@aopslabs/aops-server 0.2.18 → 0.2.20
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/THIRD_PARTY_NOTICES +38 -222
- package/THIRD_PARTY_NOTICES.inventory.json +55 -129
- package/build/client/_app/immutable/chunks/DonIqigD.js +1 -0
- package/build/client/_app/immutable/entry/{app.DE1eK-IO.js → app.C6Lg33Kk.js} +2 -2
- package/build/client/_app/immutable/entry/start.BNV-4lWe.js +1 -0
- package/build/client/_app/immutable/nodes/{1.DF4e4l4l.js → 1.vnXZ9nfR.js} +1 -1
- package/build/client/_app/version.json +1 -1
- package/build/handler.js +4 -4
- package/build/index.js +4 -4
- package/build/server/chunks/chunks/agent-gateway-runtime.js-r4g4yskN.js +924 -0
- package/build/server/chunks/chunks/{aops-runtime-config.js-CHpDUCdE.js → aops-runtime-config.js-Cjj5F0t8.js} +6 -0
- package/build/server/chunks/chunks/{discovery.js-CZjXJ_ZV.js → discovery.js-DxJiP5Ke.js} +2 -2
- package/build/server/chunks/chunks/domain-dispatch.js-DUR9TD3Q.js +83 -0
- package/build/server/chunks/chunks/{internal.js-Cex9xk6X.js → internal.js-D6CldYYG.js} +1 -1
- package/build/server/chunks/chunks/{plugin-error-normalize.js-DNeRsopQ.js → plugin-error-normalize.js-D5rNpava.js} +12 -1
- package/build/server/chunks/chunks/project-delete-preview.js-EPMmUQYW.js +64 -0
- package/build/server/chunks/chunks/{registry.js-DdOAgkkf.js → registry.js-W6rrS4yl.js} +1 -1
- package/build/server/chunks/chunks/{request-context.js-Y9Hk40z6.js → request-context.js-C7pKg6Do.js} +24 -2
- package/build/server/chunks/entries/endpoints/api/_domain_/_...path_/{_server.ts.js-DL2_Wh9Q.js → _server.ts.js-CrmOjNdW.js} +8 -9
- package/build/server/chunks/entries/endpoints/api/agent/discovery.json/{_server.ts.js-ILAncxy4.js → _server.ts.js-C_Bpk024.js} +5 -8
- package/build/server/chunks/entries/endpoints/api/agent/openapi.json/{_server.ts.js-Coo1MB-m.js → _server.ts.js-D_7ZwZLj.js} +4 -7
- package/build/server/chunks/entries/endpoints/api/agent/tools/{_server.ts.js-B99CDA4V.js → _server.ts.js-DsVOzB_s.js} +6 -9
- package/build/server/chunks/entries/endpoints/api/agent/tools/_toolId_/{_server.ts.js-Vdxe7_8Z.js → _server.ts.js-BhSRTRGX.js} +5 -8
- package/build/server/chunks/entries/endpoints/api/agent/tools/_toolId_/invoke/{_server.ts.js-D2N4Kt49.js → _server.ts.js-W45uKRo3.js} +6 -9
- package/build/server/chunks/entries/endpoints/api/aops/docman/flows/{_server.ts.js-97nMAeIY.js → _server.ts.js-B7NK3_ce.js} +2 -3
- package/build/server/chunks/entries/endpoints/api/aops/projectman/flows/{_server.ts.js-Cn1_Y84Z.js → _server.ts.js-QCAvkMnA.js} +2 -3
- package/build/server/chunks/entries/endpoints/api/aops/projects/_scopeId_/delete/_server.ts.js-2JTUKA0R.js +168 -0
- package/build/server/chunks/entries/endpoints/api/aops/projects/_scopeId_/delete-preview/_server.ts.js-6TwPYzNx.js +47 -0
- package/build/server/chunks/entries/endpoints/api/aops/settings/database/status/{_server.ts.js-DEHnxQc6.js → _server.ts.js-CysjqstH.js} +1 -1
- package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-BfazPOwp.js → _server.ts.js-BubTRJg_.js} +1 -1
- package/build/server/chunks/entries/endpoints/api/host-admin/plugins/{_server.ts.js-A9smz4KX.js → _server.ts.js-d549xH5s.js} +5 -8
- package/build/server/chunks/entries/endpoints/api/host-admin/runtime-config/{_server.ts.js-D8HIQFf4.js → _server.ts.js-Dj0PpCx9.js} +1 -1
- package/build/server/chunks/entries/endpoints/api/host-admin/runtime-config/test/{_server.ts.js-BHCFCWYZ.js → _server.ts.js-BmKesVSC.js} +1 -1
- package/build/server/chunks/entries/endpoints/api-info.json/{_server.ts.js-Cd-liJ6G.js → _server.ts.js-BlQ6o52L.js} +5 -8
- package/build/server/chunks/entries/endpoints/health/{_server.ts.js-D_H6vT6P.js → _server.ts.js-Dmp-dGYM.js} +2 -2
- package/build/server/chunks/entries/endpoints/openapi.json/{_server.ts.js-FJKIQip2.js → _server.ts.js-Bpzb9jLa.js} +4 -7
- package/build/server/chunks/{handler-7xD8haQQ.js → handler-JlcqpcVV.js} +2 -2
- package/build/server/chunks/{index.js-oJov90e3.js → index.js-BD5LJ7db.js} +1 -1
- package/build/server/chunks/{manifest.js-JcTVvkpO.js → manifest.js-N6antb1f.js} +32 -18
- package/build/server/chunks/nodes/{1.js-C_yxDx3r.js → 1.js-DCfqyX-a.js} +1 -1
- package/cockpit/.vite/manifest.json +2 -2
- package/cockpit/assets/{index-BSNHteK1.css → index-CNsNqqZP.css} +1 -1
- package/cockpit/assets/index-DuUFC3yd.js +17 -0
- package/cockpit/community.module-inventory.json +231 -191
- package/cockpit/index.html +2 -2
- package/migrations/agentspace/0001_vengeful_firestar.sql +4 -0
- package/migrations/agentspace/meta/_journal.json +7 -0
- package/migrations/projectman/0006_optional_sprint_task.sql +1 -0
- package/migrations/projectman/0007_board_column_delete_restrict.sql +15 -0
- package/migrations/projectman/meta/_journal.json +14 -0
- package/npm-shrinkwrap.json +86 -128
- package/package.json +20 -17
- package/runtime/agentspace-tooling.mjs +3 -10
- package/runtime-closure.package.json +33 -34
- package/scripts/community-migration-policy-package-v1.json +58 -216
- package/build/client/_app/immutable/chunks/Duy8DcbU.js +0 -1
- package/build/client/_app/immutable/entry/start.s0P-l96K.js +0 -1
- package/build/server/chunks/chunks/agent-gateway-runtime.js-De6jvAjX.js +0 -2642
- package/build/server/chunks/chunks/project-alias.js-BdnRxWft.js +0 -28
- package/cockpit/assets/index-BUaKAOXP.js +0 -18
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const u of d.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();function wk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ip={exports:{}},Xi={};var ey;function Nk(){if(ey)return Xi;ey=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(i,o,d){var u=null;if(d!==void 0&&(u=""+d),o.key!==void 0&&(u=""+o.key),"key"in o){d={};for(var v in o)v!=="key"&&(d[v]=o[v])}else d=o;return o=d.ref,{$$typeof:e,type:i,key:u,ref:o!==void 0?o:null,props:d}}return Xi.Fragment=n,Xi.jsx=r,Xi.jsxs=r,Xi}var ty;function Ik(){return ty||(ty=1,ip.exports=Nk()),ip.exports}var a=Ik(),lp={exports:{}},qe={};var ay;function Ek(){if(ay)return qe;ay=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),j=Symbol.iterator;function C(O){return O===null||typeof O!="object"?null:(O=j&&O[j]||O["@@iterator"],typeof O=="function"?O:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,S={};function T(O,_,K){this.props=O,this.context=_,this.refs=S,this.updater=K||k}T.prototype.isReactComponent={},T.prototype.setState=function(O,_){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,_,"setState")},T.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function I(){}I.prototype=T.prototype;function E(O,_,K){this.props=O,this.context=_,this.refs=S,this.updater=K||k}var L=E.prototype=new I;L.constructor=E,x(L,T.prototype),L.isPureReactComponent=!0;var P=Array.isArray;function N(){}var R={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function ne(O,_,K){var ee=K.ref;return{$$typeof:e,type:O,key:_,ref:ee!==void 0?ee:null,props:K}}function ye(O,_){return ne(O.type,_,O.props)}function J(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function re(O){var _={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(K){return _[K]})}var oe=/\/+/g;function fe(O,_){return typeof O=="object"&&O!==null&&O.key!=null?re(""+O.key):_.toString(36)}function de(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(N,N):(O.status="pending",O.then(function(_){O.status==="pending"&&(O.status="fulfilled",O.value=_)},function(_){O.status==="pending"&&(O.status="rejected",O.reason=_)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function G(O,_,K,ee,ve){var se=typeof O;(se==="undefined"||se==="boolean")&&(O=null);var Z=!1;if(O===null)Z=!0;else switch(se){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(O.$$typeof){case e:case n:Z=!0;break;case g:return Z=O._init,G(Z(O._payload),_,K,ee,ve)}}if(Z)return ve=ve(O),Z=ee===""?"."+fe(O,0):ee,P(ve)?(K="",Z!=null&&(K=Z.replace(oe,"$&/")+"/"),G(ve,_,K,"",function(w){return w})):ve!=null&&(J(ve)&&(ve=ye(ve,K+(ve.key==null||O&&O.key===ve.key?"":(""+ve.key).replace(oe,"$&/")+"/")+Z)),_.push(ve)),1;Z=0;var ae=ee===""?".":ee+":";if(P(O))for(var ce=0;ce<O.length;ce++)ee=O[ce],se=ae+fe(ee,ce),Z+=G(ee,_,K,se,ve);else if(ce=C(O),typeof ce=="function")for(O=ce.call(O),ce=0;!(ee=O.next()).done;)ee=ee.value,se=ae+fe(ee,ce++),Z+=G(ee,_,K,se,ve);else if(se==="object"){if(typeof O.then=="function")return G(de(O),_,K,ee,ve);throw _=String(O),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return Z}function Q(O,_,K){if(O==null)return O;var ee=[],ve=0;return G(O,ee,"","",function(se){return _.call(K,se,ve++)}),ee}function W(O){if(O._status===-1){var _=O._result;_=_(),_.then(function(K){(O._status===0||O._status===-1)&&(O._status=1,O._result=K)},function(K){(O._status===0||O._status===-1)&&(O._status=2,O._result=K)}),O._status===-1&&(O._status=0,O._result=_)}if(O._status===1)return O._result.default;throw O._result}var pe=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},ke={map:Q,forEach:function(O,_,K){Q(O,function(){_.apply(this,arguments)},K)},count:function(O){var _=0;return Q(O,function(){_++}),_},toArray:function(O){return Q(O,function(_){return _})||[]},only:function(O){if(!J(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return qe.Activity=b,qe.Children=ke,qe.Component=T,qe.Fragment=r,qe.Profiler=o,qe.PureComponent=E,qe.StrictMode=i,qe.Suspense=h,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,qe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return R.H.useMemoCache(O)}},qe.cache=function(O){return function(){return O.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(O,_,K){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ee=x({},O.props),ve=O.key;if(_!=null)for(se in _.key!==void 0&&(ve=""+_.key),_)!z.call(_,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&_.ref===void 0||(ee[se]=_[se]);var se=arguments.length-2;if(se===1)ee.children=K;else if(1<se){for(var Z=Array(se),ae=0;ae<se;ae++)Z[ae]=arguments[ae+2];ee.children=Z}return ne(O.type,ve,ee)},qe.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:d,_context:O},O},qe.createElement=function(O,_,K){var ee,ve={},se=null;if(_!=null)for(ee in _.key!==void 0&&(se=""+_.key),_)z.call(_,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ve[ee]=_[ee]);var Z=arguments.length-2;if(Z===1)ve.children=K;else if(1<Z){for(var ae=Array(Z),ce=0;ce<Z;ce++)ae[ce]=arguments[ce+2];ve.children=ae}if(O&&O.defaultProps)for(ee in Z=O.defaultProps,Z)ve[ee]===void 0&&(ve[ee]=Z[ee]);return ne(O,se,ve)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(O){return{$$typeof:v,render:O}},qe.isValidElement=J,qe.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:W}},qe.memo=function(O,_){return{$$typeof:m,type:O,compare:_===void 0?null:_}},qe.startTransition=function(O){var _=R.T,K={};R.T=K;try{var ee=O(),ve=R.S;ve!==null&&ve(K,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(N,pe)}catch(se){pe(se)}finally{_!==null&&K.types!==null&&(_.types=K.types),R.T=_}},qe.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},qe.use=function(O){return R.H.use(O)},qe.useActionState=function(O,_,K){return R.H.useActionState(O,_,K)},qe.useCallback=function(O,_){return R.H.useCallback(O,_)},qe.useContext=function(O){return R.H.useContext(O)},qe.useDebugValue=function(){},qe.useDeferredValue=function(O,_){return R.H.useDeferredValue(O,_)},qe.useEffect=function(O,_){return R.H.useEffect(O,_)},qe.useEffectEvent=function(O){return R.H.useEffectEvent(O)},qe.useId=function(){return R.H.useId()},qe.useImperativeHandle=function(O,_,K){return R.H.useImperativeHandle(O,_,K)},qe.useInsertionEffect=function(O,_){return R.H.useInsertionEffect(O,_)},qe.useLayoutEffect=function(O,_){return R.H.useLayoutEffect(O,_)},qe.useMemo=function(O,_){return R.H.useMemo(O,_)},qe.useOptimistic=function(O,_){return R.H.useOptimistic(O,_)},qe.useReducer=function(O,_,K){return R.H.useReducer(O,_,K)},qe.useRef=function(O){return R.H.useRef(O)},qe.useState=function(O){return R.H.useState(O)},qe.useSyncExternalStore=function(O,_,K){return R.H.useSyncExternalStore(O,_,K)},qe.useTransition=function(){return R.H.useTransition()},qe.version="19.2.4",qe}var ny;function bh(){return ny||(ny=1,lp.exports=Ek()),lp.exports}var y=bh();const qo=wk(y);var op={exports:{}},Wi={},cp={exports:{}},dp={};var sy;function Mk(){return sy||(sy=1,(function(e){function n(G,Q){var W=G.length;G.push(Q);e:for(;0<W;){var pe=W-1>>>1,ke=G[pe];if(0<o(ke,Q))G[pe]=Q,G[W]=ke,W=pe;else break e}}function r(G){return G.length===0?null:G[0]}function i(G){if(G.length===0)return null;var Q=G[0],W=G.pop();if(W!==Q){G[0]=W;e:for(var pe=0,ke=G.length,O=ke>>>1;pe<O;){var _=2*(pe+1)-1,K=G[_],ee=_+1,ve=G[ee];if(0>o(K,W))ee<ke&&0>o(ve,K)?(G[pe]=ve,G[ee]=W,pe=ee):(G[pe]=K,G[_]=W,pe=_);else if(ee<ke&&0>o(ve,W))G[pe]=ve,G[ee]=W,pe=ee;else break e}}return Q}function o(G,Q){var W=G.sortIndex-Q.sortIndex;return W!==0?W:G.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;e.unstable_now=function(){return d.now()}}else{var u=Date,v=u.now();e.unstable_now=function(){return u.now()-v}}var h=[],m=[],g=1,b=null,j=3,C=!1,k=!1,x=!1,S=!1,T=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function L(G){for(var Q=r(m);Q!==null;){if(Q.callback===null)i(m);else if(Q.startTime<=G)i(m),Q.sortIndex=Q.expirationTime,n(h,Q);else break;Q=r(m)}}function P(G){if(x=!1,L(G),!k)if(r(h)!==null)k=!0,N||(N=!0,re());else{var Q=r(m);Q!==null&&de(P,Q.startTime-G)}}var N=!1,R=-1,z=5,ne=-1;function ye(){return S?!0:!(e.unstable_now()-ne<z)}function J(){if(S=!1,N){var G=e.unstable_now();ne=G;var Q=!0;try{e:{k=!1,x&&(x=!1,I(R),R=-1),C=!0;var W=j;try{t:{for(L(G),b=r(h);b!==null&&!(b.expirationTime>G&&ye());){var pe=b.callback;if(typeof pe=="function"){b.callback=null,j=b.priorityLevel;var ke=pe(b.expirationTime<=G);if(G=e.unstable_now(),typeof ke=="function"){b.callback=ke,L(G),Q=!0;break t}b===r(h)&&i(h),L(G)}else i(h);b=r(h)}if(b!==null)Q=!0;else{var O=r(m);O!==null&&de(P,O.startTime-G),Q=!1}}break e}finally{b=null,j=W,C=!1}Q=void 0}}finally{Q?re():N=!1}}}var re;if(typeof E=="function")re=function(){E(J)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,fe=oe.port2;oe.port1.onmessage=J,re=function(){fe.postMessage(null)}}else re=function(){T(J,0)};function de(G,Q){R=T(function(){G(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(G){switch(j){case 1:case 2:case 3:var Q=3;break;default:Q=j}var W=j;j=Q;try{return G()}finally{j=W}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(G,Q){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var W=j;j=G;try{return Q()}finally{j=W}},e.unstable_scheduleCallback=function(G,Q,W){var pe=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?pe+W:pe):W=pe,G){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=W+ke,G={id:g++,callback:Q,priorityLevel:G,startTime:W,expirationTime:ke,sortIndex:-1},W>pe?(G.sortIndex=W,n(m,G),r(h)===null&&G===r(m)&&(x?(I(R),R=-1):x=!0,de(P,W-pe))):(G.sortIndex=ke,n(h,G),k||C||(k=!0,N||(N=!0,re()))),G},e.unstable_shouldYield=ye,e.unstable_wrapCallback=function(G){var Q=j;return function(){var W=j;j=Q;try{return G.apply(this,arguments)}finally{j=W}}}})(dp)),dp}var ry;function Tk(){return ry||(ry=1,cp.exports=Mk()),cp.exports}var up={exports:{}},ra={};var iy;function Bk(){if(iy)return ra;iy=1;var e=bh();function n(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(h,m,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:h,containerInfo:m,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return ra.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,ra.createPortal=function(h,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(n(299));return d(h,m,null,g)},ra.flushSync=function(h){var m=u.T,g=i.p;try{if(u.T=null,i.p=2,h)return h()}finally{u.T=m,i.p=g,i.d.f()}},ra.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,i.d.C(h,m))},ra.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},ra.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,b=v(g,m.crossOrigin),j=typeof m.integrity=="string"?m.integrity:void 0,C=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?i.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:b,integrity:j,fetchPriority:C}):g==="script"&&i.d.X(h,{crossOrigin:b,integrity:j,fetchPriority:C,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},ra.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=v(m.as,m.crossOrigin);i.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&i.d.M(h)},ra.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,b=v(g,m.crossOrigin);i.d.L(h,g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},ra.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=v(m.as,m.crossOrigin);i.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else i.d.m(h)},ra.requestFormReset=function(h){i.d.r(h)},ra.unstable_batchedUpdates=function(h,m){return h(m)},ra.useFormState=function(h,m,g){return u.H.useFormState(h,m,g)},ra.useFormStatus=function(){return u.H.useHostTransitionStatus()},ra.version="19.2.4",ra}var ly;function Lb(){if(ly)return up.exports;ly=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),up.exports=Bk(),up.exports}var oy;function Dk(){if(oy)return Wi;oy=1;var e=Tk(),n=bh(),r=Lb();function i(t){var s="https://react.dev/errors/"+t;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)s+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){var s=t,l=t;if(t.alternate)for(;s.return;)s=s.return;else{t=s;do s=t,(s.flags&4098)!==0&&(l=s.return),t=s.return;while(t)}return s.tag===3?l:null}function u(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function v(t){if(t.tag===31){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function h(t){if(d(t)!==t)throw Error(i(188))}function m(t){var s=t.alternate;if(!s){if(s=d(t),s===null)throw Error(i(188));return s!==t?null:t}for(var l=t,c=s;;){var p=l.return;if(p===null)break;var f=p.alternate;if(f===null){if(c=p.return,c!==null){l=c;continue}break}if(p.child===f.child){for(f=p.child;f;){if(f===l)return h(p),t;if(f===c)return h(p),s;f=f.sibling}throw Error(i(188))}if(l.return!==c.return)l=p,c=f;else{for(var A=!1,M=p.child;M;){if(M===l){A=!0,l=p,c=f;break}if(M===c){A=!0,c=p,l=f;break}M=M.sibling}if(!A){for(M=f.child;M;){if(M===l){A=!0,l=f,c=p;break}if(M===c){A=!0,c=f,l=p;break}M=M.sibling}if(!A)throw Error(i(189))}}if(l.alternate!==c)throw Error(i(190))}if(l.tag!==3)throw Error(i(188));return l.stateNode.current===l?t:s}function g(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=g(t),s!==null)return s;t=t.sibling}return null}var b=Object.assign,j=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),E=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),ye=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function re(t){return t===null||typeof t!="object"?null:(t=J&&t[J]||t["@@iterator"],typeof t=="function"?t:null)}var oe=Symbol.for("react.client.reference");function fe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case x:return"Fragment";case T:return"Profiler";case S:return"StrictMode";case P:return"Suspense";case N:return"SuspenseList";case ne:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case E:return t.displayName||"Context";case I:return(t._context.displayName||"Context")+".Consumer";case L:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case R:return s=t.displayName||null,s!==null?s:fe(t.type)||"Memo";case z:s=t._payload,t=t._init;try{return fe(t(s))}catch{}}return null}var de=Array.isArray,G=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},pe=[],ke=-1;function O(t){return{current:t}}function _(t){0>ke||(t.current=pe[ke],pe[ke]=null,ke--)}function K(t,s){ke++,pe[ke]=t.current,t.current=s}var ee=O(null),ve=O(null),se=O(null),Z=O(null);function ae(t,s){switch(K(se,s),K(ve,t),K(ee,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?Cg(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=Cg(s),t=kg(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}_(ee),K(ee,t)}function ce(){_(ee),_(ve),_(se)}function w(t){t.memoizedState!==null&&K(Z,t);var s=ee.current,l=kg(s,t.type);s!==l&&(K(ve,t),K(ee,l))}function F(t){ve.current===t&&(_(ee),_(ve)),Z.current===t&&(_(Z),qi._currentValue=W)}var X,D;function B(t){if(X===void 0)try{throw Error()}catch(l){var s=l.stack.trim().match(/\n( *(at )?)/);X=s&&s[1]||"",D=-1<l.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+X+t+D}var U=!1;function H(t,s){if(!t||U)return"";U=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(me){var ue=me}Reflect.construct(t,[],Ce)}else{try{Ce.call()}catch(me){ue=me}t.call(Ce.prototype)}}else{try{throw Error()}catch(me){ue=me}(Ce=t())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(me){if(me&&ue&&typeof me.stack=="string")return[me.stack,ue.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=c.DetermineComponentFrameRoot(),A=f[0],M=f[1];if(A&&M){var $=A.split(`
|
|
4
|
+
`),le=M.split(`
|
|
5
|
+
`);for(p=c=0;c<$.length&&!$[c].includes("DetermineComponentFrameRoot");)c++;for(;p<le.length&&!le[p].includes("DetermineComponentFrameRoot");)p++;if(c===$.length||p===le.length)for(c=$.length-1,p=le.length-1;1<=c&&0<=p&&$[c]!==le[p];)p--;for(;1<=c&&0<=p;c--,p--)if($[c]!==le[p]){if(c!==1||p!==1)do if(c--,p--,0>p||$[c]!==le[p]){var je=`
|
|
6
|
+
`+$[c].replace(" at new "," at ");return t.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",t.displayName)),je}while(1<=c&&0<=p);break}}}finally{U=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?B(l):""}function q(t,s){switch(t.tag){case 26:case 27:case 5:return B(t.type);case 16:return B("Lazy");case 13:return t.child!==s&&s!==null?B("Suspense Fallback"):B("Suspense");case 19:return B("SuspenseList");case 0:case 15:return H(t.type,!1);case 11:return H(t.type.render,!1);case 1:return H(t.type,!0);case 31:return B("Activity");default:return""}}function V(t){try{var s="",l=null;do s+=q(t,l),l=t,t=t.return;while(t);return s}catch(c){return`
|
|
7
|
+
Error generating stack: `+c.message+`
|
|
8
|
+
`+c.stack}}var be=Object.prototype.hasOwnProperty,ge=e.unstable_scheduleCallback,Se=e.unstable_cancelCallback,Ne=e.unstable_shouldYield,we=e.unstable_requestPaint,Be=e.unstable_now,Je=e.unstable_getCurrentPriorityLevel,Ke=e.unstable_ImmediatePriority,Xe=e.unstable_UserBlockingPriority,Et=e.unstable_NormalPriority,vt=e.unstable_LowPriority,Ee=e.unstable_IdlePriority,Le=e.log,xe=e.unstable_setDisableYieldValue,Te=null,Me=null;function Fe(t){if(typeof Le=="function"&&xe(t),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(Te,t)}catch{}}var ze=Math.clz32?Math.clz32:Ct,Mt=Math.log,ca=Math.LN2;function Ct(t){return t>>>=0,t===0?32:31-(Mt(t)/ca|0)|0}var ut=256,Jt=262144,_t=4194304;function he(t){var s=t&42;if(s!==0)return s;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function De(t,s,l){var c=t.pendingLanes;if(c===0)return 0;var p=0,f=t.suspendedLanes,A=t.pingedLanes;t=t.warmLanes;var M=c&134217727;return M!==0?(c=M&~f,c!==0?p=he(c):(A&=M,A!==0?p=he(A):l||(l=M&~t,l!==0&&(p=he(l))))):(M=c&~f,M!==0?p=he(M):A!==0?p=he(A):l||(l=c&~t,l!==0&&(p=he(l)))),p===0?0:s!==0&&s!==p&&(s&f)===0&&(f=p&-p,l=s&-s,f>=l||f===32&&(l&4194048)!==0)?s:p}function Qe(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function He(t,s){switch(t){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 jt(){var t=_t;return _t<<=1,(_t&62914560)===0&&(_t=4194304),t}function Ie(t){for(var s=[],l=0;31>l;l++)s.push(t);return s}function rt(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function sa(t,s,l,c,p,f){var A=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var M=t.entanglements,$=t.expirationTimes,le=t.hiddenUpdates;for(l=A&~l;0<l;){var je=31-ze(l),Ce=1<<je;M[je]=0,$[je]=-1;var ue=le[je];if(ue!==null)for(le[je]=null,je=0;je<ue.length;je++){var me=ue[je];me!==null&&(me.lane&=-536870913)}l&=~Ce}c!==0&&Rt(t,c,0),f!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=f&~(A&~s))}function Rt(t,s,l){t.pendingLanes|=s,t.suspendedLanes&=~s;var c=31-ze(s);t.entangledLanes|=s,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function Aa(t,s){var l=t.entangledLanes|=s;for(t=t.entanglements;l;){var c=31-ze(l),p=1<<c;p&s|t[c]&s&&(t[c]|=s),l&=~p}}function As(t,s){var l=s&-s;return l=(l&42)!==0?1:Yc(l),(l&(t.suspendedLanes|s))!==0?0:l}function Yc(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Jc(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function lm(){var t=Q.p;return t!==0?t:(t=window.event,t===void 0?32:qg(t.type))}function om(t,s){var l=Q.p;try{return Q.p=t,s()}finally{Q.p=l}}var Fn=Math.random().toString(36).slice(2),Xt="__reactFiber$"+Fn,da="__reactProps$"+Fn,er="__reactContainer$"+Fn,Xc="__reactEvents$"+Fn,fx="__reactListeners$"+Fn,vx="__reactHandles$"+Fn,cm="__reactResources$"+Fn,oi="__reactMarker$"+Fn;function Wc(t){delete t[Xt],delete t[da],delete t[Xc],delete t[fx],delete t[vx]}function tr(t){var s=t[Xt];if(s)return s;for(var l=t.parentNode;l;){if(s=l[er]||l[Xt]){if(l=s.alternate,s.child!==null||l!==null&&l.child!==null)for(t=Tg(t);t!==null;){if(l=t[Xt])return l;t=Tg(t)}return s}t=l,l=t.parentNode}return null}function ar(t){if(t=t[Xt]||t[er]){var s=t.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return t}return null}function ci(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(i(33))}function nr(t){var s=t[cm];return s||(s=t[cm]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Gt(t){t[oi]=!0}var dm=new Set,um={};function xs(t,s){sr(t,s),sr(t+"Capture",s)}function sr(t,s){for(um[t]=s,t=0;t<s.length;t++)dm.add(s[t])}var gx=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]*$"),pm={},hm={};function yx(t){return be.call(hm,t)?!0:be.call(pm,t)?!1:gx.test(t)?hm[t]=!0:(pm[t]=!0,!1)}function Rl(t,s,l){if(yx(s))if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(s);return}}t.setAttribute(s,""+l)}}function Ll(t,s,l){if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttribute(s,""+l)}}function vn(t,s,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(s,l,""+c)}}function Ta(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function mm(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function bx(t,s,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,s);if(!t.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,f=c.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return p.call(this)},set:function(A){l=""+A,f.call(this,A)}}),Object.defineProperty(t,s,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(A){l=""+A},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function Zc(t){if(!t._valueTracker){var s=mm(t)?"checked":"value";t._valueTracker=bx(t,s,""+t[s])}}function fm(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var l=s.getValue(),c="";return t&&(c=mm(t)?t.checked?"true":"false":t.value),t=c,t!==l?(s.setValue(t),!0):!1}function Ol(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var jx=/[\n"\\]/g;function Ba(t){return t.replace(jx,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function ed(t,s,l,c,p,f,A,M){t.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?t.type=A:t.removeAttribute("type"),s!=null?A==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+Ta(s)):t.value!==""+Ta(s)&&(t.value=""+Ta(s)):A!=="submit"&&A!=="reset"||t.removeAttribute("value"),s!=null?td(t,A,Ta(s)):l!=null?td(t,A,Ta(l)):c!=null&&t.removeAttribute("value"),p==null&&f!=null&&(t.defaultChecked=!!f),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+Ta(M):t.removeAttribute("name")}function vm(t,s,l,c,p,f,A,M){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.type=f),s!=null||l!=null){if(!(f!=="submit"&&f!=="reset"||s!=null)){Zc(t);return}l=l!=null?""+Ta(l):"",s=s!=null?""+Ta(s):l,M||s===t.value||(t.value=s),t.defaultValue=s}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=M?t.checked:!!c,t.defaultChecked=!!c,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(t.name=A),Zc(t)}function td(t,s,l){s==="number"&&Ol(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function rr(t,s,l,c){if(t=t.options,s){s={};for(var p=0;p<l.length;p++)s["$"+l[p]]=!0;for(l=0;l<t.length;l++)p=s.hasOwnProperty("$"+t[l].value),t[l].selected!==p&&(t[l].selected=p),p&&c&&(t[l].defaultSelected=!0)}else{for(l=""+Ta(l),s=null,p=0;p<t.length;p++){if(t[p].value===l){t[p].selected=!0,c&&(t[p].defaultSelected=!0);return}s!==null||t[p].disabled||(s=t[p])}s!==null&&(s.selected=!0)}}function gm(t,s,l){if(s!=null&&(s=""+Ta(s),s!==t.value&&(t.value=s),l==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=l!=null?""+Ta(l):""}function ym(t,s,l,c){if(s==null){if(c!=null){if(l!=null)throw Error(i(92));if(de(c)){if(1<c.length)throw Error(i(93));c=c[0]}l=c}l==null&&(l=""),s=l}l=Ta(s),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),Zc(t)}function ir(t,s){if(s){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=s;return}}t.textContent=s}var Ax=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 bm(t,s,l){var c=s.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="":c?t.setProperty(s,l):typeof l!="number"||l===0||Ax.has(s)?s==="float"?t.cssFloat=l:t[s]=(""+l).trim():t[s]=l+"px"}function jm(t,s,l){if(s!=null&&typeof s!="object")throw Error(i(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var p in s)c=s[p],s.hasOwnProperty(p)&&l[p]!==c&&bm(t,p,c)}else for(var f in s)s.hasOwnProperty(f)&&bm(t,f,s[f])}function ad(t){if(t.indexOf("-")===-1)return!1;switch(t){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 xx=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"]]),Cx=/^[\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 _l(t){return Cx.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function gn(){}var nd=null;function sd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var lr=null,or=null;function Am(t){var s=ar(t);if(s&&(t=s.stateNode)){var l=t[da]||null;e:switch(t=s.stateNode,s.type){case"input":if(ed(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),s=l.name,l.type==="radio"&&s!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ba(""+s)+'"][type="radio"]'),s=0;s<l.length;s++){var c=l[s];if(c!==t&&c.form===t.form){var p=c[da]||null;if(!p)throw Error(i(90));ed(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<l.length;s++)c=l[s],c.form===t.form&&fm(c)}break e;case"textarea":gm(t,l.value,l.defaultValue);break e;case"select":s=l.value,s!=null&&rr(t,!!l.multiple,s,!1)}}}var rd=!1;function xm(t,s,l){if(rd)return t(s,l);rd=!0;try{var c=t(s);return c}finally{if(rd=!1,(lr!==null||or!==null)&&(So(),lr&&(s=lr,t=or,or=lr=null,Am(s),t)))for(s=0;s<t.length;s++)Am(t[s])}}function di(t,s){var l=t.stateNode;if(l===null)return null;var c=l[da]||null;if(c===null)return null;l=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(i(231,s,typeof l));return l}var yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),id=!1;if(yn)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){id=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{id=!1}var Kn=null,ld=null,Ql=null;function Cm(){if(Ql)return Ql;var t,s=ld,l=s.length,c,p="value"in Kn?Kn.value:Kn.textContent,f=p.length;for(t=0;t<l&&s[t]===p[t];t++);var A=l-t;for(c=1;c<=A&&s[l-c]===p[f-c];c++);return Ql=p.slice(t,1<c?1-c:void 0)}function Ul(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function Pl(){return!0}function km(){return!1}function ua(t){function s(l,c,p,f,A){this._reactName=l,this._targetInst=p,this.type=c,this.nativeEvent=f,this.target=A,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(l=t[M],this[M]=l?l(f):f[M]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Pl:km,this.isPropagationStopped=km,this}return b(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Pl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Pl)},persist:function(){},isPersistent:Pl}),s}var Cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fl=ua(Cs),pi=b({},Cs,{view:0,detail:0}),kx=ua(pi),od,cd,hi,Kl=b({},pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ud,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==hi&&(hi&&t.type==="mousemove"?(od=t.screenX-hi.screenX,cd=t.screenY-hi.screenY):cd=od=0,hi=t),od)},movementY:function(t){return"movementY"in t?t.movementY:cd}}),Sm=ua(Kl),Sx=b({},Kl,{dataTransfer:0}),wx=ua(Sx),Nx=b({},pi,{relatedTarget:0}),dd=ua(Nx),Ix=b({},Cs,{animationName:0,elapsedTime:0,pseudoElement:0}),Ex=ua(Ix),Mx=b({},Cs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Tx=ua(Mx),Bx=b({},Cs,{data:0}),wm=ua(Bx),Dx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Rx={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"},Lx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ox(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=Lx[t])?!!s[t]:!1}function ud(){return Ox}var _x=b({},pi,{key:function(t){if(t.key){var s=Dx[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=Ul(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Rx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ud,charCode:function(t){return t.type==="keypress"?Ul(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ul(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Qx=ua(_x),Ux=b({},Kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nm=ua(Ux),Px=b({},pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ud}),Fx=ua(Px),Kx=b({},Cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),zx=ua(Kx),$x=b({},Kl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Hx=ua($x),Gx=b({},Cs,{newState:0,oldState:0}),qx=ua(Gx),Vx=[9,13,27,32],pd=yn&&"CompositionEvent"in window,mi=null;yn&&"documentMode"in document&&(mi=document.documentMode);var Yx=yn&&"TextEvent"in window&&!mi,Im=yn&&(!pd||mi&&8<mi&&11>=mi),Em=" ",Mm=!1;function Tm(t,s){switch(t){case"keyup":return Vx.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cr=!1;function Jx(t,s){switch(t){case"compositionend":return Bm(s);case"keypress":return s.which!==32?null:(Mm=!0,Em);case"textInput":return t=s.data,t===Em&&Mm?null:t;default:return null}}function Xx(t,s){if(cr)return t==="compositionend"||!pd&&Tm(t,s)?(t=Cm(),Ql=ld=Kn=null,cr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Im&&s.locale!=="ko"?null:s.data;default:return null}}var Wx={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 Dm(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!Wx[t.type]:s==="textarea"}function Rm(t,s,l,c){lr?or?or.push(c):or=[c]:lr=c,s=Bo(s,"onChange"),0<s.length&&(l=new Fl("onChange","change",null,l,c),t.push({event:l,listeners:s}))}var fi=null,vi=null;function Zx(t){gg(t,0)}function zl(t){var s=ci(t);if(fm(s))return t}function Lm(t,s){if(t==="change")return s}var Om=!1;if(yn){var hd;if(yn){var md="oninput"in document;if(!md){var _m=document.createElement("div");_m.setAttribute("oninput","return;"),md=typeof _m.oninput=="function"}hd=md}else hd=!1;Om=hd&&(!document.documentMode||9<document.documentMode)}function Qm(){fi&&(fi.detachEvent("onpropertychange",Um),vi=fi=null)}function Um(t){if(t.propertyName==="value"&&zl(vi)){var s=[];Rm(s,vi,t,sd(t)),xm(Zx,s)}}function eC(t,s,l){t==="focusin"?(Qm(),fi=s,vi=l,fi.attachEvent("onpropertychange",Um)):t==="focusout"&&Qm()}function tC(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return zl(vi)}function aC(t,s){if(t==="click")return zl(s)}function nC(t,s){if(t==="input"||t==="change")return zl(s)}function sC(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var xa=typeof Object.is=="function"?Object.is:sC;function gi(t,s){if(xa(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var l=Object.keys(t),c=Object.keys(s);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var p=l[c];if(!be.call(s,p)||!xa(t[p],s[p]))return!1}return!0}function Pm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Fm(t,s){var l=Pm(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=s&&c>=s)return{node:l,offset:s-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Pm(l)}}function Km(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Km(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function zm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=Ol(t.document);s instanceof t.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)t=s.contentWindow;else break;s=Ol(t.document)}return s}function fd(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}var rC=yn&&"documentMode"in document&&11>=document.documentMode,dr=null,vd=null,yi=null,gd=!1;function $m(t,s,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;gd||dr==null||dr!==Ol(c)||(c=dr,"selectionStart"in c&&fd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),yi&&gi(yi,c)||(yi=c,c=Bo(vd,"onSelect"),0<c.length&&(s=new Fl("onSelect","select",null,s,l),t.push({event:s,listeners:c}),s.target=dr)))}function ks(t,s){var l={};return l[t.toLowerCase()]=s.toLowerCase(),l["Webkit"+t]="webkit"+s,l["Moz"+t]="moz"+s,l}var ur={animationend:ks("Animation","AnimationEnd"),animationiteration:ks("Animation","AnimationIteration"),animationstart:ks("Animation","AnimationStart"),transitionrun:ks("Transition","TransitionRun"),transitionstart:ks("Transition","TransitionStart"),transitioncancel:ks("Transition","TransitionCancel"),transitionend:ks("Transition","TransitionEnd")},yd={},Hm={};yn&&(Hm=document.createElement("div").style,"AnimationEvent"in window||(delete ur.animationend.animation,delete ur.animationiteration.animation,delete ur.animationstart.animation),"TransitionEvent"in window||delete ur.transitionend.transition);function Ss(t){if(yd[t])return yd[t];if(!ur[t])return t;var s=ur[t],l;for(l in s)if(s.hasOwnProperty(l)&&l in Hm)return yd[t]=s[l];return t}var Gm=Ss("animationend"),qm=Ss("animationiteration"),Vm=Ss("animationstart"),iC=Ss("transitionrun"),lC=Ss("transitionstart"),oC=Ss("transitioncancel"),Ym=Ss("transitionend"),Jm=new Map,bd="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(" ");bd.push("scrollEnd");function Ya(t,s){Jm.set(t,s),xs(s,[t])}var $l=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Da=[],pr=0,jd=0;function Hl(){for(var t=pr,s=jd=pr=0;s<t;){var l=Da[s];Da[s++]=null;var c=Da[s];Da[s++]=null;var p=Da[s];Da[s++]=null;var f=Da[s];if(Da[s++]=null,c!==null&&p!==null){var A=c.pending;A===null?p.next=p:(p.next=A.next,A.next=p),c.pending=p}f!==0&&Xm(l,p,f)}}function Gl(t,s,l,c){Da[pr++]=t,Da[pr++]=s,Da[pr++]=l,Da[pr++]=c,jd|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Ad(t,s,l,c){return Gl(t,s,l,c),ql(t)}function ws(t,s){return Gl(t,null,null,s),ql(t)}function Xm(t,s,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var p=!1,f=t.return;f!==null;)f.childLanes|=l,c=f.alternate,c!==null&&(c.childLanes|=l),f.tag===22&&(t=f.stateNode,t===null||t._visibility&1||(p=!0)),t=f,f=f.return;return t.tag===3?(f=t.stateNode,p&&s!==null&&(p=31-ze(l),t=f.hiddenUpdates,c=t[p],c===null?t[p]=[s]:c.push(s),s.lane=l|536870912),f):null}function ql(t){if(50<Pi)throw Pi=0,Mu=null,Error(i(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var hr={};function cC(t,s,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ca(t,s,l,c){return new cC(t,s,l,c)}function xd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function bn(t,s){var l=t.alternate;return l===null?(l=Ca(t.tag,s,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=s,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,s=t.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Wm(t,s){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=s,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,s=l.dependencies,t.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),t}function Vl(t,s,l,c,p,f){var A=0;if(c=t,typeof t=="function")xd(t)&&(A=1);else if(typeof t=="string")A=mk(t,l,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ne:return t=Ca(31,l,s,p),t.elementType=ne,t.lanes=f,t;case x:return Ns(l.children,p,f,s);case S:A=8,p|=24;break;case T:return t=Ca(12,l,s,p|2),t.elementType=T,t.lanes=f,t;case P:return t=Ca(13,l,s,p),t.elementType=P,t.lanes=f,t;case N:return t=Ca(19,l,s,p),t.elementType=N,t.lanes=f,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E:A=10;break e;case I:A=9;break e;case L:A=11;break e;case R:A=14;break e;case z:A=16,c=null;break e}A=29,l=Error(i(130,t===null?"null":typeof t,"")),c=null}return s=Ca(A,l,s,p),s.elementType=t,s.type=c,s.lanes=f,s}function Ns(t,s,l,c){return t=Ca(7,t,c,s),t.lanes=l,t}function Cd(t,s,l){return t=Ca(6,t,null,s),t.lanes=l,t}function Zm(t){var s=Ca(18,null,null,0);return s.stateNode=t,s}function kd(t,s,l){return s=Ca(4,t.children!==null?t.children:[],t.key,s),s.lanes=l,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var ef=new WeakMap;function Ra(t,s){if(typeof t=="object"&&t!==null){var l=ef.get(t);return l!==void 0?l:(s={value:t,source:s,stack:V(s)},ef.set(t,s),s)}return{value:t,source:s,stack:V(s)}}var mr=[],fr=0,Yl=null,bi=0,La=[],Oa=0,zn=null,tn=1,an="";function jn(t,s){mr[fr++]=bi,mr[fr++]=Yl,Yl=t,bi=s}function tf(t,s,l){La[Oa++]=tn,La[Oa++]=an,La[Oa++]=zn,zn=t;var c=tn;t=an;var p=32-ze(c)-1;c&=~(1<<p),l+=1;var f=32-ze(s)+p;if(30<f){var A=p-p%5;f=(c&(1<<A)-1).toString(32),c>>=A,p-=A,tn=1<<32-ze(s)+p|l<<p|c,an=f+t}else tn=1<<f|l<<p|c,an=t}function Sd(t){t.return!==null&&(jn(t,1),tf(t,1,0))}function wd(t){for(;t===Yl;)Yl=mr[--fr],mr[fr]=null,bi=mr[--fr],mr[fr]=null;for(;t===zn;)zn=La[--Oa],La[Oa]=null,an=La[--Oa],La[Oa]=null,tn=La[--Oa],La[Oa]=null}function af(t,s){La[Oa++]=tn,La[Oa++]=an,La[Oa++]=zn,tn=s.id,an=s.overflow,zn=t}var Wt=null,kt=null,st=!1,$n=null,_a=!1,Nd=Error(i(519));function Hn(t){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ji(Ra(s,t)),Nd}function nf(t){var s=t.stateNode,l=t.type,c=t.memoizedProps;switch(s[Xt]=t,s[da]=c,l){case"dialog":et("cancel",s),et("close",s);break;case"iframe":case"object":case"embed":et("load",s);break;case"video":case"audio":for(l=0;l<Ki.length;l++)et(Ki[l],s);break;case"source":et("error",s);break;case"img":case"image":case"link":et("error",s),et("load",s);break;case"details":et("toggle",s);break;case"input":et("invalid",s),vm(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":et("invalid",s);break;case"textarea":et("invalid",s),ym(s,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||s.textContent===""+l||c.suppressHydrationWarning===!0||Ag(s.textContent,l)?(c.popover!=null&&(et("beforetoggle",s),et("toggle",s)),c.onScroll!=null&&et("scroll",s),c.onScrollEnd!=null&&et("scrollend",s),c.onClick!=null&&(s.onclick=gn),s=!0):s=!1,s||Hn(t,!0)}function sf(t){for(Wt=t.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:_a=!1;return;case 27:case 3:_a=!0;return;default:Wt=Wt.return}}function vr(t){if(t!==Wt)return!1;if(!st)return sf(t),st=!0,!1;var s=t.tag,l;if((l=s!==3&&s!==27)&&((l=s===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Hu(t.type,t.memoizedProps)),l=!l),l&&kt&&Hn(t),sf(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));kt=Mg(t)}else if(s===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));kt=Mg(t)}else s===27?(s=kt,rs(t.type)?(t=Ju,Ju=null,kt=t):kt=s):kt=Wt?Ua(t.stateNode.nextSibling):null;return!0}function Is(){kt=Wt=null,st=!1}function Id(){var t=$n;return t!==null&&(fa===null?fa=t:fa.push.apply(fa,t),$n=null),t}function ji(t){$n===null?$n=[t]:$n.push(t)}var Ed=O(null),Es=null,An=null;function Gn(t,s,l){K(Ed,s._currentValue),s._currentValue=l}function xn(t){t._currentValue=Ed.current,_(Ed)}function Md(t,s,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),t===l)break;t=t.return}}function Td(t,s,l,c){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var f=p.dependencies;if(f!==null){var A=p.child;f=f.firstContext;e:for(;f!==null;){var M=f;f=p;for(var $=0;$<s.length;$++)if(M.context===s[$]){f.lanes|=l,M=f.alternate,M!==null&&(M.lanes|=l),Md(f.return,l,t),c||(A=null);break e}f=M.next}}else if(p.tag===18){if(A=p.return,A===null)throw Error(i(341));A.lanes|=l,f=A.alternate,f!==null&&(f.lanes|=l),Md(A,l,t),A=null}else A=p.child;if(A!==null)A.return=p;else for(A=p;A!==null;){if(A===t){A=null;break}if(p=A.sibling,p!==null){p.return=A.return,A=p;break}A=A.return}p=A}}function gr(t,s,l,c){t=null;for(var p=s,f=!1;p!==null;){if(!f){if((p.flags&524288)!==0)f=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var A=p.alternate;if(A===null)throw Error(i(387));if(A=A.memoizedProps,A!==null){var M=p.type;xa(p.pendingProps.value,A.value)||(t!==null?t.push(M):t=[M])}}else if(p===Z.current){if(A=p.alternate,A===null)throw Error(i(387));A.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(qi):t=[qi])}p=p.return}t!==null&&Td(s,t,l,c),s.flags|=262144}function Jl(t){for(t=t.firstContext;t!==null;){if(!xa(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ms(t){Es=t,An=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Zt(t){return rf(Es,t)}function Xl(t,s){return Es===null&&Ms(t),rf(t,s)}function rf(t,s){var l=s._currentValue;if(s={context:s,memoizedValue:l,next:null},An===null){if(t===null)throw Error(i(308));An=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else An=An.next=s;return l}var dC=typeof AbortController<"u"?AbortController:function(){var t=[],s=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){s.aborted=!0,t.forEach(function(l){return l()})}},uC=e.unstable_scheduleCallback,pC=e.unstable_NormalPriority,Ft={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bd(){return{controller:new dC,data:new Map,refCount:0}}function Ai(t){t.refCount--,t.refCount===0&&uC(pC,function(){t.controller.abort()})}var xi=null,Dd=0,yr=0,br=null;function hC(t,s){if(xi===null){var l=xi=[];Dd=0,yr=Ou(),br={status:"pending",value:void 0,then:function(c){l.push(c)}}}return Dd++,s.then(lf,lf),s}function lf(){if(--Dd===0&&xi!==null){br!==null&&(br.status="fulfilled");var t=xi;xi=null,yr=0,br=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function mC(t,s){var l=[],c={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return t.then(function(){c.status="fulfilled",c.value=s;for(var p=0;p<l.length;p++)(0,l[p])(s)},function(p){for(c.status="rejected",c.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),c}var of=G.S;G.S=function(t,s){Hv=Be(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&hC(t,s),of!==null&&of(t,s)};var Ts=O(null);function Rd(){var t=Ts.current;return t!==null?t:At.pooledCache}function Wl(t,s){s===null?K(Ts,Ts.current):K(Ts,s.pool)}function cf(){var t=Rd();return t===null?null:{parent:Ft._currentValue,pool:t}}var jr=Error(i(460)),Ld=Error(i(474)),Zl=Error(i(542)),eo={then:function(){}};function df(t){return t=t.status,t==="fulfilled"||t==="rejected"}function uf(t,s,l){switch(l=t[l],l===void 0?t.push(s):l!==s&&(s.then(gn,gn),s=l),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,hf(t),t;default:if(typeof s.status=="string")s.then(gn,gn);else{if(t=At,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=s,t.status="pending",t.then(function(c){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=c}},function(c){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,hf(t),t}throw Ds=s,jr}}function Bs(t){try{var s=t._init;return s(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ds=l,jr):l}}var Ds=null;function pf(){if(Ds===null)throw Error(i(459));var t=Ds;return Ds=null,t}function hf(t){if(t===jr||t===Zl)throw Error(i(483))}var Ar=null,Ci=0;function to(t){var s=Ci;return Ci+=1,Ar===null&&(Ar=[]),uf(Ar,t,s)}function ki(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function ao(t,s){throw s.$$typeof===j?Error(i(525)):(t=Object.prototype.toString.call(s),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function mf(t){function s(te,Y){if(t){var ie=te.deletions;ie===null?(te.deletions=[Y],te.flags|=16):ie.push(Y)}}function l(te,Y){if(!t)return null;for(;Y!==null;)s(te,Y),Y=Y.sibling;return null}function c(te){for(var Y=new Map;te!==null;)te.key!==null?Y.set(te.key,te):Y.set(te.index,te),te=te.sibling;return Y}function p(te,Y){return te=bn(te,Y),te.index=0,te.sibling=null,te}function f(te,Y,ie){return te.index=ie,t?(ie=te.alternate,ie!==null?(ie=ie.index,ie<Y?(te.flags|=67108866,Y):ie):(te.flags|=67108866,Y)):(te.flags|=1048576,Y)}function A(te){return t&&te.alternate===null&&(te.flags|=67108866),te}function M(te,Y,ie,Ae){return Y===null||Y.tag!==6?(Y=Cd(ie,te.mode,Ae),Y.return=te,Y):(Y=p(Y,ie),Y.return=te,Y)}function $(te,Y,ie,Ae){var Pe=ie.type;return Pe===x?je(te,Y,ie.props.children,Ae,ie.key):Y!==null&&(Y.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===z&&Bs(Pe)===Y.type)?(Y=p(Y,ie.props),ki(Y,ie),Y.return=te,Y):(Y=Vl(ie.type,ie.key,ie.props,null,te.mode,Ae),ki(Y,ie),Y.return=te,Y)}function le(te,Y,ie,Ae){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ie.containerInfo||Y.stateNode.implementation!==ie.implementation?(Y=kd(ie,te.mode,Ae),Y.return=te,Y):(Y=p(Y,ie.children||[]),Y.return=te,Y)}function je(te,Y,ie,Ae,Pe){return Y===null||Y.tag!==7?(Y=Ns(ie,te.mode,Ae,Pe),Y.return=te,Y):(Y=p(Y,ie),Y.return=te,Y)}function Ce(te,Y,ie){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=Cd(""+Y,te.mode,ie),Y.return=te,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case C:return ie=Vl(Y.type,Y.key,Y.props,null,te.mode,ie),ki(ie,Y),ie.return=te,ie;case k:return Y=kd(Y,te.mode,ie),Y.return=te,Y;case z:return Y=Bs(Y),Ce(te,Y,ie)}if(de(Y)||re(Y))return Y=Ns(Y,te.mode,ie,null),Y.return=te,Y;if(typeof Y.then=="function")return Ce(te,to(Y),ie);if(Y.$$typeof===E)return Ce(te,Xl(te,Y),ie);ao(te,Y)}return null}function ue(te,Y,ie,Ae){var Pe=Y!==null?Y.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Pe!==null?null:M(te,Y,""+ie,Ae);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case C:return ie.key===Pe?$(te,Y,ie,Ae):null;case k:return ie.key===Pe?le(te,Y,ie,Ae):null;case z:return ie=Bs(ie),ue(te,Y,ie,Ae)}if(de(ie)||re(ie))return Pe!==null?null:je(te,Y,ie,Ae,null);if(typeof ie.then=="function")return ue(te,Y,to(ie),Ae);if(ie.$$typeof===E)return ue(te,Y,Xl(te,ie),Ae);ao(te,ie)}return null}function me(te,Y,ie,Ae,Pe){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return te=te.get(ie)||null,M(Y,te,""+Ae,Pe);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case C:return te=te.get(Ae.key===null?ie:Ae.key)||null,$(Y,te,Ae,Pe);case k:return te=te.get(Ae.key===null?ie:Ae.key)||null,le(Y,te,Ae,Pe);case z:return Ae=Bs(Ae),me(te,Y,ie,Ae,Pe)}if(de(Ae)||re(Ae))return te=te.get(ie)||null,je(Y,te,Ae,Pe,null);if(typeof Ae.then=="function")return me(te,Y,ie,to(Ae),Pe);if(Ae.$$typeof===E)return me(te,Y,ie,Xl(Y,Ae),Pe);ao(Y,Ae)}return null}function Re(te,Y,ie,Ae){for(var Pe=null,ot=null,_e=Y,Ye=Y=0,nt=null;_e!==null&&Ye<ie.length;Ye++){_e.index>Ye?(nt=_e,_e=null):nt=_e.sibling;var ct=ue(te,_e,ie[Ye],Ae);if(ct===null){_e===null&&(_e=nt);break}t&&_e&&ct.alternate===null&&s(te,_e),Y=f(ct,Y,Ye),ot===null?Pe=ct:ot.sibling=ct,ot=ct,_e=nt}if(Ye===ie.length)return l(te,_e),st&&jn(te,Ye),Pe;if(_e===null){for(;Ye<ie.length;Ye++)_e=Ce(te,ie[Ye],Ae),_e!==null&&(Y=f(_e,Y,Ye),ot===null?Pe=_e:ot.sibling=_e,ot=_e);return st&&jn(te,Ye),Pe}for(_e=c(_e);Ye<ie.length;Ye++)nt=me(_e,te,Ye,ie[Ye],Ae),nt!==null&&(t&&nt.alternate!==null&&_e.delete(nt.key===null?Ye:nt.key),Y=f(nt,Y,Ye),ot===null?Pe=nt:ot.sibling=nt,ot=nt);return t&&_e.forEach(function(ds){return s(te,ds)}),st&&jn(te,Ye),Pe}function $e(te,Y,ie,Ae){if(ie==null)throw Error(i(151));for(var Pe=null,ot=null,_e=Y,Ye=Y=0,nt=null,ct=ie.next();_e!==null&&!ct.done;Ye++,ct=ie.next()){_e.index>Ye?(nt=_e,_e=null):nt=_e.sibling;var ds=ue(te,_e,ct.value,Ae);if(ds===null){_e===null&&(_e=nt);break}t&&_e&&ds.alternate===null&&s(te,_e),Y=f(ds,Y,Ye),ot===null?Pe=ds:ot.sibling=ds,ot=ds,_e=nt}if(ct.done)return l(te,_e),st&&jn(te,Ye),Pe;if(_e===null){for(;!ct.done;Ye++,ct=ie.next())ct=Ce(te,ct.value,Ae),ct!==null&&(Y=f(ct,Y,Ye),ot===null?Pe=ct:ot.sibling=ct,ot=ct);return st&&jn(te,Ye),Pe}for(_e=c(_e);!ct.done;Ye++,ct=ie.next())ct=me(_e,te,Ye,ct.value,Ae),ct!==null&&(t&&ct.alternate!==null&&_e.delete(ct.key===null?Ye:ct.key),Y=f(ct,Y,Ye),ot===null?Pe=ct:ot.sibling=ct,ot=ct);return t&&_e.forEach(function(Sk){return s(te,Sk)}),st&&jn(te,Ye),Pe}function bt(te,Y,ie,Ae){if(typeof ie=="object"&&ie!==null&&ie.type===x&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case C:e:{for(var Pe=ie.key;Y!==null;){if(Y.key===Pe){if(Pe=ie.type,Pe===x){if(Y.tag===7){l(te,Y.sibling),Ae=p(Y,ie.props.children),Ae.return=te,te=Ae;break e}}else if(Y.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===z&&Bs(Pe)===Y.type){l(te,Y.sibling),Ae=p(Y,ie.props),ki(Ae,ie),Ae.return=te,te=Ae;break e}l(te,Y);break}else s(te,Y);Y=Y.sibling}ie.type===x?(Ae=Ns(ie.props.children,te.mode,Ae,ie.key),Ae.return=te,te=Ae):(Ae=Vl(ie.type,ie.key,ie.props,null,te.mode,Ae),ki(Ae,ie),Ae.return=te,te=Ae)}return A(te);case k:e:{for(Pe=ie.key;Y!==null;){if(Y.key===Pe)if(Y.tag===4&&Y.stateNode.containerInfo===ie.containerInfo&&Y.stateNode.implementation===ie.implementation){l(te,Y.sibling),Ae=p(Y,ie.children||[]),Ae.return=te,te=Ae;break e}else{l(te,Y);break}else s(te,Y);Y=Y.sibling}Ae=kd(ie,te.mode,Ae),Ae.return=te,te=Ae}return A(te);case z:return ie=Bs(ie),bt(te,Y,ie,Ae)}if(de(ie))return Re(te,Y,ie,Ae);if(re(ie)){if(Pe=re(ie),typeof Pe!="function")throw Error(i(150));return ie=Pe.call(ie),$e(te,Y,ie,Ae)}if(typeof ie.then=="function")return bt(te,Y,to(ie),Ae);if(ie.$$typeof===E)return bt(te,Y,Xl(te,ie),Ae);ao(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Y!==null&&Y.tag===6?(l(te,Y.sibling),Ae=p(Y,ie),Ae.return=te,te=Ae):(l(te,Y),Ae=Cd(ie,te.mode,Ae),Ae.return=te,te=Ae),A(te)):l(te,Y)}return function(te,Y,ie,Ae){try{Ci=0;var Pe=bt(te,Y,ie,Ae);return Ar=null,Pe}catch(_e){if(_e===jr||_e===Zl)throw _e;var ot=Ca(29,_e,null,te.mode);return ot.lanes=Ae,ot.return=te,ot}}}var Rs=mf(!0),ff=mf(!1),qn=!1;function Od(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _d(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Vn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Yn(t,s,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(dt&2)!==0){var p=c.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),c.pending=s,s=ql(t),Xm(t,null,l),s}return Gl(t,c,s,l),ql(t)}function Si(t,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194048)!==0)){var c=s.lanes;c&=t.pendingLanes,l|=c,s.lanes=l,Aa(t,l)}}function Qd(t,s){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var p=null,f=null;if(l=l.firstBaseUpdate,l!==null){do{var A={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};f===null?p=f=A:f=f.next=A,l=l.next}while(l!==null);f===null?p=f=s:f=f.next=s}else p=f=s;l={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:f,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=s:t.next=s,l.lastBaseUpdate=s}var Ud=!1;function wi(){if(Ud){var t=br;if(t!==null)throw t}}function Ni(t,s,l,c){Ud=!1;var p=t.updateQueue;qn=!1;var f=p.firstBaseUpdate,A=p.lastBaseUpdate,M=p.shared.pending;if(M!==null){p.shared.pending=null;var $=M,le=$.next;$.next=null,A===null?f=le:A.next=le,A=$;var je=t.alternate;je!==null&&(je=je.updateQueue,M=je.lastBaseUpdate,M!==A&&(M===null?je.firstBaseUpdate=le:M.next=le,je.lastBaseUpdate=$))}if(f!==null){var Ce=p.baseState;A=0,je=le=$=null,M=f;do{var ue=M.lane&-536870913,me=ue!==M.lane;if(me?(at&ue)===ue:(c&ue)===ue){ue!==0&&ue===yr&&(Ud=!0),je!==null&&(je=je.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Re=t,$e=M;ue=s;var bt=l;switch($e.tag){case 1:if(Re=$e.payload,typeof Re=="function"){Ce=Re.call(bt,Ce,ue);break e}Ce=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=$e.payload,ue=typeof Re=="function"?Re.call(bt,Ce,ue):Re,ue==null)break e;Ce=b({},Ce,ue);break e;case 2:qn=!0}}ue=M.callback,ue!==null&&(t.flags|=64,me&&(t.flags|=8192),me=p.callbacks,me===null?p.callbacks=[ue]:me.push(ue))}else me={lane:ue,tag:M.tag,payload:M.payload,callback:M.callback,next:null},je===null?(le=je=me,$=Ce):je=je.next=me,A|=ue;if(M=M.next,M===null){if(M=p.shared.pending,M===null)break;me=M,M=me.next,me.next=null,p.lastBaseUpdate=me,p.shared.pending=null}}while(!0);je===null&&($=Ce),p.baseState=$,p.firstBaseUpdate=le,p.lastBaseUpdate=je,f===null&&(p.shared.lanes=0),es|=A,t.lanes=A,t.memoizedState=Ce}}function vf(t,s){if(typeof t!="function")throw Error(i(191,t));t.call(s)}function gf(t,s){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)vf(l[t],s)}var xr=O(null),no=O(0);function yf(t,s){t=Tn,K(no,t),K(xr,s),Tn=t|s.baseLanes}function Pd(){K(no,Tn),K(xr,xr.current)}function Fd(){Tn=no.current,_(xr),_(no)}var ka=O(null),Qa=null;function Jn(t){var s=t.alternate;K(Qt,Qt.current&1),K(ka,t),Qa===null&&(s===null||xr.current!==null||s.memoizedState!==null)&&(Qa=t)}function Kd(t){K(Qt,Qt.current),K(ka,t),Qa===null&&(Qa=t)}function bf(t){t.tag===22?(K(Qt,Qt.current),K(ka,t),Qa===null&&(Qa=t)):Xn()}function Xn(){K(Qt,Qt.current),K(ka,ka.current)}function Sa(t){_(ka),Qa===t&&(Qa=null),_(Qt)}var Qt=O(0);function so(t){for(var s=t;s!==null;){if(s.tag===13){var l=s.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Vu(l)||Yu(l)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Cn=0,Ve=null,gt=null,Kt=null,ro=!1,Cr=!1,Ls=!1,io=0,Ii=0,kr=null,fC=0;function Lt(){throw Error(i(321))}function zd(t,s){if(s===null)return!1;for(var l=0;l<s.length&&l<t.length;l++)if(!xa(t[l],s[l]))return!1;return!0}function $d(t,s,l,c,p,f){return Cn=f,Ve=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,G.H=t===null||t.memoizedState===null?av:ru,Ls=!1,f=l(c,p),Ls=!1,Cr&&(f=Af(s,l,c,p)),jf(t),f}function jf(t){G.H=Ti;var s=gt!==null&>.next!==null;if(Cn=0,Kt=gt=Ve=null,ro=!1,Ii=0,kr=null,s)throw Error(i(300));t===null||zt||(t=t.dependencies,t!==null&&Jl(t)&&(zt=!0))}function Af(t,s,l,c){Ve=t;var p=0;do{if(Cr&&(kr=null),Ii=0,Cr=!1,25<=p)throw Error(i(301));if(p+=1,Kt=gt=null,t.updateQueue!=null){var f=t.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}G.H=nv,f=s(l,c)}while(Cr);return f}function vC(){var t=G.H,s=t.useState()[0];return s=typeof s.then=="function"?Ei(s):s,t=t.useState()[0],(gt!==null?gt.memoizedState:null)!==t&&(Ve.flags|=1024),s}function Hd(){var t=io!==0;return io=0,t}function Gd(t,s,l){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~l}function qd(t){if(ro){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}ro=!1}Cn=0,Kt=gt=Ve=null,Cr=!1,Ii=io=0,kr=null}function la(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?Ve.memoizedState=Kt=t:Kt=Kt.next=t,Kt}function Ut(){if(gt===null){var t=Ve.alternate;t=t!==null?t.memoizedState:null}else t=gt.next;var s=Kt===null?Ve.memoizedState:Kt.next;if(s!==null)Kt=s,gt=t;else{if(t===null)throw Ve.alternate===null?Error(i(467)):Error(i(310));gt=t,t={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Kt===null?Ve.memoizedState=Kt=t:Kt=Kt.next=t}return Kt}function lo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ei(t){var s=Ii;return Ii+=1,kr===null&&(kr=[]),t=uf(kr,t,s),s=Ve,(Kt===null?s.memoizedState:Kt.next)===null&&(s=s.alternate,G.H=s===null||s.memoizedState===null?av:ru),t}function oo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ei(t);if(t.$$typeof===E)return Zt(t)}throw Error(i(438,String(t)))}function Vd(t){var s=null,l=Ve.updateQueue;if(l!==null&&(s=l.memoCache),s==null){var c=Ve.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),l===null&&(l=lo(),Ve.updateQueue=l),l.memoCache=s,l=s.data[s.index],l===void 0)for(l=s.data[s.index]=Array(t),c=0;c<t;c++)l[c]=ye;return s.index++,l}function kn(t,s){return typeof s=="function"?s(t):s}function co(t){var s=Ut();return Yd(s,gt,t)}function Yd(t,s,l){var c=t.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=l;var p=t.baseQueue,f=c.pending;if(f!==null){if(p!==null){var A=p.next;p.next=f.next,f.next=A}s.baseQueue=p=f,c.pending=null}if(f=t.baseState,p===null)t.memoizedState=f;else{s=p.next;var M=A=null,$=null,le=s,je=!1;do{var Ce=le.lane&-536870913;if(Ce!==le.lane?(at&Ce)===Ce:(Cn&Ce)===Ce){var ue=le.revertLane;if(ue===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),Ce===yr&&(je=!0);else if((Cn&ue)===ue){le=le.next,ue===yr&&(je=!0);continue}else Ce={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},$===null?(M=$=Ce,A=f):$=$.next=Ce,Ve.lanes|=ue,es|=ue;Ce=le.action,Ls&&l(f,Ce),f=le.hasEagerState?le.eagerState:l(f,Ce)}else ue={lane:Ce,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},$===null?(M=$=ue,A=f):$=$.next=ue,Ve.lanes|=Ce,es|=Ce;le=le.next}while(le!==null&&le!==s);if($===null?A=f:$.next=M,!xa(f,t.memoizedState)&&(zt=!0,je&&(l=br,l!==null)))throw l;t.memoizedState=f,t.baseState=A,t.baseQueue=$,c.lastRenderedState=f}return p===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function Jd(t){var s=Ut(),l=s.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=t;var c=l.dispatch,p=l.pending,f=s.memoizedState;if(p!==null){l.pending=null;var A=p=p.next;do f=t(f,A.action),A=A.next;while(A!==p);xa(f,s.memoizedState)||(zt=!0),s.memoizedState=f,s.baseQueue===null&&(s.baseState=f),l.lastRenderedState=f}return[f,c]}function xf(t,s,l){var c=Ve,p=Ut(),f=st;if(f){if(l===void 0)throw Error(i(407));l=l()}else l=s();var A=!xa((gt||p).memoizedState,l);if(A&&(p.memoizedState=l,zt=!0),p=p.queue,Zd(Sf.bind(null,c,p,t),[t]),p.getSnapshot!==s||A||Kt!==null&&Kt.memoizedState.tag&1){if(c.flags|=2048,Sr(9,{destroy:void 0},kf.bind(null,c,p,l,s),null),At===null)throw Error(i(349));f||(Cn&127)!==0||Cf(c,s,l)}return l}function Cf(t,s,l){t.flags|=16384,t={getSnapshot:s,value:l},s=Ve.updateQueue,s===null?(s=lo(),Ve.updateQueue=s,s.stores=[t]):(l=s.stores,l===null?s.stores=[t]:l.push(t))}function kf(t,s,l,c){s.value=l,s.getSnapshot=c,wf(s)&&Nf(t)}function Sf(t,s,l){return l(function(){wf(s)&&Nf(t)})}function wf(t){var s=t.getSnapshot;t=t.value;try{var l=s();return!xa(t,l)}catch{return!0}}function Nf(t){var s=ws(t,2);s!==null&&va(s,t,2)}function Xd(t){var s=la();if(typeof t=="function"){var l=t;if(t=l(),Ls){Fe(!0);try{l()}finally{Fe(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:t},s}function If(t,s,l,c){return t.baseState=l,Yd(t,gt,typeof c=="function"?c:kn)}function gC(t,s,l,c,p){if(ho(t))throw Error(i(485));if(t=s.action,t!==null){var f={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){f.listeners.push(A)}};G.T!==null?l(!0):f.isTransition=!1,c(f),l=s.pending,l===null?(f.next=s.pending=f,Ef(s,f)):(f.next=l.next,s.pending=l.next=f)}}function Ef(t,s){var l=s.action,c=s.payload,p=t.state;if(s.isTransition){var f=G.T,A={};G.T=A;try{var M=l(p,c),$=G.S;$!==null&&$(A,M),Mf(t,s,M)}catch(le){Wd(t,s,le)}finally{f!==null&&A.types!==null&&(f.types=A.types),G.T=f}}else try{f=l(p,c),Mf(t,s,f)}catch(le){Wd(t,s,le)}}function Mf(t,s,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){Tf(t,s,c)},function(c){return Wd(t,s,c)}):Tf(t,s,l)}function Tf(t,s,l){s.status="fulfilled",s.value=l,Bf(s),t.state=l,s=t.pending,s!==null&&(l=s.next,l===s?t.pending=null:(l=l.next,s.next=l,Ef(t,l)))}function Wd(t,s,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=l,Bf(s),s=s.next;while(s!==c)}t.action=null}function Bf(t){t=t.listeners;for(var s=0;s<t.length;s++)(0,t[s])()}function Df(t,s){return s}function Rf(t,s){if(st){var l=At.formState;if(l!==null){e:{var c=Ve;if(st){if(kt){t:{for(var p=kt,f=_a;p.nodeType!==8;){if(!f){p=null;break t}if(p=Ua(p.nextSibling),p===null){p=null;break t}}f=p.data,p=f==="F!"||f==="F"?p:null}if(p){kt=Ua(p.nextSibling),c=p.data==="F!";break e}}Hn(c)}c=!1}c&&(s=l[0])}}return l=la(),l.memoizedState=l.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Df,lastRenderedState:s},l.queue=c,l=Zf.bind(null,Ve,c),c.dispatch=l,c=Xd(!1),f=su.bind(null,Ve,!1,c.queue),c=la(),p={state:s,dispatch:null,action:t,pending:null},c.queue=p,l=gC.bind(null,Ve,p,f,l),p.dispatch=l,c.memoizedState=t,[s,l,!1]}function Lf(t){var s=Ut();return Of(s,gt,t)}function Of(t,s,l){if(s=Yd(t,s,Df)[0],t=co(kn)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=Ei(s)}catch(A){throw A===jr?Zl:A}else c=s;s=Ut();var p=s.queue,f=p.dispatch;return l!==s.memoizedState&&(Ve.flags|=2048,Sr(9,{destroy:void 0},yC.bind(null,p,l),null)),[c,f,t]}function yC(t,s){t.action=s}function _f(t){var s=Ut(),l=gt;if(l!==null)return Of(s,l,t);Ut(),s=s.memoizedState,l=Ut();var c=l.queue.dispatch;return l.memoizedState=t,[s,c,!1]}function Sr(t,s,l,c){return t={tag:t,create:l,deps:c,inst:s,next:null},s=Ve.updateQueue,s===null&&(s=lo(),Ve.updateQueue=s),l=s.lastEffect,l===null?s.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,s.lastEffect=t),t}function Qf(){return Ut().memoizedState}function uo(t,s,l,c){var p=la();Ve.flags|=t,p.memoizedState=Sr(1|s,{destroy:void 0},l,c===void 0?null:c)}function po(t,s,l,c){var p=Ut();c=c===void 0?null:c;var f=p.memoizedState.inst;gt!==null&&c!==null&&zd(c,gt.memoizedState.deps)?p.memoizedState=Sr(s,f,l,c):(Ve.flags|=t,p.memoizedState=Sr(1|s,f,l,c))}function Uf(t,s){uo(8390656,8,t,s)}function Zd(t,s){po(2048,8,t,s)}function bC(t){Ve.flags|=4;var s=Ve.updateQueue;if(s===null)s=lo(),Ve.updateQueue=s,s.events=[t];else{var l=s.events;l===null?s.events=[t]:l.push(t)}}function Pf(t){var s=Ut().memoizedState;return bC({ref:s,nextImpl:t}),function(){if((dt&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function Ff(t,s){return po(4,2,t,s)}function Kf(t,s){return po(4,4,t,s)}function zf(t,s){if(typeof s=="function"){t=t();var l=s(t);return function(){typeof l=="function"?l():s(null)}}if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function $f(t,s,l){l=l!=null?l.concat([t]):null,po(4,4,zf.bind(null,s,t),l)}function eu(){}function Hf(t,s){var l=Ut();s=s===void 0?null:s;var c=l.memoizedState;return s!==null&&zd(s,c[1])?c[0]:(l.memoizedState=[t,s],t)}function Gf(t,s){var l=Ut();s=s===void 0?null:s;var c=l.memoizedState;if(s!==null&&zd(s,c[1]))return c[0];if(c=t(),Ls){Fe(!0);try{t()}finally{Fe(!1)}}return l.memoizedState=[c,s],c}function tu(t,s,l){return l===void 0||(Cn&1073741824)!==0&&(at&261930)===0?t.memoizedState=s:(t.memoizedState=l,t=qv(),Ve.lanes|=t,es|=t,l)}function qf(t,s,l,c){return xa(l,s)?l:xr.current!==null?(t=tu(t,l,c),xa(t,s)||(zt=!0),t):(Cn&42)===0||(Cn&1073741824)!==0&&(at&261930)===0?(zt=!0,t.memoizedState=l):(t=qv(),Ve.lanes|=t,es|=t,s)}function Vf(t,s,l,c,p){var f=Q.p;Q.p=f!==0&&8>f?f:8;var A=G.T,M={};G.T=M,su(t,!1,s,l);try{var $=p(),le=G.S;if(le!==null&&le(M,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var je=mC($,c);Mi(t,s,je,Ia(t))}else Mi(t,s,c,Ia(t))}catch(Ce){Mi(t,s,{then:function(){},status:"rejected",reason:Ce},Ia())}finally{Q.p=f,A!==null&&M.types!==null&&(A.types=M.types),G.T=A}}function jC(){}function au(t,s,l,c){if(t.tag!==5)throw Error(i(476));var p=Yf(t).queue;Vf(t,p,s,W,l===null?jC:function(){return Jf(t),l(c)})}function Yf(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:W},next:null};var l={};return s.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:l},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function Jf(t){var s=Yf(t);s.next===null&&(s=t.alternate.memoizedState),Mi(t,s.next.queue,{},Ia())}function nu(){return Zt(qi)}function Xf(){return Ut().memoizedState}function Wf(){return Ut().memoizedState}function AC(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var l=Ia();t=Vn(l);var c=Yn(s,t,l);c!==null&&(va(c,s,l),Si(c,s,l)),s={cache:Bd()},t.payload=s;return}s=s.return}}function xC(t,s,l){var c=Ia();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ho(t)?ev(s,l):(l=Ad(t,s,l,c),l!==null&&(va(l,t,c),tv(l,s,c)))}function Zf(t,s,l){var c=Ia();Mi(t,s,l,c)}function Mi(t,s,l,c){var p={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ho(t))ev(s,p);else{var f=t.alternate;if(t.lanes===0&&(f===null||f.lanes===0)&&(f=s.lastRenderedReducer,f!==null))try{var A=s.lastRenderedState,M=f(A,l);if(p.hasEagerState=!0,p.eagerState=M,xa(M,A))return Gl(t,s,p,0),At===null&&Hl(),!1}catch{}if(l=Ad(t,s,p,c),l!==null)return va(l,t,c),tv(l,s,c),!0}return!1}function su(t,s,l,c){if(c={lane:2,revertLane:Ou(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},ho(t)){if(s)throw Error(i(479))}else s=Ad(t,l,c,2),s!==null&&va(s,t,2)}function ho(t){var s=t.alternate;return t===Ve||s!==null&&s===Ve}function ev(t,s){Cr=ro=!0;var l=t.pending;l===null?s.next=s:(s.next=l.next,l.next=s),t.pending=s}function tv(t,s,l){if((l&4194048)!==0){var c=s.lanes;c&=t.pendingLanes,l|=c,s.lanes=l,Aa(t,l)}}var Ti={readContext:Zt,use:oo,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};Ti.useEffectEvent=Lt;var av={readContext:Zt,use:oo,useCallback:function(t,s){return la().memoizedState=[t,s===void 0?null:s],t},useContext:Zt,useEffect:Uf,useImperativeHandle:function(t,s,l){l=l!=null?l.concat([t]):null,uo(4194308,4,zf.bind(null,s,t),l)},useLayoutEffect:function(t,s){return uo(4194308,4,t,s)},useInsertionEffect:function(t,s){uo(4,2,t,s)},useMemo:function(t,s){var l=la();s=s===void 0?null:s;var c=t();if(Ls){Fe(!0);try{t()}finally{Fe(!1)}}return l.memoizedState=[c,s],c},useReducer:function(t,s,l){var c=la();if(l!==void 0){var p=l(s);if(Ls){Fe(!0);try{l(s)}finally{Fe(!1)}}}else p=s;return c.memoizedState=c.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},c.queue=t,t=t.dispatch=xC.bind(null,Ve,t),[c.memoizedState,t]},useRef:function(t){var s=la();return t={current:t},s.memoizedState=t},useState:function(t){t=Xd(t);var s=t.queue,l=Zf.bind(null,Ve,s);return s.dispatch=l,[t.memoizedState,l]},useDebugValue:eu,useDeferredValue:function(t,s){var l=la();return tu(l,t,s)},useTransition:function(){var t=Xd(!1);return t=Vf.bind(null,Ve,t.queue,!0,!1),la().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,l){var c=Ve,p=la();if(st){if(l===void 0)throw Error(i(407));l=l()}else{if(l=s(),At===null)throw Error(i(349));(at&127)!==0||Cf(c,s,l)}p.memoizedState=l;var f={value:l,getSnapshot:s};return p.queue=f,Uf(Sf.bind(null,c,f,t),[t]),c.flags|=2048,Sr(9,{destroy:void 0},kf.bind(null,c,f,l,s),null),l},useId:function(){var t=la(),s=At.identifierPrefix;if(st){var l=an,c=tn;l=(c&~(1<<32-ze(c)-1)).toString(32)+l,s="_"+s+"R_"+l,l=io++,0<l&&(s+="H"+l.toString(32)),s+="_"}else l=fC++,s="_"+s+"r_"+l.toString(32)+"_";return t.memoizedState=s},useHostTransitionStatus:nu,useFormState:Rf,useActionState:Rf,useOptimistic:function(t){var s=la();s.memoizedState=s.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=l,s=su.bind(null,Ve,!0,l),l.dispatch=s,[t,s]},useMemoCache:Vd,useCacheRefresh:function(){return la().memoizedState=AC.bind(null,Ve)},useEffectEvent:function(t){var s=la(),l={impl:t};return s.memoizedState=l,function(){if((dt&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}},ru={readContext:Zt,use:oo,useCallback:Hf,useContext:Zt,useEffect:Zd,useImperativeHandle:$f,useInsertionEffect:Ff,useLayoutEffect:Kf,useMemo:Gf,useReducer:co,useRef:Qf,useState:function(){return co(kn)},useDebugValue:eu,useDeferredValue:function(t,s){var l=Ut();return qf(l,gt.memoizedState,t,s)},useTransition:function(){var t=co(kn)[0],s=Ut().memoizedState;return[typeof t=="boolean"?t:Ei(t),s]},useSyncExternalStore:xf,useId:Xf,useHostTransitionStatus:nu,useFormState:Lf,useActionState:Lf,useOptimistic:function(t,s){var l=Ut();return If(l,gt,t,s)},useMemoCache:Vd,useCacheRefresh:Wf};ru.useEffectEvent=Pf;var nv={readContext:Zt,use:oo,useCallback:Hf,useContext:Zt,useEffect:Zd,useImperativeHandle:$f,useInsertionEffect:Ff,useLayoutEffect:Kf,useMemo:Gf,useReducer:Jd,useRef:Qf,useState:function(){return Jd(kn)},useDebugValue:eu,useDeferredValue:function(t,s){var l=Ut();return gt===null?tu(l,t,s):qf(l,gt.memoizedState,t,s)},useTransition:function(){var t=Jd(kn)[0],s=Ut().memoizedState;return[typeof t=="boolean"?t:Ei(t),s]},useSyncExternalStore:xf,useId:Xf,useHostTransitionStatus:nu,useFormState:_f,useActionState:_f,useOptimistic:function(t,s){var l=Ut();return gt!==null?If(l,gt,t,s):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Vd,useCacheRefresh:Wf};nv.useEffectEvent=Pf;function iu(t,s,l,c){s=t.memoizedState,l=l(c,s),l=l==null?s:b({},s,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var lu={enqueueSetState:function(t,s,l){t=t._reactInternals;var c=Ia(),p=Vn(c);p.payload=s,l!=null&&(p.callback=l),s=Yn(t,p,c),s!==null&&(va(s,t,c),Si(s,t,c))},enqueueReplaceState:function(t,s,l){t=t._reactInternals;var c=Ia(),p=Vn(c);p.tag=1,p.payload=s,l!=null&&(p.callback=l),s=Yn(t,p,c),s!==null&&(va(s,t,c),Si(s,t,c))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var l=Ia(),c=Vn(l);c.tag=2,s!=null&&(c.callback=s),s=Yn(t,c,l),s!==null&&(va(s,t,l),Si(s,t,l))}};function sv(t,s,l,c,p,f,A){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,f,A):s.prototype&&s.prototype.isPureReactComponent?!gi(l,c)||!gi(p,f):!0}function rv(t,s,l,c){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(l,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(l,c),s.state!==t&&lu.enqueueReplaceState(s,s.state,null)}function Os(t,s){var l=s;if("ref"in s){l={};for(var c in s)c!=="ref"&&(l[c]=s[c])}if(t=t.defaultProps){l===s&&(l=b({},l));for(var p in t)l[p]===void 0&&(l[p]=t[p])}return l}function iv(t){$l(t)}function lv(t){console.error(t)}function ov(t){$l(t)}function mo(t,s){try{var l=t.onUncaughtError;l(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function cv(t,s,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function ou(t,s,l){return l=Vn(l),l.tag=3,l.payload={element:null},l.callback=function(){mo(t,s)},l}function dv(t){return t=Vn(t),t.tag=3,t}function uv(t,s,l,c){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var f=c.value;t.payload=function(){return p(f)},t.callback=function(){cv(s,l,c)}}var A=l.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(t.callback=function(){cv(s,l,c),typeof p!="function"&&(ts===null?ts=new Set([this]):ts.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})})}function CC(t,s,l,c,p){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=l.alternate,s!==null&&gr(s,l,p,!0),l=ka.current,l!==null){switch(l.tag){case 31:case 13:return Qa===null?wo():l.alternate===null&&Ot===0&&(Ot=3),l.flags&=-257,l.flags|=65536,l.lanes=p,c===eo?l.flags|=16384:(s=l.updateQueue,s===null?l.updateQueue=new Set([c]):s.add(c),Du(t,c,p)),!1;case 22:return l.flags|=65536,c===eo?l.flags|=16384:(s=l.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=s):(l=s.retryQueue,l===null?s.retryQueue=new Set([c]):l.add(c)),Du(t,c,p)),!1}throw Error(i(435,l.tag))}return Du(t,c,p),wo(),!1}if(st)return s=ka.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,c!==Nd&&(t=Error(i(422),{cause:c}),ji(Ra(t,l)))):(c!==Nd&&(s=Error(i(423),{cause:c}),ji(Ra(s,l))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,c=Ra(c,l),p=ou(t.stateNode,c,p),Qd(t,p),Ot!==4&&(Ot=2)),!1;var f=Error(i(520),{cause:c});if(f=Ra(f,l),Ui===null?Ui=[f]:Ui.push(f),Ot!==4&&(Ot=2),s===null)return!0;c=Ra(c,l),l=s;do{switch(l.tag){case 3:return l.flags|=65536,t=p&-p,l.lanes|=t,t=ou(l.stateNode,c,t),Qd(l,t),!1;case 1:if(s=l.type,f=l.stateNode,(l.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(ts===null||!ts.has(f))))return l.flags|=65536,p&=-p,l.lanes|=p,p=dv(p),uv(p,t,l,c),Qd(l,p),!1}l=l.return}while(l!==null);return!1}var cu=Error(i(461)),zt=!1;function ea(t,s,l,c){s.child=t===null?ff(s,null,l,c):Rs(s,t.child,l,c)}function pv(t,s,l,c,p){l=l.render;var f=s.ref;if("ref"in c){var A={};for(var M in c)M!=="ref"&&(A[M]=c[M])}else A=c;return Ms(s),c=$d(t,s,l,A,f,p),M=Hd(),t!==null&&!zt?(Gd(t,s,p),Sn(t,s,p)):(st&&M&&Sd(s),s.flags|=1,ea(t,s,c,p),s.child)}function hv(t,s,l,c,p){if(t===null){var f=l.type;return typeof f=="function"&&!xd(f)&&f.defaultProps===void 0&&l.compare===null?(s.tag=15,s.type=f,mv(t,s,f,c,p)):(t=Vl(l.type,null,c,s,s.mode,p),t.ref=s.ref,t.return=s,s.child=t)}if(f=t.child,!gu(t,p)){var A=f.memoizedProps;if(l=l.compare,l=l!==null?l:gi,l(A,c)&&t.ref===s.ref)return Sn(t,s,p)}return s.flags|=1,t=bn(f,c),t.ref=s.ref,t.return=s,s.child=t}function mv(t,s,l,c,p){if(t!==null){var f=t.memoizedProps;if(gi(f,c)&&t.ref===s.ref)if(zt=!1,s.pendingProps=c=f,gu(t,p))(t.flags&131072)!==0&&(zt=!0);else return s.lanes=t.lanes,Sn(t,s,p)}return du(t,s,l,c,p)}function fv(t,s,l,c){var p=c.children,f=t!==null?t.memoizedState:null;if(t===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((s.flags&128)!==0){if(f=f!==null?f.baseLanes|l:l,t!==null){for(c=s.child=t.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~f}else c=0,s.child=null;return vv(t,s,f,l,c)}if((l&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&Wl(s,f!==null?f.cachePool:null),f!==null?yf(s,f):Pd(),bf(s);else return c=s.lanes=536870912,vv(t,s,f!==null?f.baseLanes|l:l,l,c)}else f!==null?(Wl(s,f.cachePool),yf(s,f),Xn(),s.memoizedState=null):(t!==null&&Wl(s,null),Pd(),Xn());return ea(t,s,p,l),s.child}function Bi(t,s){return t!==null&&t.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function vv(t,s,l,c,p){var f=Rd();return f=f===null?null:{parent:Ft._currentValue,pool:f},s.memoizedState={baseLanes:l,cachePool:f},t!==null&&Wl(s,null),Pd(),bf(s),t!==null&&gr(t,s,c,!0),s.childLanes=p,null}function fo(t,s){return s=go({mode:s.mode,children:s.children},t.mode),s.ref=t.ref,t.child=s,s.return=t,s}function gv(t,s,l){return Rs(s,t.child,null,l),t=fo(s,s.pendingProps),t.flags|=2,Sa(s),s.memoizedState=null,t}function kC(t,s,l){var c=s.pendingProps,p=(s.flags&128)!==0;if(s.flags&=-129,t===null){if(st){if(c.mode==="hidden")return t=fo(s,c),s.lanes=536870912,Bi(null,t);if(Kd(s),(t=kt)?(t=Eg(t,_a),t=t!==null&&t.data==="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:zn!==null?{id:tn,overflow:an}:null,retryLane:536870912,hydrationErrors:null},l=Zm(t),l.return=s,s.child=l,Wt=s,kt=null)):t=null,t===null)throw Hn(s);return s.lanes=536870912,null}return fo(s,c)}var f=t.memoizedState;if(f!==null){var A=f.dehydrated;if(Kd(s),p)if(s.flags&256)s.flags&=-257,s=gv(t,s,l);else if(s.memoizedState!==null)s.child=t.child,s.flags|=128,s=null;else throw Error(i(558));else if(zt||gr(t,s,l,!1),p=(l&t.childLanes)!==0,zt||p){if(c=At,c!==null&&(A=As(c,l),A!==0&&A!==f.retryLane))throw f.retryLane=A,ws(t,A),va(c,t,A),cu;wo(),s=gv(t,s,l)}else t=f.treeContext,kt=Ua(A.nextSibling),Wt=s,st=!0,$n=null,_a=!1,t!==null&&af(s,t),s=fo(s,c),s.flags|=4096;return s}return t=bn(t.child,{mode:c.mode,children:c.children}),t.ref=s.ref,s.child=t,t.return=s,t}function vo(t,s){var l=s.ref;if(l===null)t!==null&&t.ref!==null&&(s.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(i(284));(t===null||t.ref!==l)&&(s.flags|=4194816)}}function du(t,s,l,c,p){return Ms(s),l=$d(t,s,l,c,void 0,p),c=Hd(),t!==null&&!zt?(Gd(t,s,p),Sn(t,s,p)):(st&&c&&Sd(s),s.flags|=1,ea(t,s,l,p),s.child)}function yv(t,s,l,c,p,f){return Ms(s),s.updateQueue=null,l=Af(s,c,l,p),jf(t),c=Hd(),t!==null&&!zt?(Gd(t,s,f),Sn(t,s,f)):(st&&c&&Sd(s),s.flags|=1,ea(t,s,l,f),s.child)}function bv(t,s,l,c,p){if(Ms(s),s.stateNode===null){var f=hr,A=l.contextType;typeof A=="object"&&A!==null&&(f=Zt(A)),f=new l(c,f),s.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=lu,s.stateNode=f,f._reactInternals=s,f=s.stateNode,f.props=c,f.state=s.memoizedState,f.refs={},Od(s),A=l.contextType,f.context=typeof A=="object"&&A!==null?Zt(A):hr,f.state=s.memoizedState,A=l.getDerivedStateFromProps,typeof A=="function"&&(iu(s,l,A,c),f.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(A=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),A!==f.state&&lu.enqueueReplaceState(f,f.state,null),Ni(s,c,f,p),wi(),f.state=s.memoizedState),typeof f.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(t===null){f=s.stateNode;var M=s.memoizedProps,$=Os(l,M);f.props=$;var le=f.context,je=l.contextType;A=hr,typeof je=="object"&&je!==null&&(A=Zt(je));var Ce=l.getDerivedStateFromProps;je=typeof Ce=="function"||typeof f.getSnapshotBeforeUpdate=="function",M=s.pendingProps!==M,je||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(M||le!==A)&&rv(s,f,c,A),qn=!1;var ue=s.memoizedState;f.state=ue,Ni(s,c,f,p),wi(),le=s.memoizedState,M||ue!==le||qn?(typeof Ce=="function"&&(iu(s,l,Ce,c),le=s.memoizedState),($=qn||sv(s,l,$,c,ue,le,A))?(je||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(s.flags|=4194308)):(typeof f.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=le),f.props=c,f.state=le,f.context=A,c=$):(typeof f.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{f=s.stateNode,_d(t,s),A=s.memoizedProps,je=Os(l,A),f.props=je,Ce=s.pendingProps,ue=f.context,le=l.contextType,$=hr,typeof le=="object"&&le!==null&&($=Zt(le)),M=l.getDerivedStateFromProps,(le=typeof M=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(A!==Ce||ue!==$)&&rv(s,f,c,$),qn=!1,ue=s.memoizedState,f.state=ue,Ni(s,c,f,p),wi();var me=s.memoizedState;A!==Ce||ue!==me||qn||t!==null&&t.dependencies!==null&&Jl(t.dependencies)?(typeof M=="function"&&(iu(s,l,M,c),me=s.memoizedState),(je=qn||sv(s,l,je,c,ue,me,$)||t!==null&&t.dependencies!==null&&Jl(t.dependencies))?(le||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(c,me,$),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(c,me,$)),typeof f.componentDidUpdate=="function"&&(s.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof f.componentDidUpdate!="function"||A===t.memoizedProps&&ue===t.memoizedState||(s.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||A===t.memoizedProps&&ue===t.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=me),f.props=c,f.state=me,f.context=$,c=je):(typeof f.componentDidUpdate!="function"||A===t.memoizedProps&&ue===t.memoizedState||(s.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||A===t.memoizedProps&&ue===t.memoizedState||(s.flags|=1024),c=!1)}return f=c,vo(t,s),c=(s.flags&128)!==0,f||c?(f=s.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:f.render(),s.flags|=1,t!==null&&c?(s.child=Rs(s,t.child,null,p),s.child=Rs(s,null,l,p)):ea(t,s,l,p),s.memoizedState=f.state,t=s.child):t=Sn(t,s,p),t}function jv(t,s,l,c){return Is(),s.flags|=256,ea(t,s,l,c),s.child}var uu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pu(t){return{baseLanes:t,cachePool:cf()}}function hu(t,s,l){return t=t!==null?t.childLanes&~l:0,s&&(t|=Na),t}function Av(t,s,l){var c=s.pendingProps,p=!1,f=(s.flags&128)!==0,A;if((A=f)||(A=t!==null&&t.memoizedState===null?!1:(Qt.current&2)!==0),A&&(p=!0,s.flags&=-129),A=(s.flags&32)!==0,s.flags&=-33,t===null){if(st){if(p?Jn(s):Xn(),(t=kt)?(t=Eg(t,_a),t=t!==null&&t.data!=="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:zn!==null?{id:tn,overflow:an}:null,retryLane:536870912,hydrationErrors:null},l=Zm(t),l.return=s,s.child=l,Wt=s,kt=null)):t=null,t===null)throw Hn(s);return Yu(t)?s.lanes=32:s.lanes=536870912,null}var M=c.children;return c=c.fallback,p?(Xn(),p=s.mode,M=go({mode:"hidden",children:M},p),c=Ns(c,p,l,null),M.return=s,c.return=s,M.sibling=c,s.child=M,c=s.child,c.memoizedState=pu(l),c.childLanes=hu(t,A,l),s.memoizedState=uu,Bi(null,c)):(Jn(s),mu(s,M))}var $=t.memoizedState;if($!==null&&(M=$.dehydrated,M!==null)){if(f)s.flags&256?(Jn(s),s.flags&=-257,s=fu(t,s,l)):s.memoizedState!==null?(Xn(),s.child=t.child,s.flags|=128,s=null):(Xn(),M=c.fallback,p=s.mode,c=go({mode:"visible",children:c.children},p),M=Ns(M,p,l,null),M.flags|=2,c.return=s,M.return=s,c.sibling=M,s.child=c,Rs(s,t.child,null,l),c=s.child,c.memoizedState=pu(l),c.childLanes=hu(t,A,l),s.memoizedState=uu,s=Bi(null,c));else if(Jn(s),Yu(M)){if(A=M.nextSibling&&M.nextSibling.dataset,A)var le=A.dgst;A=le,c=Error(i(419)),c.stack="",c.digest=A,ji({value:c,source:null,stack:null}),s=fu(t,s,l)}else if(zt||gr(t,s,l,!1),A=(l&t.childLanes)!==0,zt||A){if(A=At,A!==null&&(c=As(A,l),c!==0&&c!==$.retryLane))throw $.retryLane=c,ws(t,c),va(A,t,c),cu;Vu(M)||wo(),s=fu(t,s,l)}else Vu(M)?(s.flags|=192,s.child=t.child,s=null):(t=$.treeContext,kt=Ua(M.nextSibling),Wt=s,st=!0,$n=null,_a=!1,t!==null&&af(s,t),s=mu(s,c.children),s.flags|=4096);return s}return p?(Xn(),M=c.fallback,p=s.mode,$=t.child,le=$.sibling,c=bn($,{mode:"hidden",children:c.children}),c.subtreeFlags=$.subtreeFlags&65011712,le!==null?M=bn(le,M):(M=Ns(M,p,l,null),M.flags|=2),M.return=s,c.return=s,c.sibling=M,s.child=c,Bi(null,c),c=s.child,M=t.child.memoizedState,M===null?M=pu(l):(p=M.cachePool,p!==null?($=Ft._currentValue,p=p.parent!==$?{parent:$,pool:$}:p):p=cf(),M={baseLanes:M.baseLanes|l,cachePool:p}),c.memoizedState=M,c.childLanes=hu(t,A,l),s.memoizedState=uu,Bi(t.child,c)):(Jn(s),l=t.child,t=l.sibling,l=bn(l,{mode:"visible",children:c.children}),l.return=s,l.sibling=null,t!==null&&(A=s.deletions,A===null?(s.deletions=[t],s.flags|=16):A.push(t)),s.child=l,s.memoizedState=null,l)}function mu(t,s){return s=go({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function go(t,s){return t=Ca(22,t,null,s),t.lanes=0,t}function fu(t,s,l){return Rs(s,t.child,null,l),t=mu(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function xv(t,s,l){t.lanes|=s;var c=t.alternate;c!==null&&(c.lanes|=s),Md(t.return,s,l)}function vu(t,s,l,c,p,f){var A=t.memoizedState;A===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:p,treeForkCount:f}:(A.isBackwards=s,A.rendering=null,A.renderingStartTime=0,A.last=c,A.tail=l,A.tailMode=p,A.treeForkCount=f)}function Cv(t,s,l){var c=s.pendingProps,p=c.revealOrder,f=c.tail;c=c.children;var A=Qt.current,M=(A&2)!==0;if(M?(A=A&1|2,s.flags|=128):A&=1,K(Qt,A),ea(t,s,c,l),c=st?bi:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&xv(t,l,s);else if(t.tag===19)xv(t,l,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(l=s.child,p=null;l!==null;)t=l.alternate,t!==null&&so(t)===null&&(p=l),l=l.sibling;l=p,l===null?(p=s.child,s.child=null):(p=l.sibling,l.sibling=null),vu(s,!1,p,l,f,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=s.child,s.child=null;p!==null;){if(t=p.alternate,t!==null&&so(t)===null){s.child=p;break}t=p.sibling,p.sibling=l,l=p,p=t}vu(s,!0,l,null,f,c);break;case"together":vu(s,!1,null,null,void 0,c);break;default:s.memoizedState=null}return s.child}function Sn(t,s,l){if(t!==null&&(s.dependencies=t.dependencies),es|=s.lanes,(l&s.childLanes)===0)if(t!==null){if(gr(t,s,l,!1),(l&s.childLanes)===0)return null}else return null;if(t!==null&&s.child!==t.child)throw Error(i(153));if(s.child!==null){for(t=s.child,l=bn(t,t.pendingProps),s.child=l,l.return=s;t.sibling!==null;)t=t.sibling,l=l.sibling=bn(t,t.pendingProps),l.return=s;l.sibling=null}return s.child}function gu(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&Jl(t)))}function SC(t,s,l){switch(s.tag){case 3:ae(s,s.stateNode.containerInfo),Gn(s,Ft,t.memoizedState.cache),Is();break;case 27:case 5:w(s);break;case 4:ae(s,s.stateNode.containerInfo);break;case 10:Gn(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Kd(s),null;break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(Jn(s),s.flags|=128,null):(l&s.child.childLanes)!==0?Av(t,s,l):(Jn(s),t=Sn(t,s,l),t!==null?t.sibling:null);Jn(s);break;case 19:var p=(t.flags&128)!==0;if(c=(l&s.childLanes)!==0,c||(gr(t,s,l,!1),c=(l&s.childLanes)!==0),p){if(c)return Cv(t,s,l);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),K(Qt,Qt.current),c)break;return null;case 22:return s.lanes=0,fv(t,s,l,s.pendingProps);case 24:Gn(s,Ft,t.memoizedState.cache)}return Sn(t,s,l)}function kv(t,s,l){if(t!==null)if(t.memoizedProps!==s.pendingProps)zt=!0;else{if(!gu(t,l)&&(s.flags&128)===0)return zt=!1,SC(t,s,l);zt=(t.flags&131072)!==0}else zt=!1,st&&(s.flags&1048576)!==0&&tf(s,bi,s.index);switch(s.lanes=0,s.tag){case 16:e:{var c=s.pendingProps;if(t=Bs(s.elementType),s.type=t,typeof t=="function")xd(t)?(c=Os(t,c),s.tag=1,s=bv(null,s,t,c,l)):(s.tag=0,s=du(null,s,t,c,l));else{if(t!=null){var p=t.$$typeof;if(p===L){s.tag=11,s=pv(null,s,t,c,l);break e}else if(p===R){s.tag=14,s=hv(null,s,t,c,l);break e}}throw s=fe(t)||t,Error(i(306,s,""))}}return s;case 0:return du(t,s,s.type,s.pendingProps,l);case 1:return c=s.type,p=Os(c,s.pendingProps),bv(t,s,c,p,l);case 3:e:{if(ae(s,s.stateNode.containerInfo),t===null)throw Error(i(387));c=s.pendingProps;var f=s.memoizedState;p=f.element,_d(t,s),Ni(s,c,null,l);var A=s.memoizedState;if(c=A.cache,Gn(s,Ft,c),c!==f.cache&&Td(s,[Ft],l,!0),wi(),c=A.element,f.isDehydrated)if(f={element:c,isDehydrated:!1,cache:A.cache},s.updateQueue.baseState=f,s.memoizedState=f,s.flags&256){s=jv(t,s,c,l);break e}else if(c!==p){p=Ra(Error(i(424)),s),ji(p),s=jv(t,s,c,l);break e}else for(t=s.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,kt=Ua(t.firstChild),Wt=s,st=!0,$n=null,_a=!0,l=ff(s,null,c,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Is(),c===p){s=Sn(t,s,l);break e}ea(t,s,c,l)}s=s.child}return s;case 26:return vo(t,s),t===null?(l=Lg(s.type,null,s.pendingProps,null))?s.memoizedState=l:st||(l=s.type,t=s.pendingProps,c=Do(se.current).createElement(l),c[Xt]=s,c[da]=t,ta(c,l,t),Gt(c),s.stateNode=c):s.memoizedState=Lg(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return w(s),t===null&&st&&(c=s.stateNode=Bg(s.type,s.pendingProps,se.current),Wt=s,_a=!0,p=kt,rs(s.type)?(Ju=p,kt=Ua(c.firstChild)):kt=p),ea(t,s,s.pendingProps.children,l),vo(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&st&&((p=c=kt)&&(c=tk(c,s.type,s.pendingProps,_a),c!==null?(s.stateNode=c,Wt=s,kt=Ua(c.firstChild),_a=!1,p=!0):p=!1),p||Hn(s)),w(s),p=s.type,f=s.pendingProps,A=t!==null?t.memoizedProps:null,c=f.children,Hu(p,f)?c=null:A!==null&&Hu(p,A)&&(s.flags|=32),s.memoizedState!==null&&(p=$d(t,s,vC,null,null,l),qi._currentValue=p),vo(t,s),ea(t,s,c,l),s.child;case 6:return t===null&&st&&((t=l=kt)&&(l=ak(l,s.pendingProps,_a),l!==null?(s.stateNode=l,Wt=s,kt=null,t=!0):t=!1),t||Hn(s)),null;case 13:return Av(t,s,l);case 4:return ae(s,s.stateNode.containerInfo),c=s.pendingProps,t===null?s.child=Rs(s,null,c,l):ea(t,s,c,l),s.child;case 11:return pv(t,s,s.type,s.pendingProps,l);case 7:return ea(t,s,s.pendingProps,l),s.child;case 8:return ea(t,s,s.pendingProps.children,l),s.child;case 12:return ea(t,s,s.pendingProps.children,l),s.child;case 10:return c=s.pendingProps,Gn(s,s.type,c.value),ea(t,s,c.children,l),s.child;case 9:return p=s.type._context,c=s.pendingProps.children,Ms(s),p=Zt(p),c=c(p),s.flags|=1,ea(t,s,c,l),s.child;case 14:return hv(t,s,s.type,s.pendingProps,l);case 15:return mv(t,s,s.type,s.pendingProps,l);case 19:return Cv(t,s,l);case 31:return kC(t,s,l);case 22:return fv(t,s,l,s.pendingProps);case 24:return Ms(s),c=Zt(Ft),t===null?(p=Rd(),p===null&&(p=At,f=Bd(),p.pooledCache=f,f.refCount++,f!==null&&(p.pooledCacheLanes|=l),p=f),s.memoizedState={parent:c,cache:p},Od(s),Gn(s,Ft,p)):((t.lanes&l)!==0&&(_d(t,s),Ni(s,null,null,l),wi()),p=t.memoizedState,f=s.memoizedState,p.parent!==c?(p={parent:c,cache:c},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),Gn(s,Ft,c)):(c=f.cache,Gn(s,Ft,c),c!==p.cache&&Td(s,[Ft],l,!0))),ea(t,s,s.pendingProps.children,l),s.child;case 29:throw s.pendingProps}throw Error(i(156,s.tag))}function wn(t){t.flags|=4}function yu(t,s,l,c,p){if((s=(t.mode&32)!==0)&&(s=!1),s){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(Xv())t.flags|=8192;else throw Ds=eo,Ld}else t.flags&=-16777217}function Sv(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Pg(s))if(Xv())t.flags|=8192;else throw Ds=eo,Ld}function yo(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?jt():536870912,t.lanes|=s,Er|=s)}function Di(t,s){if(!st)switch(t.tailMode){case"hidden":s=t.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function St(t){var s=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(s)for(var p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)l|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=c,t.childLanes=l,s}function wC(t,s,l){var c=s.pendingProps;switch(wd(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(s),null;case 1:return St(s),null;case 3:return l=s.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),xn(Ft),ce(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(vr(s)?wn(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Id())),St(s),null;case 26:var p=s.type,f=s.memoizedState;return t===null?(wn(s),f!==null?(St(s),Sv(s,f)):(St(s),yu(s,p,null,c,l))):f?f!==t.memoizedState?(wn(s),St(s),Sv(s,f)):(St(s),s.flags&=-16777217):(t=t.memoizedProps,t!==c&&wn(s),St(s),yu(s,p,t,c,l)),null;case 27:if(F(s),l=se.current,p=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==c&&wn(s);else{if(!c){if(s.stateNode===null)throw Error(i(166));return St(s),null}t=ee.current,vr(s)?nf(s):(t=Bg(p,c,l),s.stateNode=t,wn(s))}return St(s),null;case 5:if(F(s),p=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==c&&wn(s);else{if(!c){if(s.stateNode===null)throw Error(i(166));return St(s),null}if(f=ee.current,vr(s))nf(s);else{var A=Do(se.current);switch(f){case 1:f=A.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:f=A.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":f=A.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":f=A.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":f=A.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof c.is=="string"?A.createElement("select",{is:c.is}):A.createElement("select"),c.multiple?f.multiple=!0:c.size&&(f.size=c.size);break;default:f=typeof c.is=="string"?A.createElement(p,{is:c.is}):A.createElement(p)}}f[Xt]=s,f[da]=c;e:for(A=s.child;A!==null;){if(A.tag===5||A.tag===6)f.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===s)break e;for(;A.sibling===null;){if(A.return===null||A.return===s)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}s.stateNode=f;e:switch(ta(f,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&wn(s)}}return St(s),yu(s,s.type,t===null?null:t.memoizedProps,s.pendingProps,l),null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==c&&wn(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(i(166));if(t=se.current,vr(s)){if(t=s.stateNode,l=s.memoizedProps,c=null,p=Wt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}t[Xt]=s,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||Ag(t.nodeValue,l)),t||Hn(s,!0)}else t=Do(t).createTextNode(c),t[Xt]=s,s.stateNode=t}return St(s),null;case 31:if(l=s.memoizedState,t===null||t.memoizedState!==null){if(c=vr(s),l!==null){if(t===null){if(!c)throw Error(i(318));if(t=s.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[Xt]=s}else Is(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;St(s),t=!1}else l=Id(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return s.flags&256?(Sa(s),s):(Sa(s),null);if((s.flags&128)!==0)throw Error(i(558))}return St(s),null;case 13:if(c=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=vr(s),c!==null&&c.dehydrated!==null){if(t===null){if(!p)throw Error(i(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[Xt]=s}else Is(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;St(s),p=!1}else p=Id(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(Sa(s),s):(Sa(s),null)}return Sa(s),(s.flags&128)!==0?(s.lanes=l,s):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=s.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),f=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(f=c.memoizedState.cachePool.pool),f!==p&&(c.flags|=2048)),l!==t&&l&&(s.child.flags|=8192),yo(s,s.updateQueue),St(s),null);case 4:return ce(),t===null&&Pu(s.stateNode.containerInfo),St(s),null;case 10:return xn(s.type),St(s),null;case 19:if(_(Qt),c=s.memoizedState,c===null)return St(s),null;if(p=(s.flags&128)!==0,f=c.rendering,f===null)if(p)Di(c,!1);else{if(Ot!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(f=so(t),f!==null){for(s.flags|=128,Di(c,!1),t=f.updateQueue,s.updateQueue=t,yo(s,t),s.subtreeFlags=0,t=l,l=s.child;l!==null;)Wm(l,t),l=l.sibling;return K(Qt,Qt.current&1|2),st&&jn(s,c.treeForkCount),s.child}t=t.sibling}c.tail!==null&&Be()>Co&&(s.flags|=128,p=!0,Di(c,!1),s.lanes=4194304)}else{if(!p)if(t=so(f),t!==null){if(s.flags|=128,p=!0,t=t.updateQueue,s.updateQueue=t,yo(s,t),Di(c,!0),c.tail===null&&c.tailMode==="hidden"&&!f.alternate&&!st)return St(s),null}else 2*Be()-c.renderingStartTime>Co&&l!==536870912&&(s.flags|=128,p=!0,Di(c,!1),s.lanes=4194304);c.isBackwards?(f.sibling=s.child,s.child=f):(t=c.last,t!==null?t.sibling=f:s.child=f,c.last=f)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Be(),t.sibling=null,l=Qt.current,K(Qt,p?l&1|2:l&1),st&&jn(s,c.treeForkCount),t):(St(s),null);case 22:case 23:return Sa(s),Fd(),c=s.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(l&536870912)!==0&&(s.flags&128)===0&&(St(s),s.subtreeFlags&6&&(s.flags|=8192)):St(s),l=s.updateQueue,l!==null&&yo(s,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==l&&(s.flags|=2048),t!==null&&_(Ts),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),xn(Ft),St(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function NC(t,s){switch(wd(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return xn(Ft),ce(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return F(s),null;case 31:if(s.memoizedState!==null){if(Sa(s),s.alternate===null)throw Error(i(340));Is()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 13:if(Sa(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(i(340));Is()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return _(Qt),null;case 4:return ce(),null;case 10:return xn(s.type),null;case 22:case 23:return Sa(s),Fd(),t!==null&&_(Ts),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return xn(Ft),null;case 25:return null;default:return null}}function wv(t,s){switch(wd(s),s.tag){case 3:xn(Ft),ce();break;case 26:case 27:case 5:F(s);break;case 4:ce();break;case 31:s.memoizedState!==null&&Sa(s);break;case 13:Sa(s);break;case 19:_(Qt);break;case 10:xn(s.type);break;case 22:case 23:Sa(s),Fd(),t!==null&&_(Ts);break;case 24:xn(Ft)}}function Ri(t,s){try{var l=s.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var p=c.next;l=p;do{if((l.tag&t)===t){c=void 0;var f=l.create,A=l.inst;c=f(),A.destroy=c}l=l.next}while(l!==p)}}catch(M){ht(s,s.return,M)}}function Wn(t,s,l){try{var c=s.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var f=p.next;c=f;do{if((c.tag&t)===t){var A=c.inst,M=A.destroy;if(M!==void 0){A.destroy=void 0,p=s;var $=l,le=M;try{le()}catch(je){ht(p,$,je)}}}c=c.next}while(c!==f)}}catch(je){ht(s,s.return,je)}}function Nv(t){var s=t.updateQueue;if(s!==null){var l=t.stateNode;try{gf(s,l)}catch(c){ht(t,t.return,c)}}}function Iv(t,s,l){l.props=Os(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){ht(t,s,c)}}function Li(t,s){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(p){ht(t,s,p)}}function nn(t,s){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(p){ht(t,s,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){ht(t,s,p)}else l.current=null}function Ev(t){var s=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(p){ht(t,t.return,p)}}function bu(t,s,l){try{var c=t.stateNode;YC(c,t.type,l,s),c[da]=s}catch(p){ht(t,t.return,p)}}function Mv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&rs(t.type)||t.tag===4}function ju(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Mv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&rs(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Au(t,s,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,s?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,s):(s=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,s.appendChild(t),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=gn));else if(c!==4&&(c===27&&rs(t.type)&&(l=t.stateNode,s=null),t=t.child,t!==null))for(Au(t,s,l),t=t.sibling;t!==null;)Au(t,s,l),t=t.sibling}function bo(t,s,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,s?l.insertBefore(t,s):l.appendChild(t);else if(c!==4&&(c===27&&rs(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(bo(t,s,l),t=t.sibling;t!==null;)bo(t,s,l),t=t.sibling}function Tv(t){var s=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);ta(s,c,l),s[Xt]=t,s[da]=l}catch(f){ht(t,t.return,f)}}var Nn=!1,$t=!1,xu=!1,Bv=typeof WeakSet=="function"?WeakSet:Set,qt=null;function IC(t,s){if(t=t.containerInfo,zu=Po,t=zm(t),fd(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var p=c.anchorOffset,f=c.focusNode;c=c.focusOffset;try{l.nodeType,f.nodeType}catch{l=null;break e}var A=0,M=-1,$=-1,le=0,je=0,Ce=t,ue=null;t:for(;;){for(var me;Ce!==l||p!==0&&Ce.nodeType!==3||(M=A+p),Ce!==f||c!==0&&Ce.nodeType!==3||($=A+c),Ce.nodeType===3&&(A+=Ce.nodeValue.length),(me=Ce.firstChild)!==null;)ue=Ce,Ce=me;for(;;){if(Ce===t)break t;if(ue===l&&++le===p&&(M=A),ue===f&&++je===c&&($=A),(me=Ce.nextSibling)!==null)break;Ce=ue,ue=Ce.parentNode}Ce=me}l=M===-1||$===-1?null:{start:M,end:$}}else l=null}l=l||{start:0,end:0}}else l=null;for($u={focusedElem:t,selectionRange:l},Po=!1,qt=s;qt!==null;)if(s=qt,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,qt=t;else for(;qt!==null;){switch(s=qt,f=s.alternate,t=s.flags,s.tag){case 0:if((t&4)!==0&&(t=s.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)p=t[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&f!==null){t=void 0,l=s,p=f.memoizedProps,f=f.memoizedState,c=l.stateNode;try{var Re=Os(l.type,p);t=c.getSnapshotBeforeUpdate(Re,f),c.__reactInternalSnapshotBeforeUpdate=t}catch($e){ht(l,l.return,$e)}}break;case 3:if((t&1024)!==0){if(t=s.stateNode.containerInfo,l=t.nodeType,l===9)qu(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":qu(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=s.sibling,t!==null){t.return=s.return,qt=t;break}qt=s.return}}function Dv(t,s,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:En(t,l),c&4&&Ri(5,l);break;case 1:if(En(t,l),c&4)if(t=l.stateNode,s===null)try{t.componentDidMount()}catch(A){ht(l,l.return,A)}else{var p=Os(l.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(p,s,t.__reactInternalSnapshotBeforeUpdate)}catch(A){ht(l,l.return,A)}}c&64&&Nv(l),c&512&&Li(l,l.return);break;case 3:if(En(t,l),c&64&&(t=l.updateQueue,t!==null)){if(s=null,l.child!==null)switch(l.child.tag){case 27:case 5:s=l.child.stateNode;break;case 1:s=l.child.stateNode}try{gf(t,s)}catch(A){ht(l,l.return,A)}}break;case 27:s===null&&c&4&&Tv(l);case 26:case 5:En(t,l),s===null&&c&4&&Ev(l),c&512&&Li(l,l.return);break;case 12:En(t,l);break;case 31:En(t,l),c&4&&Ov(t,l);break;case 13:En(t,l),c&4&&_v(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=_C.bind(null,l),nk(t,l))));break;case 22:if(c=l.memoizedState!==null||Nn,!c){s=s!==null&&s.memoizedState!==null||$t,p=Nn;var f=$t;Nn=c,($t=s)&&!f?Mn(t,l,(l.subtreeFlags&8772)!==0):En(t,l),Nn=p,$t=f}break;case 30:break;default:En(t,l)}}function Rv(t){var s=t.alternate;s!==null&&(t.alternate=null,Rv(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&Wc(s)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Tt=null,pa=!1;function In(t,s,l){for(l=l.child;l!==null;)Lv(t,s,l),l=l.sibling}function Lv(t,s,l){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(Te,l)}catch{}switch(l.tag){case 26:$t||nn(l,s),In(t,s,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:$t||nn(l,s);var c=Tt,p=pa;rs(l.type)&&(Tt=l.stateNode,pa=!1),In(t,s,l),$i(l.stateNode),Tt=c,pa=p;break;case 5:$t||nn(l,s);case 6:if(c=Tt,p=pa,Tt=null,In(t,s,l),Tt=c,pa=p,Tt!==null)if(pa)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(l.stateNode)}catch(f){ht(l,s,f)}else try{Tt.removeChild(l.stateNode)}catch(f){ht(l,s,f)}break;case 18:Tt!==null&&(pa?(t=Tt,Ng(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),_r(t)):Ng(Tt,l.stateNode));break;case 4:c=Tt,p=pa,Tt=l.stateNode.containerInfo,pa=!0,In(t,s,l),Tt=c,pa=p;break;case 0:case 11:case 14:case 15:Wn(2,l,s),$t||Wn(4,l,s),In(t,s,l);break;case 1:$t||(nn(l,s),c=l.stateNode,typeof c.componentWillUnmount=="function"&&Iv(l,s,c)),In(t,s,l);break;case 21:In(t,s,l);break;case 22:$t=(c=$t)||l.memoizedState!==null,In(t,s,l),$t=c;break;default:In(t,s,l)}}function Ov(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{_r(t)}catch(l){ht(s,s.return,l)}}}function _v(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{_r(t)}catch(l){ht(s,s.return,l)}}function EC(t){switch(t.tag){case 31:case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new Bv),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new Bv),s;default:throw Error(i(435,t.tag))}}function jo(t,s){var l=EC(t);s.forEach(function(c){if(!l.has(c)){l.add(c);var p=QC.bind(null,t,c);c.then(p,p)}})}function ha(t,s){var l=s.deletions;if(l!==null)for(var c=0;c<l.length;c++){var p=l[c],f=t,A=s,M=A;e:for(;M!==null;){switch(M.tag){case 27:if(rs(M.type)){Tt=M.stateNode,pa=!1;break e}break;case 5:Tt=M.stateNode,pa=!1;break e;case 3:case 4:Tt=M.stateNode.containerInfo,pa=!0;break e}M=M.return}if(Tt===null)throw Error(i(160));Lv(f,A,p),Tt=null,pa=!1,f=p.alternate,f!==null&&(f.return=null),p.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Qv(s,t),s=s.sibling}var Ja=null;function Qv(t,s){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ha(s,t),ma(t),c&4&&(Wn(3,t,t.return),Ri(3,t),Wn(5,t,t.return));break;case 1:ha(s,t),ma(t),c&512&&($t||l===null||nn(l,l.return)),c&64&&Nn&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var p=Ja;if(ha(s,t),ma(t),c&512&&($t||l===null||nn(l,l.return)),c&4){var f=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":f=p.getElementsByTagName("title")[0],(!f||f[oi]||f[Xt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=p.createElement(c),p.head.insertBefore(f,p.querySelector("head > title"))),ta(f,c,l),f[Xt]=t,Gt(f),c=f;break e;case"link":var A=Qg("link","href",p).get(c+(l.href||""));if(A){for(var M=0;M<A.length;M++)if(f=A[M],f.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&f.getAttribute("rel")===(l.rel==null?null:l.rel)&&f.getAttribute("title")===(l.title==null?null:l.title)&&f.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){A.splice(M,1);break t}}f=p.createElement(c),ta(f,c,l),p.head.appendChild(f);break;case"meta":if(A=Qg("meta","content",p).get(c+(l.content||""))){for(M=0;M<A.length;M++)if(f=A[M],f.getAttribute("content")===(l.content==null?null:""+l.content)&&f.getAttribute("name")===(l.name==null?null:l.name)&&f.getAttribute("property")===(l.property==null?null:l.property)&&f.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&f.getAttribute("charset")===(l.charSet==null?null:l.charSet)){A.splice(M,1);break t}}f=p.createElement(c),ta(f,c,l),p.head.appendChild(f);break;default:throw Error(i(468,c))}f[Xt]=t,Gt(f),c=f}t.stateNode=c}else Ug(p,t.type,t.stateNode);else t.stateNode=_g(p,c,t.memoizedProps);else f!==c?(f===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):f.count--,c===null?Ug(p,t.type,t.stateNode):_g(p,c,t.memoizedProps)):c===null&&t.stateNode!==null&&bu(t,t.memoizedProps,l.memoizedProps)}break;case 27:ha(s,t),ma(t),c&512&&($t||l===null||nn(l,l.return)),l!==null&&c&4&&bu(t,t.memoizedProps,l.memoizedProps);break;case 5:if(ha(s,t),ma(t),c&512&&($t||l===null||nn(l,l.return)),t.flags&32){p=t.stateNode;try{ir(p,"")}catch(Re){ht(t,t.return,Re)}}c&4&&t.stateNode!=null&&(p=t.memoizedProps,bu(t,p,l!==null?l.memoizedProps:p)),c&1024&&(xu=!0);break;case 6:if(ha(s,t),ma(t),c&4){if(t.stateNode===null)throw Error(i(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(Re){ht(t,t.return,Re)}}break;case 3:if(Oo=null,p=Ja,Ja=Ro(s.containerInfo),ha(s,t),Ja=p,ma(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{_r(s.containerInfo)}catch(Re){ht(t,t.return,Re)}xu&&(xu=!1,Uv(t));break;case 4:c=Ja,Ja=Ro(t.stateNode.containerInfo),ha(s,t),ma(t),Ja=c;break;case 12:ha(s,t),ma(t);break;case 31:ha(s,t),ma(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,jo(t,c)));break;case 13:ha(s,t),ma(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(xo=Be()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,jo(t,c)));break;case 22:p=t.memoizedState!==null;var $=l!==null&&l.memoizedState!==null,le=Nn,je=$t;if(Nn=le||p,$t=je||$,ha(s,t),$t=je,Nn=le,ma(t),c&8192)e:for(s=t.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(l===null||$||Nn||$t||_s(t)),l=null,s=t;;){if(s.tag===5||s.tag===26){if(l===null){$=l=s;try{if(f=$.stateNode,p)A=f.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{M=$.stateNode;var Ce=$.memoizedProps.style,ue=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;M.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Re){ht($,$.return,Re)}}}else if(s.tag===6){if(l===null){$=s;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(Re){ht($,$.return,Re)}}}else if(s.tag===18){if(l===null){$=s;try{var me=$.stateNode;p?Ig(me,!0):Ig($.stateNode,!1)}catch(Re){ht($,$.return,Re)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;l===s&&(l=null),s=s.return}l===s&&(l=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,jo(t,l))));break;case 19:ha(s,t),ma(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,jo(t,c)));break;case 30:break;case 21:break;default:ha(s,t),ma(t)}}function ma(t){var s=t.flags;if(s&2){try{for(var l,c=t.return;c!==null;){if(Mv(c)){l=c;break}c=c.return}if(l==null)throw Error(i(160));switch(l.tag){case 27:var p=l.stateNode,f=ju(t);bo(t,f,p);break;case 5:var A=l.stateNode;l.flags&32&&(ir(A,""),l.flags&=-33);var M=ju(t);bo(t,M,A);break;case 3:case 4:var $=l.stateNode.containerInfo,le=ju(t);Au(t,le,$);break;default:throw Error(i(161))}}catch(je){ht(t,t.return,je)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function Uv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;Uv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),t=t.sibling}}function En(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Dv(t,s.alternate,s),s=s.sibling}function _s(t){for(t=t.child;t!==null;){var s=t;switch(s.tag){case 0:case 11:case 14:case 15:Wn(4,s,s.return),_s(s);break;case 1:nn(s,s.return);var l=s.stateNode;typeof l.componentWillUnmount=="function"&&Iv(s,s.return,l),_s(s);break;case 27:$i(s.stateNode);case 26:case 5:nn(s,s.return),_s(s);break;case 22:s.memoizedState===null&&_s(s);break;case 30:_s(s);break;default:_s(s)}t=t.sibling}}function Mn(t,s,l){for(l=l&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,p=t,f=s,A=f.flags;switch(f.tag){case 0:case 11:case 15:Mn(p,f,l),Ri(4,f);break;case 1:if(Mn(p,f,l),c=f,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(le){ht(c,c.return,le)}if(c=f,p=c.updateQueue,p!==null){var M=c.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)vf($[p],M)}catch(le){ht(c,c.return,le)}}l&&A&64&&Nv(f),Li(f,f.return);break;case 27:Tv(f);case 26:case 5:Mn(p,f,l),l&&c===null&&A&4&&Ev(f),Li(f,f.return);break;case 12:Mn(p,f,l);break;case 31:Mn(p,f,l),l&&A&4&&Ov(p,f);break;case 13:Mn(p,f,l),l&&A&4&&_v(p,f);break;case 22:f.memoizedState===null&&Mn(p,f,l),Li(f,f.return);break;case 30:break;default:Mn(p,f,l)}s=s.sibling}}function Cu(t,s){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(t=s.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Ai(l))}function ku(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Ai(t))}function Xa(t,s,l,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Pv(t,s,l,c),s=s.sibling}function Pv(t,s,l,c){var p=s.flags;switch(s.tag){case 0:case 11:case 15:Xa(t,s,l,c),p&2048&&Ri(9,s);break;case 1:Xa(t,s,l,c);break;case 3:Xa(t,s,l,c),p&2048&&(t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Ai(t)));break;case 12:if(p&2048){Xa(t,s,l,c),t=s.stateNode;try{var f=s.memoizedProps,A=f.id,M=f.onPostCommit;typeof M=="function"&&M(A,s.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch($){ht(s,s.return,$)}}else Xa(t,s,l,c);break;case 31:Xa(t,s,l,c);break;case 13:Xa(t,s,l,c);break;case 23:break;case 22:f=s.stateNode,A=s.alternate,s.memoizedState!==null?f._visibility&2?Xa(t,s,l,c):Oi(t,s):f._visibility&2?Xa(t,s,l,c):(f._visibility|=2,wr(t,s,l,c,(s.subtreeFlags&10256)!==0||!1)),p&2048&&Cu(A,s);break;case 24:Xa(t,s,l,c),p&2048&&ku(s.alternate,s);break;default:Xa(t,s,l,c)}}function wr(t,s,l,c,p){for(p=p&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var f=t,A=s,M=l,$=c,le=A.flags;switch(A.tag){case 0:case 11:case 15:wr(f,A,M,$,p),Ri(8,A);break;case 23:break;case 22:var je=A.stateNode;A.memoizedState!==null?je._visibility&2?wr(f,A,M,$,p):Oi(f,A):(je._visibility|=2,wr(f,A,M,$,p)),p&&le&2048&&Cu(A.alternate,A);break;case 24:wr(f,A,M,$,p),p&&le&2048&&ku(A.alternate,A);break;default:wr(f,A,M,$,p)}s=s.sibling}}function Oi(t,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var l=t,c=s,p=c.flags;switch(c.tag){case 22:Oi(l,c),p&2048&&Cu(c.alternate,c);break;case 24:Oi(l,c),p&2048&&ku(c.alternate,c);break;default:Oi(l,c)}s=s.sibling}}var _i=8192;function Nr(t,s,l){if(t.subtreeFlags&_i)for(t=t.child;t!==null;)Fv(t,s,l),t=t.sibling}function Fv(t,s,l){switch(t.tag){case 26:Nr(t,s,l),t.flags&_i&&t.memoizedState!==null&&fk(l,Ja,t.memoizedState,t.memoizedProps);break;case 5:Nr(t,s,l);break;case 3:case 4:var c=Ja;Ja=Ro(t.stateNode.containerInfo),Nr(t,s,l),Ja=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=_i,_i=16777216,Nr(t,s,l),_i=c):Nr(t,s,l));break;default:Nr(t,s,l)}}function Kv(t){var s=t.alternate;if(s!==null&&(t=s.child,t!==null)){s.child=null;do s=t.sibling,t.sibling=null,t=s;while(t!==null)}}function Qi(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var c=s[l];qt=c,$v(c,t)}Kv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)zv(t),t=t.sibling}function zv(t){switch(t.tag){case 0:case 11:case 15:Qi(t),t.flags&2048&&Wn(9,t,t.return);break;case 3:Qi(t);break;case 12:Qi(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,Ao(t)):Qi(t);break;default:Qi(t)}}function Ao(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var l=0;l<s.length;l++){var c=s[l];qt=c,$v(c,t)}Kv(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:Wn(8,s,s.return),Ao(s);break;case 22:l=s.stateNode,l._visibility&2&&(l._visibility&=-3,Ao(s));break;default:Ao(s)}t=t.sibling}}function $v(t,s){for(;qt!==null;){var l=qt;switch(l.tag){case 0:case 11:case 15:Wn(8,l,s);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ai(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,qt=c;else e:for(l=t;qt!==null;){c=qt;var p=c.sibling,f=c.return;if(Rv(c),c===l){qt=null;break e}if(p!==null){p.return=f,qt=p;break e}qt=f}}}var MC={getCacheForType:function(t){var s=Zt(Ft),l=s.data.get(t);return l===void 0&&(l=t(),s.data.set(t,l)),l},cacheSignal:function(){return Zt(Ft).controller.signal}},TC=typeof WeakMap=="function"?WeakMap:Map,dt=0,At=null,Ze=null,at=0,pt=0,wa=null,Zn=!1,Ir=!1,Su=!1,Tn=0,Ot=0,es=0,Qs=0,wu=0,Na=0,Er=0,Ui=null,fa=null,Nu=!1,xo=0,Hv=0,Co=1/0,ko=null,ts=null,Ht=0,as=null,Mr=null,Bn=0,Iu=0,Eu=null,Gv=null,Pi=0,Mu=null;function Ia(){return(dt&2)!==0&&at!==0?at&-at:G.T!==null?Ou():lm()}function qv(){if(Na===0)if((at&536870912)===0||st){var t=Jt;Jt<<=1,(Jt&3932160)===0&&(Jt=262144),Na=t}else Na=536870912;return t=ka.current,t!==null&&(t.flags|=32),Na}function va(t,s,l){(t===At&&(pt===2||pt===9)||t.cancelPendingCommit!==null)&&(Tr(t,0),ns(t,at,Na,!1)),rt(t,l),((dt&2)===0||t!==At)&&(t===At&&((dt&2)===0&&(Qs|=l),Ot===4&&ns(t,at,Na,!1)),sn(t))}function Vv(t,s,l){if((dt&6)!==0)throw Error(i(327));var c=!l&&(s&127)===0&&(s&t.expiredLanes)===0||Qe(t,s),p=c?RC(t,s):Bu(t,s,!0),f=c;do{if(p===0){Ir&&!c&&ns(t,s,0,!1);break}else{if(l=t.current.alternate,f&&!BC(l)){p=Bu(t,s,!1),f=!1;continue}if(p===2){if(f=s,t.errorRecoveryDisabledLanes&f)var A=0;else A=t.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){s=A;e:{var M=t;p=Ui;var $=M.current.memoizedState.isDehydrated;if($&&(Tr(M,A).flags|=256),A=Bu(M,A,!1),A!==2){if(Su&&!$){M.errorRecoveryDisabledLanes|=f,Qs|=f,p=4;break e}f=fa,fa=p,f!==null&&(fa===null?fa=f:fa.push.apply(fa,f))}p=A}if(f=!1,p!==2)continue}}if(p===1){Tr(t,0),ns(t,s,0,!0);break}e:{switch(c=t,f=p,f){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:ns(c,s,Na,!Zn);break e;case 2:fa=null;break;case 3:case 5:break;default:throw Error(i(329))}if((s&62914560)===s&&(p=xo+300-Be(),10<p)){if(ns(c,s,Na,!Zn),De(c,0,!0)!==0)break e;Bn=s,c.timeoutHandle=Sg(Yv.bind(null,c,l,fa,ko,Nu,s,Na,Qs,Er,Zn,f,"Throttled",-0,0),p);break e}Yv(c,l,fa,ko,Nu,s,Na,Qs,Er,Zn,f,null,-0,0)}}break}while(!0);sn(t)}function Yv(t,s,l,c,p,f,A,M,$,le,je,Ce,ue,me){if(t.timeoutHandle=-1,Ce=s.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gn},Fv(s,f,Ce);var Re=(f&62914560)===f?xo-Be():(f&4194048)===f?Hv-Be():0;if(Re=vk(Ce,Re),Re!==null){Bn=f,t.cancelPendingCommit=Re(ng.bind(null,t,s,f,l,c,p,A,M,$,je,Ce,null,ue,me)),ns(t,f,A,!le);return}}ng(t,s,f,l,c,p,A,M,$)}function BC(t){for(var s=t;;){var l=s.tag;if((l===0||l===11||l===15)&&s.flags&16384&&(l=s.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var p=l[c],f=p.getSnapshot;p=p.value;try{if(!xa(f(),p))return!1}catch{return!1}}if(l=s.child,s.subtreeFlags&16384&&l!==null)l.return=s,s=l;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ns(t,s,l,c){s&=~wu,s&=~Qs,t.suspendedLanes|=s,t.pingedLanes&=~s,c&&(t.warmLanes|=s),c=t.expirationTimes;for(var p=s;0<p;){var f=31-ze(p),A=1<<f;c[f]=-1,p&=~A}l!==0&&Rt(t,l,s)}function So(){return(dt&6)===0?(Fi(0),!1):!0}function Tu(){if(Ze!==null){if(pt===0)var t=Ze.return;else t=Ze,An=Es=null,qd(t),Ar=null,Ci=0,t=Ze;for(;t!==null;)wv(t.alternate,t),t=t.return;Ze=null}}function Tr(t,s){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,WC(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Bn=0,Tu(),At=t,Ze=l=bn(t.current,null),at=s,pt=0,wa=null,Zn=!1,Ir=Qe(t,s),Su=!1,Er=Na=wu=Qs=es=Ot=0,fa=Ui=null,Nu=!1,(s&8)!==0&&(s|=s&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=s;0<c;){var p=31-ze(c),f=1<<p;s|=t[p],c&=~f}return Tn=s,Hl(),l}function Jv(t,s){Ve=null,G.H=Ti,s===jr||s===Zl?(s=pf(),pt=3):s===Ld?(s=pf(),pt=4):pt=s===cu?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,wa=s,Ze===null&&(Ot=1,mo(t,Ra(s,t.current)))}function Xv(){var t=ka.current;return t===null?!0:(at&4194048)===at?Qa===null:(at&62914560)===at||(at&536870912)!==0?t===Qa:!1}function Wv(){var t=G.H;return G.H=Ti,t===null?Ti:t}function Zv(){var t=G.A;return G.A=MC,t}function wo(){Ot=4,Zn||(at&4194048)!==at&&ka.current!==null||(Ir=!0),(es&134217727)===0&&(Qs&134217727)===0||At===null||ns(At,at,Na,!1)}function Bu(t,s,l){var c=dt;dt|=2;var p=Wv(),f=Zv();(At!==t||at!==s)&&(ko=null,Tr(t,s)),s=!1;var A=Ot;e:do try{if(pt!==0&&Ze!==null){var M=Ze,$=wa;switch(pt){case 8:Tu(),A=6;break e;case 3:case 2:case 9:case 6:ka.current===null&&(s=!0);var le=pt;if(pt=0,wa=null,Br(t,M,$,le),l&&Ir){A=0;break e}break;default:le=pt,pt=0,wa=null,Br(t,M,$,le)}}DC(),A=Ot;break}catch(je){Jv(t,je)}while(!0);return s&&t.shellSuspendCounter++,An=Es=null,dt=c,G.H=p,G.A=f,Ze===null&&(At=null,at=0,Hl()),A}function DC(){for(;Ze!==null;)eg(Ze)}function RC(t,s){var l=dt;dt|=2;var c=Wv(),p=Zv();At!==t||at!==s?(ko=null,Co=Be()+500,Tr(t,s)):Ir=Qe(t,s);e:do try{if(pt!==0&&Ze!==null){s=Ze;var f=wa;t:switch(pt){case 1:pt=0,wa=null,Br(t,s,f,1);break;case 2:case 9:if(df(f)){pt=0,wa=null,tg(s);break}s=function(){pt!==2&&pt!==9||At!==t||(pt=7),sn(t)},f.then(s,s);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:df(f)?(pt=0,wa=null,tg(s)):(pt=0,wa=null,Br(t,s,f,7));break;case 5:var A=null;switch(Ze.tag){case 26:A=Ze.memoizedState;case 5:case 27:var M=Ze;if(A?Pg(A):M.stateNode.complete){pt=0,wa=null;var $=M.sibling;if($!==null)Ze=$;else{var le=M.return;le!==null?(Ze=le,No(le)):Ze=null}break t}}pt=0,wa=null,Br(t,s,f,5);break;case 6:pt=0,wa=null,Br(t,s,f,6);break;case 8:Tu(),Ot=6;break e;default:throw Error(i(462))}}LC();break}catch(je){Jv(t,je)}while(!0);return An=Es=null,G.H=c,G.A=p,dt=l,Ze!==null?0:(At=null,at=0,Hl(),Ot)}function LC(){for(;Ze!==null&&!Ne();)eg(Ze)}function eg(t){var s=kv(t.alternate,t,Tn);t.memoizedProps=t.pendingProps,s===null?No(t):Ze=s}function tg(t){var s=t,l=s.alternate;switch(s.tag){case 15:case 0:s=yv(l,s,s.pendingProps,s.type,void 0,at);break;case 11:s=yv(l,s,s.pendingProps,s.type.render,s.ref,at);break;case 5:qd(s);default:wv(l,s),s=Ze=Wm(s,Tn),s=kv(l,s,Tn)}t.memoizedProps=t.pendingProps,s===null?No(t):Ze=s}function Br(t,s,l,c){An=Es=null,qd(s),Ar=null,Ci=0;var p=s.return;try{if(CC(t,p,s,l,at)){Ot=1,mo(t,Ra(l,t.current)),Ze=null;return}}catch(f){if(p!==null)throw Ze=p,f;Ot=1,mo(t,Ra(l,t.current)),Ze=null;return}s.flags&32768?(st||c===1?t=!0:Ir||(at&536870912)!==0?t=!1:(Zn=t=!0,(c===2||c===9||c===3||c===6)&&(c=ka.current,c!==null&&c.tag===13&&(c.flags|=16384))),ag(s,t)):No(s)}function No(t){var s=t;do{if((s.flags&32768)!==0){ag(s,Zn);return}t=s.return;var l=wC(s.alternate,s,Tn);if(l!==null){Ze=l;return}if(s=s.sibling,s!==null){Ze=s;return}Ze=s=t}while(s!==null);Ot===0&&(Ot=5)}function ag(t,s){do{var l=NC(t.alternate,t);if(l!==null){l.flags&=32767,Ze=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!s&&(t=t.sibling,t!==null)){Ze=t;return}Ze=t=l}while(t!==null);Ot=6,Ze=null}function ng(t,s,l,c,p,f,A,M,$){t.cancelPendingCommit=null;do Io();while(Ht!==0);if((dt&6)!==0)throw Error(i(327));if(s!==null){if(s===t.current)throw Error(i(177));if(f=s.lanes|s.childLanes,f|=jd,sa(t,l,f,A,M,$),t===At&&(Ze=At=null,at=0),Mr=s,as=t,Bn=l,Iu=f,Eu=p,Gv=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,UC(Et,function(){return og(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=G.T,G.T=null,p=Q.p,Q.p=2,A=dt,dt|=4;try{IC(t,s,l)}finally{dt=A,Q.p=p,G.T=c}}Ht=1,sg(),rg(),ig()}}function sg(){if(Ht===1){Ht=0;var t=as,s=Mr,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=G.T,G.T=null;var c=Q.p;Q.p=2;var p=dt;dt|=4;try{Qv(s,t);var f=$u,A=zm(t.containerInfo),M=f.focusedElem,$=f.selectionRange;if(A!==M&&M&&M.ownerDocument&&Km(M.ownerDocument.documentElement,M)){if($!==null&&fd(M)){var le=$.start,je=$.end;if(je===void 0&&(je=le),"selectionStart"in M)M.selectionStart=le,M.selectionEnd=Math.min(je,M.value.length);else{var Ce=M.ownerDocument||document,ue=Ce&&Ce.defaultView||window;if(ue.getSelection){var me=ue.getSelection(),Re=M.textContent.length,$e=Math.min($.start,Re),bt=$.end===void 0?$e:Math.min($.end,Re);!me.extend&&$e>bt&&(A=bt,bt=$e,$e=A);var te=Fm(M,$e),Y=Fm(M,bt);if(te&&Y&&(me.rangeCount!==1||me.anchorNode!==te.node||me.anchorOffset!==te.offset||me.focusNode!==Y.node||me.focusOffset!==Y.offset)){var ie=Ce.createRange();ie.setStart(te.node,te.offset),me.removeAllRanges(),$e>bt?(me.addRange(ie),me.extend(Y.node,Y.offset)):(ie.setEnd(Y.node,Y.offset),me.addRange(ie))}}}}for(Ce=[],me=M;me=me.parentNode;)me.nodeType===1&&Ce.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<Ce.length;M++){var Ae=Ce[M];Ae.element.scrollLeft=Ae.left,Ae.element.scrollTop=Ae.top}}Po=!!zu,$u=zu=null}finally{dt=p,Q.p=c,G.T=l}}t.current=s,Ht=2}}function rg(){if(Ht===2){Ht=0;var t=as,s=Mr,l=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||l){l=G.T,G.T=null;var c=Q.p;Q.p=2;var p=dt;dt|=4;try{Dv(t,s.alternate,s)}finally{dt=p,Q.p=c,G.T=l}}Ht=3}}function ig(){if(Ht===4||Ht===3){Ht=0,we();var t=as,s=Mr,l=Bn,c=Gv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Ht=5:(Ht=0,Mr=as=null,lg(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(ts=null),Jc(l),s=s.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(Te,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=G.T,p=Q.p,Q.p=2,G.T=null;try{for(var f=t.onRecoverableError,A=0;A<c.length;A++){var M=c[A];f(M.value,{componentStack:M.stack})}}finally{G.T=s,Q.p=p}}(Bn&3)!==0&&Io(),sn(t),p=t.pendingLanes,(l&261930)!==0&&(p&42)!==0?t===Mu?Pi++:(Pi=0,Mu=t):Pi=0,Fi(0)}}function lg(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,Ai(s)))}function Io(){return sg(),rg(),ig(),og()}function og(){if(Ht!==5)return!1;var t=as,s=Iu;Iu=0;var l=Jc(Bn),c=G.T,p=Q.p;try{Q.p=32>l?32:l,G.T=null,l=Eu,Eu=null;var f=as,A=Bn;if(Ht=0,Mr=as=null,Bn=0,(dt&6)!==0)throw Error(i(331));var M=dt;if(dt|=4,zv(f.current),Pv(f,f.current,A,l),dt=M,Fi(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(Te,f)}catch{}return!0}finally{Q.p=p,G.T=c,lg(t,s)}}function cg(t,s,l){s=Ra(l,s),s=ou(t.stateNode,s,2),t=Yn(t,s,2),t!==null&&(rt(t,2),sn(t))}function ht(t,s,l){if(t.tag===3)cg(t,t,l);else for(;s!==null;){if(s.tag===3){cg(s,t,l);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ts===null||!ts.has(c))){t=Ra(l,t),l=dv(2),c=Yn(s,l,2),c!==null&&(uv(l,c,s,t),rt(c,2),sn(c));break}}s=s.return}}function Du(t,s,l){var c=t.pingCache;if(c===null){c=t.pingCache=new TC;var p=new Set;c.set(s,p)}else p=c.get(s),p===void 0&&(p=new Set,c.set(s,p));p.has(l)||(Su=!0,p.add(l),t=OC.bind(null,t,s,l),s.then(t,t))}function OC(t,s,l){var c=t.pingCache;c!==null&&c.delete(s),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,At===t&&(at&l)===l&&(Ot===4||Ot===3&&(at&62914560)===at&&300>Be()-xo?(dt&2)===0&&Tr(t,0):wu|=l,Er===at&&(Er=0)),sn(t)}function dg(t,s){s===0&&(s=jt()),t=ws(t,s),t!==null&&(rt(t,s),sn(t))}function _C(t){var s=t.memoizedState,l=0;s!==null&&(l=s.retryLane),dg(t,l)}function QC(t,s){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,p=t.memoizedState;p!==null&&(l=p.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(s),dg(t,l)}function UC(t,s){return ge(t,s)}var Eo=null,Dr=null,Ru=!1,Mo=!1,Lu=!1,ss=0;function sn(t){t!==Dr&&t.next===null&&(Dr===null?Eo=Dr=t:Dr=Dr.next=t),Mo=!0,Ru||(Ru=!0,FC())}function Fi(t,s){if(!Lu&&Mo){Lu=!0;do for(var l=!1,c=Eo;c!==null;){if(t!==0){var p=c.pendingLanes;if(p===0)var f=0;else{var A=c.suspendedLanes,M=c.pingedLanes;f=(1<<31-ze(42|t)+1)-1,f&=p&~(A&~M),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(l=!0,mg(c,f))}else f=at,f=De(c,c===At?f:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(f&3)===0||Qe(c,f)||(l=!0,mg(c,f));c=c.next}while(l);Lu=!1}}function PC(){ug()}function ug(){Mo=Ru=!1;var t=0;ss!==0&&XC()&&(t=ss);for(var s=Be(),l=null,c=Eo;c!==null;){var p=c.next,f=pg(c,s);f===0?(c.next=null,l===null?Eo=p:l.next=p,p===null&&(Dr=l)):(l=c,(t!==0||(f&3)!==0)&&(Mo=!0)),c=p}Ht!==0&&Ht!==5||Fi(t),ss!==0&&(ss=0)}function pg(t,s){for(var l=t.suspendedLanes,c=t.pingedLanes,p=t.expirationTimes,f=t.pendingLanes&-62914561;0<f;){var A=31-ze(f),M=1<<A,$=p[A];$===-1?((M&l)===0||(M&c)!==0)&&(p[A]=He(M,s)):$<=s&&(t.expiredLanes|=M),f&=~M}if(s=At,l=at,l=De(t,t===s?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===s&&(pt===2||pt===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Se(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Qe(t,l)){if(s=l&-l,s===t.callbackPriority)return s;switch(c!==null&&Se(c),Jc(l)){case 2:case 8:l=Xe;break;case 32:l=Et;break;case 268435456:l=Ee;break;default:l=Et}return c=hg.bind(null,t),l=ge(l,c),t.callbackPriority=s,t.callbackNode=l,s}return c!==null&&c!==null&&Se(c),t.callbackPriority=2,t.callbackNode=null,2}function hg(t,s){if(Ht!==0&&Ht!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Io()&&t.callbackNode!==l)return null;var c=at;return c=De(t,t===At?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Vv(t,c,s),pg(t,Be()),t.callbackNode!=null&&t.callbackNode===l?hg.bind(null,t):null)}function mg(t,s){if(Io())return null;Vv(t,s,!0)}function FC(){ZC(function(){(dt&6)!==0?ge(Ke,PC):ug()})}function Ou(){if(ss===0){var t=yr;t===0&&(t=ut,ut<<=1,(ut&261888)===0&&(ut=256)),ss=t}return ss}function fg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:_l(""+t)}function vg(t,s){var l=s.ownerDocument.createElement("input");return l.name=s.name,l.value=s.value,t.id&&l.setAttribute("form",t.id),s.parentNode.insertBefore(l,s),t=new FormData(t),l.parentNode.removeChild(l),t}function KC(t,s,l,c,p){if(s==="submit"&&l&&l.stateNode===p){var f=fg((p[da]||null).action),A=c.submitter;A&&(s=(s=A[da]||null)?fg(s.formAction):A.getAttribute("formAction"),s!==null&&(f=s,A=null));var M=new Fl("action","action",null,c,p);t.push({event:M,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ss!==0){var $=A?vg(p,A):new FormData(p);au(l,{pending:!0,data:$,method:p.method,action:f},null,$)}}else typeof f=="function"&&(M.preventDefault(),$=A?vg(p,A):new FormData(p),au(l,{pending:!0,data:$,method:p.method,action:f},f,$))},currentTarget:p}]})}}for(var _u=0;_u<bd.length;_u++){var Qu=bd[_u],zC=Qu.toLowerCase(),$C=Qu[0].toUpperCase()+Qu.slice(1);Ya(zC,"on"+$C)}Ya(Gm,"onAnimationEnd"),Ya(qm,"onAnimationIteration"),Ya(Vm,"onAnimationStart"),Ya("dblclick","onDoubleClick"),Ya("focusin","onFocus"),Ya("focusout","onBlur"),Ya(iC,"onTransitionRun"),Ya(lC,"onTransitionStart"),Ya(oC,"onTransitionCancel"),Ya(Ym,"onTransitionEnd"),sr("onMouseEnter",["mouseout","mouseover"]),sr("onMouseLeave",["mouseout","mouseover"]),sr("onPointerEnter",["pointerout","pointerover"]),sr("onPointerLeave",["pointerout","pointerover"]),xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xs("onBeforeInput",["compositionend","keypress","textInput","paste"]),xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ki="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(" "),HC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ki));function gg(t,s){s=(s&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],p=c.event;c=c.listeners;e:{var f=void 0;if(s)for(var A=c.length-1;0<=A;A--){var M=c[A],$=M.instance,le=M.currentTarget;if(M=M.listener,$!==f&&p.isPropagationStopped())break e;f=M,p.currentTarget=le;try{f(p)}catch(je){$l(je)}p.currentTarget=null,f=$}else for(A=0;A<c.length;A++){if(M=c[A],$=M.instance,le=M.currentTarget,M=M.listener,$!==f&&p.isPropagationStopped())break e;f=M,p.currentTarget=le;try{f(p)}catch(je){$l(je)}p.currentTarget=null,f=$}}}}function et(t,s){var l=s[Xc];l===void 0&&(l=s[Xc]=new Set);var c=t+"__bubble";l.has(c)||(yg(s,t,2,!1),l.add(c))}function Uu(t,s,l){var c=0;s&&(c|=4),yg(l,t,c,s)}var To="_reactListening"+Math.random().toString(36).slice(2);function Pu(t){if(!t[To]){t[To]=!0,dm.forEach(function(l){l!=="selectionchange"&&(HC.has(l)||Uu(l,!1,t),Uu(l,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[To]||(s[To]=!0,Uu("selectionchange",!1,s))}}function yg(t,s,l,c){switch(qg(s)){case 2:var p=bk;break;case 8:p=jk;break;default:p=tp}l=p.bind(null,s,l,t),p=void 0,!id||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),c?p!==void 0?t.addEventListener(s,l,{capture:!0,passive:p}):t.addEventListener(s,l,!0):p!==void 0?t.addEventListener(s,l,{passive:p}):t.addEventListener(s,l,!1)}function Fu(t,s,l,c,p){var f=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var A=c.tag;if(A===3||A===4){var M=c.stateNode.containerInfo;if(M===p)break;if(A===4)for(A=c.return;A!==null;){var $=A.tag;if(($===3||$===4)&&A.stateNode.containerInfo===p)return;A=A.return}for(;M!==null;){if(A=tr(M),A===null)return;if($=A.tag,$===5||$===6||$===26||$===27){c=f=A;continue e}M=M.parentNode}}c=c.return}xm(function(){var le=f,je=sd(l),Ce=[];e:{var ue=Jm.get(t);if(ue!==void 0){var me=Fl,Re=t;switch(t){case"keypress":if(Ul(l)===0)break e;case"keydown":case"keyup":me=Qx;break;case"focusin":Re="focus",me=dd;break;case"focusout":Re="blur",me=dd;break;case"beforeblur":case"afterblur":me=dd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Sm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=wx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=Fx;break;case Gm:case qm:case Vm:me=Ex;break;case Ym:me=zx;break;case"scroll":case"scrollend":me=kx;break;case"wheel":me=Hx;break;case"copy":case"cut":case"paste":me=Tx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Nm;break;case"toggle":case"beforetoggle":me=qx}var $e=(s&4)!==0,bt=!$e&&(t==="scroll"||t==="scrollend"),te=$e?ue!==null?ue+"Capture":null:ue;$e=[];for(var Y=le,ie;Y!==null;){var Ae=Y;if(ie=Ae.stateNode,Ae=Ae.tag,Ae!==5&&Ae!==26&&Ae!==27||ie===null||te===null||(Ae=di(Y,te),Ae!=null&&$e.push(zi(Y,Ae,ie))),bt)break;Y=Y.return}0<$e.length&&(ue=new me(ue,Re,null,l,je),Ce.push({event:ue,listeners:$e}))}}if((s&7)===0){e:{if(ue=t==="mouseover"||t==="pointerover",me=t==="mouseout"||t==="pointerout",ue&&l!==nd&&(Re=l.relatedTarget||l.fromElement)&&(tr(Re)||Re[er]))break e;if((me||ue)&&(ue=je.window===je?je:(ue=je.ownerDocument)?ue.defaultView||ue.parentWindow:window,me?(Re=l.relatedTarget||l.toElement,me=le,Re=Re?tr(Re):null,Re!==null&&(bt=d(Re),$e=Re.tag,Re!==bt||$e!==5&&$e!==27&&$e!==6)&&(Re=null)):(me=null,Re=le),me!==Re)){if($e=Sm,Ae="onMouseLeave",te="onMouseEnter",Y="mouse",(t==="pointerout"||t==="pointerover")&&($e=Nm,Ae="onPointerLeave",te="onPointerEnter",Y="pointer"),bt=me==null?ue:ci(me),ie=Re==null?ue:ci(Re),ue=new $e(Ae,Y+"leave",me,l,je),ue.target=bt,ue.relatedTarget=ie,Ae=null,tr(je)===le&&($e=new $e(te,Y+"enter",Re,l,je),$e.target=ie,$e.relatedTarget=bt,Ae=$e),bt=Ae,me&&Re)t:{for($e=GC,te=me,Y=Re,ie=0,Ae=te;Ae;Ae=$e(Ae))ie++;Ae=0;for(var Pe=Y;Pe;Pe=$e(Pe))Ae++;for(;0<ie-Ae;)te=$e(te),ie--;for(;0<Ae-ie;)Y=$e(Y),Ae--;for(;ie--;){if(te===Y||Y!==null&&te===Y.alternate){$e=te;break t}te=$e(te),Y=$e(Y)}$e=null}else $e=null;me!==null&&bg(Ce,ue,me,$e,!1),Re!==null&&bt!==null&&bg(Ce,bt,Re,$e,!0)}}e:{if(ue=le?ci(le):window,me=ue.nodeName&&ue.nodeName.toLowerCase(),me==="select"||me==="input"&&ue.type==="file")var ot=Lm;else if(Dm(ue))if(Om)ot=nC;else{ot=tC;var _e=eC}else me=ue.nodeName,!me||me.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?le&&ad(le.elementType)&&(ot=Lm):ot=aC;if(ot&&(ot=ot(t,le))){Rm(Ce,ot,l,je);break e}_e&&_e(t,ue,le),t==="focusout"&&le&&ue.type==="number"&&le.memoizedProps.value!=null&&td(ue,"number",ue.value)}switch(_e=le?ci(le):window,t){case"focusin":(Dm(_e)||_e.contentEditable==="true")&&(dr=_e,vd=le,yi=null);break;case"focusout":yi=vd=dr=null;break;case"mousedown":gd=!0;break;case"contextmenu":case"mouseup":case"dragend":gd=!1,$m(Ce,l,je);break;case"selectionchange":if(rC)break;case"keydown":case"keyup":$m(Ce,l,je)}var Ye;if(pd)e:{switch(t){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else cr?Tm(t,l)&&(nt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(nt="onCompositionStart");nt&&(Im&&l.locale!=="ko"&&(cr||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&cr&&(Ye=Cm()):(Kn=je,ld="value"in Kn?Kn.value:Kn.textContent,cr=!0)),_e=Bo(le,nt),0<_e.length&&(nt=new wm(nt,t,null,l,je),Ce.push({event:nt,listeners:_e}),Ye?nt.data=Ye:(Ye=Bm(l),Ye!==null&&(nt.data=Ye)))),(Ye=Yx?Jx(t,l):Xx(t,l))&&(nt=Bo(le,"onBeforeInput"),0<nt.length&&(_e=new wm("onBeforeInput","beforeinput",null,l,je),Ce.push({event:_e,listeners:nt}),_e.data=Ye)),KC(Ce,t,le,l,je)}gg(Ce,s)})}function zi(t,s,l){return{instance:t,listener:s,currentTarget:l}}function Bo(t,s){for(var l=s+"Capture",c=[];t!==null;){var p=t,f=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||f===null||(p=di(t,l),p!=null&&c.unshift(zi(t,p,f)),p=di(t,s),p!=null&&c.push(zi(t,p,f))),t.tag===3)return c;t=t.return}return[]}function GC(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function bg(t,s,l,c,p){for(var f=s._reactName,A=[];l!==null&&l!==c;){var M=l,$=M.alternate,le=M.stateNode;if(M=M.tag,$!==null&&$===c)break;M!==5&&M!==26&&M!==27||le===null||($=le,p?(le=di(l,f),le!=null&&A.unshift(zi(l,le,$))):p||(le=di(l,f),le!=null&&A.push(zi(l,le,$)))),l=l.return}A.length!==0&&t.push({event:s,listeners:A})}var qC=/\r\n?/g,VC=/\u0000|\uFFFD/g;function jg(t){return(typeof t=="string"?t:""+t).replace(qC,`
|
|
9
|
+
`).replace(VC,"")}function Ag(t,s){return s=jg(s),jg(t)===s}function yt(t,s,l,c,p,f){switch(l){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||ir(t,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&ir(t,""+c);break;case"className":Ll(t,"class",c);break;case"tabIndex":Ll(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Ll(t,l,c);break;case"style":jm(t,c,f);break;case"data":if(s!=="object"){Ll(t,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=_l(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"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 f=="function"&&(l==="formAction"?(s!=="input"&&yt(t,s,"name",p.name,p,null),yt(t,s,"formEncType",p.formEncType,p,null),yt(t,s,"formMethod",p.formMethod,p,null),yt(t,s,"formTarget",p.formTarget,p,null)):(yt(t,s,"encType",p.encType,p,null),yt(t,s,"method",p.method,p,null),yt(t,s,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=_l(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=gn);break;case"onScroll":c!=null&&et("scroll",t);break;case"onScrollEnd":c!=null&&et("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(i(60));t.innerHTML=l}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}l=_l(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);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":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":et("beforetoggle",t),et("toggle",t),Rl(t,"popover",c);break;case"xlinkActuate":vn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":vn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":vn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":vn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":vn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":vn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":vn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":vn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":vn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Rl(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=xx.get(l)||l,Rl(t,l,c))}}function Ku(t,s,l,c,p,f){switch(l){case"style":jm(t,c,f);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(l=c.__html,l!=null){if(p.children!=null)throw Error(i(60));t.innerHTML=l}}break;case"children":typeof c=="string"?ir(t,c):(typeof c=="number"||typeof c=="bigint")&&ir(t,""+c);break;case"onScroll":c!=null&&et("scroll",t);break;case"onScrollEnd":c!=null&&et("scrollend",t);break;case"onClick":c!=null&&(t.onclick=gn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!um.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),s=l.slice(2,p?l.length-7:void 0),f=t[da]||null,f=f!=null?f[l]:null,typeof f=="function"&&t.removeEventListener(s,f,p),typeof c=="function")){typeof f!="function"&&f!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(s,c,p);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):Rl(t,l,c)}}}function ta(t,s,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",t),et("load",t);var c=!1,p=!1,f;for(f in l)if(l.hasOwnProperty(f)){var A=l[f];if(A!=null)switch(f){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:yt(t,s,f,A,l,null)}}p&&yt(t,s,"srcSet",l.srcSet,l,null),c&&yt(t,s,"src",l.src,l,null);return;case"input":et("invalid",t);var M=f=A=p=null,$=null,le=null;for(c in l)if(l.hasOwnProperty(c)){var je=l[c];if(je!=null)switch(c){case"name":p=je;break;case"type":A=je;break;case"checked":$=je;break;case"defaultChecked":le=je;break;case"value":f=je;break;case"defaultValue":M=je;break;case"children":case"dangerouslySetInnerHTML":if(je!=null)throw Error(i(137,s));break;default:yt(t,s,c,je,l,null)}}vm(t,f,M,$,le,A,p,!1);return;case"select":et("invalid",t),c=A=f=null;for(p in l)if(l.hasOwnProperty(p)&&(M=l[p],M!=null))switch(p){case"value":f=M;break;case"defaultValue":A=M;break;case"multiple":c=M;default:yt(t,s,p,M,l,null)}s=f,l=A,t.multiple=!!c,s!=null?rr(t,!!c,s,!1):l!=null&&rr(t,!!c,l,!0);return;case"textarea":et("invalid",t),f=p=c=null;for(A in l)if(l.hasOwnProperty(A)&&(M=l[A],M!=null))switch(A){case"value":c=M;break;case"defaultValue":p=M;break;case"children":f=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(i(91));break;default:yt(t,s,A,M,l,null)}ym(t,c,p,f);return;case"option":for($ in l)l.hasOwnProperty($)&&(c=l[$],c!=null)&&($==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":yt(t,s,$,c,l,null));return;case"dialog":et("beforetoggle",t),et("toggle",t),et("cancel",t),et("close",t);break;case"iframe":case"object":et("load",t);break;case"video":case"audio":for(c=0;c<Ki.length;c++)et(Ki[c],t);break;case"image":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"embed":case"source":case"link":et("error",t),et("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in l)if(l.hasOwnProperty(le)&&(c=l[le],c!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:yt(t,s,le,c,l,null)}return;default:if(ad(s)){for(je in l)l.hasOwnProperty(je)&&(c=l[je],c!==void 0&&Ku(t,s,je,c,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(c=l[M],c!=null&&yt(t,s,M,c,l,null))}function YC(t,s,l,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,f=null,A=null,M=null,$=null,le=null,je=null;for(me in l){var Ce=l[me];if(l.hasOwnProperty(me)&&Ce!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":$=Ce;default:c.hasOwnProperty(me)||yt(t,s,me,null,c,Ce)}}for(var ue in c){var me=c[ue];if(Ce=l[ue],c.hasOwnProperty(ue)&&(me!=null||Ce!=null))switch(ue){case"type":f=me;break;case"name":p=me;break;case"checked":le=me;break;case"defaultChecked":je=me;break;case"value":A=me;break;case"defaultValue":M=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(i(137,s));break;default:me!==Ce&&yt(t,s,ue,me,c,Ce)}}ed(t,A,M,$,le,je,f,p);return;case"select":me=A=M=ue=null;for(f in l)if($=l[f],l.hasOwnProperty(f)&&$!=null)switch(f){case"value":break;case"multiple":me=$;default:c.hasOwnProperty(f)||yt(t,s,f,null,c,$)}for(p in c)if(f=c[p],$=l[p],c.hasOwnProperty(p)&&(f!=null||$!=null))switch(p){case"value":ue=f;break;case"defaultValue":M=f;break;case"multiple":A=f;default:f!==$&&yt(t,s,p,f,c,$)}s=M,l=A,c=me,ue!=null?rr(t,!!l,ue,!1):!!c!=!!l&&(s!=null?rr(t,!!l,s,!0):rr(t,!!l,l?[]:"",!1));return;case"textarea":me=ue=null;for(M in l)if(p=l[M],l.hasOwnProperty(M)&&p!=null&&!c.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:yt(t,s,M,null,c,p)}for(A in c)if(p=c[A],f=l[A],c.hasOwnProperty(A)&&(p!=null||f!=null))switch(A){case"value":ue=p;break;case"defaultValue":me=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==f&&yt(t,s,A,p,c,f)}gm(t,ue,me);return;case"option":for(var Re in l)ue=l[Re],l.hasOwnProperty(Re)&&ue!=null&&!c.hasOwnProperty(Re)&&(Re==="selected"?t.selected=!1:yt(t,s,Re,null,c,ue));for($ in c)ue=c[$],me=l[$],c.hasOwnProperty($)&&ue!==me&&(ue!=null||me!=null)&&($==="selected"?t.selected=ue&&typeof ue!="function"&&typeof ue!="symbol":yt(t,s,$,ue,c,me));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 $e in l)ue=l[$e],l.hasOwnProperty($e)&&ue!=null&&!c.hasOwnProperty($e)&&yt(t,s,$e,null,c,ue);for(le in c)if(ue=c[le],me=l[le],c.hasOwnProperty(le)&&ue!==me&&(ue!=null||me!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(i(137,s));break;default:yt(t,s,le,ue,c,me)}return;default:if(ad(s)){for(var bt in l)ue=l[bt],l.hasOwnProperty(bt)&&ue!==void 0&&!c.hasOwnProperty(bt)&&Ku(t,s,bt,void 0,c,ue);for(je in c)ue=c[je],me=l[je],!c.hasOwnProperty(je)||ue===me||ue===void 0&&me===void 0||Ku(t,s,je,ue,c,me);return}}for(var te in l)ue=l[te],l.hasOwnProperty(te)&&ue!=null&&!c.hasOwnProperty(te)&&yt(t,s,te,null,c,ue);for(Ce in c)ue=c[Ce],me=l[Ce],!c.hasOwnProperty(Ce)||ue===me||ue==null&&me==null||yt(t,s,Ce,ue,c,me)}function xg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function JC(){if(typeof performance.getEntriesByType=="function"){for(var t=0,s=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var p=l[c],f=p.transferSize,A=p.initiatorType,M=p.duration;if(f&&M&&xg(A)){for(A=0,M=p.responseEnd,c+=1;c<l.length;c++){var $=l[c],le=$.startTime;if(le>M)break;var je=$.transferSize,Ce=$.initiatorType;je&&xg(Ce)&&($=$.responseEnd,A+=je*($<M?1:(M-le)/($-le)))}if(--c,s+=8*(f+A)/(p.duration/1e3),t++,10<t)break}}if(0<t)return s/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var zu=null,$u=null;function Do(t){return t.nodeType===9?t:t.ownerDocument}function Cg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function kg(t,s){if(t===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&s==="foreignObject"?0:t}function Hu(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Gu=null;function XC(){var t=window.event;return t&&t.type==="popstate"?t===Gu?!1:(Gu=t,!0):(Gu=null,!1)}var Sg=typeof setTimeout=="function"?setTimeout:void 0,WC=typeof clearTimeout=="function"?clearTimeout:void 0,wg=typeof Promise=="function"?Promise:void 0,ZC=typeof queueMicrotask=="function"?queueMicrotask:typeof wg<"u"?function(t){return wg.resolve(null).then(t).catch(ek)}:Sg;function ek(t){setTimeout(function(){throw t})}function rs(t){return t==="head"}function Ng(t,s){var l=s,c=0;do{var p=l.nextSibling;if(t.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(p),_r(s);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")$i(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,$i(l);for(var f=l.firstChild;f;){var A=f.nextSibling,M=f.nodeName;f[oi]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&f.rel.toLowerCase()==="stylesheet"||l.removeChild(f),f=A}}else l==="body"&&$i(t.ownerDocument.body);l=p}while(l);_r(s)}function Ig(t,s){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?s?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(s?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function qu(t){var s=t.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var l=s;switch(s=s.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":qu(l),Wc(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function tk(t,s,l,c){for(;t.nodeType===1;){var p=l;if(t.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[oi])switch(s){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(f=t.getAttribute("rel"),f==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(f!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(f=t.getAttribute("src"),(f!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&f&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(s==="input"&&t.type==="hidden"){var f=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===f)return t}else return t;if(t=Ua(t.nextSibling),t===null)break}return null}function ak(t,s,l){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Ua(t.nextSibling),t===null))return null;return t}function Eg(t,s){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Ua(t.nextSibling),t===null))return null;return t}function Vu(t){return t.data==="$?"||t.data==="$~"}function Yu(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function nk(t,s){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=s;else if(t.data!=="$?"||l.readyState!=="loading")s();else{var c=function(){s(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Ua(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return t}var Ju=null;function Mg(t){t=t.nextSibling;for(var s=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(s===0)return Ua(t.nextSibling);s--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||s++}t=t.nextSibling}return null}function Tg(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(s===0)return t;s--}else l!=="/$"&&l!=="/&"||s++}t=t.previousSibling}return null}function Bg(t,s,l){switch(s=Do(l),t){case"html":if(t=s.documentElement,!t)throw Error(i(452));return t;case"head":if(t=s.head,!t)throw Error(i(453));return t;case"body":if(t=s.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function $i(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Wc(t)}var Pa=new Map,Dg=new Set;function Ro(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Dn=Q.d;Q.d={f:sk,r:rk,D:ik,C:lk,L:ok,m:ck,X:uk,S:dk,M:pk};function sk(){var t=Dn.f(),s=So();return t||s}function rk(t){var s=ar(t);s!==null&&s.tag===5&&s.type==="form"?Jf(s):Dn.r(t)}var Rr=typeof document>"u"?null:document;function Rg(t,s,l){var c=Rr;if(c&&typeof s=="string"&&s){var p=Ba(s);p='link[rel="'+t+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),Dg.has(p)||(Dg.add(p),t={rel:t,crossOrigin:l,href:s},c.querySelector(p)===null&&(s=c.createElement("link"),ta(s,"link",t),Gt(s),c.head.appendChild(s)))}}function ik(t){Dn.D(t),Rg("dns-prefetch",t,null)}function lk(t,s){Dn.C(t,s),Rg("preconnect",t,s)}function ok(t,s,l){Dn.L(t,s,l);var c=Rr;if(c&&t&&s){var p='link[rel="preload"][as="'+Ba(s)+'"]';s==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Ba(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Ba(l.imageSizes)+'"]')):p+='[href="'+Ba(t)+'"]';var f=p;switch(s){case"style":f=Lr(t);break;case"script":f=Or(t)}Pa.has(f)||(t=b({rel:"preload",href:s==="image"&&l&&l.imageSrcSet?void 0:t,as:s},l),Pa.set(f,t),c.querySelector(p)!==null||s==="style"&&c.querySelector(Hi(f))||s==="script"&&c.querySelector(Gi(f))||(s=c.createElement("link"),ta(s,"link",t),Gt(s),c.head.appendChild(s)))}}function ck(t,s){Dn.m(t,s);var l=Rr;if(l&&t){var c=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+Ba(c)+'"][href="'+Ba(t)+'"]',f=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Or(t)}if(!Pa.has(f)&&(t=b({rel:"modulepreload",href:t},s),Pa.set(f,t),l.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Gi(f)))return}c=l.createElement("link"),ta(c,"link",t),Gt(c),l.head.appendChild(c)}}}function dk(t,s,l){Dn.S(t,s,l);var c=Rr;if(c&&t){var p=nr(c).hoistableStyles,f=Lr(t);s=s||"default";var A=p.get(f);if(!A){var M={loading:0,preload:null};if(A=c.querySelector(Hi(f)))M.loading=5;else{t=b({rel:"stylesheet",href:t,"data-precedence":s},l),(l=Pa.get(f))&&Xu(t,l);var $=A=c.createElement("link");Gt($),ta($,"link",t),$._p=new Promise(function(le,je){$.onload=le,$.onerror=je}),$.addEventListener("load",function(){M.loading|=1}),$.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Lo(A,s,c)}A={type:"stylesheet",instance:A,count:1,state:M},p.set(f,A)}}}function uk(t,s){Dn.X(t,s);var l=Rr;if(l&&t){var c=nr(l).hoistableScripts,p=Or(t),f=c.get(p);f||(f=l.querySelector(Gi(p)),f||(t=b({src:t,async:!0},s),(s=Pa.get(p))&&Wu(t,s),f=l.createElement("script"),Gt(f),ta(f,"link",t),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},c.set(p,f))}}function pk(t,s){Dn.M(t,s);var l=Rr;if(l&&t){var c=nr(l).hoistableScripts,p=Or(t),f=c.get(p);f||(f=l.querySelector(Gi(p)),f||(t=b({src:t,async:!0,type:"module"},s),(s=Pa.get(p))&&Wu(t,s),f=l.createElement("script"),Gt(f),ta(f,"link",t),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},c.set(p,f))}}function Lg(t,s,l,c){var p=(p=se.current)?Ro(p):null;if(!p)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(s=Lr(l.href),l=nr(p).hoistableStyles,c=l.get(s),c||(c={type:"style",instance:null,count:0,state:null},l.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Lr(l.href);var f=nr(p).hoistableStyles,A=f.get(t);if(A||(p=p.ownerDocument||p,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(t,A),(f=p.querySelector(Hi(t)))&&!f._p&&(A.instance=f,A.state.loading=5),Pa.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Pa.set(t,l),f||hk(p,t,l,A.state))),s&&c===null)throw Error(i(528,""));return A}if(s&&c!==null)throw Error(i(529,""));return null;case"script":return s=l.async,l=l.src,typeof l=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Or(l),l=nr(p).hoistableScripts,c=l.get(s),c||(c={type:"script",instance:null,count:0,state:null},l.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Lr(t){return'href="'+Ba(t)+'"'}function Hi(t){return'link[rel="stylesheet"]['+t+"]"}function Og(t){return b({},t,{"data-precedence":t.precedence,precedence:null})}function hk(t,s,l,c){t.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=t.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),ta(s,"link",l),Gt(s),t.head.appendChild(s))}function Or(t){return'[src="'+Ba(t)+'"]'}function Gi(t){return"script[async]"+t}function _g(t,s,l){if(s.count++,s.instance===null)switch(s.type){case"style":var c=t.querySelector('style[data-href~="'+Ba(l.href)+'"]');if(c)return s.instance=c,Gt(c),c;var p=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Gt(c),ta(c,"style",p),Lo(c,l.precedence,t),s.instance=c;case"stylesheet":p=Lr(l.href);var f=t.querySelector(Hi(p));if(f)return s.state.loading|=4,s.instance=f,Gt(f),f;c=Og(l),(p=Pa.get(p))&&Xu(c,p),f=(t.ownerDocument||t).createElement("link"),Gt(f);var A=f;return A._p=new Promise(function(M,$){A.onload=M,A.onerror=$}),ta(f,"link",c),s.state.loading|=4,Lo(f,l.precedence,t),s.instance=f;case"script":return f=Or(l.src),(p=t.querySelector(Gi(f)))?(s.instance=p,Gt(p),p):(c=l,(p=Pa.get(f))&&(c=b({},l),Wu(c,p)),t=t.ownerDocument||t,p=t.createElement("script"),Gt(p),ta(p,"link",c),t.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,Lo(c,l.precedence,t));return s.instance}function Lo(t,s,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,f=p,A=0;A<c.length;A++){var M=c[A];if(M.dataset.precedence===s)f=M;else if(f!==p)break}f?f.parentNode.insertBefore(t,f.nextSibling):(s=l.nodeType===9?l.head:l,s.insertBefore(t,s.firstChild))}function Xu(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function Wu(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var Oo=null;function Qg(t,s,l){if(Oo===null){var c=new Map,p=Oo=new Map;p.set(l,c)}else p=Oo,c=p.get(l),c||(c=new Map,p.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),p=0;p<l.length;p++){var f=l[p];if(!(f[oi]||f[Xt]||t==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var A=f.getAttribute(s)||"";A=t+A;var M=c.get(A);M?M.push(f):c.set(A,[f])}}return c}function Ug(t,s,l){t=t.ownerDocument||t,t.head.insertBefore(l,s==="title"?t.querySelector("head > title"):null)}function mk(t,s,l){if(l===1||s.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(t=s.disabled,typeof s.precedence=="string"&&t==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Pg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function fk(t,s,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=Lr(c.href),f=s.querySelector(Hi(p));if(f){s=f._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(t.count++,t=_o.bind(t),s.then(t,t)),l.state.loading|=4,l.instance=f,Gt(f);return}f=s.ownerDocument||s,c=Og(c),(p=Pa.get(p))&&Xu(c,p),f=f.createElement("link"),Gt(f);var A=f;A._p=new Promise(function(M,$){A.onload=M,A.onerror=$}),ta(f,"link",c),l.instance=f}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,s),(s=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=_o.bind(t),s.addEventListener("load",l),s.addEventListener("error",l))}}var Zu=0;function vk(t,s){return t.stylesheets&&t.count===0&&Uo(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Uo(t,t.stylesheets),t.unsuspend){var f=t.unsuspend;t.unsuspend=null,f()}},6e4+s);0<t.imgBytes&&Zu===0&&(Zu=62500*JC());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Uo(t,t.stylesheets),t.unsuspend)){var f=t.unsuspend;t.unsuspend=null,f()}},(t.imgBytes>Zu?50:800)+s);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function _o(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Uo(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Qo=null;function Uo(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Qo=new Map,s.forEach(gk,t),Qo=null,_o.call(t))}function gk(t,s){if(!(s.state.loading&4)){var l=Qo.get(t);if(l)var c=l.get(null);else{l=new Map,Qo.set(t,l);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<p.length;f++){var A=p[f];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(l.set(A.dataset.precedence,A),c=A)}c&&l.set(null,c)}p=s.instance,A=p.getAttribute("data-precedence"),f=l.get(A)||c,f===c&&l.set(null,p),l.set(A,p),this.count++,c=_o.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),f?f.parentNode.insertBefore(p,f.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),s.state.loading|=4}}var qi={$$typeof:E,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function yk(t,s,l,c,p,f,A,M,$){this.tag=1,this.containerInfo=t,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=Ie(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ie(0),this.hiddenUpdates=Ie(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=f,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function Fg(t,s,l,c,p,f,A,M,$,le,je,Ce){return t=new yk(t,s,l,A,$,le,je,Ce,M),s=1,f===!0&&(s|=24),f=Ca(3,null,null,s),t.current=f,f.stateNode=t,s=Bd(),s.refCount++,t.pooledCache=s,s.refCount++,f.memoizedState={element:c,isDehydrated:l,cache:s},Od(f),t}function Kg(t){return t?(t=hr,t):hr}function zg(t,s,l,c,p,f){p=Kg(p),c.context===null?c.context=p:c.pendingContext=p,c=Vn(s),c.payload={element:l},f=f===void 0?null:f,f!==null&&(c.callback=f),l=Yn(t,c,s),l!==null&&(va(l,t,s),Si(l,t,s))}function $g(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<s?l:s}}function ep(t,s){$g(t,s),(t=t.alternate)&&$g(t,s)}function Hg(t){if(t.tag===13||t.tag===31){var s=ws(t,67108864);s!==null&&va(s,t,67108864),ep(t,67108864)}}function Gg(t){if(t.tag===13||t.tag===31){var s=Ia();s=Yc(s);var l=ws(t,s);l!==null&&va(l,t,s),ep(t,s)}}var Po=!0;function bk(t,s,l,c){var p=G.T;G.T=null;var f=Q.p;try{Q.p=2,tp(t,s,l,c)}finally{Q.p=f,G.T=p}}function jk(t,s,l,c){var p=G.T;G.T=null;var f=Q.p;try{Q.p=8,tp(t,s,l,c)}finally{Q.p=f,G.T=p}}function tp(t,s,l,c){if(Po){var p=ap(c);if(p===null)Fu(t,s,c,Fo,l),Vg(t,c);else if(xk(p,t,s,l,c))c.stopPropagation();else if(Vg(t,c),s&4&&-1<Ak.indexOf(t)){for(;p!==null;){var f=ar(p);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var A=he(f.pendingLanes);if(A!==0){var M=f;for(M.pendingLanes|=2,M.entangledLanes|=2;A;){var $=1<<31-ze(A);M.entanglements[1]|=$,A&=~$}sn(f),(dt&6)===0&&(Co=Be()+500,Fi(0))}}break;case 31:case 13:M=ws(f,2),M!==null&&va(M,f,2),So(),ep(f,2)}if(f=ap(c),f===null&&Fu(t,s,c,Fo,l),f===p)break;p=f}p!==null&&c.stopPropagation()}else Fu(t,s,c,null,l)}}function ap(t){return t=sd(t),np(t)}var Fo=null;function np(t){if(Fo=null,t=tr(t),t!==null){var s=d(t);if(s===null)t=null;else{var l=s.tag;if(l===13){if(t=u(s),t!==null)return t;t=null}else if(l===31){if(t=v(s),t!==null)return t;t=null}else if(l===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null)}}return Fo=t,null}function qg(t){switch(t){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(Je()){case Ke:return 2;case Xe:return 8;case Et:case vt:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var sp=!1,is=null,ls=null,os=null,Vi=new Map,Yi=new Map,cs=[],Ak="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 Vg(t,s){switch(t){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":ls=null;break;case"mouseover":case"mouseout":os=null;break;case"pointerover":case"pointerout":Vi.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yi.delete(s.pointerId)}}function Ji(t,s,l,c,p,f){return t===null||t.nativeEvent!==f?(t={blockedOn:s,domEventName:l,eventSystemFlags:c,nativeEvent:f,targetContainers:[p]},s!==null&&(s=ar(s),s!==null&&Hg(s)),t):(t.eventSystemFlags|=c,s=t.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),t)}function xk(t,s,l,c,p){switch(s){case"focusin":return is=Ji(is,t,s,l,c,p),!0;case"dragenter":return ls=Ji(ls,t,s,l,c,p),!0;case"mouseover":return os=Ji(os,t,s,l,c,p),!0;case"pointerover":var f=p.pointerId;return Vi.set(f,Ji(Vi.get(f)||null,t,s,l,c,p)),!0;case"gotpointercapture":return f=p.pointerId,Yi.set(f,Ji(Yi.get(f)||null,t,s,l,c,p)),!0}return!1}function Yg(t){var s=tr(t.target);if(s!==null){var l=d(s);if(l!==null){if(s=l.tag,s===13){if(s=u(l),s!==null){t.blockedOn=s,om(t.priority,function(){Gg(l)});return}}else if(s===31){if(s=v(l),s!==null){t.blockedOn=s,om(t.priority,function(){Gg(l)});return}}else if(s===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ko(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var l=ap(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);nd=c,l.target.dispatchEvent(c),nd=null}else return s=ar(l),s!==null&&Hg(s),t.blockedOn=l,!1;s.shift()}return!0}function Jg(t,s,l){Ko(t)&&l.delete(s)}function Ck(){sp=!1,is!==null&&Ko(is)&&(is=null),ls!==null&&Ko(ls)&&(ls=null),os!==null&&Ko(os)&&(os=null),Vi.forEach(Jg),Yi.forEach(Jg)}function zo(t,s){t.blockedOn===s&&(t.blockedOn=null,sp||(sp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Ck)))}var $o=null;function Xg(t){$o!==t&&($o=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){$o===t&&($o=null);for(var s=0;s<t.length;s+=3){var l=t[s],c=t[s+1],p=t[s+2];if(typeof c!="function"){if(np(c||l)===null)continue;break}var f=ar(l);f!==null&&(t.splice(s,3),s-=3,au(f,{pending:!0,data:p,method:l.method,action:c},c,p))}}))}function _r(t){function s($){return zo($,t)}is!==null&&zo(is,t),ls!==null&&zo(ls,t),os!==null&&zo(os,t),Vi.forEach(s),Yi.forEach(s);for(var l=0;l<cs.length;l++){var c=cs[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<cs.length&&(l=cs[0],l.blockedOn===null);)Yg(l),l.blockedOn===null&&cs.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var p=l[c],f=l[c+1],A=p[da]||null;if(typeof f=="function")A||Xg(l);else if(A){var M=null;if(f&&f.hasAttribute("formAction")){if(p=f,A=f[da]||null)M=A.formAction;else if(np(p)!==null)continue}else M=A.action;typeof M=="function"?l[c+1]=M:(l.splice(c,3),c-=3),Xg(l)}}}function Wg(){function t(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(A){return p=A})},focusReset:"manual",scroll:"manual"})}function s(){p!==null&&(p(),p=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),p!==null&&(p(),p=null)}}}function rp(t){this._internalRoot=t}Ho.prototype.render=rp.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(i(409));var l=s.current,c=Ia();zg(l,c,t,s,null,null)},Ho.prototype.unmount=rp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;zg(t.current,2,null,t,null,null),So(),s[er]=null}};function Ho(t){this._internalRoot=t}Ho.prototype.unstable_scheduleHydration=function(t){if(t){var s=lm();t={blockedOn:null,target:t,priority:s};for(var l=0;l<cs.length&&s!==0&&s<cs[l].priority;l++);cs.splice(l,0,t),l===0&&Yg(t)}};var Zg=n.version;if(Zg!=="19.2.4")throw Error(i(527,Zg,"19.2.4"));Q.findDOMNode=function(t){var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=m(s),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var kk={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Go=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Go.isDisabled&&Go.supportsFiber)try{Te=Go.inject(kk),Me=Go}catch{}}return Wi.createRoot=function(t,s){if(!o(t))throw Error(i(299));var l=!1,c="",p=iv,f=lv,A=ov;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(f=s.onCaughtError),s.onRecoverableError!==void 0&&(A=s.onRecoverableError)),s=Fg(t,1,!1,null,null,l,c,null,p,f,A,Wg),t[er]=s.current,Pu(t),new rp(s)},Wi.hydrateRoot=function(t,s,l){if(!o(t))throw Error(i(299));var c=!1,p="",f=iv,A=lv,M=ov,$=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(f=l.onUncaughtError),l.onCaughtError!==void 0&&(A=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&($=l.formState)),s=Fg(t,1,!0,s,l??null,c,p,$,f,A,M,Wg),s.context=Kg(null),l=s.current,c=Ia(),c=Yc(c),p=Vn(c),p.callback=null,Yn(l,p,c),l=c,s.current.lanes=l,rt(s,l),sn(s),t[er]=s.current,Pu(t),new Ho(s)},Wi.version="19.2.4",Wi}var cy;function Rk(){if(cy)return op.exports;cy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),op.exports=Dk(),op.exports}var Lk=Rk(),si=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ok=class extends si{#t;#e;#a;constructor(){super(),this.#a=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#a=e,this.#e?.(),this.#e=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},jh=new Ok,_k={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},Qk=class{#t=_k;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,n){return this.#t.setTimeout(e,n)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,n){return this.#t.setInterval(e,n)}clearInterval(e){this.#t.clearInterval(e)}},Gs=new Qk;function Uk(e){setTimeout(e,0)}var Pk=typeof window>"u"||"Deno"in globalThis;function oa(){}function Fk(e,n){return typeof e=="function"?e(n):e}function Up(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ob(e,n){return Math.max(e+(n||0)-Date.now(),0)}function ms(e,n){return typeof e=="function"?e(n):e}function Ma(e,n){return typeof e=="function"?e(n):e}function dy(e,n){const{type:r="all",exact:i,fetchStatus:o,predicate:d,queryKey:u,stale:v}=e;if(u){if(i){if(n.queryHash!==Ah(u,n.options))return!1}else if(!yl(n.queryKey,u))return!1}if(r!=="all"){const h=n.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof v=="boolean"&&n.isStale()!==v||o&&o!==n.state.fetchStatus||d&&!d(n))}function uy(e,n){const{exact:r,status:i,predicate:o,mutationKey:d}=e;if(d){if(!n.options.mutationKey)return!1;if(r){if(gl(n.options.mutationKey)!==gl(d))return!1}else if(!yl(n.options.mutationKey,d))return!1}return!(i&&n.state.status!==i||o&&!o(n))}function Ah(e,n){return(n?.queryKeyHashFn||gl)(e)}function gl(e){return JSON.stringify(e,(n,r)=>Pp(r)?Object.keys(r).sort().reduce((i,o)=>(i[o]=r[o],i),{}):r)}function yl(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>yl(e[r],n[r])):!1}var Kk=Object.prototype.hasOwnProperty;function xh(e,n,r=0){if(e===n)return e;if(r>500)return n;const i=py(e)&&py(n);if(!i&&!(Pp(e)&&Pp(n)))return n;const d=(i?e:Object.keys(e)).length,u=i?n:Object.keys(n),v=u.length,h=i?new Array(v):{};let m=0;for(let g=0;g<v;g++){const b=i?g:u[g],j=e[b],C=n[b];if(j===C){h[b]=j,(i?g<d:Kk.call(e,b))&&m++;continue}if(j===null||C===null||typeof j!="object"||typeof C!="object"){h[b]=C;continue}const k=xh(j,C,r+1);h[b]=k,k===j&&m++}return d===v&&m===d?e:h}function mc(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}function py(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pp(e){if(!hy(e))return!1;const n=e.constructor;if(n===void 0)return!0;const r=n.prototype;return!(!hy(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function hy(e){return Object.prototype.toString.call(e)==="[object Object]"}function zk(e){return new Promise(n=>{Gs.setTimeout(n,e)})}function Fp(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?xh(e,n):n}function $k(e,n,r=0){const i=[...e,n];return r&&i.length>r?i.slice(1):i}function Hk(e,n,r=0){const i=[n,...e];return r&&i.length>r?i.slice(0,-1):i}var Ch=Symbol();function _b(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===Ch?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Qb(e,n){return typeof e=="function"?e(...n):!!e}function Gk(e,n,r){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=n(),i||(i=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var bl=(()=>{let e=()=>Pk;return{isServer(){return e()},setIsServer(n){e=n}}})();function Kp(){let e,n;const r=new Promise((o,d)=>{e=o,n=d});r.status="pending",r.catch(()=>{});function i(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{i({status:"fulfilled",value:o}),e(o)},r.reject=o=>{i({status:"rejected",reason:o}),n(o)},r}var qk=Uk;function Vk(){let e=[],n=0,r=v=>{v()},i=v=>{v()},o=qk;const d=v=>{n?e.push(v):o(()=>{r(v)})},u=()=>{const v=e;e=[],v.length&&o(()=>{i(()=>{v.forEach(h=>{r(h)})})})};return{batch:v=>{let h;n++;try{h=v()}finally{n--,n||u()}return h},batchCalls:v=>(...h)=>{d(()=>{v(...h)})},schedule:d,setNotifyFunction:v=>{r=v},setBatchNotifyFunction:v=>{i=v},setScheduler:v=>{o=v}}}var Pt=Vk(),Yk=class extends si{#t=!0;#e;#a;constructor(){super(),this.#a=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#a)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#a=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#t}},fc=new Yk;function Jk(e){return Math.min(1e3*2**e,3e4)}function Ub(e){return(e??"online")==="online"?fc.isOnline():!0}var zp=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Pb(e){let n=!1,r=0,i;const o=Kp(),d=()=>o.status!=="pending",u=x=>{if(!d()){const S=new zp(x);j(S),e.onCancel?.(S)}},v=()=>{n=!0},h=()=>{n=!1},m=()=>jh.isFocused()&&(e.networkMode==="always"||fc.isOnline())&&e.canRun(),g=()=>Ub(e.networkMode)&&e.canRun(),b=x=>{d()||(i?.(),o.resolve(x))},j=x=>{d()||(i?.(),o.reject(x))},C=()=>new Promise(x=>{i=S=>{(d()||m())&&x(S)},e.onPause?.()}).then(()=>{i=void 0,d()||e.onContinue?.()}),k=()=>{if(d())return;let x;const S=r===0?e.initialPromise:void 0;try{x=S??e.fn()}catch(T){x=Promise.reject(T)}Promise.resolve(x).then(b).catch(T=>{if(d())return;const I=e.retry??(bl.isServer()?0:3),E=e.retryDelay??Jk,L=typeof E=="function"?E(r,T):E,P=I===!0||typeof I=="number"&&r<I||typeof I=="function"&&I(r,T);if(n||!P){j(T);return}r++,e.onFail?.(r,T),zk(L).then(()=>m()?void 0:C()).then(()=>{n?j(T):k()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(i?.(),o),cancelRetry:v,continueRetry:h,canStart:g,start:()=>(g()?k():C().then(k),o)}}var Fb=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Up(this.gcTime)&&(this.#t=Gs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(bl.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(Gs.clearTimeout(this.#t),this.#t=void 0)}};function Xk(e){return{onFetch:(n,r)=>{const i=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,d=n.state.data?.pages||[],u=n.state.data?.pageParams||[];let v={pages:[],pageParams:[]},h=0;const m=async()=>{let g=!1;const b=k=>{Gk(k,()=>n.signal,()=>g=!0)},j=_b(n.options,n.fetchOptions),C=async(k,x,S)=>{if(g)return Promise.reject(n.signal.reason);if(x==null&&k.pages.length)return Promise.resolve(k);const I=(()=>{const N={client:n.client,queryKey:n.queryKey,pageParam:x,direction:S?"backward":"forward",meta:n.options.meta};return b(N),N})(),E=await j(I),{maxPages:L}=n.options,P=S?Hk:$k;return{pages:P(k.pages,E,L),pageParams:P(k.pageParams,x,L)}};if(o&&d.length){const k=o==="backward",x=k?Wk:my,S={pages:d,pageParams:u},T=x(i,S);v=await C(S,T,k)}else{const k=e??d.length;do{const x=h===0?u[0]??i.initialPageParam:my(i,v);if(h>0&&x==null)break;v=await C(v,x),h++}while(h<k)}return v};n.options.persister?n.fetchFn=()=>n.options.persister?.(m,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r):n.fetchFn=m}}}function my(e,{pages:n,pageParams:r}){const i=n.length-1;return n.length>0?e.getNextPageParam(n[i],n,r[i],r):void 0}function Wk(e,{pages:n,pageParams:r}){return n.length>0?e.getPreviousPageParam?.(n[0],n,r[0],r):void 0}var Zk=class extends Fb{#t;#e;#a;#n;#s;#r;#l;#i;constructor(e){super(),this.#i=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=vy(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#l,...e},e?._type&&(this.#t=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=vy(this.options);n.data!==void 0&&(this.setState(fy(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,n){const r=Fp(this.state.data,e,this.options);return this.#o({data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e){this.#o({type:"setState",state:e})}cancel(e){const n=this.#r?.promise;return this.#r?.cancel(e),n?n.then(oa).catch(oa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ma(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ch||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ms(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Ob(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#r&&(this.#i||this.#d()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#d(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#i=!0,r.signal)})},o=()=>{const h=_b(this.options,n),g=(()=>{const b={client:this.#s,queryKey:this.queryKey,meta:this.meta};return i(b),b})();return this.#i=!1,this.options.persister?this.options.persister(h,g,this):h(g)},u=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:o};return i(h),h})();(this.#t==="infinite"?Xk(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#a=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#o({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=Pb({initialPromise:n?.initialPromise,fn:u.fetchFn,onCancel:h=>{h instanceof zp&&h.revert&&this.setState({...this.#a,fetchStatus:"idle"}),r.abort()},onFail:(h,m)=>{this.#o({type:"failed",failureCount:h,error:m})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof zp){if(h.silent)return this.#r.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#o({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#o(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Kb(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...fy(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#a=e.manual?i:void 0,i;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Pt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Kb(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ub(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fy(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vy(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var kh=class extends si{constructor(e,n){super(),this.options=n,this.#t=e,this.#i=null,this.#l=Kp(),this.bindMethods(),this.setOptions(n)}#t;#e=void 0;#a=void 0;#n=void 0;#s;#r;#l;#i;#d;#o;#h;#u;#m;#c;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),gy(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $p(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $p(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#j(),this.#A(),this.#e.removeObserver(this)}setOptions(e){const n=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ma(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#e.setOptions(this.options),n._defaulted&&!mc(this.options,n)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const i=this.hasListeners();i&&yy(this.#e,r,this.options,n)&&this.#p(),this.updateResult(),i&&(this.#e!==r||Ma(this.options.enabled,this.#e)!==Ma(n.enabled,this.#e)||ms(this.options.staleTime,this.#e)!==ms(n.staleTime,this.#e))&&this.#v();const o=this.#g();i&&(this.#e!==r||Ma(this.options.enabled,this.#e)!==Ma(n.enabled,this.#e)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const n=this.#t.getQueryCache().build(this.#t,e),r=this.createResult(n,e);return tS(this,r)&&(this.#n=r,this.#r=this.options,this.#s=this.#e.state),r}getCurrentResult(){return this.#n}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#l.status==="pending"&&this.#l.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#t.defaultQueryOptions(e),r=this.#t.getQueryCache().build(this.#t,n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#p(e){this.#x();let n=this.#e.fetch(this.options,e);return e?.throwOnError||(n=n.catch(oa)),n}#v(){this.#j();const e=ms(this.options.staleTime,this.#e);if(bl.isServer()||this.#n.isStale||!Up(e))return;const r=Ob(this.#n.dataUpdatedAt,e)+1;this.#u=Gs.setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#A(),this.#c=e,!(bl.isServer()||Ma(this.options.enabled,this.#e)===!1||!Up(this.#c)||this.#c===0)&&(this.#m=Gs.setInterval(()=>{(this.options.refetchIntervalInBackground||jh.isFocused())&&this.#p()},this.#c))}#b(){this.#v(),this.#y(this.#g())}#j(){this.#u!==void 0&&(Gs.clearTimeout(this.#u),this.#u=void 0)}#A(){this.#m!==void 0&&(Gs.clearInterval(this.#m),this.#m=void 0)}createResult(e,n){const r=this.#e,i=this.options,o=this.#n,d=this.#s,u=this.#r,h=e!==r?e.state:this.#a,{state:m}=e;let g={...m},b=!1,j;if(n._optimisticResults){const z=this.hasListeners(),ne=!z&&gy(e,n),ye=z&&yy(e,r,n,i);(ne||ye)&&(g={...g,...Kb(m.data,e.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:C,errorUpdatedAt:k,status:x}=g;j=g.data;let S=!1;if(n.placeholderData!==void 0&&j===void 0&&x==="pending"){let z;o?.isPlaceholderData&&n.placeholderData===u?.placeholderData?(z=o.data,S=!0):z=typeof n.placeholderData=="function"?n.placeholderData(this.#h?.state.data,this.#h):n.placeholderData,z!==void 0&&(x="success",j=Fp(o?.data,z,n),b=!0)}if(n.select&&j!==void 0&&!S)if(o&&j===d?.data&&n.select===this.#d)j=this.#o;else try{this.#d=n.select,j=n.select(j),j=Fp(o?.data,j,n),this.#o=j,this.#i=null}catch(z){this.#i=z}this.#i&&(C=this.#i,j=this.#o,k=Date.now(),x="error");const T=g.fetchStatus==="fetching",I=x==="pending",E=x==="error",L=I&&T,P=j!==void 0,R={status:x,fetchStatus:g.fetchStatus,isPending:I,isSuccess:x==="success",isError:E,isInitialLoading:L,isLoading:L,data:j,dataUpdatedAt:g.dataUpdatedAt,error:C,errorUpdatedAt:k,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:T,isRefetching:T&&!I,isLoadingError:E&&!P,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:E&&P,isStale:Sh(e,n),refetch:this.refetch,promise:this.#l,isEnabled:Ma(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const z=R.data!==void 0,ne=R.status==="error"&&!z,ye=oe=>{ne?oe.reject(R.error):z&&oe.resolve(R.data)},J=()=>{const oe=this.#l=R.promise=Kp();ye(oe)},re=this.#l;switch(re.status){case"pending":e.queryHash===r.queryHash&&ye(re);break;case"fulfilled":(ne||R.data!==re.value)&&J();break;case"rejected":(!ne||R.error!==re.reason)&&J();break}}return R}updateResult(){const e=this.#n,n=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#h=this.#e),mc(n,e))return;this.#n=n;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!this.#f.size)return!0;const d=new Set(o??this.#f);return this.options.throwOnError&&d.add("error"),Object.keys(this.#n).some(u=>{const v=u;return this.#n[v]!==e[v]&&d.has(v)})};this.#C({listeners:r()})}#x(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const n=this.#e;this.#e=e,this.#a=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(e){Pt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function eS(e,n){return Ma(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ma(n.retryOnMount,e)===!1)}function gy(e,n){return eS(e,n)||e.state.data!==void 0&&$p(e,n,n.refetchOnMount)}function $p(e,n,r){if(Ma(n.enabled,e)!==!1&&ms(n.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&Sh(e,n)}return!1}function yy(e,n,r,i){return(e!==n||Ma(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Sh(e,r)}function Sh(e,n){return Ma(n.enabled,e)!==!1&&e.isStaleByTime(ms(n.staleTime,e))}function tS(e,n){return!mc(e.getCurrentResult(),n)}var aS=class extends Fb{#t;#e;#a;#n;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#a=e.mutationCache,this.#e=[],this.state=e.state||nS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(n=>n!==e),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#a.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#s({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=Pb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(d,u)=>{this.#s({type:"failed",failureCount:d,error:u})},onPause:()=>{this.#s({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)});const i=this.state.status==="pending",o=!this.#n.canStart();try{if(i)n();else{this.#s({type:"pending",variables:e,isPaused:o}),this.#a.config.onMutate&&await this.#a.config.onMutate(e,this,r);const u=await this.options.onMutate?.(e,r);u!==this.state.context&&this.#s({type:"pending",context:u,variables:e,isPaused:o})}const d=await this.#n.start();return await this.#a.config.onSuccess?.(d,e,this.state.context,this,r),await this.options.onSuccess?.(d,e,this.state.context,r),await this.#a.config.onSettled?.(d,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(d,null,e,this.state.context,r),this.#s({type:"success",data:d}),d}catch(d){try{await this.#a.config.onError?.(d,e,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onError?.(d,e,this.state.context,r)}catch(u){Promise.reject(u)}try{await this.#a.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,d,e,this.state.context,r)}catch(u){Promise.reject(u)}throw this.#s({type:"error",error:d}),d}finally{this.#a.runNext(this)}}#s(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Pt.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#a.notify({mutation:this,type:"updated",action:e})})}};function nS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var sS=class extends si{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#a=0}#t;#e;#a;build(e,n,r){const i=new aS({client:e,mutationCache:this,mutationId:++this.#a,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){this.#t.add(e);const n=Vo(e);if(typeof n=="string"){const r=this.#e.get(n);r?r.push(e):this.#e.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const n=Vo(e);if(typeof n=="string"){const r=this.#e.get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&this.#e.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Vo(e);if(typeof n=="string"){const i=this.#e.get(n)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const n=Vo(e);return typeof n=="string"?this.#e.get(n)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Pt.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const n={exact:!0,...e};return this.getAll().find(r=>uy(n,r))}findAll(e={}){return this.getAll().filter(n=>uy(e,n))}notify(e){Pt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Pt.batch(()=>Promise.all(e.map(n=>n.continue().catch(oa))))}};function Vo(e){return e.options.scope?.id}function by(e,n){const r=new Set(n);return e.filter(i=>!r.has(i))}function rS(e,n,r){const i=e.slice(0);return i[n]=r,i}var iS=class extends si{#t;#e;#a;#n;#s;#r;#l;#i;#d;#o=[];constructor(e,n,r){super(),this.#t=e,this.#n=r,this.#a=[],this.#s=[],this.#e=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(n=>{this.#f(e,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,n){this.#a=e,this.#n=n,Pt.batch(()=>{const r=this.#s,i=this.#c(this.#a);i.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=i.map(g=>g.observer),d=o.map(g=>g.getCurrentResult()),u=r.length!==o.length,v=o.some((g,b)=>g!==r[b]),h=u||v,m=h?!0:d.some((g,b)=>{const j=this.#e[b];return!j||!mc(g,j)});!h&&!m||(h&&(this.#o=i,this.#s=o),this.#e=d,this.hasListeners()&&(h&&(by(r,o).forEach(g=>{g.destroy()}),by(o,r).forEach(g=>{g.subscribe(b=>{this.#f(g,b)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,n){const r=this.#c(e),i=r.map(d=>d.observer.getOptimisticResult(d.defaultedQueryOptions)),o=r.map(d=>d.defaultedQueryOptions.queryHash);return[i,d=>this.#u(d??i,n,o),()=>this.#h(i,r)]}#h(e,n){return n.map((r,i)=>{const o=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?o:r.observer.trackResult(o,d=>{n.forEach(u=>{u.observer.trackProp(d)})})})}#u(e,n,r){if(n){const i=this.#d,o=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((d,u)=>d!==i[u]));return(!this.#r||this.#e!==this.#i||o||n!==this.#l)&&(this.#l=n,this.#i=this.#e,r!==void 0&&(this.#d=r),this.#r=xh(this.#r,n(e))),this.#r}return e}#m(){return this.#n?.combine!==void 0&&this.#s.some((e,n)=>e.options.suspense&&this.#e[n]?.data===void 0)}#c(e){const n=new Map;this.#s.forEach(i=>{const o=i.options.queryHash;if(!o)return;const d=n.get(o);d?d.push(i):n.set(o,[i])});const r=[];return e.forEach(i=>{const o=this.#t.defaultQueryOptions(i),u=n.get(o.queryHash)?.shift()??new kh(this.#t,o);r.push({defaultedQueryOptions:o,observer:u})}),r}#f(e,n){const r=this.#s.indexOf(e);r!==-1&&(this.#e=rS(this.#e,r,n),this.#p())}#p(){if(this.hasListeners()){const e=this.#h(this.#e,this.#o),n=this.#m(),r=this.#r,i=n?r:this.#u(e,this.#n?.combine);(n||r!==i)&&Pt.batch(()=>{this.listeners.forEach(o=>{o(this.#e)})})}}},lS=class extends si{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,n,r){const i=n.queryKey,o=n.queryHash??Ah(i,n);let d=this.get(o);return d||(d=new Zk({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(d)),d}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#t.get(e.queryHash);n&&(e.destroy(),n===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Pt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>dy(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>dy(e,r)):n}notify(e){Pt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Pt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Pt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},oS=class{#t;#e;#a;#n;#s;#r;#l;#i;constructor(e={}){this.#t=e.queryCache||new lS,this.#e=e.mutationCache||new sS,this.#a=e.defaultOptions||{},this.#n=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#l=jh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=fc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#l?.(),this.#l=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=this.#t.build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ms(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.defaultQueryOptions({queryKey:e}),d=this.#t.get(i.queryHash)?.state.data,u=Fk(n,d);if(u!==void 0)return this.#t.build(this,i).setData(u,{...r,manual:!0})}setQueriesData(e,n,r){return Pt.batch(()=>this.#t.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state}removeQueries(e){const n=this.#t;Pt.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=this.#t;return Pt.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},i=Pt.batch(()=>this.#t.findAll(e).map(o=>o.cancel(r)));return Promise.all(i).then(oa).catch(oa)}invalidateQueries(e,n={}){return Pt.batch(()=>(this.#t.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=Pt.batch(()=>this.#t.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let d=o.fetch(void 0,r);return r.throwOnError||(d=d.catch(oa)),o.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(i).then(oa)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=this.#t.build(this,n);return r.isStaleByTime(ms(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(oa).catch(oa)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(oa).catch(oa)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return fc.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#a}setDefaultOptions(e){this.#a=e}setQueryDefaults(e,n){this.#n.set(gl(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#n.values()],r={};return n.forEach(i=>{yl(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,n){this.#s.set(gl(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#s.values()],r={};return n.forEach(i=>{yl(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#a.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Ah(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Ch&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#a.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},zb=y.createContext(void 0),Tc=e=>{const n=y.useContext(zb);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cS=({client:e,children:n})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(zb.Provider,{value:e,children:n})),$b=y.createContext(!1),Hb=()=>y.useContext($b);$b.Provider;function dS(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var uS=y.createContext(dS()),Gb=()=>y.useContext(uS),qb=(e,n,r)=>{const i=r?.state.error&&typeof e.throwOnError=="function"?Qb(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(n.isReset()||(e.retryOnMount=!1))},Vb=e=>{y.useEffect(()=>{e.clearReset()},[e])},Yb=({result:e,errorResetBoundary:n,throwOnError:r,query:i,suspense:o})=>e.isError&&!n.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||Qb(r,[e.error,i])),Jb=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...o)=>r(i(...o)):r(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},pS=(e,n)=>e.isLoading&&e.isFetching&&!n,Hp=(e,n)=>e?.suspense&&n.isPending,Gp=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function hS({queries:e,...n},r){const i=Tc(),o=Hb(),d=Gb(),u=y.useMemo(()=>e.map(x=>{const S=i.defaultQueryOptions(x);return S._optimisticResults=o?"isRestoring":"optimistic",S}),[e,i,o]);u.forEach(x=>{Jb(x);const S=i.getQueryCache().get(x.queryHash);qb(x,d,S)}),Vb(d);const[v]=y.useState(()=>new iS(i,u,n)),[h,m,g]=v.getOptimisticResult(u,n.combine),b=!o&&n.subscribed!==!1;y.useSyncExternalStore(y.useCallback(x=>b?v.subscribe(Pt.batchCalls(x)):oa,[v,b]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),y.useEffect(()=>{v.setQueries(u,n)},[u,n,v]);const C=h.some((x,S)=>Hp(u[S],x))?h.flatMap((x,S)=>{const T=u[S];if(T&&Hp(T,x)){const I=new kh(i,T);return Gp(T,I,d)}return[]}):[];if(C.length>0)throw Promise.all(C);const k=h.find((x,S)=>{const T=u[S];return T&&Yb({result:x,errorResetBoundary:d,throwOnError:T.throwOnError,query:i.getQueryCache().get(T.queryHash),suspense:T.suspense})});if(k?.error)throw k.error;return m(g())}function mS(e,n,r){const i=Hb(),o=Gb(),d=Tc(),u=d.defaultQueryOptions(e);d.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const v=d.getQueryCache().get(u.queryHash),h=e.subscribed!==!1;u._optimisticResults=i?"isRestoring":h?"optimistic":void 0,Jb(u),qb(u,o,v),Vb(o);const m=!d.getQueryCache().get(u.queryHash),[g]=y.useState(()=>new n(d,u)),b=g.getOptimisticResult(u),j=!i&&h;if(y.useSyncExternalStore(y.useCallback(C=>{const k=j?g.subscribe(Pt.batchCalls(C)):oa;return g.updateResult(),k},[g,j]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),y.useEffect(()=>{g.setOptions(u)},[u,g]),Hp(u,b))throw Gp(u,g,o);if(Yb({result:b,errorResetBoundary:o,throwOnError:u.throwOnError,query:v,suspense:u.suspense}))throw b.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(u,b),u.experimental_prefetchInRender&&!bl.isServer()&&pS(b,i)&&(m?Gp(u,g,o):v?.promise)?.catch(oa).finally(()=>{g.updateResult()}),u.notifyOnChangeProps?b:g.trackResult(b)}function mt(e,n){return mS(e,kh)}function fS(e,n){const r=Tc(),i=r.getQueryCache();return y.useSyncExternalStore(y.useCallback(o=>i.subscribe(Pt.batchCalls(o)),[i]),()=>r.isFetching(e),()=>r.isFetching(e))}var Yr=Lb();const Va=(...e)=>e.filter(Boolean).join(" "),vS=()=>{},jy=()=>{},Xb=y.createContext({panel:null,setPanel:vS}),gS=y.createContext({hasProvider:!1,setChrome:jy,clearChrome:jy}),yS=[{id:"narrow",label:"Small"},{id:"medium",label:"Mid"},{id:"wide",label:"Large"}],bS=e=>e==="medium"||e==="wide"?e:"narrow",Ay=()=>typeof document>"u"?null:document.querySelector(".app, .chat-standalone-root");function jS(){return y.useContext(Xb)}function AS({accent:e="coral",theme:n="dark",navState:r="expanded",chatHost:i,thinBar:o=null,leftDock:d=null,leftDockMode:u="hidden",leftDockWidth:v=null,className:h,children:m,style:g,...b}){const[j,C]=y.useState(null),[k,x]=y.useState({}),S=y.useMemo(()=>({panel:j,setPanel:C}),[j]),T=y.useCallback(re=>{x(oe=>{const fe=re??{};return oe.ownerId===fe.ownerId&&oe.thinBar===fe.thinBar&&oe.leftDock===fe.leftDock&&oe.leftDockMode===fe.leftDockMode&&oe.leftDockWidth===fe.leftDockWidth?oe:fe})},[]),I=y.useCallback(re=>{x(oe=>!re||oe.ownerId===re?!oe.ownerId&&oe.thinBar==null&&oe.leftDock==null&&oe.leftDockMode==null&&oe.leftDockWidth==null?oe:{}:oe)},[]),E=y.useMemo(()=>({hasProvider:!0,setChrome:T,clearChrome:I}),[I,T]),L=k.thinBar??o??null,P=k.leftDock??d??null,N=k.leftDockMode??(P?u:"hidden"),R=k.leftDockWidth??v??null,z=typeof R=="number"?`${R}px`:R||"0px",ne={...g,"--shell-left-dock-width":z,"--shell-left-dock-reserved-width":N==="pinned"&&P?z:"0px"},J=N!=="hidden"&&z!=="0px"&&z!==""?N:"hidden";return a.jsx(Xb.Provider,{value:S,children:a.jsx(gS.Provider,{value:E,children:a.jsxs("div",{...b,className:Va("app",h),"data-accent":e,"data-theme":n,"data-nav":r,"data-chat-host":i,"data-shell-left-dock-mode":J,style:ne,children:[m,a.jsx(xS,{children:L}),a.jsxs("aside",{className:"shell-workbench-dock-host","data-mode":J,"data-has-content":P?"true":"false","aria-hidden":J==="hidden"?"true":void 0,children:[N==="pinned"&&P?a.jsx("div",{className:"shell-workbench-dock-slot",children:P}):null,a.jsx("div",{className:"shell-workbench-dock-portal-target"})]})]})})})}function xS({className:e,children:n,...r}){const i=y.Children.count(n)>0;return a.jsx("section",{...r,className:Va("shell-thinbar",e),"data-has-content":i?"true":"false","aria-hidden":i?void 0:"true",children:i?a.jsx("div",{className:"shell-thinbar-inner",children:n}):null})}function CS({icons:e,className:n,...r}){const{panel:i}=jS(),o=i,d=o?.content??null;if(!o||!d)return null;const u=o.open!==!1,v=bS(o.size),h=typeof o.onSizeChange=="function",m=o.tabLabel??"Open panel",g=v==="wide",b=g?"Collapse panel width":"Expand panel width";return a.jsx("aside",{...r,className:Va("shell-secondary-panel",n,o.className),"data-state":u?"open":"closed","data-size":v,children:u?a.jsxs("div",{className:"shell-secondary-panel-frame",children:[a.jsxs("div",{className:"shell-secondary-panel-toolbar",children:[a.jsx("button",{className:"shell-secondary-panel-close",type:"button",onClick:()=>o.onOpenChange?.(!1),"aria-label":"Close panel",title:"Close panel",children:e?.close??null}),h?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"shell-panel-size-toggle",type:"button",onClick:()=>o.onSizeChange?.(g?"narrow":"wide"),"aria-pressed":g,"aria-label":b,title:b,children:g?e?.collapseWidth??e?.chevronRight??null:e?.expandWidth??e?.close??null}),a.jsx("div",{className:"shell-panel-size-control",role:"group","aria-label":"Panel size",children:yS.map(j=>a.jsx("button",{className:`shell-panel-size-button${v===j.id?" active":""}`,type:"button",onClick:()=>o.onSizeChange?.(j.id),"aria-label":j.label,title:j.label,children:a.jsx("span",{className:`shell-panel-size-icon ${j.id}`,"aria-hidden":"true",children:a.jsx("i",{})})},j.id))})]}):null]}),a.jsx("div",{className:Va("shell-secondary-panel-body",o.bodyClassName),children:d})]}):a.jsx("div",{className:"shell-secondary-panel-tab-wrap",children:a.jsx("button",{className:"shell-secondary-panel-tab",type:"button",onClick:()=>o.onOpenChange?.(!0),"aria-label":m,title:m,children:a.jsx("span",{className:"shell-secondary-panel-tab-icon","aria-hidden":"true",children:o.tabIcon??e?.chevronRight??null})})})})}function kS({className:e,children:n="Skip to Main Content",href:r="#main-content",...i}){return a.jsx("a",{...i,className:Va("skip-link",e),href:r,children:n})}function SS({className:e,children:n,...r}){return a.jsx("header",{...r,className:Va("topbar",e),children:n})}function wS({className:e,children:n,...r}){return a.jsx("main",{...r,className:Va("main",e),children:n})}function NS({accent:e="coral",accents:n,icons:r,theme:i="dark",themeLabel:o,themes:d,activeThemeId:u,onSetAccent:v,onSetThemeId:h,onToggleTheme:m,onOpenSettings:g,settingsLabel:b="Theme settings",className:j,...C}){const[k,x]=y.useState(!1),S=y.useRef(null),T=n.find(N=>N.id===e)??n[0]??null,I=d?.find(N=>N.id===u)??d?.[0]??null,E=Array.isArray(d)&&d.length>0,L=d?.length?`${o??I?.label??"Theme"} · ${T?.label??"Accent"}`:T?.label??"Accent",P=y.useCallback(()=>{x(!1)},[]);return y.useEffect(()=>{if(!k)return;const N=z=>{z.target instanceof Node&&(S.current?.contains(z.target)||P())},R=z=>{z.key==="Escape"&&P()};return document.addEventListener("mousedown",N),document.addEventListener("touchstart",N),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",N),document.removeEventListener("touchstart",N),document.removeEventListener("keydown",R)}},[k,P]),a.jsxs("div",{...C,className:Va("topbar-secondary-controls",j),ref:S,children:[a.jsxs("div",{className:"accent-switch",children:[a.jsxs("button",{className:`accent-menu-button${k?" open":""}`,type:"button",onClick:()=>x(N=>!N),"aria-haspopup":"menu","aria-expanded":k,children:[a.jsx("span",{className:"accent-swatch current","aria-hidden":"true",style:T?.swatch?{background:T.swatch}:void 0}),a.jsx("span",{children:L}),a.jsx("span",{className:"accent-menu-caret","aria-hidden":"true",children:r?.down??null})]}),k?a.jsxs("div",{className:"accent-menu-list",role:"menu",children:[E?a.jsxs("div",{className:"accent-menu-group",children:[a.jsx("div",{className:"accent-menu-section-label",children:"Themes"}),d.map(N=>a.jsxs("div",{className:`accent-menu-theme-card${I?.id===N.id?" active":""}`,children:[a.jsx("button",{className:`accent-menu-item theme-option${I?.id===N.id?" active":""}`,type:"button",onClick:()=>{h?.(N.id),P()},children:a.jsxs("span",{className:"accent-menu-theme-copy",children:[a.jsx("span",{className:"accent-menu-text",children:N.label}),N.description?a.jsx("span",{className:"accent-menu-hint",children:N.description}):null]})}),N.variations?.length?a.jsx("div",{className:"accent-menu-variation-list",role:"group","aria-label":`${N.label} variations`,children:N.variations.map(R=>{const z=I?.id===N.id&&e===R.id;return a.jsxs("button",{className:`accent-menu-variation${z?" active":""}`,type:"button",onClick:()=>{h?.(N.id),v?.(R.id),P()},children:[a.jsx("span",{className:"accent-swatch accent-menu-variation-swatch","aria-hidden":"true",style:R.swatch?{background:R.swatch}:void 0}),a.jsx("span",{className:"accent-menu-variation-label",children:R.label})]},`${N.id}-${R.id}`)})}):null]},N.id))]}):a.jsxs("div",{className:"accent-menu-group",children:[a.jsx("div",{className:"accent-menu-section-label",children:"Accent"}),n.map(N=>a.jsxs("button",{className:`accent-menu-item${e===N.id?" active":""}`,type:"button",role:"menuitemradio","aria-checked":e===N.id,"data-accent":N.id,onClick:()=>{v?.(N.id),P()},children:[a.jsx("span",{className:"accent-swatch","data-accent":N.id,style:N.swatch?{background:N.swatch}:void 0}),a.jsx("span",{className:"accent-menu-text",children:N.label})]},N.id))]}),g?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"accent-menu-divider"}),a.jsxs("button",{className:"accent-menu-settings",type:"button",onClick:()=>{g(),P()},children:[a.jsx("span",{className:"accent-menu-settings-icon","aria-hidden":"true",children:r?.gear??null}),a.jsx("span",{children:b})]})]}):null]}):null]}),a.jsx("button",{className:"theme-toggle",type:"button",onClick:()=>m?.(),"aria-label":"Toggle theme",title:i==="dark"?"Switch to light":"Switch to dark",children:i==="dark"?r?.sun??null:r?.moon??null})]})}function IS({title:e="AOPS",subtitle:n="LAB",className:r,...i}){return a.jsx("div",{...i,className:Va("logo",r),children:a.jsxs("div",{className:"brand-text",children:[a.jsx("span",{className:"brand-title",children:e}),a.jsx("span",{className:"brand-subtitle",children:n})]})})}const ES=(e,n)=>n?e.navigable===!0:e.navigable!==!1,xy=(e,n)=>e.toggleLabel??`${n?"Collapse":"Expand"} ${e.label}`,MS=({expanded:e})=>a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M9 3v18",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:e?"m16 15-3-3 3-3":"m14 9 3 3-3 3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}),TS=()=>a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M7 7l10 10M17 7L7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})}),BS={collapse:"Collapse to icon rail",expand:"Expand sidebar",hide:"Close sidebar",hideHint:"Reopen from the top bar",headerControls:"Sidebar controls",pin:"Pin sidebar",unpin:"Unpin sidebar"};function DS({navRef:e,items:n,icons:r,activePage:i,navMode:o="expanded",navAutoHide:d=!1,navPopoverEnabled:u=!1,navPopoverOpen:v=!1,isNavEdgeVisible:h=!0,brand:m,brandTitle:g="AOPS",brandSubtitle:b="LAB",footer:j,navHeaderControls:C=!0,navRailFlyout:k=!0,navLabels:x,showNavEdgeTab:S=!0,onSetNavMode:T,onToggleNavAutoHide:I,onToggleNavPopover:E,onNavEdgeHoverChange:L,onNavPopoverHoverChange:P,onNavigate:N,onToggleBranch:R,onPrefetch:z,renderIcon:ne,onMouseEnter:ye,onMouseLeave:J,className:re,...oe}){const fe=y.useRef(null),[de,G]=y.useState(()=>Ay()),Q=o==="expanded",W=o==="hidden",pe=u&&v&&!Q,ke=!W,O=!ke&&S,_={...BS,...x},K=k&&o==="collapsed"&&!u,[ee,ve]=y.useState(null),[se,Z]=y.useState(null),ae=y.useRef(null),ce=y.useRef(null),w=y.useRef(null),F=y.useRef(null),X=y.useCallback(()=>{w.current!==null&&(window.clearTimeout(w.current),w.current=null),F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),D=y.useCallback(()=>{X(),ae.current=null,ve(null)},[X]),B=y.useCallback((Ee,Le)=>{X(),ae.current=Le,ve(Ee.id)},[X]),U=y.useCallback((Ee,Le)=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null),w.current!==null&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{w.current=null,B(Ee,Le)},160)},[B]),H=y.useCallback(()=>{w.current!==null&&(window.clearTimeout(w.current),w.current=null),F.current!==null&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>{F.current=null,ae.current=null,ve(null)},260)},[]),q=y.useCallback(()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),V=y.useRef(!1);y.useEffect(()=>()=>X(),[X]),y.useEffect(()=>{!K&&ee&&D()},[K,ee,D]),y.useEffect(()=>{D()},[i,D]),y.useEffect(()=>{if(!ee){Z(null);return}const Ee=()=>{const Te=ae.current;if(!Te)return;const Me=Te.getBoundingClientRect(),Fe=ce.current?.offsetHeight??0,ze=8,Mt=Math.round(Me.right+6),ca=Math.max(ze,window.innerHeight-Fe-ze),Ct=Math.round(Math.min(ca,Math.max(ze,Me.top-6)));Z(ut=>ut?.left===Mt&&ut?.top===Ct?ut:{left:Mt,top:Ct})};let Le=null;const xe=()=>{Le===null&&(Le=window.requestAnimationFrame(()=>{Le=null,Ee()}))};return Ee(),window.addEventListener("resize",xe),window.addEventListener("scroll",xe,!0),()=>{window.removeEventListener("resize",xe),window.removeEventListener("scroll",xe,!0),Le!==null&&window.cancelAnimationFrame(Le)}},[ee]),y.useEffect(()=>{!ee||!V.current||(V.current=!1,ce.current?.querySelector("a.nav-item")?.focus())},[ee,se]),y.useEffect(()=>{if(!ee)return;const Ee=xe=>{xe.target instanceof Node&&(ce.current?.contains(xe.target)||ae.current?.contains(xe.target)||D())},Le=xe=>{if(xe.key!=="Escape")return;const Te=ae.current;D(),Te?.focus()};return document.addEventListener("pointerdown",Ee),document.addEventListener("keydown",Le),()=>{document.removeEventListener("pointerdown",Ee),document.removeEventListener("keydown",Le)}},[ee,D]);const be=y.useCallback(Ee=>Ee.active?!0:i===Ee.id,[i]),ge=y.useCallback(Ee=>Array.isArray(Ee.children)?Ee.children.some(Le=>be(Le)||ge(Le)):!1,[be]),Se=y.useCallback((Ee,Le,xe=0)=>{const Te=ne?.(Ee)??(Ee.icon?r?.[Ee.icon]??null:null),Me=be(Ee),Fe=ge(Ee),ze=Array.isArray(Ee.children)&&Ee.children.length>0,Mt=!!(ze&&Le&&(Ee.expanded??Fe)),ca=ES(Ee,ze),Ct=()=>{(R??N)?.(Ee)},ut=K&&!Le&&xe===0&&ze,Jt=ut&&ee===Ee.id,_t=a.jsxs("a",{className:`nav-item${Me?" active":""}${Fe&&!Me?" branch-active":""}${ze?" parent":""}${xe>0?" child":""}`,"aria-label":Ee.label,"aria-current":Me?"page":void 0,"aria-expanded":ut?Jt:ze?Mt:void 0,"aria-haspopup":ut?"true":void 0,href:`#${Ee.id}`,onClick:he=>{if(he.preventDefault(),ut){Jt?D():B(Ee,he.currentTarget);return}if(ca){N?.(Ee);return}Ct()},onMouseEnter:he=>{z?.(Ee.id),ut&&U(Ee,he.currentTarget)},onMouseLeave:ut?()=>H():void 0,onKeyDown:ut?he=>{he.key!=="ArrowRight"&&he.key!=="Enter"&&he.key!==" "||(he.preventDefault(),V.current=!0,B(Ee,he.currentTarget))}:void 0,onFocus:()=>z?.(Ee.id),ref:Me?fe:null,title:Le?void 0:Ee.label,children:[xe===0?a.jsx("span",{className:"nav-icon",children:Te}):null,a.jsx("span",{className:"nav-label",children:Ee.label})]});return a.jsxs("div",{className:`nav-node depth-${xe}${Mt?" expanded":""}`,children:[ze&&Le?a.jsxs("div",{className:`nav-item-row${Me?" active":""}${Fe&&!Me?" branch-active":""}`,children:[_t,a.jsx("button",{className:`nav-item-toggle${Mt?" active":""}`,type:"button","aria-label":xy(Ee,Mt),"aria-expanded":Mt,onClick:he=>{he.preventDefault(),he.stopPropagation(),Ct()},title:xy(Ee,Mt),children:a.jsx("span",{className:"nav-branch-caret","aria-hidden":"true",children:Mt?r?.down??null:r?.chevronRight??null})})]}):_t,Mt?a.jsx("div",{className:"nav-sublist",children:Ee.children?.map(he=>Se(he,Le,xe+1))}):null]},Ee.id)},[D,ge,r,be,N,R,z,B,K,ee,ne,H,U]);y.useEffect(()=>{de||G(Ay())},[de]),y.useEffect(()=>{fe.current&&fe.current.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[i,n,o]);const Ne=Ee=>!u||Q||pe?!0:o==="collapsed"||o==="hidden",we=Ee=>{ye?.(Ee),P?.(Ne())},Be=Ee=>{P?.(Ne())},Je=Ee=>{J?.(Ee),P?.(!1)},Ke=Ee=>a.jsxs("div",{className:"nav-surface",children:[C&&T?a.jsxs("div",{className:"nav-surface-actions",role:"toolbar","aria-label":_.headerControls,children:[a.jsx("button",{className:"nav-surface-action",type:"button",onClick:()=>T(Q?"collapsed":"expanded"),"aria-label":Q?_.collapse:_.expand,title:Q?_.collapse:_.expand,children:a.jsx(MS,{expanded:Q})}),Q?a.jsx("button",{className:"nav-surface-action",type:"button",onClick:()=>T("hidden"),"aria-label":_.hide,title:_.hideHint?`${_.hide} — ${_.hideHint}`:_.hide,children:a.jsx(TS,{})}):null]}):null,m===null?null:a.jsx("div",{className:"nav-top",children:m??a.jsx(IS,{title:g,subtitle:b})}),a.jsx("div",{className:"nav-list",children:n.map(Le=>Se(Le,Ee))}),j]}),Xe=K&&ee?n.find(Ee=>Ee.id===ee)??null:null,Et=Xe?a.jsxs("div",{className:"nav-flyout",ref:ce,role:"group","aria-label":Xe.label,style:se?{top:`${se.top}px`,left:`${se.left}px`}:{visibility:"hidden"},onMouseEnter:q,onMouseLeave:()=>H(),onClick:Ee=>{const Le=Ee.target instanceof Element?Ee.target.closest("a.nav-item"):null;Le&&!Le.hasAttribute("aria-expanded")&&D()},onKeyDown:Ee=>{if(Ee.key!=="ArrowDown"&&Ee.key!=="ArrowUp")return;const Le=Array.from(ce.current?.querySelectorAll("a.nav-item")??[]);if(!Le.length)return;Ee.preventDefault();const xe=Le.indexOf(document.activeElement),Te=Ee.key==="ArrowDown"?Math.min(Le.length-1,xe+1):Math.max(0,xe-1);Le[xe===-1?0:Te]?.focus()},children:[a.jsx("div",{className:"nav-flyout-title",children:Xe.label}),a.jsx("div",{className:"nav-list nav-flyout-list",children:Xe.children?.map(Ee=>Se(Ee,!0,1))})]}):null,vt=pe?a.jsx("aside",{className:Va("nav","nav-popover",re),"data-popover-open":"true","data-popover-enabled":u?"true":"false","aria-hidden":ke?void 0:!1,onMouseEnter:we,onMouseMove:Be,onMouseLeave:Je,children:Ke(!0)}):null;return a.jsxs(a.Fragment,{children:[O&&o==="hidden"&&!u?a.jsx("div",{className:"nav-hidden-edge-hotspot","aria-hidden":"true",onMouseEnter:()=>L?.(!0),onMouseLeave:()=>L?.(!1)}):null,a.jsxs("aside",{...oe,className:Va("nav",re),ref:e,"data-popover-open":"false","data-popover-enabled":u?"true":"false",onMouseEnter:we,onMouseMove:Be,onMouseLeave:Je,children:[ke?Ke(Q):null,O?a.jsxs("div",{className:`nav-edge-tab${h?" revealed":""}`,role:"toolbar","aria-label":"Sidebar controls",onMouseEnter:()=>L?.(!0),onMouseLeave:()=>L?.(!1),children:[a.jsx("button",{className:"nav-edge-tab-button",type:"button",onClick:()=>T?.("expanded"),"aria-pressed":!1,"aria-label":"Set sidebar wide",title:"Set sidebar wide",children:r?.panelLeft??r?.chevronRight??null}),a.jsx("button",{className:"nav-edge-tab-button",type:"button",onClick:()=>T?.("collapsed"),"aria-pressed":!1,"aria-label":"Set sidebar narrow",title:"Set sidebar narrow",children:r?.menu??null}),a.jsx("button",{className:`nav-edge-tab-button${o==="hidden"?" active":""}`,type:"button",onClick:()=>T?.("hidden"),"aria-pressed":o==="hidden","aria-label":"Hide sidebar",title:"Hide sidebar",children:r?.chevronLeft??null}),a.jsx("button",{className:`nav-edge-tab-button${u?" active":""}`,type:"button",onClick:()=>E?.(),"aria-pressed":u,"aria-label":u?"Disable sidebar hover popover":"Enable sidebar hover popover",title:u?"Disable sidebar hover popover":"Enable sidebar hover popover",children:r?.popover??r?.panelRight??null})]}):null]}),vt?de?Yr.createPortal(vt,de):vt:null,Et?de?Yr.createPortal(Et,de):Et:null]})}function RS({icons:e,windowActions:n=[],windowPulseActive:r=!1,onWindowPulse:i,statusMessages:o=[],numberFormatter:d,debugOpen:u=!1,onToggleDebug:v,debugStats:h,backendState:m="offline",backendStatusLabel:g="Offline",showLayoutControls:b=!1,layoutControlsOpen:j=!1,onToggleLayoutControls:C,onSetNavMode:k,onToggleNavPopover:x,navMode:S="expanded",navPopoverEnabled:T=!1,navModeOptions:I=["expanded","collapsed","hidden"],trailingContent:E,className:L,...P}){const R=Array.isArray(o)?o:[],z=Number.isFinite(h?.total??NaN)?Number(h?.total??0):0,ne=y.useRef(null),ye=y.useRef(!1),J=y.useRef(0),re=y.useRef(null),oe=Q=>typeof d?.format=="function"?d.format(Q):String(Q),fe=()=>{re.current&&(window.clearTimeout(re.current),re.current=null)},de=()=>{fe(),J.current=Date.now(),j||C?.(!0)},G=()=>{if(ye.current)return;fe();const Q=Date.now()-J.current,W=Math.max(0,2e3-Q);re.current=window.setTimeout(()=>{re.current=null,!ye.current&&C?.(!1)},W)};return y.useEffect(()=>{if(!j)return;const Q=W=>{W.target instanceof Node&&(ne.current?.contains(W.target)||(ye.current=!1,C?.(!1)))};return document.addEventListener("pointerdown",Q),()=>document.removeEventListener("pointerdown",Q)},[j,C]),y.useEffect(()=>()=>{fe()},[]),a.jsxs("footer",{...P,className:Va("statusbar",L),children:[a.jsxs("div",{className:"status-left",children:[b?a.jsxs("div",{className:"status-layout-controls",ref:ne,"data-open":j?"true":"false",onMouseEnter:de,onMouseLeave:G,onFocusCapture:de,onBlurCapture:Q=>{Q.currentTarget.contains(Q.relatedTarget)||G()},children:[a.jsx("button",{className:`status-layout-button${j?" active":""}`,type:"button",onClick:()=>{if(fe(),ye.current){ye.current=!1,C?.(!1);return}ye.current=!0,J.current=Date.now(),C?.(!0)},"aria-expanded":j,"aria-controls":"status-layout-panel","aria-label":"Toggle sidebar layout controls",title:"Sidebar layout controls",children:e.panelLeft??e.grid??null}),a.jsxs("div",{className:"status-layout-panel",id:"status-layout-panel",role:"toolbar","aria-label":"Sidebar layout controls","aria-hidden":j?"false":"true",children:[I.includes("expanded")?a.jsx("button",{className:`nav-edge-tab-button${S==="expanded"?" active":""}`,type:"button",onClick:()=>k?.("expanded"),"aria-pressed":S==="expanded","aria-label":"Set sidebar wide",title:"Set sidebar wide",children:e.panelLeft??null}):null,I.includes("collapsed")?a.jsx("button",{className:`nav-edge-tab-button${S==="collapsed"?" active":""}`,type:"button",onClick:()=>k?.("collapsed"),"aria-pressed":S==="collapsed","aria-label":"Set sidebar narrow",title:"Set sidebar narrow",children:e.menu??null}):null,I.includes("hidden")?a.jsx("button",{className:`nav-edge-tab-button${S==="hidden"?" active":""}`,type:"button",onClick:()=>k?.("hidden"),"aria-pressed":S==="hidden","aria-label":"Hide sidebar",title:"Hide sidebar",children:e.chevronLeft??null}):null,a.jsx("button",{className:`nav-edge-tab-button${T?" active":""}`,type:"button",onClick:()=>x?.(),"aria-pressed":T,"aria-label":T?"Disable sidebar hover popover":"Enable sidebar hover popover",title:T?"Disable sidebar hover popover":"Enable sidebar hover popover",children:e.popover??e.panelRight??null})]})]}):null,a.jsx("div",{className:`status-window-controls${r?" pulse":""}`,onMouseEnter:i,onFocusCapture:i,children:n.map(Q=>a.jsx("button",{className:`window-button ${Q.id}`,type:"button","aria-label":Q.label,onClick:i},Q.id))}),a.jsx("span",{className:"status-sep"}),R.length===0?a.jsxs("span",{className:"status-message status-message-idle",children:[a.jsx("span",{className:"status-message-label",children:"SYS"}),a.jsx("span",{className:"status-message-text",children:"Ready"})]}):R.map((Q,W)=>a.jsxs("span",{className:"status-message-wrap",children:[W>0?a.jsx("span",{className:"status-sep"}):null,a.jsxs("span",{className:`status-message ${Q?.tone?`status-message-${Q.tone}`:""}`,children:[a.jsx("span",{className:"status-message-label",children:Q.label??"SYS"}),a.jsx("span",{className:"status-message-text",children:Q.text??"-"})]})]},Q.id??`status-${W}`))]}),a.jsxs("div",{className:"status-right",children:[a.jsxs("button",{className:`status-log-button ${u?"active":""}`,type:"button",onClick:v,title:"Open logs",children:[a.jsx("span",{className:"status-log-button-icon",children:e.activity??null}),a.jsxs("span",{className:"status-log-count",children:["Logs ",oe(z)]})]}),a.jsxs("span",{className:`status-chip ${m}`,children:["API ",g]}),a.jsx("span",{className:"pill ghost",children:"v0.1 alpha"}),a.jsx("span",{className:"status-icon",children:e.cloud??null}),a.jsx("span",{className:"status-icon",children:e.battery??null}),E]})]})}const Yt=(...e)=>e.filter(Boolean).join(" ");function cn({className:e="",layoutClassName:n="",mainClassName:r="",toolbar:i=null,detail:o=null,detailPinned:d=!1,detailExpanded:u=!1,children:v=null}){return a.jsxs("div",{className:Yt("workbench-section-shell",e),children:[i,a.jsxs("div",{className:Yt("workbench-active-layout",n,d&&"workbench-active-layout-detail-pinned",d&&u&&"workbench-active-layout-detail-pinned-expanded"),children:[a.jsx("div",{className:Yt("workbench-active-main",r),children:v}),o]})]})}function LS({className:e="",headerClassName:n="",bodyClassName:r="",headMainClassName:i="",copyClassName:o="",eyebrowClassName:d="",titleClassName:u="",noteClassName:v="",actionsClassName:h="",mainClassName:m="",asideClassName:g="",eyebrow:b="",title:j="",note:C=null,tabs:k=null,actions:x=null,aside:S=null,children:T=null}){const I=b||j||C||k||x;return a.jsxs("section",{className:Yt("workbench-subview-shell",e),children:[I?a.jsxs("header",{className:Yt("workbench-subview-head",n),children:[a.jsxs("div",{className:Yt("workbench-subview-head-main",i),children:[a.jsxs("div",{className:Yt("workbench-subview-copy",o),children:[b?a.jsx("p",{className:Yt("workbench-subview-eyebrow",d),children:b}):null,j?a.jsx("h3",{className:Yt("workbench-subview-title",u),children:j}):null,C?a.jsx("p",{className:Yt("workbench-subview-note",v),children:C}):null]}),x?a.jsx("div",{className:Yt("workbench-subview-actions",h),children:x}):null]}),k]}):null,a.jsxs("div",{className:Yt("workbench-subview-body",r),children:[a.jsx("div",{className:Yt("workbench-subview-main",m),children:T}),S?a.jsx("aside",{className:Yt("workbench-subview-aside",g),children:S}):null]})]})}function it({className:e="",variant:n="empty",titleClassName:r="",messageClassName:i="",actionsClassName:o="",title:d="",message:u="",actions:v=null,children:h=null}){return a.jsxs("section",{className:Yt("workbench-state-panel",n?`is-${n}`:"",e),children:[d?a.jsx("h4",{className:Yt("workbench-state-panel-title",r),children:d}):null,u?a.jsx("p",{className:Yt("workbench-state-panel-message",i),children:u}):null,h,v?a.jsx("div",{className:Yt("workbench-state-panel-actions",o),children:v}):null]})}const lc={background:"#F4ECDE",surface:"#FBF6EE",foreground:"#2A211C"},oc={background:"#1A1612",surface:"#221C16",foreground:"#F0E4D2"},qs=[{id:"coral",label:"Coral",accent:"#D97757",accentSecondary:"#E89A4A",accentTertiary:"#5B8B6F"},{id:"amber",label:"Amber",accent:"#E89A4A",accentSecondary:"#D97757",accentTertiary:"#4A6B91"},{id:"mint",label:"Mint",accent:"#5B8B6F",accentSecondary:"#E89A4A",accentTertiary:"#4A6B91"}],Ga=[{id:"main",name:"Main",description:"Current AOPS shell palette.",light:lc,dark:oc,variants:qs,readonly:!0}];function Ws(e,n,r){return Math.min(r,Math.max(n,e))}function vc(e,n){return typeof e=="string"&&e.trim().length>0?e.trim():n}function ya(e,n){if(typeof e!="string")return n;const i=e.trim().match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i);if(!i)return n;const o=i[1].toLowerCase();return o.length===3?`#${o.split("").map(d=>`${d}${d}`).join("")}`:`#${o}`}function gc(e){const n=ya(e,"#000000").replace("#","");return{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}}function pp(e){return Ws(Math.round(e),0,255).toString(16).padStart(2,"0")}function qp(e){return`#${pp(e.r)}${pp(e.g)}${pp(e.b)}`}function Ge(e,n){const{r,g:i,b:o}=gc(e);return`rgba(${r}, ${i}, ${o}, ${Ws(n,0,1).toFixed(2)})`}function en(e,n,r){const i=gc(e),o=gc(n),d=Ws(r,0,1);return qp({r:i.r+(o.r-i.r)*d,g:i.g+(o.g-i.g)*d,b:i.b+(o.b-i.b)*d})}function OS({r:e,g:n,b:r}){const i=e/255,o=n/255,d=r/255,u=Math.max(i,o,d),v=Math.min(i,o,d);let h=0,m=0;const g=(u+v)/2,b=u-v;if(b!==0){switch(m=g>.5?b/(2-u-v):b/(u+v),u){case i:h=(o-d)/b+(o<d?6:0);break;case o:h=(d-i)/b+2;break;default:h=(i-o)/b+4;break}h/=6}return{h:h*360,s:m,l:g}}function hp(e,n,r){let i=r;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(n-e)*6*i:i<1/2?n:i<2/3?e+(n-e)*(2/3-i)*6:e}function _S(e,n,r){const o=(e%360+360)%360/360,d=Ws(n,0,1),u=Ws(r,0,1);if(d===0){const m=Math.round(u*255);return qp({r:m,g:m,b:m})}const v=u<.5?u*(1+d):u+d-u*d,h=2*u-v;return qp({r:hp(h,v,o+1/3)*255,g:hp(h,v,o)*255,b:hp(h,v,o-1/3)*255})}function jl(e,{hue:n=0,lightness:r=0,saturation:i=0}={}){const o=OS(gc(e));return _S(o.h+n,Ws(o.s+i,0,1),Ws(o.l+r,0,1))}function Cy(e){return e==="light"?"light":"dark"}function ky(e,n){return{background:ya(e?.background,n.background),surface:ya(e?.surface,n.surface),foreground:ya(e?.foreground,n.foreground)}}function QS(e,n){const r=ya(e?.accent,n.accent);return{id:vc(e?.id,n.id),label:vc(e?.label,n.label),accent:r,accentSecondary:ya(e?.accentSecondary,n.accentSecondary??jl(r,{hue:-36,lightness:.04})),accentTertiary:ya(e?.accentTertiary,n.accentTertiary??jl(r,{hue:42,lightness:.06}))}}function ri(e){return{id:e.id,name:e.name,description:e.description,light:{...e.light},dark:{...e.dark},variants:e.variants.map(n=>({...n})),readonly:e.readonly}}function Bc(e,n=Ga[0]){const r=ri(n),i=Array.isArray(e?.variants)&&e?.variants.length>0?e.variants:r.variants,o=r.variants[0]??qs[0];return{id:vc(e?.id,r.id),name:vc(e?.name,r.name),description:typeof e?.description=="string"&&e.description.trim().length>0?e.description.trim():r.description,light:ky(e?.light,r.light),dark:ky(e?.dark,r.dark),variants:i.slice(0,3).map((d,u)=>QS(d,r.variants[u]??o)),readonly:typeof e?.readonly=="boolean"?e.readonly:r.readonly}}function US(e){return!Array.isArray(e)||e.length===0?Ga.map(n=>ri(n)):e.map((n,r)=>Bc(n,Ga[r]??Ga[0]))}function PS(e,n,r){const i=Bc(e),o=n==="light"?i.light:i.dark,d=i.variants.find(S=>S.id===r)??i.variants[0]??qs[0],u=ya(o.background,n==="light"?lc.background:oc.background),v=ya(o.surface,n==="light"?lc.surface:oc.surface),h=ya(o.foreground,n==="light"?lc.foreground:oc.foreground),m=v,g=en(v,h,n==="light"?.08:.12),b=en(v,h,n==="light"?.15:.22),j=ya(d.accent,qs[0].accent),C=ya(d.accentSecondary,qs[0].accentSecondary??jl(j,{hue:-36,lightness:.04})),k=ya(d.accentTertiary,qs[0].accentTertiary??jl(j,{hue:42,lightness:.06}));return{"--bg-0":u,"--bg-1":m,"--bg-2":g,"--bg-3":b,"--fg":h,"--fg-soft":en(h,u,n==="light"?.18:.22),"--muted":en(h,u,n==="light"?.36:.44),"--overlay-04":Ge(h,n==="light"?.06:.04),"--overlay-05":Ge(h,n==="light"?.08:.05),"--overlay-06":Ge(h,n==="light"?.1:.06),"--overlay-08":Ge(h,n==="light"?.14:.08),"--overlay-16":Ge(h,n==="light"?.22:.16),"--border":i.id==="main"?n==="light"?"#E4D7BF":"#3A2F22":Ge(h,n==="light"?.22:.08),"--border-strong":i.id==="main"?n==="light"?"#D2C2A4":"#4D3E2D":Ge(h,n==="light"?.32:.16),"--surface-26-95":Ge(u,.95),"--surface-26-94":Ge(u,.94),"--surface-26-90":Ge(u,.9),"--surface-26-85":Ge(u,.85),"--surface-26-80":Ge(u,.8),"--surface-26-78":Ge(u,.78),"--surface-26-75":Ge(u,.75),"--surface-26-72":Ge(u,.72),"--surface-26-70":Ge(u,.7),"--surface-26-65":Ge(u,.65),"--surface-26-60":Ge(u,.6),"--surface-26-50":Ge(u,.5),"--surface-34-98":Ge(m,.98),"--surface-34-96":Ge(m,.96),"--surface-34-90":Ge(m,.9),"--surface-34-88":Ge(m,.88),"--surface-34-80":Ge(m,.8),"--surface-34-70":Ge(m,.7),"--surface-34-60":Ge(m,.6),"--surface-34-50":Ge(m,.5),"--surface-45-85":Ge(g,.85),"--surface-45-80":Ge(g,.8),"--surface-45-60":Ge(g,.6),"--surface-45-50":Ge(g,.5),"--surface-56-80":Ge(b,.8),"--shadow":`0 24px 48px ${Ge(n==="light"?h:"#000000",n==="light"?.12:.35)}`,...FS({theme:i,variant:d,mode:n,accent:j,accentSecondary:C,accentTertiary:k}),"--prompt-grid-row-odd":Ge(u,.75),"--prompt-grid-row-even":Ge(m,.9),"--prompt-grid-row-hover":Ge(g,n==="light"?.85:.8),"--prompt-grid-row-active":n==="light"?"#ffffff":Ge(m,.96),"--prompt-grid-summary-odd":Ge(u,.72),"--prompt-grid-summary-even":Ge(m,.88),...KS({theme:i,mode:n,background:u,surface:v,foreground:h,bg2:g})}}function FS(e){const{theme:n,variant:r,mode:i,accent:o,accentSecondary:d,accentTertiary:u}=e,g=(n.id==="main"?{coral:{light:{accent:"#D97757",strong:"#C26041",soft:"#F5D9C9",tint:"#FBE8DC"},dark:{accent:"#E89274",strong:"#D97757",soft:"#4A2A1E",tint:"#38201A"}},amber:{light:{accent:"#E89A4A",strong:"#C8881C",soft:"#F8DEB8",tint:"#FCEED5"},dark:{accent:"#E8A85C",strong:"#C8881C",soft:"#3F2C18",tint:"#2D1F11"}},mint:{light:{accent:"#5B8B6F",strong:"#34624A",soft:"#C8DCCD",tint:"#E1ECDF"},dark:{accent:"#84B097",strong:"#5B8B6F",soft:"#2A3A30",tint:"#1F2C24"}}}[r.id]?.[i]:void 0)??{accent:o,strong:jl(o,{lightness:-.12,saturation:.04}),soft:Ge(o,i==="light"?.2:.18),tint:Ge(o,i==="light"?.12:.08)};return{"--accent":g.accent,"--accent-strong":g.strong,"--accent-soft":g.soft,"--accent-tint":g.tint,"--accent-secondary":d,"--accent-secondary-soft":Ge(d,i==="light"?.18:.16),"--accent-tertiary":u,"--accent-tertiary-soft":Ge(u,i==="light"?.16:.14)}}function KS(e){const{theme:n,mode:r,background:i,surface:o,foreground:d,bg2:u}=e,v=n.id==="main",g=r==="light"?{bgDim:"#EDE3D2",surface2:"#F8F1E4",surfaceElev:"#FFFCF6",rail:"#F1E6D2",railActive:"#E9DCC2",text2:"#4A3F36",textMuted:"#8B7E72",textFaint:"#B5A795",borderWarm:"#E4D7BF",borderWarmStrong:"#D2C2A4",borderWarmFaint:"#EFE5D0",rule:"#E8DCC4",coral:"#D97757",coral2:"#C26041",coralSoft:"#F5D9C9",coralTint:"#FBE8DC"}:{bgDim:"#14110D",surface2:"#2A2219",surfaceElev:"#2F261C",rail:"#1F1913",railActive:"#2C2317",text2:"#D6C7B0",textMuted:"#94806A",textFaint:"#6B5C4A",borderWarm:"#3A2F22",borderWarmStrong:"#4D3E2D",borderWarmFaint:"#2D241B",rule:"#2A2118",coral:"#E89274",coral2:"#D97757",coralSoft:"#4A2A1E",coralTint:"#38201A"},b=(j,C)=>en(j,r==="light"?"#FFFFFF":"#0E0A06",C);return{"--bg":i,"--bg-dim":v?g.bgDim:en(i,d,.04),"--surface":o,"--surface-2":v?g.surface2:u,"--surface-elev":v?g.surfaceElev:b(o,r==="light"?.4:.06),"--rail":v?g.rail:en(i,d,r==="light"?.05:.04),"--rail-active":v?g.railActive:en(i,d,.1),"--overlay":Ge(d,r==="light"?.4:.55),"--text":d,"--text-2":v?g.text2:en(d,i,r==="light"?.18:.22),"--text-muted":v?g.textMuted:en(d,i,r==="light"?.42:.46),"--text-faint":v?g.textFaint:en(d,i,r==="light"?.62:.6),"--border-warm":v?g.borderWarm:Ge(d,r==="light"?.18:.14),"--border-warm-strong":v?g.borderWarmStrong:Ge(d,r==="light"?.28:.22),"--border-warm-faint":v?g.borderWarmFaint:Ge(d,r==="light"?.1:.08),"--rule":v?g.rule:Ge(d,r==="light"?.14:.1),"--coral":g.coral,"--coral-2":g.coral2,"--coral-soft":g.coralSoft,"--coral-tint":g.coralTint}}function zS(e,n,r,i="dark"){const o=US(e),d=o.find(v=>v.id===n)??o[0]??Ga[0],u=d.variants.find(v=>v.id===r)??d.variants[0]??qs[0];return{mode:Cy(i),themeId:d.id,variantId:u.id,theme:d,variant:u,style:PS(d,Cy(i),u.id)}}const $S="light",Wb=Ga[0]?.id??"main",Zb=Ga[0]?.variants?.[0]?.id??"coral",ej=3,HS=new Set(Ga.map(e=>e.id)),Ml=e=>typeof e=="string"?e.trim():"",Al=(e,n)=>Ml(e)||n;function GS(e,n="theme"){return Ml(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||n}function yc(e,n,r="theme"){const i=GS(e,r);let o=i,d=2;for(;n.has(o);)o=`${i}-${d}`,d+=1;return n.add(o),o}function tj(e,n,r){return Bc({...ri(r),variants:[{id:Ml(e?.id)||`tone-${n+1}`,label:Al(e?.label,`Variant ${n+1}`),accent:ya(e?.accent,r.variants[0]?.accent??"#D97757"),accentSecondary:e?.accentSecondary,accentTertiary:e?.accentTertiary}]},r).variants[0]}function qS(e){return e==="light"?"light":e==="dark"?"dark":$S}function VS(e,n=Wb){return Ml(e)||n}function YS(e,n=Zb){return Ml(e)||n}function aj(e){if(!Array.isArray(e)||e.length===0)return[];const n=new Set(HS);return e.map((r,i)=>{const o=Ga[0],d=Bc(typeof r=="object"&&r?r:void 0,o),u={...d,id:yc(d.id||d.name||`theme-${i+1}`,n,`theme-${i+1}`),name:Al(d.name,`Theme ${i+1}`),readonly:!1},v=new Set;return u.variants=u.variants.slice(0,ej).map((h,m)=>{const g=tj(h,m,o);return{...g,id:yc(g.id||g.label||`tone-${m+1}`,v,`tone-${m+1}`),label:Al(g.label,`Variant ${m+1}`)}}),u})}function nj(e=[]){return[...Ga.map(n=>ri(n)),...aj(e)]}function JS(e={}){const n=aj(e.customThemes),r=nj(n),i=zS(r,VS(e.themeId,Wb),YS(e.accent,Zb),qS(e.theme));return{snapshot:{theme:i.mode,themeId:i.themeId,accent:i.variantId,customThemes:n},themeCatalog:r,activeTheme:i.theme,activeVariant:i.variant,themeOptions:r.map(o=>({id:o.id,label:o.name,description:o.readonly?o.description||"Built-in theme.":"Custom theme.",variations:o.variants.map(d=>({id:d.id,label:d.label,swatch:d.accent}))})),accentOptions:i.theme.variants.map(o=>({id:o.id,label:o.label,swatch:o.accent})),style:i.style}}function sj({label:e="Variant",accent:n="#7ed6a5",accentSecondary:r,accentTertiary:i,seed:o="variant",existingIds:d=new Set}={}){const u={...ri(Ga[0]),variants:[{id:o,label:e,accent:n,accentSecondary:r,accentTertiary:i}]},v=tj({id:o,label:e,accent:n,accentSecondary:r,accentTertiary:i},0,u);return{...v,id:yc(v.id||o,d,"variant"),label:Al(e,v.label)}}function XS(e,n=[],r=""){const i=nj(n),o=new Set(i.map(v=>v.id)),d=ri(e??Ga[0]);d.readonly=!1,d.name=Al(r,`${d.name} Copy`),d.id=yc(d.name,o,"theme");const u=new Set;return d.variants=d.variants.slice(0,ej).map((v,h)=>sj({label:v.label||`Variant ${h+1}`,accent:v.accent,accentSecondary:v.accentSecondary,accentTertiary:v.accentTertiary,seed:v.id||`tone-${h+1}`,existingIds:u})),d}function Ue({children:e}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e})}const wh={terminal:a.jsxs(Ue,{children:[a.jsx("path",{d:"M4 7l5 5-5 5"}),a.jsx("path",{d:"M11 17h9"})]}),stack:a.jsxs(Ue,{children:[a.jsx("path",{d:"M12 4 3 8l9 4 9-4-9-4z"}),a.jsx("path",{d:"M3 12l9 4 9-4"}),a.jsx("path",{d:"M3 16l9 4 9-4"})]}),doc:a.jsxs(Ue,{children:[a.jsx("path",{d:"M6 2h8l4 4v16H6z"}),a.jsx("path",{d:"M14 2v6h6"})]}),layers:a.jsxs(Ue,{children:[a.jsx("path",{d:"M12 4 3 8l9 4 9-4-9-4z"}),a.jsx("path",{d:"M3 12l9 4 9-4"}),a.jsx("path",{d:"M3 16l9 4 9-4"})]}),board:a.jsxs(Ue,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),a.jsx("path",{d:"M9 4v16M15 4v16"}),a.jsx("path",{d:"M3 10h18"})]}),spark:a.jsx(Ue,{children:a.jsx("path",{d:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3z"})}),bot:a.jsxs(Ue,{children:[a.jsx("rect",{x:"5",y:"7",width:"14",height:"10",rx:"2"}),a.jsx("path",{d:"M9 11h.01M15 11h.01"}),a.jsx("path",{d:"M8 17v2M16 17v2"}),a.jsx("path",{d:"M12 5v2"})]}),chat:a.jsx(Ue,{children:a.jsx("path",{d:"M21 12a8.5 8.5 0 0 1-8.5 8.5H4l1.7-3.4A8.5 8.5 0 1 1 21 12z"})}),wand:a.jsxs(Ue,{children:[a.jsx("path",{d:"M6 18l6-6"}),a.jsx("path",{d:"M14 4l1 3 3 1-3 1-1 3-1-3-3-1 3-1 1-3z"})]}),play:a.jsx(Ue,{children:a.jsx("path",{d:"M8 6l10 6-10 6V6z"})}),plug:a.jsxs(Ue,{children:[a.jsx("path",{d:"M9 7v4M15 7v4M7 11h10v3a4 4 0 0 1-4 4h-2a4 4 0 0 1-4-4v-3z"}),a.jsx("path",{d:"M10 3v4M14 3v4"})]}),gear:a.jsxs(Ue,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"3"}),a.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33 1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82 1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),grid:a.jsx(Ue,{children:a.jsx("path",{d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})}),menu:a.jsx(Ue,{children:a.jsx("path",{d:"M4 7h16M4 12h16M4 17h16"})}),chevronLeft:a.jsx(Ue,{children:a.jsx("path",{d:"m15 18-6-6 6-6"})}),chevronRight:a.jsx(Ue,{children:a.jsx("path",{d:"m9 6 6 6-6 6"})}),down:a.jsx(Ue,{children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),panelLeft:a.jsxs(Ue,{children:[a.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),a.jsx("path",{d:"M9 3v18"})]}),panelBottom:a.jsxs(Ue,{children:[a.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),a.jsx("path",{d:"M3 15h18"})]}),panelRight:a.jsxs(Ue,{children:[a.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),a.jsx("path",{d:"M15 3v18"})]}),page:a.jsxs(Ue,{children:[a.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),a.jsx("path",{d:"M3 7h18"})]}),external:a.jsxs(Ue,{children:[a.jsx("path",{d:"M14 5h5v5"}),a.jsx("path",{d:"M19 5 10 14"}),a.jsx("path",{d:"M9 5H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"})]}),eye:a.jsxs(Ue,{children:[a.jsx("path",{d:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7z"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),eyeOff:a.jsxs(Ue,{children:[a.jsx("path",{d:"M3 3l18 18"}),a.jsx("path",{d:"M10.6 10.6a2 2 0 0 0 2.8 2.8"}),a.jsx("path",{d:"M9.9 4.2A10.9 10.9 0 0 1 12 4c6 0 10 8 10 8a16.8 16.8 0 0 1-4.2 5.2"}),a.jsx("path",{d:"M6.6 6.6A16.5 16.5 0 0 0 2 12s4 8 10 8a10.9 10.9 0 0 0 4.2-.8"})]}),popover:a.jsxs(Ue,{children:[a.jsx("path",{d:"M5 5h10a2 2 0 0 1 2 2v10"}),a.jsx("path",{d:"M9 19H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2"}),a.jsx("path",{d:"M14 12h7"}),a.jsx("path",{d:"m18 9 3 3-3 3"})]}),flask:a.jsxs(Ue,{children:[a.jsx("path",{d:"M9 3h6M10 9V3M14 9V3"}),a.jsx("path",{d:"M5 21h14"}),a.jsx("path",{d:"M5.5 21a8.5 8.5 0 0 1 3.13-11.24L10 9h4l1.37.76A8.5 8.5 0 0 1 18.5 21"})]}),bolt:a.jsx(Ue,{children:a.jsx("path",{d:"M13 2L4 14h6l-1 8 9-12h-6l1-8z"})}),cloud:a.jsx(Ue,{children:a.jsx("path",{d:"M7 17a4 4 0 0 0 0-8 5 5 0 0 1 9.6 1.5A3.5 3.5 0 0 1 17 17H7z"})}),battery:a.jsxs(Ue,{children:[a.jsx("rect",{x:"3",y:"7",width:"16",height:"10",rx:"2"}),a.jsx("path",{d:"M21 10v4"}),a.jsx("path",{d:"M6 10h10"})]}),pin:a.jsxs(Ue,{children:[a.jsx("path",{d:"M15 3v5l3 3H6l3-3V3h6z"}),a.jsx("path",{d:"M12 11v10"})]}),sun:a.jsxs(Ue,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"4"}),a.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),moon:a.jsx(Ue,{children:a.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),activity:a.jsx(Ue,{children:a.jsx("path",{d:"M3 12h4l2-5 4 10 2-5h6"})}),user:a.jsxs(Ue,{children:[a.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),a.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),refresh:a.jsxs(Ue,{children:[a.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),a.jsx("path",{d:"M21 3v5h-5"}),a.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),a.jsx("path",{d:"M3 21v-5h5"})]}),expand:a.jsxs(Ue,{children:[a.jsx("path",{d:"M9 4H4v5"}),a.jsx("path",{d:"M15 4h5v5"}),a.jsx("path",{d:"M20 15v5h-5"}),a.jsx("path",{d:"M4 15v5h5"})]}),shrink:a.jsxs(Ue,{children:[a.jsx("path",{d:"M8 4v4H4"}),a.jsx("path",{d:"M16 4v4h4"}),a.jsx("path",{d:"M20 16h-4v4"}),a.jsx("path",{d:"M4 16h4v4"})]}),copy:a.jsxs(Ue,{children:[a.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),a.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),check:a.jsx(Ue,{children:a.jsx("path",{d:"M20 6 9 17l-5-5"})}),close:a.jsxs(Ue,{children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),moreVertical:a.jsxs(Ue,{children:[a.jsx("circle",{cx:"12",cy:"5",r:"1.5"}),a.jsx("circle",{cx:"12",cy:"12",r:"1.5"}),a.jsx("circle",{cx:"12",cy:"19",r:"1.5"})]}),cart:a.jsxs(Ue,{children:[a.jsx("circle",{cx:"9",cy:"19",r:"1.6"}),a.jsx("circle",{cx:"18",cy:"19",r:"1.6"}),a.jsx("path",{d:"M3 4h2l2.2 10.2a1 1 0 0 0 1 .8h9.8a1 1 0 0 0 1-.8L21 7H7"})]}),chart:a.jsxs(Ue,{children:[a.jsx("path",{d:"M4 19V5"}),a.jsx("path",{d:"M4 19h16"}),a.jsx("path",{d:"m7 14 3-3 3 2 4-5"}),a.jsx("path",{d:"m17 8 1.5 0"})]}),clipboard:a.jsxs(Ue,{children:[a.jsx("rect",{x:"6",y:"4",width:"12",height:"16",rx:"2"}),a.jsx("path",{d:"M9 4.5h6"}),a.jsx("path",{d:"M9 10h6"}),a.jsx("path",{d:"M9 14h4"})]}),coins:a.jsxs(Ue,{children:[a.jsx("ellipse",{cx:"12",cy:"6",rx:"6.5",ry:"2.8"}),a.jsx("path",{d:"M5.5 6v6c0 1.5 2.9 2.8 6.5 2.8s6.5-1.3 6.5-2.8V6"}),a.jsx("path",{d:"M5.5 12v6c0 1.5 2.9 2.8 6.5 2.8s6.5-1.3 6.5-2.8v-6"})]}),dashboard:a.jsxs(Ue,{children:[a.jsx("rect",{x:"3",y:"4",width:"8",height:"7",rx:"1.5"}),a.jsx("rect",{x:"13",y:"4",width:"8",height:"12",rx:"1.5"}),a.jsx("rect",{x:"3",y:"13",width:"8",height:"7",rx:"1.5"}),a.jsx("path",{d:"M13 19h8"})]}),flow:a.jsxs(Ue,{children:[a.jsx("circle",{cx:"6",cy:"6",r:"2"}),a.jsx("circle",{cx:"18",cy:"6",r:"2"}),a.jsx("circle",{cx:"12",cy:"18",r:"2"}),a.jsx("path",{d:"M8 6h8"}),a.jsx("path",{d:"M7.7 7.2 10.8 15"}),a.jsx("path",{d:"M16.3 7.2 13.2 15"})]}),factory:a.jsxs(Ue,{children:[a.jsx("path",{d:"M3 21V10l6 3V9l5 3V6l7 4v11Z"}),a.jsx("path",{d:"M7 21v-4"}),a.jsx("path",{d:"M11 21v-3"}),a.jsx("path",{d:"M15 21v-4"}),a.jsx("path",{d:"M19 21v-6"})]}),boxes:a.jsxs(Ue,{children:[a.jsx("path",{d:"m12 3 8 4.5v9L12 21l-8-4.5v-9L12 3Z"}),a.jsx("path",{d:"M12 12 4 7.5"}),a.jsx("path",{d:"M12 12l8-4.5"}),a.jsx("path",{d:"M12 12v9"})]}),palette:a.jsxs(Ue,{children:[a.jsx("path",{d:"M12 3c-5.5 0-9 3.8-9 8.3 0 4.2 3 7.7 7.1 7.7H12a2.7 2.7 0 0 0 2.7-2.7c0-1-.6-1.8-1.1-2.4-.4-.5-.7-.8-.7-1.3 0-1 1-1.6 2.2-1.6H17c2.2 0 4-1.8 4-4.1C21 5.6 17.3 3 12 3Z"}),a.jsx("circle",{cx:"7.5",cy:"10",r:"1"}),a.jsx("circle",{cx:"11",cy:"7.2",r:"1"}),a.jsx("circle",{cx:"15.2",cy:"7.8",r:"1"}),a.jsx("circle",{cx:"16.8",cy:"12",r:"1"})]}),package:a.jsxs(Ue,{children:[a.jsx("path",{d:"m16.5 9.4-9-5.19"}),a.jsx("path",{d:"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"}),a.jsx("path",{d:"M3.27 6.96 12 12.01l8.73-5.05"}),a.jsx("path",{d:"M12 22.08V12"})]}),partners:a.jsxs(Ue,{children:[a.jsx("path",{d:"M16.5 20v-1.2a3.3 3.3 0 0 0-3.3-3.3h-2.4a3.3 3.3 0 0 0-3.3 3.3V20"}),a.jsx("circle",{cx:"12",cy:"9",r:"3"}),a.jsx("path",{d:"M21 20v-1a2.7 2.7 0 0 0-2.2-2.6"}),a.jsx("path",{d:"M3 20v-1A2.7 2.7 0 0 1 5.2 16.4"}),a.jsx("path",{d:"M16.8 6.4a2.6 2.6 0 0 1 0 5.1"}),a.jsx("path",{d:"M7.2 6.4a2.6 2.6 0 0 0 0 5.1"})]}),ruler:a.jsxs(Ue,{children:[a.jsx("path",{d:"m4 16 8-8 8 8"}),a.jsx("path",{d:"M6 18h12"}),a.jsx("path",{d:"M8 14v2"}),a.jsx("path",{d:"M12 10v6"}),a.jsx("path",{d:"M16 14v2"})]}),sliders:a.jsxs(Ue,{children:[a.jsx("path",{d:"M4 6h16"}),a.jsx("path",{d:"M4 12h16"}),a.jsx("path",{d:"M4 18h16"}),a.jsx("circle",{cx:"9",cy:"6",r:"1.8"}),a.jsx("circle",{cx:"15",cy:"12",r:"1.8"}),a.jsx("circle",{cx:"11",cy:"18",r:"1.8"})]}),warehouse:a.jsxs(Ue,{children:[a.jsx("path",{d:"M3 10 12 4l9 6v10H3V10Z"}),a.jsx("path",{d:"M8 20v-6h8v6"}),a.jsx("path",{d:"M8 10h8"})]}),tree:a.jsxs(Ue,{children:[a.jsx("path",{d:"M12 6v12"}),a.jsx("path",{d:"M6 6h12"}),a.jsx("path",{d:"M6 18h12"}),a.jsx("circle",{cx:"6",cy:"6",r:"2"}),a.jsx("circle",{cx:"18",cy:"6",r:"2"}),a.jsx("circle",{cx:"12",cy:"18",r:"2"})]})},Sy=e=>{let n;const r=new Set,i=(m,g)=>{const b=typeof m=="function"?m(n):m;if(!Object.is(b,n)){const j=n;n=g??(typeof b!="object"||b===null)?b:Object.assign({},n,b),r.forEach(C=>C(n,j))}},o=()=>n,v={setState:i,getState:o,getInitialState:()=>h,subscribe:m=>(r.add(m),()=>r.delete(m))},h=n=e(i,o,v);return v},WS=(e=>e?Sy(e):Sy),ZS=e=>e;function ew(e,n=ZS){const r=qo.useSyncExternalStore(e.subscribe,qo.useCallback(()=>n(e.getState()),[e,n]),qo.useCallback(()=>n(e.getInitialState()),[e,n]));return qo.useDebugValue(r),r}const wy=e=>{const n=WS(e),r=i=>ew(n,i);return Object.assign(r,n),r},rj=(e=>e?wy(e):wy);let Ny=0;function tw(e){return!e||typeof e!="object"?null:(Ny+=1,{id:e.id??`api-log-${Ny}`,ts:typeof e.ts=="number"?e.ts:Date.now(),kind:e.kind??"api",level:e.level??"info",message:e.message??"",data:e.data&&typeof e.data=="object"?e.data:{}})}function Iy(e,n){const r=tw(n);return r?[...e,r].slice(-200):e}const il=rj(e=>({requestCount:0,logs:[],debugOpen:!1,beginRequest:()=>e(n=>({requestCount:n.requestCount+1})),endRequest:n=>e(r=>({requestCount:Math.max(0,r.requestCount-1),logs:Iy(r.logs,n)})),addLog:n=>e(r=>({logs:Iy(r.logs,n)})),clearLogs:()=>e({logs:[]}),reset:()=>e({requestCount:0,logs:[]}),toggleDebug:()=>e(n=>({debugOpen:!n.debugOpen})),setDebugOpen:n=>e({debugOpen:n})}));function aw(e){return e.filter(n=>n.level==="warn"||n.level==="error").length}class za extends Error{status;statusText;result;constructor(n){super(n.message),this.name="AopsApiError",this.status=n.status,this.statusText=n.statusText,this.result=n.result??null}}function Ey(e){const n=e.authMode??"trusted-local",r=e.fetchImpl??globalThis.fetch.bind(globalThis),i=e.readCookieHeader??pw,o={baseUrl:rw(e.baseUrl,n,e.browserOrigin),browserOrigin:mp(e.browserOrigin),projectId:mp(e.projectId),scopeId:mp(e.scopeId),authMode:n},d=async(v,h={})=>{const m=ow(lw(v,o.baseUrl),h.query),g=h.body!==void 0,b=h.method??(g?"POST":"GET"),j=il.getState(),C=Date.now();j.beginRequest();try{const k=await nw(m,o,h,g,r,i),x=await fw(k),S=vw(x)?x:null,T=k.ok&&S?.ok!==!1;return j.endRequest({level:T?"info":"error",message:b+" "+m.pathname+" -> "+k.status,data:{method:b,url:m.pathname,status:k.status,ms:Date.now()-C,ok:T}}),{status:k.status,statusText:k.statusText,httpOk:k.ok,result:S,raw:x,headers:k.headers}}catch(k){throw j.endRequest({level:"error",message:b+" "+m.pathname+" -> "+(k instanceof Error?k.message:"error"),data:{method:b,url:m.pathname,ms:Date.now()-C,ok:!1,error:k instanceof Error?k.message:String(k)}}),k}},u=async(v,h={})=>{const m=await d(v,h);if(!m.httpOk||m.result?.ok===!1)throw new za({message:sw(m,"aops_api_request_failed"),status:m.status,statusText:m.statusText,result:m.result});return m.result&&Object.prototype.hasOwnProperty.call(m.result,"data")?m.result.data:m.raw};return{identity:o,requestResult:d,requestData:u,get:(v,h)=>u(v,{method:"GET",query:h}),post:(v,h,m={})=>u(v,{...m,method:"POST",body:h??{}}),patch:(v,h,m={})=>u(v,{...m,method:"PATCH",body:h??{}}),del:(v,h={})=>u(v,{...h,method:"DELETE"})}}async function nw(e,n,r,i,o,d){try{return await o(e,{method:r.method??(i?"POST":"GET"),credentials:n.authMode==="south-bff"?"same-origin":"omit",redirect:"error",referrerPolicy:n.authMode==="south-bff"?"same-origin":"no-referrer",signal:r.signal,headers:cw(n,r.headers,i,r.method??(i?"POST":"GET"),d),body:i?JSON.stringify(r.body??{}):void 0})}catch(u){throw new za({message:u instanceof Error?u.message:"network_error",status:0,statusText:"network_error"})}}function ij(e){return e?.messages?.length?e.messages.map(n=>n.messageText?.trim()).filter(n=>!!n):[]}function sw(e,n){const r=ij(e.result);return r.length?r.join("; "):e.result?.error?.message??e.result?.message??n}function It(e,n="request_failed"){if(e instanceof za){const r=ij(e.result);return r.length?r.join("; "):e.message||n}return e instanceof Error&&e.message||n}function rw(e,n,r){let i;try{i=new URL(e.trim())}catch{throw new za({message:"community_cockpit_invalid_server_url",status:0,statusText:"invalid_server_url"})}if(i.protocol!=="http:"&&i.protocol!=="https:"||i.username||i.password)throw new za({message:"community_cockpit_invalid_server_url",status:0,statusText:"invalid_server_url"});if(n==="trusted-local"&&!iw(i.hostname))throw new za({message:"community_cockpit_loopback_server_required",status:0,statusText:"loopback_server_required"});if(n==="south-bff"){let o;try{o=new URL(r??"")}catch{throw new za({message:"community_cockpit_remote_browser_origin_required",status:0,statusText:"remote_browser_origin_required"})}if(i.protocol!=="https:"||o.protocol!=="https:"||i.origin!==o.origin)throw new za({message:"community_cockpit_remote_same_origin_https_required",status:0,statusText:"remote_same_origin_https_required"})}return i.origin}function iw(e){const n=e.toLowerCase();if(n==="localhost"||n==="[::1]")return!0;const r=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(n);if(!r)return!1;const i=r.slice(1).map(Number);return i[0]===127&&i.every(o=>o>=0&&o<=255)}function lw(e,n){const r=new URL(e,n+"/");if(r.origin!==n||r.username||r.password)throw new za({message:"community_cockpit_cross_origin_request_rejected",status:0,statusText:"cross_origin_request_rejected"});for(const i of r.searchParams.keys())lj(i);return r}function mp(e){const n=e?.trim();return n||null}function ow(e,n){if(!n)return e;for(const[r,i]of Object.entries(n))lj(r),!(i==null||i==="")&&e.searchParams.set(r,String(i));return e}function cw(e,n,r,i,o){const d=new Headers(n);for(const u of[...d.keys()])hw(u)&&d.delete(u);if(d.set("accept","application/json"),r&&!d.has("content-type")&&d.set("content-type","application/json"),e.projectId&&d.set("x-project-id",e.projectId),e.scopeId&&d.set("x-scope-id",e.scopeId),e.authMode==="south-bff"&&!dw(i)){const u=uw(o());if(!u)throw new za({message:"south_bff_csrf_cookie_required",status:0,statusText:"csrf_cookie_required"});d.set("x-csrf-token",u)}return d}function dw(e){const n=e.trim().toUpperCase();return n==="GET"||n==="HEAD"||n==="OPTIONS"}function uw(e){const n=new Map;for(const r of e.split(";")){const i=r.indexOf("=");if(i<=0)continue;const o=r.slice(0,i).trim(),d=r.slice(i+1).trim();o&&d&&n.set(o,d)}return n.get("__Host-south-bff-csrf")??n.get("south-bff-csrf")??null}function pw(){return typeof document>"u"?"":document.cookie}function hw(e){const n=mw(e);return n.includes("authorization")||n.includes("cookie")||n.includes("session")||n.endsWith("token")||n.includes("accesstoken")||n.includes("apikey")||n.includes("password")||n.includes("secret")}function mw(e){return e.trim().toLowerCase().replace(/[^a-z0-9]/g,"")}function lj(e){const n=e.trim().toLowerCase().replace(/[^a-z0-9]/g,"");if(n.includes("authorization")||n.includes("cookie")||n.includes("session")||n.endsWith("token")||n.includes("apikey")||n.includes("password")||n.includes("secret")||n.includes("credential")||n.includes("bearer")||n.includes("csrf")||n.includes("xsrf")||n==="jwt"||n.endsWith("jwt"))throw new za({message:"community_cockpit_credential_query_rejected",status:0,statusText:"credential_query_rejected"})}async function fw(e){const n=await e.text();if(!n.trim())return null;try{return JSON.parse(n)}catch(r){throw new za({message:r instanceof Error?r.message:"invalid_json_response",status:e.status,statusText:e.statusText})}}function vw(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function gw({error:e,mode:n,serverBaseUrl:r,authMode:i,sessionRequired:o,t:d,onRetry:u,onSignIn:v}){const h=o?d("authSignInMessage"):It(e,"trusted_local_auth_failed");return a.jsx("main",{className:"aops-auth-page","data-theme":"light","data-accent":"sage","aria-busy":n==="loading",children:a.jsxs("section",{className:"aops-auth-panel","aria-live":"polite",children:[a.jsxs("div",{className:"aops-auth-brand",children:[a.jsx("span",{className:"aops-auth-mark",children:d("appShort")}),a.jsxs("div",{children:[a.jsx("h1",{children:d("appTitle")}),a.jsx("p",{children:r})]})]}),n==="loading"?a.jsxs("div",{className:"aops-auth-state",children:[a.jsx("h2",{children:d("authCheckingTitle")}),a.jsx("p",{children:d("authCheckingMessage")})]}):a.jsxs("div",{className:"aops-auth-state",role:"alert",children:[a.jsx("h2",{children:d("authErrorTitle")}),a.jsx("p",{children:h}),a.jsxs("div",{className:"aops-auth-actions",children:[i==="south-bff"&&o?a.jsx("button",{type:"button",className:"aops-v2-primary-button",onClick:v,children:d("authSignIn")}):null,a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:u,children:d("authRetry")})]})]})]})})}function yw({principal:e,provider:n,logoutBusy:r,logoutError:i,onLogout:o,t:d}){const u=e.fullName||e.email||e.userId||d("unknownValue");return a.jsxs("div",{className:"cockpit-authbar",title:i?`${u}: ${i}`:u,"aria-label":u,children:[a.jsxs("span",{className:"cockpit-authbar__icon","aria-hidden":"true",children:[wh.user,a.jsx("span",{className:"cockpit-authbar__dot is-active"})]}),a.jsx("span",{className:"cockpit-authbar__status",children:d(n==="south-bff"?"authProviderRemote":"authProviderTrusted")}),n==="south-bff"&&o?a.jsx("button",{type:"button",className:"cockpit-authbar__logout",disabled:r,onClick:o,children:d(r?"authChecking":"authSignOut")}):null]})}const rn=wh,bw=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function jw(e){return Array.from(e.querySelectorAll(bw)).filter(n=>n.getClientRects().length>0&&n.getAttribute("aria-hidden")!=="true")}function My(e,n){if(e.key!=="Tab"||!n)return;const r=jw(n);if(!r.length){e.preventDefault(),n.focus();return}const i=r[0],o=r[r.length-1],d=document.activeElement;e.shiftKey&&(d===i||!n.contains(d))?(e.preventDefault(),o.focus()):!e.shiftKey&&(d===o||!n.contains(d))&&(e.preventDefault(),i.focus())}function oj(e,n){return!!e.children?.some(r=>r.id===n||oj(r,n))}function cj(e,n){for(const r of e){if(r.id===n)return[r];const i=r.children?cj(r.children,n):null;if(i)return[r,...i]}return null}function Aw(){return a.jsxs("span",{className:"cockpit-prodmark",children:[a.jsxs("span",{className:"cockpit-prodmark__name",children:["aops",a.jsx("span",{className:"cockpit-prodmark__dot",children:"·"}),a.jsx("span",{className:"cockpit-prodmark__c2",children:"cockpit"})]}),a.jsx("span",{className:"cockpit-prodmark__beta",children:"Beta"})]})}function xw({currentState:e,nextState:n}){const r=n==="expanded"?9:n==="collapsed"?6.5:null;return a.jsxs("span",{className:"cockpit-header-nav-cycle__glyph","data-icon-state":n,"aria-hidden":"true",children:[a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:r!==null?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2.5",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("rect",{x:"4.5",y:"4.5",width:n==="expanded"?"4.5":"2",height:"15",rx:"0.8",fill:"currentColor",opacity:"0.2"}),a.jsx("path",{d:`M${r} 3v18`,stroke:"currentColor",strokeWidth:"1.6"})]}):a.jsx("path",{d:"M6.5 6.5l11 11M17.5 6.5l-11 11",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})}),a.jsxs("span",{className:"cockpit-header-nav-cycle__states",children:[a.jsx("i",{className:e==="expanded"?"is-active":void 0}),a.jsx("i",{className:e==="collapsed"?"is-active":void 0}),a.jsx("i",{className:e==="hidden"?"is-active":void 0})]})]})}function Cw({navMode:e,navLabels:n,navReopenLabel:r,onSetNavMode:i}){const o=e==="expanded"?"collapsed":e==="collapsed"?"hidden":"expanded",d=e==="expanded"?n.collapse:e==="collapsed"?n.hide:r,u=`${n.headerControls}: ${d}`;return a.jsx("button",{className:"cockpit-header-nav-cycle",type:"button",onClick:()=>i(o),"aria-label":u,"aria-controls":"cockpit-primary-navigation",title:u,"data-state":e,"data-next-state":o,"data-testid":"cockpit-nav-cycle",children:a.jsx(xw,{currentState:e,nextState:o})})}function kw({viewport:e,compactDensity:n,navItems:r,activePage:i,onNavigate:o,onToggleBranch:d,navMode:u,onSetNavMode:v,navLabels:h,navReopenLabel:m,leftDock:g,leftDockMode:b="hidden",leftDockWidth:j=null,thinBar:C=null,appearanceStyle:k,theme:x,accent:S,activeThemeId:T,themeOptions:I,accentOptions:E,onSetThemeId:L,onSetAccent:P,onToggleTheme:N,onOpenThemeStudio:R,authBar:z,statusBar:ne,children:ye,t:J}){const re=e==="mobile",[oe,fe]=y.useState(!1),[de,G]=y.useState(!1),Q=y.useRef(null),W=y.useRef(null),pe=y.useRef(null),ke=re&&b==="pinned"&&!!g,O=y.useMemo(()=>r.filter(ce=>!!ce.children?.length&&ce.expanded===!0),[r]),_=y.useMemo(()=>cj(r,i)??[],[i,r]),K=_[0]?.label??null,ee=_.length>1?_[_.length-1]?.label:null;y.useEffect(()=>{if(O.length<=1){pe.current=null;return}const ce=O.find(X=>oj(X,i))??O[0];if(!ce)return;const w=O.filter(X=>X.id!==ce.id),F=`${ce.id}:${w.map(X=>X.id).join(",")}`;pe.current!==F&&(pe.current=F,w.forEach(X=>d(X)))},[i,O,d]);const ve=y.useCallback((ce=!0)=>{fe(!1),ce&&window.requestAnimationFrame(()=>Q.current?.focus())},[]);y.useEffect(()=>{re||fe(!1)},[re]),y.useEffect(()=>{ke||G(!1)},[ke]),y.useEffect(()=>{G(!1)},[i]),y.useEffect(()=>{if(!re||!oe)return;const ce=F=>{if(F.key==="Escape"){F.preventDefault(),ve();return}My(F,document.getElementById("cockpit-primary-navigation"))};document.addEventListener("keydown",ce);const w=window.requestAnimationFrame(()=>{document.querySelector("#cockpit-primary-navigation .nav-item")?.focus()});return()=>{window.cancelAnimationFrame(w),document.removeEventListener("keydown",ce)}},[ve,re,oe]),y.useEffect(()=>{if(!ke||!de)return;const ce=F=>{if(F.key==="Escape"){F.preventDefault(),G(!1),window.requestAnimationFrame(()=>W.current?.focus());return}My(F,document.querySelector(".shell-workbench-dock-host[data-mode='pinned']"))};document.addEventListener("keydown",ce);const w=window.requestAnimationFrame(()=>{document.querySelector(".shell-workbench-dock-host button")?.focus()});return()=>{window.cancelAnimationFrame(w),document.removeEventListener("keydown",ce)}},[ke,de]);const se=y.useCallback(ce=>{o(ce),re&&ve(!1)},[ve,re,o]),Z=y.useCallback(ce=>{ce.expanded===!1&&O.filter(w=>w.id!==ce.id).forEach(w=>d(w)),d(ce)},[O,d]),ae=a.jsxs(a.Fragment,{children:[z,a.jsx(NS,{accent:S,accents:E,icons:rn,theme:x,themeLabel:J(x==="dark"?"themeDark":"themeLight"),themes:I,activeThemeId:T,onSetAccent:P,onSetThemeId:L,onToggleTheme:N,onOpenSettings:R})]});return a.jsxs(AS,{accent:S,theme:x,navState:u,"data-viewport":e,"data-density":n?"compact":"comfortable","data-mobile-nav-open":oe?"true":"false","data-mobile-dock-open":de?"true":"false",style:k,leftDock:g,leftDockMode:b,leftDockWidth:j,thinBar:C,children:[a.jsx(kS,{}),a.jsx(DS,{id:"cockpit-primary-navigation",items:r,icons:rn,activePage:i,navMode:re?"expanded":u,navLabels:h,navHeaderControls:!1,showNavEdgeTab:!1,navPopoverEnabled:!1,brand:null,onNavigate:se,onToggleBranch:Z,onSetNavMode:v}),re?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"cockpit-mobile-nav-backdrop","aria-label":h.hide,"aria-hidden":oe?void 0:!0,onClick:()=>ve(),tabIndex:oe?0:-1}),ke?a.jsx("button",{type:"button",className:"cockpit-mobile-dock-backdrop","aria-label":J("navPaneReopen"),"aria-hidden":de?void 0:!0,onClick:()=>{G(!1),window.requestAnimationFrame(()=>W.current?.focus())},tabIndex:de?0:-1}):null]}):null,a.jsx(SS,{children:a.jsxs("div",{className:"cockpit-topbar",children:[a.jsxs("div",{className:"cockpit-topbar__left",children:[re?a.jsx("button",{ref:Q,className:"cockpit-mobile-nav-trigger",type:"button",onClick:()=>fe(ce=>!ce),"aria-controls":"cockpit-primary-navigation","aria-expanded":oe,"aria-label":m,title:m,"data-testid":"cockpit-mobile-nav-trigger",children:rn.panelLeft??rn.menu??null}):a.jsx(Cw,{navMode:u,navLabels:h,navReopenLabel:m,onSetNavMode:v}),a.jsx(Aw,{}),K?a.jsxs("span",{className:"cockpit-topbar-context",children:[a.jsx("span",{className:"cockpit-topbar-context__primary",children:K}),ee?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"cockpit-topbar-context__separator","aria-hidden":"true",children:"/"}),a.jsx("span",{className:"cockpit-topbar-context__secondary",children:ee})]}):null]}):null,ke?a.jsx("button",{ref:W,className:"cockpit-mobile-dock-trigger",type:"button",onClick:()=>G(ce=>!ce),"aria-expanded":de,"aria-label":J("navPaneReopen"),title:J("navPaneReopen"),"data-testid":"cockpit-mobile-dock-trigger",children:rn.layers??rn.panelLeft??null}):null]}),re?a.jsxs("details",{className:"cockpit-mobile-actions",children:[a.jsx("summary",{"aria-label":J("navHeaderControls"),title:J("navHeaderControls"),children:rn.moreVertical??rn.gear??null}),a.jsx("div",{className:"cockpit-mobile-actions__panel",children:ae})]}):a.jsx("div",{className:"cockpit-topbar__right",children:ae})]})}),a.jsx(wS,{id:"main-content",children:a.jsxs("div",{className:"shell-main-frame",children:[a.jsx("div",{className:"shell-main-page-stack",children:ye}),a.jsx(CS,{icons:{close:rn.chevronLeft,chevronRight:rn.chevronRight}})]})}),ne]})}const Ty=3;function Sw(e){const{open:n,onClose:r,themeCatalog:i,activeThemeId:o,activeAccent:d,accentOptions:u,theme:v,customThemes:h,onSetThemeId:m,onSetAccent:g,onToggleTheme:b,onAddCustomTheme:j,onUpdateCustomTheme:C,onDeleteCustomTheme:k,t:x}=e,[S,T]=y.useState(null);if(!n)return null;const I=S?h.find(P=>P.id===S)??null:null,E=P=>{const N=XS(P,h,P?`${P.name} Copy`:"New theme");j(N),m(N.id),T(N.id)},L=P=>{S===P&&T(null),k(P)};return a.jsx("div",{className:"cockpit-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":x("themeStudioTitle"),onClick:r,children:a.jsxs("div",{className:"cockpit-modal cockpit-themestudio",onClick:P=>P.stopPropagation(),children:[a.jsxs("div",{className:"cockpit-modal__head",children:[a.jsxs("div",{children:[a.jsx("h2",{children:x("themeStudioTitle")}),a.jsx("p",{children:x("themeStudioSubtitle")})]}),a.jsxs("div",{className:"cockpit-modal__head-actions",children:[a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>E(),children:x("themeStudioNew")}),a.jsx("button",{type:"button",className:"cockpit-modal__close",onClick:r,"aria-label":x("themeStudioClose"),children:"×"})]})]}),a.jsxs("div",{className:"cockpit-modal__body",children:[a.jsxs("div",{className:"cockpit-ts-activebar",children:[a.jsx("span",{className:"cockpit-ts-activebar__label",children:x("themeStudioMode")}),a.jsxs("div",{className:"eops-segmented",children:[a.jsx("button",{type:"button",className:"eops-segmented-item","aria-pressed":v==="light",onClick:()=>{v!=="light"&&b()},children:x("themeLight")}),a.jsx("button",{type:"button",className:"eops-segmented-item","aria-pressed":v==="dark",onClick:()=>{v!=="dark"&&b()},children:x("themeDark")})]}),a.jsx("span",{className:"cockpit-ts-activebar__label",children:x("themeStudioAccent")}),a.jsx("div",{className:"cockpit-ts-swatches",children:u.map(P=>a.jsx("button",{type:"button",className:"cockpit-ts-swatch","aria-pressed":P.id===d,title:P.label,style:{background:P.swatch??"var(--accent)"},onClick:()=>g(P.id)},P.id))})]}),a.jsx("div",{className:"cockpit-ts-catalog",children:i.map(P=>{const N=P.id===o,R=!P.readonly;return a.jsxs("div",{className:`cockpit-ts-card${N?" is-active":""}`,children:[a.jsxs("div",{className:"cockpit-ts-card__preview",children:[a.jsx("span",{style:{background:P.light.background}}),a.jsx("span",{style:{background:P.dark.background}}),P.variants.slice(0,3).map(z=>a.jsx("span",{style:{background:z.accent}},z.id))]}),a.jsxs("div",{className:"cockpit-ts-card__main",children:[a.jsx("b",{children:P.name}),a.jsx("span",{className:`aops-pm-badge ${R?"aops-pm-badge--sage":"aops-pm-badge--ghost"}`,children:x(R?"themeStudioCustom":"themeStudioBuiltin")})]}),a.jsxs("div",{className:"cockpit-ts-card__actions",children:[N?a.jsx("span",{className:"aops-pm-badge aops-pm-badge--sage",children:x("themeStudioActive")}):a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>m(P.id),children:x("themeStudioUse")}),a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>E(P),children:x("themeStudioCopy")}),R?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>T(P.id),children:x("themeStudioEdit")}),a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>L(P.id),children:x("themeStudioDelete")})]}):null]})]},P.id)})}),I?a.jsx(ww,{theme:I,onUpdate:C,onDone:()=>T(null),t:x}):a.jsx("p",{className:"cockpit-ts-note",children:x("themeStudioReadonlyNote")})]})]})})}function ww({theme:e,onUpdate:n,onDone:r,t:i}){const o=(h,m,g)=>{n(e.id,{[h]:{...e[h],[m]:g}})},d=(h,m)=>{n(e.id,{variants:e.variants.map((g,b)=>b===h?{...g,...m}:g)})},u=()=>{if(e.variants.length>=Ty)return;const h=new Set(e.variants.map(g=>g.id)),m=sj({label:`${i("themeStudioAccent")} ${e.variants.length+1}`,accent:"#7ed6a5",seed:`tone-${e.variants.length+1}`,existingIds:h});n(e.id,{variants:[...e.variants,m]})},v=h=>{e.variants.length<=1||n(e.id,{variants:e.variants.filter((m,g)=>g!==h)})};return a.jsxs("div",{className:"cockpit-ts-editor",children:[a.jsxs("label",{className:"aops-field",children:[a.jsx("span",{children:i("themeStudioName")}),a.jsx("input",{value:e.name,onChange:h=>n(e.id,{name:h.target.value})})]}),a.jsx("div",{className:"cockpit-ts-editor-grid",children:["light","dark"].map(h=>a.jsxs("div",{className:"cockpit-ts-editor-card",children:[a.jsx("h4",{children:i(h==="light"?"themeStudioLightColors":"themeStudioDarkColors")}),a.jsx(Qr,{label:i("themeStudioColorCanvas"),value:e[h].background,onChange:m=>o(h,"background",m)}),a.jsx(Qr,{label:i("themeStudioColorSurface"),value:e[h].surface,onChange:m=>o(h,"surface",m)}),a.jsx(Qr,{label:i("themeStudioColorText"),value:e[h].foreground,onChange:m=>o(h,"foreground",m)})]},h))}),a.jsxs("div",{className:"cockpit-ts-editor-card",children:[a.jsxs("div",{className:"cockpit-ts-editor-card__head",children:[a.jsx("h4",{children:i("themeStudioVariants")}),a.jsx("button",{type:"button",className:"aops-v2-secondary-button",disabled:e.variants.length>=Ty,onClick:u,children:i("themeStudioAddVariant")})]}),e.variants.map((h,m)=>a.jsxs("div",{className:"cockpit-ts-variant",children:[a.jsxs("label",{className:"aops-field",children:[a.jsx("span",{children:i("themeStudioVariantLabel")}),a.jsx("input",{value:h.label,onChange:g=>d(m,{label:g.target.value})})]}),a.jsx(Qr,{label:i("themeStudioAccent"),value:h.accent,onChange:g=>d(m,{accent:g})}),a.jsx(Qr,{label:i("themeStudioVariantSecondary"),value:h.accentSecondary??h.accent,onChange:g=>d(m,{accentSecondary:g})}),a.jsx(Qr,{label:i("themeStudioVariantTertiary"),value:h.accentTertiary??h.accent,onChange:g=>d(m,{accentTertiary:g})}),a.jsx("button",{type:"button",className:"aops-v2-secondary-button",disabled:e.variants.length<=1,onClick:()=>v(m),children:i("themeStudioRemoveVariant")})]},h.id))]}),a.jsx("div",{className:"cockpit-ts-editor__foot",children:a.jsx("button",{type:"button",className:"aops-v2-primary-button",onClick:r,children:i("themeStudioDone")})})]})}function Qr({label:e,value:n,onChange:r}){return a.jsxs("label",{className:"cockpit-ts-color",children:[a.jsx("span",{children:e}),a.jsxs("span",{className:"cockpit-ts-color__inputs",children:[a.jsx("input",{type:"color",value:Nw(n),onChange:i=>r(i.target.value)}),a.jsx("input",{className:"cockpit-ts-color__hex",value:n,onChange:i=>r(i.target.value)})]})]})}function Nw(e){return/^#[0-9a-fA-F]{6}$/.test(e.trim())?e.trim():"#888888"}function Iw({open:e,logs:n,onClose:r,onClear:i,t:o}){const[d,u]=y.useState("all");if(!e)return null;const v=aw(n),h=d==="issues"?n.filter(m=>m.level!=="info"):n;return a.jsxs("aside",{className:"cockpit-debug-drawer","aria-label":o("debugTitle"),children:[a.jsxs("div",{className:"cockpit-debug__head",children:[a.jsxs("div",{children:[a.jsx("p",{className:"cockpit-debug__eyebrow",children:o("debugEyebrow")}),a.jsx("h3",{children:o("debugTitle")})]}),a.jsxs("div",{className:"cockpit-debug__actions",children:[a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:i,children:o("debugClear")}),a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:r,children:o("debugClose")})]})]}),a.jsxs("div",{className:"cockpit-debug__stats",children:[a.jsxs("div",{className:"cockpit-debug__stat",children:[a.jsx("span",{children:o("debugLogs")}),a.jsx("strong",{children:n.length})]}),a.jsxs("div",{className:"cockpit-debug__stat",children:[a.jsx("span",{children:o("debugIssues")}),a.jsx("strong",{children:v})]})]}),a.jsxs("div",{className:"cockpit-debug__filters",role:"group","aria-label":o("debugTitle"),children:[a.jsx("button",{type:"button",className:"eops-segmented-item","aria-pressed":d==="all",onClick:()=>u("all"),children:o("debugFilterAll")}),a.jsx("button",{type:"button",className:"eops-segmented-item","aria-pressed":d==="issues",onClick:()=>u("issues"),children:o("debugFilterIssues")})]}),a.jsx("div",{className:"cockpit-debug__list",children:h.length===0?a.jsx("div",{className:"cockpit-debug__empty",children:o("debugEmpty")}):h.slice().reverse().map(m=>a.jsxs("article",{className:`cockpit-debug__log cockpit-debug__log--${m.level}`,children:[a.jsx("span",{className:"cockpit-debug__time",children:Ew(m.ts)}),a.jsx("span",{className:`cockpit-debug__kind cockpit-debug__kind--${m.level}`,children:m.kind}),a.jsx("span",{className:"cockpit-debug__msg",children:m.message||"-"}),typeof m.data?.ms=="number"?a.jsxs("span",{className:"cockpit-debug__ms",children:[m.data.ms,"ms"]}):null]},m.id))})]})}function Ew(e){try{return new Date(e).toLocaleTimeString()}catch{return""}}function Rn(e){return String(e??"").trim()}function Mw(e,n){const r=Rn(e);if(r.length===0)throw new Error(`ui_plugin_page_id_required:${n}`);return r}function Tw(e){const n=Rn(e?.id);if(n.length===0)throw new Error("ui_plugin_id_required");const r=Array.isArray(e?.pages)?e.pages:[];if(r.length===0)throw new Error(`ui_plugin_pages_required:${n}`);return{id:n,pages:r.map(i=>({...i,id:Mw(i?.id,n)}))}}function Bw(e){return e.nav!==!1&&e.nav!==void 0}function Dw(e){const n=(Array.isArray(e?.plugins)?e.plugins:[]).map(m=>Tw(m)),r=[],i=new Map;for(const m of n)for(const g of m.pages){if(i.has(g.id))throw new Error(`ui_plugin_page_duplicate:${g.id}`);r.push(g),i.set(g.id,g)}const o=r.filter(Bw).map(m=>({id:m.id,label:Rn(m.nav.label),icon:Rn(m.nav.icon),order:Number.isFinite(m.nav.order)?Number(m.nav.order):0})).map(m=>{if(m.label.length===0)throw new Error(`ui_plugin_nav_label_required:${m.id}`);if(m.icon.length===0)throw new Error(`ui_plugin_nav_icon_required:${m.id}`);return m}).sort((m,g)=>m.order!==g.order?m.order-g.order:m.label.localeCompare(g.label)||m.id.localeCompare(g.id));return{plugins:n,pages:r,pagesById:i,navItems:o,hasPage:m=>i.has(Rn(m)),resolvePage:(m,g)=>{const b=Rn(m);if(b.length>0&&i.has(b))return b;const j=Rn(g);if(j.length===0||!i.has(j))throw new Error(`ui_plugin_page_fallback_missing:${j||"<empty>"}`);return j},prefetchPage:m=>{const g=i.get(Rn(m));if(!g?.prefetch)return;const b=g.prefetch();b&&typeof b.catch=="function"&&b.catch(()=>{})},renderPage:(m,g)=>{const b=i.get(Rn(m));return b?.render?b.render(g)??null:null}}}function Rw(e){return e.replace(/\/$/,"")}function Lw(){return globalThis.fetch.bind(globalThis)}class Nh{token=null;constructor(n){this.token=n??null}get(){return this.token}set(n){this.token=n}clear(){this.token=null}}function Ow(e,n,r,i){const o=new Error(r);return o.status=e,o.errorCode=n,i&&(o.details=i),o}class dj{tokens;base;prefix;fetchImpl;defaultHeaders;constructor(n){this.base=Rw(n.serverBaseUrl),this.prefix=n.apiPrefix,this.tokens=n.tokenProvider??new Nh,this.fetchImpl=n.fetchImpl??Lw(),this.defaultHeaders=n.defaultHeaders??{}}url(n){return`${this.base}${this.prefix}${n}`}headers(){const n={...this.defaultHeaders,"content-type":"application/json"},r=this.tokens.get();return r&&(n.authorization=`Bearer ${r}`),n}async request(n,r,i){const o=await this.fetchImpl(this.url(r),{method:n,headers:this.headers(),body:i===void 0?void 0:JSON.stringify(i)}),d=await o.text(),u=d?JSON.parse(d):{},v=m=>typeof m=="object"&&m!==null&&"ok"in m;let h=v(u)?u:null;if(h&&v(h.data)&&(h=h.data),!o.ok||h?.ok===!1){const m=h,g=m?.errorCode??m?.error,b=m?.message??`request failed (${o.status})`,j=m?.details,C=typeof j=="object"&&j!==null&&!Array.isArray(j)?j:void 0;throw Ow(o.status,g,b,C)}return h&&"data"in h?h.data:u}get(n){return this.request("GET",n)}post(n,r){return this.request("POST",n,r)}del(n){return this.request("DELETE",n)}}function Us(e,n){if(!n)return e;const r=new URLSearchParams;for(const[o,d]of Object.entries(n))d!=null&&d!==""&&r.set(o,d);const i=r.toString();return i?`${e}?${i}`:e}class _w{http;constructor(n){const r=n.tokenProvider??new Nh(n.accessToken??null),i={};n.projectId&&(i["x-project-id"]=n.projectId),n.scopeId&&(i["x-scope-id"]=n.scopeId),this.http=new dj({serverBaseUrl:n.serverBaseUrl,apiPrefix:"/api/projectman",tokenProvider:r,fetchImpl:n.fetchImpl,defaultHeaders:i})}listBoards(n){return this.http.get(Us("/kanban-boards",n))}getBoard(n){return this.http.get(`/kanban-boards/${encodeURIComponent(n)}`)}listSprints(n){return this.http.get(Us("/sprints",n))}getSprint(n){return this.http.get(`/sprints/${encodeURIComponent(n)}`)}listImplementationPlans(n){return this.http.get(Us("/implementation-plans",n))}getImplementationPlan(n){return this.http.get(`/implementation-plans/${encodeURIComponent(n)}`)}listKanbanTasks(n){return this.http.get(Us("/kanban-tasks",n))}getKanbanTask(n){return this.http.get(`/kanban-tasks/${encodeURIComponent(n)}`)}listIssues(n){return this.http.get(Us("/issues",n))}getIssue(n){return this.http.get(`/issues/${encodeURIComponent(n)}`)}listFeedback(n){return this.http.get(Us("/feedbacks",n))}getFeedback(n){return this.http.get(`/feedbacks/${encodeURIComponent(n)}`)}listReviewRequests(n){return this.http.get(Us("/review-requests",n))}getReviewRequest(n){return this.http.get(`/review-requests/${encodeURIComponent(n)}`)}}async function Qw(e,n){await e.post("/api/projectman/operations/kanban-board/archive",{id:n})}async function Uw(e,n){await e.post("/api/projectman/operations/kanban-board/unarchive",{id:n})}async function Pw(e,n){await e.del(`/api/projectman/kanban-boards/${encodeURIComponent(n)}`,{body:{id:n}})}function uj(e){const n=e.name.trim();if(!n)throw new Error("Board name is required.");const r={name:n},i=e.slug?.trim(),o=e.description?.trim();return i&&(r.slug=i),o!==void 0&&(r.description=o||null),r}async function pj(e,n){await e.post("/api/projectman/kanban-boards",uj(n))}async function Fw(e,n,r){await e.patch(`/api/projectman/kanban-boards/${encodeURIComponent(n)}`,uj(r))}async function Kw(e,n,r,i){const o=r.name.trim();if(!o)throw new Error("Column name is required.");const d={name:o},u=r.slug?.trim();u&&(d.slug=u);const v=r.description?.trim();if(v&&(d.description=v),r.wipLimit!==void 0&&r.wipLimit!==null){if(!Number.isInteger(r.wipLimit)||r.wipLimit<0)throw new Error("WIP limit must be a non-negative integer.");d.wipLimit=r.wipLimit}const h=await e.post("/api/projectman/kanban-columns",d),m=Hw(h);if(!m)throw new Error("The column was created but the server returned no id.");try{await e.post("/api/projectman/kanban-board-columns",{board:n,column:m,...i===void 0?{}:{position:i}})}catch(g){try{await e.del(`/api/projectman/kanban-columns/${encodeURIComponent(m)}`,{body:{id:m}})}catch{throw new Error(`Placing the column on the board failed, and removing the orphaned column ${m} failed as well; delete it manually.`)}throw g}}async function zw(e,n){if(n.taskIds.length>0){if(!n.targetPlacementId)throw new Error("A column holding tasks needs a destination column before it can be removed.");if(n.targetPlacementId===n.placementId)throw new Error("The destination column must be a different column.");for(const r of n.taskIds)await e.post(`/api/projectman/kanban-tasks/${encodeURIComponent(r)}/move`,{id:r,boardColumn:n.targetPlacementId})}await e.del(`/api/projectman/kanban-board-columns/${encodeURIComponent(n.placementId)}`,{body:{id:n.placementId}})}async function $w(e,n,r){if(new Set(r).size!==r.length)throw new Error("The column order names the same column twice.");await e.post("/api/projectman/kanban-board-columns/reorder",{board:n,orderedIds:[...r]})}function Hw(e){if(!e||typeof e!="object")return null;const n=e,r=n.data,o=(r&&typeof r=="object"&&!Array.isArray(r)?r:n).id;return typeof o=="string"&&o.trim()!==""?o:null}async function Gw(e,n){await e.post("/api/projectman/operations/sprint/archive",{id:n})}async function qw(e,n){await e.post("/api/projectman/operations/sprint/unarchive",{id:n})}async function Vw(e,n){await e.del(`/api/projectman/sprints/${encodeURIComponent(n)}`,{body:{id:n}})}async function Yw(e,n,r){await e.del(`/api/projectman/${n}/${encodeURIComponent(r)}`,{body:{id:r}})}function hj(e,n,r,i){return[...ia.all(e,n,r),"board-tasks",i]}function mj(e,n,r){return mt({queryKey:hj(e.client.identity,e.sessionKey,e.selectedProject,n),queryFn:async()=>(await e.client.get("/api/projectman/kanban-tasks",{board:n})).slice().sort(Vp),enabled:r&&!!e.selectedProject,staleTime:5*6e4})}const ia={all:(e,n,r)=>["aops-projectman",e.baseUrl,n??"anonymous",r?.projectId??"no-project-id",r?.scopeId??"no-scope-id",r?.slug??"no-slug"],entity:(e,n,r,i)=>[...ia.all(e,n,r),i],boardColumns:(e,n,r,i)=>[...ia.all(e,n,r),"board-columns",i],detail:(e,n,r,i,o)=>[...ia.all(e,n,r),"detail",i,o??"none"]};function Zi(e,n){return Date.parse(n.updatedAt??n.createdAt??"")-Date.parse(e.updatedAt??e.createdAt??"")}function Vp(e,n){return(e.position??0)-(n.position??0)}async function fp(e){try{return await e({includeArchived:"true"})}catch{return e()}}function Jw(e){return e.trim().toLowerCase().replace(/[^a-z0-9]/g,"")}function Xw(e){const n=Jw(e);return n.includes("authorization")||n.includes("cookie")||n.includes("session")||n.endsWith("token")||n.includes("accesstoken")||n.includes("apikey")||n.includes("password")||n.includes("secret")}function Ww(e){const n=e.toLowerCase();if(n==="localhost"||n==="[::1]")return!0;const r=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(n);if(!r)return!1;const i=r.slice(1).map(Number);return i[0]===127&&i.every(o=>o>=0&&o<=255)}function Zw(e){return e.trim().toLowerCase().replace(/[^a-z0-9]/g,"")}function e0(e){const n=Zw(e);return n.includes("authorization")||n.includes("cookie")||n.includes("session")||n.endsWith("token")||n.includes("apikey")||n.includes("password")||n.includes("secret")||n.includes("credential")||n.includes("bearer")||n.includes("csrf")||n.includes("xsrf")||n==="jwt"||n.endsWith("jwt")}function t0(e){let n;try{n=new URL(e.baseUrl)}catch{throw new Error("community_cockpit_trusted_server_base_rejected")}if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username||n.password||n.pathname!=="/"||n.search||n.hash)throw new Error("community_cockpit_trusted_server_base_rejected");if(e.authMode==="trusted-local"&&!Ww(n.hostname))throw new Error("community_cockpit_trusted_server_base_rejected");if(e.authMode==="south-bff"&&(n.protocol!=="https:"||!e.browserOrigin||n.origin!==e.browserOrigin))throw new Error("community_cockpit_trusted_server_base_rejected");return n}function a0(e,n,r){const i=e instanceof Request?e.url:e instanceof URL?e.href:String(e);let o;try{o=new URL(i)}catch{throw new Error("community_cockpit_trusted_fetch_target_rejected")}if(o.protocol!=="http:"&&o.protocol!=="https:"||o.username||o.password||o.origin!==n.origin||o.hash||o.pathname!==r.slice(0,-1)&&!o.pathname.startsWith(r))throw new Error("community_cockpit_trusted_fetch_target_rejected");for(const d of o.searchParams.keys())if(e0(d))throw new Error("community_cockpit_credential_query_rejected")}function n0(e,n){const r=new Headers(e instanceof Request?e.headers:void 0);for(const[i,o]of new Headers(n?.headers))r.set(i,o);return r}function s0(e){const n=t0(e),r=globalThis.fetch.bind(globalThis);return(i,o)=>{a0(i,n,"/api/projectman/");const d=n0(i,o);for(const g of[...d.keys()])Xw(g)&&d.delete(g);const u=o?.method??(i instanceof Request?i.method:"GET");if(e.authMode==="south-bff"&&!r0(u)){const g=i0();if(!g)throw new Error("south_bff_csrf_cookie_required");d.set("x-csrf-token",g)}const v=e.authMode==="south-bff"?"same-origin":"omit",h=e.authMode==="south-bff"?"same-origin":"no-referrer",m=new Request(i,{...o,headers:d,credentials:v,redirect:"error",referrerPolicy:h});return r(m,{headers:d,credentials:v,redirect:"error",referrerPolicy:h})}}function r0(e){const n=e.trim().toUpperCase();return n==="GET"||n==="HEAD"||n==="OPTIONS"}function i0(){if(typeof document>"u")return null;const e=new Map;for(const n of document.cookie.split(";")){const r=n.indexOf("=");if(r<=0)continue;const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();i&&o&&e.set(i,o)}return e.get("__Host-south-bff-csrf")??e.get("south-bff-csrf")??null}function l0(e){return new _w({serverBaseUrl:e.identity.baseUrl,projectId:e.identity.projectId??void 0,scopeId:e.identity.scopeId??void 0,fetchImpl:s0(e.identity)})}function o0(e,n,r){const i=new Map(n.map(d=>[d.id,d])),o=new Set(e.map(d=>d.id));return Object.fromEntries(r.filter(([d])=>o.has(d)).map(([d,u])=>[d,u.slice().sort((v,h)=>v.position-h.position).map(v=>{const h=i.get(v.columnId);return{id:v.id,boardId:v.boardId,columnId:v.columnId,name:h?.name??v.columnId.slice(0,8),slug:h?.slug,wipLimit:h?.wipLimit??null,position:v.position}})]))}function c0(e){return e.find(n=>n!=null)??null}function d0(e){const n=!!(e.enabled&&e.selectedProject),r=n&&e.tasksEnabled!==!1,i=Tc(),o=y.useMemo(()=>l0(e.client),[e.client.identity.baseUrl,e.client.identity.projectId,e.client.identity.scopeId]),d=mt({queryKey:ia.entity(e.client.identity,e.sessionKey,e.selectedProject,"boards"),queryFn:()=>fp(fe=>o.listBoards(fe)),enabled:n}),u=mt({queryKey:ia.entity(e.client.identity,e.sessionKey,e.selectedProject,"tasks"),queryFn:()=>o.listKanbanTasks(),enabled:r}),v=mt({queryKey:ia.entity(e.client.identity,e.sessionKey,e.selectedProject,"sprints"),queryFn:()=>fp(fe=>o.listSprints(fe)),enabled:n}),h=mt({queryKey:ia.entity(e.client.identity,e.sessionKey,e.selectedProject,"plans"),queryFn:()=>fp(fe=>o.listImplementationPlans(fe)),enabled:n}),m=mt({queryKey:ia.entity(e.client.identity,e.sessionKey,e.selectedProject,"issues"),queryFn:()=>o.listIssues(),enabled:n}),g=mt({queryKey:ia.entity(e.client.identity,e.sessionKey,e.selectedProject,"feedback"),queryFn:()=>o.listFeedback(),enabled:n}),b=mt({queryKey:ia.entity(e.client.identity,e.sessionKey,e.selectedProject,"review-requests"),queryFn:()=>o.listReviewRequests(),enabled:n}),j=mt({queryKey:ia.entity(e.client.identity,e.sessionKey,e.selectedProject,"columns"),queryFn:()=>e.client.get("/api/projectman/kanban-columns"),enabled:n}),C=y.useMemo(()=>(d.data??[]).slice().sort(Vp),[d.data]),k=y.useMemo(()=>C.map(fe=>fe.id),[C]),x=mt({queryKey:ia.boardColumns(e.client.identity,e.sessionKey,e.selectedProject,k),queryFn:async()=>await Promise.all(k.map(async de=>{const G=await e.client.get("/api/projectman/kanban-board-columns",{board:de});return[de,G]})),enabled:n&&d.isSuccess}),S=y.useMemo(()=>(u.data??[]).slice().sort(Vp),[u.data]),T=y.useMemo(()=>(v.data??[]).slice().sort(Zi),[v.data]),I=y.useMemo(()=>(h.data??[]).slice().sort(Zi),[h.data]),E=y.useMemo(()=>(m.data??[]).slice().sort(Zi),[m.data]),L=y.useMemo(()=>(g.data??[]).slice().sort(Zi),[g.data]),P=y.useMemo(()=>(b.data??[]).slice().sort(Zi),[b.data]),N=y.useMemo(()=>o0(C,j.data??[],x.data??[]),[x.data,C,j.data]),R=[d,u,v,h,m,g,b,j,x],z=r?R:R.filter(fe=>fe!==u),ne=c0(R.map(fe=>fe.error)),ye=n&&z.some(fe=>fe.isPending),J=R.some(fe=>fe.isFetching),re=C.length+S.length+T.length+I.length+E.length+L.length+P.length>0;return{status:e.selectedProject?ye?"loading":ne?"error":re?"ready":"empty":"select-project",selectedProject:e.selectedProject,client:e.client,sessionKey:e.sessionKey,error:ne,isFetching:J,boards:C,tasks:S,sprints:T,implementationPlans:I,issues:E,feedback:L,reviewRequests:P,columnsByBoard:N,refresh:()=>{for(const fe of z)fe.refetch();i.invalidateQueries({queryKey:[...ia.all(e.client.identity,e.sessionKey,e.selectedProject),"board-tasks"]})}}}function Ih(e){const n=e.sprintId?.trim()||null;return mt({queryKey:ia.detail(e.model.client.identity,e.model.sessionKey,e.model.selectedProject,"sprint",n),queryFn:()=>e.model.client.get(`/api/projectman/sprints/${n}`),enabled:!!(e.enabled&&n&&e.model.selectedProject)})}function Eh(e){const n=e.planId?.trim()||null;return mt({queryKey:ia.detail(e.model.client.identity,e.model.sessionKey,e.model.selectedProject,"implementation-plan",n),queryFn:()=>e.model.client.get(`/api/projectman/implementation-plans/${n}`),enabled:!!(e.enabled&&n&&e.model.selectedProject)})}function dn(e){return e.archived===!0||!!e.archivedAt}function gs(e){return["done","completed","closed","accepted","approved"].includes(e?.toLowerCase()??"")}function Hr(e){return["open","new","doing","in_progress","in-progress","requested","blocked"].includes(e?.toLowerCase()??"")}function ja(e){const n=e?.toLowerCase().replace(/_/g,"-");return n?["done","closed","resolved","accepted","approved","completed","published"].includes(n)?"sage":["doing","in-progress","requested","open","new"].includes(n)?"amber":["changes-requested","rejected","blocked","failed"].includes(n)?"claret":"indigo":"ghost"}function Oe(e){return e.slice(0,8)}function fj({board:e,busy:n,error:r,onCancel:i,onSubmit:o,t:d}){const[u,v]=y.useState(e?.name??""),[h,m]=y.useState(e?.slug??""),[g,b]=y.useState(e?.description??""),[j,C]=y.useState(!1),k=y.useRef(null);y.useEffect(()=>{const E=L=>{L.key==="Escape"&&!n&&i()};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[n,i]),y.useEffect(()=>{k.current?.focus(),k.current?.select()},[]);const x=u.trim(),S=x.length===0,T=d(e?"pmBoardEditorEditTitle":"pmBoardEditorCreateTitle"),I=()=>{C(!0),!(S||n)&&o({name:x,slug:h,description:g})};return a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",onClick:()=>!n&&i(),children:a.jsxs("div",{className:"aops-v2-chat-modal aops-v2-chat-modal-sm",role:"dialog","aria-modal":"true","aria-label":T,onClick:E=>E.stopPropagation(),"data-testid":"aops-v2-boards-editor-modal",children:[a.jsxs("header",{className:"aops-v2-chat-modal-head",children:[a.jsx("h4",{children:T}),a.jsx("button",{type:"button",className:"aops-v2-chat-iconclose","aria-label":d("pmCardCancel"),onClick:i,disabled:n,children:"✕"})]}),a.jsxs("form",{className:"aops-v2-chat-modal-body aops-pm-boardeditor",onSubmit:E=>{E.preventDefault(),I()},children:[a.jsxs("label",{className:"aops-pm-boardeditor-field",children:[a.jsxs("span",{className:"aops-pm-boardeditor-label",children:[d("pmBoardEditorName"),a.jsx("span",{"aria-hidden":!0,children:" *"})]}),a.jsx("input",{ref:k,type:"text",value:u,onChange:E=>v(E.target.value),onBlur:()=>C(!0),disabled:n,required:!0,"aria-invalid":j&&S,"aria-describedby":j&&S?"aops-pm-boardeditor-nameerr":void 0,"data-testid":"aops-v2-boards-editor-name"}),j&&S?a.jsx("span",{className:"aops-pm-boardeditor-error",id:"aops-pm-boardeditor-nameerr",children:d("pmBoardEditorNameRequired")}):null]}),a.jsxs("label",{className:"aops-pm-boardeditor-field",children:[a.jsx("span",{className:"aops-pm-boardeditor-label",children:d("pmBoardEditorSlug")}),a.jsx("input",{type:"text",value:h,onChange:E=>m(E.target.value),disabled:n,className:"aops-pm-mono","aria-describedby":"aops-pm-boardeditor-slughint","data-testid":"aops-v2-boards-editor-slug"}),a.jsx("span",{className:"aops-pm-boardeditor-hint",id:"aops-pm-boardeditor-slughint",children:d(e?"pmBoardEditorSlugHintEdit":"pmBoardEditorSlugHint")})]}),a.jsxs("label",{className:"aops-pm-boardeditor-field",children:[a.jsx("span",{className:"aops-pm-boardeditor-label",children:d("pmBoardEditorDescription")}),a.jsx("textarea",{value:g,onChange:E=>b(E.target.value),disabled:n,rows:3,"data-testid":"aops-v2-boards-editor-description"})]}),r?a.jsx("p",{className:"aops-pm-delete-error",children:r}):null,a.jsxs("div",{className:"aops-pm-delete-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:i,disabled:n,children:d("pmCardCancel")}),a.jsx("button",{type:"submit",className:"aops-pm-cards-mini theme-accent",disabled:n,"data-testid":"aops-v2-boards-editor-save",children:d(n?"pmBoardEditorSaveBusy":"pmBoardEditorSave")})]})]})]})})}function u0({model:e,t:n}){const[r,i]=y.useState(!1),[o,d]=y.useState(!1),[u,v]=y.useState(null),h=y.useCallback(async m=>{d(!0),v(null);try{await pj(e.client,m),i(!1),e.refresh()}catch(g){v(It(g))}finally{d(!1)}},[e]);return a.jsxs(a.Fragment,{children:[a.jsx(it,{variant:"empty",title:n("pmEmptyTitle"),message:n("pmEmptyMessage"),actions:a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>{v(null),i(!0)},"data-testid":"aops-v2-boards-empty-create",children:n("pmBoardEditorNew")})}),r?a.jsx(fj,{board:null,busy:o,error:u,onCancel:()=>{o||i(!1)},onSubmit:m=>{h(m)},t:n}):null]})}const pn=[{id:"pm-boards",section:"boards",labelKey:"pmSectionBoards"},{id:"pm-sprints",section:"sprints",labelKey:"pmSectionSprints"},{id:"pm-issues",section:"issues",labelKey:"pmSectionIssues"},{id:"pm-feedback",section:"feedback",labelKey:"pmSectionFeedback"},{id:"pm-reviews",section:"reviews",labelKey:"pmSectionReviews"}],vj=pn[0].id;function gj(e){return pn.find(n=>n.id===e)?.section??pn[0].section}function By(e){return pn.find(n=>n.section===e)?.id??vj}function Yo(e){return pn.some(n=>n.id===e)}const hn=[{id:"as-memory",section:"memory",labelKey:"asSectionMemory"},{id:"as-discussions",section:"discussions",labelKey:"asSectionDiscussions"},{id:"as-prompts",section:"prompts",labelKey:"asSectionPrompts"},{id:"as-skills",section:"skills",labelKey:"asSectionSkills"},{id:"as-artifacts",section:"artifacts",labelKey:"asSectionArtifacts"},{id:"as-resources",section:"resources",labelKey:"asSectionResources"},{id:"as-agents",section:"agents",labelKey:"asSectionAgents"}],yj=hn[0].id;function p0(e){return hn.find(n=>n.id===e)?.section??hn[0].section}function Dy(e){return hn.find(n=>n.section===e)?.id??yj}function h0(e){return hn.some(n=>n.id===e)}const m0=[{id:"projects",label:"navProjects",navItems:[{id:"projects",labelKey:"navProjects",icon:"stack"}],defaultPageId:"projects"},{id:"pm",label:"navProjectman",navItems:[{id:"projectman",labelKey:"navProjectman",icon:"board",children:pn.map(e=>({id:e.id,labelKey:e.labelKey}))}],defaultPageId:vj},{id:"agentspace",label:"navAgentspace",navItems:[{id:"agentspace",labelKey:"navAgentspace",icon:"spark",children:hn.map(e=>({id:e.id,labelKey:e.labelKey}))}],defaultPageId:yj},{id:"docs",label:"navDocs",navItems:[{id:"docs",labelKey:"navDocs",icon:"doc"}],defaultPageId:"docs"},{id:"sessions",label:"navSessions",navItems:[{id:"chat",labelKey:"navChat",icon:"chat"}],defaultPageId:"chat"}];function f0(){return m0.flatMap(e=>e.navItems)}const Ry=e=>{const n=Number(e);return!Number.isFinite(n)||n<0?0:Math.floor(n)},v0=(e,n=20)=>{const r=Number(e);return!Number.isFinite(r)||r<=0?n:Math.floor(r)};function Dc({total:e=0,page:n=0,pageSize:r=20,visibleCount:i=0}={}){const o=Ry(e),d=v0(r),u=Math.max(1,Math.ceil(o/d)),v=Math.min(Math.max(Number(n)||0,0),u-1),h=v>0,m=v<u-1,g=o===0?0:v*d+1,b=o===0?0:Math.min(o,v*d+Ry(i));return{total:o,pageSize:d,totalPages:u,currentPage:v,canGoPrev:h,canGoNext:m,start:g,end:b}}const Ps=e=>typeof e=="string"?e.trim():"",Ly=e=>Array.isArray(e)?e:[],g0="__all_categories__",lt={navModeLeftMenu:"inventory_itemsv3__nav_mode_left_menu",navModeNavigator:"inventory_itemsv3__nav_mode_navigator",treeControlsAria:"inventory_itemsv3__tree_controls_aria",treeSearchPlaceholder:"inventory_itemsv3__tree_search_placeholder",treeSearchAria:"inventory_itemsv3__tree_search_aria",treeExpandAll:"inventory_itemsv3__tree_expand_all",treeCollapseAll:"inventory_itemsv3__tree_collapse_all",treeExpandBranch:"inventory_itemsv3__tree_expand_branch",treeCollapseBranch:"inventory_itemsv3__tree_collapse_branch",treePaneAria:"inventory_itemsv3__tree_pane_aria",treeLoading:"inventory_itemsv3__tree_loading",treeEmpty:"inventory_itemsv3__tree_empty",treeNarrowPane:"inventory_itemsv3__tree_narrow_pane",treeFitPane:"inventory_itemsv3__tree_fit_pane",treeFavAdd:"inventory_itemsv3__tree_fav_add",treeFavRemove:"inventory_itemsv3__tree_fav_remove",treeFavGroupAria:"inventory_itemsv3__tree_fav_group_aria",treeLabelModeAria:"inventory_itemsv3__tree_label_mode_aria",treeLabelModeCode:"inventory_itemsv3__tree_label_mode_code",treeLabelModeName:"inventory_itemsv3__tree_label_mode_name",navigatorAllCategories:"inventory_itemsv2__navigator_all_categories",navigatorAllMeta:"inventory_itemsv2__navigator_all_meta",navigatorEmptySearch:"inventory_itemsv2__navigator_empty_search"},Rc=(e,n="")=>n;function Ea(...e){return e.filter(Boolean).join(" ")}function y0({size:e=12}){return a.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m9 5 7 7-7 7",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function b0({size:e=12}){return a.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m5 9 7 7 7-7",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function j0({size:e=15}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"m7 9.2 5-5 5 5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"m7 14.8 5 5 5-5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})]})}function A0({size:e=15}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"m7 3.6 5 5 5-5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"m7 20.4 5-5 5 5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})]})}function x0({size:e=15}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("rect",{x:"4",y:"4.5",width:"16",height:"15",rx:"2",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M9 4.8v14.4",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"m17 8.4-3.3 3.6 3.3 3.6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})]})}function C0({size:e=15}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("rect",{x:"4",y:"4.5",width:"16",height:"15",rx:"2",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"M9 4.8v14.4",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("path",{d:"m13.5 8.4 3.3 3.6-3.3 3.6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})]})}function k0({size:e=14}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("rect",{x:"3.4",y:"4.4",width:"17.2",height:"15.2",rx:"2.6",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"M9.6 4.8v14.4",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"M12.6 9.4h4.6M12.6 12.6h4.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function S0({size:e=14}){return a.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M4.5 6.8h15M4.5 12h15M4.5 17.2h15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function w0({size:e=13}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("circle",{cx:"11",cy:"11",r:"6.5",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m16 16 4.5 4.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function Oy({size:e=12,filled:n=!1}){return a.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:n?"currentColor":"none","aria-hidden":"true",children:a.jsx("path",{d:"m12 3.6 2.6 5.3 5.8.8-4.2 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.6 9.7l5.8-.8z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})}function _y({size:e=13}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M12 3.6 4 7.3v9.4l8 3.7 8-3.7V7.3z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M4 7.3l8 3.7 8-3.7M12 11v9.4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Mh({active:e=!1,onClick:n,tItems:r=Rc}){const i=r(lt.navModeLeftMenu,"Left menu");return a.jsx("button",{type:"button",className:Ea("mini-button ghost icon-only inv-iv3-leftmenu-header-btn",e&&"is-active"),onClick:n,"aria-label":i,title:i,"aria-pressed":e,"data-testid":"itemsv3-header-left-menu",children:a.jsx(k0,{})})}function N0({searchValue:e,onSearchChange:n,searchPlaceholder:r="",searchAriaLabel:i="",controlsAriaLabel:o="",searchTrailingSlot:d=null,tItems:u=Rc}){return a.jsx("header",{className:"inv-iv3-cattree-header",role:"group","aria-label":o||u(lt.treeControlsAria,"Category tree tools"),children:a.jsxs("span",{className:"inv-iv3-cattree-search",children:[a.jsx("span",{className:"inv-iv3-cattree-search-icon",children:a.jsx(w0,{})}),a.jsx("input",{type:"search",className:"inv-iv3-cattree-search-input",value:e,"data-testid":"itemsv3-cattree-search","aria-label":i||u(lt.treeSearchAria,"Filter the category tree"),placeholder:r||u(lt.treeSearchPlaceholder,"Search categories"),onChange:v=>n?.(v.target.value)}),d?a.jsx("span",{className:"inv-iv3-cattree-search-trailing",children:d}):null]})})}function Th({onExpandAll:e,onCollapseAll:n,onNarrowPane:r,onFitPane:i,expandDisabled:o=!1,collapseDisabled:d=!1,narrowDisabled:u=!1,fitDisabled:v=!1,onSwitchToNavigator:h,labelMode:m="name",onLabelModeChange:g,codeLabel:b="",nameLabel:j="",dataLang:C="en",onDataLangChange:k,dataLangAria:x="",settingsSlot:S=null,tItems:T=Rc}){return a.jsxs("div",{className:"inv-iv3-cattree-iconbar",role:"toolbar","aria-label":T(lt.treeControlsAria,"Category tree tools"),"data-testid":"itemsv3-category-iconbar",children:[S?a.jsxs(a.Fragment,{children:[S,a.jsx("span",{className:"inv-iv3-cattree-iconbar-sep","aria-hidden":"true"})]}):null,g?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"inv-iv3-cattree-labelmode",role:"group","aria-label":T(lt.treeLabelModeAria,"Row label mode"),"data-testid":"itemsv3-cattree-labelmode",children:[a.jsx("button",{type:"button",className:Ea("inv-iv3-cattree-labelmode-btn",m==="code"&&"is-active"),"aria-pressed":m==="code",onClick:()=>g("code"),"data-testid":"itemsv3-cattree-labelmode-code",children:b||T(lt.treeLabelModeCode,"Code")}),a.jsx("button",{type:"button",className:Ea("inv-iv3-cattree-labelmode-btn",m!=="code"&&"is-active"),"aria-pressed":m!=="code",onClick:()=>g("name"),"data-testid":"itemsv3-cattree-labelmode-name",children:j||T(lt.treeLabelModeName,"Name")})]}),a.jsx("span",{className:"inv-iv3-cattree-iconbar-sep","aria-hidden":"true"})]}):null,k?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"inv-iv3-cattree-labelmode inv-iv3-cattree-datalang",role:"group","aria-label":x||"Data language","data-testid":"itemsv3-cattree-datalang",children:[a.jsx("button",{type:"button",className:Ea("inv-iv3-cattree-labelmode-btn",C==="tr"&&"is-active"),"aria-pressed":C==="tr",onClick:()=>k("tr"),"data-testid":"itemsv3-cattree-datalang-tr",children:"TR"}),a.jsx("button",{type:"button",className:Ea("inv-iv3-cattree-labelmode-btn",C!=="tr"&&"is-active"),"aria-pressed":C!=="tr",onClick:()=>k("en"),"data-testid":"itemsv3-cattree-datalang-en",children:"EN"})]}),a.jsx("span",{className:"inv-iv3-cattree-iconbar-sep","aria-hidden":"true"})]}):null,a.jsx("button",{className:"inv-iv3-cattree-tool-btn",type:"button","aria-label":T(lt.treeExpandAll,"Expand all"),title:T(lt.treeExpandAll,"Expand all"),onClick:e,disabled:o,"data-testid":"itemsv3-cattree-expand-all",children:a.jsx(j0,{})}),a.jsx("button",{className:"inv-iv3-cattree-tool-btn",type:"button","aria-label":T(lt.treeCollapseAll,"Collapse all"),title:T(lt.treeCollapseAll,"Collapse all"),onClick:n,disabled:d,"data-testid":"itemsv3-cattree-collapse-all",children:a.jsx(A0,{})}),r||i?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"inv-iv3-cattree-iconbar-sep","aria-hidden":"true"}),r?a.jsx("button",{className:"inv-iv3-cattree-tool-btn",type:"button","aria-label":T(lt.treeNarrowPane,"Narrow category pane"),title:T(lt.treeNarrowPane,"Narrow category pane"),onClick:r,disabled:u,"data-testid":"itemsv3-cattree-pane-narrow",children:a.jsx(x0,{})}):null,i?a.jsx("button",{className:"inv-iv3-cattree-tool-btn",type:"button","aria-label":T(lt.treeFitPane,"Fit pane to expanded tree"),title:T(lt.treeFitPane,"Fit pane to expanded tree"),onClick:i,disabled:v,"data-testid":"itemsv3-cattree-pane-fit",children:a.jsx(C0,{})}):null]}):null,h?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"inv-iv3-cattree-iconbar-sep","aria-hidden":"true"}),a.jsx("button",{className:"inv-iv3-cattree-tool-btn",type:"button","aria-label":T(lt.navModeNavigator,"Category navigator"),title:T(lt.navModeNavigator,"Category navigator"),onClick:h,"data-testid":"itemsv3-cattree-to-navigator",children:a.jsx(S0,{})})]}):null]})}const I0=new Set(["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Home","End"]);function bj({loading:e=!1,error:n="",rows:r=[],hasCategories:i=!1,totalItemCount:o=0,allRowKey:d=g0,selectedCategoryKey:u=d,countsByCategoryUid:v={},unclassifiedLabel:h="Unclassified",favoriteCategoryUids:m=new Set,favoriteEntries:g=[],pinnedEntries:b=[],searchValue:j="",onSearchChange:C,iconBar:k=null,bodyContent:x=null,panelRef:S,labelMode:T="name",showAllCategoriesRow:I=!0,showRowFavorite:E=!0,searchPlaceholder:L="",searchAriaLabel:P="",controlsAriaLabel:N="",searchTrailingSlot:R=null,paneAriaLabel:z="",loadingLabel:ne="",emptyLabel:ye="",emptySearchLabel:J="",onToggleFavorite:re,onSelectCategory:oe,onToggleBranch:fe,tItems:de=Rc}){const G=u===d,Q=Ly(b).filter(_=>Ps(_?.id)&&_?.label!==null&&_?.label!==void 0),W=T==="code";function pe(_,K){if((_.key==="f"||_.key==="F")&&K){_.preventDefault(),re?.(K.categoryUid);return}if(!I0.has(_.key))return;const ee=_.currentTarget.closest('[data-testid="itemsv3-category-tree"]');if(!ee)return;_.preventDefault(),_.stopPropagation();const ve=Array.from(ee.querySelectorAll("[data-tree-entry]")),se=ve.indexOf(_.currentTarget),Z=w=>{const F=ve[Math.max(0,Math.min(ve.length-1,w))];F&&F.focus()};if(_.key==="ArrowDown")return Z(se+1);if(_.key==="ArrowUp")return Z(se-1);if(_.key==="Home")return Z(0);if(_.key==="End")return Z(ve.length-1);if(!K)return;if(_.key==="ArrowRight"){if(K.hasChildren&&!K.isExpanded){fe?.(K.categoryUid);return}K.hasChildren&&K.isExpanded&&Z(se+1);return}if(K.hasChildren&&K.isExpanded){fe?.(K.categoryUid);return}const ae=Ps(K.category?.parentCategoryUid);if(!ae)return;const ce=ve.find(w=>w.getAttribute("data-category-uid")===ae);ce&&ce.focus()}function ke(_,K){const ee=Ps(_?.id);if(!ee)return null;const ve=String(_?.label??ee),se=Ps(_?.meta),Z=_?.count??_?.badge,ae=Z!=null&&Z!=="",ce=_?.active??ee===u,w=_?.testId||`itemsv3-cattree-pinned-${ee}`;return a.jsxs("div",{className:Ea("cat-wb-tree-row is-leaf inv-iv3-cattree-allrow inv-iv3-cattree-pinnedrow",ce&&"active is-root",_?.className),"data-testid":`${w}-row`,children:[a.jsx("span",{className:"cat-wb-tree-toggle-spacer inv-iv3-cattree-allicon","aria-hidden":"true",children:_?.icon??a.jsx(_y,{size:13})}),a.jsxs("button",{className:Ea("cat-wb-tree-entry",ce&&"active is-root"),type:"button",title:_?.title||ve,"aria-label":_?.ariaLabel||ve,onClick:()=>_?.onSelect?_.onSelect(ee):oe?.(ee),onKeyDown:F=>pe(F,null),"data-tree-entry":"true","data-category-uid":ee,"data-testid":w,children:[a.jsxs("span",{className:"cat-wb-tree-copy",children:[a.jsx("span",{className:"cat-wb-tree-title-row",children:a.jsx("span",{className:"cat-wb-tree-title",children:ve})}),se?a.jsx("span",{className:"cat-wb-tree-meta",children:se}):null]}),ae?a.jsx("span",{className:"cat-wb-tree-count",title:_?.countTitle||String(Z),children:Z}):null]})]},`${ee}-${K}`)}let O=null;return e&&!i?O=a.jsx("p",{className:"inv-iv3-cattree-empty",children:ne||de(lt.treeLoading,"Loading categories…")}):n&&!i?O=a.jsx("p",{className:"inv-iv3-cattree-empty is-error",children:n}):r.length?O=a.jsx("div",{className:"cat-wb-tree-panel",children:r.map(_=>{const K=_.categoryUid===u,ee=_.depth===0,ve=_.pathLabel||Ps(_.label)||_.categoryUid||h,se=Ps(_.category?.groupCode)||_.categoryUid,Z=W?se:ve,ae=W?ve:_.categoryUid,ce=Ly(_.metaLines).map(B=>Ps(B)).filter(Boolean),w=[Z,_.hideDefaultMeta?"":ae,...ce].filter(Boolean).join(" · "),F=v[_.categoryUid],X=Number(F?.total)||0,D=m.has(_.categoryUid);return a.jsxs("div",{className:Ea("cat-wb-tree-row",K&&"active",ee&&"is-root",!_.hasChildren&&"is-leaf"),"data-testid":`itemsv3-cattree-row-${_.categoryUid}`,children:[a.jsx("span",{className:"cat-wb-tree-indent","aria-hidden":"true",style:{width:`${_.depth*16}px`}}),_.hasChildren?a.jsx("button",{className:"cat-wb-tree-toggle",type:"button",tabIndex:-1,"aria-label":(_.isExpanded?de(lt.treeCollapseBranch,"Collapse {name}"):de(lt.treeExpandBranch,"Expand {name}")).replace("{name}",ve),"aria-expanded":_.isExpanded,onClick:()=>fe?.(_.categoryUid),children:_.isExpanded?a.jsx(b0,{size:12}):a.jsx(y0,{size:12})}):a.jsx("span",{className:"cat-wb-tree-toggle-spacer","aria-hidden":"true"}),a.jsxs("button",{className:Ea("cat-wb-tree-entry",K&&"active",ee&&"is-root"),type:"button",title:w,"aria-label":w||void 0,onClick:()=>oe?.(_.categoryUid),onKeyDown:B=>pe(B,_),"aria-expanded":_.hasChildren?_.isExpanded:void 0,"data-tree-entry":"true","data-category-uid":_.categoryUid,"data-testid":`itemsv3-cattree-entry-${_.categoryUid}`,children:[a.jsxs("span",{className:"cat-wb-tree-copy",children:[a.jsx("span",{className:"cat-wb-tree-title-row",children:a.jsx("span",{className:"cat-wb-tree-title",children:Z})}),_.hideDefaultMeta?null:a.jsx("span",{className:"cat-wb-tree-meta",children:ae}),ce.map((B,U)=>a.jsx("span",{className:"cat-wb-tree-meta cat-wb-tree-meta-extra",children:B},`${_.categoryUid}-meta-${U}`))]}),X>0?a.jsx("span",{className:"cat-wb-tree-count",title:de(lt.navigatorAllMeta,"{count} items").replace("{count}",String(X)),children:X}):null]}),E?a.jsx("button",{className:Ea("inv-iv3-cattree-fav",D&&"is-active"),type:"button",tabIndex:-1,"aria-label":(D?de(lt.treeFavRemove,"Remove {name} from favorites"):de(lt.treeFavAdd,"Add {name} to favorites")).replace("{name}",ve),title:(D?de(lt.treeFavRemove,"Remove {name} from favorites"):de(lt.treeFavAdd,"Add {name} to favorites")).replace("{name}",ve),"aria-pressed":D,"data-testid":`itemsv3-cattree-fav-${_.categoryUid}`,onClick:()=>re?.(_.categoryUid),children:a.jsx(Oy,{filled:D})}):null]},_.categoryUid)})}):O=a.jsx("p",{className:"inv-iv3-cattree-empty",children:i?J||de(lt.navigatorEmptySearch,"No matching categories."):ye||de(lt.treeEmpty,"No categories defined yet.")}),a.jsxs("aside",{ref:S,className:"inv-iv3-cattree-pane","aria-label":z||de(lt.treePaneAria,"Category tree"),"data-testid":"itemsv3-category-tree",children:[a.jsxs("div",{className:"inv-iv3-cattree-toolrow",children:[a.jsx(N0,{searchValue:j,onSearchChange:C,searchPlaceholder:L,searchAriaLabel:P,controlsAriaLabel:N,searchTrailingSlot:R,tItems:de}),k]}),a.jsx("div",{className:"inv-iv3-cattree-body",children:x??a.jsxs(a.Fragment,{children:[I?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:Ea("cat-wb-tree-row is-leaf inv-iv3-cattree-allrow",G&&"active is-root"),children:[a.jsx("span",{className:"cat-wb-tree-toggle-spacer inv-iv3-cattree-allicon","aria-hidden":"true",children:a.jsx(_y,{size:13})}),a.jsxs("button",{className:Ea("cat-wb-tree-entry",G&&"active is-root"),type:"button",onClick:()=>oe?.(d),onKeyDown:_=>pe(_,null),"data-tree-entry":"true","data-testid":"itemsv3-cattree-all",children:[a.jsx("span",{className:"cat-wb-tree-copy",children:a.jsx("span",{className:"cat-wb-tree-title-row",children:a.jsx("span",{className:"cat-wb-tree-title",children:de(lt.navigatorAllCategories,"All categories")})})}),o>0?a.jsx("span",{className:"cat-wb-tree-count",title:de(lt.navigatorAllMeta,"{count} items").replace("{count}",String(o)),children:o}):null]})]}),a.jsx("div",{className:"inv-iv3-cattree-divider","aria-hidden":"true"})]}):null,Q.length>0?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"inv-iv3-cattree-pinned",role:"group","aria-label":de(lt.treePaneAria,"Category tree"),"data-testid":"itemsv3-cattree-pinned",children:Q.map(ke)}),a.jsx("div",{className:"inv-iv3-cattree-divider","aria-hidden":"true"})]}):null,g.length>0?a.jsx("div",{className:"inv-iv3-cattree-favs",role:"group","aria-label":de(lt.treeFavGroupAria,"Favorite categories"),"data-testid":"itemsv3-cattree-favs",children:g.map(_=>a.jsxs("button",{className:Ea("inv-iv3-cattree-fav-chip",_.categoryUid===u&&"is-active"),type:"button",title:_.pathText||_.categoryUid,"data-testid":`itemsv3-cattree-favchip-${_.categoryUid}`,onClick:()=>oe?.(_.categoryUid),children:[a.jsx(Oy,{filled:!0,size:10}),a.jsx("span",{children:_.label})]},_.categoryUid))}):null,O]})})]})}const Qy={narrow:340,medium:408,wide:476},cl="__all_projects__",Uy="__custom_scope__",zr="__no_projects__",We=(...e)=>e.filter(Boolean).join(" "),Yp=e=>e!=null,Py=(e,n)=>{e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),n())},xl="xf-project-scope:recent-projects-change",Cl="xf-project-scope:favorite-projects-change",E0="xf-project-scope:collapsed-projects-change",M0=({crossed:e=!1})=>a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M2 12s3.8-6 10-6 10 6 10 6-3.8 6-10 6-10-6-10-6Z"}),a.jsx("circle",{cx:"12",cy:"12",r:"2.6"}),e?a.jsx("path",{d:"M4 4 20 20"}):null]}),Bh=()=>a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M6 6 18 18"}),a.jsx("path",{d:"M18 6 6 18"})]}),T0=()=>a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M15 3v5l3 3H6l3-3V3h6z"}),a.jsx("path",{d:"M12 11v10"})]}),B0=()=>a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"11",cy:"11",r:"6.5"}),a.jsx("path",{d:"m16 16 4.5 4.5"})]}),D0=()=>a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M6 7h12"}),a.jsx("path",{d:"M6 17h12"}),a.jsx("path",{d:"m8 13 4-4 4 4"})]}),R0=()=>a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2.4"})}),Jp=({filled:e=!1})=>a.jsx("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"m12 3.8 2.63 5.34 5.89.86-4.26 4.15 1 5.85L12 17.22 6.74 20l1-5.85-4.26-4.15 5.89-.86L12 3.8Z"})}),Dh=(e=[])=>{const n=new Set;return(Array.isArray(e)?e:[]).map(r=>{const i=typeof r?.id=="string"?r.id.trim():"",o=typeof r?.name=="string"&&r.name.trim()?r.name.trim():typeof r?.slug=="string"&&r.slug.trim()?r.slug.trim():i,d=typeof r?.slug=="string"?r.slug.trim():"",u=typeof r?.meta=="string"&&r.meta.trim()?r.meta.trim():typeof r?.description=="string"&&r.description.trim()?r.description.trim():d||i,v=typeof r?.sideLabel=="string"?r.sideLabel.trim():"",h=typeof r?.parentId=="string"?r.parentId.trim():"",m=Math.max(0,Number.isFinite(r?.depth)?Math.trunc(r.depth):h?1:0),g=typeof r?.keywords=="string"&&r.keywords.trim()?r.keywords.trim():"";return{id:i,name:o,slug:d,meta:u,sideLabel:v,parentId:h,depth:m,keywords:g}}).filter(r=>r.id&&!n.has(r.id)&&n.add(r.id))},Xp=(e=[])=>(Array.isArray(e)?e:[]).map(n=>typeof n=="string"?n.trim():"").filter(Boolean),$r=(e=[],n=[])=>e.length===n.length&&e.every((r,i)=>r===n[i]),jj=(e="",n=null)=>{if(!e||typeof window>"u")return[];try{const r=window.localStorage.getItem(e),i=r?JSON.parse(r):[],o=(Array.isArray(i)?i:[]).map(d=>typeof d=="string"?d.trim():"").filter(Boolean);return typeof n=="number"&&Number.isFinite(n)?o.slice(0,Math.max(1,n)):o}catch{return[]}},bc=(e="",n=5)=>jj(e,n),jc=(e="")=>jj(e,null),L0=(e="")=>{if(!e||typeof window>"u")return null;try{const n=window.localStorage.getItem(e);if(n==null)return null;const r=JSON.parse(n);return Array.isArray(r)?r.map(i=>typeof i=="string"?i.trim():"").filter(Boolean):null}catch{return null}},Rh=(e="",n=[],r="",i=null)=>{if(!e||typeof window>"u")return;let o=(Array.isArray(n)?n:[]).map(d=>typeof d=="string"?d.trim():"").filter(Boolean);typeof i=="number"&&Number.isFinite(i)&&(o=o.slice(0,Math.max(1,i)));try{window.localStorage.setItem(e,JSON.stringify(o))}catch{}try{window.dispatchEvent(new CustomEvent(r,{detail:{storageKey:e,projectIds:o}}))}catch{}},Aj=(e="",n=[],r=5)=>Rh(e,n,xl,r),xj=(e="",n=[])=>Rh(e,n,Cl,null),O0=(e="",n=[])=>Rh(e,n,E0,null),Cj=(e,n)=>{const r=e.length,i=e.filter(d=>n.includes(d.id)),o=i.length;if(r===0)return{mode:"empty",activeKey:cl,summary:"No projects",detail:"Load project records to scope project-aware workbenches.",totalProjects:r,selectedCount:o};if(n.includes(zr))return{mode:"none",activeKey:zr,summary:"No projects",detail:"No projects are active in this view.",totalProjects:r,selectedCount:0};if(n.length===0)return{mode:"all",activeKey:cl,summary:"All projects",detail:`${r} projects are active in this view.`,totalProjects:r,selectedCount:r};if(o===1){const d=i[0];return{mode:"single",activeKey:d.id,summary:d.name||d.id,detail:d.slug?`Scoped to ${d.slug}`:"Scoped to one project",totalProjects:r,selectedCount:o}}return o===0?{mode:"missing",activeKey:Uy,summary:`${n.length} selected ids`,detail:"Current scope does not expose those project records.",totalProjects:r,selectedCount:o}:{mode:"custom",activeKey:Uy,summary:"Custom scope",detail:`${o} projects remain active in this view.`,totalProjects:r,selectedCount:o}},_0=({selectionState:e,filterCount:n,filterLabel:r})=>{const i=[];return e.mode==="none"?i.push("No projects"):e.mode==="all"?i.push("All active"):e.selectedCount>0?i.push(`${e.selectedCount} scoped`):e.totalProjects>0&&i.push("Project scope"),n>0?i.push(`${n} active ${n===1?r:`${r}s`}`):i.push(`No extra ${r.toLowerCase()}`),i};function kj({className:e="",launcherClassName:n="",mainClassName:r="",actionClassName:i="",launcher:o=null,main:d=null,action:u=null,alignToSelector:v="",alignWhen:h=!1}){return a.jsxs("div",{className:We("xf-workbench-thinbar",e),"data-align-when":h?"true":"false","data-align-selector":v||void 0,children:[a.jsx("div",{className:We("xf-workbench-thinbar-launcher",n),children:o}),a.jsx("div",{className:We("xf-workbench-thinbar-main",r),children:d}),u?a.jsx("div",{className:We("xf-workbench-thinbar-action",i),children:u}):null]})}function Q0({isOpen:e=!1,onOpenChange:n=null,pinned:r=!1,showPanelWhenPinned:i=!0,onPinnedChange:o=null,launcherLabel:d="Open panel",launcherIcon:u=null,triggerContent:v=null,triggerVariant:h="icon",panelTitle:m="Workbench panel",panelSize:g="medium",panelWidth:b=null,label:j="Workbench panel",subtitle:C=null,showHeader:k=!0,closeIcon:x=null,pinIcon:S=null,headerActions:T=null,showBackdropWhenOpen:I=!1,pinnedOffsetTop:E=72,pinnedOffsetLeft:L=24,showEdgeTab:P=!1,edgeAutoHideStorageKey:N="",edgeLauncherLabel:R="Toggle panel",triggerClassName:z="",panelClassName:ne="",panelShellClassName:ye="",panelHeaderClassName:J="",panelBodyClassName:re="",edgeClassName:oe="",children:fe=null}){const de=y.useRef(null),G=y.useRef(null),Q=y.useRef(null),[W,pe]=y.useState(()=>{if(!N||typeof window>"u")return!1;try{return window.localStorage.getItem(N)==="1"}catch{return!1}}),[ke,O]=y.useState(!1),[_,K]=y.useState(!1),ee=e&&(!r||i),ve=e&&!r&&I,se=!W||ke||_,Z=typeof b=="number"&&Number.isFinite(b)&&b>0?b:Qy[g||"medium"]??Qy.medium,ae=typeof document<"u"?document.querySelector(".shell-workbench-dock-portal-target"):null,ce=typeof document<"u"?ae??document.querySelector(".app[data-theme], .chat-standalone-root[data-theme], .chat-standalone-root, .app")??document.body:null,w=!!(ce&&ce instanceof Element&&ce.closest(".shell-workbench-dock-host")),F=e?`Hide ${j.toLowerCase()}`:d,X=v??(h==="icon"?u:a.jsx("span",{className:"xf-workbench-launcher-trigger-copy",children:u}));y.useEffect(()=>{if(!e||r||typeof document>"u")return;const U=H=>{G.current?.contains(H.target)||de.current?.contains(H.target)||n?.(!1)};return document.addEventListener("pointerdown",U),()=>document.removeEventListener("pointerdown",U)},[e,n,r]),y.useEffect(()=>{if(!e||typeof document>"u")return;const U=H=>{H.key==="Escape"&&n?.(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[e,n]),y.useEffect(()=>{if(!(!P||!N||typeof window>"u"))try{window.localStorage.setItem(N,W?"1":"0")}catch{}},[W,N,P]),y.useEffect(()=>{if(typeof window>"u"||!P||!W){O(!1);return}let U=0;const H=24,q=be=>{const ge=Q.current,Se=ge?Number.parseFloat(window.getComputedStyle(ge).left||"0"):0,Ne=(Number.isFinite(Se)?Se:0)+H,we=be.clientX<=Ne;U&&window.cancelAnimationFrame(U),U=window.requestAnimationFrame(()=>{O(Be=>Be===we?Be:we)})},V=()=>O(!1);return window.addEventListener("mousemove",q),window.addEventListener("mouseleave",V),()=>{U&&window.cancelAnimationFrame(U),window.removeEventListener("mousemove",q),window.removeEventListener("mouseleave",V)}},[W,P]);const D=a.jsx("div",{ref:G,className:We("xf-workbench-launcher-panel",`is-size-${g}`,r&&"is-pinned",w&&"is-shell-dock-positioned",ne),style:{"--xf-workbench-launcher-left":`${L}px`,"--xf-workbench-launcher-top":`${E}px`,"--xf-workbench-launcher-top-adjust":"0px","--xf-workbench-launcher-width":`${Z}px`},role:"dialog","aria-modal":r?void 0:!0,"aria-label":m,children:a.jsx(Sj,{variant:"panel",panelTitle:m,label:j,subtitle:C,showHeader:k,pinned:r,onPinnedChange:o,onOpenChange:n,closeIcon:x,pinIcon:S,headerActions:T,shellClassName:ye,headerClassName:J,bodyClassName:re,children:fe})}),B=P&&ce?Yr.createPortal(a.jsxs("div",{ref:Q,className:We("xf-workbench-launcher-edge",W&&"auto-hide",se&&"revealed",oe),role:"toolbar","aria-label":`${j} controls`,onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),children:[a.jsx("button",{className:We("xf-workbench-launcher-edge-button",(e||r)&&"active"),type:"button",onClick:()=>n?.(!e),"aria-label":R,title:R,"aria-pressed":e,children:u}),a.jsx("button",{className:We("xf-workbench-launcher-edge-button",W&&"active"),type:"button",onClick:()=>pe(U=>!U),"aria-label":W?"Disable edge auto hide":"Enable edge auto hide",title:W?"Disable edge auto hide":"Enable edge auto hide","aria-pressed":W,children:a.jsx(M0,{crossed:W})})]}),ce):null;return a.jsxs(a.Fragment,{children:[a.jsx("button",{ref:de,className:We("xf-workbench-launcher-trigger",h==="card"&&"is-card",e&&"is-open",r&&"is-pinned",z),type:"button",onClick:()=>n?.(!e),"aria-label":F,title:F,"aria-expanded":e,"aria-haspopup":"dialog",children:X}),B,ee&&ce?Yr.createPortal(a.jsxs(a.Fragment,{children:[ve?a.jsx("div",{className:"xf-workbench-launcher-backdrop","aria-hidden":"true",onClick:()=>n?.(!1)}):null,D]}),ce):null]})}function U0({pinned:e=!1,onPinnedChange:n=null,onOpenChange:r=null,panelTitle:i="Workbench panel",label:o="Workbench panel",subtitle:d=null,showHeader:u=!0,closeIcon:v=null,pinIcon:h=null,headerActions:m=null,className:g="",shellClassName:b="",headerClassName:j="",bodyClassName:C="",children:k=null}){return a.jsx("aside",{className:We("xf-workbench-launcher-dock",g),role:"complementary","aria-label":i,children:a.jsx(Sj,{variant:"dock",panelTitle:i,label:o,subtitle:d,showHeader:u,pinned:e,onPinnedChange:n,onOpenChange:r,closeIcon:v,pinIcon:h,headerActions:m,shellClassName:b,headerClassName:j,bodyClassName:C,children:k})})}function Sj({variant:e,panelTitle:n,label:r,subtitle:i=null,showHeader:o=!0,pinned:d=!1,onPinnedChange:u=null,onOpenChange:v=null,closeIcon:h=null,pinIcon:m=null,headerActions:g=null,shellClassName:b="",headerClassName:j="",bodyClassName:C="",children:k=null}){const x=e==="dock"?"xf-workbench-launcher-dock-shell":"xf-workbench-launcher-panel-shell",S=e==="dock"?"xf-workbench-launcher-dock-header":"xf-workbench-launcher-panel-header",T=e==="dock"?"xf-workbench-launcher-dock-header-copy":"xf-workbench-launcher-panel-header-copy",I=e==="dock"?"xf-workbench-launcher-dock-eyebrow":"xf-workbench-launcher-panel-eyebrow",E=e==="dock"?"xf-workbench-launcher-dock-title":"xf-workbench-launcher-panel-title",L=e==="dock"?"xf-workbench-launcher-dock-subtitle":"xf-workbench-launcher-panel-subtitle",P=e==="dock"?"xf-workbench-launcher-dock-actions":"xf-workbench-launcher-panel-actions",N=e==="dock"?"xf-workbench-launcher-dock-pin":"xf-workbench-launcher-panel-pin",R=e==="dock"?"xf-workbench-launcher-dock-body":"xf-workbench-launcher-panel-body";return a.jsxs("div",{className:We("xf-workbench-launcher-surface-shell",x,b,!o&&"is-headerless"),children:[o?a.jsxs("header",{className:We("xf-workbench-launcher-surface-header",S,j),children:[a.jsxs("div",{className:We("xf-workbench-launcher-surface-header-copy",T),children:[a.jsx("p",{className:We("xf-workbench-launcher-surface-eyebrow",I),children:r}),a.jsx("h3",{className:We("xf-workbench-launcher-surface-title",E),children:n}),i?a.jsx("p",{className:We("xf-workbench-launcher-surface-subtitle",L),children:i}):null]}),a.jsxs("div",{className:We("xf-workbench-launcher-surface-actions",P),children:[g,typeof u=="function"?a.jsx("button",{className:We("mini-button ghost icon-only xf-workbench-launcher-surface-pin",N,d&&"active"),type:"button",onClick:()=>u(!d),"aria-label":d?`Unpin ${r.toLowerCase()}`:`Pin ${r.toLowerCase()}`,title:d?`Unpin ${r.toLowerCase()}`:`Pin ${r.toLowerCase()}`,"aria-pressed":d,children:m??a.jsx(T0,{})}):null,a.jsx("button",{className:"mini-button ghost icon-only",type:"button",onClick:()=>v?.(!1),"aria-label":`Close ${r.toLowerCase()}`,title:`Close ${r.toLowerCase()}`,children:h??a.jsx(Bh,{})})]})]}):null,a.jsx("div",{className:We("xf-workbench-launcher-surface-body",R,C),children:k})]})}function P0({title:e,description:n="",defaultOpen:r=!1,badge:i="",children:o=null}){const[d,u]=y.useState(r);return a.jsxs("section",{className:"xf-project-scope-section",children:[a.jsxs("button",{className:We("xf-project-scope-section-toggle",d&&"is-open"),type:"button",onClick:()=>u(v=>!v),"aria-expanded":d,children:[a.jsxs("span",{className:"xf-project-scope-section-copy",children:[a.jsx("span",{className:"xf-project-scope-section-title",children:e}),n?a.jsx("span",{className:"xf-project-scope-section-description",children:n}):null]}),a.jsxs("span",{className:"xf-project-scope-section-side",children:[i?a.jsx("span",{className:"xf-project-scope-section-badge",children:i}):null,a.jsx("span",{className:"xf-project-scope-section-chevron","aria-hidden":"true",children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),d?a.jsx("div",{className:"xf-project-scope-section-body",children:o}):null]})}function wj({mode:e="single",title:n="Projects",description:r="Choose the active project context for this workbench.",defaultOpen:i=!0,chrome:o="accordion",showAllProjectsRow:d=!0,favoriteProjectStorageKey:u="",projectItems:v=[],selectedProjectIds:h=[],onSelectionChange:m=null,searchPlaceholder:g="Search projects...",searchTrailingAction:b=null,showCollapseAllAction:j=!1,collapseAllLabel:C="Collapse all",showClearSelectionAction:k=!1,clearSelectionLabel:x="Clear selection",emptySearchMessage:S="No matching projects.",selectAllLabel:T="Check all",clearLabel:I="Uncheck all",allProjectsLabel:E="All projects",allProjectsDescription:L="Browse the full project-scoped catalog.",singleNoteAll:P="All projects stay active. Pick one project to narrow the current workbench.",singleNoteSelected:N="One project is actively scoped.",singleNoteCustom:R="",singleNoteEmpty:z="No project records are available yet.",singleNoteMissing:ne="The current selection references projects outside the loaded catalog.",multiNoteAll:ye="No explicit project filter. All workspace projects stay active.",multiNoteSingle:J="One project stays active in the current scope.",multiNoteCustom:re="",multiNoteEmpty:oe="No project scopes are available for this workspace.",defaultGroupsCollapsed:fe=!1,collapsedProjectStorageKey:de=""}){const[G,Q]=y.useState(""),W=y.useMemo(()=>Dh(v),[v]),[pe,ke]=y.useState(()=>jc(u)),O=y.useRef(typeof window>"u"?null:L0(de)),[_,K]=y.useState(()=>O.current||[]),ee=(O.current?.length??0)>0,ve=y.useRef(!fe||ee),se=y.useMemo(()=>Xp(h),[h]),Z=se.includes(zr),ae=y.useMemo(()=>se.filter(he=>he!==zr),[se]),ce=y.useMemo(()=>Cj(W,se),[W,se]),w=y.useMemo(()=>{if(W.some(Qe=>Qe.depth>0||Qe.parentId)||pe.length===0)return W;const De=new Map(pe.map((Qe,He)=>[Qe,He]));return[...W].sort((Qe,He)=>{const jt=De.get(Qe.id),Ie=De.get(He.id),rt=typeof jt=="number",sa=typeof Ie=="number";return rt&&sa?jt-Ie:rt?-1:sa?1:0})},[pe,W]),F=y.useMemo(()=>{const he=new Map(w.map(He=>[He.id,He])),De=new Map,Qe=new Map;return w.forEach(He=>{if(!He.parentId||!he.has(He.parentId))return;const jt=De.get(He.parentId)||[];jt.push(He.id),De.set(He.parentId,jt),Qe.set(He.parentId,(Qe.get(He.parentId)||0)+1)}),{childIdsById:De,childCountById:Qe,hasHierarchy:Qe.size>0,projectById:he}},[w]),X=y.useMemo(()=>{const he=new Set,De=se.length===1?F.projectById.get(se[0]):null;if(!De)return he;let Qe=De.parentId||"";for(;Qe;)he.add(Qe),Qe=(F.projectById.get(Qe)||null)?.parentId||"";return he},[se,F.projectById]),D=y.useMemo(()=>{if(!fe||ve.current||F.childCountById.size===0)return _;const he=Array.from(F.childCountById.keys());return X.size===0?he:he.filter(De=>!X.has(De))},[X,_,fe,F.childCountById]),B=y.useMemo(()=>new Set(D),[D]),U=y.useMemo(()=>{const he=G.trim().toLowerCase(),{childCountById:De,hasHierarchy:Qe,projectById:He}=F,jt=Rt=>`${Rt.name} ${Rt.slug} ${Rt.meta} ${Rt.sideLabel} ${Rt.keywords} ${Rt.id}`.toLowerCase().includes(he);if(!he)return!Qe||B.size===0?w:w.filter(Rt=>{let Aa=Rt.parentId;for(;Aa;){if(B.has(Aa))return!1;Aa=(He.get(Aa)||null)?.parentId||""}return!0});if(!Qe)return w.filter(jt);const Ie=new Set,rt=(Rt="")=>{let Aa=He.get(Rt)||null;for(;Aa?.parentId;)Ie.add(Aa.parentId),Aa=He.get(Aa.parentId)||null},sa=(Rt="")=>{(F.childIdsById.get(Rt)||[]).forEach(As=>{Ie.has(As)||(Ie.add(As),sa(As))})};return w.forEach(Rt=>{jt(Rt)&&(Ie.add(Rt.id),rt(Rt.id),sa(Rt.id))}),w.filter(Rt=>Ie.has(Rt.id))},[B,w,F,G]),H=y.useMemo(()=>W.map(he=>he.id),[W]),q=y.useMemo(()=>Z?[]:ae.length>0?ae:H,[H,Z,ae]),V=y.useMemo(()=>new Set(q),[q]),be=y.useMemo(()=>U.map(he=>he.id),[U]),ge=y.useMemo(()=>new Set(be),[be]),Se=Z?"0":ae.length>0?`${ae.length}`:`${W.length}`,Ne=he=>{if(typeof m!="function")return;const De=Xp(he).filter(Qe=>Qe!==zr);if(De.length===0){m([zr]);return}if(De.length>=W.length){m([]);return}m(De)},we=he=>{if(!(typeof m!="function"||!he)){if(Z){m([he]);return}if(ae.length===0){m(W.map(De=>De.id).filter(De=>De!==he));return}if(ae.includes(he)){Ne(ae.filter(De=>De!==he));return}Ne([...ae,he])}},Be=()=>{const he=new Set(q);be.forEach(De=>he.add(De)),Ne(Array.from(he))},Je=()=>{const he=q.filter(De=>!ge.has(De));Ne(he)},Ke=be.length>0&&be.some(he=>!V.has(he)),Xe=be.length>0&&be.some(he=>V.has(he)),Et=y.useMemo(()=>Array.from(F.childCountById.keys()),[F.childCountById]),vt=Et.length>0&&Et.every(he=>B.has(he)),Ee=ae.length>0||Z,Le=j,xe=k,Te=(Le?1:0)+(xe?1:0)+(b?1:0),Me=Te>0?{"--xf-project-scope-search-trailing-width":`${Te*32}px`}:void 0,Fe=(he="")=>{const De=typeof he=="string"?he.trim():"";De&&K(Qe=>Qe.includes(De)?Qe.filter(He=>He!==De):[...Qe,De])},ze=()=>{Et.length!==0&&K(Et)},Mt=()=>{typeof m=="function"&&m([])},ca=(he="")=>{const De=typeof he=="string"?he.trim():"";De&&ke(Qe=>Qe.includes(De)?Qe.filter(He=>He!==De):[De,...Qe.filter(He=>He!==De)])},Ct=he=>{const De=F.childCountById.get(he.id)||0,Qe=De>0,He=Qe&&B.has(he.id);return{childCount:De,hasChildren:Qe,isCollapsed:He}},ut=(he,De,Qe)=>De?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"xf-project-scope-project-row-toggle",type:"button",onClick:He=>{He.preventDefault(),He.stopPropagation(),Fe(he.id)},"aria-label":`${Qe?"Expand":"Collapse"} ${he.name}`,"aria-expanded":!Qe,title:`${Qe?"Expand":"Collapse"} ${he.name}`,children:a.jsx(Nj,{})}),a.jsx("span",{className:"xf-project-scope-project-row-glyph","aria-hidden":"true",children:a.jsx(z0,{})})]}):null;y.useEffect(()=>{u&&xj(u,pe)},[pe,u]),y.useEffect(()=>{F.childCountById.size!==0&&K(he=>{const De=he.filter(Qe=>F.childCountById.has(Qe));return De.length===he.length?he:De})},[F.childCountById]),y.useEffect(()=>{if(!fe||ve.current||F.childCountById.size===0)return;ve.current=!0;const he=Array.from(F.childCountById.keys()),De=X.size===0?he:he.filter(Qe=>!X.has(Qe));K(De)},[fe,F.childCountById,X]);const Jt=y.useRef(!0);y.useEffect(()=>{if(de){if(Jt.current){Jt.current=!1;return}O0(de,_)}},[_,de]),y.useEffect(()=>{if(!u||typeof window>"u")return;const he=De=>{const Qe=De instanceof CustomEvent&&De.detail&&typeof De.detail=="object"?De.detail:{};if(Qe.storageKey!==u)return;const He=Array.isArray(Qe.projectIds)?Qe.projectIds.map(jt=>typeof jt=="string"?jt.trim():"").filter(Boolean):jc(u);ke(jt=>$r(jt,He)?jt:He)};return window.addEventListener(Cl,he),()=>{window.removeEventListener(Cl,he)}},[u]);const _t=a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:We("xf-project-scope-search",Te>0&&"has-trailing-action",!!G&&"has-clear-action"),style:Me,children:[a.jsx("span",{className:"xf-project-scope-search-icon","aria-hidden":"true",children:a.jsx(B0,{})}),a.jsx("input",{type:"text",value:G,onChange:he=>Q(he.target.value),placeholder:g,"aria-label":g||"Search projects"}),G?a.jsx("button",{className:"xf-project-scope-search-clear",type:"button",onClick:()=>Q(""),"aria-label":"Clear search",title:"Clear search",children:a.jsx(Bh,{})}):null,Te>0?a.jsxs("span",{className:"xf-project-scope-search-trailing-action",role:"group","aria-label":"Navigator search actions",children:[Le?a.jsx("button",{className:"xf-project-scope-search-action-button",type:"button",onClick:ze,disabled:Et.length===0||vt,"aria-label":C,title:C,children:a.jsx(D0,{})}):null,xe?a.jsx("button",{className:"xf-project-scope-search-action-button",type:"button",onClick:Mt,disabled:!Ee,"aria-label":x,title:x,children:a.jsx(R0,{})}):null,b]}):null]}),e==="multi"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"xf-project-scope-bulk-actions",role:"group","aria-label":"Project selection actions",children:[a.jsx("button",{className:"xf-project-scope-bulk-button",type:"button",onClick:Be,disabled:!Ke,children:T}),a.jsx("button",{className:"xf-project-scope-bulk-button",type:"button",onClick:Je,disabled:!Xe,title:"Removes the visible projects from the current selection.",children:I})]}),a.jsx("div",{className:"xf-project-scope-project-list xf-project-scope-project-list--checkbox",role:"group","aria-label":n||"Projects",children:U.length===0?a.jsx("div",{className:"xf-project-scope-empty",children:S}):U.map(he=>{const De=se.length===0||se.includes(he.id),{hasChildren:Qe,isCollapsed:He}=Ct(he);return a.jsxs("label",{className:We("xf-project-scope-project-row","xf-project-scope-project-row--checkbox",De&&"is-active",Qe&&"has-children",He&&"is-collapsed"),"data-project-depth":he.depth||0,"data-project-parent":he.parentId||void 0,"data-project-collapsed":Qe?He?"true":"false":void 0,children:[a.jsx("span",{className:"xf-project-scope-project-row-checkbox",children:a.jsx("input",{type:"checkbox",checked:De,onChange:()=>we(he.id),"aria-label":`Toggle ${he.name}`})}),ut(he,Qe,He),a.jsxs("span",{className:"xf-project-scope-project-row-copy",children:[a.jsx("span",{className:"xf-project-scope-project-row-line",children:a.jsx("span",{className:"xf-project-scope-project-row-title",children:he.name})}),he.meta&&String(he.meta).trim()?a.jsx("span",{className:"xf-project-scope-project-row-meta",children:he.meta}):null]}),he.sideLabel?a.jsx("span",{className:"xf-project-scope-project-row-side",children:he.sideLabel}):null,a.jsx("button",{className:We("xf-project-scope-favorite-button",pe.includes(he.id)&&"is-active"),type:"button",onClick:jt=>{jt.preventDefault(),jt.stopPropagation(),ca(he.id)},"aria-label":pe.includes(he.id)?`Remove ${he.name} from favorites`:`Add ${he.name} to favorites`,title:pe.includes(he.id)?`Remove ${he.name} from favorites`:`Add ${he.name} to favorites`,children:a.jsx(Jp,{filled:pe.includes(he.id)})})]},he.id)})})]}):a.jsx(a.Fragment,{children:a.jsxs("div",{className:"xf-project-scope-project-list",role:"listbox","aria-label":n||"Projects",children:[d?a.jsxs("div",{className:We("xf-project-scope-project-row",ce.activeKey===cl&&"is-active"),role:"option",tabIndex:ce.activeKey===cl?0:-1,onClick:()=>m?.([]),onKeyDown:he=>Py(he,()=>m?.([])),"aria-selected":ce.activeKey===cl,children:[a.jsx("span",{className:"xf-project-scope-project-row-copy",children:a.jsxs("span",{className:"xf-project-scope-project-row-line",children:[a.jsx("span",{className:"xf-project-scope-project-row-title",children:E}),a.jsx("span",{className:"xf-project-scope-project-row-meta",children:L})]})}),a.jsx("span",{className:"xf-project-scope-project-row-side",children:W.length})]}):null,U.length===0?a.jsx("div",{className:"xf-project-scope-empty",children:S}):U.map(he=>{const De=ce.activeKey===he.id,Qe=X.has(he.id),{hasChildren:He,isCollapsed:jt}=Ct(he);return a.jsxs("div",{className:We("xf-project-scope-project-row",De&&"is-active",Qe&&"is-active-ancestor",He&&"has-children",jt&&"is-collapsed"),"data-project-depth":he.depth||0,"data-project-parent":he.parentId||void 0,"data-project-collapsed":He?jt?"true":"false":void 0,onClick:()=>m?.([he.id]),onKeyDown:Ie=>Py(Ie,()=>m?.([he.id])),role:"option",tabIndex:De?0:-1,"aria-selected":De,children:[ut(he,He,jt),a.jsxs("span",{className:"xf-project-scope-project-row-copy",children:[a.jsx("span",{className:"xf-project-scope-project-row-line",children:a.jsx("span",{className:"xf-project-scope-project-row-title",children:he.name})}),he.meta&&String(he.meta).trim()?a.jsx("span",{className:"xf-project-scope-project-row-meta",children:he.meta}):null]}),he.sideLabel?a.jsx("span",{className:"xf-project-scope-project-row-side",children:he.sideLabel}):null,a.jsx("button",{className:We("xf-project-scope-favorite-button",pe.includes(he.id)&&"is-active"),type:"button",onClick:Ie=>{Ie.preventDefault(),Ie.stopPropagation(),ca(he.id)},"aria-label":pe.includes(he.id)?`Remove ${he.name} from favorites`:`Add ${he.name} to favorites`,title:pe.includes(he.id)?`Remove ${he.name} from favorites`:`Add ${he.name} to favorites`,children:a.jsx(Jp,{filled:pe.includes(he.id)})})]},he.id)})]})})]});return o==="flat"?a.jsx("div",{className:"xf-project-scope-project-section-flat",children:_t}):a.jsx(P0,{title:n,description:r,defaultOpen:i,badge:Se,children:_t})}function F0({isOpen:e=!1,onOpenChange:n=null,pinned:r=!1,showPanelWhenPinned:i=!0,onPinnedChange:o=null,launcherLabel:d="Open project scope",launcherIcon:u=null,triggerContent:v=null,triggerVariant:h="card",panelTitle:m="Project scope",panelSize:g="medium",panelWidth:b=null,label:j="Project scope",showHeader:C=!0,filterCount:k=0,filterLabel:x="filter",closeIcon:S=null,pinIcon:T=null,headerActions:I=null,projectItems:E=[],selectedProjectIds:L=[],onSelectionChange:P=null,selectionTitle:N="Projects",selectionDescription:R="Choose the active project context for this workbench.",searchPlaceholder:z="Search projects...",searchTrailingAction:ne=null,showCollapseAllAction:ye=!1,collapseAllLabel:J="Collapse all",showClearSelectionAction:re=!1,clearSelectionLabel:oe="Clear selection",showProjectSelection:fe=!0,projectSectionChrome:de="accordion",showAllProjectsRow:G=!0,showBackdropWhenOpen:Q=!1,pinnedOffsetTop:W=104,pinnedOffsetLeft:pe=24,showEdgeTab:ke=!1,edgeAutoHideStorageKey:O="",edgeLauncherLabel:_="Toggle project scope",recentProjectStorageKey:K="",favoriteProjectStorageKey:ee="",recentProjectsLabel:ve="Recent",maxRecentProjects:se=5,children:Z=null}){const ae=y.useRef(null),ce=y.useMemo(()=>Dh(E),[E]),w=y.useMemo(()=>Xp(L),[L]),F=y.useMemo(()=>Cj(ce,w),[ce,w]),X=y.useMemo(()=>_0({selectionState:F,filterCount:k,filterLabel:x}),[k,x,F]),[D,B]=y.useState(()=>{if(!O||typeof window>"u")return!1;try{return window.localStorage.getItem(O)==="1"}catch{return!1}}),[U,H]=y.useState(()=>bc(K,se)),q=w.length===1?ce.find(we=>we.id===w[0])??null:null,V=y.useMemo(()=>U.map(we=>ce.find(Be=>Be.id===we)??null).filter(Yp).slice(0,Math.max(1,se)),[se,ce,U]),be=h==="card"&&typeof P=="function"&&V.length>0,ge=e?"Hide project scope":d;y.useEffect(()=>{if(!(!ke||!O||typeof window>"u"))try{window.localStorage.setItem(O,D?"1":"0")}catch{}},[D,O,ke]),y.useEffect(()=>{if(!(!K||typeof window>"u"))try{Aj(K,U,se)}catch{}},[se,U,K]),y.useEffect(()=>{if(!K||typeof window>"u")return;const we=Be=>{const Je=Be instanceof CustomEvent&&Be.detail&&typeof Be.detail=="object"?Be.detail:{};if(Je.storageKey!==K)return;const Ke=Array.isArray(Je.projectIds)?Je.projectIds.map(Xe=>typeof Xe=="string"?Xe.trim():"").filter(Boolean).slice(0,Math.max(1,se)):bc(K,se);H(Xe=>$r(Xe,Ke)?Xe:Ke)};return window.addEventListener(xl,we),()=>{window.removeEventListener(xl,we)}},[se,K]),y.useEffect(()=>{!K||!q?.id||H(we=>{if(we.includes(q.id))return we;const Be=[...we,q.id].slice(-Math.max(1,se));return Be.length===we.length&&Be.every((Je,Ke)=>Je===we[Ke])?we:Be})},[se,K,q?.id]),y.useEffect(()=>{if(!be)return;const we=ae.current;we&&(we.scrollLeft=0)},[be,V]);const Se=v??(h==="icon"?u:a.jsxs("span",{className:"xf-project-scope-trigger-shell",children:[u?a.jsx("span",{className:"xf-project-scope-trigger-icon","aria-hidden":"true",children:u}):null,a.jsxs("span",{className:"xf-project-scope-trigger-copy",children:[a.jsx("span",{className:"xf-project-scope-trigger-label",children:j}),a.jsx("span",{className:"xf-project-scope-trigger-summary",children:F.summary}),a.jsx("span",{className:"xf-project-scope-trigger-detail",children:F.detail})]}),a.jsxs("span",{className:"xf-project-scope-trigger-side",children:[a.jsx("span",{className:"xf-project-scope-trigger-badges",children:X.map(we=>a.jsx("span",{className:"xf-project-scope-trigger-badge",children:we},we))}),a.jsx("span",{className:"xf-project-scope-trigger-caret","aria-hidden":"true",children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]})),Ne=a.jsx("div",{children:a.jsx(wj,{mode:"single",title:N,description:R,defaultOpen:!0,projectItems:ce,selectedProjectIds:w,onSelectionChange:P,searchPlaceholder:z,searchTrailingAction:ne,showCollapseAllAction:ye,collapseAllLabel:J,showClearSelectionAction:re,clearSelectionLabel:oe})});return a.jsx(a.Fragment,{children:a.jsxs("div",{className:We("xf-project-scope-stack",h==="card"&&"is-card"),children:[be?a.jsxs("div",{className:"xf-project-scope-recent",role:"navigation","aria-label":"Recent projects",children:[a.jsx("span",{className:"xf-project-scope-recent-label",children:ve}),a.jsxs("div",{ref:ae,className:"xf-project-scope-recent-strip",children:[a.jsxs("button",{className:We("xf-project-scope-recent-button","xf-project-scope-recent-toggle",(e||r)&&"is-active"),type:"button",onClick:()=>n?.(!e),title:ge,"aria-label":ge,"aria-pressed":e,children:[u?a.jsx("span",{className:"xf-project-scope-recent-button-icon","aria-hidden":"true",children:u}):null,a.jsx("span",{className:"xf-project-scope-recent-button-name",children:j})]}),V.map(we=>a.jsx("button",{className:We("xf-project-scope-recent-button",q?.id===we.id&&"is-active"),type:"button",onClick:()=>P?.([we.id]),title:we.slug?`${we.name} · ${we.slug}`:we.name,"aria-current":q?.id===we.id?"true":void 0,children:a.jsx("span",{className:"xf-project-scope-recent-button-name",children:we.name})},we.id))]})]}):null,a.jsxs(Q0,{isOpen:e,onOpenChange:n,pinned:r,showPanelWhenPinned:i,onPinnedChange:o,launcherLabel:d,launcherIcon:u,triggerContent:Se,triggerVariant:h,panelTitle:m,panelSize:g,panelWidth:b,label:j,showHeader:C,closeIcon:S,pinIcon:T,headerActions:I,showBackdropWhenOpen:Q,pinnedOffsetTop:W,pinnedOffsetLeft:pe,showEdgeTab:ke,edgeAutoHideStorageKey:O,edgeLauncherLabel:ge,triggerClassName:"xf-project-scope-trigger",panelClassName:"xf-project-scope-panel",panelShellClassName:"xf-project-scope-panel-shell",panelHeaderClassName:"xf-project-scope-panel-header",panelBodyClassName:"xf-project-scope-panel-body",edgeClassName:"xf-project-scope-edge-tab",children:[fe?Ne:null,Z]})]})})}const K0=()=>a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M15 18 9 12l6-6"})}),Nj=()=>a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"m9 18 6-6-6-6"})}),z0=()=>a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 3 4 7v10l8 4 8-4V7l-8-4z"}),a.jsx("path",{d:"M4 7l8 4 8-4"}),a.jsx("path",{d:"M12 21V11"})]}),$0=()=>a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"5",width:"18",height:"5",rx:"1.5"}),a.jsx("rect",{x:"3",y:"14",width:"18",height:"5",rx:"1.5"})]});function Lc({className:e="",iconClassName:n="",labelClassName:r="",label:i="Project navigator",icon:o=null}){return a.jsxs("span",{className:We("xf-project-scope-navigator-heading",e),children:[a.jsx("span",{className:We("xf-project-scope-navigator-heading-icon",n),"aria-hidden":"true",children:o??a.jsx($0,{})}),a.jsx("span",{className:We("xf-project-scope-navigator-heading-label",r),children:i})]})}function H0({className:e="",style:n,containerRef:r=null,projectItems:i=[],activeProjectId:o="",onSelectProjectId:d=null,recentProjectStorageKey:u="",favoriteProjectStorageKey:v="",maxRecentProjects:h=8,visibleCount:m=4,ariaLabel:g="Recent projects",previousLabel:b="Show previous recent projects",nextLabel:j="Show next recent projects",removeLabel:C="Remove from recent projects",emptyLabel:k="No recent projects",previousIcon:x=null,nextIcon:S=null,removeIcon:T=null}){const I=y.useMemo(()=>Dh(i),[i]),E=typeof o=="string"?o.trim():"",[L,P]=y.useState(()=>bc(u,h)),[N,R]=y.useState(()=>jc(v)),[z,ne]=y.useState(""),[ye,J]=y.useState(""),[re,oe]=y.useState({hasPrevious:!1,hasNext:!1}),fe=y.useRef(null),de=y.useRef(new Map),G=y.useRef(null),Q=y.useRef("");y.useEffect(()=>{u&&Aj(u,L,h)},[h,L,u]),y.useEffect(()=>{v&&xj(v,N)},[N,v]),y.useEffect(()=>{if(!u||typeof window>"u")return;const K=ee=>{const ve=ee instanceof CustomEvent&&ee.detail&&typeof ee.detail=="object"?ee.detail:{};if(ve.storageKey!==u)return;const se=Array.isArray(ve.projectIds)?ve.projectIds.map(Z=>typeof Z=="string"?Z.trim():"").filter(Boolean).slice(0,Math.max(1,h)):bc(u,h);P(Z=>$r(Z,se)?Z:se)};return window.addEventListener(xl,K),()=>{window.removeEventListener(xl,K)}},[h,u]),y.useEffect(()=>{if(!v||typeof window>"u")return;const K=ee=>{const ve=ee instanceof CustomEvent&&ee.detail&&typeof ee.detail=="object"?ee.detail:{};if(ve.storageKey!==v)return;const se=Array.isArray(ve.projectIds)?ve.projectIds.map(Z=>typeof Z=="string"?Z.trim():"").filter(Boolean):jc(v);R(Z=>$r(Z,se)?Z:se)};return window.addEventListener(Cl,K),()=>{window.removeEventListener(Cl,K)}},[v]),y.useEffect(()=>{!u||!E||P(K=>{if(K.includes(E))return K;const ee=[...K,E].slice(-Math.max(1,h));return $r(K,ee)?K:ee})},[h,E,u]);const W=y.useMemo(()=>N.map(K=>I.find(ee=>ee.id===K)??null).filter(Yp),[N,I]),pe=y.useMemo(()=>L.map(K=>I.find(ee=>ee.id===K)??null).filter(Yp),[I,L]),ke=y.useMemo(()=>{const K=new Set(W.map(ee=>ee.id));return[...W,...pe.filter(ee=>!K.has(ee.id))]},[W,pe]),O=y.useCallback(()=>{const K=fe.current;if(!K){oe(ve=>ve.hasPrevious||ve.hasNext?{hasPrevious:!1,hasNext:!1}:ve);return}const ee={hasPrevious:K.scrollLeft>1,hasNext:K.scrollLeft+K.clientWidth<K.scrollWidth-1};oe(ve=>ve.hasPrevious===ee.hasPrevious&&ve.hasNext===ee.hasNext?ve:ee)},[]),_=(K="",ee="")=>{const ve=typeof K=="string"?K.trim():"",se=typeof ee=="string"?ee.trim():"";!ve||!se||ve!==se&&P(Z=>{const ae=Z.indexOf(ve),ce=Z.indexOf(se);if(ae===-1||ce===-1)return Z;const w=[...Z],[F]=w.splice(ae,1);return w.splice(ce,0,F),$r(Z,w)?Z:w})};return y.useEffect(()=>{if(typeof window>"u")return;const K=ve=>{const se=G.current;if(!se)return;const Z=Math.abs(ve.clientX-se.startX),ae=Math.abs(ve.clientY-se.startY);if(!se.active&&Z<6&&ae<6)return;se.active||(se.active=!0,ne(se.projectId),J(se.projectId));const w=document.elementFromPoint(ve.clientX,ve.clientY)?.closest?.("[data-recent-project-id]")?.getAttribute("data-recent-project-id")??"";!w||w===se.projectId||w===se.lastTargetProjectId||(se.lastTargetProjectId=w,J(w),_(se.projectId,w))},ee=()=>{const ve=G.current;ve&&(ve.active&&(Q.current=ve.projectId),G.current=null,ne(""),J(""),window.setTimeout(()=>{Q.current=""},0))};return window.addEventListener("pointermove",K),window.addEventListener("pointerup",ee),window.addEventListener("pointercancel",ee),()=>{window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",ee),window.removeEventListener("pointercancel",ee)}},[]),y.useEffect(()=>{if(typeof window>"u")return;O();const K=fe.current;if(!K)return;const ee=()=>O();if(K.addEventListener("scroll",ee,{passive:!0}),typeof ResizeObserver>"u")return window.addEventListener("resize",O),()=>{K.removeEventListener("scroll",ee),window.removeEventListener("resize",O)};const ve=new ResizeObserver(()=>O());return ve.observe(K),()=>{K.removeEventListener("scroll",ee),ve.disconnect()}},[ke,O]),y.useEffect(()=>{if(!E)return;const K=de.current.get(E);K&&(K.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),typeof window<"u"&&window.setTimeout(()=>O(),180))},[E,ke,O]),u?a.jsxs("div",{ref:r,className:We("xf-project-scope-recent-bar",e),role:"navigation","aria-label":g,style:{...n},children:[a.jsx("button",{className:"mini-button ghost icon-only xf-project-scope-recent-bar-nav",type:"button",onClick:()=>{const K=fe.current;K&&K.scrollBy({left:-Math.max(180,Math.round(K.clientWidth*.7)),behavior:"smooth"})},"aria-label":b,title:b,disabled:!re.hasPrevious,children:x??a.jsx(K0,{})}),a.jsx("div",{ref:fe,className:"xf-project-scope-recent-bar-track",children:ke.length===0?a.jsx("div",{className:"xf-project-scope-recent-bar-empty",children:k}):ke.map((K,ee)=>{const ve=K.id===E,se=N.includes(K.id);return a.jsxs("div",{ref:Z=>{Z?de.current.set(K.id,Z):de.current.delete(K.id)},"data-recent-project-id":K.id,className:We("xf-project-scope-recent-bar-item",ve&&"is-active",z===K.id&&"is-dragging",ye===K.id&&z!==K.id&&"is-drop-target"),children:[a.jsxs("button",{className:"xf-project-scope-recent-bar-item-main",type:"button",onPointerDown:Z=>{Z.button===0&&(Z.preventDefault(),G.current={projectId:K.id,pointerId:Z.pointerId,startX:Z.clientX,startY:Z.clientY,active:!1,lastTargetProjectId:""})},onClick:Z=>{if(Q.current===K.id){Z.preventDefault(),Z.stopPropagation();return}d?.(K.id)},title:K.slug?`${K.name} · ${K.slug}`:K.name,"aria-current":ve?"true":void 0,children:[se?a.jsx("span",{className:"xf-project-scope-recent-bar-item-favorite","aria-hidden":"true",children:a.jsx(Jp,{filled:!0})}):null,a.jsx("span",{className:"xf-project-scope-recent-bar-item-name",children:K.name})]}),a.jsx("button",{className:"xf-project-scope-recent-bar-item-remove",type:"button",onClick:Z=>{Z.stopPropagation(),P(ae=>ae.filter(ce=>ce!==K.id))},"aria-label":`${C}: ${K.name}`,title:`${C}: ${K.name}`,children:T??a.jsx(Bh,{})}),ee<ke.length-1?a.jsx("span",{className:"xf-project-scope-recent-bar-separator","aria-hidden":"true"}):null]},K.id)})}),a.jsx("button",{className:"mini-button ghost icon-only xf-project-scope-recent-bar-nav",type:"button",onClick:()=>{const K=fe.current;K&&K.scrollBy({left:Math.max(180,Math.round(K.clientWidth*.7)),behavior:"smooth"})},"aria-label":j,title:j,disabled:!re.hasNext,children:S??a.jsx(Nj,{})})]}):null}function G0({pinned:e=!1,onPinnedChange:n=null,onOpenChange:r=null,panelTitle:i="Project scope",label:o="Project scope",showHeader:d=!0,filterCount:u=0,filterLabel:v="filter",showFilterSummary:h=!1,closeIcon:m=null,pinIcon:g=null,headerActions:b=null,projectItems:j=[],selectedProjectIds:C=[],onSelectionChange:k=null,selectionTitle:x="Projects",selectionDescription:S="Choose the active project context for this workbench.",searchPlaceholder:T="Search projects...",searchTrailingAction:I=null,showCollapseAllAction:E=!1,collapseAllLabel:L="Collapse all",showClearSelectionAction:P=!1,clearSelectionLabel:N="Clear selection",showProjectSelection:R=!0,projectSectionChrome:z="accordion",showAllProjectsRow:ne=!0,favoriteProjectStorageKey:ye="",className:J="",shellClassName:re="",headerClassName:oe="",bodyClassName:fe="",children:de=null}){const G=u>0?`${u} ${v}${u===1?"":"s"} active`:"No page filters active";return a.jsxs(U0,{className:We("xf-project-scope-dock",J),shellClassName:We("xf-project-scope-dock-shell",re),headerClassName:We("xf-project-scope-dock-header",oe),bodyClassName:We("xf-project-scope-dock-body",fe),pinned:e,onPinnedChange:n,onOpenChange:r,panelTitle:i,label:o,subtitle:h?G:null,showHeader:d,closeIcon:m,pinIcon:g,headerActions:b,children:[R?a.jsx(wj,{mode:"single",title:x,description:S,defaultOpen:!0,chrome:z,showAllProjectsRow:ne,favoriteProjectStorageKey:ye,projectItems:j,selectedProjectIds:C,onSelectionChange:k,searchPlaceholder:T,searchTrailingAction:I,showCollapseAllAction:E,collapseAllLabel:L,showClearSelectionAction:P,clearSelectionLabel:N}):null,de]})}const dl="navigator",Wp="left-menu";function $a(...e){return e.filter(Boolean).join(" ")}function $s(e,n,r){return Math.min(Math.max(e,n),r)}function Jo(e,n=dl){return e===Wp||e===dl?e:n}function Ij(){return typeof window<"u"&&!!window.localStorage}function Lh(e,n){if(!e||!Ij())return n;try{return window.localStorage.getItem(e)??n}catch{return n}}function Fy(e,n){const r=Lh(e,null);return r==="true"?!0:r==="false"?!1:n}function Ky(e,n,r,i){const o=Number.parseFloat(Lh(e,""));return Number.isFinite(o)?$s(o,r,i):n}function el(e,n){if(!(!e||!Ij()))try{window.localStorage.setItem(e,String(n))}catch{}}function Tl({storageKeys:e={},defaultMode:n=dl,defaultOpen:r=!0,defaultPinned:i=!0,defaultNavigatorWidth:o=360,defaultLeftMenuWidth:d=320,minWidth:u=280,maxWidth:v=720,navigatorMinWidth:h=u,navigatorMaxWidth:m=v,leftMenuMinWidth:g=u,leftMenuMaxWidth:b=v,mode:j,open:C,pinned:k,navigatorWidth:x,leftMenuWidth:S,onModeChange:T,onOpenChange:I,onPinnedChange:E,onNavigatorWidthChange:L,onLeftMenuWidthChange:P}={}){const N=Jo(n,dl),R=$s(o,h,m),z=$s(d,g,b),[ne,ye]=y.useState(()=>Jo(Lh(e.mode,N),N)),[J,re]=y.useState(()=>Fy(e.open,r)),[oe,fe]=y.useState(()=>Fy(e.pinned,i)),[de,G]=y.useState(()=>Ky(e.navigatorWidth,R,h,m)),[Q,W]=y.useState(()=>Ky(e.leftMenuWidth,z,g,b)),pe=Jo(j??ne,N),ke=C??J,O=k??oe,_=$s(x??de,h,m),K=$s(S??Q,g,b),ee=pe===Wp,ve=ee?K:_,se=y.useCallback(B=>{const U=Jo(typeof B=="function"?B(pe):B,N);j===void 0&&ye(U),T?.(U)},[j,pe,N,T]),Z=y.useCallback(B=>{const U=!!(typeof B=="function"?B(ke):B);C===void 0&&re(U),I?.(U)},[C,I,ke]),ae=y.useCallback(B=>{const U=!!(typeof B=="function"?B(O):B);k===void 0&&fe(U),E?.(U),U&&Z(!0)},[k,E,O,Z]),ce=y.useCallback(B=>{const U=$s(typeof B=="function"?B(_):Number(B),h,m);x===void 0&&G(U),L?.(U)},[x,m,h,_,L]),w=y.useCallback(B=>{const U=$s(typeof B=="function"?B(K):Number(B),g,b);S===void 0&&W(U),P?.(U)},[S,b,g,K,P]),F=y.useCallback(B=>{if(ee){w(B);return}ce(B)},[ee,w,ce]),X=y.useCallback(()=>{se(dl),Z(!0)},[se,Z]),D=y.useCallback(()=>{se(Wp),Z(!0)},[se,Z]);return y.useEffect(()=>{el(e.mode,pe)},[pe,e.mode]),y.useEffect(()=>{el(e.open,ke)},[ke,e.open]),y.useEffect(()=>{el(e.pinned,O)},[O,e.pinned]),y.useEffect(()=>{el(e.navigatorWidth,Math.round(_))},[_,e.navigatorWidth]),y.useEffect(()=>{el(e.leftMenuWidth,Math.round(K))},[K,e.leftMenuWidth]),{mode:pe,open:ke,pinned:O,navigatorWidth:_,leftMenuWidth:K,activeWidth:ve,minWidth:u,maxWidth:v,navigatorMinWidth:h,navigatorMaxWidth:m,leftMenuMinWidth:g,leftMenuMaxWidth:b,isLeftMenuMode:ee,usePinnedNavigatorLayout:!ee&&O&&ke,setMode:se,setOpen:Z,setPinned:ae,setNavigatorWidth:ce,setLeftMenuWidth:w,setActiveWidth:F,switchToNavigator:X,switchToLeftMenu:D,close:()=>Z(!1),openNavigator:()=>Z(!0)}}function Oc({controller:e=null,navigator:n=null,navigatorLabel:r="Navigator",navigatorPanelTitle:i=null,leftMenuClassName:o="inv-iv3-detail-leftmenu-shell",leftMenuPanelClassName:d="inv-iv3-detail-leftmenu-panel",leftMenuProps:u={},leftMenuPanelProps:v={},leftMenuToggle:h=null,closedMenuToggle:m=null,resizeHandle:g=null,tabs:b=null,tabsPlacement:j="inside-content",content:C=null,children:k=null,className:x="",mainClassName:S="",contentClassName:T="",contentProps:I={},rootRef:E=null,...L}){const P=Tl(),N=e??P,R=N.isLeftMenuMode&&N.open,z=j==="above-content"?"above-content":"inside-content";return a.jsxs("div",{...L,ref:E,className:$a("eops-record-detail-body-layout","inv-iv3-detail-master-detail",R&&"has-item-menu",x),"data-eops-record-detail-body-layout":"true","data-tabs-placement":z,children:[R?a.jsxs(_c,{controller:N,className:"eops-record-detail-body-leftmenu",leftMenuClassName:o,panelClassName:d,label:r,panelTitle:i??r,leftMenuProps:{...u,"data-eops-left-menu-host":"true",className:$a(u.className)},panelProps:{...v,"data-eops-left-menu-panel":"true"},children:[h?a.jsx("div",{className:"inv-iv3-detail-leftmenu-toggle-row eops-record-detail-leftmenu-toggle-row",children:h}):null,n]}):null,R?g:null,a.jsxs("div",{className:$a("inv-iv3-detail-main","eops-record-detail-body-main",S),children:[N.isLeftMenuMode&&!N.open&&m?a.jsx("div",{className:"inv-iv3-detail-closed-menu-toggle-row eops-record-detail-closed-menu-toggle-row",children:m}):null,b?a.jsx("div",{className:$a("eops-record-detail-tabs-slot",`is-${z}`),"data-eops-tabs-placement":z,children:b}):null,a.jsx("div",{...I,className:$a("eops-record-detail-content-anchor",T,I.className),"data-eops-record-detail-content-anchor":"true",children:C??k})]})]})}function _c({controller:e=null,children:n,className:r="",panelClassName:i="",dockClassName:o="",selectorClassName:d="",leftMenuClassName:u="",label:v="Navigator",launcherLabel:h="Open navigator",panelTitle:m="Navigator",triggerContent:g=null,triggerVariant:b="icon",headerActions:j=null,filterCount:C=0,filterLabel:k="",showHeader:x=!0,showProjectSelection:S=!1,selectorProps:T={},dockProps:I={},leftMenuProps:E={},panelProps:L={}}){const P=Tl(),N=e??P,R=a.jsx("div",{...L,className:$a("eops-wb-nav-panel",i,L.className),children:n});return N.isLeftMenuMode?N.open?a.jsx("aside",{...E,className:$a("eops-wb-nav-leftmenu",u,r,E.className),"aria-label":v,role:"complementary",style:{"--eops-wb-nav-width":`${N.leftMenuWidth}px`,...E.style},children:R}):null:N.pinned&&N.open?a.jsx(G0,{...I,className:$a("eops-wb-nav-dock",o,r),pinned:!0,onPinnedChange:N.setPinned,onOpenChange:N.setOpen,headerActions:j,panelTitle:m,label:v,filterCount:C,filterLabel:k,showHeader:x,showProjectSelection:S,children:R}):a.jsx(F0,{...T,className:$a("eops-wb-nav-selector",d,r),isOpen:N.open,onOpenChange:N.setOpen,pinned:N.pinned,showPanelWhenPinned:!1,onPinnedChange:N.setPinned,headerActions:j,launcherLabel:h,triggerContent:g??a.jsx(Lc,{label:v}),triggerVariant:b,panelTitle:m,panelSize:"medium",panelWidth:N.navigatorWidth,label:v,filterCount:C,filterLabel:k,showHeader:x,showProjectSelection:S,children:R})}function Oh({items:e=[],activeId:n,onChange:r,ariaLabel:i,className:o="",tabClassName:d="",badgeClassName:u="",...v}){return a.jsx("div",{...v,className:$a("eops-detail-tabs",o),role:"tablist","aria-label":i,children:e.map(h=>{const m=h.id===n,g=h.count??h.badge,b=g!=null&&g!=="";return a.jsxs("button",{className:$a("eops-detail-tabs-tab",m&&"is-active",m&&"active",d),type:"button",role:"tab","aria-selected":m,"aria-controls":h.panelId,tabIndex:m?0:-1,disabled:h.disabled,"data-testid":h.testId,onClick:()=>{h.disabled||r?.(h.id)},children:[a.jsxs("span",{className:"workbench-section-tab-head",children:[a.jsx("span",{className:"workbench-section-tab-title",children:h.label}),b?a.jsx("span",{className:$a("eops-detail-tabs-badge",u),children:g}):null]}),h.hint?a.jsx("span",{className:"workbench-section-tab-hint",children:h.hint}):null]},h.id)})})}const Ej="(max-width: 767px)",Mj="(max-width: 1080px)",Tj="(max-width: 480px)",Bj={viewport:"desktop",compactDensity:!1},Ac=new Set;let Gr=null,cc=Dj();function Dj(){if(typeof window>"u")return Bj;const e=window.matchMedia(Ej).matches,n=window.matchMedia(Mj).matches;return{viewport:e?"mobile":n?"narrow":"desktop",compactDensity:window.matchMedia(Tj).matches}}function Zp(){const e=Dj();e.viewport===cc.viewport&&e.compactDensity===cc.compactDensity||(cc=e,Ac.forEach(n=>n()))}function q0(){typeof window>"u"||Gr||(Gr=[window.matchMedia(Ej),window.matchMedia(Mj),window.matchMedia(Tj)],Gr.forEach(e=>e.addEventListener("change",Zp)),Zp())}function V0(){!Gr||Ac.size>0||(Gr.forEach(e=>e.removeEventListener("change",Zp)),Gr=null)}function Y0(e){return Ac.add(e),q0(),()=>{Ac.delete(e),V0()}}function J0(){return cc}function ii(){return y.useSyncExternalStore(Y0,J0,()=>Bj)}function _h({ariaLabel:e,value:n,items:r,onChange:i,className:o=""}){return a.jsx("div",{className:`aops-pm-section-view-switch is-icon-only${o?` ${o}`:""}`,children:a.jsx("div",{className:"aops-pm-view-icon-group",role:"group","aria-label":e,children:r.map(d=>{const u=n===d.value;return a.jsx("button",{type:"button",className:d.icon==="side-panel"&&d.expanded?"is-panel-open":"","aria-label":d.label,title:d.label,"aria-pressed":u,"aria-expanded":d.icon==="side-panel"?!!d.expanded:void 0,onClick:d.onSelect??(()=>i(d.value)),"data-testid":d.testId,children:a.jsx(Rj,{kind:d.icon,panelOpen:d.expanded})},d.value)})})})}function Rj({kind:e,panelOpen:n=!1}){return a.jsx("svg",{viewBox:"0 0 24 24",width:e==="cards"?16:17,height:e==="cards"?16:17,fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e==="side-panel"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"2.75",y:"4",width:"18.5",height:"16",rx:"2.25"}),a.jsx("path",{d:"M9.25 4.25v15.5"}),a.jsx("path",{d:"M3.5 5.25h5v13.5h-5z",fill:"currentColor",fillOpacity:n?.2:.1,stroke:"none"}),a.jsx("path",{d:n?"m16.25 9-3 3 3 3":"m13 9 3 3-3 3",strokeWidth:2})]}):e==="cards"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"4",y:"4",width:"16",height:"6",rx:"1.5"}),a.jsx("rect",{x:"4",y:"14",width:"16",height:"6",rx:"1.5"})]}):e==="dropdown"?a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2.5"}),a.jsx("path",{d:"M7 12h6"}),a.jsx("path",{d:"m15 10.5 2.25 2.75 2.25-2.75",fill:"currentColor",stroke:"none"})]}):e==="timeline"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M5 5v14"}),a.jsx("circle",{cx:"5",cy:"7",r:"1.6",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"5",cy:"12",r:"1.6",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"5",cy:"17",r:"1.6",fill:"currentColor",stroke:"none"}),a.jsx("path",{d:"M9 7h10M9 12h7M9 17h9"})]}):e==="read"?a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M4 5.5c3.2-.9 5.9-.4 8 1.4v12c-2.1-1.8-4.8-2.3-8-1.4z"}),a.jsx("path",{d:"M20 5.5c-3.2-.9-5.9-.4-8 1.4v12c2.1-1.8 4.8-2.3 8-1.4z"})]}):a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),a.jsx("path",{d:"M8 9h8M8 13h8M8 17h5"})]})})}function Qc(){return a.jsx("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function ft({tone:e,children:n}){return a.jsx("span",{className:`aops-pm-badge aops-pm-badge--${e}`,children:n})}function Lj({items:e,labels:n,toolbar:r,detailExtra:i,layout:o="side-panel",navigatorOpen:d=!0,onCloseNavigator:u,closeNavigatorLabel:v}){const[h,m]=y.useState(""),[g,b]=y.useState(null),[j,C]=y.useState(!1),k=ii().viewport==="mobile",x=y.useRef(null),S=y.useRef(null),T=y.useRef(null),I=h.trim().toLowerCase(),E=y.useMemo(()=>I?e.filter(R=>R.searchText.toLowerCase().includes(I)):e,[e,I]),L=E.find(R=>R.id===g)??E[0]??null,P=k&&g!==null&&E.some(R=>R.id===g),N=y.useCallback(()=>{b(null),window.requestAnimationFrame(()=>S.current?.focus())},[]);return y.useEffect(()=>{if(!P)return;x.current?.focus();const R=z=>{z.key==="Escape"&&N()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[N,P]),y.useEffect(()=>{if(!j)return;const R=ne=>{T.current?.contains(ne.target)||C(!1)},z=ne=>{ne.key==="Escape"&&C(!1)};return document.addEventListener("mousedown",R),document.addEventListener("keydown",z),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",z)}},[j]),e.length===0&&!r&&!u?a.jsx(it,{variant:"empty",title:n.title,message:n.emptyLabel}):a.jsxs("div",{className:`aops-pm-recordlist${o==="dropdown"?" is-dropdown":""}${o==="side-panel"&&!d?" is-navigator-closed":""}`,"data-detail-open":P?"true":"false",children:[o==="dropdown"?a.jsxs("div",{className:"aops-pm-boardnav-dropdown aops-pm-recordlist-dropdown",ref:T,children:[a.jsxs("button",{type:"button",className:"aops-pm-boardnav-trigger","aria-haspopup":"listbox","aria-expanded":j,onClick:()=>C(R=>!R),children:[a.jsx("span",{className:"aops-pm-boardnav-trigger-k",children:n.title}),a.jsx("span",{className:"aops-pm-boardnav-trigger-name",children:L?.title??n.emptyLabel}),a.jsx("span",{className:"aops-pm-boardnav-caret","aria-hidden":!0,children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),j?a.jsxs("div",{className:"aops-pm-boardnav-menu",children:[a.jsx("input",{className:"aops-pm-boardnav-search",type:"search",value:h,placeholder:n.searchPlaceholder,"aria-label":n.searchPlaceholder,autoFocus:!0,onChange:R=>m(R.target.value)}),a.jsxs("div",{className:"aops-pm-boardnav-list",role:"listbox","aria-label":n.title,children:[E.map(R=>{const z=L?.id===R.id;return a.jsxs("button",{type:"button",role:"option","aria-selected":z,className:`aops-pm-boardnav-item${z?" is-active":""}`,onClick:()=>{b(R.id),C(!1),m("")},children:[a.jsx("span",{className:"aops-pm-boardnav-item-name",children:R.title}),a.jsx("span",{className:"aops-pm-boardnav-item-slug",children:Oe(R.id)}),z?a.jsx("span",{className:"aops-pm-boardnav-item-check","aria-hidden":!0,children:"✓"}):null]},R.id)}),E.length===0?a.jsx("span",{className:"aops-pm-boardnav-empty",children:n.noMatchLabel}):null]})]}):null]}):d?a.jsxs("aside",{className:"aops-pm-recordlist-list","aria-label":n.title,children:[r?a.jsx("div",{className:"aops-pm-recordlist-toolbar",children:r}):null,a.jsxs("div",{className:"aops-pm-recordlist-searchrow",children:[a.jsx("input",{className:"aops-pm-recordlist-search",type:"text",value:h,placeholder:n.searchPlaceholder,"aria-label":n.searchPlaceholder,onChange:R=>m(R.target.value)}),u?a.jsx("button",{type:"button",className:"aops-pm-recordlist-navclose",onClick:u,"aria-label":v??n.title,title:v??n.title,children:a.jsx(Qc,{})}):null]}),a.jsxs("ul",{className:"aops-pm-recordlist-rows",children:[E.map(R=>{const z=L?.id===R.id;return a.jsx("li",{children:a.jsxs("button",{type:"button",className:`aops-pm-recordlist-row${z?" is-active":""}`,"aria-current":z?"true":void 0,onClick:ne=>{S.current=ne.currentTarget,b(R.id)},children:[a.jsx("span",{className:"aops-pm-recordlist-row-title",title:R.title,children:R.title}),a.jsxs("span",{className:"aops-pm-recordlist-row-meta",children:[a.jsx(ft,{tone:ja(R.status),children:R.status??n.unknownStatusLabel}),R.chips.slice(0,2).map((ne,ye)=>a.jsx(ft,{tone:ne.tone??"ghost",children:ne.label},ye))]})]})},R.id)}),E.length===0?a.jsx("li",{className:"aops-pm-recordlist-empty",children:n.noMatchLabel}):null]})]}):null,a.jsx("section",{className:"aops-pm-recordlist-detail","aria-label":n.detailAriaLabel,"aria-hidden":k&&!P?"true":void 0,ref:x,tabIndex:P?-1:void 0,children:L?a.jsxs(a.Fragment,{children:[a.jsxs("header",{className:"aops-pm-rechead",children:[a.jsxs("button",{type:"button",className:"aops-pm-recordlist-mobile-back",onClick:N,"aria-label":n.backLabel??n.title,children:[a.jsx("span",{"aria-hidden":!0,children:"←"}),n.backLabel??n.title]}),a.jsxs("div",{className:"aops-pm-rechead-id",children:[a.jsx("span",{className:"aops-pm-rechead-eyebrow",children:L.eyebrow}),a.jsx("h3",{className:"aops-pm-rechead-title",title:L.title,children:L.title}),a.jsxs("div",{className:"aops-pm-rechead-meta",children:[a.jsx(ft,{tone:ja(L.status),children:L.status??n.unknownStatusLabel}),L.chips.map((R,z)=>a.jsx(ft,{tone:R.tone??"ghost",children:R.label},z)),a.jsx("span",{className:"aops-pm-mono",children:Oe(L.id)})]})]})]}),a.jsx("dl",{className:"aops-pm-detail-grid",children:L.fields.filter(R=>R.value).map((R,z)=>a.jsxs("div",{className:"aops-pm-detail-row",children:[a.jsx("dt",{children:R.label}),a.jsx("dd",{title:R.value??void 0,children:R.value})]},z))}),L.body?.map((R,z)=>R.text?a.jsxs("section",{className:"aops-pm-recordlist-block",children:[a.jsx("h5",{children:R.heading}),a.jsx("p",{children:R.text})]},z):null),i?i(L):null,L.tags&&L.tags.length?a.jsx("div",{className:"aops-pm-recordlist-tags",children:L.tags.map(R=>a.jsx("span",{className:"eops-chip eops-chip--ghost cp-chip-xs",children:R},R))}):null]}):a.jsx(it,{variant:"empty",title:n.title,message:n.noMatchLabel})})]})}function Ha({label:e,value:n}){return a.jsxs("div",{className:"aops-pm-metric",role:"listitem",children:[a.jsx("span",{children:n}),a.jsx("b",{children:e})]})}function _n({t:e}){return a.jsx("div",{className:"aops-pm-empty-line",children:e("pmNoRows")})}function Xo({label:e,value:n,t:r}){return a.jsxs("div",{children:[a.jsx("dt",{children:e}),a.jsx("dd",{children:n??r("unknownValue")})]})}function Jr({ariaLabel:e,value:n,items:r,onChange:i,compact:o=!1}){return a.jsx("div",{className:`aops-pm-segmented${o?" is-compact":""}`,role:"group","aria-label":e,children:r.map(d=>a.jsx("button",{type:"button","aria-pressed":n===d.value,onClick:()=>i(d.value),children:d.label},d.value))})}function X0(e){return y.useMemo(()=>{const n=Object.values(e.columnsByBoard).flatMap(r=>r);return new Map(n.map(r=>[r.id,r]))},[e.columnsByBoard])}function Xr(e,n,r){return e.sprintId?n.get(e.sprintId)?.name??Oe(e.sprintId):r("pmUnassigned")}function eh(e){return typeof e.progress=="number"?`${e.progress}%`:"-"}function tt(e,n){if(!e)return"—";const r=new Date(e);if(Number.isNaN(r.getTime()))return"—";const i=n==="tr"?"tr-TR":"en-US",o=r.toLocaleDateString(i,{day:"numeric",month:"short"}),d=r.toLocaleTimeString(i,{hour:"2-digit",minute:"2-digit"});return`${o} ${d}`}function Oj(e){const n=e.progress?.total??_j(e.phases),r=e.progress?.completed??Qj(e.phases);return n>0?`${r}/${n}`:typeof e.progress?.ratio=="number"?`${Math.round(e.progress.ratio*100)}%`:"-"}function W0(e){const n=new Map;for(const o of e.phases)for(const d of o.microtasks??[]){const u=(d.status??"todo").toLowerCase().replace(/-/g,"_")||"todo";n.set(u,(n.get(u)??0)+1)}const r=e.progress?.total??_j(e.phases),i=e.progress?.completed??Qj(e.phases);return[{id:"todo",value:n.get("todo")??0},{id:"doing",value:(n.get("doing")??0)+(n.get("in_progress")??0)},{id:"blocked",value:n.get("blocked")??0},{id:"paused",value:n.get("paused")??0},{id:"in_review",value:n.get("in_review")??0},{id:"postponed",value:n.get("postponed")??0},{id:"cancelled",value:n.get("cancelled")??0},{id:"completed",value:i,total:r}]}function _j(e){return e.reduce((n,r)=>n+(r.microtasks?.length??0),0)}function Qj(e){return e.reduce((n,r)=>n+(r.microtasks??[]).filter(i=>gs(i.status)).length,0)}function Z0(e){return{key:`sprint:${e.id}`,id:e.id,kind:"sprint",name:e.name,status:e.status,goal:e.goal,taskId:e.kanbanTaskId,archived:dn(e),updatedAt:e.updatedAt,createdAt:e.createdAt}}function eN(e){return{key:`plan:${e.id}`,id:e.id,kind:"plan",name:e.name,status:e.status,goal:e.goal,taskId:e.kanbanTaskId,archived:dn(e),updatedAt:e.updatedAt,createdAt:e.createdAt}}function Qh(e,n){return{id:n?.id??e.id,kind:e.kind,name:n?.name??e.name,status:n?.status??e.status,goal:n?.goal??e.goal,taskId:n?.kanbanTaskId??e.taskId,scope:n?.scope??[],validationPlan:n?.validationPlan??[],references:n?.references??[],phases:(n?.phases??[]).slice().sort(Uj).map(r=>({...r,microtasks:Uh(r.microtasks??[])})),progress:n?.progress??null}}function Uh(e){return e.slice().sort(Uj)}function Uj(e,n){return(e.position??0)-(n.position??0)}function tN(e,n){return Date.parse(n.updatedAt??n.createdAt??"")-Date.parse(e.updatedAt??e.createdAt??"")}function Pj(e,n){const r=new Map;for(const i of n)r.set(i.id,eN(i));for(const i of e)r.set(i.id,Z0(i));return[...r.values()].sort(tN)}function aN(e,n){return new Set([...e,...n].map(r=>r.id)).size}function nN(e){return e.sprintId??null}const Fj=/done|complete|closed|shipped|accept/;function ul(e){const n=(e.slug||e.name||"").toLowerCase();return Fj.test(n)?"var(--sage)":/doing|progress|active|wip|working/.test(n)?"var(--coral)":/review|test|qa|verify/.test(n)?"var(--indigo)":/backlog|icebox|later/.test(n)?"var(--border-warm-strong, var(--aops-v2-muted))":/todo|new|open|ready|next/.test(n)?"var(--amber)":"var(--aops-v2-muted)"}const Kj="aops-cockpit-v2.boards.laneCollapse.v1";function zj(){if(typeof window>"u")return{};try{const e=JSON.parse(window.localStorage.getItem(Kj)??"{}");return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function zy(e){if(!e)return new Set;const n=zj()[e];return new Set(Array.isArray(n)?n.filter(r=>typeof r=="string"):[])}function sN(e,n){if(!(!e||typeof window>"u"))try{const r=zj();n.size>0?r[e]=[...n]:delete r[e],window.localStorage.setItem(Kj,JSON.stringify(r))}catch{}}function $j(e,n){if(gs(e.status))return!0;const r=e.boardColumnId?n.get(e.boardColumnId):void 0;return r?Fj.test((r.slug||r.name||"").toLowerCase()):!1}function Hj({boardId:e,boardName:n,columns:r,tasksByColumn:i,sprintById:o,onOpenTask:d,orientation:u="horizontal",t:v}){const h=i.get("unassigned")??[],m=y.useMemo(()=>[...r.map(x=>({id:x.id,label:x.name,count:(i.get(x.id)??[]).length,color:ul(x)})),...h.length?[{id:"unassigned",label:v("pmUnassigned"),count:h.length,color:"var(--aops-v2-muted)"}]:[]],[r,i,v,h.length]),[g,b]=y.useState(()=>m[0]?.id??""),[j,C]=y.useState(()=>zy(e));y.useEffect(()=>{m.some(x=>x.id===g)||b(m[0]?.id??"")},[m,g]),y.useEffect(()=>{C(zy(e))},[e]);const k=y.useCallback(x=>{C(S=>{const T=new Set(S);return T.has(x)?T.delete(x):T.add(x),sN(e,T),T})},[e]);return a.jsxs("div",{className:"aops-pm-kanban-shell",children:[a.jsx("div",{className:"aops-pm-mobile-lanes",role:"tablist","aria-label":n,children:m.map(x=>a.jsxs("button",{type:"button",role:"tab","aria-selected":g===x.id,className:`aops-pm-mobile-lane${g===x.id?" is-active":""}`,onClick:()=>b(x.id),children:[a.jsx("span",{className:"aops-pm-kanban-dot",style:{background:x.color},"aria-hidden":!0}),a.jsx("span",{children:x.label}),a.jsx("b",{children:x.count})]},x.id))}),a.jsxs("div",{className:`aops-pm-kanban${u==="vertical"?" is-vertical":""}`,"aria-label":n,"data-orientation":u,children:[r.map(x=>{const S=i.get(x.id)??[],T=!!(x.wipLimit&&S.length>x.wipLimit),I=j.has(x.id);return a.jsxs("section",{className:`aops-pm-kanban-lane${I?" is-collapsed":""}`,style:{"--aops-lane-accent":ul(x)},"data-lane-selected":g===x.id?"true":"false","data-wip-over":T?"true":"false",children:[a.jsxs("header",{className:"aops-pm-kanban-head",children:[a.jsx("span",{className:"aops-pm-kanban-dot",style:{background:ul(x)},"aria-hidden":!0}),a.jsx("span",{className:"aops-pm-kanban-name",children:x.name}),a.jsxs("span",{className:`aops-pm-kanban-wip${T?" is-over":""}`,title:T?v("pmWipOver"):void 0,children:[S.length,x.wipLimit?`/${x.wipLimit}`:"",T?a.jsxs("span",{className:"aops-a11y-only",children:[" ",v("pmWipOver")]}):null]}),a.jsx($y,{collapsed:I,laneName:x.name,onToggle:()=>k(x.id),t:v})]}),a.jsxs("div",{className:"aops-pm-kanban-cards",children:[S.map(E=>a.jsx(Hy,{task:E,sprintName:Xr(E,o,v),onOpen:d?L=>d(E,L):void 0},E.id)),S.length===0?a.jsx(_n,{t:v}):null]})]},x.id)}),h.length?a.jsxs("section",{className:`aops-pm-kanban-lane${j.has("unassigned")?" is-collapsed":""}`,style:{"--aops-lane-accent":"var(--aops-v2-muted)"},"data-lane-selected":g==="unassigned"?"true":"false","data-wip-over":"false",children:[a.jsxs("header",{className:"aops-pm-kanban-head",children:[a.jsx("span",{className:"aops-pm-kanban-dot",style:{background:"var(--aops-v2-muted)"},"aria-hidden":!0}),a.jsx("span",{className:"aops-pm-kanban-name",children:v("pmUnassigned")}),a.jsx("span",{className:"aops-pm-kanban-wip",children:h.length}),a.jsx($y,{collapsed:j.has("unassigned"),laneName:v("pmUnassigned"),onToggle:()=>k("unassigned"),t:v})]}),a.jsx("div",{className:"aops-pm-kanban-cards",children:h.map(x=>a.jsx(Hy,{task:x,sprintName:Xr(x,o,v),onOpen:d?S=>d(x,S):void 0},x.id))})]}):null]})]})}function $y({collapsed:e,laneName:n,onToggle:r,t:i}){return a.jsx("button",{type:"button",className:"aops-pm-kanban-lane-toggle","aria-expanded":!e,"aria-label":`${i(e?"pmLaneExpand":"pmLaneCollapse")}: ${n}`,title:i(e?"pmLaneExpand":"pmLaneCollapse"),onClick:r,children:a.jsx("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:e?"M6 4l4 4-4 4":"M10 4l-4 4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Hy({task:e,sprintName:n,onOpen:r}){const i=(e.status??"").trim(),o=i.length>0&&!/unknown|none/i.test(i),d=typeof e.progress=="number",u=(e.description??"").replace(/\s+/g," ").trim();return a.jsxs("article",{className:`aops-pm-kanban-card${r?" is-actionable":""}`,children:[a.jsxs("div",{className:"aops-pm-card-head",children:[a.jsx("span",{className:"aops-pm-mono",children:e.taskCode??Oe(e.id)}),o?a.jsx(ft,{tone:ja(i),children:i}):null]}),a.jsx("h4",{children:e.title}),u?a.jsx("p",{className:"aops-pm-kanban-card-desc",children:u}):null,d?a.jsx("span",{className:"aops-pm-kanban-card-progress",children:a.jsx(Gj,{task:e})}):null,n?a.jsx("div",{className:"aops-pm-task-meta",children:a.jsx(ft,{tone:"ghost",children:n})}):null,r?a.jsx("button",{type:"button",className:"aops-pm-task-open",onClick:v=>r(v.currentTarget),"aria-label":e.title,children:a.jsx("span",{"aria-hidden":!0,children:"→"})}):null]})}function rN(e,n,r,i,o,d){if(n==="none")return[{id:"__all",label:"",rows:e}];const u=[],v=new Map,h=(m,g)=>{let b=v.get(m);return b||(b={id:m,label:g,rows:[]},v.set(m,b),u.push(m)),b};if(n==="column")for(const m of i)h(m.id,m.name);for(const m of e){let g,b;if(n==="column"){const j=!!(m.boardColumnId&&r.has(m.boardColumnId));g=j?m.boardColumnId:"__unassigned",b=j?r.get(g)?.name??d("pmUnassigned"):d("pmUnassigned")}else g=m.sprintId??"__nosprint",b=m.sprintId?o.get(m.sprintId)?.name??Oe(m.sprintId):d("pmNoSprint");h(g,b).rows.push(m)}return u.map(m=>v.get(m)).filter(m=>m.rows.length>0)}function Gj({task:e}){if(typeof e.progress!="number")return a.jsx("span",{className:"aops-pm-muted",children:"—"});const n=Math.max(0,Math.min(100,e.progress));return a.jsxs("span",{className:"aops-pm-progress",children:[a.jsx("span",{className:"aops-pm-progress-track","aria-hidden":!0,children:a.jsx("span",{className:`aops-pm-progress-fill${n>=100?" is-done":""}`,style:{width:`${n}%`}})}),a.jsx("span",{className:"aops-pm-progress-label",children:eh(e)})]})}const Gy={task:"asc",progress:"desc",updated:"desc",column:"asc",sprint:"asc"};function iN(e,n){const r={key:"task",label:n("pmTasks"),cellClass:"gt-task",width:"minmax(260px, 2.4fr)"},i={key:"column",label:n("pmFieldColumn"),cellClass:"gt-column",width:"minmax(130px, 1fr)"},o={key:"sprint",label:n("pmFieldSprint"),cellClass:"gt-sprint",width:"minmax(130px, 1fr)"},d={key:"progress",label:n("pmFieldProgress"),cellClass:"gt-progress",width:"minmax(150px, 0.9fr)"},u={key:"updated",label:n("pmFieldUpdated"),cellClass:"gt-updated",width:"minmax(120px, 0.8fr)"};return e==="column"?[r,d,u,o]:e==="sprint"?[r,d,u,i]:[r,i,o,d,u]}function lN(e,n,r,i,o,d,u){const v=(g,b)=>g.localeCompare(b,d,{numeric:!0,sensitivity:"base"}),h=g=>g.boardColumnId?i.get(g.boardColumnId)?.name??u("pmUnassigned"):u("pmUnassigned");let m;switch(r.key){case"task":m=v(Wo(e),Wo(n));break;case"progress":m=(e.progress??-1)-(n.progress??-1);break;case"updated":m=Date.parse(e.updatedAt??"")-Date.parse(n.updatedAt??"")||0;break;case"column":m=v(h(e),h(n));break;case"sprint":m=v(Xr(e,o,u),Xr(n,o,u));break}return m===0&&(m=v(Wo(e),Wo(n))),r.dir==="asc"?m:-m}function Wo(e){return`${e.taskCode??""} ${e.title??""}`.trim()}function oN({state:e}){return e==="none"?a.jsx("svg",{className:"aops-pm-gt-sorticon",viewBox:"0 0 12 12",width:"9",height:"9",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M6 2.2 8.2 5H3.8L6 2.2ZM6 9.8 3.8 7h4.4L6 9.8Z",fill:"currentColor",opacity:"0.45"})}):a.jsx("svg",{className:"aops-pm-gt-sorticon is-active",viewBox:"0 0 12 12",width:"9",height:"9",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:e==="asc"?"M6 2.6 9 6.6H3L6 2.6Z":"M6 9.4 3 5.4h6L6 9.4Z",fill:"currentColor"})})}function qj({tasks:e,groupBy:n,columns:r,orderedColumns:i,sprintById:o,collapsed:d,onToggleGroup:u,onOpenTask:v,locale:h,t:m}){const[g,b]=y.useState({key:"updated",dir:"desc"}),j=y.useMemo(()=>iN(n,m),[n,m]),C=j.map(T=>T.width).join(" ");y.useEffect(()=>{b(T=>j.some(I=>I.key===T.key)?T:{key:"updated",dir:Gy.updated})},[j]);const k=T=>b(I=>I.key===T?{key:T,dir:I.dir==="asc"?"desc":"asc"}:{key:T,dir:Gy[T]}),x=y.useMemo(()=>rN(e,n,r,i,o,m).map(I=>({...I,rows:[...I.rows].sort((E,L)=>lN(E,L,g,r,o,h,m))})),[r,n,h,i,g,o,m,e]);if(e.length===0)return a.jsx("div",{className:"aops-pm-grouptable-wrap",children:a.jsx(_n,{t:m})});const S=(T,I)=>{switch(I){case"progress":return a.jsx(Gj,{task:T});case"updated":return tt(T.updatedAt,h);case"column":return T.boardColumnId?r.get(T.boardColumnId)?.name??m("pmUnassigned"):m("pmUnassigned");case"sprint":return Xr(T,o,m);case"task":return null}};return a.jsx("div",{className:"aops-pm-grouptable-wrap",style:{"--gt-cols":C},children:a.jsxs("div",{className:"aops-pm-grouptable",role:"table","aria-label":m("pmTasks"),children:[a.jsx("div",{className:"aops-pm-grouptable-headrow",role:"row",children:j.map(T=>{const I=g.key===T.key;return a.jsx("span",{className:T.cellClass,role:"columnheader","aria-sort":I?g.dir==="asc"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:`aops-pm-gt-sortbtn${I?" is-active":""}`,onClick:()=>k(T.key),children:[a.jsx("span",{children:T.label}),a.jsx(oN,{state:I?g.dir:"none"})]})},T.key)})}),x.map(T=>{const I=d.has(T.id);return a.jsxs(y.Fragment,{children:[T.label!==""?a.jsxs("button",{type:"button",className:"aops-pm-grouptable-group","aria-expanded":!I,onClick:()=>u(T.id),children:[a.jsx("svg",{className:`aops-pm-grouptable-caret${I?"":" is-open"}`,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})}),a.jsx("span",{className:"aops-pm-grouptable-group-name",children:T.label}),a.jsx("span",{className:"aops-pm-grouptable-group-count",children:T.rows.length})]}):null,I?null:T.rows.map(E=>a.jsx("div",{className:"aops-pm-grouptable-row",role:"row",children:j.map(L=>L.key==="task"?a.jsxs("span",{className:"gt-task",children:[a.jsx("span",{className:"aops-pm-mono",children:E.taskCode??Oe(E.id)}),v?a.jsx("button",{type:"button",className:"gt-task-title is-actionable",onClick:P=>v(E,P.currentTarget),children:E.title}):a.jsx("span",{className:"gt-task-title",children:E.title})]},L.key):a.jsx("span",{className:L.cellClass,children:S(E,L.key)},L.key))},E.id))]},T.id)})]})})}const qy={mode:"kanban",groupBy:"column"},Vj="aops-cockpit-v2.boards.cardsUi",Zo={orderByProject:{},favoritesByProject:{},expandedByProject:{},sortKeyByProject:{},sortDirectionByProject:{},filterModeByProject:{},bodyViewByProject:{},pageSizeByProject:{}},Ph=10,cN=[10,25,50],dN=["manual","updatedAt","createdAt","name"],uN=["all","favorites","withTasks"];function pN(){if(typeof window>"u")return Zo;try{const e=window.localStorage.getItem(Vj);if(!e)return Zo;const n=JSON.parse(e);return{...Zo,...n}}catch{return Zo}}function hN(e){try{typeof window<"u"&&window.localStorage.setItem(Vj,JSON.stringify(e))}catch{}}function Pn({children:e,size:n=24}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",width:n,height:n,"aria-hidden":"true",children:e})}const Fh=a.jsx(Pn,{children:a.jsx("path",{d:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3z"})}),Uc=a.jsx(Pn,{children:a.jsx("path",{d:"m6 15 6-6 6 6"})}),Pc=a.jsx(Pn,{children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),Yj=a.jsxs(Pn,{children:[a.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),a.jsx("path",{d:"m15 5 4 4"})]}),Fc=a.jsx(Pn,{children:a.jsx("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),Kc=a.jsxs(Pn,{children:[a.jsx("circle",{cx:"11",cy:"11",r:"7"}),a.jsx("path",{d:"M20 20l-3.5-3.5"})]}),mn=a.jsxs(Pn,{children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),Kh=a.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"5",r:"2"}),a.jsx("circle",{cx:"12",cy:"12",r:"2"}),a.jsx("circle",{cx:"12",cy:"19",r:"2"})]}),Jj=a.jsxs(Pn,{children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"5",rx:"1"}),a.jsx("path",{d:"M5 9v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"}),a.jsx("path",{d:"M10 13h4"})]}),zh=a.jsxs(Pn,{children:[a.jsx("path",{d:"M3 6h18"}),a.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),a.jsx("path",{d:"M6 6l1 14h10l1-14"})]});function $h({filled:e=!1}){return a.jsx("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m12 3.8 2.63 5.34 5.89.86-4.26 4.15 1 5.85L12 17.22 6.74 20l1-5.85-4.26-4.15 5.89-.86L12 3.8Z"})})}function Hh({expanded:e=!1}){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M3.5 8h9"}),e?null:a.jsx("path",{d:"M8 3.5v9"})]})}function bs(){const[e,n]=y.useState(!1),r=y.useRef(null);return y.useEffect(()=>{if(!e)return;const i=d=>{r.current&&!r.current.contains(d.target)&&n(!1)},o=d=>d.key==="Escape"&&n(!1);return document.addEventListener("pointerdown",i),document.addEventListener("keydown",o),()=>{document.removeEventListener("pointerdown",i),document.removeEventListener("keydown",o)}},[e]),{open:e,setOpen:n,rootRef:r}}function mN({filterMode:e,onSetFilterMode:n,t:r}){const{open:i,setOpen:o,rootRef:d}=bs(),u={all:r("pmCardsFilterAll"),favorites:r("pmCardsFilterFavorites"),withTasks:r("pmCardsFilterWithTasks")},v={all:r("pmCardsFilterAllNote"),favorites:r("pmCardsFilterFavoritesNote"),withTasks:r("pmCardsFilterWithTasksNote")};return a.jsxs("div",{className:"aops-pm-cards-popwrap",ref:d,children:[a.jsxs("button",{type:"button",className:`aops-pm-cards-tool-btn${e!=="all"?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":i,"aria-label":r("pmCardsFilterTitle"),title:r("pmCardsFilterTitle"),onClick:()=>o(h=>!h),"data-testid":"aops-v2-boards-cards-filter",children:[Fc,e!=="all"?a.jsx("span",{className:"aops-pm-cards-tool-badge",children:"1"}):null]}),i?a.jsxs("div",{className:"aops-pm-cards-popmenu",role:"menu",children:[a.jsxs("div",{className:"aops-pm-cards-popmenu-head",children:[a.jsxs("div",{children:[a.jsx("h3",{children:r("pmCardsFilterTitle")}),a.jsx("p",{children:r("pmCardsFilterScope")})]}),a.jsx("button",{type:"button",className:"aops-pm-cards-popmenu-clear",disabled:e==="all",onClick:()=>{n("all"),o(!1)},children:r("pmCardsFilterClear")})]}),a.jsx("span",{className:"aops-pm-cards-popmenu-label",children:r("pmCardsFilterLabel")}),uN.map(h=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":e===h,className:`aops-pm-cards-popmenu-option${e===h?" is-active":""}`,onClick:()=>{n(h),o(!1)},children:[a.jsxs("span",{className:"aops-pm-cards-popmenu-option-copy",children:[a.jsx("b",{children:u[h]}),a.jsx("small",{children:v[h]})]}),e===h?a.jsx("span",{className:"aops-pm-cards-popmenu-check",children:"✓"}):null]},h)),a.jsxs("div",{className:"aops-pm-cards-popmenu-summary",children:[a.jsx("span",{children:r("pmCardsFilterActive")}),a.jsx("strong",{children:u[e]})]})]}):null]})}function Gh({sortKey:e,sortDirection:n,onSetSort:r,t:i}){const{open:o,setOpen:d,rootRef:u}=bs(),v={manual:i("pmCardsSortManual"),updatedAt:i("pmCardsSortUpdated"),createdAt:i("pmCardsSortCreated"),name:i("pmCardsSortName")};return a.jsxs("div",{className:"aops-pm-cards-popwrap aops-pm-cards-sort",ref:u,children:[a.jsx("button",{type:"button",className:`aops-pm-cards-tool-btn aops-pm-cards-sort-field${e!=="manual"?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":o,title:`${i("pmCardsSortBy")}: ${v[e]}`,onClick:()=>d(h=>!h),"data-testid":"aops-v2-boards-cards-sort",children:a.jsx("span",{className:"aops-pm-cards-sort-label",children:i("pmCardsSortBy")})}),a.jsx("button",{type:"button",className:"aops-pm-cards-tool-btn","aria-label":i("pmCardsSortDirection"),title:i(n==="asc"?"pmCardsSortAsc":"pmCardsSortDesc"),onClick:()=>r(e,n==="asc"?"desc":"asc"),"data-testid":"aops-v2-boards-cards-sortdir",children:n==="asc"?Uc:Pc}),o?a.jsxs("div",{className:"aops-pm-cards-popmenu",role:"menu",children:[a.jsx("span",{className:"aops-pm-cards-popmenu-label",children:i("pmCardsSortBy")}),dN.map(h=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":e===h,className:`aops-pm-cards-popmenu-option${e===h?" is-active":""}`,onClick:()=>{r(h,n),d(!1)},children:[a.jsx("span",{className:"aops-pm-cards-popmenu-option-copy",children:a.jsx("b",{children:v[h]})}),e===h?a.jsx("span",{className:"aops-pm-cards-popmenu-check",children:"✓"}):null]},h))]}):null]})}function qh({total:e,page:n,pageSize:r,visibleCount:i,onPageChange:o,onPageSizeChange:d,noun:u,testIdPrefix:v="aops-v2-boards-cards",t:h}){const m=Dc({total:e,page:n,pageSize:r,visibleCount:i});return a.jsxs("div",{className:"collection-pagination aops-pm-cards-pager","data-testid":`${v}-pager`,children:[a.jsxs("span",{className:"collection-pagination-count",children:[m.start,"-",m.end," / ",m.total," ",u??h("pmCardsPagerNoun")]}),a.jsxs("div",{className:"collection-pagination-controls",children:[a.jsxs("label",{className:"aops-pm-cards-pagesize",children:[a.jsx("span",{children:h("pmCardsPageSize")}),a.jsx(Jr,{compact:!0,ariaLabel:h("pmCardsPageSize"),value:String(r),items:cN.map(g=>({value:String(g),label:String(g)})),onChange:g=>d(Number(g))})]}),a.jsx("button",{className:"mini-button ghost",type:"button",onClick:()=>o(m.currentPage-1),disabled:!m.canGoPrev,"data-testid":`${v}-pager-prev`,children:h("pmCardsPagerPrev")}),a.jsxs("span",{className:"collection-pagination-page",children:[h("pmCardsPagerPage")," ",m.currentPage+1," / ",m.totalPages]}),a.jsx("button",{className:"mini-button ghost",type:"button",onClick:()=>o(m.currentPage+1),disabled:!m.canGoNext,"data-testid":`${v}-pager-next`,children:h("pmCardsPagerNext")})]})]})}function fN({columns:e,value:n,onChange:r,boardName:i,t:o}){const{open:d,setOpen:u,rootRef:v}=bs(),h=[{id:"all",label:o("pmCardFilterAllColumns"),dot:null},...e.map(g=>({id:g.id,label:g.name,dot:ul(g)})),{id:"unassigned",label:o("pmUnassigned"),dot:"var(--aops-v2-muted)"}],m=n!=="all";return a.jsxs("div",{className:"aops-pm-cards-popwrap",ref:v,children:[a.jsxs("button",{type:"button",className:`aops-pm-cards-tool-btn is-compact${m?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":d,"aria-label":`${o("pmCardFilterColumns")}: ${i}`,title:o("pmCardFilterColumns"),onClick:()=>u(g=>!g),"data-testid":"aops-v2-boards-card-columnfilter",children:[Fc,m?a.jsx("span",{className:"aops-pm-cards-tool-badge",children:"1"}):null]}),d?a.jsxs("div",{className:"aops-pm-cards-popmenu",role:"menu",children:[a.jsx("span",{className:"aops-pm-cards-popmenu-label",children:o("pmCardFilterColumns")}),h.map(g=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":n===g.id,className:`aops-pm-cards-popmenu-option${n===g.id?" is-active":""}`,onClick:()=>{r(g.id),u(!1)},children:[a.jsx("span",{className:"aops-pm-cards-popmenu-option-copy",children:a.jsxs("b",{children:[g.dot?a.jsx("span",{className:"aops-pm-kanban-dot",style:{background:g.dot},"aria-hidden":!0}):null,g.label]})}),n===g.id?a.jsx("span",{className:"aops-pm-cards-popmenu-check",children:"✓"}):null]},g.id))]}):null]})}function vN({archived:e,busy:n,onToggleArchive:r,onRequestDelete:i,t:o}){const{open:d,setOpen:u,rootRef:v}=bs();return a.jsxs("div",{className:"aops-pm-boardcard-menuwrap",ref:v,children:[a.jsx("button",{type:"button",className:`aops-pm-boardcard-action${d?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":d,"aria-label":o("pmCardMenu"),title:o("pmCardMenu"),disabled:n,onClick:()=>u(h=>!h),"data-testid":"aops-v2-boards-card-menu",children:Kh}),d?a.jsxs("div",{className:"aops-pm-cards-popmenu is-right",role:"menu",children:[a.jsxs("button",{type:"button",role:"menuitem",className:"aops-pm-cards-popmenu-option",onClick:()=>{u(!1),r()},"data-testid":"aops-v2-boards-card-archive",children:[a.jsx("span",{className:"aops-pm-cards-popmenu-option-icon",children:Jj}),a.jsx("span",{className:"aops-pm-cards-popmenu-option-copy",children:a.jsx("b",{children:o(e?"pmCardUnarchive":"pmCardArchive")})})]}),a.jsxs("button",{type:"button",role:"menuitem",className:"aops-pm-cards-popmenu-option is-danger",onClick:()=>{u(!1),i()},"data-testid":"aops-v2-boards-card-delete",children:[a.jsx("span",{className:"aops-pm-cards-popmenu-option-icon",children:zh}),a.jsx("span",{className:"aops-pm-cards-popmenu-option-copy",children:a.jsx("b",{children:o("pmCardDelete")})})]})]}):null]})}function gN({board:e,columns:n,model:r,sprintById:i,isFavorite:o,isExpanded:d,isSelected:u,canMoveUp:v,canMoveDown:h,menuBusy:m,bodyView:g,onSetBodyView:b,onToggleExpanded:j,onToggleFavorite:C,onMoveUp:k,onMoveDown:x,onOpenDetail:S,onRequestColumns:T,onRequestEdit:I,onToggleArchive:E,onRequestDelete:L,locale:P,t:N}){const R=mj(r,e.id,d||u),z=y.useMemo(()=>R.data??[],[R.data]),ne=R.data!==void 0,[ye,J]=y.useState(()=>new Set),re=Z=>J(ae=>{const ce=new Set(ae);return ce.has(Z)?ce.delete(Z):ce.add(Z),ce}),[oe,fe]=y.useState(""),[de,G]=y.useState("all"),Q=y.useMemo(()=>new Map(n.map(Z=>[Z.id,Z])),[n]),W=y.useMemo(()=>z.slice().sort((Z,ae)=>(Z.position??0)-(ae.position??0)),[z]),pe=y.useMemo(()=>{const Z=oe.trim().toLowerCase();return W.filter(ae=>{if(de==="unassigned"){if(ae.boardColumnId&&Q.has(ae.boardColumnId))return!1}else if(de!=="all"&&ae.boardColumnId!==de)return!1;return!(Z&&!`${ae.title} ${ae.taskCode??""}`.toLowerCase().includes(Z))})},[Q,de,W,oe]),ke=y.useMemo(()=>de==="all"?n:de==="unassigned"?[]:n.filter(Z=>Z.id===de),[de,n]),O=y.useMemo(()=>g.groupBy==="column"?[...n.map(Z=>Z.id),"__unassigned"]:g.groupBy==="sprint"?Array.from(new Set(pe.map(Z=>Z.sprintId??"__nosprint"))):[],[g.groupBy,n,pe]),_=y.useMemo(()=>{const Z=new Set(n.map(ce=>ce.id)),ae=new Map;for(const ce of pe){const w=ce.boardColumnId&&Z.has(ce.boardColumnId)?ce.boardColumnId:"unassigned";ae.set(w,[...ae.get(w)??[],ce])}return ae},[n,pe]),K=y.useMemo(()=>{const Z=new Set(n.map(F=>F.id)),ae=new Map;for(const F of z){const X=F.boardColumnId&&Z.has(F.boardColumnId)?F.boardColumnId:"unassigned";ae.set(X,(ae.get(X)??0)+1)}const ce=n.map(F=>({id:F.id,title:F.name,count:ae.get(F.id)??0})),w=ae.get("unassigned")??0;return w>0&&ce.push({id:"unassigned",title:N("pmUnassigned"),count:w}),ce},[n,N,z]),ee=dn(e),ve=(e.description??"").trim(),se=()=>{try{navigator.clipboard?.writeText(e.id)}catch{}};return a.jsxs("section",{className:`aops-pm-boardcard${u?" is-selected":""}`,"data-testid":"aops-v2-boards-card","data-board-id":e.id,children:[a.jsxs("div",{className:"aops-pm-boardcard-head",children:[a.jsxs("div",{className:"aops-pm-boardcard-copy",children:[a.jsxs("div",{className:"aops-pm-boardcard-titlerow",children:[a.jsxs("button",{type:"button",className:"aops-pm-boardcard-toggle","aria-expanded":d,"aria-label":N(d?"pmCardCollapse":"pmCardExpand"),onClick:j,children:[a.jsx("span",{className:"aops-pm-boardcard-symbol","aria-hidden":!0,children:a.jsx(Hh,{expanded:d})}),a.jsx("span",{className:"aops-pm-boardcard-title",children:e.name})]}),ee?a.jsx(ft,{tone:"ghost",children:N("navArchivedGroup")}):null]}),ve?a.jsx("p",{className:"aops-pm-boardcard-desc",role:"button",tabIndex:0,"aria-expanded":d,onClick:j,onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),j())},children:ve}):null,a.jsxs("div",{className:"aops-pm-boardcard-meta",children:[a.jsxs("span",{children:[ne?`${z.length} ${N("pmCardTasksWord")} · `:"",`${n.length} ${N("pmCardColumnsWord")}`]}),e.slug&&e.slug!==e.name?a.jsx("span",{children:e.slug}):null,a.jsxs("button",{type:"button",className:"aops-pm-boardcard-uid",title:N("pmCardCopyId"),"aria-label":N("pmCardCopyId"),onClick:se,children:["uid ",Oe(e.id)]})]})]}),a.jsxs("div",{className:"aops-pm-boardcard-side",children:[a.jsxs("div",{className:"aops-pm-boardcard-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-boardcard-action","aria-label":`${N("pmCardDetail")}: ${e.name}`,title:N("pmCardDetail"),onClick:S,"data-testid":"aops-v2-boards-card-detail",children:Fh}),a.jsx("button",{type:"button",className:`aops-pm-boardcard-action theme-accent${o?" is-active":""}`,"aria-label":N(o?"pmCardFavoriteRemove":"pmCardFavoriteAdd"),"aria-pressed":o,title:N(o?"pmCardFavoriteRemove":"pmCardFavoriteAdd"),onClick:C,"data-testid":"aops-v2-boards-card-favorite",children:a.jsx($h,{filled:o})}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action theme-accent","aria-label":`${N("pmCardMoveUp")}: ${e.name}`,title:N("pmCardMoveUp"),onClick:k,disabled:!v,"data-testid":"aops-v2-boards-card-moveup",children:Uc}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action theme-accent","aria-label":`${N("pmCardMoveDown")}: ${e.name}`,title:N("pmCardMoveDown"),onClick:x,disabled:!h,"data-testid":"aops-v2-boards-card-movedown",children:Pc}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action","aria-label":`${N("pmColumnsManage")}: ${e.name}`,title:N("pmColumnsManage"),onClick:T,"data-testid":"aops-v2-boards-card-columns",children:"▤"}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action","aria-label":`${N("pmCardEdit")}: ${e.name}`,title:N("pmCardEdit"),onClick:I,"data-testid":"aops-v2-boards-card-edit",children:Yj}),a.jsx(vN,{archived:ee,busy:m,onToggleArchive:E,onRequestDelete:L,t:N})]}),ne&&K.length>0?a.jsx("div",{className:"aops-pm-boardcard-stats","aria-label":`${N("pmCardStatsLabel")}: ${e.name}`,children:K.map(Z=>a.jsxs("span",{className:"aops-pm-boardcard-stat",children:[a.jsx("span",{className:"aops-pm-boardcard-stat-label",children:Z.title}),a.jsx("span",{className:"aops-pm-boardcard-stat-value",children:Z.count})]},Z.id))}):null]})]}),d&&!ne?a.jsx("div",{className:"aops-pm-boardcard-body",children:a.jsx("div",{className:"aops-pm-boardcard-loading",role:"status",children:R.isError?It(R.error):N("pmCardTasksLoading")})}):null,d&&ne?a.jsxs("div",{className:"aops-pm-boardcard-body",children:[a.jsxs("div",{className:"aops-pm-boardcard-viewrow",role:"toolbar","aria-label":`${N("pmCardsToolbar")}: ${e.name}`,children:[a.jsx(Jr,{compact:!0,ariaLabel:`${N("pmBoardViewMode")}: ${e.name}`,value:g.mode,items:[{value:"kanban",label:N("pmBoardModeKanban")},{value:"table",label:N("pmBoardModeTable")}],onChange:Z=>b({mode:Z})}),g.mode==="table"?a.jsxs("label",{className:"aops-pm-groupby is-compact",children:[a.jsx("span",{className:"aops-pm-groupby-label",children:N("pmGroupBy")}),a.jsx(Jr,{compact:!0,ariaLabel:`${N("pmGroupBy")}: ${e.name}`,value:g.groupBy,items:[{value:"column",label:N("pmGroupColumn")},{value:"sprint",label:N("pmGroupSprint")},{value:"none",label:N("pmGroupNone")}],onChange:Z=>b({groupBy:Z})})]}):null,a.jsx(fN,{columns:n,value:de,onChange:G,boardName:e.name,t:N}),a.jsxs("label",{className:"aops-pm-cards-search is-compact aops-pm-boardcard-search",children:[a.jsx("span",{className:"aops-pm-cards-search-icon","aria-hidden":!0,children:Kc}),a.jsx("input",{type:"search",value:oe,placeholder:N("pmCardBoardSearch"),"aria-label":`${N("pmCardBoardSearch")}: ${e.name}`,onChange:Z=>fe(Z.target.value),"data-testid":"aops-v2-boards-card-tasksearch"}),oe?a.jsx("button",{type:"button",className:"aops-pm-cards-search-clear","aria-label":N("pmCardBoardSearchClear"),title:N("pmCardBoardSearchClear"),onClick:()=>fe(""),children:mn}):null]}),a.jsxs("div",{className:"aops-pm-boardcard-viewrow-end",children:[g.mode==="table"&&g.groupBy!=="none"?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"aops-pm-cards-mini is-compact",onClick:()=>J(new Set),"data-testid":"aops-v2-boards-card-expandgroups",children:N("pmCardsExpandAll")}),a.jsx("button",{type:"button",className:"aops-pm-cards-mini is-compact",onClick:()=>J(new Set(O)),"data-testid":"aops-v2-boards-card-collapsegroups",children:N("pmCardsCollapseAll")})]}):null,a.jsxs("span",{className:"aops-pm-boardcard-count",children:[N("pmCountVisible"),": ",pe.length]})]})]}),g.mode==="kanban"?a.jsx(Hj,{boardId:e.id,boardName:e.name,columns:ke,tasksByColumn:_,sprintById:i,t:N}):a.jsx(qj,{tasks:pe,groupBy:g.groupBy,columns:Q,orderedColumns:ke,sprintById:i,collapsed:ye,onToggleGroup:re,locale:P,t:N})]}):null,a.jsx("span",{className:"aops-pm-boardcard-updated",children:tt(e.updatedAt,P)})]})}function yN({board:e,columns:n,model:r,onClose:i,locale:o,t:d}){const u=mj(r,e.id,!0),v=y.useMemo(()=>u.data??[],[u.data]),h=u.data!==void 0,m=y.useMemo(()=>new Map(n.map(j=>[j.id,j])),[n]),g=v.filter(j=>$j(j,m)).length,b=(e.description??"").trim();return a.jsxs("aside",{className:"aops-pm-cardpane","aria-label":d("pmCardPaneTitle"),"data-testid":"aops-v2-boards-cardpane",children:[a.jsxs("header",{className:"aops-pm-cardpane-head",children:[a.jsxs("div",{className:"aops-pm-cardpane-heading",children:[a.jsx("span",{className:"aops-pm-board-eyebrow",children:d("pmCardPaneTitle")}),a.jsx("h3",{className:"aops-pm-cardpane-title",children:e.name})]}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action","aria-label":d("pmCardPaneClose"),title:d("pmCardPaneClose"),onClick:i,"data-testid":"aops-v2-boards-cardpane-close",children:mn})]}),a.jsxs("div",{className:"aops-pm-cardpane-body",children:[a.jsxs("div",{className:"aops-pm-cardpane-chips",children:[e.slug?a.jsx("span",{className:"aops-pm-mono",children:e.slug}):null,a.jsxs("span",{className:"aops-pm-mono",children:["uid ",Oe(e.id)]}),dn(e)?a.jsx(ft,{tone:"ghost",children:d("navArchivedGroup")}):null]}),a.jsx("p",{className:`aops-pm-cardpane-desc${b?"":" is-empty"}`,children:b||d("pmCardPaneNoDescription")}),h?a.jsxs("div",{className:"aops-pm-board-summary",role:"list","aria-label":d("pmBoardSummary"),children:[a.jsx(Ha,{label:d("pmFieldColumn"),value:n.length}),a.jsx(Ha,{label:d("pmTasks"),value:v.length}),a.jsx(Ha,{label:d("pmCompleted"),value:g}),a.jsx(Ha,{label:d("pmOpenItems"),value:v.length-g})]}):a.jsx("div",{className:"aops-pm-boardcard-loading",role:"status",children:u.isError?It(u.error):d("pmCardTasksLoading")}),a.jsxs("section",{className:"aops-pm-cardpane-section",children:[a.jsx("h4",{children:d("pmCardPaneColumns")}),a.jsxs("div",{className:"aops-pm-cardpane-columns",children:[n.map(j=>{const C=v.filter(k=>k.boardColumnId===j.id).length;return a.jsxs("div",{className:"aops-pm-cardpane-column",children:[a.jsx("span",{className:"aops-pm-kanban-dot",style:{background:ul(j)},"aria-hidden":!0}),a.jsx("span",{className:"aops-pm-cardpane-column-name",children:j.name}),a.jsxs("span",{className:"aops-pm-cardpane-column-count",children:[C,j.wipLimit?`/${j.wipLimit}`:""]})]},j.id)}),n.length===0?a.jsx("p",{className:"aops-pm-cardpane-desc is-empty",children:d("pmNoRows")}):null]})]}),a.jsxs("dl",{className:"aops-pm-cardpane-dates",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("pmFieldCreated")}),a.jsx("dd",{children:tt(e.createdAt,o)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("pmFieldUpdated")}),a.jsx("dd",{children:tt(e.updatedAt,o)})]})]})]})]})}function bN({board:e,taskCount:n,columnCount:r,busy:i,error:o,onCancel:d,onConfirm:u,t:v}){y.useEffect(()=>{const b=j=>{j.key==="Escape"&&d()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[d]);const h=n!==null,m=!h||(n??0)>0||r>0,g=h?v("pmCardDeleteWarnOrphans").replace("{tasks}",String(n)).replace("{columns}",String(r)):v("pmCardDeleteWarnOrphansUnknown");return a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",onClick:d,children:a.jsxs("div",{className:"aops-v2-chat-modal aops-v2-chat-modal-sm",role:"dialog","aria-modal":"true","aria-label":v("pmCardDeleteTitle"),onClick:b=>b.stopPropagation(),"data-testid":"aops-v2-boards-delete-modal",children:[a.jsxs("header",{className:"aops-v2-chat-modal-head",children:[a.jsx("h4",{children:v("pmCardDeleteTitle")}),a.jsx("button",{type:"button",className:"aops-v2-chat-iconclose","aria-label":v("pmCardCancel"),onClick:d,children:"✕"})]}),a.jsxs("div",{className:"aops-v2-chat-modal-body",children:[a.jsxs("p",{className:"aops-pm-delete-board-line",children:[v("pmCardDeleteBoardLabel"),": ",a.jsx("b",{children:e.name}),e.slug?a.jsxs("span",{className:"aops-pm-mono",children:[" (",e.slug,")"]}):null]}),a.jsx("p",{className:"aops-v2-chat-muted",children:v("pmCardDeleteQuestion")}),a.jsx("p",{className:`aops-pm-delete-warn${m?" has-deps":""}`,children:m?g:v("pmCardDeleteNoDeps")}),o?a.jsx("p",{className:"aops-pm-delete-error",children:o}):null,a.jsxs("div",{className:"aops-pm-delete-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:d,disabled:i,children:v("pmCardCancel")}),a.jsx("button",{type:"button",className:"aops-v2-chat-danger-button",disabled:i,onClick:u,"data-testid":"aops-v2-boards-delete-confirm",children:v(i?"pmCardDeleteBusy":"pmCardDeleteConfirm")})]})]})]})})}function jN(e){const n=e.columnIds.filter(u=>u!==e.columnId),r=e.taskCount>0,i=r&&n.length===0,o=e.destination??"",d=r&&(o===""||o===e.columnId||!n.includes(o));return{needsDestination:r,nowhereToMove:i,destinationMissing:d,canRemove:!i&&!d,destinationCandidates:n}}function AN({board:e,columns:n,taskCountByColumnId:r,busy:i,error:o,onClose:d,onAdd:u,onRemove:v,onReorder:h,t:m}){const g=y.useMemo(()=>[...n].sort((Q,W)=>Q.position-W.position),[n]),[b,j]=y.useState(()=>g.map(Q=>Q.id)),[C,k]=y.useState(""),[x,S]=y.useState(""),[T,I]=y.useState(null),[E,L]=y.useState(""),[P,N]=y.useState(!1);y.useEffect(()=>{j(g.map(Q=>Q.id))},[g]),y.useEffect(()=>{const Q=W=>{W.key==="Escape"&&!i&&d()};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[i,d]);const R=y.useMemo(()=>new Map(g.map(Q=>[Q.id,Q])),[g]),z=b.length===g.length&&b.some((Q,W)=>g[W]?.id!==Q),ne=(Q,W)=>{const pe=Q+W;if(pe<0||pe>=b.length)return;const ke=[...b],[O]=ke.splice(Q,1);ke.splice(pe,0,O),j(ke)},ye=T?R.get(T)??null:null,J=ye?r.get(ye.id)??0:0,re=jN({columnId:ye?.id??"",columnIds:g.map(Q=>Q.id),taskCount:J,destination:E}),oe=g.filter(Q=>re.destinationCandidates.includes(Q.id)),{needsDestination:fe,nowhereToMove:de,destinationMissing:G}=re;return a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",onClick:()=>!i&&d(),children:a.jsxs("div",{className:"aops-v2-chat-modal",role:"dialog","aria-modal":"true","aria-label":`${m("pmColumnsTitle")}: ${e.name}`,onClick:Q=>Q.stopPropagation(),"data-testid":"aops-v2-columns-modal",children:[a.jsxs("header",{className:"aops-v2-chat-modal-head",children:[a.jsxs("h4",{children:[m("pmColumnsTitle")," ",a.jsxs("span",{className:"aops-v2-chat-muted",children:["— ",e.name]})]}),a.jsx("button",{type:"button",className:"aops-v2-chat-iconclose","aria-label":m("pmCardCancel"),onClick:d,disabled:i,children:"✕"})]}),a.jsxs("div",{className:"aops-v2-chat-modal-body aops-pm-columns",children:[g.length===0?a.jsx("p",{className:"aops-pm-cardpane-desc is-empty",children:m("pmColumnsEmpty")}):a.jsx("ol",{className:"aops-pm-columns-list","data-testid":"aops-v2-columns-list",children:b.map((Q,W)=>{const pe=R.get(Q);if(!pe)return null;const ke=r.get(pe.id)??0;return a.jsxs("li",{className:"aops-pm-columns-row",children:[a.jsx("span",{className:"aops-pm-columns-name",children:pe.name}),a.jsxs("span",{className:"aops-pm-columns-count",children:[ke,pe.wipLimit?`/${pe.wipLimit}`:""]}),a.jsxs("span",{className:"aops-pm-columns-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-cards-mini","aria-label":`${m("pmColumnsMoveUp")}: ${pe.name}`,onClick:()=>ne(W,-1),disabled:i||W===0,"data-testid":"aops-v2-columns-up",children:"↑"}),a.jsx("button",{type:"button",className:"aops-pm-cards-mini","aria-label":`${m("pmColumnsMoveDown")}: ${pe.name}`,onClick:()=>ne(W,1),disabled:i||W===b.length-1,"data-testid":"aops-v2-columns-down",children:"↓"}),a.jsx("button",{type:"button",className:"aops-pm-cards-mini","aria-label":`${m("pmColumnsRemove")}: ${pe.name}`,onClick:()=>{I(pe.id),L(""),N(!1)},disabled:i,"data-testid":"aops-v2-columns-remove",children:m("pmColumnsRemove")})]})]},pe.id)})}),z?a.jsx("div",{className:"aops-pm-columns-orderbar",children:a.jsx("button",{type:"button",className:"aops-pm-cards-mini theme-accent",onClick:()=>h(b),disabled:i,"data-testid":"aops-v2-columns-saveorder",children:m(i?"pmColumnsBusy":"pmColumnsSaveOrder")})}):null,ye?a.jsxs("section",{className:"aops-pm-columns-removal","data-testid":"aops-v2-columns-removal",children:[a.jsxs("p",{className:"aops-pm-columns-removal-head",children:[m("pmColumnsRemove"),": ",a.jsx("b",{children:ye.name})]}),J>0?a.jsx("p",{className:"aops-pm-delete-warn has-deps",children:m("pmColumnsHoldsTasks").replace("{count}",String(J))}):null,de?a.jsx("p",{className:"aops-pm-delete-error",children:m("pmColumnsLastColumn")}):fe?a.jsxs("label",{className:"aops-pm-boardeditor-field",children:[a.jsx("span",{className:"aops-pm-boardeditor-label",children:m("pmColumnsDestination")}),a.jsxs("select",{value:E,onChange:Q=>L(Q.target.value),onBlur:()=>N(!0),disabled:i,"aria-invalid":P&&G,"data-testid":"aops-v2-columns-destination",children:[a.jsx("option",{value:"",children:"—"}),oe.map(Q=>a.jsx("option",{value:Q.id,children:Q.name},Q.id))]}),P&&G?a.jsx("span",{className:"aops-pm-boardeditor-error",children:m("pmColumnsDestinationRequired")}):null]}):null,a.jsxs("div",{className:"aops-pm-delete-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:()=>I(null),disabled:i,children:m("pmCardCancel")}),a.jsx("button",{type:"button",className:"aops-v2-chat-danger-button",disabled:i||!re.canRemove,onClick:()=>{N(!0),re.canRemove&&(v(ye.id,fe?E:null),I(null))},"data-testid":"aops-v2-columns-remove-confirm",children:m(i?"pmColumnsBusy":"pmColumnsRemoveConfirm")})]})]}):null,a.jsxs("form",{className:"aops-pm-columns-add",onSubmit:Q=>{Q.preventDefault();const W=C.trim();if(!W||i)return;const pe=x.trim();u({name:W,wipLimit:pe===""?null:Number(pe)}),k(""),S("")},children:[a.jsxs("label",{className:"aops-pm-boardeditor-field",children:[a.jsx("span",{className:"aops-pm-boardeditor-label",children:m("pmColumnsAddName")}),a.jsx("input",{type:"text",value:C,onChange:Q=>k(Q.target.value),disabled:i,"data-testid":"aops-v2-columns-add-name"})]}),a.jsxs("label",{className:"aops-pm-boardeditor-field",children:[a.jsx("span",{className:"aops-pm-boardeditor-label",children:m("pmColumnsWipLimit")}),a.jsx("input",{type:"number",min:"0",value:x,onChange:Q=>S(Q.target.value),disabled:i,"data-testid":"aops-v2-columns-add-wip"}),a.jsx("span",{className:"aops-pm-boardeditor-hint",children:m("pmColumnsWipLimitHint")})]}),a.jsx("div",{className:"aops-pm-delete-actions",children:a.jsx("button",{type:"submit",className:"aops-pm-cards-mini theme-accent",disabled:i||C.trim()==="","data-testid":"aops-v2-columns-add",children:m(i?"pmColumnsBusy":"pmColumnsAdd")})})]}),o?a.jsx("p",{className:"aops-pm-delete-error",children:o}):null]})]})})}function xN({model:e,navigator:n,selectedBoardId:r,locale:i,t:o}){const d=e.selectedProject?.key??"__global__",[u,v]=y.useState(pN),[h,m]=y.useState(""),[g,b]=y.useState(!1),[j,C]=y.useState(0),k=y.useCallback(xe=>{v(Te=>{const Me=xe(Te);return hN(Me),Me})},[]),x=e.boards,S=y.useMemo(()=>new Set(u.favoritesByProject[d]??[]),[d,u.favoritesByProject]),T=y.useMemo(()=>new Set(u.expandedByProject[d]??[]),[d,u.expandedByProject]),I=u.sortKeyByProject[d]??"manual",E=u.sortDirectionByProject[d]??"asc",L=u.filterModeByProject[d]??"all",P=u.pageSizeByProject[d]??Ph;y.useEffect(()=>{C(0)},[d,h,L,I,E,P]);const N=y.useMemo(()=>new Map(e.sprints.map(xe=>[xe.id,xe])),[e.sprints]),R=hS({queries:x.map(xe=>({queryKey:hj(e.client.identity,e.sessionKey,e.selectedProject,xe.id),queryFn:async()=>e.client.get("/api/projectman/kanban-tasks",{board:xe.id}),enabled:!1,staleTime:5*6e4})),combine:xe=>new Map(x.map((Te,Me)=>[Te.id,xe[Me]?.data?.length]))}),z=y.useMemo(()=>{const xe=x.map(ze=>ze.id),Te=new Set(xe),Me=(u.orderByProject[d]??[]).filter(ze=>Te.has(ze)),Fe=new Set(Me);return[...Me,...xe.filter(ze=>!Fe.has(ze))]},[x,d,u.orderByProject]),ne=y.useMemo(()=>{const xe=h.trim().toLowerCase(),Te=new Map(z.map((Fe,ze)=>[Fe,ze])),Me=E==="asc"?1:-1;return x.filter(Fe=>!(L==="favorites"&&!S.has(Fe.id)||L==="withTasks"&&R.get(Fe.id)===0||xe&&!`${Fe.name} ${Fe.slug??""}`.toLowerCase().includes(xe))).sort((Fe,ze)=>{const Mt=S.has(Fe.id),ca=S.has(ze.id);if(Mt!==ca)return Mt?-1:1;if(I==="manual")return((Te.get(Fe.id)??0)-(Te.get(ze.id)??0))*Me;if(I==="name")return Fe.name.localeCompare(ze.name,void 0,{numeric:!0,sensitivity:"base"})*Me;const Ct=Date.parse(Fe[I]??"")||0,ut=Date.parse(ze[I]??"")||0;return(Ct-ut)*Me})},[R,x,S,L,z,h,E,I]),ye=y.useCallback(xe=>k(Te=>{const Me=Te.favoritesByProject[d]??[],Fe=Me.includes(xe)?Me.filter(ze=>ze!==xe):[...Me,xe];return{...Te,favoritesByProject:{...Te.favoritesByProject,[d]:Fe}}}),[k,d]),J=y.useCallback((xe,Te)=>k(Me=>{const Fe=x.map(_t=>_t.id),ze=new Set(Fe),Mt=(Me.orderByProject[d]??[]).filter(_t=>ze.has(_t)),ca=new Set(Mt),Ct=[...Mt,...Fe.filter(_t=>!ca.has(_t))],ut=Ct.indexOf(xe),Jt=Te==="up"?ut-1:ut+1;return ut<0||Jt<0||Jt>=Ct.length?Me:([Ct[ut],Ct[Jt]]=[Ct[Jt],Ct[ut]],{...Me,orderByProject:{...Me.orderByProject,[d]:Ct},sortKeyByProject:{...Me.sortKeyByProject,[d]:"manual"},sortDirectionByProject:{...Me.sortDirectionByProject,[d]:"asc"}})}),[x,k,d]),re=y.useCallback(xe=>k(Te=>{const Me=Te.expandedByProject[d]??[],Fe=Me.includes(xe)?Me.filter(ze=>ze!==xe):[...Me,xe];return{...Te,expandedByProject:{...Te.expandedByProject,[d]:Fe}}}),[k,d]),oe=y.useCallback(xe=>k(Te=>({...Te,expandedByProject:{...Te.expandedByProject,[d]:xe?x.map(Me=>Me.id):[]}})),[x,k,d]),fe=y.useCallback(xe=>k(Te=>({...Te,filterModeByProject:{...Te.filterModeByProject,[d]:xe}})),[k,d]),de=y.useCallback((xe,Te)=>k(Me=>({...Me,sortKeyByProject:{...Me.sortKeyByProject,[d]:xe},sortDirectionByProject:{...Me.sortDirectionByProject,[d]:Te}})),[k,d]),G=y.useCallback(xe=>k(Te=>({...Te,pageSizeByProject:{...Te.pageSizeByProject,[d]:xe}})),[k,d]),Q=u.bodyViewByProject[d]??{},W=y.useCallback((xe,Te)=>k(Me=>{const Fe=Me.bodyViewByProject[d]??{},ze=Fe[xe]??qy;return{...Me,bodyViewByProject:{...Me.bodyViewByProject,[d]:{...Fe,[xe]:{...ze,...Te}}}}}),[k,d]),pe=y.useCallback(xe=>{n.selectRecord(xe),b(!0)},[n]),[ke,O]=y.useState(null),[_,K]=y.useState(null),[ee,ve]=y.useState(null),[se,Z]=y.useState(!1),[ae,ce]=y.useState(null),[w,F]=y.useState(null),[X,D]=y.useState(!1),[B,U]=y.useState(null),[H,q]=y.useState(null),[V,be]=y.useState(!1),[ge,Se]=y.useState(null),Ne=y.useCallback(async xe=>{be(!0),Se(null);try{await xe(),e.refresh()}catch(Te){Se(It(Te))}finally{be(!1)}},[e]),we=y.useCallback(xe=>{if(!H)return;const Te=(e.columnsByBoard[H.id]??[]).length;Ne(()=>Kw(e.client,H.id,xe,Te))},[H,e,Ne]),Be=y.useCallback((xe,Te)=>{if(!H)return;const Me=e.tasks.filter(Fe=>Fe.boardColumnId===xe).map(Fe=>Fe.id);Ne(()=>zw(e.client,{placementId:xe,taskIds:Me,targetPlacementId:Te}))},[H,e,Ne]),Je=y.useCallback(xe=>{H&&Ne(()=>$w(e.client,H.id,xe))},[H,e,Ne]),Ke=y.useCallback(async xe=>{if(w){D(!0),U(null);try{w==="create"?await pj(e.client,xe):await Fw(e.client,w.id,xe),F(null),e.refresh()}catch(Te){U(It(Te))}finally{D(!1)}}},[w,e]),Xe=y.useCallback(async xe=>{O(xe.id),K(null);try{dn(xe)?await Uw(e.client,xe.id):await Qw(e.client,xe.id),e.refresh()}catch(Te){K(`${o("pmCardActionFailed")}: ${It(Te)}`)}finally{O(null)}},[e,o]),Et=y.useCallback(async()=>{if(ee){Z(!0),ce(null);try{await Pw(e.client,ee.id),ve(null),e.refresh()}catch(xe){ce(It(xe))}finally{Z(!1)}}},[ee,e]),vt=g?x.find(xe=>xe.id===r)??null:null,Ee=Dc({total:ne.length,page:j,pageSize:P}).currentPage*P,Le=ne.slice(Ee,Ee+P);return a.jsxs("div",{className:"aops-pm-cards-view","data-testid":"aops-v2-boards-cards",children:[a.jsxs("div",{className:"aops-pm-cards-toolbar",role:"toolbar","aria-label":o("pmCardsToolbar"),children:[a.jsxs("div",{className:"aops-pm-cards-toolbar-lead",children:[a.jsx(mN,{filterMode:L,onSetFilterMode:fe,t:o}),a.jsx(Gh,{sortKey:I,sortDirection:E,onSetSort:de,t:o}),a.jsxs("label",{className:"aops-pm-cards-search",children:[a.jsx("span",{className:"aops-pm-cards-search-icon","aria-hidden":!0,children:Kc}),a.jsx("input",{type:"search",value:h,placeholder:o("pmNavSearchBoards"),"aria-label":o("pmNavFilterBoards"),onChange:xe=>m(xe.target.value),"data-testid":"aops-v2-boards-cards-search"}),h?a.jsx("button",{type:"button",className:"aops-pm-cards-search-clear","aria-label":o("pmCardsSearchClear"),title:o("pmCardsSearchClear"),onClick:()=>m(""),children:mn}):null]})]}),a.jsxs("div",{className:"aops-pm-cards-toolbar-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-cards-mini theme-accent",onClick:()=>{U(null),F("create")},"data-testid":"aops-v2-boards-create",children:o("pmBoardEditorNew")}),a.jsx("span",{className:"aops-pm-cards-toolbar-sep","aria-hidden":!0}),a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:()=>oe(!0),children:o("pmCardsExpandAll")}),a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:()=>oe(!1),children:o("pmCardsCollapseAll")})]})]}),_?a.jsxs("div",{className:"aops-pm-cards-error",role:"alert",children:[a.jsx("span",{children:_}),a.jsx("button",{type:"button",className:"aops-pm-cards-search-clear","aria-label":o("pmCardCancel"),onClick:()=>K(null),children:mn})]}):null,a.jsxs("div",{className:`aops-pm-cards-layout${vt?" has-pane":""}`,children:[a.jsxs("div",{className:"aops-pm-cards-list",children:[Le.map((xe,Te)=>{const Me=Ee+Te;return a.jsx(gN,{board:xe,columns:e.columnsByBoard[xe.id]??[],model:e,sprintById:N,isFavorite:S.has(xe.id),isExpanded:T.has(xe.id),isSelected:!!(vt&&xe.id===vt.id),canMoveUp:Me>0,canMoveDown:Me<ne.length-1,menuBusy:ke===xe.id,bodyView:Q[xe.id]??qy,onSetBodyView:Fe=>W(xe.id,Fe),onToggleExpanded:()=>re(xe.id),onToggleFavorite:()=>ye(xe.id),onMoveUp:()=>J(xe.id,"up"),onMoveDown:()=>J(xe.id,"down"),onOpenDetail:()=>pe(xe.id),onToggleArchive:()=>{Xe(xe)},onRequestColumns:()=>{Se(null),q(xe)},onRequestEdit:()=>{U(null),F(xe)},onRequestDelete:()=>{ce(null),ve(xe)},locale:i,t:o},xe.id)}),ne.length===0?a.jsx("div",{className:"aops-pm-cards-empty",children:o("pmCardsEmpty")}):null,ne.length>0?a.jsx(qh,{total:ne.length,page:j,pageSize:P,visibleCount:Le.length,onPageChange:C,onPageSizeChange:G,t:o}):null]}),vt?a.jsx(yN,{board:vt,columns:e.columnsByBoard[vt.id]??[],model:e,onClose:()=>b(!1),locale:i,t:o}):null]}),H?a.jsx(AN,{board:H,columns:e.columnsByBoard[H.id]??[],taskCountByColumnId:new Map((e.columnsByBoard[H.id]??[]).map(xe=>[xe.id,e.tasks.filter(Te=>Te.boardColumnId===xe.id).length])),busy:V,error:ge,onClose:()=>{V||q(null)},onAdd:we,onRemove:Be,onReorder:Je,t:o}):null,w?a.jsx(fj,{board:w==="create"?null:w,busy:X,error:B,onCancel:()=>{X||F(null)},onSubmit:xe=>{Ke(xe)},t:o}):null,ee?a.jsx(bN,{board:ee,taskCount:R.get(ee.id)??null,columnCount:e.columnsByBoard[ee.id]?.length??0,busy:se,error:ae,onCancel:()=>{se||ve(null)},onConfirm:()=>{Et()},t:o}):null]})}const CN='a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])';function kN({model:e,navigator:n,selectedBoardId:r,locale:i,t:o}){const[d,u]=y.useState("kanban"),[v,h]=y.useState("column"),[m,g]=y.useState(()=>new Set),[b,j]=y.useState(null),C=y.useId(),k=y.useRef(null),x=y.useRef(null),S=y.useRef(null),T=re=>g(oe=>{const fe=new Set(oe);return fe.has(re)?fe.delete(re):fe.add(re),fe}),I=X0(e),E=y.useMemo(()=>new Map(e.sprints.map(re=>[re.id,re])),[e.sprints]),L=e.boards.find(re=>re.id===r)??null,P=L?e.columnsByBoard[L.id]??[]:[],N=y.useMemo(()=>L?e.tasks.filter(re=>re.boardId===L.id).slice().sort((re,oe)=>(re.position??0)-(oe.position??0)):[],[e.tasks,L]),R=y.useMemo(()=>{const re=new Map;for(const oe of N){const fe=oe.boardColumnId&&I.has(oe.boardColumnId)?oe.boardColumnId:"unassigned";re.set(fe,[...re.get(fe)??[],oe])}return re},[I,N]),z=N.filter(re=>$j(re,I)).length,ne=y.useCallback((re,oe)=>{S.current=oe,j(re)},[]),ye=y.useCallback(()=>{const re=S.current;j(null),re?.focus()},[]);y.useEffect(()=>{j(null),S.current=null},[r]),y.useLayoutEffect(()=>{b&&x.current?.focus()},[b]),y.useEffect(()=>{if(!b)return;const re=oe=>{if(oe.key==="Escape"){oe.preventDefault(),ye();return}if(oe.key!=="Tab")return;const fe=k.current;if(!fe)return;const de=[...fe.querySelectorAll(CN)].filter(pe=>pe.tabIndex>=0&&!pe.hasAttribute("disabled"));if(de.length===0)return;const G=de[0],Q=de[de.length-1],W=document.activeElement;if(!(W instanceof HTMLElement)||!fe.contains(W)){oe.preventDefault(),(oe.shiftKey?Q:G).focus();return}oe.shiftKey&&W===G?(oe.preventDefault(),Q.focus()):!oe.shiftKey&&W===Q&&(oe.preventDefault(),G.focus())};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[ye,b]);const J=L?a.jsxs("div",{className:"aops-pm-board-detail",children:[a.jsxs("div",{className:"aops-pm-board-toolbar",children:[a.jsxs("div",{className:"aops-pm-board-toolbar-id",children:[a.jsx("span",{className:"aops-pm-board-eyebrow",children:o("pmBoardsTitle")}),a.jsx("h3",{className:"aops-pm-board-title",children:L.name})]}),a.jsx(Jr,{ariaLabel:o("pmBoardViewMode"),value:d,items:[{value:"kanban",label:o("pmBoardModeKanban")},{value:"vertical",label:o("pmBoardModeVertical")},{value:"table",label:o("pmBoardModeTable")}],onChange:re=>u(re)})]}),a.jsxs("div",{className:"aops-pm-board-summary",role:"list","aria-label":o("pmBoardSummary"),children:[a.jsx(Ha,{label:o("pmFieldColumn"),value:P.length}),a.jsx(Ha,{label:o("pmTasks"),value:N.length}),a.jsx(Ha,{label:o("pmCompleted"),value:z}),a.jsx(Ha,{label:o("pmOpenItems"),value:N.length-z})]}),d!=="table"?a.jsx(Hj,{boardId:L.id,boardName:L.name,columns:P,tasksByColumn:R,sprintById:E,onOpenTask:ne,orientation:d==="vertical"?"vertical":"horizontal",t:o}):a.jsxs("div",{className:"aops-pm-table-stage",children:[a.jsx("div",{className:"aops-pm-table-tools",children:a.jsxs("label",{className:"aops-pm-groupby",children:[a.jsx("span",{className:"aops-pm-groupby-label",children:o("pmGroupBy")}),a.jsx(Jr,{ariaLabel:o("pmGroupBy"),value:v,items:[{value:"column",label:o("pmGroupColumn")},{value:"sprint",label:o("pmGroupSprint")},{value:"none",label:o("pmGroupNone")}],onChange:re=>h(re)})]})}),a.jsx(qj,{tasks:N,groupBy:v,columns:I,orderedColumns:P,sprintById:E,collapsed:m,onToggleGroup:T,onOpenTask:ne,locale:i,t:o})]}),b?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"aops-pm-task-drilldown-backdrop","aria-hidden":"true",onClick:ye}),a.jsxs("section",{ref:k,className:"aops-pm-task-drilldown",role:"dialog","aria-modal":"true","aria-labelledby":C,children:[a.jsxs("header",{className:"aops-pm-task-drilldown-head",children:[a.jsxs("button",{ref:x,type:"button",className:"aops-pm-task-drilldown-back",onClick:ye,"aria-label":o("pmTaskDrilldownBack"),children:[a.jsx("span",{"aria-hidden":!0,children:"←"}),a.jsx("span",{children:o("pmTaskDrilldownBack")})]}),a.jsx(ft,{tone:b.progress===100?"sage":"amber",children:eh(b)})]}),a.jsx("span",{className:"aops-pm-mono",children:b.taskCode??b.id.slice(0,8)}),a.jsx("h3",{id:C,children:b.title}),a.jsx("p",{className:"aops-pm-description",children:b.description||o("pmTaskNoDescription")}),a.jsxs("dl",{className:"aops-pm-detail-grid",children:[a.jsx(Xo,{label:o("pmFieldColumn"),value:b.boardColumnId?I.get(b.boardColumnId)?.name??o("pmUnassigned"):o("pmUnassigned"),t:o}),a.jsx(Xo,{label:o("pmFieldSprint"),value:Xr(b,E,o),t:o}),b.status&&!/unknown|none/i.test(b.status)?a.jsx(Xo,{label:o("pmFieldStatus"),value:b.status,t:o}):null,a.jsx(Xo,{label:o("pmFieldProgress"),value:eh(b),t:o})]})]})]}):null]}):a.jsx(it,{variant:"empty",title:o("pmBoardsTitle"),message:o("pmNoRows")});return n.isCardsMode?a.jsx("div",{className:"aops-pm-board-view is-cards",children:a.jsx(xN,{model:e,navigator:n,selectedBoardId:r,locale:i,t:o})}):n.isDropdownMode?a.jsxs("div",{className:"aops-pm-board-view is-dropdown",children:[a.jsx("div",{className:"aops-pm-board-navrow",children:n.dropdownNode}),J]}):a.jsx("div",{className:"aops-pm-board-view",children:a.jsx(Oc,{controller:n.controller,navigator:n.treePanel,navigatorLabel:o("pmBoardsTitle"),className:"aops-pm-board-recordlayout",contentClassName:"aops-pm-board-recordcontent",content:J})})}function SN({phases:e,openPhases:n,t:r,onToggle:i}){return e.length?a.jsx("div",{className:"aops-pm-phase-list",children:e.map(o=>{const d=Uh(o.microtasks??[]),u=d.filter(h=>gs(h.status)).length,v=n[o.id]??!0;return a.jsxs("section",{className:"aops-pm-phase",children:[a.jsxs("button",{type:"button",className:"aops-pm-phase-head","aria-expanded":v,onClick:()=>i(o.id),children:[a.jsx("span",{children:v?"-":"+"}),a.jsx("b",{children:o.name}),a.jsxs(ft,{tone:u===d.length&&d.length>0?"sage":"amber",children:[u,"/",d.length]})]}),v?a.jsxs("div",{className:"aops-pm-phase-body",children:[o.description?a.jsx("p",{children:o.description}):null,d.map(h=>a.jsxs("div",{className:`aops-pm-microtask${gs(h.status)?" aops-pm-microtask--done":""}`,children:[a.jsx("span",{className:"aops-pm-microtask-state","aria-hidden":"true"}),a.jsxs("span",{className:"aops-pm-microtask-main",children:[a.jsx("b",{children:h.title}),h.notes?a.jsx("small",{children:h.notes}):null]}),a.jsx(ft,{tone:ja(h.status),children:h.status??"todo"})]},h.id)),d.length===0?a.jsx(_n,{t:r}):null]}):null]},o.id)})}):a.jsx("div",{className:"aops-pm-empty-line",children:r("pmPhasesEmpty")})}function vp({title:e,rows:n}){return a.jsxs("section",{className:"aops-pm-text-list",children:[a.jsx("h4",{children:e}),a.jsx("ul",{children:n.map(r=>a.jsx("li",{children:r},r))})]})}const wN=new Set(["doing","in_progress","in_review","blocked","paused"]),Vh=new Set(["blocked","failed"]),NN=new Set(["cancelled"]);function kl(e){return(e??"todo").trim().toLowerCase().replace(/-/g,"_")||"todo"}function IN(e){return gs(e)||NN.has(kl(e))}function EN(e){const n=e.map(u=>{const v=Uh(u.microtasks??[]),h=v.filter(j=>gs(j.status)).length,m=v.filter(j=>Vh.has(kl(j.status))).length,g=v.length>0&&v.every(j=>IN(j.status)),b=v.some(j=>wN.has(kl(j.status)));return{phase:u,microtasks:v,completed:h,blocked:m,settled:g,hasActiveWork:b}}),r=n.findIndex(u=>u.hasActiveWork),i=n.findIndex(u=>!u.settled),o=r>=0?r:i,d=n.some(u=>!u.settled);return n.map((u,v)=>{let h;return u.settled?h="complete":u.microtasks.length===0?h=v===o&&d?"current":"unplanned":v===o&&u.blocked>0?h="blocked":v===o?h="current":h="upcoming",{...u,ordinal:v+1,state:h}})}function MN(e,n){return n(e==="complete"?"pmTimelineComplete":e==="current"?"pmTimelineCurrent":e==="blocked"?"pmTimelineBlocked":e==="unplanned"?"pmTimelineUnplanned":"pmTimelineUpcoming")}function TN(e){return e==="complete"?"sage":e==="blocked"?"claret":e==="current"?"amber":"ghost"}function BN({status:e}){const n=kl(e),r=gs(e),i=Vh.has(n);return a.jsx("span",{className:`aops-pm-timeline-task-icon${r?" is-done":""}${i?" is-blocked":""}`,"aria-hidden":"true",children:r?"✓":i?"!":""})}function DN({detail:e,visiblePhases:n,compact:r,t:i}){const o=EN(e.phases),d=new Set(n.map(S=>S.id)),u=o.filter(S=>d.has(S.phase.id)),v=o.flatMap(S=>S.microtasks),h=v.filter(S=>gs(S.status)).length,m=v.filter(S=>Vh.has(kl(S.status))).length,g=o.filter(S=>S.settled).length,b=o.findIndex(S=>S.state==="current"||S.state==="blocked"),j=b>=0?o[b]:null,C=o.find((S,T)=>T>b&&!S.settled)??null,k=e.progress?.ratio,x=Math.max(0,Math.min(100,Math.round(typeof k=="number"?k*100:v.length>0?h/v.length*100:0)));return a.jsxs("section",{className:`aops-pm-timeline${r?" is-compact":""}`,"aria-label":i("pmTimelineTitle"),"data-testid":"aops-v2-sprint-timeline",children:[a.jsxs("div",{className:"aops-pm-timeline-overview",children:[a.jsxs("div",{className:"aops-pm-timeline-progress-card",children:[a.jsxs("div",{className:"aops-pm-timeline-progress-head",children:[a.jsxs("span",{children:[a.jsx("small",{children:i("pmTimelineEyebrow")}),a.jsx("strong",{children:i("pmTimelineTitle")})]}),a.jsxs("b",{children:[x,"%"]})]}),a.jsx("p",{children:i("pmTimelineSubtitle")}),a.jsx("div",{className:"aops-pm-timeline-progress-track",role:"progressbar","aria-label":i("pmTimelineProgress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x,children:a.jsx("span",{style:{width:`${x}%`}})}),a.jsxs("div",{className:"aops-pm-timeline-facts",children:[a.jsxs("span",{children:[a.jsxs("b",{children:[h,"/",v.length]}),i("pmTimelineCompletedTasks")]}),a.jsxs("span",{children:[a.jsxs("b",{children:[g,"/",o.length]}),i("pmTimelineCompletedPhases")]}),a.jsxs("span",{className:m>0?"has-blocker":"",children:[a.jsx("b",{children:m}),i("pmTimelineBlocked")]})]})]}),a.jsxs("div",{className:"aops-pm-timeline-context-card is-current",children:[a.jsx("span",{className:"aops-pm-timeline-context-icon","aria-hidden":"true",children:"◎"}),a.jsx("small",{children:i("pmTimelineCurrent")}),a.jsx("strong",{children:j?.phase.name??i("pmTimelineFinished")}),j?a.jsxs("span",{children:[j.completed,"/",j.microtasks.length," ",i("pmTimelineTasks")]}):null]}),a.jsxs("div",{className:"aops-pm-timeline-context-card is-next",children:[a.jsx("span",{className:"aops-pm-timeline-context-icon","aria-hidden":"true",children:"→"}),a.jsx("small",{children:i("pmTimelineNext")}),a.jsx("strong",{children:C?.phase.name??i("pmTimelineFinishLine")}),C?a.jsxs("span",{children:[C.microtasks.length," ",i("pmTimelineTasks")]}):null]})]}),a.jsx("ol",{className:"aops-pm-timeline-list",children:u.map(S=>a.jsxs("li",{className:"aops-pm-timeline-phase","data-state":S.state,"data-testid":"aops-v2-sprint-timeline-phase",children:[a.jsx("div",{className:"aops-pm-timeline-rail","aria-hidden":"true",children:a.jsx("span",{children:S.state==="complete"?"✓":S.ordinal})}),a.jsxs("article",{className:"aops-pm-timeline-phase-card",children:[a.jsxs("header",{className:"aops-pm-timeline-phase-head",children:[a.jsxs("div",{children:[a.jsxs("span",{className:"aops-pm-timeline-step",children:[i("pmTimelinePhase")," ",String(S.ordinal).padStart(2,"0")]}),a.jsx("h4",{children:S.phase.name})]}),a.jsx(ft,{tone:TN(S.state),children:MN(S.state,i)})]}),S.phase.description?a.jsx("p",{children:S.phase.description}):null,a.jsxs("div",{className:"aops-pm-timeline-phase-progress",children:[a.jsx("span",{children:a.jsx("i",{style:{width:`${S.microtasks.length?Math.round(S.completed/S.microtasks.length*100):0}%`}})}),a.jsxs("small",{children:[S.completed,"/",S.microtasks.length," ",i("pmTimelineTasks")]})]}),S.microtasks.length>0?a.jsx("ul",{className:"aops-pm-timeline-tasks",children:S.microtasks.map(T=>a.jsxs("li",{children:[a.jsx(BN,{status:T.status}),a.jsxs("span",{className:"aops-pm-timeline-task-copy",children:[a.jsx("b",{children:T.title}),T.notes?a.jsx("small",{children:T.notes}):null]}),a.jsx(ft,{tone:ja(T.status),children:T.status??"todo"})]},T.id))}):a.jsx("div",{className:"aops-pm-timeline-no-tasks",children:i("pmTimelineNoTasks")})]})]},S.phase.id))})]})}const RN={todo:"pmRollupTodo",doing:"pmRollupDoing",blocked:"pmRollupBlocked",paused:"pmRollupPaused",in_review:"pmRollupInReview",postponed:"pmRollupPostponed",cancelled:"pmRollupCancelled",completed:"pmRollupCompleted"};function Yh({detail:e,t:n}){return e.phases.length?a.jsx("div",{className:"aops-pm-sprint-rollup",role:"list","aria-label":n("pmFieldStatus"),children:W0(e).map(r=>a.jsxs("span",{role:"listitem",className:`aops-pm-rollup-item${r.value>0?" has-count":""}${r.id==="completed"&&r.total&&r.value>=r.total?" is-done":""}`,children:[a.jsx("span",{className:"aops-pm-rollup-label",children:n(RN[r.id])}),a.jsx("span",{className:"aops-pm-rollup-count",children:r.id==="completed"?`${r.value}/${r.total??0}`:r.value})]},r.id))}):null}function Xj({detail:e,activeTab:n,onTab:r,phaseView:i,onPhaseView:o,openPhases:d,onTogglePhase:u,onSetAllPhases:v,microtaskQuery:h,onMicrotaskQuery:m,linkedTaskTitle:g,sprintTasks:b,compact:j=!1,t:C}){const k=(e.taskId?1:0)+b.length,x=(h??"").trim().toLowerCase(),S=x?e.phases.map(E=>({...E,microtasks:(E.microtasks??[]).filter(L=>`${L.title} ${L.notes??""}`.toLowerCase().includes(x))})).filter(E=>(E.microtasks??[]).length>0):e.phases,T=x?Object.fromEntries(S.map(E=>[E.id,!0])):d,I=[{id:"phases",label:C("pmPhasesTab"),count:e.phases.length||null},{id:"scope",label:C("pmScopeTitle"),count:e.scope.length||null},{id:"validation",label:C("pmValidationTitle"),count:e.validationPlan.length||null},{id:"references",label:C("pmReferencesTab"),count:e.references.length||null},{id:"tasks",label:C("pmTasksTab"),count:k||null}];return a.jsxs(a.Fragment,{children:[a.jsx(Oh,{className:"aops-pm-detail-tabs",items:I,activeId:n,onChange:E=>r(E),ariaLabel:C("pmSprintsPlansTitle")}),a.jsx("div",{className:"aops-pm-tabbody",children:n==="phases"?a.jsx(LN,{detail:e,phases:S,allEmpty:e.phases.length===0,phaseView:i,onPhaseView:o,openPhases:T,onTogglePhase:u,onSetAllPhases:v,microtaskQuery:h,onMicrotaskQuery:m,compact:j,t:C}):n==="scope"?e.scope.length?a.jsx(vp,{title:C("pmScopeTitle"),rows:e.scope}):a.jsx(_n,{t:C}):n==="validation"?e.validationPlan.length?a.jsx(vp,{title:C("pmValidationTitle"),rows:e.validationPlan}):a.jsx(_n,{t:C}):n==="references"?e.references.length?a.jsx(vp,{title:C("pmReferencesTab"),rows:e.references}):a.jsx(_n,{t:C}):a.jsx(_N,{linkedTaskTitle:g,tasks:b,t:C})})]})}function LN({detail:e,phases:n,allEmpty:r,phaseView:i,onPhaseView:o,openPhases:d,onTogglePhase:u,onSetAllPhases:v,microtaskQuery:h,onMicrotaskQuery:m,compact:g,t:b}){if(r)return a.jsx(_n,{t:b});const j=!!(h??"").trim();return a.jsxs("div",{className:"aops-pm-phases",children:[a.jsxs("div",{className:"aops-pm-phases-toolbar",children:[a.jsx(Jr,{compact:g,ariaLabel:b("pmPhaseView"),value:i,items:[{value:"timeline",label:b("pmPhaseTimeline")},{value:"accordion",label:b("pmPhaseAccordion")},{value:"table",label:b("pmPhaseTable")}],onChange:C=>o(C)}),m?a.jsxs("label",{className:`aops-pm-cards-search aops-pm-boardcard-search${g?" is-compact":""}`,children:[a.jsx("input",{type:"search",value:h??"",placeholder:b("pmSprintMicrotaskSearch"),"aria-label":b("pmSprintMicrotaskSearch"),onChange:C=>m(C.target.value),"data-testid":"aops-v2-sprints-card-mtsearch"}),j?a.jsx("button",{type:"button",className:"aops-pm-cards-search-clear","aria-label":b("pmSprintMicrotaskSearchClear"),title:b("pmSprintMicrotaskSearchClear"),onClick:()=>m(""),children:"✕"}):null]}):null,v?a.jsxs("div",{className:"aops-pm-boardcard-viewrow-end",children:[a.jsx("button",{type:"button",className:`aops-pm-cards-mini${g?" is-compact":""}`,onClick:()=>v(!0),"data-testid":"aops-v2-sprints-card-expandphases",children:b("pmCardsExpandAll")}),a.jsx("button",{type:"button",className:`aops-pm-cards-mini${g?" is-compact":""}`,onClick:()=>v(!1),"data-testid":"aops-v2-sprints-card-collapsephases",children:b("pmCardsCollapseAll")})]}):null]}),j&&n.length===0?a.jsx(_n,{t:b}):i==="timeline"?a.jsx(DN,{detail:e,visiblePhases:n,compact:g,t:b}):i==="accordion"?a.jsx(SN,{phases:n,openPhases:d,t:b,onToggle:u}):a.jsx(ON,{phases:n,collapsed:d,onToggle:u,t:b})]})}function ON({phases:e,collapsed:n,onToggle:r,t:i}){return a.jsx("div",{className:"aops-pm-grouptable-wrap aops-pm-phase-grouptable",children:a.jsxs("div",{className:"aops-pm-grouptable",role:"table","aria-label":i("pmPhasesTab"),children:[a.jsxs("div",{className:"aops-pm-grouptable-headrow",role:"row",children:[a.jsx("span",{className:"gt-task",children:i("pmPhaseChecklistItem")}),a.jsx("span",{className:"gt-status",children:i("pmFieldStatus")}),a.jsx("span",{className:"gt-last",children:i("pmPhaseNotes")})]}),e.map(o=>{const d=o.microtasks??[],u=n[o.id]??!0;return a.jsxs(y.Fragment,{children:[a.jsxs("button",{type:"button",className:"aops-pm-grouptable-group","aria-expanded":u,onClick:()=>r(o.id),children:[a.jsx("svg",{className:`aops-pm-grouptable-caret${u?" is-open":""}`,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})}),a.jsx("span",{className:"aops-pm-grouptable-group-name",children:o.name}),a.jsx("span",{className:"aops-pm-grouptable-group-count",children:d.length})]}),u?d.map(v=>{const h=(v.status??"").trim();return a.jsxs("div",{className:"aops-pm-grouptable-row aops-pm-phase-row",role:"row",children:[a.jsx("span",{className:"gt-task",children:a.jsx("span",{className:"gt-task-title",children:v.title})}),a.jsx("span",{className:"gt-status",children:h?a.jsx(ft,{tone:ja(h),children:h}):a.jsx("span",{className:"aops-pm-muted",children:"—"})}),a.jsx("span",{className:"gt-last",children:v.notes||"—"})]},v.id)}):null]},o.id)})]})})}function _N({linkedTaskTitle:e,tasks:n,t:r}){return!e&&n.length===0?a.jsx(_n,{t:r}):a.jsxs("ul",{className:"aops-pm-sprint-tasks",children:[e?a.jsxs("li",{className:"aops-pm-sprint-task is-linked",children:[a.jsx("span",{className:"aops-pm-sprint-task-title",children:e}),a.jsx(ft,{tone:"indigo",children:r("pmFieldLinkedTask")})]}):null,n.map(i=>{const o=(i.status??"").trim();return a.jsxs("li",{className:"aops-pm-sprint-task",children:[a.jsx("span",{className:"aops-pm-sprint-task-title",children:i.title}),o?a.jsx(ft,{tone:ja(o),children:o}):null]},i.id)})]})}const Vy={tab:"phases",phaseView:"timeline"},Wj="aops-cockpit-v2.sprints.cardsUi",ec={orderByProject:{},favoritesByProject:{},expandedByProject:{},sortKeyByProject:{},sortDirectionByProject:{},filterModeByProject:{},bodyViewByProject:{},pageSizeByProject:{}},QN=["all","sprints","plans","favorites"];function UN(){if(typeof window>"u")return ec;try{const e=window.localStorage.getItem(Wj);if(!e)return ec;const n=JSON.parse(e);return{...ec,...n}}catch{return ec}}function PN(e){try{typeof window<"u"&&window.localStorage.setItem(Wj,JSON.stringify(e))}catch{}}function Zj(e){const n=e.progress,r=typeof n?.total=="number"&&n.total>=0?n.total:e.phases.reduce((d,u)=>d+(u.microtasks?.length??0),0),i=typeof n?.completed=="number"?n.completed:null,o=typeof n?.ratio=="number"&&n.ratio>=0?n.ratio:i!==null&&r>0?i/r:null;return o===null?null:Math.round(Math.max(0,Math.min(1,o))*100)}function FN({archived:e,busy:n,onToggleArchive:r,onRequestDelete:i,t:o}){const{open:d,setOpen:u,rootRef:v}=bs();return a.jsxs("div",{className:"aops-pm-boardcard-menuwrap",ref:v,children:[a.jsx("button",{type:"button",className:`aops-pm-boardcard-action${d?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":d,"aria-label":o("pmCardMenu"),title:o("pmCardMenu"),disabled:n,onClick:()=>u(h=>!h),"data-testid":"aops-v2-sprints-card-menu",children:Kh}),d?a.jsxs("div",{className:"aops-pm-cards-popmenu is-right",role:"menu",children:[a.jsxs("button",{type:"button",role:"menuitem",className:"aops-pm-cards-popmenu-option",onClick:()=>{u(!1),r()},"data-testid":"aops-v2-sprints-card-archive",children:[a.jsx("span",{className:"aops-pm-cards-popmenu-option-icon",children:Jj}),a.jsx("span",{className:"aops-pm-cards-popmenu-option-copy",children:a.jsx("b",{children:o(e?"pmSprintUnarchive":"pmSprintArchive")})})]}),a.jsxs("button",{type:"button",role:"menuitem",className:"aops-pm-cards-popmenu-option is-danger",onClick:()=>{u(!1),i()},"data-testid":"aops-v2-sprints-card-delete",children:[a.jsx("span",{className:"aops-pm-cards-popmenu-option-icon",children:zh}),a.jsx("span",{className:"aops-pm-cards-popmenu-option-copy",children:a.jsx("b",{children:o("pmSprintDelete")})})]})]}):null]})}function KN({item:e,model:n,isFavorite:r,isExpanded:i,isSelected:o,canMoveUp:d,canMoveDown:u,menuBusy:v,bodyView:h,onSetBodyView:m,onToggleExpanded:g,onToggleFavorite:b,onMoveUp:j,onMoveDown:C,onOpenDetail:k,onToggleArchive:x,onRequestDelete:S,locale:T,t:I}){const E=i||o,L=Ih({model:n,sprintId:e.kind==="sprint"?e.id:null,enabled:E&&e.kind==="sprint"}),P=Eh({model:n,planId:e.kind==="plan"?e.id:null,enabled:E&&e.kind==="plan"}),N=e.kind==="sprint"?L.data:P.data,R=e.kind==="sprint"?L.error:P.error,z=N!==void 0,ne=y.useMemo(()=>Qh(e,N),[e,N]),ye=z?Zj(ne):null,J=e.taskId?n.tasks.find(_=>_.id===e.taskId)??null:null,re=y.useMemo(()=>n.tasks.filter(_=>_.sprintId===e.id&&_.id!==e.taskId).map(_=>({id:_.id,title:_.title,status:_.status??null})),[e.id,e.taskId,n.tasks]),[oe,fe]=y.useState({}),[de,G]=y.useState(""),Q=_=>fe(K=>({...K,[_]:!(K[_]??!0)})),W=_=>fe(Object.fromEntries(ne.phases.map(K=>[K.id,_]))),pe=(e.status??"").trim(),ke=[J?.title,e.goal?.trim()].filter(Boolean).join(" • "),O=()=>{try{navigator.clipboard?.writeText(e.id)}catch{}};return a.jsxs("section",{className:`aops-pm-boardcard aops-pm-sprintcard${o?" is-selected":""}`,"data-testid":"aops-v2-sprints-card","data-record-key":e.key,children:[a.jsxs("div",{className:"aops-pm-boardcard-head",children:[a.jsxs("div",{className:"aops-pm-boardcard-copy",children:[a.jsxs("div",{className:"aops-pm-boardcard-titlerow",children:[a.jsxs("button",{type:"button",className:"aops-pm-boardcard-toggle","aria-expanded":i,"aria-label":I(i?"pmCardCollapse":"pmCardExpand"),onClick:g,children:[a.jsx("span",{className:"aops-pm-boardcard-symbol","aria-hidden":!0,children:a.jsx(Hh,{expanded:i})}),a.jsx("span",{className:"aops-pm-boardcard-title",children:e.name})]}),a.jsx(ft,{tone:"ghost",children:e.kind==="sprint"?I("pmSprintType"):I("pmPlanType")}),a.jsx(ft,{tone:ja(pe||null),children:pe||I("pmUnknownStatus")}),e.archived?a.jsx(ft,{tone:"ghost",children:I("navArchivedGroup")}):null,ye!==null?a.jsxs("span",{className:"aops-pm-sprintcard-progress","aria-label":`${I("pmFieldProgress")}: ${ye}%`,children:[a.jsxs("strong",{children:[ye,"%"]}),a.jsx("span",{className:"aops-pm-progress-track","aria-hidden":!0,children:a.jsx("span",{className:`aops-pm-progress-fill${ye>=100?" is-done":""}`,style:{width:`${ye}%`}})})]}):null]}),ke?a.jsx("p",{className:"aops-pm-boardcard-desc",role:"button",tabIndex:0,"aria-expanded":i,onClick:g,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),g())},children:ke}):null,a.jsxs("div",{className:"aops-pm-boardcard-meta",children:[a.jsxs("span",{children:[I("pmFieldCreated"),": ",tt(e.createdAt,T)]}),a.jsxs("span",{children:[I("pmFieldUpdated"),": ",tt(e.updatedAt,T)]}),a.jsxs("button",{type:"button",className:"aops-pm-boardcard-uid",title:I("pmCardCopyId"),"aria-label":I("pmCardCopyId"),onClick:O,children:["uid ",Oe(e.id)]})]})]}),a.jsxs("div",{className:"aops-pm-boardcard-side",children:[a.jsxs("div",{className:"aops-pm-boardcard-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-boardcard-action","aria-label":`${I("pmCardDetail")}: ${e.name}`,title:I("pmCardDetail"),onClick:k,"data-testid":"aops-v2-sprints-card-detail",children:Fh}),a.jsx("button",{type:"button",className:`aops-pm-boardcard-action theme-accent${r?" is-active":""}`,"aria-label":I(r?"pmCardFavoriteRemove":"pmCardFavoriteAdd"),"aria-pressed":r,title:I(r?"pmCardFavoriteRemove":"pmCardFavoriteAdd"),onClick:b,"data-testid":"aops-v2-sprints-card-favorite",children:a.jsx($h,{filled:r})}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action theme-accent","aria-label":`${I("pmCardMoveUp")}: ${e.name}`,title:I("pmCardMoveUp"),onClick:j,disabled:!d,"data-testid":"aops-v2-sprints-card-moveup",children:Uc}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action theme-accent","aria-label":`${I("pmCardMoveDown")}: ${e.name}`,title:I("pmCardMoveDown"),onClick:C,disabled:!u,"data-testid":"aops-v2-sprints-card-movedown",children:Pc}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action","aria-label":`${I("pmCardEdit")}: ${e.name}`,title:`${I("pmCardEdit")} — ${I("pmCardReadOnly")}`,disabled:!0,"data-testid":"aops-v2-sprints-card-edit",children:Yj}),e.kind==="sprint"?a.jsx(FN,{archived:e.archived,busy:v,onToggleArchive:x,onRequestDelete:S,t:I}):null]}),z?a.jsx(Yh,{detail:ne,t:I}):null]})]}),i&&!z?a.jsx("div",{className:"aops-pm-boardcard-body",children:a.jsx("div",{className:"aops-pm-boardcard-loading",role:"status",children:R?It(R):I("pmLoadingDetail")})}):null,i&&z?a.jsx("div",{className:"aops-pm-boardcard-body aops-pm-sprintcard-body",children:a.jsx(Xj,{detail:ne,activeTab:h.tab,onTab:_=>m({tab:_}),phaseView:h.phaseView,onPhaseView:_=>m({phaseView:_}),openPhases:oe,onTogglePhase:Q,onSetAllPhases:W,microtaskQuery:de,onMicrotaskQuery:G,linkedTaskTitle:J?.title??null,sprintTasks:re,compact:!0,t:I})}):null]})}function zN({item:e,model:n,onClose:r,locale:i,t:o}){const d=Ih({model:n,sprintId:e.kind==="sprint"?e.id:null,enabled:e.kind==="sprint"}),u=Eh({model:n,planId:e.kind==="plan"?e.id:null,enabled:e.kind==="plan"}),v=e.kind==="sprint"?d.data:u.data,h=e.kind==="sprint"?d.error:u.error,m=v!==void 0,g=y.useMemo(()=>Qh(e,v),[e,v]),b=m?Zj(g):null,j=e.taskId?n.tasks.find(S=>S.id===e.taskId)??null:null,C=(e.status??"").trim(),k=(g.goal??"").trim(),x=g.phases.reduce((S,T)=>S+(T.microtasks?.length??0),0);return a.jsxs("aside",{className:"aops-pm-cardpane","aria-label":o("pmSprintPaneTitle"),"data-testid":"aops-v2-sprints-cardpane",children:[a.jsxs("header",{className:"aops-pm-cardpane-head",children:[a.jsxs("div",{className:"aops-pm-cardpane-heading",children:[a.jsx("span",{className:"aops-pm-board-eyebrow",children:e.kind==="sprint"?o("pmSprintType"):o("pmPlanType")}),a.jsx("h3",{className:"aops-pm-cardpane-title",children:e.name})]}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action","aria-label":o("pmCardPaneClose"),title:o("pmCardPaneClose"),onClick:r,"data-testid":"aops-v2-sprints-cardpane-close",children:mn})]}),a.jsxs("div",{className:"aops-pm-cardpane-body",children:[a.jsxs("div",{className:"aops-pm-cardpane-chips",children:[a.jsx(ft,{tone:ja(C||null),children:C||o("pmUnknownStatus")}),e.archived?a.jsx(ft,{tone:"ghost",children:o("navArchivedGroup")}):null,a.jsxs("span",{className:"aops-pm-mono",children:["uid ",Oe(e.id)]})]}),m?a.jsxs(a.Fragment,{children:[b!==null?a.jsxs("div",{className:"aops-pm-sprintcard-progress is-pane","aria-label":`${o("pmFieldProgress")}: ${b}%`,children:[a.jsxs("strong",{children:[b,"%"]}),a.jsx("span",{className:"aops-pm-progress-track","aria-hidden":!0,children:a.jsx("span",{className:`aops-pm-progress-fill${b>=100?" is-done":""}`,style:{width:`${b}%`}})}),a.jsx("span",{className:"aops-pm-muted",children:Oj(g)})]}):null,a.jsx(Yh,{detail:g,t:o}),a.jsx("p",{className:`aops-pm-cardpane-desc${k?"":" is-empty"}`,children:k||o("pmCardPaneNoDescription")}),a.jsxs("div",{className:"aops-pm-board-summary",role:"list","aria-label":o("pmSprintPaneTitle"),children:[a.jsx(Ha,{label:o("pmPhasesTab"),value:g.phases.length}),a.jsx(Ha,{label:o("pmTasksTab"),value:x}),a.jsx(Ha,{label:o("pmScopeTitle"),value:g.scope.length}),a.jsx(Ha,{label:o("pmValidationTitle"),value:g.validationPlan.length})]}),a.jsxs("section",{className:"aops-pm-cardpane-section","data-testid":"aops-v2-sprints-linked-task",children:[a.jsx("h4",{children:o("pmFieldLinkedTask")}),a.jsx("p",{className:`aops-pm-cardpane-desc${j?"":" is-empty"}`,children:j?j.title:o("pmCardPaneNoLinkedTask")})]})]}):a.jsx("div",{className:"aops-pm-boardcard-loading",role:"status",children:h?It(h):o("pmLoadingDetail")}),a.jsxs("dl",{className:"aops-pm-cardpane-dates",children:[a.jsxs("div",{children:[a.jsx("dt",{children:o("pmFieldCreated")}),a.jsx("dd",{children:tt(e.createdAt,i)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:o("pmFieldUpdated")}),a.jsx("dd",{children:tt(e.updatedAt,i)})]})]})]})]})}function $N({item:e,busy:n,error:r,onCancel:i,onConfirm:o,t:d}){return y.useEffect(()=>{const u=v=>{v.key==="Escape"&&i()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[i]),a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",onClick:i,children:a.jsxs("div",{className:"aops-v2-chat-modal aops-v2-chat-modal-sm",role:"dialog","aria-modal":"true","aria-label":d("pmSprintDeleteTitle"),onClick:u=>u.stopPropagation(),"data-testid":"aops-v2-sprints-delete-modal",children:[a.jsxs("header",{className:"aops-v2-chat-modal-head",children:[a.jsx("h4",{children:d("pmSprintDeleteTitle")}),a.jsx("button",{type:"button",className:"aops-v2-chat-iconclose","aria-label":d("pmCardCancel"),onClick:i,children:"✕"})]}),a.jsxs("div",{className:"aops-v2-chat-modal-body",children:[a.jsxs("p",{className:"aops-pm-delete-board-line",children:[d("pmSprintDeleteLabel"),": ",a.jsx("b",{children:e.name})]}),a.jsx("p",{className:"aops-v2-chat-muted",children:d("pmSprintDeleteQuestion")}),a.jsx("p",{className:"aops-pm-delete-warn has-deps",children:d("pmSprintDeleteWarn")}),r?a.jsx("p",{className:"aops-pm-delete-error",children:r}):null,a.jsxs("div",{className:"aops-pm-delete-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:i,disabled:n,children:d("pmCardCancel")}),a.jsx("button",{type:"button",className:"aops-v2-chat-danger-button",disabled:n,onClick:o,"data-testid":"aops-v2-sprints-delete-confirm",children:d(n?"pmCardDeleteBusy":"pmSprintDeleteConfirm")})]})]})]})})}function HN({filterMode:e,onSetFilterMode:n,t:r}){const{open:i,setOpen:o,rootRef:d}=bs(),u={all:r("pmSprintCardsFilterAll"),sprints:r("pmSprintCardsFilterSprints"),plans:r("pmSprintCardsFilterPlans"),favorites:r("pmCardsFilterFavorites")},v={all:r("pmSprintCardsFilterAllNote"),sprints:r("pmSprintCardsFilterSprintsNote"),plans:r("pmSprintCardsFilterPlansNote"),favorites:r("pmCardsFilterFavoritesNote")};return a.jsxs("div",{className:"aops-pm-cards-popwrap",ref:d,children:[a.jsxs("button",{type:"button",className:`aops-pm-cards-tool-btn${e!=="all"?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":i,"aria-label":r("pmSprintCardsFilterTitle"),title:r("pmSprintCardsFilterTitle"),onClick:()=>o(h=>!h),"data-testid":"aops-v2-sprints-cards-filter",children:[Fc,e!=="all"?a.jsx("span",{className:"aops-pm-cards-tool-badge",children:"1"}):null]}),i?a.jsxs("div",{className:"aops-pm-cards-popmenu",role:"menu",children:[a.jsxs("div",{className:"aops-pm-cards-popmenu-head",children:[a.jsxs("div",{children:[a.jsx("h3",{children:r("pmSprintCardsFilterTitle")}),a.jsx("p",{children:r("pmCardsFilterScope")})]}),a.jsx("button",{type:"button",className:"aops-pm-cards-popmenu-clear",disabled:e==="all",onClick:()=>{n("all"),o(!1)},children:r("pmCardsFilterClear")})]}),a.jsx("span",{className:"aops-pm-cards-popmenu-label",children:r("pmSprintCardsFilterLabel")}),QN.map(h=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":e===h,className:`aops-pm-cards-popmenu-option${e===h?" is-active":""}`,onClick:()=>{n(h),o(!1)},children:[a.jsxs("span",{className:"aops-pm-cards-popmenu-option-copy",children:[a.jsx("b",{children:u[h]}),a.jsx("small",{children:v[h]})]}),e===h?a.jsx("span",{className:"aops-pm-cards-popmenu-check",children:"✓"}):null]},h)),a.jsxs("div",{className:"aops-pm-cards-popmenu-summary",children:[a.jsx("span",{children:r("pmCardsFilterActive")}),a.jsx("strong",{children:u[e]})]})]}):null]})}function GN({model:e,navigator:n,selectedKey:r,items:i,locale:o,t:d}){const u=e.selectedProject?.key??"__global__",[v,h]=y.useState(UN),[m,g]=y.useState(""),[b,j]=y.useState(!1),[C,k]=y.useState(0),x=y.useCallback(D=>{h(B=>{const U=D(B);return PN(U),U})},[]),S=y.useMemo(()=>new Set(v.favoritesByProject[u]??[]),[u,v.favoritesByProject]),T=y.useMemo(()=>new Set(v.expandedByProject[u]??[]),[u,v.expandedByProject]),I=v.sortKeyByProject[u]??"manual",E=v.sortDirectionByProject[u]??"asc",L=v.filterModeByProject[u]??"all",P=v.pageSizeByProject[u]??Ph;y.useEffect(()=>{k(0)},[u,m,L,I,E,P]);const N=y.useMemo(()=>{const D=i.map(q=>q.key),B=new Set(D),U=(v.orderByProject[u]??[]).filter(q=>B.has(q)),H=new Set(U);return[...U,...D.filter(q=>!H.has(q))]},[i,u,v.orderByProject]),R=y.useMemo(()=>{const D=m.trim().toLowerCase(),B=new Map(N.map((H,q)=>[H,q])),U=E==="asc"?1:-1;return i.filter(H=>!(L==="sprints"&&H.kind!=="sprint"||L==="plans"&&H.kind!=="plan"||L==="favorites"&&!S.has(H.key)||D&&!`${H.name} ${H.goal??""}`.toLowerCase().includes(D))).sort((H,q)=>{const V=S.has(H.key),be=S.has(q.key);if(V!==be)return V?-1:1;if(I==="manual")return((B.get(H.key)??0)-(B.get(q.key)??0))*U;if(I==="name")return H.name.localeCompare(q.name,void 0,{numeric:!0,sensitivity:"base"})*U;const ge=Date.parse((I==="updatedAt"?H.updatedAt:H.createdAt)??"")||0,Se=Date.parse((I==="updatedAt"?q.updatedAt:q.createdAt)??"")||0;return(ge-Se)*U})},[S,L,i,N,m,E,I]),z=y.useCallback(D=>x(B=>{const U=B.favoritesByProject[u]??[],H=U.includes(D)?U.filter(q=>q!==D):[...U,D];return{...B,favoritesByProject:{...B.favoritesByProject,[u]:H}}}),[x,u]),ne=y.useCallback((D,B)=>x(U=>{const H=i.map(we=>we.key),q=new Set(H),V=(U.orderByProject[u]??[]).filter(we=>q.has(we)),be=new Set(V),ge=[...V,...H.filter(we=>!be.has(we))],Se=ge.indexOf(D),Ne=B==="up"?Se-1:Se+1;return Se<0||Ne<0||Ne>=ge.length?U:([ge[Se],ge[Ne]]=[ge[Ne],ge[Se]],{...U,orderByProject:{...U.orderByProject,[u]:ge},sortKeyByProject:{...U.sortKeyByProject,[u]:"manual"},sortDirectionByProject:{...U.sortDirectionByProject,[u]:"asc"}})}),[i,x,u]),ye=y.useCallback(D=>x(B=>{const U=B.expandedByProject[u]??[],H=U.includes(D)?U.filter(q=>q!==D):[...U,D];return{...B,expandedByProject:{...B.expandedByProject,[u]:H}}}),[x,u]),J=y.useCallback(D=>x(B=>({...B,expandedByProject:{...B.expandedByProject,[u]:D?i.map(U=>U.key):[]}})),[i,x,u]),re=y.useCallback(D=>x(B=>({...B,filterModeByProject:{...B.filterModeByProject,[u]:D}})),[x,u]),oe=y.useCallback((D,B)=>x(U=>({...U,sortKeyByProject:{...U.sortKeyByProject,[u]:D},sortDirectionByProject:{...U.sortDirectionByProject,[u]:B}})),[x,u]),fe=y.useCallback(D=>x(B=>({...B,pageSizeByProject:{...B.pageSizeByProject,[u]:D}})),[x,u]),de=v.bodyViewByProject[u]??{},G=y.useCallback((D,B)=>x(U=>{const H=U.bodyViewByProject[u]??{},q=H[D]??Vy;return{...U,bodyViewByProject:{...U.bodyViewByProject,[u]:{...H,[D]:{...q,...B}}}}}),[x,u]),Q=y.useCallback(D=>{n.selectRecord(D),j(!0)},[n]),[W,pe]=y.useState(null),[ke,O]=y.useState(null),[_,K]=y.useState(null),[ee,ve]=y.useState(!1),[se,Z]=y.useState(null),ae=y.useCallback(async D=>{pe(D.key),O(null);try{D.archived?await qw(e.client,D.id):await Gw(e.client,D.id),e.refresh()}catch(B){O(`${d("pmCardActionFailed")}: ${It(B)}`)}finally{pe(null)}},[e,d]),ce=y.useCallback(async()=>{if(_){ve(!0),Z(null);try{await Vw(e.client,_.id),K(null),e.refresh()}catch(D){Z(It(D))}finally{ve(!1)}}},[_,e]),w=b?i.find(D=>D.key===r)??null:null,F=Dc({total:R.length,page:C,pageSize:P}).currentPage*P,X=R.slice(F,F+P);return a.jsxs("div",{className:"aops-pm-cards-view","data-testid":"aops-v2-sprints-cards",children:[a.jsxs("div",{className:"aops-pm-cards-toolbar",role:"toolbar","aria-label":d("pmCardsToolbar"),children:[a.jsxs("div",{className:"aops-pm-cards-toolbar-lead",children:[a.jsx(HN,{filterMode:L,onSetFilterMode:re,t:d}),a.jsx(Gh,{sortKey:I,sortDirection:E,onSetSort:oe,t:d}),a.jsxs("label",{className:"aops-pm-cards-search",children:[a.jsx("span",{className:"aops-pm-cards-search-icon","aria-hidden":!0,children:Kc}),a.jsx("input",{type:"search",value:m,placeholder:d("pmNavSearchSprints"),"aria-label":d("pmNavFilterSprints"),onChange:D=>g(D.target.value),"data-testid":"aops-v2-sprints-cards-search"}),m?a.jsx("button",{type:"button",className:"aops-pm-cards-search-clear","aria-label":d("pmCardsSearchClear"),title:d("pmCardsSearchClear"),onClick:()=>g(""),children:mn}):null]})]}),a.jsxs("div",{className:"aops-pm-cards-toolbar-actions",children:[a.jsx("span",{className:"aops-pm-cards-toolbar-sep","aria-hidden":!0}),a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:()=>J(!0),children:d("pmCardsExpandAll")}),a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:()=>J(!1),children:d("pmCardsCollapseAll")})]})]}),ke?a.jsxs("div",{className:"aops-pm-cards-error",role:"alert",children:[a.jsx("span",{children:ke}),a.jsx("button",{type:"button",className:"aops-pm-cards-search-clear","aria-label":d("pmCardCancel"),onClick:()=>O(null),children:mn})]}):null,a.jsxs("div",{className:`aops-pm-cards-layout${w?" has-pane":""}`,children:[a.jsxs("div",{className:"aops-pm-cards-list",children:[X.map((D,B)=>{const U=F+B;return a.jsx(KN,{item:D,model:e,isFavorite:S.has(D.key),isExpanded:T.has(D.key),isSelected:!!(w&&D.key===w.key),canMoveUp:U>0,canMoveDown:U<R.length-1,menuBusy:W===D.key,bodyView:de[D.key]??Vy,onSetBodyView:H=>G(D.key,H),onToggleExpanded:()=>ye(D.key),onToggleFavorite:()=>z(D.key),onMoveUp:()=>ne(D.key,"up"),onMoveDown:()=>ne(D.key,"down"),onOpenDetail:()=>Q(D.key),onToggleArchive:()=>{ae(D)},onRequestDelete:()=>{Z(null),K(D)},locale:o,t:d},D.key)}),R.length===0?a.jsx("div",{className:"aops-pm-cards-empty",children:d("pmNavNoSprints")}):null,R.length>0?a.jsx(qh,{total:R.length,page:C,pageSize:P,visibleCount:X.length,onPageChange:k,onPageSizeChange:fe,noun:d("pmSprintCardsPagerNoun"),testIdPrefix:"aops-v2-sprints-cards",t:d}):null]}),w?a.jsx(zN,{item:w,model:e,onClose:()=>j(!1),locale:o,t:d}):null]}),_?a.jsx($N,{item:_,busy:ee,error:se,onCancel:()=>{ee||K(null)},onConfirm:()=>{ce()},t:d}):null]})}function qN({model:e,navigator:n,selectedKey:r,locale:i,t:o}){const[d,u]=y.useState("phases"),[v,h]=y.useState({}),[m,g]=y.useState("timeline"),b=y.useMemo(()=>new Map(e.tasks.map(C=>[C.id,C])),[e.tasks]),j=y.useMemo(()=>Pj(e.sprints,e.implementationPlans),[e.implementationPlans,e.sprints]);return n.isCardsMode?a.jsx("div",{className:"aops-pm-board-view is-cards",children:a.jsx(GN,{model:e,navigator:n,selectedKey:r,items:j,locale:i,t:o})}):a.jsx(VN,{model:e,navigator:n,selectedKey:r,items:j,taskById:b,activeTab:d,setActiveTab:u,openPhases:v,setOpenPhases:h,phaseView:m,setPhaseView:g,t:o})}function VN({model:e,navigator:n,selectedKey:r,items:i,taskById:o,activeTab:d,setActiveTab:u,openPhases:v,setOpenPhases:h,phaseView:m,setPhaseView:g,t:b}){const j=i.find(R=>R.key===r)??i[0]??null,C=Ih({model:e,sprintId:j?.kind==="sprint"?j.id:null,enabled:j?.kind==="sprint"}),k=Eh({model:e,planId:j?.kind==="plan"?j.id:null,enabled:j?.kind==="plan"}),x=j?Qh(j,j.kind==="sprint"?C.data:k.data):null,S=j?.kind==="sprint"?C.isPending:j?.kind==="plan"?k.isPending:!1,T=j?.kind==="sprint"?C.error:j?.kind==="plan"?k.error:null,I=x?.taskId?o.get(x.taskId)??null:null,E=x?e.tasks.filter(R=>R.sprintId===x.id&&R.id!==x.taskId):[],L=x?e.issues.filter(R=>nN(R)===x.id).length:0,P=R=>h(z=>({...z,[R]:!(z[R]??!0)})),N=j&&x?a.jsx(YN,{detail:x,activeTab:d,onTab:u,phaseView:m,onPhaseView:g,openPhases:v,onTogglePhase:P,loading:S,error:T?It(T,"detail_unavailable"):null,linkedTaskTitle:I?.title??null,sprintTasks:E.map(R=>({id:R.id,title:R.title,status:R.status??null})),linkedIssueCount:L,t:b}):a.jsx(it,{variant:"empty",title:b("pmSprintsPlansTitle"),message:b("pmNoRows")});return n.isDropdownMode?a.jsxs("div",{className:"aops-pm-board-view is-dropdown",children:[a.jsx("div",{className:"aops-pm-board-navrow",children:n.dropdownNode}),N]}):a.jsx("div",{className:"aops-pm-board-view",children:a.jsx(Oc,{controller:n.controller,navigator:n.treePanel,navigatorLabel:b("pmSprintsPlansTitle"),className:"aops-pm-board-recordlayout",contentClassName:"aops-pm-board-recordcontent",content:N})})}function YN({detail:e,activeTab:n,onTab:r,phaseView:i,onPhaseView:o,openPhases:d,onTogglePhase:u,loading:v,error:h,linkedTaskTitle:m,sprintTasks:g,linkedIssueCount:b,t:j}){return a.jsxs("section",{className:"aops-pm-sprint-record","aria-label":e.name,children:[a.jsx("header",{className:"aops-pm-rechead",children:a.jsxs("div",{className:"aops-pm-rechead-id",children:[a.jsx("span",{className:"aops-pm-rechead-eyebrow",children:e.kind==="sprint"?j("pmSprintType"):j("pmPlanType")}),a.jsx("h3",{className:"aops-pm-rechead-title",children:e.name}),a.jsxs("div",{className:"aops-pm-rechead-meta",children:[a.jsx(ft,{tone:ja(e.status),children:e.status??j("pmUnknownStatus")}),a.jsx("span",{className:"aops-pm-muted",children:Oj(e)}),a.jsxs("span",{className:"aops-pm-muted",children:[j("pmIssues"),": ",b]}),a.jsx("span",{className:"aops-pm-mono",children:Oe(e.id)}),v?a.jsx(ft,{tone:"amber",children:j("pmLoadingDetail")}):null]}),e.goal?a.jsx("p",{className:"aops-pm-sprint-goal",children:e.goal}):null,a.jsx(Yh,{detail:e,t:j})]})}),h?a.jsx("p",{className:"aops-pm-error-line",children:h}):null,a.jsx(Xj,{detail:e,activeTab:n,onTab:r,phaseView:i,onPhaseView:o,openPhases:d,onTogglePhase:u,linkedTaskTitle:m,sprintTasks:g,t:j})]})}function Wr(e,n){return e?[{label:e,tone:n}]:[]}function JN(e,n,r,i){return e.map(o=>({id:o.id,title:o.title,status:o.status??null,eyebrow:i("pmSectionIssues"),chips:[...Wr(o.severity,Bl(o.severity)),...Wr(o.source)],fields:[{label:i("pmSeverity"),value:o.severity??null},{label:i("pmSource"),value:o.source??null},{label:i("pmFieldSprint"),value:n(o.sprintId)},{label:i("pmFieldLinkedTask"),value:r(o.kanbanTaskId)}],tags:o.tags,searchText:`${o.title} ${o.status} ${o.severity??""} ${(o.tags??[]).join(" ")}`,createdAt:o.createdAt,updatedAt:o.updatedAt}))}function XN(e,n){return e.map(r=>({id:r.id,title:r.title,status:r.status??null,eyebrow:n("pmSectionFeedback"),chips:[...Wr(r.type,"indigo"),...Wr(r.severity,Bl(r.severity))],fields:[{label:n("pmType"),value:r.type??null},{label:n("pmSeverity"),value:r.severity??null},{label:n("pmSource"),value:r.source??null}],tags:r.tags,searchText:`${r.title} ${r.status} ${r.type??""} ${(r.tags??[]).join(" ")}`,createdAt:r.createdAt,updatedAt:r.updatedAt}))}function WN(e,n,r,i){return e.map(o=>({id:o.id,title:o.title,status:o.status??null,eyebrow:i("pmSectionReviews"),chips:[...Wr(o.priority,Bl(o.priority)),...Wr(o.source)],fields:[{label:i("pmPriority"),value:o.priority??null},{label:i("pmScope"),value:o.reviewScope??null},{label:i("pmSource"),value:o.source??null},{label:i("pmFieldSprint"),value:n(o.sprintId)},{label:i("pmFieldLinkedTask"),value:r(o.kanbanTaskId)}],body:[{heading:i("pmDescription"),text:o.description??""},{heading:i("pmInstructions"),text:o.instructions??""}],searchText:`${o.title} ${o.status} ${o.priority??""} ${o.description??""}`,createdAt:o.createdAt,updatedAt:o.updatedAt,results:(o.results??[]).map(d=>({id:d.id,reviewer:d.reviewer,outcome:d.outcome,summary:d.summary,positives:d.positives,concerns:d.concerns,objections:d.objections,createdAt:d.createdAt}))}))}function Bl(e){const n=(e??"").toLowerCase();return/crit|block|urgent|p0|highest/.test(n)?"claret":/high|major|p1/.test(n)?"coral":/med|normal|p2/.test(n)?"amber":/low|minor|trivial|p3/.test(n)?"sage":"ghost"}function ZN({items:e,title:n,searchPlaceholder:r,emptyLabel:i,layout:o,t:d}){return a.jsx(Lj,{items:e,layout:o,labels:{title:n,searchPlaceholder:r,emptyLabel:i,noMatchLabel:d("pmNoRows"),unknownStatusLabel:d("pmUnknownStatus"),detailAriaLabel:n,backLabel:d("pmCardPaneClose")}})}const eA="aops-cockpit-v2.pm-records.cardsUi",tc={orderByScope:{},favoritesByScope:{},expandedByScope:{},sortKeyByScope:{},sortDirectionByScope:{},filterModeByScope:{},pageSizeByScope:{},viewBySection:{}};function tA(){if(typeof window>"u")return tc;try{const e=window.localStorage.getItem(eA);if(!e)return tc;const n=JSON.parse(e);return{...tc,...n}}catch{return tc}}function aA(e){try{typeof window<"u"&&window.localStorage.setItem(eA,JSON.stringify(e))}catch{}}function eI({results:e,t:n}){return e.length?a.jsxs("section",{className:"aops-pm-recordcard-results",children:[a.jsxs("h4",{children:[n("pmReviewResults")," ",a.jsx("span",{className:"aops-pm-recordcard-results-count",children:e.length})]}),e.map(r=>a.jsxs("article",{className:"aops-pm-recordcard-result",children:[a.jsxs("div",{className:"aops-pm-recordcard-result-head",children:[a.jsx(ft,{tone:ja(r.outcome),children:r.outcome}),a.jsx("b",{children:r.reviewer}),r.createdAt?a.jsx("span",{className:"aops-pm-muted",children:r.createdAt.slice(0,10)}):null]}),r.summary?a.jsx("p",{className:"aops-pm-recordcard-result-summary",children:r.summary}):null,[["pmReviewPositives",r.positives],["pmReviewConcerns",r.concerns],["pmReviewObjections",r.objections]].map(([i,o])=>o&&o.length?a.jsxs("div",{className:"aops-pm-recordcard-result-group",children:[a.jsx("span",{className:"aops-pm-recordcard-result-label",children:n(i)}),a.jsx("ul",{children:o.map(d=>a.jsx("li",{children:d},d))})]},i):null)]},r.id))]}):null}function nA({item:e,t:n}){const r=e.fields.filter(i=>i.value);return a.jsxs(a.Fragment,{children:[r.length?a.jsx("dl",{className:"aops-pm-recordcard-fields",children:r.map(i=>a.jsxs("div",{children:[a.jsx("dt",{children:i.label}),a.jsx("dd",{title:i.value??void 0,children:i.value})]},i.label))}):null,e.body?.map((i,o)=>i.text?a.jsxs("section",{className:"aops-pm-recordcard-block",children:[a.jsx("h5",{children:i.heading}),a.jsx("p",{children:i.text})]},o):null),e.results&&e.results.length?a.jsx(eI,{results:e.results,t:n}):null,e.tags&&e.tags.length?a.jsx("div",{className:"aops-pm-recordlist-tags",children:e.tags.map(i=>a.jsx("span",{className:"eops-chip eops-chip--ghost cp-chip-xs",children:i},i))}):null]})}function tI({busy:e,onRequestDelete:n,t:r}){const{open:i,setOpen:o,rootRef:d}=bs();return a.jsxs("div",{className:"aops-pm-boardcard-menuwrap",ref:d,children:[a.jsx("button",{type:"button",className:`aops-pm-boardcard-action${i?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":i,"aria-label":r("pmCardMenu"),title:r("pmCardMenu"),disabled:e,onClick:()=>o(u=>!u),"data-testid":"aops-v2-records-card-menu",children:Kh}),i?a.jsx("div",{className:"aops-pm-cards-popmenu is-right",role:"menu",children:a.jsxs("button",{type:"button",role:"menuitem",className:"aops-pm-cards-popmenu-option is-danger",onClick:()=>{o(!1),n()},"data-testid":"aops-v2-records-card-delete",children:[a.jsx("span",{className:"aops-pm-cards-popmenu-option-icon",children:zh}),a.jsx("span",{className:"aops-pm-cards-popmenu-option-copy",children:a.jsx("b",{children:r("pmRecordDelete")})})]})}):null]})}function aI({item:e,isFavorite:n,isExpanded:r,isSelected:i,canMoveUp:o,canMoveDown:d,menuBusy:u,onToggleExpanded:v,onToggleFavorite:h,onMoveUp:m,onMoveDown:g,onOpenDetail:b,onRequestDelete:j,extra:C,locale:k,t:x}){const S=(e.status??"").trim(),T=()=>{try{navigator.clipboard?.writeText(e.id)}catch{}};return a.jsxs("section",{className:`aops-pm-boardcard aops-pm-recordcard${i?" is-selected":""}`,"data-testid":"aops-v2-records-card","data-record-id":e.id,children:[a.jsxs("div",{className:"aops-pm-boardcard-head",children:[a.jsxs("div",{className:"aops-pm-boardcard-copy",children:[a.jsxs("div",{className:"aops-pm-boardcard-titlerow",children:[a.jsxs("button",{type:"button",className:"aops-pm-boardcard-toggle","aria-expanded":r,"aria-label":x(r?"pmCardCollapse":"pmCardExpand"),onClick:v,children:[a.jsx("span",{className:"aops-pm-boardcard-symbol","aria-hidden":!0,children:a.jsx(Hh,{expanded:r})}),a.jsx("span",{className:"aops-pm-boardcard-title",title:e.title,children:e.title})]}),a.jsx(ft,{tone:ja(S||null),children:S||x("pmUnknownStatus")}),e.chips.map(I=>a.jsx(ft,{tone:I.tone??Bl(I.label),children:I.label},I.label))]}),a.jsxs("div",{className:"aops-pm-boardcard-meta",children:[a.jsxs("span",{children:[x("pmFieldCreated"),": ",tt(e.createdAt,k)]}),a.jsxs("span",{children:[x("pmFieldUpdated"),": ",tt(e.updatedAt,k)]}),a.jsxs("button",{type:"button",className:"aops-pm-boardcard-uid",title:x("pmCardCopyId"),"aria-label":x("pmCardCopyId"),onClick:T,children:["uid ",Oe(e.id)]})]})]}),a.jsx("div",{className:"aops-pm-boardcard-side",children:a.jsxs("div",{className:"aops-pm-boardcard-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-boardcard-action","aria-label":`${x("pmCardDetail")}: ${e.title}`,title:x("pmCardDetail"),onClick:b,"data-testid":"aops-v2-records-card-detail",children:Fh}),a.jsx("button",{type:"button",className:`aops-pm-boardcard-action theme-accent${n?" is-active":""}`,"aria-label":x(n?"pmCardFavoriteRemove":"pmCardFavoriteAdd"),"aria-pressed":n,title:x(n?"pmCardFavoriteRemove":"pmCardFavoriteAdd"),onClick:h,"data-testid":"aops-v2-records-card-favorite",children:a.jsx($h,{filled:n})}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action theme-accent","aria-label":`${x("pmCardMoveUp")}: ${e.title}`,title:x("pmCardMoveUp"),onClick:m,disabled:!o,"data-testid":"aops-v2-records-card-moveup",children:Uc}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action theme-accent","aria-label":`${x("pmCardMoveDown")}: ${e.title}`,title:x("pmCardMoveDown"),onClick:g,disabled:!d,"data-testid":"aops-v2-records-card-movedown",children:Pc}),j?a.jsx(tI,{busy:u,onRequestDelete:j,t:x}):null]})})]}),r?a.jsxs("div",{className:"aops-pm-boardcard-body aops-pm-recordcard-body",children:[a.jsx(nA,{item:e,t:x}),C]}):null]})}function nI({item:e,sectionTitle:n,onClose:r,extra:i,locale:o,t:d}){const u=(e.status??"").trim();return a.jsxs("aside",{className:"aops-pm-cardpane","aria-label":n,"data-testid":"aops-v2-records-cardpane",children:[a.jsxs("header",{className:"aops-pm-cardpane-head",children:[a.jsxs("div",{className:"aops-pm-cardpane-heading",children:[a.jsx("span",{className:"aops-pm-board-eyebrow",children:n}),a.jsx("h3",{className:"aops-pm-cardpane-title",title:e.title,children:e.title})]}),a.jsxs("button",{type:"button",className:"aops-pm-boardcard-action aops-pm-recordpane-close","aria-label":d("pmCardPaneClose"),title:d("pmCardPaneClose"),onClick:r,"data-testid":"aops-v2-records-cardpane-close",children:[a.jsxs("span",{className:"aops-pm-recordpane-close-mobile","aria-hidden":!0,children:["← ",d("pmCardPaneClose")]}),a.jsx("span",{className:"aops-pm-recordpane-close-desktop","aria-hidden":!0,children:mn})]})]}),a.jsxs("div",{className:"aops-pm-cardpane-body",children:[a.jsxs("div",{className:"aops-pm-cardpane-chips",children:[a.jsx(ft,{tone:ja(u||null),children:u||d("pmUnknownStatus")}),e.chips.map(v=>a.jsx(ft,{tone:v.tone??Bl(v.label),children:v.label},v.label)),a.jsxs("span",{className:"aops-pm-mono",children:["uid ",Oe(e.id)]})]}),a.jsx(nA,{item:e,t:d}),i,a.jsxs("dl",{className:"aops-pm-cardpane-dates",children:[a.jsxs("div",{children:[a.jsx("dt",{children:d("pmFieldCreated")}),a.jsx("dd",{children:tt(e.createdAt,o)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:d("pmFieldUpdated")}),a.jsx("dd",{children:tt(e.updatedAt,o)})]})]})]})]})}function sI({item:e,busy:n,error:r,onCancel:i,onConfirm:o,t:d}){return y.useEffect(()=>{const u=v=>{v.key==="Escape"&&i()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[i]),a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",onClick:i,children:a.jsxs("div",{className:"aops-v2-chat-modal aops-v2-chat-modal-sm",role:"dialog","aria-modal":"true","aria-label":d("pmRecordDeleteTitle"),onClick:u=>u.stopPropagation(),"data-testid":"aops-v2-records-delete-modal",children:[a.jsxs("header",{className:"aops-v2-chat-modal-head",children:[a.jsx("h4",{children:d("pmRecordDeleteTitle")}),a.jsx("button",{type:"button",className:"aops-v2-chat-iconclose","aria-label":d("pmCardCancel"),onClick:i,children:"✕"})]}),a.jsxs("div",{className:"aops-v2-chat-modal-body",children:[a.jsxs("p",{className:"aops-pm-delete-board-line",children:[d("pmRecordDeleteLabel"),": ",a.jsx("b",{children:e.title})]}),a.jsx("p",{className:"aops-v2-chat-muted",children:d("pmRecordDeleteQuestion")}),a.jsx("p",{className:"aops-pm-delete-warn has-deps",children:d("pmRecordDeleteWarn")}),r?a.jsx("p",{className:"aops-pm-delete-error",children:r}):null,a.jsxs("div",{className:"aops-pm-delete-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:i,disabled:n,children:d("pmCardCancel")}),a.jsx("button",{type:"button",className:"aops-v2-chat-danger-button",disabled:n,onClick:o,"data-testid":"aops-v2-records-delete-confirm",children:d(n?"pmCardDeleteBusy":"pmRecordDeleteConfirm")})]})]})]})})}function rI({filterMode:e,statuses:n,onSetFilterMode:r,t:i}){const{open:o,setOpen:d,rootRef:u}=bs(),v=m=>m==="all"?i("pmRecordsAllStatuses"):m==="favorites"?i("pmCardsFilterFavorites"):m,h=["all","favorites",...n];return a.jsxs("div",{className:"aops-pm-cards-popwrap",ref:u,children:[a.jsxs("button",{type:"button",className:`aops-pm-cards-tool-btn${e!=="all"?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":o,"aria-label":i("pmSprintCardsFilterTitle"),title:i("pmSprintCardsFilterTitle"),onClick:()=>d(m=>!m),"data-testid":"aops-v2-records-cards-filter",children:[Fc,e!=="all"?a.jsx("span",{className:"aops-pm-cards-tool-badge",children:"1"}):null]}),o?a.jsxs("div",{className:"aops-pm-cards-popmenu",role:"menu",children:[a.jsxs("div",{className:"aops-pm-cards-popmenu-head",children:[a.jsxs("div",{children:[a.jsx("h3",{children:i("pmSprintCardsFilterTitle")}),a.jsx("p",{children:i("pmCardsFilterScope")})]}),a.jsx("button",{type:"button",className:"aops-pm-cards-popmenu-clear",disabled:e==="all",onClick:()=>{r("all"),d(!1)},children:i("pmCardsFilterClear")})]}),a.jsx("span",{className:"aops-pm-cards-popmenu-label",children:i("pmFieldStatus")}),h.map(m=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":e===m,className:`aops-pm-cards-popmenu-option${e===m?" is-active":""}`,onClick:()=>{r(m),d(!1)},children:[a.jsx("span",{className:"aops-pm-cards-popmenu-option-copy",children:a.jsx("b",{children:v(m)})}),e===m?a.jsx("span",{className:"aops-pm-cards-popmenu-check",children:"✓"}):null]},m)),a.jsxs("div",{className:"aops-pm-cards-popmenu-summary",children:[a.jsx("span",{children:i("pmCardsFilterActive")}),a.jsx("strong",{children:v(e)})]})]}):null]})}function Jh({projectKey:e,section:n,items:r,sectionTitle:i,searchPlaceholder:o,emptyLabel:d,onDeleteRecord:u,renderExtra:v,toolbarExtra:h,toolbarTrailing:m,locale:g,t:b}){const j=`${e}:${n}`,[C,k]=y.useState(tA),[x,S]=y.useState(""),[T,I]=y.useState(null),[E,L]=y.useState(0),P=y.useCallback(B=>{k(U=>{const H=B(U);return aA(H),H})},[]),N=y.useMemo(()=>new Set(C.favoritesByScope[j]??[]),[j,C.favoritesByScope]),R=y.useMemo(()=>new Set(C.expandedByScope[j]??[]),[j,C.expandedByScope]),z=C.sortKeyByScope[j]??"updatedAt",ne=C.sortDirectionByScope[j]??"desc",ye=C.filterModeByScope[j]??"all",J=C.pageSizeByScope[j]??Ph;y.useEffect(()=>{L(0)},[j,x,ye,z,ne,J]);const re=y.useMemo(()=>Array.from(new Set(r.map(B=>(B.status??"").trim()).filter(Boolean))).sort((B,U)=>B.localeCompare(U)),[r]),oe=y.useMemo(()=>{const B=r.map(V=>V.id),U=new Set(B),H=(C.orderByScope[j]??[]).filter(V=>U.has(V)),q=new Set(H);return[...H,...B.filter(V=>!q.has(V))]},[r,j,C.orderByScope]),fe=y.useMemo(()=>{const B=x.trim().toLowerCase(),U=new Map(oe.map((q,V)=>[q,V])),H=ne==="asc"?1:-1;return r.filter(q=>!(ye==="favorites"&&!N.has(q.id)||ye!=="all"&&ye!=="favorites"&&(q.status??"").trim()!==ye||B&&!q.searchText.toLowerCase().includes(B))).sort((q,V)=>{const be=N.has(q.id),ge=N.has(V.id);if(be!==ge)return be?-1:1;if(z==="manual")return((U.get(q.id)??0)-(U.get(V.id)??0))*H;if(z==="name")return q.title.localeCompare(V.title,void 0,{numeric:!0,sensitivity:"base"})*H;const Se=Date.parse((z==="updatedAt"?q.updatedAt:q.createdAt)??"")||0,Ne=Date.parse((z==="updatedAt"?V.updatedAt:V.createdAt)??"")||0;return(Se-Ne)*H})},[N,ye,r,oe,x,ne,z]),de=y.useCallback(B=>P(U=>{const H=U.favoritesByScope[j]??[],q=H.includes(B)?H.filter(V=>V!==B):[...H,B];return{...U,favoritesByScope:{...U.favoritesByScope,[j]:q}}}),[P,j]),G=y.useCallback((B,U)=>P(H=>{const q=r.map(Be=>Be.id),V=new Set(q),be=(H.orderByScope[j]??[]).filter(Be=>V.has(Be)),ge=new Set(be),Se=[...be,...q.filter(Be=>!ge.has(Be))],Ne=Se.indexOf(B),we=U==="up"?Ne-1:Ne+1;return Ne<0||we<0||we>=Se.length?H:([Se[Ne],Se[we]]=[Se[we],Se[Ne]],{...H,orderByScope:{...H.orderByScope,[j]:Se},sortKeyByScope:{...H.sortKeyByScope,[j]:"manual"},sortDirectionByScope:{...H.sortDirectionByScope,[j]:"asc"}})}),[r,P,j]),Q=y.useCallback(B=>P(U=>{const H=U.expandedByScope[j]??[],q=H.includes(B)?H.filter(V=>V!==B):[...H,B];return{...U,expandedByScope:{...U.expandedByScope,[j]:q}}}),[P,j]),W=y.useCallback(B=>P(U=>({...U,expandedByScope:{...U.expandedByScope,[j]:B?r.map(H=>H.id):[]}})),[r,P,j]),pe=y.useCallback(B=>P(U=>({...U,filterModeByScope:{...U.filterModeByScope,[j]:B}})),[P,j]),ke=y.useCallback((B,U)=>P(H=>({...H,sortKeyByScope:{...H.sortKeyByScope,[j]:B},sortDirectionByScope:{...H.sortDirectionByScope,[j]:U}})),[P,j]),O=y.useCallback(B=>P(U=>({...U,pageSizeByScope:{...U.pageSizeByScope,[j]:B}})),[P,j]),[_,K]=y.useState(null),[ee,ve]=y.useState(null),[se,Z]=y.useState(!1),[ae,ce]=y.useState(null),w=y.useCallback(async()=>{if(!(!ee||!u)){Z(!0),ce(null),K(ee.id);try{await u(ee),ve(null),T===ee.id&&I(null)}catch(B){ce(It(B))}finally{Z(!1),K(null)}}},[ee,u,T]),F=T?r.find(B=>B.id===T)??null:null,X=Dc({total:fe.length,page:E,pageSize:J}).currentPage*J,D=fe.slice(X,X+J);return a.jsxs("div",{className:"aops-pm-cards-view","data-testid":"aops-v2-records-cards",children:[a.jsxs("div",{className:"aops-pm-cards-toolbar",role:"toolbar","aria-label":b("pmCardsToolbar"),children:[a.jsxs("div",{className:"aops-pm-cards-toolbar-lead",children:[a.jsx(rI,{filterMode:ye,statuses:re,onSetFilterMode:pe,t:b}),a.jsx(Gh,{sortKey:z,sortDirection:ne,onSetSort:ke,t:b}),h,a.jsxs("label",{className:"aops-pm-cards-search",children:[a.jsx("span",{className:"aops-pm-cards-search-icon","aria-hidden":!0,children:Kc}),a.jsx("input",{type:"search",value:x,placeholder:o,"aria-label":o,onChange:B=>S(B.target.value),"data-testid":"aops-v2-records-cards-search"}),x?a.jsx("button",{type:"button",className:"aops-pm-cards-search-clear","aria-label":b("pmCardsSearchClear"),title:b("pmCardsSearchClear"),onClick:()=>S(""),children:mn}):null]})]}),a.jsxs("div",{className:"aops-pm-cards-toolbar-actions",children:[a.jsx("span",{className:"aops-pm-cards-toolbar-sep","aria-hidden":!0}),a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:()=>W(!0),children:b("pmCardsExpandAll")}),a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:()=>W(!1),children:b("pmCardsCollapseAll")}),m]})]}),a.jsxs("div",{className:`aops-pm-cards-layout${F?" has-pane":""}`,children:[a.jsxs("div",{className:"aops-pm-cards-list",children:[D.map((B,U)=>{const H=X+U;return a.jsx(aI,{item:B,isFavorite:N.has(B.id),isExpanded:R.has(B.id),isSelected:!!(F&&B.id===F.id),canMoveUp:H>0,canMoveDown:H<fe.length-1,menuBusy:_===B.id,onToggleExpanded:()=>Q(B.id),onToggleFavorite:()=>de(B.id),onMoveUp:()=>G(B.id,"up"),onMoveDown:()=>G(B.id,"down"),onOpenDetail:()=>I(B.id),onRequestDelete:u?()=>{ce(null),ve(B)}:void 0,extra:v?.(B),locale:g,t:b},B.id)}),fe.length===0?a.jsx("div",{className:"aops-pm-cards-empty",children:d}):null,fe.length>0?a.jsx(qh,{total:fe.length,page:E,pageSize:J,visibleCount:D.length,onPageChange:L,onPageSizeChange:O,noun:b("pmSprintCardsPagerNoun"),testIdPrefix:"aops-v2-records-cards",t:b}):null]}),F?a.jsx(nI,{item:F,sectionTitle:i,onClose:()=>I(null),extra:v?.(F),locale:g,t:b}):null]}),ee?a.jsx(sI,{item:ee,busy:se,error:ae,onCancel:()=>{se||ve(null)},onConfirm:()=>{w()},t:b}):null]})}function gp({model:e,section:n,deleteResource:r,items:i,title:o,searchPlaceholder:d,emptyLabel:u,view:v,locale:h,t:m}){const g=y.useCallback(async b=>{await Yw(e.client,r,b.id),e.refresh()},[r,e]);return a.jsx("div",{className:"aops-pm-recordsection","data-testid":`aops-v2-${n}-section`,children:v==="cards"?a.jsx(Jh,{projectKey:e.selectedProject?.key??"__global__",section:n,items:i,sectionTitle:o,searchPlaceholder:d,emptyLabel:u,onDeleteRecord:g,locale:h,t:m}):a.jsx(ZN,{items:i,title:o,searchPlaceholder:d,emptyLabel:u,layout:v==="dropdown"?"dropdown":"side-panel",t:m})})}function iI({model:e,boardsNavigator:n,selectedBoardId:r,sprintsNavigator:i,selectedSprintKey:o,section:d,onNavigate:u,locale:v,t:h}){const m={boards:e.boards.length,sprints:aN(e.sprints,e.implementationPlans),issues:e.issues.length,feedback:e.feedback.length,reviews:e.reviewRequests.length},g=pn.map(E=>({id:E.section,label:h(E.labelKey),count:m[E.section]||null})),[b,j]=y.useState(tA);y.useEffect(()=>{if(d==="boards"&&n.viewMode==="navigator"){n.switchMode("left-menu");return}d==="sprints"&&i.viewMode==="navigator"&&i.switchMode("left-menu")},[n.switchMode,n.viewMode,d,i.switchMode,i.viewMode]);const k=`${e.selectedProject?.key??"__global__"}:${d}`,x=b.viewBySection[k]??b.viewBySection[d]??"cards",S=d==="boards"?n.viewMode==="cards"?"cards":n.viewMode==="left-menu"?"side-panel":"dropdown":d==="sprints"?i.viewMode==="cards"?"cards":i.viewMode==="left-menu"?"side-panel":"dropdown":x==="dropdown"?"dropdown":x==="side-panel"||x==="list"?"side-panel":"cards",T=E=>{if(d==="boards"){n.switchMode(E==="cards"?"cards":E==="dropdown"?"dropdown":"left-menu");return}if(d==="sprints"){i.switchMode(E==="cards"?"cards":E==="dropdown"?"dropdown":"left-menu");return}j(L=>{const P={...L,viewBySection:{...L.viewBySection,[k]:E}};return aA(P),P})},I=d==="boards"?n:d==="sprints"?i:null;return a.jsx(cn,{className:"aops-v2-section aops-pm-section",mainClassName:"aops-v2-section-main",children:a.jsxs("div",{className:`aops-pm-dispatch has-view-switch is-${d} is-${S}`,children:[a.jsxs("label",{className:"aops-pm-mobile-section-picker",children:[a.jsx("span",{children:h("pmTitle")}),a.jsx("select",{"aria-label":h("pmTitle"),value:d,onChange:E=>u(By(E.target.value)),children:g.map(E=>a.jsxs("option",{value:E.id,children:[E.label,E.count!=null?` (${E.count})`:""]},E.id))})]}),a.jsxs("div",{className:"aops-pm-section-controls",children:[a.jsx("div",{className:"aops-pm-sectiontabs",role:"tablist","aria-label":h("pmTitle"),children:g.map(E=>a.jsxs("button",{type:"button",role:"tab","aria-selected":d===E.id,className:`aops-pm-sectiontab${d===E.id?" is-active":""}`,onClick:()=>u(By(E.id)),children:[a.jsx("span",{className:"aops-pm-sectiontab-label",children:E.label}),E.count!=null?a.jsx("span",{className:"aops-pm-sectiontab-count",children:E.count}):null]},E.id))}),a.jsx(lI,{section:d,value:S,sidePanelOpen:I?.controller.open??!0,onSidePanelToggle:()=>{if(!I){T("side-panel");return}if(S==="side-panel"){I.controller.setOpen(E=>!E);return}I.controller.setOpen(!0),T("side-panel")},onChange:T,t:h})]}),a.jsx("div",{className:"aops-pm-dispatch-body",children:a.jsx(oI,{section:d,model:e,boardsNavigator:n,selectedBoardId:r,sprintsNavigator:i,selectedSprintKey:o,viewMode:S,locale:v,t:h})})]})})}function lI({section:e,value:n,sidePanelOpen:r,onSidePanelToggle:i,onChange:o,t:d}){const u=pn.find(g=>g.section===e)??pn[0],v=e==="boards"||e==="sprints",h=n==="side-panel"&&r,m=d(v?h?"navSidePanelHide":"navSidePanelShow":"pmRecordViewSidePanel");return a.jsx(_h,{ariaLabel:`${d("pmRecordViewLabel")}: ${d(u.labelKey)}`,value:n,items:[{value:"side-panel",label:m,icon:"side-panel",expanded:v?h:n==="side-panel",onSelect:i,testId:`aops-pm-${e}-view-side-panel`},{value:"cards",label:d("navModeCards"),icon:"cards",testId:`aops-pm-${e}-view-cards`},{value:"dropdown",label:d("navModeDropdown"),icon:"dropdown",testId:`aops-pm-${e}-view-dropdown`}],onChange:o})}function oI({section:e,model:n,boardsNavigator:r,selectedBoardId:i,sprintsNavigator:o,selectedSprintKey:d,viewMode:u,locale:v,t:h}){if(n.status==="select-project")return a.jsx(it,{variant:"empty",title:h("pmNoProjectTitle"),message:h("pmNoProjectMessage")});if(n.status==="loading")return a.jsx(it,{variant:"loading",title:h("pmLoadingTitle"),message:h("pmLoadingMessage")});if(n.status==="error")return a.jsx(it,{variant:"error",title:h("pmErrorTitle"),message:It(n.error,"projectman_unavailable"),actions:a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:n.refresh,children:h("authRetry")})});if(n.status==="empty")return e==="boards"?a.jsx(u0,{model:n,t:h}):a.jsx(it,{variant:"empty",title:h("pmEmptyTitle"),message:h("pmEmptyMessage")});if(e==="boards")return a.jsx(kN,{model:n,navigator:r,selectedBoardId:i,locale:v,t:h});if(e==="sprints")return a.jsx(qN,{model:n,navigator:o,selectedKey:d,locale:v,t:h});const m=b=>b?n.sprints.find(j=>j.id===b)?.name??Oe(b):null,g=b=>b?n.tasks.find(j=>j.id===b)?.title??Oe(b):null;return e==="issues"?a.jsx(gp,{model:n,section:"issues",deleteResource:"issues",items:JN(n.issues,m,g,h),title:h("pmSectionIssues"),searchPlaceholder:h("pmSearchIssues"),emptyLabel:h("pmNoIssues"),view:u,locale:v,t:h}):e==="feedback"?a.jsx(gp,{model:n,section:"feedback",deleteResource:"feedbacks",items:XN(n.feedback,h),title:h("pmSectionFeedback"),searchPlaceholder:h("pmSearchFeedback"),emptyLabel:h("pmNoFeedback"),view:u,locale:v,t:h}):a.jsx(gp,{model:n,section:"reviews",deleteResource:"review-requests",items:WN(n.reviewRequests,m,g,h),title:h("pmSectionReviews"),searchPlaceholder:h("pmSearchReviews"),emptyLabel:h("pmNoReviews"),view:u,locale:v,t:h})}const Xh={all:e=>["aops-projects",e.baseUrl],list:(e,n)=>[...Xh.all(e),"list",n??"anonymous"]};async function cI(e){const n=await e.get("/api/agentspace/projects");return uI(Array.isArray(n)?n:[])}function dI(e){return mt({queryKey:Xh.list(e.client.identity,e.sessionKey),queryFn:()=>cI(e.client),enabled:e.enabled??!0,retry:0,staleTime:1e4})}function uI(e){const n=new Set,r=[];for(const i of e){const o=pI(i);!o||n.has(o.key)||(n.add(o.key),r.push(o))}return r}function pI(e){const n=ln(e.id)??ln(e.projectId)??ln(e.scopeId),r=ln(e.scopeId)??n,i=ln(e.slug)??ln(e.name)??n;if(!i&&!n)return null;const o=i??n??"project";return{key:o,label:o,name:ln(e.name)??o,slug:o,projectId:n,scopeId:r,status:ln(e.status),visibility:ln(e.visibility),projectType:ln(e.projectType)}}function ln(e){const n=e?.trim();return n||null}const hI={preview:(e,n)=>[...Xh.all(e),"delete-preview",n]};async function mI(e,n){return await e.get(`/api/aops/projects/${n}/delete-preview`)}function fI(e){return mt({queryKey:hI.preview(e.client.identity,e.scopeId??"none"),enabled:!!e.scopeId&&e.enabled!==!1,staleTime:0,gcTime:0,queryFn:async()=>await mI(e.client,e.scopeId)})}async function vI(e){return await e.client.post(`/api/aops/projects/${e.scopeId}/delete`,{previewDigest:e.previewDigest,confirm:e.confirm})}function gI(e){const n=e.preview,r=e.typed.trim().toLowerCase(),i=[e.identity.name,e.identity.slug].map(v=>(v??"").trim()).filter(Boolean),o=i[0]??null,d=i.some(v=>v.toLowerCase()===r)&&r.length>0;if(!n)return{loading:!0,blocked:!1,blockers:[],totalRecords:0,confirmationRequired:o,confirmationMatches:d,canDelete:!1};const u=!n.deletable;return{loading:!1,blocked:u,blockers:n.blockers,totalRecords:n.totalRecords,confirmationRequired:o,confirmationMatches:d,canDelete:!u&&d&&o!==null&&e.busy!==!0}}function yI({project:e,preview:n,previewError:r,busy:i,onCancel:o,onDelete:d,t:u}){const[v,h]=y.useState(""),m=gI({preview:n,identity:e,typed:v,busy:i});return a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",children:a.jsxs("section",{className:"aops-v2-chat-modal",role:"dialog","aria-modal":"true","aria-label":u("projectsDeleteTitle"),"data-testid":"aops-v2-project-delete",children:[a.jsx("header",{className:"aops-pm-cardpane-head",children:a.jsxs("h3",{className:"aops-pm-cardpane-title",children:[u("projectsDeleteTitle")," — ",a.jsx("span",{className:"aops-pm-mono",children:e.name??e.slug??""})]})}),a.jsxs("div",{className:"aops-pm-cardpane-body",children:[r?a.jsx("p",{className:"aops-pm-delete-error","data-testid":"aops-v2-project-delete-error",children:r}):m.loading?a.jsx("p",{className:"aops-pm-boardcard-loading",role:"status",children:u("projectsDeleteCounting")}):m.blocked?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"aops-pm-delete-error",children:u("projectsDeleteBlocked")}),a.jsx("ul",{className:"aops-pm-cardpane-columns","data-testid":"aops-v2-project-delete-blockers",children:m.blockers.map(g=>a.jsxs("li",{className:"aops-pm-cardpane-column",children:[a.jsx("span",{className:"aops-pm-cardpane-column-name",children:g.label}),a.jsx("b",{children:g.count})]},g.label))})]}):a.jsx("p",{className:"aops-pm-cardpane-desc",children:u("projectsDeleteEmpty")}),!m.blocked&&!m.loading&&!r?a.jsxs("label",{className:"aops-pm-boardeditor-field",children:[a.jsx("span",{className:"aops-pm-boardeditor-label",children:u("projectsDeleteTypeName").replace("{name}",m.confirmationRequired??"")}),a.jsx("input",{type:"text",value:v,onChange:g=>h(g.target.value),disabled:i,"data-testid":"aops-v2-project-delete-confirm",autoComplete:"off"})]}):null]}),a.jsxs("div",{className:"aops-pm-delete-actions",children:[a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:o,disabled:i,children:u("pmCardCancel")}),a.jsx("button",{type:"button",className:"aops-v2-chat-danger-button",disabled:!m.canDelete||!n,onClick:()=>{!m.canDelete||!n||d({previewDigest:n.previewDigest,confirm:v.trim()})},"data-testid":"aops-v2-project-delete-confirm-button",children:u(i?"pmColumnsBusy":"projectsDeleteConfirm")})]})]})})}const bI=[{id:"overview",labelKey:"projectTabOverview",hintKey:"projectTabOverviewHint"},{id:"activity",labelKey:"projectTabActivity",hintKey:"projectTabActivityHint"},{id:"planning",labelKey:"projectTabPlanning",hintKey:"projectTabPlanningHint"},{id:"memory",labelKey:"projectTabMemory",hintKey:"projectTabMemoryHint"},{id:"docs",labelKey:"projectTabDocs",hintKey:"projectTabDocsHint"}];function jI({model:e,navigator:n,projectman:r,agentspace:i,docman:o,onNavigate:d,onOpenPlan:u,locale:v,t:h}){const m=e.isFetching||r.isFetching||i.isFetching||o.isFetching,g=()=>{e.onRefresh(),r.refresh(),i.refresh(),o.refresh()};let b=null;return e.status==="loading"?b=a.jsx(it,{variant:"loading",title:h("projectsLoadingTitle"),message:h("projectsLoadingMessage")}):e.status==="error"?b=a.jsx(it,{variant:"error",title:h("projectsErrorTitle"),message:It(e.error,"projects_unavailable"),actions:a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:e.onRefresh,children:h("authRetry")})}):e.status==="empty"?b=a.jsx(it,{variant:"empty",title:h("projectsEmptyTitle"),message:h("projectsEmptyMessage")}):e.status==="ready"&&(b=a.jsx(AI,{model:e,navigator:n,projectman:r,agentspace:i,docman:o,onNavigate:d,onOpenPlan:u,locale:v,t:h})),a.jsx(cn,{className:"aops-v2-section",mainClassName:"aops-v2-section-main",toolbar:a.jsxs("div",{className:"aops-project-toolbar",children:[a.jsxs("span",{children:[h("projectCount"),": ",a.jsx("b",{children:e.projects.length})]}),a.jsx("button",{type:"button",className:"aops-v2-secondary-button",disabled:m,onClick:g,children:h("projectsRefresh")})]}),children:a.jsx(LS,{className:"aops-v2-projects-subview",title:h("projectsListLabel"),children:b})})}function AI({model:e,navigator:n,projectman:r,agentspace:i,docman:o,onNavigate:d,onOpenPlan:u,locale:v,t:h}){const[m,g]=y.useState("overview"),b=e.selectedProject,[j,C]=y.useState(!1),[k,x]=y.useState(!1),[S,T]=y.useState(null),I=fI({client:r.client,scopeId:b?.scopeId??null,enabled:j}),E=y.useMemo(()=>RI({projectman:r,agentspace:i,docman:o,t:h}),[i,o,r,h]),L=y.useMemo(()=>({planning:r.boards.length+r.tasks.length+r.sprints.length+r.implementationPlans.length+r.issues.length+r.feedback.length+r.reviewRequests.length,memory:i.memoryItems.length+i.discussions.length+i.prompts.length+i.skills.length+i.artifacts.length+i.resources.length+i.agentProfiles.length,docs:o.documents.length+o.groups.length,activity:E.length}),[E.length,i.agentProfiles.length,i.artifacts.length,i.discussions.length,i.memoryItems.length,i.prompts.length,i.resources.length,i.skills.length,o.documents.length,o.groups.length,r.boards.length,r.feedback.length,r.implementationPlans.length,r.issues.length,r.reviewRequests.length,r.sprints.length,r.tasks.length]),P=y.useMemo(()=>[{id:"planning",tabId:"planning",label:h("projectDomainProjectman"),count:L.planning,status:r.status,latestAt:E.find(ne=>ne.domain==="planning")?.timestamp??null},{id:"memory",tabId:"memory",label:h("projectDomainAgentspace"),count:L.memory,status:i.status,latestAt:E.find(ne=>ne.domain==="memory")?.timestamp??null},{id:"docs",tabId:"docs",label:h("projectDomainDocman"),count:L.docs,status:o.status,latestAt:E.find(ne=>ne.domain==="docs")?.timestamp??null}],[E,i.status,o.status,r.status,L,h]),N=y.useMemo(()=>bI.map(ne=>({id:ne.id,label:h(ne.labelKey),title:h(ne.hintKey),count:ne.id==="overview"||ne.id==="activity"?void 0:L[ne.id],panelId:`aops-project-tabpanel-${ne.id}`})),[h,L]);y.useEffect(()=>{g("overview")},[b?.key]),y.useEffect(()=>{N.some(ne=>ne.id===m)||g("overview")},[m,N]);const R=b?a.jsx(kI,{project:b,activeTab:m,projectman:r,agentspace:i,docman:o,activityEvents:E,domainPulses:P,onSelectTab:g,onNavigate:d,onOpenPlan:u,locale:v,t:h}):a.jsx("div",{className:"aops-v2-route-proof","aria-label":h("projectsRegistryBadge"),children:a.jsx("span",{children:h("projectsRegistryBadge")})}),z=b?a.jsx(Oh,{className:"aops-project-detail-tabs",tabClassName:"aops-project-detail-tab",badgeClassName:"aops-project-detail-tab-badge",items:N,activeId:m,onChange:ne=>g(ne),ariaLabel:h("projectDetailTabsLabel")}):null;return a.jsxs("div",{className:["aops-project-record-surface",n.isLeftMenuMode?"is-left-menu":"is-detail-only"].join(" "),"data-testid":"aops-projects-record-surface",children:[a.jsx(xI,{project:e.selectedProject,tabCounts:L,onDelete:b?.scopeId?()=>{T(null),C(!0)}:void 0,t:h}),j&&b?.scopeId?a.jsx(yI,{project:{name:b.name,slug:b.slug},preview:I.data,previewError:S??(I.error?It(I.error):null),busy:k,onCancel:()=>{C(!1),x(!1)},onDelete:({previewDigest:ne,confirm:ye})=>{x(!0),T(null),vI({client:r.client,scopeId:b.scopeId,previewDigest:ne,confirm:ye}).then(()=>{C(!1),e.onRefresh()}).catch(J=>{T(It(J)),I.refetch()}).finally(()=>x(!1))},t:h}):null,a.jsx(Oc,{controller:n.controller,navigator:n.treePanel,navigatorLabel:h("projectsNavPanelTitle"),navigatorPanelTitle:h("projectsNavPanelTitle"),className:"aops-project-record-layout",leftMenuClassName:"inv-iv3-detail-leftmenu-shell aops-project-record-leftmenu",leftMenuPanelClassName:"inv-iv3-detail-leftmenu-panel aops-project-record-leftmenu-panel",leftMenuToggle:a.jsx("button",{type:"button",className:"aops-project-record-nav-mode","aria-label":h("navModeNavigator"),title:h("navModeNavigator"),onClick:n.controller.switchToNavigator,children:a.jsx(Yy,{size:13})}),closedMenuToggle:a.jsx("button",{type:"button",className:"aops-project-record-nav-mode","aria-label":h("navPaneReopen"),title:h("navPaneReopen"),onClick:n.controller.openNavigator,children:a.jsx(Yy,{size:13})}),tabs:z,tabsPlacement:"above-content",contentClassName:"aops-project-record-content",content:R,"data-testid":"aops-projects-record-layout"})]})}function xI({project:e,tabCounts:n,onDelete:r,t:i}){const o=e?.name??i("projectsTitle"),d=e?.slug??i("unknownValue"),u=[e?.status,e?.visibility,e?.projectType].filter(v=>!!v);return a.jsxs("header",{className:"aops-project-record-hero",children:[a.jsx("span",{className:"aops-project-record-eyebrow",children:i("projectsEyebrow")}),a.jsxs("div",{className:"aops-project-record-title-row",children:[a.jsx("h3",{children:o}),e?a.jsxs("span",{className:"aops-project-record-title-supplement",children:[a.jsx("span",{"aria-hidden":"true",children:"/"}),a.jsx("span",{title:d,children:d})]}):null,e&&r?a.jsx("button",{type:"button",className:"aops-pm-cards-mini",onClick:r,"aria-label":`${i("projectsDeleteTitle")}: ${o}`,title:i("projectsDeleteTitle"),"data-testid":"aops-v2-project-delete-open",children:i("projectsDeleteTitle")}):null]}),a.jsx("p",{className:"aops-project-record-note",children:u.length?u.join(" · "):i("projectsHeaderNote")}),a.jsxs("dl",{className:"aops-project-record-metrics","aria-label":i("projectReferences"),children:[a.jsx(ac,{label:i("projectScope"),value:CI(e?.scopeId),fullValue:e?.scopeId,t:i}),a.jsx(ac,{label:i("projectTabPlanning"),value:String(n.planning),t:i}),a.jsx(ac,{label:i("projectTabMemory"),value:String(n.memory),t:i}),a.jsx(ac,{label:i("projectTabDocs"),value:String(n.docs),t:i})]})]})}function ac({label:e,value:n,fullValue:r,t:i}){return a.jsxs("div",{children:[a.jsx("dt",{children:e}),a.jsx("dd",{title:r?.trim()||n?.trim()||void 0,children:n?.trim()?n:i("unknownValue")})]})}function Yy({size:e=14}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("rect",{x:"3.4",y:"4.4",width:"17.2",height:"15.2",rx:"2.6",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"M9.6 4.8v14.4",stroke:"currentColor",strokeWidth:"1.7"})]})}function CI(e){const n=e?.trim();return n?Oe(n):null}function kI({project:e,activeTab:n,projectman:r,agentspace:i,docman:o,activityEvents:d,domainPulses:u,onSelectTab:v,onNavigate:h,onOpenPlan:m,locale:g,t:b}){return a.jsx("aside",{className:"aops-project-detail","aria-label":b("projectDetailTitle"),"data-testid":"aops-project-detail",children:a.jsxs("div",{className:"aops-project-detail-body",role:"tabpanel",id:`aops-project-tabpanel-${n}`,"data-testid":"aops-project-detail-panel",children:[n==="overview"?a.jsx(EI,{project:e,domainPulses:u,activityEvents:d,projectman:r,onSelectTab:v,locale:g,t:b}):null,n==="activity"?a.jsx(II,{events:d,onNavigate:h,locale:g,t:b}):null,n==="planning"?a.jsx(SI,{model:r,onNavigate:h,onOpenPlan:m,t:b}):null,n==="memory"?a.jsx(wI,{model:i,onNavigate:h,t:b}):null,n==="docs"?a.jsx(NI,{model:o,onNavigate:h,t:b}):null]})})}function SI({model:e,onNavigate:n,onOpenPlan:r,t:i}){const o=e.boards.filter(b=>!dn(b)),d=e.sprints.filter(b=>!dn(b)),u=e.implementationPlans.filter(b=>!dn(b)),v=[...u,...d].sort(LI)[0]??null,h=e.issues.filter(b=>Hr(b.status)).length+e.feedback.filter(b=>Hr(b.status)).length,m=e.reviewRequests.filter(b=>Hr(b.status)).length,g=v?[{title:v.name??v.id,meta:`${v.id?Oe(v.id):i("unknownValue")} / ${u.some(b=>b.id===v.id)?i("pmPlans"):i("pmSprints")}`,status:v.status}]:[];return a.jsx(Wh,{title:i("projectPlanningTitle"),message:i("projectPlanningMessage"),status:e.status,metrics:[{label:i("pmBoards"),value:o.length},{label:i("pmTasks"),value:e.tasks.length},{label:i("pmSprints"),value:d.length},{label:i("pmPlans"),value:u.length},{label:i("pmOpenItems"),value:h},{label:i("pmRequestedReviews"),value:m}],latestTitle:i("projectLatestPlan"),latestItems:g,emptyMessage:i("projectSummaryEmpty"),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>n?.("pm-boards"),disabled:!n,children:i("projectOpenPlanning")}),a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>v&&r?.(v.id),disabled:!v||!r,children:i("projectOpenPlan")})]}),t:i})}function wI({model:e,onNavigate:n,t:r}){const i=e.memoryItems[0]??null,o=i?[{title:Zr(i.content,i.kind??i.id),meta:i.kind??i.durability??Oe(i.id),status:i.durability}]:[];return a.jsx(Wh,{title:r("projectMemoryTitle"),message:r("projectMemoryMessage"),status:e.status,metrics:[{label:r("asSectionMemory"),value:e.memoryItems.length},{label:r("asSectionDiscussions"),value:e.discussions.length},{label:r("asSectionPrompts"),value:e.prompts.length},{label:r("asSectionSkills"),value:e.skills.length},{label:r("asSectionResources"),value:e.resources.length}],latestTitle:r("projectLatestMemory"),latestItems:o,emptyMessage:r("projectSummaryEmpty"),actions:a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>n?.("as-memory"),disabled:!n,children:r("projectOpenMemory")}),t:r})}function NI({model:e,onNavigate:n,t:r}){const i=e.documents[0]??null,o=i?[{title:i.title??i.slug??i.documentUid??i.id,meta:i.groupUid??i.slug??Oe(i.id),status:i.status}]:[];return a.jsx(Wh,{title:r("projectDocsTitle"),message:r("projectDocsMessage"),status:e.status,metrics:[{label:r("docsTitle"),value:e.documents.length},{label:r("projectDocGroups"),value:e.groups.length}],latestTitle:r("projectLatestDocs"),latestItems:o,emptyMessage:r("projectSummaryEmpty"),actions:a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>n?.("docs"),disabled:!n,children:r("projectOpenDocs")}),t:r})}function Wh({title:e,message:n,status:r,metrics:i,latestTitle:o,latestItems:d,emptyMessage:u,actions:v,t:h}){const m=r==="loading"?h("projectSummaryLoading"):r==="error"?h("projectSummaryError"):r==="select-project"||r==="empty"?u:null;return a.jsxs("section",{className:"aops-project-detail-section",children:[a.jsxs("div",{className:"aops-project-detail-copy",children:[a.jsx("h5",{children:e}),a.jsx("p",{children:n})]}),m?a.jsx("p",{className:"aops-project-summary-state",children:m}):null,a.jsx("div",{className:"aops-project-summary-metrics",role:"list",children:i.map(g=>a.jsxs("div",{className:"aops-project-summary-metric",role:"listitem",children:[a.jsx("span",{children:g.label}),a.jsx("strong",{children:g.value})]},g.label))}),a.jsxs("div",{className:"aops-project-summary-latest",children:[a.jsx("span",{className:"aops-project-summary-heading",children:o}),d.length?a.jsx("ul",{className:"aops-project-summary-list",children:d.map(g=>a.jsxs("li",{className:"aops-project-summary-item",children:[a.jsx("span",{className:"aops-project-summary-item-main",title:g.title,children:Zr(g.title,h("unknownValue"))}),a.jsx("span",{className:"aops-project-summary-item-meta",children:[g.meta,g.status].filter(Boolean).join(" / ")||h("unknownValue")})]},`${g.title}:${g.meta??""}`))}):a.jsx("p",{className:"aops-project-summary-state",children:u})]}),a.jsx("div",{className:"aops-project-detail-actions",children:v})]})}function II({events:e,onNavigate:n,locale:r,t:i}){const[o,d]=y.useState("week"),u=y.useMemo(()=>{if(o==="all")return e;const b=o==="day"?1440*60*1e3:o==="week"?10080*60*1e3:720*60*60*1e3,j=Date.now()-b;return e.filter(C=>C.epoch>=j)},[e,o]),v=u.slice(0,60),h=y.useMemo(()=>sA(v,r),[r,v]),m=new Set(u.map(b=>b.domain)).size,g=[{id:"day",label:i("projectActivityRangeDay")},{id:"week",label:i("projectActivityRangeWeek")},{id:"month",label:i("projectActivityRangeMonth")},{id:"all",label:i("projectActivityRangeAll")}];return a.jsxs("section",{className:"aops-project-detail-section aops-project-activity","data-testid":"aops-project-activity",children:[a.jsxs("div",{className:"aops-project-activity-head",children:[a.jsxs("div",{className:"aops-project-detail-copy",children:[a.jsx("h5",{children:i("projectActivityTitle")}),a.jsx("p",{children:i("projectActivityMessage")})]}),a.jsx("div",{className:"aops-project-activity-range eops-segmented",role:"group","aria-label":i("projectActivityRangeLabel"),children:g.map(b=>a.jsx("button",{type:"button",className:`eops-segmented-item${o===b.id?" is-active":""}`,"aria-pressed":o===b.id,onClick:()=>d(b.id),"data-testid":`aops-project-activity-range-${b.id}`,children:b.label},b.id))})]}),a.jsx("p",{className:"aops-project-activity-note",children:i("projectActivitySnapshotNote")}),a.jsxs("dl",{className:"aops-project-activity-metrics",children:[a.jsx(pl,{label:i("projectActivityTotal"),value:e.length}),a.jsx(pl,{label:i("projectActivityVisible"),value:u.length}),a.jsx(pl,{label:i("projectActivityDomains"),value:m}),a.jsxs("div",{children:[a.jsx("dt",{children:i("projectActivityLatest")}),a.jsx("dd",{children:iA(e[0]?.timestamp??null,r,i)})]})]}),h.length?a.jsx("div",{className:"aops-project-activity-groups",children:h.map(b=>a.jsxs("section",{className:"aops-project-activity-day",children:[a.jsxs("header",{children:[a.jsx("time",{dateTime:b.key,children:b.label}),a.jsxs("span",{children:[b.events.length," ",i("projectActivityChanges")]})]}),a.jsx("ol",{className:"aops-project-activity-list",children:b.events.map(j=>a.jsxs("li",{className:`aops-project-activity-item is-${j.domain}`,"data-testid":"aops-project-activity-item",children:[a.jsx("span",{className:"aops-project-activity-rail","aria-hidden":"true",children:a.jsx("i",{})}),a.jsxs("div",{className:"aops-project-activity-copy",children:[a.jsxs("div",{className:"aops-project-activity-meta-row",children:[a.jsx("span",{className:"aops-project-activity-domain",children:rA(j.domain,i)}),a.jsx("time",{dateTime:j.timestamp,children:tt(j.timestamp,r)})]}),a.jsx("strong",{title:j.title,children:Zr(j.title,i("unknownValue"),140)}),a.jsx("span",{className:"aops-project-activity-kind",children:[j.kind,j.status,j.meta].filter(Boolean).join(" · ")})]}),a.jsx("button",{type:"button",className:"aops-project-activity-open",onClick:()=>n?.(j.pageId),disabled:!n,children:i("projectActivityOpen")})]},j.id))})]},b.key))}):a.jsx("p",{className:"aops-project-summary-state aops-project-activity-empty",children:i("projectActivityEmpty")})]})}function sA(e,n){const r=[];for(const i of e){const o=new Date(i.epoch),d=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")}`;let u=r[r.length-1];(!u||u.key!==d)&&(u={key:d,label:new Intl.DateTimeFormat(n==="tr"?"tr-TR":"en-US",{weekday:"short",day:"numeric",month:"long",year:"numeric"}).format(o),events:[]},r.push(u)),u.events.push(i)}return r}function rA(e,n){return n(e==="planning"?"projectDomainProjectman":e==="memory"?"projectDomainAgentspace":"projectDomainDocman")}function EI({project:e,domainPulses:n,activityEvents:r,projectman:i,onSelectTab:o,locale:d,t:u}){const v=i.issues.filter(m=>Hr(m.status)).length+i.feedback.filter(m=>Hr(m.status)).length,h=i.reviewRequests.filter(m=>Hr(m.status)).length;return a.jsxs("section",{className:"aops-project-detail-section aops-project-overview",children:[a.jsxs("div",{className:"aops-project-overview-section aops-project-pulse",children:[a.jsxs("div",{className:"aops-project-detail-copy",children:[a.jsx("h5",{children:u("projectPulseTitle")}),a.jsx("p",{children:u("projectPulseMessage")})]}),a.jsx("div",{className:"aops-project-pulse-grid",children:n.map(m=>a.jsxs("button",{type:"button",className:`aops-project-pulse-card is-${m.id}`,onClick:()=>o(m.tabId),"data-status":m.status,"data-testid":`aops-project-pulse-${m.id}`,children:[a.jsxs("span",{className:"aops-project-pulse-card-topline",children:[a.jsxs("span",{className:"aops-project-pulse-domain",children:[a.jsx("i",{"aria-hidden":"true"}),m.label]}),a.jsx("span",{className:"aops-project-pulse-state",children:DI(m.status,u)})]}),a.jsx("strong",{children:m.count}),a.jsxs("span",{className:"aops-project-pulse-latest",children:[u("projectDomainLatest")," · ",iA(m.latestAt,d,u)]})]},m.id))}),a.jsxs("dl",{className:"aops-project-attention-strip","aria-label":u("projectPulseTitle"),children:[a.jsx(pl,{label:u("projectPulseOpenWork"),value:v}),a.jsx(pl,{label:u("projectPulsePendingReviews"),value:h})]})]}),a.jsxs("div",{className:"aops-project-overview-lower aops-project-card-divider",children:[a.jsxs("div",{className:"aops-project-overview-section aops-project-identity-card",children:[a.jsxs("div",{className:"aops-project-detail-copy",children:[a.jsx("h5",{children:u("projectOverviewTitle")}),a.jsx("p",{children:u("projectOverviewMessage")})]}),a.jsxs("dl",{className:"aops-project-detail-grid",children:[a.jsx(Fs,{label:u("projectSlug"),value:e.slug,t:u}),a.jsx(Fs,{label:u("projectStatus"),value:e.status,t:u}),a.jsx(Fs,{label:u("projectVisibility"),value:e.visibility,t:u}),a.jsx(Fs,{label:u("projectType"),value:e.projectType,t:u}),a.jsx(Fs,{label:u("projectScope"),value:e.scopeId,t:u}),a.jsx(Fs,{label:u("projectId"),value:e.projectId,t:u}),a.jsx(Fs,{label:u("projectKey"),value:e.key,t:u})]})]}),a.jsx(MI,{events:r,onSelectTab:o,locale:d,t:u})]})]})}function MI({events:e,onSelectTab:n,locale:r,t:i}){const o=sA(e,r)[0],d=o?.events.slice(0,7).reverse()??[];return a.jsxs("section",{className:"aops-project-latest-day","data-testid":"aops-project-latest-day",children:[a.jsxs("header",{className:"aops-project-latest-day-head",children:[a.jsxs("div",{className:"aops-project-detail-copy",children:[a.jsx("h5",{children:i("projectLatestDayTitle")}),a.jsx("p",{children:o?`${o.label} · ${o.events.length} ${i("projectActivityChanges")}`:i("projectLatestDayMessage")})]}),a.jsxs("button",{type:"button",className:"aops-project-latest-day-open",onClick:()=>n("activity"),"data-testid":"aops-project-latest-day-open",children:[i("projectLatestDayOpenAll"),a.jsx("span",{"aria-hidden":"true",children:"→"})]})]}),d.length?a.jsx("ol",{className:"aops-project-latest-day-list",children:d.map(u=>a.jsx("li",{className:`aops-project-latest-day-item is-${u.domain}`,"data-testid":"aops-project-latest-day-item","data-epoch":u.epoch,children:a.jsxs("button",{type:"button",onClick:()=>n(u.domain),children:[a.jsx("time",{dateTime:u.timestamp,children:BI(u.timestamp,r)}),a.jsx("span",{className:"aops-project-latest-day-icon","aria-hidden":"true",children:a.jsx(TI,{domain:u.domain})}),a.jsxs("span",{className:"aops-project-latest-day-copy",children:[a.jsx("strong",{title:u.title,children:Zr(u.title,i("unknownValue"),92)}),a.jsxs("span",{children:[rA(u.domain,i)," · ",u.kind]})]}),a.jsx("span",{className:"aops-project-latest-day-ref",children:Zr(u.status??u.meta??u.kind,i("unknownValue"),24)})]})},u.id))}):a.jsx("p",{className:"aops-project-summary-state aops-project-latest-day-empty",children:i("projectLatestDayEmpty")})]})}function TI({domain:e}){return e==="memory"?a.jsxs("svg",{viewBox:"0 0 24 24",focusable:"false",children:[a.jsx("path",{d:"M9 5a3 3 0 0 0-5 2.2A3.2 3.2 0 0 0 3 13a3.4 3.4 0 0 0 4 4.8A3 3 0 0 0 12 20V4A3 3 0 0 0 9 5Zm6 0a3 3 0 0 1 5 2.2A3.2 3.2 0 0 1 21 13a3.4 3.4 0 0 1-4 4.8A3 3 0 0 1 12 20V4a3 3 0 0 1 3 1Z"}),a.jsx("path",{d:"M7 10h2m6 0h2M8 15h2m4 0h2"})]}):e==="docs"?a.jsxs("svg",{viewBox:"0 0 24 24",focusable:"false",children:[a.jsx("path",{d:"M6 3h8l4 4v14H6V3Z"}),a.jsx("path",{d:"M14 3v5h5M9 12h6m-6 4h6"})]}):a.jsxs("svg",{viewBox:"0 0 24 24",focusable:"false",children:[a.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),a.jsx("path",{d:"M9 4v16m6-16v16M6 8h2m3 4h2m3 4h2"})]})}function BI(e,n){const r=Date.parse(e);return Number.isFinite(r)?new Intl.DateTimeFormat(n==="tr"?"tr-TR":"en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(r)):"--:--"}function pl({label:e,value:n}){return a.jsxs("div",{children:[a.jsx("dt",{children:e}),a.jsx("dd",{children:n})]})}function DI(e,n){return n(e==="loading"?"projectDomainLoading":e==="error"?"projectDomainError":e==="empty"||e==="select-project"?"projectDomainEmpty":"projectDomainReady")}function iA(e,n,r){return e?tt(e,n):r("unknownValue")}function RI({projectman:e,agentspace:n,docman:r,t:i}){const o=[],d=u=>{const v=Date.parse(u.timestamp);Number.isFinite(v)&&o.push({...u,epoch:v})};for(const u of e.boards)d({id:`board:${u.id}`,domain:"planning",kind:i("pmBoards"),title:u.name??u.slug??u.id,meta:Oe(u.id),status:dn(u)?"archived":null,timestamp:u.archivedAt??u.updatedAt??u.createdAt,pageId:"pm-boards"});for(const u of e.tasks)d({id:`task:${u.id}`,domain:"planning",kind:i("pmTasks"),title:u.title??u.id,meta:Oe(u.id),status:u.status,timestamp:u.updatedAt??u.createdAt,pageId:"pm-boards"});for(const u of e.sprints)d({id:`sprint:${u.id}`,domain:"planning",kind:i("pmSprints"),title:u.name??u.id,meta:Oe(u.id),status:u.status,timestamp:u.archivedAt??u.updatedAt??u.createdAt,pageId:"pm-sprints"});for(const u of e.implementationPlans)d({id:`plan:${u.id}`,domain:"planning",kind:i("pmPlans"),title:u.name??u.id,meta:Oe(u.id),status:u.status,timestamp:u.updatedAt??u.createdAt??"",pageId:"pm-sprints"});for(const u of e.issues)d({id:`issue:${u.id}`,domain:"planning",kind:i("pmIssues"),title:u.title??u.id,meta:u.severity??Oe(u.id),status:u.status,timestamp:u.updatedAt??u.createdAt,pageId:"pm-issues"});for(const u of e.feedback)d({id:`feedback:${u.id}`,domain:"planning",kind:i("pmFeedback"),title:u.title??u.id,meta:u.type??u.severity??Oe(u.id),status:u.status,timestamp:u.updatedAt??u.createdAt,pageId:"pm-feedback"});for(const u of e.reviewRequests){d({id:`review:${u.id}`,domain:"planning",kind:i("pmReviews"),title:u.title??u.id,meta:u.targetAgent??u.requestedBy??Oe(u.id),status:u.status,timestamp:u.updatedAt??u.createdAt,pageId:"pm-reviews"});for(const v of u.results??[])d({id:`review-result:${u.id}:${v.id}`,domain:"planning",kind:i("pmReviews"),title:v.summary??u.title??v.id,meta:v.reviewer??Oe(u.id),status:v.outcome,timestamp:v.createdAt,pageId:"pm-reviews"})}for(const u of n.memoryItems)d({id:`memory:${u.id}`,domain:"memory",kind:i("asSectionMemory"),title:Zr(u.content,u.kind??u.id,140),meta:u.kind??Oe(u.id),status:u.durability,timestamp:u.updatedAt??u.createdAt??"",pageId:"as-memory"});for(const u of n.discussions)d({id:`discussion:${u.id}`,domain:"memory",kind:i("asSectionDiscussions"),title:u.title??u.question??u.slug??u.id,meta:u.participants?.join(", ")??Oe(u.id),status:u.status,timestamp:u.lastTurnAt??u.updatedAt??u.createdAt??"",pageId:"as-discussions"});for(const u of n.prompts)d({id:`prompt:${u.id}`,domain:"memory",kind:i("asSectionPrompts"),title:u.name??u.id,meta:Oe(u.id),status:u.status,timestamp:u.updatedAt??u.createdAt??"",pageId:"as-prompts"});for(const u of n.skills)d({id:`skill:${u.id}`,domain:"memory",kind:i("asSectionSkills"),title:u.name??u.id,meta:Oe(u.id),status:u.status,timestamp:u.updatedAt??u.createdAt??"",pageId:"as-skills"});for(const u of n.artifacts)d({id:`artifact:${u.id}`,domain:"memory",kind:i("asSectionArtifacts"),title:u.label??u.storagePath??u.id,meta:u.artifactType??Oe(u.id),timestamp:u.updatedAt??u.createdAt??"",pageId:"as-artifacts"});for(const u of n.resources)d({id:`resource:${u.id}`,domain:"memory",kind:i("asSectionResources"),title:u.name??u.uri??u.id,meta:u.resourceType??Oe(u.id),timestamp:u.updatedAt??u.createdAt??"",pageId:"as-resources"});for(const u of n.agentProfiles)d({id:`agent:${u.id}`,domain:"memory",kind:i("asSectionAgents"),title:u.name??u.slug??u.id,meta:u.role??u.kind??Oe(u.id),timestamp:u.updatedAt??u.createdAt??"",pageId:"as-agents"});for(const u of r.documents)d({id:`document:${u.id}`,domain:"docs",kind:i("docsTitle"),title:u.title??u.slug??u.documentUid??u.id,meta:u.groupUid??u.slug??Oe(u.id),status:u.status,timestamp:u.updatedAt??u.createdAt??"",pageId:"docs"});return o.sort((u,v)=>v.epoch-u.epoch)}function Fs({label:e,value:n,t:r}){return a.jsxs("div",{children:[a.jsx("dt",{children:e}),a.jsx("dd",{title:n?.trim()||void 0,children:n?.trim()?n:r("unknownValue")})]})}function LI(e,n){return Date.parse(n.updatedAt??n.createdAt??"")-Date.parse(e.updatedAt??e.createdAt??"")}function Zr(e,n,r=96){const i=(e??"").replace(/\s+/g," ").trim()||n;return i.length>r?`${i.slice(0,r-1)}...`:i}const th="v0-shared-epoch",ah={kdf:"hkdf-sha256",saltSpec:"tenantId|spaceId|keyId|epoch",info:"chatv3-v0-epoch-wrap",wrapAlg:"aes-256-gcm"},Un=globalThis.crypto.subtle,hl=new TextEncoder,OI=new TextDecoder;function un(e){let n="";for(const r of e)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function fn(e){const n=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(Math.ceil(e.length/4)*4,"="),r=atob(n),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i}function Zh(e){const n=new Uint8Array(e);return globalThis.crypto.getRandomValues(n),un(n)}const _I=()=>Zh(24),QI=()=>Zh(32),UI=()=>`cvk_${Zh(9)}`;async function PI(e){const n=await Un.digest("SHA-256",hl.encode(e));return[...new Uint8Array(n)].map(r=>r.toString(16).padStart(2,"0")).join("")}async function ml(e,n){const r=await Un.importKey("raw",hl.encode(e),"HKDF",!1,["deriveKey"]),i=hl.encode(`${n.tenantId}|${n.spaceId}|${n.keyId}|${n.epoch}`);return Un.deriveKey({name:"HKDF",hash:"SHA-256",salt:i,info:hl.encode(ah.info)},r,{name:"AES-GCM",length:256},!1,["wrapKey","unwrapKey"])}async function Jy(){return Un.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"])}async function dc(e){return Un.importKey("raw",fn(e),{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Xy(e,n){const r=new Uint8Array(12);globalThis.crypto.getRandomValues(r);const i=new Uint8Array(await Un.wrapKey("raw",n,e,{name:"AES-GCM",iv:r})),o=new Uint8Array(r.length+i.length);return o.set(r,0),o.set(i,r.length),un(o)}async function fl(e,n){const r=fn(n),i=r.slice(0,12),o=r.slice(12);return Un.unwrapKey("raw",o,e,{name:"AES-GCM",iv:i},{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function FI(e,n,r){const i=new Uint8Array(12);globalThis.crypto.getRandomValues(i);const o=new Uint8Array(await Un.encrypt({name:"AES-GCM",iv:i},e,hl.encode(r)));return{protocolVersion:1,cipherSuite:th,epoch:n,ciphertext:un(o),nonce:un(i)}}async function KI(e,n){const r=await Un.decrypt({name:"AES-GCM",iv:fn(n.nonce)},e,fn(n.ciphertext));return OI.decode(r)}function Wy(e){const n=encodeURIComponent(e.serverBaseUrl);return e.mode==="server-encrypted"?`chv3://join/${n}/${e.channelId}#srv.${e.keyId}.${e.accessSecret}`:`chv3://join/${n}/${e.channelId}#${e.keyId}.${e.accessSecret}.${e.wrapSecret}`}const zI=/^chv3:\/\/join\/([^/]+)\/([0-9a-fA-F-]{36})#([^.]+)\.([^.]+)\.([^.]+)$/,$I=/^chv3:\/\/join\/([^/]+)\/([0-9a-fA-F-]{36})#srv\.([^.]+)\.([^.]+)$/,Zy=/^cvk_[A-Za-z0-9_-]+$/;function Sl(e){const n=e.trim(),r=$I.exec(n);if(r){const d=r[3];if(!Zy.test(d))throw new Error("invalid chatv3 invite keyId");return{mode:"server-encrypted",serverBaseUrl:decodeURIComponent(r[1]),channelId:r[2],keyId:d,accessSecret:r[4]}}const i=zI.exec(n);if(!i)throw new Error("invalid chatv3 invite string");const o=i[3];if(!Zy.test(o))throw new Error("invalid chatv3 invite keyId");return{mode:"e2e",serverBaseUrl:decodeURIComponent(i[1]),channelId:i[2],keyId:o,accessSecret:i[4],wrapSecret:i[5]}}class HI{wrapSecrets=new Map;epochKeys=new Map;async setWrapSecret(n,r){this.wrapSecrets.set(n,r)}async getWrapSecret(n){return this.wrapSecrets.get(n)??null}async setEpochKey(n,r,i){this.epochKeys.set(`${n}#${r}`,i)}async getEpochKey(n,r){return this.epochKeys.get(`${n}#${r}`)??null}async deleteEpochKey(n,r){this.epochKeys.delete(`${n}#${r}`)}}function GI(e,n,r){const i=e.includes("?")?"&":"?";return`${e}${i}${encodeURIComponent(n)}=${encodeURIComponent(r)}`}class qI extends dj{memberHeaders;authv2AccessToken;chatv3MemberToken;constructor(n){const r={},i=n.accessToken??n.memberToken??null;n.accessToken&&n.memberToken&&(r["x-chatv3-member-token"]=`Bearer ${n.memberToken}`),super({serverBaseUrl:n.serverBaseUrl,apiPrefix:"/api/chatv3/v1",tokenProvider:new Nh(i),fetchImpl:n.fetchImpl,defaultHeaders:r}),this.memberHeaders=r,this.authv2AccessToken=n.accessToken??null,this.chatv3MemberToken=n.memberToken??null}get memberToken(){return this.chatv3MemberToken??void 0}set memberToken(n){this.chatv3MemberToken=n??null,this.syncAuthHeaders()}get accessToken(){return this.authv2AccessToken??void 0}set accessToken(n){this.authv2AccessToken=n??null,this.syncAuthHeaders()}syncAuthHeaders(){if(this.authv2AccessToken){this.tokens.set(this.authv2AccessToken),this.chatv3MemberToken?this.memberHeaders["x-chatv3-member-token"]=`Bearer ${this.chatv3MemberToken}`:delete this.memberHeaders["x-chatv3-member-token"];return}delete this.memberHeaders["x-chatv3-member-token"],this.tokens.set(this.chatv3MemberToken)}streamUrl(n){const r=this.url(`/rooms/${n}/stream`),i=this.tokens.get();return i?GI(r,"token",i):r}}class VI extends Error{code="chatv3_join_compensation_failed";compensationFailed=!0;compensationError;constructor(n,r){super("ChatV3 join initialization failed and membership rollback failed.",{cause:n}),this.name="Chatv3JoinCompensationError",Object.defineProperty(this,"compensationError",{value:r,enumerable:!1,configurable:!1,writable:!1})}}class YI{http;keyStore;serverBaseUrl;keyIdByChannel=new Map;memberCacheByChannel=new Map;constructor(n){this.http=new qI(n),this.keyStore=n.keyStore??new HI,this.serverBaseUrl=n.serverBaseUrl.replace(/\/$/,"")}async rememberChannelInvite(n){const r=typeof n=="string"?Sl(n):n;return this.keyIdByChannel.set(r.channelId,r.keyId),r.mode!=="server-encrypted"&&await this.keyStore.setWrapSecret(r.channelId,r.wrapSecret),r}async ensureSpace(n,r){return this.http.post("/spaces/ensure",{slug:n,title:r})}async listSpaces(n={}){const r=new URLSearchParams;n.tenantId&&r.set("tenantId",n.tenantId),n.status&&r.set("status",n.status),n.limit!=null&&r.set("limit",String(n.limit));const i=r.toString();return this.http.get(`/spaces${i?`?${i}`:""}`)}async archiveSpace(n,r={}){return this.http.post(`/spaces/${n}/archive`,{...r})}async createChannel(n){const r=_I(),i=UI(),o=1,d=n.encryptionMode??"e2e";let u,v,h;if(d==="e2e"){u=QI();const b={tenantId:n.space.tenantId,spaceId:n.space.id,keyId:i,epoch:o},j=await Jy(),C=await ml(u,b),k=await Xy(C,j);v=await fl(C,k),h={epoch:o,cipherSuite:th,wrappedKeyBlob:k,kdfMeta:{...ah}}}const m=await this.http.post("/channels",{tenantId:n.space.tenantId,spaceId:n.space.id,slug:n.slug,title:n.title,...n.purpose?{purpose:n.purpose}:{},...n.guidanceMarkdown?{guidanceMarkdown:n.guidanceMarkdown}:{},...n.generalRoomGuidanceMarkdown?{generalRoomGuidanceMarkdown:n.generalRoomGuidanceMarkdown}:{},encryptionMode:d,accessKey:{keyId:i,verifierHash:await PI(r)},...h?{epoch:h}:{},creator:{handle:n.handle,actorKind:"agent"}});if(this.http.memberToken=m.memberToken,this.keyIdByChannel.set(m.channel.id,i),d==="server-encrypted"){if(!m.serverEpochKey)throw new Error("server-encrypted channel create did not return serverEpochKey");await this.keyStore.setEpochKey(m.generalRoom.id,o,await dc(m.serverEpochKey))}else await this.keyStore.setWrapSecret(m.channel.id,u),await this.keyStore.setEpochKey(m.generalRoom.id,o,v);const g=Wy(d==="server-encrypted"?{mode:"server-encrypted",serverBaseUrl:this.serverBaseUrl,channelId:m.channel.id,keyId:i,accessSecret:r}:{mode:"e2e",serverBaseUrl:this.serverBaseUrl,channelId:m.channel.id,keyId:i,accessSecret:r,wrapSecret:u});return{channel:m.channel,generalRoom:m.generalRoom,invite:g}}async importServerEpochKeys(n){if(n.length>0&&typeof this.keyStore.deleteEpochKey!="function")throw new Error("ChatV3 keystore must implement deleteEpochKey for atomic epoch-key imports.");const r=await Promise.all(n.map(async o=>({roomId:o.roomId,epoch:o.epoch,key:await dc(o.rawEpochKey)}))),i=[];try{for(const o of r){const d=await this.keyStore.getEpochKey(o.roomId,o.epoch);i.push({roomId:o.roomId,epoch:o.epoch,previous:d}),await this.keyStore.setEpochKey(o.roomId,o.epoch,o.key)}}catch(o){for(const d of i.reverse())try{d.previous?await this.keyStore.setEpochKey(d.roomId,d.epoch,d.previous):await this.keyStore.deleteEpochKey(d.roomId,d.epoch)}catch{}throw o}}async joinFromInvite(n,r){const i=typeof n=="string"?Sl(n):n,o=await this.http.post(`/channels/${i.channelId}/join`,{keyId:i.keyId,accessSecret:i.accessSecret,handle:r,actorKind:"agent"}),d=this.http.memberToken,u=this.keyIdByChannel.get(o.channel.id);this.http.memberToken=o.memberToken,this.keyIdByChannel.set(o.channel.id,i.keyId);try{const v=o.channel.encryptionMode??i.mode??"e2e";if(i.mode==="server-encrypted"||v==="server-encrypted"){const h=o.serverEpochKeys??(await this.epochKeys(o.channel.id,{tenantId:o.channel.tenantId})).keys;return await this.importServerEpochKeys(h),{rooms:o.rooms,epochKeys:h}}await this.keyStore.setWrapSecret(o.channel.id,i.wrapSecret);for(const h of o.epochs){const m=await ml(i.wrapSecret,{tenantId:o.channel.tenantId,spaceId:o.channel.spaceId,keyId:i.keyId,epoch:h.epoch}),g=await fl(m,h.wrappedKeyBlob);await this.keyStore.setEpochKey(h.roomId,h.epoch,g)}return{rooms:o.rooms}}catch(v){let h;try{await this.updateMember(o.member.id,{status:"removed"})}catch(m){h=m}finally{this.http.memberToken=d,u?this.keyIdByChannel.set(o.channel.id,u):this.keyIdByChannel.delete(o.channel.id)}throw h!==void 0?new VI(v,h):v}}async epochKeys(n,r={}){const i=new URLSearchParams;r.tenantId&&i.set("tenantId",r.tenantId);const o=i.toString();return this.http.get(`/channels/${n}/epoch-keys${o?`?${o}`:""}`)}async remintMemberToken(n,r={}){const i=await this.http.post(`/channels/${n}/members/me/token`,{channelId:n,...r.tenantId?{tenantId:r.tenantId}:{}});return this.http.memberToken=i.memberToken,i}async recoverMemberToken(n,r,i={}){const o=await this.http.post(`/channels/${n}/members/${r}/token`,{channelId:n,memberId:r,...i.tenantId?{tenantId:i.tenantId}:{}});return this.http.memberToken=o.memberToken,o}async sendText(n,r,i="message"){const o=await this.keyStore.getEpochKey(n.id,n.currentEpoch);if(!o)throw new Error(`no epoch key for room ${n.id} epoch ${n.currentEpoch}`);const d=await FI(o,n.currentEpoch,r);return{seq:(await this.http.post(`/rooms/${n.id}/messages`,{kind:i,envelope:d})).message.seq}}async readText(n,r=0,i){const o=new URLSearchParams({afterSeq:String(r)});i!=null&&o.set("limit",String(i));const d=await this.http.get(`/rooms/${n.id}/messages?${o.toString()}`),u=[];for(const v of d){const h=await this.keyStore.getEpochKey(n.id,v.epoch),{ciphertext:m,nonce:g,...b}=v;u.push({...b,text:h?await KI(h,{ciphertext:m,nonce:g}):"[locked]"})}return u}async listMembers(n,r={}){const i=new URLSearchParams;r.status&&i.set("status",r.status),r.limit!=null&&i.set("limit",String(r.limit));const o=i.toString(),u=(await this.http.get(`/channels/${n}/members${o?`?${o}`:""}`)).map(({tokenHash:v,...h})=>h);return this.memberCacheByChannel.set(n,new Map(u.map(v=>[v.id,v]))),u}async updateMember(n,r){return this.http.request("PATCH",`/members/${n}`,{...r.displayName!==void 0?{displayName:r.displayName??void 0}:{},...r.roleKey?{roleKey:r.roleKey}:{},...r.status?{status:r.status}:{}})}resolveMember(n,r){return this.memberCacheByChannel.get(n)?.get(r)}async listRoomMembers(n,r={}){const i=new URLSearchParams;r.status&&i.set("status",r.status),r.limit!=null&&i.set("limit",String(r.limit));const o=i.toString();return this.http.get(`/rooms/${n}/members${o?`?${o}`:""}`)}async joinRoom(n){return this.http.post(`/rooms/${n}/join`,{})}async leaveRoom(n){return this.http.post(`/rooms/${n}/leave`,{})}async updateRoomMember(n,r,i){return this.http.request("PATCH",`/rooms/${n}/members/${r}`,{status:i})}async listPresence(n){return this.http.get(`/rooms/${n}/presence`)}async setPresence(n,r={}){return this.http.post(`/rooms/${n}/presence`,{...r})}async getReceipts(n){return this.http.get(`/rooms/${n}/receipts`)}async listBindings(n,r={}){const i=new URLSearchParams;r.roomId&&i.set("roomId",r.roomId);const o=i.toString();return this.http.get(`/channels/${n}/bindings${o?`?${o}`:""}`)}async markRead(n,r){return this.http.post(`/rooms/${n}/read`,{lastReadSeq:r})}async markDelivered(n,r){return this.http.post(`/rooms/${n}/delivered`,{deliveredSeq:r})}async ackDirective(n,r){return this.http.post(`/rooms/${n}/ack`,{ackSeq:r})}async getChannel(n){return this.http.get(`/channels/${n}`)}async createRoom(n){if(n.channel.encryptionMode==="server-encrypted"){const g=await this.http.post(`/channels/${n.channel.id}/rooms`,{channelId:n.channel.id,slug:n.slug,title:n.title,kind:n.kind??"session",...n.purpose?{purpose:n.purpose}:{},...n.guidanceMarkdown?{guidanceMarkdown:n.guidanceMarkdown}:{}});if(!g.serverEpochKey)throw new Error("server-encrypted room create did not return serverEpochKey");return await this.keyStore.setEpochKey(g.room.id,g.room.currentEpoch,await dc(g.serverEpochKey)),g.room}const r=this.keyIdByChannel.get(n.channel.id),i=await this.keyStore.getWrapSecret(n.channel.id);if(!r||!i)throw new Error(`no channel crypto material for ${n.channel.id}`);const o=1,d=await Jy(),u=await ml(i,{tenantId:n.channel.tenantId,spaceId:n.channel.spaceId,keyId:r,epoch:o}),v=await Xy(u,d),h=await fl(u,v),m=await this.http.post(`/channels/${n.channel.id}/rooms`,{channelId:n.channel.id,slug:n.slug,title:n.title,kind:n.kind??"session",...n.purpose?{purpose:n.purpose}:{},...n.guidanceMarkdown?{guidanceMarkdown:n.guidanceMarkdown}:{},epoch:{epoch:o,cipherSuite:th,wrappedKeyBlob:v,kdfMeta:{...ah}}});return await this.keyStore.setEpochKey(m.room.id,o,h),m.room}async listChannels(n={}){const r=new URLSearchParams;n.tenantId&&r.set("tenantId",n.tenantId),n.spaceId&&r.set("spaceId",n.spaceId),n.status&&r.set("status",n.status),n.limit!=null&&r.set("limit",String(n.limit));const i=r.toString();return this.http.get(`/channels${i?`?${i}`:""}`)}async listMyChannels(n={}){const r=new URLSearchParams;n.tenantId&&r.set("tenantId",n.tenantId),n.spaceId&&r.set("spaceId",n.spaceId),n.status&&r.set("status",n.status),n.limit!=null&&r.set("limit",String(n.limit));const i=r.toString();return this.http.get(`/channels/mine${i?`?${i}`:""}`)}async purgeChannelsBefore(n){return this.http.post("/channels/purge-before",{beforeDate:n.beforeDate,...n.tenantId?{tenantId:n.tenantId}:{},...n.dryRun!==void 0?{dryRun:n.dryRun}:{},...n.confirm!==void 0?{confirm:n.confirm}:{}})}async registerUserKey(n){return this.http.post("/users/me/key-backup",n)}async getUserKey(n={}){const r=new URLSearchParams;n.tenantId&&r.set("tenantId",n.tenantId);const i=r.toString();return this.http.get(`/users/me/key-backup${i?`?${i}`:""}`)}async putMemberKeyPackage(n){return this.http.request("PUT",`/channels/${n.channelId}/members/${n.memberId}/key-package`,{...n.tenantId?{tenantId:n.tenantId}:{},recipientUserKeyId:n.recipientUserKeyId,recipientKeyVersion:n.recipientKeyVersion,envelope:n.envelope})}async getMemberKeyPackage(n){const r=new URLSearchParams;n.tenantId&&r.set("tenantId",n.tenantId);const i=r.toString();return this.http.get(`/channels/${n.channelId}/members/${n.memberId}/key-package${i?`?${i}`:""}`)}async getMemberRecovery(n){const r=new URLSearchParams;n.tenantId&&r.set("tenantId",n.tenantId),n.mintToken!==void 0&&r.set("mintToken",String(n.mintToken));const i=r.toString();return this.http.get(`/channels/${n.channelId}/recovery${i?`?${i}`:""}`)}async archiveChannel(n,r={}){return this.http.post(`/channels/${n}/archive`,{...r})}async unarchiveChannel(n,r={}){return this.http.post(`/channels/${n}/unarchive`,{...r})}async deleteChannel(n,r){return this.http.request("DELETE",`/channels/${n}`,{confirmSlug:r.confirmSlug,...r.tenantId?{tenantId:r.tenantId}:{}})}async listRooms(n,r={}){const i=new URLSearchParams;r.status&&i.set("status",r.status),r.limit!=null&&i.set("limit",String(r.limit));const o=i.toString();return this.http.get(`/channels/${n}/rooms${o?`?${o}`:""}`)}async archiveRoom(n){return this.http.post(`/rooms/${n}/archive`,{})}async deleteRoom(n,r){return this.http.request("DELETE",`/rooms/${n}`,{confirmSlug:r.confirmSlug})}}class lA{dbName;storeName;constructor(n){this.dbName=n.dbName,this.storeName=n.storeName??"kv"}open(){return new Promise((n,r)=>{const i=indexedDB.open(this.dbName,1);i.onupgradeneeded=()=>{i.result.objectStoreNames.contains(this.storeName)||i.result.createObjectStore(this.storeName)},i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error)})}async get(n){const r=await this.open();try{return await new Promise((i,o)=>{const u=r.transaction(this.storeName,"readonly").objectStore(this.storeName).get(n);u.onsuccess=()=>i(u.result??null),u.onerror=()=>o(u.error)})}finally{r.close()}}async put(n,r){const i=await this.open();try{await new Promise((o,d)=>{const u=i.transaction(this.storeName,"readwrite");u.objectStore(this.storeName).put(r,n),u.oncomplete=()=>o(),u.onerror=()=>d(u.error)})}finally{i.close()}}async delete(n){const r=await this.open();try{await new Promise((i,o)=>{const d=r.transaction(this.storeName,"readwrite");d.objectStore(this.storeName).delete(n),d.oncomplete=()=>i(),d.onerror=()=>o(d.error)})}finally{r.close()}}}const aa=new lA({dbName:"aops-cockpit-v2-chat",storeName:"keys"}),yp="session:v1",bp="channel-member-token:",jp="channel-key-id:",Ap="channel-invite:";class oA{async setWrapSecret(n,r){await aa.put(`wrap:${n}`,r)}async getWrapSecret(n){return aa.get(`wrap:${n}`)}async setEpochKey(n,r,i){await aa.put(`epoch:${n}:${r}`,i)}async getEpochKey(n,r){return aa.get(`epoch:${n}:${r}`)}async deleteEpochKey(n,r){await aa.delete(`epoch:${n}:${r}`)}}class cA{async get(){return aa.get(yp)}async set(n){await aa.put(yp,n)}async clear(){await aa.delete(yp)}async setChannelMemberToken(n,r){await aa.put(`${bp}${n}`,r)}async getChannelMemberToken(n){return aa.get(`${bp}${n}`)}async deleteChannelMemberToken(n){await aa.delete(`${bp}${n}`)}async setChannelKeyId(n,r){await aa.put(`${jp}${n}`,r)}async getChannelKeyId(n){return aa.get(`${jp}${n}`)}async deleteChannelKeyId(n){await aa.delete(`${jp}${n}`)}async setChannelInvite(n,r){await aa.put(`${Ap}${n}`,r)}async getChannelInvite(n){return aa.get(`${Ap}${n}`)}async deleteChannelInvite(n){await aa.delete(`${Ap}${n}`)}}function Js(e,n,r,i){function o(d){return d instanceof r?d:new r(function(u){u(d)})}return new(r||(r=Promise))(function(d,u){function v(g){try{m(i.next(g))}catch(b){u(b)}}function h(g){try{m(i.throw(g))}catch(b){u(b)}}function m(g){g.done?d(g.value):o(g.value).then(v,h)}m((i=i.apply(e,[])).next())})}class Dt{constructor(){this.mutex=Promise.resolve()}lock(){let n=()=>{};return this.mutex=this.mutex.then(()=>new Promise(n)),new Promise(r=>{n=r})}dispatch(n){return Js(this,void 0,void 0,function*(){const r=yield this.lock();try{return yield Promise.resolve(n())}finally{r()}})}}var xp;function JI(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global}const nh=JI(),Cp=(xp=nh.Buffer)!==null&&xp!==void 0?xp:null,XI=nh.TextEncoder?new nh.TextEncoder:null;function dA(e,n){return(e&15)+(e>>6|e>>3&8)<<4|(n&15)+(n>>6|n>>3&8)}function uA(e,n){const r=n.length>>1;for(let i=0;i<r;i++){const o=i<<1;e[i]=dA(n.charCodeAt(o),n.charCodeAt(o+1))}}function WI(e,n){if(e.length!==n.length*2)return!1;for(let r=0;r<n.length;r++){const i=r<<1;if(n[r]!==dA(e.charCodeAt(i),e.charCodeAt(i+1)))return!1}return!0}const eb=87,tb=48;function sh(e,n,r){let i=0;for(let o=0;o<r;o++){let d=n[o]>>>4;e[i++]=d>9?d+eb:d+tb,d=n[o]&15,e[i++]=d>9?d+eb:d+tb}return String.fromCharCode.apply(null,e)}const Qn=Cp!==null?e=>{if(typeof e=="string"){const n=Cp.from(e,"utf8");return new Uint8Array(n.buffer,n.byteOffset,n.length)}if(Cp.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if(typeof e=="string")return XI.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},Za="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ll=new Uint8Array(256);for(let e=0;e<Za.length;e++)ll[Za.charCodeAt(e)]=e;function ab(e,n=!0){const r=e.length,i=r%3,o=[],d=r-i;for(let u=0;u<d;u+=3){const v=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(e[u+2]&255),h=Za.charAt(v>>18&63)+Za.charAt(v>>12&63)+Za.charAt(v>>6&63)+Za.charAt(v&63);o.push(h)}if(i===1){const u=e[r-1],v=Za.charAt(u>>2),h=Za.charAt(u<<4&63);o.push(`${v}${h}`),n&&o.push("==")}else if(i===2){const u=(e[r-2]<<8)+e[r-1],v=Za.charAt(u>>10),h=Za.charAt(u>>4&63),m=Za.charAt(u<<2&63);o.push(`${v}${h}${m}`),n&&o.push("=")}return o.join("")}function ZI(e){let n=Math.floor(e.length*.75);const r=e.length;return e[r-1]==="="&&(n-=1,e[r-2]==="="&&(n-=1)),n}function e1(e){const n=ZI(e),r=e.length,i=new Uint8Array(n);let o=0;for(let d=0;d<r;d+=4){const u=ll[e.charCodeAt(d)],v=ll[e.charCodeAt(d+1)],h=ll[e.charCodeAt(d+2)],m=ll[e.charCodeAt(d+3)];i[o]=u<<2|v>>4,o+=1,i[o]=(v&15)<<4|h>>2,o+=1,i[o]=(h&3)<<6|m&63,o+=1}return i}const nc=16*1024,tl=4,t1=new Dt,kp=new Map;function pA(e,n){return Js(this,void 0,void 0,function*(){let r=null,i=null,o=!1;if(typeof WebAssembly>"u")throw new Error("WebAssembly is not supported in this environment!");const d=(N,R=0)=>{i.set(N,R)},u=()=>i,v=()=>r.exports,h=N=>{r.exports.Hash_SetMemorySize(N);const R=r.exports.Hash_GetBuffer(),z=r.exports.memory.buffer;i=new Uint8Array(z,R,N)},m=()=>new DataView(r.exports.memory.buffer).getUint32(r.exports.STATE_SIZE,!0),g=t1.dispatch(()=>Js(this,void 0,void 0,function*(){if(!kp.has(e.name)){const R=e1(e.data),z=WebAssembly.compile(R);kp.set(e.name,z)}const N=yield kp.get(e.name);r=yield WebAssembly.instantiate(N,{})})),b=()=>Js(this,void 0,void 0,function*(){r||(yield g);const N=r.exports.Hash_GetBuffer(),R=r.exports.memory.buffer;i=new Uint8Array(R,N,nc)}),j=(N=null)=>{o=!0,r.exports.Hash_Init(N)},C=N=>{let R=0;for(;R<N.length;){const z=N.subarray(R,R+nc);R+=z.length,i.set(z),r.exports.Hash_Update(z.length)}},k=N=>{if(!o)throw new Error("update() called before init()");const R=Qn(N);C(R)},x=new Uint8Array(n*2),S=(N,R=null)=>{if(!o)throw new Error("digest() called before init()");return o=!1,r.exports.Hash_Final(R),N==="binary"?i.slice(0,n):sh(x,i,n)},T=()=>{if(!o)throw new Error("save() can only be called after init() and before digest()");const N=r.exports.Hash_GetState(),R=m(),z=r.exports.memory.buffer,ne=new Uint8Array(z,N,R),ye=new Uint8Array(tl+R);return uA(ye,e.hash),ye.set(ne,tl),ye},I=N=>{if(!(N instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const R=r.exports.Hash_GetState(),z=m(),ne=tl+z,ye=r.exports.memory.buffer;if(N.length!==ne)throw new Error(`Bad state length (expected ${ne} bytes, got ${N.length})`);if(!WI(e.hash,N.subarray(0,tl)))throw new Error("This state was written by an incompatible hash implementation");const J=N.subarray(tl);new Uint8Array(ye,R,z).set(J),o=!0},E=N=>typeof N=="string"?N.length<nc/4:N.byteLength<nc;let L=E;switch(e.name){case"argon2":case"scrypt":L=()=>!0;break;case"blake2b":case"blake2s":L=(N,R)=>R<=512&&E(N);break;case"blake3":L=(N,R)=>R===0&&E(N);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":L=()=>!1;break}const P=(N,R=null,z=null)=>{if(!L(N,R))return j(R),k(N),S("hex",z);const ne=Qn(N);return i.set(ne),r.exports.Hash_Calculate(ne.length,R,z),sh(x,i,n)};return yield b(),{getMemory:u,writeMemory:d,getExports:v,setMemorySize:h,init:j,update:k,digest:S,save:T,load:I,calculate:P,hashLength:n}})}new Dt;var a1="argon2",n1="AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQFBgEBAoCAAgYIAX8BQZCoBAsHQQQGbWVtb3J5AgASSGFzaF9TZXRNZW1vcnlTaXplAAAOSGFzaF9HZXRCdWZmZXIAAQ5IYXNoX0NhbGN1bGF0ZQAECvEyBVgBAn9BACEBAkAgAEEAKAKICCICRg0AAkAgACACayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBB/wHADwtBACEBQQBBACkDiAggAEEQdK18NwOICAsgAcALcAECfwJAQQAoAoAIIgANAEEAPwBBEHQiADYCgAhBACgCiAgiAUGAgCBGDQACQEGAgCAgAWsiAEEQdiAAQYCAfHEgAElqIgBAAEF/Rw0AQQAPC0EAQQApA4gIIABBEHStfDcDiAhBACgCgAghAAsgAAvcDgECfiAAIAQpAwAiECAAKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAMIBAgDCkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgBCAQIAQpAwCFQiiJIhA3AwAgACAQIAApAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAwgECAMKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwAgASAFKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAEgECABKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAIgBikDACIQIAIpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIA4gECAOKQMAhUIgiSIQNwMAIAogECAKKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACACIBAgAikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDiAQIA4pAwCFQjCJIhA3AwAgCiAQIAopAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACADIAcpAwAiECADKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAPIBAgDykDAIVCIIkiEDcDACALIBAgCykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAyAQIAMpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA8gECAPKQMAhUIwiSIQNwMAIAsgECALKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFQiCJIhA3AwAgCiAQIAopAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAAgECAAKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIVCMIkiEDcDACAKIBAgCikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAEgBikDACIQIAEpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAwgECAMKQMAhUIgiSIQNwMAIAsgECALKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACABIBAgASkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDCAQIAwpAwCFQjCJIhA3AwAgCyAQIAspAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACACIAcpAwAiECACKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACANIBAgDSkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAiAQIAIpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA0gECANKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAQgECAEKQMAhUIoiSIQNwMAIAMgECADKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBCAQIAQpAwCFQgGJNwMAC98aAQN/QQAhBEEAIAIpAwAgASkDAIU3A5AIQQAgAikDCCABKQMIhTcDmAhBACACKQMQIAEpAxCFNwOgCEEAIAIpAxggASkDGIU3A6gIQQAgAikDICABKQMghTcDsAhBACACKQMoIAEpAyiFNwO4CEEAIAIpAzAgASkDMIU3A8AIQQAgAikDOCABKQM4hTcDyAhBACACKQNAIAEpA0CFNwPQCEEAIAIpA0ggASkDSIU3A9gIQQAgAikDUCABKQNQhTcD4AhBACACKQNYIAEpA1iFNwPoCEEAIAIpA2AgASkDYIU3A/AIQQAgAikDaCABKQNohTcD+AhBACACKQNwIAEpA3CFNwOACUEAIAIpA3ggASkDeIU3A4gJQQAgAikDgAEgASkDgAGFNwOQCUEAIAIpA4gBIAEpA4gBhTcDmAlBACACKQOQASABKQOQAYU3A6AJQQAgAikDmAEgASkDmAGFNwOoCUEAIAIpA6ABIAEpA6ABhTcDsAlBACACKQOoASABKQOoAYU3A7gJQQAgAikDsAEgASkDsAGFNwPACUEAIAIpA7gBIAEpA7gBhTcDyAlBACACKQPAASABKQPAAYU3A9AJQQAgAikDyAEgASkDyAGFNwPYCUEAIAIpA9ABIAEpA9ABhTcD4AlBACACKQPYASABKQPYAYU3A+gJQQAgAikD4AEgASkD4AGFNwPwCUEAIAIpA+gBIAEpA+gBhTcD+AlBACACKQPwASABKQPwAYU3A4AKQQAgAikD+AEgASkD+AGFNwOICkEAIAIpA4ACIAEpA4AChTcDkApBACACKQOIAiABKQOIAoU3A5gKQQAgAikDkAIgASkDkAKFNwOgCkEAIAIpA5gCIAEpA5gChTcDqApBACACKQOgAiABKQOgAoU3A7AKQQAgAikDqAIgASkDqAKFNwO4CkEAIAIpA7ACIAEpA7AChTcDwApBACACKQO4AiABKQO4AoU3A8gKQQAgAikDwAIgASkDwAKFNwPQCkEAIAIpA8gCIAEpA8gChTcD2ApBACACKQPQAiABKQPQAoU3A+AKQQAgAikD2AIgASkD2AKFNwPoCkEAIAIpA+ACIAEpA+AChTcD8ApBACACKQPoAiABKQPoAoU3A/gKQQAgAikD8AIgASkD8AKFNwOAC0EAIAIpA/gCIAEpA/gChTcDiAtBACACKQOAAyABKQOAA4U3A5ALQQAgAikDiAMgASkDiAOFNwOYC0EAIAIpA5ADIAEpA5ADhTcDoAtBACACKQOYAyABKQOYA4U3A6gLQQAgAikDoAMgASkDoAOFNwOwC0EAIAIpA6gDIAEpA6gDhTcDuAtBACACKQOwAyABKQOwA4U3A8ALQQAgAikDuAMgASkDuAOFNwPIC0EAIAIpA8ADIAEpA8ADhTcD0AtBACACKQPIAyABKQPIA4U3A9gLQQAgAikD0AMgASkD0AOFNwPgC0EAIAIpA9gDIAEpA9gDhTcD6AtBACACKQPgAyABKQPgA4U3A/ALQQAgAikD6AMgASkD6AOFNwP4C0EAIAIpA/ADIAEpA/ADhTcDgAxBACACKQP4AyABKQP4A4U3A4gMQQAgAikDgAQgASkDgASFNwOQDEEAIAIpA4gEIAEpA4gEhTcDmAxBACACKQOQBCABKQOQBIU3A6AMQQAgAikDmAQgASkDmASFNwOoDEEAIAIpA6AEIAEpA6AEhTcDsAxBACACKQOoBCABKQOoBIU3A7gMQQAgAikDsAQgASkDsASFNwPADEEAIAIpA7gEIAEpA7gEhTcDyAxBACACKQPABCABKQPABIU3A9AMQQAgAikDyAQgASkDyASFNwPYDEEAIAIpA9AEIAEpA9AEhTcD4AxBACACKQPYBCABKQPYBIU3A+gMQQAgAikD4AQgASkD4ASFNwPwDEEAIAIpA+gEIAEpA+gEhTcD+AxBACACKQPwBCABKQPwBIU3A4ANQQAgAikD+AQgASkD+ASFNwOIDUEAIAIpA4AFIAEpA4AFhTcDkA1BACACKQOIBSABKQOIBYU3A5gNQQAgAikDkAUgASkDkAWFNwOgDUEAIAIpA5gFIAEpA5gFhTcDqA1BACACKQOgBSABKQOgBYU3A7ANQQAgAikDqAUgASkDqAWFNwO4DUEAIAIpA7AFIAEpA7AFhTcDwA1BACACKQO4BSABKQO4BYU3A8gNQQAgAikDwAUgASkDwAWFNwPQDUEAIAIpA8gFIAEpA8gFhTcD2A1BACACKQPQBSABKQPQBYU3A+ANQQAgAikD2AUgASkD2AWFNwPoDUEAIAIpA+AFIAEpA+AFhTcD8A1BACACKQPoBSABKQPoBYU3A/gNQQAgAikD8AUgASkD8AWFNwOADkEAIAIpA/gFIAEpA/gFhTcDiA5BACACKQOABiABKQOABoU3A5AOQQAgAikDiAYgASkDiAaFNwOYDkEAIAIpA5AGIAEpA5AGhTcDoA5BACACKQOYBiABKQOYBoU3A6gOQQAgAikDoAYgASkDoAaFNwOwDkEAIAIpA6gGIAEpA6gGhTcDuA5BACACKQOwBiABKQOwBoU3A8AOQQAgAikDuAYgASkDuAaFNwPIDkEAIAIpA8AGIAEpA8AGhTcD0A5BACACKQPIBiABKQPIBoU3A9gOQQAgAikD0AYgASkD0AaFNwPgDkEAIAIpA9gGIAEpA9gGhTcD6A5BACACKQPgBiABKQPgBoU3A/AOQQAgAikD6AYgASkD6AaFNwP4DkEAIAIpA/AGIAEpA/AGhTcDgA9BACACKQP4BiABKQP4BoU3A4gPQQAgAikDgAcgASkDgAeFNwOQD0EAIAIpA4gHIAEpA4gHhTcDmA9BACACKQOQByABKQOQB4U3A6APQQAgAikDmAcgASkDmAeFNwOoD0EAIAIpA6AHIAEpA6AHhTcDsA9BACACKQOoByABKQOoB4U3A7gPQQAgAikDsAcgASkDsAeFNwPAD0EAIAIpA7gHIAEpA7gHhTcDyA9BACACKQPAByABKQPAB4U3A9APQQAgAikDyAcgASkDyAeFNwPYD0EAIAIpA9AHIAEpA9AHhTcD4A9BACACKQPYByABKQPYB4U3A+gPQQAgAikD4AcgASkD4AeFNwPwD0EAIAIpA+gHIAEpA+gHhTcD+A9BACACKQPwByABKQPwB4U3A4AQQQAgAikD+AcgASkD+AeFNwOIEEGQCEGYCEGgCEGoCEGwCEG4CEHACEHICEHQCEHYCEHgCEHoCEHwCEH4CEGACUGICRACQZAJQZgJQaAJQagJQbAJQbgJQcAJQcgJQdAJQdgJQeAJQegJQfAJQfgJQYAKQYgKEAJBkApBmApBoApBqApBsApBuApBwApByApB0ApB2ApB4ApB6ApB8ApB+ApBgAtBiAsQAkGQC0GYC0GgC0GoC0GwC0G4C0HAC0HIC0HQC0HYC0HgC0HoC0HwC0H4C0GADEGIDBACQZAMQZgMQaAMQagMQbAMQbgMQcAMQcgMQdAMQdgMQeAMQegMQfAMQfgMQYANQYgNEAJBkA1BmA1BoA1BqA1BsA1BuA1BwA1ByA1B0A1B2A1B4A1B6A1B8A1B+A1BgA5BiA4QAkGQDkGYDkGgDkGoDkGwDkG4DkHADkHIDkHQDkHYDkHgDkHoDkHwDkH4DkGAD0GIDxACQZAPQZgPQaAPQagPQbAPQbgPQcAPQcgPQdAPQdgPQeAPQegPQfAPQfgPQYAQQYgQEAJBkAhBmAhBkAlBmAlBkApBmApBkAtBmAtBkAxBmAxBkA1BmA1BkA5BmA5BkA9BmA8QAkGgCEGoCEGgCUGoCUGgCkGoCkGgC0GoC0GgDEGoDEGgDUGoDUGgDkGoDkGgD0GoDxACQbAIQbgIQbAJQbgJQbAKQbgKQbALQbgLQbAMQbgMQbANQbgNQbAOQbgOQbAPQbgPEAJBwAhByAhBwAlByAlBwApByApBwAtByAtBwAxByAxBwA1ByA1BwA5ByA5BwA9ByA8QAkHQCEHYCEHQCUHYCUHQCkHYCkHQC0HYC0HQDEHYDEHQDUHYDUHQDkHYDkHQD0HYDxACQeAIQegIQeAJQegJQeAKQegKQeALQegLQeAMQegMQeANQegNQeAOQegOQeAPQegPEAJB8AhB+AhB8AlB+AlB8ApB+ApB8AtB+AtB8AxB+AxB8A1B+A1B8A5B+A5B8A9B+A8QAkGACUGICUGACkGICkGAC0GIC0GADEGIDEGADUGIDUGADkGIDkGAD0GID0GAEEGIEBACAkACQCADRQ0AA0AgACAEaiIDIAIgBGoiBSkDACABIARqIgYpAwCFIARBkAhqKQMAhSADKQMAhTcDACADQQhqIgMgBUEIaikDACAGQQhqKQMAhSAEQZgIaikDAIUgAykDAIU3AwAgBEEQaiIEQYAIRw0ADAILC0EAIQQDQCAAIARqIgMgAiAEaiIFKQMAIAEgBGoiBikDAIUgBEGQCGopAwCFNwMAIANBCGogBUEIaikDACAGQQhqKQMAhSAEQZgIaikDAIU3AwAgBEEQaiIEQYAIRw0ACwsL5QcMBX8BfgR/An4BfwF+AX8Bfgd/AX4DfwF+AkBBACgCgAgiAiABQQp0aiIDKAIIIAFHDQAgAygCDCEEIAMoAgAhBUEAIAMoAhQiBq03A7gQQQAgBK0iBzcDsBBBACAFIAEgBUECdG4iCGwiCUECdK03A6gQAkACQAJAAkAgBEUNAEF/IQogBUUNASAIQQNsIQsgCEECdCIErSEMIAWtIQ0gBkF/akECSSEOQgAhDwNAQQAgDzcDkBAgD6chEEIAIRFBACEBA0BBACARNwOgECAPIBGEUCIDIA5xIRIgBkEBRiAPUCITIAZBAkYgEUICVHFxciEUQX8gAUEBakEDcSAIbEF/aiATGyEVIAEgEHIhFiABIAhsIRcgA0EBdCEYQgAhGQNAQQBCADcDwBBBACAZNwOYECAYIQECQCASRQ0AQQBCATcDwBBBkBhBkBBBkCBBABADQZAYQZAYQZAgQQAQA0ECIQELAkAgASAITw0AIAQgGaciGmwgF2ogAWohAwNAIANBACAEIAEbQQAgEVAiGxtqQX9qIRwCQAJAIBQNAEEAKAKACCICIBxBCnQiHGohCgwBCwJAIAFB/wBxIgINAEEAQQApA8AQQgF8NwPAEEGQGEGQEEGQIEEAEANBkBhBkBhBkCBBABADCyAcQQp0IRwgAkEDdEGQGGohCkEAKAKACCECCyACIANBCnRqIAIgHGogAiAKKQMAIh1CIIinIAVwIBogFhsiHCAEbCABIAFBACAZIBytUSIcGyIKIBsbIBdqIAogC2ogExsgAUUgHHJrIhsgFWqtIB1C/////w+DIh0gHX5CIIggG61+QiCIfSAMgqdqQQp0akEBEAMgA0EBaiEDIAggAUEBaiIBRw0ACwsgGUIBfCIZIA1SDQALIBFCAXwiEachASARQgRSDQALIA9CAXwiDyAHUg0AC0EAKAKACCECCyAJQQx0QYB4aiEXIAVBf2oiCkUNAgwBC0EAQgM3A6AQQQAgBEF/aq03A5AQQYB4IRcLIAIgF2ohGyAIQQx0IQhBACEcA0AgCCAcQQFqIhxsQYB4aiEEQQAhAQNAIBsgAWoiAyADKQMAIAIgBCABamopAwCFNwMAIANBCGoiAyADKQMAIAIgBCABQQhyamopAwCFNwMAIAFBCGohAyABQRBqIQEgA0H4B0kNAAsgHCAKRw0ACwsgAiAXaiEbQXghAQNAIAIgAWoiA0EIaiAbIAFqIgRBCGopAwA3AwAgA0EQaiAEQRBqKQMANwMAIANBGGogBEEYaikDADcDACADQSBqIARBIGopAwA3AwAgAUEgaiIBQfgHSQ0ACwsL",s1="e4cdc523",r1={name:a1,data:n1,hash:s1},i1="blake2b",l1="AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwoJAAECAwECAgABBQQBAQICBg4CfwFBsIsFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACkhhc2hfRmluYWwAAwlIYXNoX0luaXQABQtIYXNoX1VwZGF0ZQAGDUhhc2hfR2V0U3RhdGUABw5IYXNoX0NhbGN1bGF0ZQAIClNUQVRFX1NJWkUDAQrTOAkFAEGACQvrAgIFfwF+AkAgAUEBSA0AAkACQAJAIAFBgAFBACgC4IoBIgJrIgNKDQAgASEEDAELQQBBADYC4IoBAkAgAkH/AEoNACACQeCJAWohBSAAIQRBACEGA0AgBSAELQAAOgAAIARBAWohBCAFQQFqIQUgAyAGQQFqIgZB/wFxSg0ACwtBAEEAKQPAiQEiB0KAAXw3A8CJAUEAQQApA8iJASAHQv9+Vq18NwPIiQFB4IkBEAIgACADaiEAAkAgASADayIEQYEBSA0AIAIgAWohBQNAQQBBACkDwIkBIgdCgAF8NwPAiQFBAEEAKQPIiQEgB0L/flatfDcDyIkBIAAQAiAAQYABaiEAIAVBgH9qIgVBgAJLDQALIAVBgH9qIQQMAQsgBEEATA0BC0EAIQUDQCAFQQAoAuCKAWpB4IkBaiAAIAVqLQAAOgAAIAQgBUEBaiIFQf8BcUoNAAsLQQBBACgC4IoBIARqNgLgigELC78uASR+QQBBACkD0IkBQQApA7CJASIBQQApA5CJAXwgACkDICICfCIDhULr+obav7X2wR+FQiCJIgRCq/DT9K/uvLc8fCIFIAGFQiiJIgYgA3wgACkDKCIBfCIHIASFQjCJIgggBXwiCSAGhUIBiSIKQQApA8iJAUEAKQOoiQEiBEEAKQOIiQF8IAApAxAiA3wiBYVCn9j52cKR2oKbf4VCIIkiC0K7zqqm2NDrs7t/fCIMIASFQiiJIg0gBXwgACkDGCIEfCIOfCAAKQNQIgV8Ig9BACkDwIkBQQApA6CJASIQQQApA4CJASIRfCAAKQMAIgZ8IhKFQtGFmu/6z5SH0QCFQiCJIhNCiJLznf/M+YTqAHwiFCAQhUIoiSIVIBJ8IAApAwgiEHwiFiAThUIwiSIXhUIgiSIYQQApA9iJAUEAKQO4iQEiE0EAKQOYiQF8IAApAzAiEnwiGYVC+cL4m5Gjs/DbAIVCIIkiGkLx7fT4paf9p6V/fCIbIBOFQiiJIhwgGXwgACkDOCITfCIZIBqFQjCJIhogG3wiG3wiHSAKhUIoiSIeIA98IAApA1giCnwiDyAYhUIwiSIYIB18Ih0gDiALhUIwiSIOIAx8Ih8gDYVCAYkiDCAWfCAAKQNAIgt8Ig0gGoVCIIkiFiAJfCIaIAyFQiiJIiAgDXwgACkDSCIJfCIhIBaFQjCJIhYgGyAchUIBiSIMIAd8IAApA2AiB3wiDSAOhUIgiSIOIBcgFHwiFHwiFyAMhUIoiSIbIA18IAApA2giDHwiHCAOhUIwiSIOIBd8IhcgG4VCAYkiGyAZIBQgFYVCAYkiFHwgACkDcCINfCIVIAiFQiCJIhkgH3wiHyAUhUIoiSIUIBV8IAApA3giCHwiFXwgDHwiIoVCIIkiI3wiJCAbhUIoiSIbICJ8IBJ8IiIgFyAYIBUgGYVCMIkiFSAffCIZIBSFQgGJIhQgIXwgDXwiH4VCIIkiGHwiFyAUhUIoiSIUIB98IAV8Ih8gGIVCMIkiGCAXfCIXIBSFQgGJIhR8IAF8IiEgFiAafCIWIBUgHSAehUIBiSIaIBx8IAl8IhyFQiCJIhV8Ih0gGoVCKIkiGiAcfCAIfCIcIBWFQjCJIhWFQiCJIh4gGSAOIBYgIIVCAYkiFiAPfCACfCIPhUIgiSIOfCIZIBaFQiiJIhYgD3wgC3wiDyAOhUIwiSIOIBl8Ihl8IiAgFIVCKIkiFCAhfCAEfCIhIB6FQjCJIh4gIHwiICAiICOFQjCJIiIgJHwiIyAbhUIBiSIbIBx8IAp8IhwgDoVCIIkiDiAXfCIXIBuFQiiJIhsgHHwgE3wiHCAOhUIwiSIOIBkgFoVCAYkiFiAffCAQfCIZICKFQiCJIh8gFSAdfCIVfCIdIBaFQiiJIhYgGXwgB3wiGSAfhUIwiSIfIB18Ih0gFoVCAYkiFiAVIBqFQgGJIhUgD3wgBnwiDyAYhUIgiSIYICN8IhogFYVCKIkiFSAPfCADfCIPfCAHfCIihUIgiSIjfCIkIBaFQiiJIhYgInwgBnwiIiAjhUIwiSIjICR8IiQgFoVCAYkiFiAOIBd8Ig4gDyAYhUIwiSIPICAgFIVCAYkiFCAZfCAKfCIXhUIgiSIYfCIZIBSFQiiJIhQgF3wgC3wiF3wgBXwiICAPIBp8Ig8gHyAOIBuFQgGJIg4gIXwgCHwiGoVCIIkiG3wiHyAOhUIoiSIOIBp8IAx8IhogG4VCMIkiG4VCIIkiISAdIB4gDyAVhUIBiSIPIBx8IAF8IhWFQiCJIhx8Ih0gD4VCKIkiDyAVfCADfCIVIByFQjCJIhwgHXwiHXwiHiAWhUIoiSIWICB8IA18IiAgIYVCMIkiISAefCIeIBogFyAYhUIwiSIXIBl8IhggFIVCAYkiFHwgCXwiGSAchUIgiSIaICR8IhwgFIVCKIkiFCAZfCACfCIZIBqFQjCJIhogHSAPhUIBiSIPICJ8IAR8Ih0gF4VCIIkiFyAbIB98Iht8Ih8gD4VCKIkiDyAdfCASfCIdIBeFQjCJIhcgH3wiHyAPhUIBiSIPIBsgDoVCAYkiDiAVfCATfCIVICOFQiCJIhsgGHwiGCAOhUIoiSIOIBV8IBB8IhV8IAx8IiKFQiCJIiN8IiQgD4VCKIkiDyAifCAHfCIiICOFQjCJIiMgJHwiJCAPhUIBiSIPIBogHHwiGiAVIBuFQjCJIhUgHiAWhUIBiSIWIB18IAR8IhuFQiCJIhx8Ih0gFoVCKIkiFiAbfCAQfCIbfCABfCIeIBUgGHwiFSAXIBogFIVCAYkiFCAgfCATfCIYhUIgiSIXfCIaIBSFQiiJIhQgGHwgCXwiGCAXhUIwiSIXhUIgiSIgIB8gISAVIA6FQgGJIg4gGXwgCnwiFYVCIIkiGXwiHyAOhUIoiSIOIBV8IA18IhUgGYVCMIkiGSAffCIffCIhIA+FQiiJIg8gHnwgBXwiHiAghUIwiSIgICF8IiEgGyAchUIwiSIbIB18IhwgFoVCAYkiFiAYfCADfCIYIBmFQiCJIhkgJHwiHSAWhUIoiSIWIBh8IBJ8IhggGYVCMIkiGSAfIA6FQgGJIg4gInwgAnwiHyAbhUIgiSIbIBcgGnwiF3wiGiAOhUIoiSIOIB98IAZ8Ih8gG4VCMIkiGyAafCIaIA6FQgGJIg4gFSAXIBSFQgGJIhR8IAh8IhUgI4VCIIkiFyAcfCIcIBSFQiiJIhQgFXwgC3wiFXwgBXwiIoVCIIkiI3wiJCAOhUIoiSIOICJ8IAh8IiIgGiAgIBUgF4VCMIkiFSAcfCIXIBSFQgGJIhQgGHwgCXwiGIVCIIkiHHwiGiAUhUIoiSIUIBh8IAZ8IhggHIVCMIkiHCAafCIaIBSFQgGJIhR8IAR8IiAgGSAdfCIZIBUgISAPhUIBiSIPIB98IAN8Ih2FQiCJIhV8Ih8gD4VCKIkiDyAdfCACfCIdIBWFQjCJIhWFQiCJIiEgFyAbIBkgFoVCAYkiFiAefCABfCIZhUIgiSIbfCIXIBaFQiiJIhYgGXwgE3wiGSAbhUIwiSIbIBd8Ihd8Ih4gFIVCKIkiFCAgfCAMfCIgICGFQjCJIiEgHnwiHiAiICOFQjCJIiIgJHwiIyAOhUIBiSIOIB18IBJ8Ih0gG4VCIIkiGyAafCIaIA6FQiiJIg4gHXwgC3wiHSAbhUIwiSIbIBcgFoVCAYkiFiAYfCANfCIXICKFQiCJIhggFSAffCIVfCIfIBaFQiiJIhYgF3wgEHwiFyAYhUIwiSIYIB98Ih8gFoVCAYkiFiAVIA+FQgGJIg8gGXwgCnwiFSAchUIgiSIZICN8IhwgD4VCKIkiDyAVfCAHfCIVfCASfCIihUIgiSIjfCIkIBaFQiiJIhYgInwgBXwiIiAjhUIwiSIjICR8IiQgFoVCAYkiFiAbIBp8IhogFSAZhUIwiSIVIB4gFIVCAYkiFCAXfCADfCIXhUIgiSIZfCIbIBSFQiiJIhQgF3wgB3wiF3wgAnwiHiAVIBx8IhUgGCAaIA6FQgGJIg4gIHwgC3wiGoVCIIkiGHwiHCAOhUIoiSIOIBp8IAR8IhogGIVCMIkiGIVCIIkiICAfICEgFSAPhUIBiSIPIB18IAZ8IhWFQiCJIh18Ih8gD4VCKIkiDyAVfCAKfCIVIB2FQjCJIh0gH3wiH3wiISAWhUIoiSIWIB58IAx8Ih4gIIVCMIkiICAhfCIhIBogFyAZhUIwiSIXIBt8IhkgFIVCAYkiFHwgEHwiGiAdhUIgiSIbICR8Ih0gFIVCKIkiFCAafCAJfCIaIBuFQjCJIhsgHyAPhUIBiSIPICJ8IBN8Ih8gF4VCIIkiFyAYIBx8Ihh8IhwgD4VCKIkiDyAffCABfCIfIBeFQjCJIhcgHHwiHCAPhUIBiSIPIBggDoVCAYkiDiAVfCAIfCIVICOFQiCJIhggGXwiGSAOhUIoiSIOIBV8IA18IhV8IA18IiKFQiCJIiN8IiQgD4VCKIkiDyAifCAMfCIiICOFQjCJIiMgJHwiJCAPhUIBiSIPIBsgHXwiGyAVIBiFQjCJIhUgISAWhUIBiSIWIB98IBB8IhiFQiCJIh18Ih8gFoVCKIkiFiAYfCAIfCIYfCASfCIhIBUgGXwiFSAXIBsgFIVCAYkiFCAefCAHfCIZhUIgiSIXfCIbIBSFQiiJIhQgGXwgAXwiGSAXhUIwiSIXhUIgiSIeIBwgICAVIA6FQgGJIg4gGnwgAnwiFYVCIIkiGnwiHCAOhUIoiSIOIBV8IAV8IhUgGoVCMIkiGiAcfCIcfCIgIA+FQiiJIg8gIXwgBHwiISAehUIwiSIeICB8IiAgGCAdhUIwiSIYIB98Ih0gFoVCAYkiFiAZfCAGfCIZIBqFQiCJIhogJHwiHyAWhUIoiSIWIBl8IBN8IhkgGoVCMIkiGiAcIA6FQgGJIg4gInwgCXwiHCAYhUIgiSIYIBcgG3wiF3wiGyAOhUIoiSIOIBx8IAN8IhwgGIVCMIkiGCAbfCIbIA6FQgGJIg4gFSAXIBSFQgGJIhR8IAt8IhUgI4VCIIkiFyAdfCIdIBSFQiiJIhQgFXwgCnwiFXwgBHwiIoVCIIkiI3wiJCAOhUIoiSIOICJ8IAl8IiIgGyAeIBUgF4VCMIkiFSAdfCIXIBSFQgGJIhQgGXwgDHwiGYVCIIkiHXwiGyAUhUIoiSIUIBl8IAp8IhkgHYVCMIkiHSAbfCIbIBSFQgGJIhR8IAN8Ih4gGiAffCIaIBUgICAPhUIBiSIPIBx8IAd8IhyFQiCJIhV8Ih8gD4VCKIkiDyAcfCAQfCIcIBWFQjCJIhWFQiCJIiAgFyAYIBogFoVCAYkiFiAhfCATfCIahUIgiSIYfCIXIBaFQiiJIhYgGnwgDXwiGiAYhUIwiSIYIBd8Ihd8IiEgFIVCKIkiFCAefCAFfCIeICCFQjCJIiAgIXwiISAiICOFQjCJIiIgJHwiIyAOhUIBiSIOIBx8IAt8IhwgGIVCIIkiGCAbfCIbIA6FQiiJIg4gHHwgEnwiHCAYhUIwiSIYIBcgFoVCAYkiFiAZfCABfCIXICKFQiCJIhkgFSAffCIVfCIfIBaFQiiJIhYgF3wgBnwiFyAZhUIwiSIZIB98Ih8gFoVCAYkiFiAVIA+FQgGJIg8gGnwgCHwiFSAdhUIgiSIaICN8Ih0gD4VCKIkiDyAVfCACfCIVfCANfCIihUIgiSIjfCIkIBaFQiiJIhYgInwgCXwiIiAjhUIwiSIjICR8IiQgFoVCAYkiFiAYIBt8IhggFSAahUIwiSIVICEgFIVCAYkiFCAXfCASfCIXhUIgiSIafCIbIBSFQiiJIhQgF3wgCHwiF3wgB3wiISAVIB18IhUgGSAYIA6FQgGJIg4gHnwgBnwiGIVCIIkiGXwiHSAOhUIoiSIOIBh8IAt8IhggGYVCMIkiGYVCIIkiHiAfICAgFSAPhUIBiSIPIBx8IAp8IhWFQiCJIhx8Ih8gD4VCKIkiDyAVfCAEfCIVIByFQjCJIhwgH3wiH3wiICAWhUIoiSIWICF8IAN8IiEgHoVCMIkiHiAgfCIgIBggFyAahUIwiSIXIBt8IhogFIVCAYkiFHwgBXwiGCAchUIgiSIbICR8IhwgFIVCKIkiFCAYfCABfCIYIBuFQjCJIhsgHyAPhUIBiSIPICJ8IAx8Ih8gF4VCIIkiFyAZIB18Ihl8Ih0gD4VCKIkiDyAffCATfCIfIBeFQjCJIhcgHXwiHSAPhUIBiSIPIBkgDoVCAYkiDiAVfCAQfCIVICOFQiCJIhkgGnwiGiAOhUIoiSIOIBV8IAJ8IhV8IBN8IiKFQiCJIiN8IiQgD4VCKIkiDyAifCASfCIiICOFQjCJIiMgJHwiJCAPhUIBiSIPIBsgHHwiGyAVIBmFQjCJIhUgICAWhUIBiSIWIB98IAt8IhmFQiCJIhx8Ih8gFoVCKIkiFiAZfCACfCIZfCAJfCIgIBUgGnwiFSAXIBsgFIVCAYkiFCAhfCAFfCIahUIgiSIXfCIbIBSFQiiJIhQgGnwgA3wiGiAXhUIwiSIXhUIgiSIhIB0gHiAVIA6FQgGJIg4gGHwgEHwiFYVCIIkiGHwiHSAOhUIoiSIOIBV8IAF8IhUgGIVCMIkiGCAdfCIdfCIeIA+FQiiJIg8gIHwgDXwiICAhhUIwiSIhIB58Ih4gGSAchUIwiSIZIB98IhwgFoVCAYkiFiAafCAIfCIaIBiFQiCJIhggJHwiHyAWhUIoiSIWIBp8IAp8IhogGIVCMIkiGCAdIA6FQgGJIg4gInwgBHwiHSAZhUIgiSIZIBcgG3wiF3wiGyAOhUIoiSIOIB18IAd8Ih0gGYVCMIkiGSAbfCIbIA6FQgGJIg4gFSAXIBSFQgGJIhR8IAx8IhUgI4VCIIkiFyAcfCIcIBSFQiiJIhQgFXwgBnwiFXwgEnwiIoVCIIkiI3wiJCAOhUIoiSIOICJ8IBN8IiIgGyAhIBUgF4VCMIkiFSAcfCIXIBSFQgGJIhQgGnwgBnwiGoVCIIkiHHwiGyAUhUIoiSIUIBp8IBB8IhogHIVCMIkiHCAbfCIbIBSFQgGJIhR8IA18IiEgGCAffCIYIBUgHiAPhUIBiSIPIB18IAJ8Ih2FQiCJIhV8Ih4gD4VCKIkiDyAdfCABfCIdIBWFQjCJIhWFQiCJIh8gFyAZIBggFoVCAYkiFiAgfCADfCIYhUIgiSIZfCIXIBaFQiiJIhYgGHwgBHwiGCAZhUIwiSIZIBd8Ihd8IiAgFIVCKIkiFCAhfCAIfCIhIB+FQjCJIh8gIHwiICAiICOFQjCJIiIgJHwiIyAOhUIBiSIOIB18IAd8Ih0gGYVCIIkiGSAbfCIbIA6FQiiJIg4gHXwgDHwiHSAZhUIwiSIZIBcgFoVCAYkiFiAafCALfCIXICKFQiCJIhogFSAefCIVfCIeIBaFQiiJIhYgF3wgCXwiFyAahUIwiSIaIB58Ih4gFoVCAYkiFiAVIA+FQgGJIg8gGHwgBXwiFSAchUIgiSIYICN8IhwgD4VCKIkiDyAVfCAKfCIVfCACfCIChUIgiSIifCIjIBaFQiiJIhYgAnwgC3wiAiAihUIwiSILICN8IiIgFoVCAYkiFiAZIBt8IhkgFSAYhUIwiSIVICAgFIVCAYkiFCAXfCANfCINhUIgiSIXfCIYIBSFQiiJIhQgDXwgBXwiBXwgEHwiECAVIBx8Ig0gGiAZIA6FQgGJIg4gIXwgDHwiDIVCIIkiFXwiGSAOhUIoiSIOIAx8IBJ8IhIgFYVCMIkiDIVCIIkiFSAeIB8gDSAPhUIBiSINIB18IAl8IgmFQiCJIg98IhogDYVCKIkiDSAJfCAIfCIJIA+FQjCJIgggGnwiD3wiGiAWhUIoiSIWIBB8IAd8IhAgEYUgDCAZfCIHIA6FQgGJIgwgCXwgCnwiCiALhUIgiSILIAUgF4VCMIkiBSAYfCIJfCIOIAyFQiiJIgwgCnwgE3wiEyALhUIwiSIKIA58IguFNwOAiQFBACADIAYgDyANhUIBiSINIAJ8fCICIAWFQiCJIgUgB3wiBiANhUIoiSIHIAJ8fCICQQApA4iJAYUgBCABIBIgCSAUhUIBiSIDfHwiASAIhUIgiSISICJ8IgkgA4VCKIkiAyABfHwiASAShUIwiSIEIAl8IhKFNwOIiQFBACATQQApA5CJAYUgECAVhUIwiSIQIBp8IhOFNwOQiQFBACABQQApA5iJAYUgAiAFhUIwiSICIAZ8IgGFNwOYiQFBACASIAOFQgGJQQApA6CJAYUgAoU3A6CJAUEAIBMgFoVCAYlBACkDqIkBhSAKhTcDqIkBQQAgASAHhUIBiUEAKQOwiQGFIASFNwOwiQFBACALIAyFQgGJQQApA7iJAYUgEIU3A7iJAQvdAgUBfwF+AX8BfgJ/IwBBwABrIgAkAAJAQQApA9CJAUIAUg0AQQBBACkDwIkBIgFBACgC4IoBIgKsfCIDNwPAiQFBAEEAKQPIiQEgAyABVK18NwPIiQECQEEALQDoigFFDQBBAEJ/NwPYiQELQQBCfzcD0IkBAkAgAkH/AEoNAEEAIQQDQCACIARqQeCJAWpBADoAACAEQQFqIgRBgAFBACgC4IoBIgJrSA0ACwtB4IkBEAIgAEEAKQOAiQE3AwAgAEEAKQOIiQE3AwggAEEAKQOQiQE3AxAgAEEAKQOYiQE3AxggAEEAKQOgiQE3AyAgAEEAKQOoiQE3AyggAEEAKQOwiQE3AzAgAEEAKQO4iQE3AzhBACgC5IoBIgVBAUgNAEEAIQRBACECA0AgBEGACWogACAEai0AADoAACAEQQFqIQQgBSACQQFqIgJB/wFxSg0ACwsgAEHAAGokAAv9AwMBfwF+AX8jAEGAAWsiAiQAQQBBgQI7AfKKAUEAIAE6APGKAUEAIAA6APCKAUGQfiEAA0AgAEGAiwFqQgA3AAAgAEH4igFqQgA3AAAgAEHwigFqQgA3AAAgAEEYaiIADQALQQAhAEEAQQApA/CKASIDQoiS853/zPmE6gCFNwOAiQFBAEEAKQP4igFCu86qptjQ67O7f4U3A4iJAUEAQQApA4CLAUKr8NP0r+68tzyFNwOQiQFBAEEAKQOIiwFC8e30+KWn/aelf4U3A5iJAUEAQQApA5CLAULRhZrv+s+Uh9EAhTcDoIkBQQBBACkDmIsBQp/Y+dnCkdqCm3+FNwOoiQFBAEEAKQOgiwFC6/qG2r+19sEfhTcDsIkBQQBBACkDqIsBQvnC+JuRo7Pw2wCFNwO4iQFBACADp0H/AXE2AuSKAQJAIAFBAUgNACACQgA3A3ggAkIANwNwIAJCADcDaCACQgA3A2AgAkIANwNYIAJCADcDUCACQgA3A0ggAkIANwNAIAJCADcDOCACQgA3AzAgAkIANwMoIAJCADcDICACQgA3AxggAkIANwMQIAJCADcDCCACQgA3AwBBACEEA0AgAiAAaiAAQYAJai0AADoAACAAQQFqIQAgBEEBaiIEQf8BcSABSA0ACyACQYABEAELIAJBgAFqJAALEgAgAEEDdkH/P3EgAEEQdhAECwkAQYAJIAAQAQsGAEGAiQELGwAgAUEDdkH/P3EgAUEQdhAEQYAJIAAQARADCwsLAQBBgAgLBPAAAAA=",o1="c6f286e6",c1={name:i1,data:l1,hash:o1};new Dt;function nb(e){return!Number.isInteger(e)||e<8||e>512||e%8!==0?new Error("Invalid variant! Valid values: 8, 16, ..., 512"):null}function d1(e,n){return e|n<<16}function rh(e=512,n=null){if(nb(e))return Promise.reject(nb(e));let r=null,i=e;if(n!==null){if(r=Qn(n),r.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));i=d1(e,r.length)}const o=e/8;return pA(c1,o).then(d=>{i>512&&d.writeMemory(r),d.init(i);const u={init:i>512?()=>(d.writeMemory(r),d.init(i),u):()=>(d.init(i),u),update:v=>(d.update(v),u),digest:v=>d.digest(v),save:()=>d.save(),load:v=>(d.load(v),u),blockSize:128,digestSize:o};return u})}function u1(e,n,r){const i=[`m=${n.memorySize}`,`t=${n.iterations}`,`p=${n.parallelism}`].join(",");return`$argon2${n.hashType}$v=19$${i}$${ab(e,!1)}$${ab(r,!1)}`}const sb=new DataView(new ArrayBuffer(4));function Ln(e){return sb.setInt32(0,e,!0),new Uint8Array(sb.buffer)}function Sp(e,n,r){return Js(this,void 0,void 0,function*(){if(r<=64){const h=yield rh(r*8);return h.update(Ln(r)),h.update(n),h.digest("binary")}const i=Math.ceil(r/32)-2,o=new Uint8Array(r);e.init(),e.update(Ln(r)),e.update(n);let d=e.digest("binary");o.set(d.subarray(0,32),0);for(let h=1;h<i;h++)e.init(),e.update(d),d=e.digest("binary"),o.set(d.subarray(0,32),h*32);const u=r-32*i;let v;return u===64?(v=e,v.init()):v=yield rh(u*8),v.update(d),d=v.digest("binary"),o.set(d.subarray(0,u),i*32),o})}function p1(e){switch(e){case"d":return 0;case"i":return 1;default:return 2}}function h1(e){return Js(this,void 0,void 0,function*(){var n;const{parallelism:r,iterations:i,hashLength:o}=e,d=Qn(e.password),u=Qn(e.salt),v=19,h=p1(e.hashType),{memorySize:m}=e,g=Qn((n=e.secret)!==null&&n!==void 0?n:""),[b,j]=yield Promise.all([pA(r1,1024),rh(512)]);b.setMemorySize(m*1024+1024);const C=new Uint8Array(24),k=new DataView(C.buffer);k.setInt32(0,r,!0),k.setInt32(4,o,!0),k.setInt32(8,m,!0),k.setInt32(12,i,!0),k.setInt32(16,v,!0),k.setInt32(20,h,!0),b.writeMemory(C,m*1024),j.init(),j.update(C),j.update(Ln(d.length)),j.update(d),j.update(Ln(u.length)),j.update(u),j.update(Ln(g.length)),j.update(g),j.update(Ln(0));const S=Math.floor(m/(r*4))*4,T=new Uint8Array(72),I=j.digest("binary");T.set(I);for(let P=0;P<r;P++){T.set(Ln(0),64),T.set(Ln(P),68);let N=P*S,R=yield Sp(j,T,1024);b.writeMemory(R,N*1024),N+=1,T.set(Ln(1),64),R=yield Sp(j,T,1024),b.writeMemory(R,N*1024)}const E=new Uint8Array(1024);uA(E,b.calculate(new Uint8Array([]),m));const L=yield Sp(j,E,o);if(e.outputType==="hex"){const P=new Uint8Array(o*2);return sh(P,L,o)}return e.outputType==="encoded"?u1(u,e,L):L})}const m1=e=>{var n;if(!e||typeof e!="object")throw new Error("Invalid options parameter. It requires an object.");if(!e.password)throw new Error("Password must be specified");if(e.password=Qn(e.password),e.password.length<1)throw new Error("Password must be specified");if(!e.salt)throw new Error("Salt must be specified");if(e.salt=Qn(e.salt),e.salt.length<8)throw new Error("Salt should be at least 8 bytes long");if(e.secret=Qn((n=e.secret)!==null&&n!==void 0?n:""),!Number.isInteger(e.iterations)||e.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(e.parallelism)||e.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(e.hashLength)||e.hashLength<4)throw new Error("Hash length should be at least 4 bytes.");if(!Number.isInteger(e.memorySize))throw new Error("Memory size should be specified.");if(e.memorySize<8*e.parallelism)throw new Error("Memory size should be at least 8 * parallelism.");if(e.outputType===void 0&&(e.outputType="hex"),!["hex","binary","encoded"].includes(e.outputType))throw new Error(`Insupported output type ${e.outputType}. Valid values: ['hex', 'binary', 'encoded']`)};function f1(e){return Js(this,void 0,void 0,function*(){return m1(e),h1(Object.assign(Object.assign({},e),{hashType:"id"}))})}new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;new Dt;const v1=e=>String(e).trim().toLowerCase().replace(/_/g,"-")==="recoverable";class hA extends Error{stage;constructor(n,r,i=[]){const o=i.length?`${i.join(", ")} OK; `:"";super(`${o}${n} failed: ${r}`),this.name="ChatRecoveryStepError",this.stage=n}}const g1=e=>e instanceof Error?e.message:String(e),sc=(e,n,r=[])=>new hA(e,g1(n),r),mA=new lA({dbName:"aops-cockpit-v2-chat",storeName:"keys"}),wl=new oA,xc=new cA,qa=globalThis.crypto.subtle,fA=new TextEncoder,y1=new TextDecoder,b1=1,ih=65536,rb=3,ib=1,j1=12,vA=(e,n)=>`user-key-private:${n}:${e}`;function gA(e){const n=new Uint8Array(e);return globalThis.crypto.getRandomValues(n),n}function Xs(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function A1(e){return e?fn(e):new Uint8Array}function lh(e){return e.source==="password"?"password-kdf":"chat-pin"}async function yA(e){const n=await f1({password:e.secret,salt:fn(e.salt),iterations:e.iterations,parallelism:e.parallelism,memorySize:e.memoryKiB??ih,hashLength:32,outputType:"binary"});return qa.importKey("raw",Xs(n),{name:"AES-GCM"},!1,["encrypt","decrypt"])}async function bA(e,n,r){const i=gA(j1),o=fA.encode(r),d=await qa.encrypt({name:"AES-GCM",iv:Xs(i),additionalData:Xs(o)},e,Xs(n));return{nonce:un(i),ciphertext:un(new Uint8Array(d)),aad:un(o)}}async function jA(e,n,r,i){const o=A1(i),d=await qa.decrypt({name:"AES-GCM",iv:Xs(fn(n)),additionalData:Xs(o)},e,Xs(fn(r)));return new Uint8Array(d)}async function AA(e){return qa.importKey("pkcs8",e,{name:"ECDH",namedCurve:"P-256"},!1,["deriveKey"])}async function xA(e){const n={userId:e.userId,tenantId:e.tenantId,userKeyId:e.userKey.id,keyVersion:e.userKey.keyVersion,publicKey:e.userKey.publicKey,privateKey:e.privateKey,updatedAt:new Date().toISOString()};return await mA.put(vA(e.userId,e.tenantId),n),n}async function x1(e,n){return e?mA.get(vA(e,n)):null}async function C1(e){const n=lh(e.secret);if(e.userKey.kekSource!==n)throw new Error(`recovery key expects ${e.userKey.kekSource}`);const r=await yA({secret:e.secret.value,salt:e.userKey.kdfSalt,memoryKiB:e.userKey.kdfMemoryKiB,iterations:e.userKey.kdfIterations,parallelism:e.userKey.kdfParallelism}),i=await jA(r,e.userKey.nonce,e.userKey.ciphertext,e.userKey.aad),o=await AA(i);return xA({userId:e.userId,tenantId:e.tenantId,userKey:e.userKey,privateKey:o})}async function k1(e){const n=await qa.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"]),r=un(new Uint8Array(await qa.exportKey("spki",n.publicKey))),i=new Uint8Array(await qa.exportKey("pkcs8",n.privateKey)),o=await AA(i),d=un(gA(16)),u=await yA({secret:e.secret.value,salt:d,memoryKiB:ih,iterations:rb,parallelism:ib}),v=`chatv3-user-key-backup:v1:${e.tenantId}:${lh(e.secret)}`,h=await bA(u,i,v);return{privateKey:o,input:{tenantId:e.tenantId,publicKey:{algorithm:"p256-ecdh",format:"spki",publicKey:r},privateKeyBackup:{packageVersion:1,kekSource:lh(e.secret),kdf:{name:"argon2id",version:b1,salt:d,memoryKiB:ih,iterations:rb,parallelism:ib},wrapAlg:"aes-256-gcm",...h}}}}async function Cc(e){const n=await e.client.getUserKey({tenantId:e.tenantId}),r=await x1(e.principalUserId,e.tenantId);if(n&&r?.userKeyId===n.id&&r.keyVersion===n.keyVersion)return{userKey:n,localKey:r,created:!1};if(n&&e.principalUserId&&e.secret){const i=await C1({userId:e.principalUserId,tenantId:e.tenantId,userKey:n,secret:e.secret});return{userKey:n,localKey:i,created:!1}}if(!n&&e.principalUserId&&e.secret){const i=await k1({tenantId:e.tenantId,secret:e.secret}),o=await e.client.registerUserKey(i.input),d=await xA({userId:e.principalUserId,tenantId:e.tenantId,userKey:o.userKey,privateKey:i.privateKey});return{userKey:o.userKey,localKey:d,created:!0}}return{userKey:n,localKey:null,created:!1}}async function CA(e,n,r){return qa.deriveKey({name:"ECDH",public:n},e,{name:"AES-GCM",length:256},!1,r)}async function S1(e){const n=await qa.importKey("spki",fn(e.userKey.publicKey),{name:"ECDH",namedCurve:"P-256"},!1,[]),r=await qa.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"]),i=await CA(r.privateKey,n,["encrypt"]),o=`chatv3-member-key-package:v1:${e.channelId}:${e.memberId}:${e.userKey.keyVersion}`,d={version:1,channelId:e.channelId,keyId:e.keyId,wrapSecret:e.wrapSecret,sourceEpoch:e.sourceEpoch,issuedAt:new Date().toISOString()},u=await bA(i,fA.encode(JSON.stringify(d)),o);return{packageVersion:1,packageAlg:"p256-ecdh+a256gcm",ephemeralPublicKey:{algorithm:"p256-ecdh",format:"spki",publicKey:un(new Uint8Array(await qa.exportKey("spki",r.publicKey)))},sourceEpoch:e.sourceEpoch,...u}}async function w1(e,n){const r=await qa.importKey("spki",fn(n.ephemeralPublicKey),{name:"ECDH",namedCurve:"P-256"},!1,[]),i=await CA(e,r,["decrypt"]),o=await jA(i,n.nonce,n.ciphertext,n.aad),d=JSON.parse(y1.decode(o));if(d.version!==1||!d.keyId||!d.wrapSecret)throw new Error("invalid member key-package payload");return d}async function N1(e){if(!e.member?.id||!e.keyId||!e.wrapSecret)return!1;const{userKey:n}=await Cc({client:e.client,tenantId:e.tenantId,principalUserId:e.principalUserId,secret:e.secret});if(!n)return!1;const r=await S1({userKey:n,channelId:e.channel.id,memberId:e.member.id,keyId:e.keyId,wrapSecret:e.wrapSecret,sourceEpoch:e.sourceEpoch});return await e.client.putMemberKeyPackage({tenantId:e.tenantId,channelId:e.channel.id,memberId:e.member.id,recipientUserKeyId:n.id,recipientKeyVersion:n.keyVersion,envelope:r}),await xc.setChannelKeyId(e.channel.id,e.keyId),!0}async function I1(e){if(!v1(e.recovery.recoveryState)||!e.recovery.memberToken||!e.recovery.keyPackage)throw new hA("recovery.restore.preflight",`state=${e.recovery.recoveryState}; memberToken=${!!e.recovery.memberToken}; keyPackage=${!!e.recovery.keyPackage}`);const n=[];let r=null;try{if(r=(await Cc({client:e.client,tenantId:e.tenantId,principalUserId:e.principalUserId,secret:e.secret})).localKey,!r)throw new Error("local account key unavailable after unlock");n.push("account-key.unlock")}catch(o){throw sc("account-key.unlock",o,n)}let i;try{i=await w1(r.privateKey,e.recovery.keyPackage),n.push("member-package.unseal")}catch(o){throw sc("member-package.unseal",o,n)}try{await wl.setWrapSecret(e.channel.id,i.wrapSecret),await xc.setChannelMemberToken(e.channel.id,e.recovery.memberToken),await xc.setChannelKeyId(e.channel.id,i.keyId),await e.client.rememberChannelInvite({serverBaseUrl:"",channelId:e.channel.id,keyId:i.keyId,accessSecret:"",wrapSecret:i.wrapSecret}),e.client.http.memberToken=e.recovery.memberToken,n.push("wrap-secret.store")}catch(o){throw sc("wrap-secret.store",o,n)}try{const o=e.rooms??await e.client.listRooms(e.channel.id,{status:"active"});for(const d of o){const u=await e.client.http.get(`/rooms/${d.id}/epochs`);for(const v of u){const h=await ml(i.wrapSecret,{tenantId:e.channel.tenantId,spaceId:e.channel.spaceId,keyId:i.keyId,epoch:v.epoch}),m=await fl(h,v.wrappedKeyBlob);await wl.setEpochKey(v.roomId,v.epoch,m)}}n.push("epoch.hydrate")}catch(o){throw sc("epoch.hydrate",o,n)}return{memberToken:e.recovery.memberToken,keyId:i.keyId,wrapSecret:i.wrapSecret}}async function ol(e){const n=await kc(e.channel.id);if(!n.keyId||!n.wrapSecret)return!1;await e.client.rememberChannelInvite({serverBaseUrl:"",channelId:e.channel.id,keyId:n.keyId,accessSecret:"",wrapSecret:n.wrapSecret});const r=e.rooms??await e.client.listRooms(e.channel.id,{status:"active"}).catch(()=>[]);for(const i of r){if(await wl.getEpochKey(i.id,i.currentEpoch).catch(()=>null))continue;const d=await e.client.http.get(`/rooms/${i.id}/epochs`).catch(()=>[]);for(const u of d){const v=await ml(n.wrapSecret,{tenantId:e.channel.tenantId,spaceId:e.channel.spaceId,keyId:n.keyId,epoch:u.epoch}),h=await fl(v,u.wrappedKeyBlob);await wl.setEpochKey(u.roomId,u.epoch,h)}}return!0}async function kc(e){const[n,r]=await Promise.all([xc.getChannelKeyId(e).catch(()=>null),wl.getWrapSecret(e).catch(()=>null)]);return{keyId:n,wrapSecret:r}}async function oh(e){const n=await kc(e);return!!(n.keyId&&n.wrapSecret)}function lb(e){const n=e.trim().replace(/\/+$/,"");if(!n)throw new Error("ChatV3 server base URL is required");return n}function wp(e){const n=e.trim();if(!n)throw new Error("ChatV3 channel id is required");return n}class E1{serverUrl;baseOptions;createClient;directoryInstance=null;channelClients=new Map;clientGeneration=new WeakMap;clientChannel=new WeakMap;generation=0;constructor(n){const{serverBaseUrl:r,createClient:i,...o}=n;this.serverUrl=lb(r),this.baseOptions=o,this.createClient=i??(d=>new YI(d))}get serverBaseUrl(){return this.serverUrl}directory(){return this.directoryInstance||(this.directoryInstance=this.instantiate()),this.directoryInstance}createChannelClient(n){const r=this.instantiate(n);return this.clientGeneration.set(r,this.generation),r}registerChannel(n,r){return this.adoptChannel(n,this.createChannelClient(r))}adoptChannel(n,r){const i=wp(n);if(r===this.directoryInstance)throw new Error("The neutral ChatV3 directory client cannot be adopted by a channel");if(this.clientGeneration.get(r)!==this.generation)throw new Error("Only a channel client created by the current ChatV3 registry generation can be adopted");const o=this.clientChannel.get(r);if(o&&o!==i)throw new Error(`A ChatV3 client registered for channel ${o} cannot be reused for channel ${i}`);const d=this.channelClients.get(i);return d&&d!==r&&this.clientChannel.delete(d),this.channelClients.set(i,r),this.clientChannel.set(r,i),r}getChannel(n){return this.channelClients.get(wp(n))}setChannelMemberToken(n,r){const i=wp(n),o=this.channelClients.get(i);if(!o)throw new Error(`No ChatV3 client is registered for channel ${i}`);return o.http.memberToken=r,o}reset(n=this.serverUrl,r={}){this.serverUrl=lb(n),this.baseOptions={...this.baseOptions,...r},this.directoryInstance=null,this.channelClients.clear(),this.clientGeneration=new WeakMap,this.clientChannel=new WeakMap,this.generation+=1}instantiate(n){return this.createClient({...this.baseOptions,serverBaseUrl:this.serverUrl,...n===void 0?{}:{memberToken:n}})}}function wt(e){const n=e instanceof Error?e.message:String(e);if(!(e instanceof Error))return n;const r=e,i=[r.errorCode?`code=${r.errorCode}`:null,Number.isFinite(r.status)?`http=${r.status}`:null].filter(o=>!!o);return i.length?`${n} [${i.join(", ")}]`:n}function Np(e){const n=e instanceof Error?e.message:String(e);return/(member token (?:mismatch|required|unknown|not found)|unknown member token|invalid member token(?: format)?|membership is not active)/i.test(n)}function M1(e){return/(active principal-bound membership required|membership is not active)/i.test(wt(e))}function T1(e,n,r){return{status:"connected",error:n,activeSpaceSlug:e.spaceSlug,channelId:e.id,channelTitle:e.title,invite:e.invite,rooms:e.rooms,activeRoomId:r,messages:[],members:[],presence:[],receipts:[],bindings:[]}}function B1(e,n){return n?e.find(r=>r.id===n)?.recoveryError??null:null}function D1(e,n){const r=new Set(n.spaceSlugs),i=new Set(n.tenantIds);return e.every(o=>i.has(o.tenantId)||r.has(o.spaceSlug))}function Ip(e,n){if(n.authoritative)return[...n.rows];const r=new Map(e.map(i=>[i.id,i]));for(const i of n.rows)r.set(i.id,i);return[...r.values()]}const R1=e=>!e||typeof e!="object"?!1:e.status===404,L1=async(e,n)=>{try{const r=await e.get(`/rooms/${n}/members`);return Array.isArray(r)?r:null}catch(r){if(R1(r))return null;throw r}},uc=e=>e.roomStatus==="active"&&e.memberStatus==="active",kA=(e,n)=>e.find(r=>r.memberId===n&&!r.expired)?.state??"offline",ch=e=>!!e&&e!=="offline"&&e!=="none",O1=e=>e.roomMembers===void 0?[]:(e.roomMembers?e.roomMembers.filter(uc).map(r=>{const i=e.members.find(o=>o.id===r.memberId);return{id:r.memberId,handle:i?.handle??r.handle,actorKind:i?.actorKind??r.actorKind??void 0}}):e.members.length?e.members.filter(r=>r.status!=="removed").map(r=>({id:r.id,handle:r.handle,actorKind:r.actorKind})):e.receipts.map(r=>({id:r.memberId,handle:r.handle,actorKind:r.actorKind}))).map(r=>({...r,state:kA(e.presence,r.id)})).sort((r,i)=>{const o=Number(ch(i.state))-Number(ch(r.state));return o!==0?o:r.handle.localeCompare(i.handle)}),SA=e=>{const n=String(e).trim().toLowerCase().replace(/_/g,"-");return n==="recoverable"||n==="locked-needs-pin"||n==="locked-needs-invite"||n==="stale-needs-current-device"?n:e},Ep=e=>({...e,recoveryState:SA(e.recoveryState)}),_1=(e,n)=>({...e,recoveryState:SA(e.recoveryState),channel:e.channel??n.channel,member:e.member??n.member,userKey:e.userKey??n.userKey,keyPackage:e.keyPackage??n.keyPackage}),Q1={status:"idle",error:null,channelId:null,channelTitle:null,handle:null,invite:null,spaces:[],activeSpaceSlug:"default",channels:[],rooms:[],activeRoomId:null,messages:[],members:[],presence:[],receipts:[],roomMembers:void 0,bindings:[],spaceAdminStatus:"idle",spaceAdminError:null},wA="aops.cockpit.chatv3.spaces.v1",na={slug:"default",title:"Default Space"},NA=new oA,Nt=new cA,dh=(e,n)=>`ChatV3 auto-recovery failed at ${e}: ${wt(n)}`,Fa=(e,n)=>{const r=dh(e,n);return console.error("[chatv3 recovery]",e,n),r},Wa=(e,n)=>`${n} (${e.title||e.slug||e.id})`,U1=8,P1=e=>{const n=e.updatedAt??e.createdAt;if(!n)return 0;const r=Date.parse(n);return Number.isFinite(r)?r:0},Mp=(e,n={})=>e.map((r,i)=>({channel:r,index:i,preferred:n.preferredChannelId===r.id,hasLocalAccess:!!(r.memberToken||r.localCryptoAvailable),activeSpace:!!(n.activeSpaceSlug&&r.spaceSlug===n.activeSpaceSlug),recency:P1(r)})).sort((r,i)=>r.preferred!==i.preferred?r.preferred?-1:1:r.activeSpace!==i.activeSpace?r.activeSpace?-1:1:r.recency!==i.recency?i.recency-r.recency:r.hasLocalAccess!==i.hasLocalAccess?r.hasLocalAccess?-1:1:r.index-i.index).map(r=>r.channel),ei=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"oda",IA=async(e,n)=>{if(!n.invite)return;const r=Sl(n.invite);r.channelId===n.id&&(await Nt.setChannelInvite(n.id,n.invite),await Nt.setChannelKeyId(n.id,r.keyId).catch(()=>{}),await e.rememberChannelInvite(r))},F1=async e=>e.memberToken??Nt.getChannelMemberToken(e.id).catch(()=>null),Ka=async(e,n)=>{const r=await F1(n);return r&&(e.http.memberToken=r),r},Tp=async(e,n,r=n.rooms??[])=>{if(await IA(e,n),!await Ka(e,n))return null;if(n.encryptionMode==="server-encrypted")try{const o=await e.epochKeys(n.id,{tenantId:n.tenantId||"default"});return await TA(o.keys),null}catch(o){return Fa(Wa({id:n.id,slug:n.slug??"",title:n.title??""},"server-encrypted.epoch-keys"),o)}return await ol({client:e,channel:n,rooms:r}).catch(()=>{}),null},qr=e=>{const n=ei(e.slug||e.title||na.slug);return{...e.id?{id:e.id}:{},...e.tenantId?{tenantId:e.tenantId}:{},slug:n,title:(e.title??n).trim()||n,...e.status?{status:e.status}:{},source:e.source??(e.id?"server":"local")}},On=e=>{const n=new Map;for(const r of[na,...e]){const i=qr(r);n.set(i.slug,{...n.get(i.slug),...i})}return[...n.values()].slice(0,20)},Bp=(e,n)=>On([...e.filter(r=>r.slug!==n.slug),n]),K1=e=>qr({id:e.id,tenantId:e.tenantId,slug:e.slug,title:e.title,status:e.status,source:"server"}),EA=()=>{if(typeof window>"u")return[na];try{const e=window.localStorage.getItem(wA);if(!e)return[na];const n=JSON.parse(e);return Array.isArray(n)?On(n.filter(r=>!!r&&typeof r.slug=="string").map(r=>qr(r))):[na]}catch{return[na]}},Ur=e=>{typeof window>"u"||window.localStorage.setItem(wA,JSON.stringify(On(e)))},Hs=(e,n)=>({...Q1,spaces:e,activeSpaceSlug:n}),z1=()=>{const e=EA();return Hs(e,e[0]?.slug??na.slug)},al=e=>({id:e.id,slug:e.slug,title:e.title,currentEpoch:e.currentEpoch,purpose:"purpose"in e?e.purpose:null,guidanceMarkdown:ga("guidanceMarkdown"in e?e.guidanceMarkdown:null),..."createdBy"in e?{createdBy:e.createdBy??null}:{}}),ga=e=>{if(typeof e!="string")return null;const n=e.trim();return n||null},$1=e=>[`Channel: ${e.trim()||"chatv3-channel"}`,"Purpose: coordinate work in this channel; use rooms for separate conversation streams.","Agent bootstrap: join from invite, save a local session, read the active/general room, send a short ACK, then follow PM/task/review refs instead of treating chat as the truth ledger.","Rules: chat is coordination; PM stores execution and review truth; discuss stores material decisions; do not paste secrets into messages."].join(`
|
|
10
|
+
`),uh=e=>[`Room: ${e.trim()||"general"}`,"Purpose: keep this room focused on its named topic.","Agent bootstrap: read recent messages, mark delivered/read, ACK direct instructions, and resolve PM/RR/doc refs before acting."].join(`
|
|
11
|
+
`),H1=e=>e.slug==="general"&&e.title==="General"&&e.currentEpoch===0,G1=(e,n)=>n.length?e.length?n.length===1&&H1(n[0])&&e.some(r=>r.id===n[0].id)?e:n.map(r=>{const i=e.find(o=>o.id===r.id);return i?{...i,...r}:r}):n:e,Bt=(e,n)=>e.some(i=>i.id===n.id)?e.map(i=>i.id===n.id?{...i,...n,invite:n.invite??i.invite,rooms:G1(i.rooms,n.rooms)}:i):[...e,n],q1=(e,n)=>n.reduce((r,i)=>Bt(r,i),e),Dp=(e,n)=>(n&&e.some(r=>r.id===n)?n:null)??e[0]?.id??null,ob=e=>`Channel ${e.slug} is archived on the server. It is shown for orientation, but it cannot be loaded or joined until an owner/operator restores or recreates an active channel.`,V1=e=>{switch(e.recoveryState){case"locked-needs-pin":return`Channel ${e.slug} is tied to your account. Enter your Chat PIN to unlock the local key.`;case"stale-needs-current-device":return`Channel ${e.slug} has a stale recovery package. Open it from a current unlocked device to publish a fresh package.`;case"recoverable":return`Channel ${e.slug} is recoverable from your account key, but this browser has not finished unlocking it.`;default:return`Channel ${e.slug} is tied to your account, but this browser does not have the local ChatV3 key yet. Paste an invite once to unlock it.`}},Y1=/^cv3m_([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})_/i,cb=e=>Y1.exec(e)?.[1]??null,J1=e=>{for(const n of e)n.memberToken&&Nt.setChannelMemberToken(n.id,n.memberToken).catch(()=>{})},MA=e=>e.encryptionMode==="server-encrypted"?"server-encrypted":"e2e",TA=async e=>{for(const n of e)await NA.setEpochKey(n.roomId,n.epoch,await dc(n.rawEpochKey))},db=e=>{Nt.deleteChannelMemberToken(e).catch(()=>{}),Nt.deleteChannelKeyId(e).catch(()=>{}),Nt.deleteChannelInvite(e).catch(()=>{})},BA=(e,n=e?.memberToken??null)=>{if(!e?.id||!e.slug||!n)return null;const r=Array.isArray(e.rooms)?e.rooms.filter(i=>!!i?.id&&!!i.slug):[];return{id:e.id,tenantId:e.tenantId||"default",spaceId:e.spaceId||"default",spaceSlug:ei(e.spaceSlug||na.slug),slug:e.slug,title:e.title||e.slug,...e.status?{status:e.status}:{},...e.archivedAt!==void 0?{archivedAt:e.archivedAt}:{},...e.createdAt!==void 0?{createdAt:e.createdAt}:{},...e.updatedAt!==void 0?{updatedAt:e.updatedAt}:{},purpose:ga(e.purpose),guidanceMarkdown:ga(e.guidanceMarkdown),encryptionMode:MA(e),invite:e.invite??null,memberToken:n,...e.membershipStatus!==void 0?{membershipStatus:e.membershipStatus}:{},...e.isOwner!==void 0?{isOwner:e.isOwner}:{},...e.canDelete!==void 0?{canDelete:e.canDelete}:{},...e.recoveryState!==void 0?{recoveryState:e.recoveryState}:{},...e.recoveryError!==void 0?{recoveryError:e.recoveryError}:{},...e.localCryptoAvailable!==void 0?{localCryptoAvailable:e.localCryptoAvailable}:{},rooms:r}},X1=e=>{const n=new Map;for(const r of e??[]){const i=BA(r);i&&n.set(i.id,i)}return[...n.values()]},W1=async e=>{const n=new Map;for(const r of e??[]){const i=r.memberToken??(r.id?await Nt.getChannelMemberToken(r.id).catch(()=>null):null),o=r.invite??(r.id?await Nt.getChannelInvite(r.id).catch(()=>null):null),d=BA({...r,invite:o},i);d&&n.set(d.id,d)}return[...n.values()]},DA=(e,n,r,i)=>{const o=e,d=i?.rooms?.length||!o.generalRoomId?i?.rooms??[]:[{id:o.generalRoomId,slug:"general",title:"General",currentEpoch:0,purpose:null,guidanceMarkdown:uh("general")}];return{id:e.id,tenantId:e.tenantId,spaceId:e.spaceId,spaceSlug:n.slug,slug:e.slug,title:e.title||e.slug,...o.status?{status:o.status}:{},...o.archivedAt!==void 0?{archivedAt:o.archivedAt}:{},...o.createdAt!==void 0?{createdAt:o.createdAt}:{},...o.updatedAt!==void 0?{updatedAt:o.updatedAt}:{},purpose:ga(e.purpose),guidanceMarkdown:ga(e.guidanceMarkdown),encryptionMode:e.encryptionMode??i?.encryptionMode??"e2e",invite:i?.invite??null,memberToken:r,...i?.membershipStatus!==void 0?{membershipStatus:i.membershipStatus}:{},...i?.isOwner!==void 0?{isOwner:i.isOwner}:{},...i?.canDelete!==void 0?{canDelete:i.canDelete}:{},...i?.recoveryState!==void 0?{recoveryState:i.recoveryState}:{},...i?.recoveryError!==void 0?{recoveryError:i.recoveryError}:{},...i?.localCryptoAvailable!==void 0?{localCryptoAvailable:i.localCryptoAvailable}:{},rooms:d}},Z1=(e,n,r,i)=>({...DA(e.channel,n,r,i),membershipStatus:e.membership?.status??null,isOwner:e.isOwner,canDelete:e.canDelete,recoveryState:i?.recoveryState??null,recoveryError:i?.recoveryError??null,encryptionMode:e.modeStatus?.encryptionMode??e.channel.encryptionMode??i?.encryptionMode??"e2e",localCryptoAvailable:(e.modeStatus?.encryptionMode??e.channel.encryptionMode)==="server-encrypted"?!!(r||i?.localCryptoAvailable):i?.localCryptoAvailable??!1}),eE=async(e,n,r,i)=>{const o=j=>e.listMyChannels({tenantId:n.tenantId??"default",...n.id?{spaceId:n.id}:{},status:j,limit:500}).catch(()=>null),[d,u]=await Promise.all([o("active"),o("archived")]);if(d&&u){const j=[];for(const C of[...d,...u]){const k=i.find(L=>L.id===C.channel.id),x=k?.memberToken??await Nt.getChannelMemberToken(C.channel.id).catch(()=>null),S=(C.modeStatus?.encryptionMode??C.channel.encryptionMode)==="server-encrypted"?!!(x||k?.localCryptoAvailable):await oh(C.channel.id).catch(()=>!1),T=k?.invite??await Nt.getChannelInvite(C.channel.id).catch(()=>null),I=r.find(L=>L.id===C.channel.spaceId)??n,E=k?{...k,localCryptoAvailable:S}:void 0;j.push({...Z1(C,I,x,E),invite:T})}return{rows:j,authoritative:!0}}const v=j=>e.listChannels({tenantId:n.tenantId??"default",...n.id?{spaceId:n.id}:{},status:j,limit:500}).catch(()=>null),[h,m]=await Promise.all([v("active"),v("archived")]),g=[...h??[],...m??[]],b=[];for(const j of g){const C=i.find(E=>E.id===j.id),k=C?.memberToken??await Nt.getChannelMemberToken(j.id).catch(()=>null),x=MA(j)==="server-encrypted"?!!(k||C?.localCryptoAvailable):await oh(j.id).catch(()=>!1),S=C?.invite??await Nt.getChannelInvite(j.id).catch(()=>null),T=r.find(E=>E.id===j.spaceId)??n,I=C?{...C,localCryptoAvailable:x}:void 0;b.push({...DA(j,T,k,I),invite:S})}return{rows:b,authoritative:!!(h&&m)}},Rp=async(e,n,r,i)=>{const o=new Map(n.map(h=>[h.slug,h])),d=new Map,u=i?o.get(i):null;u&&d.set(u.slug,u);for(const h of n)h.id&&d.set(h.slug,h);const v=await Promise.all([...d.values()].map(h=>eE(e,h,n,r)));return{rows:q1([],v.flatMap(h=>h.rows)),authoritative:v.every(h=>h.authoritative)&&D1(r,{spaceSlugs:[...d.values()].filter(h=>!!h.id).map(h=>h.slug),tenantIds:[...d.values()].filter(h=>!h.id).map(h=>h.tenantId??"default")})}},tE=(e,n,r=e.channels)=>({...e,status:"connected",error:null,activeSpaceSlug:n.spaceSlug,channelId:n.id,channelTitle:n.title,invite:n.invite,channels:Bt(r,n),rooms:n.rooms,activeRoomId:null,messages:[],members:[],presence:[],receipts:[],roomMembers:void 0,bindings:[]}),aE=e=>({version:1,updatedAt:new Date().toISOString(),handle:e.handle,activeSpaceSlug:e.activeSpaceSlug,activeChannelId:e.channelId,activeRoomId:e.activeRoomId,spaces:On(e.spaces),channels:X1(e.channels)}),xt=e=>{const n=aE(e);if(J1(n.channels),!n.channels.length){Nt.clear().catch(()=>{});return}Nt.set(n).catch(()=>{})},Ks=(e,n,r=e.channels)=>{const i=tE(e,n,r);return xt(i),i},Lp=()=>{Nt.clear().catch(()=>{})},nE=async(e,n)=>{const r=[];let i=0;for(let o=0;o<1e3;o+=1){const d=await e.readText(n,i);if(!d.length)break;r.push(...d);const u=d.reduce((v,h)=>h.seq>v?h.seq:v,i);if(u<=i)break;i=u}return r};function sE(e){return e.trim().toLowerCase().replace(/[^a-z0-9]/g,"")}function rE(e){const n=sE(e);return n.includes("authorization")||n.includes("cookie")||n.includes("session")||n.endsWith("token")||n.includes("accesstoken")||n.includes("apikey")||n.includes("password")||n.includes("secret")}function iE(e){const n=e.toLowerCase();if(n==="localhost"||n==="[::1]")return!0;const r=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(n);if(!r)return!1;const i=r.slice(1).map(Number);return i[0]===127&&i.every(o=>o>=0&&o<=255)}function lE(e){return e.trim().toLowerCase().replace(/[^a-z0-9]/g,"")}function oE(e){const n=lE(e);return n.includes("authorization")||n.includes("cookie")||n.includes("session")||n.endsWith("token")||n.includes("apikey")||n.includes("password")||n.includes("secret")||n.includes("credential")||n.includes("bearer")||n.includes("csrf")||n.includes("xsrf")||n==="jwt"||n.endsWith("jwt")}function cE(e,n,r){let i;try{i=new URL(e)}catch{throw new Error("community_cockpit_trusted_server_base_rejected")}if(i.protocol!=="http:"&&i.protocol!=="https:"||i.username||i.password||i.pathname!=="/"||i.search||i.hash)throw new Error("community_cockpit_trusted_server_base_rejected");if(n==="trusted-local"&&!iE(i.hostname))throw new Error("community_cockpit_trusted_server_base_rejected");if(n==="south-bff"){let o;try{o=new URL(r??"")}catch{throw new Error("community_cockpit_trusted_server_base_rejected")}if(i.protocol!=="https:"||o.protocol!=="https:"||i.origin!==o.origin)throw new Error("community_cockpit_trusted_server_base_rejected")}return i}function dE(e,n,r){const i=e instanceof Request?e.url:e instanceof URL?e.href:String(e);let o;try{o=new URL(i)}catch{throw new Error("community_cockpit_trusted_fetch_target_rejected")}if(o.protocol!=="http:"&&o.protocol!=="https:"||o.username||o.password||o.origin!==n.origin||o.hash||o.pathname!==r.slice(0,-1)&&!o.pathname.startsWith(r))throw new Error("community_cockpit_trusted_fetch_target_rejected");for(const d of o.searchParams.keys())if(oE(d))throw new Error("community_cockpit_credential_query_rejected")}function uE(e,n){const r=new Headers(e instanceof Request?e.headers:void 0);for(const[i,o]of new Headers(n?.headers))r.set(i,o);return r}function ub(e){const n=e.trim(),r=/^Bearer\s+/i.test(n)?n.replace(/^Bearer\s+/i,""):n;return/^cv3m_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}_[A-Za-z0-9_-]{16,}$/.test(r)?"Bearer "+r:null}function pE(e,n,r){const i=cE(e,n,r),o=globalThis.fetch.bind(globalThis);return(d,u)=>{dE(d,i,"/api/chatv3/v1/");const v=uE(d,u),h=v.get("authorization"),m="x-chatv3-member-token",g=v.get(m),b=g===null?null:ub(g);if(g!==null&&b===null)throw new Error("community_cockpit_invalid_chatv3_member_token");const j=h===null?null:ub(h),C=b??j;for(const I of[...v.keys()])rE(I)&&v.delete(I);C&&v.set(m,C);const k=u?.method??(d instanceof Request?d.method:"GET");if(n==="south-bff"&&!hE(k)){const I=mE();if(!I)throw new Error("south_bff_csrf_cookie_required");v.set("x-csrf-token",I)}const x=n==="south-bff"?"same-origin":"omit",S=n==="south-bff"?"same-origin":"no-referrer",T=new Request(d,{...u,headers:v,credentials:x,redirect:"error",referrerPolicy:S});return o(T,{headers:v,credentials:x,redirect:"error",referrerPolicy:S})}}function hE(e){const n=e.trim().toUpperCase();return n==="GET"||n==="HEAD"||n==="OPTIONS"}function mE(){if(typeof document>"u")return null;const e=new Map;for(const n of document.cookie.split(";")){const r=n.indexOf("=");if(r<=0)continue;const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();i&&o&&e.set(i,o)}return e.get("__Host-south-bff-csrf")??e.get("south-bff-csrf")??null}function fE(e,n={}){const r=y.useRef(null),i=y.useRef({}),o=y.useRef({}),[d,u]=y.useState(()=>z1()),v=y.useRef(d),h=y.useRef(n.recoverySecret??null),m=y.useRef(0);y.useEffect(()=>{v.current=d},[d]),y.useEffect(()=>{h.current=n.recoverySecret??null},[n.recoverySecret]);const g=y.useCallback(()=>{const w=e.replace(/\/$/,"");return(!r.current||r.current.serverBaseUrl!==w)&&(r.current=new E1({serverBaseUrl:e,fetchImpl:pE(e,n.authMode??"trusted-local",n.browserOrigin),keyStore:NA})),r.current},[n.authMode,n.browserOrigin,e]),b=y.useCallback(()=>g().directory(),[g]),j=y.useCallback(w=>{const F=g(),X=F.getChannel(w.id)??F.registerChannel(w.id,w.memberToken??void 0);return w.memberToken&&F.setChannelMemberToken(w.id,w.memberToken),X},[g]),C=y.useCallback(async(w,F=h.current,X={})=>{if(w.status==="archived")return w;const D=j(w),B=w.tenantId||n.tenantId||"default",[U,H]=await Promise.all([Nt.getChannelMemberToken(w.id).catch(()=>null),oh(w.id).catch(()=>!1)]),q=v.current.channelId===w.id&&D.http.memberToken?D.http.memberToken:null,V=w.memberToken??U??q;if(w.encryptionMode==="server-encrypted"){if(!V)return{...w,memberToken:null,localCryptoAvailable:!1};let Ne=V;try{if(X.forceServerRecovery){const we=cb(V);if(!we)throw new Error("stored member token does not contain a recoverable member identity");D.http.memberToken=void 0;const Be=await D.http.post(`/channels/${w.id}/members/${we}/token`,{tenantId:B,channelId:w.id,memberId:we});if(Be.member.id!==we||cb(Be.memberToken)!==we)throw new Error("server returned a token for a different member identity");Ne=Be.memberToken}D.http.memberToken=Ne,await Nt.setChannelMemberToken(w.id,Ne).catch(()=>{})}catch(we){const Be=Fa(Wa(w,"server-encrypted.member-token"),we);D.http.memberToken=void 0;const Je=M1(we);return Je&&await Nt.deleteChannelMemberToken(w.id).catch(()=>{}),{...w,memberToken:Je?null:V,recoveryState:Je?"locked-needs-invite":null,recoveryError:Be,localCryptoAvailable:!1}}try{const we=await D.epochKeys(w.id,{tenantId:B});return await TA(we.keys),{...w,memberToken:Ne,recoveryState:null,recoveryError:null,localCryptoAvailable:!0}}catch(we){return{...w,memberToken:Ne,recoveryState:null,recoveryError:Fa(Wa(w,"server-encrypted.epoch-keys"),we),localCryptoAvailable:!1}}}const be=H;if(!n.principalUserId)return w;if(be&&V)return await Nt.setChannelMemberToken(w.id,V).catch(()=>{}),v.current.channelId===w.id&&(D.http.memberToken=V,await ol({client:D,channel:w}).catch(()=>{})),{...w,memberToken:V,recoveryState:null,recoveryError:null,localCryptoAvailable:!0};if(w.memberToken)return{...w,recoveryError:null,localCryptoAvailable:be};let ge=null;try{ge=Ep(await D.getMemberRecovery({tenantId:B,channelId:w.id,mintToken:!1}))}catch(Ne){return{...w,recoveryState:w.recoveryState??null,recoveryError:Fa(Wa(w,"recovery.inspect"),Ne),localCryptoAvailable:be}}if(be&&!X.forceServerRecovery)return{...w,recoveryState:null,recoveryError:null,localCryptoAvailable:!0};if(ge.recoveryState!=="recoverable"){const Ne=ge.recoveryState==="locked-needs-invite"&&ge.userKey?dh(Wa(w,"recovery.inspect"),new Error("no member key-package was available for this account key")):null;return{...w,recoveryState:ge.recoveryState,recoveryError:Ne}}const Se=await Cc({client:D,tenantId:B,principalUserId:n.principalUserId,secret:null}).catch(()=>null);if(!Se?.localKey&&ge.userKey?.kekSource==="chat-pin"&&!F)return{...w,recoveryState:"locked-needs-pin",recoveryError:null};if(!Se?.localKey&&!F){const Ne=ge.userKey?.kekSource==="password-kdf"?Fa(Wa(w,"account-key.unlock"),new Error("login password is no longer available for password-kdf recovery")):null;return{...w,recoveryState:"recoverable",recoveryError:Ne}}try{const Ne=_1(Ep(await D.getMemberRecovery({tenantId:B,channelId:w.id,mintToken:!0})),ge),we=await I1({client:D,tenantId:B,principalUserId:n.principalUserId,channel:w,recovery:Ne,secret:F});return we?{...w,memberToken:we.memberToken,recoveryState:null,recoveryError:null,localCryptoAvailable:!0}:{...w,recoveryState:Ne.recoveryState,recoveryError:Fa(Wa(w,"recovery.restore"),new Error("recoverable recovery did not include a usable member token and key-package"))}}catch(Ne){return{...w,recoveryState:ge.recoveryState,recoveryError:Fa(Wa(w,"recovery.restore"),Ne)}}},[j,n.principalUserId,n.tenantId]),k=y.useCallback(async(w,F={})=>{const X=new Map(w.map(V=>[V.id,V])),D=Mp(w,F),B=h.current;let U=!1,H=0;const q=Math.max(0,F.eagerLimit??U1);for(const V of D){const be=F.preferredChannelId===V.id,ge=!!(V.memberToken||V.localCryptoAvailable);if(!(V.encryptionMode==="server-encrypted"?!F.lazy||be||ge:!F.lazy||be||ge||H<q))continue;const Ne=!!V.memberToken,we=await C(V,B);if(ge||(H+=1),X.set(V.id,we),B?.source==="password"&&!Ne&&we.memberToken&&(U=!0),F.stopAfterFirstRestored&&!Ne&&we.memberToken)break}return U&&n.onRecoverySecretConsumed?.(),w.map(V=>X.get(V.id)??V)},[n.onRecoverySecretConsumed,C]),x=y.useCallback(async w=>{const F=(B,U)=>{const H=Fa(B,U);if(w.required)throw new Error(H);return!1};if(!n.principalUserId)return w.required?F("self-key-package.principal",new Error("auth principal is required before self key-package publish")):!1;if(!w.member?.id)return w.required?F("self-key-package.member",new Error("current channel member is required before self key-package publish")):!1;if(!w.keyId||!w.wrapSecret)return w.required?F("self-key-package.crypto",new Error("channel key id and wrap secret are required before self key-package publish")):!1;let X=!1;try{X=!!(await Cc({client:w.client,tenantId:w.channel.tenantId,principalUserId:n.principalUserId,secret:h.current})).userKey}catch(B){return F("self-key-package.account-key.register",B)}if(!X)return w.required?F("self-key-package.account-key.register",new Error("account user-key is not registered; login password or Chat PIN is required before publishing self key-package")):!1;let D=!1;try{D=await N1({client:w.client,tenantId:w.channel.tenantId,principalUserId:n.principalUserId,secret:h.current,channel:w.channel,member:w.member,keyId:w.keyId,wrapSecret:w.wrapSecret,sourceEpoch:w.sourceEpoch})}catch(B){return F("self-key-package.publish",B)}if(!D)return F("self-key-package.publish",new Error("no self key-package was published for the current member"));try{const B=Ep(await w.client.getMemberRecovery({tenantId:w.channel.tenantId,channelId:w.channel.id,mintToken:!1}));if(B.recoveryState!=="recoverable"||!B.keyPackage)return F("self-key-package.verify",new Error(`self key-package verification returned ${B.recoveryState}`))}catch(B){return F("self-key-package.verify",B)}return!0},[n.principalUserId]),S=y.useCallback(async w=>{const F=d.rooms.find(q=>q.id===w),X=d.channelId,D=d.channels.find(q=>q.id===X);if(!F||!X||!D)return;const B=j(D),U=async q=>{q&&(await Ka(B,q),await ol({client:B,channel:q,rooms:[F]}).catch(()=>{}));const[V,be,ge,Se,Ne,we]=await Promise.all([nE(B,F),B.listPresence(w),B.getReceipts(w),B.listMembers(X).catch(()=>null),L1(B.http,w).catch(()=>{}),B.listBindings(X).then(Je=>Je.filter(Ke=>!Ke.roomId||Ke.roomId===w)).catch(()=>[])]);let Be=Ne;return Array.isArray(Be)?o.current[X]=!0:Be===null&&o.current[X]&&(Be=void 0),{messages:V,presence:be,receipts:ge,members:Se,roomMembers:Be,bindings:we}},H=async(q,V)=>{u(ge=>{if(ge.activeRoomId!==w)return ge;const Se=V?Bt(ge.channels,V):ge.channels,Ne={...ge,channels:Se,messages:q.messages,presence:q.presence,receipts:q.receipts,bindings:q.bindings,...q.members?{members:q.members}:{},...q.roomMembers!==void 0?{roomMembers:q.roomMembers}:{},error:B1(Se,ge.channelId)};return V&&xt(Ne),Ne});const be=q.messages.length?q.messages[q.messages.length-1].seq:0;be>0&&be>(i.current[w]??0)&&(i.current[w]=be,await B.markDelivered(w,be).catch(()=>{}),await B.markRead(w,be).catch(()=>{}))};try{await H(await U(D))}catch(q){let V=q,be=null;if(D?.encryptionMode==="server-encrypted"&&Np(q))try{const ge=await C(D,h.current,{forceServerRecovery:!0});if(be=ge,ge.memberToken)try{await H(await U(ge),ge);return}catch(Se){V=Se}else ge.recoveryError&&(V=ge.recoveryError)}catch(ge){V=ge}u(ge=>{if(ge.activeRoomId!==w)return ge;if(be&&!be.memberToken)return Ks(ge,be,Bt(ge.channels,be));const Se={...ge,...be?{channels:Bt(ge.channels,be)}:{},error:wt(V)};return be&&xt(Se),Se})}},[d.rooms,d.channelId,d.channels,C,j]),T=y.useCallback(async(w,F)=>{const X=j(w);if(w.status==="archived")throw new Error(ob(w));if(!w.memberToken)throw new Error(V1(w));await IA(X,w).catch(()=>{}),await Ka(X,w);const[D,B]=await Promise.all([X.listRooms(w.id,{status:"active"}),X.listMembers(w.id)]),U=D.map(al),H=await Tp(X,{...w,rooms:U},U),q=Dp(U,F),V=B.find(ge=>{const Se=ge;return n.principalUserId&&Se.userId===n.principalUserId||ge.handle===v.current.handle});if(V&&w.encryptionMode!=="server-encrypted")try{const ge=await kc(w.id);await x({client:X,channel:w,member:V,keyId:ge.keyId,wrapSecret:ge.wrapSecret,sourceEpoch:U.reduce((Se,Ne)=>Math.max(Se,Ne.currentEpoch),1),required:!1})}catch(ge){Fa("self-key-package.load",ge)}const be=await X.getChannel(w.id).catch(()=>null);return{rooms:U,members:B,activeRoomId:q,channel:be,cryptoWarning:H}},[j,n.principalUserId,x]);y.useEffect(()=>{let w=!0;const F=m.current,X=()=>m.current===F;return(async()=>{const D=await Nt.get().catch(()=>null);if(!w||!X()||D&&D.version!==1)return;const B=b(),U=On([...D?.spaces??[],...EA()]),H=await W1(D?.channels),q=D?.activeSpaceSlug??U[0]?.slug??na.slug,V=U.some(Ke=>Ke.slug===q)?q:H[0]?.spaceSlug??na.slug,be=await Rp(B,U,H,V),ge=D?.activeChannelId??null,Se=Ip(H,be),Ne=await k(Se,{preferredChannelId:ge,activeSpaceSlug:V,lazy:!0,stopAfterFirstRestored:!0});if(!w||!X())return;if(!Ne.length){if(!be.authoritative)return;u(()=>Hs(U,V)),Lp();return}const we=Mp(Ne,{preferredChannelId:ge,activeSpaceSlug:V}),Be=we.filter(Ke=>Ke.memberToken),Je=Be.find(Ke=>Ke.id===D?.activeChannelId)??Be.find(Ke=>Ke.spaceSlug===V)??Be[0]??we[0]??Ne[0];if(!(!Je||!X())){if(u(Ke=>({...Ke,status:"connecting",error:null,spaces:U,activeSpaceSlug:V,channels:Ne})),!Je.memberToken){if(!X())return;u(Ke=>Ks({...Ke,spaces:U,activeSpaceSlug:V},Je,Ne));return}try{const Ke=await T(Je,D?.activeRoomId);if(!w||!X())return;const Xe={...Je,...Ke.channel?{title:Ke.channel.title,purpose:Ke.channel.purpose,guidanceMarkdown:ga(Ke.channel.guidanceMarkdown)}:{},rooms:Ke.rooms};u(Et=>{if(!X())return Et;const vt={...Et,status:"connected",error:Ke.cryptoWarning,channelId:Xe.id,channelTitle:Xe.title,handle:D?.handle??null,invite:Xe.invite,spaces:U,activeSpaceSlug:Xe.spaceSlug,channels:Bt(Ne,{...Xe,recoveryError:Ke.cryptoWarning}),rooms:Ke.rooms,activeRoomId:Ke.activeRoomId,messages:[],members:Ke.members,presence:[],receipts:[],roomMembers:void 0,bindings:[]};return xt(vt),vt})}catch(Ke){if(!w||!X())return;u(Xe=>({...Xe,status:"error",error:`Session restore failed: ${wt(Ke)}`,spaces:U,activeSpaceSlug:V,channels:Ne}))}}})(),()=>{w=!1}},[b,k,T]);const I=y.useCallback(async(w,F,X,D,B,U)=>{const H=j({id:w.id,memberToken:U}),q=U??H.http.memberToken??await Nt.getChannelMemberToken(w.id).catch(()=>null);q&&(H.http.memberToken=q,await Nt.setChannelMemberToken(w.id,q).catch(()=>{}));let V=[];try{q&&(H.http.memberToken=q),V=await H.listMembers(w.id)}catch{V=[]}let be=X;try{q&&(H.http.memberToken=q);const Ee=await H.listRooms(w.id,{status:"active"});Ee.length&&(be=Ee.map(al))}catch{}const ge=await H.listMyChannels({tenantId:w.tenantId,spaceId:w.spaceId,status:"active",limit:500}).then(Ee=>Ee.find(Le=>Le.channel.id===w.id)??null).catch(()=>null),Se=D?(()=>{try{return Sl(D)}catch{return null}})():null;Se&&await Nt.setChannelKeyId(w.id,Se.keyId).catch(()=>{});const Ne=w.encryptionMode??Se?.mode??"e2e",we=Ne==="e2e"?Se&&Se.mode==="e2e"?{keyId:Se.keyId,wrapSecret:Se.wrapSecret}:await kc(w.id):{keyId:Se?.keyId??null,wrapSecret:null};q&&(H.http.memberToken=q);const Be=await Tp(H,{...w,encryptionMode:Ne,invite:D,memberToken:q,rooms:be},be).catch(Ee=>Fa(Wa({id:w.id,slug:w.slug,title:w.title??w.slug},"channel.crypto-hydrate"),Ee));q&&(H.http.memberToken=q);const Je=ge?.membership??V.find(Ee=>Ee.handle===F),Ke=be.reduce((Ee,Le)=>Math.max(Ee,Le.currentEpoch),1),Xe=Ne==="e2e"&&n.principalUserId&&q&&we.wrapSecret?{memberToken:q,member:Je,keyId:we.keyId,wrapSecret:we.wrapSecret,sourceEpoch:Ke}:null,Et=be[0]??null;q&&(H.http.memberToken=q,await Nt.setChannelMemberToken(w.id,q).catch(()=>{}));const vt={id:w.id,tenantId:w.tenantId,spaceId:w.spaceId,spaceSlug:B.slug,slug:w.slug,title:w.title??w.slug,purpose:ga("purpose"in w?w.purpose:null),guidanceMarkdown:ga("guidanceMarkdown"in w?w.guidanceMarkdown:null),encryptionMode:Ne,invite:D,memberToken:q??null,recoveryError:Be,...ge?.membership?.status!==void 0?{membershipStatus:ge.membership.status}:{},...ge?{isOwner:ge.isOwner,canDelete:ge.canDelete}:{},localCryptoAvailable:Ne==="server-encrypted"?!!q:!!(we.keyId&&we.wrapSecret),rooms:be};u(Ee=>{const Le={...Ee,status:"connected",error:Be,channelId:w.id,channelTitle:vt.title,handle:F,invite:D,spaces:Bp(Ee.spaces,B),activeSpaceSlug:B.slug,channels:Bt(Ee.channels,vt),rooms:be,activeRoomId:Et?.id??null,messages:[],members:V,presence:[],receipts:[],roomMembers:void 0,bindings:[]};return Ur(Le.spaces),xt(Le),Le}),Xe&&globalThis.setTimeout(()=>{(async()=>{const Ee=H.http.memberToken;H.http.memberToken=Xe.memberToken;const Le=Wa(vt,"self-key-package.background"),xe=Te=>{u(Me=>Me.channelId!==vt.id?Me:{...Me,error:Te,channels:Bt(Me.channels,{...vt,recoveryError:Te})})};try{await x({client:H,channel:w,member:Xe.member,keyId:Xe.keyId,wrapSecret:Xe.wrapSecret,sourceEpoch:Xe.sourceEpoch,required:!1})||xe(dh(Le,new Error("account recovery escrow did not publish for this channel")))}catch(Te){xe(Fa(Le,Te))}finally{v.current.channelId===vt.id?H.http.memberToken=Xe.memberToken:H.http.memberToken=Ee}})()},0)},[j,n.principalUserId,x]),E=y.useCallback(async()=>{if(!n.adminEnabled)return;const w=b();u(F=>({...F,spaceAdminStatus:"loading",spaceAdminError:null}));try{const X=(await w.listSpaces({status:"active",limit:100})).map(K1),D=v.current,B=On([...D.spaces,...X]),U=await Rp(w,B,D.channels,D.activeSpaceSlug);u(H=>{const q=On([...H.spaces,...X]),V=Ip(H.channels,U),be=H.channelId?V.find(Be=>Be.id===H.channelId):null,ge=be?be.rooms:H.rooms,Se=be?.memberToken?Dp(ge,H.activeRoomId):H.activeRoomId,Ne=q.some(Be=>Be.slug===H.activeSpaceSlug)?H.activeSpaceSlug:q[0]?.slug??na.slug,we={...H,channels:V,rooms:ge,activeRoomId:Se,spaces:q,activeSpaceSlug:Ne,spaceAdminStatus:"ready",spaceAdminError:null};return Ur(q),xt(we),we})}catch(F){u(X=>({...X,spaceAdminStatus:"error",spaceAdminError:wt(F)}))}},[b,n.adminEnabled]);y.useEffect(()=>{if(!n.adminEnabled){u(w=>w.spaceAdminStatus==="idle"&&!w.spaceAdminError?w:{...w,spaceAdminStatus:"idle",spaceAdminError:null});return}E()},[n.adminEnabled,E]);const L=y.useCallback(async({slug:w,title:F})=>{const X=b(),D=qr({slug:w,title:F});try{const B=await X.ensureSpace(D.slug,D.title),U=qr({id:B.id,tenantId:B.tenantId,slug:B.slug??D.slug,title:D.title,status:"active",source:n.adminEnabled?"server":"local"});return u(H=>{const q=Bp(H.spaces,U);Ur(q);const V={...H,error:null,spaces:q,activeSpaceSlug:U.slug};return V.channels.length&&xt(V),V}),U}catch(B){throw u(U=>({...U,error:wt(B)})),B}},[b,n.adminEnabled]),P=y.useCallback(w=>{w!==na.slug&&u(F=>{const X=On(F.spaces.filter(H=>H.slug!==w)),D=F.activeSpaceSlug===w?na.slug:F.activeSpaceSlug,B=F.channels.filter(H=>H.spaceSlug!==w);if(Ur(X),F.activeSpaceSlug!==w){const H={...F,spaces:X,channels:B};return xt(H),H}const U={...Hs(X,D),error:null,channels:B};return xt(U),U})},[]),N=y.useCallback(async w=>{const F=b();if(w===na.slug){u(D=>({...D,error:"default space cannot be archived"}));return}const X=d.spaces.find(D=>D.slug===w);if(!X?.id){u(D=>({...D,error:"space metadata id missing; refresh admin space list first"}));return}try{await F.archiveSpace(X.id,{updatedBy:d.handle??"operator"}),u(D=>{const B=On(D.spaces.filter(V=>V.slug!==w)),U=D.activeSpaceSlug===w?B[0]?.slug??na.slug:D.activeSpaceSlug,H=D.channels.filter(V=>V.spaceSlug!==w),q=D.activeSpaceSlug===w?{...Hs(B,U),error:null,channels:H,spaceAdminStatus:D.spaceAdminStatus,spaceAdminError:D.spaceAdminError}:{...D,error:null,spaces:B,channels:H};return Ur(B),xt(q),q}),E()}catch(D){throw u(B=>({...B,error:wt(D)})),D}},[b,E,d.handle,d.spaces]),R=y.useCallback(async w=>{const F=b(),X=d.spaces.find(ge=>ge.slug===w)??qr({slug:w}),D=Bp(d.spaces,X);Ur(D);const B=await Rp(F,D,d.channels,X.slug),U=d.channels.find(ge=>ge.id===d.channelId&&ge.spaceSlug===X.slug)?.id??null,H=Ip(d.channels,B),q=await k(H,{preferredChannelId:U,activeSpaceSlug:X.slug,lazy:!0,stopAfterFirstRestored:!0}),V=Mp(q,{preferredChannelId:U,activeSpaceSlug:X.slug}),be=V.find(ge=>ge.spaceSlug===X.slug&&ge.memberToken)??V.find(ge=>ge.spaceSlug===X.slug);if(!be){u(()=>{const ge={...Hs(D,X.slug),channels:q,error:null};return xt(ge),ge});return}if(!be.memberToken){u(ge=>Ks({...ge,spaces:D,activeSpaceSlug:X.slug},be,q));return}try{const ge=await T(be);u(Se=>{const Ne={...Se,status:"connected",error:ge.cryptoWarning,spaces:D,activeSpaceSlug:X.slug,channelId:be.id,channelTitle:be.title,invite:be.invite,channels:Bt(q,{...be,rooms:ge.rooms,recoveryError:ge.cryptoWarning}),rooms:ge.rooms,activeRoomId:ge.activeRoomId,messages:[],members:ge.members,presence:[],receipts:[],roomMembers:void 0,bindings:[]};return xt(Ne),Ne})}catch(ge){u(Se=>({...Se,status:"error",spaces:D,channels:q,activeSpaceSlug:X.slug,channelId:null,channelTitle:null,rooms:[],activeRoomId:null,messages:[],members:[],presence:[],receipts:[],roomMembers:void 0,bindings:[],error:wt(ge)}))}},[b,d.spaces,d.channels,k,T]),z=y.useCallback(async({handle:w,title:F,guidanceMarkdown:X,encryptionMode:D="server-encrypted"})=>{u(B=>({...B,status:"connecting",error:null}));try{const B=g(),U=B.directory(),H=B.createChannelClient(),q=ga(X)??$1(F),V=uh("general"),be=d.spaces.find(Je=>Je.slug===d.activeSpaceSlug)??na,ge=await U.ensureSpace(be.slug,be.title),{channel:Se,generalRoom:Ne,invite:we}=await H.createChannel({space:ge,slug:ei(F||"cockpit-oda"),title:F||"Cockpit Oda",handle:w,encryptionMode:D,guidanceMarkdown:q,generalRoomGuidanceMarkdown:V});B.adoptChannel(Se.id,H);const Be=H.http.memberToken??null;await I({...Se,title:F||Se.slug,guidanceMarkdown:q},w,[al(Ne)],we,be,Be)}catch(B){u(U=>({...U,status:"error",error:wt(B)}))}},[g,I,d.activeSpaceSlug,d.spaces]),ne=y.useCallback(async({handle:w,invite:F})=>{u(X=>({...X,status:"connecting",error:null}));try{const X=g(),D=X.createChannelClient(),B=Sl(F.trim()),{rooms:U}=await D.joinFromInvite(B,w);X.adoptChannel(B.channelId,D);const H=D.http.memberToken??null;let q=null;try{q=await D.getChannel(B.channelId)}catch{q=null}await I(q??{id:B.channelId,tenantId:U[0]?.tenantId??"default",spaceId:"default",slug:"katilinan-kanal",title:"katılınan kanal"},w,U.map(al),F,d.spaces.find(V=>V.slug===d.activeSpaceSlug)??na,H)}catch(X){u(D=>({...D,status:"error",error:wt(X)}))}},[g,I,d.activeSpaceSlug,d.spaces]),ye=y.useCallback(async(w,F)=>{const X=v.current.channels.find(q=>q.id===w)??d.channels.find(q=>q.id===w);if(!X)return;const D=++m.current,B=()=>m.current===D,U=(q,V)=>{B()&&u(be=>{if(!B())return be;const ge={...q,rooms:V.rooms,recoveryError:V.cryptoWarning},Se={...be,status:"connected",error:V.cryptoWarning,channelId:q.id,channelTitle:q.title,invite:q.invite,activeSpaceSlug:q.spaceSlug,channels:Bt(be.channels,ge),rooms:V.rooms,activeRoomId:V.activeRoomId,messages:[],members:V.members,presence:[],receipts:[],roomMembers:void 0,bindings:[]};return xt(Se),Se})},H=(q,V,be="channel.load")=>{if(!B())return;const ge=Fa(Wa(q,be),V),Se={...q,recoveryError:ge};u(Ne=>{if(!B())return Ne;const we={...Ne,...T1(Se,ge,Dp(Se.rooms,F)),roomMembers:void 0,channels:Bt(Ne.channels,Se)};return xt(we),we})};if(!X.memberToken){u(q=>B()?Ks(q,X,Bt(q.channels,X)):q);return}try{const q=await T(X,F);U(X,q)}catch(q){if(!B())return;if(X.status==="archived"){u(V=>B()?{...V,status:"connected",error:wt(q),activeSpaceSlug:X.spaceSlug,channelId:X.id,channelTitle:X.title,invite:X.invite,channels:Bt(V.channels,X),rooms:X.rooms,activeRoomId:null,messages:[],members:[],presence:[],receipts:[],roomMembers:void 0,bindings:[]}:V);return}if(X.encryptionMode==="server-encrypted"&&Np(q)){let V;try{V=await C(X,h.current,{forceServerRecovery:!0})}catch(be){H(X,be,"channel.recovery");return}if(!B())return;if(V.memberToken){try{U(V,await T(V,F))}catch(be){H(V,be)}return}u(be=>B()?Ks({...be,status:"connected"},V,Bt(be.channels,V)):be);return}H(X,q)}},[d.channels,C,T]),J=y.useCallback((w,F=d.channelId)=>{if(F&&F!==d.channelId){ye(F,w);return}u(X=>{const D={...X,activeRoomId:w,messages:[],presence:[],receipts:[],roomMembers:void 0,bindings:[]};return xt(D),D})},[d.channelId,ye]),re=y.useCallback(async(w,F)=>{const X=v.current.channels.find(D=>D.id===w)??d.channels.find(D=>D.id===w);if(X){u(D=>({...D,status:"connecting",error:null}));try{const D=await C(X,{source:"pin",value:F},{forceServerRecovery:!0});if(!D.memberToken){u(U=>Ks({...U,status:"connected"},D,Bt(U.channels,D)));return}const B=await T(D);u(U=>{const H={...D,rooms:B.rooms,recoveryError:B.cryptoWarning},q={...U,status:"connected",error:B.cryptoWarning,channelId:D.id,channelTitle:D.title,invite:D.invite,activeSpaceSlug:D.spaceSlug,channels:Bt(U.channels,H),rooms:B.rooms,activeRoomId:B.activeRoomId,messages:[],members:B.members,presence:[],receipts:[],roomMembers:void 0,bindings:[]};return xt(q),q})}catch(D){u(B=>({...B,status:"error",error:wt(D)}))}}},[d.channels,C,T]),oe=y.useCallback(async(w,F)=>{const X=d.rooms.find(U=>U.id===d.activeRoomId),D=d.channels.find(U=>U.id===d.channelId);if(!D||!X)return;const B=j(D);try{D&&(await Ka(B,D),await ol({client:B,channel:D,rooms:[X]}).catch(()=>{})),await B.sendText(X,w,F),await S(X.id)}catch(U){u(H=>({...H,error:wt(U)}))}},[d.rooms,d.activeRoomId,d.channels,d.channelId,S,j]),fe=y.useCallback(async({slug:w,title:F,guidanceMarkdown:X})=>{const D=d.channels.find(U=>U.id===d.channelId);if(!D)return;const B=j(D);try{const U=await Tp(B,D);if(U)throw new Error(U);await Ka(B,D);const H=ga(X)??uh(F||w),q=await B.createRoom({channel:D,slug:ei(w||F),title:F||w,guidanceMarkdown:H}),V=al(q);await ol({client:B,channel:D,rooms:[V]}).catch(()=>{}),u(be=>{const ge=be.channels.find(we=>we.id===D.id)??D,Se=[...ge.rooms.filter(we=>we.id!==V.id),V],Ne={...be,error:null,channels:Bt(be.channels,{...ge,rooms:Se}),rooms:Se,activeRoomId:V.id,messages:[],presence:[],receipts:[],roomMembers:void 0,bindings:[]};return xt(Ne),Ne})}catch(U){throw u(H=>({...H,error:wt(U)})),U}},[d.channels,d.channelId,j]),de=y.useCallback(async(w,F)=>{const X=j(w);await Ka(X,w);try{return await F(X)}catch(D){if(w.encryptionMode!=="server-encrypted"||!Np(D))throw D;const B=await C(w,h.current,{forceServerRecovery:!0});if(u(U=>{if(!B.memberToken)return Ks(U,B,Bt(U.channels,B));const H={...U,error:B.recoveryError??null,channels:Bt(U.channels,B)};return xt(H),H}),!B.memberToken)throw new Error(B.recoveryError??wt(D));return await Ka(X,B),await F(X)}},[j,C]),G=y.useCallback(async w=>{const F=v.current.channelId,X=v.current.channels.find(D=>D.id===F);if(!(!F||!X))try{await de(X,D=>D.archiveRoom(w)),u(D=>{const B=D.rooms.filter(V=>V.id!==w),U=D.channels.find(V=>V.id===F),H=U?Bt(D.channels,{...U,rooms:B}):D.channels,q={...D,error:null,channels:H,rooms:B,activeRoomId:D.activeRoomId===w?B[0]?.id??null:D.activeRoomId,messages:D.activeRoomId===w?[]:D.messages,presence:D.activeRoomId===w?[]:D.presence,receipts:D.activeRoomId===w?[]:D.receipts,roomMembers:D.activeRoomId===w?void 0:D.roomMembers,bindings:D.activeRoomId===w?[]:D.bindings};return xt(q),q})}catch(D){throw u(B=>({...B,error:wt(D)})),D}},[de]),Q=y.useCallback(async(w,F)=>{const X=v.current.channelId,D=v.current.channels.find(B=>B.id===X);if(!(!X||!D))try{await de(D,B=>B.deleteRoom(w,{confirmSlug:F})),u(B=>{const U=B.rooms.filter(be=>be.id!==w),H=B.channels.find(be=>be.id===X),q=H?Bt(B.channels,{...H,rooms:U}):B.channels,V={...B,error:null,channels:q,rooms:U,activeRoomId:B.activeRoomId===w?U[0]?.id??null:B.activeRoomId,messages:B.activeRoomId===w?[]:B.messages,presence:B.activeRoomId===w?[]:B.presence,receipts:B.activeRoomId===w?[]:B.receipts,roomMembers:B.activeRoomId===w?void 0:B.roomMembers,bindings:B.activeRoomId===w?[]:B.bindings};return xt(V),V})}catch(B){throw u(U=>({...U,error:wt(B)})),B}},[de]),W=y.useCallback(async w=>{const F=new Set(w),X=v.current.channels.filter(H=>F.has(H.id)),D=new Map,B={succeeded:[],failed:[]};for(const H of X){if(H.status==="archived"){B.succeeded.push(H.id),D.set(H.id,H);continue}try{const q=await de(H,be=>be.archiveChannel(H.id,{updatedBy:v.current.handle??"operator"})),V={...H,title:q.title||H.title,purpose:ga(q.purpose),guidanceMarkdown:ga(q.guidanceMarkdown),status:"archived",archivedAt:q.archivedAt?String(q.archivedAt):new Date().toISOString()};D.set(H.id,V),B.succeeded.push(H.id)}catch(q){B.failed.push({id:H.id,message:wt(q)})}}const U=B.failed.length?B.failed.map(H=>H.message).join("; "):null;return u(H=>{let q=H.channels;for(const ge of D.values())q=Bt(q,ge);const V=H.channelId?D.get(H.channelId):void 0,be=V?{...H,status:"connected",error:U??ob(V),channelTitle:V.title,invite:V.invite,channels:q,rooms:V.rooms,activeRoomId:null,messages:[],members:[],presence:[],receipts:[],roomMembers:void 0,bindings:[]}:{...H,error:U,channels:q};return xt(be),be}),B},[de]),pe=y.useCallback(async w=>{const F=new Map(w.map(V=>[V.id,V])),X=v.current.channels.filter(V=>F.has(V.id)),D={succeeded:[],failed:[]};for(const V of X){const be=F.get(V.id);if(V.canDelete===!1){D.failed.push({id:V.id,message:`${V.title||V.slug} cannot be deleted`});continue}try{await de(V,ge=>ge.deleteChannel(V.id,{confirmSlug:be.confirmSlug})),db(V.id),D.succeeded.push(V.id)}catch(ge){D.failed.push({id:V.id,message:wt(ge)})}}const B=new Set(D.succeeded),U=D.failed.length?D.failed.map(V=>V.message).join("; "):null,q=!!(v.current.channelId&&B.has(v.current.channelId))?v.current.channels.find(V=>!B.has(V.id)&&!!V.memberToken)??v.current.channels.find(V=>!B.has(V.id)):void 0;return u(V=>{const be=V.channels.filter(Se=>!B.has(Se.id));if(!be.length)return Lp(),{...Hs(V.spaces,V.activeSpaceSlug),error:U};if(!V.channelId||!B.has(V.channelId)){const Se={...V,error:U,channels:be};return xt(Se),Se}const ge={...V,status:"connected",error:U,channelId:null,channelTitle:null,invite:null,channels:be,rooms:[],activeRoomId:null,messages:[],members:[],presence:[],receipts:[],roomMembers:void 0,bindings:[]};return xt(ge),ge}),q&&D.failed.length===0&&await ye(q.id),D},[de,ye]),ke=y.useCallback(async w=>{const F=await W([w]);if(F.failed.length)throw new Error(F.failed[0].message)},[W]),O=y.useCallback(async w=>{const F=d.channels.find(D=>D.id===w);if(!F)return;const X=j(F);try{await Ka(X,F);const D=await X.unarchiveChannel(w,{updatedBy:d.handle??"operator"}),B={...F,title:D.title||F.title,purpose:ga(D.purpose),guidanceMarkdown:ga(D.guidanceMarkdown),status:"active",archivedAt:null},U=await T(B);u(H=>{const q={...H,status:"connected",error:U.cryptoWarning,channelId:B.id,channelTitle:B.title,invite:B.invite,activeSpaceSlug:B.spaceSlug,channels:Bt(H.channels,{...B,rooms:U.rooms,recoveryError:U.cryptoWarning}),rooms:U.rooms,activeRoomId:U.activeRoomId,messages:[],members:U.members,presence:[],receipts:[],roomMembers:void 0,bindings:[]};return xt(q),q})}catch(D){u(B=>({...B,status:"error",error:wt(D)}))}},[d.channels,d.handle,T,j]),_=y.useCallback(async(w,F)=>{const X=await pe([{id:w,confirmSlug:F}]);if(X.failed.length)throw new Error(X.failed[0].message)},[pe]),K=y.useCallback(async w=>{const F=d.channelId,X=d.channels.find(U=>U.id===F);if(!F||!X)return;const D=j(X),B=d.members.find(U=>U.id===w);if(!B)throw new Error(`member ${w} is not in the active channel roster`);if(B.channelId!==F)throw new Error(`member ${w} belongs to channel ${B.channelId}, not active channel ${F}`);try{await Ka(D,X);const U=await D.updateMember(w,{status:"removed"});if(U.channelId!==F)throw new Error(`server returned member ${U.id} from channel ${U.channelId}, not active channel ${F}`);const H=await D.listMembers(F).catch(()=>d.members.map(q=>q.id===w?U:q));u(q=>{const V={...q,error:null,members:H};return xt(V),V})}catch(U){throw u(H=>({...H,error:wt(U)})),U}},[d.channelId,d.channels,d.members,j]),ee=y.useCallback(async()=>{const w=d.channelId,F=d.channels.find(B=>B.id===w),X=d.members.find(B=>B.handle===d.handle&&B.status!=="removed");if(!w||!F||!X)return;const D=j(F);try{await Ka(D,F),await D.updateMember(X.id,{status:"removed"}),db(w);const B=d.channels.filter(q=>q.id!==w);if(!B.length){u(q=>{const V=Hs(q.spaces,q.activeSpaceSlug);return Lp(),V});return}const U=B[0],H=await T(U);u(q=>{const V={...q,status:"connected",error:H.cryptoWarning,channelId:U.id,channelTitle:U.title,invite:U.invite,activeSpaceSlug:U.spaceSlug,channels:Bt(B,{...U,rooms:H.rooms,recoveryError:H.cryptoWarning}),rooms:H.rooms,activeRoomId:H.activeRoomId,messages:[],members:H.members,presence:[],receipts:[],roomMembers:void 0,bindings:[]};return xt(V),V})}catch(B){throw u(U=>({...U,error:wt(B)})),B}},[d.channelId,d.channels,d.handle,d.members,T,j]),ve=y.useCallback(async(w,F)=>{const X=d.activeRoomId,D=d.channels.find(U=>U.id===d.channelId);if(!X||!D)return;const B=j(D);try{await Ka(B,D),await B.http.request("PATCH",`/rooms/${X}/members/${w}`,{status:F}),await S(X)}catch(U){throw u(H=>({...H,error:wt(U)})),U}},[d.activeRoomId,d.channelId,d.channels,S,j]),se=y.useCallback(async()=>{const w=d.activeRoomId,F=d.channels.find(D=>D.id===d.channelId);if(!w||!F)return;const X=j(F);try{await Ka(X,F),await X.http.post(`/rooms/${w}/leave`),await S(w)}catch(D){throw u(B=>({...B,error:wt(D)})),D}},[d.activeRoomId,d.channelId,d.channels,S,j]),Z=y.useCallback(async w=>{const F=d.activeRoomId,X=d.channels.find(B=>B.id===d.channelId);if(!X||!F)return;const D=j(X);try{await D.ackDirective(F,w),await S(F)}catch(B){u(U=>({...U,error:wt(B)}))}},[d.activeRoomId,d.channelId,d.channels,S,j]);y.useEffect(()=>{const w=d.activeRoomId,F=d.channels.find(B=>B.id===d.channelId);if(!F||!w)return;const X=j(F);S(w),X.setPresence(w,{state:"active",note:"aops-cockpit"}).catch(()=>{});const D=window.setInterval(()=>{S(w)},5e3);return()=>window.clearInterval(D)},[d.activeRoomId,d.channelId,d.channels,S,j]);const ae=y.useCallback(w=>(d.channelId?g().getChannel(d.channelId)?.resolveMember(d.channelId,w):void 0)??d.members.find(F=>F.id===w),[d.channelId,d.members,g]),ce=(()=>{let w=0;for(const B of d.messages)B.kind==="directive"&&B.seq>w&&(w=B.seq);if(!w)return null;const F=d.members.length||d.receipts.length,X=d.receipts.filter(B=>B.ackSeq>=w).length,D=d.receipts.some(B=>B.handle===d.handle&&B.ackSeq>=w);return{seq:w,acked:X,total:F,mine:D}})();return{...d,directiveAck:ce,createSpace:L,selectSpace:R,forgetSpace:P,archiveSpace:N,refreshAdminSpaces:E,createChannel:z,joinChannel:ne,selectChannel:ye,unlockChannelWithPin:re,selectRoom:J,createRoom:fe,send:oe,archiveRoom:G,deleteRoom:Q,archiveChannels:W,deleteChannels:pe,archiveChannel:ke,unarchiveChannel:O,deleteChannel:_,removeMember:K,leaveChannel:ee,updateRoomMember:ve,leaveRoom:se,ackDirective:Z,resolveMember:ae}}function RA(e){if(!e.trim())throw new Error("agent_wake_member_token_required");return{"x-chatv3-member-token":e}}async function LA(e){const n=await e.json();if(!n||typeof n!="object"||Array.isArray(n))throw new Error("agent_wake_response_invalid");if(!e.ok){const r=n.code,i=typeof r=="string"?r:`agent_wake_http_${e.status}`;throw new Error(i)}return n}async function vE(e,n,r=fetch){const i=await LA(await r("/_aops/agent-wake/capability",{method:"POST",credentials:"same-origin",cache:"no-store",headers:{"content-type":"application/json",...RA(n)},body:JSON.stringify(e)})),o=i.capability;if(!o||typeof o!="object"||Array.isArray(o))throw new Error("agent_wake_capability_invalid");const d=i.grant;return{capability:o,grant:d&&typeof d=="object"&&!Array.isArray(d)?d:null}}async function gE(e,n,r,i,o=fetch){const d=await LA(await o("/_aops/agent-wake",{method:"POST",credentials:"same-origin",cache:"no-store",headers:{"content-type":"application/json","x-aops-agent-wake-grant":r.value,...RA(i)},body:JSON.stringify({...e,prompt:n})}));return{code:typeof d.code=="string"?d.code:"wake_sent",targetSessionIdHash:typeof d.targetSessionIdHash=="string"?d.targetSessionIdHash:void 0,turnId:typeof d.turnId=="string"||d.turnId===null?d.turnId:void 0}}const pb=["var(--coral)","var(--sage)","var(--indigo)","var(--amber)","var(--claret)"];function ys(e){let n=0;for(let r=0;r<e.length;r++)n=n*31+e.charCodeAt(r)>>>0;return pb[n%pb.length]}function ti(e){const n=e.replace(/^@/,"").trim(),r=n.split(/[\s._-]+/).filter(Boolean);return r.length>=2?`${r[0][0]??""}${r[1][0]??""}`.toUpperCase():(n.slice(0,2)||"?").toUpperCase()}const yE={message:"chatKindMessage",directive:"chatKindDirective",question:"chatKindQuestion",decision:"chatKindDecision",status:"chatKindStatus"},bE=300*1e3;function nl(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`}function jE(e){return e==="tr"?"tr-TR":"en-US"}function hb(e){return e==="directive"?"is-directive":e==="status"||e==="handoff"?"is-status":e==="question"||e==="decision"||e==="answer"?"is-decision":"is-neutral"}function mb(e,n,r){const i=yE[e];return(i?r(i):e).toLocaleUpperCase(n)}function AE({messages:e,resolveMember:n,receipts:r=[],myHandle:i,roomLabel:o,directiveAck:d,onAckDirective:u,locale:v,t:h}){const m=jE(v),[g,b]=y.useState(null),j=I=>{const E=new Date,L=nl(E),P=nl(new Date(E.getFullYear(),E.getMonth(),E.getDate()-1)),N=nl(I),R=I.toLocaleDateString(m,{day:"numeric",month:"short"});return N===L?`${h("chatDayToday")} · ${R}`:N===P?`${h("chatDayYesterday")} · ${R}`:R},C=I=>I.toLocaleTimeString(m,{hour:"2-digit",minute:"2-digit"});y.useEffect(()=>{if(g==null)return;const I=window.setTimeout(()=>b(null),1200);return()=>window.clearTimeout(I)},[g]);const k=I=>{const E=`chatv3:${o||"room"}#${I}`;navigator.clipboard?.writeText(E).then(()=>b(I)).catch(()=>{})},x=I=>a.jsxs("button",{type:"button",className:`aops-v2-msg-seq${g===I?" is-copied":""}`,onClick:()=>k(I),title:h(g===I?"chatCopied":"chatCopyRef"),"aria-label":h("chatCopyRef"),children:["#",I]});if(e.length===0)return a.jsx("div",{className:"aops-v2-msg-empty",children:h("chatEmpty")});const S=i?r.find(I=>I.handle===i)?.lastReadSeq:void 0,T=S==null?null:e.find(I=>I.seq>S)?.seq??null;return a.jsx("div",{className:"aops-v2-msg-timeline",children:e.map((I,E)=>{const L=n(I.senderMemberId),P=L?.handle??I.senderMemberId.slice(0,8),N=new Date(I.createdAt),R=e[E-1],z=R?new Date(R.createdAt):null,ne=!z||nl(z)!==nl(N),ye=!ne&&!!R&&R.senderMemberId===I.senderMemberId&&N.getTime()-z.getTime()<bE,J=!!i&&L?.handle===i,re=I.text==="[locked]",oe=r.filter(Q=>Q.memberId!==I.senderMemberId),fe=oe.filter(Q=>Q.lastReadSeq>=I.seq).map(Q=>Q.handle),de=oe.filter(Q=>Q.lastReadSeq<I.seq&&Q.deliveredSeq>=I.seq).map(Q=>Q.handle),G=I.kind==="directive"&&!!d&&d.seq===I.seq;return a.jsxs("div",{children:[ne&&a.jsx("div",{className:"aops-v2-msg-daybar",children:j(N)}),T===I.seq&&a.jsx("div",{className:"aops-v2-msg-unreadbar",children:h("chatUnreadDivider")}),a.jsxs("div",{className:`aops-v2-msg${J?" is-mine":""}${ye?" is-grouped":""}${I.kind!=="message"?` is-kind-${I.kind}`:""}`,children:[a.jsx("span",{className:"aops-v2-msg-seqcol",children:x(I.seq)}),ye?a.jsx("span",{className:"aops-v2-msg-gutter","aria-hidden":!0}):a.jsx("span",{className:"aops-v2-msg-avatar",style:{background:ys(P)},"aria-hidden":!0,children:ti(P)}),a.jsxs("div",{className:"aops-v2-msg-body",children:[!ye&&a.jsxs("div",{className:"aops-v2-msg-head",children:[a.jsx("span",{className:"aops-v2-msg-handle",style:{color:ys(P)},children:P}),L?.actorKind&&L.actorKind!=="human"&&a.jsx("span",{className:"aops-v2-msg-tag is-agent",children:L.actorKind.toLocaleUpperCase(m)}),I.kind!=="message"&&a.jsx("span",{className:`aops-v2-msg-tag ${hb(I.kind)}`,children:mb(I.kind,m,h)}),J&&a.jsx("span",{className:"aops-v2-msg-tag is-you",children:h("chatYou").toLocaleUpperCase(m)}),a.jsx("span",{className:"aops-v2-msg-head-spacer","aria-hidden":!0}),a.jsx("span",{className:"aops-v2-msg-time",children:C(N)})]}),ye&&a.jsxs("div",{className:"aops-v2-msg-minihead",children:[I.kind!=="message"&&a.jsx("span",{className:`aops-v2-msg-tag ${hb(I.kind)}`,children:mb(I.kind,m,h)}),J&&a.jsx("span",{className:"aops-v2-msg-tag is-you",children:h("chatYou").toLocaleUpperCase(m)}),a.jsx("span",{className:"aops-v2-msg-head-spacer","aria-hidden":!0}),a.jsx("span",{className:"aops-v2-msg-time",children:C(N)})]}),a.jsx("div",{className:`aops-v2-msg-text${re?" is-locked":""}`,children:re?h("chatLockedHint"):I.text}),G&&d&&a.jsx("div",{className:"aops-v2-msg-ack",children:d.mine?a.jsxs("span",{className:"aops-v2-msg-ack-done",children:["✓ ",h("chatAcknowledged")," · ",d.acked,"/",d.total]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"aops-v2-msg-ack-btn",onClick:()=>u?.(I.seq),children:[h("chatAckShort")," ",d.acked,"/",d.total]}),a.jsxs("span",{className:"aops-v2-msg-ack-note",children:["· ",h("chatActivityPending")]})]})}),fe.length>0&&a.jsxs("div",{className:"aops-v2-msg-receipt",children:["✓✓ ",h("chatRead")," · ",fe.join(", ")]}),de.length>0&&a.jsxs("div",{className:"aops-v2-msg-receipt is-delivered",children:["✓ ",h("chatDelivered")," · ",de.join(", ")]})]})]})]},I.seq)})})}function ai({mode:e,compact:n=!1,t:r}){return e!=="e2e"?null:a.jsx("span",{className:`aops-v2-chat-e2e-badge${n?" is-compact":""}`,title:r("chatEncryptionE2eHint"),"aria-label":r("chatEncryptionE2e"),"data-encryption-mode":"e2e",children:r("chatEncryptionE2eShort")})}const Op=[{id:"message",key:"chatKindMessage"},{id:"directive",key:"chatKindDirective"},{id:"question",key:"chatKindQuestion"},{id:"decision",key:"chatKindDecision"},{id:"status",key:"chatKindStatus"}];function xE({disabled:e,encryptionMode:n,onSend:r,t:i}){const[o,d]=y.useState(""),[u,v]=y.useState("message"),[h,m]=y.useState(!1),g=y.useRef(null);y.useEffect(()=>{if(!h)return;const C=x=>{g.current?.contains(x.target)||m(!1)},k=x=>{x.key==="Escape"&&m(!1)};return document.addEventListener("pointerdown",C),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",C),document.removeEventListener("keydown",k)}},[h]);const b=()=>{const C=o.trim();!C||e||(d(""),r(C,u))},j=Op.find(C=>C.id===u)??Op[0];return a.jsx("div",{className:`aops-v2-composer${e?" is-disabled":""}`,children:a.jsxs("div",{className:"aops-v2-composer-bar",children:[a.jsxs("div",{className:"aops-v2-composer-kindwrap",ref:g,children:[a.jsxs("button",{type:"button",className:"aops-v2-composer-kind","aria-label":i("chatComposerKindLabel"),"aria-haspopup":"menu","aria-expanded":h,disabled:e,onClick:()=>m(C=>!C),children:[i(j.key),a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})]}),h?a.jsx("div",{className:"aops-v2-composer-kindmenu",role:"menu",children:Op.map(C=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":u===C.id,className:u===C.id?"is-active":"",onClick:()=>{v(C.id),m(!1)},children:i(C.key)},C.id))}):null]}),a.jsx("span",{className:"aops-v2-composer-prompt","aria-hidden":!0,children:"›"}),a.jsx("textarea",{className:"aops-v2-composer-box",value:o,disabled:e,onChange:C=>d(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())},placeholder:i("chatComposerPlaceholder"),rows:1}),a.jsx(ai,{mode:n,compact:!0,t:i}),a.jsx("kbd",{className:"aops-v2-composer-hint","aria-hidden":!0,children:"⌘↵"}),a.jsx("button",{type:"button",className:"aops-v2-composer-send",onClick:b,disabled:e,"aria-label":i("chatComposerSend"),title:i("chatComposerSend"),children:a.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:"M3 10l14-6-4 14-3-5-7-3z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round",strokeLinecap:"round",fill:"currentColor",fillOpacity:"0.12"})})})]})})}const CE={"server-key":{titleKey:"chatErrorServerKeyTitle",messageKey:"chatErrorServerKeyMessage",actionKey:"chatErrorServerKeyAction",retryable:!0},service:{titleKey:"chatErrorServiceTitle",messageKey:"chatErrorServiceMessage",actionKey:"chatErrorServiceAction",retryable:!0},network:{titleKey:"chatErrorNetworkTitle",messageKey:"chatErrorNetworkMessage",actionKey:"chatErrorNetworkAction",retryable:!0},"rate-limit":{titleKey:"chatErrorRateLimitTitle",messageKey:"chatErrorRateLimitMessage",actionKey:"chatErrorRateLimitAction",retryable:!0},busy:{titleKey:"chatErrorBusyTitle",messageKey:"chatErrorBusyMessage",actionKey:"chatErrorBusyAction",retryable:!0},membership:{titleKey:"chatErrorMembershipTitle",messageKey:"chatErrorMembershipMessage",actionKey:"chatErrorMembershipAction",retryable:!1},access:{titleKey:"chatErrorAccessTitle",messageKey:"chatErrorAccessMessage",actionKey:"chatErrorAccessAction",retryable:!1},"client-key":{titleKey:"chatErrorClientKeyTitle",messageKey:"chatErrorClientKeyMessage",actionKey:"chatErrorClientKeyAction",retryable:!1},unknown:{titleKey:"chatErrorUnknownTitle",messageKey:"chatErrorUnknownMessage",actionKey:"chatErrorUnknownAction",retryable:!0}};function sl(e,n){return new RegExp(`(?:\\bhttp(?:\\s+status)?(?:\\s*[:=]\\s*|\\s+)${n}\\b|\\bstatus\\s*[:=]\\s*${n}\\b)`).test(e)}function kE(e,n={}){const r=e.trim().toLowerCase();if(/server_keyring_lock_busy/.test(r)||sl(r,423)||/(migration advisory lock|operation (?:is )?(?:busy|locked)|concurrent operation|already in progress)/.test(r))return"busy";if(/server_key_(?:adoption_required|unavailable|authentication_failed)/.test(r)||/server_keyring_invalid/.test(r))return"server-key";if(/(wrapsecret|wrap secret|wrapped epoch|local channel crypto|channel crypto material|\[locked\]|locked \(no key\))/.test(r)||/(?:missing|no) (?:local )?(?:epoch )?(?:encryption )?key/.test(r)||/(?:failed|unable|cannot) to (?:unwrap|decrypt)/.test(r))return n.encryptionMode==="server-encrypted"?"server-key":"client-key";if(/(member token (?:mismatch|required|unknown|not found)|unknown member token|invalid member token format|membership is not active)/.test(r)||/principal-bound membership required/.test(r))return"membership";if(/(failed to fetch|fetch failed|networkerror|network error|econnrefused|econnreset|enotfound)/.test(r)||/(?:server|host) (?:is )?(?:unreachable|cannot be reached)/.test(r))return"network";if(sl(r,429)||/(rate[_ -]?limit|too many requests)/.test(r))return"rate-limit";if(sl(r,503)||/(service[_ -]unavailable|runtime operation failed|temporarily unavailable)/.test(r))return"service";if(/server-encrypted\.member-token/.test(r))return"membership";if(sl(r,401)||sl(r,403)||/(unauthorized|forbidden|verified authv2 principal required)/.test(r))return"access";if(/server-encrypted\.(?:epoch-keys|keyring)/.test(r)||/server[- ]managed.*(?:epoch|key)/.test(r))return"server-key";if(/(?:epoch|encryption) key.*(?:keyring|unwrap|unseal|decrypt|load)/.test(r)){if(n.encryptionMode==="server-encrypted")return"server-key";if(n.encryptionMode==="e2e")return"client-key"}return"unknown"}function SE(e,n={}){const r=kE(e,n);return{kind:r,...CE[r]}}function wE(e){return e.replace(/\b([a-z][a-z0-9+.-]*):\/\/[^@\s/]+@/gi,"$1://[redacted]@").replace(/\bchv3:\/\/join\/[^\s"'<>]+/gi,"chv3://join/[redacted]").replace(/\bBearer\s+[a-z0-9._~+\/=-]+/gi,"Bearer [redacted]").replace(/\bcv3m_[a-z0-9_-]+\b/gi,"cv3m_[redacted]").replace(/([?&](?:token|memberToken|accessSecret|wrapSecret|password)=)[^&#\s]+/gi,"$1[redacted]").replace(/(["'])(accessSecret|wrapSecret|memberToken|password)\1(\s*:\s*)(["'])(?:\\.|(?!\4)[^\\])*(?:\4|$)/gi,(n,r,i,o,d)=>`${r}${i}${r}${o}${d}[redacted]${d}`).replace(/\b(accessSecret|wrapSecret|memberToken|password)\b\s*[:=]\s*("[^"]*"|'[^']*'|[^\s,}]+)/gi,"$1=[redacted]").slice(0,4e3)}function zc({error:e,compact:n=!1,encryptionMode:r,onRetry:i,t:o}){const d=SE(e,{encryptionMode:r}),u=d.retryable&&!!i;return a.jsxs("section",{className:`aops-v2-chat-error-notice${n?" is-compact":""}`,"data-error-kind":d.kind,role:"alert",children:[a.jsx("span",{className:"aops-v2-chat-error-mark","aria-hidden":"true",children:"!"}),a.jsxs("div",{className:"aops-v2-chat-error-copy",children:[a.jsx("strong",{children:o(d.titleKey)}),a.jsx("p",{children:o(d.messageKey)}),a.jsxs("p",{className:"aops-v2-chat-error-action",children:[a.jsx("b",{children:o("chatErrorNextStepLabel")})," ",o(d.actionKey)]}),a.jsxs("details",{className:"aops-v2-chat-error-details",children:[a.jsx("summary",{children:o("chatErrorTechnicalDetails")}),a.jsx("code",{children:wE(e)})]})]}),u?a.jsx("button",{type:"button",className:"aops-v2-secondary-button aops-v2-chat-error-retry",onClick:i,children:o("chatErrorRetry")}):null]})}function NE(e){switch(e){case"connecting":return"chatStatusConnecting";case"connected":return"chatStatusConnected";case"error":return"chatStatusError";default:return"chatStatusIdle"}}function IE(){return a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("circle",{cx:"11",cy:"11",r:"6.5",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m16 16 4.5 4.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function EE(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:a.jsx("path",{d:"M6 6l12 12M18 6 6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function fb({checked:e=!1}){return a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("rect",{x:"2.25",y:"2.25",width:"11.5",height:"11.5",rx:"3",stroke:"currentColor",strokeWidth:"1.5"}),e?a.jsx("path",{d:"m4.8 8 2 2 4.4-4.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"}):null]})}function ME(){return a.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",children:a.jsx("path",{d:"M2.4 4.3h11.2v8.5H2.4zM1.8 2.2h12.4v2.2H1.8zM6 7h4",stroke:"currentColor",strokeWidth:"1.35",strokeLinejoin:"round",strokeLinecap:"round"})})}function TE(){return a.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",children:a.jsx("path",{d:"M3.5 4.3h9M6 4.3V2.8h4v1.5m1.5 0-.6 9H5.1l-.6-9M6.6 6.5v4.8m2.8-4.8v4.8",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function OA(){return a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function _A(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function BE(){return a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("circle",{cx:"3.5",cy:"8",r:"1.25",fill:"currentColor"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.25",fill:"currentColor"}),a.jsx("circle",{cx:"12.5",cy:"8",r:"1.25",fill:"currentColor"})]})}function DE({model:e,navigator:n,locale:r,t:i}){const o=ii().viewport==="mobile",[d,u]=y.useState(!1),[v,h]=y.useState("create"),[m,g]=y.useState(!1),[b,j]=y.useState(o&&!e.activeRoomId),C=y.useRef(null),k=y.useRef(null),x=(z=!0)=>{j(!1),z&&window.requestAnimationFrame(()=>C.current?.focus())},S=()=>{j(!0),window.requestAnimationFrame(()=>document.querySelector(".aops-v2-chat-console-nav button")?.focus())};y.useEffect(()=>{if(!b)return;const z=ne=>{ne.key==="Escape"&&(ne.preventDefault(),x())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[b]);const T=(z="create")=>{h(z),u(!0)};y.useEffect(()=>{e.refreshAdminSpaces()},[]);const I=e.activeRoomId?e.rooms.find(z=>z.id===e.activeRoomId)??null:null,E=e.channelId?e.channels.find(z=>z.id===e.channelId)??null:null,L=E&&E.status!=="archived"&&!E.memberToken&&!E.localCryptoAvailable?E:null,P=e.channels.length>0,N=e.channels.reduce((z,ne)=>z+(ne.rooms?.length??0),0)||e.rooms.length;let R=null;return L?R=a.jsx(_E,{channel:L,model:e,t:i,onPasteInvite:()=>T("join")}):e.channelId?R=a.jsx(it,{variant:"empty",title:i("chatNoRoomTitle"),message:i("chatNoRoomMessage")}):R=a.jsx(it,{variant:"empty",title:i(P?"chatConnectTitle":"chatConnectPanelTitle"),message:i("chatConnectMessage"),actions:P?void 0:a.jsxs("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>T("create"),children:["+ ",i("chatNewChannel")]})}),a.jsxs("div",{className:"aops-v2-chat-console-page","data-mobile-navigator-open":b?"true":"false","data-side-panel-open":n.controller.open?"true":"false",children:[e.error&&e.error!==L?.recoveryError?a.jsx(zc,{error:e.error,encryptionMode:E?.encryptionMode,t:i,onRetry:e.channelId?()=>{const z=e.channelId;z&&e.selectChannel(z,e.activeRoomId)}:void 0}):null,a.jsx(RE,{status:e.status,channelCount:e.channels.length,roomCount:N,canCreateRoom:!!e.channelId,onCreateChannel:()=>T("create"),onCreateRoom:()=>g(!0),onOpenNavigator:S,sidePanelOpen:n.controller.open,onToggleSidePanel:()=>n.controller.setOpen(z=>!z),navigatorTriggerRef:C,t:i}),n.bulkDialog,a.jsxs("div",{className:"aops-v2-chat-console-shell",children:[a.jsx("button",{type:"button",className:"aops-v2-chat-mobile-nav-backdrop","aria-label":i("chatBackToChannels"),"aria-hidden":b?void 0:!0,tabIndex:b?0:-1,onClick:()=>x()}),a.jsx(LE,{model:e,navigator:n,t:i,onCreateChannel:()=>T("create"),onJoinChannel:()=>T("join"),onClose:()=>{o?x():n.controller.setOpen(!1)},onSelectRoom:(z,ne)=>{e.selectRoom(z,ne),o&&(x(!1),window.requestAnimationFrame(()=>k.current?.focus()))}}),a.jsx("main",{ref:k,className:"aops-v2-chat-console-main","aria-label":i("chatActiveRoom"),tabIndex:-1,children:I?a.jsx(QE,{model:e,locale:r,t:i,onBackToNavigator:S}):a.jsx("div",{className:"aops-v2-chat-detail-only",children:R})})]}),d?a.jsx(JE,{model:e,t:i,initialMode:v,onClose:()=>u(!1)}):null,m&&e.channelId?a.jsx(qE,{model:e,t:i,onClose:()=>g(!1)}):null]})}function RE({status:e,channelCount:n,roomCount:r,canCreateRoom:i,onCreateChannel:o,onCreateRoom:d,onOpenNavigator:u,sidePanelOpen:v,onToggleSidePanel:h,navigatorTriggerRef:m,t:g}){return a.jsxs("div",{className:"aops-v2-chat-console-toolbar",children:[a.jsx("button",{type:"button",className:"aops-v2-chat-side-nav-trigger",onClick:h,"aria-label":g(v?"navSidePanelHide":"navSidePanelShow"),title:g(v?"navSidePanelHide":"navSidePanelShow"),"aria-pressed":v,"aria-expanded":v,"data-testid":"aops-v2-chat-side-panel-toggle",children:a.jsx(Rj,{kind:"side-panel",panelOpen:v})}),a.jsx("button",{ref:m,type:"button",className:"aops-v2-chat-mobile-nav-trigger",onClick:u,"aria-label":g("chatNavReopen"),"data-testid":"chat-mobile-navigator-trigger",children:a.jsx("span",{"aria-hidden":!0,children:"☰"})}),a.jsx("span",{className:`aops-v2-chat-console-status is-${e}`,children:g(NE(e))}),a.jsxs("span",{className:"aops-v2-chat-console-metric",children:[g("chatChannelsLabel"),": ",a.jsx("b",{children:n})]}),a.jsxs("span",{className:"aops-v2-chat-console-metric",children:[g("chatRoomsLabel"),": ",a.jsx("b",{children:r})]}),a.jsx("span",{className:"aops-v2-chat-console-spacer","aria-hidden":!0}),a.jsxs("button",{type:"button",className:"aops-v2-chat-console-new",onClick:o,children:["+ ",g("chatNewChannel")]}),a.jsxs("button",{type:"button",className:"aops-v2-chat-console-new is-secondary",disabled:!i,onClick:d,children:["+ ",g("chatNewRoom")]})]})}function LE({model:e,navigator:n,t:r,onCreateChannel:i,onJoinChannel:o,onClose:d,onSelectRoom:u}){const v=n.searchValue.trim().toLocaleLowerCase(),h=e.channels.map(m=>{const g=OE(e,m),b=`${m.title} ${m.slug}`.toLocaleLowerCase(),j=v?g.filter(k=>`${k.title} ${k.slug}`.toLocaleLowerCase().includes(v)):g;return!v||b.includes(v)||j.length>0?{channel:m,rooms:j.length?j:g}:null}).filter(m=>!!m);return a.jsxs("aside",{className:"aops-v2-chat-console-nav","aria-label":r("chatNavPanelTitle"),children:[a.jsxs("div",{className:"aops-v2-chat-console-navhead",children:[a.jsxs("span",{children:[r("chatChannelsLabel")," ",a.jsx("b",{children:e.channels.length})]}),a.jsxs("span",{className:"aops-v2-chat-console-navhead-actions",children:[a.jsx("button",{type:"button",className:`aops-v2-chat-console-select-toggle${n.selectionMode?" is-active":""}`,"aria-label":n.selectionMode?r("chatSelectionDone"):r("chatSelectChats"),title:n.selectionMode?r("chatSelectionDone"):r("chatSelectChats"),"aria-pressed":n.selectionMode,disabled:n.bulkBusy,onClick:n.selectionMode?n.exitSelectionMode:n.enterSelectionMode,"data-testid":"aops-v2-chat-selection-toggle",children:a.jsx(fb,{checked:n.selectionMode})}),a.jsx("button",{type:"button",className:"aops-v2-chat-console-navgear","aria-label":r("navSidePanelClose"),title:r("navSidePanelClose"),onClick:d,"data-testid":"aops-v2-chat-console-nav-close",children:a.jsx(Qc,{})})]})]}),a.jsxs("label",{className:"aops-v2-chat-console-search",children:[a.jsx("span",{children:IE()}),a.jsx("input",{type:"search",value:n.searchValue,onChange:m=>n.onSearchChange(m.currentTarget.value),placeholder:r("chatSearchPlaceholder"),"aria-label":r("chatSearchPlaceholder")}),n.searchValue?a.jsx("button",{type:"button","aria-label":"Clear chat search",title:"Clear chat search",onClick:()=>n.onSearchChange(""),children:EE()}):null]}),n.selectionMode?a.jsxs("div",{className:"aops-v2-chat-console-bulkbar",children:[a.jsx("button",{type:"button",className:"aops-v2-chat-console-bulk-all",disabled:!e.channels.length||n.bulkBusy,onClick:n.selectAllChannels,children:r("chatSelectAll")}),a.jsxs("span",{className:"aops-v2-chat-console-bulk-count","aria-live":"polite",children:[n.selectedChannelCount," ",r("chatSelected")]}),a.jsx("span",{className:"aops-v2-chat-console-bulk-spacer"}),a.jsx("button",{type:"button",className:"aops-v2-chat-console-bulk-action",disabled:!n.selectedChannelCount||n.bulkBusy,title:r("chatArchiveSelected"),"aria-label":r("chatArchiveSelected"),onClick:()=>n.requestBulkAction("archive"),"data-testid":"aops-v2-chat-bulk-archive",children:a.jsx(ME,{})}),a.jsx("button",{type:"button",className:"aops-v2-chat-console-bulk-action is-danger",disabled:!n.selectedChannelCount||n.selectedDeleteBlocked||n.bulkBusy,title:n.selectedDeleteBlocked?r("chatBulkDeleteBlocked"):r("chatDeleteSelected"),"aria-label":r("chatDeleteSelected"),onClick:()=>n.requestBulkAction("delete"),"data-testid":"aops-v2-chat-bulk-delete",children:a.jsx(TE,{})})]}):null,n.bulkError?a.jsx(zc,{error:n.bulkError,compact:!0,t:r}):null,a.jsx("div",{className:"aops-v2-chat-console-navlist",children:h.length?h.map(({channel:m,rooms:g})=>a.jsxs("div",{className:`aops-v2-chat-console-channel${m.id===e.channelId?" is-active":""}${m.status==="archived"?" is-archived":""}${n.selectedChannelIds.has(m.id)?" is-selected":""}`,children:[a.jsxs("button",{type:"button",className:"aops-v2-chat-console-channelbtn",onClick:()=>n.selectionMode?n.toggleChannelSelection(m.id):void e.selectChannel(m.id),role:n.selectionMode?"checkbox":void 0,"aria-checked":n.selectionMode?n.selectedChannelIds.has(m.id):void 0,"aria-expanded":n.selectionMode?void 0:m.id===e.channelId||!!v,"data-testid":n.selectionMode?`aops-v2-chat-select-${m.id}`:void 0,children:[n.selectionMode?a.jsx("span",{className:"aops-v2-chat-console-selectbox",children:a.jsx(fb,{checked:n.selectedChannelIds.has(m.id)})}):null,a.jsx("span",{className:"aops-v2-chat-console-channelavatar",style:{background:ys(m.id||m.slug)},children:ti(m.title||m.slug)}),a.jsx("span",{className:"aops-v2-chat-console-channelname",title:m.title||m.slug,children:m.title||m.slug}),a.jsx(ai,{mode:m.encryptionMode,compact:!0,t:r}),a.jsx("span",{className:"aops-v2-chat-console-count",children:g.length})]}),!n.selectionMode&&(m.id===e.channelId||v)?a.jsx("div",{className:"aops-v2-chat-console-rooms",children:g.map(b=>a.jsxs("button",{type:"button",className:`aops-v2-chat-console-roombtn${b.id===e.activeRoomId?" is-active":""}`,onClick:()=>u(b.id,m.id),children:[a.jsx("span",{"aria-hidden":!0,children:"#"}),a.jsx("span",{className:"aops-v2-chat-console-roomname",title:b.title||b.slug,children:b.title||b.slug}),a.jsx(ai,{mode:m.encryptionMode,compact:!0,t:r})]},b.id))}):null]},m.id)):a.jsxs("div",{className:"aops-v2-chat-console-navempty",children:[a.jsx("span",{children:r(v?"chatNoChannelsSearch":"chatNoChannelsNav")}),a.jsx("button",{type:"button",onClick:i,children:r("chatNewChannel")}),a.jsx("button",{type:"button",onClick:o,children:r("chatJoinChannel")})]})})]})}function OE(e,n){return n.id===e.channelId&&e.rooms.length?e.rooms:n.rooms??[]}function _E({channel:e,model:n,t:r,onPasteInvite:i}){const[o,d]=y.useState(""),[u,v]=y.useState(!1),h=e.recoveryState==="locked-needs-pin",m=e.encryptionMode==="server-encrypted"&&!e.recoveryState&&!!e.recoveryError,g=o.trim().length===0?r("chatRecoveryPinRequired"):null,b=!!(g&&u),j=e.recoveryError?a.jsx(zc,{error:e.recoveryError,compact:!0,encryptionMode:e.encryptionMode,t:r,onRetry:m?()=>{n.selectChannel(e.id)}:void 0}):null,C=()=>{v(!0),!g&&n.unlockChannelWithPin(e.id,o)};return m?a.jsx("div",{className:"aops-v2-chat-retry-state",children:j}):h?a.jsx(it,{variant:"empty",title:r("chatChannelPinLockedTitle"),message:r("chatChannelPinLockedMessage"),actions:a.jsxs(a.Fragment,{children:[j,a.jsxs("form",{className:"aops-v2-chat-unlock-form",onSubmit:k=>{k.preventDefault(),C()},noValidate:!0,children:[a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsx("span",{children:r("chatRecoveryPinLabel")}),a.jsx("input",{type:"password",value:o,autoComplete:"off","aria-invalid":b,"aria-describedby":b?"aops-chat-pin-error":void 0,onChange:k=>d(k.currentTarget.value)}),b?a.jsx("span",{className:"aops-field-error",id:"aops-chat-pin-error",children:g}):null]}),a.jsxs("div",{className:"aops-v2-chat-connect-actions",children:[a.jsx("button",{type:"submit",className:"aops-v2-primary-button",children:r("chatUnlockWithPin")}),a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:i,children:r("chatPasteInvite")})]})]})]})}):e.recoveryState==="stale-needs-current-device"?a.jsx(it,{variant:"empty",title:r("chatChannelStaleTitle"),message:r("chatChannelStaleMessage"),actions:a.jsxs(a.Fragment,{children:[j,a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:i,children:r("chatPasteInvite")})]})}):e.recoveryState==="recoverable"?a.jsx(it,{variant:"empty",title:r("chatChannelRecoverableTitle"),message:r("chatChannelRecoverableMessage"),actions:a.jsxs(a.Fragment,{children:[j,a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:i,children:r("chatPasteInvite")})]})}):a.jsx(it,{variant:"empty",title:r("chatChannelLockedTitle"),message:r("chatChannelLockedMessage"),actions:a.jsxs(a.Fragment,{children:[j,a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:i,children:r("chatPasteInvite")})]})})}function em({title:e,closeLabel:n,onClose:r,size:i,children:o}){return y.useEffect(()=>{const d=u=>{u.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[r]),a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",onClick:r,children:a.jsxs("div",{className:`aops-v2-chat-modal${i==="sm"?" aops-v2-chat-modal-sm":""}`,role:"dialog","aria-modal":"true","aria-label":e,onClick:d=>d.stopPropagation(),children:[a.jsxs("header",{className:"aops-v2-chat-modal-head",children:[a.jsx("h4",{children:e}),a.jsx("button",{type:"button",className:"aops-v2-chat-iconclose","aria-label":n,onClick:r,children:"✕"})]}),a.jsx("div",{className:"aops-v2-chat-modal-body",children:o})]})})}function QE({model:e,locale:n,t:r,onBackToNavigator:i}){const[o,d]=y.useState("messages"),[u,v]=y.useState(!1),[h,m]=y.useState(null),g=y.useRef(null),b=y.useRef(null),[j,C]=y.useState(()=>PE()),[k,x]=y.useState(!1),[S,T]=y.useState(!1),I=e.rooms.find(de=>de.id===e.activeRoomId)??null,E=e.channels.find(de=>de.id===e.channelId)??null,L=!!e.invite,P=e.messages.length;if(y.useLayoutEffect(()=>{if(o!=="messages"){b.current=null;return}const de=g.current;if(!de||!e.activeRoomId)return;const G=`${e.activeRoomId}`;b.current!==G&&P>0&&(de.scrollTop=de.scrollHeight,b.current=G)},[e.activeRoomId,P,o]),y.useEffect(()=>{if(!k)return;const de=window.setTimeout(()=>x(!1),1200);return()=>window.clearTimeout(de)},[k]),!I)return null;const N=E?.guidanceMarkdown?.trim()||"",R=I.guidanceMarkdown?.trim()||"",z=UA(e),ne=z.filter(de=>Vs(de.state)).length,ye=e.channelTitle||E?.title||E?.slug||r("chatChannelSection"),J=I.title||I.slug,re=I.title||I.slug,oe=async()=>{if(!(S||!L)){T(!0);try{const de=e.invite;if(!de)return;if(!navigator.clipboard?.writeText)throw new Error("Clipboard API is unavailable");await navigator.clipboard.writeText(de),x(!0)}catch{}finally{T(!1)}}},fe=[{id:"messages",label:r("chatTabMessages"),count:P||null},{id:"members",label:r("chatTabMembers"),count:e.members.length||null},{id:"references",label:r("chatTabReferences"),count:e.bindings.length||null},{id:"rules",label:r("chatTabRules")},{id:"activity",label:r("chatTabActivity")}];return a.jsxs("section",{className:"aops-v2-chat-record","aria-label":r("chatActiveRoom"),children:[a.jsxs("header",{className:"aops-v2-chat-rechead",children:[a.jsx("button",{type:"button",className:"aops-v2-chat-mobile-back",onClick:i,"aria-label":r("chatBackToChannels"),children:a.jsx("span",{"aria-hidden":!0,children:"←"})}),a.jsxs("div",{className:"aops-v2-chat-rechead-id",children:[a.jsxs("h3",{className:"aops-v2-chat-rechead-path",title:re,children:[a.jsx("span",{className:"aops-v2-chat-rechead-eyebrow",children:ye}),a.jsx("span",{className:"aops-v2-chat-rechead-sep",children:" / "}),a.jsx("span",{className:"aops-v2-chat-rechead-hash",children:"#"}),a.jsx("span",{className:"aops-v2-chat-rechead-room",children:J})]}),a.jsxs("div",{className:"aops-v2-chat-rechead-chips","aria-label":r("chatActiveRoom"),children:[a.jsx(ai,{mode:E?.encryptionMode,t:r}),a.jsxs("span",{className:"aops-v2-chat-headchip is-epoch",children:[r("chatEpochShort")," ",I.currentEpoch]})]})]}),a.jsxs("div",{className:"aops-v2-chat-rechead-summary","aria-label":r("chatMembersOnline"),children:[a.jsxs("span",{children:[z.length," ",r("chatTabMembers")]}),a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsxs("span",{children:[a.jsx("b",{children:ne})," ",r("chatPresenceOnline")]})]}),a.jsxs("div",{className:"aops-v2-chat-rechead-actions",children:[a.jsx("button",{type:"button",className:`aops-v2-chat-copybtn${k?" is-copied":""}`,disabled:!L||S,"data-state":k?"copied":S?"busy":"idle","aria-label":r(k?"chatInviteCopied":"chatCopyInvite"),title:k?r("chatInviteCopied"):e.invite?r("chatCopyInvite"):r("chatInviteUnavailable"),onClick:()=>{oe()},children:k?_A():OA()}),a.jsx(GE,{open:u,onToggle:()=>v(de=>!de),onClose:()=>v(!1),isGeneralRoom:I.slug==="general",channelArchived:E?.status==="archived",canDeleteChannel:E?.canDelete??!0,invite:e.invite,inviteCopied:k,inviteCopyBusy:S,t:r,onCopyInvite:()=>{oe()},onArchiveRoom:()=>{v(!1),e.archiveRoom(I.id)},onDeleteRoom:()=>{v(!1),m({kind:"room",id:I.id,slug:I.slug,label:I.title||I.slug})},onArchiveChannel:()=>{v(!1),e.channelId&&e.archiveChannel(e.channelId)},onUnarchiveChannel:()=>{v(!1),e.channelId&&e.unarchiveChannel(e.channelId)},onDeleteChannel:()=>{v(!1),E&&m({kind:"channel",id:E.id,slug:E.slug,label:E.title||E.slug})},onLeaveChannel:()=>{v(!1),e.leaveChannel()}})]})]}),a.jsx(Oh,{className:"aops-v2-chat-tabs",items:fe,activeId:o,onChange:de=>d(de),ariaLabel:r("chatTitle")}),a.jsx("div",{className:"aops-v2-chat-tabbody",children:o==="messages"?a.jsxs("div",{className:"aops-v2-chat-msglayout",children:[a.jsxs("div",{className:"aops-v2-chat-msgcol",children:[a.jsx("div",{className:"aops-v2-chat-scroll",ref:g,children:a.jsx(AE,{messages:e.messages,resolveMember:e.resolveMember,receipts:e.receipts,myHandle:e.handle,roomLabel:I.slug,directiveAck:e.directiveAck,onAckDirective:de=>{e.ackDirective(de)},locale:n,t:r})}),a.jsx(xE,{disabled:e.status==="connecting",encryptionMode:E?.encryptionMode,onSend:(de,G)=>{e.send(de,G)},t:r})]}),a.jsx(KE,{model:e,expanded:j,onToggle:()=>C(de=>(FE(!de),!de)),t:r})]}):o==="references"?a.jsx("div",{className:"aops-v2-chat-tabscroll",children:a.jsx(YE,{bindings:e.bindings,t:r})}):o==="rules"?a.jsx("div",{className:"aops-v2-chat-tabscroll",children:a.jsx(UE,{channelRules:N,roomRules:R,t:r})}):o==="members"?a.jsx("div",{className:"aops-v2-chat-tabscroll",children:a.jsx($E,{model:e,t:r})}):a.jsx("div",{className:"aops-v2-chat-tabscroll",children:a.jsx(HE,{model:e,room:I,t:r})})}),h?a.jsx(VE,{target:h,t:r,onClose:()=>m(null),onConfirm:()=>{const de=h;m(null),de.kind==="room"?e.deleteRoom(de.id,de.slug):e.deleteChannel(de.id,de.slug)}}):null]})}function UE({channelRules:e,roomRules:n,t:r}){return a.jsxs("div",{className:"aops-v2-chat-rules",children:[a.jsxs("section",{children:[a.jsx("h5",{children:r("chatRulesChannel")}),e?a.jsx("pre",{className:"aops-v2-chat-rules-text",children:e}):a.jsx("p",{className:"aops-v2-chat-muted",children:r("chatRulesEmpty")})]}),a.jsxs("section",{children:[a.jsx("h5",{children:r("chatRulesRoom")}),n?a.jsx("pre",{className:"aops-v2-chat-rules-text",children:n}):a.jsx("p",{className:"aops-v2-chat-muted",children:r("chatRulesEmpty")})]})]})}function QA(e,n){return kA(e.presence,n)}function Vs(e){return ch(e)}function tm(e){return e==="active"?"is-active":Vs(e)?"is-busy":""}function Sc(e,n){return e==="active"?n("chatPresenceActive"):e==="idle"?n("chatPresenceIdle"):Vs(e)?e:n("chatPresenceOffline")}function UA(e){return O1({members:e.members,receipts:e.receipts,presence:e.presence,roomMembers:e.roomMembers})}const PA="aops-cockpit-v2.chat.memberRail.expanded";function PE(){if(typeof window>"u"||!window.localStorage)return!0;try{return window.localStorage.getItem(PA)!=="0"}catch{return!0}}function FE(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(PA,e?"1":"0")}catch{}}function KE({model:e,expanded:n,onToggle:r,t:i}){const o=UA(e);if(!o.length)return null;const d=o.filter(h=>Vs(h.state)),u=o.filter(h=>!Vs(h.state)),v=h=>{const m=h.handle===e.handle,g=Sc(h.state,i),b=m&&Vs(h.state)?`${g} · ${i("chatMemberYou")}`:h.actorKind&&h.actorKind!=="human"?`${h.actorKind} · ${g}`:g;return a.jsxs("li",{className:`aops-v2-chat-memberrail-row${Vs(h.state)?"":" is-offline"}${m?" is-self":""}`,title:n?void 0:`@${h.handle} - ${g}`,children:[a.jsxs("span",{className:"aops-v2-chat-memberrail-avatarwrap",children:[a.jsx("span",{className:"aops-v2-chat-memberrail-avatar",style:{background:ys(h.handle)},"aria-hidden":!0,children:ti(h.handle)}),a.jsx("span",{className:`aops-v2-chat-memberrail-dot ${tm(h.state)}`,"aria-label":g})]}),n?a.jsxs("span",{className:"aops-v2-chat-memberrail-info",children:[a.jsxs("span",{className:"aops-v2-chat-memberrail-name",children:["@",h.handle]}),a.jsx("span",{className:"aops-v2-chat-memberrail-pres",children:b})]}):null]},h.id)};return a.jsxs("aside",{className:`aops-v2-chat-memberrail ${n?"is-expanded":"is-narrow"}`,"aria-label":i("chatTabMembers"),children:[a.jsxs("div",{className:"aops-v2-chat-memberrail-head",children:[n?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"aops-v2-chat-memberrail-summary",children:[a.jsx("span",{className:"aops-v2-chat-memberrail-count",children:d.length}),a.jsx("span",{className:"aops-v2-chat-memberrail-title",children:i("chatPresenceOnline")})]}),a.jsx("div",{className:"aops-v2-chat-memberrail-facepile","aria-hidden":!0,children:d.slice(0,3).map(h=>a.jsx("span",{className:"aops-v2-chat-memberrail-face",style:{background:ys(h.handle)},children:ti(h.handle)},h.id))})]}):null,a.jsx("button",{type:"button",className:"aops-v2-chat-memberrail-toggle",onClick:r,"aria-expanded":n,"aria-label":i(n?"chatMemberRailCollapse":"chatMemberRailExpand"),title:i(n?"chatMemberRailCollapse":"chatMemberRailExpand"),children:a.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:a.jsx("path",{d:n?"M6 3l5 5-5 5":"M10 3L5 8l5 5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),n?a.jsxs("div",{className:"aops-v2-chat-memberrail-groups",children:[a.jsxs("div",{className:"aops-v2-chat-memberrail-group",children:[a.jsxs("div",{className:"aops-v2-chat-memberrail-grouplabel",children:[i("chatPresenceOnline")," · ",d.length]}),a.jsx("ul",{className:"aops-v2-chat-memberrail-list",children:d.map(v)})]}),u.length?a.jsxs("div",{className:"aops-v2-chat-memberrail-group",children:[a.jsxs("div",{className:"aops-v2-chat-memberrail-grouplabel",children:[i("chatPresenceOffline")," · ",u.length]}),a.jsx("ul",{className:"aops-v2-chat-memberrail-list",children:u.map(v)})]}):null]}):a.jsx("ul",{className:"aops-v2-chat-memberrail-list",children:o.map(v)})]})}function zE({channelId:e,memberToken:n,member:r,active:i,t:o}){const[d,u]=y.useState(!1),[v,h]=y.useState(!1),[m,g]=y.useState(null),[b,j]=y.useState(null),[C,k]=y.useState(!1),[x,S]=y.useState(()=>o("chatWakeDefaultPrompt")),[T,I]=y.useState("idle"),[E,L]=y.useState(null),P=y.useRef(null),N={channelId:e,memberId:r.id,handle:r.handle,actorKind:r.actorKind??"",status:i?"active":"inactive"};y.useEffect(()=>{if(!d)return;const J=re=>{P.current?.contains(re.target)||u(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[d]),y.useEffect(()=>{u(!1),k(!1),g(null),j(null),I("idle"),L(null)},[i,e,r.id,n]);const R=async()=>{if(h(!0),L(null),!n){g({enabled:!1,reason:"member_token_required",hostMatched:!1}),j(null),h(!1);return}try{const J=await vE(N,n);g(J.capability),j(J.grant)}catch(J){const re=J instanceof Error?J.message:String(J);g({enabled:!1,reason:re,hostMatched:!1}),j(null),L(re)}finally{h(!1)}},z=()=>{const J=!d;u(J),J&&R()},ne=async()=>{if(!(!n||!b||!m?.enabled||!x.trim())){I("sending"),L(null);try{await gE(N,x,b,n),I("sent")}catch(J){I("failed"),L(J instanceof Error?J.message:String(J)),await R()}}},ye=v?o("chatWakeChecking"):n?m?.enabled?o("chatWakeReady"):`${o("chatWakeUnavailable")}${m?.reason?` · ${m.reason}`:""}`:`${o("chatWakeUnavailable")} · ${o("chatWakeCredentialMissing")}`;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"aops-v2-chat-member-actions",ref:P,children:[a.jsx("button",{type:"button",className:"aops-v2-chat-member-action-trigger","aria-haspopup":"menu","aria-expanded":d,"aria-label":o("chatMemberActions"),title:o("chatMemberActions"),onClick:z,children:"⋯"}),d?a.jsxs("div",{className:"aops-v2-chat-member-action-menu",role:"menu",children:[a.jsx("button",{type:"button",role:"menuitem",disabled:v||!m?.enabled||!b,onClick:()=>{u(!1),k(!0),I("idle"),L(null)},children:o("chatWakeUp")}),a.jsx("span",{className:m?.enabled?"is-ready":"",children:ye})]}):null]}),C?a.jsxs(em,{title:`${o("chatWakeTitle")} · @${r.handle}`,closeLabel:o("chatCancel"),onClose:()=>k(!1),children:[a.jsx("p",{className:"aops-v2-chat-wake-hint",children:o("chatWakeExperimentalHint")}),a.jsxs("label",{className:"aops-v2-chat-wake-field",children:[a.jsx("span",{children:o("chatWakePromptLabel")}),a.jsx("textarea",{value:x,maxLength:1e5,rows:6,disabled:T==="sending"||T==="sent",onChange:J=>S(J.target.value)})]}),T==="sent"?a.jsx("p",{className:"aops-v2-chat-wake-result is-success",children:o("chatWakeSent")}):null,T==="failed"?a.jsxs("p",{className:"aops-v2-chat-wake-result is-error",children:[o("chatWakeFailed"),E?` · ${E}`:""]}):null,a.jsxs("div",{className:"aops-v2-chat-wake-actions",children:[a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>k(!1),children:o(T==="sent"?"chatClose":"chatCancel")}),T!=="sent"?a.jsx("button",{type:"button",className:"aops-v2-primary-button",disabled:T==="sending"||!x.trim()||!m?.enabled||!b,onClick:()=>{ne()},children:o(T==="sending"?"chatWakeSending":"chatWakeUp")}):null]})]}):null]})}function $E({model:e,t:n}){const[r,i]=y.useState(null),[o,d]=y.useState(null),[u,v]=y.useState(!1),h=e.members.find(J=>J.handle===e.handle),m=!!h&&["owner","operator","admin"].includes((h?.roleKey??"").toLowerCase()),g=e.rooms.find(J=>J.id===e.activeRoomId)??null,b=!!(e.handle&&g?.createdBy&&g.createdBy===e.handle),j=m||b,C=e.roomMembers,k=new Map((C??[]).map(J=>[J.memberId,J])),x=h?k.get(h.id):void 0,S=!!(x&&uc(x)),T=e.members.length?e.members:e.receipts.map(J=>({id:J.memberId,handle:J.handle,actorKind:J.actorKind,roleKey:J.roleKey,status:"active"})),I=T.filter(J=>J.status!=="removed"),E=T.filter(J=>J.status==="removed"),L=e.channels.find(J=>J.id===e.channelId)?.memberToken??null,P=new Set(E.map(J=>J.id)),N=(C??[]).filter(J=>J.roomStatus==="removed"&&!P.has(J.memberId)),R=()=>{e.invite&&navigator.clipboard?.writeText(e.invite).then(()=>v(!0)).catch(()=>{})},z=async(J,re)=>{d(J);try{await re()}catch{}finally{d(null)}},ne=J=>{const re=QA(e,J.id),oe=e.receipts.find(O=>O.memberId===J.id),fe=J.handle===e.handle,de=J.status==="removed",G=k.get(J.id),Q=j&&!fe&&!de&&!!(G&&uc(G)),W=!de&&(C===void 0||!!(G&&uc(G))),pe=[J.actorKind,J.roleKey].filter(Boolean).join(" · "),ke=oe?oe.lastReadSeq>0?`✓✓ ${n("chatMemberReadUpTo")} #${oe.lastReadSeq}`:oe.deliveredSeq>0?`✓ ${n("chatMemberDeliveredUpTo")} #${oe.deliveredSeq}`:"":"";return a.jsxs("li",{className:`aops-v2-chat-memberrow${de?" is-removed":""}`,children:[a.jsx("span",{className:`aops-v2-chat-presdot ${tm(re)}`,title:Sc(re,n),"aria-label":Sc(re,n)}),a.jsx("span",{className:"aops-v2-chat-memberavatar",style:{background:ys(J.handle)},"aria-hidden":!0,children:ti(J.handle)}),a.jsxs("div",{className:"aops-v2-chat-memberinfo",children:[a.jsxs("span",{className:"aops-v2-chat-membername",children:["@",J.handle,fe?a.jsx("span",{className:"eops-chip eops-chip--coral cp-chip-xs",children:n("chatMemberYou")}):null]}),pe?a.jsx("span",{className:"aops-v2-chat-muted",children:pe}):null,ke?a.jsx("span",{className:"aops-v2-chat-memberreceipt",children:ke}):null]}),!fe&&e.channelId?a.jsx(zE,{channelId:e.channelId,memberToken:L,member:J,active:W,t:n}):null,de?a.jsx("span",{className:"aops-v2-chat-muted",children:n("chatMemberRemoved")}):a.jsxs(a.Fragment,{children:[Q?a.jsx("button",{type:"button",className:"aops-v2-chat-headbtn",disabled:o===`room-remove:${J.id}`,title:n("chatMemberRemoveFromRoom"),onClick:()=>{z(`room-remove:${J.id}`,()=>e.updateRoomMember(J.id,"removed"))},children:o===`room-remove:${J.id}`?n("chatStatusConnecting"):n("chatMemberRemoveFromRoom")}):null,m&&!fe?r===J.id?a.jsxs("span",{className:"aops-v2-chat-member-confirm",children:[a.jsx("button",{type:"button",className:"aops-v2-chat-danger-button",disabled:o===J.id,onClick:async()=>{d(J.id);try{await e.removeMember(J.id),i(null)}catch{}finally{d(null)}},children:o===J.id?n("chatStatusConnecting"):n("chatMemberRemove")}),a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>i(null),children:n("chatCancel")})]}):a.jsx("button",{type:"button",className:"aops-v2-chat-headbtn",title:n("chatMemberRemoveConfirm"),onClick:()=>i(J.id),children:n("chatMemberRemove")}):null]})]},J.id)},ye=J=>{const re=e.members.find(de=>de.id===J.memberId),oe=re?.handle??J.handle,fe=[re?.actorKind??J.actorKind,re?.roleKey??J.roleKey].filter(Boolean).join(" · ");return a.jsxs("li",{className:"aops-v2-chat-memberrow is-removed",children:[a.jsx("span",{className:"aops-v2-chat-presdot","aria-hidden":!0}),a.jsx("span",{className:"aops-v2-chat-memberavatar",style:{background:ys(oe)},"aria-hidden":!0,children:ti(oe)}),a.jsxs("div",{className:"aops-v2-chat-memberinfo",children:[a.jsxs("span",{className:"aops-v2-chat-membername",children:["@",oe,a.jsx("span",{className:"aops-v2-chat-muted",children:n("chatMemberRoomRemovedHint")})]}),fe?a.jsx("span",{className:"aops-v2-chat-muted",children:fe}):null]}),j?a.jsx("button",{type:"button",className:"aops-v2-chat-headbtn",disabled:o===`room-readd:${J.memberId}`,title:n("chatMemberReadd"),onClick:()=>{z(`room-readd:${J.memberId}`,()=>e.updateRoomMember(J.memberId,"active"))},children:o===`room-readd:${J.memberId}`?n("chatStatusConnecting"):n("chatMemberReadd")}):a.jsx("span",{className:"aops-v2-chat-muted",children:n("chatMemberRemoved")})]},`room:${J.memberId}`)};return a.jsxs("section",{className:"aops-v2-chat-members","aria-label":n("chatTabMembers"),children:[a.jsx(FA,{invite:e.invite,copied:u,onCopy:R,t:n}),I.length?a.jsx("ul",{className:"aops-v2-chat-memberlist",children:I.map(ne)}):a.jsx("p",{className:"aops-v2-chat-muted",children:n("chatMembersEmpty")}),E.length||N.length?a.jsxs("div",{className:"aops-v2-chat-memberlist-group",children:[a.jsxs("div",{className:"aops-v2-chat-memberlist-grouplabel",children:[n("chatMemberRemovedSection")," · ",E.length+N.length]}),a.jsxs("ul",{className:"aops-v2-chat-memberlist",children:[E.map(ne),N.map(ye)]})]}):null,a.jsxs("div",{className:"aops-v2-chat-members-foot",children:[S?a.jsx("button",{type:"button",className:"aops-v2-secondary-button",disabled:o==="room-leave",onClick:()=>{z("room-leave",()=>e.leaveRoom())},children:n("chatLeaveRoom")}):null,a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>{e.leaveChannel()},children:n("chatLeaveChannel")})]})]})}function HE({model:e,room:n,t:r}){const i=e.directiveAck,[o,d]=y.useState(!1),u=()=>{e.invite&&navigator.clipboard?.writeText(e.invite).then(()=>d(!0)).catch(()=>{})};return a.jsxs("div",{className:"aops-v2-chat-activity",children:[a.jsxs("section",{className:"aops-v2-chat-activity-card",children:[a.jsx("h5",{children:r("chatActivityDirective")}),i?a.jsxs("div",{className:"aops-v2-chat-activity-directive",children:[a.jsxs("span",{className:"eops-chip eops-chip--sage cp-chip-xs",children:["#",i.seq]}),a.jsxs("span",{children:[a.jsx("b",{children:i.acked}),"/",i.total," ",r("chatActivityAcked")]}),a.jsx("span",{className:"aops-v2-chat-muted",children:i.mine?r("chatActivityAcknowledged"):r("chatActivityPending")})]}):a.jsx("p",{className:"aops-v2-chat-muted",children:r("chatActivityNoDirective")})]}),a.jsxs("section",{className:"aops-v2-chat-activity-card",children:[a.jsx("h5",{children:r("chatActivityPresenceTitle")}),a.jsxs("ul",{className:"aops-v2-chat-presencelist",children:[e.members.map(v=>{const h=QA(e,v.id);return a.jsxs("li",{children:[a.jsx("span",{className:`aops-v2-chat-presdot ${tm(h)}`,"aria-hidden":!0}),a.jsxs("span",{className:"aops-v2-chat-membername",children:["@",v.handle]}),a.jsx("span",{className:"aops-v2-chat-muted",children:Sc(h,r)})]},v.id)}),e.members.length===0?a.jsx("li",{className:"aops-v2-chat-muted",children:r("chatMembersEmpty")}):null]})]}),a.jsxs("section",{className:"aops-v2-chat-activity-card",children:[a.jsx("h5",{children:r("chatActivityRoomMeta")}),a.jsxs("dl",{className:"aops-v2-chat-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:r("chatActivityEpoch")}),a.jsxs("dd",{children:["#",n.currentEpoch]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:r("chatMessageCount")}),a.jsx("dd",{children:e.messages.length})]})]}),a.jsx(FA,{invite:e.invite,copied:o,onCopy:u,t:r})]})]})}function FA({invite:e,copied:n,onCopy:r,t:i}){return e?a.jsxs("div",{className:"aops-v2-chat-inviteblock",children:[a.jsx("p",{className:"aops-v2-chat-invitehint",children:i("chatInviteHint")}),a.jsxs("div",{className:"aops-v2-chat-inviterow",children:[a.jsx("code",{className:"aops-v2-chat-invitecode",title:e,children:e}),a.jsxs("button",{type:"button",className:"aops-v2-chat-headbtn aops-v2-chat-copyinvite aops-v2-chat-invitecopy",onClick:r,title:i(n?"chatInviteCopied":"chatCopyInvite"),"data-state":n?"copied":"idle",children:[a.jsx("span",{className:"aops-v2-chat-invitecopy-icon","aria-hidden":!0,children:n?_A():OA()}),i(n?"chatInviteCopied":"chatCopyInvite")]})]})]}):null}function GE({open:e,onToggle:n,onClose:r,isGeneralRoom:i,channelArchived:o,canDeleteChannel:d,invite:u,inviteCopied:v,inviteCopyBusy:h,t:m,onCopyInvite:g,onArchiveRoom:b,onDeleteRoom:j,onArchiveChannel:C,onUnarchiveChannel:k,onDeleteChannel:x,onLeaveChannel:S}){const T=y.useRef(null);return y.useEffect(()=>{if(!e)return;const I=L=>{T.current?.contains(L.target)||r()},E=L=>{L.key==="Escape"&&r()};return document.addEventListener("pointerdown",I),document.addEventListener("keydown",E),()=>{document.removeEventListener("pointerdown",I),document.removeEventListener("keydown",E)}},[e,r]),a.jsxs("div",{className:"aops-v2-chat-actions",ref:T,children:[a.jsx("button",{type:"button",className:`aops-v2-chat-headbtn${e?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":e,"aria-label":m("chatActions"),onClick:n,children:BE()}),e?a.jsxs("div",{className:"aops-v2-chat-actions-menu",role:"menu",children:[a.jsx("span",{className:"aops-v2-chat-actions-label",children:m("chatRoomSection")}),a.jsx("button",{type:"button",role:"menuitem",onClick:b,children:m("chatArchiveRoom")}),i?null:a.jsx("button",{type:"button",role:"menuitem",className:"is-danger",onClick:j,children:m("chatDeleteRoom")}),a.jsx("span",{className:"aops-v2-chat-actions-sep","aria-hidden":!0}),a.jsx("span",{className:"aops-v2-chat-actions-label",children:m("chatChannelSection")}),a.jsx("button",{type:"button",role:"menuitem",disabled:!u||h,title:m(u?"chatCopyInvite":"chatInviteUnavailable"),onClick:g,children:m(v?"chatInviteCopied":"chatInviteAction")}),o?a.jsx("button",{type:"button",role:"menuitem",onClick:k,children:m("chatUnarchiveChannel")}):a.jsx("button",{type:"button",role:"menuitem",onClick:C,children:m("chatArchiveChannel")}),a.jsx("button",{type:"button",role:"menuitem",onClick:S,children:m("chatLeaveChannel")}),d?a.jsx("button",{type:"button",role:"menuitem",className:"is-danger",onClick:x,children:m("chatDeleteChannel")}):null,a.jsx("span",{className:"aops-v2-chat-actions-hint",children:m("chatRenameUnsupported")})]}):null]})}function qE({model:e,t:n,onClose:r}){const[i,o]=y.useState(""),[d,u]=y.useState(""),v=e.status==="connecting",h=async()=>{const m=i.trim();m&&(await e.createRoom({slug:ei(m),title:m,guidanceMarkdown:d||void 0}),r())};return a.jsxs(em,{title:n("chatNewRoom"),closeLabel:n("chatClose"),size:"sm",onClose:r,children:[a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsx("span",{children:n("chatRoomName")}),a.jsx("input",{value:i,onChange:m=>o(m.target.value),placeholder:n("chatRoomNamePh"),autoFocus:!0})]}),a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsx("span",{children:n("chatRoomRules")}),a.jsx("textarea",{value:d,onChange:m=>u(m.target.value),placeholder:n("chatChannelRulesPh"),rows:2})]}),a.jsxs("div",{className:"aops-v2-chat-connect-actions",children:[a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:r,children:n("chatCancel")}),a.jsx("button",{type:"button",className:"aops-v2-primary-button",disabled:v||!i.trim(),onClick:()=>{h()},children:n(v?"chatStatusConnecting":"chatCreateRoom")})]})]})}function VE({target:e,t:n,onClose:r,onConfirm:i}){const[o,d]=y.useState("");y.useEffect(()=>{const v=h=>{h.key==="Escape"&&r()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]);const u=o.trim()===e.slug;return a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",onClick:r,children:a.jsxs("div",{className:"aops-v2-chat-modal aops-v2-chat-modal-sm",role:"dialog","aria-modal":"true","aria-label":n("chatDeleteConfirmTitle"),onClick:v=>v.stopPropagation(),children:[a.jsxs("header",{className:"aops-v2-chat-modal-head",children:[a.jsx("h4",{children:n("chatDeleteConfirmTitle")}),a.jsx("button",{type:"button",className:"aops-v2-chat-iconclose","aria-label":n("chatClose"),onClick:r,children:"✕"})]}),a.jsxs("div",{className:"aops-v2-chat-modal-body",children:[a.jsx("p",{className:"aops-v2-chat-muted",children:n("chatDeleteConfirmMessage")}),a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsxs("span",{children:[n("chatDeleteConfirmSlugLabel"),": ",a.jsx("code",{children:e.slug})]}),a.jsx("input",{value:o,onChange:v=>d(v.target.value),autoFocus:!0})]}),a.jsx("div",{className:"aops-v2-chat-connect-actions",children:a.jsx("button",{type:"button",className:"aops-v2-chat-danger-button",disabled:!u,onClick:i,children:n("chatDelete")})})]})]})})}function YE({bindings:e,t:n}){const[r,i]=y.useState(null);y.useEffect(()=>{if(!r)return;const d=window.setTimeout(()=>i(null),1200);return()=>window.clearTimeout(d)},[r]);const o=(d,u)=>{navigator.clipboard?.writeText(d).then(()=>i(u)).catch(()=>{})};return a.jsxs("section",{className:"aops-v2-chat-refs","aria-label":n("chatRefsTitle"),children:[a.jsx("h5",{children:n("chatRefsTitle")}),e.length===0?a.jsx("p",{className:"aops-v2-chat-muted",children:n("chatRefsEmpty")}):a.jsx("ul",{className:"aops-v2-chat-reflist",children:e.map(d=>{const u=d.uri||d.refId||d.id;return a.jsxs("li",{children:[a.jsxs("div",{className:"aops-v2-chat-ref-main",children:[a.jsx("span",{className:"eops-chip eops-chip--ghost cp-chip-xs",children:d.bindingType}),a.jsx("span",{className:"aops-v2-chat-ref-title",children:d.title||u})]}),d.note?a.jsx("span",{className:"aops-v2-chat-muted",children:d.note}):null,a.jsx("button",{type:"button",className:"aops-v2-chat-ref-copy",onClick:()=>o(u,d.id),children:r===d.id?n("chatCopied"):n("chatRefsCopy")})]},d.id)})})]})}function JE({model:e,t:n,initialMode:r,onClose:i}){const[o,d]=y.useState(r),[u,v]=y.useState("operator"),[h,m]=y.useState(""),[g,b]=y.useState(""),[j,C]=y.useState(""),[k,x]=y.useState("server-encrypted"),S=e.status==="connecting",T=o==="create"?!!h.trim():!!j.trim(),I=async()=>{if(o==="create"){if(!h.trim())return;await e.createChannel({handle:u,title:h,guidanceMarkdown:g||void 0,encryptionMode:k})}else{if(!j.trim())return;await e.joinChannel({handle:u,invite:j})}i()};return a.jsxs(em,{title:n("chatConnectPanelTitle"),closeLabel:n("chatClose"),onClose:i,children:[a.jsxs("div",{className:"aops-v2-chat-connect-tabs",role:"tablist",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":o==="create",className:`aops-v2-chat-connect-tab${o==="create"?" is-active":""}`,onClick:()=>d("create"),children:n("chatCreateTab")}),a.jsx("button",{type:"button",role:"tab","aria-selected":o==="join",className:`aops-v2-chat-connect-tab${o==="join"?" is-active":""}`,onClick:()=>d("join"),children:n("chatJoinTab")})]}),a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsx("span",{children:n("chatHandle")}),a.jsx("input",{value:u,onChange:E=>v(E.target.value),placeholder:"operator"})]}),o==="create"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsx("span",{children:n("chatChannelName")}),a.jsx("input",{value:h,onChange:E=>m(E.target.value),placeholder:n("chatChannelNamePh")})]}),a.jsxs("fieldset",{className:"aops-v2-chat-field aops-v2-chat-encryption-mode",children:[a.jsx("legend",{children:n("chatEncryptionMode")}),a.jsxs("label",{className:`aops-v2-chat-mode-option${k==="server-encrypted"?" is-active":""}`,children:[a.jsx("input",{type:"radio",name:"chat-encryption-mode",value:"server-encrypted",checked:k==="server-encrypted",onChange:()=>x("server-encrypted")}),a.jsxs("span",{children:[a.jsx("strong",{children:n("chatEncryptionServer")}),a.jsx("small",{children:n("chatEncryptionServerHint")})]})]}),a.jsxs("label",{className:`aops-v2-chat-mode-option${k==="e2e"?" is-active":""}`,children:[a.jsx("input",{type:"radio",name:"chat-encryption-mode",value:"e2e",checked:k==="e2e",onChange:()=>x("e2e")}),a.jsxs("span",{children:[a.jsx("strong",{children:n("chatEncryptionE2e")}),a.jsx("small",{children:n("chatEncryptionE2eHint")})]})]})]}),a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsx("span",{children:n("chatChannelRules")}),a.jsx("textarea",{value:g,onChange:E=>b(E.target.value),placeholder:n("chatChannelRulesPh"),rows:3})]})]}):a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsx("span",{children:n("chatInvite")}),a.jsx("input",{value:j,onChange:E=>C(E.target.value),placeholder:n("chatInvitePh")})]}),a.jsxs("div",{className:"aops-v2-chat-connect-actions",children:[a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:i,children:n("chatCancel")}),a.jsx("button",{type:"button",className:"aops-v2-primary-button",disabled:S||!T,onClick:()=>{I()},children:n(S?"chatStatusConnecting":o==="create"?"chatCreate":"chatJoin")})]})]})}function KA(e){return e.trim().toLowerCase().replace(/[^a-z0-9çğıöşü\s-]/gi,"").replace(/\s+/g,"-").slice(0,80)}function XE(e){const n=[],r=e.replace(/\r\n/g,`
|
|
12
|
+
`).split(`
|
|
13
|
+
`);let i=0;for(;i<r.length;){const o=r[i];if(/^```/.test(o)){const v=[];for(i+=1;i<r.length&&!/^```/.test(r[i]);)v.push(r[i]),i+=1;i+=1,n.push({kind:"code",lines:v});continue}const d=/^(#{1,6})\s+(.*)$/.exec(o);if(d){n.push({kind:"heading",level:d[1].length,lines:[d[2]]}),i+=1;continue}if(/^\s*([-*+]|\d+\.)\s+/.test(o)){const v=[];for(;i<r.length&&/^\s*([-*+]|\d+\.)\s+/.test(r[i]);)v.push(r[i].replace(/^\s*([-*+]|\d+\.)\s+/,"")),i+=1;n.push({kind:"bullet",lines:v});continue}if(/^\s*>/.test(o)){const v=[];for(;i<r.length&&/^\s*>/.test(r[i]);)v.push(r[i].replace(/^\s*>\s?/,"")),i+=1;n.push({kind:"quote",lines:v});continue}if(o.trim()===""){i+=1;continue}const u=[];for(;i<r.length&&r[i].trim()!==""&&!/^(#{1,6}\s|```|\s*([-*+]|\d+\.)\s|\s*>)/.test(r[i]);)u.push(r[i]),i+=1;n.push({kind:"paragraph",lines:u})}return n}function ph({markdown:e}){const n=y.useMemo(()=>XE(e),[e]);return a.jsx("div",{className:"aops-mdlite",children:n.map((r,i)=>{if(r.kind==="heading"){const o=Math.min(r.level??1,6),d=`h${Math.min(o+2,6)}`;return a.jsx(d,{id:KA(r.lines[0]),className:`aops-mdlite-h aops-mdlite-h${o}`,children:r.lines[0]},i)}return r.kind==="code"?a.jsx("pre",{className:"aops-mdlite-code",children:r.lines.join(`
|
|
14
|
+
`)},i):r.kind==="bullet"?a.jsx("ul",{className:"aops-mdlite-list",children:r.lines.map((o,d)=>a.jsx("li",{children:o},d))},i):r.kind==="quote"?a.jsx("blockquote",{className:"aops-mdlite-quote",children:r.lines.join(`
|
|
15
|
+
`)},i):a.jsx("p",{children:r.lines.join(" ")},i)})})}const Nl={all:(e,n,r)=>["aops-agentspace",e.baseUrl,n??"anonymous",r?.projectId??"no-project-id",r?.scopeId??"no-scope-id"],entity:(e,n,r,i)=>[...Nl.all(e,n,r),i],detail:(e,n,r,i,o)=>[...Nl.all(e,n,r),"detail",i,o??"none"]};function zs(e,n){return Date.parse(n.updatedAt??n.createdAt??"")-Date.parse(e.updatedAt??e.createdAt??"")}function WE(e){return e.find(n=>n!=null)??null}function ZE(e){const n=!!(e.enabled&&e.selectedProject),r=ye=>Nl.entity(e.client.identity,e.sessionKey,e.selectedProject,ye),i=ye=>e.client.get(ye).then(J=>Array.isArray(J)?J:[]),o=mt({queryKey:r("memory-items"),queryFn:()=>i("/api/agentspace/memory-items"),enabled:n}),d=mt({queryKey:r("discussion-topics"),queryFn:()=>i("/api/agentspace/discussion-topics"),enabled:n}),u=mt({queryKey:r("prompts"),queryFn:()=>i("/api/agentspace/prompts"),enabled:n}),v=mt({queryKey:r("skills"),queryFn:()=>i("/api/agentspace/skills"),enabled:n}),h=mt({queryKey:r("resources"),queryFn:()=>i("/api/agentspace/resources"),enabled:n}),m=mt({queryKey:r("agent-profiles"),queryFn:()=>i("/api/agentspace/agent-profiles"),enabled:n}),g=mt({queryKey:r("artifacts"),queryFn:async()=>{const ye=await i("/api/agentspace/artifact-links"),J=new Map;for(const oe of ye)oe.artifactId&&J.set(oe.artifactId,[...J.get(oe.artifactId)??[],oe]);return await Promise.all([...J.keys()].map(oe=>e.client.get(`/api/agentspace/artifacts/${encodeURIComponent(oe)}`).then(fe=>({...fe,links:J.get(oe)??[]}))))},enabled:n,retry:0}),b=[o,d,u,v,h,m],j=n&&b.some(ye=>ye.isPending),C=WE(b.map(ye=>ye.error)),k=b.some(ye=>ye.isFetching),x=y.useMemo(()=>(o.data??[]).slice().sort(zs),[o.data]),S=y.useMemo(()=>(d.data??[]).slice().sort(zs),[d.data]),T=y.useMemo(()=>(u.data??[]).slice().sort(zs),[u.data]),I=y.useMemo(()=>(v.data??[]).slice().sort(zs),[v.data]),E=y.useMemo(()=>(h.data??[]).slice().sort(zs),[h.data]),L=y.useMemo(()=>(m.data??[]).slice().sort(zs),[m.data]),P=y.useMemo(()=>(g.data??[]).slice().sort(zs),[g.data]),N=g.error??null,R=n&&g.isPending,z=!j&&!C&&x.length===0&&S.length===0&&T.length===0&&I.length===0&&E.length===0&&L.length===0&&P.length===0&&!R&&!N;return{status:e.selectedProject?j?"loading":C?"error":z?"empty":"ready":"select-project",error:C,isFetching:k||g.isFetching,memoryItems:x,discussions:S,prompts:T,skills:I,artifacts:P,artifactsError:N,artifactsPending:R,resources:E,agentProfiles:L,refresh:()=>{for(const ye of b)ye.refetch();g.refetch()},client:e.client,sessionKey:e.sessionKey,selectedProject:e.selectedProject}}function e2(e){const n=e.asset==="prompt"?`/api/agentspace/prompt-versions/${encodeURIComponent(e.versionId??"")}`:`/api/agentspace/skill-versions/${encodeURIComponent(e.versionId??"")}`;return mt({queryKey:Nl.detail(e.model.client.identity,e.model.sessionKey,e.model.selectedProject,`${e.asset}-version`,e.versionId),queryFn:()=>e.model.client.get(n),enabled:!!e.versionId,retry:0,staleTime:3e4})}function t2(e){return mt({queryKey:Nl.detail(e.model.client.identity,e.model.sessionKey,e.model.selectedProject,"discussion-topic",e.topicId),queryFn:()=>e.model.client.get(`/api/agentspace/discussion-topics/${encodeURIComponent(e.topicId??"")}`),enabled:!!e.topicId,retry:0})}async function a2(e){const n=window.document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0";let r=!1;try{window.document.body.appendChild(n),n.select(),r=window.document.execCommand("copy")}catch{}finally{n.remove()}if(!r){if(window.navigator.clipboard?.writeText)try{await Promise.race([window.navigator.clipboard.writeText(e),new Promise((i,o)=>window.setTimeout(()=>o(new Error("clipboard_timeout")),400))]);return}catch{}throw new Error("clipboard_unavailable")}}function n2(){return a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function s2(){return a.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m5 12.5 4.2 4.2L19 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function am({text:e,copyLabel:n,copiedLabel:r,failedLabel:i}){const[o,d]=y.useState("idle"),u=y.useRef(null);y.useEffect(()=>()=>{u.current!=null&&window.clearTimeout(u.current)},[]);const v=async()=>{if(e){try{await a2(e),d("copied")}catch{d("error")}u.current!=null&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>d("idle"),1800)}},h=o==="copied"?r:o==="error"?i:n;return a.jsx("button",{type:"button",className:"aops-content-copy-button","data-state":o,disabled:!e,"aria-label":h,title:h,onClick:()=>{v()},children:o==="copied"?a.jsx(s2,{}):a.jsx(n2,{})})}const zA="aops-cockpit-v2.agentspace.memoryViewer",ps=30,$A=3,HA=6,rc={viewByScope:{},navigatorOpenByScope:{},expandedByScope:{},sortByScope:{}};function r2(){if(typeof window>"u")return rc;try{const e=window.localStorage.getItem(zA);if(!e)return rc;const n=JSON.parse(e);return{...rc,...n}}catch{return rc}}function i2(e){try{typeof window<"u"&&window.localStorage.setItem(zA,JSON.stringify(e))}catch{}}function fs(e,n){e(r=>{const i=n(r);return i2(i),i})}function l2({model:e,section:n,onNavigate:r,onOpenProjectmanRef:i,locale:o,t:d}){const u={memory:e.memoryItems.length,discussions:e.discussions.length,prompts:e.prompts.length,skills:e.skills.length,artifacts:e.artifacts.length,resources:e.resources.length,agents:e.agentProfiles.length},v=hn.map(N=>({id:N.section,label:d(N.labelKey),count:u[N.section]||null})),h=e.selectedProject?.key??"__global__",m=`${h}:as-${n}`,g=n==="memory"?["timeline","cards","read","digest"]:n==="discussions"?["cards","read","digest"]:["side-panel","cards","dropdown"],b=g.length>1,j=ii().viewport==="mobile",[C,k]=y.useState(r2),x=C.viewByScope[m],S=x==="list"&&g.includes("side-panel")?"side-panel":x,T=S&&g.includes(S)?S:g[0],I=j?"cards":T,E=C.navigatorOpenByScope[m]!==!1,L=N=>fs(k,R=>({...R,navigatorOpenByScope:{...R.navigatorOpenByScope,[m]:N}})),P=N=>fs(k,R=>({...R,viewByScope:{...R.viewByScope,[m]:N},navigatorOpenByScope:N==="side-panel"?{...R.navigatorOpenByScope,[m]:!0}:R.navigatorOpenByScope}));return a.jsx(cn,{className:"aops-v2-section aops-pm-section",mainClassName:"aops-v2-section-main",children:a.jsxs("div",{className:`aops-pm-dispatch${b?" has-view-switch":""}`,children:[a.jsxs("label",{className:"aops-pm-mobile-section-picker",children:[a.jsx("span",{children:d("asTitle")}),a.jsx("select",{"aria-label":d("asTitle"),value:n,onChange:N=>r(Dy(N.target.value)),children:v.map(N=>a.jsxs("option",{value:N.id,children:[N.label,N.count!=null?` (${N.count})`:""]},N.id))})]}),a.jsxs("div",{className:"aops-pm-section-controls",children:[a.jsx("div",{className:"aops-pm-sectiontabs",role:"tablist","aria-label":d("asTitle"),children:v.map(N=>a.jsxs("button",{type:"button",role:"tab","aria-selected":n===N.id,className:`aops-pm-sectiontab${n===N.id?" is-active":""}`,onClick:()=>r(Dy(N.id)),children:[a.jsx("span",{className:"aops-pm-sectiontab-label",children:N.label}),N.count!=null?a.jsx("span",{className:"aops-pm-sectiontab-count",children:N.count}):null]},N.id))}),b?a.jsx(c2,{section:n,value:I,navigatorOpen:E,onChange:P,onToggleNavigator:()=>L(!E),t:d}):null]}),a.jsx("div",{className:"aops-pm-dispatch-body",children:a.jsx(o2,{section:n,model:e,onOpenProjectmanRef:i,locale:o,t:d,projectKey:h,recordScopeKey:m,memoryUi:C,setMemoryUi:k,recordViewMode:I,recordNavigatorOpen:E,onCloseRecordNavigator:()=>L(!1)})})]})})}function o2({section:e,model:n,onOpenProjectmanRef:r,locale:i,t:o,projectKey:d,recordScopeKey:u,memoryUi:v,setMemoryUi:h,recordViewMode:m,recordNavigatorOpen:g,onCloseRecordNavigator:b}){const j=hn.find(x=>x.section===e)??hn[0],C=x=>({title:o(j.labelKey),searchPlaceholder:o(x),emptyLabel:o("asNoRecords"),noMatchLabel:o("asNoRecords"),unknownStatusLabel:o("pmUnknownStatus"),detailAriaLabel:o(j.labelKey),backLabel:o("pmCardPaneClose")}),k=(x,S,T)=>{const I=E=>a.jsxs(a.Fragment,{children:[a.jsx(js,{refs:E.refs,onOpen:r,t:o}),T?.renderExtra?.(E)]});return a.jsx("div",{className:"aops-pm-recordsection","data-testid":`aops-v2-as-${e}-section`,children:m==="cards"?a.jsx(Jh,{section:`as-${e}`,projectKey:d,items:S,sectionTitle:o(j.labelKey),searchPlaceholder:o(x),emptyLabel:o("asNoRecords"),renderExtra:I,toolbarExtra:T?.toolbarExtra,locale:i,t:o}):a.jsx(Lj,{items:S,labels:C(x),detailExtra:I,layout:m==="dropdown"?"dropdown":"side-panel",navigatorOpen:g,onCloseNavigator:b,closeNavigatorLabel:o("navSidePanelClose")})})};return n.status==="select-project"?a.jsx(it,{variant:"empty",title:o("asNoProjectTitle"),message:o("asNoProjectMessage")}):e==="artifacts"?n.artifactsPending?a.jsx(it,{variant:"loading",title:o("asLoadingTitle"),message:o("asLoadingMessage")}):n.artifactsError?a.jsx(it,{variant:"error",title:o("asArtifactsGapTitle"),message:`${o("asArtifactsGapMessage")} — ${It(n.artifactsError,"agentspace_operation_failed")}`,actions:a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:n.refresh,children:o("authRetry")})}):k("asSearchArtifacts",Y2(n.artifacts,i,o)):n.status==="loading"?a.jsx(it,{variant:"loading",title:o("asLoadingTitle"),message:o("asLoadingMessage")}):n.status==="error"?a.jsx(it,{variant:"error",title:o("asErrorTitle"),message:It(n.error,"agentspace_unavailable"),actions:a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:n.refresh,children:o("authRetry")})}):n.status==="empty"?a.jsx(it,{variant:"empty",title:o("asEmptyTitle"),message:o("asEmptyMessage")}):e==="memory"?a.jsx(S2,{model:n,scopeKey:u,ui:v,setUi:h,viewMode:m,onOpenProjectmanRef:r,locale:i,t:o}):e==="discussions"?a.jsx(Q2,{title:o("asSectionDiscussions"),searchLabel:o("asSearchDiscussions"),emptyLabel:o("asNoRecords"),items:G2(n.discussions,i,o),scopeKey:u,ui:v,setUi:h,viewMode:m,locale:i,t:o,onOpenProjectmanRef:r,detailExtra:x=>a.jsx($2,{model:n,topicId:x.id,locale:i,t:o})}):e==="prompts"?k("asSearchPrompts",Ab(n.prompts,"prompts",i,o),{renderExtra:x=>{const S=n.prompts.find(T=>T.id===x.id)?.currentVersionId??null;return a.jsx(jb,{model:n,asset:"prompt",versionId:S,t:o})}}):e==="skills"?k("asSearchSkills",Ab(n.skills,"skills",i,o),{renderExtra:x=>{const S=n.skills.find(T=>T.id===x.id)?.currentVersionId??null;return a.jsx(jb,{model:n,asset:"skill",versionId:S,t:o})}}):e==="resources"?k("asSearchResources",J2(n.resources,i,o)):k("asSearchAgents",X2(n.agentProfiles,o))}function c2({section:e,value:n,navigatorOpen:r,onChange:i,onToggleNavigator:o,t:d}){const u=e==="memory"?[{value:"timeline",label:d("asMemoryViewTimeline")},{value:"cards",label:d("asMemoryViewCards")},{value:"read",label:d("asMemoryViewRead")},{value:"digest",label:d("asMemoryViewDigest")}]:e==="discussions"?[{value:"cards",label:d("asMemoryViewCards")},{value:"read",label:d("asMemoryViewRead")},{value:"digest",label:d("asMemoryViewDigest")}]:[{value:"side-panel",label:d(r&&n==="side-panel"?"navSidePanelHide":"navSidePanelShow")},{value:"cards",label:d("navModeCards")},{value:"dropdown",label:d("navModeDropdown")}],v=h=>h==="side-panel"?"side-panel":h==="cards"?"cards":h==="dropdown"?"dropdown":h==="timeline"?"timeline":h==="read"?"read":"digest";return a.jsx(_h,{className:"aops-as-memory-view-switch",ariaLabel:d("asMemoryViewLabel"),value:n,items:u.map(h=>({value:h.value,label:h.label,icon:v(h.value),expanded:h.value==="side-panel"&&n==="side-panel"&&r,onSelect:h.value==="side-panel"&&n==="side-panel"?o:void 0,testId:`aops-as-${e}-view-${h.value}`})),onChange:i})}const d2={resume:"#4A6B91",checkpoint:"#E89A4A",closeout:"#5B8B6F",note:"#D2C2A4",kickoff:"#D97757",rule:"#C26041",decision:"#6D5F8F",constraint:"#B3503C"};function ni(e){return d2[(e??"").toLowerCase()]??"#D2C2A4"}const u2={proposal:"var(--aops-v2-primary)",question:"var(--amber, var(--aops-v2-primary))",answer:"var(--sage, var(--aops-v2-primary))",statement:"var(--aops-v2-muted)","final-stance":"var(--coral, var(--aops-v2-primary))",objection:"var(--coral, var(--aops-v2-primary))",concession:"var(--sage, var(--aops-v2-primary))"};function p2(e){return u2[(e??"").toLowerCase()]??"var(--aops-v2-primary)"}function h2(e){switch((e??"").toLowerCase()){case"final-stance":case"objection":return"eops-chip--coral";case"answer":case"concession":return"eops-chip--sage";case"question":return"eops-chip--amber";default:return"eops-chip--ghost"}}const vb=["decision","consensus","disagreement","open-questions","final-stance"],m2={decision:"sage",consensus:"sage",disagreement:"coral","open-questions":"amber","final-stance":"coral"};function wc(e){return(e??"").trim().toLowerCase()}function GA(e){return m2[wc(e)]??"ghost"}function f2(e){return`eops-chip--${GA(e)}`}function v2(e,n){switch(wc(e)){case"decision":return n("asOutputKindDecision");case"consensus":return n("asOutputKindConsensus");case"disagreement":return n("asOutputKindDisagreement");case"open-questions":return n("asOutputKindOpenQuestions");case"final-stance":return n("asOutputKindFinalStance");default:return e??n("asOutputs")}}function g2(e){return e.map((n,r)=>({output:n,index:r})).sort((n,r)=>{const i=vb.indexOf(wc(n.output.outputKind)),o=vb.indexOf(wc(r.output.outputKind)),d=i===-1?Number.MAX_SAFE_INTEGER:i,u=o===-1?Number.MAX_SAFE_INTEGER:o;return d-u||n.index-r.index}).map(n=>n.output)}function qA(e,n){if(!e.blockedOn)return null;const r=e.blockingTurnSeq!=null?` #${e.blockingTurnSeq}`:"";return`${n("asAttentionBlocked")}: ${e.blockedOn}${r}`}function y2(e){return[e.content,e.kind,e.durability,e.sourceType,e.sourceId,JSON.stringify(e.meta??{}),...e.tags??[]].filter(Boolean).join(" ").toLowerCase()}function li(e){return!e.sourceType&&!e.sourceId?null:`${e.sourceType??"source"}${e.sourceId?` · ${Oe(e.sourceId)}`:""}`}function Nc(e){const n=e?.meta;if(!n||typeof n!="object")return null;const r=n.scopeId??n.projectId??n.projectSlug;return typeof r=="string"&&r.trim()?r:null}function Il(e){return H2(e.content,132)||Oe(e.id)}function nm(e){const n=(e.content??"").trim();if(!n)return{title:null,body:""};const r=n.split(/\r?\n/),i=(r[0]??"").trim(),o=r.slice(1).join(`
|
|
16
|
+
`).trim();return o?{title:i,body:o}:{title:null,body:n}}function ic(e,...n){if(!e||typeof e!="object")return null;for(const r of n){const i=e[r];if(typeof i=="string"&&i.trim())return i}return null}function b2(e){const n=(e??"").toLowerCase();return n?n.includes("board")?"board":n.includes("sprint")||n.includes("implementation-plan")||n.includes("implementation_plan")||n.includes("plan")?"sprint":n.includes("task")||n.includes("kanban-task")||n.includes("kanban_task")?"task":null:null}function us(e,n,r,i){const o=n?.trim();if(!o)return null;const d=b2(e);return d?{kind:d,id:o,boardId:i,rawType:e,label:r||`${d} · ${Oe(o)}`}:null}function $c(e){const n=new Set,r=[];for(const i of e){if(!i)continue;const o=`${i.kind}:${i.id}:${i.boardId??""}`;n.has(o)||(n.add(o),r.push(i))}return r}function Dl(e){const n=e.meta,r=ic(n,"boardId","kanbanBoardId","boardUid");return $c([us(e.sourceType,e.sourceId,li(e),r),us("board",r),us("task",ic(n,"taskId","kanbanTaskId","taskUid"),null,r),us("sprint",ic(n,"sprintId","sprintUid")),us("implementation-plan",ic(n,"planId","implementationPlanId","activeImplementationPlanId"))])}function js({refs:e,onOpen:n,t:r}){return e?.length?a.jsxs("div",{className:"aops-as-ref-list",children:[a.jsx("span",{children:r("asFieldRef")}),e.map(i=>a.jsx("button",{type:"button",className:"aops-as-ref-link",onClick:()=>n({kind:i.kind,id:i.id,boardId:i.boardId}),children:i.label},`${i.kind}:${i.id}:${i.boardId??""}`))]}):null}function Hc({row:e,onOpen:n,t:r}){const i=li(e);if(!i)return r("unknownValue");const o=Dl(e)[0];return o?a.jsx("button",{type:"button",className:"aops-as-ref-link is-inline",onClick:()=>n({kind:o.kind,id:o.id,boardId:o.boardId}),children:i}):i}function VA(e){return e==="tr"?"tr-TR":"en-US"}function hs(e){return e.createdAt??e.updatedAt??null}function gb(e){return Date.parse(hs(e)??"")||0}function Ic(e,n){if(!e)return"";const r=new Date(e);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(VA(n),{month:"short",day:"numeric"}).format(r)}function YA(e,n){if(!e)return"";const r=new Date(e);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(VA(n),{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(r)}function JA(e,n){if(!e)return"";const r=new Date(e);return Number.isNaN(r.getTime())?e:`${Ic(e,n)} · ${YA(e,n)}`}function yb(e,n){return Ic(e,n).toUpperCase()}function j2(e,n){if(!e.length)return"";const r=hs(e[0]),i=hs(e[e.length-1]);return!r||!i?"":`${Ic(r,n)} - ${Ic(i,n)}`}function A2(e,n=120){const r=(e.content??"").replace(/\s+/g," ").trim();return r.length<=n?r:`${r.slice(0,n-1).trim()}...`}function bb(e){return e?.kind??"none"}function x2(e){return e.map(r=>r.updatedAt??r.createdAt).filter(Boolean).sort((r,i)=>Date.parse(i??"")-Date.parse(r??""))[0]??null}function C2(e){const n=new Map;for(const r of e){const i=(r.kind??"note").trim()||"note";n.set(i,[...n.get(i)??[],r])}return[...n.entries()].map(([r,i])=>({kind:r,count:i.length,color:ni(r),latest:x2(i),durability:i.find(o=>o.durability)?.durability??null,rows:i})).sort((r,i)=>i.count-r.count||r.kind.localeCompare(i.kind))}function XA({expanded:e}){return a.jsxs("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[a.jsx("path",{d:"M3.5 8h9"}),e?null:a.jsx("path",{d:"M8 3.5v9"})]})}function Gc({open:e}){return a.jsx("svg",{className:e?"is-open":void 0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M5.5 3.5 10 8l-4.5 4.5"})})}function qc(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7"}),a.jsx("path",{d:"M20 20l-3.5-3.5"})]})}function WA(){return a.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M3 5h18l-7 8v6l-4-2v-4z"})})}function Vc({kind:e}){return a.jsx("i",{className:"aops-as-memory-dot",style:{backgroundColor:ni(e)},"aria-hidden":!0})}function ba({children:e,kind:n,muted:r=!1}){return a.jsx("span",{className:`aops-as-memory-chip${r?" is-muted":""}`,style:n&&!r?{borderColor:ni(n),color:ni(n)}:void 0,children:e})}function ZA({stats:e,value:n,onChange:r,t:i,compact:o=!1}){const d=e.slice(0,o?5:6),u=e.reduce((v,h)=>v+h.count,0);return a.jsxs("div",{className:`aops-as-memory-kindpills${o?" is-compact":""}`,"aria-label":i("asFieldKind"),children:[a.jsxs("button",{type:"button",className:n==="all"?"is-active":void 0,onClick:()=>r("all"),children:[i("asFilterAll")," ",a.jsx("span",{children:u})]}),d.map(v=>a.jsxs("button",{type:"button",className:n===v.kind?"is-active":void 0,onClick:()=>r(v.kind),children:[v.kind," ",a.jsx("span",{children:v.count})]},v.kind))]})}function k2({value:e,onChange:n,t:r}){const[i,o]=y.useState(!1),d=y.useRef(null),u=[{value:"updated",label:r("asMemorySortUpdated")},{value:"created",label:r("asMemorySortCreated")},{value:"kind",label:r("asMemorySortKind")},{value:"importance",label:r("asMemorySortImportance")}];return y.useEffect(()=>{if(!i)return;const v=m=>{d.current&&!d.current.contains(m.target)&&o(!1)},h=m=>{m.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",v),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",h)}},[i]),a.jsxs("div",{className:"aops-as-memory-sort",ref:d,children:[a.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,onClick:()=>o(v=>!v),children:[r("asMemorySortBy")," ",a.jsx("span",{"aria-hidden":!0,children:"v"})]}),i?a.jsx("div",{className:"aops-as-memory-sort-menu",role:"menu",children:u.map(v=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":v.value===e,className:v.value===e?"is-active":void 0,onClick:()=>{n(v.value),o(!1)},children:v.label},v.value))}):null]})}function S2({model:e,scopeKey:n,ui:r,setUi:i,viewMode:o,onOpenProjectmanRef:d,locale:u,t:v}){const h=ii().viewport==="mobile",[m,g]=y.useState("all"),[b,j]=y.useState(""),[C,k]=y.useState(null),[x,S]=y.useState(()=>new Set),T=y.useMemo(()=>C2(e.memoryItems),[e.memoryItems]),I=r.sortByScope[n]??"updated",E=J=>fs(i,re=>({...re,sortByScope:{...re.sortByScope,[n]:J}})),L=y.useMemo(()=>{const J=b.trim().toLowerCase();return e.memoryItems.filter(re=>m==="all"?!0:re.kind===m).filter(re=>J?y2(re).includes(J):!0).sort((re,oe)=>{if(I==="kind")return(re.kind??"").localeCompare(oe.kind??"")||Date.parse(oe.updatedAt??"")-Date.parse(re.updatedAt??"");if(I==="importance")return(oe.importance??-1)-(re.importance??-1)||Date.parse(oe.updatedAt??"")-Date.parse(re.updatedAt??"");const fe=I==="created"?re.createdAt:re.updatedAt,de=I==="created"?oe.createdAt:oe.updatedAt;return(Date.parse(de??"")||0)-(Date.parse(fe??"")||0)})},[m,e.memoryItems,b,I]),P=r.expandedByScope[n],N=y.useMemo(()=>new Set(P??(h?[]:L.slice(0,1).map(J=>J.id))),[L,h,P]),R=J=>fs(i,re=>{const oe=new Set(re.expandedByScope[n]??(h?[]:L.slice(0,1).map(fe=>fe.id)));return oe.has(J)?oe.delete(J):oe.add(J),{...re,expandedByScope:{...re.expandedByScope,[n]:[...oe]}}}),z=J=>fs(i,re=>({...re,expandedByScope:{...re.expandedByScope,[n]:J?L.map(oe=>oe.id):[]}})),ne=C?L.find(J=>J.id===C)??L[0]??null:L[0]??null,ye=J=>S(re=>{const oe=new Set(re);return oe.has(J)?oe.delete(J):oe.add(J),oe});return e.memoryItems.length===0?a.jsx(it,{variant:"empty",title:v("asSectionMemory"),message:v("asNoRecords")}):a.jsxs("div",{className:"aops-as-memory","data-testid":"aops-v2-as-memory-viewer","data-mode":o,children:[o==="timeline"?a.jsx(w2,{rows:e.memoryItems,stats:T,selectedId:C,locale:u,t:v,onOpenProjectmanRef:d,onSelect:k}):null,o==="cards"?a.jsx(I2,{rows:L,stats:T,query:b,sortKey:I,kindFilter:m,expandedIds:N,locale:u,t:v,onOpenProjectmanRef:d,onQueryChange:j,onSortChange:E,onKindChange:g,onToggleExpanded:R,onExpandAll:()=>z(!0),onCollapseAll:()=>z(!1)}):null,o==="read"?a.jsx(M2,{rows:L,stats:T,selected:ne,query:b,kindFilter:m,locale:u,t:v,onOpenProjectmanRef:d,onQueryChange:j,onKindChange:g,onSelect:k}):null,o==="digest"?a.jsx(T2,{rows:e.memoryItems,stats:T,collapsedKinds:x,locale:u,t:v,onOpenProjectmanRef:d,onToggleKind:ye}):null]})}function w2({rows:e,stats:n,selectedId:r,locale:i,t:o,onOpenProjectmanRef:d,onSelect:u}){const v=y.useMemo(()=>e.slice().sort((E,L)=>gb(E)-gb(L)||E.id.localeCompare(L.id)),[e]),h=y.useMemo(()=>v.slice().reverse(),[v]),m=r?e.find(E=>E.id===r)??null:h[0]??null,g=m?v.findIndex(E=>E.id===m.id):-1,b=g>0?v[g-1]:null,j=g>=0&&g<v.length-1?v[g+1]:null,C=34,k=v.length?Math.ceil(v.length/C)*C-v.length:0,x=new Set(h.map(E=>yb(hs(E),i)).filter(Boolean)).size,[S,T]=y.useState(!0),I=y.useMemo(()=>{const E=[];for(const L of h){const P=hs(L),N=P?yb(P,i):o("unknownValue"),R=N,z=E[E.length-1];z?.key===R?z.rows.push(L):E.push({key:R,label:N,rows:[L]})}return E},[i,h,o]);return y.useEffect(()=>{if(!h.length){r&&u(null);return}(!m||!e.some(E=>E.id===m.id))&&u(h[0].id)},[u,h,e,m,r]),e.length?a.jsxs("div",{className:`aops-as-memory-timeline${S?"":" is-preview-closed"}`,children:[a.jsxs("div",{className:"aops-as-memory-timeline-left",children:[a.jsxs("section",{className:"aops-as-memory-map-panel","aria-label":o("asMemoryMap"),children:[a.jsxs("div",{className:"aops-as-memory-map-head",children:[a.jsx("span",{children:o("asMemoryMap")}),a.jsxs("small",{children:[e.length," ",o("asMemoryBlocks")," · ",j2(v,i)]})]}),a.jsx("div",{className:"aops-as-memory-map-surface",children:a.jsxs("div",{className:"aops-as-memory-map-grid",children:[v.map((E,L)=>{const P=ni(E.kind),N=hs(E),R=m?.id===E.id;return a.jsx("button",{type:"button",className:`aops-as-memory-block${R?" is-selected":""}`,style:{backgroundColor:P},title:`${E.kind??"memory"} · ${Oe(E.id)}`,"aria-label":`${o("asSectionMemory")} ${L+1}: ${Il(E)}`,"aria-pressed":R,onClick:()=>{T(!0),u(E.id)},children:a.jsxs("span",{className:"aops-as-memory-map-popover",children:[a.jsxs("span",{className:"aops-as-memory-map-popover-head",children:[a.jsx("i",{style:{backgroundColor:P}}),E.kind?a.jsx(ba,{kind:E.kind,children:E.kind}):null,a.jsxs("b",{children:["uid ",Oe(E.id)]})]}),a.jsxs("span",{className:"aops-as-memory-map-popover-meta",children:[JA(N,i)," · ",E.sourceType??"source"]}),a.jsx("span",{className:"aops-as-memory-map-popover-text",children:A2(E)})]})},E.id)}),Array.from({length:k}).map((E,L)=>a.jsx("span",{className:"aops-as-memory-block is-free","aria-hidden":!0},`free-${L}`))]})}),a.jsxs("div",{className:"aops-as-memory-map-legend",children:[a.jsx("span",{children:o("asMemoryOlder")}),n.map(E=>a.jsxs("span",{children:[a.jsx("i",{style:{backgroundColor:E.kind==="note"?"#CBBBA0":E.color}})," ",E.kind]},E.kind)),a.jsx("span",{children:o("asMemoryNewer")})]})]}),a.jsxs("section",{className:"aops-as-memory-timeline-rail","aria-label":o("asMemoryTimeline"),children:[a.jsxs("header",{children:[a.jsx("span",{children:o("asMemoryTimeline")}),a.jsx("small",{children:o("asMemoryNewestFirst")}),a.jsx("b",{children:o("asMemoryAllKinds")}),a.jsxs("em",{children:[x," ",o("asMemoryDaysShown")]})]}),a.jsx("div",{className:"aops-as-memory-rail-body",children:I.map(E=>a.jsxs("div",{className:"aops-as-memory-rail-day",children:[a.jsx("div",{className:"aops-as-memory-rail-daylabel",children:E.label}),E.rows.map(L=>{const P=hs(L),N=m?.id===L.id;return a.jsxs("button",{type:"button",className:`aops-as-memory-rail-entry${N?" is-selected":""}`,onClick:()=>{T(!0),u(L.id)},children:[a.jsx(Vc,{kind:L.kind}),a.jsx("time",{children:YA(P,i)}),L.kind?a.jsx(ba,{kind:L.kind,children:L.kind}):null,a.jsx("span",{children:Il(L)})]},L.id)})]},E.key))})]})]}),S?a.jsx(N2,{row:m,blockIndex:g,total:v.length,previous:b,next:j,locale:i,t:o,onOpenProjectmanRef:d,onClose:()=>T(!1)}):null]}):a.jsx("div",{className:"aops-as-memory-empty",children:o("asNoRecords")})}function N2({row:e,blockIndex:n,total:r,previous:i,next:o,locale:d,t:u,onOpenProjectmanRef:v,onClose:h}){if(!e)return a.jsx("section",{className:"aops-as-memory-timeline-preview",children:a.jsx(it,{variant:"empty",title:u("asSectionMemory"),message:u("asNoRecords")})});const m=nm(e),g=hs(e),b=li(e);return a.jsxs("section",{className:"aops-as-memory-timeline-preview",children:[a.jsxs("div",{className:"aops-as-memory-preview-head",children:[a.jsxs("div",{className:"aops-as-memory-preview-title",children:[a.jsxs("div",{className:"aops-as-memory-reader-eyebrow",style:{color:ni(e.kind)},children:[u("asSectionMemory")," · ",e.kind??"note"]}),m.title?a.jsx("h3",{children:m.title}):null]}),a.jsx("button",{type:"button",className:"aops-pm-boardcard-action aops-as-memory-preview-close","aria-label":u("pmCardPaneClose"),title:u("pmCardPaneClose"),onClick:h,children:mn})]}),a.jsxs("div",{className:"aops-as-memory-reader-chips",children:[e.kind?a.jsx(ba,{kind:e.kind,children:e.kind}):null,e.durability?a.jsx(ba,{muted:!0,children:e.durability}):null,a.jsx("span",{className:"aops-as-memory-reader-uid",children:Oe(e.id)})]}),a.jsxs("div",{className:"aops-as-memory-timeline-infobar",children:[JA(g,d)," · ",u("asMemoryBlock")," ",n+1," / ",r]}),a.jsxs("section",{className:"aops-as-memory-reader-content",children:[a.jsx("span",{children:u("asMemoryContent")}),a.jsx("p",{children:m.body})]}),a.jsxs("dl",{className:"aops-as-memory-read-dl is-timeline",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("asFieldSource")}),a.jsx("dd",{children:b?a.jsx(Hc,{row:e,onOpen:v,t:u}):u("unknownValue")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("asMemoryCreated")}),a.jsx("dd",{children:tt(e.createdAt,d)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("asMemoryNeighbors")}),a.jsxs("dd",{className:"aops-pm-mono",children:["← ",bb(i)," · ",bb(o)," →"]})]})]}),a.jsx(js,{refs:Dl(e),onOpen:v,t:u}),e.tags?.length?a.jsx("div",{className:"aops-as-memory-tags is-reader",children:e.tags.map(j=>a.jsx("span",{className:j.startsWith("project:")?"is-project":void 0,children:j},j))}):null]})}function I2({rows:e,stats:n,query:r,sortKey:i,kindFilter:o,expandedIds:d,locale:u,t:v,onOpenProjectmanRef:h,onQueryChange:m,onSortChange:g,onKindChange:b,onToggleExpanded:j,onExpandAll:C,onCollapseAll:k}){const[x,S]=y.useState(ps);y.useEffect(()=>{S(ps)},[o,r,e.length,i]);const T=e.slice(0,x),I=Math.min(x,e.length);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"aops-as-memory-toolbar",children:[a.jsx("span",{className:"aops-as-memory-tool-icon",children:WA()}),a.jsx(k2,{value:i,onChange:g,t:v}),a.jsx("span",{className:"aops-as-memory-divider","aria-hidden":!0}),a.jsx(ZA,{stats:n,value:o,onChange:b,t:v}),a.jsxs("label",{className:"aops-as-memory-search",children:[qc(),a.jsx("input",{type:"search",value:r,placeholder:`${v("asSearchMemory")}...`,"aria-label":v("asSearchMemory"),onChange:E=>m(E.currentTarget.value)})]}),a.jsx("button",{type:"button",className:"aops-as-memory-linkbtn",onClick:C,children:v("pmCardsExpandAll")}),a.jsx("button",{type:"button",className:"aops-as-memory-linkbtn",onClick:k,children:v("pmCardsCollapseAll")})]}),a.jsx("div",{className:"aops-as-memory-cards",children:e.length?T.map(E=>a.jsx(E2,{row:E,expanded:d.has(E.id),locale:u,t:v,onOpenProjectmanRef:h,onToggle:()=>j(E.id)},E.id)):a.jsx("div",{className:"aops-as-memory-empty",children:v("asNoRecords")})}),e.length>ps?a.jsxs("div",{className:"aops-as-memory-pagebar",children:[a.jsxs("span",{children:[I," / ",e.length]}),I<e.length?a.jsx("button",{type:"button",className:"aops-as-memory-linkbtn",onClick:()=>S(E=>E+ps),children:v("asPageLoadMore")}):null]}):null]})}function E2({row:e,expanded:n,locale:r,t:i,onOpenProjectmanRef:o,onToggle:d}){const u=li(e),v=Dl(e);return a.jsxs("article",{className:`aops-as-memory-card${n?" is-expanded":""}`,children:[a.jsxs("header",{className:"aops-as-memory-card-head",children:[a.jsxs("button",{type:"button",className:"aops-as-memory-toggle",onClick:d,"aria-expanded":n,children:[a.jsx("span",{className:"aops-as-memory-toggle-icon",children:a.jsx(XA,{expanded:n})}),a.jsx("span",{className:"aops-as-memory-mobile-back-arrow","aria-hidden":!0,children:"←"}),a.jsx("span",{className:"aops-as-memory-mobile-back-label",children:i("pmCardPaneClose")})]}),a.jsx(Vc,{kind:e.kind}),a.jsx("h3",{title:e.content??e.id,children:Il(e)}),e.kind?a.jsx(ba,{kind:e.kind,children:e.kind}):null,e.durability?a.jsx(ba,{muted:!0,children:e.durability}):null,u?a.jsx("span",{className:"aops-as-memory-card-source",children:u}):null,a.jsx("span",{className:"aops-as-memory-card-spacer","aria-hidden":!0}),a.jsx("button",{type:"button",className:"aops-as-memory-chevron",onClick:d,"aria-label":i(n?"pmCardsCollapseAll":"pmCardsExpandAll"),children:a.jsx(Gc,{open:n})})]}),a.jsxs("div",{className:"aops-as-memory-card-meta",children:[i("asMemoryCreated")," ",tt(e.createdAt,r)," · ",i("asFieldUpdated")," ",tt(e.updatedAt,r)," · uid ",Oe(e.id)]}),n?a.jsxs("div",{className:"aops-as-memory-card-expanded",children:[a.jsxs("dl",{className:"aops-as-memory-fieldgrid",children:[a.jsxs("div",{children:[a.jsx("dt",{children:i("asFieldKind")}),a.jsx("dd",{children:e.kind??i("unknownValue")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("asFieldDurability")}),a.jsx("dd",{children:e.durability??i("unknownValue")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("asFieldSource")}),a.jsx("dd",{className:"aops-pm-mono",children:a.jsx(Hc,{row:e,onOpen:o,t:i})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:i("asFieldUpdated")}),a.jsx("dd",{children:tt(e.updatedAt,r)})]})]}),a.jsxs("div",{className:"aops-as-memory-body",children:[a.jsx("span",{children:i("asSectionMemory")}),a.jsx("p",{children:e.content??""})]}),a.jsx(js,{refs:v,onOpen:o,t:i}),e.tags?.length?a.jsx("div",{className:"aops-as-memory-tags",children:e.tags.map(h=>a.jsx("span",{className:h.startsWith("project:")?"is-project":void 0,children:h},h))}):null]}):null]})}function M2({rows:e,stats:n,selected:r,query:i,kindFilter:o,locale:d,t:u,onOpenProjectmanRef:v,onQueryChange:h,onKindChange:m,onSelect:g}){return a.jsxs("div",{className:"aops-as-memory-read",children:[a.jsxs("aside",{className:"aops-as-memory-index",children:[a.jsxs("label",{className:"aops-as-memory-search is-index",children:[qc(),a.jsx("input",{type:"search",value:i,placeholder:`${u("asSearchMemory")} ${n.reduce((b,j)=>b+j.count,0)}`,"aria-label":u("asSearchMemory"),onChange:b=>h(b.currentTarget.value)})]}),a.jsx(ZA,{stats:n,value:o,onChange:m,t:u,compact:!0}),a.jsx("div",{className:"aops-as-memory-index-list",children:e.map(b=>a.jsxs("button",{type:"button",className:r?.id===b.id?"is-selected":void 0,onClick:()=>g(b.id),children:[a.jsx(Vc,{kind:b.kind}),a.jsxs("span",{children:[a.jsx("b",{children:Il(b)}),a.jsxs("small",{children:[b.kind??"note"," · ",b.durability??"short"," · ",tt(b.updatedAt,d)]})]})]},b.id))})]}),a.jsx("section",{className:"aops-as-memory-reader",children:r?(()=>{const b=nm(r);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"aops-as-memory-reader-eyebrow",children:[u("asSectionMemory")," · ",r.kind??"note"]}),b.title?a.jsx("h3",{children:b.title}):null,a.jsxs("div",{className:"aops-as-memory-reader-chips",children:[r.kind?a.jsx(ba,{kind:r.kind,children:r.kind}):null,r.durability?a.jsx(ba,{muted:!0,children:r.durability}):null,r.importance!=null?a.jsxs(ba,{muted:!0,children:[u("asFieldImportance")," ",r.importance]}):null,a.jsxs("span",{className:"aops-as-memory-reader-uid",children:["uid ",Oe(r.id)]})]}),a.jsxs("section",{className:"aops-as-memory-reader-content",children:[a.jsx("span",{children:u("asMemoryContent")}),a.jsx("p",{children:b.body})]}),a.jsxs("dl",{className:"aops-as-memory-read-dl",children:[a.jsxs("div",{children:[a.jsx("dt",{children:u("asFieldKind")}),a.jsx("dd",{children:r.kind??u("unknownValue")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("asFieldDurability")}),a.jsx("dd",{children:r.durability??u("unknownValue")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("asFieldSource")}),a.jsx("dd",{children:a.jsx(Hc,{row:r,onOpen:v,t:u})})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("asFieldImportance")}),a.jsx("dd",{children:r.importance??u("unknownValue")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("asMemoryCreated")}),a.jsx("dd",{children:tt(r.createdAt,d)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:u("asMemoryScope")}),a.jsx("dd",{children:Nc(r)?Oe(Nc(r)??""):u("unknownValue")})]})]}),a.jsx(js,{refs:Dl(r),onOpen:v,t:u}),r.tags?.length?a.jsxs("div",{className:"aops-as-memory-tags is-reader",children:[a.jsx("span",{className:"aops-as-memory-taglabel",children:u("asMemoryTags")}),r.tags.map(j=>a.jsx("span",{className:j.startsWith("project:")?"is-project":void 0,children:j},j))]}):null]})})():a.jsx(it,{variant:"empty",title:u("asSectionMemory"),message:u("asNoRecords")})})]})}function T2({rows:e,stats:n,collapsedKinds:r,locale:i,t:o,onOpenProjectmanRef:d,onToggleKind:u}){const v=e.length||1,[h,m]=y.useState(null),[g,b]=y.useState({});y.useEffect(()=>{m(null),b({})},[e]);const j=h?e.find(C=>C.id===h)??null:null;return a.jsxs("div",{className:`aops-as-memory-digest${j?" has-pane":""}`,children:[a.jsxs("section",{className:"aops-as-memory-breakdown",children:[a.jsxs("div",{className:"aops-as-memory-breakdown-head",children:[a.jsxs("span",{children:[e.length," ",o("asSectionMemory")," · ",o("asMemoryByKind")]}),a.jsxs("small",{children:[n.length," ",o("asFieldKind")," · scope ",Nc(e[0])?Oe(Nc(e[0])??""):o("unknownValue")]})]}),a.jsx("div",{className:"aops-as-memory-stackbar","aria-hidden":!0,children:n.map(C=>a.jsx("span",{style:{width:`${Math.max(2,C.count/v*100)}%`,backgroundColor:C.color}},C.kind))}),a.jsx("div",{className:"aops-as-memory-legend",children:n.map(C=>a.jsxs("span",{children:[a.jsx("i",{style:{backgroundColor:C.color}})," ",C.kind," ",a.jsx("b",{children:C.count})]},C.kind))})]}),a.jsx("section",{className:"aops-as-memory-digest-card",children:n.map(C=>{const k=r.has(C.kind),x=g[C.kind]??$A,S=C.rows.slice(0,x),T=Math.max(0,C.rows.length-S.length);return a.jsxs("div",{className:"aops-as-memory-digest-section",children:[a.jsxs("button",{type:"button",className:k?void 0:"is-open",onClick:()=>u(C.kind),children:[a.jsx(Gc,{open:!k}),a.jsx(Vc,{kind:C.kind}),a.jsx("span",{children:C.kind}),a.jsx("b",{children:C.count}),a.jsxs("small",{children:[C.durability??"short"," · ",o("asMemoryLatest")," ",tt(C.latest,i)]})]}),k?null:a.jsxs("div",{className:"aops-as-memory-digest-rows",children:[S.map(I=>a.jsxs("div",{className:`aops-as-memory-digest-row${h===I.id?" is-selected":""}`,children:[a.jsx("button",{type:"button",className:"aops-as-memory-digest-title",onClick:()=>m(I.id),children:Il(I)}),a.jsx("small",{children:li(I)??Oe(I.id)}),I.durability?a.jsx(ba,{muted:!0,children:I.durability}):null,a.jsx("time",{children:tt(I.updatedAt,i)}),a.jsx("button",{type:"button",className:"aops-as-memory-rowlink",onClick:()=>m(I.id),children:o("asOpenDigestPane")})]},I.id)),T?a.jsxs("button",{type:"button",className:"aops-as-memory-showmore",onClick:()=>b(I=>({...I,[C.kind]:S.length+HA})),children:[o("asMemoryShowMore")," ",T," ",C.kind]}):null]})]},C.kind)})}),j?a.jsx(B2,{row:j,locale:i,t:o,onOpenProjectmanRef:d,onClose:()=>m(null)}):null]})}function B2({row:e,locale:n,t:r,onOpenProjectmanRef:i,onClose:o}){const d=li(e),u=nm(e);return a.jsxs("aside",{className:"aops-as-memory-digest-pane",children:[a.jsxs("div",{className:"aops-as-memory-digest-pane-head",children:[a.jsxs("span",{children:[r("asSectionMemory")," · ",e.kind??"note"]}),a.jsx("button",{type:"button",onClick:o,children:r("asCloseDigestPane")})]}),u.title?a.jsx("h3",{children:u.title}):null,a.jsx("p",{children:u.body}),a.jsx(js,{refs:Dl(e),onOpen:i,t:r}),a.jsxs("dl",{children:[a.jsxs("div",{children:[a.jsx("dt",{children:r("asFieldSource")}),a.jsx("dd",{children:d?a.jsx(Hc,{row:e,onOpen:i,t:r}):r("unknownValue")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:r("asFieldDurability")}),a.jsx("dd",{children:e.durability??r("unknownValue")})]}),a.jsxs("div",{children:[a.jsx("dt",{children:r("asFieldUpdated")}),a.jsx("dd",{children:tt(e.updatedAt,n)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"uid"}),a.jsx("dd",{children:Oe(e.id)})]})]})]})}function D2(e){return[e.title,e.status,e.eyebrow,e.searchText,...e.chips.map(n=>n.label),...e.fields.flatMap(n=>[n.label,n.value]),...(e.body??[]).flatMap(n=>[n.heading,n.text]),...e.tags??[]].filter(Boolean).join(" ").toLowerCase()}function Ec(e){const n=(e??"").toLowerCase();return["active","open","ready","running","in-progress","in_progress"].includes(n)?"#5B8B6F":["completed","complete","done","resolved","concluded","closed"].includes(n)?"#4A6B91":["draft","pending","planned","todo","queued"].includes(n)?"#E89A4A":["blocked","error","failed","cancelled","canceled"].includes(n)?"#B3503C":"#D2C2A4"}function vs(e,n){return e.status??n("pmUnknownStatus")}function Ys(e,n){return n==="created"?e.createdAt:e.updatedAt??e.createdAt}function R2(e,n){const r=new Map;for(const i of e){const o=vs(i,n);r.set(o,[...r.get(o)??[],i])}return[...r.entries()].map(([i,o])=>({status:i,count:o.length,color:Ec(i),latest:L2(o),rows:o})).sort((i,o)=>o.count-i.count||i.status.localeCompare(o.status))}function L2(e){return e.map(n=>n.updatedAt??n.createdAt).filter(Boolean).sort((n,r)=>Date.parse(r??"")-Date.parse(n??""))[0]??null}function sm({status:e}){return a.jsx("i",{className:"aops-as-memory-dot",style:{backgroundColor:Ec(e)},"aria-hidden":!0})}function ex({status:e,children:n}){return a.jsx("span",{className:"aops-as-memory-chip",style:{borderColor:Ec(e),color:Ec(e)},children:n})}function tx({stats:e,value:n,onChange:r,t:i,compact:o=!1}){const d=e.reduce((u,v)=>u+v.count,0);return a.jsxs("div",{className:`aops-as-memory-kindpills${o?" is-compact":""}`,"aria-label":i("pmFieldStatus"),children:[a.jsxs("button",{type:"button",className:n==="all"?"is-active":void 0,onClick:()=>r("all"),children:[i("asFilterAll")," ",a.jsx("span",{children:d})]}),e.slice(0,o?5:6).map(u=>a.jsxs("button",{type:"button",className:n===u.status?"is-active":void 0,onClick:()=>r(u.status),children:[u.status," ",a.jsx("span",{children:u.count})]},u.status))]})}function O2({value:e,onChange:n,t:r}){const[i,o]=y.useState(!1),d=y.useRef(null),u=[{value:"updated",label:r("asMemorySortUpdated")},{value:"created",label:r("asMemorySortCreated")},{value:"status",label:r("pmFieldStatus")},{value:"title",label:r("pmCardsSortName")}];return y.useEffect(()=>{if(!i)return;const v=m=>{d.current&&!d.current.contains(m.target)&&o(!1)},h=m=>{m.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",v),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",h)}},[i]),a.jsxs("div",{className:"aops-as-memory-sort",ref:d,children:[a.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,onClick:()=>o(v=>!v),children:[r("asMemorySortBy")," ",a.jsx("span",{"aria-hidden":!0,children:"v"})]}),i?a.jsx("div",{className:"aops-as-memory-sort-menu",role:"menu",children:u.map(v=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":v.value===e,className:v.value===e?"is-active":void 0,onClick:()=>{n(v.value),o(!1)},children:v.label},v.value))}):null]})}function _2(e,n){return e.slice().sort((r,i)=>{if(n==="status")return(r.status??"").localeCompare(i.status??"")||(Date.parse(Ys(i,"updated")??"")||0)-(Date.parse(Ys(r,"updated")??"")||0);if(n==="title")return r.title.localeCompare(i.title);const o=n==="created"?"created":"updated";return(Date.parse(Ys(i,o)??"")||0)-(Date.parse(Ys(r,o)??"")||0)})}function Q2({title:e,searchLabel:n,emptyLabel:r,items:i,scopeKey:o,ui:d,setUi:u,viewMode:v,locale:h,t:m,onOpenProjectmanRef:g,cardDetailExtra:b,detailExtra:j}){const C=ii().viewport==="mobile",[k,x]=y.useState("all"),[S,T]=y.useState(""),[I,E]=y.useState(null),[L,P]=y.useState(()=>new Set),N=y.useMemo(()=>R2(i,m),[i,m]),R=d.sortByScope[o]??"updated",z=G=>fs(u,Q=>({...Q,sortByScope:{...Q.sortByScope,[o]:G}})),ne=y.useMemo(()=>{const G=S.trim().toLowerCase(),Q=i.filter(W=>k==="all"?!0:vs(W,m)===k).filter(W=>G?D2(W).includes(G):!0);return _2(Q,R)},[i,S,R,k,m]),ye=d.expandedByScope[o],J=y.useMemo(()=>new Set(ye??(C?[]:ne.slice(0,1).map(G=>G.id))),[ne,C,ye]),re=G=>fs(u,Q=>{const W=new Set(Q.expandedByScope[o]??(C?[]:ne.slice(0,1).map(pe=>pe.id)));return W.has(G)?W.delete(G):W.add(G),{...Q,expandedByScope:{...Q.expandedByScope,[o]:[...W]}}}),oe=I?ne.find(G=>G.id===I)??ne[0]??null:ne[0]??null,fe=G=>fs(u,Q=>({...Q,expandedByScope:{...Q.expandedByScope,[o]:G?ne.map(W=>W.id):[]}})),de=G=>P(Q=>{const W=new Set(Q);return W.has(G)?W.delete(G):W.add(G),W});return i.length===0?a.jsx(it,{variant:"empty",title:e,message:r}):a.jsxs("div",{className:"aops-as-memory aops-as-record","data-testid":`aops-v2-${o}-viewer`,"data-mode":v,children:[v==="cards"?a.jsx(U2,{rows:ne,stats:N,query:S,statusFilter:k,sortKey:R,expandedIds:J,searchLabel:n,locale:h,t:m,onOpenProjectmanRef:g,detailExtra:b,onQueryChange:T,onStatusChange:x,onSortChange:z,onToggleExpanded:re,onExpandAll:()=>fe(!0),onCollapseAll:()=>fe(!1)}):null,v==="read"?a.jsx(F2,{rows:ne,stats:N,selected:oe,query:S,statusFilter:k,title:e,searchLabel:n,locale:h,t:m,onOpenProjectmanRef:g,detailExtra:j,onQueryChange:T,onStatusChange:x,onSelect:E}):null,v==="digest"?a.jsx(K2,{title:e,rows:i,stats:N,collapsedStatuses:L,locale:h,t:m,onOpenProjectmanRef:g,onToggleStatus:de}):null]})}function U2({rows:e,stats:n,query:r,statusFilter:i,sortKey:o,expandedIds:d,searchLabel:u,locale:v,t:h,onOpenProjectmanRef:m,detailExtra:g,onQueryChange:b,onStatusChange:j,onSortChange:C,onToggleExpanded:k,onExpandAll:x,onCollapseAll:S}){const[T,I]=y.useState(ps);y.useEffect(()=>{I(ps)},[r,e.length,o,i]);const E=e.slice(0,T),L=Math.min(T,e.length);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"aops-as-memory-toolbar",children:[a.jsx("span",{className:"aops-as-memory-tool-icon",children:WA()}),a.jsx(O2,{value:o,onChange:C,t:h}),a.jsx("span",{className:"aops-as-memory-divider","aria-hidden":!0}),a.jsx(tx,{stats:n,value:i,onChange:j,t:h}),a.jsxs("label",{className:"aops-as-memory-search",children:[qc(),a.jsx("input",{type:"search",value:r,placeholder:`${u}...`,"aria-label":u,onChange:P=>b(P.currentTarget.value)})]}),a.jsx("button",{type:"button",className:"aops-as-memory-linkbtn",onClick:x,children:h("pmCardsExpandAll")}),a.jsx("button",{type:"button",className:"aops-as-memory-linkbtn",onClick:S,children:h("pmCardsCollapseAll")})]}),a.jsx("div",{className:"aops-as-memory-cards",children:e.length?E.map(P=>a.jsx(P2,{item:P,expanded:d.has(P.id),locale:v,t:h,onOpenProjectmanRef:m,detailExtra:g,onToggle:()=>k(P.id)},P.id)):a.jsx("div",{className:"aops-as-memory-empty",children:h("asNoRecords")})}),e.length>ps?a.jsxs("div",{className:"aops-as-memory-pagebar",children:[a.jsxs("span",{children:[L," / ",e.length]}),L<e.length?a.jsx("button",{type:"button",className:"aops-as-memory-linkbtn",onClick:()=>I(P=>P+ps),children:h("asPageLoadMore")}):null]}):null]})}function P2({item:e,expanded:n,locale:r,t:i,onOpenProjectmanRef:o,detailExtra:d,onToggle:u}){return a.jsxs("article",{className:`aops-as-memory-card${n?" is-expanded":""}`,children:[a.jsxs("header",{className:"aops-as-memory-card-head",children:[a.jsxs("button",{type:"button",className:"aops-as-memory-toggle",onClick:u,"aria-expanded":n,children:[a.jsx("span",{className:"aops-as-memory-toggle-icon",children:a.jsx(XA,{expanded:n})}),a.jsx("span",{className:"aops-as-memory-mobile-back-arrow","aria-hidden":!0,children:"←"}),a.jsx("span",{className:"aops-as-memory-mobile-back-label",children:i("pmCardPaneClose")})]}),a.jsx(sm,{status:e.status}),a.jsx("h3",{title:e.title,children:e.title}),a.jsx(ex,{status:e.status,children:vs(e,i)}),e.chips.slice(0,2).map((v,h)=>a.jsx(ba,{muted:!0,children:v.label},`${v.label}-${h}`)),a.jsxs("span",{className:"aops-as-memory-card-source",children:["uid ",Oe(e.id)]}),a.jsx("span",{className:"aops-as-memory-card-spacer","aria-hidden":!0}),a.jsx("button",{type:"button",className:"aops-as-memory-chevron",onClick:u,"aria-label":i(n?"pmCardsCollapseAll":"pmCardsExpandAll"),children:a.jsx(Gc,{open:n})})]}),a.jsxs("div",{className:"aops-as-memory-card-meta",children:[i("asMemoryCreated")," ",tt(e.createdAt,r)," · ",i("asFieldUpdated")," ",tt(e.updatedAt,r)," · uid ",Oe(e.id)]}),n?a.jsxs("div",{className:"aops-as-memory-card-expanded",children:[a.jsx("dl",{className:"aops-as-memory-fieldgrid",children:e.fields.slice(0,4).map(v=>a.jsxs("div",{children:[a.jsx("dt",{children:v.label}),a.jsx("dd",{children:v.value??i("unknownValue")})]},v.label))}),(e.body??[]).map(v=>a.jsxs("div",{className:"aops-as-memory-body",children:[a.jsx("span",{children:v.heading}),a.jsx("p",{children:v.text||i("unknownValue")})]},v.heading)),a.jsx(js,{refs:e.refs,onOpen:o,t:i}),e.tags?.length?a.jsx("div",{className:"aops-as-memory-tags",children:e.tags.map(v=>a.jsx("span",{children:v},v))}):null,d?a.jsx("div",{className:"aops-as-record-extra",children:d(e)}):null]}):null]})}function F2({rows:e,stats:n,selected:r,query:i,statusFilter:o,title:d,searchLabel:u,locale:v,t:h,onOpenProjectmanRef:m,detailExtra:g,onQueryChange:b,onStatusChange:j,onSelect:C}){return a.jsxs("div",{className:"aops-as-memory-read",children:[a.jsxs("aside",{className:"aops-as-memory-index",children:[a.jsxs("label",{className:"aops-as-memory-search is-index",children:[qc(),a.jsx("input",{type:"search",value:i,placeholder:`${u} ${n.reduce((k,x)=>k+x.count,0)}`,"aria-label":u,onChange:k=>b(k.currentTarget.value)})]}),a.jsx(tx,{stats:n,value:o,onChange:j,t:h,compact:!0}),a.jsxs("div",{className:"aops-as-memory-index-list",children:[e.map(k=>a.jsxs("button",{type:"button",className:r?.id===k.id?"is-selected":void 0,onClick:()=>C(k.id),children:[a.jsx(sm,{status:k.status}),a.jsxs("span",{children:[a.jsx("b",{children:k.title}),a.jsxs("small",{children:[vs(k,h)," · ",tt(Ys(k,"updated"),v)," · uid ",Oe(k.id)]})]})]},k.id)),e.length===0?a.jsx("div",{className:"aops-as-memory-empty",children:h("asNoRecords")}):null]})]}),a.jsx("section",{className:"aops-as-memory-reader",children:r?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"aops-as-memory-reader-eyebrow",children:[d," · ",vs(r,h)]}),a.jsx("h3",{children:r.title}),a.jsxs("div",{className:"aops-as-memory-reader-chips",children:[a.jsx(ex,{status:r.status,children:vs(r,h)}),r.chips.slice(0,3).map((k,x)=>a.jsx(ba,{muted:!0,children:k.label},`${k.label}-${x}`)),a.jsxs("span",{className:"aops-as-memory-reader-uid",children:["uid ",Oe(r.id)]})]}),(r.body??[]).map(k=>a.jsxs("section",{className:"aops-as-memory-reader-content",children:[a.jsx("span",{children:k.heading}),a.jsx("p",{children:k.text||h("unknownValue")})]},k.heading)),a.jsxs("dl",{className:"aops-as-memory-read-dl",children:[r.fields.map(k=>a.jsxs("div",{children:[a.jsx("dt",{children:k.label}),a.jsx("dd",{children:k.value??h("unknownValue")})]},k.label)),a.jsxs("div",{children:[a.jsx("dt",{children:h("asMemoryCreated")}),a.jsx("dd",{children:tt(r.createdAt,v)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:h("asFieldUpdated")}),a.jsx("dd",{children:tt(r.updatedAt,v)})]})]}),a.jsx(js,{refs:r.refs,onOpen:m,t:h}),r.tags?.length?a.jsxs("div",{className:"aops-as-memory-tags is-reader",children:[a.jsx("span",{className:"aops-as-memory-taglabel",children:h("asMemoryTags")}),r.tags.map(k=>a.jsx("span",{children:k},k))]}):null,g?a.jsx("div",{className:"aops-as-record-extra is-reader",children:g(r)}):null]}):a.jsx(it,{variant:"empty",title:d,message:h("asNoRecords")})})]})}function K2({title:e,rows:n,stats:r,collapsedStatuses:i,locale:o,t:d,onOpenProjectmanRef:u,onToggleStatus:v}){const h=n.length||1,[m,g]=y.useState(null),[b,j]=y.useState({});y.useEffect(()=>{g(null),j({})},[n]);const C=m?n.find(k=>k.id===m)??null:null;return a.jsxs("div",{className:`aops-as-memory-digest${C?" has-pane":""}`,children:[a.jsxs("section",{className:"aops-as-memory-breakdown",children:[a.jsxs("div",{className:"aops-as-memory-breakdown-head",children:[a.jsxs("span",{children:[n.length," ",e," · ",d("pmFieldStatus")]}),a.jsxs("small",{children:[r.length," ",d("pmFieldStatus")]})]}),a.jsx("div",{className:"aops-as-memory-stackbar","aria-hidden":!0,children:r.map(k=>a.jsx("span",{style:{width:`${Math.max(2,k.count/h*100)}%`,backgroundColor:k.color}},k.status))}),a.jsx("div",{className:"aops-as-memory-legend",children:r.map(k=>a.jsxs("span",{children:[a.jsx("i",{style:{backgroundColor:k.color}})," ",k.status," ",a.jsx("b",{children:k.count})]},k.status))})]}),a.jsx("section",{className:"aops-as-memory-digest-card",children:r.map(k=>{const x=i.has(k.status),S=b[k.status]??$A,T=k.rows.slice(0,S),I=Math.max(0,k.rows.length-T.length);return a.jsxs("div",{className:"aops-as-memory-digest-section",children:[a.jsxs("button",{type:"button",className:x?void 0:"is-open",onClick:()=>v(k.status),children:[a.jsx(Gc,{open:!x}),a.jsx(sm,{status:k.status}),a.jsx("span",{children:k.status}),a.jsx("b",{children:k.count}),a.jsxs("small",{children:[d("asMemoryLatest")," ",tt(k.latest,o)]})]}),x?null:a.jsxs("div",{className:"aops-as-memory-digest-rows",children:[T.map(E=>a.jsxs("div",{className:`aops-as-memory-digest-row${m===E.id?" is-selected":""}`,children:[a.jsx("button",{type:"button",className:"aops-as-memory-digest-title",onClick:()=>g(E.id),children:E.title}),a.jsxs("small",{children:["uid ",Oe(E.id)]}),a.jsx(ba,{muted:!0,children:vs(E,d)}),E.chips.filter(L=>L.tone==="coral").slice(0,1).map((L,P)=>a.jsx(ba,{muted:!0,children:L.label},`${L.label}-${P}`)),a.jsx("time",{children:tt(Ys(E,"updated"),o)}),a.jsx("button",{type:"button",className:"aops-as-memory-rowlink",onClick:()=>g(E.id),children:d("asOpenDigestPane")})]},E.id)),I?a.jsxs("button",{type:"button",className:"aops-as-memory-showmore",onClick:()=>j(E=>({...E,[k.status]:T.length+HA})),children:[d("asMemoryShowMore")," ",I," ",k.status]}):null]})]},k.status)})}),C?a.jsx(z2,{item:C,title:e,locale:o,t:d,onOpenProjectmanRef:u,onClose:()=>g(null)}):null]})}function z2({item:e,title:n,locale:r,t:i,onOpenProjectmanRef:o,onClose:d}){return a.jsxs("aside",{className:"aops-as-memory-digest-pane",children:[a.jsxs("div",{className:"aops-as-memory-digest-pane-head",children:[a.jsxs("span",{children:[n," · ",vs(e,i)]}),a.jsx("button",{type:"button",onClick:d,children:i("asCloseDigestPane")})]}),a.jsx("h3",{children:e.title}),(e.body??[]).map(u=>a.jsxs("section",{children:[a.jsx("span",{children:u.heading}),a.jsx("p",{children:u.text||i("unknownValue")})]},u.heading)),a.jsx(js,{refs:e.refs,onOpen:o,t:i}),a.jsxs("dl",{children:[e.fields.slice(0,6).map(u=>a.jsxs("div",{children:[a.jsx("dt",{children:u.label}),a.jsx("dd",{children:u.value??i("unknownValue")})]},u.label)),a.jsxs("div",{children:[a.jsx("dt",{children:i("asFieldUpdated")}),a.jsx("dd",{children:tt(Ys(e,"updated"),r)})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"uid"}),a.jsx("dd",{children:Oe(e.id)})]})]})]})}function $2({model:e,topicId:n,locale:r,t:i}){const o=t2({model:e,topicId:n});if(o.isPending)return a.jsx("p",{className:"aops-pm-muted",children:i("asLoadingMessage")});if(o.error)return a.jsx("p",{className:"aops-pm-error-line",children:It(o.error,"agentspace_unavailable")});const d=o.data?.topic??e.discussions.find(m=>m.id===n)??null,u=(o.data?.turns??[]).slice().sort((m,g)=>(m.seq??0)-(g.seq??0)),v=g2(o.data?.outputs??[]),h=d?qA(d,i):null;return a.jsxs("div",{className:"aops-as-thread",children:[a.jsxs("h5",{className:"aops-as-thread-title",children:[i("asTurns")," ",a.jsx("span",{className:"aops-pm-mono",children:u.length})]}),h?a.jsx("p",{className:"aops-pm-error-line",children:h}):null,u.length===0?a.jsx("p",{className:"aops-pm-muted",children:i("asNoTurns")}):null,u.length?a.jsx("div",{className:"aops-as-turn-list",children:u.map(m=>a.jsxs("article",{className:"aops-as-turn is-turn",children:[a.jsx("i",{className:"aops-as-turn-dot",style:{backgroundColor:p2(m.kind)},"aria-hidden":!0}),a.jsxs("header",{className:"aops-as-turn-head",children:[a.jsxs("span",{className:"aops-pm-mono",children:["#",m.seq??"—"]}),a.jsx("b",{children:m.agentId??"?"}),m.kind?a.jsx("span",{className:`eops-chip cp-chip-xs ${h2(m.kind)}`,children:m.kind}):null,m.replyToSeq!=null?a.jsxs("span",{className:"eops-chip eops-chip--ghost cp-chip-xs",children:[i("asFieldReplyTo")," #",m.replyToSeq]}):null,m.addressedTo?a.jsxs("span",{className:"eops-chip eops-chip--amber cp-chip-xs",children:[i("asFieldAddressedTo"),": ",m.addressedTo]}):null,a.jsx("span",{className:"aops-pm-muted",children:tt(m.createdAt,r)})]}),a.jsx("div",{className:"aops-as-turn-body",children:a.jsx(ph,{markdown:m.text??""})})]},m.id))}):null,v.length?a.jsxs(a.Fragment,{children:[a.jsx("h5",{className:"aops-as-thread-title",children:i("asOutputs")}),a.jsx("div",{className:"aops-as-output-list",children:v.map(m=>{const g=m.outputKind??null;return a.jsxs("article",{className:`aops-as-turn is-output is-output-${GA(g)}`,children:[a.jsxs("header",{className:"aops-as-turn-head",children:[a.jsx("span",{className:`eops-chip cp-chip-xs ${f2(g)}`,children:v2(g,i)}),m.ownerAgentId?a.jsxs("span",{className:"eops-chip eops-chip--ghost cp-chip-xs",children:[i("asFieldOutputOwner"),": ",m.ownerAgentId]}):null]}),a.jsx("div",{className:"aops-as-turn-body",children:a.jsx(ph,{markdown:m.content??""})})]},m.id)})})]}):null]})}function jb({model:e,asset:n,versionId:r,t:i}){const o=e2({model:e,asset:n,versionId:r});if(!r)return null;if(o.isPending)return a.jsx("p",{className:"aops-pm-muted",children:i("asLoadingMessage")});if(o.error)return a.jsx("p",{className:"aops-pm-error-line",children:It(o.error,"agentspace_unavailable")});const d=o.data,u=d?.content??d?.bodyMarkdown??"";return!u&&!d?.entryFile?null:a.jsxs("div",{className:"aops-as-versionbody",children:[a.jsxs("div",{className:"aops-as-versionbody-head",children:[a.jsxs("h5",{className:"aops-as-thread-title",children:[i("asVersionBody"),d?.version!=null?a.jsxs("span",{className:"aops-pm-mono",children:[" v",d.version]}):null,d?.entryFile?a.jsxs("span",{className:"aops-pm-muted",children:[" · ",d.entryFile]}):null]}),a.jsx(am,{text:u,copyLabel:i("contentCopy"),copiedLabel:i("contentCopied"),failedLabel:i("contentCopyFailed")})]}),a.jsx("pre",{className:"aops-as-versionbody-content",children:u})]})}function H2(e,n=96){const r=(e??"").trim().split(`
|
|
17
|
+
`)[0]??"";return r.length>n?`${r.slice(0,n-1)}…`:r}function G2(e,n,r){return e.map(i=>{const o=qA(i,r);return{id:i.id,title:i.title||i.slug||Oe(i.id),status:i.status??null,eyebrow:r("asSectionDiscussions"),refs:$c([us(i.subjectType,i.subjectId,i.subjectId?`${i.subjectType??"ref"} · ${Oe(i.subjectId)}`:null)]),chips:[...o?[{label:o,tone:"coral"}]:[],...i.participants?.length?[{label:`${i.participants.length}× ${r("asFieldParticipants")}`}]:[],...i.lastSeq!=null?[{label:`${r("asFieldLastSeq")} #${i.lastSeq}`}]:[],...i.subjectType?[{label:i.subjectType}]:[]],fields:[{label:r("asFieldSlug"),value:i.slug??null},{label:r("asFieldParticipants"),value:i.participants?.join(", ")??null},{label:r("asFieldLastSeq"),value:i.lastSeq!=null?`#${i.lastSeq}`:null},{label:r("asFieldRules"),value:q2(i.rules,r)},...o?[{label:r("asAttentionBlocked"),value:o}]:[],{label:r("asFieldLastTurn"),value:i.lastTurnAt?tt(i.lastTurnAt,n):null}],body:[{heading:r("asFieldQuestion"),text:i.question??""}],tags:i.tags??void 0,searchText:`${i.title??""} ${i.slug??""} ${i.question??""} ${i.status??""} ${o??""} ${(i.participants??[]).join(" ")}`,createdAt:i.createdAt,updatedAt:i.updatedAt??i.lastTurnAt??void 0}})}function q2(e,n){if(!e)return null;const r=[e.turnOrder?.length?`${n("asDiscussionTurnOrder")}: ${e.turnOrder.join(" -> ")}`:null,e.minTurnsBeforeConclude!=null?`${n("asDiscussionMinTurns")}: ${e.minTurnsBeforeConclude}`:null,e.requireQuestionAnswer?n("asDiscussionRequireQuestionAnswer"):null].filter(Boolean);return r.length?r.join(" | "):null}function Ab(e,n,r,i){return e.map(o=>({id:o.id,title:o.name??Oe(o.id),status:o.status??null,eyebrow:i(n==="prompts"?"asSectionPrompts":"asSectionSkills"),chips:[],fields:[{label:i("asFieldDescription"),value:("shortDescription"in o?o.shortDescription:null)??o.description??null},{label:i("asFieldCurrentVersion"),value:o.currentVersionId?Oe(o.currentVersionId):null},{label:i("asFieldUpdated"),value:tt(o.updatedAt,r)}],tags:o.tags??void 0,searchText:`${o.name??""} ${o.description??""} ${(o.tags??[]).join(" ")}`,createdAt:o.createdAt,updatedAt:o.updatedAt}))}function V2(e){return e==null||!Number.isFinite(e)?null:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Y2(e,n,r){return e.map(i=>({id:i.id,title:i.label??i.storagePath?.split(/[\\/]/).pop()??Oe(i.id),status:i.artifactType??null,eyebrow:r("asSectionArtifacts"),refs:$c((i.links??[]).map(o=>us(o.refType,o.refId))),chips:[...i.mimeType?[{label:i.mimeType}]:[],...(i.links??[]).slice(0,1).map(o=>({label:o.refType??"ref",tone:"indigo"}))],fields:[{label:r("asFieldArtifactType"),value:i.artifactType??null},{label:r("asFieldMimeType"),value:i.mimeType??null},{label:r("asFieldSize"),value:V2(i.sizeBytes)},{label:r("asFieldRef"),value:(i.links??[]).map(o=>`${o.refType??"ref"} · ${o.refId?Oe(o.refId):"?"}`).join(", ")||null},{label:r("asFieldStoragePath"),value:i.storagePath??null},{label:r("asFieldUpdated"),value:tt(i.updatedAt,n)}],searchText:`${i.label??""} ${i.artifactType??""} ${i.mimeType??""} ${i.storagePath??""}`,createdAt:i.createdAt,updatedAt:i.updatedAt}))}function J2(e,n,r){return e.map(i=>({id:i.id,title:i.name??Oe(i.id),status:i.resourceType??null,eyebrow:r("asSectionResources"),refs:$c([us(i.refType,i.refId)]),chips:i.refType?[{label:i.refType,tone:"indigo"}]:[],fields:[{label:r("asFieldResourceType"),value:i.resourceType??null},{label:r("asFieldRef"),value:i.refId?`${i.refType??"ref"} · ${Oe(i.refId)}`:null},{label:r("asFieldUri"),value:i.uri??null},{label:r("asFieldDescription"),value:i.description??null},{label:r("asFieldUpdated"),value:tt(i.updatedAt,n)}],tags:i.tags??void 0,searchText:`${i.name??""} ${i.resourceType??""} ${i.uri??""} ${(i.tags??[]).join(" ")}`,createdAt:i.createdAt,updatedAt:i.updatedAt}))}function X2(e,n){return e.map(r=>({id:r.id,title:r.name??r.slug??Oe(r.id),status:r.kind??null,eyebrow:n("asSectionAgents"),chips:r.role?[{label:r.role,tone:"indigo"}]:[],fields:[{label:n("asFieldSlug"),value:r.slug??null},{label:n("asFieldRole"),value:r.role??null},{label:n("asFieldCapabilities"),value:r.capabilities?.join(", ")??null}],body:r.body?[{heading:n("asSectionAgents"),text:r.body}]:void 0,tags:r.tags??void 0,searchText:`${r.name??""} ${r.slug??""} ${r.role??""}`,createdAt:r.createdAt,updatedAt:r.updatedAt}))}const Zs={all:(e,n,r)=>["aops-docman",e.baseUrl,n??"anonymous",r?.projectId??"no-project-id",r?.scopeId??"no-scope-id"],entity:(e,n,r,i)=>[...Zs.all(e,n,r),i],detail:(e,n,r,i,o)=>[...Zs.all(e,n,r),"detail",i,o??"none"]};function xb(e,n){return Date.parse(n.updatedAt??n.createdAt??"")-Date.parse(e.updatedAt??e.createdAt??"")}function W2(e){const n=!!(e.enabled&&e.selectedProject),r=mt({queryKey:Zs.entity(e.client.identity,e.sessionKey,e.selectedProject,"groups"),queryFn:()=>e.client.get("/api/docman/document-groups").then(m=>Array.isArray(m)?m:[]),enabled:n}),i=mt({queryKey:Zs.entity(e.client.identity,e.sessionKey,e.selectedProject,"documents"),queryFn:()=>e.client.get("/api/docman/documents").then(m=>Array.isArray(m)?m:[]),enabled:n}),o=y.useMemo(()=>(r.data??[]).slice().sort(xb),[r.data]),d=y.useMemo(()=>(i.data??[]).slice().sort(xb),[i.data]),u=n&&(r.isPending||i.isPending),v=r.error??i.error??null;return{status:e.selectedProject?u?"loading":v?"error":d.length===0&&o.length===0?"empty":"ready":"select-project",error:v,isFetching:r.isFetching||i.isFetching,groups:o,documents:d,refresh:()=>{r.refetch(),i.refetch()},client:e.client,sessionKey:e.sessionKey,selectedProject:e.selectedProject}}function Z2(e){return e?.contentMode==="text-file"?"source":"markdown"}function eM(e){return e?.contentMode!=="text-file"}function tM(e){return mt({queryKey:Zs.detail(e.model.client.identity,e.model.sessionKey,e.model.selectedProject,`materialized-${e.target}`,e.versionId),queryFn:()=>e.model.client.post(`/api/docman/document-versions/${encodeURIComponent(e.versionId??"")}/materialize`,{documentVersionId:e.versionId,target:e.target}),enabled:!!e.versionId,retry:0,staleTime:6e4})}function aM(e){return mt({queryKey:Zs.detail(e.model.client.identity,e.model.sessionKey,e.model.selectedProject,"document-versions",e.documentId),queryFn:()=>e.model.client.get("/api/docman/document-versions",{documentId:e.documentId??""}).then(n=>(Array.isArray(n)?n:[]).slice().sort((r,i)=>(i.version??0)-(r.version??0))),enabled:!!e.documentId,retry:0})}function nM(e){return mt({queryKey:Zs.detail(e.model.client.identity,e.model.sessionKey,e.model.selectedProject,"version-index",e.versionId),queryFn:()=>e.model.client.get(`/api/docman/document-versions/${encodeURIComponent(e.versionId??"")}/index`),enabled:!!(e.versionId&&e.enabled!==!1),retry:0,staleTime:3e4})}function sM(e){return e.find(n=>n.isCurrent)??e[0]??null}function rM(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,96)||"document"}function iM(e){const n=e.materialized.fileExtension?.trim()??"";if(!/^[a-z0-9][a-z0-9_-]{0,31}$/.test(n))throw new Error("docman_source_file_extension_invalid");const r=e.materialized.suggestedFileName?.trim().split(/[\\/]/).pop()??"";return{filename:r.endsWith(`.${n}`)?r:`${rM(e.fallbackSlug)}.${n}`,mediaType:e.materialized.mediaType?.trim()||"text/plain; charset=utf-8",content:e.materialized.content??""}}function lM(e){const n=new Blob([e.content],{type:e.mediaType}),r=URL.createObjectURL(n),i=window.document.createElement("a");i.href=r,i.download=e.filename,i.hidden=!0,window.document.body.appendChild(i),i.click(),i.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),0)}function oM({materialized:e,fallbackSlug:n,version:r,labels:i}){const[o,d]=y.useState(!1);let u=null;try{u=iM({materialized:e,fallbackSlug:n})}catch{}if(!u)return a.jsx("section",{className:"aops-docs-source","aria-label":i.sourceFile,children:a.jsx("p",{className:"aops-pm-error-line aops-docs-source-profile-error",children:i.invalidProfile})});const v=e.contentHash?.trim()??"";return a.jsxs("section",{className:"aops-docs-source","aria-label":`${i.sourceFile}: ${u.filename}`,children:[a.jsxs("div",{className:"aops-docs-source-toolbar",children:[a.jsxs("div",{className:"aops-docs-source-identity",children:[a.jsx("span",{className:"aops-docs-source-filename",title:u.filename,children:u.filename}),a.jsxs("span",{className:"aops-docs-source-fact",children:[a.jsx("b",{children:i.format})," text"]}),a.jsxs("span",{className:"aops-docs-source-fact",children:[a.jsx("b",{children:i.extension})," .",e.fileExtension]}),r!=null?a.jsxs("span",{className:"aops-docs-source-fact",children:[a.jsx("b",{children:i.version})," ",r]}):null]}),a.jsxs("div",{className:"aops-docs-source-actions",role:"group","aria-label":i.sourceFile,children:[a.jsx("button",{type:"button",className:"aops-docs-source-action","aria-pressed":o,onClick:()=>d(h=>!h),children:o?i.noWrap:i.wrap}),a.jsx("button",{type:"button",className:"aops-docs-source-action",onClick:()=>lM(u),children:i.download}),a.jsx(am,{text:u.content,copyLabel:i.copy,copiedLabel:i.copied,failedLabel:i.copyFailed})]})]}),v?a.jsxs("p",{className:"aops-docs-source-hash",title:v,children:[a.jsx("span",{children:i.contentHash}),a.jsx("code",{children:v})]}):null,u.content?a.jsx("pre",{className:`aops-docs-source-pre${o?" is-wrapped":""}`,"data-wrap":o?"on":"off",children:a.jsx("code",{children:u.content})}):a.jsx("p",{className:"aops-docs-source-empty",children:i.empty})]})}function cM({model:e,navigator:n,selectedDocumentId:r,locale:i,t:o}){if(y.useEffect(()=>{n.viewMode==="navigator"&&n.switchMode("left-menu")},[n]),e.status==="select-project")return a.jsx(cn,{className:"aops-v2-section aops-pm-section",mainClassName:"aops-v2-section-main",children:a.jsx(it,{variant:"empty",title:o("asNoProjectTitle"),message:o("asNoProjectMessage")})});if(e.status==="loading")return a.jsx(cn,{className:"aops-v2-section aops-pm-section",mainClassName:"aops-v2-section-main",children:a.jsx(it,{variant:"loading",title:o("docsLoadingTitle"),message:o("asLoadingMessage")})});if(e.status==="error")return a.jsx(cn,{className:"aops-v2-section aops-pm-section",mainClassName:"aops-v2-section-main",children:a.jsx(it,{variant:"error",title:o("docsErrorTitle"),message:It(e.error,"docman_unavailable"),actions:a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:e.refresh,children:o("authRetry")})})});if(e.status==="empty")return a.jsx(cn,{className:"aops-v2-section aops-pm-section",mainClassName:"aops-v2-section-main",children:a.jsx(it,{variant:"empty",title:o("docsEmptyTitle"),message:o("docsEmptyMessage")})});const d=e.documents.find(g=>g.id===r)??null,u=d?a.jsx(dM,{model:e,document:d,locale:i,t:o}):a.jsx(it,{variant:"empty",title:o("docsTitle"),message:o("docsNavEmpty")}),v=n.isCardsMode?"cards":n.isDropdownMode?"dropdown":"side-panel",h=v==="side-panel"&&n.controller.open,m=a.jsx(_h,{className:"aops-docs-view-switch",ariaLabel:`${o("pmRecordViewLabel")}: ${o("docsTitle")}`,value:v,items:[{value:"side-panel",label:o(h?"navSidePanelHide":"navSidePanelShow"),icon:"side-panel",expanded:h,onSelect:()=>{if(v==="side-panel"){n.controller.setOpen(g=>!g);return}n.controller.setOpen(!0),n.switchMode("left-menu")},testId:"aops-docs-view-side-panel"},{value:"cards",label:o("navModeCards"),icon:"cards",testId:"aops-docs-view-cards"},{value:"dropdown",label:o("navModeDropdown"),icon:"dropdown",testId:"aops-docs-view-dropdown"}],onChange:g=>n.switchMode(g==="cards"?"cards":g==="dropdown"?"dropdown":"left-menu")});if(n.isCardsMode){const g=new Map(e.groups.map(j=>[j.groupUid??j.id,j.title??j.groupUid??j.id])),b=e.documents.map(j=>({id:j.id,title:j.title??j.slug??j.id.slice(0,8),status:j.status??null,eyebrow:o("docsTitle"),chips:j.groupUid?[{label:g.get(j.groupUid)??j.groupUid,tone:"indigo"}]:[],fields:[{label:o("docsNavPanelTitle"),value:j.groupUid?g.get(j.groupUid)??null:null},{label:o("asFieldSlug"),value:j.slug??null}],body:j.summary?[{heading:o("docsTitle"),text:j.summary}]:void 0,tags:j.tags??void 0,searchText:`${j.title??""} ${j.slug??""} ${(j.tags??[]).join(" ")}`,createdAt:j.createdAt,updatedAt:j.updatedAt}));return a.jsx(cn,{className:"aops-v2-section aops-pm-section",mainClassName:"aops-v2-section-main",children:a.jsxs("div",{className:"aops-pm-dispatch has-view-switch aops-docs-dispatch",children:[m,a.jsx("div",{className:"aops-pm-dispatch-body",children:a.jsx("div",{className:"aops-pm-board-view is-cards",children:a.jsx(Jh,{projectKey:e.selectedProject?.key??"__global__",section:"docs",items:b,sectionTitle:o("docsTitle"),searchPlaceholder:o("docsNavSearch"),emptyLabel:o("docsNavEmpty"),renderExtra:j=>a.jsx("div",{className:"aops-pm-recordlist-actions",children:a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:()=>{n.selectRecord(j.id),n.switchMode("left-menu")},"data-testid":"aops-v2-docs-card-open",children:o("docsCardsOpen")})}),locale:i,t:o})})})]})})}return n.isDropdownMode?a.jsx(cn,{className:"aops-v2-section aops-pm-section",mainClassName:"aops-v2-section-main",children:a.jsxs("div",{className:"aops-pm-dispatch has-view-switch aops-docs-dispatch",children:[m,a.jsx("div",{className:"aops-pm-dispatch-body",children:a.jsxs("div",{className:"aops-pm-board-view is-dropdown",children:[a.jsx("div",{className:"aops-pm-board-navrow",children:n.dropdownNode}),u]})})]})}):a.jsx(cn,{className:"aops-v2-section aops-pm-section",mainClassName:"aops-v2-section-main",children:a.jsxs("div",{className:"aops-pm-dispatch has-view-switch aops-docs-dispatch",children:[m,a.jsx("div",{className:"aops-pm-dispatch-body",children:a.jsx("div",{className:"aops-pm-board-view",children:a.jsx(Oc,{controller:n.controller,navigator:n.treePanel,navigatorLabel:o("docsNavPanelTitle"),className:"aops-pm-board-recordlayout",contentClassName:"aops-pm-board-recordcontent",content:u})})})]})})}function dM({model:e,document:n,locale:r,t:i}){const o=aM({model:e,documentId:n.id}),d=o.data??[],u=sM(d),[v,h]=y.useState(null);y.useEffect(()=>{h(null)},[n.id]);const m=v??u?.id??null,g=d.find(z=>z.id===m)??u,b=Z2(g),j=b==="source",C=eM(g),k=tM({model:e,versionId:m,target:b}),x=nM({model:e,versionId:m,enabled:C}),S=k.data?.content??"",T=(x.data?.entries??[]).filter(z=>z.title),I=k.data?.sourceFormat??(j?"text":"md"),E=k.data?.fileExtension??g?.fileExtension??(j?null:"md"),L=e.groups.find(z=>(z.groupUid??z.id)===(n.groupUid??""))?.title??n.groupUid??null,P=z=>{window.document.getElementById(KA(z))?.scrollIntoView({behavior:"smooth",block:"start"})},N=a.jsxs("div",{className:"aops-pm-rechead-meta",children:[a.jsx(ft,{tone:ja(n.status),children:n.status??i("pmUnknownStatus")}),a.jsx("span",{className:"aops-docs-format-badge","data-format":I,children:I}),E?a.jsxs("span",{className:"aops-docs-format-badge",children:[".",E]}):null,L?a.jsx("span",{className:"aops-pm-muted",title:L,children:L}):null,a.jsx("span",{className:"aops-pm-muted",children:tt(n.updatedAt,r)}),a.jsx("span",{className:"aops-pm-mono",title:n.slug??n.id,children:n.slug??n.id.slice(0,8)})]}),R=d.length?a.jsxs("div",{className:"aops-docs-versions",role:"group","aria-label":i("docsVersions"),children:[a.jsx("span",{className:"aops-pm-groupby-label",children:i("docsVersions")}),d.map(z=>{const ne=z.id===m;return a.jsxs("button",{type:"button",className:`aops-docs-version-chip${ne?" is-active":""}${z.isCurrent?" is-current":""}`,"aria-pressed":ne,title:z.label??z.title??void 0,onClick:()=>h(z.id),children:["v",z.version??"?",z.isCurrent?" ●":""]},z.id)})]}):null;return a.jsxs("section",{className:"aops-docs-record","aria-label":n.title??n.id,children:[a.jsxs("header",{className:"aops-pm-rechead",children:[a.jsxs("div",{className:"aops-pm-rechead-id",children:[a.jsx("span",{className:"aops-pm-rechead-eyebrow",children:i("docsTitle")}),a.jsx("h3",{className:"aops-pm-rechead-title",children:n.title??n.slug??n.id.slice(0,8)}),a.jsxs("div",{className:"aops-docs-desktop-meta",children:[N,R]}),a.jsxs("details",{className:"aops-docs-mobile-meta",children:[a.jsxs("summary",{children:[i("docsVersions")," · ",d.length]}),N,R]}),n.summary?a.jsx("p",{className:"aops-pm-sprint-goal",children:n.summary}):null]}),j?null:a.jsx(am,{text:S,copyLabel:i("contentCopy"),copiedLabel:i("contentCopied"),failedLabel:i("contentCopyFailed")})]}),C&&T.length>1?a.jsxs("details",{className:"aops-docs-outline",children:[a.jsx("summary",{children:i("docsOutline")}),a.jsx("ul",{children:T.map((z,ne)=>a.jsx("li",{style:{paddingLeft:`${Math.max(0,(z.depth??1)-1)*14}px`},children:a.jsxs("button",{type:"button",onClick:()=>P(z.title??""),children:[z.number?`${z.number} `:"",z.title]})},ne))})]}):null,o.isPending||k.isPending?a.jsx("p",{className:"aops-pm-muted",children:i("asLoadingMessage")}):k.error?a.jsx("p",{className:"aops-pm-error-line",children:It(k.error,"docman_unavailable")}):j&&k.data?a.jsx(oM,{materialized:k.data,fallbackSlug:n.slug??n.id,version:g?.version,labels:{sourceFile:i("docsSourceFile"),format:i("docsFormat"),extension:i("docsExtension"),version:i("docsVersion"),contentHash:i("docsContentHash"),wrap:i("docsWrap"),noWrap:i("docsNoWrap"),download:i("docsDownload"),empty:i("docsEmptySource"),invalidProfile:i("docsInvalidSourceProfile"),copy:i("contentCopy"),copied:i("contentCopied"),copyFailed:i("contentCopyFailed")}}):S?a.jsx("div",{className:"aops-docs-body",children:a.jsx(ph,{markdown:S})}):a.jsxs("p",{className:"aops-pm-muted",children:[i("docsNoContent"),g?.status?` (${g.status})`:""]})]})}const uM=["projects","pm-boards","pm-sprints","pm-issues","pm-feedback","pm-reviews","as-memory","as-discussions","as-prompts","as-skills","as-artifacts","as-resources","as-agents","docs","chat"],pM=e=>a.jsx(iI,{model:e.projectman,projects:e.projects,boardsNavigator:e.boardsNavigator,selectedBoardId:e.selectedBoardId,sprintsNavigator:e.sprintsNavigator,selectedSprintKey:e.selectedSprintKey,section:gj(e.activePageId),onNavigate:e.onNavigate,locale:e.locale,t:e.t}),hM=pn.map(e=>({id:e.id,nav:{label:e.id,icon:"projectman",order:20},render:pM})),mM=e=>a.jsx(l2,{model:e.agentspace,section:p0(e.activePageId),onNavigate:e.onNavigate,onOpenProjectmanRef:e.onOpenProjectmanRef,locale:e.locale,t:e.t}),fM=hn.map(e=>({id:e.id,nav:{label:e.id,icon:"agentspace",order:25},render:mM}));function vM(e){const n=[...uM].sort(),r=[...e].sort();if(r.length!==n.length||r.some((i,o)=>i!==n[o]))throw new Error(`community_cockpit_registry_mismatch:expected=${n.join(",")}:actual=${r.join(",")}`)}const ax="projects",nx=[{id:ax,nav:{label:"Projects",icon:"projects",order:10},render:e=>a.jsx(jI,{model:e.projects,navigator:e.projectsNavigator,projectman:e.projectman,agentspace:e.agentspace,docman:e.docman,onNavigate:e.onNavigate,onOpenPlan:e.onOpenPlan,locale:e.locale,t:e.t})},...hM,...fM,{id:"docs",nav:{label:"Docs",icon:"docs",order:28},render:e=>a.jsx(cM,{model:e.docman,navigator:e.docsNavigator,selectedDocumentId:e.selectedDocumentId,locale:e.locale,t:e.t})},{id:"chat",nav:{label:"Chat",icon:"chat",order:30},render:e=>a.jsx(DE,{model:e.chat,navigator:e.chatNavigator,locale:e.locale,t:e.t})}];vM(nx.map(e=>e.id));const gM={id:"aops-cockpit-v2-core",pages:nx},sx=Dw({plugins:[gM]});function yM(e,n){return sx.renderPage(e,n)}const rx={all:e=>["aops-auth-session",e.baseUrl,e.projectId,e.scopeId,e.authMode],me:e=>[...rx.all(e),"me"]},bM=300*1e3;async function jM(e){if(e.identity.authMode==="south-bff")return kM(e);const n=await e.requestResult("/api/auth/me",{method:"GET"}),r=n.result?.data;if(!n.httpOk||n.result?.ok!==!0)throw new Error("community_trusted_local_auth_me_failed");if(r?.authProvider!=="trusted-local"||r.authRequired!==!1)throw new Error("community_trusted_local_auth_contract_rejected");const i=ix(r.principal);if(!i)throw new Error("community_trusted_local_principal_required");return{principal:i,authRequired:!1,authProvider:"trusted-local",tenantId:vl(r.tenantId)}}class hh extends Error{constructor(n="south_bff_session_required"){super(n),this.name="SouthBffSessionRequiredError"}}function AM(e){return e instanceof hh}async function xM(e){if(e.identity.authMode!=="south-bff")return;const n=await e.requestResult("/api/auth/session/logout",{method:"POST"});if(!n.httpOk||n.result?.ok!==!0||n.result.data?.loggedOut!==!0)throw new Error("south_bff_logout_failed")}function CM(e){return mt({queryKey:rx.me(e.identity),queryFn:()=>jM(e),retry:0,refetchInterval:bM,refetchOnMount:"always",refetchOnReconnect:"always",refetchOnWindowFocus:"always",staleTime:1e4})}async function kM(e){const n=await e.requestResult("/api/auth/session/status",{method:"GET"}),r=n.result?.data;if(!n.httpOk||n.result?.ok!==!0)throw new Error("south_bff_session_status_failed");if(r?.authenticated!==!0||!r.profile)throw new hh;const i=vl(r.profile.southTenantId);if(!i)throw new hh("south_bff_tenant_selection_required");const o=ix({userId:r.profile.principalId,roles:r.profile.roles,permissions:r.profile.permissions});if(!o)throw new Error("south_bff_principal_required");return{principal:o,authRequired:!1,authProvider:"south-bff",tenantId:i}}function SM(e){return e?.principal.userId??"untrusted"}function ix(e){const n=vl(e?.userId);if(!n)return null;const r=vl(e?.email),i=vl(e?.fullName),o=Cb(e?.roles),d=Cb(e?.permissions);return{userId:n,...r?{email:r}:{},...i?{fullName:i}:{},...o.length?{roles:o}:{},...d.length?{permissions:d}:{}}}function Cb(e){return Array.isArray(e)?[...new Set(e.map(n=>n.trim()).filter(Boolean))]:[]}function vl(e){const n=e?.trim();return n||null}const Fr="ch:",mh="rm:",wM={mode:"aops-cockpit-v2.chat.navMode",open:"aops-cockpit-v2.chat.navOpen",pinned:"aops-cockpit-v2.chat.navPinned",navigatorWidth:"aops-cockpit-v2.chat.navigatorWidth",leftMenuWidth:"aops-cockpit-v2.chat.leftMenuWidth"};function Vr(...e){return e.filter(Boolean).join(" ")}function lx(e,n){return`${mh}${e}:${n}`}function NM(e){if(!e.startsWith(mh))return null;const n=e.slice(mh.length),r=n.indexOf(":");return r<0?null:{channelId:n.slice(0,r),roomId:n.slice(r+1)}}function ox(e,n,r){return e.id===n&&r.length?r:e.rooms??[]}function IM(e,n,r,i,o,d){const u=o.trim().toLowerCase(),v=[],h={};for(const m of e){const g=m.status==="archived",b=!m.memberToken&&!m.localCryptoAvailable&&!g,j=b?[]:ox(m,r,i),C=!u||`${m.title} ${m.slug}`.toLowerCase().includes(u),k=u?j.filter(L=>`${L.title} ${L.slug}`.toLowerCase().includes(u)):j;if(u&&!C&&k.length===0)continue;const x=`${Fr}${m.id}`;h[x]={total:j.length};const S=u?!0:n.has(m.id),T=m.recoveryState==="locked-needs-pin"?d("chatLockedNeedsPinHint"):m.recoveryState==="stale-needs-current-device"?d("chatLockedStaleHint"):m.recoveryState==="recoverable"?d("chatLockedRecoverableHint"):d("chatLockedHint"),I=[m.status==="archived"?"archived":null,b?T:null].filter(Boolean);if(v.push({categoryUid:x,kind:"channel",depth:0,hasChildren:j.length>0,isExpanded:S,channelId:m.id,channel:m,labelText:m.title||m.slug,titleText:[m.title||m.slug,m.slug].filter(Boolean).join(" · "),locked:b,archived:g,encryptionMode:m.encryptionMode,roomCount:j.length,lockedHint:b?T:void 0,label:m.title||m.slug,hideDefaultMeta:!0,metaLines:I.length?I:void 0}),!S)continue;const E=u?k:j;for(const L of E)v.push({categoryUid:lx(m.id,L.id),kind:"room",depth:1,hasChildren:!1,channelId:m.id,roomId:L.id,room:L,encryptionMode:m.encryptionMode,labelText:L.title||L.slug,titleText:L.slug&&L.slug!==L.title?`${L.title||L.slug} · ${L.slug}`:L.title||L.slug,label:L.title||L.slug,hideDefaultMeta:!0,metaLines:void 0})}return{rows:v,counts:h}}function EM(e){return(e.title||e.slug||"?").trim().slice(0,1).toUpperCase()||"?"}function MM({title:e}){return a.jsx("span",{className:"aops-v2-chat-navlock",title:e,"aria-label":e,children:a.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[a.jsx("path",{d:"M5 6.8V5.2a3 3 0 0 1 6 0v1.6",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round"}),a.jsx("rect",{x:"3.7",y:"6.6",width:"8.6",height:"6.8",rx:"1.7",fill:"none",stroke:"currentColor",strokeWidth:"1.45"})]})})}function TM(){return a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("circle",{cx:"11",cy:"11",r:"6.5",stroke:"currentColor",strokeWidth:"1.7"}),a.jsx("path",{d:"m16 16 4.5 4.5",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function cx({checked:e}){return a.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[a.jsx("rect",{x:"2.25",y:"2.25",width:"11.5",height:"11.5",rx:"3",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),e?a.jsx("path",{d:"m4.8 8 2 2 4.4-4.5",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"}):null]})}function BM(){return a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:a.jsx("path",{d:"M2.4 4.3h11.2v8.5H2.4zM1.8 2.2h12.4v2.2H1.8zM6 7h4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinejoin:"round",strokeLinecap:"round"})})}function DM(){return a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:a.jsx("path",{d:"M3.5 4.3h9M6 4.3V2.8h4v1.5m1.5 0-.6 9H5.1l-.6-9M6.6 6.5v4.8m2.8-4.8v4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function RM({row:e,t:n}){const r=e.channel;return r?a.jsxs("span",{className:Vr("aops-v2-chat-navlabel is-channel",e.locked&&"is-locked",e.archived&&"is-archived"),children:[a.jsx("span",{className:"aops-v2-chat-navavatar",style:{background:ys(r.id||r.slug)},"aria-hidden":"true",children:EM(r)}),a.jsx("span",{className:"aops-v2-chat-navtext",children:a.jsx("span",{className:"aops-v2-chat-navname",title:e.titleText,children:e.labelText})}),a.jsxs("span",{className:"aops-v2-chat-navside",children:[e.roomCount&&e.roomCount>0?a.jsx("span",{className:"aops-v2-chat-navbadge",title:`${e.roomCount} rooms`,"aria-label":`${e.roomCount} rooms`}):null,a.jsx(ai,{mode:e.encryptionMode,compact:!0,t:n}),e.locked?a.jsx(MM,{title:e.lockedHint||"Locked channel"}):null,e.archived?a.jsx("span",{className:"aops-v2-chat-navstate",children:"archived"}):null]})]}):e.labelText}function LM({row:e,t:n}){return a.jsxs("span",{className:"aops-v2-chat-navlabel is-room",title:e.titleText,children:[a.jsx("span",{className:"aops-v2-chat-roomhash","aria-hidden":"true",children:"#"}),a.jsx("span",{className:"aops-v2-chat-navname",title:e.titleText,children:e.labelText}),a.jsx(ai,{mode:e.encryptionMode,compact:!0,t:n})]})}function kb(e){typeof document>"u"||(document.querySelector(".aops-v2-chat-toolbar .aops-v2-chat-addbtn")?.click(),e!=="join")||window.setTimeout(()=>{Array.from(document.querySelectorAll(".aops-v2-chat-connect-tab")).find(i=>/join|katıl/i.test(i.textContent||""))?.click()},0)}function OM({hasChannels:e,search:n,t:r}){return e&&n.trim()?a.jsx("p",{className:"inv-iv3-cattree-empty",children:r("chatNoChannelsSearch")}):a.jsxs("div",{className:"inv-iv3-cattree-empty aops-v2-chat-navempty",children:[a.jsx("span",{children:r("chatNoChannelsNav")}),a.jsxs("span",{className:"aops-v2-chat-navempty-actions",children:[a.jsx("button",{type:"button",onClick:()=>kb("create"),children:r("chatNewChannel")}),a.jsx("button",{type:"button",onClick:()=>kb("join"),children:r("chatJoinChannel")})]})]})}function _M({rows:e,selectedKey:n,selectionMode:r,selectedChannelIds:i,hasChannels:o,search:d,onSelect:u,onToggleSelection:v,onToggleBranch:h,t:m}){return e.length?a.jsx("div",{className:"cat-wb-tree-panel aops-v2-chat-navtree",children:e.map(g=>{const b=g.categoryUid===n,j=g.depth===0,C=j&&i.has(g.channelId),k=[g.titleText,g.locked?g.lockedHint:"",g.archived?"archived":"",g.encryptionMode].filter(Boolean).join(" · ");return a.jsxs("div",{className:Vr("cat-wb-tree-row",b&&"active",j&&"is-root",!g.hasChildren&&"is-leaf",g.kind==="channel"&&"is-chat-channel",g.kind==="room"&&"is-chat-room",r&&"is-selection-mode",C&&"is-selected",g.locked&&"is-chat-locked",g.archived&&"is-chat-archived"),"data-testid":`itemsv3-cattree-row-${g.categoryUid}`,children:[a.jsx("span",{className:"cat-wb-tree-indent","aria-hidden":"true",style:{width:`${(g.depth??0)*16}px`}}),g.hasChildren?a.jsx("button",{className:"cat-wb-tree-toggle",type:"button",tabIndex:-1,"aria-label":g.isExpanded?"Collapse channel":"Expand channel","aria-expanded":g.isExpanded,onClick:()=>h(g.categoryUid),children:a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:a.jsx("path",{d:g.isExpanded?"M4 6 8 10l4-4":"M6 4l4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}):a.jsx("span",{className:"cat-wb-tree-toggle-spacer","aria-hidden":"true"}),r?j?a.jsx("button",{type:"button",role:"checkbox","aria-checked":C,"aria-label":`${m("chatSelectChannel")} ${g.labelText}`,title:`${m("chatSelectChannel")} ${g.labelText}`,className:Vr("aops-v2-chat-navcheck",C&&"is-checked"),onClick:()=>v(g.channelId),"data-testid":`aops-v2-chat-select-${g.channelId}`,children:a.jsx(cx,{checked:C})}):a.jsx("span",{className:"aops-v2-chat-navcheck-spacer","aria-hidden":"true"}):null,a.jsx("button",{className:Vr("cat-wb-tree-entry",b&&"active",j&&"is-root"),type:"button",title:k,"aria-label":k||void 0,onClick:()=>u(g.categoryUid),"aria-expanded":g.hasChildren?g.isExpanded:void 0,"data-tree-entry":"true","data-category-uid":g.categoryUid,"data-testid":`itemsv3-cattree-entry-${g.categoryUid}`,children:a.jsx("span",{className:"cat-wb-tree-copy",children:a.jsx("span",{className:"cat-wb-tree-title-row",children:a.jsx("span",{className:"cat-wb-tree-title",children:g.kind==="channel"?a.jsx(RM,{row:g,t:m}):a.jsx(LM,{row:g,t:m})})})})})]},g.categoryUid)})}):a.jsx(OM,{hasChannels:o,search:d,t:m})}function QM({action:e,channels:n,busy:r,t:i,onClose:o,onConfirm:d}){const[u,v]=y.useState(""),h=e==="delete",m=!h||u.trim().toUpperCase()==="DELETE";return y.useEffect(()=>{const g=b=>{b.key==="Escape"&&!r&&o()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r,o]),a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",onClick:r?void 0:o,children:a.jsxs("div",{className:"aops-v2-chat-modal aops-v2-chat-modal-sm",role:"dialog","aria-modal":"true","aria-label":i(h?"chatBulkDeleteTitle":"chatBulkArchiveTitle"),onClick:g=>g.stopPropagation(),children:[a.jsxs("header",{className:"aops-v2-chat-modal-head",children:[a.jsx("h4",{children:i(h?"chatBulkDeleteTitle":"chatBulkArchiveTitle")}),a.jsx("button",{type:"button",className:"aops-v2-chat-iconclose","aria-label":i("chatClose"),disabled:r,onClick:o,children:"✕"})]}),a.jsxs("div",{className:"aops-v2-chat-modal-body",children:[a.jsx("p",{className:"aops-v2-chat-muted",children:i(h?"chatBulkDeleteMessage":"chatBulkArchiveMessage")}),a.jsxs("ul",{className:"aops-v2-chat-bulk-list",children:[n.slice(0,5).map(g=>a.jsx("li",{children:g.title||g.slug},g.id)),n.length>5?a.jsxs("li",{children:["+",n.length-5]}):null]}),h?a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsxs("span",{children:[i("chatBulkDeleteConfirmLabel"),": ",a.jsx("code",{children:"DELETE"})]}),a.jsx("input",{value:u,onChange:g=>v(g.target.value),autoFocus:!0,"data-testid":"aops-v2-chat-bulk-delete-confirm"})]}):null,a.jsxs("div",{className:"aops-v2-chat-connect-actions",children:[a.jsx("button",{type:"button",className:"aops-v2-secondary-button",disabled:r,onClick:o,children:i("chatCancel")}),a.jsx("button",{type:"button",className:h?"aops-v2-chat-danger-button":"aops-v2-primary-button",disabled:r||!m,onClick:d,"data-testid":"aops-v2-chat-bulk-confirm",children:i(r?"chatBulkWorking":h?"chatDelete":"chatArchiveSelected")})]})]})]})})}function UM(e,n){const[r,i]=y.useState(""),[o,d]=y.useState(()=>new Set),[u,v]=y.useState(!1),[h,m]=y.useState(()=>new Set),[g,b]=y.useState(null),[j,C]=y.useState(!1),[k,x]=y.useState(null),S=Tl({storageKeys:wM,defaultMode:"left-menu",defaultOpen:!0,defaultPinned:!0,defaultNavigatorWidth:320,defaultLeftMenuWidth:300,leftMenuMinWidth:240,leftMenuMaxWidth:460}),{rows:T}=y.useMemo(()=>IM(e.channels,o,e.channelId,e.rooms,r,n),[e.channels,o,e.channelId,e.rooms,r,n]),I=y.useMemo(()=>e.channels.filter(se=>h.has(se.id)),[e.channels,h]),E=I.some(se=>se.canDelete===!1),L=e.activeRoomId&&e.channelId?lx(e.channelId,e.activeRoomId):e.channelId?`${Fr}${e.channelId}`:"",P=y.useCallback(se=>d(Z=>{const ae=new Set(Z);return ae.has(se)?ae.delete(se):ae.add(se),ae}),[]),N=y.useCallback(se=>{const Z=NM(se);if(Z){e.selectRoom(Z.roomId,Z.channelId);return}if(se.startsWith(Fr)){const ae=se.slice(Fr.length),ce=e.channels.find(F=>F.id===ae),w=!!ce&&ce?.status!=="archived"&&!ce?.memberToken&&!ce?.localCryptoAvailable;d(F=>new Set(F).add(ae)),(ae!==e.channelId||w)&&e.selectChannel(ae)}},[e]),R=y.useCallback(se=>{se.startsWith(Fr)&&P(se.slice(Fr.length))},[P]),z=y.useCallback(se=>{m(Z=>{const ae=new Set(Z);return ae.has(se)?ae.delete(se):ae.add(se),ae}),x(null)},[]),ne=y.useMemo(()=>e.channels.map(se=>se.id),[e.channels]),ye=y.useMemo(()=>{const se=new Set;return e.channelId&&se.add(e.channelId),e.channels.length===1&&se.add(e.channels[0].id),Array.from(se).filter(Z=>{const ae=e.channels.find(ce=>ce.id===Z);return ae?ox(ae,e.channelId,e.rooms).length>0:!1})},[e.channelId,e.channels,e.rooms]);y.useEffect(()=>{ye.length&&d(se=>{let Z=!1;const ae=new Set(se);for(const ce of ye)ae.has(ce)||(ae.add(ce),Z=!0);return Z?ae:se})},[ye]),y.useEffect(()=>{const se=new Set(e.channels.map(Z=>Z.id));m(Z=>{const ae=new Set(Array.from(Z).filter(ce=>se.has(ce)));return ae.size===Z.size?Z:ae})},[e.channels]);const J=y.useCallback(()=>{j||(v(!1),m(new Set),b(null),x(null))},[j]),re=y.useCallback(()=>{m(new Set(e.channels.map(se=>se.id))),x(null)},[e.channels]),oe=y.useCallback(async()=>{if(!(!g||!I.length)){C(!0),x(null);try{const se=g==="archive"?await e.archiveChannels(I.map(ae=>ae.id)):await e.deleteChannels(I.map(ae=>({id:ae.id,confirmSlug:ae.slug}))),Z=new Set(se.succeeded);m(ae=>new Set(Array.from(ae).filter(ce=>!Z.has(ce)))),b(null),se.failed.length?x(se.failed.map(ae=>ae.message).join("; ")):v(!1)}catch(se){x(se instanceof Error?se.message:String(se))}finally{C(!1)}}},[g,e,I]),fe=y.useCallback(()=>d(new Set(ne)),[ne]),de=y.useCallback(()=>d(new Set),[]),G=y.useCallback(()=>{S.setLeftMenuWidth(S.leftMenuMinWidth),S.setNavigatorWidth(S.navigatorMinWidth)},[S]),Q=y.useCallback(()=>{const se=Math.min(S.leftMenuMaxWidth,Math.max(S.leftMenuWidth+72,340)),Z=Math.min(S.navigatorMaxWidth,Math.max(S.navigatorWidth+72,360));S.setLeftMenuWidth(se),S.setNavigatorWidth(Z)},[S]),W=y.useCallback(()=>S.openNavigator(),[S]),pe=y.useCallback((se,Z="")=>Z,[]),ke=a.jsx(Th,{settingsSlot:a.jsx("button",{type:"button",className:"inv-iv3-cattree-tool-btn aops-v2-tree-close","aria-label":n("navSidePanelClose"),title:n("navSidePanelClose"),onClick:()=>S.setOpen(!1),"data-testid":"aops-v2-chat-tree-close",children:a.jsx(Qc,{})}),onExpandAll:fe,onCollapseAll:de,onNarrowPane:G,onFitPane:Q,onSwitchToNavigator:S.isLeftMenuMode?()=>S.switchToNavigator():void 0,expandDisabled:ne.length===0||o.size>=ne.length,collapseDisabled:o.size===0,narrowDisabled:S.isLeftMenuMode?Math.round(S.leftMenuWidth)<=S.leftMenuMinWidth:Math.round(S.navigatorWidth)<=S.navigatorMinWidth,fitDisabled:e.channels.length===0,tItems:pe}),O=a.jsxs("div",{className:"inv-iv3-cattree-pane aops-v2-chat-navstack","aria-label":n("chatChannelsLabel"),children:[a.jsx("div",{className:"aops-v2-chat-nav-search-card",children:a.jsxs("label",{className:"aops-v2-chat-nav-search",children:[a.jsx("span",{className:"aops-v2-chat-nav-search-icon",children:TM()}),a.jsx("input",{type:"search",className:"aops-v2-chat-nav-search-input",value:r,onChange:se=>i(se.currentTarget.value),placeholder:n("chatSearchPlaceholder"),"aria-label":n("chatSearchPlaceholder"),"data-testid":"itemsv3-cattree-search"})]})}),a.jsxs("div",{className:"aops-v2-chat-nav-toolrow",children:[ke,a.jsx("span",{className:"aops-v2-chat-nav-toolspacer"}),a.jsxs("button",{type:"button",className:Vr("aops-v2-chat-nav-select-toggle",u&&"is-active"),"aria-pressed":u,onClick:()=>u?J():v(!0),"data-testid":"aops-v2-chat-selection-toggle",children:[a.jsx(cx,{checked:u}),a.jsx("span",{children:n(u?"chatSelectionDone":"chatSelectChats")})]})]}),a.jsxs("div",{className:Vr("aops-v2-chat-bulkbar",u&&"is-visible"),"aria-hidden":!u,children:[a.jsx("button",{type:"button",className:"aops-v2-chat-bulk-all",disabled:!e.channels.length||j,onClick:re,children:n("chatSelectAll")}),a.jsxs("span",{className:"aops-v2-chat-bulk-count","aria-live":"polite",children:[I.length," ",n("chatSelected")]}),a.jsx("span",{className:"aops-v2-chat-nav-toolspacer"}),a.jsx("button",{type:"button",className:"aops-v2-chat-bulk-action",disabled:!I.length||j,title:n("chatArchiveSelected"),"aria-label":n("chatArchiveSelected"),onClick:()=>b("archive"),"data-testid":"aops-v2-chat-bulk-archive",children:a.jsx(BM,{})}),a.jsx("button",{type:"button",className:"aops-v2-chat-bulk-action is-danger",disabled:!I.length||E||j,title:n(E?"chatBulkDeleteBlocked":"chatDeleteSelected"),"aria-label":n("chatDeleteSelected"),onClick:()=>b("delete"),"data-testid":"aops-v2-chat-bulk-delete",children:a.jsx(DM,{})})]}),k?a.jsx(zc,{error:k,compact:!0,t:n}):null,a.jsx("div",{className:"inv-iv3-cattree-body aops-v2-chat-nav-listcard",children:a.jsx(_M,{rows:T,selectedKey:L,selectionMode:u,selectedChannelIds:h,hasChannels:e.channels.length>0,search:r,onSelect:N,onToggleSelection:z,onToggleBranch:R,t:n})})]}),_=g?a.jsx(QM,{action:g,channels:I,busy:j,t:n,onClose:()=>b(null),onConfirm:()=>{oe()}}):null,K=a.jsx(_c,{controller:S,label:"NAVIGATOR",panelTitle:n("chatNavPanelTitle"),showHeader:!0,showProjectSelection:!1,dockClassName:"aops-v2-chat-navdock",headerActions:a.jsx(Mh,{active:!1,onClick:()=>S.switchToLeftMenu()}),children:O}),ee=S.isLeftMenuMode?"hidden":S.pinned?S.open?"pinned":"hidden":"overlay",ve=!S.isLeftMenuMode&&(!S.pinned||!S.open)?a.jsx(kj,{className:"aops-v2-chat-overlay-rail",launcherClassName:"aops-v2-chat-overlay-launcher",launcher:S.pinned?a.jsx("button",{type:"button",className:"aops-v2-nav-reopen",onClick:W,"aria-label":n("chatNavReopen"),title:n("chatNavReopen"),"data-testid":"aops-v2-chat-nav-reopen",children:a.jsx(Lc,{label:n("chatNavModeNavigator")})}):K}):null;return{controller:S,treePanel:O,dockNode:K,navThinBar:ve,isLeftMenuMode:S.isLeftMenuMode,isNavigatorOpen:S.open,isPinned:S.pinned,openNavigator:W,leftDockMode:ee,leftDockWidth:S.navigatorWidth,channelCount:e.channels.length,searchValue:r,onSearchChange:i,selectionMode:u,selectedChannelIds:h,selectedChannelCount:I.length,bulkBusy:j,bulkError:k,selectedDeleteBlocked:E,enterSelectionMode:()=>{v(!0),x(null)},exitSelectionMode:J,toggleChannelSelection:z,selectAllChannels:re,requestBulkAction:b,bulkDialog:_}}var Mc;(function(e){e.Throw="throw",e.DefaultReturnKey="returnKey"})(Mc||(Mc={}));class PM extends Error{code;context;constructor(n,r,i){super(n),this.code=r,this.context=i,this.name="I18nError"}}class FM extends PM{constructor(n,r,i){super(`Resource not found: locale=${n}, namespace=${r}${i?`, key=${i}`:""}`,"RESOURCE_NOT_FOUND",{locale:n,namespace:r,key:i}),this.name="I18nResourceNotFoundError"}}class Pr{static translate(n,r,i){return!n||!r?n:this.substituteParameters(n,r,i)}static substituteParameters(n,r,i){return n.replace(/\{\{(\w+)\}\}/g,(o,d)=>{const u=r[d];return u==null?(i?.debug&&console.warn(`Missing parameter '${d}' in translation template: ${n}`),o):this.formatValue(u,i)})}static formatValue(n,r){return n instanceof Date?this.formatDate(n,r?.locale):typeof n=="number"?this.formatNumber(n,r?.locale):String(n)}static formatDate(n,r){if(!r)return n.toISOString();try{return new Intl.DateTimeFormat(r).format(n)}catch{return n.toISOString()}}static formatNumber(n,r){if(!r)return n.toString();try{return new Intl.NumberFormat(r).format(n)}catch{return n.toString()}}static getNestedValue(n,r){return r.split(".").reduce((i,o)=>i&&typeof i=="object"?i[o]:void 0,n)}static setNestedValue(n,r,i){const o=r.split("."),d=o.pop();let u=n;for(const v of o)(!(v in u)||typeof u[v]!="object")&&(u[v]={}),u=u[v];u[d]=i}static validateKey(n){return!n||typeof n!="string"?!1:/^[a-zA-Z0-9._-]+$/.test(n)}static normalizeLocale(n){return n.toLowerCase().replace(/_/g,"-")}static getFallbackLocales(n){const r=this.normalizeLocale(n),i=r.split("-"),o=[r];return i.length>1&&o.push(i[0]),o}static parseNamespacedKey(n){const r=n.indexOf(":");return r===-1?{key:n}:{namespace:n.substring(0,r),key:n.substring(r+1)}}static buildNamespacedKey(n,r){return`${n}:${r}`}static mergeTranslations(n,r){if(!r||typeof r!="object")return n;const i={...n};for(const[o,d]of Object.entries(r))d&&typeof d=="object"&&!Array.isArray(d)?i[o]=this.mergeTranslations(i[o]||{},d):i[o]=d;return i}static flattenTranslations(n,r="",i="."){const o={};for(const[d,u]of Object.entries(n)){const v=r?`${r}${i}${d}`:d;u&&typeof u=="object"&&!Array.isArray(u)?Object.assign(o,this.flattenTranslations(u,v,i)):o[v]=String(u)}return o}static createTranslation(n){const{TranslationType:r}=require("../translations/types.js"),{SimpleTranslation:i}=require("../translations/SimpleTranslation.js"),{ParameterizedTranslation:o}=require("../translations/ParameterizedTranslation.js"),{PluralizedTranslation:d}=require("../translations/PluralizedTranslation.js"),{FormattedTranslation:u}=require("../translations/FormattedTranslation.js"),{ConditionalTranslation:v}=require("../translations/ConditionalTranslation.js");switch(n.type){case r.SIMPLE:return new i(n.value);case r.PARAMETERIZED:return new o(n.template,n.requiredParams);case r.PLURALIZED:return new d(n.rules,n.countParam);case r.FORMATTED:return new u(n.template,n.formatter);case r.CONDITIONAL:return v.fromDefinition(n);default:throw new Error(`Unknown translation type: ${n.type}`)}}static validateDefinition(n){const r=[];return!n||typeof n!="object"?{isValid:!1,errors:[{name:"INVALID_DEFINITION",type:"unknown",field:"definition",message:"Definition must be an object",code:"INVALID_DEFINITION",translationType:"unknown",validationErrors:[]}]}:n.type?{isValid:r.length===0,errors:r}:{isValid:!1,errors:[{name:"MISSING_TYPE",type:n.type,field:"type",message:"Translation type is required",code:"MISSING_TYPE",translationType:n.type,validationErrors:[]}]}}static createMissingTranslationError(n,r,i){return new FM(n,r,i)}}class on{static defaultNamespace="ns";config;resources={};namespaces=new Set;translators=new Map;constructor(n){this.config={defaultLocale:n.defaultLocale,fallbackLocale:n.fallbackLocale||n.defaultLocale,defaultNamespace:n.defaultNamespace||on.defaultNamespace,debug:n.debug??!1,strict:n.strict??Mc.DefaultReturnKey},this.config.debug&&console.log("XfI18n initialized with config:",this.config)}addResource(n,r,i,o){if(o&&!o.includes(n)){this.config.debug&&console.log(`Skipping resource for locale '${n}' due to allowedLocales filter.`);return}this.validateLocale(n),i=i||this.config.defaultNamespace,this.resources[i]||(this.resources[i]={}),this.resources[i][n]=r,this.namespaces.add(i),this.config.debug&&console.log(`Added resource for ${i}:${n}`,r)}addResources(n,r){for(const i of n){if(r&&!r.includes(i.locale)){this.config.debug&&console.log(`Skipping source for locale '${i.locale}' due to allowedLocales filter.`);continue}this.addResource(i.locale,i.messages,i.namespace,r)}}addBundle(n,r){this.addResources(n.sources,r)}addInlineResource(n,r,i){r=r||this.config.defaultNamespace;const o=new Set;for(const d of Object.values(n))for(const u of Object.keys(d))o.add(u);for(const d of o){if(i&&!i.includes(d)){this.config.debug&&console.log(`Skipping inline resource for locale '${d}' due to allowedLocales filter.`);continue}const u={};for(const[v,h]of Object.entries(n))h[d]&&(u[v]=h[d]);Object.keys(u).length>0&&this.addResource(d,u,r,i)}}getResource(n,r){n=n||this.config.defaultLocale,r=r||this.config.defaultNamespace;const i=this.resources[r]?.[n];if(i!==void 0)return i;if(n!==this.config.fallbackLocale)return this.getResource(this.config.fallbackLocale,r)}getResources(){return this.resources}namespaceCacheToI18nBundle(n){const r=[];for(const[i,o]of Object.entries(n))for(const[d,u]of Object.entries(o))r.push({locale:d,namespace:i,messages:u});return{sources:r}}hasNamespace(n,r){const i=r||this.config.defaultLocale;return this.getResource(i,n)!==void 0}getNamespaces(){return Array.from(this.namespaces)}getLocales(n){const r=this.resources[n];return r?Object.keys(r):[]}translate(n,r,i,o){const d={locale:r||this.config.defaultLocale,namespace:i||this.config.defaultNamespace,fallbackLocale:this.config.fallbackLocale,debug:this.config.debug},u=this.translateWithContext(n,d,o);if(u!==n)return u;if(this.config.strict===Mc.DefaultReturnKey)return n;throw new Error(`Translation not found: ${n} for locale ${d.locale}`)}translateWithContext(n,r,i){const{namespace:o,key:d}=Pr.parseNamespacedKey(n),u=o||r.namespace||this.config.defaultNamespace,v=this.getTranslation(d,r.locale,u);if(v!==void 0)return Pr.translate(v,i,r);if(r.locale!==r.fallbackLocale){const h=this.getTranslation(d,r.fallbackLocale,u);if(h!==void 0)return Pr.translate(h,i,{...r,locale:r.fallbackLocale})}return r.debug&&console.warn(`Translation not found: ${u}:${d} for locale ${r.locale}`),d}getTranslation(n,r,i){const o=this.getResource(r,i);if(!o||typeof o!="object")return;const d=Pr.getNestedValue(o,n);if(typeof d=="string")return d}createTranslator(n,r){const i=n||this.config.defaultLocale,o=r||this.config.defaultNamespace,u=((v,h)=>this.translate(v,i,o,h));return u.locale=i,u.namespace=o,u}getTranslator(n,r){const i=`${n}:${r}`;if(this.translators.has(i))return this.translators.get(i);const o=this.createTranslator(n,r);return this.translators.set(i,o),o}getFlattenedTranslations(n,r){const i=this.getResource(n,r);return!i||typeof i!="object"?{}:Pr.flattenTranslations(i)}mergeTranslations(n,r,i,o){const d=this.getResource(r,n)||{},u=Pr.mergeTranslations(d,i);this.addResource(r,u,n,o)}validateLocale(n){const r=[];return!n||typeof n!="string"?r.push({path:"locale",message:"Locale must be a non-empty string",code:"INVALID_LOCALE"}):/^[a-z]{2}(-[A-Z]{2})?$/.test(n)||this.config.debug&&console.warn(`Locale '${n}' doesn't match standard format (e.g., 'en', 'en-US')`),{isValid:r.length===0,errors:r}}getConfig(){return{...this.config}}updateConfig(n){n.debug!==void 0&&(this.config.debug=n.debug),n.defaultNamespace!==void 0&&(this.config.defaultNamespace=n.defaultNamespace)}getAvailableLocales(){const n=new Set;for(const r of Object.keys(this.resources))for(const i of Object.keys(this.resources[r]||{}))n.add(i);return Array.from(n).sort()}}class KM{engine;config;filters;translators=new Map;constructor({config:n,bmResources:r,inlineResources:i,filters:o}){if(r&&i)throw new Error("bmResources and inlineResources cannot be used together");this.engine=new on(n),this.config=n,this.filters=o,r&&this.addResources(r),i&&this.addInlineResources(i)}addResources(n,r){const i=r||this.config.defaultNamespace||on.defaultNamespace,o=this.filters;for(const[d,u]of Object.entries(n)){if(o&&!o.includes(d))continue;const v={};u.fields&&(v.fields=u.fields),u.tags&&(v.tags=u.tags),u.validations&&(v.validations=u.validations),this.engine.mergeTranslations(i,d,v,o)}}addInlineResources(n,r){const i=r||this.config.defaultNamespace||on.defaultNamespace,o=this.filters,d=(h,m)=>{if(h)for(const g of Object.keys(h))m?.add(g)},u=new Set;if(n.fields)for(const h of Object.values(n.fields))h&&(d(h.label,u),d(h.placeholder,u),d(h.tooltip,u));const v=h=>{if(h)for(const m of Object.values(h))d(m,u)};v(n.tags),v(n.validations);for(const h of u){if(o&&!o.includes(h))continue;const m={};if(n.fields)for(const[b,j]of Object.entries(n.fields)){if(!j)continue;const C={};j.label&&j.label[h]!==void 0&&(C.label=j.label[h]),j.placeholder&&j.placeholder[h]!==void 0&&(C.placeholder=j.placeholder[h]),j.tooltip&&j.tooltip[h]!==void 0&&(C.tooltip=j.tooltip[h]),Object.keys(C).length&&(m.fields||(m.fields={}),m.fields[b]=C)}const g=(b,j)=>{if(j)for(const[C,k]of Object.entries(j)){const x=k[h];x!==void 0&&(m[b]||(m[b]={}),m[b][C]=x)}};g("tags",n.tags),g("validations",n.validations),Object.keys(m).length&&this.engine.mergeTranslations(i,h,m,o)}}getTranslatedResource(n,r){return this.engine.getResource(n,r)}getTranslatedResourceInline(n){const r=n?.locale,i=n?.namespace,o=n?.filters,d=this.filters,u=o&&d?o.filter(m=>d.includes(m)):o||d,v=(m,g)=>{const b=this.engine.getResource(m,i);if(!b)return;if(b.fields){const C=g.fields??{};for(const[k,x]of Object.entries(b.fields)){if(!x)continue;const S=C[k]??{},T={...S};x.label!==void 0&&(T.label={...S.label,[m]:String(x.label)}),x.placeholder!==void 0&&(T.placeholder={...S.placeholder,[m]:String(x.placeholder)}),x.tooltip!==void 0&&(T.tooltip={...S.tooltip,[m]:String(x.tooltip)}),Object.keys(T).length&&(C[k]=T)}Object.keys(C).length&&(g.fields=C)}const j=(C,k)=>{if(!C)return k;const x={...k??{}};for(const[S,T]of Object.entries(C)){if(T===void 0)continue;const I=x[S]??{};x[S]={...I,[m]:String(T)}}return Object.keys(x).length?x:void 0};g.tags=j(b.tags,g.tags),g.validations=j(b.validations,g.validations)},h={};if(u&&u.length>0)for(const m of u)v(m,h);else{const m=r||this.config.defaultLocale;if(!m)return;v(m,h)}return Object.keys(h).length?h:void 0}getFlattenedTranslations(n,r){return this.engine.getFlattenedTranslations(n,r)}getTranslator(n,r){const i=`${n}:${r}`;if(this.translators.has(i))return this.translators.get(i);const o=this.engine.createTranslator(n,r);return this.translators.set(i,o),o}getFieldTranslator(n={}){const r=this.getFieldLabelTranslator(n),i=this.getFieldPlaceholderTranslator(n),o=this.getFieldTooltipTranslator(n);return d=>({label:r(d,n.params),placeholder:i(d,n.params),tooltip:o(d,n.params)})}getFieldLabelTranslator(n={}){const r=this.getTranslator(n.locale,n.namespace),i=((o,d)=>r(`fields.${o}.label`,d));return i.locale=n.locale||this.config.defaultLocale,i.namespace=n.namespace||this.config.defaultNamespace||on.defaultNamespace,i}getFieldPlaceholderTranslator(n={}){const r=this.getTranslator(n.locale,n.namespace),i=((o,d)=>r(`fields.${o}.placeholder`,d));return i.locale=n.locale||this.config.defaultLocale,i.namespace=n.namespace||this.config.defaultNamespace||on.defaultNamespace,i}getFieldTooltipTranslator(n={}){const r=this.getTranslator(n.locale,n.namespace),i=((o,d)=>r(`fields.${o}.tooltip`,d));return i.locale=n.locale||this.config.defaultLocale,i.namespace=n.namespace||this.config.defaultNamespace||on.defaultNamespace,i}getValidationTranslator(n={}){const r=this.getTranslator(n.locale,n.namespace),i=((o,d)=>r(`validations.${o}`,d));return i.locale=n.locale||this.config.defaultLocale,i.namespace=n.namespace||this.config.defaultNamespace||on.defaultNamespace,i}getTagTranslator(n={}){const r=this.getTranslator(n.locale,n.namespace),i=((o,d)=>r(`tags.${o}`,d));return i.locale=n.locale||this.config.defaultLocale,i.namespace=n.namespace||this.config.defaultNamespace||on.defaultNamespace,i}getZodTranslators(n){const r=new Set,i=m=>{r.has(m)||(n&&n[m]&&this.addInlineResources({validations:{[m]:n[m]}}),r.add(m))},o=(m,g)=>(i(m),this.validation(m,{params:g})),d=this.getFieldLabelTranslator(),u=(m=>d(m)),v=this.getTranslator();return{f:u,v:o,t:v,i18nBm:this}}getField(n,r={}){const i=this.fieldLabel(n,r),o=this.fieldPlaceholder(n,r),d=this.fieldTooltip(n,r);return{label:i,placeholder:o,tooltip:d}}fieldLabel(n,r={}){const i=`fields.${String(n)}.label`;return this.getTranslator(r.locale,r.namespace)(i,r.params)}fieldPlaceholder(n,r={}){const i=`fields.${String(n)}.placeholder`;return this.getTranslator(r.locale,r.namespace)(i,r.params)}fieldTooltip(n,r={}){const i=`fields.${String(n)}.tooltip`;return this.getTranslator(r.locale,r.namespace)(i,r.params)}tag(n,r={}){const i=`tags.${String(n)}`;return this.getTranslator(r.locale,r.namespace)(i,r.params)}validation(n,r={}){const i=`validations.${String(n)}`;return this.getTranslator(r.locale,r.namespace)(i,r.params)}}const zM={tags:{appTitle:{en:"AOPS Cockpit v2",tr:"AOPS Kokpit v2"},appShort:{en:"AOPS",tr:"AOPS"},webMode:{en:"Web cockpit",tr:"Web kokpit"},navLandmark:{en:"Cockpit sections",tr:"Kokpit bölümleri"},navProjects:{en:"Projects",tr:"Projeler"},navProjectman:{en:"PM",tr:"PM"},navSessions:{en:"Sessions",tr:"Oturumlar"},navChat:{en:"Chat",tr:"Sohbet"},dockPinned:{en:"Pinned navigation",tr:"Sabit navigasyon"},dockCompact:{en:"Compact navigation",tr:"Kompakt navigasyon"},localeToggle:{en:"Switch language",tr:"Dili değiştir"},projectsEyebrow:{en:"Projects",tr:"Projeler"},projectsTitle:{en:"Project Inventory",tr:"Proje Envanteri"},projectsHeaderNote:{en:"Hosted project context",tr:"Hosted proje bağlamı"},projectsReadyTitle:{en:"Projects surface",tr:"Proje yuzeyi"},projectsReadyMessage:{en:"Registry route active",tr:"Registry rotasi aktif"},projectsRegistryBadge:{en:"ui-plugin registry",tr:"ui-plugin registry"},authCheckingTitle:{en:"Checking session",tr:"Oturum kontrol ediliyor"},authCheckingMessage:{en:"AOPS host session",tr:"AOPS host oturumu"},authErrorTitle:{en:"Session unavailable",tr:"Oturum kullanılamıyor"},authRetry:{en:"Retry",tr:"Tekrar dene"},authSignIn:{en:"Sign in with South",tr:"South ile giriş yap"},authSignInMessage:{en:"Sign in or select an active South tenant to continue.",tr:"Devam etmek için giriş yap veya etkin bir South tenant seç."},authSignOut:{en:"Sign out",tr:"Çıkış yap"},authProviderTrusted:{en:"Trusted local",tr:"Güvenilir yerel"},authProviderRemote:{en:"South session",tr:"South oturumu"},projectsRefresh:{en:"Refresh",tr:"Yenile"},projectsLoadingTitle:{en:"Loading projects",tr:"Projeler yükleniyor"},projectsLoadingMessage:{en:"Reading hosted inventory",tr:"Hosted envanter okunuyor"},projectsErrorTitle:{en:"Projects unavailable",tr:"Projeler kullanılamıyor"},projectsEmptyTitle:{en:"No projects",tr:"Proje yok"},projectsEmptyMessage:{en:"No visible hosted projects",tr:"Görünür hosted proje yok"},projectsListLabel:{en:"Project list",tr:"Proje listesi"},projectDetailTitle:{en:"Project detail",tr:"Proje detayı"},projectDetailTabsLabel:{en:"Project detail sections",tr:"Proje detay sekmeleri"},projectTabOverview:{en:"Overview",tr:"Özet"},projectTabOverviewHint:{en:"Identity and hosted scope",tr:"Kimlik ve hosted kapsam"},projectTabActivity:{en:"Timeline",tr:"Akış"},projectTabActivityHint:{en:"Cross-domain recent changes",tr:"Domainler arası son değişiklikler"},projectTabPlanning:{en:"Planning",tr:"Planlama"},projectTabPlanningHint:{en:"Boards, tasks, sprints",tr:"Panolar, görevler, sprintler"},projectTabMemory:{en:"Memory",tr:"Hafıza"},projectTabMemoryHint:{en:"Durable project context",tr:"Kalıcı proje bağlamı"},projectTabDocs:{en:"Docs",tr:"Dokümanlar"},projectTabDocsHint:{en:"Docman assets",tr:"Docman varlıkları"},projectOverviewTitle:{en:"Project info",tr:"Proje bilgisi"},projectOverviewMessage:{en:"Core hosted project identity for the selected register row.",tr:"Seçili kayıt satırı için temel hosted proje kimliği."},projectPlanningTitle:{en:"Projectman context",tr:"Projectman bağlamı"},projectPlanningMessage:{en:"Boards, tasks, sprints, review requests, and issues use this selected project scope.",tr:"Panolar, görevler, sprintler, inceleme istekleri ve sorunlar bu seçili proje kapsamını kullanır."},projectMemoryTitle:{en:"Agentspace memory",tr:"Agentspace hafızası"},projectMemoryMessage:{en:"Durable handoffs, decisions, and resume notes are read by project scope.",tr:"Kalıcı handoff, karar ve resume notları proje kapsamına göre okunur."},projectDocsTitle:{en:"Docman documents",tr:"Docman dokümanları"},projectDocsMessage:{en:"Documents and current versions are filtered through the selected project context.",tr:"Dokümanlar ve güncel versiyonlar seçili proje bağlamıyla filtrelenir."},projectOpenPlanning:{en:"Open PM",tr:"PM'i aç"},projectOpenPlan:{en:"Open plan",tr:"Planı aç"},projectOpenMemory:{en:"Open Memory",tr:"Hafızayı aç"},projectOpenDocs:{en:"Open Docs",tr:"Dokümanları aç"},projectLatestPlan:{en:"Latest plan or sprint",tr:"Son plan veya sprint"},projectLatestMemory:{en:"Latest memory",tr:"Son hafıza kaydı"},projectLatestDocs:{en:"Latest document",tr:"Son doküman"},projectSummaryLoading:{en:"Summary is loading for this project.",tr:"Bu proje için özet yükleniyor."},projectSummaryError:{en:"Summary data is unavailable right now.",tr:"Özet verisi şu anda kullanılamıyor."},projectSummaryEmpty:{en:"No records yet for this project section.",tr:"Bu proje bölümü için henüz kayıt yok."},projectPulseTitle:{en:"Project pulse",tr:"Proje nabzı"},projectPulseMessage:{en:"A live, project-scoped snapshot across the AOPS owner domains.",tr:"AOPS owner domainlerinde proje kapsamlı canlı durum özeti."},projectPulseOpenWork:{en:"Open work",tr:"Açık işler"},projectPulsePendingReviews:{en:"Pending reviews",tr:"Bekleyen incelemeler"},projectPulseRunningRuns:{en:"Running runs",tr:"Çalışan koşular"},projectDomainProjectman:{en:"Projectman",tr:"Projectman"},projectDomainAgentspace:{en:"Agentspace",tr:"Agentspace"},projectDomainDocman:{en:"Docman",tr:"Docman"},projectDomainRunner:{en:"Runner",tr:"Runner"},projectDomainReady:{en:"Ready",tr:"Hazır"},projectDomainLoading:{en:"Loading",tr:"Yükleniyor"},projectDomainError:{en:"Unavailable",tr:"Kullanılamıyor"},projectDomainEmpty:{en:"No records",tr:"Kayıt yok"},projectDomainLatest:{en:"Latest change",tr:"Son değişiklik"},projectActivityTitle:{en:"Cross-domain timeline",tr:"Domainler arası zaman akışı"},projectActivityMessage:{en:"Projectman, Agentspace, Docman, and Runner records ordered by their latest timestamps.",tr:"Projectman, Agentspace, Docman ve Runner kayıtları son zaman damgalarına göre sıralanır."},projectActivitySnapshotNote:{en:"This is a recent-change view composed from current read models, not an audit log.",tr:"Bu görünüm güncel okuma modellerinden üretilen son değişiklik akışıdır; denetim günlüğü değildir."},projectActivityRangeLabel:{en:"Time range",tr:"Zaman aralığı"},projectActivityRangeDay:{en:"24 hours",tr:"24 saat"},projectActivityRangeWeek:{en:"7 days",tr:"7 gün"},projectActivityRangeMonth:{en:"30 days",tr:"30 gün"},projectActivityRangeAll:{en:"All time",tr:"Tümü"},projectActivityTotal:{en:"Total changes",tr:"Toplam değişiklik"},projectActivityVisible:{en:"In range",tr:"Aralıkta"},projectActivityDomains:{en:"Active domains",tr:"Aktif domain"},projectActivityLatest:{en:"Latest",tr:"En son"},projectActivityEmpty:{en:"No changes in this time range.",tr:"Bu zaman aralığında değişiklik yok."},projectActivityOpen:{en:"Open section",tr:"Bölümü aç"},projectActivityChanges:{en:"changes",tr:"değişiklik"},projectLatestDayTitle:{en:"Latest active day",tr:"Son aktif gün"},projectLatestDayMessage:{en:"Latest project records across owner domains.",tr:"Owner domainlerdeki en son proje kayıtları."},projectLatestDayOpenAll:{en:"Open full timeline",tr:"Tüm akışı aç"},projectLatestDayEmpty:{en:"No project activity is available yet.",tr:"Henüz proje hareketi bulunmuyor."},projectDocGroups:{en:"Groups",tr:"Gruplar"},projectReferences:{en:"Project references",tr:"Proje referansları"},projectSlug:{en:"Slug",tr:"Slug"},projectKey:{en:"Key",tr:"Anahtar"},projectStatus:{en:"Status",tr:"Durum"},projectVisibility:{en:"Visibility",tr:"Görünürlük"},projectType:{en:"Type",tr:"Tip"},projectScope:{en:"Scope",tr:"Scope"},projectId:{en:"Project ID",tr:"Proje ID"},projectSelected:{en:"Selected",tr:"Seçili"},projectCount:{en:"Projects",tr:"Projeler"},unknownValue:{en:"Unknown",tr:"Bilinmiyor"},pmTitle:{en:"PM Workbench",tr:"PM Workbench"},pmHeaderNote:{en:"Project-scoped PM read surface",tr:"Proje kapsamlı PM okuma yüzeyi"},pmHeaderProjectId:{en:"Project Id",tr:"Proje Id"},pmSelectedProject:{en:"Project",tr:"Proje"},pmRefresh:{en:"Refresh",tr:"Yenile"},pmNoProjectTitle:{en:"No project selected",tr:"Proje seçili değil"},pmNoProjectMessage:{en:"Select a project to read Projectman records",tr:"Projectman kayıtlarını okumak için proje seçin"},pmLoadingTitle:{en:"Loading Projectman",tr:"Projectman yükleniyor"},pmLoadingMessage:{en:"Reading hosted PM records",tr:"Hosted PM kayıtları okunuyor"},pmErrorTitle:{en:"Projectman unavailable",tr:"Projectman kullanılamıyor"},pmEmptyTitle:{en:"No PM records",tr:"PM kaydı yok"},pmEmptyMessage:{en:"No Projectman records for the selected project",tr:"Seçili proje için Projectman kaydı yok"},pmTabOverview:{en:"Overview",tr:"Özet"},pmTabTasks:{en:"Tasks",tr:"Görevler"},pmTabBoards:{en:"Boards",tr:"Panolar"},pmTabSprintsPlans:{en:"Sprints/Plans",tr:"Sprintler/Planlar"},pmSectionBoards:{en:"Boards",tr:"Panolar"},pmSectionSprints:{en:"Sprints",tr:"Sprintler"},pmSectionIssues:{en:"Issues",tr:"Sorunlar"},pmSectionFeedback:{en:"Feedback",tr:"Geri Bildirim"},pmSectionReviews:{en:"Reviews",tr:"İncelemeler"},pmBandProject:{en:"Project",tr:"Proje"},pmBandProjectScope:{en:"Project · hosted scope",tr:"Proje · barındırılan kapsam"},pmActionBack:{en:"Back to projects",tr:"Projelere dön"},pmActionMore:{en:"More actions",tr:"Diğer işlemler"},pmActionRefreshData:{en:"Refresh data",tr:"Veriyi yenile"},pmActionGoProjects:{en:"Go to Projects",tr:"Projelere git"},pmGroupBy:{en:"Group",tr:"Grupla"},pmFieldUpdated:{en:"Updated",tr:"Güncelleme"},pmRollupTodo:{en:"Todo",tr:"Yapılacak"},pmRollupDoing:{en:"Doing",tr:"Sürüyor"},pmRollupBlocked:{en:"Blocked",tr:"Engelli"},pmRollupPaused:{en:"Paused",tr:"Duraklatıldı"},pmRollupInReview:{en:"In Review",tr:"İncelemede"},pmRollupPostponed:{en:"Postponed",tr:"Ertelendi"},pmRollupCancelled:{en:"Cancelled",tr:"İptal"},pmRollupCompleted:{en:"Completed",tr:"Tamamlandı"},navSettings:{en:"View settings",tr:"Görünüm ayarları"},navMode:{en:"Mode",tr:"Mod"},navModeNavigator:{en:"Navigator",tr:"Navigatör"},navModeLeftMenu:{en:"Left menu",tr:"Sol menü"},navModeDropdown:{en:"Dropdown",tr:"Açılır liste"},navModeCards:{en:"Cards",tr:"Kartlar"},navPaneReopen:{en:"Show navigator",tr:"Navigatörü göster"},navSidePanelShow:{en:"Show side panel",tr:"Yan paneli göster"},navSidePanelHide:{en:"Hide side panel",tr:"Yan paneli gizle"},navSidePanelClose:{en:"Close side panel",tr:"Yan paneli kapat"},navArchivedGroup:{en:"Archived",tr:"Arşiv"},navActiveGroup:{en:"Active",tr:"Aktif"},pmNavActiveBoards:{en:"Active boards",tr:"Aktif panolar"},pmNavUntitledBoard:{en:"Untitled board",tr:"Adsız pano"},pmNavSearchBoards:{en:"Search boards, TASK-92 or task content",tr:"Pano, TASK-92 veya görev içeriği ara"},pmNavFilterBoards:{en:"Filter boards",tr:"Panoları filtrele"},pmNavBoardTools:{en:"Board navigator tools",tr:"Pano navigatör araçları"},pmNavBoardsPane:{en:"Boards navigator",tr:"Panolar navigatörü"},pmNavNoBoards:{en:"No boards",tr:"Pano yok"},pmNavNoBoardsMatch:{en:"No boards match your search",tr:"Aramayla eşleşen pano yok"},pmNavBoardsPanelTitle:{en:"Boards",tr:"Panolar"},pmNavBoardK:{en:"Board",tr:"Pano"},pmNavSelectBoard:{en:"Select board",tr:"Pano seç"},pmCardsToolbar:{en:"Card list toolbar",tr:"Kart listesi araç çubuğu"},pmCardsFilterTitle:{en:"Board filters",tr:"Pano filtreleri"},pmCardsFilterScope:{en:"Current scope",tr:"Geçerli kapsam"},pmCardsFilterLabel:{en:"Board list",tr:"Pano listesi"},pmCardsFilterAll:{en:"All boards",tr:"Tüm panolar"},pmCardsFilterAllNote:{en:"Show every board in the current project scope.",tr:"Geçerli proje kapsamındaki tüm panoları göster."},pmCardsFilterFavorites:{en:"Favorites only",tr:"Sadece favoriler"},pmCardsFilterFavoritesNote:{en:"Keep only favorites in the list.",tr:"Listede yalnızca favorileri tut."},pmCardsFilterWithTasks:{en:"Boards with tasks",tr:"Görevi olan panolar"},pmCardsFilterWithTasksNote:{en:"Hide empty boards from the list.",tr:"Boş panoları listeden gizle."},pmCardsFilterClear:{en:"Clear",tr:"Temizle"},pmCardsFilterActive:{en:"Active filter",tr:"Aktif filtre"},pmCardsSortBy:{en:"Sort by",tr:"Sırala"},pmCardsSortDirection:{en:"Sort direction",tr:"Sıralama yönü"},pmCardsSortManual:{en:"Manual order",tr:"Elle sıralama"},pmCardsSortUpdated:{en:"Updated date",tr:"Güncellenme tarihi"},pmCardsSortCreated:{en:"Created date",tr:"Oluşturulma tarihi"},pmCardsSortName:{en:"Name",tr:"Ad"},pmCardsSortAsc:{en:"Ascending",tr:"Artan"},pmCardsSortDesc:{en:"Descending",tr:"Azalan"},pmCardsExpandAll:{en:"Expand all",tr:"Tümünü aç"},pmCardsCollapseAll:{en:"Collapse all",tr:"Tümünü kapat"},pmCardsSearchClear:{en:"Clear search",tr:"Aramayı temizle"},pmCardsEmpty:{en:"No boards match the current filter",tr:"Geçerli filtreyle eşleşen pano yok"},pmCardExpand:{en:"Expand",tr:"Genişlet"},pmCardCollapse:{en:"Collapse",tr:"Daralt"},pmCardDetail:{en:"Details",tr:"Detay"},pmCardFavoriteAdd:{en:"Add to favorites",tr:"Favorilere ekle"},pmCardFavoriteRemove:{en:"Remove from favorites",tr:"Favorilerden kaldır"},pmCardMoveUp:{en:"Move up",tr:"Yukarı taşı"},pmCardMoveDown:{en:"Move down",tr:"Aşağı taşı"},pmCardEdit:{en:"Edit",tr:"Düzenle"},pmCardReadOnly:{en:"Read-only cockpit",tr:"Salt okunur kokpit"},pmCardCopyId:{en:"Copy id",tr:"Kimliği kopyala"},pmCardMenu:{en:"Record actions",tr:"Kayıt işlemleri"},pmCardArchive:{en:"Archive board",tr:"Panoyu arşivle"},pmCardUnarchive:{en:"Unarchive board",tr:"Panoyu arşivden çıkar"},pmCardDelete:{en:"Delete board",tr:"Panoyu sil"},pmBoardEditorCreateTitle:{en:"New Board",tr:"Yeni Pano"},pmBoardEditorEditTitle:{en:"Edit Board",tr:"Panoyu Düzenle"},pmBoardEditorName:{en:"Name",tr:"Ad"},pmBoardEditorSlug:{en:"Slug",tr:"Kısa ad"},pmBoardEditorSlugHint:{en:"Leave empty to derive it from the name.",tr:"Addan türetilmesi için boş bırakın."},pmBoardEditorSlugHintEdit:{en:"Leave empty to keep the current slug. Renaming the board does not move it.",tr:"Mevcut kısa adı korumak için boş bırakın. Panoyu yeniden adlandırmak kısa adı değiştirmez."},pmBoardEditorDescription:{en:"Description",tr:"Açıklama"},pmBoardEditorSave:{en:"Save",tr:"Kaydet"},pmBoardEditorSaveBusy:{en:"Saving…",tr:"Kaydediliyor…"},pmBoardEditorNameRequired:{en:"A board needs a name.",tr:"Panonun bir adı olmalı."},pmBoardEditorNew:{en:"New board",tr:"Yeni pano"},pmColumnsTitle:{en:"Board Columns",tr:"Pano Kolonları"},pmColumnsManage:{en:"Manage columns",tr:"Kolonları yönet"},pmColumnsAdd:{en:"Add column",tr:"Kolon ekle"},pmColumnsAddName:{en:"New column name",tr:"Yeni kolon adı"},pmColumnsWipLimit:{en:"WIP limit",tr:"WIP limiti"},pmColumnsWipLimitHint:{en:"Optional. Leave empty for no limit.",tr:"İsteğe bağlı. Limitsiz için boş bırakın."},pmColumnsRemove:{en:"Remove",tr:"Kaldır"},pmColumnsMoveUp:{en:"Move up",tr:"Yukarı taşı"},pmColumnsMoveDown:{en:"Move down",tr:"Aşağı taşı"},pmColumnsSaveOrder:{en:"Save order",tr:"Sırayı kaydet"},pmColumnsHoldsTasks:{en:"This column holds {count} task(s). They must be moved before it can be removed.",tr:"Bu kolonda {count} görev var. Kaldırılabilmesi için önce taşınmaları gerekiyor."},pmColumnsDestination:{en:"Move its tasks to",tr:"Görevlerini şuraya taşı"},pmColumnsDestinationRequired:{en:"Choose where the tasks should go.",tr:"Görevlerin nereye gideceğini seçin."},pmColumnsLastColumn:{en:"The last column cannot be removed while it holds tasks; there is nowhere to move them.",tr:"Görev tutan son kolon kaldırılamaz; görevleri taşıyacak yer yok."},pmColumnsRemoveConfirm:{en:"Remove column",tr:"Kolonu kaldır"},pmColumnsEmpty:{en:"This board has no columns yet.",tr:"Bu panoda henüz kolon yok."},pmColumnsBusy:{en:"Working…",tr:"İşleniyor…"},pmCardDeleteTitle:{en:"Delete Board",tr:"Panoyu Sil"},pmCardDeleteBoardLabel:{en:"Board",tr:"Pano"},pmCardDeleteQuestion:{en:"This permanently deletes the board. This cannot be undone.",tr:"Bu işlem panoyu kalıcı olarak siler ve geri alınamaz."},pmCardDeleteWarnOrphans:{en:"Linked records are deleted with it: {tasks} tasks and {columns} column links go too. This cannot be undone.",tr:"Bağlı kayıtlar da silinir: {tasks} görev ve {columns} kolon bağlantısı birlikte gider. Bu işlem geri alınamaz."},pmCardDeleteNoDeps:{en:"This board has no linked tasks.",tr:"Bu panoya bağlı görev yok."},pmCardDeleteConfirm:{en:"Delete Board",tr:"Panoyu Sil"},pmCardDeleteBusy:{en:"Deleting…",tr:"Siliniyor…"},pmCardActionFailed:{en:"Action failed",tr:"İşlem başarısız"},pmCardCancel:{en:"Cancel",tr:"Vazgeç"},pmCardsPagerPrev:{en:"Prev",tr:"Önceki"},pmCardsPagerNext:{en:"Next",tr:"Sonraki"},pmCardsPagerPage:{en:"Page",tr:"Sayfa"},pmCardsPagerNoun:{en:"boards",tr:"pano"},pmCardsPageSize:{en:"Per page",tr:"Sayfa başına"},pmCardTasksLoading:{en:"Loading tasks…",tr:"Görevler yükleniyor…"},pmCardDeleteWarnOrphansUnknown:{en:"Task count unknown. Any tasks and column links on this board are deleted with it. This cannot be undone.",tr:"Görev sayısı bilinmiyor. Bu panodaki görevler ve kolon bağlantıları da silinir. Bu işlem geri alınamaz."},pmCardBoardSearch:{en:"Search tasks",tr:"Görevlerde ara"},pmCardBoardSearchClear:{en:"Clear task search",tr:"Görev aramasını temizle"},pmCardFilterColumns:{en:"Column filter",tr:"Kolon filtresi"},pmCardFilterAllColumns:{en:"All columns",tr:"Tüm kolonlar"},pmSprintCardsFilterTitle:{en:"Record filters",tr:"Kayıt filtreleri"},pmSprintCardsFilterLabel:{en:"Record list",tr:"Kayıt listesi"},pmSprintCardsFilterAll:{en:"All records",tr:"Tüm kayıtlar"},pmSprintCardsFilterAllNote:{en:"Show sprints and implementation plans together.",tr:"Sprintleri ve uygulama planlarını birlikte göster."},pmSprintCardsFilterSprints:{en:"Sprints only",tr:"Sadece sprintler"},pmSprintCardsFilterSprintsNote:{en:"Hide implementation plans from the list.",tr:"Uygulama planlarını listeden gizle."},pmSprintCardsFilterPlans:{en:"Plans only",tr:"Sadece planlar"},pmSprintCardsFilterPlansNote:{en:"Hide sprints from the list.",tr:"Sprintleri listeden gizle."},pmSprintCardsPagerNoun:{en:"records",tr:"kayıt"},pmSprintArchive:{en:"Archive sprint",tr:"Sprinti arşivle"},pmSprintUnarchive:{en:"Unarchive sprint",tr:"Sprinti arşivden çıkar"},pmSprintDelete:{en:"Delete sprint",tr:"Sprinti sil"},pmSprintDeleteTitle:{en:"Delete Sprint",tr:"Sprinti Sil"},pmSprintDeleteLabel:{en:"Sprint",tr:"Sprint"},pmSprintDeleteQuestion:{en:"This permanently deletes the sprint document. This cannot be undone.",tr:"Bu işlem sprint dokümanını kalıcı olarak siler ve geri alınamaz."},pmSprintDeleteWarn:{en:"The sprint's phases and checklist items are deleted with the document; the linked kanban task is NOT deleted.",tr:"Sprintin fazları ve checklist maddeleri dokümanla birlikte silinir; bağlı kanban görevi SİLİNMEZ."},pmSprintDeleteConfirm:{en:"Delete Sprint",tr:"Sprinti Sil"},pmSprintPaneTitle:{en:"Record details",tr:"Kayıt detayı"},pmSprintMicrotaskSearch:{en:"Search checklist",tr:"Checklist'te ara"},pmSprintMicrotaskSearchClear:{en:"Clear checklist search",tr:"Checklist aramasını temizle"},pmFieldGoal:{en:"Goal",tr:"Hedef"},docsCardsOpen:{en:"Open document",tr:"Dokümanı aç"},pmRecordViewList:{en:"List",tr:"Liste"},pmRecordViewSidePanel:{en:"Side panel",tr:"Yan panel"},pmSprintSidePanelShow:{en:"Show sprint side panel",tr:"Sprint yan panelini göster"},pmSprintSidePanelHide:{en:"Hide sprint side panel",tr:"Sprint yan panelini gizle"},pmSprintSidePanelClose:{en:"Close sprint side panel",tr:"Sprint yan panelini kapat"},pmRecordViewLabel:{en:"View",tr:"Görünüm"},pmRecordDelete:{en:"Delete record",tr:"Kaydı sil"},pmRecordDeleteTitle:{en:"Delete Record",tr:"Kaydı Sil"},pmRecordDeleteLabel:{en:"Record",tr:"Kayıt"},pmRecordDeleteQuestion:{en:"This permanently deletes the record. This cannot be undone.",tr:"Bu işlem kaydı kalıcı olarak siler ve geri alınamaz."},pmRecordDeleteWarn:{en:"Embedded content (e.g. review results) is deleted with the record; linked sprints/tasks are NOT deleted.",tr:"Gömülü içerik (örn. inceleme sonuçları) kayıtla birlikte silinir; bağlı sprint/görevler SİLİNMEZ."},pmRecordDeleteConfirm:{en:"Delete Record",tr:"Kaydı Sil"},pmRecordsAllStatuses:{en:"All statuses",tr:"Tüm durumlar"},pmReviewResults:{en:"Results",tr:"Sonuçlar"},pmReviewPositives:{en:"Positives",tr:"Olumlular"},pmReviewConcerns:{en:"Concerns",tr:"Endişeler"},pmReviewObjections:{en:"Objections",tr:"İtirazlar"},pmCardTasksWord:{en:"tasks",tr:"görev"},pmCardColumnsWord:{en:"columns",tr:"kolon"},pmCardStatsLabel:{en:"Column statistics",tr:"Kolon istatistikleri"},pmCardPaneTitle:{en:"Board details",tr:"Pano detayı"},pmCardPaneClose:{en:"Close details",tr:"Detayı kapat"},pmCardPaneColumns:{en:"Columns",tr:"Kolonlar"},pmCardPaneNoDescription:{en:"No description",tr:"Açıklama yok"},pmCardPaneNoLinkedTask:{en:"No linked task",tr:"Bağlı görev yok"},projectsDeleteTitle:{en:"Delete project",tr:"Projeyi sil"},projectsDeleteCounting:{en:"Counting what this project holds…",tr:"Projenin neleri tuttuğu sayılıyor…"},projectsDeleteBlocked:{en:"This project still holds records. Move or remove them, then delete the project.",tr:"Bu proje hâlâ kayıt tutuyor. Önce onları taşıyın ya da kaldırın, sonra projeyi silin."},projectsDeleteEmpty:{en:"This project holds no records. Deleting it removes the project itself.",tr:"Bu proje hiç kayıt tutmuyor. Silmek yalnızca projenin kendisini kaldırır."},projectsDeleteTypeName:{en:"Type {name} to confirm",tr:"Onaylamak için {name} yazın"},projectsDeleteConfirm:{en:"Delete project",tr:"Projeyi sil"},projectsDeleteStale:{en:"The project changed while you were looking at it. The counts have been refreshed — review them and confirm again.",tr:"Siz bakarken proje değişti. Sayımlar yenilendi — gözden geçirip yeniden onaylayın."},pmFieldCreated:{en:"Created",tr:"Oluşturulma"},pmNavSprintsGroup:{en:"Sprints",tr:"Sprintler"},pmNavPlansGroup:{en:"Plans",tr:"Planlar"},pmNavUntitled:{en:"Untitled",tr:"Adsız"},pmNavSearchSprints:{en:"Search sprints & plans",tr:"Sprint ve planlarda ara"},pmNavFilterSprints:{en:"Filter sprints and plans",tr:"Sprint ve planları filtrele"},pmNavSprintTools:{en:"Sprint navigator tools",tr:"Sprint navigatör araçları"},pmNavSprintsPane:{en:"Sprints navigator",tr:"Sprintler navigatörü"},pmNavNoSprints:{en:"No sprints or plans",tr:"Sprint veya plan yok"},pmNavNothingMatches:{en:"Nothing matches your search",tr:"Aramayla eşleşen kayıt yok"},pmNavSprintsPanelTitle:{en:"Sprints & Plans",tr:"Sprintler & Planlar"},pmNavSprintK:{en:"Sprint",tr:"Sprint"},pmNavSelect:{en:"Select",tr:"Seç"},projectsNavUnknownStatus:{en:"Unknown status",tr:"Durumu bilinmeyen"},projectsNavUntitled:{en:"Untitled project",tr:"Adsız proje"},projectsNavSearch:{en:"Search projects",tr:"Projelerde ara"},projectsNavFilter:{en:"Filter projects",tr:"Projeleri filtrele"},projectsNavTools:{en:"Project navigator tools",tr:"Proje navigatör araçları"},projectsNavPane:{en:"Projects navigator",tr:"Projeler navigatörü"},projectsNavEmpty:{en:"No projects",tr:"Proje yok"},projectsNavEmptySearch:{en:"No projects match your search",tr:"Aramayla eşleşen proje yok"},projectsNavAll:{en:"All projects",tr:"Tüm projeler"},projectsNavPanelTitle:{en:"Projects",tr:"Projeler"},projectsNavFavoritesRecentTitle:{en:"Favorites and Recent Projects",tr:"Favoriler ve Son Projeler"},projectsNavRecents:{en:"Recently opened projects",tr:"Son açılan projeler"},projectsNavRecentsEmpty:{en:"No recently opened projects",tr:"Son açılan proje yok"},projectsNavRecentsRemove:{en:"Remove from recent projects",tr:"Son projelerden kaldır"},navAgentspace:{en:"Agentspace",tr:"Agentspace"},asEyebrow:{en:"Agentspace",tr:"Agentspace"},asTitle:{en:"Agentspace Workbench",tr:"Agentspace Çalışma Alanı"},asHeaderNote:{en:"Project-scoped agent memory and assets",tr:"Proje kapsamlı ajan hafızası, misyonlar ve varlıklar"},asSectionMemory:{en:"Memory",tr:"Hafıza"},asSectionDiscussions:{en:"Discussions",tr:"Tartışmalar"},asSectionPrompts:{en:"Prompts",tr:"Promptlar"},asSectionSkills:{en:"Skills",tr:"Skiller"},asSectionArtifacts:{en:"Artifacts",tr:"Artefaktlar"},asSectionResources:{en:"Resources",tr:"Kaynaklar"},asSectionAgents:{en:"Agents",tr:"Ajanlar"},asNoProjectTitle:{en:"Select a project",tr:"Bir proje seçin"},asNoProjectMessage:{en:"Agentspace reads are project-scoped — pick a project first.",tr:"Agentspace okumaları proje kapsamlıdır — önce bir proje seçin."},asLoadingTitle:{en:"Loading Agentspace",tr:"Agentspace yükleniyor"},asLoadingMessage:{en:"Fetching hosted agent records…",tr:"Barındırılan ajan kayıtları getiriliyor…"},asErrorTitle:{en:"Agentspace unavailable",tr:"Agentspace kullanılamıyor"},asEmptyTitle:{en:"No Agentspace records",tr:"Agentspace kaydı yok"},asEmptyMessage:{en:"No agent records for the selected project",tr:"Seçili proje için ajan kaydı yok"},asSearchMemory:{en:"Search memory",tr:"Hafızada ara"},asSearchDiscussions:{en:"Search discussions",tr:"Tartışmalarda ara"},asSearchPrompts:{en:"Search prompts",tr:"Promptlarda ara"},asSearchSkills:{en:"Search skills",tr:"Skillerde ara"},asSearchArtifacts:{en:"Search artifacts",tr:"Artefaktlarda ara"},asSearchResources:{en:"Search resources",tr:"Kaynaklarda ara"},asSearchAgents:{en:"Search agents",tr:"Ajanlarda ara"},asNoRecords:{en:"No records",tr:"Kayıt yok"},asFieldKind:{en:"Kind",tr:"Tür"},asFieldDurability:{en:"Durability",tr:"Kalıcılık"},asFieldImportance:{en:"Importance",tr:"Önem"},asFieldSource:{en:"Source",tr:"Kaynak"},asFieldSlug:{en:"Slug",tr:"Slug"},asFieldObjective:{en:"Objective",tr:"Hedef"},asFieldTaskDefinition:{en:"Task definition",tr:"Görev tanımı"},asFieldActivePlan:{en:"Active plan",tr:"Aktif plan"},asFieldParticipants:{en:"Participants",tr:"Katılımcılar"},asFieldLastTurn:{en:"Last turn",tr:"Son tur"},asFieldLastSeq:{en:"Last seq",tr:"Son sıra"},asFieldRules:{en:"Rules",tr:"Kurallar"},asFieldBlockedOn:{en:"Blocked on",tr:"Bloklayan"},asAttentionBlocked:{en:"Attention",tr:"Dikkat"},asFieldReplyTo:{en:"Reply to",tr:"Yanıt"},asFieldAddressedTo:{en:"Addressed to",tr:"Adreslenen"},asFieldOutputOwner:{en:"Owner",tr:"Sahip"},asFieldQuestion:{en:"Question",tr:"Soru"},asFieldDescription:{en:"Description",tr:"Açıklama"},asFieldCurrentVersion:{en:"Current version",tr:"Güncel versiyon"},asFieldResourceType:{en:"Resource type",tr:"Kaynak türü"},asFieldRef:{en:"Reference",tr:"Referans"},asFieldUri:{en:"URI",tr:"URI"},asArtifactsGapTitle:{en:"Artifacts unavailable",tr:"Artefaktlar kullanılamıyor"},asArtifactsGapMessage:{en:"The hosted artifacts read failed (backend gap, tracked as a PM issue)",tr:"Barındırılan artefakt okuması başarısız (backend eksiği, PM issue olarak izleniyor)"},asFieldArtifactType:{en:"Artifact type",tr:"Artefakt türü"},asFieldMimeType:{en:"MIME type",tr:"MIME türü"},asFieldSize:{en:"Size",tr:"Boyut"},asFieldStoragePath:{en:"Storage path",tr:"Depolama yolu"},asFieldRole:{en:"Role",tr:"Rol"},asFieldCapabilities:{en:"Capabilities",tr:"Yetkinlikler"},asFieldUpdated:{en:"Updated",tr:"Güncelleme"},asFilterAll:{en:"All",tr:"Tümü"},asMemoryViewLabel:{en:"View",tr:"Görünüm"},asMemoryViewTimeline:{en:"Timeline",tr:"Zaman çizgisi"},asMemoryViewCards:{en:"Cards",tr:"Kartlar"},asMemoryViewRead:{en:"Read",tr:"Oku"},asMemoryViewDigest:{en:"Digest",tr:"Özet"},asMemoryMap:{en:"Memory map",tr:"Hafıza haritası"},asMemoryBlocks:{en:"blocks",tr:"blok"},asMemoryTimeline:{en:"Timeline",tr:"Zaman çizgisi"},asMemoryNewestFirst:{en:"newest first",tr:"en yeni önce"},asMemoryAllKinds:{en:"All kinds",tr:"Tüm türler"},asMemoryDaysShown:{en:"days shown",tr:"gün gösteriliyor"},asMemoryBlock:{en:"block",tr:"blok"},asMemoryNeighbors:{en:"Neighbors",tr:"Komşular"},asMemoryOlder:{en:"older",tr:"eski"},asMemoryNewer:{en:"newer",tr:"yeni"},asMemorySortBy:{en:"Sort by",tr:"Sırala"},asMemorySortUpdated:{en:"Updated ↓",tr:"Güncelleme ↓"},asMemorySortCreated:{en:"Created ↓",tr:"Oluşturma ↓"},asMemorySortKind:{en:"Kind",tr:"Tür"},asMemorySortImportance:{en:"Importance ↓",tr:"Önem ↓"},asMemoryCreated:{en:"Created",tr:"Oluşturma"},asMemoryContent:{en:"Content",tr:"İçerik"},asMemoryTags:{en:"Tags",tr:"Etiketler"},asMemoryScope:{en:"Scope",tr:"Kapsam"},asMemoryByKind:{en:"by kind",tr:"türe göre"},asMemoryLatest:{en:"latest",tr:"son"},asMemoryShowMore:{en:"Show",tr:"Göster"},asOpenDigestPane:{en:"Open",tr:"Aç"},asCloseDigestPane:{en:"Close",tr:"Kapat"},asPageLoadMore:{en:"Load more",tr:"Daha fazla yükle"},asFieldRoles:{en:"Roles",tr:"Roller"},asFieldSuccessCriteria:{en:"Success criteria",tr:"Başarı ölçütleri"},asFieldConstraints:{en:"Constraints",tr:"Kısıtlar"},asOpenPlanInPm:{en:"Open plan in PM ▸ Sprints",tr:"Planı PM ▸ Sprintler'de aç"},asTurns:{en:"Turns",tr:"Turlar"},asNoTurns:{en:"No turns yet",tr:"Henüz tur yok"},asOutputs:{en:"Conclusion outputs",tr:"Sonuç çıktıları"},asOutputKindDecision:{en:"Decision",tr:"Karar"},asOutputKindConsensus:{en:"Consensus",tr:"Uzlaşı"},asOutputKindDisagreement:{en:"Disagreement",tr:"Ayrışma"},asOutputKindOpenQuestions:{en:"Open questions",tr:"Açık sorular"},asOutputKindFinalStance:{en:"Final stance",tr:"Son duruş"},asDiscussionTurnOrder:{en:"Turn order",tr:"Tur sırası"},asDiscussionMinTurns:{en:"Min turns",tr:"En az tur"},asDiscussionRequireQuestionAnswer:{en:"Requires question answer",tr:"Soru yanıtı gerekir"},asVersionBody:{en:"Current version content",tr:"Güncel versiyon içeriği"},navDocs:{en:"Docs",tr:"Dokümanlar"},docsEyebrow:{en:"Docman",tr:"Docman"},docsTitle:{en:"Documents",tr:"Dokümanlar"},docsHeaderNote:{en:"Hosted Docman document graph (read-only)",tr:"Barındırılan Docman doküman grafiği (salt okunur)"},docsLoadingTitle:{en:"Loading documents",tr:"Dokümanlar yükleniyor"},docsErrorTitle:{en:"Docman unavailable",tr:"Docman kullanılamıyor"},docsEmptyTitle:{en:"No documents",tr:"Doküman yok"},docsEmptyMessage:{en:"No Docman documents for the selected project",tr:"Seçili proje için Docman dokümanı yok"},docsNoContent:{en:"This version has no assembled content yet.",tr:"Bu versiyonun henüz birleştirilmiş içeriği yok."},docsNavPanelTitle:{en:"Documents",tr:"Dokümanlar"},docsNavPane:{en:"Documents navigator",tr:"Dokümanlar navigatörü"},docsNavTools:{en:"Document navigator tools",tr:"Doküman navigatör araçları"},docsNavSearch:{en:"Search documents",tr:"Dokümanlarda ara"},docsNavFilter:{en:"Filter documents",tr:"Dokümanları filtrele"},docsNavEmpty:{en:"No documents",tr:"Doküman yok"},docsNavEmptySearch:{en:"No documents match your search",tr:"Aramayla eşleşen doküman yok"},docsNavUntitled:{en:"Untitled document",tr:"Adsız doküman"},docsNavUngrouped:{en:"Ungrouped",tr:"Grupsuz"},docsNavDocK:{en:"Document",tr:"Doküman"},docsNavSelectDoc:{en:"Select document",tr:"Doküman seç"},docsOutline:{en:"Contents",tr:"İçindekiler"},docsVersions:{en:"Versions",tr:"Versiyonlar"},docsSourceFile:{en:"Source file",tr:"Kaynak dosya"},docsFormat:{en:"Format",tr:"Format"},docsExtension:{en:"Extension",tr:"Uzantı"},docsVersion:{en:"Version",tr:"Versiyon"},docsContentHash:{en:"Content hash",tr:"İçerik özeti"},docsWrap:{en:"Wrap lines",tr:"Satırları kaydır"},docsNoWrap:{en:"Keep lines",tr:"Satırları koru"},docsDownload:{en:"Download",tr:"İndir"},docsEmptySource:{en:"This source file is empty.",tr:"Bu kaynak dosya boş."},docsInvalidSourceProfile:{en:"This source version has no valid persisted file extension.",tr:"Bu kaynak versiyonunda geçerli kalıcı dosya uzantısı yok."},pmGroupNone:{en:"None",tr:"Yok"},pmGroupColumn:{en:"Column",tr:"Kolon"},pmGroupSprint:{en:"Sprint",tr:"Sprint"},pmNoSprint:{en:"No sprint",tr:"Sprint yok"},pmPhasesTab:{en:"Phases",tr:"Fazlar"},pmReferencesTab:{en:"References",tr:"Referanslar"},pmTasksTab:{en:"Tasks",tr:"Görevler"},pmPhaseView:{en:"Phase view",tr:"Faz görünümü"},pmPhaseTimeline:{en:"Timeline",tr:"Zaman akışı"},pmPhaseAccordion:{en:"Accordion",tr:"Akordeon"},pmPhaseTable:{en:"Table",tr:"Tablo"},pmTimelineEyebrow:{en:"Execution map",tr:"Yürütme haritası"},pmTimelineTitle:{en:"Plan timeline",tr:"Plan akışı"},pmTimelineSubtitle:{en:"Follow completed work, the active boundary and what comes next.",tr:"Tamamlanan işleri, aktif sınırı ve sırada ne olduğunu tek akışta izle."},pmTimelineProgress:{en:"Plan progress",tr:"Plan ilerlemesi"},pmTimelineCurrent:{en:"Current phase",tr:"Aktif faz"},pmTimelineNext:{en:"Up next",tr:"Sıradaki"},pmTimelineComplete:{en:"Complete",tr:"Tamamlandı"},pmTimelineUpcoming:{en:"Upcoming",tr:"Sırada"},pmTimelineBlocked:{en:"Blocked",tr:"Engelli"},pmTimelineUnplanned:{en:"No checklist",tr:"Checklist yok"},pmTimelineFinished:{en:"All phases complete",tr:"Tüm fazlar tamamlandı"},pmTimelineFinishLine:{en:"Finish line",tr:"Bitiş çizgisi"},pmTimelineCompletedTasks:{en:"tasks complete",tr:"iş tamamlandı"},pmTimelineCompletedPhases:{en:"phases complete",tr:"faz tamamlandı"},pmTimelinePhase:{en:"Phase",tr:"Faz"},pmTimelineTasks:{en:"items",tr:"iş"},pmTimelineNoTasks:{en:"This phase has no checklist items yet.",tr:"Bu faz için henüz checklist maddesi yok."},pmPhaseChecklistItem:{en:"Checklist item",tr:"Kontrol öğesi"},pmPhaseNotes:{en:"Notes",tr:"Notlar"},pmSeverity:{en:"Severity",tr:"Önem"},pmSource:{en:"Source",tr:"Kaynak"},pmType:{en:"Type",tr:"Tür"},pmPriority:{en:"Priority",tr:"Öncelik"},pmScope:{en:"Scope",tr:"Kapsam"},pmDescription:{en:"Description",tr:"Açıklama"},pmInstructions:{en:"Instructions",tr:"Yönergeler"},pmSearchIssues:{en:"Search issues",tr:"Sorunlarda ara"},pmSearchFeedback:{en:"Search feedback",tr:"Geri bildirimde ara"},pmSearchReviews:{en:"Search reviews",tr:"İncelemelerde ara"},pmNoIssues:{en:"No issues",tr:"Sorun yok"},pmNoFeedback:{en:"No feedback",tr:"Geri bildirim yok"},pmNoReviews:{en:"No review requests",tr:"İnceleme isteği yok"},pmOverviewTitle:{en:"PM Overview",tr:"PM Özeti"},pmTasksTitle:{en:"Tasks",tr:"Görevler"},pmBoardsTitle:{en:"Boards",tr:"Panolar"},pmSprintsPlansTitle:{en:"Sprints and Plans",tr:"Sprintler ve Planlar"},pmContextTitle:{en:"PM Context",tr:"PM Bağlamı"},pmBoards:{en:"Boards",tr:"Panolar"},pmTasks:{en:"Tasks",tr:"Görevler"},pmSprints:{en:"Sprints",tr:"Sprintler"},pmPlans:{en:"Plans",tr:"Planlar"},pmIssues:{en:"Issues",tr:"Sorunlar"},pmFeedback:{en:"Feedback",tr:"Geri bildirim"},pmReviews:{en:"Reviews",tr:"İncelemeler"},pmOpenItems:{en:"Open items",tr:"Açık kayıtlar"},pmRequestedReviews:{en:"Requested reviews",tr:"Bekleyen incelemeler"},pmLatestTasks:{en:"Active tasks",tr:"Aktif görevler"},pmReviewQueue:{en:"Review queue",tr:"İnceleme kuyruğu"},pmIssueQueue:{en:"Issue queue",tr:"Sorun kuyruğu"},pmNoRows:{en:"No records",tr:"Kayıt yok"},pmArchiveFilter:{en:"Archive visibility",tr:"Arşiv görünürlüğü"},pmFilterActive:{en:"Active",tr:"Aktif"},pmFilterArchived:{en:"Archived",tr:"Arşiv"},pmBoardSelect:{en:"Board selector",tr:"Pano seçici"},pmBoardViewMode:{en:"Board view mode",tr:"Pano görünüm modu"},pmBoardModeKanban:{en:"Kanban",tr:"Kanban"},pmBoardModeVertical:{en:"Vertical",tr:"Dikey"},pmBoardModeTable:{en:"Table",tr:"Tablo"},pmBoardSummary:{en:"Board summary",tr:"Pano özeti"},pmCompleted:{en:"Completed",tr:"Tamamlanan"},pmNoArchivedBoards:{en:"No archived boards",tr:"Arşivlenmiş pano yok"},pmPlanTypeFilter:{en:"Sprint or plan filter",tr:"Sprint veya plan filtresi"},pmFilterAllPlanTypes:{en:"All types",tr:"Tüm tipler"},pmSprintType:{en:"Sprint",tr:"Sprint"},pmPlanType:{en:"Plan",tr:"Plan"},pmPlanDetailTitle:{en:"Sprint or plan detail",tr:"Sprint veya plan detayı"},pmLoadingDetail:{en:"Loading detail",tr:"Detay yükleniyor"},pmPlanNoGoal:{en:"No goal",tr:"Hedef yok"},pmFieldLinkedTask:{en:"Linked task",tr:"Bağlı görev"},pmScopeTitle:{en:"Scope",tr:"Kapsam"},pmValidationTitle:{en:"Validation",tr:"Doğrulama"},pmNoArchivedPlans:{en:"No archived sprints or plans",tr:"Arşivlenmiş sprint veya plan yok"},pmPhasesEmpty:{en:"No phases",tr:"Faz yok"},pmTaskBoardFilter:{en:"Board filter",tr:"Pano filtresi"},pmTaskSprintFilter:{en:"Sprint filter",tr:"Sprint filtresi"},pmFilterAllBoards:{en:"All boards",tr:"Tüm panolar"},pmFilterAllSprints:{en:"All sprints",tr:"Tüm sprintler"},pmCountVisible:{en:"Visible",tr:"Görünen"},pmTaskDetailTitle:{en:"Task detail",tr:"Görev detayı"},pmTaskDrilldownBack:{en:"Back to board",tr:"Panoya dön"},pmTaskNoDescription:{en:"No description",tr:"Açıklama yok"},pmFieldId:{en:"ID",tr:"ID"},pmFieldBoard:{en:"Board",tr:"Pano"},pmFieldColumn:{en:"Column",tr:"Kolon"},pmFieldSprint:{en:"Sprint",tr:"Sprint"},pmFieldProgress:{en:"Progress",tr:"İlerleme"},pmFieldStatus:{en:"Status",tr:"Durum"},pmUnassigned:{en:"Unassigned",tr:"Atanmamış"},pmUnknownStatus:{en:"Unknown",tr:"Bilinmiyor"},pmLaneCollapse:{en:"Collapse column",tr:"Kolonu daralt"},pmLaneExpand:{en:"Expand column",tr:"Kolonu genişlet"},pmWipOver:{en:"Over WIP limit",tr:"WIP limiti aşıldı"},contentCopy:{en:"Copy content",tr:"İçeriği kopyala"},contentCopied:{en:"Content copied",tr:"İçerik kopyalandı"},contentCopyFailed:{en:"Content could not be copied",tr:"İçerik kopyalanamadı"},themeLight:{en:"Light",tr:"Açık"},themeDark:{en:"Dark",tr:"Koyu"},a11ySectionSwitch:{en:"Section switch",tr:"Bölüm değiştirici"},a11yLocaleSwitch:{en:"Language switch",tr:"Dil değiştirici"},a11yNavToggle:{en:"Toggle navigation",tr:"Navigasyonu aç/kapat"},navCollapse:{en:"Collapse to icon rail",tr:"Simge rayına daralt"},navExpand:{en:"Expand sidebar",tr:"Kenar çubuğunu genişlet"},navHide:{en:"Hide sidebar",tr:"Kenar çubuğunu gizle"},navHideHint:{en:"Reopen from the menu button in the top bar",tr:"Üst çubuktaki menü düğmesinden yeniden aç"},navHeaderControls:{en:"Sidebar size controls",tr:"Kenar çubuğu boyut denetimleri"},navReopen:{en:"Open navigation menu",tr:"Navigasyon menüsünü aç"},navPin:{en:"Pin sidebar",tr:"Menüyü sabitle"},navUnpin:{en:"Unpin sidebar (reveal on hover)",tr:"Sabitlemeyi kaldır (üzerine gelince aç)"},statusReady:{en:"READY",tr:"HAZIR"},brandTitle:{en:"aopslab",tr:"aopslab"},brandSubtitle:{en:"OPERATOR COCKPIT",tr:"OPERATÖR KOKPİT"},authChecking:{en:"Checking",tr:"Kontrol ediliyor"},authStatusActive:{en:"Signed in",tr:"Oturum açık"},statusApi:{en:"API",tr:"API"},statusProject:{en:"Project",tr:"Proje"},statusNoProject:{en:"No project",tr:"Proje yok"},themeStudioTitle:{en:"Theme Studio",tr:"Tema Stüdyosu"},themeStudioSubtitle:{en:"Pick or craft a theme",tr:"Tema seç veya oluştur"},themeStudioClose:{en:"Close",tr:"Kapat"},themeStudioBuiltin:{en:"Built-in",tr:"Yerleşik"},themeStudioCustom:{en:"Custom",tr:"Özel"},themeStudioUse:{en:"Use",tr:"Kullan"},themeStudioActive:{en:"Active",tr:"Aktif"},themeStudioNew:{en:"New theme",tr:"Yeni tema"},themeStudioCopy:{en:"Copy",tr:"Kopyala"},themeStudioEdit:{en:"Edit",tr:"Düzenle"},themeStudioDelete:{en:"Delete",tr:"Sil"},themeStudioMode:{en:"Mode",tr:"Mod"},themeStudioAccent:{en:"Accent",tr:"Vurgu"},themeStudioName:{en:"Theme name",tr:"Tema adı"},themeStudioLightColors:{en:"Light colors",tr:"Açık renkler"},themeStudioDarkColors:{en:"Dark colors",tr:"Koyu renkler"},themeStudioColorCanvas:{en:"Canvas",tr:"Zemin"},themeStudioColorSurface:{en:"Surface",tr:"Yüzey"},themeStudioColorText:{en:"Text",tr:"Metin"},themeStudioVariants:{en:"Accents",tr:"Vurgular"},themeStudioVariantSecondary:{en:"Secondary",tr:"İkincil"},themeStudioVariantTertiary:{en:"Tertiary",tr:"Üçüncül"},themeStudioVariantLabel:{en:"Label",tr:"Etiket"},themeStudioAddVariant:{en:"Add accent",tr:"Vurgu ekle"},themeStudioRemoveVariant:{en:"Remove",tr:"Kaldır"},themeStudioReadonlyNote:{en:"Built-in themes can be copied, not edited",tr:"Yerleşik temalar kopyalanır, düzenlenmez"},themeStudioDone:{en:"Done",tr:"Tamam"},chatEyebrow:{en:"Sessions",tr:"Oturumlar"},chatTitle:{en:"Chat",tr:"Sohbet"},chatHeaderNote:{en:"Hosted ChatV3 rooms",tr:"Hosted ChatV3 odaları"},chatStatusIdle:{en:"Idle",tr:"Boşta"},chatStatusConnecting:{en:"Connecting",tr:"Bağlanıyor"},chatStatusConnected:{en:"Connected",tr:"Bağlı"},chatStatusError:{en:"Error",tr:"Hata"},chatErrorServerKeyTitle:{en:"Server-encrypted history could not be opened",tr:"Sunucu şifrelemeli geçmiş açılamadı"},chatErrorServerKeyMessage:{en:"The server could not load this channel's encryption key. Your invite and browser are not the cause.",tr:"Sunucu bu kanalın şifreleme anahtarını yükleyemedi. Sorun davetinizden veya tarayıcınızdan kaynaklanmıyor."},chatErrorServerKeyAction:{en:"Update or restart AOPS Server, then retry. If the database moved, verify the ChatV3 server key store.",tr:"AOPS Server'ı güncelleyip yeniden başlatın ve tekrar deneyin. Veritabanı taşındıysa ChatV3 sunucu anahtar deposunu doğrulayın."},chatErrorServiceTitle:{en:"Chat service could not complete the request",tr:"Sohbet servisi isteği tamamlayamadı"},chatErrorServiceMessage:{en:"Cockpit did not receive a confirmed result from the chat service.",tr:"Cockpit sohbet servisinden doğrulanmış bir sonuç alamadı."},chatErrorServiceAction:{en:"Check AOPS Server status and logs, then retry.",tr:"AOPS Server durumunu ve loglarını kontrol edip tekrar deneyin."},chatErrorNetworkTitle:{en:"Chat server cannot be reached",tr:"Sohbet sunucusuna ulaşılamıyor"},chatErrorNetworkMessage:{en:"Cockpit could not reach AOPS Server or confirm its current state. Local browser keys are unchanged.",tr:"Cockpit, AOPS Server'a ulaşamadı veya güncel durumunu doğrulayamadı. Tarayıcıdaki yerel anahtarlar değişmedi."},chatErrorNetworkAction:{en:"Start AOPS Server or check the configured server address, then retry.",tr:"AOPS Server'ı başlatın veya tanımlı sunucu adresini kontrol edip tekrar deneyin."},chatErrorRateLimitTitle:{en:"Chat is receiving too many requests",tr:"Sohbet servisi çok fazla istek alıyor"},chatErrorRateLimitMessage:{en:"The server limited the request before Cockpit received a successful result.",tr:"Cockpit başarılı sonuç almadan önce sunucu isteği sınırlandırdı."},chatErrorRateLimitAction:{en:"Wait a moment, then retry.",tr:"Kısa bir süre bekleyip tekrar deneyin."},chatErrorBusyTitle:{en:"Another chat operation is still running",tr:"Başka bir sohbet işlemi hâlâ çalışıyor"},chatErrorBusyMessage:{en:"The server protected the channel from overlapping changes.",tr:"Sunucu kanalı çakışan değişikliklerden korudu."},chatErrorBusyAction:{en:"Wait for the current operation to finish, then retry.",tr:"Mevcut işlemin bitmesini bekleyip tekrar deneyin."},chatErrorMembershipTitle:{en:"Channel access needs to be renewed",tr:"Kanal erişiminin yenilenmesi gerekiyor"},chatErrorMembershipMessage:{en:"The server rejected this browser's current membership. Encrypted history was not deleted.",tr:"Sunucu bu tarayıcının mevcut üyeliğini reddetti. Şifreli geçmiş silinmedi."},chatErrorMembershipAction:{en:"Sign in again or paste a current channel invite.",tr:"Yeniden giriş yapın veya güncel bir kanal daveti yapıştırın."},chatErrorAccessTitle:{en:"This chat action is not allowed",tr:"Bu sohbet işlemine izin verilmiyor"},chatErrorAccessMessage:{en:"The server refused the current account or channel role. This does not indicate that encrypted history was deleted.",tr:"Sunucu mevcut hesabı veya kanal rolünü bu işlem için kabul etmedi. Bu durum şifreli geçmişin silindiği anlamına gelmez."},chatErrorAccessAction:{en:"Sign in again and check your channel role. If access should exist, ask the channel owner.",tr:"Yeniden giriş yapıp kanal rolünüzü kontrol edin. Erişiminiz olması gerekiyorsa kanal sahibine başvurun."},chatErrorClientKeyTitle:{en:"This browser does not have the E2E key",tr:"Bu tarayıcıda E2E anahtarı yok"},chatErrorClientKeyMessage:{en:"The server has the encrypted history, but it cannot recover the content for this browser.",tr:"Şifreli geçmiş sunucuda duruyor, ancak sunucu içeriği bu tarayıcı için kurtaramaz."},chatErrorClientKeyAction:{en:"Use an unlocked existing device, a recovery package, or the original invite.",tr:"Kilidi açık mevcut bir cihazı, kurtarma paketini veya orijinal daveti kullanın."},chatErrorUnknownTitle:{en:"Chat operation failed",tr:"Sohbet işlemi tamamlanamadı"},chatErrorUnknownMessage:{en:"Cockpit could not complete or confirm this chat operation.",tr:"Cockpit bu sohbet işlemini tamamlayamadı veya doğrulayamadı."},chatErrorUnknownAction:{en:"Retry once. If it fails again, open technical details and check server logs.",tr:"Bir kez daha deneyin. Tekrar başarısız olursa teknik ayrıntıyı açıp sunucu loglarını kontrol edin."},chatErrorNextStepLabel:{en:"Next:",tr:"Sonraki adım:"},chatErrorTechnicalDetails:{en:"Technical details",tr:"Teknik ayrıntı"},chatErrorRetry:{en:"Reload channel",tr:"Kanalı yeniden yükle"},chatConnectTitle:{en:"No channel joined",tr:"Katılınan kanal yok"},chatConnectMessage:{en:"Pick a channel and room from the navigator to start chatting.",tr:"Sohbete başlamak için navigatörden bir kanal ve oda seçin."},chatChannelLockedTitle:{en:"Channel locked on this browser",tr:"Kanal bu tarayıcıda kilitli"},chatChannelLockedMessage:{en:"Your account can see this channel, but no recovery package is available for this browser yet. Paste an invite once to unlock it.",tr:"Hesabınız bu kanalı görüyor, ancak bu tarayıcı için henüz kurtarma paketi yok. Kilidi açmak için daveti bir kez yapıştırın."},chatChannelPinLockedTitle:{en:"Chat PIN required",tr:"Sohbet PIN'i gerekli"},chatChannelPinLockedMessage:{en:"This channel is recoverable, but the local account key is locked. Enter the Chat PIN or paste an invite from a current device.",tr:"Bu kanal kurtarılabilir, ancak yerel hesap anahtarı kilitli. Sohbet PIN'ini girin veya güncel bir cihazdan davet yapıştırın."},chatChannelStaleTitle:{en:"Current device required",tr:"Güncel cihaz gerekli"},chatChannelStaleMessage:{en:"The recovery package is stale after a key rotation. Open the channel on a current unlocked device so it can publish a fresh package.",tr:"Anahtar rotasyonundan sonra kurtarma paketi bayatlamış. Taze paket yayınlamak için kanalı güncel ve açık bir cihazda açın."},chatChannelRecoverableTitle:{en:"Recovering channel",tr:"Kanal kurtarılıyor"},chatChannelRecoverableMessage:{en:"This browser is using your account-bound key package to restore the channel. If it stays locked, refresh or paste an invite.",tr:"Bu tarayıcı kanalı geri yüklemek için hesaba bağlı anahtar paketini kullanıyor. Kilitli kalırsa yenileyin veya davet yapıştırın."},chatRecoveryPinLabel:{en:"Chat PIN",tr:"Sohbet PIN'i"},chatRecoveryPinRequired:{en:"PIN is required",tr:"PIN gerekli"},chatUnlockWithPin:{en:"Unlock with PIN",tr:"PIN ile aç"},chatPasteInvite:{en:"Paste invite",tr:"Davet yapıştır"},chatNoRoomTitle:{en:"No room selected",tr:"Oda seçili değil"},chatNoRoomMessage:{en:"Select a room to load its messages.",tr:"Mesajları yüklemek için bir oda seçin."},chatSpacesTitle:{en:"Spaces",tr:"Alanlar"},chatSpacesBandLabel:{en:"Space",tr:"Alan"},chatSpacesBandScope:{en:"Chat spaces",tr:"Sohbet alanları"},chatSpacesLoading:{en:"Loading spaces",tr:"Alanlar yükleniyor"},chatSpacesEmpty:{en:"No spaces",tr:"Alan yok"},chatSpacesUnavailable:{en:"Space directory unavailable",tr:"Alan dizini kullanılamıyor"},chatSpacesManage:{en:"Manage spaces...",tr:"Alan yönet..."},chatSpacesManageTitle:{en:"Manage spaces",tr:"Alan yönetimi"},chatSpacesManageIntro:{en:"Create spaces and archive unused active spaces from this channel scope.",tr:"Bu kanal kapsamında alan oluşturun ve kullanılmayan aktif alanları arşivleyin."},chatSpacesReadOnlyNote:{en:"You do not have ChatV3 space admin permission, so this modal is read-only.",tr:"ChatV3 alan yönetimi yetkiniz yok; bu modal salt okunur."},chatSpacesRenameUnsupported:{en:"Rename is not supported.",tr:"Yeniden adlandırma desteklenmiyor."},chatSpaceCreateTitle:{en:"New space",tr:"Yeni alan"},chatSpaceTitleLabel:{en:"Space title",tr:"Alan adı"},chatSpaceTitlePlaceholder:{en:"Field Operations",tr:"Saha Operasyonları"},chatSpaceSlugPreview:{en:"Slug",tr:"Slug"},chatSpaceCreate:{en:"Create space",tr:"Alan oluştur"},chatSpaceCreating:{en:"Creating",tr:"Oluşturuluyor"},chatSpaceArchive:{en:"Archive",tr:"Arşivle"},chatSpaceArchiving:{en:"Archiving",tr:"Arşivleniyor"},chatSpaceDefaultArchiveDisabled:{en:"Default space cannot be archived.",tr:"Varsayılan alan arşivlenemez."},chatSpaceArchiveMissingId:{en:"Refresh the admin space list before archiving this space.",tr:"Bu alanı arşivlemeden önce admin alan listesini yenileyin."},chatSpaceListEmpty:{en:"No spaces yet.",tr:"Henüz alan yok."},chatChannelsLabel:{en:"Channels",tr:"Kanallar"},chatRoomsLabel:{en:"Rooms",tr:"Odalar"},chatActiveRoom:{en:"Active room",tr:"Aktif oda"},chatMessageCount:{en:"Messages",tr:"Mesajlar"},chatRefresh:{en:"Refresh",tr:"Yenile"},chatSearchPlaceholder:{en:"Search channels and rooms",tr:"Kanal ve oda ara"},chatNoChannelsNav:{en:"No channels",tr:"Kanal yok"},chatNoChannelsSearch:{en:"No channels or rooms match",tr:"Eşleşen kanal veya oda yok"},chatNewChannel:{en:"New channel",tr:"Yeni kanal"},chatJoinChannel:{en:"Join channel",tr:"Kanala katıl"},chatSelectChats:{en:"Select chats",tr:"Sohbetleri seç"},chatSelectionDone:{en:"Done",tr:"Bitti"},chatSelectChannel:{en:"Select channel",tr:"Kanalı seç"},chatSelectAll:{en:"Select all",tr:"Tümünü seç"},chatSelected:{en:"selected",tr:"seçili"},chatArchiveSelected:{en:"Archive selected",tr:"Seçilenleri arşivle"},chatDeleteSelected:{en:"Delete selected",tr:"Seçilenleri sil"},chatBulkDeleteBlocked:{en:"One or more selected channels cannot be deleted.",tr:"Seçilen kanallardan biri veya birkaçı silinemez."},chatBulkArchiveTitle:{en:"Archive selected chats",tr:"Seçili sohbetleri arşivle"},chatBulkArchiveMessage:{en:"Selected chats will be hidden from active lists. You can restore archived chats later.",tr:"Seçili sohbetler aktif listelerden gizlenir. Arşivlenen sohbetleri daha sonra geri alabilirsiniz."},chatBulkDeleteTitle:{en:"Delete selected chats",tr:"Seçili sohbetleri sil"},chatBulkDeleteMessage:{en:"This permanently deletes the selected chats and their rooms. This cannot be undone.",tr:"Bu işlem seçili sohbetleri ve odalarını kalıcı olarak siler. İşlem geri alınamaz."},chatBulkDeleteConfirmLabel:{en:"Type to confirm",tr:"Onaylamak için yazın"},chatBulkWorking:{en:"Working…",tr:"İşleniyor…"},chatCreateTab:{en:"Create",tr:"Oluştur"},chatJoinTab:{en:"Join",tr:"Katıl"},chatHandle:{en:"Handle",tr:"Takma ad"},chatChannelName:{en:"Channel name",tr:"Kanal adı"},chatChannelNamePh:{en:"sprint-coordination",tr:"sprint-koordinasyon"},chatEncryptionMode:{en:"Encryption mode",tr:"Şifreleme modu"},chatEncryptionServer:{en:"Server-encrypted (default)",tr:"Sunucu şifrelemeli (varsayılan)"},chatEncryptionServerHint:{en:"Easier cross-device access. Data is encrypted at rest, but the server can access message content while serving the room.",tr:"Cihazlar arası erişim daha kolaydır. Veri saklanırken şifrelidir, ancak oda sunulurken sunucu mesaj içeriğine erişebilir."},chatEncryptionE2e:{en:"End-to-end",tr:"Uçtan uca"},chatEncryptionE2eShort:{en:"E2E",tr:"E2E"},chatEncryptionE2eHint:{en:"The server cannot recover content. Each browser needs an invite or recovery package before it can open the channel.",tr:"Sunucu içeriği kurtaramaz. Her tarayıcı kanalı açmadan önce davet veya kurtarma paketine ihtiyaç duyar."},chatChannelRules:{en:"Channel rules (optional)",tr:"Kanal kuralları (isteğe bağlı)"},chatChannelRulesPh:{en:"Markdown guidance for this channel",tr:"Bu kanal için markdown rehber"},chatInvite:{en:"Invite",tr:"Davet"},chatInvitePh:{en:"chv3://join/...",tr:"chv3://join/..."},chatCreate:{en:"Create channel",tr:"Kanal oluştur"},chatJoin:{en:"Join channel",tr:"Kanala katıl"},chatCancel:{en:"Cancel",tr:"Vazgeç"},chatConnectPanelTitle:{en:"Add a channel",tr:"Kanal ekle"},chatEmpty:{en:"No messages yet",tr:"Henüz mesaj yok"},chatDayToday:{en:"Today",tr:"Bugün"},chatDayYesterday:{en:"Yesterday",tr:"Dün"},chatUnreadDivider:{en:"New",tr:"Yeni"},chatRead:{en:"Read",tr:"Okundu"},chatDelivered:{en:"Delivered",tr:"İletildi"},chatCopied:{en:"Copied",tr:"Kopyalandı"},chatCopyRef:{en:"Copy message ref",tr:"Mesaj referansını kopyala"},chatAckShort:{en:"ACK",tr:"ACK"},chatAcknowledge:{en:"Acknowledge",tr:"Onayla"},chatAcknowledged:{en:"Acknowledged",tr:"Onaylandı"},chatYou:{en:"you",tr:"sen"},chatLockedHint:{en:"locked (no key)",tr:"kilitli (anahtar yok)"},chatLockedNeedsPinHint:{en:"PIN required",tr:"PIN gerekli"},chatLockedRecoverableHint:{en:"recoverable",tr:"kurtarılabilir"},chatLockedStaleHint:{en:"stale package",tr:"bayat paket"},chatComposerPlaceholder:{en:"type a message - / to set kind",tr:"mesaj yaz - / ile tür seç"},chatComposerSend:{en:"Send",tr:"Gönder"},chatComposerKindLabel:{en:"Message kind",tr:"Mesaj türü"},chatKindMessage:{en:"Message",tr:"Mesaj"},chatKindDirective:{en:"Directive",tr:"Direktif"},chatKindQuestion:{en:"Question",tr:"Soru"},chatKindDecision:{en:"Decision",tr:"Karar"},chatKindStatus:{en:"Status",tr:"Durum"},chatRulesOpen:{en:"Rules",tr:"Kurallar"},chatRulesTitle:{en:"Channel & room rules",tr:"Kanal ve oda kuralları"},chatRulesChannel:{en:"Channel rules",tr:"Kanal kuralları"},chatRulesRoom:{en:"Room rules",tr:"Oda kuralları"},chatRulesEmpty:{en:"No rules set",tr:"Kural tanımlı değil"},chatClose:{en:"Close",tr:"Kapat"},chatRefsTitle:{en:"References",tr:"Referanslar"},chatRefsEmpty:{en:"No references",tr:"Referans yok"},chatRefsCopy:{en:"Copy reference",tr:"Referansı kopyala"},chatRefsToggle:{en:"References",tr:"Referanslar"},chatNewRoom:{en:"New room",tr:"Yeni oda"},chatRoomName:{en:"Room name",tr:"Oda adı"},chatRoomNamePh:{en:"design-review",tr:"tasarım-inceleme"},chatRoomRules:{en:"Room rules (optional)",tr:"Oda kuralları (isteğe bağlı)"},chatCreateRoom:{en:"Create room",tr:"Oda oluştur"},chatActions:{en:"Actions",tr:"İşlemler"},chatArchiveRoom:{en:"Archive room",tr:"Odayı arşivle"},chatDeleteRoom:{en:"Delete room…",tr:"Odayı sil…"},chatArchiveChannel:{en:"Archive channel",tr:"Kanalı arşivle"},chatUnarchiveChannel:{en:"Unarchive channel",tr:"Kanalı geri al"},chatDeleteChannel:{en:"Delete channel…",tr:"Kanalı sil…"},chatLeaveChannel:{en:"Leave channel",tr:"Kanaldan ayrıl"},chatDeleteConfirmTitle:{en:"Confirm delete",tr:"Silmeyi onayla"},chatDeleteConfirmMessage:{en:"This permanently deletes it. Type the slug to confirm:",tr:"Bu kalıcı olarak siler. Onaylamak için slug yazın:"},chatDeleteConfirmSlugLabel:{en:"Slug",tr:"Slug"},chatDelete:{en:"Delete",tr:"Sil"},chatArchivedBadge:{en:"Archived",tr:"Arşivli"},chatRenameUnsupported:{en:"Rename is not supported by hosted ChatV3 (titles are immutable; use archive or delete).",tr:"Yeniden adlandırma hosted ChatV3'te desteklenmez (başlıklar değiştirilemez; arşivle veya sil)."},chatChannelSection:{en:"Channel",tr:"Kanal"},chatRoomSection:{en:"Room",tr:"Oda"},chatNavSettings:{en:"View settings",tr:"Görünüm ayarları"},chatNavMode:{en:"Mode",tr:"Mod"},chatNavModeNavigator:{en:"Navigator",tr:"Navigatör"},chatNavModeLeftMenu:{en:"Left menu",tr:"Sol menü"},chatNavReopen:{en:"Show navigator",tr:"Navigatörü göster"},chatBackToChannels:{en:"Back to channels",tr:"Kanallara dön"},chatNavPanelTitle:{en:"Channels",tr:"Kanallar"},chatRecordEyebrow:{en:"Chat room",tr:"Sohbet odası"},chatEpochShort:{en:"Epoch",tr:"Epoch"},chatTabMessages:{en:"Messages",tr:"Mesajlar"},chatTabMembers:{en:"Members",tr:"Üyeler"},chatTabReferences:{en:"References",tr:"Referanslar"},chatTabRules:{en:"Rules",tr:"Kurallar"},chatTabActivity:{en:"Activity",tr:"Aktivite"},chatPresenceOnline:{en:"online",tr:"çevrimiçi"},chatMembersOnline:{en:"members online",tr:"üye çevrimiçi"},chatMemberRailExpand:{en:"Expand members",tr:"Üyeleri genişlet"},chatMemberRailCollapse:{en:"Collapse members",tr:"Üyeleri daralt"},chatMembersEmpty:{en:"No members",tr:"Üye yok"},chatMemberRemove:{en:"Remove",tr:"Çıkar"},chatMemberRemoveConfirm:{en:"Remove this member from the channel?",tr:"Bu üye kanaldan çıkarılsın mı?"},chatMemberYou:{en:"you",tr:"sen"},chatMemberRemoved:{en:"removed",tr:"çıkarıldı"},chatMemberRemovedSection:{en:"Removed",tr:"Çıkarılanlar"},chatMemberRoomRemovedHint:{en:"(room)",tr:"(oda)"},chatMemberRemoveFromRoom:{en:"Remove from room",tr:"Odadan çıkar"},chatMemberReadd:{en:"Re-add",tr:"Geri ekle"},chatLeaveRoom:{en:"Leave room",tr:"Odadan ayrıl"},chatMemberReadUpTo:{en:"read up to",tr:"okudu"},chatMemberDeliveredUpTo:{en:"delivered up to",tr:"iletildi"},chatMemberActions:{en:"Member actions",tr:"Üye işlemleri"},chatWakeUp:{en:"Wake up",tr:"Uyandır"},chatWakeTitle:{en:"Wake local agent",tr:"Yerel agentı uyandır"},chatWakePromptLabel:{en:"Prompt sent to the local task",tr:"Yerel göreve gönderilecek prompt"},chatWakeDefaultPrompt:{en:"Read the active AOPS ChatV3 room with your saved session. If there is a direct question or instruction, acknowledge it briefly and handle it.",tr:"Kayıtlı session'ınla etkin AOPS ChatV3 odasını oku. Doğrudan bir soru veya talimat varsa kısa ACK ver ve ele al."},chatWakeExperimentalHint:{en:"Experimental trusted-local action. Your active channel member credential authorizes the request; the host verifies the same-channel target and registered task before sending. This does not isolate processes running as the same OS user.",tr:"Deneysel trusted-local işlem. İsteği etkin kanal üye kimliğin yetkilendirir; host göndermeden önce aynı kanaldaki hedefi ve kayıtlı görevi doğrular. Bu, aynı OS kullanıcısıyla çalışan süreçleri birbirinden izole etmez."},chatWakeChecking:{en:"Checking local task…",tr:"Yerel görev denetleniyor…"},chatWakeReady:{en:"Local task is ready",tr:"Yerel görev hazır"},chatWakeUnavailable:{en:"Unavailable",tr:"Kullanılamıyor"},chatWakeCredentialMissing:{en:"Reconnect this channel to restore your member credential",tr:"Üye kimliğini geri yüklemek için bu kanala yeniden bağlan"},chatWakeSending:{en:"Waking…",tr:"Uyandırılıyor…"},chatWakeSent:{en:"Wake turn sent.",tr:"Uyandırma turn'ü gönderildi."},chatWakeFailed:{en:"Wake failed",tr:"Uyandırma başarısız"},chatPresenceActive:{en:"active",tr:"aktif"},chatPresenceIdle:{en:"idle",tr:"boşta"},chatPresenceOffline:{en:"offline",tr:"çevrimdışı"},chatInviteHint:{en:"Share this invite with another browser, user, or agent to join the same encrypted channel.",tr:"Aynı şifreli kanala katılması için bu daveti başka bir tarayıcı, kullanıcı veya agent ile paylaş."},chatInviteAction:{en:"Invite",tr:"Davet et"},chatInviteUnavailable:{en:"No stored invite for this channel",tr:"Bu kanal için kayıtlı davet yok"},chatCopyInvite:{en:"Copy invite",tr:"Daveti kopyala"},chatCreateAndCopyInvite:{en:"Create and copy invite",tr:"Davet oluştur ve kopyala"},chatInviteCopied:{en:"Invite copied",tr:"Davet kopyalandı"},chatActivityDirective:{en:"Latest directive",tr:"Son direktif"},chatActivityNoDirective:{en:"No directive yet",tr:"Henüz direktif yok"},chatActivityAcked:{en:"acknowledged",tr:"onaylandı"},chatActivityEpoch:{en:"Encryption epoch",tr:"Şifreleme epoch"},chatActivityPresenceTitle:{en:"Presence",tr:"Durum"},chatActivityRoomMeta:{en:"Room",tr:"Oda"},chatActivityAcknowledged:{en:"You acknowledged",tr:"Onayladın"},chatActivityPending:{en:"Pending your ack",tr:"Onayın bekleniyor"},debugTitle:{en:"Live API Activity",tr:"Canlı API Aktivitesi"},debugEyebrow:{en:"Status + Logs",tr:"Durum + Loglar"},debugClear:{en:"Clear",tr:"Temizle"},debugClose:{en:"Close",tr:"Kapat"},debugLogs:{en:"Logs",tr:"Loglar"},debugIssues:{en:"Issues",tr:"Sorunlar"},debugFilterAll:{en:"All",tr:"Hepsi"},debugFilterIssues:{en:"Issues",tr:"Sorunlar"},debugEmpty:{en:"No live calls yet",tr:"Henüz canlı çağrı yok"}}},$M=new KM({config:{defaultLocale:"en",fallbackLocale:"en",defaultNamespace:"aopsCockpitV2"},inlineResources:zM});function HM(e,n="en"){return $M.tag(e,{locale:n})}function GM(e){return y.useCallback(n=>HM(n,e),[e])}const rl="__all_projects__",Kr="status:",qM={mode:"aops-cockpit-v2.projects.navMode",open:"aops-cockpit-v2.projects.navOpen",pinned:"aops-cockpit-v2.projects.navPinned",navigatorWidth:"aops-cockpit-v2.projects.navWidth",leftMenuWidth:"aops-cockpit-v2.projects.leftMenuWidth"},El="aops-cockpit-v2.projects.favorites",fh="aops-cockpit-v2.projects.recents",vh="xf-project-scope:favorite-projects-change",Sb="xf-project-scope:recent-projects-change",pc=8;function VM(e,n){return e==="unknown"?n("projectsNavUnknownStatus"):e.charAt(0).toUpperCase()+e.slice(1)}function wb(){return dx(El)}function Nb(){return dx(fh,pc)}function dx(e,n=null){if(typeof window>"u")return[];try{const r=window.localStorage.getItem(e),i=r?JSON.parse(r):[],o=Array.isArray(i)?i.filter(d=>typeof d=="string"&&d):[];return n==null?o:o.slice(0,Math.max(1,n))}catch{return[]}}function YM(e){if(!(typeof window>"u")){try{window.localStorage.setItem(El,JSON.stringify(e))}catch{}try{window.dispatchEvent(new CustomEvent(vh,{detail:{storageKey:El,projectIds:e}}))}catch{}}}function JM(e,n,r,i){const o=r.trim().toLowerCase(),d=new Map;for(const h of e){const m=h.status??"unknown",g=d.get(m)??[];g.push(h),d.set(m,g)}const u=[],v={};for(const[h,m]of d){const g=`${Kr}${h}`,b=o?m.filter(C=>`${C.name} ${C.slug}`.toLowerCase().includes(o)):m;if(o&&b.length===0)continue;v[g]={total:m.length};const j=o?!0:!n.has(h);if(u.push({categoryUid:g,depth:0,hasChildren:!0,isExpanded:j,label:VM(h,i),hideDefaultMeta:!0}),!!j)for(const C of b)u.push({categoryUid:C.key,depth:1,hasChildren:!1,label:C.name,hideDefaultMeta:!0,metaLines:C.slug&&C.slug!==C.name?[C.slug]:void 0})}return{rows:u,counts:v}}function XM(e,n){const[r,i]=y.useState(""),[o,d]=y.useState(()=>new Set),[u,v]=y.useState(()=>wb()),[h,m]=y.useState(()=>Nb()),g=Tl({storageKeys:qM,defaultMode:"left-menu",defaultOpen:!0,defaultPinned:!0,defaultNavigatorWidth:360,defaultLeftMenuWidth:350,leftMenuMinWidth:340,leftMenuMaxWidth:520}),{rows:b,counts:j}=y.useMemo(()=>JM(e.projects,o,r,n),[e.projects,o,r,n]),C=e.selectedProjectKey??rl,k=y.useMemo(()=>Array.from(new Set(e.projects.map(Q=>Q.status??"unknown"))),[e.projects]),x=y.useMemo(()=>new Map(e.projects.map(Q=>[Q.key,Q])),[e.projects]);y.useEffect(()=>{if(typeof window>"u")return;const Q=W=>{const pe=W instanceof CustomEvent&&W.detail&&typeof W.detail=="object"?W.detail:{};if(pe.storageKey!==El)return;const ke=Array.isArray(pe.projectIds)?pe.projectIds.filter(O=>typeof O=="string"&&O):wb();v(O=>O.length===ke.length&&O.every((_,K)=>_===ke[K])?O:ke)};return window.addEventListener(vh,Q),()=>window.removeEventListener(vh,Q)},[]),y.useEffect(()=>{if(typeof window>"u")return;const Q=W=>{const pe=W instanceof CustomEvent&&W.detail&&typeof W.detail=="object"?W.detail:{};if(pe.storageKey!==fh)return;const ke=Array.isArray(pe.projectIds)?pe.projectIds.filter(O=>typeof O=="string"&&O).slice(0,pc):Nb();m(O=>O.length===ke.length&&O.every((_,K)=>_===ke[K])?O:ke)};return window.addEventListener(Sb,Q),()=>window.removeEventListener(Sb,Q)},[]),y.useEffect(()=>{const Q=e.selectedProjectKey;Q&&m(W=>W.includes(Q)?W:[...W,Q].slice(-pc))},[e.selectedProjectKey]);const S=y.useMemo(()=>new Set(u),[u]),T=y.useMemo(()=>u.map(Q=>{const W=x.get(Q);return W?{categoryUid:Q,label:W.name,pathText:W.slug??W.name}:null}).filter(Q=>!!Q),[u,x]),I=y.useMemo(()=>{const Q=u.map(ke=>x.get(ke)).filter(ke=>!!ke),W=new Set(Q.map(ke=>ke.key)),pe=h.map(ke=>x.get(ke)).filter(ke=>ke!=null&&!W.has(ke.key));return[...Q,...pe]},[u,x,h]),E=y.useMemo(()=>e.projects.map(Q=>({id:Q.key,name:Q.name,slug:Q.slug??Q.key})),[e.projects]),L=y.useCallback(Q=>d(W=>{const pe=new Set(W);return pe.has(Q)?pe.delete(Q):pe.add(Q),pe}),[]),P=y.useCallback(Q=>{if(Q===rl){e.onSelectProject(null);return}if(Q.startsWith(Kr)){L(Q.slice(Kr.length));return}e.onSelectProject(Q)},[e,L]),N=y.useCallback(Q=>{Q.startsWith(Kr)&&L(Q.slice(Kr.length))},[L]),R=y.useCallback(()=>d(new Set),[]),z=y.useCallback(()=>d(new Set(k)),[k]),ne=y.useCallback(Q=>{!Q||Q===rl||Q.startsWith(Kr)||v(W=>{const pe=W.includes(Q)?W.filter(ke=>ke!==Q):[...W,Q];return YM(pe),pe})},[]),ye=y.useCallback(()=>g.openNavigator(),[g]),J=y.useCallback(Q=>{Q&&Q!==rl&&e.onSelectProject(Q)},[e]),re=a.jsx("div",{className:"aops-v2-tree-wrap",style:{display:"contents"},children:a.jsx(bj,{rows:b,hasCategories:e.projects.length>0,totalItemCount:e.projects.length,allRowKey:rl,selectedCategoryKey:C,countsByCategoryUid:j,searchValue:r,onSearchChange:i,onSelectCategory:P,onToggleBranch:N,onToggleFavorite:ne,favoriteCategoryUids:S,favoriteEntries:T,showRowFavorite:!0,iconBar:a.jsx(Th,{settingsSlot:a.jsx("button",{type:"button",className:"inv-iv3-cattree-tool-btn aops-v2-tree-close","aria-label":n("navSidePanelClose"),title:n("navSidePanelClose"),onClick:()=>g.setOpen(!1),"data-testid":"aops-v2-projects-tree-close",children:a.jsx(Qc,{})}),onExpandAll:R,onCollapseAll:z,expandDisabled:o.size===0,collapseDisabled:k.length===0||o.size>=k.length}),showAllCategoriesRow:!0,unclassifiedLabel:n("projectsNavUntitled"),searchPlaceholder:n("projectsNavSearch"),searchAriaLabel:n("projectsNavFilter"),controlsAriaLabel:n("projectsNavTools"),paneAriaLabel:n("projectsNavPane"),emptyLabel:n("projectsNavEmpty"),emptySearchLabel:n("projectsNavEmptySearch"),tItems:(Q,W="")=>W==="All categories"?n("projectsNavAll"):W})}),oe=a.jsx(_c,{controller:g,label:n("projectsNavPanelTitle"),panelTitle:n("projectsNavPanelTitle"),showHeader:!0,showProjectSelection:!1,dockClassName:"aops-v2-projects-navdock",headerActions:e.allowLeftMenuMode===!1?null:a.jsx(Mh,{active:!1,onClick:()=>g.switchToLeftMenu()}),children:re}),fe=!g.isLeftMenuMode&&!g.pinned?oe:!g.isLeftMenuMode&&!g.open?a.jsx("button",{type:"button",className:"aops-v2-nav-reopen",onClick:ye,"aria-label":n("navPaneReopen"),title:n("navPaneReopen"),"data-testid":"aops-v2-nav-reopen",children:a.jsx(Lc,{label:n("projectsNavPanelTitle")})}):null,de=a.jsx(kj,{className:"aops-v2-projects-toprail inv-iv3-detail-toprail",launcherClassName:"inventory-itemsv2-topbar-launcher",mainClassName:"inventory-itemsv2-topbar-recents",launcher:fe,main:a.jsx(H0,{projectItems:E,activeProjectId:e.selectedProjectKey??"",onSelectProjectId:J,recentProjectStorageKey:fh,favoriteProjectStorageKey:El,maxRecentProjects:pc,visibleCount:4,ariaLabel:n("projectsNavRecents"),emptyLabel:n("projectsNavRecentsEmpty"),removeLabel:n("projectsNavRecentsRemove")})}),G=g.isLeftMenuMode?"hidden":g.pinned?g.open?"pinned":"hidden":"overlay";return{controller:g,treePanel:re,dockNode:oe,recentsBar:de,scopeProjectOptions:I,scopeFavoriteProjectKeys:u,launcherNode:fe,isLeftMenuMode:g.isLeftMenuMode,isNavigatorOpen:g.open,isPinned:g.pinned,openNavigator:ye,leftDockMode:G,leftDockWidth:g.navigatorWidth}}function WM({size:e=15}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",stroke:"currentColor",strokeWidth:"1.6"}),a.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"1.6"})]})}function ZM({mode:e,onModeChange:n,title:r="View settings",modeLabel:i="Mode",navigatorLabel:o="Navigator",showNavigatorOption:d=!0,leftMenuLabel:u="Left menu",showLeftMenuOption:v=!0,dropdownLabel:h,cardsLabel:m,modeOrder:g,testIdPrefix:b="aops-v2"}){const[j,C]=y.useState(!1),[k,x]=y.useState({top:0,left:0}),S=y.useRef(null),T=y.useRef(null),I=()=>{const N=S.current?.getBoundingClientRect();if(N){const z=Math.max(8,Math.min(N.left,window.innerWidth-304-8));x({top:Math.round(N.bottom+6),left:Math.round(z)})}C(!0)};y.useEffect(()=>{if(!j)return;const N=ne=>{const ye=ne.target;S.current?.contains(ye)||T.current?.contains(ye)||C(!1)},R=ne=>{ne.key==="Escape"&&C(!1)},z=()=>C(!1);return document.addEventListener("pointerdown",N),document.addEventListener("keydown",R),window.addEventListener("resize",z),window.addEventListener("scroll",z,!0),()=>{document.removeEventListener("pointerdown",N),document.removeEventListener("keydown",R),window.removeEventListener("resize",z),window.removeEventListener("scroll",z,!0)}},[j]);const E=N=>{C(!1),n(N)},L=[...d?[{value:"navigator",label:o,active:e==="navigator",onSelect:()=>E("navigator"),testId:`${b}-mode-navigator`}]:[],...v?[{value:"left-menu",label:u,active:e==="left-menu",onSelect:()=>E("left-menu"),testId:`${b}-mode-leftmenu`}]:[],...h?[{value:"dropdown",label:h,active:e==="dropdown",onSelect:()=>E("dropdown"),testId:`${b}-mode-dropdown`}]:[],...m?[{value:"cards",label:m,active:e==="cards",onSelect:()=>E("cards"),testId:`${b}-mode-cards`}]:[]],P=g?g.flatMap(N=>L.filter(R=>R.value===N)):L;return a.jsxs("div",{className:"inv-iv3-cattree-settings",children:[a.jsx("button",{ref:S,type:"button",className:`inv-iv3-cattree-tool-btn${j?" is-active":""}`,"aria-haspopup":"menu","aria-expanded":j,"aria-label":r,title:r,onClick:()=>j?C(!1):I(),"data-testid":`${b}-tree-settings`,children:a.jsx(WM,{})}),j?Yr.createPortal(a.jsxs("div",{ref:T,className:"inv-iv3-cattree-settings-menu aops-v2-settings-menu",role:"menu",style:{position:"fixed",top:k.top,left:k.left},"data-testid":`${b}-tree-settings-menu`,children:[a.jsx("p",{className:"inv-iv3-cattree-settings-title",children:r}),a.jsx("div",{className:"inv-iv3-cattree-settings-body",children:a.jsxs("div",{className:"aops-v2-settings-radiogroup",role:"radiogroup","aria-label":i,children:[a.jsx("span",{className:"inv-iv3-cattree-settings-label",children:i}),P.map(N=>a.jsxs("button",{type:"button",role:"radio","aria-checked":N.active,className:`aops-v2-settings-radio${N.active?" is-active":""}`,onClick:N.onSelect,"data-testid":N.testId,children:[a.jsx("span",{className:"aops-v2-settings-radio-dot","aria-hidden":!0}),a.jsx("span",{className:"aops-v2-settings-radio-label",children:N.label})]},N.value))]})})]}),document.body):null]})}function rm({children:e}){return a.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e})}const eT=a.jsxs(rm,{children:[a.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),a.jsx("path",{d:"M8.5 3v18"})]}),tT=a.jsxs(rm,{children:[a.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),a.jsx("path",{d:"M10 5v14"}),a.jsx("path",{d:"M5.4 9h2.4M5.4 12h2.4"})]}),Ib=a.jsxs(rm,{children:[a.jsx("rect",{x:"4",y:"4",width:"16",height:"7",rx:"1.5"}),a.jsx("rect",{x:"4",y:"13",width:"16",height:"7",rx:"1.5"})]}),aT=a.jsx("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),hc="grp:";function nT(e,n,r){const i=r.trim().toLowerCase(),o=[],d={},u=e.groups.filter(m=>m.items.length>0),v=u.map(m=>({...m,matched:i?m.items.filter(g=>e.searchText(g).toLowerCase().includes(i)):m.items})).filter(m=>!i||m.matched.length>0),h=!!e.flattenSingleGroup&&u.length===1;for(const m of v){const g=`${hc}${m.key}`;d[g]={total:m.items.length};const b=i?!0:!n.has(g);if(h||o.push({categoryUid:g,depth:0,hasChildren:!0,isExpanded:b,label:m.label,hideDefaultMeta:!0}),!(!h&&!b))for(const j of m.matched)o.push({categoryUid:e.itemKey(j),depth:h?0:1,hasChildren:!1,label:e.itemLabel(j),hideDefaultMeta:!0,metaLines:e.itemMeta?.(j)})}return{rows:o,counts:d}}function Eb(e){if(typeof window>"u")return!1;try{return window.localStorage.getItem(e)==="1"}catch{return!1}}function Mb(e,n){try{typeof window<"u"&&window.localStorage.setItem(e,n?"1":"0")}catch{}}function sT(e){if(typeof window>"u")return new Set;try{const n=JSON.parse(window.localStorage.getItem(e)??"[]");return new Set(Array.isArray(n)?n.filter(r=>typeof r=="string"):[])}catch{return new Set}}function rT(e,n){try{typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify([...n]))}catch{}}function im(e,n){const r=`${e.storagePrefix}.dropdownMode`,i=`${e.storagePrefix}.cardsMode`,o=`${e.storagePrefix}.favorites.v1`,[d,u]=y.useState(""),[v,h]=y.useState(()=>new Set),[m,g]=y.useState(()=>Eb(r)),[b,j]=y.useState(()=>!!e.enableCardsMode&&Eb(i)),[C,k]=y.useState(()=>e.enableFavorites?sT(o):new Set),x=Tl({storageKeys:{mode:`${e.storagePrefix}.navMode`,open:`${e.storagePrefix}.navOpen`,pinned:`${e.storagePrefix}.navPinned`,navigatorWidth:`${e.storagePrefix}.navWidth`,leftMenuWidth:`${e.storagePrefix}.leftMenuWidth`},defaultMode:"left-menu",defaultOpen:!0,defaultPinned:!0,defaultNavigatorWidth:340,defaultLeftMenuWidth:300,leftMenuMinWidth:240,leftMenuMaxWidth:460}),{rows:S,counts:T}=y.useMemo(()=>nT(e,v,d),[e,v,d]),I=y.useMemo(()=>{const ae=e.groups.filter(ce=>ce.items.length>0);return e.flattenSingleGroup&&ae.length===1?new Set:new Set(ae.map(ce=>`${hc}${ce.key}`))},[e.flattenSingleGroup,e.groups]),E=y.useMemo(()=>e.groups.reduce((ae,ce)=>ae+ce.items.length,0),[e.groups]),L=y.useMemo(()=>{const ae=new Map;for(const ce of e.groups)for(const w of ce.items)ae.set(e.itemKey(w),w);return ae},[e.groups,e.itemKey]),P=y.useMemo(()=>[...C].map(ae=>{const ce=L.get(ae);return ce?{categoryUid:ae,label:e.itemLabel(ce),pathText:e.itemMeta?.(ce)?.join(" · ")||e.itemLabel(ce)}:null}).filter(ae=>ae!==null),[e.itemLabel,e.itemMeta,C,L]),N=y.useCallback(ae=>{g(ae),Mb(r,ae)},[r]),R=e.onCardsModeChange,z=y.useCallback(ae=>{j(ae),Mb(i,ae),R?.(ae)},[i,R]),ne=y.useCallback(ae=>h(ce=>{const w=new Set(ce);return w.has(ae)?w.delete(ae):w.add(ae),w}),[]),ye=y.useCallback(ae=>{if(ae.startsWith(hc)){ne(ae);return}e.onSelect(ae)},[e,ne]),J=y.useCallback(ae=>ae.startsWith(hc)&&ne(ae),[ne]),re=y.useCallback(ae=>{!e.enableFavorites||!L.has(ae)||k(ce=>{const w=new Set(ce);return w.has(ae)?w.delete(ae):w.add(ae),rT(o,w),w})},[e.enableFavorites,o,L]),oe=y.useCallback(ae=>{if(ae==="cards"){N(!1),z(!0);return}if(z(!1),ae==="dropdown"){N(!0);return}N(!1),ae==="left-menu"?x.switchToLeftMenu():x.switchToNavigator()},[x,z,N]),fe=y.useCallback(()=>h(new Set),[]),de=y.useCallback(()=>h(new Set(I)),[I]),G=y.useCallback(()=>x.openNavigator(),[x]),Q=b?"cards":m?"dropdown":x.isLeftMenuMode?"left-menu":"navigator",W=a.jsx(ZM,{mode:Q,onModeChange:oe,title:n("navSettings"),modeLabel:n("navMode"),navigatorLabel:n("navModeNavigator"),showNavigatorOption:e.showNavigatorSetting!==!1,leftMenuLabel:n(e.leftMenuModeLabel??"navModeLeftMenu"),dropdownLabel:n("navModeDropdown"),cardsLabel:e.enableCardsMode?n("navModeCards"):void 0,modeOrder:e.settingsModeOrder,testIdPrefix:e.testIdPrefix}),pe=(ae,ce,w)=>a.jsx("button",{type:"button",className:`inv-iv3-cattree-tool-btn aops-v2-mode-shortcut${Q===ae?" is-active":""}`,"aria-label":w,title:w,"aria-pressed":Q===ae,onClick:()=>oe(ae),"data-testid":`${e.testIdPrefix}-shortcut-${ae}`,children:ce}),ke=e.showModeShortcuts===!1?null:a.jsxs(a.Fragment,{children:[pe("navigator",eT,n("navModeNavigator")),pe("left-menu",tT,n("navModeLeftMenu")),e.enableCardsMode?pe("cards",Ib,n("navModeCards")):null]}),O=e.showTreeClose?a.jsx("button",{type:"button",className:"inv-iv3-cattree-tool-btn aops-v2-tree-close","aria-label":n(e.treeCloseLabel??"navSidePanelClose"),title:n(e.treeCloseLabel??"navSidePanelClose"),onClick:()=>x.setOpen(!1),"data-testid":`${e.testIdPrefix}-tree-close`,children:aT}):null,_=e.showTreeSettings===!1&&!ke&&!O?null:a.jsxs(a.Fragment,{children:[e.showTreeSettings===!1?null:W,ke,O]}),K=a.jsx("div",{className:`aops-v2-tree-wrap${e.treeClassName?` ${e.treeClassName}`:""}`,style:{display:"contents"},children:a.jsx(bj,{rows:S,hasCategories:E>0,totalItemCount:E,selectedCategoryKey:e.selectedKey??"",countsByCategoryUid:T,searchValue:d,onSearchChange:u,searchTrailingSlot:e.searchTrailingSlot,onSelectCategory:ye,onToggleBranch:J,onToggleFavorite:e.enableFavorites?re:void 0,favoriteCategoryUids:e.enableFavorites?C:void 0,favoriteEntries:e.enableFavorites?P:void 0,showRowFavorite:!!e.enableFavorites,showAllCategoriesRow:!1,iconBar:a.jsx(Th,{settingsSlot:_,onExpandAll:fe,onCollapseAll:de,expandDisabled:v.size===0,collapseDisabled:I.size===0||v.size>=I.size}),unclassifiedLabel:n(e.labels.unclassified),searchPlaceholder:n(e.labels.searchPlaceholder),searchAriaLabel:n(e.labels.searchAria),controlsAriaLabel:n(e.labels.toolsAria),paneAriaLabel:n(e.labels.paneAria),emptyLabel:n(e.labels.empty),emptySearchLabel:n(e.labels.emptySearch),tItems:(ae,ce="")=>ce})}),ee=a.jsx(_c,{controller:x,label:"NAVIGATOR",panelTitle:n(e.labels.panelTitle),showHeader:!0,showProjectSelection:!1,dockClassName:e.dockClassName,headerActions:a.jsxs(a.Fragment,{children:[a.jsx(Mh,{active:!1,onClick:()=>oe("left-menu")}),e.enableCardsMode?a.jsx("button",{type:"button",className:"mini-button ghost icon-only inv-iv3-leftmenu-header-btn","aria-label":n("navModeCards"),title:n("navModeCards"),onClick:()=>oe("cards"),"data-testid":`${e.testIdPrefix}-header-cards`,children:Ib}):null,a.jsx("span",{className:"aops-v2-navhead-sep","aria-hidden":!0})]}),children:K}),ve=!b&&!m&&!x.isLeftMenuMode&&!x.pinned?ee:!b&&!m&&!x.isLeftMenuMode&&!x.open?a.jsx("button",{type:"button",className:"aops-v2-nav-reopen",onClick:G,"aria-label":n("navPaneReopen"),title:n("navPaneReopen"),"data-testid":`${e.testIdPrefix}-nav-reopen`,children:a.jsx(Lc,{label:n("navModeNavigator")})}):null,se=a.jsx(iT,{config:e,gear:e.showDropdownSettings===!1?null:W,t:n}),Z=b||m||x.isLeftMenuMode?"hidden":x.pinned?x.open?"pinned":"hidden":"overlay";return{viewMode:Q,controller:x,treePanel:K,dockNode:ee,dropdownNode:se,launcherNode:ve,gearNode:W,isLeftMenuMode:x.isLeftMenuMode,isDropdownMode:m,isCardsMode:b,selectRecord:e.onSelect,switchMode:oe,openNavigator:G,leftDockMode:Z,leftDockWidth:x.navigatorWidth}}function iT({config:e,gear:n,t:r}){const[i,o]=y.useState(!1),[d,u]=y.useState(""),v=y.useRef(null),h=y.useRef(null);y.useEffect(()=>{if(!i)return;const C=S=>{v.current&&!v.current.contains(S.target)&&o(!1)},k=S=>S.key==="Escape"&&o(!1);document.addEventListener("mousedown",C),document.addEventListener("keydown",k);const x=window.requestAnimationFrame(()=>h.current?.focus());return()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",k),window.cancelAnimationFrame(x)}},[i]);const m=y.useMemo(()=>e.groups.flatMap(C=>C.items),[e.groups]),g=m.find(C=>e.itemKey(C)===e.selectedKey)??null,b=d.trim().toLowerCase(),j=b?m.filter(C=>e.searchText(C).toLowerCase().includes(b)):m;return a.jsxs("div",{className:"aops-pm-boardnav-dropdown",ref:v,children:[a.jsxs("button",{type:"button",className:"aops-pm-boardnav-trigger","aria-haspopup":"listbox","aria-expanded":i,onClick:()=>o(C=>!C),"data-testid":`${e.testIdPrefix}-dropdown-trigger`,children:[a.jsx("span",{className:"aops-pm-boardnav-trigger-icon",children:e.dropdownIcon}),a.jsx("span",{className:"aops-pm-boardnav-trigger-k",children:r(e.labels.dropdownKicker)}),a.jsx("b",{className:"aops-pm-boardnav-trigger-name",children:g?e.itemLabel(g):r(e.labels.dropdownSelect)}),a.jsx("span",{className:"aops-pm-boardnav-caret","aria-hidden":"true",children:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),i?a.jsxs("div",{className:"aops-pm-boardnav-menu",role:"listbox",children:[a.jsx("input",{ref:h,className:"aops-pm-boardnav-search",type:"text",value:d,placeholder:r(e.labels.searchPlaceholder),"aria-label":r(e.labels.searchAria),onChange:C=>u(C.target.value)}),a.jsx("div",{className:"aops-pm-boardnav-list",children:j.length===0?a.jsx("div",{className:"aops-pm-boardnav-empty",children:r(e.labels.emptySearch)}):j.map(C=>{const k=e.itemKey(C),x=k===e.selectedKey,S=e.itemMeta?.(C);return a.jsxs("button",{type:"button",role:"option","aria-selected":x,className:`aops-pm-boardnav-item${x?" is-active":""}`,onClick:()=>{e.onSelect(k),o(!1),u("")},children:[a.jsx("span",{className:"aops-pm-boardnav-item-name",children:e.itemLabel(C)}),e.showDropdownMeta!==!1&&S&&S.length?a.jsx("span",{className:"aops-pm-boardnav-item-slug",children:S[0]}):null,x?a.jsx("span",{className:"aops-pm-boardnav-item-check",children:"✓"}):null]},k)})})]}):null,n?a.jsx("div",{className:"aops-pm-boardnav-gear",children:n}):null]})}const lT=a.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M7 3h7l4 4v14H7zM14 3v4h4M9.5 12h5M9.5 15.5h5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function oT(e,n){const r=y.useMemo(()=>{const i=new Map(e.docman.groups.map(u=>[u.groupUid??u.id,u.title??u.groupUid??u.id])),o=new Map;for(const u of e.docman.documents){const v=u.groupUid??"__ungrouped";o.set(v,[...o.get(v)??[],u])}const d=[...o.entries()].sort(([u],[v])=>(i.get(u)??u).localeCompare(i.get(v)??v)).map(([u,v])=>({key:u,label:u==="__ungrouped"?n("docsNavUngrouped"):i.get(u)??u,items:v}));return{storagePrefix:"aops-cockpit-v2.docs",testIdPrefix:"aops-v2-docs",dockClassName:"aops-v2-docs-navdock",enableCardsMode:!0,showDropdownSettings:!1,showModeShortcuts:!1,showTreeSettings:!1,showTreeClose:!0,showNavigatorSetting:!1,leftMenuModeLabel:"pmRecordViewSidePanel",settingsModeOrder:["left-menu","cards","dropdown"],labels:{panelTitle:"docsNavPanelTitle",paneAria:"docsNavPane",toolsAria:"docsNavTools",searchPlaceholder:"docsNavSearch",searchAria:"docsNavFilter",empty:"docsNavEmpty",emptySearch:"docsNavEmptySearch",unclassified:"docsNavUntitled",dropdownKicker:"docsNavDocK",dropdownSelect:"docsNavSelectDoc"},dropdownIcon:lT,groups:d,itemKey:u=>u.id,itemLabel:u=>u.title??u.slug??u.id.slice(0,8),itemMeta:u=>u.slug&&u.slug!==u.title?[u.slug]:void 0,searchText:u=>`${u.title??""} ${u.slug??""} ${(u.tags??[]).join(" ")}`,selectedKey:e.selectedDocumentId,onSelect:e.onSelectDocument}},[e.docman.documents,e.docman.groups,e.onSelectDocument,e.selectedDocumentId,n]);return im(r,n)}const Tb=a.jsx("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3zM12 3v9m0 0l8-4.5M12 12L4 7.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),cT=a.jsx("svg",{viewBox:"0 0 24 24",width:"13",height:"13",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),dT=a.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M8 1.4l1.85 3.75 4.15.6-3 2.92.7 4.13L8 10.86 4.3 12.8l.7-4.13-3-2.92 4.15-.6L8 1.4z",fill:"currentColor"})}),uT=a.jsx("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M10 2.5 4.5 8 10 13.5M4.5 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),pT=a.jsx("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.88M13.5 2.5v3h-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),hT=a.jsxs("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none","aria-hidden":"true",children:[a.jsx("circle",{cx:"8",cy:"3.25",r:"1.4",fill:"currentColor"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),a.jsx("circle",{cx:"8",cy:"12.75",r:"1.4",fill:"currentColor"})]});function mT({onBack:e,onRefresh:n,isFetching:r,disabled:i,t:o}){const[d,u]=y.useState(!1),v=y.useRef(null);return y.useEffect(()=>{if(!d)return;const h=g=>{v.current&&!v.current.contains(g.target)&&u(!1)},m=g=>{g.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",m)}},[d]),a.jsxs("div",{className:"aops-pm-actionbar",children:[a.jsx("button",{type:"button",className:"aops-pm-action-btn",onClick:e,"aria-label":o("pmActionBack"),title:o("pmActionBack"),children:uT}),a.jsx("button",{type:"button",className:`aops-pm-action-btn${r?" is-busy":""}`,onClick:n,disabled:i,"aria-label":o("pmRefresh"),title:o("pmRefresh"),children:pT}),a.jsxs("div",{className:"aops-pm-action-menuwrap",ref:v,children:[a.jsx("button",{type:"button",className:`aops-pm-action-btn${d?" is-active":""}`,onClick:()=>u(h=>!h),"aria-haspopup":"menu","aria-expanded":d,"aria-label":o("pmActionMore"),title:o("pmActionMore"),children:hT}),d?a.jsxs("div",{className:"aops-pm-action-menu",role:"menu",children:[a.jsx("button",{type:"button",role:"menuitem",className:"aops-pm-action-menu-item",disabled:i,onClick:()=>{u(!1),n()},children:o("pmActionRefreshData")}),a.jsx("button",{type:"button",role:"menuitem",className:"aops-pm-action-menu-item",onClick:()=>{u(!1),e()},children:o("pmActionGoProjects")})]}):null]})]})}function Bb(e){return e.slug||e.name||e.key}function _p({projects:e,projectOptions:n,favoriteProjectKeys:r=[],projectMenuTitle:i,crumb:o,isFetching:d,onRefresh:u,onBack:v,showProjectSelector:h=!0,t:m}){const[g,b]=y.useState(!1),j=y.useRef(null);y.useEffect(()=>{if(!g)return;const I=L=>{j.current&&!j.current.contains(L.target)&&b(!1)},E=L=>{L.key==="Escape"&&b(!1)};return document.addEventListener("mousedown",I),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",E)}},[g]);const C=e.selectedProject,k=C?Bb(C):m("unknownValue"),x=n??e.projects,S=i??m("pmBandProjectScope"),T=new Set(r);return a.jsxs("div",{className:`aops-pm-band${h?"":" is-projectless"}`,children:[h?a.jsxs("div",{className:"aops-pm-selector-wrap",ref:j,children:[a.jsxs("button",{type:"button",className:"aops-pm-selector","aria-haspopup":"listbox","aria-expanded":g,onClick:()=>b(I=>!I),children:[a.jsx("span",{className:"aops-pm-selector-icon",children:Tb}),a.jsx("span",{className:"aops-pm-selector-k",children:m("pmBandProject")}),a.jsx("b",{className:"aops-pm-selector-name",children:k}),a.jsx("span",{className:"aops-pm-selector-caret",children:cT})]}),g?a.jsxs("div",{className:"aops-pm-proj-menu",role:"listbox",children:[a.jsx("div",{className:"aops-pm-proj-menu-head",children:S}),x.length===0?a.jsx("div",{className:"aops-pm-proj-menu-empty",children:m("pmNoProjectTitle")}):x.map(I=>{const E=I.key===e.selectedProjectKey,L=T.has(I.key);return a.jsxs("button",{type:"button",role:"option","aria-selected":E,className:`aops-pm-proj-menu-item${E?" is-active":""}`,onClick:()=>{e.onSelectProject(I.key),b(!1)},children:[a.jsx("span",{className:"aops-pm-proj-menu-icon",children:Tb}),a.jsx("span",{className:"aops-pm-proj-menu-label",children:Bb(I)}),L?a.jsx("span",{className:"aops-pm-proj-menu-favorite","aria-hidden":"true",children:dT}):null,E?a.jsx("span",{className:"aops-pm-proj-menu-check",children:"✓"}):null]},I.key)})]}):null]}):null,a.jsx("span",{className:"aops-pm-band-crumb",children:o}),a.jsx(mT,{onBack:v,onRefresh:u,isFetching:d,disabled:d||e.selectedProject===null,t:m})]})}const Qp=a.jsx("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M4 6.5h16M4 12h16M4 17.5h16M7 4v16M17 4v16",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})}),fT=a.jsx("svg",{viewBox:"0 0 24 24",width:"13",height:"13",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})});function gh(e){return e.title||e.slug}function vT(e){const n=ei(e);return n==="oda"&&!/[a-z0-9]/i.test(e)?"space":n}function gT({spaces:e,activeSpaceSlug:n,onSelectSpace:r,onCreateSpace:i,onArchiveSpace:o,adminEnabled:d,adminStatus:u,adminError:v,t:h}){const[m,g]=y.useState(!1),[b,j]=y.useState(!1),C=y.useRef(null),k=e.length?e:[{slug:"default",title:"Default Space"}],x=k.find(S=>S.slug===n)??k[0];return y.useEffect(()=>{if(!m)return;const S=I=>{C.current&&!C.current.contains(I.target)&&g(!1)},T=I=>{I.key==="Escape"&&g(!1)};return document.addEventListener("mousedown",S),document.addEventListener("keydown",T),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("keydown",T)}},[m]),a.jsxs("div",{className:"aops-pm-band aops-chat-spaces-band",children:[a.jsxs("div",{className:"aops-pm-selector-wrap",ref:C,children:[a.jsxs("button",{type:"button",className:"aops-pm-selector aops-chat-space-selector","aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(S=>!S),children:[a.jsx("span",{className:"aops-pm-selector-icon",children:Qp}),a.jsx("span",{className:"aops-pm-selector-k",children:h("chatSpacesBandLabel")}),a.jsx("b",{className:"aops-pm-selector-name",children:x?gh(x):h("chatSpacesEmpty")}),a.jsx("span",{className:"aops-pm-selector-caret",children:fT})]}),m?a.jsxs("div",{className:"aops-pm-proj-menu aops-chat-space-menu",role:"listbox",children:[a.jsx("div",{className:"aops-pm-proj-menu-head",children:h("chatSpacesBandScope")}),k.map(S=>{const T=S.slug===n;return a.jsxs("button",{type:"button",role:"option","aria-selected":T,className:`aops-pm-proj-menu-item${T?" is-active":""}`,onClick:()=>{r(S.slug),g(!1)},children:[a.jsx("span",{className:"aops-pm-proj-menu-icon",children:Qp}),gh(S),T?a.jsx("span",{className:"aops-pm-proj-menu-check",children:"✓"}):null]},S.slug)}),a.jsx("div",{className:"aops-chat-space-menu-sep"}),a.jsxs("button",{type:"button",className:"aops-pm-proj-menu-item aops-chat-space-manage",onClick:()=>{g(!1),j(!0)},children:[a.jsx("span",{className:"aops-pm-proj-menu-icon",children:Qp}),h("chatSpacesManage")]})]}):null]}),a.jsx("span",{className:"aops-pm-band-crumb",children:h("chatTitle")}),b?a.jsx(yT,{spaces:k,activeSpaceSlug:n,adminEnabled:d,adminStatus:u,adminError:v,onCreateSpace:i,onArchiveSpace:o,onClose:()=>j(!1),t:h}):null]})}function yT({spaces:e,activeSpaceSlug:n,adminEnabled:r,adminStatus:i,adminError:o,onCreateSpace:d,onArchiveSpace:u,onClose:v,t:h}){const[m,g]=y.useState(""),[b,j]=y.useState(null),[C,k]=y.useState(null),x=m.trim(),S=vT(x),T=!r,I=b!==null,E=C??o;y.useEffect(()=>{const N=R=>{R.key==="Escape"&&v()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[v]);const L=async()=>{if(!(T||I||!x)){j("__create__"),k(null);try{await d({slug:S,title:x}),g("")}catch(N){k(N instanceof Error?N.message:String(N))}finally{j(null)}}},P=async N=>{if(!(T||I||N.slug==="default"||!N.id)){j(N.slug),k(null);try{await u(N.slug)}catch(R){k(R instanceof Error?R.message:String(R))}finally{j(null)}}};return a.jsx("div",{className:"aops-v2-chat-modal-backdrop",role:"presentation",onClick:v,children:a.jsxs("div",{className:"aops-v2-chat-modal aops-chat-space-modal",role:"dialog","aria-modal":"true","aria-label":h("chatSpacesManageTitle"),onClick:N=>N.stopPropagation(),children:[a.jsxs("header",{className:"aops-v2-chat-modal-head",children:[a.jsx("h4",{children:h("chatSpacesManageTitle")}),a.jsx("button",{type:"button",className:"aops-v2-chat-iconclose","aria-label":h("chatClose"),onClick:v,children:"x"})]}),a.jsxs("div",{className:"aops-v2-chat-modal-body",children:[a.jsx("p",{className:"aops-v2-chat-muted",children:h("chatSpacesManageIntro")}),T?a.jsx("p",{className:"aops-chat-space-readonly",children:h("chatSpacesReadOnlyNote")}):null,E?a.jsx("p",{className:"aops-chat-space-error",children:E}):null,a.jsxs("section",{className:"aops-chat-space-section","aria-label":h("chatSpacesTitle"),children:[a.jsxs("div",{className:"aops-chat-space-section-head",children:[a.jsx("h5",{children:h("chatSpacesTitle")}),a.jsx("span",{children:h(i==="loading"?"chatSpacesLoading":"chatSpacesBandScope")})]}),a.jsx("div",{className:"aops-chat-space-list",children:e.length?e.map(N=>{const R=N.slug==="default",z=!N.id,ne=T||I||R||z,ye=T?h("chatSpacesReadOnlyNote"):R?h("chatSpaceDefaultArchiveDisabled"):z?h("chatSpaceArchiveMissingId"):void 0;return a.jsxs("div",{className:`aops-chat-space-row${N.slug===n?" is-active":""}`,children:[a.jsxs("div",{className:"aops-chat-space-row-main",children:[a.jsx("strong",{children:gh(N)}),a.jsx("span",{children:N.slug})]}),a.jsx("span",{className:"aops-chat-space-status",children:N.status??"active"}),a.jsx("button",{type:"button",className:"aops-v2-chat-danger-button aops-chat-space-archive",disabled:ne,title:ye,onClick:()=>{P(N)},children:b===N.slug?h("chatSpaceArchiving"):h("chatSpaceArchive")})]},N.slug)}):a.jsx("p",{className:"aops-v2-chat-muted",children:h("chatSpaceListEmpty")})})]}),a.jsxs("section",{className:"aops-chat-space-section","aria-label":h("chatSpaceCreateTitle"),children:[a.jsxs("div",{className:"aops-chat-space-section-head",children:[a.jsx("h5",{children:h("chatSpaceCreateTitle")}),a.jsx("span",{children:h("chatSpacesRenameUnsupported")})]}),a.jsxs("label",{className:"aops-v2-chat-field",children:[a.jsx("span",{children:h("chatSpaceTitleLabel")}),a.jsx("input",{value:m,onChange:N=>g(N.target.value),placeholder:h("chatSpaceTitlePlaceholder"),disabled:T||I,autoFocus:!T})]}),a.jsxs("div",{className:"aops-chat-space-slug-preview",children:[a.jsx("span",{children:h("chatSpaceSlugPreview")}),a.jsx("code",{children:S})]}),a.jsxs("div",{className:"aops-v2-chat-connect-actions",children:[a.jsx("button",{type:"button",className:"aops-v2-secondary-button",onClick:v,children:h("chatCancel")}),a.jsx("button",{type:"button",className:"aops-v2-primary-button",disabled:T||I||!x,onClick:()=>{L()},children:h(b==="__create__"?"chatSpaceCreating":"chatSpaceCreate")})]})]})]})]})})}const bT=a.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M4 5h5v14H4zM10 5h4v14h-4zM15 5h5v14h-5z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})}),ux="aops-cockpit-v2.boards.statusFilter.v1";function jT(){if(typeof window>"u")return"active";try{const e=window.localStorage.getItem(ux);return e==="all"||e==="archived"||e==="active"?e:"active"}catch{return"active"}}function AT(){return a.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M4 6h16M7 12h10M10 18h4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function xT({value:e,onChange:n,t:r}){const[i,o]=y.useState(!1),d=y.useRef(null),u=y.useRef(null),[v,h]=y.useState({top:0,left:0});y.useEffect(()=>{if(!i)return;const b=()=>{const k=d.current?.getBoundingClientRect();if(!k)return;const x=216;h({top:k.bottom+8,left:Math.max(8,Math.min(k.right-x,window.innerWidth-x-8))})},j=k=>{const x=k.target;!d.current?.contains(x)&&!u.current?.contains(x)&&o(!1)},C=k=>k.key==="Escape"&&o(!1);return b(),document.addEventListener("pointerdown",j),document.addEventListener("keydown",C),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("keydown",C),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[i]);const m=[{value:"all",label:r("pmCardsFilterAll")},{value:"active",label:r("navActiveGroup")},{value:"archived",label:r("navArchivedGroup")}],g=m.find(b=>b.value===e)?.label??m[0].label;return a.jsxs("div",{className:"aops-v2-board-filter",children:[a.jsxs("button",{ref:d,type:"button",className:`aops-v2-board-filter-button${e!=="all"?" is-filtered":""}`,"aria-label":`${r("pmNavFilterBoards")}: ${g}`,title:`${r("pmNavFilterBoards")}: ${g}`,"aria-haspopup":"menu","aria-expanded":i,onClick:()=>o(b=>!b),"data-testid":"aops-v2-boards-status-filter",children:[a.jsx(AT,{}),e!=="all"?a.jsx("span",{className:"aops-v2-board-filter-dot","aria-hidden":"true"}):null]}),i&&typeof document<"u"?Yr.createPortal(a.jsxs("div",{ref:u,className:"aops-v2-board-filter-menu",role:"menu","aria-label":r("pmNavFilterBoards"),style:{top:v.top,left:v.left},"data-testid":"aops-v2-boards-status-filter-menu",children:[a.jsx("span",{className:"aops-v2-board-filter-menu-title",children:r("pmNavFilterBoards")}),m.map(b=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":e===b.value,className:`aops-v2-board-filter-option${e===b.value?" is-selected":""}`,onClick:()=>{n(b.value),o(!1)},children:[a.jsx("span",{className:"aops-v2-board-filter-radio","aria-hidden":"true"}),a.jsx("span",{children:b.label})]},b.value))]}),document.body):null]})}function CT(e,n){const[r,i]=y.useState(jT),o=h=>{i(h);try{window.localStorage.setItem(ux,h)}catch{}},d=y.useMemo(()=>e.boards.filter(h=>{if(r==="all")return!0;const m=dn(h);return r==="archived"?m:!m}),[e.boards,r]),u=y.useMemo(()=>{const h=new Map;for(const m of e.tasks){if(!m.boardId)continue;const g=h.get(m.boardId)??[];g.push(m.taskCode??"",m.title??"",m.description??"",m.status??""),h.set(m.boardId,g)}return new Map([...h].map(([m,g])=>[m,g.join(" ")]))},[e.tasks]),v=y.useMemo(()=>({storagePrefix:"aops-cockpit-v2.boards",testIdPrefix:"aops-v2-boards",dockClassName:"aops-v2-boards-navdock",treeClassName:"aops-v2-boards-tree",flattenSingleGroup:!0,enableFavorites:!0,searchTrailingSlot:a.jsx(xT,{value:r,onChange:o,t:n}),enableCardsMode:!0,showDropdownSettings:!1,showDropdownMeta:!1,showModeShortcuts:!1,showTreeSettings:!1,showTreeClose:!0,showNavigatorSetting:!1,leftMenuModeLabel:"pmRecordViewSidePanel",settingsModeOrder:["left-menu","cards","dropdown"],onCardsModeChange:e.onCardsModeChange,labels:{panelTitle:"pmNavBoardsPanelTitle",paneAria:"pmNavBoardsPane",toolsAria:"pmNavBoardTools",searchPlaceholder:"pmNavSearchBoards",searchAria:"pmNavFilterBoards",empty:"pmNavNoBoards",emptySearch:"pmNavNoBoardsMatch",unclassified:"pmNavUntitledBoard",dropdownKicker:"pmNavBoardK",dropdownSelect:"pmNavSelectBoard"},dropdownIcon:bT,groups:[{key:"boards",label:n("pmNavBoardsPanelTitle"),items:d}],itemKey:h=>h.id,itemLabel:h=>h.name,itemMeta:h=>h.slug&&h.slug!==h.name?[h.slug]:void 0,searchText:h=>`${h.name} ${h.slug??""} ${u.get(h.id)??""}`,selectedKey:e.selectedBoardId,onSelect:e.onSelectBoard}),[e.onCardsModeChange,e.onSelectBoard,e.selectedBoardId,r,n,u,d]);return im(v,n)}const kT=a.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M5 3v18M5 4h11l-2 3 2 3H5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})});function ST(e,n){const r=y.useMemo(()=>({storagePrefix:"aops-cockpit-v2.sprints",testIdPrefix:"aops-v2-sprints",dockClassName:"aops-v2-sprints-navdock",treeClassName:"aops-v2-sprints-tree",flattenSingleGroup:!0,enableCardsMode:!0,showDropdownSettings:!1,showDropdownMeta:!1,showModeShortcuts:!1,showTreeSettings:!1,showTreeClose:!0,treeCloseLabel:"pmSprintSidePanelClose",showNavigatorSetting:!1,leftMenuModeLabel:"pmRecordViewSidePanel",settingsModeOrder:["left-menu","cards","dropdown"],labels:{panelTitle:"pmNavSprintsPanelTitle",paneAria:"pmNavSprintsPane",toolsAria:"pmNavSprintTools",searchPlaceholder:"pmNavSearchSprints",searchAria:"pmNavFilterSprints",empty:"pmNavNoSprints",emptySearch:"pmNavNothingMatches",unclassified:"pmNavUntitled",dropdownKicker:"pmNavSprintK",dropdownSelect:"pmNavSelect"},dropdownIcon:kT,groups:[{key:"active",label:n("navActiveGroup"),items:e.items.filter(i=>!i.archived)},{key:"archived",label:n("navArchivedGroup"),items:e.items.filter(i=>i.archived)}],itemKey:i=>i.key,itemLabel:i=>i.name,searchText:i=>i.name,selectedKey:e.selectedKey,onSelect:e.onSelect}),[e.items,e.onSelect,e.selectedKey,n]);return im(r,n)}const Db="token",wT="server";function NT(){const e=IT(window.location.href),n=window.location.pathname+window.location.search+window.location.hash;return e.sanitizedUrl!==n&&window.history.replaceState(null,"",e.sanitizedUrl),e.config}function IT(e){const n=new URL(e),r=n.searchParams;r.has(Db)&&r.delete(Db);const i=r.get(wT)?.trim()??"",o=n.origin,u=px(n.hostname)?"trusted-local":"south-bff",v=u==="trusted-local"?ET(i,o):MT(i,o),h=n.pathname+(r.toString()?"?"+r.toString():"")+n.hash;return{config:{serverBaseUrl:v,browserOrigin:o,authMode:u,loginUrl:u==="south-bff"?`/login?${new URLSearchParams({returnTo:h}).toString()}`:null},sanitizedUrl:n.pathname+(r.toString()?"?"+r.toString():"")+n.hash}}function ET(e,n){const r=e||n;let i;try{i=new URL(r,n)}catch{throw new Error("community_cockpit_invalid_server_url")}if(i.protocol!=="http:"&&i.protocol!=="https:"||i.username||i.password||!px(i.hostname))throw new Error("community_cockpit_loopback_server_required");return i.origin}function MT(e,n){let r,i;try{r=new URL(n),i=new URL(e||n,n)}catch{throw new Error("community_cockpit_invalid_server_url")}if(r.protocol!=="https:"||i.protocol!=="https:"||i.username||i.password||i.origin!==r.origin)throw new Error("community_cockpit_remote_same_origin_https_required");return i.origin}function px(e){const n=e.toLowerCase();if(n==="localhost"||n==="[::1]")return!0;const r=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(n);if(!r)return!1;const i=r.slice(1).map(Number);return i[0]===127&&i.every(o=>o>=0&&o<=255)}function hx(e,n){let r;try{r=e()}catch{return}return{getItem:o=>{var d;const u=h=>h===null?null:JSON.parse(h,void 0),v=(d=r.getItem(o))!=null?d:null;return v instanceof Promise?v.then(u):u(v)},setItem:(o,d)=>r.setItem(o,JSON.stringify(d,void 0)),removeItem:o=>r.removeItem(o)}}const yh=e=>n=>{try{const r=e(n);return r instanceof Promise?r:{then(i){return yh(i)(r)},catch(i){return this}}}catch(r){return{then(i){return this},catch(i){return yh(i)(r)}}}},TT=(e,n)=>(r,i,o)=>{let d={storage:hx(()=>window.localStorage),partialize:S=>S,version:0,merge:(S,T)=>({...T,...S}),...n},u=!1,v=0;const h=new Set,m=new Set;let g=d.storage;if(!g)return e((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${d.name}', the given storage is currently unavailable.`),r(...S)},i,o);const b=()=>{const S=d.partialize({...i()});return g.setItem(d.name,{state:S,version:d.version})},j=o.setState;o.setState=(S,T)=>(j(S,T),b());const C=e((...S)=>(r(...S),b()),i,o);o.getInitialState=()=>C;let k;const x=()=>{var S,T;if(!g)return;const I=++v;u=!1,h.forEach(L=>{var P;return L((P=i())!=null?P:C)});const E=((T=d.onRehydrateStorage)==null?void 0:T.call(d,(S=i())!=null?S:C))||void 0;return yh(g.getItem.bind(g))(d.name).then(L=>{if(L)if(typeof L.version=="number"&&L.version!==d.version){if(d.migrate){const P=d.migrate(L.state,L.version);return P instanceof Promise?P.then(N=>[!0,N]):[!0,P]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,L.state];return[!1,void 0]}).then(L=>{var P;if(I!==v)return;const[N,R]=L;if(k=d.merge(R,(P=i())!=null?P:C),r(k,!0),N)return b()}).then(()=>{I===v&&(E?.(k,void 0),k=i(),u=!0,m.forEach(L=>L(k)))}).catch(L=>{I===v&&E?.(void 0,L)})};return o.persist={setOptions:S=>{d={...d,...S},S.storage&&(g=S.storage)},clearStorage:()=>{g?.removeItem(d.name)},getOptions:()=>d,rehydrate:()=>x(),hasHydrated:()=>u,onHydrate:S=>(h.add(S),()=>{h.delete(S)}),onFinishHydration:S=>(m.add(S),()=>{m.delete(S)})},d.skipHydration||x(),k||C},BT=TT,DT="aops-cockpit-v2.shell.v1",Rb="main",RT="coral",LT="light",Vt=rj()(BT(e=>({theme:LT,accentId:RT,themeId:Rb,customThemes:[],navMode:"expanded",navAutoHide:!1,navPopoverEnabled:!1,section:"projects",activePageId:"projects",locale:"en",selectedProjectKey:null,dockPinned:!0,setTheme:n=>e({theme:n}),toggleTheme:()=>e(n=>({theme:n.theme==="light"?"dark":"light"})),setAccentId:n=>e({accentId:n}),setThemeId:n=>e({themeId:n}),addCustomTheme:n=>e(r=>({customThemes:[...r.customThemes.filter(i=>i.id!==n.id),n]})),updateCustomTheme:(n,r)=>e(i=>({customThemes:i.customThemes.map(o=>o.id===n?{...o,...r,id:o.id}:o)})),deleteCustomTheme:n=>e(r=>({customThemes:r.customThemes.filter(i=>i.id!==n),themeId:r.themeId===n?Rb:r.themeId})),setNavMode:n=>e({navMode:n}),toggleNavAutoHide:()=>e(n=>({navAutoHide:!n.navAutoHide})),setNavPopoverEnabled:n=>e({navPopoverEnabled:n}),toggleNavPopover:()=>e(n=>({navPopoverEnabled:!n.navPopoverEnabled})),setSection:n=>e({section:n}),setActivePageId:n=>e({activePageId:n}),setLocale:n=>e({locale:n}),toggleLocale:()=>e(n=>({locale:n.locale==="tr"?"en":"tr"})),setSelectedProjectKey:n=>e({selectedProjectKey:n}),toggleDockPinned:()=>e(n=>({dockPinned:!n.dockPinned}))}),{name:DT,storage:hx(()=>window.localStorage),version:2,migrate:e=>({...e,locale:"en"}),partialize:e=>({theme:e.theme,accentId:e.accentId,themeId:e.themeId,customThemes:e.customThemes,navMode:e.navMode,navAutoHide:e.navAutoHide,navPopoverEnabled:e.navPopoverEnabled,section:e.section,locale:e.locale})}));function OT(){const e=Vt(o=>o.theme),n=Vt(o=>o.themeId),r=Vt(o=>o.accentId),i=Vt(o=>o.customThemes);return y.useMemo(()=>JS({theme:e,themeId:n,accent:r,customThemes:i}),[e,n,r,i])}const _T=a.jsx("span",{"aria-hidden":!0,hidden:!0}),QT=new Set(["*","chatv3.*","chatv3.channel.manage","chatv3.space.manage"]),UT=a.jsx("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M10 2.5 4.5 8 10 13.5M4.5 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),PT=a.jsx("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.88M13.5 2.5v3h-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function FT(e){return!!e?.some(n=>QT.has(n))}function KT(e){if(e?.authProvider!=="trusted-local"&&e?.authProvider!=="south-bff"||e.authRequired!==!1||!e.principal)return null;const n=e.principal.userId?.trim();return n?{...e.principal,userId:n}:null}function zT({isFetching:e,onRefresh:n,onBack:r,t:i}){return a.jsxs("div",{className:"aops-pm-actionbar aops-chat-thinbar-actions",children:[a.jsx("button",{type:"button",className:`aops-pm-action-btn${e?" is-busy":""}`,onClick:n,"aria-label":i("pmRefresh"),title:i("pmRefresh"),children:PT}),a.jsx("button",{type:"button",className:"aops-pm-action-btn",onClick:r,"aria-label":i("pmActionBack"),title:i("pmActionBack"),children:UT})]})}function $T(){const e=ii(),n=y.useMemo(()=>NT(),[]),r=Vt(Ie=>Ie.locale),i=GM(r),o=y.useMemo(()=>Ey({baseUrl:n.serverBaseUrl,browserOrigin:n.browserOrigin,authMode:n.authMode}),[n.authMode,n.browserOrigin,n.serverBaseUrl]),d=CM(o),u=SM(d.data),v=KT(d.data),h=!!v,[m,g]=y.useState(!1),[b,j]=y.useState(null),C=y.useCallback(async()=>{if(!(n.authMode!=="south-bff"||!n.loginUrl||m)){g(!0),j(null);try{await xM(o),window.location.assign(n.loginUrl)}catch(Ie){j(It(Ie,"south_bff_logout_failed")),g(!1)}}},[o,m,n.authMode,n.loginUrl]),k=Vt(Ie=>Ie.activePageId),x=Vt(Ie=>Ie.setActivePageId),S=Vt(Ie=>Ie.navMode),T=Vt(Ie=>Ie.setNavMode),I=Vt(Ie=>Ie.toggleTheme),E=Vt(Ie=>Ie.setThemeId),L=Vt(Ie=>Ie.setAccentId),P=OT(),N=Vt(Ie=>Ie.selectedProjectKey),R=Vt(Ie=>Ie.setSelectedProjectKey),z=Vt(Ie=>Ie.customThemes),ne=Vt(Ie=>Ie.addCustomTheme),ye=Vt(Ie=>Ie.updateCustomTheme),J=Vt(Ie=>Ie.deleteCustomTheme),[re,oe]=y.useState(!1),fe=y.useRef(!1),[de,G]=y.useState(()=>new Set),Q=il(Ie=>Ie.logs),W=il(Ie=>Ie.debugOpen),pe=il(Ie=>Ie.toggleDebug),ke=il(Ie=>Ie.clearLogs),O=fS(),_=dI({client:o,sessionKey:u,enabled:h}),K=sx.resolvePage(k,ax),ee=K==="projects",ve=h0(K),se=Yo(K),Z=K==="docs",ae=ve||se||Z,ce=K==="chat",w=_.data??[],F=w.find(Ie=>Ie.key===N)??w[0]??null,X=_.isPending&&h?"loading":_.isError?"error":w.length?"ready":"empty",D=XM({projects:w,selectedProjectKey:N,onSelectProject:R,allowLeftMenuMode:!ae},i),B=y.useMemo(()=>Ey({baseUrl:n.serverBaseUrl,browserOrigin:n.browserOrigin,authMode:n.authMode,projectId:F?.projectId,scopeId:F?.scopeId}),[n.authMode,n.browserOrigin,n.serverBaseUrl,F?.projectId,F?.scopeId]),U=Yo(K)&&gj(K)==="boards",[H,q]=y.useState(()=>{try{return window.localStorage.getItem("aops-cockpit-v2.boards.cardsMode")==="1"}catch{return!1}}),[V,be]=y.useState(null),ge=V?.kind==="task"&&!V.boardId,Se=d0({client:B,sessionKey:u,selectedProject:F,enabled:h&&_.isSuccess,tasksEnabled:(ee||Yo(K)||ge)&&!(U&&H)}),[Ne,we]=y.useState(null);y.useEffect(()=>{const Ie=Se.boards;if(!Ie.length){Ne!==null&&we(null);return}(!Ne||!Ie.some(rt=>rt.id===Ne))&&we(Ie[0].id)},[Se.boards,Ne]);const Be=CT({boards:Se.boards,tasks:Se.tasks,selectedBoardId:Ne,onSelectBoard:we,onCardsModeChange:q},i),Je=y.useMemo(()=>Pj(Se.sprints,Se.implementationPlans),[Se.sprints,Se.implementationPlans]),[Ke,Xe]=y.useState(null);y.useEffect(()=>{if(!Je.length){Ke!==null&&Xe(null);return}(!Ke||!Je.some(Ie=>Ie.key===Ke))&&Xe(Je[0].key)},[Je,Ke]);const Et=ST({items:Je,selectedKey:Ke,onSelect:Xe},i),vt=v,Ee=d.isSuccess&&!!vt&&FT(vt?.permissions),Le=fE(n.serverBaseUrl,{adminEnabled:Ee,principalUserId:vt?.userId??null,tenantId:d.data?.tenantId??"default",authMode:n.authMode,browserOrigin:n.browserOrigin}),xe=UM(Le,i),Te=ZE({client:B,sessionKey:u,selectedProject:F,enabled:h&&_.isSuccess&&(ee||ve)}),Me=W2({client:B,sessionKey:u,selectedProject:F,enabled:h&&_.isSuccess&&(ee||Z)}),[Fe,ze]=y.useState(null);y.useEffect(()=>{const Ie=Me.documents;if(!Ie.length){Fe!==null&&ze(null);return}(!Fe||!Ie.some(rt=>rt.id===Fe))&&ze(Ie[0].id)},[Me.documents,Fe]);const Mt=oT({docman:Me,selectedDocumentId:Fe,onSelectDocument:ze},i);y.useEffect(()=>{document.documentElement.dataset.theme=P.snapshot.theme,document.documentElement.dataset.accent=P.snapshot.accent,document.documentElement.dataset.density="comfortable",document.documentElement.lang=r},[P.snapshot.theme,P.snapshot.accent,r]),y.useEffect(()=>{const Ie=ae&&!fe.current;fe.current=ae,Ie&&(D.isLeftMenuMode&&D.controller.switchToNavigator(),e.viewport==="mobile"?D.controller.openNavigator():D.controller.close())},[ae,D.controller,D.isLeftMenuMode,e.viewport]),y.useEffect(()=>{if(_.isSuccess){if(!w.length){N!==null&&R(null);return}(!N||!w.some(Ie=>Ie.key===N))&&R(w[0].key)}},[w,_.isSuccess,N,R]);const ca=y.useMemo(()=>{const Ie=rt=>({id:rt.id,label:rt.labelKey?i(rt.labelKey):rt.label??rt.id,icon:rt.icon,children:rt.children?.map(Ie),expanded:rt.children?!de.has(rt.id):void 0});return f0().map(Ie)},[i,de]),Ct=y.useCallback(Ie=>{const rt=Je.find(sa=>sa.id===Ie);Xe(rt?.key??null),x("pm-sprints")},[Je,x]),ut=y.useCallback(Ie=>{if(be(Ie),Ie.kind==="sprint"){Ct(Ie.id);return}if(Ie.kind==="board"){we(Ie.id),x("pm-boards");return}q(!1),Ie.boardId&&we(Ie.boardId),x("pm-boards")},[Ct,x]);y.useEffect(()=>{if(!V)return;if(V.kind==="board"){we(V.id),be(null);return}if(V.kind==="sprint"){const rt=Je.find(sa=>sa.id===V.id);rt&&(Xe(rt.key),be(null));return}if(V.boardId){we(V.boardId),be(null);return}const Ie=Se.tasks.find(rt=>rt.id===V.id||rt.taskCode===V.id);Ie?.boardId&&(we(Ie.boardId),be(null))},[V,Se.tasks,Je]);const Jt=y.useCallback(Ie=>{G(rt=>{const sa=new Set(rt);return sa.has(Ie.id)?sa.delete(Ie.id):sa.add(Ie.id),sa})},[]),_t=y.useMemo(()=>({activePageId:K,t:i,locale:r,projects:{status:X,projects:w,selectedProject:F,selectedProjectKey:N,error:_.error,isFetching:_.isFetching,onRefresh:()=>{_.refetch()},onSelectProject:R},projectsNavigator:D,projectman:Se,boardsNavigator:Be,selectedBoardId:Ne,sprintsNavigator:Et,selectedSprintKey:Ke,chat:Le,chatNavigator:xe,agentspace:Te,docman:Me,docsNavigator:Mt,selectedDocumentId:Fe,onNavigate:x,onOpenPlan:Ct,onOpenProjectmanRef:ut}),[Te,Me,Mt,Fe,u,ut,Ct,Be,Et,Ke,Le,xe,r,X,Se,w,D,_,K,Ne,F,N,x,R,i]),he=yM(K,_t);if(d.isPending||d.isError||!v)return a.jsx(gw,{error:d.error??(v?null:new Error("trusted_local_principal_required")),mode:d.isPending?"loading":"error",serverBaseUrl:n.serverBaseUrl,authMode:n.authMode,sessionRequired:AM(d.error),t:i,onRetry:()=>{d.refetch()},onSignIn:()=>{n.loginUrl&&window.location.assign(n.loginUrl)}});const De=v.fullName||v.email||v.userId,Qe=a.jsx(RS,{icons:wh,windowActions:[{id:"minimize",label:"Minimize"},{id:"maximize",label:"Maximize"},{id:"close",label:"Close"}],windowPulseActive:O>0,statusMessages:[{id:"api",label:i("statusApi"),text:n.serverBaseUrl},{id:"project",label:i("statusProject"),text:F?F.slug??F.key:i("statusNoProject")}],backendState:"online",backendStatusLabel:De,debugOpen:W,onToggleDebug:pe,debugStats:{total:Q.length}}),He=ee||ae,jt=e.viewport==="mobile"&&He;return a.jsxs(a.Fragment,{children:[a.jsx(kw,{viewport:e.viewport,compactDensity:e.compactDensity,navItems:ca,activePage:K,onNavigate:Ie=>x(Ie.id),onToggleBranch:Jt,navMode:S,onSetNavMode:T,navLabels:{collapse:i("navCollapse"),expand:i("navExpand"),hide:i("navHide"),hideHint:i("navHideHint"),headerControls:i("navHeaderControls")},navReopenLabel:i("navReopen"),leftDock:jt||He&&D.leftDockMode==="pinned"?D.dockNode:He&&D.leftDockMode==="overlay"?_T:null,leftDockMode:jt?"pinned":He?D.leftDockMode:"hidden",leftDockWidth:ce?xe.leftDockWidth:D.leftDockWidth,thinBar:Yo(K)?a.jsxs("div",{className:"aops-pm-thinbar-row aops-pm-project-scope-row",children:[D.recentsBar,a.jsx(_p,{projects:_t.projects,projectOptions:D.scopeProjectOptions,favoriteProjectKeys:D.scopeFavoriteProjectKeys,projectMenuTitle:i("projectsNavFavoritesRecentTitle"),crumb:"",isFetching:Se.isFetching,onRefresh:Se.refresh,onBack:()=>x("projects"),t:i})]}):ve?a.jsxs("div",{className:"aops-pm-thinbar-row aops-as-project-scope-row",children:[D.recentsBar,a.jsx(_p,{projects:_t.projects,projectOptions:D.scopeProjectOptions,favoriteProjectKeys:D.scopeFavoriteProjectKeys,projectMenuTitle:i("projectsNavFavoritesRecentTitle"),crumb:"",isFetching:Te.isFetching,onRefresh:Te.refresh,onBack:()=>x("projects"),t:i})]}):Z?a.jsxs("div",{className:"aops-pm-thinbar-row aops-docs-project-scope-row",children:[D.recentsBar,a.jsx(_p,{projects:_t.projects,projectOptions:D.scopeProjectOptions,favoriteProjectKeys:D.scopeFavoriteProjectKeys,projectMenuTitle:i("projectsNavFavoritesRecentTitle"),crumb:"",isFetching:Me.isFetching,onRefresh:Me.refresh,onBack:()=>x("projects"),t:i})]}):ee&&X==="ready"?D.recentsBar:ce?a.jsxs("div",{className:"aops-pm-thinbar-row",children:[a.jsx(gT,{spaces:Le.spaces,activeSpaceSlug:Le.activeSpaceSlug,onSelectSpace:Ie=>{Le.selectSpace(Ie)},onCreateSpace:Le.createSpace,onArchiveSpace:Le.archiveSpace,adminEnabled:Ee,adminStatus:Le.spaceAdminStatus,adminError:Le.spaceAdminError,t:i}),a.jsx(zT,{isFetching:Le.status==="connecting",onRefresh:()=>{Le.refreshAdminSpaces()},onBack:()=>x("projects"),t:i})]}):null,appearanceStyle:P.style,theme:P.snapshot.theme,accent:P.snapshot.accent,activeThemeId:P.snapshot.themeId,themeOptions:P.themeOptions,accentOptions:P.accentOptions,onSetThemeId:E,onSetAccent:L,onToggleTheme:I,onOpenThemeStudio:()=>oe(!0),authBar:a.jsx(yw,{principal:v,provider:d.data.authProvider,logoutBusy:m,logoutError:b,onLogout:d.data.authProvider==="south-bff"?()=>{C()}:void 0,t:i}),statusBar:Qe,t:i,children:he}),a.jsx(Sw,{open:re,onClose:()=>oe(!1),themeCatalog:P.themeCatalog,activeThemeId:P.snapshot.themeId,activeAccent:P.snapshot.accent,accentOptions:P.accentOptions,theme:P.snapshot.theme,customThemes:z,onSetThemeId:E,onSetAccent:L,onToggleTheme:I,onAddCustomTheme:ne,onUpdateCustomTheme:ye,onDeleteCustomTheme:J,t:i}),a.jsx(Iw,{open:W,logs:Q,onClose:pe,onClear:ke,t:i})]})}function HT(){return new oS({defaultOptions:{queries:{retry:0,staleTime:1e4,gcTime:5*6e4,refetchOnWindowFocus:!1,refetchOnReconnect:!1},mutations:{retry:0}}})}const GT=HT(),mx=document.getElementById("root");if(!mx)throw new Error("aops_cockpit_v2_root_missing");Lk.createRoot(mx).render(a.jsx(y.StrictMode,{children:a.jsx(cS,{client:GT,children:a.jsx($T,{})})}));
|