loki-mode 11.8.1 → 11.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/lib/backlog.py +4 -3
  4. package/autonomy/lib/workspace.py +95 -4
  5. package/autonomy/loki +185 -106
  6. package/autonomy/trigger-server.py +282 -4
  7. package/bin/loki +1 -1
  8. package/completions/_loki +34 -1
  9. package/completions/loki.bash +10 -3
  10. package/dashboard/__init__.py +1 -1
  11. package/docs/ARCHITECTURE.md +0 -1
  12. package/docs/CLI-REFERENCE.md +1 -1
  13. package/docs/COMPONENTS.md +1 -1
  14. package/docs/DEPLOY-PLAN.md +13 -3
  15. package/docs/INSTALLATION.md +1 -1
  16. package/docs/WORKSPACES.md +1 -1
  17. package/docs/dev/architecture-reference.md +1 -1
  18. package/docs/sentry-intake.md +15 -1
  19. package/docs/v10/D61-SPEED.md +2 -0
  20. package/docs/v10/PROGRESS.md +13 -1
  21. package/loki-ts/dist/loki.js +947 -881
  22. package/mcp/__init__.py +1 -1
  23. package/package.json +2 -2
  24. package/packages/control-plane/dist/ask-tools-server.js +13 -4
  25. package/packages/control-plane/dist/server.js +428 -276
  26. package/packages/control-plane/src/server/diffstat.ts +10 -2
  27. package/packages/control-plane/src/server/legacy/routes-control.ts +8 -4
  28. package/packages/control-plane/src/server/routes/checkpoints.ts +11 -2
  29. package/packages/control-plane/ui/dist/assets/index-u8cd6TRQ.js +190 -0
  30. package/packages/control-plane/ui/dist/index.html +1 -1
  31. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  32. package/web-app/dist/assets/{AdminPage-BnIg9ilA.js → AdminPage-BdH9iL2I.js} +1 -1
  33. package/web-app/dist/assets/{Avatar-0BTVsQ2A.js → Avatar-C-WixxR6.js} +1 -1
  34. package/web-app/dist/assets/{Badge-Bbq8CXgn.js → Badge-BFWpRd_L.js} +1 -1
  35. package/web-app/dist/assets/{Button-CKD4n0ld.js → Button-CE5vG66Y.js} +1 -1
  36. package/web-app/dist/assets/{CockpitPage-DJhLNLAz.js → CockpitPage-BAVn10bY.js} +1 -1
  37. package/web-app/dist/assets/{ComparePage-Di2akuII.js → ComparePage-DOecIGfM.js} +1 -1
  38. package/web-app/dist/assets/{ErrorBoundary-9lhsYG-z.js → ErrorBoundary-1rNA5v7f.js} +1 -1
  39. package/web-app/dist/assets/{EvidenceReceiptPanel-CQDGXvDr.js → EvidenceReceiptPanel-DjOaWfdH.js} +1 -1
  40. package/web-app/dist/assets/{GitHubIssuesPanel-Y_w2k9Ej.js → GitHubIssuesPanel-NNPBuRPD.js} +1 -1
  41. package/web-app/dist/assets/{GitHubPRsPanel-pMSQedCv.js → GitHubPRsPanel-CL1b--tV.js} +1 -1
  42. package/web-app/dist/assets/{HomePage-CIAkiGdt.js → HomePage-BsLDN6MW.js} +2 -2
  43. package/web-app/dist/assets/{LoginPage-BES4Pk6k.js → LoginPage-CVIv5bCS.js} +1 -1
  44. package/web-app/dist/assets/{MagicPage-B154fMhi.js → MagicPage-BgMBB9lK.js} +1 -1
  45. package/web-app/dist/assets/{MetricsPage-BcNyaiUO.js → MetricsPage-BHeJlqPC.js} +1 -1
  46. package/web-app/dist/assets/{NotFoundPage-D28FqYxG.js → NotFoundPage-DDzwfyDK.js} +1 -1
  47. package/web-app/dist/assets/{ProjectPage-C_O3u8Jx.js → ProjectPage-CuQWEYBF.js} +3 -3
  48. package/web-app/dist/assets/{ProjectsPage-uqdahuPA.js → ProjectsPage-OoD0RFDZ.js} +1 -1
  49. package/web-app/dist/assets/{SettingsPage-DLvVA9OZ.js → SettingsPage-tMFMKkK5.js} +1 -1
  50. package/web-app/dist/assets/{ShowcasePage-BAZP8vsm.js → ShowcasePage-DVfLoWdz.js} +1 -1
  51. package/web-app/dist/assets/{SystemSettingsPage-DPYZkLWh.js → SystemSettingsPage-CThV9N4l.js} +1 -1
  52. package/web-app/dist/assets/{TeamsPage-BgSyb5Pd.js → TeamsPage-CV0nvXI8.js} +1 -1
  53. package/web-app/dist/assets/{TemplatesPage-D_Jh5VU1.js → TemplatesPage-D81EI1L8.js} +1 -1
  54. package/web-app/dist/assets/{TerminalOutput-4v8poDKb.js → TerminalOutput-Bj7uKRIe.js} +1 -1
  55. package/web-app/dist/assets/{activity-CE2b6kdw.js → activity-DoNfNkOL.js} +1 -1
  56. package/web-app/dist/assets/{bell-CxJDlLSR.js → bell-BWO3OU50.js} +1 -1
  57. package/web-app/dist/assets/{bot-C2WuK4zw.js → bot-DcvWv_zD.js} +1 -1
  58. package/web-app/dist/assets/{check-81epVldw.js → check-CfG09Z18.js} +1 -1
  59. package/web-app/dist/assets/{chevron-left-B6EXh_3C.js → chevron-left-z0fh4x2h.js} +1 -1
  60. package/web-app/dist/assets/{circle-alert-0iqoo-iy.js → circle-alert-C_7GlYul.js} +1 -1
  61. package/web-app/dist/assets/{clock-CFrBpNUp.js → clock-BsYUp070.js} +1 -1
  62. package/web-app/dist/assets/{cloud-BBSFhUT_.js → cloud-BVWAJ7Rv.js} +1 -1
  63. package/web-app/dist/assets/{code-xml-BCU2V1rq.js → code-xml-CdZT-6zu.js} +1 -1
  64. package/web-app/dist/assets/{database-D2hvO52K.js → database-Dbkm9t2D.js} +1 -1
  65. package/web-app/dist/assets/{dollar-sign-CXFA9b6T.js → dollar-sign-CfIUM5Pd.js} +1 -1
  66. package/web-app/dist/assets/{file-code-corner-CqTCEEfS.js → file-code-corner-CrUKhnj-.js} +1 -1
  67. package/web-app/dist/assets/{file-plus-DYFbkGbs.js → file-plus-Cf6u0xHY.js} +1 -1
  68. package/web-app/dist/assets/{globe-DpYHLobk.js → globe-DsIqaI7w.js} +1 -1
  69. package/web-app/dist/assets/{hammer-CZ97SEYo.js → hammer-CA14BeMp.js} +1 -1
  70. package/web-app/dist/assets/{index-DzswgpRo.js → index-DpJ_GJuZ.js} +3 -3
  71. package/web-app/dist/assets/{layers-2Tq0edx4.js → layers-Dh5Oqhrj.js} +1 -1
  72. package/web-app/dist/assets/{loader-circle-BFP4kUX-.js → loader-circle-B0WHIGqt.js} +1 -1
  73. package/web-app/dist/assets/{lock-DkKdZH4d.js → lock-DkgfEGYF.js} +1 -1
  74. package/web-app/dist/assets/{package-ChOGD8yf.js → package-LzjmwD1S.js} +1 -1
  75. package/web-app/dist/assets/{plus-hggB1o6b.js → plus-BNjA0KSV.js} +1 -1
  76. package/web-app/dist/assets/{refresh-cw-DYwVLOeF.js → refresh-cw-k3IacuDX.js} +1 -1
  77. package/web-app/dist/assets/{rotate-ccw-CUdY506q.js → rotate-ccw-BFON_xv-.js} +1 -1
  78. package/web-app/dist/assets/{scroll-text-Wvidz5uN.js → scroll-text-CaIlSPZB.js} +1 -1
  79. package/web-app/dist/assets/{server-O11QmkCN.js → server-CKFUccCG.js} +1 -1
  80. package/web-app/dist/assets/{shield-alert-DXXx27uV.js → shield-alert-Q4-rPo5r.js} +1 -1
  81. package/web-app/dist/assets/{thumbs-up-DF8ivs3A.js → thumbs-up-BYMeh8oV.js} +1 -1
  82. package/web-app/dist/assets/{trash-2-LA6PW0Nf.js → trash-2-BHSUEIHw.js} +1 -1
  83. package/web-app/dist/assets/{trending-down-Bw_vLKHT.js → trending-down-BC_FR2VT.js} +1 -1
  84. package/web-app/dist/assets/{trending-up-tX8motha.js → trending-up-CmA-WmLW.js} +1 -1
  85. package/web-app/dist/assets/{upload-CxtTWJd2.js → upload-BxLgBa1B.js} +1 -1
  86. package/web-app/dist/assets/{usePolling-D-P5Iofq.js → usePolling-DKNgwt5n.js} +1 -1
  87. package/web-app/dist/assets/{user-dKTcuUFq.js → user-CA2DlmLc.js} +1 -1
  88. package/web-app/dist/index.html +1 -1
  89. package/memory/rag_injector.py +0 -161
  90. package/packages/control-plane/ui/dist/assets/index-DbLzr87u.js +0 -190
@@ -1,190 +0,0 @@
1
- (function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&c(p)}).observe(document,{childList:!0,subtree:!0});function o(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(d){if(d.ep)return;d.ep=!0;const m=o(d);fetch(d.href,m)}})();var Jo={exports:{}},Ki={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var u0;function Fx(){if(u0)return Ki;u0=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(c,d,m){var p=null;if(m!==void 0&&(p=""+m),d.key!==void 0&&(p=""+d.key),"key"in d){m={};for(var g in d)g!=="key"&&(m[g]=d[g])}else m=d;return d=m.ref,{$$typeof:i,type:c,key:p,ref:d!==void 0?d:null,props:m}}return Ki.Fragment=r,Ki.jsx=o,Ki.jsxs=o,Ki}var r0;function Wx(){return r0||(r0=1,Jo.exports=Fx()),Jo.exports}var u=Wx(),Io={exports:{}},Ji={},Fo={exports:{}},Wo={};/**
10
- * @license React
11
- * scheduler.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var c0;function Px(){return c0||(c0=1,(function(i){function r(V,lt){var X=V.length;V.push(lt);t:for(;0<X;){var wt=X-1>>>1,Tt=V[wt];if(0<d(Tt,lt))V[wt]=lt,V[X]=Tt,X=wt;else break t}}function o(V){return V.length===0?null:V[0]}function c(V){if(V.length===0)return null;var lt=V[0],X=V.pop();if(X!==lt){V[0]=X;t:for(var wt=0,Tt=V.length,tl=Tt>>>1;wt<tl;){var Sl=2*(wt+1)-1,_n=V[Sl],S=Sl+1,U=V[S];if(0>d(_n,X))S<Tt&&0>d(U,_n)?(V[wt]=U,V[S]=X,wt=S):(V[wt]=_n,V[Sl]=X,wt=Sl);else if(S<Tt&&0>d(U,X))V[wt]=U,V[S]=X,wt=S;else break t}}return lt}function d(V,lt){var X=V.sortIndex-lt.sortIndex;return X!==0?X:V.id-lt.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var p=Date,g=p.now();i.unstable_now=function(){return p.now()-g}}var b=[],v=[],R=1,y=null,A=3,L=!1,Q=!1,at=!1,H=!1,Y=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function B(V){for(var lt=o(v);lt!==null;){if(lt.callback===null)c(v);else if(lt.startTime<=V)c(v),lt.sortIndex=lt.expirationTime,r(b,lt);else break;lt=o(v)}}function $(V){if(at=!1,B(V),!Q)if(o(b)!==null)Q=!0,ot||(ot=!0,it());else{var lt=o(v);lt!==null&&It($,lt.startTime-V)}}var ot=!1,tt=-1,et=5,Kt=-1;function P(){return H?!0:!(i.unstable_now()-Kt<et)}function xt(){if(H=!1,ot){var V=i.unstable_now();Kt=V;var lt=!0;try{t:{Q=!1,at&&(at=!1,J(tt),tt=-1),L=!0;var X=A;try{e:{for(B(V),y=o(b);y!==null&&!(y.expirationTime>V&&P());){var wt=y.callback;if(typeof wt=="function"){y.callback=null,A=y.priorityLevel;var Tt=wt(y.expirationTime<=V);if(V=i.unstable_now(),typeof Tt=="function"){y.callback=Tt,B(V),lt=!0;break e}y===o(b)&&c(b),B(V)}else c(b);y=o(b)}if(y!==null)lt=!0;else{var tl=o(v);tl!==null&&It($,tl.startTime-V),lt=!1}}break t}finally{y=null,A=X,L=!1}lt=void 0}}finally{lt?it():ot=!1}}}var it;if(typeof M=="function")it=function(){M(xt)};else if(typeof MessageChannel<"u"){var Jt=new MessageChannel,Gt=Jt.port2;Jt.port1.onmessage=xt,it=function(){Gt.postMessage(null)}}else it=function(){Y(xt,0)};function It(V,lt){tt=Y(function(){V(i.unstable_now())},lt)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(V){V.callback=null},i.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):et=0<V?Math.floor(1e3/V):5},i.unstable_getCurrentPriorityLevel=function(){return A},i.unstable_next=function(V){switch(A){case 1:case 2:case 3:var lt=3;break;default:lt=A}var X=A;A=lt;try{return V()}finally{A=X}},i.unstable_requestPaint=function(){H=!0},i.unstable_runWithPriority=function(V,lt){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var X=A;A=V;try{return lt()}finally{A=X}},i.unstable_scheduleCallback=function(V,lt,X){var wt=i.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?wt+X:wt):X=wt,V){case 1:var Tt=-1;break;case 2:Tt=250;break;case 5:Tt=1073741823;break;case 4:Tt=1e4;break;default:Tt=5e3}return Tt=X+Tt,V={id:R++,callback:lt,priorityLevel:V,startTime:X,expirationTime:Tt,sortIndex:-1},X>wt?(V.sortIndex=X,r(v,V),o(b)===null&&V===o(v)&&(at?(J(tt),tt=-1):at=!0,It($,X-wt))):(V.sortIndex=Tt,r(b,V),Q||L||(Q=!0,ot||(ot=!0,it()))),V},i.unstable_shouldYield=P,i.unstable_wrapCallback=function(V){var lt=A;return function(){var X=A;A=lt;try{return V.apply(this,arguments)}finally{A=X}}}})(Wo)),Wo}var o0;function t1(){return o0||(o0=1,Fo.exports=Px()),Fo.exports}var Po={exports:{}},ut={};/**
18
- * @license React
19
- * react.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var f0;function e1(){if(f0)return ut;f0=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),A=Symbol.for("react.view_transition"),L=Symbol.iterator;function Q(S){return S===null||typeof S!="object"?null:(S=L&&S[L]||S["@@iterator"],typeof S=="function"?S:null)}var at={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,Y={};function J(S,U,F){this.props=S,this.context=U,this.refs=Y,this.updater=F||at}J.prototype.isReactComponent={},J.prototype.setState=function(S,U){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,U,"setState")},J.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function M(){}M.prototype=J.prototype;function B(S,U,F){this.props=S,this.context=U,this.refs=Y,this.updater=F||at}var $=B.prototype=new M;$.constructor=B,H($,J.prototype),$.isPureReactComponent=!0;var ot=Array.isArray;function tt(){}var et={H:null,A:null,T:null,S:null},Kt=Object.prototype.hasOwnProperty;function P(S,U,F){var W=F.ref;return{$$typeof:i,type:S,key:U,ref:W!==void 0?W:null,props:F}}function xt(S,U){return P(S.type,U,S.props)}function it(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function Jt(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(F){return U[F]})}var Gt=/\/+/g;function It(S,U){return typeof S=="object"&&S!==null&&S.key!=null?Jt(""+S.key):U.toString(36)}function V(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(tt,tt):(S.status="pending",S.then(function(U){S.status==="pending"&&(S.status="fulfilled",S.value=U)},function(U){S.status==="pending"&&(S.status="rejected",S.reason=U)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function lt(S,U,F,W,yt){var bt=typeof S;(bt==="undefined"||bt==="boolean")&&(S=null);var St=!1;if(S===null)St=!0;else switch(bt){case"bigint":case"string":case"number":St=!0;break;case"object":switch(S.$$typeof){case i:case r:St=!0;break;case R:return St=S._init,lt(St(S._payload),U,F,W,yt)}}if(St)return yt=yt(S),St=W===""?"."+It(S,0):W,ot(yt)?(F="",St!=null&&(F=St.replace(Gt,"$&/")+"/"),lt(yt,U,F,"",function(_l){return _l})):yt!=null&&(it(yt)&&(yt=xt(yt,F+(yt.key==null||S&&S.key===yt.key?"":(""+yt.key).replace(Gt,"$&/")+"/")+St)),U.push(yt)),1;St=0;var K=W===""?".":W+":";if(ot(S))for(var st=0;st<S.length;st++)W=S[st],bt=K+It(W,st),St+=lt(W,U,F,bt,yt);else if(st=Q(S),typeof st=="function")for(S=st.call(S),st=0;!(W=S.next()).done;)W=W.value,bt=K+It(W,st++),St+=lt(W,U,F,bt,yt);else if(bt==="object"){if(typeof S.then=="function")return lt(V(S),U,F,W,yt);throw U=String(S),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return St}function X(S,U,F){if(S==null)return S;var W=[],yt=0;return lt(S,W,"","",function(bt){return U.call(F,bt,yt++)}),W}function wt(S){if(S._status===-1){var U=S._result,F=U();F.then(function(W){(S._status===0||S._status===-1)&&(S._status=1,S._result=W,F.status===void 0&&(F.status="fulfilled",F.value=W))},function(W){(S._status===0||S._status===-1)&&(S._status=2,S._result=W,F.status===void 0&&(F.status="rejected",F.reason=W))}),S._status===-1&&(S._status=0,S._result=F)}if(S._status===1)return S._result.default;throw S._result}var Tt=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)};function tl(S){var U=et.T,F={};F.types=U!==null?U.types:null,et.T=F;try{var W=S(),yt=et.S;yt!==null&&yt(F,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(tt,Tt)}catch(bt){Tt(bt)}finally{U!==null&&F.types!==null&&(U.types=F.types),et.T=U}}function Sl(S){var U=et.T;if(U!==null){var F=U.types;F===null?U.types=[S]:F.indexOf(S)===-1&&F.push(S)}else tl(Sl.bind(null,S))}var _n={map:X,forEach:function(S,U,F){X(S,function(){U.apply(this,arguments)},F)},count:function(S){var U=0;return X(S,function(){U++}),U},toArray:function(S){return X(S,function(U){return U})||[]},only:function(S){if(!it(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ut.Activity=y,ut.Children=_n,ut.Component=J,ut.Fragment=o,ut.Profiler=d,ut.PureComponent=B,ut.StrictMode=c,ut.Suspense=b,ut.ViewTransition=A,ut.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=et,ut.__COMPILER_RUNTIME={__proto__:null,c:function(S){return et.H.useMemoCache(S)}},ut.addTransitionType=Sl,ut.cache=function(S){return function(){return S.apply(null,arguments)}},ut.cacheSignal=function(){return null},ut.cloneElement=function(S,U,F){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var W=H({},S.props),yt=S.key;if(U!=null)for(bt in U.key!==void 0&&(yt=""+U.key),U)!Kt.call(U,bt)||bt==="key"||bt==="__self"||bt==="__source"||bt==="ref"&&U.ref===void 0||(W[bt]=U[bt]);var bt=arguments.length-2;if(bt===1)W.children=F;else if(1<bt){for(var St=Array(bt),K=0;K<bt;K++)St[K]=arguments[K+2];W.children=St}return P(S.type,yt,W)},ut.createContext=function(S){return S={$$typeof:p,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:m,_context:S},S},ut.createElement=function(S,U,F){var W,yt={},bt=null;if(U!=null)for(W in U.key!==void 0&&(bt=""+U.key),U)Kt.call(U,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(yt[W]=U[W]);var St=arguments.length-2;if(St===1)yt.children=F;else if(1<St){for(var K=Array(St),st=0;st<St;st++)K[st]=arguments[st+2];yt.children=K}if(S&&S.defaultProps)for(W in St=S.defaultProps,St)yt[W]===void 0&&(yt[W]=St[W]);return P(S,bt,yt)},ut.createRef=function(){return{current:null}},ut.forwardRef=function(S){return{$$typeof:g,render:S}},ut.isValidElement=it,ut.lazy=function(S){return{$$typeof:R,_payload:{_status:-1,_result:S},_init:wt}},ut.memo=function(S,U){return{$$typeof:v,type:S,compare:U===void 0?null:U}},ut.startTransition=tl,ut.unstable_useCacheRefresh=function(){return et.H.useCacheRefresh()},ut.use=function(S){return et.H.use(S)},ut.useActionState=function(S,U,F){return et.H.useActionState(S,U,F)},ut.useCallback=function(S,U){return et.H.useCallback(S,U)},ut.useContext=function(S){return et.H.useContext(S)},ut.useDebugValue=function(){},ut.useDeferredValue=function(S,U){return et.H.useDeferredValue(S,U)},ut.useEffect=function(S,U){return et.H.useEffect(S,U)},ut.useEffectEvent=function(S){return et.H.useEffectEvent(S)},ut.useId=function(){return et.H.useId()},ut.useImperativeHandle=function(S,U,F){return et.H.useImperativeHandle(S,U,F)},ut.useInsertionEffect=function(S,U){return et.H.useInsertionEffect(S,U)},ut.useLayoutEffect=function(S,U){return et.H.useLayoutEffect(S,U)},ut.useMemo=function(S,U){return et.H.useMemo(S,U)},ut.useOptimistic=function(S,U){return et.H.useOptimistic(S,U)},ut.useReducer=function(S,U,F){return et.H.useReducer(S,U,F)},ut.useRef=function(S){return et.H.useRef(S)},ut.useState=function(S){return et.H.useState(S)},ut.useSyncExternalStore=function(S,U,F){return et.H.useSyncExternalStore(S,U,F)},ut.useTransition=function(){return et.H.useTransition()},ut.version="19.3.0",ut}var d0;function _f(){return d0||(d0=1,Po.exports=e1()),Po.exports}var tf={exports:{}},he={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var h0;function l1(){if(h0)return he;h0=1;var i=_f();function r(R){var y="https://react.dev/errors/"+R;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var A=2;A<arguments.length;A++)y+="&args[]="+encodeURIComponent(arguments[A])}return"Minified React error #"+R+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var c={d:{f:o,r:function(){throw Error(r(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},d=Symbol.for("react.portal"),m=Symbol.for("react.recoverable"),p=Symbol.for("react.optimistic_key");function g(R,y,A){var L=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:L==null?null:L===p?p:""+L,children:R,containerInfo:y,implementation:A}}var b=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(R,y){if(R==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return he.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,he.browser=function(R){return{$$typeof:m,_reason:R}},he.createPortal=function(R,y){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(r(299));return g(R,y,null,A)},he.flushSync=function(R){var y=b.T,A=c.p;try{if(b.T=null,c.p=2,R)return R()}finally{b.T=y,c.p=A,c.d.f()}},he.preconnect=function(R,y){typeof R=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,c.d.C(R,y))},he.prefetchDNS=function(R){typeof R=="string"&&c.d.D(R)},he.preinit=function(R,y){if(typeof R=="string"&&y&&typeof y.as=="string"){var A=y.as,L=v(A,y.crossOrigin),Q=typeof y.integrity=="string"?y.integrity:void 0,at=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;A==="style"?c.d.S(R,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:L,integrity:Q,fetchPriority:at}):A==="script"&&c.d.X(R,{crossOrigin:L,integrity:Q,fetchPriority:at,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},he.preinitModule=function(R,y){if(typeof R=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var A=v(y.as,y.crossOrigin);c.d.M(R,{crossOrigin:A,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&c.d.M(R)},he.preload=function(R,y){if(typeof R=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var A=y.as,L=v(A,y.crossOrigin);c.d.L(R,A,{crossOrigin:L,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},he.preloadModule=function(R,y){if(typeof R=="string")if(y){var A=v(y.as,y.crossOrigin);c.d.m(R,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:A,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else c.d.m(R)},he.requestFormReset=function(R){c.d.r(R)},he.unstable_batchedUpdates=function(R,y){return R(y)},he.useFormState=function(R,y,A){return b.H.useFormState(R,y,A)},he.useFormStatus=function(){return b.H.useHostTransitionStatus()},he.version="19.3.0",he}var m0;function n1(){if(m0)return tf.exports;m0=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),tf.exports=l1(),tf.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var p0;function a1(){if(p0)return Ji;p0=1;var i=t1(),r=_f(),o=n1();function c(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)e+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function m(t){for(var e=t,l=e;l&&!l.alternate;)e=l,(e.flags&4098)!==0&&(t=e.return),l=e.return;for(;e.return;)e=e.return;return e.tag===3?t:null}function p(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function g(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function b(t){if(m(t)!==t)throw Error(c(188))}function v(t){var e=t.alternate;if(!e){if(e=m(t),e===null)throw Error(c(188));return e!==t?null:t}for(var l=t,n=e;;){var a=l.return;if(a===null)break;var s=a.alternate;if(s===null){if(n=a.return,n!==null){l=n;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===l)return b(a),t;if(s===n)return b(a),e;s=s.sibling}throw Error(c(188))}if(l.return!==n.return)l=a,n=s;else{for(var f=!1,h=a.child;h;){if(h===l){f=!0,l=a,n=s;break}if(h===n){f=!0,n=a,l=s;break}h=h.sibling}if(!f){for(h=s.child;h;){if(h===l){f=!0,l=s,n=a;break}if(h===n){f=!0,n=s,l=a;break}h=h.sibling}if(!f)throw Error(c(189))}}if(l.alternate!==n)throw Error(c(190))}if(l.tag!==3)throw Error(c(188));return l.stateNode.current===l?t:e}function R(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=R(t),e!==null)return e;t=t.sibling}return null}function y(t,e,l,n,a,s){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&l(t,n,a,s)||(t.tag!==22||t.memoizedState===null)&&(e||t.tag!==5&&t.tag!==27)&&y(t.child,e,l,n,a,s))return!0;t=t.sibling}return!1}function A(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function L(t){var e=!1;for(t=t.return;t!==null&&(t.tag===4&&(e=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return e}function Q(t){var e=[null,null],l=A(t);return l===null||at(e,t,l.child,{foundSelf:!1}),e}function at(t,e,l,n){for(;l!==null;){if(l===e)n.foundSelf=!0;else if(l.tag===5||l.tag===27||l.tag===6){if(n.foundSelf)return t[1]=l,!0;t[0]=l}else if((l.tag!==22||l.memoizedState===null)&&at(t,e,l.child,n))return!0;l=l.sibling}return!1}function H(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(c(559))}}var Y=null,J=null;function M(t,e,l){return t===l?!0:t===e?(Y=t,!0):!1}function B(t,e,l){return t===l?(J=t,!1):t===e?(J!==null&&(Y=t),!0):!1}function $(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function ot(t,e,l){for(var n=0,a=t;a;a=l(a))n++;a=0;for(var s=e;s;s=l(s))a++;for(;0<n-a;)t=l(t),n--;for(;0<a-n;)e=l(e),a--;for(;n--;){if(t===e||e!==null&&t===e.alternate)return t;t=l(t),e=l(e)}return null}var tt=Object.assign,et=Symbol.for("react.element"),Kt=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),xt=Symbol.for("react.fragment"),it=Symbol.for("react.strict_mode"),Jt=Symbol.for("react.profiler"),Gt=Symbol.for("react.consumer"),It=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),lt=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),wt=Symbol.for("react.memo"),Tt=Symbol.for("react.lazy"),tl=Symbol.for("react.activity"),Sl=Symbol.for("react.legacy_hidden"),_n=Symbol.for("react.memo_cache_sentinel"),S=Symbol.for("react.view_transition"),U=Symbol.for("react.recoverable"),F=Symbol.iterator;function W(t){return t===null||typeof t!="object"?null:(t=F&&t[F]||t["@@iterator"],typeof t=="function"?t:null)}var yt=Symbol.for("react.client.reference");function bt(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===yt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case xt:return"Fragment";case Jt:return"Profiler";case it:return"StrictMode";case lt:return"Suspense";case X:return"SuspenseList";case tl:return"Activity";case S:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case P:return"Portal";case It:return t.displayName||"Context";case Gt:return(t._context.displayName||"Context")+".Consumer";case V:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case wt:return e=t.displayName||null,e!==null?e:bt(t.type)||"Memo";case Tt:e=t._payload,t=t._init;try{return bt(t(e))}catch{}}return null}var St=Array.isArray,K=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,st=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_l={pending:!1,data:null,method:null,action:null},hr=[],Pn=-1;function rl(t){return{current:t}}function se(t){0>Pn||(t.current=hr[Pn],hr[Pn]=null,Pn--)}function Mt(t,e){Pn++,hr[Pn]=t.current,t.current=e}var cl=rl(null),ti=rl(null),$l=rl(null),hs=rl(null);function ms(t,e){switch(Mt($l,e),Mt(ti,t),Mt(cl,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?gp(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=gp(e),t=vp(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}se(cl),Mt(cl,t)}function ta(){se(cl),se(ti),se($l)}function mr(t){var e=t.memoizedState;e!==null&&($a._currentValue=e.memoizedState,Mt(hs,t)),e=cl.current;var l=vp(e,t.type);e!==l&&(Mt(ti,t),Mt(cl,l))}function ps(t){ti.current===t&&(se(cl),se(ti)),hs.current===t&&(se(hs),$a._currentValue=_l)}var pr,Hf;function Yl(t){if(pr===void 0)try{throw Error()}catch(l){var e=l.stack.trim().match(/\n( *(at )?)/);pr=e&&e[1]||"",Hf=-1<l.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+pr+t+Hf}var gr=!1;function vr(t,e){if(!t||gr)return"";gr=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(e){var D=function(){throw Error()};if(Object.defineProperty(D.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(D,[])}catch(q){var _=q}Reflect.construct(t,[],D)}else{try{D.call()}catch(q){_=q}D=!1;try{var O=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),D=!0,new t}finally{D&&(O!==void 0?Object.defineProperty(t.prototype,"props",O):delete t.prototype.props)}}}else{try{throw Error()}catch(q){_=q}(D=t())&&typeof D.catch=="function"&&D.catch(function(){})}}catch(q){if(q&&_&&typeof q.stack=="string")return[q.stack,_.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=n.DetermineComponentFrameRoot(),f=s[0],h=s[1];if(f&&h){var x=f.split(`
44
- `),T=h.split(`
45
- `);for(a=n=0;n<x.length&&!x[n].includes("DetermineComponentFrameRoot");)n++;for(;a<T.length&&!T[a].includes("DetermineComponentFrameRoot");)a++;if(n===x.length||a===T.length)for(n=x.length-1,a=T.length-1;1<=n&&0<=a&&x[n]!==T[a];)a--;for(;1<=n&&0<=a;n--,a--)if(x[n]!==T[a]){if(n!==1||a!==1)do if(n--,a--,0>a||x[n]!==T[a]){var C=`
46
- `+x[n].replace(" at new "," at ");return t.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",t.displayName)),C}while(1<=n&&0<=a);break}}}finally{gr=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Yl(l):""}function ev(t,e){switch(t.tag){case 26:case 27:case 5:return Yl(t.type);case 16:return Yl("Lazy");case 13:return t.child!==e&&e!==null?Yl("Suspense Fallback"):Yl("Suspense");case 19:return Yl("SuspenseList");case 0:case 15:return vr(t.type,!1);case 11:return vr(t.type.render,!1);case 1:return vr(t.type,!0);case 31:return Yl("Activity");case 30:return Yl("ViewTransition");default:return""}}function Lf(t){try{var e="",l=null;do e+=ev(t,l),l=t,t=t.return;while(t);return e}catch(n){return`
47
- Error generating stack: `+n.message+`
48
- `+n.stack}}var yr=Object.prototype.hasOwnProperty,xr=i.unstable_scheduleCallback,br=i.unstable_cancelCallback,lv=i.unstable_shouldYield,nv=i.unstable_requestPaint,we=i.unstable_now,av=i.unstable_getCurrentPriorityLevel,Bf=i.unstable_ImmediatePriority,qf=i.unstable_UserBlockingPriority,gs=i.unstable_NormalPriority,iv=i.unstable_LowPriority,$f=i.unstable_IdlePriority,sv=i.log,uv=i.unstable_setDisableYieldValue,ei=null,De=null;function Vl(t){if(typeof sv=="function"&&uv(t),De&&typeof De.setStrictMode=="function")try{De.setStrictMode(ei,t)}catch{}}var Me=Math.clz32?Math.clz32:ov,rv=Math.log,cv=Math.LN2;function ov(t){return t>>>=0,t===0?32:31-(rv(t)/cv|0)|0}var vs=256,ys=262144,xs=4194304;function En(t){var e=t&42;if(e!==0)return e;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&-t;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 bs(t,e,l){var n=t.pendingLanes;if(n===0)return 0;var a=0,s=t.suspendedLanes,f=t.pingedLanes;t=t.warmLanes;var h=n&134217727;return h!==0?(n=h&~s,n!==0?a=En(n):(f&=h,f!==0?a=En(f):l||(l=h&~t,l!==0&&(a=En(l))))):(h=n&~s,h!==0?a=En(h):f!==0?a=En(f):l||(l=n&~t,l!==0&&(a=En(l)))),a===0?0:e!==0&&e!==a&&(e&s)===0&&(s=a&-a,l=e&-e,s>=l||s===32&&(l&4194048)!==0)?e:a}function li(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Yf(t,e){(e&8)!==0&&(e|=e&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=e;0<l;){var n=31-Me(l),a=1<<n;e|=t[n],l&=~a}return e}function fv(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 Vf(){var t=xs;return xs<<=1,(xs&62914560)===0&&(xs=4194304),t}function jr(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function ni(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function dv(t,e,l,n,a,s){var f=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 h=t.entanglements,x=t.expirationTimes,T=t.hiddenUpdates;for(l=f&~l;0<l;){var C=31-Me(l),D=1<<C;h[C]=0,x[C]=-1;var _=T[C];if(_!==null)for(T[C]=null,C=0;C<_.length;C++){var O=_[C];O!==null&&(O.lane&=-536870913)}l&=~D}n!==0&&Gf(t,n,0),s!==0&&a===0&&t.tag!==0&&(t.suspendedLanes|=s&~(f&~e))}function Gf(t,e,l){t.pendingLanes|=e,t.suspendedLanes&=~e;var n=31-Me(e);t.entangledLanes|=e,t.entanglements[n]=t.entanglements[n]|1073741824|l&261930}function Qf(t,e){var l=t.entangledLanes|=e;for(t=t.entanglements;l;){var n=31-Me(l),a=1<<n;a&e|t[n]&e&&(t[n]|=e),l&=~a}}function Xf(t,e){var l=e&-e;return l=(l&42)!==0?1:Sr(l),(l&(t.suspendedLanes|e))!==0?0:l}function Sr(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 _r(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Zf(){var t=st.p;return t!==0?t:(t=window.event,t===void 0?32:t0(t.type))}function Kf(t,e){var l=st.p;try{return st.p=t,e()}finally{st.p=l}}var El=Math.random().toString(36).slice(2),ue="__reactFiber$"+El,Ee="__reactProps$"+El,ea="__reactContainer$"+El,Jf="__reactEvents$"+El,hv="__reactListeners$"+El,mv="__reactHandles$"+El,If="__reactResources$"+El,ai="__reactMarker$"+El,js="__reactLoad$"+El;function Ss(t){delete t[ue],delete t[Ee],delete t[hv],delete t[mv]}function Tn(t){var e;if(e=t[ue])return e;for(var l=t.parentNode;l;){if(e=l[ea]||l[ue]){if(l=e.alternate,e.child!==null||l!==null&&l.child!==null)for(t=Mp(t);t!==null;){if(l=t[ue])return l;t=Mp(t)}return e}t=l,l=t.parentNode}return null}function la(t){if(t=t[ue]||t[ea]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function ii(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(c(33))}function na(t){var e=t[If];return e||(e=t[If]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function le(t){t[ai]=!0}function Ff(t){t[js]=void 0}var Wf=new Set,Pf={};function Nn(t,e){aa(t,e),aa(t+"Capture",e)}function aa(t,e){for(Pf[t]=e,t=0;t<e.length;t++)Wf.add(e[t])}var pv=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]*$"),td={},ed={};function gv(t){return yr.call(ed,t)?!0:yr.call(td,t)?!1:pv.test(t)?ed[t]=!0:(td[t]=!0,!1)}var jt=!1;function ld(){var t=jt;return jt=!1,t}function _s(t,e,l){if(gv(e))if(l===null)t.removeAttribute(e);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var n=e.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,l)}}function Es(t,e,l){if(l===null)t.removeAttribute(e);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,l)}}function Tl(t,e,l,n){if(n===null)t.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(e,l,n)}}function ke(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function nd(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function vv(t,e,l){var n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return a.call(this)},set:function(f){l=""+f,s.call(this,f)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(f){l=""+f},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Er(t){if(!t._valueTracker){var e=nd(t)?"checked":"value";t._valueTracker=vv(t,e,""+t[e])}}function ad(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var l=e.getValue(),n="";return t&&(n=nd(t)?t.checked?"true":"false":t.value),t=n,t!==l?(e.setValue(t),!0):!1}var yv=/[\n"\\]/g;function Ve(t){return t.replace(yv,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Tr(t,e,l,n,a,s,f,h){t.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?t.type=f:t.removeAttribute("type"),e!=null?f==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ke(e)):t.value!==""+ke(e)&&(t.value=""+ke(e)):f!=="submit"&&f!=="reset"||t.removeAttribute("value"),e!=null?f==="number"&&t.value==e?Nr(t,ke(t.value)):Nr(t,ke(e)):l!=null?Nr(t,ke(l)):n!=null&&t.removeAttribute("value"),a==null&&s!=null&&(t.defaultChecked=!!s),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+ke(h):t.removeAttribute("name")}function id(t,e,l,n,a,s,f,h){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||l!=null){if(!(s!=="submit"&&s!=="reset"||e!=null)){Er(t);return}l=l!=null?""+ke(l):"",e=e!=null?""+ke(e):l,h||e===t.value||(t.value=e),t.defaultValue=e}n=n??a,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=h?t.checked:!!n,t.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.name=f),Er(t)}function Nr(t,e){t.defaultValue!==""+e&&(t.defaultValue=""+e)}function ia(t,e,l,n){if(t=t.options,e){e={};for(var a=0;a<l.length;a++)e["$"+l[a]]=!0;for(l=0;l<t.length;l++)a=e.hasOwnProperty("$"+t[l].value),t[l].selected!==a&&(t[l].selected=a),a&&n&&(t[l].defaultSelected=!0)}else{for(l=""+ke(l),e=null,a=0;a<t.length;a++){if(t[a].value===l){t[a].selected=!0,n&&(t[a].defaultSelected=!0);return}e!==null||t[a].disabled||(e=t[a])}e!==null&&(e.selected=!0)}}function sd(t,e,l){if(e!=null&&(e=""+ke(e),e!==t.value&&(t.value=e),l==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=l!=null?""+ke(l):""}function ud(t,e,l,n){if(e==null){if(n!=null){if(l!=null)throw Error(c(92));if(St(n)){if(1<n.length)throw Error(c(93));n=n[0]}l=n}l==null&&(l=""),e=l}l=ke(e),t.defaultValue=l,n=t.textContent,n===l&&n!==""&&n!==null&&(t.value=n),Er(t)}function sa(t,e){if(e){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=e;return}}t.textContent=e}var xv=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 rd(t,e,l){var n=e.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":n?t.setProperty(e,l):typeof l!="number"||l===0||xv.has(e)?e==="float"?t.cssFloat=l:t[e]=(""+l).trim():t[e]=l+"px"}function cd(t,e,l){if(e!=null&&typeof e!="object")throw Error(c(62));if(t=t.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||e!=null&&e.hasOwnProperty(n)||(n.indexOf("--")===0?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="",jt=!0);for(var a in e)n=e[a],e.hasOwnProperty(a)&&l[a]!==n&&(rd(t,a,n),jt=!0)}else for(var s in e)e.hasOwnProperty(s)&&rd(t,s,e[s])}function Rr(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 bv=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),jv=/^[\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 Ts(t){return jv.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ol(){}var zr=null;function Or(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ua=null,ra=null;function od(t){var e=la(t);if(e&&(t=e.stateNode)){var l=t[Ee]||null;t:switch(t=e.stateNode,e.type){case"input":if(Tr(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),e=l.name,l.type==="radio"&&e!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ve(""+e)+'"][type="radio"]'),e=0;e<l.length;e++){var n=l[e];if(n!==t&&n.form===t.form){var a=n[Ee]||null;if(!a)throw Error(c(90));Tr(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(e=0;e<l.length;e++)n=l[e],n.form===t.form&&ad(n)}break t;case"textarea":sd(t,l.value,l.defaultValue);break t;case"select":e=l.value,e!=null&&ia(t,!!l.multiple,e,!1)}}}var Cr=!1;function fd(t,e,l){if(Cr)return t(e,l);Cr=!0;try{var n=t(e);return n}finally{if(Cr=!1,(ua!==null||ra!==null)&&(Tu(),ua&&(e=ua,t=ra,ra=ua=null,od(e),t)))for(e=0;e<t.length;e++)od(t[e])}}function si(t,e){var l=t.stateNode;if(l===null)return null;var n=l[Ee]||null;if(n===null)return null;l=n[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break t;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(c(231,e,typeof l));return l}var Nl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ar=!1;if(Nl)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){Ar=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{Ar=!1}var Gl=null,wr=null,Ns=null;function dd(){if(Ns)return Ns;var t,e=wr,l=e.length,n,a="value"in Gl?Gl.value:Gl.textContent,s=a.length;for(t=0;t<l&&e[t]===a[t];t++);var f=l-t;for(n=1;n<=f&&e[l-n]===a[s-n];n++);return Ns=a.slice(t,1<n?1-n:void 0)}function Rs(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function zs(){return!0}function hd(){return!1}function ye(t){function e(l,n,a,s,f){this._reactName=l,this._targetInst=a,this.type=n,this.nativeEvent=s,this.target=f,this.currentTarget=null;for(var h in t)t.hasOwnProperty(h)&&(l=t[h],this[h]=l?l(s):s[h]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?zs:hd,this.isPropagationStopped=hd,this}return tt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=zs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=zs)},persist:function(){},isPersistent:zs}),e}var Ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Os=ye(Ql),ri=tt({},Ql,{view:0,detail:0}),Sv=ye(ri),Dr,Mr,ci,Cs=tt({},ri,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ur,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!==ci&&(ci&&t.type==="mousemove"?(Dr=t.screenX-ci.screenX,Mr=t.screenY-ci.screenY):Mr=Dr=0,ci=t),Dr)},movementY:function(t){return"movementY"in t?t.movementY:Mr}}),md=ye(Cs),_v=tt({},Cs,{dataTransfer:0}),Ev=ye(_v),Tv=tt({},ri,{relatedTarget:0}),kr=ye(Tv),Nv=tt({},Ql,{animationName:0,elapsedTime:0,pseudoElement:0}),Rv=ye(Nv),zv=tt({},Ql,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Ov=ye(zv),Cv=tt({},Ql,{data:0}),pd=ye(Cv),Av={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wv={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"},Dv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mv(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Dv[t])?!!e[t]:!1}function Ur(){return Mv}var kv=tt({},ri,{key:function(t){if(t.key){var e=Av[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Rs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?wv[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ur,charCode:function(t){return t.type==="keypress"?Rs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Rs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Uv=ye(kv),Hv=tt({},Cs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gd=ye(Hv),Lv=tt({},Ql,{submitter:0}),Bv=ye(Lv),qv=tt({},ri,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ur}),$v=ye(qv),Yv=tt({},Ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vv=ye(Yv),Gv=tt({},Cs,{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}),Qv=ye(Gv),Xv=tt({},Ql,{newState:0,oldState:0,source:0}),Zv=ye(Xv),Kv=[9,13,27,32],Hr=Nl&&"CompositionEvent"in window,oi=null;Nl&&"documentMode"in document&&(oi=document.documentMode);var Jv=Nl&&"TextEvent"in window&&!oi,vd=Nl&&(!Hr||oi&&8<oi&&11>=oi),yd=" ",xd=!1;function bd(t,e){switch(t){case"keyup":return Kv.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ca=!1;function Iv(t,e){switch(t){case"compositionend":return jd(e);case"keypress":return e.which!==32?null:(xd=!0,yd);case"textInput":return t=e.data,t===yd&&xd?null:t;default:return null}}function Fv(t,e){if(ca)return t==="compositionend"||!Hr&&bd(t,e)?(t=dd(),Ns=wr=Gl=null,ca=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return vd&&e.locale!=="ko"?null:e.data;default:return null}}var Wv={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 Sd(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Wv[t.type]:e==="textarea"}function _d(t,e,l,n){ua?ra?ra.push(n):ra=[n]:ua=n,e=Au(e,"onChange"),0<e.length&&(l=new Os("onChange","change",null,l,n),t.push({event:l,listeners:e}))}var fi=null,di=null;function Pv(t){op(t,0)}function As(t){var e=ii(t);if(ad(e))return t}function Ed(t,e){if(t==="change")return e}var Td=!1;if(Nl){var Lr;if(Nl){var Br="oninput"in document;if(!Br){var Nd=document.createElement("div");Nd.setAttribute("oninput","return;"),Br=typeof Nd.oninput=="function"}Lr=Br}else Lr=!1;Td=Lr&&(!document.documentMode||9<document.documentMode)}function Rd(){fi&&(fi.detachEvent("onpropertychange",zd),di=fi=null)}function zd(t){if(t.propertyName==="value"&&As(di)){var e=[];_d(e,di,t,Or(t)),fd(Pv,e)}}function ty(t,e,l){t==="focusin"?(Rd(),fi=e,di=l,fi.attachEvent("onpropertychange",zd)):t==="focusout"&&Rd()}function ey(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return As(di)}function ly(t,e){if(t==="click")return As(e)}function ny(t,e){if(t==="input"||t==="change")return As(e)}function ay(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ue=typeof Object.is=="function"?Object.is:ay;function hi(t,e){if(Ue(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var l=Object.keys(t),n=Object.keys(e);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var a=l[n];if(!yr.call(e,a)||!Ue(t[a],e[a]))return!1}return!0}function qr(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}}function Od(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Cd(t,e){var l=Od(t);t=0;for(var n;l;){if(l.nodeType===3){if(n=t+l.textContent.length,t<=e&&n>=e)return{node:l,offset:e-t};t=n}t:{for(;l;){if(l.nextSibling){l=l.nextSibling;break t}l=l.parentNode}l=void 0}l=Od(l)}}function Ad(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ad(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wd(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=qr(t.document);e instanceof t.HTMLIFrameElement;){try{var l=typeof e.contentWindow.location.href=="string"}catch{l=!1}if(l)t=e.contentWindow;else break;e=qr(t.document)}return e}function $r(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var iy=Nl&&"documentMode"in document&&11>=document.documentMode,oa=null,Yr=null,mi=null,Vr=!1;function Dd(t,e,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Vr||oa==null||oa!==qr(n)||(n=oa,"selectionStart"in n&&$r(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),mi&&hi(mi,n)||(mi=n,n=Au(Yr,"onSelect"),0<n.length&&(e=new Os("onSelect","select",null,e,l),t.push({event:e,listeners:n}),e.target=oa)))}function Rn(t,e){var l={};return l[t.toLowerCase()]=e.toLowerCase(),l["Webkit"+t]="webkit"+e,l["Moz"+t]="moz"+e,l}var fa={animationend:Rn("Animation","AnimationEnd"),animationiteration:Rn("Animation","AnimationIteration"),animationstart:Rn("Animation","AnimationStart"),transitionrun:Rn("Transition","TransitionRun"),transitionstart:Rn("Transition","TransitionStart"),transitioncancel:Rn("Transition","TransitionCancel"),transitionend:Rn("Transition","TransitionEnd")},Gr={},Md={};Nl&&(Md=document.createElement("div").style,"AnimationEvent"in window||(delete fa.animationend.animation,delete fa.animationiteration.animation,delete fa.animationstart.animation),"TransitionEvent"in window||delete fa.transitionend.transition);function zn(t){if(Gr[t])return Gr[t];if(!fa[t])return t;var e=fa[t],l;for(l in e)if(e.hasOwnProperty(l)&&l in Md)return Gr[t]=e[l];return t}var kd=zn("animationend"),Ud=zn("animationiteration"),Hd=zn("animationstart"),sy=zn("transitionrun"),uy=zn("transitionstart"),ry=zn("transitioncancel"),Ld=zn("transitionend"),Bd=new Map,Qr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Qr.push("scrollEnd");function el(t,e){Bd.set(t,e),Nn(e,[t])}var cy=0;function Rl(t,e){if(t.name!=null&&t.name!=="auto")return t.name;if(e.autoName!==null)return e.autoName;t=il.identifierPrefix;var l=cy++;return t="_"+t+"t_"+l.toString(32)+"_",e.autoName=t}function qd(t){if(t==null||typeof t=="string")return t;var e=null,l=Aa;if(l!==null)for(var n=0;n<l.length;n++){var a=t[l[n]];if(a!=null){if(a==="none")return"none";e=e==null?a:e+(" "+a)}}return e??t.default}function zl(t,e){return t=qd(t),e=qd(e),e==null?t==="auto"?null:t:e==="auto"?null:e}var ws=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=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(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Ge=[],da=0,Xr=0;function Ds(){for(var t=da,e=Xr=da=0;e<t;){var l=Ge[e];Ge[e++]=null;var n=Ge[e];Ge[e++]=null;var a=Ge[e];Ge[e++]=null;var s=Ge[e];if(Ge[e++]=null,n!==null&&a!==null){var f=n.pending;f===null?a.next=a:(a.next=f.next,f.next=a),n.pending=a}s!==0&&$d(l,a,s)}}function Ms(t,e,l,n){Ge[da++]=t,Ge[da++]=e,Ge[da++]=l,Ge[da++]=n,Xr|=n,t.lanes|=n,t=t.alternate,t!==null&&(t.lanes|=n)}function Zr(t,e,l,n){return Ms(t,e,l,n),ks(t)}function On(t,e){return Ms(t,null,null,e),ks(t)}function $d(t,e,l){t.lanes|=l;var n=t.alternate;n!==null&&(n.lanes|=l);for(var a=!1,s=t.return;s!==null;)s.childLanes|=l,n=s.alternate,n!==null&&(n.childLanes|=l),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(a=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,a&&e!==null&&(a=31-Me(l),t=s.hiddenUpdates,n=t[a],n===null?t[a]=[e]:n.push(e),e.lane=l|536870912),s):null}function ks(t){if(50<Ui)throw Ui=0,Eu=null,Error(c(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var ha={};function oy(t,e,l,n){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=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Te(t,e,l,n){return new oy(t,e,l,n)}function Kr(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ol(t,e){var l=t.alternate;return l===null?(l=Te(t.tag,e,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=e,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&1206910976,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,e=t.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Yd(t,e){t.flags&=1206910978;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=e,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,e=l.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Us(t,e,l,n,a,s){var f=0;if(n=t,typeof n=="function")Kr(n)&&(f=1);else if(typeof n=="string")f=Lx(t,l,cl.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(n){case tl:return t=Te(31,l,e,a),t.elementType=tl,t.lanes=s,t;case xt:return Cn(l.children,a,s,e);case it:f=8,a|=24;break;case Jt:return t=Te(12,l,e,a|2),t.elementType=Jt,t.lanes=s,t;case lt:return t=Te(13,l,e,a),t.elementType=lt,t.lanes=s,t;case X:return t=Te(19,l,e,a),t.elementType=X,t.lanes=s,t;case Sl:case S:return t=a|32,t=Te(30,l,e,t),t.elementType=S,t.lanes=s,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case It:f=10;break t;case Gt:f=9;break t;case V:f=11;break t;case wt:f=14;break t;case Tt:f=16,n=null;break t}f=29,l=Error(c(130,t===null?"null":typeof t,"")),n=null}return e=Te(f,l,e,a),e.elementType=t,e.type=n,e.lanes=s,e}function Cn(t,e,l,n){return t=Te(7,t,n,e),t.lanes=l,t}function Jr(t,e,l){return t=Te(6,t,null,e),t.lanes=l,t}function Vd(t){var e=Te(18,null,null,0);return e.stateNode=t,e}function Ir(t,e,l){return e=Te(4,t.children!==null?t.children:[],t.key,e),e.lanes=l,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var Gd=new WeakMap;function Qe(t,e){if(typeof t=="object"&&t!==null){var l=Gd.get(t);return l!==void 0?l:(e={value:t,source:e,stack:Lf(e)},Gd.set(t,e),e)}return{value:t,source:e,stack:Lf(e)}}var ma=[],pa=0,Hs=null,pi=0,Xe=[],Ze=0,Xl=null,fl=1,dl="";function Cl(t,e){ma[pa++]=pi,ma[pa++]=Hs,Hs=t,pi=e}function Qd(t,e,l){Xe[Ze++]=fl,Xe[Ze++]=dl,Xe[Ze++]=Xl,Xl=t;var n=fl;t=dl;var a=32-Me(n)-1;n&=~(1<<a),l+=1;var s=32-Me(e)+a;if(30<s){var f=a-a%5;s=(n&(1<<f)-1).toString(32),n>>=f,a-=f,fl=1<<32-Me(e)+a|l<<a|n,dl=s+t}else fl=1<<s|l<<a|n,dl=t}function Ls(t){t.return!==null&&(Cl(t,1),Qd(t,1,0))}function Fr(t){for(;t===Hs;)Hs=ma[--pa],ma[pa]=null,pi=ma[--pa],ma[pa]=null;for(;t===Xl;)Xl=Xe[--Ze],Xe[Ze]=null,dl=Xe[--Ze],Xe[Ze]=null,fl=Xe[--Ze],Xe[Ze]=null}function Xd(t,e){Xe[Ze++]=fl,Xe[Ze++]=dl,Xe[Ze++]=Xl,fl=e.id,dl=e.overflow,Xl=t}var ne=null,kt=null,ft=!1,Zl=null,Ke=!1,Wr=Error(c(519));function Kl(t){var e=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw gi(Qe(e,t)),Wr}function Zd(t){var e=t.stateNode,l=t.type,n=t.memoizedProps;switch(e[ue]=t,e[Ee]=n,l){case"dialog":ht("cancel",e),ht("close",e);break;case"iframe":case"object":case"embed":ht("load",e);break;case"video":case"audio":for(l=0;l<Li.length;l++)ht(Li[l],e);break;case"source":ht("error",e);break;case"img":case"image":case"link":ht("error",e),ht("load",e);break;case"details":ht("toggle",e);break;case"input":ht("invalid",e),id(e,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":ht("invalid",e);break;case"textarea":ht("invalid",e),ud(e,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||e.textContent===""+l||n.suppressHydrationWarning===!0||mp(e.textContent,l)?(n.popover!=null&&(ht("beforetoggle",e),ht("toggle",e)),n.onScroll!=null&&ht("scroll",e),n.onScrollEnd!=null&&ht("scrollend",e),n.onClick!=null&&(e.onclick=ol),e=!0):e=!1,e||Kl(t,!0)}function Bs(t){for(ne=t.return;ne;)switch(ne.tag){case 5:case 31:case 13:Ke=!1;return;case 27:case 3:Ke=!0;return;default:ne=ne.return}}function ga(t){if(t!==ne)return!1;if(!ft)return Bs(t),ft=!0,!1;var e=t.tag,l;if((l=e!==3&&e!==27)&&((l=e===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Oo(t.type,t.memoizedProps)),l=!l),l&&kt&&Kl(t),Bs(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(317));kt=Dp(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(317));kt=Dp(t)}else e===27?(e=kt,fn(t.type)?(t=Lo,Lo=null,kt=t):kt=e):kt=ne?Ie(t.stateNode.nextSibling):null;return!0}function An(){kt=ne=null,ft=!1}function Pr(){var t=Zl;return t!==null&&(ze===null?ze=t:ze.push.apply(ze,t),Zl=null),t}function gi(t){Zl===null?Zl=[t]:Zl.push(t)}var tc=rl(null),wn=null,Al=null;function Jl(t,e,l){Mt(tc,e._currentValue),e._currentValue=l}function wl(t){t._currentValue=tc.current,se(tc)}function qs(t,e,l){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===l)break;t=t.return}}function ec(t,e,l,n){var a=t.child;for(a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){var f=a.child;s=s.firstContext;t:for(;s!==null;){var h=s;s=a;for(var x=0;x<e.length;x++)if(h.context===e[x]){s.lanes|=l,h=s.alternate,h!==null&&(h.lanes|=l),qs(s.return,l,t),n||(f=null);break t}s=h.next}}else if(a.tag===18){if(f=a.return,f===null)throw Error(c(341));f.lanes|=l,s=f.alternate,s!==null&&(s.lanes|=l),qs(f,l,t),f=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=l,f=a.alternate,f!==null&&(f.lanes|=l),qs(a.return,l,t),f=a.child,f=f!==null?f.sibling:null):f=a.child;if(f!==null)f.return=a;else for(f=a;f!==null;){if(f===t){f=null;break}if(a=f.sibling,a!==null){a.return=f.return,f=a;break}f=f.return}a=f}}function Dn(t,e,l,n){t=null;for(var a=e,s=!1;a!==null;){if(!s){if((a.flags&524288)!==0)s=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var f=a.alternate;if(f===null)throw Error(c(387));if(f=f.memoizedProps,f!==null){var h=a.type;Ue(a.pendingProps.value,f.value)||(t!==null?t.push(h):t=[h])}}else if(a===hs.current){if(f=a.alternate,f===null)throw Error(c(387));f.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(t!==null?t.push($a):t=[$a])}a=a.return}return t!==null&&ec(e,t,l,n),e.flags|=262144,t!==null}function $s(t){for(t=t.firstContext;t!==null;){if(!Ue(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Mn(t){wn=t,Al=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function re(t){return Kd(wn,t)}function Ys(t,e){return wn===null&&Mn(t),Kd(t,e)}function Kd(t,e){var l=e._currentValue;if(e={context:e,memoizedValue:l,next:null},Al===null){if(t===null)throw Error(c(308));Al=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Al=Al.next=e;return l}var fy=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(l,n){t.push(n)}};this.abort=function(){e.aborted=!0,t.forEach(function(l){return l()})}},dy=i.unstable_scheduleCallback,hy=i.unstable_NormalPriority,Ft={$$typeof:It,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lc(){return{controller:new fy,data:new Map,refCount:0}}function vi(t){t.refCount--,t.refCount===0&&dy(hy,function(){t.controller.abort()})}function Jd(t,e){if((t.pendingLanes&4194048)!==0){var l=t.transitionTypes;for(l===null&&(l=t.transitionTypes=[]),t=0;t<e.length;t++){var n=e[t];l.indexOf(n)===-1&&l.push(n)}}}var yi=null;function my(t){var e=t.transitionTypes;return t.transitionTypes=null,e}var xi=null,nc=0,kn=0,va=null;function py(t,e){if(xi===null){var l=xi=[];nc=0,kn=bo(),va={status:"pending",value:void 0,then:function(n){l.push(n)}}}return nc++,e.then(Id,Id),e}function Id(){if(--nc===0&&(yi=null,xi!==null)){va!==null&&(va.status="fulfilled");var t=xi;xi=null,kn=0,va=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function gy(t,e){var l=[],n={status:"pending",value:null,reason:null,then:function(a){l.push(a)}};return t.then(function(){n.status="fulfilled",n.value=e;for(var a=0;a<l.length;a++)(0,l[a])(e)},function(a){for(n.status="rejected",n.reason=a,a=0;a<l.length;a++)(0,l[a])(void 0)}),n}var Fd=K.S;K.S=function(t,e){if(Vm=we(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&py(t,e),yi!==null)for(var l=ka;l!==null;)Jd(l,yi),l=l.next;if(l=t.types,l!==null){for(var n=ka;n!==null;)Jd(n,l),n=n.next;if(kn!==0){n=yi,n===null&&(n=yi=[]);for(var a=0;a<l.length;a++){var s=l[a];n.indexOf(s)===-1&&n.push(s)}}}Fd!==null&&Fd(t,e)};var Un=rl(null);function ac(){var t=Un.current;return t!==null?t:Dt.pooledCache}function Vs(t,e){e===null?Mt(Un,Un.current):Mt(Un,e.pool)}function Wd(){var t=ac();return t===null?null:{parent:Ft._currentValue,pool:t}}var ya=Error(c(460)),ic=Error(c(474)),Gs=Error(c(542)),Qs={then:function(){}};function Pd(t){return t=t.status,t==="fulfilled"||t==="rejected"}function th(t,e,l){switch(l=t[l],l===void 0?t.push(e):l!==e&&(e.then(ol,ol),e=l),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,lh(t),t===void 0&&!("reason"in e)?Error(c(600)):t;default:if(typeof e.status=="string")e.then(ol,ol);else{if(t=Dt,t!==null&&100<t.shellSuspendCounter)throw Error(c(482));t=e,t.status="pending",t.then(function(n){if(e.status==="pending"){var a=e;a.status="fulfilled",a.value=n}},function(n){if(e.status==="pending"){var a=e;a.status="rejected",a.reason=n}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,lh(t),t}throw Ln=e,ya}}function Hn(t){try{var e=t._init;return e(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ln=l,ya):l}}var Ln=null;function eh(){if(Ln===null)throw Error(c(459));var t=Ln;return Ln=null,t}function lh(t){if(t===ya||t===Gs)throw Error(c(483))}var xa=null,bi=0;function Xs(t){var e=bi;return bi+=1,xa===null&&(xa=[]),th(xa,t,e)}function Il(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Zs(t,e){throw e.$$typeof===et?Error(c(525)):(t=Object.prototype.toString.call(e),Error(c(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function nh(t){function e(E,j){if(t){var z=E.deletions;z===null?(E.deletions=[j],E.flags|=16):z.push(j)}}function l(E,j){if(!t)return null;for(;j!==null;)e(E,j),j=j.sibling;return null}function n(E){for(var j=new Map;E!==null;)E.key===null?j.set(E.index,E):j.set(E.key,E),E=E.sibling;return j}function a(E,j){return E=Ol(E,j),E.index=0,E.sibling=null,E}function s(E,j,z){return E.index=z,t?(z=E.alternate,z!==null?(z=z.index,z<j?(E.flags|=2,j):z):(E.flags|=134217730,j)):(E.flags|=1048576,j)}function f(E){return t&&E.alternate===null&&(E.flags|=134217730),E}function h(E,j,z,w){return j===null||j.tag!==6?(j=Jr(z,E.mode,w),j.return=E,j):(j=a(j,z),j.return=E,j)}function x(E,j,z,w){var G=z.type;return G===xt?(E=C(E,j,z.props.children,w,z.key),Il(E,z),E):j!==null&&(j.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Tt&&Hn(G)===j.type)?(j=a(j,z.props),Il(j,z),j.return=E,j):(j=Us(z.type,z.key,z.props,null,E.mode,w),Il(j,z),j.return=E,j)}function T(E,j,z,w){return j===null||j.tag!==4||j.stateNode.containerInfo!==z.containerInfo||j.stateNode.implementation!==z.implementation?(j=Ir(z,E.mode,w),j.return=E,j):(j=a(j,z.children||[]),j.return=E,j)}function C(E,j,z,w,G){return j===null||j.tag!==7?(j=Cn(z,E.mode,w,G),j.return=E,j):(j=a(j,z),j.return=E,j)}function D(E,j,z){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=Jr(""+j,E.mode,z),j.return=E,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Kt:return z=Us(j.type,j.key,j.props,null,E.mode,z),Il(z,j),z.return=E,z;case P:return j=Ir(j,E.mode,z),j.return=E,j;case Tt:return j=Hn(j),D(E,j,z)}if(St(j)||W(j))return j=Cn(j,E.mode,z,null),j.return=E,j;if(typeof j.then=="function")return D(E,Xs(j),z);if(j.$$typeof===It)return D(E,Ys(E,j),z);Zs(E,j)}return null}function _(E,j,z,w){var G=j!==null?j.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return G!==null?null:h(E,j,""+z,w);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case Kt:return z.key===G?x(E,j,z,w):null;case P:return z.key===G?T(E,j,z,w):null;case Tt:return z=Hn(z),_(E,j,z,w)}if(St(z)||W(z))return G!==null?null:C(E,j,z,w,null);if(typeof z.then=="function")return _(E,j,Xs(z),w);if(z.$$typeof===It)return _(E,j,Ys(E,z),w);Zs(E,z)}return null}function O(E,j,z,w,G){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return E=E.get(z)||null,h(j,E,""+w,G);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Kt:return E=E.get(w.key===null?z:w.key)||null,x(j,E,w,G);case P:return E=E.get(w.key===null?z:w.key)||null,T(j,E,w,G);case Tt:return w=Hn(w),O(E,j,z,w,G)}if(St(w)||W(w))return E=E.get(z)||null,C(j,E,w,G,null);if(typeof w.then=="function")return O(E,j,z,Xs(w),G);if(w.$$typeof===It)return O(E,j,z,Ys(j,w),G);Zs(j,w)}return null}function q(E,j,z,w){for(var G=null,pt=null,I=j,nt=j=0,te=null;I!==null&&nt<z.length;nt++){I.index>nt?(te=I,I=null):te=I.sibling;var vt=_(E,I,z[nt],w);if(vt===null){I===null&&(I=te);break}t&&I&&vt.alternate===null&&e(E,I),j=s(vt,j,nt),pt===null?G=vt:pt.sibling=vt,pt=vt,I=te}if(nt===z.length)return l(E,I),ft&&Cl(E,nt),G;if(I===null){for(;nt<z.length;nt++)I=D(E,z[nt],w),I!==null&&(j=s(I,j,nt),pt===null?G=I:pt.sibling=I,pt=I);return ft&&Cl(E,nt),G}for(I=n(I);nt<z.length;nt++)te=O(I,E,nt,z[nt],w),te!==null&&(t&&(vt=te.alternate,vt!==null&&I.delete(vt.key===null?nt:vt.key)),j=s(te,j,nt),pt===null?G=te:pt.sibling=te,pt=te);return t&&I.forEach(function(gn){return e(E,gn)}),ft&&Cl(E,nt),G}function Z(E,j,z,w){if(z==null)throw Error(c(151));for(var G=null,pt=null,I=j,nt=j=0,te=null,vt=z.next();I!==null&&!vt.done;nt++,vt=z.next()){I.index>nt?(te=I,I=null):te=I.sibling;var gn=_(E,I,vt.value,w);if(gn===null){I===null&&(I=te);break}t&&I&&gn.alternate===null&&e(E,I),j=s(gn,j,nt),pt===null?G=gn:pt.sibling=gn,pt=gn,I=te}if(vt.done)return l(E,I),ft&&Cl(E,nt),G;if(I===null){for(;!vt.done;nt++,vt=z.next())vt=D(E,vt.value,w),vt!==null&&(j=s(vt,j,nt),pt===null?G=vt:pt.sibling=vt,pt=vt);return ft&&Cl(E,nt),G}for(I=n(I);!vt.done;nt++,vt=z.next())vt=O(I,E,nt,vt.value,w),vt!==null&&(t&&(te=vt.alternate,te!==null&&I.delete(te.key===null?nt:te.key)),j=s(vt,j,nt),pt===null?G=vt:pt.sibling=vt,pt=vt);return t&&I.forEach(function(Ix){return e(E,Ix)}),ft&&Cl(E,nt),G}function ct(E,j,z,w){if(typeof z=="object"&&z!==null&&z.type===xt&&z.key===null&&z.props.ref===void 0&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case Kt:t:{for(var G=z.key;j!==null;){if(j.key===G){if(G=z.type,G===xt){if(j.tag===7){l(E,j.sibling),w=a(j,z.props.children),Il(w,z),w.return=E,E=w;break t}}else if(j.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Tt&&Hn(G)===j.type){l(E,j.sibling),w=a(j,z.props),Il(w,z),w.return=E,E=w;break t}l(E,j);break}else e(E,j);j=j.sibling}z.type===xt?(w=Cn(z.props.children,E.mode,w,z.key),Il(w,z),w.return=E,E=w):(w=Us(z.type,z.key,z.props,null,E.mode,w),Il(w,z),w.return=E,E=w)}return f(E);case P:t:{for(G=z.key;j!==null;){if(j.key===G)if(j.tag===4&&j.stateNode.containerInfo===z.containerInfo&&j.stateNode.implementation===z.implementation){l(E,j.sibling),w=a(j,z.children||[]),w.return=E,E=w;break t}else{l(E,j);break}else e(E,j);j=j.sibling}w=Ir(z,E.mode,w),w.return=E,E=w}return f(E);case Tt:return z=Hn(z),ct(E,j,z,w)}if(St(z))return q(E,j,z,w);if(W(z)){if(G=W(z),typeof G!="function")throw Error(c(150));return z=G.call(z),Z(E,j,z,w)}if(typeof z.then=="function")return ct(E,j,Xs(z),w);if(z.$$typeof===It)return ct(E,j,Ys(E,z),w);Zs(E,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,j!==null&&j.tag===6?(l(E,j.sibling),w=a(j,z),w.return=E,E=w):(l(E,j),w=Jr(z,E.mode,w),w.return=E,E=w),f(E)):l(E,j)}return function(E,j,z,w){try{bi=0;var G=ct(E,j,z,w);return xa=null,G}catch(I){if(I===ya||I===Gs)throw I;var pt=Te(29,I,null,E.mode);return pt.lanes=w,pt.return=E,pt}finally{}}}var Bn=nh(!0),ah=nh(!1),Fl=!1;function sc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uc(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Wl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Pl(t,e,l){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,(_t&2)!==0){var a=n.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),n.pending=e,e=ks(t),$d(t,null,l),e}return Ms(t,n,e,l),ks(t)}function ji(t,e,l){if(e=e.updateQueue,e!==null&&(e=e.shared,(l&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,l|=n,e.lanes=l,Qf(t,l)}}function rc(t,e){var l=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var a=null,s=null;if(l=l.firstBaseUpdate,l!==null){do{var f={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};s===null?a=s=f:s=s.next=f,l=l.next}while(l!==null);s===null?a=s=e:s=s.next=e}else a=s=e;l={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:n.shared,callbacks:n.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=e:t.next=e,l.lastBaseUpdate=e}var cc=!1;function Si(){if(cc){var t=va;if(t!==null)throw t}}function _i(t,e,l,n){cc=!1;var a=t.updateQueue;Fl=!1;var s=a.firstBaseUpdate,f=a.lastBaseUpdate,h=a.shared.pending;if(h!==null){a.shared.pending=null;var x=h,T=x.next;x.next=null,f===null?s=T:f.next=T,f=x;var C=t.alternate;C!==null&&(C=C.updateQueue,h=C.lastBaseUpdate,h!==f&&(h===null?C.firstBaseUpdate=T:h.next=T,C.lastBaseUpdate=x))}if(s!==null){var D=a.baseState;f=0,C=T=x=null,h=s;do{var _=h.lane&-536870913,O=_!==h.lane;if(O?(mt&_)===_:(n&_)===_){_!==0&&_===kn&&(cc=!0),C!==null&&(C=C.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var q=t,Z=h;_=e;var ct=l;switch(Z.tag){case 1:if(q=Z.payload,typeof q=="function"){D=q.call(ct,D,_);break t}D=q;break t;case 3:q.flags=q.flags&-65537|128;case 0:if(q=Z.payload,_=typeof q=="function"?q.call(ct,D,_):q,_==null)break t;D=tt({},D,_);break t;case 2:Fl=!0}}_=h.callback,_!==null&&(t.flags|=64,O&&(t.flags|=8192),O=a.callbacks,O===null?a.callbacks=[_]:O.push(_))}else O={lane:_,tag:h.tag,payload:h.payload,callback:h.callback,next:null},C===null?(T=C=O,x=D):C=C.next=O,f|=_;if(h=h.next,h===null){if(h=a.shared.pending,h===null)break;O=h,h=O.next,O.next=null,a.lastBaseUpdate=O,a.shared.pending=null}}while(!0);C===null&&(x=D),a.baseState=x,a.firstBaseUpdate=T,a.lastBaseUpdate=C,s===null&&(a.shared.lanes=0),un|=f,t.lanes=f,t.memoizedState=D}}function ih(t,e){if(typeof t!="function")throw Error(c(191,t));t.call(e)}function sh(t,e){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)ih(l[t],e)}var tn=rl(null),Ks=rl(0);function uh(t,e){t=Hl,Mt(Ks,t),Mt(tn,e),Hl=t|e.baseLanes}function oc(){Mt(Ks,Hl),Mt(tn,tn.current)}function fc(){Hl=Ks.current,se(tn),se(Ks)}var ce=rl(null),ge=null;function en(t){var e=t.alternate;Mt(oe,oe.current&1),Mt(ce,t),ge===null&&(e===null||tn.current!==null||e.memoizedState!==null)&&(ge=t)}function dc(t){Mt(oe,oe.current),Mt(ce,t),ge===null&&(ge=t)}function rh(t){t.tag===22?(Mt(oe,oe.current),Mt(ce,t),ge===null&&(ge=t)):ln()}function ln(){Mt(oe,oe.current),Mt(ce,ce.current)}function He(t){se(ce),ge===t&&(ge=null),se(oe)}var oe=rl(0);function Ei(t,e){Mt(ce,ce.current),Mt(oe,e)}function hc(t){se(oe),se(ce),ge===t&&(ge=null)}function Js(t){for(var e=t;e!==null;){if(e.tag===13){var l=e.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Uo(l)||Ho(l)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!=="independent"){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Dl=0,rt=null,At=null,Wt=null,Is=!1,ba=!1,qn=!1,Fs=0,Ti=0,ja=null,vy=0;function Qt(){throw Error(c(321))}function mc(t,e){if(e===null)return!1;for(var l=0;l<e.length&&l<t.length;l++)if(!Ue(t[l],e[l]))return!1;return!0}function pc(t,e,l,n,a,s){return Dl=s,rt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,K.H=t===null||t.memoizedState===null?Qh:Xh,qn=!1,s=l(n,a),qn=!1,ba&&(s=oh(e,l,n,a)),ch(t),s}function ch(t){K.H=au;var e=At!==null&&At.next!==null;if(Dl=0,Wt=At=rt=null,Is=!1,Ti=0,ja=null,e)throw Error(c(300));t===null||Pt||(t=t.dependencies,t!==null&&$s(t)&&(Pt=!0))}function oh(t,e,l,n){rt=t;var a=0;do{if(ba&&(ja=null),Ti=0,ba=!1,25<=a)throw Error(c(301));if(a+=1,Wt=At=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}K.H=Ty,s=e(l,n)}while(ba);return s}function yy(){var t=K.H,e=t.useState()[0];return e=typeof e.then=="function"?Ni(e):e,t=t.useState()[0],(At!==null?At.memoizedState:null)!==t&&(rt.flags|=1024),e}function gc(){var t=Fs!==0;return Fs=0,t}function vc(t,e,l){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~l}function yc(t){if(Is){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}Is=!1}Dl=0,Wt=At=rt=null,ba=!1,Ti=Fs=0,ja=null}function xe(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wt===null?rt.memoizedState=Wt=t:Wt=Wt.next=t,Wt}function Zt(){if(At===null){var t=rt.alternate;t=t!==null?t.memoizedState:null}else t=At.next;var e=Wt===null?rt.memoizedState:Wt.next;if(e!==null)Wt=e,At=t;else{if(t===null)throw rt.alternate===null?Error(c(467)):Error(c(310));At=t,t={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Wt===null?rt.memoizedState=Wt=t:Wt=Wt.next=t}return Wt}function Ws(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ni(t){var e=Ti;return Ti+=1,ja===null&&(ja=[]),t=th(ja,t,e),e=rt,(Wt===null?e.memoizedState:Wt.next)===null&&(e=e.alternate,K.H=e===null||e.memoizedState===null?Qh:Xh),t}function Ps(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ni(t);if(t.$$typeof===U)return;if(t.$$typeof===It)return re(t)}throw Error(c(438,String(t)))}function xc(t){var e=null,l=rt.updateQueue;if(l!==null&&(e=l.memoCache),e==null){var n=rt.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(e={data:n.data.map(function(a){return a.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),l===null&&(l=Ws(),rt.updateQueue=l),l.memoCache=e,l=e.data[e.index],l===void 0)for(l=e.data[e.index]=Array(t),n=0;n<t;n++)l[n]=_n;return e.index++,l}function Ml(t,e){return typeof e=="function"?e(t):e}function tu(t){var e=Zt();return bc(e,At,t)}function bc(t,e,l){var n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=l;var a=t.baseQueue,s=n.pending;if(s!==null){if(a!==null){var f=a.next;a.next=s.next,s.next=f}e.baseQueue=a=s,n.pending=null}if(s=t.baseState,a===null)t.memoizedState=s;else{e=a.next;var h=f=null,x=null,T=e,C=!1;do{var D=T.lane&-536870913;if(D!==T.lane?(mt&D)===D:(Dl&D)===D){var _=T.revertLane;if(_===0)x!==null&&(x=x.next={lane:0,revertLane:0,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),D===kn&&(C=!0);else if((Dl&_)===_){T=T.next,_===kn&&(C=!0);continue}else D={lane:0,revertLane:T.revertLane,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},x===null?(h=x=D,f=s):x=x.next=D,rt.lanes|=_,un|=_;D=T.action,qn&&l(s,D),s=T.hasEagerState?T.eagerState:l(s,D)}else _={lane:D,revertLane:T.revertLane,gesture:T.gesture,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},x===null?(h=x=_,f=s):x=x.next=_,rt.lanes|=D,un|=D;T=T.next}while(T!==null&&T!==e);if(x===null?f=s:x.next=h,!Ue(s,t.memoizedState)&&(Pt=!0,C&&(l=va,l!==null)))throw l;t.memoizedState=s,t.baseState=f,t.baseQueue=x,n.lastRenderedState=s}return a===null&&(n.lanes=0),[t.memoizedState,n.dispatch]}function jc(t){var e=Zt(),l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=t;var n=l.dispatch,a=l.pending,s=e.memoizedState;if(a!==null){l.pending=null;var f=a=a.next;do s=t(s,f.action),f=f.next;while(f!==a);Ue(s,e.memoizedState)||(Pt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),l.lastRenderedState=s}return[s,n]}function fh(t,e,l){var n=rt,a=Zt(),s=ft;if(s){if(l===void 0)throw Error(c(407));l=l()}else l=e();var f=!Ue((At||a).memoizedState,l);if(f&&(a.memoizedState=l,Pt=!0),a=a.queue,Ec(mh.bind(null,n,a,t),[t]),t=a.getSnapshot!==e||f||Wt!==null&&(Wt.memoizedState.tag&1)!==0,Sa(t?9:8,{destroy:void 0},hh.bind(null,n,a,l,e),null),t){if(n.flags|=2048,Dt===null)throw Error(c(349));s||(Dl&127)!==0||dh(n,e,l)}return l}function dh(t,e,l){t.flags|=16384,t={getSnapshot:e,value:l},e=rt.updateQueue,e===null?(e=Ws(),rt.updateQueue=e,e.stores=[t]):(l=e.stores,l===null?e.stores=[t]:l.push(t))}function hh(t,e,l,n){e.value=l,e.getSnapshot=n,ph(e)&&gh(t)}function mh(t,e,l){return l(function(){ph(e)&&gh(t)})}function ph(t){var e=t.getSnapshot;t=t.value;try{var l=e();return!Ue(t,l)}catch{return!0}}function gh(t){var e=On(t,2);e!==null&&Oe(e,t,2)}function Sc(t){var e=xe();if(typeof t=="function"){var l=t;if(t=l(),qn){Vl(!0);try{l()}finally{Vl(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:t},e}function vh(t,e,l,n){return t.baseState=l,bc(t,At,typeof n=="function"?n:Ml)}function xy(t,e,l,n,a){if(nu(t))throw Error(c(485));if(t=e.action,t!==null){var s={payload:a,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){s.listeners.push(f)}};K.T!==null?l(!0):s.isTransition=!1,n(s),l=e.pending,l===null?(s.next=e.pending=s,yh(e,s)):(s.next=l.next,e.pending=l.next=s)}}function yh(t,e){var l=e.action,n=e.payload,a=t.state;if(e.isTransition){var s=K.T,f={};f.types=s!==null?s.types:null,K.T=f;try{var h=l(a,n),x=K.S;x!==null&&x(f,h),xh(t,e,h)}catch(T){_c(t,e,T)}finally{s!==null&&f.types!==null&&(s.types=f.types),K.T=s}}else try{s=l(a,n),xh(t,e,s)}catch(T){_c(t,e,T)}}function xh(t,e,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){bh(t,e,n)},function(n){return _c(t,e,n)}):bh(t,e,l)}function bh(t,e,l){e.status="fulfilled",e.value=l,jh(e),t.state=l,e=t.pending,e!==null&&(l=e.next,l===e?t.pending=null:(l=l.next,e.next=l,yh(t,l)))}function _c(t,e,l){var n=t.pending;if(t.pending=null,n!==null){n=n.next;do e.status="rejected",e.reason=l,jh(e),e=e.next;while(e!==n)}t.action=null}function jh(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function Sh(t,e){return e}function _h(t,e){if(ft){var l=Dt.formState;if(l!==null){t:{var n=rt;if(ft){if(kt){e:{for(var a=kt,s=Ke;a.nodeType!==8;){if(!s){a=null;break e}if(a=Ie(a.nextSibling),a===null){a=null;break e}}s=a.data,a=s==="F!"||s==="F"?a:null}if(a){kt=Ie(a.nextSibling),n=a.data==="F!";break t}}Kl(n)}n=!1}n&&(e=l[0])}}return l=xe(),l.memoizedState=l.baseState=e,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sh,lastRenderedState:e},l.queue=n,l=Yh.bind(null,rt,n),n.dispatch=l,n=Sc(!1),s=Oc.bind(null,rt,!1,n.queue),n=xe(),a={state:e,dispatch:null,action:t,pending:null},n.queue=a,l=xy.bind(null,rt,a,s,l),a.dispatch=l,n.memoizedState=t,[e,l,!1]}function Eh(t){var e=Zt();return Th(e,At,t)}function Th(t,e,l){if(e=bc(t,e,Sh)[0],t=tu(Ml)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var n=Ni(e)}catch(f){throw f===ya?Gs:f}else n=e;e=Zt();var a=e.queue,s=a.dispatch;return l!==e.memoizedState&&(rt.flags|=2048,Sa(9,{destroy:void 0},by.bind(null,a,l),null)),[n,s,t]}function by(t,e){t.action=e}function Nh(t){var e=Zt(),l=At;if(l!==null)return Th(e,l,t);Zt(),e=e.memoizedState,l=Zt();var n=l.queue.dispatch;return l.memoizedState=t,[e,n,!1]}function Sa(t,e,l,n){return t={tag:t,create:l,deps:n,inst:e,next:null},e=rt.updateQueue,e===null&&(e=Ws(),rt.updateQueue=e),l=e.lastEffect,l===null?e.lastEffect=t.next=t:(n=l.next,l.next=t,t.next=n,e.lastEffect=t),t}function Rh(){return Zt().memoizedState}function eu(t,e,l,n){var a=xe();rt.flags|=t,a.memoizedState=Sa(1|e,{destroy:void 0},l,n===void 0?null:n)}function lu(t,e,l,n){var a=Zt();n=n===void 0?null:n;var s=a.memoizedState.inst;At!==null&&n!==null&&mc(n,At.memoizedState.deps)?a.memoizedState=Sa(e,s,l,n):(rt.flags|=t,a.memoizedState=Sa(1|e,s,l,n))}function zh(t,e){eu(8390656,8,t,e)}function Ec(t,e){lu(2048,8,t,e)}function jy(t){rt.flags|=4;var e=rt.updateQueue;if(e===null)e=Ws(),rt.updateQueue=e,e.events=[t];else{var l=e.events;l===null?e.events=[t]:l.push(t)}}function Oh(t){var e=Zt().memoizedState;return jy({ref:e,nextImpl:t}),function(){if((_t&2)!==0)throw Error(c(440));return e.impl.apply(void 0,arguments)}}function Ch(t,e){return lu(4,2,t,e)}function Ah(t,e){return lu(4,4,t,e)}function wh(t,e){if(typeof e=="function"){t=t();var l=e(t);return function(){typeof l=="function"?l():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Dh(t,e,l){l=l!=null?l.concat([t]):null,lu(4,4,wh.bind(null,e,t),l)}function Tc(){}function Mh(t,e){var l=Zt();e=e===void 0?null:e;var n=l.memoizedState;return e!==null&&mc(e,n[1])?n[0]:(l.memoizedState=[t,e],t)}function kh(t,e){var l=Zt();e=e===void 0?null:e;var n=l.memoizedState;if(e!==null&&mc(e,n[1]))return n[0];if(n=t(),qn){Vl(!0);try{t()}finally{Vl(!1)}}return l.memoizedState=[n,e],n}function Nc(t,e,l){return l===void 0||(Dl&1073741824)!==0&&(mt&261930)===0?t.memoizedState=e:(t.memoizedState=l,t=Qm(),rt.lanes|=t,un|=t,l)}function Uh(t,e,l,n){return Ue(l,e)?l:tn.current!==null?(t=Nc(t,l,n),Ue(t,e)||(Pt=!0),t):(Dl&106)===0||(Dl&1073741824)!==0&&(mt&261930)===0?(Pt=!0,t.memoizedState=l):(t=Qm(),rt.lanes|=t,un|=t,e)}function Hh(t,e,l,n,a){var s=st.p;st.p=s!==0&&8>s?s:8;var f=K.T,h={};h.types=f!==null?f.types:null,K.T=h,Oc(t,!1,e,l);try{var x=a(),T=K.S;if(T!==null&&T(h,x),x!==null&&typeof x=="object"&&typeof x.then=="function"){var C=gy(x,n);Ri(t,e,C,$e(t))}else Ri(t,e,n,$e(t))}catch(D){Ri(t,e,{then:function(){},status:"rejected",reason:D},$e())}finally{st.p=s,f!==null&&h.types!==null&&(f.types=h.types),K.T=f}}function Sy(){}function Rc(t,e,l,n){if(t.tag!==5)throw Error(c(476));var a=Lh(t).queue;Hh(t,a,e,_l,l===null?Sy:function(){return Bh(t),l(n)})}function Lh(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:_l,baseState:_l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:_l},next:null};var l={};return e.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:l},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Bh(t){var e=Lh(t);e.next===null&&(e=t.alternate.memoizedState),Ri(t,e.next.queue,{},$e())}function zc(){return re($a)}function qh(){return Zt().memoizedState}function $h(){return Zt().memoizedState}function _y(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var l=$e();t=Wl(l);var n=Pl(e,t,l);n!==null&&(Oe(n,e,l),ji(n,e,l)),e={cache:lc()},t.payload=e;return}e=e.return}}function Ey(t,e,l){var n=$e();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},nu(t)?Vh(e,l):(l=Zr(t,e,l,n),l!==null&&(Oe(l,t,n),Gh(l,e,n)))}function Yh(t,e,l){var n=$e();Ri(t,e,l,n)}function Ri(t,e,l,n){var a={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(nu(t))Vh(e,a);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var f=e.lastRenderedState,h=s(f,l);if(a.hasEagerState=!0,a.eagerState=h,Ue(h,f))return Ms(t,e,a,0),Dt===null&&Ds(),!1}catch{}finally{}if(l=Zr(t,e,a,n),l!==null)return Oe(l,t,n),Gh(l,e,n),!0}return!1}function Oc(t,e,l,n){if(n={lane:2,revertLane:bo(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},nu(t)){if(e)throw Error(c(479))}else e=Zr(t,l,n,2),e!==null&&Oe(e,t,2)}function nu(t){var e=t.alternate;return t===rt||e!==null&&e===rt}function Vh(t,e){ba=Is=!0;var l=t.pending;l===null?e.next=e:(e.next=l.next,l.next=e),t.pending=e}function Gh(t,e,l){if((l&4194048)!==0){var n=e.lanes;n&=t.pendingLanes,l|=n,e.lanes=l,Qf(t,l)}}var au={readContext:re,use:Ps,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt,useEffectEvent:Qt},Qh={readContext:re,use:Ps,useCallback:function(t,e){return xe().memoizedState=[t,e===void 0?null:e],t},useContext:re,useEffect:zh,useImperativeHandle:function(t,e,l){l=l!=null?l.concat([t]):null,eu(4194308,4,wh.bind(null,e,t),l)},useLayoutEffect:function(t,e){return eu(4194308,4,t,e)},useInsertionEffect:function(t,e){eu(4,2,t,e)},useMemo:function(t,e){var l=xe();e=e===void 0?null:e;var n=t();if(qn){Vl(!0);try{t()}finally{Vl(!1)}}return l.memoizedState=[n,e],n},useReducer:function(t,e,l){var n=xe();if(l!==void 0){var a=l(e);if(qn){Vl(!0);try{l(e)}finally{Vl(!1)}}}else a=e;return n.memoizedState=n.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},n.queue=t,t=t.dispatch=Ey.bind(null,rt,t),[n.memoizedState,t]},useRef:function(t){var e=xe();return t={current:t},e.memoizedState=t},useState:function(t){t=Sc(t);var e=t.queue,l=Yh.bind(null,rt,e);return e.dispatch=l,[t.memoizedState,l]},useDebugValue:Tc,useDeferredValue:function(t,e){var l=xe();return Nc(l,t,e)},useTransition:function(){var t=Sc(!1);return t=Hh.bind(null,rt,t.queue,!0,!1),xe().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,l){var n=rt,a=xe();if(ft){if(l===void 0)throw Error(c(407));l=l()}else{if(l=e(),Dt===null)throw Error(c(349));(mt&127)!==0||dh(n,e,l)}a.memoizedState=l;var s={value:l,getSnapshot:e};return a.queue=s,zh(mh.bind(null,n,s,t),[t]),n.flags|=2048,Sa(9,{destroy:void 0},hh.bind(null,n,s,l,e),null),l},useId:function(){var t=xe(),e=Dt.identifierPrefix;if(ft){var l=dl,n=fl;l=(n&~(1<<32-Me(n)-1)).toString(32)+l,e="_"+e+"R_"+l,l=Fs++,0<l&&(e+="H"+l.toString(32)),e+="_"}else l=vy++,e="_"+e+"r_"+l.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:zc,useFormState:_h,useActionState:_h,useOptimistic:function(t){var e=xe();e.memoizedState=e.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=l,e=Oc.bind(null,rt,!0,l),l.dispatch=e,[t,e]},useMemoCache:xc,useCacheRefresh:function(){return xe().memoizedState=_y.bind(null,rt)},useEffectEvent:function(t){var e=xe(),l={impl:t};return e.memoizedState=l,function(){if((_t&2)!==0)throw Error(c(440));return l.impl.apply(void 0,arguments)}}},Xh={readContext:re,use:Ps,useCallback:Mh,useContext:re,useEffect:Ec,useImperativeHandle:Dh,useInsertionEffect:Ch,useLayoutEffect:Ah,useMemo:kh,useReducer:tu,useRef:Rh,useState:function(){return tu(Ml)},useDebugValue:Tc,useDeferredValue:function(t,e){var l=Zt();return Uh(l,At.memoizedState,t,e)},useTransition:function(){var t=tu(Ml)[0],e=Zt().memoizedState;return[typeof t=="boolean"?t:Ni(t),e]},useSyncExternalStore:fh,useId:qh,useHostTransitionStatus:zc,useFormState:Eh,useActionState:Eh,useOptimistic:function(t,e){var l=Zt();return vh(l,At,t,e)},useMemoCache:xc,useCacheRefresh:$h,useEffectEvent:Oh},Ty={readContext:re,use:Ps,useCallback:Mh,useContext:re,useEffect:Ec,useImperativeHandle:Dh,useInsertionEffect:Ch,useLayoutEffect:Ah,useMemo:kh,useReducer:jc,useRef:Rh,useState:function(){return jc(Ml)},useDebugValue:Tc,useDeferredValue:function(t,e){var l=Zt();return At===null?Nc(l,t,e):Uh(l,At.memoizedState,t,e)},useTransition:function(){var t=jc(Ml)[0],e=Zt().memoizedState;return[typeof t=="boolean"?t:Ni(t),e]},useSyncExternalStore:fh,useId:qh,useHostTransitionStatus:zc,useFormState:Nh,useActionState:Nh,useOptimistic:function(t,e){var l=Zt();return At!==null?vh(l,At,t,e):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:xc,useCacheRefresh:$h,useEffectEvent:Oh};function Cc(t,e,l,n){e=t.memoizedState,l=l(n,e),l=l==null?e:tt({},e,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Ac={enqueueSetState:function(t,e,l){t=t._reactInternals;var n=$e(),a=Wl(n);a.payload=e,l!=null&&(a.callback=l),e=Pl(t,a,n),e!==null&&(Oe(e,t,n),ji(e,t,n))},enqueueReplaceState:function(t,e,l){t=t._reactInternals;var n=$e(),a=Wl(n);a.tag=1,a.payload=e,l!=null&&(a.callback=l),e=Pl(t,a,n),e!==null&&(Oe(e,t,n),ji(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var l=$e(),n=Wl(l);n.tag=2,e!=null&&(n.callback=e),e=Pl(t,n,l),e!==null&&(Oe(e,t,l),ji(e,t,l))}};function Zh(t,e,l,n,a,s,f){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,s,f):e.prototype&&e.prototype.isPureReactComponent?!hi(l,n)||!hi(a,s):!0}function Kh(t,e,l,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(l,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(l,n),e.state!==t&&Ac.enqueueReplaceState(e,e.state,null)}function $n(t,e){var l=e;if("ref"in e){l={};for(var n in e)n!=="ref"&&(l[n]=e[n])}if(t=t.defaultProps){l===e&&(l=tt({},l));for(var a in t)l[a]===void 0&&(l[a]=t[a])}return l}function Jh(t){ws(t)}function Ih(t){console.error(t)}function Fh(t){ws(t)}function iu(t,e){try{var l=t.onUncaughtError;l(e.value,{componentStack:e.stack})}catch(n){setTimeout(function(){throw n})}}function Wh(t,e,l){try{var n=t.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function wc(t,e,l){return l=Wl(l),l.tag=3,l.payload={element:null},l.callback=function(){iu(t,e)},l}function Ph(t){return t=Wl(t),t.tag=3,t}function tm(t,e,l,n){var a=l.type.getDerivedStateFromError;if(typeof a=="function"){var s=n.value;t.payload=function(){return a(s)},t.callback=function(){Wh(e,l,n)}}var f=l.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(t.callback=function(){Wh(e,l,n),typeof a!="function"&&(rn===null?rn=new Set([this]):rn.add(this));var h=n.stack;this.componentDidCatch(n.value,{componentStack:h!==null?h:""})})}function Ny(t,e,l,n,a){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(e=l.alternate,e!==null&&Dn(e,l,a,!0),l=ce.current,l!==null){switch(l.tag){case 31:case 13:case 19:return ge===null?Nu():l.alternate===null&&Xt===0&&(Xt=3),l.flags&=-257,l.flags|=65536,l.lanes=a,n===Qs?l.flags|=16384:(e=l.updateQueue,e===null?l.updateQueue=new Set([n]):e.add(n),vo(t,n,a)),!1;case 22:return l.flags|=65536,n===Qs?l.flags|=16384:(e=l.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=e):(l=e.retryQueue,l===null?e.retryQueue=new Set([n]):l.add(n)),vo(t,n,a)),!1}throw Error(c(435,l.tag))}return vo(t,n,a),Nu(),!1}if(ft)return e=ce.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=a,n!==Wr&&(t=Error(c(422),{cause:n}),gi(Qe(t,l)))):(n!==Wr&&(e=Error(c(423),{cause:n}),gi(Qe(e,l))),t=t.current.alternate,t.flags|=65536,a&=-a,t.lanes|=a,n=Qe(n,l),a=wc(t.stateNode,n,a),rc(t,a),Xt!==4&&(Xt=2)),!1;var s=Error(c(520),{cause:n});if(s=Qe(s,l),ki===null?ki=[s]:ki.push(s),Xt!==4&&(Xt=2),e===null)return!0;n=Qe(n,l),l=e;do{switch(l.tag){case 3:return l.flags|=65536,t=a&-a,l.lanes|=t,t=wc(l.stateNode,n,t),rc(l,t),!1;case 1:if(e=l.type,s=l.stateNode,(l.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(rn===null||!rn.has(s))))return l.flags|=65536,a&=-a,l.lanes|=a,a=Ph(a),tm(a,t,l,n),rc(l,a),!1;break;case 22:if(l.memoizedState!==null)return l.flags|=65536,!1}l=l.return}while(l!==null);return!1}var Dc=Error(c(461)),Pt=!1;function ee(t,e,l,n){e.child=t===null?ah(e,null,l,n):Bn(e,t.child,l,n)}function em(t,e,l,n,a){l=l.render;var s=e.ref;if("ref"in n){var f={};for(var h in n)h!=="ref"&&(f[h]=n[h])}else f=n;return Mn(e),n=pc(t,e,l,f,s,a),h=gc(),t!==null&&!Pt?(vc(t,e,a),kl(t,e,a)):(ft&&h&&Ls(e),e.flags|=1,ee(t,e,n,a),e.child)}function lm(t,e,l,n,a){if(t===null){var s=l.type;return typeof s=="function"&&!Kr(s)&&s.defaultProps===void 0&&l.compare===null?(e.tag=15,e.type=s,nm(t,e,s,n,a)):(t=Us(l.type,null,n,e,e.mode,a),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!$c(t,a)){var f=s.memoizedProps;if(l=l.compare,l=l!==null?l:hi,l(f,n)&&t.ref===e.ref)return kl(t,e,a)}return e.flags|=1,t=Ol(s,n),t.ref=e.ref,t.return=e,e.child=t}function nm(t,e,l,n,a){if(t!==null){var s=t.memoizedProps;if(hi(s,n)&&t.ref===e.ref)if(Pt=!1,e.pendingProps=n=s,$c(t,a))(t.flags&131072)!==0&&(Pt=!0);else return e.lanes=t.lanes,kl(t,e,a)}return Mc(t,e,l,n,a)}function am(t,e,l,n){var a=n.children,s=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((e.flags&128)!==0){if(s=s!==null?s.baseLanes|l:l,t!==null){for(n=e.child=t.child,a=0;n!==null;)a=a|n.lanes|n.childLanes,n=n.sibling;n=a&~s}else n=0,e.child=null;return im(t,e,s,l,n)}if((l&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Vs(e,s!==null?s.cachePool:null),s!==null?uh(e,s):oc(),rh(e);else return n=e.lanes=536870912,im(t,e,s!==null?s.baseLanes|l:l,l,n)}else s!==null?(Vs(e,s.cachePool),uh(e,s),ln(),e.memoizedState=null):(t!==null&&Vs(e,null),oc(),ln());return ee(t,e,a,l),e.child}function zi(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function im(t,e,l,n,a){var s=ac();return s=s===null?null:{parent:Ft._currentValue,pool:s},e.memoizedState={baseLanes:l,cachePool:s},t!==null&&Vs(e,null),oc(),rh(e),t!==null&&Dn(t,e,n,!0),e.childLanes=a,null}function su(t,e){return e=uu({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function sm(t,e,l){return Bn(e,t.child,null,l),t=su(e,e.pendingProps),t.flags|=2,He(e),e.memoizedState=null,t}function Ry(t,e,l){var n=e.pendingProps,a=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(ft){if(n.mode==="hidden")return t=su(e,n),e.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},zi(null,t);if(dc(e),(t=kt)?(t=wp(t,Ke),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Xl!==null?{id:fl,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},l=Vd(t),l.return=e,e.child=l,ne=e,kt=null)):t=null,t===null)throw Kl(e);return e.lanes=536870912,null}return su(e,n)}var s=t.memoizedState;if(s!==null){var f=s.dehydrated;if(dc(e),a)if(e.flags&256)e.flags&=-257,e=sm(t,e,l);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(c(558));else if(Pt||Dn(t,e,l,!1),a=(l&t.childLanes)!==0,Pt||a){if(tn.current===null){if(n=Dt,n!==null&&(f=Xf(n,l),f!==0&&f!==s.retryLane))throw s.retryLane=f,On(t,f),Oe(n,t,f),Dc;Nu()}e=sm(t,e,l)}else t=s.treeContext,kt=Ie(f.nextSibling),ne=e,ft=!0,Zl=null,Ke=!1,t!==null&&Xd(e,t),e=su(e,n),e.flags|=134221824;return e}return t=Ol(t.child,{mode:n.mode,children:n.children}),t.ref=e.ref,e.child=t,t.return=e,t}function _a(t,e){var l=e.ref;if(l===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(c(284));(t===null||t.ref!==l)&&(e.flags|=4194816)}}function Mc(t,e,l,n,a){return Mn(e),l=pc(t,e,l,n,void 0,a),n=gc(),t!==null&&!Pt?(vc(t,e,a),kl(t,e,a)):(ft&&n&&Ls(e),e.flags|=1,ee(t,e,l,a),e.child)}function um(t,e,l,n,a,s){return Mn(e),e.updateQueue=null,l=oh(e,n,l,a),ch(t),n=gc(),t!==null&&!Pt?(vc(t,e,s),kl(t,e,s)):(ft&&n&&Ls(e),e.flags|=1,ee(t,e,l,s),e.child)}function rm(t,e,l,n,a){if(Mn(e),e.stateNode===null){var s=ha,f=l.contextType;typeof f=="object"&&f!==null&&(s=re(f)),s=new l(n,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Ac,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=n,s.state=e.memoizedState,s.refs={},sc(e),f=l.contextType,s.context=typeof f=="object"&&f!==null?re(f):ha,s.state=e.memoizedState,f=l.getDerivedStateFromProps,typeof f=="function"&&(Cc(e,l,f,n),s.state=e.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(f=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),f!==s.state&&Ac.enqueueReplaceState(s,s.state,null),_i(e,n,s,a),Si(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!0}else if(t===null){s=e.stateNode;var h=e.memoizedProps,x=$n(l,h);s.props=x;var T=s.context,C=l.contextType;f=ha,typeof C=="object"&&C!==null&&(f=re(C));var D=l.getDerivedStateFromProps;C=typeof D=="function"||typeof s.getSnapshotBeforeUpdate=="function",h=e.pendingProps!==h,C||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(h||T!==f)&&Kh(e,s,n,f),Fl=!1;var _=e.memoizedState;s.state=_,_i(e,n,s,a),Si(),T=e.memoizedState,h||_!==T||Fl?(typeof D=="function"&&(Cc(e,l,D,n),T=e.memoizedState),(x=Fl||Zh(e,l,x,n,_,T,f))?(C||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=T),s.props=n,s.state=T,s.context=f,n=x):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{s=e.stateNode,uc(t,e),f=e.memoizedProps,C=$n(l,f),s.props=C,D=e.pendingProps,_=s.context,T=l.contextType,x=ha,typeof T=="object"&&T!==null&&(x=re(T)),h=l.getDerivedStateFromProps,(T=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(f!==D||_!==x)&&Kh(e,s,n,x),Fl=!1,_=e.memoizedState,s.state=_,_i(e,n,s,a),Si();var O=e.memoizedState;f!==D||_!==O||Fl||t!==null&&t.dependencies!==null&&$s(t.dependencies)?(typeof h=="function"&&(Cc(e,l,h,n),O=e.memoizedState),(C=Fl||Zh(e,l,C,n,_,O,x)||t!==null&&t.dependencies!==null&&$s(t.dependencies))?(T||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,O,x),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,O,x)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||f===t.memoizedProps&&_===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||f===t.memoizedProps&&_===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=O),s.props=n,s.state=O,s.context=x,n=C):(typeof s.componentDidUpdate!="function"||f===t.memoizedProps&&_===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||f===t.memoizedProps&&_===t.memoizedState||(e.flags|=1024),n=!1)}return s=n,_a(t,e),n=(e.flags&128)!==0,s||n?(s=e.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&n?(e.child=Bn(e,t.child,null,a),e.child=Bn(e,null,l,a)):ee(t,e,l,a),e.memoizedState=s.state,t=e.child):t=kl(t,e,a),t}function cm(t,e,l,n){return An(),e.flags|=256,ee(t,e,l,n),e.child}var kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uc(t){return{baseLanes:t,cachePool:Wd()}}function Hc(t,e,l){return t=t!==null?t.childLanes&~l:0,e&&(t|=qe),t}function om(t,e,l){var n=e.pendingProps,a=!1,s=(e.flags&128)!==0,f;if((f=s)||(f=t!==null&&t.memoizedState===null?!1:(oe.current&2)!==0),f&&(a=!0,e.flags&=-129),f=(e.flags&32)!==0,e.flags&=-33,t===null){if(ft){if(a?en(e):ln(),(t=kt)?(t=wp(t,Ke),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Xl!==null?{id:fl,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},l=Vd(t),l.return=e,e.child=l,ne=e,kt=null)):t=null,t===null)throw Kl(e);return Ho(t)?e.lanes=32:e.lanes=536870912,null}return s=n.children,n=n.fallback,a?(ln(),a=e.mode,s=uu({mode:"hidden",children:s},a),n=Cn(n,a,l,null),s.return=e,n.return=e,s.sibling=n,e.child=s,n=e.child,n.memoizedState=Uc(l),n.childLanes=Hc(t,f,l),e.memoizedState=kc,zi(null,n)):(en(e),Lc(e,s))}var h=t.memoizedState;if(h!==null){var x=h.dehydrated;if(x!==null)return zy(t,e,s,f,n,x,h,l)}return a?(ln(),a=n.fallback,s=e.mode,h=t.child,x=h.sibling,n=Ol(h,{mode:"hidden",children:n.children}),n.subtreeFlags=h.subtreeFlags&1206910976,x!==null?a=Ol(x,a):(a=Cn(a,s,l,null),a.flags|=2),a.return=e,n.return=e,n.sibling=a,e.child=n,zi(null,n),n=e.child,a=t.child.memoizedState,a===null?a=Uc(l):(s=a.cachePool,s!==null?(h=Ft._currentValue,s=s.parent!==h?{parent:h,pool:h}:s):s=Wd(),a={baseLanes:a.baseLanes|l,cachePool:s}),n.memoizedState=a,n.childLanes=Hc(t,f,l),e.memoizedState=kc,zi(t.child,n)):(en(e),l=t.child,t=l.sibling,l=Ol(l,{mode:"visible",children:n.children}),l.return=e,l.sibling=null,t!==null&&(f=e.deletions,f===null?(e.deletions=[t],e.flags|=16):f.push(t)),e.child=l,e.memoizedState=null,l)}function Lc(t,e){return e=uu({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function uu(t,e){return t=Te(22,t,null,e),t.lanes=0,t}function ru(t,e,l){return Bn(e,t.child,null,l),t=Lc(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function zy(t,e,l,n,a,s,f,h){if(l)return e.flags&256?(en(e),e.flags&=-257,ru(t,e,h)):e.memoizedState!==null?(ln(),e.child=t.child,e.flags|=128,null):(ln(),s=a.fallback,f=e.mode,a=uu({mode:"visible",children:a.children},f),s=Cn(s,f,h,null),s.flags|=2,a.return=e,s.return=e,a.sibling=s,e.child=a,Bn(e,t.child,null,h),a=e.child,a.memoizedState=Uc(h),a.childLanes=Hc(t,n,h),e.memoizedState=kc,zi(null,a));if(en(e),Ho(s)){if(n=s.nextSibling&&s.nextSibling.dataset,n)var x=n.dgst;return n=x,n!==""&&(a=Error(c(419)),a.stack="",a.digest=n,gi({value:a,source:null,stack:null})),ru(t,e,h)}if(Pt||Dn(t,e,h,!1),n=(h&t.childLanes)!==0,Pt||n){if(tn.current!==null)return ru(t,e,h);if(n=Dt,n!==null&&(a=Xf(n,h),a!==0&&a!==f.retryLane))throw f.retryLane=a,On(t,a),Oe(n,t,a),Dc;return Uo(s)||Nu(),ru(t,e,h)}return Uo(s)?(e.flags|=192,e.child=t.child,null):(t=f.treeContext,kt=Ie(s.nextSibling),ne=e,ft=!0,Zl=null,Ke=!1,t!==null&&Xd(e,t),e=Lc(e,a.children),e.flags|=134221824,e)}function fm(t,e,l){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),qs(t.return,e,l)}function dm(t){for(var e=null;t!==null;){var l=t.alternate;l!==null&&Js(l)===null&&(e=t),t=t.sibling}return e}function cu(t,e,l,n,a,s){var f=t.memoizedState;f===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:a,treeForkCount:s}:(f.isBackwards=e,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=l,f.tailMode=a,f.treeForkCount=s)}function Bc(t){var e=t.child;for(t.child=null;e!==null;){var l=e.sibling;e.sibling=t.child,t.child=e,e=l}}function qc(t,e,l){var n=e.pendingProps,a=n.revealOrder,s=n.tail;n=n.children;var f=oe.current;if(e.flags&128)return Ei(e,f),null;var h=(f&2)!==0;if(h?(f=f&1|2,e.flags|=128):f&=1,Ei(e,f),a==="backwards"&&t!==null?(Bc(t),ee(t,e,n,l),Bc(t)):ee(t,e,n,l),n=ft?pi:0,!h&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&fm(t,l,e);else if(t.tag===19)fm(t,l,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(a){case"backwards":l=dm(e.child),l===null?(a=e.child,e.child=null):(a=l.sibling,l.sibling=null,Bc(e)),cu(e,!0,a,null,s,n);break;case"unstable_legacy-backwards":for(l=null,a=e.child,e.child=null;a!==null;){if(t=a.alternate,t!==null&&Js(t)===null){e.child=a;break}t=a.sibling,a.sibling=l,l=a,a=t}cu(e,!0,l,null,s,n);break;case"together":cu(e,!1,null,null,void 0,n);break;case"independent":e.memoizedState=null;break;default:l=dm(e.child),l===null?(a=e.child,e.child=null):(a=l.sibling,l.sibling=null),cu(e,!1,a,l,s,n)}return e.child}function hm(t,e,l){var n=e.pendingProps;return Jl(e,e.type,n.value),ee(t,e,n.children,l),e.child}function kl(t,e,l){if(t!==null&&(e.dependencies=t.dependencies),un|=e.lanes,(l&e.childLanes)===0)if(t!==null){if(Dn(t,e,l,!1),(l&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(c(153));if(e.child!==null){for(t=e.child,l=Ol(t,t.pendingProps),e.child=l,l.return=e;t.sibling!==null;)t=t.sibling,l=l.sibling=Ol(t,t.pendingProps),l.return=e;l.sibling=null}return e.child}function $c(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&$s(t)))}function Oy(t,e,l){switch(e.tag){case 3:ms(e,e.stateNode.containerInfo),Jl(e,Ft,t.memoizedState.cache),An();break;case 27:case 5:mr(e);break;case 4:ms(e,e.stateNode.containerInfo);break;case 10:Jl(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,dc(e),null;break;case 13:var n=e.memoizedState;if(n!==null){if(n.dehydrated!==null)return en(e),e.flags|=128,null;n=Dn(t,e,l,!1);var a=e.child.childLanes;return n||(l&a)!==0?om(t,e,l):(en(e),t=kl(t,e,l),t!==null?t.sibling:null)}en(e);break;case 19:if(e.flags&128)return qc(t,e,l);if(a=(t.flags&128)!==0,n=(l&e.childLanes)!==0,n||(Dn(t,e,l,!1),n=(l&e.childLanes)!==0),a){if(n)return qc(t,e,l);e.flags|=128}if(a=e.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ei(e,oe.current),n)break;return null;case 22:return e.lanes=0,am(t,e,l,e.pendingProps);case 24:Jl(e,Ft,t.memoizedState.cache)}return kl(t,e,l)}function mm(t,e,l){if(t!==null)if(t.memoizedProps!==e.pendingProps)Pt=!0;else{if(!$c(t,l)&&(e.flags&128)===0)return Pt=!1,Oy(t,e,l);Pt=(t.flags&131072)!==0}else Pt=!1,ft&&(e.flags&1048576)!==0&&Qd(e,pi,e.index);switch(e.lanes=0,e.tag){case 16:t:{var n=e.pendingProps;if(t=Hn(e.elementType),e.type=t,typeof t=="function")Kr(t)?(n=$n(t,n),e.tag=1,e=rm(null,e,t,n,l)):(e.tag=0,e=Mc(null,e,t,n,l));else{if(t!=null){var a=t.$$typeof;if(a===V){e.tag=11,e=em(null,e,t,n,l);break t}else if(a===wt){e.tag=14,e=lm(null,e,t,n,l);break t}else if(a===It){e.tag=10,e.type=t,e=hm(null,e,l);break t}}throw e=bt(t)||t,Error(c(306,e,""))}}return e;case 0:return Mc(t,e,e.type,e.pendingProps,l);case 1:return n=e.type,a=$n(n,e.pendingProps),rm(t,e,n,a,l);case 3:t:{if(ms(e,e.stateNode.containerInfo),t===null)throw Error(c(387));n=e.pendingProps;var s=e.memoizedState;a=s.element,uc(t,e),_i(e,n,null,l);var f=e.memoizedState;if(n=f.cache,Jl(e,Ft,n),n!==s.cache&&ec(e,[Ft],l,!0),Si(),n=f.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:f.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=cm(t,e,n,l);break t}else if(n!==a){a=Qe(Error(c(424)),e),gi(a),e=cm(t,e,n,l);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(kt=Ie(t.firstChild),ne=e,ft=!0,Zl=null,Ke=!0,l=ah(e,null,n,l),e.child=l;l;)l.flags=l.flags&-3|134221824,l=l.sibling}else{if(An(),n===a){e=kl(t,e,l);break t}ee(t,e,n,l)}e=e.child}return e;case 26:return _a(t,e),t===null?(l=Bp(e.type,null,e.pendingProps,null))?e.memoizedState=l:ft||(e.stateNode=yp(e.type,e.pendingProps,$l.current,e)):e.memoizedState=Bp(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return mr(e),t===null&&ft&&(n=e.stateNode=kp(e.type,e.pendingProps,$l.current),ne=e,Ke=!0,a=kt,fn(e.type)?(Lo=a,kt=Ie(n.firstChild)):kt=a),ee(t,e,e.pendingProps.children,l),_a(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&ft&&((a=n=kt)&&(n=_x(n,e.type,e.pendingProps,Ke),n!==null?(e.stateNode=n,ne=e,kt=Ie(n.firstChild),Ke=!1,a=!0):a=!1),a||Kl(e)),mr(e),a=e.type,s=e.pendingProps,f=t!==null?t.memoizedProps:null,n=s.children,Oo(a,s)?n=null:f!==null&&Oo(a,f)&&(e.flags|=32),e.memoizedState!==null&&(a=pc(t,e,yy,null,null,l),$a._currentValue=a),_a(t,e),ee(t,e,n,l),e.child;case 6:return t===null&&ft&&((t=l=kt)&&(l=Ex(l,e.pendingProps,Ke),l!==null?(e.stateNode=l,ne=e,kt=null,t=!0):t=!1),t||Kl(e)),null;case 13:return om(t,e,l);case 4:return ms(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Bn(e,null,n,l):ee(t,e,n,l),e.child;case 11:return em(t,e,e.type,e.pendingProps,l);case 7:return n=e.pendingProps,_a(t,e),ee(t,e,n,l),e.child;case 8:return ee(t,e,e.pendingProps.children,l),e.child;case 12:return ee(t,e,e.pendingProps.children,l),e.child;case 10:return hm(t,e,l);case 9:return a=e.type._context,n=e.pendingProps.children,Mn(e),a=re(a),n=n(a),e.flags|=1,ee(t,e,n,l),e.child;case 14:return lm(t,e,e.type,e.pendingProps,l);case 15:return nm(t,e,e.type,e.pendingProps,l);case 19:return qc(t,e,l);case 31:return Ry(t,e,l);case 22:return am(t,e,l,e.pendingProps);case 24:return Mn(e),n=re(Ft),t===null?(a=ac(),a===null&&(a=Dt,s=lc(),a.pooledCache=s,s.refCount++,s!==null&&(a.pooledCacheLanes|=l),a=s),e.memoizedState={parent:n,cache:a},sc(e),Jl(e,Ft,a)):((t.lanes&l)!==0&&(uc(t,e),_i(e,null,null,l),Si()),a=t.memoizedState,s=e.memoizedState,a.parent!==n?(a={parent:n,cache:n},e.memoizedState=a,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=a),Jl(e,Ft,n)):(n=s.cache,Jl(e,Ft,n),n!==a.cache&&ec(e,[Ft],l,!0))),ee(t,e,e.pendingProps.children,l),e.child;case 30:return e.stateNode===null&&(e.stateNode={autoName:null,paired:null,clones:null,ref:null}),n=e.pendingProps,n.name!=null&&n.name!=="auto"?e.flags|=t===null?18882560:18874368:ft&&Ls(e),t!==null&&t.memoizedProps.name!==n.name?e.flags|=4194816:_a(t,e),ee(t,e,n.children,l),e.child;case 29:throw e.pendingProps}throw Error(c(156,e.tag))}function Ul(t){t.flags|=4}function Yc(t,e,l,n,a){var s;if((s=(t.mode&32)!==0)&&(s=l===null?Vp(e,n):Vp(e,n)&&(n.src!==l.src||n.srcSet!==l.srcSet)),s){if(t.flags|=16777216,(a&335544128)===a)if(t.stateNode.complete)t.flags|=8192;else if(Jm())t.flags|=8192;else throw Ln=Qs,ic}else t.flags&=-16777217}function pm(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Gp(e))if(Jm())t.flags|=8192;else throw Ln=Qs,ic}function ou(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?Vf():536870912,t.lanes|=e,za|=e)}function Oi(t,e){if(!ft)switch(t.tailMode){case"visible":break;case"collapsed":for(var l=t.tail,n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null;break;default:for(e=t.tail,l=null;e!==null;)e.alternate!==null&&(l=e),e=e.sibling;l===null?t.tail=null:l.sibling=null}}function Ut(t){var e=t.alternate!==null&&t.alternate.child===t.child,l=0,n=0;if(e)for(var a=t.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags&1206910976,n|=a.flags&1206910976,a.return=t,a=a.sibling;else for(a=t.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=t,a=a.sibling;return t.subtreeFlags|=n,t.childLanes=l,e}function Cy(t,e,l){var n=e.pendingProps;switch(Fr(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(e),null;case 1:return Ut(e),null;case 3:return l=e.stateNode,n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),wl(Ft),ta(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(ga(e)?Ul(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Pr())),Ut(e),null;case 26:var a=e.type,s=e.memoizedState;return t===null?(Ul(e),s!==null?(Ut(e),pm(e,s)):(Ut(e),Yc(e,a,null,n,l))):s?s!==t.memoizedState?(Ul(e),Ut(e),pm(e,s)):(Ut(e),e.flags&=-16777217):(t=t.memoizedProps,t!==n&&Ul(e),Ut(e),Yc(e,a,t,n,l)),null;case 27:if(ps(e),l=$l.current,a=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==n&&Ul(e);else{if(!n){if(e.stateNode===null)throw Error(c(166));return Ut(e),e.subtreeFlags&=-33554433,null}t=cl.current,ga(e)?Zd(e):(t=kp(a,n,l),e.stateNode=t,Ul(e))}return Ut(e),e.subtreeFlags&=-33554433,null;case 5:if(ps(e),a=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==n&&Ul(e);else{if(!n){if(e.stateNode===null)throw Error(c(166));return Ut(e),e.subtreeFlags&=-33554433,null}if(s=cl.current,ga(e))Zd(e);else{var f=qi($l.current);switch(s){case 1:s=f.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:s=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":s=f.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":s=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":s=f.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?s.multiple=!0:n.size&&(s.size=n.size);break;default:s=typeof n.is=="string"?f.createElement(a,{is:n.is}):f.createElement(a)}}s[ue]=e,s[Ee]=n;t:for(f=e.child;f!==null;){if(f.tag===5||f.tag===6)s.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break t;for(;f.sibling===null;){if(f.return===null||f.return===e)break t;f=f.return}f.sibling.return=f.return,f=f.sibling}e.stateNode=s;t:switch(de(s,a,n),a){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break t;case"img":n=!0;break t;default:n=!1}n&&Ul(e)}}return Ut(e),e.subtreeFlags&=-33554433,Yc(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,l),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&Ul(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(c(166));if(t=$l.current,ga(e)){if(t=e.stateNode,l=e.memoizedProps,n=null,a=ne,a!==null)switch(a.tag){case 27:case 5:n=a.memoizedProps}t[ue]=e,t=!!(t.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||mp(t.nodeValue,l)),t||Kl(e,!0)}else t=qi(t).createTextNode(n),t[ue]=e,e.stateNode=t}return Ut(e),null;case 31:if(l=e.memoizedState,t===null||t.memoizedState!==null){if(n=ga(e),l!==null){if(t===null){if(!n)throw Error(c(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(557));t[ue]=e}else An(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ut(e),t=!1}else l=Pr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return e.flags&256?(He(e),e):(He(e),null);if((e.flags&128)!==0)throw Error(c(558))}return Ut(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=ga(e),n!==null&&n.dehydrated!==null){if(t===null){if(!a)throw Error(c(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(c(317));a[ue]=e}else An(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ut(e),a=!1}else a=Pr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return e.flags&256?(He(e),e):(He(e),null)}return He(e),(e.flags&128)!==0?(e.lanes=l,e):(l=n!==null,t=t!==null&&t.memoizedState!==null,l&&(n=e.child,a=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(a=n.alternate.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==a&&(n.flags|=2048)),l!==t&&l&&(e.child.flags|=8192),ou(e,e.updateQueue),Ut(e),null);case 4:return ta(),t===null&&Eo(e.stateNode.containerInfo),e.flags|=67108864,Ut(e),null;case 10:return wl(e.type),Ut(e),null;case 19:if(hc(e),n=e.memoizedState,n===null)return Ut(e),null;if(a=(e.flags&128)!==0,s=n.rendering,s===null)if(a)Oi(n,!1);else{if(Xt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=Js(t),s!==null){for(e.flags|=128,Oi(n,!1),t=s.updateQueue,e.updateQueue=t,ou(e,t),e.subtreeFlags=0,t=l,l=e.child;l!==null;)Yd(l,t),l=l.sibling;return Ei(e,oe.current&1|2),ft&&Cl(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&we()>Su&&(e.flags|=128,a=!0,Oi(n,!1),e.lanes=4194304)}else{if(!a)if(t=Js(s),t!==null){if(e.flags|=128,a=!0,t=t.updateQueue,e.updateQueue=t,ou(e,t),Oi(n,!0),n.tail===null&&n.tailMode!=="collapsed"&&n.tailMode!=="visible"&&!s.alternate&&!ft)return Ut(e),null}else 2*we()-n.renderingStartTime>Su&&l!==536870912&&(e.flags|=128,a=!0,Oi(n,!1),e.lanes=4194304);n.isBackwards?(s.sibling=e.child,e.child=s):(t=n.last,t!==null?t.sibling=s:e.child=s,n.last=s)}if(n.tail!==null){t=n.tail;t:{for(l=t;l!==null;){if(l.alternate!==null){l=!1;break t}l=l.sibling}l=!0}return n.rendering=t,n.tail=t.sibling,n.renderingStartTime=we(),t.sibling=null,s=oe.current,s=a?s&1|2:s&1,n.tailMode==="visible"||n.tailMode==="collapsed"||!l||ft?Ei(e,s):(l=s,Mt(ce,e),Mt(oe,l),ge===null&&(ge=e)),ft&&Cl(e,n.treeForkCount),t}return Ut(e),null;case 22:case 23:return He(e),fc(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?(l&536870912)!==0&&(e.flags&128)===0&&(Ut(e),e.subtreeFlags&6&&(e.flags|=8192)):Ut(e),l=e.updateQueue,l!==null&&ou(e,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==l&&(e.flags|=2048),t!==null&&se(Un),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),e.memoizedState.cache!==l&&(e.flags|=2048),wl(Ft),Ut(e),null;case 25:return null;case 30:return e.flags|=33554432,Ut(e),null}throw Error(c(156,e.tag))}function Ay(t,e){switch(Fr(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return wl(Ft),ta(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ps(e),null;case 31:if(e.memoizedState!==null){if(He(e),e.alternate===null)throw Error(c(340));An()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(He(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(c(340));An()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return hc(e),t=e.flags,t&65536?(e.flags=t&-65537|128,t=e.memoizedState,t!==null&&(t.rendering=null,t.tail=null),e.flags|=4,e):null;case 4:return ta(),null;case 10:return wl(e.type),null;case 22:case 23:return He(e),fc(),t!==null&&se(Un),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return wl(Ft),null;case 25:return null;default:return null}}function gm(t,e){switch(Fr(e),e.tag){case 3:wl(Ft),ta();break;case 26:case 27:case 5:ps(e);break;case 4:ta();break;case 31:e.memoizedState!==null&&He(e);break;case 13:He(e);break;case 19:hc(e);break;case 10:wl(e.type);break;case 22:case 23:He(e),fc(),t!==null&&se(Un);break;case 24:wl(Ft)}}function Ci(t,e){try{var l=e.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var a=n.next;l=a;do{if((l.tag&t)===t){n=void 0;var s=l.create,f=l.inst;n=s(),f.destroy=n}l=l.next}while(l!==a)}}catch(h){Ot(e,e.return,h)}}function nn(t,e,l){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var s=a.next;n=s;do{if((n.tag&t)===t){var f=n.inst,h=f.destroy;if(h!==void 0){f.destroy=void 0,a=e;var x=l,T=h;try{T()}catch(C){Ot(a,x,C)}}}n=n.next}while(n!==s)}}catch(C){Ot(e,e.return,C)}}function vm(t){var e=t.updateQueue;if(e!==null){var l=t.stateNode;try{sh(e,l)}catch(n){Ot(t,t.return,n)}}}function ym(t,e,l){l.props=$n(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(n){Ot(t,e,n)}}function hl(t,e){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:var a=t.stateNode,s=Rl(t.memoizedProps,a);(a.ref===null||a.ref.name!==s)&&(a.ref=Tp(s)),n=a.ref;break;case 7:if(t.stateNode===null){var f=new Ye(t);y(t.child,!1,jx,f,void 0,void 0),t.stateNode=f}n=t.stateNode;break;default:n=t.stateNode}typeof l=="function"?t.refCleanup=l(n):l.current=n}}catch(h){Ot(t,e,h)}}function fe(t,e){var l=t.ref,n=t.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(a){Ot(t,e,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(a){Ot(t,e,a)}else l.current=null}function fu(t,e){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&e!==null)for(var l=0;l<e.length;l++)Ap(t.stateNode,e[l])}function xm(t){for(var e=t.return;e!==null&&(Gc(e)&&Ap(t.stateNode,e.stateNode),!Vc(e));)e=e.return}function Ai(t){for(var e=t.return;e!==null&&(Gc(e)&&Sx(t.stateNode,e.stateNode),!Vc(e));)e=e.return}function Vc(t){return t.tag===5||t.tag===3||t.tag===27}function Gc(t){return t&&t.tag===7&&t.stateNode!==null}function Qc(t){var e=t.type,l=t.memoizedProps,n=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break t;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(a){Ot(t,t.return,a)}}function Xc(t,e,l){try{var n=t.stateNode;nx(n,t.type,l,e),n[Ee]=e}catch(a){Ot(t,t.return,a)}}function bm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&fn(t.type)||t.tag===4}function Zc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||bm(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&&fn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Kc(t,e,l,n){var a=t.tag;if(a===5||a===6)a=t.stateNode,e?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(a,e):(e=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,e.appendChild(a),l=l._reactRootContainer,l!=null||e.onclick!==null||(e.onclick=ol)),fu(t,n),jt=!0;else if(a!==4&&(a===27&&(fu(t,n),n=null,fn(t.type)&&(l=t.stateNode,e=null)),t=t.child,t!==null))for(Kc(t,e,l,n),t=t.sibling;t!==null;)Kc(t,e,l,n),t=t.sibling}function du(t,e,l,n){var a=t.tag;if(a===5||a===6)a=t.stateNode,e?l.insertBefore(a,e):l.appendChild(a),fu(t,n),jt=!0;else if(a!==4&&(a===27&&(fu(t,n),n=null,fn(t.type)&&(l=t.stateNode)),t=t.child,t!==null))for(du(t,e,l,n),t=t.sibling;t!==null;)du(t,e,l,n),t=t.sibling}function jm(t){var e=t.stateNode,l=t.memoizedProps;try{for(var n=t.type,a=e.attributes;a.length;)e.removeAttributeNode(a[0]);de(e,n,l),e[ue]=t,e[Ee]=l}catch(s){Ot(t,t.return,s)}}var hu=!1,Le=null;function Sm(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(hu=!0)}var ml=null;function _m(){var t=ml;return ml=null,t}var Ne=0;function Ea(t,e,l,n,a){return Ne=0,Em(t.child,e,l,n,a)}function Em(t,e,l,n,a){for(var s=!1;t!==null;){if(t.tag===5){var f=t.stateNode;if(n!==null){var h=wo(f);n.push(h),h.view&&(s=!0)}else s||wo(f).view&&(s=!0);hu=!0,_p(f,Ne===0?e:e+"_"+Ne,l),Ne++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&a||Em(t.child,e,l,n,a)&&(s=!0));t=t.sibling}return s}function pl(t,e){for(;t!==null;)t.tag===5?Ep(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&e||pl(t.child,e)),t=t.sibling}function mu(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(mu(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var e=t.memoizedProps;if(e.name==null||e.name==="auto")throw Error(c(544));var l=e.name;e=zl(e.default,e.share),e!=="none"&&(Ea(t,l,e,null,!1)||pl(t.child,!1))}t=t.sibling}}function Jc(t,e){if(t.tag===30){var l=t.stateNode,n=t.memoizedProps,a=Rl(n,l),s=zl(n.default,l.paired?n.share:n.enter);s!=="none"?Ea(t,a,s,null,!1)?(mu(t),l.paired||e||wa(t,n.onEnter)):pl(t.child,!1):mu(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Jc(t,e),t=t.sibling;else mu(t)}function Ic(t){if(Le!==null&&Le.size!==0){var e=Le;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var l=t.memoizedProps,n=l.name;if(n!=null&&n!=="auto"){var a=e.get(n);if(a!==void 0){var s=zl(l.default,l.share);if(s!=="none"&&(Ea(t,n,s,null,!1)?(s=t.stateNode,a.paired=s,s.paired=a,wa(t,l.onShare)):pl(t.child,!1)),e.delete(n),e.size===0)break}}}Ic(t)}t=t.sibling}}}function Fc(t){if(t.tag===30){var e=t.memoizedProps,l=Rl(e,t.stateNode),n=Le!==null?Le.get(l):void 0,a=zl(e.default,n!==void 0?e.share:e.exit);a!=="none"&&(Ea(t,l,a,null,!1)?n!==void 0?(a=t.stateNode,n.paired=a,a.paired=n,Le.delete(l),wa(t,e.onShare)):wa(t,e.onExit):pl(t.child,!1)),Le!==null&&Ic(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Fc(t),t=t.sibling;else Le!==null&&Ic(t)}function Tm(t){for(t=t.child;t!==null;){if(t.tag===30){var e=t.memoizedProps,l=Rl(e,t.stateNode);e=zl(e.default,e.update),t.flags&=-5,e!=="none"&&Ea(t,l,e,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&Tm(t);t=t.sibling}}function Wc(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var e=t.stateNode;e.paired!==null&&(e.paired=null,pl(t.child,!1))}Wc(t)}t=t.sibling}}function pu(t){if(t.tag===30)t.stateNode.paired=null,pl(t.child,!1),Wc(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)pu(t),t=t.sibling;else Wc(t)}function Nm(t){for(t=t.child;t!==null;)t.tag===30?pl(t.child,!1):(t.subtreeFlags&33554432)!==0&&Nm(t),t=t.sibling}function Pc(t,e,l,n,a,s,f){for(var h=!1;e!==null;){if(e.tag===5){var x=e.stateNode;if(s!==null&&Ne<s.length){var T=s[Ne],C=wo(x);(T.view||C.view)&&(h=!0);var D;if(D=(t.flags&4)===0)if(C.clip)D=!0;else{D=T.rect;var _=C.rect;D=D.y!==_.y||D.x!==_.x||D.height!==_.height||D.width!==_.width}D&&(t.flags|=4),C.abs?C=!T.abs:(T=T.rect,C=C.rect,C=T.height!==C.height||T.width!==C.width),C&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&_p(x,Ne===0?l:l+"_"+Ne,a),h&&(t.flags&4)!==0||(ml===null&&(ml=[]),ml.push(x,Ne===0?n:n+"_"+Ne,e.memoizedProps)),Ne++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&f?t.flags|=e.flags&32:Pc(t,e.child,l,n,a,s,f)&&(h=!0));e=e.sibling}return h}function Rm(t,e){for(t=t.child;t!==null;){if(t.tag===30){var l=t.memoizedProps,n=t.stateNode,a=Rl(l,n),s=zl(l.default,l.update),f;f=t.memoizedState,t.memoizedState=null,n=t;var h=t.child;Ne=0,a=Pc(n,h,a,a,s,f,!1),(t.flags&4)!==0&&a&&wa(t,l.onUpdate)}else(t.subtreeFlags&33554432)!==0&&Rm(t);t=t.sibling}}var ae=!1,Nt=!1,gl=!1,to=!1,zm=typeof WeakSet=="function"?WeakSet:Set,ie=null,vl=!1,wi=!1,gu=!1,eo=!1;function wy(t,e,l){if(t=t.containerInfo,Ro=Ya,t=wd(t),$r(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var s=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break t}var h=0,x=-1,T=-1,C=0,D=0,_=t,O=null;e:for(;;){for(var q;_!==n||s!==0&&_.nodeType!==3||(x=h+s),_!==f||a!==0&&_.nodeType!==3||(T=h+a),_.nodeType===3&&(h+=_.nodeValue.length),(q=_.firstChild)!==null;)O=_,_=q;for(;;){if(_===t)break e;if(O===n&&++C===s&&(x=h),O===f&&++D===a&&(T=h),(q=_.nextSibling)!==null)break;_=O,O=_.parentNode}_=q}n=x===-1||T===-1?null:{start:x,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(zo={focusedElem:t,selectionRange:n},Ya=!1,l=(l&335544064)===l,ie=e,e=l?9270:1024;ie!==null;){if(t=ie,l&&(n=t.deletions,n!==null))for(s=0;s<n.length;s++)l&&Fc(n[s]);if(t.alternate===null&&(t.flags&2)!==0)l&&Sm(t),vu(l);else{if(t.tag===22){if(n=t.alternate,t.memoizedState!==null){n!==null&&n.memoizedState===null&&l&&Fc(n),vu(l);continue}else if(n!==null&&n.memoizedState!==null){l&&Sm(t),vu(l);continue}}n=t.child,(t.subtreeFlags&e)!==0&&n!==null?(n.return=t,ie=n):(l&&Tm(t),vu(l))}}Le=null}function vu(t){for(;ie!==null;){var e=ie,l=t,n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 15:break;case 1:if((a&1024)!==0&&n!==null){l=void 0,a=n.memoizedProps,n=n.memoizedState;var s=e.stateNode;try{var f=$n(e.type,a);l=s.getSnapshotBeforeUpdate(f,n),s.__reactInternalSnapshotBeforeUpdate=l}catch(h){Ot(e,e.return,h)}}break;case 3:if((a&1024)!==0){if(n=e.stateNode.containerInfo,l=n.nodeType,l===9)ko(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ko(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:l&&n!==null&&(l=Rl(n.memoizedProps,n.stateNode),a=e.memoizedProps,a=zl(a.default,a.update),a!=="none"&&Ea(n,l,a,n.memoizedState=[],!0));break;default:if((a&1024)!==0)throw Error(c(163))}if(n=e.sibling,n!==null){n.return=e.return,ie=n;break}ie=e.return}}function Om(t,e,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:yl(t,l),n&4&&Ci(5,l);break;case 1:if(yl(t,l),n&4)if(t=l.stateNode,e===null)try{t.componentDidMount()}catch(f){Ot(l,l.return,f)}else{var a=$n(l.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(a,e,t.__reactInternalSnapshotBeforeUpdate)}catch(f){Ot(l,l.return,f)}}n&64&&vm(l),n&512&&hl(l,l.return);break;case 3:if(yl(t,l),n&64&&(t=l.updateQueue,t!==null)){if(e=null,l.child!==null)switch(l.child.tag){case 27:case 5:e=l.child.stateNode;break;case 1:e=l.child.stateNode}try{sh(t,e)}catch(f){Ot(l,l.return,f)}}break;case 27:e===null&&n&4&&jm(l);case 26:case 5:yl(t,l),e===null&&n&4&&Qc(l),n&512&&hl(l,l.return);break;case 12:yl(t,l);break;case 31:yl(t,l),n&4&&Dm(t,l);break;case 13:yl(t,l),n&4&&Mm(t,l),n&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Gy.bind(null,l),Tx(t,l))));break;case 22:if(n=l.memoizedState!==null||ae,!n){var s=e!==null&&e.memoizedState!==null||Nt;e=ae,a=Nt,ae=n,(Nt=s)&&!a?(n=2,(l.subtreeFlags&8772)!==0&&(n|=1),al(t,l,n)):yl(t,l),ae=e,Nt=a}break;case 30:yl(t,l),n&512&&hl(l,l.return);break;case 7:n&512&&hl(l,l.return);default:yl(t,l)}}function lo(t,e){for(t=t.child;t!==null;)Cm(t,e),t=t.sibling}function Cm(t,e){switch(t.tag){case 5:case 26:try{var l=t.stateNode;if(e){var n=l.style;typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"}else{var a=t.stateNode,s=t.memoizedProps.style,f=s!=null&&s.hasOwnProperty("display")?s.display:null;a.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(x){Ot(t,t.return,x)}no(t,e);break;case 6:try{t.stateNode.nodeValue=e?"":t.memoizedProps,jt=!0}catch(x){Ot(t,t.return,x)}break;case 18:try{var h=t.stateNode;e?Sp(h,!0):Sp(t.stateNode,!1)}catch(x){Ot(t,t.return,x)}break;case 22:case 23:t.memoizedState===null&&lo(t,e);break;default:lo(t,e)}}function no(t,e){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){t:{var l=t,n=e;switch(l.tag){case 4:Cm(l,n);break t;case 22:l.memoizedState===null&&no(l,n);break t;default:no(l,n)}}t=t.sibling}}function Am(t){var e=t.alternate;e!==null&&(t.alternate=null,Am(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Ss(e)),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 qt=null,Re=!1;function ll(t,e,l){for(l=l.child;l!==null;)wm(t,e,l),l=l.sibling}function wm(t,e,l){if(De&&typeof De.onCommitFiberUnmount=="function")try{De.onCommitFiberUnmount(ei,l)}catch{}switch(l.tag){case 26:Nt||fe(l,e),ll(t,e,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&!Nt&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Nt||fe(l,e),Ai(l);var n=qt,a=Re;fn(l.type)&&(qt=l.stateNode,Re=!1),ll(t,e,l),Up(l.stateNode,l.type,l.memoizedProps),qt=n,Re=a;break;case 5:Nt||fe(l,e),Ai(l);case 6:if(l.tag===6&&Ai(l),n=qt,a=Re,qt=null,ll(t,e,l),qt=n,Re=a,qt!==null)if(Re)try{(qt.nodeType===9?qt.body:qt.nodeName==="HTML"?qt.ownerDocument.body:qt).removeChild(l.stateNode),jt=!0}catch(s){Ot(l,e,s)}else try{qt.removeChild(l.stateNode),jt=!0}catch(s){Ot(l,e,s)}break;case 18:qt!==null&&(Re?(t=qt,jp(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Va(t)):jp(qt,l.stateNode));break;case 4:n=qt,a=Re,qt=l.stateNode.containerInfo,Re=!0,ll(t,e,l),qt=n,Re=a;break;case 0:case 11:case 14:case 15:nn(2,l,e),Nt||nn(4,l,e),ll(t,e,l);break;case 1:Nt||(fe(l,e),n=l.stateNode,typeof n.componentWillUnmount=="function"&&ym(l,e,n)),ll(t,e,l);break;case 21:ll(t,e,l);break;case 22:Nt=(n=Nt)||l.memoizedState!==null,ll(t,e,l),Nt=n;break;case 30:fe(l,e),ll(t,e,l);break;case 7:Nt||fe(l,e),ll(t,e,l);break;default:ll(t,e,l)}}function Dm(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Va(t)}catch(l){Ot(e,e.return,l)}}}function Mm(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Va(t)}catch(l){Ot(e,e.return,l)}}function Dy(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new zm),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new zm),e;default:throw Error(c(435,t.tag))}}function yu(t,e){var l=Dy(t);e.forEach(function(n){if(!l.has(n)){l.add(n);var a=Qy.bind(null,t,n);n.then(a,a)}})}function be(t,e,l){var n=e.deletions;if(n!==null)for(var a=0;a<n.length;a++){var s=n[a],f=t,h=e,x=h;t:for(;x!==null;){switch(x.tag){case 27:if(fn(x.type)){qt=x.stateNode,Re=!1;break t}break;case 5:qt=x.stateNode,Re=!1;break t;case 3:case 4:qt=x.stateNode.containerInfo,Re=!0;break t}x=x.return}if(qt===null)throw Error(c(160));wm(f,h,s),qt=null,Re=!1,f=s.alternate,f!==null&&(f.return=null),s.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)km(e,t,l),e=e.sibling}var nl=null;function km(t,e,l){var n=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(a&4&&(n=t.updateQueue,n=n!==null?n.events:null,n!==null))for(var s=0;s<n.length;s++){var f=n[s];f.ref.impl=f.nextImpl}be(e,t,l),je(t),a&4&&(nn(3,t,t.return),Ci(3,t),nn(5,t,t.return));break;case 1:be(e,t,l),je(t),a&512&&(Nt||n===null||fe(n,n.return)),a&64&&ae&&(t=t.updateQueue,t!==null&&(e=t.callbacks,e!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?e:l.concat(e))));break;case 26:if(s=nl,be(e,t,l),je(t),a&512&&(Nt||n===null||fe(n,n.return)),a&4)if(a=n!==null?n.memoizedState:null,l=t.memoizedState,n===null)if(l===null)if(t.stateNode===null)if(ae)t.stateNode=yp(t.type,t.memoizedProps,e.containerInfo,t);else{t:{e=t.type,l=t.memoizedProps,a=s.ownerDocument||s;e:switch(e){case"title":n=a.getElementsByTagName("title")[0],(!n||n[ai]||n[ue]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=a.createElement(e),a.head.insertBefore(n,a.querySelector("head > title"))),de(n,e,l),n[ue]=t,le(n),e=n;break t;case"link":if(s=Yp("link","href",a).get(e+(l.href||""))){for(f=0;f<s.length;f++)if(n=s[f],n.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&n.getAttribute("rel")===(l.rel==null?null:l.rel)&&n.getAttribute("title")===(l.title==null?null:l.title)&&n.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){s.splice(f,1);break e}}n=a.createElement(e),de(n,e,l),a.head.appendChild(n);break;case"meta":if(s=Yp("meta","content",a).get(e+(l.content||""))){for(f=0;f<s.length;f++)if(n=s[f],n.getAttribute("content")===(l.content==null?null:""+l.content)&&n.getAttribute("name")===(l.name==null?null:l.name)&&n.getAttribute("property")===(l.property==null?null:l.property)&&n.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&n.getAttribute("charset")===(l.charSet==null?null:l.charSet)){s.splice(f,1);break e}}n=a.createElement(e),de(n,e,l),a.head.appendChild(n);break;default:throw Error(c(468,e))}n[ue]=t,le(n),e=n}t.stateNode=e}else ae||Yo(s,t.type,t.stateNode);else t.stateNode=$p(s,l,t.memoizedProps);else a!==l?(a===null?(e=n.stateNode,e===null||Nt||e.parentNode.removeChild(e)):a.count--,l===null?ae||Yo(s,t.type,t.stateNode):$p(s,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Xc(t,t.memoizedProps,n.memoizedProps);break;case 27:be(e,t,l),je(t),a&512&&(Nt||n===null||fe(n,n.return)),n!==null&&a&4&&Xc(t,t.memoizedProps,n.memoizedProps);break;case 5:if(s=gl,gl=!1,be(e,t,l),gl=s,je(t),a&512&&(Nt||n===null||fe(n,n.return)),t.flags&32){e=t.stateNode;try{sa(e,""),jt=!0}catch(C){Ot(t,t.return,C)}}a&4&&t.stateNode!=null&&(e=t.memoizedProps,Xc(t,e,n!==null?n.memoizedProps:e)),a&1024&&(to=!0);break;case 6:if(be(e,t,l),je(t),a&4){if(t.stateNode===null)throw Error(c(162));e=t.memoizedProps,l=t.stateNode;try{l.nodeValue=e,jt=!0}catch(C){Ot(t,t.return,C)}}break;case 3:if(jt=!1,Du=null,s=nl,nl=$i(e.containerInfo),be(e,t,l),nl=s,je(t),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Va(e.containerInfo)}catch(C){Ot(t,t.return,C)}to&&(to=!1,Um(t)),jt=!1;break;case 4:a=gl,gl=ae,n=ld(),s=nl,nl=$i(t.stateNode.containerInfo),be(e,t,l),je(t),nl=s,jt&&wi&&(gu=!0),jt=n,gl=a;break;case 12:be(e,t,l),je(t);break;case 31:be(e,t,l),je(t),a&4&&(e=t.updateQueue,e!==null&&(t.updateQueue=null,yu(t,e)));break;case 13:be(e,t,l),je(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ju=we()),a&4&&(e=t.updateQueue,e!==null&&(t.updateQueue=null,yu(t,e)));break;case 22:s=t.memoizedState!==null,f=n!==null&&n.memoizedState!==null;var h=ae,x=Nt,T=gl;ae=h||s,gl=T||s,Nt=x||f,be(e,t,l),Nt=x,gl=T,ae=h,je(t),a&8192&&(e=t.stateNode,e._visibility=s?e._visibility&-2:e._visibility|1,!s||n===null||f||ae||Nt||(e=f||Nt,l=ae,n=Nt,ae=s||ae,Nt=e,an(t,2),ae=l,Nt=n),!s&&gl||lo(t,s)),a&4&&(e=t.updateQueue,e!==null&&(l=e.retryQueue,l!==null&&(e.retryQueue=null,yu(t,l))));break;case 19:be(e,t,l),je(t),a&4&&(e=t.updateQueue,e!==null&&(t.updateQueue=null,yu(t,e)));break;case 30:a&512&&(Nt||n===null||fe(n,n.return)),a=ld(),s=wi,f=(l&335544064)===l,h=t.memoizedProps,wi=f&&zl(h.default,h.update)!=="none",be(e,t,l),je(t),f&&n!==null&&jt&&(t.flags|=4),wi=s,jt=a;break;case 21:break;case 7:a&512&&(Nt||n===null||fe(n,n.return)),n&&n.stateNode!==null&&(n.stateNode._fragmentFiber=t);default:be(e,t,l),je(t)}}function je(t){var e=t.flags;if(e&2){try{for(var l,n=t.return;n!==null;){if(bm(n)){l=n;break}n=n.return}n=null;for(var a=t.return;a!==null;){if(Gc(a)){var s=a.stateNode;n===null?n=[s]:n.push(s)}if(Vc(a))break;a=a.return}var f=n;if(l==null)throw Error(c(160));switch(l.tag){case 27:var h=l.stateNode,x=Zc(t);du(t,x,h,f);break;case 5:var T=l.stateNode;l.flags&32&&(sa(T,""),l.flags&=-33);var C=Zc(t);du(t,C,T,f);break;case 3:case 4:var D=l.stateNode.containerInfo,_=Zc(t);Kc(t,_,D,f);break;default:throw Error(c(161))}}catch(O){Ot(t,t.return,O)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Um(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;Um(e),e.tag===5&&e.flags&1024&&(e=e.stateNode,Ya=!0,e.reset(),Ya=!1),t=t.sibling}}function Ta(t,e){if(e.subtreeFlags&9270)for(e=e.child;e!==null;)Hm(e,t),e=e.sibling;else Rm(e)}function Hm(t,e){var l=t.alternate;if(l===null)Jc(t,!1);else switch(t.tag){case 3:if(eo=vl=!1,_m(),Ta(e,t),!vl&&!gu){if(t=ml,t!==null)for(var n=0;n<t.length;n+=3){l=t[n];var a=t[n+1];Ep(l,t[n+2]),l=l.ownerDocument.documentElement,l!==null&&l.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+a+")"})}t=e.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),eo=!0}ml=null;break;case 5:Ta(e,t);break;case 4:n=vl,vl=!1,Ta(e,t),vl&&(gu=!0),vl=n;break;case 22:t.memoizedState===null&&(l.memoizedState!==null?Jc(t,!1):Ta(e,t));break;case 30:n=vl,a=_m(),vl=!1,Ta(e,t),vl&&(t.flags|=4);var s=t.memoizedProps,f=t.stateNode;e=Rl(s,f),f=Rl(l.memoizedProps,f);var h=zl(s.default,s.update);h==="none"?e=!1:(s=l.memoizedState,l.memoizedState=null,l=t.child,Ne=0,e=Pc(t,l,e,f,h,s,!0),Ne!==(s===null?0:s.length)&&(t.flags|=32)),(t.flags&4)!==0&&e?(wa(t,t.memoizedProps.onUpdate),ml=a):a!==null&&(a.push.apply(a,ml),ml=a),vl=(t.flags&32)!==0?!0:n;break;default:Ta(e,t)}}function yl(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Om(t,e.alternate,e),e=e.sibling}function an(t,e){for(t=t.child;t!==null;){var l=t,n=e;switch(l.tag){case 0:case 11:case 14:case 15:nn(4,l,l.return),an(l,n);break;case 1:fe(l,l.return);var a=l.stateNode;typeof a.componentWillUnmount=="function"&&ym(l,l.return,a),an(l,n);break;case 27:(n&2)!==0&&Up(l.stateNode,l.type,l.memoizedProps);case 5:fe(l,l.return),l.tag!==5&&l.tag!==27||Ai(l),an(l,n);break;case 6:Ai(l);break;case 26:fe(l,l.return),a=l.stateNode,l.memoizedState!==null||a===null||Nt||a.parentNode.removeChild(a),an(l,n);break;case 22:l.memoizedState===null&&an(l,n);break;case 30:fe(l,l.return),an(l,n);break;case 7:fe(l,l.return);default:an(l,n)}t=t.sibling}}function al(t,e,l){for(l=(e.subtreeFlags&8772)!==0?l:l&-2,e=e.child;e!==null;){var n=e.alternate,a=t,s=e,f=s.flags,h=(l&1)!==0;switch(s.tag){case 0:case 11:case 15:al(a,s,l),Ci(4,s);break;case 1:if(al(a,s,l),n=s,a=n.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(C){Ot(n,n.return,C)}if(n=s,a=n.updateQueue,a!==null){var x=n.stateNode;try{var T=a.shared.hiddenCallbacks;if(T!==null)for(a.shared.hiddenCallbacks=null,a=0;a<T.length;a++)ih(T[a],x)}catch(C){Ot(n,n.return,C)}}h&&f&64&&vm(s),hl(s,s.return);break;case 27:(l&2)!==0&&jm(s);case 5:s.tag!==5&&s.tag!==27||xm(s),al(a,s,l),h&&n===null&&f&4&&Qc(s),hl(s,s.return);break;case 6:xm(s);break;case 26:x=s.stateNode,s.memoizedState!==null||x===null||ae||Yo($i(x.ownerDocument),s.type,x),al(a,s,l),h&&n===null&&f&4&&Qc(s),hl(s,s.return);break;case 12:al(a,s,l);break;case 31:al(a,s,l),h&&f&4&&Dm(a,s);break;case 13:al(a,s,l),h&&f&4&&Mm(a,s);break;case 22:s.memoizedState===null&&al(a,s,l),hl(s,s.return);break;case 30:al(a,s,l),hl(s,s.return);break;case 7:hl(s,s.return);default:al(a,s,l)}e=e.sibling}}function ao(t,e){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&vi(l))}function io(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&vi(t))}function Je(t,e,l,n){var a=(l&335544064)===l;if(e.subtreeFlags&(a?10262:10256))for(e=e.child;e!==null;)Lm(t,e,l,n),e=e.sibling;else a&&Nm(e)}function Lm(t,e,l,n){var a=(l&335544064)===l;a&&e.alternate===null&&e.return!==null&&e.return.alternate!==null&&pu(e);var s=e.flags;switch(e.tag){case 0:case 11:case 15:Je(t,e,l,n),s&2048&&Ci(9,e);break;case 1:Je(t,e,l,n);break;case 3:Je(t,e,l,n),a&&eo&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),s&2048&&(s=null,e.alternate!==null&&(s=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==s&&(e.refCount++,s!=null&&vi(s)));break;case 12:if(s&2048){Je(t,e,l,n),s=e.stateNode;try{var f=e.memoizedProps,h=f.id,x=f.onPostCommit;typeof x=="function"&&x(h,e.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(T){Ot(e,e.return,T)}}else Je(t,e,l,n);break;case 31:Je(t,e,l,n);break;case 13:Je(t,e,l,n);break;case 23:break;case 22:f=e.stateNode,h=e.alternate,e.memoizedState!==null?(a&&h!==null&&h.memoizedState===null&&pu(h),f._visibility&2?Je(t,e,l,n):Di(t,e)):(a&&h!==null&&h.memoizedState!==null&&pu(e),f._visibility&2?Je(t,e,l,n):(f._visibility|=2,Na(t,e,l,n,(e.subtreeFlags&10256)!==0||!1))),s&2048&&ao(h,e);break;case 24:Je(t,e,l,n),s&2048&&io(e.alternate,e);break;case 30:a&&(s=e.alternate,s!==null&&(pl(s.child,!0),pl(e.child,!0))),Je(t,e,l,n);break;default:Je(t,e,l,n)}}function Na(t,e,l,n,a){for(a=a&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var s=t,f=e,h=l,x=n,T=f.flags;switch(f.tag){case 0:case 11:case 15:Na(s,f,h,x,a),Ci(8,f);break;case 23:break;case 22:var C=f.stateNode;f.memoizedState!==null?C._visibility&2?Na(s,f,h,x,a):Di(s,f):(C._visibility|=2,Na(s,f,h,x,a)),a&&T&2048&&ao(f.alternate,f);break;case 24:Na(s,f,h,x,a),a&&T&2048&&io(f.alternate,f);break;default:Na(s,f,h,x,a)}e=e.sibling}}function Di(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var l=t,n=e,a=n.flags;switch(n.tag){case 22:Di(l,n),a&2048&&ao(n.alternate,n);break;case 24:Di(l,n),a&2048&&io(n.alternate,n);break;default:Di(l,n)}e=e.sibling}}var Yn=8192;function Vn(t,e,l){if(t.subtreeFlags&Yn)for(t=t.child;t!==null;)Bm(t,e,l),t=t.sibling}function Bm(t,e,l){switch(t.tag){case 26:Vn(t,e,l),t.flags&Yn&&(t.memoizedState!==null?Bx(l,nl,t.memoizedState,t.memoizedProps):(t=t.stateNode,(e&335544128)===e&&Xp(l,t)));break;case 5:Vn(t,e,l),t.flags&Yn&&(t=t.stateNode,(e&335544128)===e&&Xp(l,t));break;case 3:case 4:var n=nl;nl=$i(t.stateNode.containerInfo),Vn(t,e,l),nl=n;break;case 22:t.memoizedState===null&&(n=t.alternate,n!==null&&n.memoizedState!==null?(n=Yn,Yn=16777216,Vn(t,e,l),Yn=n):Vn(t,e,l));break;case 30:if((t.flags&Yn)!==0&&(n=t.memoizedProps.name,n!=null&&n!=="auto")){var a=t.stateNode;a.paired=null,Le===null&&(Le=new Map),Le.set(n,a)}Vn(t,e,l);break;default:Vn(t,e,l)}}function qm(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Mi(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var l=0;l<e.length;l++){var n=e[l];ie=n,Ym(n,t)}qm(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)$m(t),t=t.sibling}function $m(t){switch(t.tag){case 0:case 11:case 15:Mi(t),t.flags&2048&&nn(9,t,t.return);break;case 3:Mi(t);break;case 12:Mi(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,xu(t)):Mi(t);break;default:Mi(t)}}function xu(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var l=0;l<e.length;l++){var n=e[l];ie=n,Ym(n,t)}qm(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:nn(8,e,e.return),xu(e);break;case 22:l=e.stateNode,l._visibility&2&&(l._visibility&=-3,xu(e));break;default:xu(e)}t=t.sibling}}function Ym(t,e){for(;ie!==null;){var l=ie;switch(l.tag){case 0:case 11:case 15:nn(8,l,e);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:vi(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,ie=n;else t:for(l=t;ie!==null;){n=ie;var a=n.sibling,s=n.return;if(Am(n),n===l){ie=null;break t}if(a!==null){a.return=s,ie=a;break t}ie=s}}}var My={getCacheForType:function(t){var e=re(Ft),l=e.data.get(t);return l===void 0&&(l=t(),e.data.set(t,l)),l},cacheSignal:function(){return re(Ft).controller.signal}},ky=typeof WeakMap=="function"?WeakMap:Map,_t=0,Dt=null,dt=null,mt=0,zt=0,Be=null,sn=!1,Ra=!1,so=!1,Hl=0,Xt=0,un=0,Gn=0,bu=0,qe=0,za=0,ki=null,ze=null,uo=!1,ju=0,Vm=0,Su=1/0,_u=null,rn=null,Yt=0,il=null,Qn=null,xl=0,ro=0,co=null,Gm=null,Oa=null,Ca=null,Aa=null,Ui=0,Eu=null;function $e(){return(_t&2)!==0&&mt!==0?mt&-mt:K.T!==null?bo():Zf()}function Qm(){if(qe===0)if((mt&536870912)===0||ft){var t=ys;ys<<=1,(ys&3932160)===0&&(ys=262144),qe=t}else qe=536870912;return t=ce.current,t!==null&&(t.flags|=32),qe}function wa(t,e){if(e!=null){var l=t.stateNode,n=l.ref;n===null&&(n=l.ref=Tp(Rl(t.memoizedProps,l))),Ca===null&&(Ca=[]),Ca.push(e.bind(null,n))}}function Oe(t,e,l){(t===Dt&&(zt===2||zt===9)||t.cancelPendingCommit!==null)&&(Da(t,0),cn(t,mt,qe,!1)),ni(t,l),((_t&2)===0||t!==Dt)&&(t===Dt&&((_t&2)===0&&(Gn|=l),Xt===4&&cn(t,mt,qe,!1)),bl(t))}function Xm(t,e,l){if((_t&6)!==0)throw Error(c(327));var n=!l&&(e&127)===0&&(e&t.expiredLanes)===0||li(t,e),a=n?Ly(t,e):fo(t,e,!0),s=n;do{if(a===0){Ra&&!n&&cn(t,e,0,!1);break}else{if(l=t.current.alternate,s&&!Uy(l)){a=fo(t,e,!1),s=!1;continue}if(a===2){if(s=e,t.errorRecoveryDisabledLanes&s)var f=0;else f=t.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){e=f;t:{var h=t;a=ki;var x=h.current.memoizedState.isDehydrated;if(x&&(Da(h,f).flags|=256),f=fo(h,f,!1),f!==2&&f!==6){if(so&&!x){h.errorRecoveryDisabledLanes|=s,Gn|=s,a=4;break t}s=ze,ze=a,s!==null&&(ze===null?ze=s:ze.push.apply(ze,s))}a=f}if(s=!1,a!==2)continue}}if(a===1){Da(t,0),cn(t,e,0,!0);break}t:{switch(n=t,s=a,s){case 0:case 1:throw Error(c(345));case 4:if((e&4194048)!==e&&(e&62914560)!==e)break;case 6:cn(n,e,qe,!sn);break t;case 2:ze=null;break;case 3:case 5:break;default:throw Error(c(329))}if((e&62914560)===e&&(a=ju+300-we(),10<a)){if(cn(n,e,qe,!sn),bs(n,0,!0)!==0)break t;xl=e,n.timeoutHandle=Ao(Zm.bind(null,n,l,ze,_u,uo,e,qe,Gn,za,sn,s,"Throttled",-0,0),a);break t}Zm(n,l,ze,_u,uo,e,qe,Gn,za,sn,s,null,-0,0)}}break}while(!0);bl(t)}function Zm(t,e,l,n,a,s,f,h,x,T,C,D,_,O){t.timeoutHandle=-1;var q=e.subtreeFlags,Z=(s&335544064)===s;if(D=null,(Z||q&8192||(q&16785408)===16785408)&&(D={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ol},Le=null,Bm(e,s,D),Z&&(q=D,Z=t.containerInfo,Z=(Z.nodeType===9?Z:Z.ownerDocument).__reactViewTransition,Z!=null&&(q.count++,q.waitingForViewTransition=!0,q=Gi.bind(q),Z.finished.then(q,q))),q=(s&62914560)===s?ju-we():(s&4194048)===s?Vm-we():0,q=qx(D,q),q!==null)){xl=s,t.cancelPendingCommit=q(ep.bind(null,t,e,s,l,n,a,f,h,x,T,C,D,null,_,O)),cn(t,s,f,!T);return}ep(t,e,s,l,n,a,f,h,x,T,C,D)}function Uy(t){for(var e=t;;){var l=e.tag;if((l===0||l===11||l===15)&&e.flags&16384&&(l=e.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var a=l[n],s=a.getSnapshot;a=a.value;try{if(!Ue(s(),a))return!1}catch{return!1}}if(l=e.child,e.subtreeFlags&16384&&l!==null)l.return=e,e=l;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function cn(t,e,l,n){e=Yf(t,e),e&=~bu,e&=~Gn,t.suspendedLanes|=e,t.pingedLanes&=~e,n&&(t.warmLanes|=e),n=t.expirationTimes;for(var a=e;0<a;){var s=31-Me(a),f=1<<s;n[s]=-1,a&=~f}l!==0&&Gf(t,l,e)}function Tu(){return(_t&6)===0?(Hi(0),!1):!0}function oo(){if(dt!==null){if(zt===0)var t=dt.return;else t=dt,Al=wn=null,yc(t),xa=null,bi=0,t=dt;for(;t!==null;)gm(t.alternate,t),t=t.return;dt=null}}function Da(t,e){var l=t.timeoutHandle;return l!==-1&&(t.timeoutHandle=-1,sx(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),xl=0,oo(),Dt=t,dt=l=Ol(t.current,null),mt=e,zt=0,Be=null,sn=!1,Ra=li(t,e),so=!1,za=qe=bu=Gn=un=Xt=0,ze=ki=null,uo=!1,Hl=Yf(t,e),Ds(),l}function Km(t,e){rt=null,K.H=au,e===ya||e===Gs?(e=eh(),zt=3):e===ic?(e=eh(),zt=4):zt=e===Dc?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Be=e,dt===null&&(Xt=1,iu(t,Qe(e,t.current)))}function Jm(){var t=ce.current;return t===null?!0:(mt&4194048)===mt?ge===null:(mt&62914560)===mt||(mt&536870912)!==0?t===ge:!1}function Im(){var t=K.H;return K.H=au,t===null?au:t}function Fm(){var t=K.A;return K.A=My,t}function Nu(){Xt=4,sn||(mt&4194048)!==mt&&ce.current!==null||(Ra=!0),(un&134217727)===0&&(Gn&134217727)===0||Dt===null||cn(Dt,mt,qe,!1)}function fo(t,e,l){var n=_t;_t|=2;var a=Im(),s=Fm();(Dt!==t||mt!==e)&&(_u=null,Da(t,e)),e=!1;var f=Xt;t:do try{if(zt!==0&&dt!==null){var h=dt,x=Be;switch(zt){case 8:oo(),f=6;break t;case 3:case 2:case 9:case 6:ce.current===null&&(e=!0);var T=zt;if(zt=0,Be=null,Ma(t,h,x,T),l&&Ra){f=0;break t}break;default:T=zt,zt=0,Be=null,Ma(t,h,x,T)}}Hy(),f=Xt;break}catch(C){Km(t,C)}while(!0);return e&&t.shellSuspendCounter++,Al=wn=null,_t=n,K.H=a,K.A=s,dt===null&&(Dt=null,mt=0,Ds()),f}function Hy(){for(;dt!==null;)Wm(dt)}function Ly(t,e){var l=_t;_t|=2;var n=Im(),a=Fm();Dt!==t||mt!==e?(_u=null,Su=we()+500,Da(t,e)):Ra=li(t,e);t:do try{if(zt!==0&&dt!==null){e=dt;var s=Be;e:switch(zt){case 1:zt=0,Be=null,Ma(t,e,s,1);break;case 2:case 9:if(Pd(s)){zt=0,Be=null,Pm(e);break}e=function(){zt!==2&&zt!==9||Dt!==t||(zt=7),bl(t)},s.then(e,e);break t;case 3:zt=7;break t;case 4:zt=5;break t;case 7:Pd(s)?(zt=0,Be=null,Pm(e)):(zt=0,Be=null,Ma(t,e,s,7));break;case 5:var f=null;switch(dt.tag){case 26:f=dt.memoizedState;case 5:case 27:var h=dt;if(f?Gp(f):h.stateNode.complete){zt=0,Be=null;var x=h.sibling;if(x!==null)dt=x;else{var T=h.return;T!==null?(dt=T,Ru(T)):dt=null}break e}}zt=0,Be=null,Ma(t,e,s,5);break;case 6:zt=0,Be=null,Ma(t,e,s,6);break;case 8:oo(),Xt=6;break t;default:throw Error(c(462))}}By();break}catch(C){Km(t,C)}while(!0);return Al=wn=null,K.H=n,K.A=a,_t=l,dt!==null?0:(Dt=null,mt=0,Ds(),Xt)}function By(){for(;dt!==null&&!lv();)Wm(dt)}function Wm(t){var e=mm(t.alternate,t,Hl);t.memoizedProps=t.pendingProps,e===null?Ru(t):dt=e}function Pm(t){var e=t,l=e.alternate;switch(e.tag){case 15:case 0:e=um(l,e,e.pendingProps,e.type,void 0,mt);break;case 11:e=um(l,e,e.pendingProps,e.type.render,e.ref,mt);break;case 5:yc(e);var n=e;n===ne&&(ft?(Bs(n),n.tag===5&&n.stateNode!=null&&(kt=n.stateNode)):(Bs(n),ft=!0));default:gm(l,e),e=dt=Yd(e,Hl),e=mm(l,e,Hl)}t.memoizedProps=t.pendingProps,e===null?Ru(t):dt=e}function Ma(t,e,l,n){Al=wn=null,yc(e),xa=null,bi=0;var a=e.return;try{if(Ny(t,a,e,l,mt)){Xt=1,iu(t,Qe(l,t.current)),dt=null;return}}catch(s){if(a!==null)throw dt=a,s;Xt=1,iu(t,Qe(l,t.current)),dt=null;return}e.flags&32768?(ft||n===1?t=!0:Ra||(mt&536870912)!==0?t=!1:(sn=t=!0,(n===2||n===9||n===3||n===6)&&(n=ce.current,n!==null&&n.tag===13&&(n.flags|=16384))),tp(e,t)):Ru(e)}function Ru(t){var e=t;do{if((e.flags&32768)!==0){tp(e,sn);return}t=e.return;var l=Cy(e.alternate,e,Hl);if(l!==null){dt=l;return}if(e=e.sibling,e!==null){dt=e;return}dt=e=t}while(e!==null);Xt===0&&(Xt=5)}function tp(t,e){do{var l=Ay(t.alternate,t);if(l!==null){l.flags&=32767,dt=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!e&&(t=t.sibling,t!==null)){dt=t;return}dt=t=l}while(t!==null);Xt=6,dt=null}function ep(t,e,l,n,a,s,f,h,x,T,C,D){t.cancelPendingCommit=null;do zu();while(Yt!==0);if((_t&6)!==0)throw Error(c(327));if(e!==null){if(e===t.current)throw Error(c(177));t===Dt&&(dt=Dt=null,mt=0),Qn=e,il=t,xl=l,co=a,Gm=n,qy(t,e,l,f,h,x,D)}}function qy(t,e,l,n,a,s,f){var h=e.lanes|e.childLanes;if(ro=h,h|=Xr,dv(t,l,h,n,a,s),Ca=null,(l&335544064)===l?(Aa=my(t),n=10262):(Aa=null,n=10256),(e.subtreeFlags&n)!==0||(e.flags&n)!==0?(t.callbackNode=null,t.callbackPriority=0,Xy(gs,function(){return go(),null})):(t.callbackNode=null,t.callbackPriority=0),hu=!1,n=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||n){n=K.T,K.T=null,a=st.p,st.p=2,s=_t,_t|=4;try{wy(t,e,l)}finally{_t=s,st.p=a,K.T=n}}Yt=1,hu?Oa=dx(f,t.containerInfo,Aa,ho,mo,Yy,po,go,$y):(ho(),mo(),po())}function $y(t){if(Yt!==0){var e=il.onRecoverableError;e(t,{componentStack:null})}}function Yy(){Yt===3&&(Yt=0,Hm(Qn,il),Yt=4)}function ho(){if(Yt===1){Yt=0;var t=il,e=Qn,l=xl,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=K.T,K.T=null;var a=st.p;st.p=2;var s=_t;_t|=4;try{wi=gu=!1,km(e,t,l),l=zo;var f=wd(t.containerInfo),h=l.focusedElem,x=l.selectionRange;if(f!==h&&h&&h.ownerDocument&&Ad(h.ownerDocument.documentElement,h)){if(x!==null&&$r(h)){var T=x.start,C=x.end;if(C===void 0&&(C=T),"selectionStart"in h)h.selectionStart=T,h.selectionEnd=Math.min(C,h.value.length);else{var D=h.ownerDocument||document,_=D&&D.defaultView||window;if(_.getSelection){var O=_.getSelection(),q=h.textContent.length,Z=Math.min(x.start,q),ct=x.end===void 0?Z:Math.min(x.end,q);!O.extend&&Z>ct&&(f=ct,ct=Z,Z=f);var E=Cd(h,Z),j=Cd(h,ct);if(E&&j&&(O.rangeCount!==1||O.anchorNode!==E.node||O.anchorOffset!==E.offset||O.focusNode!==j.node||O.focusOffset!==j.offset)){var z=D.createRange();z.setStart(E.node,E.offset),O.removeAllRanges(),Z>ct?(O.addRange(z),O.extend(j.node,j.offset)):(z.setEnd(j.node,j.offset),O.addRange(z))}}}}for(D=[],O=h;O=O.parentNode;)O.nodeType===1&&D.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<D.length;h++){var w=D[h];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Ya=!!Ro,zo=Ro=null}finally{_t=s,st.p=a,K.T=n}}t.current=e,Yt=2}}function mo(){if(Yt===2){Yt=0;var t=il,e=Qn,l=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||l){l=K.T,K.T=null;var n=st.p;st.p=2;var a=_t;_t|=4;try{Om(t,e.alternate,e)}finally{_t=a,st.p=n,K.T=l}}Yt=3}}function po(){if(Yt===4||Yt===3){Yt=0;var t=Oa;Oa=null,nv();var e=il,l=Qn,n=xl,a=Gm,s=(n&335544064)===n?10262:10256;if((l.subtreeFlags&s)!==0||(l.flags&s)!==0?Yt=5:(Yt=0,Qn=il=null,lp(e,e.pendingLanes)),s=e.pendingLanes,s===0&&(rn=null),_r(n),l=l.stateNode,De&&typeof De.onCommitFiberRoot=="function")try{De.onCommitFiberRoot(ei,l,void 0,(l.current.flags&128)===128)}catch{}if(a!==null){l=K.T,s=st.p,st.p=2,K.T=null;try{for(var f=e.onRecoverableError,h=0;h<a.length;h++){var x=a[h];f(x.value,{componentStack:x.stack})}}finally{K.T=l,st.p=s}}if(a=Ca,f=Aa,Aa=null,a!==null&&(Ca=null,f===null&&(f=[]),t!==null))for(x=0;x<a.length;x++)l=(0,a[x])(f),l!==void 0&&t.finished.finally(l);(xl&3)!==0&&zu(),bl(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===Eu?Ui++:(Ui=0,Eu=e):(Ui=0,Eu=null),Hi(0)}}function lp(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,vi(e)))}function zu(){return Oa!==null&&(Oa.skipTransition(),Oa=null),ho(),mo(),po(),go()}function go(){if(Yt!==5)return!1;var t=il,e=ro;ro=0;var l=_r(xl),n=K.T,a=st.p;try{st.p=32>l?32:l,K.T=null,l=co,co=null;var s=il,f=xl;if(Yt=0,Qn=il=null,xl=0,(_t&6)!==0)throw Error(c(331));var h=_t;if(_t|=4,$m(s.current),Lm(s,s.current,f,l),_t=h,Hi(0,!1),De&&typeof De.onPostCommitFiberRoot=="function")try{De.onPostCommitFiberRoot(ei,s)}catch{}return!0}finally{st.p=a,K.T=n,lp(t,e)}}function np(t,e,l){e=Qe(l,e),e=wc(t.stateNode,e,2),t=Pl(t,e,2),t!==null&&(ni(t,2),bl(t))}function Ot(t,e,l){if(t.tag===3)np(t,t,l);else for(;e!==null;){if(e.tag===3){np(e,t,l);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(rn===null||!rn.has(n))){t=Qe(l,t),l=Ph(2),n=Pl(e,l,2),n!==null&&(tm(l,n,e,t),ni(n,2),bl(n));break}}e=e.return}}function vo(t,e,l){var n=t.pingCache;if(n===null){n=t.pingCache=new ky;var a=new Set;n.set(e,a)}else a=n.get(e),a===void 0&&(a=new Set,n.set(e,a));a.has(l)||(so=!0,a.add(l),t=Vy.bind(null,t,e,l),e.then(t,t))}function Vy(t,e,l){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Dt===t&&(mt&l)===l&&((Xt===4||Xt===3&&(mt&62914560)===mt&&300>we()-ju)&&(_t&2)===0?Da(t,0):bu|=l,za===mt&&(za=0)),bl(t)}function ap(t,e){e===0&&(e=Vf()),t=On(t,e),t!==null&&(ni(t,e),bl(t))}function Gy(t){var e=t.memoizedState,l=0;e!==null&&(l=e.retryLane),ap(t,l)}function Qy(t,e){var l=0;switch(t.tag){case 31:case 13:var n=t.stateNode,a=t.memoizedState;a!==null&&(l=a.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(e),ap(t,l)}function Xy(t,e){return xr(t,e)}var ka=null,Ua=null,yo=!1,Ou=!1,xo=!1,on=0;function bl(t){t!==Ua&&t.next===null&&(Ua===null?ka=Ua=t:Ua=Ua.next=t),Ou=!0,yo||(yo=!0,Ky())}function Hi(t,e){if(!xo&&Ou){xo=!0;do for(var l=!1,n=ka;n!==null;){if(t!==0){var a=n.pendingLanes;if(a===0)var s=0;else{var f=n.suspendedLanes,h=n.pingedLanes;s=(1<<31-Me(42|t)+1)-1,s&=a&~(f&~h),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(l=!0,rp(n,s))}else s=mt,s=bs(n,n===Dt?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(s&3)===0||li(n,s)||(l=!0,rp(n,s));n=n.next}while(l);xo=!1}}function Zy(){ip()}function ip(){Ou=yo=!1;var t=0;on!==0&&ix()&&(t=on);for(var e=we(),l=null,n=ka;n!==null;){var a=n.next,s=sp(n,e);s===0?(n.next=null,l===null?ka=a:l.next=a,a===null&&(Ua=l)):(l=n,(t!==0||(s&3)!==0)&&(Ou=!0)),n=a}Yt!==0&&Yt!==5||Hi(t),on!==0&&(on=0)}function sp(t,e){for(var l=t.suspendedLanes,n=t.pingedLanes,a=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var f=31-Me(s),h=1<<f,x=a[f];x===-1?((h&l)===0||(h&n)!==0)&&(a[f]=fv(h,e)):x<=e&&(t.expiredLanes|=h),s&=~h}if(e=Dt,l=mt,l=bs(t,t===e?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n=t.callbackNode,l===0||t===e&&(zt===2||zt===9)||t.cancelPendingCommit!==null)return n!==null&&n!==null&&br(n),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||li(t,l)){if(e=l&-l,e===t.callbackPriority)return e;switch(n!==null&&br(n),_r(l)){case 2:case 8:l=qf;break;case 32:l=gs;break;case 268435456:l=$f;break;default:l=gs}return n=up.bind(null,t),l=xr(l,n),t.callbackPriority=e,t.callbackNode=l,e}return n!==null&&n!==null&&br(n),t.callbackPriority=2,t.callbackNode=null,2}function up(t,e){if(Yt!==0&&Yt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(zu()&&t.callbackNode!==l)return null;var n=mt;return n=bs(t,t===Dt?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n===0?null:(Xm(t,n,e),sp(t,we()),t.callbackNode!=null&&t.callbackNode===l?up.bind(null,t):null)}function rp(t,e){if(zu())return null;Xm(t,e,!0)}function Ky(){ux(function(){(_t&6)!==0?xr(Bf,Zy):ip()})}function bo(){if(on===0){var t=kn;t===0&&(t=vs,vs<<=1,(vs&261888)===0&&(vs=256)),on=t}return on}function cp(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ts(t)}function Jy(t,e,l,n,a){if(e==="submit"&&l&&l.stateNode===a){var s=cp((a[Ee]||null).action),f=n.submitter;f&&(e=(e=f[Ee]||null)?cp(e.formAction):f.getAttribute("formAction"),e!==null&&(s=e,f=null));var h=new Os("action","action",null,n,a);t.push({event:h,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(on!==0){var x=new FormData(a,f);Rc(l,{pending:!0,data:x,method:a.method,action:s},null,x)}}else typeof s=="function"&&(h.preventDefault(),x=new FormData(a,f),Rc(l,{pending:!0,data:x,method:a.method,action:s},s,x))},currentTarget:a}]})}}for(var jo=0;jo<Qr.length;jo++){var So=Qr[jo],Iy=So.toLowerCase(),Fy=So[0].toUpperCase()+So.slice(1);el(Iy,"on"+Fy)}el(kd,"onAnimationEnd"),el(Ud,"onAnimationIteration"),el(Hd,"onAnimationStart"),el("dblclick","onDoubleClick"),el("focusin","onFocus"),el("focusout","onBlur"),el(sy,"onTransitionRun"),el(uy,"onTransitionStart"),el(ry,"onTransitionCancel"),el(Ld,"onTransitionEnd"),aa("onMouseEnter",["mouseout","mouseover"]),aa("onMouseLeave",["mouseout","mouseover"]),aa("onPointerEnter",["pointerout","pointerover"]),aa("onPointerLeave",["pointerout","pointerover"]),Nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Nn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Li="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(" "),Wy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Li));function op(t,e){e=(e&4)!==0;for(var l=0;l<t.length;l++){var n=t[l],a=n.event;n=n.listeners;t:{var s=void 0;if(e)for(var f=n.length-1;0<=f;f--){var h=n[f],x=h.instance,T=h.currentTarget;if(h=h.listener,x!==s&&a.isPropagationStopped())break t;s=h,a.currentTarget=T;try{s(a)}catch(C){ws(C)}a.currentTarget=null,s=x}else for(f=0;f<n.length;f++){if(h=n[f],x=h.instance,T=h.currentTarget,h=h.listener,x!==s&&a.isPropagationStopped())break t;s=h,a.currentTarget=T;try{s(a)}catch(C){ws(C)}a.currentTarget=null,s=x}}}}function ht(t,e){var l=e[Jf];l===void 0&&(l=e[Jf]=new Set);var n=t+"__bubble";l.has(n)||(fp(e,t,2,!1),l.add(n))}function _o(t,e,l){var n=0;e&&(n|=4),fp(l,t,n,e)}var Cu="_reactListening"+Math.random().toString(36).slice(2);function Eo(t){if(!t[Cu]){t[Cu]=!0,Wf.forEach(function(l){l!=="selectionchange"&&(Wy.has(l)||_o(l,!1,t),_o(l,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Cu]||(e[Cu]=!0,_o("selectionchange",!1,e))}}function fp(t,e,l,n){switch(t0(e)){case 2:var a=Gx;break;case 8:a=Qx;break;default:a=Go}l=a.bind(null,e,l,t),a=void 0,!Ar||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(a=!0),n?a!==void 0?t.addEventListener(e,l,{capture:!0,passive:a}):t.addEventListener(e,l,!0):a!==void 0?t.addEventListener(e,l,{passive:a}):t.addEventListener(e,l,!1)}function To(t,e,l,n,a){var s=n;if((e&1)===0&&(e&2)===0&&n!==null)t:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var h=n.stateNode.containerInfo;if(h===a)break;if(f===4)for(f=n.return;f!==null;){var x=f.tag;if((x===3||x===4)&&f.stateNode.containerInfo===a)return;f=f.return}for(;h!==null;){if(f=Tn(h),f===null)return;if(x=f.tag,x===5||x===6||x===26||x===27){n=s=f;continue t}h=h.parentNode}}n=n.return}fd(function(){var T=s,C=Or(l),D=[];t:{var _=Bd.get(t);if(_!==void 0){var O=Os,q=t;switch(t){case"keypress":if(Rs(l)===0)break t;case"keydown":case"keyup":O=Uv;break;case"focusin":q="focus",O=kr;break;case"focusout":q="blur",O=kr;break;case"beforeblur":case"afterblur":O=kr;break;case"click":if(l.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=md;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=Ev;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=$v;break;case kd:case Ud:case Hd:O=Rv;break;case Ld:O=Vv;break;case"scroll":case"scrollend":O=Sv;break;case"wheel":O=Qv;break;case"copy":case"cut":case"paste":O=Ov;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=gd;break;case"submit":O=Bv;break;case"toggle":case"beforetoggle":O=Zv}var Z=(e&4)!==0,ct=!Z&&(t==="scroll"||t==="scrollend"),E=Z?_!==null?_+"Capture":null:_;Z=[];for(var j=T,z;j!==null;){var w=j;if(z=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||z===null||E===null||(w=si(j,E),w!=null&&Z.push(Bi(j,w,z))),ct)break;j=j.return}0<Z.length&&(_=new O(_,q,null,l,C),D.push({event:_,listeners:Z}))}}if((e&7)===0){t:{if(O=t==="mouseover"||t==="pointerover",_=t==="mouseout"||t==="pointerout",O&&l!==zr&&(q=l.relatedTarget||l.fromElement)&&(Tn(q)||q[ea]))break t;(_||O)&&(q=C.window===C?C:(O=C.ownerDocument)?O.defaultView||O.parentWindow:window,_?(O=l.relatedTarget||l.toElement,_=T,O=O?Tn(O):null,O!==null&&(ct=m(O),Z=O.tag,O!==ct||Z!==5&&Z!==27&&Z!==6)&&(O=null)):(_=null,O=T),_!==O&&(Z=md,w="onMouseLeave",E="onMouseEnter",j="mouse",(t==="pointerout"||t==="pointerover")&&(Z=gd,w="onPointerLeave",E="onPointerEnter",j="pointer"),ct=_==null?q:ii(_),z=O==null?q:ii(O),q=new Z(w,j+"leave",_,l,C),q.target=ct,q.relatedTarget=z,w=null,Tn(C)===T&&(Z=new Z(E,j+"enter",O,l,C),Z.target=z,Z.relatedTarget=ct,w=Z),ct=w,Z=_&&O?ot(_,O,Py):null,_!==null&&dp(D,q,_,Z,!1),O!==null&&ct!==null&&dp(D,ct,O,Z,!0)))}t:{if(_=T?ii(T):window,O=_.nodeName&&_.nodeName.toLowerCase(),O==="select"||O==="input"&&_.type==="file")var G=Ed;else if(Sd(_))if(Td)G=ny;else{G=ey;var pt=ty}else O=_.nodeName,!O||O.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?T&&Rr(T.elementType)&&(G=Ed):G=ly;if(G&&(G=G(t,T))){_d(D,G,l,C);break t}pt&&pt(t,_,T)}switch(pt=T?ii(T):window,t){case"focusin":(Sd(pt)||pt.contentEditable==="true")&&(oa=pt,Yr=T,mi=null);break;case"focusout":mi=Yr=oa=null;break;case"mousedown":Vr=!0;break;case"contextmenu":case"mouseup":case"dragend":Vr=!1,Dd(D,l,C);break;case"selectionchange":if(iy)break;case"keydown":case"keyup":Dd(D,l,C)}var I;if(Hr)t:{switch(t){case"compositionstart":var nt="onCompositionStart";break t;case"compositionend":nt="onCompositionEnd";break t;case"compositionupdate":nt="onCompositionUpdate";break t}nt=void 0}else ca?bd(t,l)&&(nt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(nt="onCompositionStart");nt&&(vd&&l.locale!=="ko"&&(ca||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&ca&&(I=dd()):(Gl=C,wr="value"in Gl?Gl.value:Gl.textContent,ca=!0)),pt=Au(T,nt),0<pt.length&&(nt=new pd(nt,t,null,l,C),D.push({event:nt,listeners:pt}),I?nt.data=I:(I=jd(l),I!==null&&(nt.data=I)))),(I=Jv?Iv(t,l):Fv(t,l))&&(nt=Au(T,"onBeforeInput"),0<nt.length&&(pt=new pd("onBeforeInput","beforeinput",null,l,C),D.push({event:pt,listeners:nt}),pt.data=I)),Jy(D,t,T,l,C)}op(D,e)})}function Bi(t,e,l){return{instance:t,listener:e,currentTarget:l}}function Au(t,e){for(var l=e+"Capture",n=[];t!==null;){var a=t,s=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||s===null||(a=si(t,l),a!=null&&n.unshift(Bi(t,a,s)),a=si(t,e),a!=null&&n.push(Bi(t,a,s))),t.tag===3)return n;t=t.return}return[]}function Py(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function dp(t,e,l,n,a){for(var s=e._reactName,f=[];l!==null&&l!==n;){var h=l,x=h.alternate,T=h.stateNode;if(h=h.tag,x!==null&&x===n)break;h!==5&&h!==26&&h!==27||T===null||(x=T,a?(T=si(l,s),T!=null&&f.unshift(Bi(l,T,x))):a||(T=si(l,s),T!=null&&f.push(Bi(l,T,x)))),l=l.return}f.length!==0&&t.push({event:e,listeners:f})}var tx=/\r\n?/g,ex=/\u0000|\uFFFD/g;function hp(t){return(typeof t=="string"?t:""+t).replace(tx,`
49
- `).replace(ex,"")}function mp(t,e){return e=hp(e),hp(t)===e}function Ct(t,e,l,n,a,s){switch(l){case"children":if(typeof n=="string")e==="body"||e==="textarea"&&n===""||sa(t,n);else if(typeof n=="number"||typeof n=="bigint")e!=="body"&&sa(t,""+n);else return;break;case"className":Es(t,"class",n);break;case"tabIndex":Es(t,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Es(t,l,n);break;case"style":cd(t,n,s);return;case"data":if(e!=="object"){Es(t,"data",n);break}case"src":case"href":if(n===""&&(e!=="a"||l!=="href")){t.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(l);break}n=Ts(n),t.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="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 s=="function"&&(l==="formAction"?(e!=="input"&&Ct(t,e,"name",a.name,a,null),Ct(t,e,"formEncType",a.formEncType,a,null),Ct(t,e,"formMethod",a.formMethod,a,null),Ct(t,e,"formTarget",a.formTarget,a,null)):(Ct(t,e,"encType",a.encType,a,null),Ct(t,e,"method",a.method,a,null),Ct(t,e,"target",a.target,a,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(l);break}n=Ts(n),t.setAttribute(l,n);break;case"onClick":n!=null&&(t.onclick=ol);return;case"onScroll":n!=null&&ht("scroll",t);return;case"onScrollEnd":n!=null&&ht("scrollend",t);return;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(c(60));(s!=null?s.__html:void 0)!==l&&(t.innerHTML=l)}}break;case"multiple":t.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":t.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){t.removeAttribute("xlink:href");break}l=Ts(n),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":n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(l,n):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":n===!0?t.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(l,n):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?t.setAttribute(l,n):t.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?t.removeAttribute(l):t.setAttribute(l,n);break;case"popover":ht("beforetoggle",t),ht("toggle",t),_s(t,"popover",n);break;case"xlinkActuate":Tl(t,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Tl(t,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Tl(t,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Tl(t,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Tl(t,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Tl(t,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Tl(t,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Tl(t,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Tl(t,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":_s(t,"is",n);break;case"innerText":case"textContent":return;default:if(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")l=bv.get(l)||l,_s(t,l,n);else return}jt=!0}function No(t,e,l,n,a,s){switch(l){case"style":cd(t,n,s);return;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(c(60));(s!=null?s.__html:void 0)!==l&&(t.innerHTML=l)}}break;case"children":if(typeof n=="string")sa(t,n);else if(typeof n=="number"||typeof n=="bigint")sa(t,""+n);else return;break;case"onScroll":n!=null&&ht("scroll",t);return;case"onScrollEnd":n!=null&&ht("scrollend",t);return;case"onClick":n!=null&&(t.onclick=ol);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Pf.hasOwnProperty(l))t:{if(l[0]==="o"&&l[1]==="n"&&(a=l.endsWith("Capture"),s=l.slice(2,a?l.length-7:void 0),e=t[Ee]||null,e=e!=null?e[l]:null,typeof e=="function"&&t.removeEventListener(s,e,a),typeof n=="function")){typeof e!="function"&&e!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(s,n,a);break t}jt=!0,l in t?t[l]=n:n===!0?t.setAttribute(l,""):_s(t,l,n)}return}jt=!0}function de(t,e,l){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",t),ht("load",t);var n=!1,a=!1,s;for(s in l)if(l.hasOwnProperty(s)){var f=l[s];if(f!=null)switch(s){case"src":n=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,e));default:Ct(t,e,s,f,l,null)}}a&&Ct(t,e,"srcSet",l.srcSet,l,null),n&&Ct(t,e,"src",l.src,l,null);return;case"input":ht("invalid",t);var h=s=f=a=null,x=null,T=null;for(n in l)if(l.hasOwnProperty(n)){var C=l[n];if(C!=null)switch(n){case"name":a=C;break;case"type":f=C;break;case"checked":x=C;break;case"defaultChecked":T=C;break;case"value":s=C;break;case"defaultValue":h=C;break;case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(c(137,e));break;default:Ct(t,e,n,C,l,null)}}id(t,s,h,x,T,f,a,!1);return;case"select":ht("invalid",t),n=f=s=null;for(a in l)if(l.hasOwnProperty(a)&&(h=l[a],h!=null))switch(a){case"value":s=h;break;case"defaultValue":f=h;break;case"multiple":n=h;default:Ct(t,e,a,h,l,null)}e=s,l=f,t.multiple=!!n,e!=null?ia(t,!!n,e,!1):l!=null&&ia(t,!!n,l,!0);return;case"textarea":ht("invalid",t),s=a=n=null;for(f in l)if(l.hasOwnProperty(f)&&(h=l[f],h!=null))switch(f){case"value":n=h;break;case"defaultValue":a=h;break;case"children":s=h;break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(c(91));break;default:Ct(t,e,f,h,l,null)}ud(t,n,a,s);return;case"option":for(x in l)if(l.hasOwnProperty(x)&&(n=l[x],n!=null))switch(x){case"selected":t.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ct(t,e,x,n,l,null)}return;case"dialog":ht("beforetoggle",t),ht("toggle",t),ht("cancel",t),ht("close",t);break;case"iframe":case"object":ht("load",t);break;case"video":case"audio":for(n=0;n<Li.length;n++)ht(Li[n],t);break;case"image":ht("error",t),ht("load",t);break;case"details":ht("toggle",t);break;case"embed":case"source":case"link":ht("error",t),ht("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(T in l)if(l.hasOwnProperty(T)&&(n=l[T],n!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,e));default:Ct(t,e,T,n,l,null)}return;default:if(Rr(e)){for(C in l)l.hasOwnProperty(C)&&(n=l[C],n!==void 0&&No(t,e,C,n,l,void 0));return}}for(h in l)l.hasOwnProperty(h)&&(n=l[h],n!=null&&Ct(t,e,h,n,l,null))}var lx={};function nx(t,e,l,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,s=null,f=null,h=null,x=null,T=null,C=null;for(O in l){var D=l[O];if(l.hasOwnProperty(O)&&D!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":x=D;default:n.hasOwnProperty(O)||Ct(t,e,O,null,n,D)}}for(var _ in n){var O=n[_];if(D=l[_],n.hasOwnProperty(_)&&(O!=null||D!=null))switch(_){case"type":O!==D&&(jt=!0),s=O;break;case"name":O!==D&&(jt=!0),a=O;break;case"checked":O!==D&&(jt=!0),T=O;break;case"defaultChecked":O!==D&&(jt=!0),C=O;break;case"value":O!==D&&(jt=!0),f=O;break;case"defaultValue":O!==D&&(jt=!0),h=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(c(137,e));break;default:O!==D&&Ct(t,e,_,O,n,D)}}Tr(t,f,h,x,T,C,s,a);return;case"select":O=f=h=_=null;for(s in l)if(x=l[s],l.hasOwnProperty(s)&&x!=null)switch(s){case"value":break;case"multiple":O=x;default:n.hasOwnProperty(s)||Ct(t,e,s,null,n,x)}for(a in n)if(s=n[a],x=l[a],n.hasOwnProperty(a)&&(s!=null||x!=null))switch(a){case"value":s!==x&&(jt=!0),_=s;break;case"defaultValue":s!==x&&(jt=!0),h=s;break;case"multiple":s!==x&&(jt=!0),f=s;default:s!==x&&Ct(t,e,a,s,n,x)}e=h,l=f,n=O,_!=null?ia(t,!!l,_,!1):!!n!=!!l&&(e!=null?ia(t,!!l,e,!0):ia(t,!!l,l?[]:"",!1));return;case"textarea":O=_=null;for(h in l)if(a=l[h],l.hasOwnProperty(h)&&a!=null&&!n.hasOwnProperty(h))switch(h){case"value":break;case"children":break;default:Ct(t,e,h,null,n,a)}for(f in n)if(a=n[f],s=l[f],n.hasOwnProperty(f)&&(a!=null||s!=null))switch(f){case"value":a!==s&&(jt=!0),_=a;break;case"defaultValue":a!==s&&(jt=!0),O=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(c(91));break;default:a!==s&&Ct(t,e,f,a,n,s)}sd(t,_,O);return;case"option":for(var q in l)if(_=l[q],l.hasOwnProperty(q)&&_!=null&&!n.hasOwnProperty(q))switch(q){case"selected":t.selected=!1;break;default:Ct(t,e,q,null,n,_)}for(x in n)if(_=n[x],O=l[x],n.hasOwnProperty(x)&&_!==O&&(_!=null||O!=null))switch(x){case"selected":_!==O&&(jt=!0),t.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:Ct(t,e,x,_,n,O)}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 Z in l)_=l[Z],l.hasOwnProperty(Z)&&_!=null&&!n.hasOwnProperty(Z)&&Ct(t,e,Z,null,n,_);for(T in n)if(_=n[T],O=l[T],n.hasOwnProperty(T)&&_!==O&&(_!=null||O!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(c(137,e));break;default:Ct(t,e,T,_,n,O)}return;default:if(Rr(e)){for(var ct in l)_=l[ct],l.hasOwnProperty(ct)&&_!==void 0&&!n.hasOwnProperty(ct)&&No(t,e,ct,void 0,n,_);for(C in n)_=n[C],O=l[C],!n.hasOwnProperty(C)||_===O||_===void 0&&O===void 0||No(t,e,C,_,n,O);return}}for(var E in l)_=l[E],l.hasOwnProperty(E)&&_!=null&&!n.hasOwnProperty(E)&&Ct(t,e,E,null,n,_);for(D in n)_=n[D],O=l[D],!n.hasOwnProperty(D)||_===O||_==null&&O==null||Ct(t,e,D,_,n,O)}function pp(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ax(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var a=l[n],s=a.transferSize,f=a.initiatorType,h=a.duration;if(s&&h&&pp(f)){for(f=0,h=a.responseEnd,n+=1;n<l.length;n++){var x=l[n],T=x.startTime;if(T>h)break;var C=x.transferSize,D=x.initiatorType;C&&pp(D)&&(x=x.responseEnd,f+=C*(x<h?1:(h-T)/(x-T)))}if(--n,e+=8*(s+f)/(a.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Ro=null,zo=null;function qi(t){return t.nodeType===9?t:t.ownerDocument}function gp(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 vp(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function yp(t,e,l,n){return l=qi(l).createElement(t),l[ue]=n,l[Ee]=e,de(l,t,e),le(l),l}function Oo(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Co=null;function ix(){var t=window.event;return t&&t.type==="popstate"?t===Co?!1:(Co=t,!0):(Co=null,!1)}var Ao=typeof setTimeout=="function"?setTimeout:void 0,sx=typeof clearTimeout=="function"?clearTimeout:void 0,xp=typeof Promise=="function"?Promise:void 0,bp=typeof requestAnimationFrame=="function"?requestAnimationFrame:Ao,ux=typeof queueMicrotask=="function"?queueMicrotask:typeof xp<"u"?function(t){return xp.resolve(null).then(t).catch(rx)}:Ao;function rx(t){setTimeout(function(){throw t})}function fn(t){return t==="head"}function jp(t,e){var l=e,n=0;do{var a=l.nextSibling;if(t.removeChild(l),a&&a.nodeType===8)if(l=a.data,l==="/$"||l==="/&"){if(n===0){t.removeChild(a),Va(e);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")Bo(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Bo(l);for(var s=l.firstChild;s;){var f=s.nextSibling,h=s.nodeName;s[ai]||h==="SCRIPT"||h==="STYLE"||h==="LINK"&&s.rel.toLowerCase()==="stylesheet"||l.removeChild(s),s=f}}else l==="body"&&Bo(t.ownerDocument.body);l=a}while(l);Va(e)}function Sp(t,e){var l=t;t=0;do{var n=l.nextSibling;if(l.nodeType===1?e?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(e?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=n}while(l)}function _p(t,e,l){if(e=CSS.escape(e)!==e?"r-"+btoa(e).replace(/=/g,""):e,t.style.viewTransitionName=e,l!=null&&(t.style.viewTransitionClass=l),l=getComputedStyle(t),l.display==="inline"){if(e=t.getClientRects(),e.length===1)var n=1;else for(var a=n=0;a<e.length;a++){var s=e[a];0<s.width&&0<s.height&&n++}n===1&&(t=t.style,t.display=e.length===1?"inline-block":"block",t.marginTop="-"+l.paddingTop,t.marginBottom="-"+l.paddingBottom)}}function Ep(t,e){t=t.style,e=e.style;var l=e!=null?e.hasOwnProperty("viewTransitionName")?e.viewTransitionName:e.hasOwnProperty("view-transition-name")?e["view-transition-name"]:null:null;t.viewTransitionName=l==null||typeof l=="boolean"?"":(""+l).trim(),l=e!=null?e.hasOwnProperty("viewTransitionClass")?e.viewTransitionClass:e.hasOwnProperty("view-transition-class")?e["view-transition-class"]:null:null,t.viewTransitionClass=l==null||typeof l=="boolean"?"":(""+l).trim(),t.display==="inline-block"&&(e==null?t.display=t.margin="":(l=e.display,t.display=l==null||typeof l=="boolean"?"":l,l=e.margin,l!=null?t.margin=l:(l=e.hasOwnProperty("marginTop")?e.marginTop:e["margin-top"],t.marginTop=l==null||typeof l=="boolean"?"":l,e=e.hasOwnProperty("marginBottom")?e.marginBottom:e["margin-bottom"],t.marginBottom=e==null||typeof e=="boolean"?"":e)))}function cx(t,e,l){return l=l.ownerDocument.defaultView,{rect:t,abs:e.position==="absolute"||e.position==="fixed",clip:e.clipPath!=="none"||e.overflow!=="visible"||e.filter!=="none"||e.mask!=="none"||e.mask!=="none"||e.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=l.innerHeight&&t.left<=l.innerWidth}}function wo(t){var e=t.getBoundingClientRect(),l=getComputedStyle(t);return cx(e,l,t)}function ox(t){return t.documentElement.clientHeight}function fx(t){this.addEventListener("load",t),this.addEventListener("error",t)}function dx(t,e,l,n,a,s,f,h,x){var T=e.nodeType===9?e:e.ownerDocument;try{var C=T.startViewTransition({update:function(){var _=T.defaultView,O=_.navigation&&_.navigation.transition,q=T.fonts.status;n();var Z=[];if(q==="loaded"&&(ox(T),T.fonts.status==="loading"&&Z.push(T.fonts.ready)),q=Z.length,t!==null)for(var ct=t.suspenseyImages,E=0,j=0;j<ct.length;j++){var z=ct[j];if(!z.complete){var w=z.getBoundingClientRect();if(0<w.bottom&&0<w.right&&w.top<_.innerHeight&&w.left<_.innerWidth){if(E+=Qp(z),E>Mu){Z.length=q;break}z=new Promise(fx.bind(z)),Z.push(z)}}}if(0<Z.length)return _=Promise.race([Promise.all(Z),new Promise(function(G){return setTimeout(G,500)})]).then(a,a),(O?Promise.allSettled([O.finished,_]):_).then(s,s);if(a(),O)return O.finished.then(s,s);s()},types:l});T.__reactViewTransition=C;var D=[];return C.ready.then(function(){for(var _=T.documentElement.getAnimations({subtree:!0}),O=0;O<_.length;O++){var q=_[O],Z=q.effect,ct=Z.pseudoElement;if(ct!=null&&ct.startsWith("::view-transition")){D.push(q),q=Z.getKeyframes();for(var E=ct=void 0,j=!0,z=0;z<q.length;z++){var w=q[z],G=w.width;if(ct===void 0)ct=G;else if(ct!==G){j=!1;break}if(G=w.height,E===void 0)E=G;else if(E!==G){j=!1;break}delete w.width,delete w.height,w.transform==="none"&&delete w.transform}j&&ct!==void 0&&E!==void 0&&(Z.setKeyframes(q),j=getComputedStyle(Z.target,Z.pseudoElement),j.width!==ct||j.height!==E)&&(j=q[0],j.width=ct,j.height=E,j=q[q.length-1],j.width=ct,j.height=E,Z.setKeyframes(q))}}f()},function(_){T.__reactViewTransition===C&&(T.__reactViewTransition=null);try{if(typeof _=="object"&&_!==null)switch(_.name){case"InvalidStateError":(_.message==="View transition was skipped because document visibility state is hidden."||_.message==="Skipping view transition because document visibility state has become hidden."||_.message==="Skipping view transition because viewport size changed."||_.message==="Transition was aborted because of invalid state")&&(_=null)}_!==null&&x(_)}finally{n(),a(),f()}}),C.finished.finally(function(){for(var _=0;_<D.length;_++)D[_].cancel();T.__reactViewTransition===C&&(T.__reactViewTransition=null),h()}),C}catch{return n(),a(),f(),null}}function Xn(t,e){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+e+")"}Xn.prototype.animate=function(t,e){return e=typeof e=="number"?{duration:e}:tt({},e),e.pseudoElement=this._selector,this._scope.animate(t,e)},Xn.prototype.getAnimations=function(){for(var t=this._scope,e=this._selector,l=t.getAnimations({subtree:!0}),n=[],a=0;a<l.length;a++){var s=l[a].effect;s!==null&&s.target===t&&s.pseudoElement===e&&n.push(l[a])}return n},Xn.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Tp(t){return{name:t,group:new Xn("group",t),imagePair:new Xn("image-pair",t),old:new Xn("old",t),new:new Xn("new",t)}}function Ye(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}Ye.prototype.addEventListener=function(t,e,l){var n=null,a=null;if(!(l!=null&&typeof l!="boolean"&&(n=l.signal||null,n!==null&&n.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var s=this._eventListeners;if(Rp(s,t,e,l)===-1){var f=this,h=e;l!=null&&typeof l!="boolean"&&l.once===!0&&(h=function(x){f.removeEventListener(t,e,l),typeof e=="function"?e.call(this,x):e.handleEvent(x)}),n!==null&&(a=f.removeEventListener.bind(f,t,e,l),n.addEventListener("abort",a,{once:!0}),a=n.removeEventListener.bind(n,"abort",a)),n=Ha(l),s.push({type:t,listener:e,optionsOrUseCapture:l,attachedListener:h,cleanup:a}),y(this._fragmentFiber.child,!1,hx,t,h,n)}this._eventListeners=s}};function hx(t,e,l,n){return H(t).addEventListener(e,l,n),!1}Ye.prototype.removeEventListener=function(t,e,l){var n=this._eventListeners;if(n!==null&&(e=Rp(n,t,e,l),e!==-1)){var a=n[e];l=a.attachedListener;var s=a.cleanup;a=Ha(a.optionsOrUseCapture),y(this._fragmentFiber.child,!1,mx,t,l,a),n.splice(e,1),s!==null&&s()}};function mx(t,e,l,n){return H(t).removeEventListener(e,l,n),!1}function Ha(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function Np(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function Rp(t,e,l,n){if(t.length===0)return-1;n=Np(n);for(var a=0;a<t.length;a++){var s=t[a];if(s.type===e&&s.listener===l&&Np(s.optionsOrUseCapture)===n)return a}return-1}Ye.prototype.dispatchEvent=function(t){var e=A(this._fragmentFiber);if(e===null)return!0;e=H(e);var l=this._eventListeners;if(l!==null&&0<l.length||!t.bubbles){var n=e.nodeType===9?e.createComment(""):document.createTextNode("");if(l)for(var a=0;a<l.length;a++){var s=l[a];n.addEventListener(s.type,s.attachedListener,Ha(s.optionsOrUseCapture))}if(e.appendChild(n),t=n.dispatchEvent(t),l)for(a=0;a<l.length;a++)s=l[a],n.removeEventListener(s.type,s.attachedListener,Ha(s.optionsOrUseCapture));return e.removeChild(n),t}return e.dispatchEvent(t)},Ye.prototype.focus=function(t){y(this._fragmentFiber.child,!0,zp,t,void 0,void 0)};function zp(t,e){return t.tag===6?!1:(t=H(t),Nx(t,e))}Ye.prototype.focusLast=function(t){var e=[];y(this._fragmentFiber.child,!0,Do,e,void 0,void 0);for(var l=e.length-1;0<=l&&!zp(e[l],t);l--);};function Do(t,e){return e.push(t),!1}Ye.prototype.blur=function(){var t=A(this._fragmentFiber);t!==null&&(t=H(t),t=qi(t).activeElement,t!==null&&y(this._fragmentFiber.child,!1,px,t,void 0,void 0))};function px(t,e){return t.tag===6?!1:(t=H(t),t===e||t.contains(e)?(e.blur(),!0):!1)}Ye.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),y(this._fragmentFiber.child,!1,gx,t,void 0,void 0)};function gx(t,e){return t.tag===6||(t=H(t),e.observe(t)),!1}Ye.prototype.unobserveUsing=function(t){var e=this._observers;if(e!==null&&e.has(t)){e.delete(t),y(this._fragmentFiber.child,!1,vx,t,void 0,void 0);for(var l=e=0;l<sl.length;l++){var n=sl[l];n.fragmentInstance===this&&n.observer===t?t.unobserve(n.instance):sl[e++]=n}sl.length=e}};function vx(t,e){return t.tag===6||(t=H(t),e.unobserve(t)),!1}var sl=[],Mo=!1;function yx(t,e,l){sl.push({fragmentInstance:t,observer:e,instance:l}),Mo||(Mo=!0,Rx(function(){Mo=!1;var n=sl;sl=[];for(var a=0;a<n.length;a++){var s=n[a];s.observer.unobserve(s.instance)}}))}Ye.prototype.getClientRects=function(){var t=[];return y(this._fragmentFiber.child,!1,xx,t,void 0,void 0),t};function xx(t,e){if(t.tag===6){t=t.stateNode;var l=t.ownerDocument.createRange();l.selectNodeContents(t),e.push.apply(e,l.getClientRects())}else t=H(t),e.push.apply(e,t.getClientRects());return!1}Ye.prototype.getRootNode=function(t){var e=A(this._fragmentFiber);return e===null?this:H(e).getRootNode(t)},Ye.prototype.compareDocumentPosition=function(t){var e=A(this._fragmentFiber);if(e===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var l=[];y(this._fragmentFiber.child,!1,Do,l,void 0,void 0);var n=H(e);if(l.length===0){if(l=n,L(this._fragmentFiber)){t:{for(e=this._fragmentFiber.return;e!==null;){if(e.tag===4){e=e.stateNode.containerInfo;break t}if(e.tag===3||e.tag===5||e.tag===27)break;e=e.return}e=null}e!=null&&(l=e)}e=this._fragmentFiber;var a=n=l.compareDocumentPosition(t);return l===t?a=Node.DOCUMENT_POSITION_CONTAINS:n&Node.DOCUMENT_POSITION_CONTAINED_BY&&(l=Q(e)[1],l===null?a=Node.DOCUMENT_POSITION_PRECEDING:(t=H(l).compareDocumentPosition(t),a=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),a|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}e=H(l[0]),a=H(l[l.length-1]);var s=L(this._fragmentFiber)?e.parentElement:n;if(s==null)return Node.DOCUMENT_POSITION_DISCONNECTED;n=s.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY,s=s.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY;var f=e.compareDocumentPosition(t),h=a.compareDocumentPosition(t),x=f&Node.DOCUMENT_POSITION_CONTAINED_BY||h&Node.DOCUMENT_POSITION_CONTAINED_BY;return h=n&&s&&f&Node.DOCUMENT_POSITION_FOLLOWING&&h&Node.DOCUMENT_POSITION_PRECEDING,e=n&&e===t||s&&a===t||x||h?Node.DOCUMENT_POSITION_CONTAINED_BY:!n&&e===t||!s&&a===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:f,e&Node.DOCUMENT_POSITION_DISCONNECTED||e&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||bx(e,this._fragmentFiber,l[0],l[l.length-1],t)?e:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function bx(t,e,l,n,a){var s=Tn(a);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(l=!!s)t:{for(;s!==null;){if(s.tag===7&&(s===e||s.alternate===e)){l=!0;break t}s=s.return}l=!1}return l}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(s===null)return s=a.ownerDocument,a===s||a===s.documentElement||a===s.body;t:{for(s=e,e=A(e);s!==null;){if(!(s.tag!==5&&s.tag!==3&&s.tag!==27||s!==e&&s.alternate!==e)){s=!0;break t}s=s.return}s=!1}return s}return t&Node.DOCUMENT_POSITION_PRECEDING?((e=!!s)&&!(e=s===l)&&(e=ot(l,s,$),e===null?e=!1:(y(e,!0,M,s,l),s=Y,Y=null,e=s!==null)),e):t&Node.DOCUMENT_POSITION_FOLLOWING?((e=!!s)&&!(e=s===n)&&(e=ot(n,s,$),e===null?e=!1:(y(e,!0,B,s,n),s=Y,J=Y=null,e=s!==null)),e):!1}function Op(t,e){var l=t.ownerDocument.createRange();l.selectNodeContents(t),t=l.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,e?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}Ye.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(c(566));var e=[];y(this._fragmentFiber.child,!1,Do,e,void 0,void 0);var l=t!==!1;if(e.length===0){var n=Q(this._fragmentFiber);if(n=l?n[1]||n[0]||A(this._fragmentFiber):n[0]||n[1],n===null)return;if(n.tag===6){t=H(n),Op(t,l);return}if(n=H(n),n.nodeType!==9){if(n.nodeType===11){l="host"in n?n.host:null,l!==null&&l.scrollIntoView(t);return}n.scrollIntoView(t)}}for(n=l?e.length-1:0;n!==(l?-1:e.length);){var a=e[n];a.tag===6?(a=H(a),Op(a,l)):H(a).scrollIntoView(t),n+=l?-1:1}};function jx(t,e){return t=H(t),Cp(t,e),!1}function Cp(t,e){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(e)}function Ap(t,e){var l=e._eventListeners;if(l!==null)for(var n=0;n<l.length;n++){var a=l[n];t.addEventListener(a.type,a.attachedListener,Ha(a.optionsOrUseCapture))}t.nodeType!==3&&(l=e._observers,l!==null&&l.forEach(function(s){for(var f=0,h=0;h<sl.length;h++){var x=sl[h];(x.fragmentInstance!==e||x.observer!==s||x.instance!==t)&&(sl[f++]=x)}sl.length=f,s.observe(t)}),Cp(t,e))}function Sx(t,e){var l=e._eventListeners;if(l!==null)for(var n=0;n<l.length;n++){var a=l[n];t.removeEventListener(a.type,a.attachedListener,Ha(a.optionsOrUseCapture))}t.nodeType!==3&&(l=e._observers,l!==null&&l.forEach(function(s){typeof s.rootMargin=="string"?yx(e,s,t):s.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(e))}function ko(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var l=e;switch(e=e.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ko(l),Ss(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function _x(t,e,l,n){for(;t.nodeType===1;){var a=l;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!n&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(n){if(!t[ai])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==a.rel||t.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||t.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||t.getAttribute("title")!==(a.title==null?null:a.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(s=t.getAttribute("src"),(s!==(a.src==null?null:a.src)||t.getAttribute("type")!==(a.type==null?null:a.type)||t.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=a.name==null?null:""+a.name;if(a.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=Ie(t.nextSibling),t===null)break}return null}function Ex(t,e,l){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Ie(t.nextSibling),t===null))return null;return t}function wp(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Ie(t.nextSibling),t===null))return null;return t}function Uo(t){return t.data==="$?"||t.data==="$~"}function Ho(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Tx(t,e){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||l.readyState!=="loading")e();else{var n=function(){e(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),t._reactRetry=n}}function Ie(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Lo=null;function Dp(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(e===0)return Ie(t.nextSibling);e--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||e++}t=t.nextSibling}return null}function Mp(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(e===0)return t;e--}else l!=="/$"&&l!=="/&"||e++}t=t.previousSibling}return null}function Nx(t,e){function l(){n=!0}if(t.ownerDocument.activeElement===t)return!0;var n=!1;try{t.ownerDocument.addEventListener("focus",l,!0),(t.focus||HTMLElement.prototype.focus).call(t,e)}finally{t.ownerDocument.removeEventListener("focus",l,!0)}return n}function Rx(t){bp(function(){bp(function(e){return t(e)})})}function kp(t,e,l){switch(e=qi(l),t){case"html":if(t=e.documentElement,!t)throw Error(c(452));return t;case"head":if(t=e.head,!t)throw Error(c(453));return t;case"body":if(t=e.body,!t)throw Error(c(454));return t;default:throw Error(c(451))}}function Up(t,e,l){for(var n in l){var a=l[n];l.hasOwnProperty(n)&&a!=null&&Ct(t,e,n,null,lx,a)}l.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===ol&&(t.onclick=null),Ss(t)}function Bo(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Ss(t)}var Fe=new Map,Hp=new Set;function $i(t){if(typeof t.getRootNode=="function"){var e=t.getRootNode();if(e.nodeType===9||e.nodeType===11)return e}return t.nodeType===9?t:t.ownerDocument}var Ll=st.d;st.d={f:zx,r:Ox,D:Cx,C:Ax,L:wx,m:Dx,X:kx,S:Mx,M:Ux};function zx(){var t=Ll.f(),e=Tu();return t||e}function Ox(t){var e=la(t);e!==null&&e.tag===5&&e.type==="form"?Bh(e):Ll.r(t)}var La=typeof document>"u"?null:document;function Lp(t,e,l){var n=La;if(n&&typeof e=="string"&&e){var a=Ve(e);a='link[rel="'+t+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),Hp.has(a)||(Hp.add(a),t={rel:t,crossOrigin:l,href:e},n.querySelector(a)===null&&(e=n.createElement("link"),de(e,"link",t),le(e),n.head.appendChild(e)))}}function Cx(t){Ll.D(t),Lp("dns-prefetch",t,null)}function Ax(t,e){Ll.C(t,e),Lp("preconnect",t,e)}function wx(t,e,l){Ll.L(t,e,l);var n=La;if(n&&t&&e){var a='link[rel="preload"][as="'+Ve(e)+'"]';e==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+Ve(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+Ve(l.imageSizes)+'"]')):a+='[href="'+Ve(t)+'"]';var s=a;switch(e){case"style":s=Ba(t);break;case"script":s=qa(t)}if(!(Fe.has(s)||(t=tt({rel:"preload",href:e==="image"&&l&&l.imageSrcSet?void 0:t,as:e},l),Fe.set(s,t),n.querySelector(a)!==null||e==="style"&&n.querySelector(Yi(s))||e==="script"&&n.querySelector(Vi(s))))){var f=n.createElement("link");de(f,"link",t),e==="style"&&(f[js]=!0,f.onload=f.onerror=function(){Ff(f)}),le(f),n.head.appendChild(f)}}}function Dx(t,e){Ll.m(t,e);var l=La;if(l&&t){var n=e&&typeof e.as=="string"?e.as:"script",a='link[rel="modulepreload"][as="'+Ve(n)+'"][href="'+Ve(t)+'"]',s=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=qa(t)}if(!Fe.has(s)&&(t=tt({rel:"modulepreload",href:t},e),Fe.set(s,t),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Vi(s)))return}n=l.createElement("link"),de(n,"link",t),le(n),l.head.appendChild(n)}}}function Mx(t,e,l){Ll.S(t,e,l);var n=La;if(n&&t){var a=na(n).hoistableStyles,s=Ba(t);e=e||"default";var f=a.get(s);if(!f){var h={loading:0,preload:null};if(f=n.querySelector(Yi(s)))h.loading=5;else{t=tt({rel:"stylesheet",href:t,"data-precedence":e},l),(l=Fe.get(s))&&qo(t,l);var x=f=n.createElement("link");le(x),de(x,"link",t),x._p=new Promise(function(T,C){x.onload=T,x.onerror=C}),x.addEventListener("load",function(){h.loading|=1}),x.addEventListener("error",function(){h.loading|=2}),h.loading|=4,wu(f,e,n)}f={type:"stylesheet",instance:f,count:1,state:h},a.set(s,f)}}}function kx(t,e){Ll.X(t,e);var l=La;if(l&&t){var n=na(l).hoistableScripts,a=qa(t),s=n.get(a);s||(s=l.querySelector(Vi(a)),s||(t=tt({src:t,async:!0},e),(e=Fe.get(a))&&$o(t,e),s=l.createElement("script"),le(s),de(s,"link",t),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(a,s))}}function Ux(t,e){Ll.M(t,e);var l=La;if(l&&t){var n=na(l).hoistableScripts,a=qa(t),s=n.get(a);s||(s=l.querySelector(Vi(a)),s||(t=tt({src:t,async:!0,type:"module"},e),(e=Fe.get(a))&&$o(t,e),s=l.createElement("script"),le(s),de(s,"link",t),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(a,s))}}function Bp(t,e,l,n){var a=(a=$l.current)?$i(a):null;if(!a)throw Error(c(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=Ba(l.href),e=na(a).hoistableStyles,n=e.get(l),n||(n={type:"style",instance:null,count:0,state:null},e.set(l,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Ba(l.href);var s=na(a).hoistableStyles,f=s.get(t);if(f||(a=a.ownerDocument||a,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,f),(s=a.querySelector(Yi(t)))?s._p||(f.instance=s,f.state.loading=5):(s=Fe.get(t),s||(s={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Fe.set(t,s)),Hx(a,t,s,f.state))),e&&n===null)throw Error(c(528,""));return f}if(e&&n!==null)throw Error(c(529,""));return null;case"script":return e=l.async,l=l.src,typeof l=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(l=qa(l),e=na(a).hoistableScripts,n=e.get(l),n||(n={type:"script",instance:null,count:0,state:null},e.set(l,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,t))}}function Ba(t){return'href="'+Ve(t)+'"'}function Yi(t){return'link[rel="stylesheet"]['+t+"]"}function qp(t){return tt({},t,{"data-precedence":t.precedence,precedence:null})}function Hx(t,e,l,n){if(e=t.querySelector('link[rel="preload"][as="style"]['+e+"]")){if(e[js]!==!0){n.loading=1;return}}else e=t.createElement("link"),e[js]=!0,e.onload=e.onerror=Ff.bind(null,e),de(e,"link",l),le(e),t.head.appendChild(e);n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2})}function qa(t){return'[src="'+Ve(t)+'"]'}function Vi(t){return"script[async]"+t}function $p(t,e,l){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+Ve(l.href)+'"]');if(n)return e.instance=n,le(n),n;var a=tt({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),le(n),de(n,"style",a),wu(n,l.precedence,t),e.instance=n;case"stylesheet":a=Ba(l.href);var s=t.querySelector(Yi(a));if(s)return e.state.loading|=4,e.instance=s,le(s),s;n=qp(l),(a=Fe.get(a))&&qo(n,a),s=(t.ownerDocument||t).createElement("link"),le(s);var f=s;return f._p=new Promise(function(h,x){f.onload=h,f.onerror=x}),de(s,"link",n),e.state.loading|=4,wu(s,l.precedence,t),e.instance=s;case"script":return s=qa(l.src),(a=t.querySelector(Vi(s)))?(e.instance=a,le(a),a):(n=l,(a=Fe.get(s))&&(n=tt({},l),$o(n,a)),t=t.ownerDocument||t,a=t.createElement("script"),le(a),de(a,"link",n),t.head.appendChild(a),e.instance=a);case"void":return null;default:throw Error(c(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(n=e.instance,e.state.loading|=4,wu(n,l.precedence,t));return e.instance}function wu(t,e,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,s=a,f=0;f<n.length;f++){var h=n[f];if(h.dataset.precedence===e)s=h;else if(s!==a)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=l.nodeType===9?l.head:l,e.insertBefore(t,e.firstChild))}function qo(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function $o(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Du=null;function Yp(t,e,l){if(Du===null){var n=new Map,a=Du=new Map;a.set(l,n)}else a=Du,n=a.get(l),n||(n=new Map,a.set(l,n));if(n.has(t))return n;for(n.set(t,null),l=l.getElementsByTagName(t),a=0;a<l.length;a++){var s=l[a];if(!(s[ai]||s[ue]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var f=s.getAttribute(e)||"";f=t+f;var h=n.get(f);h?h.push(s):n.set(f,[s])}}return n}function Yo(t,e,l){t=t.ownerDocument||t,t.head.insertBefore(l,e==="title"?t.querySelector("head > title"):null)}function Lx(t,e,l){if(l===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Vp(t,e){return t==="img"&&e.src!=null&&e.src!==""&&e.onLoad==null&&e.loading!=="lazy"}function Gp(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Qp(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Xp(t,e){typeof e.decode=="function"&&(t.imgCount++,e.complete||(t.imgBytes+=Qp(e),t.suspenseyImages.push(e)),t=$x.bind(t),e.decode().then(t,t))}function Bx(t,e,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var a=Ba(n.href),s=e.querySelector(Yi(a));if(s){e=s._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Gi.bind(t),e.then(t,t)),l.state.loading|=4,l.instance=s,le(s);return}s=e.ownerDocument||e,n=qp(n),(a=Fe.get(a))&&qo(n,a),s=s.createElement("link"),le(s);var f=s;f._p=new Promise(function(h,x){f.onload=h,f.onerror=x}),de(s,"link",n),l.instance=s}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,e),(e=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Gi.bind(t),e.addEventListener("load",l),e.addEventListener("error",l))}}var Mu=0;function qx(t,e){return t.stylesheets&&t.count===0&&Uu(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var n=setTimeout(function(){if(t.stylesheets&&Uu(t,t.stylesheets),t.unsuspend){var s=t.unsuspend;t.unsuspend=null,s()}},6e4+e);0<t.imgBytes&&Mu===0&&(Mu=62500*ax());var a=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Uu(t,t.stylesheets),t.unsuspend)){var s=t.unsuspend;t.unsuspend=null,s()}},(t.imgBytes>Mu?50:800)+e);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function Zp(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)Uu(t,t.stylesheets);else if(t.unsuspend){var e=t.unsuspend;t.unsuspend=null,e()}}}function Gi(){this.count--,Zp(this)}function $x(){this.imgCount--,Zp(this)}var ku=null;function Uu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ku=new Map,e.forEach(Yx,t),ku=null,Gi.call(t))}function Yx(t,e){if(!(e.state.loading&4)){var l=ku.get(t);if(l)var n=l.get(null);else{l=new Map,ku.set(t,l);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<a.length;s++){var f=a[s];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(l.set(f.dataset.precedence,f),n=f)}n&&l.set(null,n)}a=e.instance,f=a.getAttribute("data-precedence"),s=l.get(f)||n,s===n&&l.set(null,a),l.set(f,a),this.count++,n=Gi.bind(this),a.addEventListener("load",n),a.addEventListener("error",n),s?s.parentNode.insertBefore(a,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(a,t.firstChild)),e.state.loading|=4}}var $a={$$typeof:It,Provider:null,Consumer:null,_currentValue:_l,_currentValue2:_l,_threadCount:0};function Vx(t,e,l,n,a,s,f,h,x){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=jr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jr(0),this.hiddenUpdates=jr(null),this.identifierPrefix=n,this.onUncaughtError=a,this.onCaughtError=s,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.transitionTypes=null,this.incompleteTransitions=new Map}function Kp(t,e,l,n,a,s,f,h,x,T,C,D){return t=new Vx(t,e,l,f,x,T,C,D,h),e=1,s===!0&&(e|=24),s=Te(3,null,null,e),t.current=s,s.stateNode=t,e=lc(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:n,isDehydrated:l,cache:e},sc(s),t}function Jp(t){return t?(t=ha,t):ha}function Ip(t,e,l,n,a,s){a=Jp(a),n.context===null?n.context=a:n.pendingContext=a,n=Wl(e),n.payload={element:l},s=s===void 0?null:s,s!==null&&(n.callback=s),l=Pl(t,n,e),l!==null&&(Oe(l,t,e),ji(l,t,e))}function Fp(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<e?l:e}}function Vo(t,e){Fp(t,e),(t=t.alternate)&&Fp(t,e)}function Wp(t){if(t.tag===13||t.tag===31){var e=On(t,67108864);e!==null&&Oe(e,t,67108864),Vo(t,67108864)}}function Pp(t){if(t.tag===13||t.tag===31){var e=$e();e=Sr(e);var l=On(t,e);l!==null&&Oe(l,t,e),Vo(t,e)}}var Ya=!0;function Gx(t,e,l,n){var a=K.T;K.T=null;var s=st.p;try{st.p=2,Go(t,e,l,n)}finally{st.p=s,K.T=a}}function Qx(t,e,l,n){var a=K.T;K.T=null;var s=st.p;try{st.p=8,Go(t,e,l,n)}finally{st.p=s,K.T=a}}function Go(t,e,l,n){if(Ya){var a=Qo(n);if(a===null)To(t,e,n,Hu,l),e0(t,n);else if(Zx(a,t,e,l,n))n.stopPropagation();else if(e0(t,n),e&4&&-1<Xx.indexOf(t)){for(;a!==null;){var s=la(a);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var f=En(s.pendingLanes);if(f!==0){var h=s;for(h.pendingLanes|=2,h.entangledLanes|=2;f;){var x=1<<31-Me(f);h.entanglements[1]|=x,f&=~x}bl(s),(_t&6)===0&&(Su=we()+500,Hi(0))}}break;case 31:case 13:h=On(s,2),h!==null&&Oe(h,s,2),Tu(),Vo(s,2)}if(s=Qo(n),s===null&&To(t,e,n,Hu,l),s===a)break;a=s}a!==null&&n.stopPropagation()}else To(t,e,n,null,l)}}function Qo(t){return t=Or(t),Xo(t)}var Hu=null;function Xo(t){if(Hu=null,t=Tn(t),t!==null){var e=m(t);if(e===null)t=null;else{var l=e.tag;if(l===13){if(t=p(e),t!==null)return t;t=null}else if(l===31){if(t=g(e),t!==null)return t;t=null}else if(l===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Hu=t,null}function t0(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"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(av()){case Bf:return 2;case qf:return 8;case gs:case iv:return 32;case $f:return 268435456;default:return 32}default:return 32}}var Zo=!1,dn=null,hn=null,mn=null,Qi=new Map,Xi=new Map,pn=[],Xx="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 e0(t,e){switch(t){case"focusin":case"focusout":dn=null;break;case"dragenter":case"dragleave":hn=null;break;case"mouseover":case"mouseout":mn=null;break;case"pointerover":case"pointerout":Qi.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xi.delete(e.pointerId)}}function Zi(t,e,l,n,a,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:l,eventSystemFlags:n,nativeEvent:s,targetContainers:[a]},e!==null&&(e=la(e),e!==null&&Wp(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,a!==null&&e.indexOf(a)===-1&&e.push(a),t)}function Zx(t,e,l,n,a){switch(e){case"focusin":return dn=Zi(dn,t,e,l,n,a),!0;case"dragenter":return hn=Zi(hn,t,e,l,n,a),!0;case"mouseover":return mn=Zi(mn,t,e,l,n,a),!0;case"pointerover":var s=a.pointerId;return Qi.set(s,Zi(Qi.get(s)||null,t,e,l,n,a)),!0;case"gotpointercapture":return s=a.pointerId,Xi.set(s,Zi(Xi.get(s)||null,t,e,l,n,a)),!0}return!1}function l0(t){var e=Tn(t.target);if(e!==null){var l=m(e);if(l!==null){if(e=l.tag,e===13){if(e=p(l),e!==null){t.blockedOn=e,Kf(t.priority,function(){Pp(l)});return}}else if(e===31){if(e=g(l),e!==null){t.blockedOn=e,Kf(t.priority,function(){Pp(l)});return}}else if(e===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Lu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var l=Qo(t.nativeEvent);if(l===null){l=t.nativeEvent;var n=new l.constructor(l.type,l);zr=n,l.target.dispatchEvent(n),zr=null}else return e=la(l),e!==null&&Wp(e),t.blockedOn=l,!1;e.shift()}return!0}function n0(t,e,l){Lu(t)&&l.delete(e)}function Kx(){Zo=!1,dn!==null&&Lu(dn)&&(dn=null),hn!==null&&Lu(hn)&&(hn=null),mn!==null&&Lu(mn)&&(mn=null),Qi.forEach(n0),Xi.forEach(n0)}function Bu(t,e){t.blockedOn===e&&(t.blockedOn=null,Zo||(Zo=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Kx)))}var qu=null;function a0(t){qu!==t&&(qu=t,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){qu===t&&(qu=null);for(var e=0;e<t.length;e+=3){var l=t[e],n=t[e+1],a=t[e+2];if(typeof n!="function"){if(Xo(n||l)===null)continue;break}var s=la(l);s!==null&&(t.splice(e,3),e-=3,Rc(s,{pending:!0,data:a,method:l.method,action:n},n,a))}}))}function Va(t){function e(x){return Bu(x,t)}dn!==null&&Bu(dn,t),hn!==null&&Bu(hn,t),mn!==null&&Bu(mn,t),Qi.forEach(e),Xi.forEach(e);for(var l=0;l<pn.length;l++){var n=pn[l];n.blockedOn===t&&(n.blockedOn=null)}for(;0<pn.length&&(l=pn[0],l.blockedOn===null);)l0(l),l.blockedOn===null&&pn.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var a=l[n],s=l[n+1],f=a[Ee]||null;if(typeof s=="function")f||a0(l);else if(f){var h=null;if(s&&s.hasAttribute("formAction")){if(a=s,f=s[Ee]||null)h=f.formAction;else if(Xo(a)!==null)continue}else h=f.action;typeof h=="function"?l[n+1]=h:(l.splice(n,3),n-=3),a0(l)}}}function i0(){function t(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(f){return a=f})},focusReset:"manual",scroll:"manual"})}function e(){a!==null&&(a(),a=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,a=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),a!==null&&(a(),a=null)}}}function Ko(t){this._internalRoot=t}$u.prototype.render=Ko.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(c(409));var l=e.current,n=$e();Ip(l,n,t,e,null,null)},$u.prototype.unmount=Ko.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ip(t.current,2,null,t,null,null),Tu(),e[ea]=null}};function $u(t){this._internalRoot=t}$u.prototype.unstable_scheduleHydration=function(t){if(t){var e=Zf();t={blockedOn:null,target:t,priority:e};for(var l=0;l<pn.length&&e!==0&&e<pn[l].priority;l++);pn.splice(l,0,t),l===0&&l0(t)}};var s0=r.version;if(s0!=="19.3.0")throw Error(c(527,s0,"19.3.0"));st.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(c(188)):(t=Object.keys(t).join(","),Error(c(268,t)));return t=v(e),t=t!==null?R(t):null,t=t===null?null:t.stateNode,t};var Jx={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yu.isDisabled&&Yu.supportsFiber)try{ei=Yu.inject(Jx),De=Yu}catch{}}return Ji.createRoot=function(t,e){if(!d(t))throw Error(c(299));var l=!1,n="",a=Jh,s=Ih,f=Fh;return e!=null&&(e.unstable_strictMode===!0&&(l=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onUncaughtError!==void 0&&(a=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(f=e.onRecoverableError)),e=Kp(t,1,!1,null,null,l,n,null,a,s,f,i0),t[ea]=e.current,Eo(t),new Ko(e)},Ji.hydrateRoot=function(t,e,l){if(!d(t))throw Error(c(299));var n=!1,a="",s=Jh,f=Ih,h=Fh,x=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(a=l.identifierPrefix),l.onUncaughtError!==void 0&&(s=l.onUncaughtError),l.onCaughtError!==void 0&&(f=l.onCaughtError),l.onRecoverableError!==void 0&&(h=l.onRecoverableError),l.formState!==void 0&&(x=l.formState)),e=Kp(t,1,!0,e,l??null,n,a,x,s,f,h,i0),e.context=Jp(null),l=e.current,n=$e(),n=Sr(n),a=Wl(n),a.callback=null,Pl(l,a,n),l=n,e.current.lanes=l,ni(e,l),bl(e),t[ea]=e.current,Eo(t),new $u(e)},Ji.version="19.3.0",Ji}var g0;function i1(){if(g0)return Io.exports;g0=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),Io.exports=a1(),Io.exports}var s1=i1(),N=_f();/**
50
- * @license lucide-react v0.577.0 - ISC
51
- *
52
- * This source code is licensed under the ISC license.
53
- * See the LICENSE file in the root directory of this source tree.
54
- */const V0=(...i)=>i.filter((r,o,c)=>!!r&&r.trim()!==""&&c.indexOf(r)===o).join(" ").trim();/**
55
- * @license lucide-react v0.577.0 - ISC
56
- *
57
- * This source code is licensed under the ISC license.
58
- * See the LICENSE file in the root directory of this source tree.
59
- */const u1=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
60
- * @license lucide-react v0.577.0 - ISC
61
- *
62
- * This source code is licensed under the ISC license.
63
- * See the LICENSE file in the root directory of this source tree.
64
- */const r1=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,o,c)=>c?c.toUpperCase():o.toLowerCase());/**
65
- * @license lucide-react v0.577.0 - ISC
66
- *
67
- * This source code is licensed under the ISC license.
68
- * See the LICENSE file in the root directory of this source tree.
69
- */const v0=i=>{const r=r1(i);return r.charAt(0).toUpperCase()+r.slice(1)};/**
70
- * @license lucide-react v0.577.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */var c1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
75
- * @license lucide-react v0.577.0 - ISC
76
- *
77
- * This source code is licensed under the ISC license.
78
- * See the LICENSE file in the root directory of this source tree.
79
- */const o1=i=>{for(const r in i)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1};/**
80
- * @license lucide-react v0.577.0 - ISC
81
- *
82
- * This source code is licensed under the ISC license.
83
- * See the LICENSE file in the root directory of this source tree.
84
- */const f1=N.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:d="",children:m,iconNode:p,...g},b)=>N.createElement("svg",{ref:b,...c1,width:r,height:r,stroke:i,strokeWidth:c?Number(o)*24/Number(r):o,className:V0("lucide",d),...!m&&!o1(g)&&{"aria-hidden":"true"},...g},[...p.map(([v,R])=>N.createElement(v,R)),...Array.isArray(m)?m:[m]]));/**
85
- * @license lucide-react v0.577.0 - ISC
86
- *
87
- * This source code is licensed under the ISC license.
88
- * See the LICENSE file in the root directory of this source tree.
89
- */const pe=(i,r)=>{const o=N.forwardRef(({className:c,...d},m)=>N.createElement(f1,{ref:m,iconNode:r,className:V0(`lucide-${u1(v0(i))}`,`lucide-${i}`,c),...d}));return o.displayName=v0(i),o};/**
90
- * @license lucide-react v0.577.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */const d1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],h1=pe("chevron-down",d1);/**
95
- * @license lucide-react v0.577.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */const m1=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],p1=pe("chevron-right",m1);/**
100
- * @license lucide-react v0.577.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const g1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ef=pe("external-link",g1);/**
105
- * @license lucide-react v0.577.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */const v1=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],y1=pe("folder-git-2",v1);/**
110
- * @license lucide-react v0.577.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const x1=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],G0=pe("git-pull-request",x1);/**
115
- * @license lucide-react v0.577.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const b1=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],j1=pe("layout-dashboard",b1);/**
120
- * @license lucide-react v0.577.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const S1=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],_1=pe("list-checks",S1);/**
125
- * @license lucide-react v0.577.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const E1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],T1=pe("menu",E1);/**
130
- * @license lucide-react v0.577.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const N1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],R1=pe("message-circle-question-mark",N1);/**
135
- * @license lucide-react v0.577.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const z1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],O1=pe("message-square",z1);/**
140
- * @license lucide-react v0.577.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const C1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],A1=pe("moon",C1);/**
145
- * @license lucide-react v0.577.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const w1=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],D1=pe("receipt-text",w1);/**
150
- * @license lucide-react v0.577.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const M1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],y0=pe("rotate-ccw",M1);/**
155
- * @license lucide-react v0.577.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const k1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],U1=pe("settings",k1);/**
160
- * @license lucide-react v0.577.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const H1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],L1=pe("shield-check",H1);/**
165
- * @license lucide-react v0.577.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const B1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],q1=pe("sun",B1);/**
170
- * @license lucide-react v0.577.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const $1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],x0=pe("triangle-alert",$1),Q0={label:"Unverified (signature not checked)",tone:"warn"},b0={VERIFIED:{label:"Verified",tone:"good"},PARTIAL:{label:"Partly verified",tone:"warn"},FAILED:{label:"Failed",tone:"bad"},BLOCKED:{label:"Needs your answer",tone:"warn"},SPEC_CONFLICT:{label:"Needs your answer",tone:"warn"},ALREADY_SATISFIED:{label:"Already done",tone:"good"},UNVERIFIED:Q0,TAMPERED:{label:"Tampered",tone:"bad"},RUNNING:{label:"Running",tone:"neutral"}},Y1=/^(BUDGET|COST_CAP|CAP_REACHED|OVER_BUDGET|STOPPED_BUDGET)/;function Ae(i){if(typeof i!="string"||!i.trim())return{label:"Running",tone:"neutral"};const r=i.trim(),o=r.toUpperCase().replace(/[\s-]+/g,"_");if(b0[o])return b0[o];if(Y1.test(o))return{label:"Stopped (budget)",tone:"warn"};if(/_?\(SIGNATURE_NOT_CHECKED\)$/.test(o)||/_?\(UNATTESTED\)$/.test(o))return Q0;const c=r.replace(/[_-]+/g," ").replace(/\s+/g," ").toLowerCase();return{label:c.charAt(0).toUpperCase()+c.slice(1),tone:"neutral"}}const V1=/\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)|\u001b[@-Z\\-_]/g,G1=/\[\d{1,3}(?:;\d{1,3})*m/g;function Fu(i){return typeof i!="string"?"":i.replace(V1,"").replace(G1,"").replace(/\u001b/g,"")}function Pe(i){const r=Math.abs(i);return`$${r===0?"0.000":r<.01?i.toFixed(3):i.toFixed(2)}`}const j0=new Set(["VERIFIED","ALREADY_SATISFIED"]),nr=i=>{if(i.tampered)return"TAMPERED";if(typeof i.verdict!="string")return i.verdict;const r=i.verdict.trim().toUpperCase();return i.attested===!1?j0.has(r)?"UNVERIFIED":`${i.verdict} (unattested)`:j0.has(r)?i.sig_checked===!1?`${r} (signature not checked)`:r:i.verdict},ss=()=>globalThis.LOKI_CONTROL_BASE??"",S0="loki-control-token";function _e(){var i,r;try{const o=/[#&]token=([^&]+)/.exec(((i=globalThis.location)==null?void 0:i.hash)??"");return o!=null&&o[1]&&(sessionStorage.setItem(S0,decodeURIComponent(o[1])),(r=globalThis.history)==null||r.replaceState(null,"",globalThis.location.pathname+globalThis.location.search)),sessionStorage.getItem(S0)}catch{return null}}const us=(i={})=>{const r=_e();return r?{...i,authorization:`Bearer ${r}`}:i};async function rs(i){const r=await fetch(`${ss()}${i}`,{headers:us()});if(!r.ok)throw new Error(`${i}: HTTP ${r.status}`);return await r.json()}const Q1=()=>rs("/health");function In(i={}){const r=new URLSearchParams;for(const[c,d]of Object.entries(i))d&&r.set(c,d);const o=r.toString();return rs(`/v1/runs${o?`?${o}`:""}`)}function ar(i,r){return rs(`/v1/runs/${encodeURIComponent(i)}/${encodeURIComponent(r)}`)}async function X0(i,r,o){const c=await fetch(`${ss()}/v1/runs/${encodeURIComponent(i)}/${encodeURIComponent(r)}/answer`,{method:"POST",headers:us({"content-type":"application/json"}),body:JSON.stringify({answer:o})}),d=await c.json();if(!c.ok)throw new Error(d.error??`HTTP ${c.status}`);return{path:d.path??"",resume:d.resume??""}}async function X1(i,r){const o=await fetch(`${ss()}${i}`,{method:"POST",headers:us({"content-type":"application/json"}),body:JSON.stringify(r)}),c=await o.json().catch(()=>({}));if(!o.ok)throw new Error(c.error??`HTTP ${o.status}`);return c}const Z1=()=>X1("/v1/import",{}),K1=()=>rs("/v1/repos");function Z0(i,r=3e3){const o=new AbortController,c=d=>new Promise(m=>{const p=setTimeout(m,d);o.signal.addEventListener("abort",()=>{clearTimeout(p),m()},{once:!0})});return(async()=>{for(;!o.signal.aborted;){try{const d=await fetch(`${ss()}/v1/stream`,{headers:us({accept:"text/event-stream"}),signal:o.signal});if(d.ok&&d.body){const m=d.body.getReader(),p=new TextDecoder;let g="";for(;;){const{value:b,done:v}=await m.read();if(v)break;g+=p.decode(b,{stream:!0});const R=g.split(`
175
-
176
- `);g=R.pop()??"",R.some(y=>/^event: run$/m.test(y))&&i()}}}catch{}await c(r)}})(),()=>o.abort()}async function J1(i,r){const o=await fetch(`${ss()}/v1/runs/${encodeURIComponent(i)}/${encodeURIComponent(r)}`,{method:"DELETE",headers:us({"content-type":"application/json"})}),c=await o.json().catch(()=>({}));if(!o.ok)throw new Error(c.error??`HTTP ${o.status}`);return{ok:!0,removed:c.removed??{runs:0,events:0,sources:0},remaining_runs:c.remaining_runs??0}}const I1=()=>rs("/v1/doctor"),k=i=>`var(--cp-${i})`,F1=(...i)=>i.filter(Boolean).join(" ")||void 0,K0={success:k("success-muted"),warning:k("warning-muted"),error:k("error-muted"),info:k("info-muted"),neutral:k("bg-3")},J0={success:k("success-ink"),warning:k("warning-ink"),error:k("error-ink"),info:k("info-ink"),neutral:k("text-2")};function Vt({interactive:i,compact:r,style:o,className:c,children:d,...m}){return u.jsx("div",{...m,"data-cp":"card","data-interactive":i?"true":void 0,className:F1("cp-card",c),style:{background:k("card"),border:`1px solid ${k("border")}`,borderRadius:k("radius-lg"),padding:r?10:16,transition:`transform ${k("dur-fast")} ${k("ease")}, box-shadow ${k("dur-fast")} ${k("ease")}`,...i?{cursor:"pointer",boxShadow:k("shadow-sm")}:null,...o},children:d})}function Kn({label:i,value:r,icon:o,trend:c,trendTone:d="neutral",series:m,compact:p}){const g=m&&m.length>1?m:null;let b=null;if(g){const v=Math.min(...g),R=Math.max(...g),y=R-v||1,A=g.map((L,Q)=>`${Q?"L":"M"}${(Q/(g.length-1)*80).toFixed(1)} ${(22-(L-v)/y*20).toFixed(1)}`).join(" ");b=u.jsx("svg",{"data-cp":"sparkline",width:80,height:24,viewBox:"0 0 80 24","aria-hidden":"true",children:u.jsx("path",{d:A,fill:"none",stroke:k("accent"),strokeWidth:1.5})})}return u.jsxs(Vt,{"data-cp-kind":"kpi",style:{padding:p?"10px 12px":"14px 16px",display:"flex",gap:10,alignItems:"center"},children:[o?u.jsx("span",{style:{width:28,height:28,borderRadius:6,background:k("accent-muted"),color:k("accent"),display:"inline-flex",alignItems:"center",justifyContent:"center"},children:o}):null,u.jsxs("div",{style:{flex:1,minWidth:0},children:[u.jsx("div",{style:{fontSize:k("text-sm"),color:k("text-2")},children:i}),u.jsx("div",{style:{fontFamily:k("font-mono"),fontSize:p?20:28,fontWeight:500,lineHeight:1.2},children:r})]}),c?u.jsx("span",{style:{fontSize:11,borderRadius:3,padding:"1px 6px",background:K0[d],color:J0[d]},children:c}):null,b]})}const W1={VERIFIED:"success",PARTIAL:"warning",FAILED:"error",SPEC_CONFLICT:"info",BLOCKED:"info",running:"neutral",TAMPERED:"error",UNSIGNED:"warning",NOT_VERIFIED:"warning",UNCHECKED:"warning",UNVERIFIED:"warning","VERIFIED (signature not checked)":"info"},Et={VERIFIED:"VERIFIED",PARTIAL:"PARTIAL",FAILED:"FAILED",SPEC_CONFLICT:"SPEC_CONFLICT",TAMPERED:"TAMPERED",UNVERIFIED:"UNVERIFIED",VERIFIED_UNCHECKED:"VERIFIED (signature not checked)",RUNNING:"running"},P1=[Et.VERIFIED,Et.VERIFIED_UNCHECKED,Et.UNVERIFIED,Et.TAMPERED,Et.PARTIAL,Et.FAILED,Et.SPEC_CONFLICT];function jl(i){var r;return i?i.tampered===!0||i.integrity===Et.TAMPERED||((r=i.receipt)==null?void 0:r.verdict)===Et.TAMPERED||i.verdict===Et.TAMPERED?Et.TAMPERED:nr({verdict:i.verdict??null,tampered:!1,attested:i.attested??void 0,sig_checked:i.sig_checked??void 0}):null}const is=i=>jl(i)===Et.VERIFIED;function Lt({tone:i="neutral",pulse:r,children:o,...c}){return u.jsxs("span",{...c,"data-cp":"badge","data-tone":i,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 10px",borderRadius:k("radius-full"),fontSize:k("text-xs"),textTransform:"uppercase",letterSpacing:"0.025em",fontWeight:500,background:K0[i],color:J0[i],...c.style},children:[r?u.jsx("span",{className:"cp-pulse","aria-hidden":"true",style:{width:6,height:6,borderRadius:"50%",background:"currentColor"}}):null,o]})}function Ja({verdict:i,run:r,style:o}){const c=r?jl(r):i??null;return c?u.jsx(Lt,{tone:W1[c]??"neutral",pulse:c===Et.RUNNING,"data-verdict":c,title:o?Ae(c).label:void 0,style:o,children:Ae(c).label}):u.jsx(Lt,{pulse:!0,style:o,children:"running"})}const tb={active:k("success-fill"),idle:k("text-muted"),paused:k("warning-fill"),error:k("error-fill")};function eb({state:i="idle",label:r}){return u.jsx("span",{role:"img","aria-label":r??i,"data-cp":"status-dot","data-state":i,className:i==="active"?"cp-pulse":void 0,style:{display:"inline-block",width:12,height:6,borderRadius:2,background:tb[i]}})}const lb={primary:{background:k("accent-solid"),color:"#ffffff",border:"1px solid transparent"},secondary:{background:k("bg-3"),color:k("text"),border:`1px solid ${k("border")}`},ghost:{background:"transparent",color:k("text-2"),border:"1px solid transparent"},danger:{background:k("error"),color:"#ffffff",border:"1px solid transparent"}};function gt({variant:i="primary",size:r="md",style:o,type:c="button",...d}){const m=r==="sm"?"4px 12px":r==="lg"?"12px 24px":"8px 18px";return u.jsx("button",{...d,type:c,"data-cp":"button","data-variant":i,"data-size":r,style:{padding:m,borderRadius:k("radius-full"),fontSize:k(r==="sm"?"text-base":"text-md"),fontWeight:500,cursor:d.disabled?"not-allowed":"pointer",opacity:d.disabled?.5:1,...lb[i],...o}})}const I0={background:k("bg-3"),border:`1px solid ${k("border")}`,borderRadius:k("radius-md"),padding:"8px 12px",fontSize:k("text-md"),color:k("text"),width:"100%",fontFamily:"inherit"};function Fn({style:i,onFocus:r,onBlur:o,...c}){const[d,m]=N.useState(!1);return u.jsx("input",{...c,"data-cp":"input",onFocus:p=>{m(!0),r==null||r(p)},onBlur:p=>{m(!1),o==null||o(p)},style:{...I0,...d?{borderColor:k("accent"),boxShadow:k("focus"),outline:"none"}:null,...i}})}function F0({style:i,onFocus:r,onBlur:o,...c}){const[d,m]=N.useState(!1);return u.jsx("textarea",{...c,"data-cp":"textarea",onFocus:p=>{m(!0),r==null||r(p)},onBlur:p=>{m(!1),o==null||o(p)},style:{...I0,resize:"vertical",...d?{borderColor:k("accent"),boxShadow:k("focus"),outline:"none"}:null,...i}})}function mf({label:i,value:r,icon:o,options:c,onSelect:d}){const[m,p]=N.useState(!1),g=N.useId();return u.jsxs("span",{style:{position:"relative",display:"inline-block"},children:[u.jsxs("button",{type:"button","data-cp":"chip","aria-haspopup":c?"menu":void 0,"aria-expanded":c?m:void 0,"aria-controls":c&&m?g:void 0,onClick:()=>c&&p(b=>!b),style:{display:"inline-flex",alignItems:"center",gap:6,borderRadius:999,padding:"4px 10px",fontSize:k("text-base"),background:k("card"),border:`1px solid ${k("border")}`,color:k("text"),cursor:"pointer"},children:[o,u.jsx("span",{style:{color:k("text-2")},children:i}),r?u.jsx("span",{style:{fontWeight:500},children:r}):null]}),c&&m?u.jsx("div",{id:g,role:"menu",style:{position:"absolute",top:"100%",left:0,marginTop:4,minWidth:140,zIndex:400,background:k("bg"),border:`1px solid ${k("border")}`,borderRadius:k("radius-lg"),boxShadow:k("shadow-lg"),padding:4},children:c.map(b=>u.jsx("button",{role:"menuitem",type:"button",onClick:()=>{d==null||d(b.value),p(!1)},style:{display:"block",width:"100%",textAlign:"left",padding:"6px 10px",borderRadius:k("radius-md"),background:"transparent",border:0,color:k("text"),fontSize:k("text-base"),cursor:"pointer"},children:b.label},b.value))}):null]})}function Wn({columns:i,rows:r,caption:o}){return u.jsx(Vt,{style:{padding:0,overflow:"auto"},children:u.jsxs("table",{"data-cp":"table",style:{width:"100%",borderCollapse:"collapse",fontSize:k("text-base")},children:[o?u.jsx("caption",{style:{position:"absolute",left:-9999},children:o}):null,u.jsx("thead",{children:u.jsx("tr",{children:i.map(c=>u.jsx("th",{scope:"col",style:{textAlign:"left",padding:"10px 14px",fontSize:k("text-sm"),fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:k("text-2"),background:k("bg-3")},children:c},c))})}),u.jsx("tbody",{children:r.map((c,d)=>u.jsx("tr",{style:{borderTop:`1px solid ${k("border-light")}`},children:c.map((m,p)=>u.jsx("td",{style:{padding:"10px 14px"},children:m},p))},d))})]})})}function Wu({active:i,icon:r,children:o,href:c,onClick:d}){const m={position:"relative",display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderRadius:k("radius-nav"),fontSize:k("text-md"),fontWeight:500,textDecoration:"none",cursor:"pointer",border:0,width:"100%",textAlign:"left",background:i?k("accent-glow"):"transparent",color:k(i?"accent-ink":"text-2")},p=u.jsxs(u.Fragment,{children:[i?u.jsx("span",{"data-cp":"nav-bar","aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",width:3,height:16,borderRadius:2,background:k("accent")}}):null,r,u.jsx("span",{children:o})]});return c?u.jsx("a",{"data-cp":"nav-item","data-active":i?"true":void 0,"aria-current":i?"page":void 0,href:c,onClick:d,style:m,children:p}):u.jsx("button",{type:"button","data-cp":"nav-item","data-active":i?"true":void 0,"aria-current":i?"page":void 0,onClick:d,style:m,children:p})}function nb({children:i}){return u.jsx("div",{"data-cp":"group-head",style:{fontSize:9.5,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.09em",color:k("text-subtle"),padding:"4px 12px 5px"},children:i})}function ab({stages:i}){return u.jsx("ol",{"data-cp":"timeline",style:{listStyle:"none",margin:0,padding:0},children:i.map((r,o)=>u.jsxs("li",{"data-status":r.status,style:{display:"flex",gap:10,position:"relative",paddingBottom:o===i.length-1?0:14},children:[u.jsxs("span",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[u.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:r.status==="pending"?k("bg-3"):r.status==="neutral"?k("text-muted"):k(`${r.status}-fill`),border:`1px solid ${k("border")}`}}),o<i.length-1?u.jsx("span",{style:{flex:1,width:1,background:k("border")}}):null]}),u.jsxs("span",{style:{fontSize:k("text-base")},children:[r.label,r.duration?u.jsx("span",{style:{marginLeft:8,fontFamily:k("font-mono"),color:k("text-2")},children:r.duration}):null]})]},`${r.label}-${o}`))})}function Rt({title:i,hint:r,action:o}){return u.jsxs("div",{"data-cp":"empty-state",style:{textAlign:"center",padding:"var(--cp-space-3xl) var(--cp-space-xl)",color:k("text-2")},children:[u.jsx("div",{style:{fontFamily:k("font-serif"),fontSize:k("text-2xl"),color:k("text")},children:i}),r?u.jsx("div",{style:{marginTop:8,fontSize:k("text-md")},children:r}):null,o?u.jsx("div",{style:{marginTop:16},children:o}):null]})}function Bt({size:i=16,label:r="Loading"}){return u.jsx("span",{role:"status","aria-label":r,"data-cp":"spinner",className:"cp-spinner",style:{display:"inline-block",width:i,height:i,borderRadius:"50%",border:`2px solid ${k("border")}`,borderTopColor:k("accent")}})}function W0(i,r){const o=N.useRef(null);return N.useEffect(()=>{var m;if(!i)return;const c=document.activeElement;(m=o.current)==null||m.focus();const d=p=>{p.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>{var p;document.removeEventListener("keydown",d),(p=c==null?void 0:c.focus)==null||p.call(c)}},[i,r]),o}function ib({open:i,title:r,onClose:o,children:c}){const d=W0(i,o),m=N.useId();return i?u.jsx("div",{"data-cp":"dialog-backdrop",onClick:o,style:{position:"fixed",inset:0,zIndex:300,background:"rgba(0,0,0,0.4)",display:"flex",alignItems:"center",justifyContent:"center"},children:u.jsxs("div",{ref:d,role:"dialog","aria-modal":"true","aria-labelledby":m,tabIndex:-1,"data-cp":"dialog",onClick:p=>p.stopPropagation(),style:{width:"min(480px, 92vw)",background:k("bg"),color:k("text"),border:`1px solid ${k("border")}`,borderRadius:k("radius-lg"),boxShadow:k("shadow-lg"),padding:20},children:[u.jsx("h2",{id:m,style:{margin:"0 0 12px",fontFamily:k("font-serif"),fontWeight:400,fontSize:"1.15rem"},children:r}),c]})}):null}function sb({open:i,title:r,onClose:o,side:c="right",children:d}){const m=W0(i,o),p=N.useId();return i?u.jsx("div",{"data-cp":"drawer-backdrop",onClick:o,style:{position:"fixed",inset:0,zIndex:300,background:"rgba(0,0,0,0.3)"},children:u.jsxs("aside",{ref:m,role:"dialog","aria-modal":"true","aria-labelledby":p,tabIndex:-1,"data-cp":"drawer","data-side":c,onClick:g=>g.stopPropagation(),style:{position:"absolute",top:0,bottom:0,[c]:0,width:"min(var(--cp-detail-w, 288px), 92vw)",background:k("bg"),color:k("text"),borderLeft:c==="right"?`1px solid ${k("border")}`:void 0,borderRight:c==="left"?`1px solid ${k("border")}`:void 0,boxShadow:k("shadow-lg"),padding:16,overflow:"auto"},children:[u.jsx("h2",{id:p,style:{margin:"0 0 12px",fontFamily:k("font-serif"),fontWeight:400,fontSize:"1.15rem"},children:r}),d]})}):null}function ub({children:i}){return u.jsx("kbd",{"data-cp":"kbd",style:{fontFamily:k("font-mono"),fontSize:k("text-sm"),padding:"1px 5px",borderRadius:k("radius-md"),background:k("bg-3"),border:`1px solid ${k("border")}`,color:k("text-2")},children:i})}const bn="unmeasured",_0=3e3,rb=["intake","plan","Wall","implement","verify","seal","PR"];function cb(i,r){const o=new Set,c=p=>i.find(g=>!o.has(g)&&g.stage.toLowerCase().includes(p.toLowerCase())),d=(p,g)=>{if(!g)return{name:p,status:"pending",elapsed_s:null};o.add(g);const b=g.started_at?Date.parse(g.started_at):NaN,v=g.ended_at?Date.parse(g.ended_at):g.status==="started"?r:NaN,R=Number.isNaN(b)||Number.isNaN(v)?null:Math.max(0,(v-b)/1e3),y=g.status==="started"?"running":g.status==="completed"?"done":"failed";return{name:p,status:y,elapsed_s:R}},m=rb.map(p=>d(p,c(p)));for(const p of i)o.has(p)||m.push(d(p.stage,p));return m}const ob=i=>i===null?bn:i>=60?`${Math.floor(i/60)}m ${Math.floor(i%60)}s`:`${i.toFixed(1)}s`,P0=i=>i.cost_usd!==null&&i.cost_usd!==void 0?Pe(i.cost_usd):i.partial_usd?`at least ${Pe(i.partial_usd)} (rest ${bn})`:bn;function Tf(i,r,o){const[c,d]=N.useState({data:null,error:null});return N.useEffect(()=>{let m=!0,p;const g=()=>i().then(b=>{m&&(d({data:b,error:null}),o(b)&&(p=setTimeout(g,_0)))},b=>{m&&(d(v=>({data:v.data,error:b.message})),p=setTimeout(g,_0))});return g(),()=>{m=!1,clearTimeout(p)}},r),c}const fb=i=>!!i&&!!i.version&&!!i.installed_version&&i.version!==i.installed_version&&i.installed_version!=="unknown";function tg(){const{data:i}=Tf(()=>Q1().catch(()=>null),[],()=>!0);return fb(i)?u.jsxs("p",{role:"status","data-testid":"cp-out-of-date",className:"rounded border border-amber-400 bg-amber-50 p-3 text-sm text-amber-900 dark:bg-amber-950 dark:text-amber-200",children:["Control Plane is out of date, restarting. Run ",u.jsx("code",{children:"loki control serve"})," if it does not come back (running ",i.version,", installed ",i.installed_version,")."]}):null}const Zn="rounded border border-slate-200 p-4 dark:border-slate-800",db={pending:"text-slate-400",running:"text-sky-600 dark:text-sky-400",done:"text-emerald-600 dark:text-emerald-400",failed:"text-red-600"},hb=i=>i&&/^https?:\/\//.test(i)?i:null;function eg({source:i,run:r}){const{data:o,error:c}=Tf(()=>ar(i,r),[i,r],v=>v.status==="running"),[,d]=N.useState(0),m=(o==null?void 0:o.status)==="running";if(N.useEffect(()=>{if(!m)return;const v=setInterval(()=>d(R=>R+1),1e3);return()=>clearInterval(v)},[m]),c&&!o)return u.jsxs("p",{role:"alert",className:"text-red-600",children:["Could not load run: ",c]});if(!o)return u.jsx("p",{className:"text-slate-500",children:"Loading run"});const p=cb(o.stages??[],Date.now()),g=o.files_touched??[],b=hb(o.pr_url);return u.jsxs("section",{"data-testid":"live-run",className:"space-y-4",children:[u.jsx(tg,{}),u.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[u.jsx("h1",{className:"text-xl font-semibold",children:m?"Live run":"Run finished"}),u.jsx("span",{className:"break-all font-mono text-xs text-slate-500",children:o.run_id})]}),u.jsxs("div",{className:Zn,children:[u.jsx("h2",{className:"mb-2 text-sm font-semibold uppercase text-slate-500",children:"Stages"}),u.jsx("ol",{className:"space-y-2 text-sm",children:p.map(v=>u.jsxs("li",{"data-testid":"live-stage","data-status":v.status,className:"flex flex-wrap items-center justify-between gap-x-4",children:[u.jsx("span",{className:"font-medium",children:v.name}),u.jsxs("span",{className:db[v.status],children:[v.status,", ",v.status==="pending"?"not started":ob(v.elapsed_s),", limit ",bn]})]},v.name))})]}),u.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[u.jsxs("div",{className:Zn,children:[u.jsx("h2",{className:"mb-1 text-sm font-semibold uppercase text-slate-500",children:"Diff"}),u.jsxs("p",{"data-testid":"live-diff",children:[g.length," files, +/- ",bn]})]}),u.jsxs("div",{className:Zn,children:[u.jsx("h2",{className:"mb-1 text-sm font-semibold uppercase text-slate-500",children:"Cost so far"}),u.jsx("p",{"data-testid":"live-cost",children:P0(o)})]}),u.jsxs("div",{className:Zn,children:[u.jsx("h2",{className:"mb-1 text-sm font-semibold uppercase text-slate-500",children:"Model"}),u.jsx("p",{"data-testid":"live-model",children:o.model??bn})]})]}),!m&&u.jsxs("div",{"data-testid":"live-outcome",className:Zn,children:[u.jsx("h2",{className:"mb-1 text-sm font-semibold uppercase text-slate-500",children:"Outcome"}),u.jsx("p",{className:`text-lg font-medium${o.tampered?" text-red-600":""}`,children:Ae(jl(o)).label}),u.jsxs("p",{className:"mt-1 flex flex-wrap gap-4 text-sm",children:[b?u.jsx("a",{"data-testid":"live-pr",href:b,target:"_blank",rel:"noreferrer",className:"text-sky-600 hover:underline dark:text-sky-400",children:"Pull request"}):u.jsx("span",{"data-testid":"live-pr",className:"text-slate-500",children:"no PR"}),o.receipt?u.jsxs("a",{"data-testid":"live-receipt",href:`#/runs/${encodeURIComponent(i)}/${encodeURIComponent(r)}`,className:"text-sky-600 hover:underline dark:text-sky-400",children:["Receipt",o.receipt.signed?" (signed)":" (unsigned)"]}):u.jsx("span",{"data-testid":"live-receipt",className:"text-slate-500",children:"no receipt"})]})]}),u.jsx("a",{href:"#/overview",className:"inline-block py-2 text-sm text-sky-600 hover:underline dark:text-sky-400",children:"Overview"})]})}function mb(i,r){const o=new Date(r);o.setUTCHours(0,0,0,0);const c=o.getTime(),d={today:0,week:0,verified:0,unchecked:0,partial:0,failed:0,other:0,running:0,costUsd:0,unmeasuredRuns:0,prsOpened:0,last:[]};for(const m of i){const p=m.started_at?Date.parse(m.started_at):NaN;Number.isNaN(p)||(p>=c&&d.today++,p>=c-6*864e5&&d.week++);const g=jl(m);g===Et.VERIFIED?d.verified++:g===Et.VERIFIED_UNCHECKED?d.unchecked++:g===Et.PARTIAL?d.partial++:g===Et.FAILED?d.failed++:g?d.other++:d.running++,m.cost_usd!==null&&m.cost_usd!==void 0?d.costUsd+=m.cost_usd:(d.unmeasuredRuns++,d.costUsd+=m.partial_usd??0),m.pr_url&&d.prsOpened++}return d.last=[...i].sort((m,p)=>Date.parse(p.started_at??"")-Date.parse(m.started_at??"")).slice(0,10),d}function Bl({id:i,label:r,value:o}){return u.jsxs("div",{className:Zn,children:[u.jsx("div",{className:"text-xs uppercase text-slate-500",children:r}),u.jsx("div",{"data-testid":i,className:"mt-1 text-lg font-semibold",children:o})]})}function pb({runs:i,now:r=Date.now()}){const o=mb(i,r),c=o.unmeasuredRuns===0?`${Pe(o.costUsd)}`:`${Pe(o.costUsd)} measured, ${o.unmeasuredRuns} run${o.unmeasuredRuns===1?"":"s"} ${bn}`;return u.jsxs("section",{"data-testid":"overview",className:"space-y-4",children:[u.jsx("h1",{className:"text-xl font-semibold",children:"Overview"}),u.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[u.jsx(Bl,{id:"ov-today",label:"Runs today",value:String(o.today)}),u.jsx(Bl,{id:"ov-week",label:"Runs, last 7 days",value:String(o.week)}),u.jsx(Bl,{id:"ov-verified",label:Et.VERIFIED,value:String(o.verified)}),u.jsx(Bl,{id:"ov-unchecked",label:"Signature not checked",value:String(o.unchecked)}),u.jsx(Bl,{id:"ov-partial",label:Et.PARTIAL,value:String(o.partial)}),u.jsx(Bl,{id:"ov-failed",label:Et.FAILED,value:String(o.failed)}),u.jsx(Bl,{id:"ov-cost",label:"Total cost",value:c}),u.jsx(Bl,{id:"ov-pr-opened",label:"PRs opened",value:String(o.prsOpened)}),u.jsx(Bl,{id:"ov-pr-merged",label:"PRs merged",value:bn})]}),u.jsxs("div",{className:Zn,children:[u.jsx("h2",{className:"mb-2 text-sm font-semibold uppercase text-slate-500",children:"Last 10 runs"}),u.jsx("ul",{className:"space-y-1 text-sm",children:o.last.map(d=>u.jsxs("li",{"data-testid":"ov-run",className:"flex flex-wrap justify-between gap-x-4",children:[u.jsx("a",{href:`#/runs/${encodeURIComponent(d.source_id)}/${encodeURIComponent(d.run_id)}`,className:"break-all py-1 font-mono text-xs text-sky-600 hover:underline dark:text-sky-400",children:d.run_id}),u.jsxs("span",{className:d.tampered?"text-red-600":void 0,children:[jl(d)??"in progress",", ",P0(d)]})]},`${d.source_id}/${d.run_id}`))})]})]})}function lg({fallback:i,overview:r}){const{data:o}=Tf(()=>In(),[],d=>d.runs.some(m=>m.status==="running"));if(!o)return u.jsx("p",{className:"text-slate-500",children:"Loading runs"});if(o.runs.length===0)return u.jsx(u.Fragment,{children:i});const c=o.runs.find(d=>d.status==="running");return c&&!r?u.jsx(eg,{source:c.source_id,run:c.run_id}):u.jsxs(u.Fragment,{children:[u.jsx(tg,{}),u.jsx(pb,{runs:o.runs})]})}const ir=new Map,pf=new Set;let ng=0;const ag=()=>{ng++;for(const i of pf)i()};function Ce(i){ir.set(i.id,i),ag()}function E0(i){ir.delete(i)&&ag()}const ig=()=>[...ir.values()],gb=()=>ig().filter(i=>i.inSettings),sg=i=>(pf.add(i),()=>{pf.delete(i)}),Pu=()=>ng;function cs(i){const o=(i.replace(/^#/,"").split("?")[0]??"").replace(/\/+$/,"");return o===""?"/":o.startsWith("/")?o:`/${o}`}function vb(i,r){const o=i.split("/").filter(Boolean),c=r.split("/").filter(Boolean);if(o.length!==c.length)return null;const d={};for(let m=0;m<o.length;m++){const p=o[m];if(p.startsWith(":"))try{d[p.slice(1)]=decodeURIComponent(c[m])}catch{return null}else if(p!==c[m])return null}return d}function yb(i){const r=cs(i);let o=null;for(const c of ir.values()){const d=vb(c.path,r);if(!d)continue;const m=c.path.split("/").filter(p=>p&&!p.startsWith(":")).length;(!o||m>o.score)&&(o={page:c,params:d,score:m})}return o?{page:o.page,params:o.params}:null}async function xb(i){const r=globalThis.LOKI_CONTROL_BASE??"",o=_e(),c=await fetch(`${r}/v1/stats/cost?group=${i}`,{headers:o?{authorization:`Bearer ${o}`}:{}});if(!c.ok)throw new Error(`/v1/stats/cost: HTTP ${c.status}`);return await c.json()}const Jn=Pe,Ii=i=>i.toLocaleString("en-US"),T0=[{value:"day",label:"Day"},{value:"model",label:"Model"},{value:"repo",label:"Repo"},{value:"provider",label:"Provider"}];function bb({budget:i}){const r=o=>`${o} run${o===1?"":"s"}`;return u.jsxs(Vt,{"data-testid":"cost-budget",style:{display:"flex",flexDirection:"column",gap:6},children:[u.jsxs("div",{"data-testid":"cost-budget-subscription",children:[u.jsx(Lt,{tone:"info",children:"Subscription runs"})," ","no cap (",r(i.subscription_runs),"): usage counts against your plan limits, no dollar figure is measured."]}),u.jsxs("div",{"data-testid":"cost-budget-api",children:[u.jsx(Lt,{tone:"warning",children:"API-key runs"})," ",Jn(i.api_key_default_cap_usd)," cap per run by default (",r(i.api_key_runs),"); ",u.jsx("code",{children:"--max-cost"})," and loki.yaml ",u.jsx("code",{children:"budgets.per_run"})," override it."]})]})}function jb({row:i,max:r}){const o=c=>r>0?`${c/r*100}%`:"0%";return u.jsxs("div",{"data-testid":"cost-bar",role:"img","aria-label":`measured ${Jn(i.measured_usd)}, partial ${Jn(i.partial_usd)}`,style:{display:"flex",height:8,minWidth:120,background:"var(--cp-bg-3)",borderRadius:4,overflow:"hidden"},children:[u.jsx("span",{"data-part":"measured",style:{width:o(i.measured_usd),background:"var(--cp-accent)"}}),u.jsx("span",{"data-part":"partial",style:{width:o(i.partial_usd),background:"var(--cp-warning-fill)"}})]})}function Sb(){const[i,r]=N.useState("day"),[o,c]=N.useState(null),[d,m]=N.useState(null);if(N.useEffect(()=>{let v=!0;return c(null),m(null),xb(i).then(R=>{v&&c(R)},R=>{v&&m(R.message)}),()=>{v=!1}},[i]),d)return u.jsx(Rt,{title:"Cost unavailable",hint:d});if(!o)return u.jsx(Bt,{label:"Loading cost"});const p=o.totals,g=Math.max(0,...o.rows.map(v=>v.measured_usd+v.partial_usd)),b=T0.find(v=>v.value===i).label;return u.jsxs("div",{"data-testid":"cost-page",style:{display:"flex",flexDirection:"column",gap:16},children:[u.jsx("h1",{style:{margin:0,fontFamily:"var(--cp-font-serif)",fontWeight:400},children:"Cost and usage"}),u.jsx(bb,{budget:o.budget}),u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:12},children:[u.jsx(Kn,{label:"Measured",value:u.jsx("span",{"data-testid":"cost-measured",children:Jn(p.measured_usd)}),trend:`${p.measured_runs} runs`,trendTone:"success"}),u.jsx(Kn,{label:"Partial (priced sessions only)",value:u.jsx("span",{"data-testid":"cost-partial",children:Jn(p.partial_usd)}),trend:`${p.partial_runs} runs`,trendTone:"warning"}),u.jsx(Kn,{label:"Unmeasured",value:u.jsxs("span",{"data-testid":"cost-unmeasured",children:[p.unmeasured_runs," runs"]}),trend:"not measured"}),u.jsx(Kn,{label:"Tokens in (incl. cache) / out",value:u.jsxs("span",{"data-testid":"cost-tokens",children:[Ii(p.input_tokens)," / ",Ii(p.output_tokens)]}),trend:p.token_sessions_total?`partial: ${p.token_sessions} of ${p.token_sessions_total} sessions`:void 0,trendTone:"warning"})]}),u.jsx("div",{children:u.jsx(mf,{label:"Group by",value:b,options:T0,onSelect:v=>r(v)})}),o.rows.length===0?u.jsx(Rt,{title:"No runs yet",hint:"Cost appears here once a run has been ingested."}):u.jsx(Wn,{caption:`Cost by ${b}`,columns:[b,"Runs","Measured","Partial","Unmeasured","Tokens in (incl. cache)","Tokens out","Spend"],rows:o.rows.map(v=>[v[i]??"unknown",v.runs,v.measured_runs?Jn(v.measured_usd):"not measured",v.partial_runs?`${Jn(v.partial_usd)} (partial)`:"none",v.unmeasured_runs?`${v.unmeasured_runs} not measured`:"none",v.token_sessions_total?`${Ii(v.input_tokens)} (partial: ${v.token_sessions} of ${v.token_sessions_total} sessions)`:Ii(v.input_tokens),Ii(v.output_tokens),u.jsx(jb,{row:v,max:g},"bar")])})]})}const _b={id:"cost",path:"/cost",title:"Cost and usage",component:Sb},Eb=()=>globalThis.LOKI_CONTROL_BASE??"";async function ug(i,r,o){const c=_e(),d={"content-type":"application/json"};c&&(d.authorization=`Bearer ${c}`);const m=await fetch(`${Eb()}/v1/runs/${encodeURIComponent(i)}/${encodeURIComponent(r)}/${o}`,{method:"POST",headers:d,body:"{}"}),p=await m.json().catch(()=>({}));if(!m.ok)throw new Error(p.error??`HTTP ${m.status}`)}const Tb={stop:"Stopping...",retry:"Retrying...",resume:"Resuming..."},Nb={stop:"Stop signal sent.",retry:"Retry started as a new run.",resume:"Resume started."};function Rb({source:i,run:r,status:o,ownRules:c,onChanged:d}){const[m,p]=N.useState(!1),[g,b]=N.useState(null),[v,R]=N.useState(!1),[y,A]=N.useState(!1),[L,Q]=N.useState(null),at=o.trim().toUpperCase(),H=g==="stop"||v,Y=!H&&(g==="resume"||y||at==="RUNNING"),J=at==="BLOCKED"&&!Y&&!H&&!c,M=async B=>{if(!g){p(!1),Q(null),b(B);try{await ug(i,r,B),B==="stop"&&R(!0),B==="resume"&&A(!0),Q({tone:"ok",text:Nb[B]}),d==null||d()}catch($){Q({tone:"error",text:$.message})}finally{b(null)}}};return u.jsxs("div",{"data-testid":"run-controls","data-state":H?"stopping":Y?"running":at.toLowerCase(),style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[Y&&!g&&!m?u.jsx(gt,{variant:"danger",size:"sm",onClick:()=>p(!0),children:"Stop"}):null,m?u.jsxs("span",{"data-testid":"stop-confirm",role:"group","aria-label":"Confirm stop",style:{display:"flex",gap:8,alignItems:"center"},children:[u.jsx("span",{children:"Stop this run?"}),u.jsx(gt,{variant:"danger",size:"sm",onClick:()=>void M("stop"),children:"Confirm stop"}),u.jsx(gt,{variant:"ghost",size:"sm",onClick:()=>p(!1),children:"Cancel"})]}):null,J&&!g?u.jsx(gt,{size:"sm",onClick:()=>void M("resume"),children:"Resume"}):null,!Y&&!H&&!g&&at!==""?u.jsx(gt,{variant:c?"primary":"secondary",size:"sm",onClick:()=>void M("retry"),children:"Retry"}):null,g?u.jsx("span",{role:"status",children:Tb[g]}):null,!g&&L?u.jsx("span",{role:L.tone==="error"?"alert":"status",style:L.tone==="error"?{color:"var(--cp-error)"}:void 0,children:L.text}):null]})}class Nf extends Error{constructor(r,o){super(o),this.status=r}}const rg=()=>globalThis.LOKI_CONTROL_BASE??"",cg=()=>{const i=_e();return i?{authorization:`Bearer ${i}`}:{}};async function og(i){const r=await fetch(`${rg()}/v1/runs`,{method:"POST",headers:{"content-type":"application/json",...cg()},body:JSON.stringify(i)}),o=await r.json().catch(()=>({}));if(!r.ok)throw new Nf(r.status,o.error??`HTTP ${r.status}`);return o}const zb=async()=>(await K1()).repos;async function Ob(i){const r=await fetch(`${rg()}/v1/repos/issues?repo=${encodeURIComponent(i)}`,{headers:cg()}),o=await r.json().catch(()=>({}));if(!r.ok)throw new Nf(r.status,o.error??`HTTP ${r.status}`);return o.issues??[]}const fg=()=>globalThis.LOKI_CONTROL_BASE??"",dg=(i={})=>{const r=_e();return r?{...i,authorization:`Bearer ${r}`}:i};async function hg(i,r){const o=await fetch(`${fg()}/v1/runs/${encodeURIComponent(i)}/${encodeURIComponent(r)}/verify`,{method:"POST",headers:dg({"content-type":"application/json"}),body:"{}"}),c=await o.json().catch(()=>({}));if(!o.ok)throw new Error(c.error??`HTTP ${o.status}`);return c}async function Cb(){const i=await fetch(`${fg()}/v1/keys`,{headers:dg()});if(i.status===404)return null;if(!i.ok)throw new Error(`/v1/keys: HTTP ${i.status}`);return await i.json()}function Ab(i){const r=new Map;for(const o of i){if(!o.verdict||!o.started_at)continue;const c=o.started_at.slice(0,10),d=r.get(c)??{v:0,n:0};d.n++,is(o)&&d.v++,r.set(c,d)}return[...r.entries()].sort(([o],[c])=>o<c?-1:1).map(([o,c])=>({day:o,rate:c.v/c.n,total:c.n}))}const Rf=()=>globalThis.LOKI_CONTROL_BASE??"",zf=()=>{const i=_e();return i?{authorization:`Bearer ${i}`}:{}},Of=(i,r)=>`/v1/runs/${encodeURIComponent(i)}/${encodeURIComponent(r)}`;async function mg(i,r,o){try{const c=await fetch(`${Rf()}${Of(i,r)}/artifact/${o}`,{headers:zf()});return c.ok?await c.text():null}catch{return null}}async function wb(i,r,o=-1){const c=[];try{for(let d=o,m=0;m<200;m++){const p=d>=0?`?after=${d}&limit=1000`:"?limit=1000",g=await fetch(`${Rf()}${Of(i,r)}/events${p}`,{headers:zf()});if(!g.ok)break;const b=await g.json(),v=b.events??[];if(c.push(...v),!b.has_more||v.length===0)break;d=v[v.length-1].seq}}catch{}return c}function Db(i,r){const o=i.split(`
177
-
178
- `),c=o.pop()??"";for(const d of o){const m=d.split(`
179
- `).filter(p=>p.startsWith("data:")).map(p=>p.slice(5).trim()).join("");if(!(!m||!/^event: event$/m.test(d)))try{r(JSON.parse(m))}catch{}}return c}async function Mb(i,r,o,c,d){try{const m=await fetch(`${Rf()}${Of(i,r)}/stream?after=${o()}`,{headers:{...zf(),accept:"text/event-stream"},signal:d});if(!m.ok||!m.body)return;const p=m.body.getReader(),g=new TextDecoder;let b="";for(;;){const{done:v,value:R}=await p.read();if(v)return;b=Db(b+g.decode(R,{stream:!0}),c)}}catch{}}const N0=i=>i&&typeof i=="object"?i:{},R0=i=>typeof i=="number"&&Number.isFinite(i)?i:null,ul=i=>typeof i=="string"&&i?i:null,ef=i=>{const r=i?Date.parse(i):NaN;return Number.isNaN(r)?null:r};function kb(i){const r=[],o=new Map,c=new Map,d=new Map,m=new Set;for(const g of i){const b=N0(g.data),v=g.stage??"";if(g.type==="session.started"&&v&&m.add(v),g.type==="session.started"&&v&&ul(b.model)&&d.set(v,ul(b.model)),g.type==="cost"&&v){const R=c.get(v)??{usd:0,unmeasured:!1,seen:!1},y=R0(b.usd);R.seen=!0,y===null?R.unmeasured=!0:R.usd+=y,c.set(v,R),ul(b.model)&&!d.has(v)&&d.set(v,ul(b.model))}}const p=g=>{const b=c.get(g);return!b&&!m.has(g)&&!d.has(g)?"no-session":b&&b.seen&&!b.unmeasured?b.usd:null};for(const g of i){const b=N0(g.data);if(g.type==="run.started")r.push({key:`s${g.seq}`,ts:g.ts??null,kind:"run",label:"Run started",duration_s:null,model:ul(b.model),cost_usd:null,outcome:"started",detail:ul(b.issue_ref)??void 0});else if(g.type==="stage.started"&&g.stage){const v={key:`s${g.seq}`,ts:g.ts??null,kind:"stage",label:g.stage,duration_s:null,model:d.get(g.stage)??null,cost_usd:p(g.stage),outcome:"running",startedMs:ef(g.ts)};o.set(g.stage,v),r.push(v)}else if((g.type==="stage.skipped"||g.type==="stage.failed")&&g.stage){const v=o.get(g.stage),R=ul(b.reason)??(g.type==="stage.skipped"?"no reason recorded":null),y=g.type==="stage.skipped"?"skipped":"failed";v?Object.assign(v,{outcome:y,detail:R??void 0,cost_usd:p(g.stage)}):r.push({key:`s${g.seq}`,ts:g.ts??null,kind:"stage",label:g.stage,duration_s:null,model:null,cost_usd:p(g.stage),outcome:y,detail:R??void 0}),o.delete(g.stage)}else if(g.type==="stage.completed"&&g.stage){const v=o.get(g.stage),R=R0(b.duration_s)??((v==null?void 0:v.startedMs)!=null&&ef(g.ts)!=null?(ef(g.ts)-v.startedMs)/1e3:null),y=ul(b.skipped_reason)??ul(b.reason),A=b.skipped===!0?"skipped":"completed",L=Array.isArray(b.files)?b.files.length:void 0;v?Object.assign(v,{duration_s:R,outcome:A,model:d.get(g.stage)??v.model,cost_usd:p(g.stage),detail:y??void 0,files:L}):r.push({key:`s${g.seq}`,ts:g.ts??null,kind:"stage",label:g.stage,duration_s:R,model:d.get(g.stage)??null,cost_usd:p(g.stage),outcome:A,detail:y??void 0,files:L}),o.delete(g.stage)}else g.type==="pr.opened"?r.push({key:`s${g.seq}`,ts:g.ts??null,kind:"pr",label:"Pull request opened",duration_s:null,model:null,cost_usd:null,outcome:b.draft===!0?"draft":"opened",detail:ul(b.url)??void 0}):g.type==="receipt.sealed"?r.push({key:`s${g.seq}`,ts:g.ts??null,kind:"receipt",label:"Receipt sealed",duration_s:null,model:null,cost_usd:null,outcome:b.signed===!0?"signed":"unsigned"}):g.type==="run.completed"&&r.push({key:`s${g.seq}`,ts:g.ts??null,kind:"verdict",label:"Run completed",duration_s:null,model:null,cost_usd:null,outcome:ul(b.verdict)??"no verdict"})}return r}const ve="unmeasured",Ub={intake:"Read the issue and its comments",plan:"Named the files and tests in scope",implement:"Edited the code in an isolated worktree",fix:"Fixed what the failing checks reported",verify:"Ran the repo tests against the change",commit:"Committed the change to the run branch",wall:"Wrote acceptance checks",seal:"Signed a receipt with the diff hash","deep-verify":"Full suite and secret scan after the PR opens"};function Hb(i){const r=i.detail?` (${i.detail})`:"";if(i.kind==="run")return`Run started${i.detail?` for ${i.detail}`:""}`;if(i.kind==="pr")return`Opened a ${i.outcome==="draft"?"draft ":""}pull request${r}`;if(i.kind==="receipt")return`Sealed the receipt, ${i.outcome}`;if(i.kind==="verdict")return`Run finished: ${i.outcome==="no verdict"?i.outcome:Ae(i.outcome).label}`;if(i.label==="wall"){if(i.outcome==="skipped")return"Wall skipped: no checks written";if(i.outcome==="completed"&&typeof i.files=="number")return`Wrote acceptance checks (${i.files} ${i.files===1?"file":"files"})`}const o=Ub[i.label]??`Stage ${i.label}`;return i.outcome==="failed"?`${o}: failed${r}`:i.outcome==="skipped"?`${o}: skipped${r}`:i.outcome==="running"?`${o}: in progress`:`${o}${r}`}function Lb(i){const r=i?Date.parse(i):NaN;return Number.isNaN(r)?null:new Date(r).toISOString().slice(11,19)}function Bb(i){const r=[];let o=null;for(const c of i.split(`
180
- `)){const d=/^diff --git a\/(.+?) b\/(.+)$/.exec(c);if(d){o={path:d[2],added:0,removed:0,kind:"modified"},r.push(o);continue}if(o)if(c.startsWith("new file mode"))o.kind="added";else if(c.startsWith("deleted file mode"))o.kind="deleted";else{if(c.startsWith("+++")||c.startsWith("---"))continue;c.startsWith("+")?o.added++:c.startsWith("-")&&o.removed++}}return r}function qb(i){const r=/^\s*\[([^\]]{1,40})\]\s*(.*)$/.exec(i);if(r)return{owner:r[1],text:r[2]};const o=/^(.*?)[\s,;(-]*\(?owner[:\s]+([A-Za-z0-9_@./-]{1,40})\)?\s*$/i.exec(i);return o?{owner:o[2],text:o[1]}:{owner:null,text:i}}function $b(i){const r=i.length,o=i.some(d=>d.status==="started"),c=i.filter(d=>d.status!=="started").length;return{n:Math.min(r,c+(o?1:0)),m:r,running:o}}function pg(i){return typeof i!="number"?ve:i>=3600?`${Math.floor(i/3600)}h ${Math.floor(i%3600/60)}m`:i>=60?`${Math.floor(i/60)}m ${Math.floor(i%60)}s`:`${i.toFixed(1)}s`}function Yb(i,r){const o=i?Bb(i):[];return o.length?{files:o,source:"patch"}:r&&r.files.length?{files:r.files.map(c=>({...c,kind:"modified"})),source:"git"}:null}const Vb=i=>i&&typeof i=="object"?i:{},Vu=i=>typeof i=="string"&&i.trim()?i.trim():null,lf=(i,r=120)=>i.length>r?`${i.slice(0,r-3)}...`:i,Gb=/time ?limit|timed out|time budget|over cap/i;function Qb(i){const r=new Map,o=[];let c=0;for(const g of i){const b=Vb(g.data);if(g.type==="test.result"){const v=Vu(b.name);v&&r.set(v,{result:String(b.result??""),why:Vu(b.first_error)??Vu(b.reason)})}else if(g.type==="stage.completed"&&g.stage==="fix"&&b.killed===!0)c++;else if((g.type==="stage.failed"||g.type==="stage.skipped")&&g.stage){const v=Vu(b.reason);v&&g.stage!=="fix"?o.push(`${g.stage}: ${lf(v)}`):v&&Gb.test(v)&&c++}}const d=[],m=[...r].filter(([,g])=>g.result==="fail");m.length&&d.push(`verify: ${m.slice(0,3).map(([g,b])=>b.why?`${g} ${lf(b.why,90)}`:`${g} failed`).join("; ")}${m.length>3?`; ${m.length-3} more`:""}`);const p=[...r].filter(([,g])=>g.result==="not_run");!m.length&&p.length&&d.push(`verify: ${p.slice(0,3).map(([g,b])=>b.why?`${g} not run (${lf(b.why,60)})`:`${g} not run`).join("; ")}`);for(const g of o.slice(0,2))d.some(b=>b.includes(g))||d.push(g);return c&&d.push(`${c} fix round${c===1?"":"s"} hit time limits`),d.length?d.join("; "):null}const Za=i=>i&&typeof i=="object"&&!Array.isArray(i)?i:{},Ka=i=>typeof i=="string"&&i.trim()?i.trim():null,ql=(i,r)=>{for(const o of r){const c=Ka(i[o]);if(c)return c}return null},Xb={pass:"pass",passed:"pass",ok:"pass",success:"pass",flaky:"pass",fail:"fail",failed:"fail",failure:"fail",error:"fail",not_run:"not_run",skipped:"not_run",skip:"not_run"},gg=i=>{const r=Za(i),o=typeof i=="string"?i:Ka(r.result)??Ka(r.status)??Ka(r.outcome);return o?Xb[o.toLowerCase()]??null:null},vg=i=>({total:i.length,pass:i.filter(r=>r==="pass").length,fail:i.filter(r=>r==="fail").length,notRun:i.filter(r=>r==="not_run").length});function Zb(i){if(!i)return null;let r;try{const g=JSON.parse(i);if(!g||typeof g!="object"||Array.isArray(g))return null;r=g}catch{return null}const o=Za(r.git),c=Za(r.diff),d=Array.isArray(r.checks)?r.checks:Array.isArray(r.tests)?r.tests:null,m=!d&&r.checks&&typeof r.checks=="object"?Object.values(Za(r.checks)):null,p=d??m;return{verdict:ql(r,["verdict","result","outcome"]),diffSha:ql(r,["diff_sha256","diff_hash","diff_sha"])??ql(c,["sha256","hash"]),base:ql(r,["base_sha","base","base_commit"])??ql(o,["base","base_sha"]),head:ql(r,["head_sha","head","head_commit"])??ql(o,["head","head_sha"]),checks:p?vg(p.map(gg)):null}}function Kb(i){let r=null,o=null;const c=new Map;for(const d of i){const m=Za(d.data);if(d.type==="stage.completed"&&d.stage==="commit"&&(r=ql(m,["head_sha"])??r),o=ql(m,["base_sha"])??o,d.type==="test.result"){const p=Ka(m.name);p&&c.set(p,gg(m))}}return{verdict:null,diffSha:null,base:o,head:r,checks:c.size?vg([...c.values()]):null}}function Jb(i,r){if(i===void 0)return{facts:{verdict:null,diffSha:null,base:null,head:null,checks:null},state:"loading"};const o=Zb(i);return o?{facts:o,state:"read"}:{facts:Kb(r),state:"unreachable"}}function nf(i,r){return r==="read"?ve:r==="loading"?"loading":"receipt file not reachable from this Control Plane"}const Ib="Loki's own rules stopped this run (fixed in 10.10.3). Retry on the latest version.";function af(i){return Ae(i.verdict?nr(i)??i.verdict:null)}function Fb(i){var c;const r=i.verdict?nr(i)??i.verdict:null;if(!r)return null;const o=(c=i.integrity_reasons)==null?void 0:c[0];return(r==="TAMPERED"||r==="UNVERIFIED")&&o?Fu(`The receipt did not pass the integrity check: ${o}`):i.stop_reason?Fu(i.stop_reason).replace(/\s+/g," ").trim():null}function Wb(i){const r=i.find(m=>m.type==="stage.completed"&&m.stage==="implement"),o=Ka(Za(r==null?void 0:r.data).spec_conflict_reason),c=Qb(i.map(m=>({type:m.type,stage:m.stage,data:m.data}))),d=[o,c].filter(m=>!!m);return d.length?d.join(`
181
-
182
- `):null}const Pb=ve,tj={good:"success",warn:"warning",bad:"error",neutral:"neutral"};function Ju({verdict:i,label:r,tone:o,testid:c}){const d=r?{label:r,tone:o??"neutral"}:Ae(i);return u.jsx(Lt,{tone:tj[d.tone],pulse:d.label==="Running","data-testid":c,style:{textTransform:"none",letterSpacing:0},children:d.label})}function z0(i){return i.token_sessions!=null&&i.total_sessions>0&&i.token_sessions<i.total_sessions?`partial: ${i.token_sessions} of ${i.total_sessions} sessions`:null}function ej(i){return i.cost_usd!==null&&i.cost_usd!==void 0?Pe(i.cost_usd):i.partial_usd?`at least ${Pe(i.partial_usd)} (${i.measured_sessions} of ${i.total_sessions} sessions measured)`:Pb}function lj(i){const r=i.data,o=r==null?"":typeof r=="string"?r:JSON.stringify(r);return[i.type,i.stage,o.length>160?`${o.slice(0,160)}...`:o].filter(Boolean).join(" ")}function nj(i,r){const[o,c]=N.useState([]),d=N.useRef(-1);return N.useEffect(()=>{const m=new AbortController;d.current=-1;const p=g=>{const b=g.filter(v=>v.seq>d.current);b.length&&(d.current=b[b.length-1].seq,c(v=>[...v,...b].slice(-2e3)))};return(async()=>{for(p(await wb(i,r));!m.signal.aborted;)await Mb(i,r,()=>d.current,g=>p([g]),m.signal),m.signal.aborted||await new Promise(g=>setTimeout(g,3e3))})(),()=>m.abort()},[i,r]),o}function sf(i,r,o){const[c,d]=N.useState(void 0);return N.useEffect(()=>{let m=!0;return mg(i,r,o).then(p=>{m&&d(p)}),()=>{m=!1}},[i,r,o]),c}const gf={completed:"var(--cp-term-green)",running:"var(--cp-term-purple)",failed:"var(--cp-term-red)",skipped:"var(--cp-term-amber)"},aj=i=>gf[i==="started"?"running":i]??"var(--cp-term-dim)";function Qa({color:i,pulse:r}){return u.jsx("span",{"aria-hidden":"true",className:r?"cp-pulse":void 0,style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:i,flexShrink:0}})}function ij({d:i}){return u.jsxs("aside",{className:"cp-term-side","data-testid":"run-stages","aria-label":"Stages",children:[u.jsx("div",{style:{color:"var(--cp-term-dim)",marginBottom:10,textTransform:"uppercase",letterSpacing:"0.12em",fontSize:10},children:"Stages"}),i.stages.length===0?u.jsx("div",{style:{color:"var(--cp-term-muted)"},children:"no stages recorded yet"}):null,i.stages.map((r,o)=>u.jsxs("div",{"data-testid":"run-stage","data-status":r.status,style:{display:"flex",alignItems:"center",gap:8,padding:"4px 0",color:r.status==="started"?"var(--cp-term-lilac)":"var(--cp-term-text)"},children:[u.jsx(Qa,{color:aj(r.status),pulse:r.status==="started"}),u.jsx("span",{className:"cp-trunc",style:{flex:1},children:r.stage}),r.reason?u.jsx("span",{"data-testid":"run-stage-reason",className:"cp-trunc",style:{maxWidth:80,color:"var(--cp-term-muted)"},title:r.reason,children:r.reason}):r.status==="skipped"?u.jsx("span",{"data-testid":"run-stage-reason",style:{color:"var(--cp-term-muted)"},children:"no reason recorded"}):null]},`${r.stage}-${o}`))]})}function sj({events:i,awaiting:r}){const o=kb(i);return o.length===0?u.jsx("div",{"data-testid":"run-timeline",style:{color:"var(--cp-term-muted)",fontSize:12},children:r?"Waiting for the first event":"No events recorded for this run."}):u.jsx("ol",{"data-testid":"run-timeline","aria-live":"polite",style:{listStyle:"none",margin:0,padding:0},children:o.map(c=>{const d=c.kind==="stage";return u.jsxs("li",{className:"cp-tl-row","data-testid":"timeline-line","data-outcome":c.outcome,children:[u.jsx("span",{"data-testid":"tl-time",style:{fontFamily:"var(--cp-font-mono)",color:"var(--cp-term-dim)"},children:Lb(c.ts)??ve}),u.jsxs("span",{style:{display:"flex",alignItems:"flex-start",gap:6,fontFamily:"var(--cp-font-mono)",color:gf[c.outcome]??"var(--cp-term-lilac)"},children:[u.jsx("span",{style:{marginTop:6},children:u.jsx(Qa,{color:gf[c.outcome]??"var(--cp-term-purple)",pulse:c.outcome==="running"})}),u.jsx("strong",{"data-testid":"tl-label",className:"cp-trunc",style:{fontWeight:500},children:c.label})]}),u.jsx("span",{"data-testid":"tl-desc",style:{color:"var(--cp-term-text)"},children:Hb(c)}),d?u.jsxs("span",{className:"cp-tl-meta",children:[u.jsx("span",{"data-testid":"tl-duration",children:typeof c.duration_s=="number"?pg(c.duration_s):c.outcome==="running"?"running":ve}),u.jsx("span",{"data-testid":"tl-model",children:c.model??(c.cost_usd==="no-session"?"-":ve)}),u.jsx("span",{"data-testid":"tl-cost",children:c.cost_usd==="no-session"?"-":c.cost_usd===null?ve:Pe(c.cost_usd)})]}):null]},c.key)})})}const uj={display:"flex",flexDirection:"column",gap:10};function Wa({title:i,meta:r,children:o,testid:c}){return u.jsxs(Vt,{"data-testid":c,style:uj,children:[u.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[u.jsx("h2",{className:"cp-display",style:{margin:0,fontSize:18},children:i}),r?u.jsx("span",{style:{color:"var(--cp-text-muted)",fontSize:"var(--cp-text-base)"},children:r}):null]}),o]})}function rj({d:i,patch:r}){const o=Yb(r,i.diff_stat),c=i.files_touched??[],d=(o==null?void 0:o.files)??null,m=(d==null?void 0:d.reduce((v,R)=>v+(R.added??0),0))??0,p=(d==null?void 0:d.reduce((v,R)=>v+(R.removed??0),0))??0,g={added:["+","var(--cp-success-ink)"],deleted:["-","var(--cp-error-ink)"],modified:["~","var(--cp-warning-ink)"]},b=(v,R)=>v===null?"binary":`${R}${v}`;return u.jsx(Wa,{title:"Changed files",testid:"run-diff",meta:d&&d.length?`${d.length} files, +${m} -${p}${(o==null?void 0:o.source)==="git"?" (from the receipt's commit range)":""}`:c.length?`${c.length} files touched`:void 0,children:d&&d.length?u.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,fontFamily:"var(--cp-font-mono)",fontSize:"var(--cp-text-base)"},children:d.map(v=>u.jsxs("li",{"data-testid":"changed-file",style:{display:"flex",gap:10,padding:"3px 0"},children:[u.jsx("span",{style:{color:g[v.kind][1],width:12},children:g[v.kind][0]}),u.jsx("span",{className:"cp-trunc",style:{flex:1},title:v.path,children:v.path}),u.jsx("span",{style:{color:"var(--cp-success-ink)"},children:b(v.added,"+")}),u.jsx("span",{style:{color:"var(--cp-error-ink)"},children:v.removed===null?"":b(v.removed,"-")})]},v.path))}):c.length?u.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,fontFamily:"var(--cp-font-mono)",fontSize:"var(--cp-text-base)"},children:c.map(v=>u.jsxs("li",{"data-testid":"changed-file",className:"cp-trunc",title:v,children:[v," ",u.jsxs("span",{style:{color:"var(--cp-text-muted)"},children:["(line counts ",ve,")"]})]},v))}):u.jsx("span",{"data-testid":"changed-files-unmeasured",children:r===void 0?u.jsx(Bt,{label:"Loading diff"}):`Changed files ${ve}: no diff or commit range could be read for this run.`})})}function Ga({k:i,children:r,testid:o}){return u.jsxs("div",{"data-testid":o,style:{display:"flex",gap:12,alignItems:"baseline",padding:"3px 0",borderBottom:"1px solid var(--cp-border)"},children:[u.jsx("span",{style:{width:120,flexShrink:0,color:"var(--cp-text-muted)"},children:i}),u.jsx("span",{style:{minWidth:0,overflowWrap:"anywhere"},children:r})]})}function cj({d:i,source:r,run:o,receipt:c,receiptJson:d,events:m}){var B,$,ot,tt;const[p,g]=N.useState({busy:!1}),[b,v]=N.useState(!1),R=((B=i.receipt)==null?void 0:B.sha256)??null,{facts:y,state:A}=Jb(d,m),L=async()=>{g({busy:!0});try{g({busy:!1,res:await hg(r,o)})}catch(et){g({busy:!1,error:et.message})}},Q=y.base??(A==="read"?null:(($=i.diff_stat)==null?void 0:$.base)??null),at=y.head??(A==="read"?null:((ot=i.diff_stat)==null?void 0:ot.head)??null),H=(et,Kt)=>et?et.slice(0,Kt):nf(null,A),Y=y.verdict??((tt=i.receipt)==null?void 0:tt.verdict)??null,J=i.receipt?i.receipt.signed?i.sig_checked?"signed, signature checked":"signed, signature not checked":"unsigned":"no receipt sealed in the run's events",M=y.checks;return u.jsxs(Wa,{title:"Evidence and receipt",testid:"run-receipt",meta:R?`sha256 ${R.slice(0,16)}`:"no receipt",children:[u.jsxs("div",{"data-testid":"receipt-rows",style:{display:"flex",flexDirection:"column",fontSize:"var(--cp-text-base)"},children:[u.jsx(Ga,{k:"Verdict",testid:"rr-verdict",children:Y?`receipt says ${Ae(Y).label}`:nf(null,A)}),u.jsx(Ga,{k:"Diff hash",testid:"rr-diff",children:u.jsx("code",{title:y.diffSha??void 0,children:H(y.diffSha,16)})}),u.jsx(Ga,{k:"Base",testid:"rr-base",children:u.jsx("code",{title:Q??void 0,children:H(Q,12)})}),u.jsx(Ga,{k:"Head",testid:"rr-head",children:u.jsx("code",{title:at??void 0,children:H(at,12)})}),u.jsx(Ga,{k:"Signature",testid:"rr-sig",children:J}),u.jsx(Ga,{k:"Checks run",testid:"rr-checks",children:M?M.total===0?"none recorded":`${M.total} run: ${M.pass} passed, ${M.fail} failed${M.notRun?`, ${M.notRun} not run`:""}`:nf(null,A)})]}),u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[u.jsxs(gt,{variant:"secondary",size:"sm","data-testid":"run-verify",disabled:!R||p.busy,onClick:()=>void L(),children:[u.jsx(L1,{size:13,"aria-hidden":"true"})," ",p.busy?"Verifying":"Verify"]}),u.jsx(gt,{variant:"ghost",size:"sm","data-testid":"receipt-raw-toggle","aria-pressed":b,onClick:()=>v(et=>!et),children:b?"Hide raw":"Show raw"}),R?null:u.jsx("span",{style:{color:"var(--cp-text-muted)"},children:"No receipt to verify."}),p.res?u.jsxs("span",{"data-testid":"run-verify-result",role:"status",children:[u.jsx(Ju,{verdict:p.res.verdict})," ",Fu(p.res.reasons[0]??"")]}):null,p.error?u.jsx("span",{role:"alert","data-testid":"run-verify-error",style:{color:"var(--cp-error-ink)"},children:p.error}):null]}),b?c===void 0?u.jsx(Bt,{label:"Loading receipt"}):c===null?u.jsx("div",{"data-testid":"receipt-raw",children:"Receipt text not available for this run."}):u.jsx("pre",{"data-testid":"receipt-raw",style:{margin:0,whiteSpace:"pre-wrap",fontFamily:"var(--cp-font-mono)",fontSize:"var(--cp-text-sm)",maxHeight:280,overflow:"auto",color:"var(--cp-text-2)"},children:c}):null]})}function oj({d:i}){return u.jsx(Wa,{title:"NOT PROVEN",testid:"run-not-proven",meta:i.not_proven.length?`${i.not_proven.length} item${i.not_proven.length===1?"":"s"}`:void 0,children:i.not_proven.length?u.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:8},children:i.not_proven.map((r,o)=>{const c=qb(r);return u.jsxs("li",{"data-testid":"not-proven-item",style:{display:"flex",gap:10,alignItems:"flex-start",justifyContent:"space-between"},children:[u.jsx("span",{style:{minWidth:0},children:c.text}),c.owner?u.jsxs(Lt,{tone:"info","data-testid":"not-proven-owner",style:{flexShrink:0,textTransform:"none"},children:["owner: ",c.owner]}):null]},o)})}):u.jsx("span",{children:i.verdict?"Nothing listed as not proven.":"Not known until the run finishes."})})}function fj({source:i,run:r,question:o,onSent:c}){const[d,m]=N.useState(""),[p,g]=N.useState({busy:!1}),b=async()=>{g({busy:!0});try{await X0(i,r,d.trim()),g({busy:!1,sent:!0}),c()}catch(v){g({busy:!1,error:v.message})}};return u.jsxs(Wa,{title:"Needs your answer",testid:"run-reply-card",meta:u.jsx(R1,{size:16,"aria-hidden":"true"}),children:[u.jsx("div",{children:o}),u.jsxs("div",{"data-testid":"run-reply",style:{display:"flex",flexDirection:"column",gap:8},children:[u.jsx(F0,{"aria-label":"Your reply",rows:3,value:d,onChange:v=>m(v.target.value),disabled:p.busy||p.sent}),u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[u.jsx(gt,{onClick:b,disabled:!d.trim()||p.busy||p.sent,children:"Send reply"}),p.sent?u.jsx("span",{role:"status",children:"Reply saved. Resume the run to continue."}):null,p.error?u.jsx("span",{role:"alert",style:{color:"var(--cp-error-ink)"},children:p.error}):null]})]})]})}function dj({d:i}){let r;return i.pr_url?r=/^https?:\/\//.test(i.pr_url)?u.jsxs("a",{href:i.pr_url,target:"_blank",rel:"noreferrer",style:{color:"var(--cp-accent-ink)",wordBreak:"break-all"},children:[i.pr_url," ",u.jsx(Ef,{size:12,"aria-hidden":"true"})]}):u.jsx("span",{children:i.pr_url}):i.verdict?Ae(i.verdict).tone==="good"?r=u.jsxs("span",{children:["No PR opened ",ve,": the run recorded no PR address."]}):r=u.jsxs("span",{children:["No PR opened: the run ended as ",Ae(i.verdict).label.toLowerCase(),", and a PR opens only after the run verifies."]}):r=u.jsx("span",{children:"No PR yet: the run is still in progress."}),u.jsx(Wa,{title:"Pull request",testid:"run-pr",meta:i.pr_draft?"draft":void 0,children:u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[u.jsx(G0,{size:14,"aria-hidden":"true"}),r]})})}function hj({source:i,run:r,slot:o,renderSlot:c}){const[d,m]=N.useState(null),[p,g]=N.useState(null),[b,v]=N.useState(!1),[R,y]=N.useState(!1),[A,L]=N.useState({busy:!1}),[Q,at]=N.useState({busy:!1}),H=nj(i,r),Y=sf(i,r,"diff.patch"),J=sf(i,r,"receipt.md"),M=sf(i,r,"receipt.json"),B=J===void 0||M===void 0?void 0:J??M,$=N.useCallback(()=>{ar(i,r).then(X=>{m(X),g(null)},X=>g(X.message))},[i,r]),ot=!d||d.status==="running"||d.verdict===null;if(N.useEffect(()=>{if($(),!ot)return;const X=setInterval($,4e3);return()=>clearInterval(X)},[$,ot]),p&&!d)return u.jsx(Rt,{title:"Run not available",hint:p});if(!d)return u.jsx(Bt,{label:"Loading run"});const tt=d.title??d.issue_ref??d.origin_repo??`Title ${ve}`,et=!!d.verdict&&af(d).label==="Tampered",Kt=!!d.blocked_question&&!et,P=d.status==="running"||d.verdict===null&&!d.ended_at,xt=$b(d.stages),it=P?null:Fb(d),Jt=it?Wb(H):null,Gt=!P&&!et&&d.own_rules_block===!0,It=!P&&!!d.issue_ref,V=async()=>{L({busy:!0});try{await ug(i,r,"retry"),L({busy:!1,msg:"Retry started as a new run."}),$()}catch(X){L({busy:!1,msg:X.message,error:!0})}},lt=async()=>{at({busy:!0});try{await og({target:d.issue_ref}),at({busy:!1,msg:"Started a new run."})}catch(X){at({busy:!1,msg:X.message,error:!0})}};return u.jsxs("section",{"data-testid":"run-thread",style:{maxWidth:1100,margin:"0 auto",padding:"8px 0 32px",display:"flex",flexDirection:"column",gap:20},children:[u.jsxs("header",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12},children:[u.jsxs("div",{style:{flex:"1 1 320px",minWidth:0},children:[u.jsxs("div",{className:"cp-eyebrow",children:[d.origin_repo??d.source_id,d.issue_ref&&d.title?` / ${d.issue_ref}`:""]}),u.jsx("h1",{"data-testid":"run-title",className:"cp-display",style:{margin:"4px 0 0",fontSize:30,overflowWrap:"anywhere"},children:tt})]}),Kt?u.jsx(Ju,{verdict:"BLOCKED",testid:"run-outcome"}):d.verdict?u.jsx(Ju,{label:af(d).label,tone:af(d).tone,testid:"run-outcome"}):u.jsx(Ju,{verdict:null,testid:"run-outcome"}),u.jsx("span",{"data-testid":"run-elapsed",style:{fontFamily:"var(--cp-font-mono)",fontSize:"var(--cp-text-base)"},children:pg(d.elapsed_s??d.wall_s)}),u.jsx("span",{"data-testid":"run-cost",style:{fontFamily:"var(--cp-font-mono)",fontSize:"var(--cp-text-base)"},children:ej(d)}),z0(d)&&u.jsxs("span",{"data-testid":"run-tokens-partial",style:{fontFamily:"var(--cp-font-mono)",fontSize:"var(--cp-text-sm, 12px)"},children:["tokens ",z0(d)]}),u.jsxs("span",{"data-testid":"run-header-slot",style:{display:"inline-flex",gap:8},children:[o,c?c(Gt?{...d,blocked_question:null}:d,$):null]}),c?null:u.jsxs(gt,{variant:Gt?"primary":"secondary",size:"sm","data-testid":"run-retry",disabled:!It||Q.busy,title:P?"The run is still in progress":d.issue_ref?"Start this issue again":`No issue reference recorded ${ve}`,onClick:()=>void lt(),children:[u.jsx(y0,{size:13,"aria-hidden":"true"})," Retry"]}),Q.msg?u.jsx("span",{role:Q.error?"alert":"status","data-testid":"run-retry-msg",style:{color:Q.error?"var(--cp-error-ink)":"var(--cp-text-2)",fontSize:"var(--cp-text-base)"},children:Q.msg}):null]}),Gt?u.jsxs(Wa,{title:"Loki's own rules stopped this run",testid:"run-own-rules",children:[u.jsx("p",{"data-testid":"run-own-rules-text",style:{margin:0},children:Ib}),u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[u.jsxs(gt,{"data-testid":"run-own-rules-retry",disabled:A.busy,onClick:()=>void V(),children:[u.jsx(y0,{size:13,"aria-hidden":"true"})," Retry"]}),A.msg?u.jsx("span",{role:A.error?"alert":"status",style:{color:A.error?"var(--cp-error-ink)":"var(--cp-text-2)"},children:A.msg}):null]})]}):null,it&&!Gt?u.jsxs("div",{style:{margin:"-8px 0 0"},children:[u.jsxs("p",{"data-testid":"run-why",style:{margin:0,fontSize:"var(--cp-text-md)",color:"var(--cp-text-2)",overflowWrap:"anywhere"},children:[u.jsx("strong",{style:{color:"var(--cp-text)"},children:"Why:"})," ",it]}),Jt?u.jsx(gt,{variant:"ghost",size:"sm","data-testid":"run-why-raw-toggle","aria-pressed":R,onClick:()=>y(X=>!X),children:R?"Hide raw":"Show raw"}):null,R&&Jt?u.jsx("pre",{"data-testid":"run-why-raw",style:{margin:"6px 0 0",whiteSpace:"pre-wrap",overflowWrap:"anywhere",fontFamily:"var(--cp-font-mono)",fontSize:"var(--cp-text-sm)",maxHeight:280,overflow:"auto",color:"var(--cp-text-2)"},children:Jt}):null]}):null,Kt&&!Gt&&d.blocked_question?u.jsx(fj,{source:i,run:r,question:Fu(d.blocked_question),onSent:$}):null,u.jsxs("div",{"data-testid":"run-summary",style:{display:"grid",gap:16,gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 440px), 1fr))",alignItems:"start"},children:[u.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[u.jsx(rj,{d,patch:Y}),u.jsx(cj,{d,source:i,run:r,receipt:B,receiptJson:M,events:H})]}),u.jsxs("div",{"data-testid":"run-aside",style:{display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[u.jsx(oj,{d}),u.jsx(dj,{d})]})]}),u.jsxs("div",{className:"cp-term","data-testid":"run-panel",children:[u.jsxs("div",{className:"cp-term-bar",children:[u.jsxs("span",{style:{display:"inline-flex",gap:6},"aria-hidden":"true",children:[u.jsx(Qa,{color:"#FF5F57"}),u.jsx(Qa,{color:"#FEBC2E"}),u.jsx(Qa,{color:"#28C840"})]}),u.jsxs("span",{className:"cp-trunc",children:["Control Plane / ",d.model??`model ${ve}`]}),u.jsx("span",{children:d.provider??`provider ${ve}`})]}),u.jsxs("div",{className:"cp-term-body",children:[u.jsx(ij,{d}),u.jsx("div",{className:"cp-term-main",children:u.jsx(sj,{events:H,awaiting:P})})]}),u.jsxs("div",{className:"cp-term-foot",children:[u.jsx("span",{"data-testid":"run-progress",children:xt.m?`stage ${xt.n} / ${xt.m}`:`stage ${ve}`}),P?u.jsxs("span",{"data-testid":"run-live",style:{display:"inline-flex",alignItems:"center",gap:8,color:"var(--cp-term-green)"},children:[u.jsx(Qa,{color:"var(--cp-term-green)",pulse:!0})," live"]}):u.jsx("span",{"data-testid":"run-ended",children:d.ended_at?"run ended":`end time ${ve}`})]})]}),u.jsxs("div",{children:[u.jsx(gt,{variant:"ghost",size:"sm","data-testid":"run-raw-toggle","aria-pressed":b,onClick:()=>v(X=>!X),children:b?"Hide raw":"Show raw"}),b?u.jsxs("div",{"data-testid":"run-log",style:{marginTop:8},children:[u.jsx("pre",{"data-testid":"run-raw-json",style:{margin:0,padding:12,borderRadius:12,background:"var(--cp-term-bg)",color:"var(--cp-term-text)",fontFamily:"var(--cp-font-mono)",fontSize:11,maxHeight:360,overflow:"auto",whiteSpace:"pre-wrap"},children:JSON.stringify(d,null,2)}),u.jsx("div",{role:"log",style:{marginTop:8,maxHeight:280,overflow:"auto",fontFamily:"var(--cp-font-mono)",fontSize:11,color:"var(--cp-text-2)"},children:H.length===0?u.jsx("div",{children:"No events yet."}):H.map(X=>u.jsx("div",{children:`${X.seq} ${lj(X)}`},X.seq))})]}):null]})]})}function mj(){var r,o;const i=/\/runs?\/([^/]+)\/([^/?#]+)/.exec(((r=globalThis.location)==null?void 0:r.pathname)??"")??/#\/runs?\/([^/]+)\/([^/?#]+)/.exec(((o=globalThis.location)==null?void 0:o.hash)??"");return i?{source:decodeURIComponent(i[1]),run:decodeURIComponent(i[2])}:null}function pj({source:i,run:r,slot:o,renderSlot:c}){const d=i&&r?{source:i,run:r}:mj();return d?u.jsx(hj,{source:d.source,run:d.run,slot:o,renderSlot:c}):u.jsx(Rt,{title:"No run selected",hint:"Open a run from Home or Runs."})}const yg={id:"run",path:"/runs/:source/:run",title:"Run",component:pj},xg="loki-theme",tr=new Set,gj=()=>{try{const i=localStorage.getItem(xg);return i==="light"||i==="dark"?i:null}catch{return null}},bg=()=>{try{return typeof globalThis.matchMedia=="function"?globalThis.matchMedia("(prefers-color-scheme: dark)"):null}catch{return null}},jg=()=>{const i=bg();return i?i.matches?"dark":"light":"dark"};let sr=gj(),os=sr??jg();function ur(i=os){var o;const r=(o=globalThis.document)==null?void 0:o.documentElement;r&&(sr?r.setAttribute("data-theme",i):r.removeAttribute("data-theme"),r.classList.toggle("dark",i==="dark"))}function vj(i){os=i,sr=i;try{localStorage.setItem(xg,i)}catch{}ur(i);for(const r of tr)r()}const er=()=>vj(os==="dark"?"light":"dark");var Ku,Y0;(Y0=(Ku=bg())==null?void 0:Ku.addEventListener)==null||Y0.call(Ku,"change",()=>{if(!sr){os=jg(),ur();for(const i of tr)i()}});function Sg(){return N.useSyncExternalStore(i=>(tr.add(i),()=>{tr.delete(i)}),()=>os,()=>"dark")}const yj="min-h-11 rounded bg-sky-700 px-4 py-2 text-sm text-white disabled:opacity-50 md:min-h-0 md:px-3 md:py-1",xj="loki start owner/repo#N";function _g(){const[i,r]=N.useState(null),[o,c]=N.useState(!1),d=async()=>{c(!0);try{const m=await Z1();r(m.failed.length?{ok:!1,text:`Imported ${m.runs} runs; ${m.failed.length} failed.`}:{ok:!0,text:m.runs===0?"No runs found in this folder.":`Imported ${m.runs} runs. Reload to see them.`})}catch(m){r({ok:!1,text:m.message})}c(!1)};return u.jsxs("div",{children:[u.jsx("button",{type:"button","data-testid":"import-runs",disabled:o,onClick:d,className:yj,children:"Import runs from this folder"}),i&&u.jsx("p",{role:i.ok?"status":"alert",className:`mt-2 text-sm ${i.ok?"text-emerald-600":"text-red-600"}`,children:i.text})]})}function Cf(){return u.jsxs("div",{"data-testid":"empty-state",className:"rounded border border-dashed border-slate-300 p-8 text-center dark:border-slate-700",children:[u.jsx("p",{className:"text-lg font-medium",children:"No runs yet"}),u.jsx("div",{className:"mt-4 flex justify-center",children:u.jsx(_g,{})}),u.jsx("p",{className:"mt-6 text-sm text-slate-600 dark:text-slate-400",children:"Or start your first run from a terminal:"}),u.jsx("code",{className:"mt-2 inline-block rounded bg-slate-200 px-2 py-1 text-sm dark:bg-slate-800",children:xj})]})}function bj(){const i=Sg();return u.jsxs("section",{children:[u.jsx("h2",{className:"mb-4 text-xl",style:{fontFamily:"var(--cp-font-serif)",fontWeight:400},children:"General"}),u.jsx("p",{className:"mb-2 text-sm",style:{color:"var(--cp-text-2)"},children:"Appearance"}),u.jsx(gt,{variant:"secondary",onClick:er,children:i==="dark"?"Switch to light theme":"Switch to dark theme"}),u.jsx("div",{className:"mt-6",children:u.jsx(_g,{})})]})}let Eg={open:!1,preset:null};const vf=new Set,Tg=i=>{Eg=i;for(const r of vf)r()},Ia=(i=null)=>Tg({open:!0,preset:i}),O0=()=>Tg({open:!1,preset:null}),C0=()=>Eg,jj=()=>N.useSyncExternalStore(i=>(vf.add(i),()=>{vf.delete(i)}),C0,C0),Sj=()=>globalThis.LOKI_CONTROL_BASE??"",_j=10;async function Ej(){const i=[];let r=null;for(let o=0;o<_j;o++){const c=_e(),d=new URLSearchParams({limit:"200"});r&&d.set("cursor",r);const m=await fetch(`${Sj()}/v1/runs?${d}`,{headers:c?{authorization:`Bearer ${c}`}:{}});if(!m.ok)throw new Error(`/v1/runs: HTTP ${m.status}`);const p=await m.json();if(i.push(...p.runs),r=p.next_cursor,!r)break}return i}function rr(i=!0){const[r,o]=N.useState({runs:null,error:null}),c=N.useCallback(()=>{Ej().then(d=>o({runs:d,error:null}),d=>o(m=>({runs:m.runs,error:d.message})))},[]);return N.useEffect(()=>(c(),i?Z0(c):void 0),[c,i]),r}const Ng=864e5,Tj=14,Xa=i=>{const r=Date.parse(i.started_at??i.last_event_at??"");return Number.isNaN(r)?-1/0:r},fs=i=>`#/runs/${encodeURIComponent(i.source_id)}/${encodeURIComponent(i.run_id)}`,Sn=i=>i.status==="running"||!i.verdict&&!i.ended_at?null:nr(i),Af=i=>Ae(Sn(i)),Nj=i=>Sn(i)===null,cr=i=>(Sn(i)??"").trim().toUpperCase(),Rj=i=>["SPEC_CONFLICT","BLOCKED"].includes(cr(i)),zj=i=>cr(i)==="PARTIAL",Oj=i=>cr(i)==="VERIFIED",Cj=i=>!Nj(i),A0=i=>{var r;return((r=i.title)==null?void 0:r.trim())||i.issue_ref||"Untitled task"};function or(i){const r=new Map;for(const c of i){const d=c.issue_ref?`${c.origin_repo??""}|${c.issue_ref}`:`${c.source_id}/${c.run_id}`;r.set(d,[...r.get(d)??[],c])}const o=[];for(const[c,d]of r){const m=[...d].sort((b,v)=>Xa(v)-Xa(b)),p=m[0],g=m.find(b=>{var v;return(v=b.title)==null?void 0:v.trim()});o.push({key:c,title:A0(g||p),repo:p.origin_repo,ref:p.issue_ref,attempts:m,latest:p})}return o.sort((c,d)=>Xa(d.latest)-Xa(c.latest))}function Aj(i){return i.attempts.length<2?null:`${i.ref?i.ref.includes("/")?i.ref.split("/").slice(1).join("/"):i.ref:i.title}, ${i.attempts.length} attempts, latest ${Af(i.latest).label}`}function wf(i){return typeof i.cost_usd=="number"?Pe(i.cost_usd):i.partial_usd?`${Pe(i.partial_usd)}+`:null}function Rg(i){const r=i.wall_s??i.elapsed_s;return typeof r!="number"||!Number.isFinite(r)?null:r<60?`${Math.round(r)}s`:r<3600?`${Math.floor(r/60)}m ${Math.round(r%60)}s`:`${Math.floor(r/3600)}h ${Math.floor(r%3600/60)}m`}function Pa(i,r){const o=Date.parse(i.started_at??i.last_event_at??"");if(Number.isNaN(o))return null;const c=Math.max(0,Math.round((r-o)/1e3));return c<60?"just now":c<3600?`${Math.floor(c/60)}m ago`:c<86400?`${Math.floor(c/3600)}h ago`:`${Math.floor(c/86400)}d ago`}function zg(i,r){const o=i.filter(m=>Rj(m.latest)),c=i.filter(m=>zj(m.latest)),d=i.filter(m=>m.latest.pr_url&&["VERIFIED","ALREADY_SATISFIED"].includes(cr(m.latest))&&r-Xa(m.latest)<=Tj*Ng);return{blocked:o,partial:c,prs:d}}function wj(i,r,o){const c=i.filter(b=>Xa(b)>=o-7*Ng),d=c.filter(Cj),m=d.filter(Oj),p=c.filter(b=>typeof b.cost_usd=="number"),g=zg(r,o);return{runsWeek:c.length,finishedWeek:d.length,verifiedWeek:m.length,verifiedShare:d.length?m.length/d.length:null,costWeek:p.length?p.reduce((b,v)=>b+(v.cost_usd??0),0):null,costPartial:p.length<c.length,needsYou:g.blocked.length+g.partial.length+g.prs.length}}const Dj={good:"success",warn:"warning",bad:"error",neutral:"neutral"};function ds({verdict:i}){const r=Ae(i);return u.jsx(Lt,{tone:Dj[r.tone],pulse:r.label==="Running","data-outcome":r.label,style:{textTransform:"none",letterSpacing:0,whiteSpace:"nowrap"},children:r.label})}const Se={padding:"12px 14px",verticalAlign:"top"},Mj={...Se,textAlign:"left",fontSize:"var(--cp-text-sm)",fontWeight:500,color:"var(--cp-text-muted)",borderBottom:"1px solid var(--cp-border)"},Pi={color:"var(--cp-text-muted)",fontSize:"var(--cp-text-sm)"},Og={color:"var(--cp-text)",textDecoration:"none"};function fr({run:i}){if(!i.pr_url)return null;const r=/\/pull\/(\d+)/.exec(i.pr_url);return u.jsxs("a",{href:i.pr_url,target:"_blank",rel:"noreferrer",style:{color:"var(--cp-accent)",display:"inline-flex",gap:4,alignItems:"center",textDecoration:"none"},children:[r?`PR #${r[1]}`:"PR",u.jsx(Ef,{size:12,"aria-hidden":"true"})]})}function kj({run:i,now:r}){return u.jsxs("tr",{"data-testid":"attempt-row",style:{background:"var(--cp-bg-3)"},children:[u.jsx("td",{style:{...Se,paddingLeft:40},children:u.jsx("a",{href:fs(i),style:{...Og,color:"var(--cp-accent)"},children:"Attempt"})}),u.jsx("td",{style:Se}),u.jsx("td",{style:Se,children:u.jsx(ds,{verdict:Sn(i)})}),u.jsx("td",{style:Se,children:u.jsx(fr,{run:i})}),u.jsx("td",{style:Se,children:wf(i)}),u.jsx("td",{style:Se,children:Rg(i)}),u.jsx("td",{style:{...Se,...Pi},children:Pa(i,r)})]})}function Uj({g:i,now:r}){const[o,c]=N.useState(!1),d=i.attempts.length>1,m=Aj(i),p=i.latest;return u.jsxs(N.Fragment,{children:[u.jsxs("tr",{"data-testid":"issue-row","data-attempts":i.attempts.length,style:{borderTop:"1px solid var(--cp-border-light)"},children:[u.jsx("td",{style:Se,children:u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[d?u.jsx("button",{type:"button","data-testid":"expand","aria-expanded":o,"aria-label":o?"Hide attempts":"Show attempts",onClick:()=>c(g=>!g),style:{background:"none",border:0,padding:2,cursor:"pointer",color:"var(--cp-text-muted)"},children:o?u.jsx(h1,{size:14,"aria-hidden":"true"}):u.jsx(p1,{size:14,"aria-hidden":"true"})}):u.jsx("span",{style:{width:18}}),u.jsxs("div",{style:{minWidth:0},children:[u.jsx("a",{href:fs(p),"data-testid":"issue-title",style:Og,children:i.title}),m?u.jsx("div",{"data-testid":"group-summary",style:Pi,children:m}):i.ref?u.jsx("div",{style:Pi,children:i.ref}):null]})]})}),u.jsx("td",{style:{...Se,...Pi},children:i.repo}),u.jsx("td",{style:Se,children:u.jsx(ds,{verdict:Sn(p)})}),u.jsx("td",{style:Se,children:u.jsx(fr,{run:p})}),u.jsx("td",{style:Se,children:wf(p)}),u.jsx("td",{style:Se,children:Rg(p)}),u.jsx("td",{style:{...Se,...Pi},children:Pa(p,r)})]}),d&&o?i.attempts.map(g=>u.jsx(kj,{run:g,now:r},`${g.source_id}/${g.run_id}`)):null]})}const Hj={outcome:"",repo:"",q:""};function Lj(i,r){const o=r.q.trim().toLowerCase();return i.filter(c=>!(r.outcome&&Af(c.latest).label!==r.outcome||r.repo&&c.repo!==r.repo||o&&![c.title,c.ref,c.repo].some(d=>(d??"").toLowerCase().includes(o))))}function Bj({runs:i,now:r=Date.now()}){const[o,c]=N.useState(Hj),d=N.useMemo(()=>or(i),[i]),m=N.useMemo(()=>Lj(d,o),[d,o]),p=N.useMemo(()=>[...new Set(d.map(v=>Af(v.latest).label))].sort(),[d]),g=N.useMemo(()=>[...new Set(d.map(v=>v.repo).filter(v=>!!v))].sort(),[d]),b=o.outcome!==""||o.repo!==""||o.q!=="";return u.jsxs("section",{"data-testid":"runs-page",style:{display:"flex",flexDirection:"column",gap:20},children:[u.jsxs("header",{style:{display:"flex",flexWrap:"wrap",gap:12,alignItems:"center"},children:[u.jsx("h1",{style:{fontFamily:"var(--cp-font-serif)",fontWeight:400,fontSize:"var(--cp-text-2xl)",margin:0,marginRight:"auto"},children:"Runs"}),u.jsx(Fn,{"aria-label":"Search runs",placeholder:"Search issues",value:o.q,onChange:v=>c({...o,q:v.target.value}),style:{maxWidth:220}}),u.jsx("span",{"data-testid":"filter-outcome",children:u.jsx(mf,{label:"Outcome",value:o.outcome||"All",options:[{value:"",label:"All"},...p.map(v=>({value:v,label:v}))],onSelect:v=>c({...o,outcome:v})})}),u.jsx("span",{"data-testid":"filter-repo",children:u.jsx(mf,{label:"Repo",value:o.repo||"All",options:[{value:"",label:"All"},...g.map(v=>({value:v,label:v}))],onSelect:v=>c({...o,repo:v})})}),u.jsx(gt,{"data-testid":"new-run-button",onClick:()=>Ia(),children:"New run"})]}),i.length===0?u.jsx(Cf,{}):m.length===0?u.jsx(Rt,{title:b?"No runs match these filters":"No runs yet",hint:b?"Clear a filter or the search to see more.":"Use New run to start one from a registered repo."}):u.jsx(Vt,{style:{padding:0,overflow:"auto"},children:u.jsxs("table",{"data-testid":"runs-table",style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--cp-text-base)"},children:[u.jsx("thead",{children:u.jsx("tr",{children:["Issue","Repo","Outcome","PR","Cost","Duration","When"].map(v=>u.jsx("th",{scope:"col",style:Mj,children:v},v))})}),u.jsx("tbody",{children:m.map(v=>u.jsx(Uj,{g:v,now:r},v.key))})]})})]})}function qj(){const{runs:i,error:r}=rr();return i===null?r?u.jsx(Rt,{title:"Could not load runs",hint:r}):u.jsx(Bt,{label:"Loading runs"}):u.jsx(Bj,{runs:i})}const $j={id:"runs",path:"/runs",title:"Runs",component:qj,inSettings:!1},Yj=12,jn={color:"var(--cp-text-muted)",fontSize:"var(--cp-text-sm)"},Df={fontFamily:"var(--cp-font-serif)",fontWeight:400,fontSize:"var(--cp-text-xl)",margin:0};function Vj(i){const r=i.verifiedShare===null?"No finished runs":`${Math.round(i.verifiedShare*100)}%`;return[{id:"kpi-runs",label:"Runs this week",value:String(i.runsWeek)},{id:"kpi-verified",label:"Verified share",value:r,trend:i.finishedWeek?`${i.verifiedWeek} of ${i.finishedWeek} finished`:void 0},{id:"kpi-cost",label:"Cost this week",value:i.costWeek===null?"No priced runs":`${Pe(i.costWeek)}${i.costPartial?"+":""}`},{id:"kpi-needs",label:"Needs you",value:String(i.needsYou)}]}function uf({title:i,items:r,now:o,testid:c}){return r.length===0?null:u.jsxs("div",{"data-testid":c,children:[u.jsxs("div",{style:{...jn,fontWeight:500,padding:"10px 16px 4px"},children:[i," (",r.length,")"]}),r.map(d=>u.jsxs("div",{"data-testid":"inbox-row",style:{display:"flex",gap:12,alignItems:"center",padding:"10px 16px",borderTop:"1px solid var(--cp-border-light)"},children:[u.jsx("a",{href:fs(d.latest),style:{flex:1,minWidth:0,color:"var(--cp-text)",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),d.repo?u.jsx("span",{style:jn,children:d.repo}):null,u.jsx(fr,{run:d.latest}),u.jsx("span",{style:jn,children:Pa(d.latest,o)})]},d.key))]})}function Gj({groups:i,now:r}){const o=N.useMemo(()=>zg(i,r),[i,r]),c=o.blocked.length+o.partial.length+o.prs.length===0;return u.jsxs("section",{"data-testid":"needs-you","aria-label":"Needs you",style:{display:"flex",flexDirection:"column",gap:12},children:[u.jsx("h2",{style:Df,children:"Needs you"}),u.jsx(Vt,{style:{padding:0},children:c?u.jsx("p",{"data-testid":"needs-you-empty",style:{...jn,margin:0,padding:16},children:"Nothing is waiting on you."}):u.jsxs(u.Fragment,{children:[u.jsx(uf,{testid:"inbox-blocked",title:"Runs waiting for your answer",items:o.blocked,now:r}),u.jsx(uf,{testid:"inbox-partial",title:"Partly verified, review",items:o.partial,now:r}),u.jsx(uf,{testid:"inbox-prs",title:"Pull requests to review",items:o.prs,now:r})]})})]})}function Qj({groups:i,now:r}){const o=i.slice(0,Yj);return u.jsxs("section",{"data-testid":"latest-by-issue","aria-label":"Latest by issue",style:{display:"flex",flexDirection:"column",gap:12},children:[u.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:12},children:[u.jsx("h2",{style:{...Df,marginRight:"auto"},children:"Latest by issue"}),i.length>o.length?u.jsx("a",{href:"#/runs",style:{color:"var(--cp-accent)",fontSize:"var(--cp-text-sm)"},children:"All runs"}):null]}),o.length===0?u.jsx(Cf,{}):u.jsx(Vt,{style:{padding:0},children:o.map((c,d)=>u.jsxs("div",{"data-testid":"latest-row",style:{display:"flex",gap:12,alignItems:"center",padding:"12px 16px",borderTop:d?"1px solid var(--cp-border-light)":void 0},children:[u.jsx("a",{href:fs(c.latest),style:{flex:1,minWidth:0,color:"var(--cp-text)",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.title}),c.repo?u.jsx("span",{style:jn,children:c.repo}):null,u.jsx(ds,{verdict:Sn(c.latest)}),u.jsx("span",{style:{...jn,minWidth:64,textAlign:"right"},children:Pa(c.latest,r)})]},c.key))})]})}const Xj={pass:"success",warn:"warning",fail:"error"},Zj={pass:"Pass",warn:"Warning",fail:"Failing"};function Kj({doctor:i,noRuns:r}){if(!i)return null;const o="checks"in i&&i.checks.some(c=>c.status!=="pass");return!("error"in i)&&!o&&!r?null:u.jsxs("section",{"data-testid":"getting-started","aria-label":"Getting started",style:{display:"flex",flexDirection:"column",gap:12},children:[u.jsx("h2",{style:Df,children:"Getting started"}),u.jsx(Vt,{style:{padding:0},children:"error"in i?u.jsxs("p",{"data-testid":"getting-started-error",role:"alert",style:{...jn,margin:0,padding:16},children:["Could not run the setup checks: ",i.error]}):i.checks.map((c,d)=>u.jsxs("div",{"data-testid":"doctor-check","data-status":c.status,style:{display:"flex",gap:12,alignItems:"center",padding:"10px 16px",borderTop:d?"1px solid var(--cp-border-light)":void 0},children:[u.jsx(Lt,{tone:Xj[c.status],children:Zj[c.status]}),u.jsx("span",{style:{flex:1,minWidth:0},children:c.name}),u.jsx("span",{style:jn,children:c.detail})]},c.name))})]})}function Jj({runs:i,now:r=Date.now(),doctor:o=null}){const c=N.useMemo(()=>or(i),[i]),d=N.useMemo(()=>Vj(wj(i,c,r)),[i,c,r]);return u.jsxs("div",{"data-testid":"overview",style:{display:"flex",flexDirection:"column",gap:32,maxWidth:960},children:[u.jsxs("header",{style:{display:"flex",alignItems:"center",gap:12},children:[u.jsx("h1",{style:{fontFamily:"var(--cp-font-serif)",fontWeight:400,fontSize:"var(--cp-text-2xl)",margin:0,marginRight:"auto"},children:"Overview"}),u.jsx(gt,{"data-testid":"new-run-button",onClick:()=>Ia(),children:"New run"})]}),u.jsx("div",{"data-testid":"kpis",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:16},children:d.map(m=>u.jsx("div",{"data-testid":m.id,children:u.jsx(Kn,{label:m.label,value:m.value,trend:m.trend})},m.id))}),u.jsx(Kj,{doctor:o,noRuns:i.length===0}),u.jsx(Gj,{groups:c,now:r}),u.jsx(Qj,{groups:c,now:r})]})}function Ij(){const{runs:i,error:r}=rr(),[o,c]=N.useState(null);return N.useEffect(()=>{let d=!0;return I1().then(m=>d&&c(m),m=>d&&c({error:m.message})),()=>{d=!1}},[]),i===null?r?u.jsx(Rt,{title:"Could not load runs",hint:r}):u.jsx(Bt,{label:"Loading overview"}):u.jsx(Jj,{runs:i,doctor:o})}const Fj={id:"home",path:"/home",title:"Overview",component:Ij};function Wj(i){return i.verdict?is(i)?"verified":"notproven":i.pr_url?"pr":i.status==="running"||i.started_at?"running":"issue"}const w0={issue:"Issue",running:"Running",pr:"PR open",verified:"Verified",notproven:"Not proven"};function Pj({r:i}){const r=i.issue_ref??i.run_id;return u.jsx("a",{href:`#/runs/${encodeURIComponent(i.source_id)}/${encodeURIComponent(i.run_id)}`,"data-testid":"board-card","data-run":i.run_id,style:{textDecoration:"none",color:"inherit"},children:u.jsxs(Vt,{interactive:!0,compact:!0,children:[u.jsx("div",{style:{fontWeight:600,fontSize:"var(--cp-text-md)",overflowWrap:"anywhere"},children:r}),u.jsx("div",{style:{color:"var(--cp-text-muted)",fontSize:"var(--cp-text-xs)",marginTop:2},children:i.origin_repo??"repo not recorded"}),u.jsxs("div",{style:{display:"flex",gap:6,marginTop:8,flexWrap:"wrap",alignItems:"center"},children:[i.verdict?u.jsx(Ja,{run:i}):i.pr_url?u.jsx(Lt,{tone:"info",children:i.pr_draft?"draft PR":"PR open"}):i.status==="running"?u.jsx(Ja,{verdict:Et.RUNNING}):u.jsx(Lt,{children:"queued"}),i.current_stage&&!i.verdict?u.jsx(Lt,{children:i.current_stage}):null]})]})})}function Fi({id:i,runs:r}){return u.jsxs("section",{"data-testid":`lane-${i}`,"aria-label":w0[i],style:{display:"flex",flexDirection:"column",gap:8},children:[u.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"var(--cp-text-xs)",color:"var(--cp-text-2)",textTransform:"uppercase",letterSpacing:"0.05em"},children:[u.jsx("span",{children:w0[i]}),u.jsx("span",{children:r.length})]}),r.length===0?u.jsx("div",{style:{color:"var(--cp-text-muted)",fontSize:"var(--cp-text-xs)"},children:"none"}):r.map(o=>u.jsx(Pj,{r:o},`${o.source_id}/${o.run_id}`))]})}function Gu({id:i,children:r}){return u.jsx("div",{"data-testid":`col-${i}`,style:{background:"var(--cp-bg-2)",borderRadius:"var(--cp-radius-lg)",padding:10,display:"flex",flexDirection:"column",gap:16,minWidth:220},children:r})}function tS(){const[i,r]=N.useState(null),[o,c]=N.useState(null),d=N.useCallback(()=>{In().then(p=>{r(p.runs),c(null)}).catch(p=>c(p.message))},[]);if(N.useEffect(()=>(d(),Z0(d)),[d]),o&&!i)return u.jsx(Rt,{title:"Could not load runs",hint:o});if(!i)return u.jsx("div",{style:{padding:24},children:u.jsx(Bt,{label:"Loading runs"})});if(i.length===0)return u.jsx(Rt,{title:"No runs yet",hint:"Start a run and it will appear here."});const m=p=>i.filter(g=>Wj(g)===p);return u.jsxs("div",{style:{padding:24},children:[u.jsx("h1",{style:{fontFamily:"var(--cp-font-serif)",fontSize:"var(--cp-text-2xl)",margin:"0 0 16px"},children:"Work"}),u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:12,alignItems:"start"},children:[u.jsx(Gu,{id:"issue",children:u.jsx(Fi,{id:"issue",runs:m("issue")})}),u.jsx(Gu,{id:"running",children:u.jsx(Fi,{id:"running",runs:m("running")})}),u.jsx(Gu,{id:"pr",children:u.jsx(Fi,{id:"pr",runs:m("pr")})}),u.jsxs(Gu,{id:"done",children:[u.jsx(Fi,{id:"verified",runs:m("verified")}),u.jsx(Fi,{id:"notproven",runs:m("notproven")})]})]})]})}const eS={id:"work",path:"/work",title:"Work",component:()=>u.jsx(tS,{})},Qu=i=>`${i.source_id}/${i.run_id}`;function lS(){const[i,r]=N.useState(null),[o,c]=N.useState(null),[d,m]=N.useState({}),[p,g]=N.useState(void 0);N.useEffect(()=>{let A=!0;return In().then(L=>A&&r(L.runs),L=>A&&c(L.message)),Cb().then(L=>A&&g(L),()=>A&&g(null)),()=>{A=!1}},[]);const b=async A=>{m(L=>({...L,[Qu(A)]:"pending"}));try{const L=await hg(A.source_id,A.run_id);m(Q=>({...Q,[Qu(A)]:L}))}catch(L){m(Q=>({...Q,[Qu(A)]:{error:L.message}}))}};if(o)return u.jsx(Rt,{title:"Receipts unavailable",hint:o});if(!i)return u.jsx(Bt,{label:"Loading receipts"});const v=i.filter(A=>A.verdict),R=Ab(v),y=v.length?Math.round(v.filter(A=>is(A)).length/v.length*100):null;return u.jsxs("div",{"data-testid":"receipts",style:{display:"flex",flexDirection:"column",gap:16},children:[u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:12},children:[u.jsx(Kn,{label:`Verified rate (${v.length} finished run${v.length===1?"":"s"}, by run outcome)`,value:y===null?"not measured":`${y}%`,series:R.map(A=>A.rate),trend:R.length>1?`${R.length} days`:void 0}),u.jsxs(Vt,{style:{padding:"14px 16px"},"data-testid":"public-key",children:[u.jsx("div",{style:{fontSize:"var(--cp-text-sm)",color:"var(--cp-text-2)"},children:"Public key (Ed25519)"}),p===void 0?u.jsx(Bt,{size:12}):p===null?u.jsx("div",{children:"not measured: no signing key on this machine yet"}):u.jsxs("div",{style:{fontFamily:"var(--cp-font-mono)",fontSize:12,wordBreak:"break-all"},children:[u.jsxs("div",{"data-testid":"key-kid",children:["kid ",p.kid]}),u.jsxs("div",{"data-testid":"key-x",children:["x ",p.x]})]})]})]}),v.length===0?u.jsx(Rt,{title:"No finished runs yet",hint:"A receipt appears here when a run completes."}):u.jsx(Wn,{caption:"Receipts",columns:["Run","Outcome","Started","Verify"],rows:v.map(A=>{const L=d[Qu(A)];return[u.jsx("span",{style:{fontFamily:"var(--cp-font-mono)"},children:A.run_id},"run"),u.jsx(Ja,{run:A},"out"),A.started_at??"not measured",u.jsxs("span",{style:{display:"inline-flex",gap:8,alignItems:"center"},children:[u.jsx(gt,{size:"sm",variant:"secondary",disabled:L==="pending",onClick:()=>void b(A),"data-testid":"verify-btn",children:L==="pending"?"Verifying":"Verify"}),L&&L!=="pending"?"error"in L?u.jsx(Lt,{tone:"error","data-testid":"verify-result",children:L.error}):u.jsxs("span",{"data-testid":"verify-result","data-verdict":L.verdict,children:[u.jsx(Ja,{run:{verdict:L.verdict,tampered:A.tampered}}),L.reasons[0]?u.jsx("span",{style:{marginLeft:8,color:"var(--cp-text-2)",fontSize:12},children:L.reasons[0]}):null]}):null]},"v")]})})]})}const nS={id:"receipts",path:"/receipts",title:"Receipts",component:lS},We={padding:"12px 14px",verticalAlign:"top"},Cg={...We,textAlign:"left",fontSize:"var(--cp-text-sm)",fontWeight:500,color:"var(--cp-text-muted)",borderBottom:"1px solid var(--cp-border)"},yf={color:"var(--cp-text-muted)",fontSize:"var(--cp-text-sm)"},Ag={fontFamily:"var(--cp-font-serif)",fontWeight:400,fontSize:"var(--cp-text-2xl)",margin:0};function aS({runs:i,now:r=Date.now()}){const o=N.useMemo(()=>or(i).filter(c=>c.attempts.some(d=>d.pr_url)).map(c=>({g:c,r:c.attempts.find(d=>d.pr_url)})),[i]);return u.jsxs("section",{"data-testid":"prs-page",style:{display:"flex",flexDirection:"column",gap:20},children:[u.jsx("h1",{style:Ag,children:"Pull requests"}),o.length===0?u.jsx(Rt,{title:"No pull requests yet",hint:"A run that opens a PR lists it here."}):u.jsx(Vt,{style:{padding:0,overflow:"auto"},children:u.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--cp-text-base)"},children:[u.jsx("thead",{children:u.jsx("tr",{children:["Issue","Repo","Outcome","PR","When"].map(c=>u.jsx("th",{scope:"col",style:Cg,children:c},c))})}),u.jsx("tbody",{children:o.map(({g:c,r:d})=>u.jsxs("tr",{"data-testid":"pr-row",style:{borderTop:"1px solid var(--cp-border-light)"},children:[u.jsx("td",{style:We,children:u.jsx("a",{href:fs(d),style:{color:"var(--cp-text)",textDecoration:"none"},children:c.title})}),u.jsx("td",{style:{...We,...yf},children:c.repo}),u.jsx("td",{style:We,children:u.jsx(ds,{verdict:Sn(d)})}),u.jsx("td",{style:We,children:u.jsx(fr,{run:d})}),u.jsx("td",{style:{...We,...yf},children:Pa(d,r)})]},c.key))})]})})]})}function iS(){const{runs:i,error:r}=rr();return i===null?r?u.jsx(Rt,{title:"Could not load pull requests",hint:r}):u.jsx(Bt,{label:"Loading pull requests"}):u.jsx(aS,{runs:i})}function sS(i){const r=new Map;for(const o of i)o.origin_repo&&r.set(o.origin_repo,[...r.get(o.origin_repo)??[],o]);return[...r].map(([o,c])=>{const d=c.filter(p=>typeof p.cost_usd=="number"),m=or(c);return{repo:o,issues:m.length,runs:c.length,latest:m[0].latest,cost:d.length?d.reduce((p,g)=>p+(g.cost_usd??0),0):null}}).sort((o,c)=>Date.parse(c.latest.started_at??"")-Date.parse(o.latest.started_at??""))}function uS({runs:i,now:r=Date.now()}){const o=N.useMemo(()=>sS(i),[i]);return u.jsxs("section",{"data-testid":"repos-page",style:{display:"flex",flexDirection:"column",gap:20},children:[u.jsx("h1",{style:Ag,children:"Repos"}),o.length===0?u.jsx(Rt,{title:"No repos yet",hint:"Repos appear once a run has recorded its origin."}):u.jsx(Vt,{style:{padding:0,overflow:"auto"},children:u.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--cp-text-base)"},children:[u.jsx("thead",{children:u.jsx("tr",{children:["Repo","Issues","Runs","Latest outcome","Cost","Last run"].map(c=>u.jsx("th",{scope:"col",style:Cg,children:c},c))})}),u.jsx("tbody",{children:o.map(c=>u.jsxs("tr",{"data-testid":"repo-row",style:{borderTop:"1px solid var(--cp-border-light)"},children:[u.jsx("td",{style:We,children:c.repo}),u.jsx("td",{style:We,children:c.issues}),u.jsx("td",{style:We,children:c.runs}),u.jsx("td",{style:We,children:u.jsx(ds,{verdict:Sn(c.latest)})}),u.jsx("td",{style:We,children:wf({...c.latest,cost_usd:c.cost,partial_usd:0})}),u.jsx("td",{style:{...We,...yf},children:Pa(c.latest,r)})]},c.repo))})]})})]})}function rS(){const{runs:i,error:r}=rr();return i===null?r?u.jsx(Rt,{title:"Could not load repos",hint:r}):u.jsx(Bt,{label:"Loading repos"}):u.jsx(uS,{runs:i})}const cS={id:"pulls",path:"/pulls",title:"Pull requests",component:iS},oS={id:"repos",path:"/repos",title:"Repos",component:rS};class dr extends Error{constructor(r,o){super(o),this.status=r}}const wg=()=>globalThis.LOKI_CONTROL_BASE??"",Dg=(i={})=>{const r=_e();return r?{...i,authorization:`Bearer ${r}`}:i};async function Mf(i,r){const o=await fetch(`${wg()}${i}`,{...r,headers:Dg(r!=null&&r.body?{"content-type":"application/json"}:{})}),c=await o.json().catch(()=>({}));if(!o.ok)throw new dr(o.status,c.error??`HTTP ${o.status}`);return c}const fS=async()=>(await Mf("/v1/ask/threads")).threads,dS=i=>Mf(`/v1/ask/threads/${encodeURIComponent(i)}`),Mg=i=>Mf("/v1/ask",{method:"POST",body:JSON.stringify(i)});function hS(i){var d,m;const r=i.split(`
183
-
184
- `),o=r.pop()??"",c=[];for(const p of r){const g=(m=(d=/^event: (.+)$/m.exec(p))==null?void 0:d[1])==null?void 0:m.trim(),b=p.split(`
185
- `).filter(R=>R.startsWith("data:")).map(R=>R.slice(5).replace(/^ /,"")).join(`
186
- `);if(!g)continue;let v={};try{v=b?JSON.parse(b):{}}catch{continue}g==="delta"?c.push({type:"delta",text:String(v.text??"")}):g==="tool_use"?c.push({type:"tool_use",name:String(v.name??"")}):g==="result"?c.push({type:"result",text:String(v.text??""),isError:v.isError===!0}):g==="error"?c.push({type:"error",message:String(v.message??"error")}):g==="done"&&c.push({type:"done",status:String(v.status??"")})}return{events:c,rest:o}}async function mS(i,r,o){const c=await fetch(`${wg()}/v1/ask/messages/${encodeURIComponent(i)}/stream`,{headers:Dg({accept:"text/event-stream"}),signal:o});if(!c.ok||!c.body)throw new dr(c.status,`HTTP ${c.status}`);const d=c.body.getReader(),m=new TextDecoder;let p="";for(;;){const{value:g,done:b}=await d.read();if(b)break;p+=m.decode(g,{stream:!0});const{events:v,rest:R}=hS(p);p=R;for(const y of v)r(y)}}const pS=/Start a run on ([A-Za-z0-9][A-Za-z0-9._-]*\/[A-Za-z0-9._-]+#[1-9][0-9]*)\?/g;function gS(i){return[...new Set([...i.matchAll(pS)].map(r=>r[1]))]}let lr={enabled:!1,checked:!1,threads:[],error:null};const xf=new Set,rf=i=>{lr=i;for(const r of xf)r()},ns=()=>lr;async function kf(){try{rf({enabled:!0,checked:!0,threads:await fS(),error:null})}catch(i){i instanceof dr&&i.status===404?rf({enabled:!1,checked:!0,threads:[],error:null}):rf({...lr,enabled:lr.enabled,checked:!0,error:i instanceof Error?i.message:"could not reach the control service"})}}function kg(){const i=N.useSyncExternalStore(r=>(xf.add(r),()=>{xf.delete(r)}),ns,ns);return N.useEffect(()=>{ns().checked||kf()},[]),i}const Ug=["done","complete","completed","error","failed","cancelled","canceled"],Hg={color:"var(--cp-text-muted)",fontSize:"var(--cp-text-sm)"},vS=i=>{location.hash=`#/ask/${encodeURIComponent(i)}`};function yS({text:i}){const r=gS(i);return r.length===0?null:u.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginTop:10},children:r.map(o=>u.jsxs(gt,{variant:"secondary",size:"sm","data-testid":"offer-run",onClick:()=>Ia(o),children:["Start a run on ",o,"?"]},o))})}function xS({m:i,tool:r}){const o=i.role==="user";return u.jsxs("div",{"data-testid":o?"ask-user":"ask-assistant","data-status":i.status,style:{alignSelf:o?"flex-end":"stretch",maxWidth:o?"80%":"100%",padding:o?"10px 14px":"4px 0",borderRadius:"var(--cp-radius-lg)",background:o?"var(--cp-bg-3)":"transparent",color:"var(--cp-text)",fontSize:"var(--cp-text-md)",lineHeight:1.6,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:[i.text,!o&&r?u.jsxs("div",{"data-testid":"ask-tool",style:Hg,children:["Using ",r]}):null,i.error?u.jsx("div",{role:"alert","data-testid":"ask-message-error",style:{color:"var(--cp-error)",marginTop:6},children:i.error}):null,!o&&!Ug.includes(i.status)&&i.text===""&&!r?u.jsx(Bt,{label:"Loki is answering"}):null,o?null:u.jsx(yS,{text:i.text})]})}function Lg({busy:i,onSend:r,placeholder:o}){const[c,d]=N.useState(""),m=()=>{const p=c.trim();!p||i||(r(p),d(""))};return u.jsxs("form",{onSubmit:p=>{p.preventDefault(),m()},style:{display:"flex",gap:8,alignItems:"flex-end"},children:[u.jsx("textarea",{"aria-label":"Ask Loki","data-testid":"ask-input",rows:2,value:c,placeholder:o,maxLength:4e3,disabled:i,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&!p.nativeEvent.isComposing&&(p.preventDefault(),m())},style:{flex:1,resize:"vertical",padding:"10px 12px",borderRadius:"var(--cp-radius-md)",border:"1px solid var(--cp-border)",background:"var(--cp-bg)",color:"var(--cp-text)",font:"inherit",fontSize:"var(--cp-text-md)"}}),u.jsx(gt,{type:"submit","data-testid":"ask-send",disabled:i||c.trim()==="",children:"Ask"})]})}const Iu=i=>i instanceof dr&&i.status===404?"Ask Loki is not available on this control service.":i instanceof Error?i.message:"could not reach the control service";function bS(){return u.jsx(Rt,{title:"Ask Loki is off",hint:"This control service was started without LOKI_CP_ASK, so there is nothing to ask. Set LOKI_CP_ASK=1 and restart it."})}function jS({id:i}){var H;const[r,o]=N.useState(null),[c,d]=N.useState(null),[m,p]=N.useState({}),[g,b]=N.useState(!1),v=N.useRef(new Set),R=N.useRef(!0),y=N.useRef(null),A=N.useCallback((Y,J)=>{o(M=>M&&{...M,messages:M.messages.map(B=>B.id===Y?J(B):B)})},[]),L=N.useCallback(Y=>{if(v.current.has(Y))return;v.current.add(Y),b(!0),mS(Y,M=>{R.current&&(M.type==="delta"?A(Y,B=>({...B,status:"streaming",text:B.text+M.text})):M.type==="tool_use"?p(B=>({...B,[Y]:M.name})):M.type==="result"?A(Y,B=>M.isError?{...B,error:M.text}:B.text===""?{...B,text:M.text}:B):M.type==="error"?A(Y,B=>({...B,status:"error",error:M.message})):M.type==="done"&&A(Y,B=>({...B,status:B.status==="error"?"error":M.status||"done"})))}).catch(M=>R.current&&A(Y,B=>({...B,status:"error",error:Iu(M)}))).finally(()=>{v.current.delete(Y),R.current&&(p(M=>{const{[Y]:B,...$}=M;return $}),b(v.current.size>0),kf())})},[A]),Q=N.useCallback(()=>{dS(i).then(Y=>{if(R.current){o(Y),d(null);for(const J of Y.messages)J.role==="assistant"&&!Ug.includes(J.status)&&L(J.id)}},Y=>R.current&&d(Iu(Y)))},[i,L]);N.useEffect(()=>(R.current=!0,o(null),d(null),Q(),()=>{R.current=!1}),[Q]),N.useEffect(()=>{var Y,J;(J=(Y=y.current)==null?void 0:Y.scrollIntoView)==null||J.call(Y,{block:"end"})},[r==null?void 0:r.messages.length,(H=r==null?void 0:r.messages.at(-1))==null?void 0:H.text]);const at=Y=>{d(null),Mg({question:Y,thread_id:i}).then(()=>Q(),J=>d(Iu(J)))};return c&&!r?u.jsx(Rt,{title:"Could not open this thread",hint:c}):r?u.jsxs("section",{"data-testid":"ask-thread",style:{display:"flex",flexDirection:"column",gap:20,maxWidth:760,margin:"0 auto"},children:[u.jsx("h1",{style:{fontFamily:"var(--cp-font-serif)",fontWeight:400,fontSize:"var(--cp-text-2xl)",margin:0},children:r.thread.title}),u.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[r.messages.map(Y=>u.jsx(xS,{m:Y,tool:m[Y.id]},Y.id)),u.jsx("div",{ref:y})]}),c?u.jsx("p",{role:"alert","data-testid":"ask-error",style:{margin:0,color:"var(--cp-error)"},children:c}):null,u.jsx(Lg,{busy:g,onSend:at,placeholder:"Ask a follow-up"})]}):u.jsx(Bt,{label:"Loading thread"})}function SS(){const[i,r]=N.useState(!1),[o,c]=N.useState(null),d=m=>{r(!0),c(null),Mg({question:m}).then(p=>{kf(),vS(p.thread_id)},p=>{c(Iu(p)),r(!1)})};return u.jsxs("section",{"data-testid":"ask-new",style:{display:"flex",flexDirection:"column",gap:20,maxWidth:760,margin:"12vh auto 0"},children:[u.jsx("h1",{style:{fontFamily:"var(--cp-font-serif)",fontWeight:400,fontSize:"var(--cp-text-3xl, 2rem)",margin:0},children:"Ask Loki"}),u.jsx("p",{style:{...Hg,margin:0},children:"Ask about your runs, repos and issues. Loki answers from what it can read and never starts a run without your confirmation."}),o?u.jsx("p",{role:"alert","data-testid":"ask-error",style:{margin:0,color:"var(--cp-error)"},children:o}):null,u.jsx(Lg,{busy:i,onSend:d,placeholder:"What do you want to know?"})]})}function Bg({id:i}){const r=kg();return r.checked?r.enabled?i?u.jsx(jS,{id:i},i):u.jsx(SS,{}):r.error?u.jsx(Rt,{title:"Could not reach Ask Loki",hint:r.error}):u.jsx(bS,{}):u.jsx(Bt,{label:"Checking Ask Loki"})}const _S={id:"ask",path:"/ask",title:"Ask Loki",component:()=>u.jsx(Bg,{})},ES={id:"ask-thread",path:"/ask/:id",title:"Ask Loki thread",component:({params:i})=>u.jsx(Bg,{id:i.id})};async function TS(){const i=globalThis.LOKI_CONTROL_BASE??"",r=_e(),o=await fetch(`${i}/v1/providers`,{headers:r?{authorization:`Bearer ${r}`}:{}});if(!o.ok)throw new Error(`HTTP ${o.status}`);return await o.json()}const NS=i=>i.probe==="timeout"?"installed, version probe timed out":i.installed?i.version?`installed, ${i.version}`:"installed, version not reported":"not installed";function RS(){const[i,r]=N.useState(null),[o,c]=N.useState(null);if(N.useEffect(()=>{let m=!0;return TS().then(p=>m&&r(p)).catch(p=>m&&c(p instanceof Error?p.message:String(p))),()=>{m=!1}},[]),o)return u.jsx(Rt,{title:"Could not load providers",hint:o});if(!i)return u.jsx(Bt,{label:"Detecting provider CLIs"});const d=i.providers.map(m=>[u.jsxs("span",{style:{display:"inline-flex",gap:8,alignItems:"center"},children:[u.jsx(eb,{state:m.installed?"active":"idle",label:m.installed?"installed":"not installed"}),u.jsx("strong",{children:m.id}),m.deprecated?u.jsx(Lt,{tone:"warning",children:"deprecated"}):null]},"n"),NS(m),m.auth_present?u.jsx(Lt,{tone:"success",children:"auth present"},"a"):u.jsx(Lt,{tone:"neutral",children:"no auth env set"},"a"),m.auth_env_names.length?`${m.auth_env_set.length?m.auth_env_set.join(", "):"none"} (of ${m.auth_env_names.join(", ")})`:"not measured",m.tiers.planning??"not measured",m.tiers.development??"not measured",m.tiers.fast??"not measured"]);return u.jsxs("div",{style:{display:"grid",gap:16},children:[u.jsx("h1",{style:{margin:0,fontSize:"var(--cp-text-xl, 20px)"},children:"Models and providers"}),u.jsx(Wn,{caption:"Provider CLIs",columns:["Provider","CLI","Auth","Env vars set","Planning","Development","Fast"],rows:d}),u.jsx(Vt,{compact:!0,children:u.jsxs("small",{children:["Auth shows only whether an environment variable is set, never its value. Model tiers come from the catalog",i.catalog_updated?` (updated ${i.catalog_updated})`:"",". Version probes stop after ",i.probe_timeout_ms," ms."]})})]})}const zS={id:"models",path:"/models",title:"Models and providers",component:RS,inSettings:!0},OS=new Set(["that","this","with","from","when","should","must","will","have","into","then","than","each","which","their","there","about"]),ts=i=>new Set((i.toLowerCase().match(/[a-z0-9]{4,}/g)??[]).filter(r=>!OS.has(r))),Wi=(i,r)=>{for(const o of i)if(r.has(o))return!0;return!1},cf=i=>ts(i.replace(/[/.]/g," "));function of(i){if(i===null)return null;try{return JSON.parse(i)}catch{return null}}function CS(i){const r=i&&typeof i=="object"?i:{},c=(typeof r.body=="string"?r.body:"").split(/\r?\n/),d=c.map(b=>{var v,R;return(R=(v=/^\s*[-*]\s*\[[ xX]\]\s*(.+)$/.exec(b))==null?void 0:v[1])==null?void 0:R.trim()}).filter(b=>!!b);if(d.length)return{list:d,source:"checklist"};const m=[];let p=!1;for(const b of c)if(/^\s*#{1,6}\s/.test(b)||/^\s*\*\*[^*]+\*\*:?\s*$/.test(b))p=/accept|requirement|criteri|expected|done when/i.test(b);else if(p){const v=/^\s*(?:[-*]|\d+[.)])\s+(.+)$/.exec(b);v!=null&&v[1]&&m.push(v[1].trim())}if(m.length)return{list:m,source:"checklist"};const g=typeof r.title=="string"?r.title.trim():"";return g?{list:[g],source:"title"}:{list:[],source:"none"}}function AS(i){const r=i,o=Array.isArray(i)?i:Array.isArray(r==null?void 0:r.steps)?r.steps:Array.isArray(r==null?void 0:r.plan)?r.plan:typeof(r==null?void 0:r.plan)=="string"?r.plan.split(/\r?\n/).filter(d=>d.trim()):[],c=[];for(const d of o){if(typeof d=="string"){const m=d.replace(/^\s*(?:[-*]|\d+[.)])\s*/,"").trim();m&&c.push({text:m,files:[],checks:[]});continue}if(d&&typeof d=="object"){const m=d,p=[m.title,m.step,m.description,m.text].find(v=>typeof v=="string"&&v.trim()!=="");if(!p)continue;const g=Array.isArray(m.files)?m.files.filter(v=>typeof v=="string"):[],b=Array.isArray(m.checks)?m.checks.filter(v=>typeof v=="string"):[];c.push({text:p.trim(),files:g,checks:b,...typeof m.criterion=="string"?{criterion:m.criterion}:{}})}}return c}function wS(i){if(!i)return[];const r=new Set;for(const o of i.matchAll(/^diff --git a\/(.+?) b\/(.+)$/gm))r.add(o[2]);return[...r]}function DS(i,r){return i?jl({...i,verdict:i.verdict??(r==null?void 0:r.verdict)??null}):null}function MS(i){var y,A,L,Q,at;const{list:r,source:o}=CS(i.issue),c=AS(i.plan),d=((y=i.receipt)==null?void 0:y.checks)??[],m=i.run?jl({...i.run,verdict:i.run.verdict??((A=i.receipt)==null?void 0:A.verdict)??null}):null,p=(L=i.receipt)==null?void 0:L.verdict,g=m===Et.VERIFIED&&(p==null||p===Et.VERIFIED),b=[...new Set([...i.changedFiles,...((at=(Q=i.receipt)==null?void 0:Q.wall)==null?void 0:at.files)??[]])],v=new Set;return{rows:r.map(H=>{const Y=ts(H),J=c.filter(it=>it.criterion?it.criterion.trim()===H:Wi(Y,ts(it.text))),M=new Set;for(const it of J){for(const Gt of it.files)M.add(Gt);const Jt=ts(it.text);for(const Gt of b)Wi(Jt,cf(Gt))&&M.add(Gt)}for(const it of b)Wi(Y,cf(it))&&M.add(it);const B=[...M];B.forEach(it=>v.add(it));const $=it=>it.name.trim().toLowerCase(),ot=it=>!!$(it)&&(H.toLowerCase().includes($(it))||J.some(Jt=>Jt.text.toLowerCase().includes($(it))||Jt.checks.some(Gt=>Gt.trim().toLowerCase()===$(it)))),tt=d.filter(it=>{const Jt=ts(`${it.name} ${it.cmd??""}`);return ot(it)||Wi(Y,Jt)||B.some(Gt=>Wi(cf(Gt),Jt))}),et=tt.filter(ot),Kt=tt.filter(it=>!ot(it));let P="not proven",xt=null;return i.receipt?et.some(it=>it.result==="fail")?(P="failed",xt="a linked check failed"):et.length===0?xt=Kt.length?"link inferred":"no check linked to this criterion":et.every(it=>it.result==="pass")?g?P="proven":xt=`verdict is ${m!==Et.VERIFIED?m??"unknown (run record unavailable)":p}`:xt="a linked check did not run":xt="no receipt for this run",{criterion:H,steps:J.map(it=>it.text),files:B,evidence:et,inferred:Kt,status:P,note:xt}}),unmapped_files:b.filter(H=>!v.has(H)),criteria_source:o}}async function kS(i,r,o,c){const[d,m,p,g]=await Promise.all(["issue.json","plan.json","receipt.json","diff.patch"].map(y=>mg(i,r,y))),b=of(p??null),v=of(d??null),R=of(m??null);return{matrix:MS({issue:v,plan:R,receipt:b,changedFiles:wS(g??null),run:c}),stages:o,verdict:DS(c,b),have:{issue:v!==null,plan:R!==null,receipt:b!==null}}}const US={proven:"success",failed:"error","not proven":"warning"},es={fontFamily:"var(--cp-font-mono)",fontSize:12,wordBreak:"break-all"},ff=u.jsx("span",{style:{color:"var(--cp-text-2)"},children:"none"});function qg({params:i}){const r=i.source,o=i.run;return!r||!o?u.jsx(HS,{}):u.jsx(LS,{source:r,run:o})}function HS(){const[i,r]=N.useState(null),[o,c]=N.useState(null);return N.useEffect(()=>{let d=!0;return In().then(m=>d&&r(m.runs),m=>d&&c(m.message)),()=>{d=!1}},[]),o?u.jsx(Rt,{title:"Plans unavailable",hint:o}):i?i.length?u.jsx("div",{"data-testid":"plans-picker",children:u.jsx(Wn,{caption:"Pick a run",columns:["Run","Outcome","Started"],rows:i.map(d=>[u.jsx("a",{href:`#/plans/${encodeURIComponent(d.source_id)}/${encodeURIComponent(d.run_id)}`,style:es,"data-testid":"plans-pick",children:d.run_id},"a"),d.verdict?u.jsx(Ja,{run:d},"v"):"running",d.started_at??"not measured"])})}):u.jsx(Rt,{title:"No runs yet",hint:"Start a run to see its plan and traceability here."}):u.jsx(Bt,{label:"Loading runs"})}function LS({source:i,run:r}){var R;const[o,c]=N.useState(null),[d,m]=N.useState(null);if(N.useEffect(()=>{let y=!0;return c(null),(async()=>{const A=await ar(i,r).catch(()=>null);return kS(i,r,(A==null?void 0:A.stages)??null,A)})().then(A=>y&&c(A),A=>y&&m(A.message)),()=>{y=!1}},[i,r]),d)return u.jsx(Rt,{title:"Plan unavailable",hint:d});if(!o)return u.jsx(Bt,{label:"Loading plan"});const{matrix:p,have:g}=o,b=["issue","plan","receipt"].filter(y=>!g[y]),v=p.rows.filter(y=>y.status==="proven").length;return u.jsxs("div",{"data-testid":"plans",style:{display:"flex",flexDirection:"column",gap:16},children:[u.jsxs(Vt,{style:{padding:"14px 16px"},children:[u.jsx("div",{style:{fontFamily:"var(--cp-font-mono)"},children:r}),u.jsxs("div",{"data-testid":"plans-summary",style:{color:"var(--cp-text-2)"},children:[p.rows.length?`${v} of ${p.rows.length} criteria proven`:"not measured: no criteria",o.verdict?` - verdict ${Ae(o.verdict).label}`:g.receipt?" - verdict unavailable":" - no receipt"]}),b.length?u.jsxs("div",{"data-testid":"plans-missing",style:{color:"var(--cp-text-2)"},children:["not available: ",b.map(y=>`${y}.json`).join(", ")]}):null]}),(R=o.stages)!=null&&R.length?u.jsx(ab,{stages:o.stages.map(y=>({label:y.stage,status:y.status==="completed"?"success":y.status==="failed"?"error":"pending"}))}):null,p.rows.length===0?u.jsx(Rt,{title:"No requirements found",hint:"issue.json has no title or acceptance criteria for this run."}):u.jsx(Wn,{caption:"Traceability matrix",columns:["Requirement","Plan step","Files changed","Evidence","Verdict"],rows:p.rows.map(y=>[y.criterion,y.steps.length?u.jsx("ol",{style:{margin:0,paddingLeft:16},children:y.steps.map(A=>u.jsx("li",{children:A},A))},"s"):ff,y.files.length?u.jsx("div",{style:es,children:y.files.map(A=>u.jsx("div",{children:A},A))},"f"):ff,y.evidence.length||y.inferred.length?u.jsxs("div",{children:[y.evidence.map(A=>u.jsxs("div",{style:es,children:[A.result,": ",A.name]},A.name)),y.inferred.map(A=>u.jsxs("div",{"data-testid":"inferred-hint",style:{...es,color:"var(--cp-text-2)"},children:["inferred, not recorded: ",A.result,": ",A.name]},`i-${A.name}`))]},"e"):ff,u.jsxs("span",{"data-testid":"row-status","data-status":y.status,children:[u.jsx(Lt,{tone:US[y.status],children:y.status==="not proven"?y.note==="link inferred"?"NOT PROVEN (link inferred)":"NOT PROVEN":y.status.toUpperCase()}),y.note?u.jsx("div",{style:{color:"var(--cp-text-2)",fontSize:12},children:y.note}):null]},"v")])}),p.unmapped_files.length?u.jsxs(Vt,{style:{padding:"14px 16px"},"data-testid":"plans-unmapped",children:[u.jsx("div",{style:{color:"var(--cp-text-2)"},children:"Changed files not tied to any requirement"}),u.jsx("div",{style:es,children:p.unmapped_files.map(y=>u.jsx("div",{children:y},y))})]}):null]})}const BS={id:"plans",path:"/plans/:source/:run",title:"Plans",component:qg},qS={id:"plans-picker",path:"/plans",title:"Plans",component:qg},$g=()=>globalThis.LOKI_CONTROL_BASE??"",bf=i=>{const r=_e();return{...i?{"content-type":"application/json"}:{},...r?{authorization:`Bearer ${r}`}:{}}};async function D0(i,r){const o=await fetch(`${$g()}${i}`,r),c=await o.json().catch(()=>({}));if(!o.ok)throw new Error(c.error??`HTTP ${o.status}`);return c}async function $S(i){const r=await fetch(`${$g()}/v1/merge/run`,{method:"POST",headers:bf(!0),body:JSON.stringify({dryRun:i})}),o=await r.json().catch(()=>null);if(!o||!Array.isArray(o.lines))throw new Error((o==null?void 0:o.error)??`HTTP ${r.status}`);return{ok:!1,ran:!1,dryRun:i,exit:null,...o,lines:o.lines}}function Xu(i){if(i.ran&&!i.partial&&!i.error)return null;const r=i.error??"the run did not finish cleanly";return i.timedOut?`Partial outcome: ${r}. Lines below show what completed before it stopped. PRs listed as merged are already merged, but the queue file is only rewritten when a run finishes, so they may still appear in the queue; PRs not listed may still be queued.`:`${i.partial?"Partial outcome":"Not completed"}: ${r}. Lines below show what completed before it stopped; PRs not listed as merged may still be queued.`}function YS(){const[i,r]=N.useState(null),[o,c]=N.useState(null),[d,m]=N.useState(""),[p,g]=N.useState(!1),[b,v]=N.useState(null),[R,y]=N.useState(null),[A,L]=N.useState(!1),[Q,at]=N.useState(null),H=N.useCallback(async()=>{try{const $=await D0("/v1/merge/queue",{headers:bf(!1)});$.measured?(r($.queue),c(null)):(r(null),c($.error??"not measured"))}catch($){r(null),c($ instanceof Error?$.message:String($))}},[]);N.useEffect(()=>{H()},[H]);const Y=/^[0-9]{1,7}$/.test(d.trim()),J=async()=>{g(!0),v(null);try{await D0("/v1/merge/queue",{method:"POST",headers:bf(!0),body:JSON.stringify({prs:[d.trim()]})}),v({tone:"success",text:`Queued PR #${d.trim()}`}),m(""),await H()}catch($){v({tone:"error",text:$ instanceof Error?$.message:String($)})}g(!1)},M=async $=>{g(!0),v(null),L(!1);try{const ot=await $S($);$?(y(ot),at(null)):(at(ot),y(null)),await H()}catch(ot){v({tone:"error",text:ot instanceof Error?ot.message:String(ot)})}g(!1)},B=i!==null&&i.length===0;return u.jsxs("div",{style:{display:"grid",gap:16,maxWidth:720},children:[u.jsx("h1",{style:{margin:0,fontSize:"var(--cp-text-xl, 20px)"},children:"Merge queue"}),u.jsx(Vt,{children:u.jsxs("div",{style:{display:"grid",gap:8},children:[u.jsx("strong",{children:"Queue"}),o?u.jsx(Rt,{title:"Queue not measured",hint:o}):i===null?u.jsx(Bt,{label:"Reading the queue"}):B?u.jsx("small",{children:"The merge queue is empty."}):u.jsx("ol",{"aria-label":"Queued pull requests",style:{margin:0,paddingLeft:20},children:i.map($=>u.jsxs("li",{children:["PR #",$]},$))}),u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx(Fn,{"aria-label":"PR number",inputMode:"numeric",placeholder:"PR number",value:d,onChange:$=>m($.target.value.replace(/[^0-9]/g,"").slice(0,7))}),u.jsx(gt,{variant:"secondary",disabled:!Y||p,onClick:J,children:"Add"})]})]})}),u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[u.jsx(gt,{variant:"secondary",disabled:p||B||i===null,onClick:()=>M(!0),children:"Preview"}),A?u.jsxs("span",{role:"alertdialog","aria-label":"Confirm merge",style:{display:"inline-flex",gap:8,alignItems:"center"},children:[u.jsx("small",{children:"Squash-merge each PR whose checks are green, one at a time. This cannot be undone."}),u.jsx(gt,{variant:"danger",disabled:p,onClick:()=>M(!1),children:"Confirm merge"}),u.jsx(gt,{variant:"ghost",onClick:()=>L(!1),children:"Cancel"})]}):u.jsx(gt,{disabled:p||B||i===null,onClick:()=>L(!0),children:"Merge queue"}),p?u.jsx(Bt,{label:"Working"}):null]}),b?u.jsx(Lt,{tone:b.tone,children:b.text}):null,R?u.jsxs(Vt,{children:[u.jsx("strong",{children:"Plan (dry run, nothing changed)"}),Xu(R)?u.jsx("p",{role:"alert",style:{margin:"4px 0"},children:Xu(R)}):null,u.jsx("pre",{style:{margin:0,whiteSpace:"pre-wrap"},children:R.lines.join(`
187
- `)||"not measured"})]}):null,Q?u.jsxs(Vt,{children:[u.jsx("strong",{children:"Merge result"})," ",u.jsx(Lt,{tone:Q.ok?"success":"warning",children:Q.ok?"all merged":Q.partial||!Q.ran?"partial result":"some PRs left in queue"}),Xu(Q)?u.jsx("p",{role:"alert",style:{margin:"4px 0"},children:Xu(Q)}):null,u.jsx("pre",{style:{margin:0,whiteSpace:"pre-wrap"},children:Q.lines.join(`
188
- `)})]}):null]})}const VS={id:"merge",path:"/merge",title:"Merge queue",component:YS},GS=()=>globalThis.LOKI_CONTROL_BASE??"",QS=i=>i==="low"?"success":i==="medium"?"warning":i==="high"||i==="critical"?"error":"neutral";function XS(){const[i,r]=N.useState("pr"),[o,c]=N.useState(""),[d,m]=N.useState(!1),[p,g]=N.useState(null),b=i==="staged"||(i==="pr"?/^[0-9]{1,7}$/.test(o):/^[A-Za-z0-9._/][A-Za-z0-9._/-]{0,99}$/.test(o)),v=async()=>{m(!0);const R=i==="staged"?"staged=1":`${i}=${encodeURIComponent(o)}`;try{const y=_e(),A=await fetch(`${GS()}/v1/review/risk?${R}`,{headers:y?{authorization:`Bearer ${y}`}:{}}),L=await A.json().catch(()=>null);g(A.ok&&L&&L.measured===!0&&typeof L.score=="number"?L:{measured:!1,reason:(L==null?void 0:L.error)??(L==null?void 0:L.reason)??`HTTP ${A.status}`})}catch(y){g({measured:!1,reason:y instanceof Error?y.message:String(y)})}m(!1)};return u.jsxs("div",{style:{display:"grid",gap:16,maxWidth:720},children:[u.jsx("h1",{style:{margin:0,fontSize:"var(--cp-text-xl, 20px)"},children:"PR risk"}),u.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[u.jsxs("select",{"aria-label":"Diff source",value:i,onChange:R=>{r(R.target.value),c(""),g(null)},children:[u.jsx("option",{value:"pr",children:"Pull request"}),u.jsx("option",{value:"staged",children:"Staged changes"}),u.jsx("option",{value:"since",children:"Since a ref"})]}),i!=="staged"?u.jsx(Fn,{"aria-label":i==="pr"?"PR number":"Git ref",placeholder:i==="pr"?"PR number":"HEAD~5",value:o,onChange:R=>c(R.target.value)}):null,u.jsx(gt,{disabled:!b||d,onClick:v,children:"Measure risk"}),d?u.jsx(Bt,{label:"Scoring"}):null]}),p&&p.measured?u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[u.jsx(Kn,{label:"Risk score",value:`${p.score}/100`}),u.jsx(Lt,{tone:QS(p.level),children:p.level}),u.jsx("small",{children:p.source}),u.jsx("small",{children:typeof p.files=="number"?`${p.files} files`:"files: not measured"})]}),u.jsx(Wn,{caption:"Risk factors",columns:["Factor","Points","Detail"],rows:p.factors.map(R=>[R.factor,`${R.points}/${R.max}`,R.detail])})]}):p?u.jsxs(Vt,{children:[u.jsx("strong",{children:"Risk score: not measured"}),u.jsx("br",{}),u.jsx("small",{children:p.reason??"no reason reported"})]}):null]})}const ZS={id:"risk",path:"/risk",title:"PR risk",component:XS},Yg=()=>globalThis.LOKI_CONTROL_BASE??"",Vg=(i={})=>{const r=_e();return r?{...i,authorization:`Bearer ${r}`}:i};class Fa extends Error{constructor(r,o,c){super(r),this.status=o,this.details=c}}async function Gg(){const i=await fetch(`${Yg()}/v1/config`,{headers:Vg()}),r=await i.json().catch(()=>({}));if(!i.ok)throw new Fa(r.error??`HTTP ${i.status}`,i.status,[]);return{exists:!!r.exists,etag:r.etag??"",config:r.config??{},errors:r.errors??[]}}async function Qg(i,r){const o=await fetch(`${Yg()}/v1/config`,{method:"PUT",headers:Vg({"content-type":"application/json","if-match":r}),body:JSON.stringify({config:i})}),c=await o.json().catch(()=>({}));if(!o.ok)throw new Fa(c.error??`HTTP ${o.status}`,o.status,c.errors??(c.paths?c.paths.map(d=>`${d}: looks like a secret`):[]));return{etag:c.etag??r,config:c.config??i}}const $t=i=>`var(--cp-${i})`,KS=[{id:"provider",title:"Provider",hint:"Default provider. A CLI flag or LOKI_PROVIDER overrides it.",fields:[{path:["provider"],label:"Provider",kind:"select",options:["claude","codex","cline","aider","opencode"]}]},{id:"models",title:"Models",hint:"Model names passed to the provider.",fields:[{path:["models","default"],label:"Default model",kind:"text"},{path:["models","cheap"],label:"Cheap model",kind:"text"}]},{id:"git",title:"Git",hint:"Name of the environment variable that holds your GitHub token. The token itself is never stored here.",fields:[{path:["git","token_env"],label:"Token variable name",kind:"env",hint:"For example GITHUB_TOKEN"}]},{id:"repos",title:"Repos",hint:"owner/repo, one per line. The UI offers these and headless runs may target them.",fields:[{path:["repos"],label:"Repos",kind:"lines"}]},{id:"concurrency",title:"Concurrency",hint:"Backlog runs in parallel, 1 to 32 (default 2).",fields:[{path:["concurrency"],label:"Parallel runs",kind:"number"}]},{id:"budgets",title:"Budgets",hint:"USD caps. Leave blank for no cap.",fields:[{path:["budgets","per_run_usd"],label:"Per run (USD)",kind:"number"},{path:["budgets","per_day_usd"],label:"Per day (USD)",kind:"number"}]},{id:"knowledge_sources",title:"Knowledge sources",hint:"Local paths of knowledge to give runs, one per line.",fields:[{path:["knowledge_sources"],label:"Paths",kind:"lines"}]},{id:"workspaces",title:"Workspaces",hint:"Named groups of repos for cross-repo runs. Edited as JSON; the server validates it against the schema.",fields:[{path:["workspaces"],label:"Workspaces (JSON)",kind:"json"}]},{id:"notifications",title:"Notifications",hint:"Name of the environment variable that holds the Slack webhook URL. The URL itself is never stored here.",fields:[{path:["notifications","slack_webhook_env"],label:"Webhook variable name",kind:"env",hint:"For example SLACK_WEBHOOK_URL"}]}],vn=i=>typeof i=="object"&&i!==null&&!Array.isArray(i);function Zu(i){const r={},o=vn(i)&&vn(i.workspaces)?i.workspaces:{};for(const[c,d]of Object.entries(o))vn(d)&&(vn(d.integration)&&"command"in d.integration&&(r[`${c} integration command`]=String(d.integration.command)),Array.isArray(d.repos)&&d.repos.forEach((m,p)=>{vn(m)&&"setup"in m&&(r[`${c} setup for repo ${p+1}`]=String(m.setup))}));return r}const JS=(i,r)=>r.reduce((o,c)=>vn(o)?o[c]:void 0,i);function Xg(i,r,o){const c={...i},[d,...m]=r;if(d===void 0)return c;if(m.length===0)return o===void 0?delete c[d]:c[d]=o,c;const p=Xg(vn(c[d])?c[d]:{},m,o);return Object.keys(p).length===0?delete c[d]:c[d]=p,c}function IS(i,r){return r==null?"":i.kind==="lines"?Array.isArray(r)?r.join(`
189
- `):"":i.kind==="json"?JSON.stringify(r,null,2):String(r)}function FS(i,r){const o=r.trim();if(o==="")return{value:void 0};if(i.kind==="number"){const c=Number(o);return Number.isFinite(c)?{value:c}:{error:`${i.label} must be a number`}}if(i.kind==="lines")return{value:o.split(`
190
- `).map(c=>c.trim()).filter(Boolean)};if(i.kind==="json")try{const c=JSON.parse(o);return vn(c)?{value:c}:{error:`${i.label} must be a JSON object`}}catch{return{error:`${i.label} is not valid JSON`}}return{value:o}}function WS({section:i,state:r,onSave:o}){const c=i.fields.map(H=>IS(H,JS(r.config,H.path))),[d,m]=N.useState(c),[p,g]=N.useState([]),[b,v]=N.useState(!1),[R,y]=N.useState(!1),A=N.useId(),L=JSON.stringify(c);N.useEffect(()=>{m(c),g([])},[L]);const Q=d.some((H,Y)=>H!==c[Y]),at=async()=>{const H=[];let Y=r.config;if(i.fields.forEach((J,M)=>{const B=FS(J,d[M]??"");B.error?H.push(B.error):Y=Xg(Y,J.path,B.value)}),H.length){g(H);return}if(JSON.stringify(Zu(Y))!==JSON.stringify(Zu(r.config))){g(["Edit shell commands in loki.yaml directly"]);return}v(!0),g([]),y(!1);try{await o(Y),y(!0)}catch(J){g(J instanceof Fa?[J.message,...J.details]:[J.message])}finally{v(!1)}};return u.jsxs(Vt,{"data-testid":`settings-${i.id}`,"aria-labelledby":`${A}-h`,children:[u.jsx("h2",{id:`${A}-h`,style:{margin:0,fontFamily:$t("font-serif"),fontWeight:400,fontSize:$t("text-xl")},children:i.title}),u.jsx("p",{style:{margin:"4px 0 12px",color:$t("text-2"),fontSize:$t("text-md")},children:i.hint}),u.jsx("div",{style:{display:"grid",gap:12},children:i.fields.map((H,Y)=>{const J=`${A}-${Y}`,M=$=>{y(!1),m(ot=>ot.map((tt,et)=>et===Y?$:tt))},B={id:J,value:d[Y]??"","data-field":H.path.join(".")};return u.jsxs("div",{children:[u.jsx("label",{htmlFor:J,style:{display:"block",fontSize:$t("text-md"),marginBottom:4},children:H.label}),H.kind==="select"?u.jsxs("select",{...B,onChange:$=>M($.target.value),style:{padding:"8px 10px",borderRadius:$t("radius-md"),border:`1px solid ${$t("border")}`,background:$t("bg"),color:$t("text"),font:"inherit"},children:[u.jsx("option",{value:"",children:"Not set"}),H.options.map($=>u.jsx("option",{value:$,children:$},$))]}):H.kind==="lines"||H.kind==="json"?u.jsx(F0,{...B,rows:H.kind==="json"?8:4,spellCheck:!1,onChange:$=>M($.target.value),style:H.kind==="json"?{fontFamily:$t("font-mono")}:void 0}):u.jsx(Fn,{...B,type:H.kind==="number"?"number":"text",step:H.kind==="number"?"any":void 0,autoComplete:"off",spellCheck:!1,placeholder:H.kind==="env"?"ENV_VAR_NAME":void 0,onChange:$=>M($.target.value),style:H.kind==="env"?{fontFamily:$t("font-mono")}:void 0}),H.hint?u.jsx("div",{style:{color:$t("text-3"),fontSize:$t("text-base"),marginTop:4},children:H.hint}):null]},H.path.join("."))})}),i.id==="workspaces"&&Object.keys(Zu(r.config)).length?u.jsxs("div",{"data-testid":"settings-shell-readonly",style:{marginTop:12},children:[u.jsx("div",{style:{fontSize:$t("text-md"),marginBottom:4},children:"Shell commands (read only, edit in loki.yaml directly)"}),u.jsx("ul",{style:{margin:0,paddingLeft:18,fontFamily:$t("font-mono"),fontSize:$t("text-base"),color:$t("text-2")},children:Object.entries(Zu(r.config)).map(([H,Y])=>u.jsxs("li",{children:[H,": ",Y]},H))})]}):null,p.length?u.jsx("ul",{role:"alert","data-testid":"settings-problems",style:{margin:"12px 0 0",paddingLeft:18,color:$t("error"),fontSize:$t("text-md")},children:p.map(H=>u.jsx("li",{children:H},H))}):null,u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:12},children:[u.jsx(gt,{disabled:!Q||b,onClick:at,children:b?"Saving":"Save"}),R&&!Q?u.jsx(Lt,{tone:"success",children:"Saved"}):null]})]})}function PS(){const[i,r]=N.useState(null),[o,c]=N.useState(null),d=()=>{c(null),Gg().then(r,p=>c(p.message))};if(N.useEffect(d,[]),o)return u.jsx(Rt,{title:"Configuration unavailable",hint:o,action:u.jsx(gt,{variant:"secondary",onClick:d,children:"Retry"})});if(!i)return u.jsx(Bt,{label:"Loading configuration"});const m=async p=>{try{const g=await Qg(p,i.etag);r({exists:!0,etag:g.etag,config:g.config,errors:[]})}catch(g){throw g instanceof Fa&&g.status===409?new Fa("loki.yaml changed on disk since it was loaded. Reload to see the latest, then apply your edit again.",409,[]):g}};return u.jsxs("div",{"data-testid":"config-settings",style:{display:"grid",gap:16,maxWidth:720},children:[u.jsxs("div",{children:[u.jsx("h1",{style:{margin:0,fontFamily:$t("font-serif"),fontWeight:400,fontSize:$t("text-2xl")},children:"Configuration"}),u.jsxs("p",{style:{margin:"4px 0 0",color:$t("text-2"),fontSize:$t("text-md")},children:[i.exists?"Edits loki.yaml in this repo. Comments are kept.":"No loki.yaml in this repo yet. Saving a section creates it."," ","Credentials are environment variable names, never values."]})]}),i.errors.length?u.jsxs(Vt,{"data-testid":"config-file-errors",role:"alert",style:{borderColor:$t("error")},children:[u.jsx("strong",{children:"The current loki.yaml has problems"}),u.jsx("ul",{style:{margin:"6px 0 0",paddingLeft:18},children:i.errors.map(p=>u.jsx("li",{children:p},p))})]}):null,KS.map(p=>u.jsx(WS,{section:p,state:i,onSave:m},p.id)),u.jsx("div",{children:u.jsx(gt,{variant:"ghost",size:"sm",onClick:d,children:"Reload from disk"})})]})}const t2={id:"settings-config",path:"/settings/config",title:"Configuration",component:PS,inSettings:!0},df=i=>typeof i=="object"&&i!==null&&!Array.isArray(i),ls=i=>i.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??i;function e2(i){const r=df(i)&&df(i.workspaces)?i.workspaces:{};return Object.entries(r).map(([o,c])=>({name:o,def:df(c)?c:{}}))}const l2=(i,r)=>{const o=r.origin_repo;return o?i.repo&&(o===i.repo||o.endsWith(`/${i.repo}`)||ls(o)===ls(i.repo))?!0:!!i.path&&ls(o)===ls(i.path):!1},M0=i=>i.started_at??"";function n2(i,r){return e2(i).map(({name:o,def:c})=>{const d=(Array.isArray(c.repos)?c.repos:[]).map(b=>{const v=r.filter(R=>l2(b,R)).sort((R,y)=>M0(y).localeCompare(M0(R)));return{name:b.repo??(b.path?ls(b.path):"unnamed"),path:b.path??null,after:Array.isArray(b.after)?b.after:[],shell:typeof b.setup=="string",latest:v[0]??null,runs:v.length}}),m=d.filter(b=>b.latest),p=d.length&&m.length===d.length?{total:d.length,verified:m.filter(b=>is(b.latest)).length,failed:m.filter(b=>b.latest.verdict!==null&&!is(b.latest)).length,running:m.filter(b=>b.latest.verdict===null).length}:null,g=!!c.integration&&typeof c.integration.command=="string";return{name:o,repos:d,shell:g||d.some(b=>b.shell),integrationShell:g,status:p}})}const Zg=()=>globalThis.LOKI_CONTROL_BASE??"",a2=()=>{const i=_e();return i?{"content-type":"application/json",authorization:`Bearer ${i}`}:{"content-type":"application/json"}};async function i2(){const i=_e(),r=await fetch(`${Zg()}/v1/config`,{headers:i?{authorization:`Bearer ${i}`}:{}});if(!r.ok)throw new Error(`/v1/config: HTTP ${r.status}`);const o=await r.json();return{config:o.config??{},errors:o.errors??[]}}async function s2(i,r){const o=await fetch(`${Zg()}/v1/runs`,{method:"POST",headers:a2(),body:JSON.stringify({workspace:i,target:r})}),c=await o.json().catch(()=>({}));if(!o.ok)throw new Error(c.error??`HTTP ${o.status}`);return{pid:c.pid??0,command:c.command??""}}function u2({name:i}){const[r,o]=N.useState(""),[c,d]=N.useState(null),[m,p]=N.useState(!1),g=async()=>{p(!0),d(null);try{const b=await s2(i,r.trim());d({ok:!0,text:`Started: ${b.command} (pid ${b.pid})`})}catch(b){d({ok:!1,text:b instanceof Error?b.message:String(b)})}finally{p(!1)}};return u.jsxs("div",{style:{display:"grid",gap:8},children:[u.jsxs("div",{style:{display:"flex",gap:8},children:[u.jsx(Fn,{"aria-label":`Target for ${i}`,placeholder:"owner/repo#123 or a short task",value:r,onChange:b=>o(b.target.value)}),u.jsx(gt,{disabled:m||!r.trim(),onClick:g,children:"Run workspace"})]}),c?u.jsxs("div",{role:c.ok?"status":"alert",children:[u.jsx(Lt,{tone:c.ok?"success":"error",children:c.ok?"started":"refused"})," ",c.text]}):null]})}function r2({w:i}){const r=i.repos.map(o=>[u.jsx("strong",{children:o.name},"n"),o.path??"not measured",o.after.length?o.after.join(", "):"none",o.latest?o.latest.verdict?u.jsx(Ja,{run:o.latest},"v"):u.jsx(Lt,{tone:"neutral",pulse:!0,children:"running"},"v"):"not measured",o.latest?String(o.runs):"not measured"]);return u.jsx(Vt,{children:u.jsxs("div",{style:{display:"grid",gap:12},children:[u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[u.jsx("h2",{style:{margin:0,fontSize:16},children:i.name}),i.shell?u.jsx(Lt,{tone:"warning",children:"read-only: runs shell commands"}):null,u.jsx("span",{style:{marginLeft:"auto"},children:i.status?`Group: ${i.status.verified} of ${i.status.total} verified`+(i.status.failed?`, ${i.status.failed} not verified`:"")+(i.status.running?`, ${i.status.running} running`:""):"Group status: not measured"})]}),i.repos.length?u.jsx(Wn,{caption:`Repos in ${i.name}`,columns:["Repo","Path","After","Latest run","Runs"],rows:r}):u.jsx("div",{children:"No repos listed"}),i.shell?u.jsx("div",{children:"Edit shell commands in loki.yaml; the UI never changes them."}):null,u.jsx(u2,{name:i.name})]})})}function c2(){const[i,r]=N.useState(null),[o,c]=N.useState([]),[d,m]=N.useState(null);return N.useEffect(()=>{let p=!0;return(async()=>{try{const{config:g,errors:b}=await i2();let v=[];try{v=(await In()).runs}catch{}p&&(r(n2(g,v)),c(b))}catch(g){p&&m(g instanceof Error?g.message:String(g))}})(),()=>{p=!1}},[]),d?u.jsx(Rt,{title:"Could not load workspaces",hint:d}):i?i.length?u.jsxs("div",{style:{display:"grid",gap:16},children:[o.length?u.jsxs("div",{role:"alert",children:[u.jsx(Lt,{tone:"warning",children:"loki.yaml has problems"})," ",o.join("; ")]}):null,i.map(p=>u.jsx(r2,{w:p},p.name))]}):u.jsx(Rt,{title:"No workspaces",hint:"Define workspaces in loki.yaml to run a group of repos together."}):u.jsx(Bt,{label:"Loading workspaces"})}const o2={id:"workspaces",path:"/workspaces",title:"Workspaces",component:c2},f2=()=>globalThis.LOKI_CONTROL_BASE??"";async function d2(){const i=_e(),r=await fetch(`${f2()}/v1/integrations`,{headers:i?{authorization:`Bearer ${i}`}:{}});if(!r.ok)throw new Error(`HTTP ${r.status}`);return(await r.json()).integrations}const h2=i=>typeof i=="object"&&i!==null&&!Array.isArray(i);function Kg(i,r,o){const[c,...d]=r;return c===void 0?i:{...i,[c]:d.length?Kg(h2(i[c])?i[c]:{},d,o):o}}const m2={connected:"success",not_connected:"neutral",not_measured:"neutral"},p2={connected:"connected",not_connected:"not connected",not_measured:"not measured"};function g2({row:i,onChanged:r}){const[o,c]=N.useState(i.env_name??""),[d,m]=N.useState(!1),[p,g]=N.useState(null),b=/^[A-Z_][A-Z0-9_]*$/.test(o),v=async()=>{if(!(!i.config_path||!b)){m(!0),g(null);try{const R=await Gg();await Qg(Kg(R.config,i.config_path.split("."),o),R.etag),g(`Saved ${o} to loki.yaml`),r()}catch(R){g(R instanceof Fa?[R.message,...R.details].join(": "):R.message)}finally{m(!1)}}};return u.jsxs(Vt,{"data-testid":`integration-${i.id}`,children:[u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",justifyContent:"space-between"},children:[u.jsx("strong",{children:i.label}),u.jsx(Lt,{tone:m2[i.status],children:p2[i.status]})]}),u.jsx("p",{style:{margin:"4px 0 8px",color:"var(--cp-text-2)",fontSize:"var(--cp-text-md)"},children:i.detail}),i.config_path?u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[u.jsx(Fn,{"aria-label":`${i.label} variable name`,value:o,placeholder:"ENV_VAR_NAME",autoComplete:"off",spellCheck:!1,onChange:R=>{c(R.target.value.trim()),g(null)},style:{fontFamily:"var(--cp-font-mono)"}}),u.jsx(gt,{onClick:v,disabled:d||!b||o===i.env_name,children:d?"Saving":"Connect"})]}):u.jsx("small",{style:{color:"var(--cp-text-3)"},children:i.id==="mcp"?"Managed in .mcp.json.":"loki.yaml has no setting for this service yet."}),i.config_path&&o&&!b?u.jsx("small",{role:"alert",children:"Use an environment variable name such as GITHUB_TOKEN, never the secret itself."}):null,p?u.jsx("small",{role:"status",style:{display:"block",marginTop:4},children:p}):null]})}function v2(){const[i,r]=N.useState(null),[o,c]=N.useState(null),d=N.useCallback(()=>{d2().then(r).catch(m=>c(m instanceof Error?m.message:String(m)))},[]);return N.useEffect(d,[d]),o?u.jsx(Rt,{title:"Could not load integrations",hint:o}):i?u.jsxs("div",{style:{display:"grid",gap:16},children:[u.jsx("h1",{style:{margin:0,fontSize:"var(--cp-text-xl, 20px)"},children:"Integrations"}),u.jsx("small",{style:{color:"var(--cp-text-3)"},children:"Status shows whether an environment variable is set or a CLI is signed in, never its value. Connect stores the variable name in loki.yaml."}),i.map(m=>u.jsx(g2,{row:m,onChanged:d},m.id))]}):u.jsx(Bt,{label:"Probing integrations"})}const y2={id:"integrations",path:"/integrations",title:"Integrations",component:v2,inSettings:!0},x2=yg.component,k0={...yg,component:({params:i})=>u.jsx(x2,{source:i.source,run:i.run,renderSlot:(r,o)=>u.jsx(Rb,{source:i.source,run:i.run,status:r.blocked_question?"BLOCKED":r.status==="running"||r.verdict===null?"running":r.verdict??r.status??"",onChanged:o})})};function U0(i){const r=i.component;return{...i,component:()=>u.jsx(r,{})}}function b2(){E0("run-detail"),E0("new-run"),Ce(U0({...Fj,path:"/"})),Ce({...k0,id:"run-short",path:"/r/:source/:run"}),Ce(k0),Ce(BS),Ce(qS),Ce(_S),Ce(ES);for(const i of[_b,eS,nS,$j,cS,oS,zS,VS,ZS,t2,o2,y2])Ce(U0(i))}let jf=null;function H0(i){jf=i}function j2(){return jf?(jf(),!0):!1}const S2=8,_2=()=>[{id:"action:new-run",kind:"Actions",label:"New run",hint:"Cmd+N",action:"new-run"},{id:"action:toggle-theme",kind:"Actions",label:"Toggle theme",hint:"Cmd+Shift+D",action:"toggle-theme"}],E2=i=>i.filter(r=>!r.path.includes(":")).map(r=>({id:`page:${r.id}`,kind:"Pages",label:r.title,hint:r.path,to:r.path})),L0=i=>{const r=Date.parse(i.started_at??i.last_event_at??"");return Number.isNaN(r)?0:r},T2=i=>[...i].sort((r,o)=>L0(o)-L0(r)).map(r=>{var o;return{id:`run:${r.source_id}/${r.run_id}`,kind:"Runs",label:((o=r.title)==null?void 0:o.trim())||r.issue_ref||"Untitled task",hint:[r.origin_repo,jl(r)?Ae(jl(r)).label:r.status].filter(Boolean).join(" / ")||void 0,to:`/runs/${encodeURIComponent(r.source_id)}/${encodeURIComponent(r.run_id)}`}}),N2=(i,r)=>{const o=`${i.label} ${i.hint??""}`.toLowerCase();return r.split(/\s+/).filter(Boolean).every(c=>o.includes(c))};function R2(i,r,o,c){const d=i.trim().toLowerCase(),m=p=>d?p.filter(g=>N2(g,d)):p;return[...m(c),...m(r),...m(o).slice(0,S2)]}const me=i=>`var(--cp-${i})`,z2=i=>{location.hash=`#${i}`};function O2(){const[i,r]=N.useState(!1),[o,c]=N.useState(""),[d,m]=N.useState(0),[p,g]=N.useState([]),[b,v]=N.useState(null),R=N.useRef(null),y=N.useId(),A=N.useSyncExternalStore(sg,Pu,Pu),L=()=>{r(!1),c(""),m(0)};N.useEffect(()=>(H0(()=>r(M=>!M)),()=>H0(null)),[]),N.useEffect(()=>{if(!i)return;let M=!0;return v(null),In().then(B=>{M&&g(B.runs)},B=>{M&&v(B.message)}),queueMicrotask(()=>{var B;return(B=R.current)==null?void 0:B.focus()}),()=>{M=!1}},[i]),N.useEffect(()=>{const M=B=>{const $=B.metaKey||B.ctrlKey,ot=B.key.toLowerCase();B.key==="Escape"&&i?(B.preventDefault(),L()):$&&!B.shiftKey&&ot==="n"?(B.preventDefault(),Ia(),i&&L()):$&&B.shiftKey&&ot==="d"&&(B.preventDefault(),er())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[i]);const Q=N.useMemo(()=>R2(o,E2(ig().filter(M=>ns().enabled||!M.id.startsWith("ask"))),T2(p),_2()),[o,p,A]),at=Math.min(d,Math.max(0,Q.length-1)),H=M=>{M.action==="toggle-theme"?er():M.action==="new-run"?Ia():M.to&&z2(M.to),L()},Y=M=>{if(M.key==="ArrowDown")M.preventDefault(),m(Q.length?(at+1)%Q.length:0);else if(M.key==="ArrowUp")M.preventDefault(),m(Q.length?(at-1+Q.length)%Q.length:0);else if(M.key==="Home")M.preventDefault(),m(0);else if(M.key==="End")M.preventDefault(),m(Math.max(0,Q.length-1));else if(M.key==="Enter"&&!(M.metaKey||M.ctrlKey)){M.preventDefault();const B=Q[at];B&&H(B)}};if(!i)return null;let J="";return u.jsx("div",{"data-testid":"palette-backdrop",onClick:L,style:{position:"fixed",inset:0,zIndex:400,background:"rgba(0,0,0,0.4)",display:"flex",justifyContent:"center",alignItems:"flex-start",paddingTop:"14vh"},children:u.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Command palette",onClick:M=>M.stopPropagation(),style:{width:"min(560px, 92vw)",background:me("bg"),color:me("text"),border:`1px solid ${me("border")}`,borderRadius:me("radius-lg"),boxShadow:me("shadow-lg"),overflow:"hidden",fontFamily:me("font-sans")},children:[u.jsx("input",{ref:R,role:"combobox","aria-expanded":"true","aria-controls":y,"aria-autocomplete":"list","aria-label":"Search pages, runs and actions","aria-activedescendant":Q[at]?`${y}-${at}`:void 0,value:o,onChange:M=>{c(M.target.value),m(0)},onKeyDown:Y,placeholder:"Search pages, runs, actions",style:{width:"100%",boxSizing:"border-box",padding:"14px 16px",background:"transparent",color:me("text"),border:"none",borderBottom:`1px solid ${me("border")}`,outline:"none",fontSize:"1rem"}}),u.jsx("ul",{id:y,role:"listbox","aria-label":"Results",style:{listStyle:"none",margin:0,padding:6,maxHeight:"50vh",overflowY:"auto"},children:Q.map((M,B)=>{const $=M.kind!==J?M.kind:null;return J=M.kind,u.jsxs("li",{role:"presentation",children:[$&&u.jsx("div",{role:"presentation",style:{padding:"8px 10px 4px",fontSize:me("text-sm"),color:me("text-2")},children:$}),u.jsxs("div",{id:`${y}-${B}`,role:"option","aria-selected":B===at,onMouseMove:()=>m(B),onClick:()=>H(M),style:{display:"flex",justifyContent:"space-between",gap:12,padding:"8px 10px",borderRadius:me("radius-md"),cursor:"pointer",background:B===at?me("bg-3"):"transparent"},children:[u.jsx("span",{children:M.label}),M.hint&&u.jsx("span",{style:{color:me("text-2"),fontSize:me("text-sm")},children:M.hint.startsWith("Cmd")?u.jsx(ub,{children:M.hint}):M.hint})]})]},M.id)})}),Q.length===0&&u.jsx("p",{role:"status",style:{margin:0,padding:"14px 16px",color:me("text-2")},children:"No matches"}),b&&u.jsxs("p",{role:"alert",style:{margin:0,padding:"8px 16px",color:me("error"),fontSize:me("text-sm")},children:["Recent runs not loaded: ",b]})]})})}const C2=/^https:\/\/github\.com\/([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9._-]+)\/issues\/([1-9][0-9]*)\/?$/,A2=/^([A-Za-z0-9][A-Za-z0-9._-]*)\/([A-Za-z0-9._-]+)#([1-9][0-9]*)$/;function w2(i){const r=i.trim(),o=C2.exec(r);return o?`${o[1]}/${o[2]}#${o[3]}`:r}function B0(i){return i instanceof Nf?i.status===400?`The server refused this run: ${i.message}`:i.status===403?`Not allowed: ${i.message}. Starting runs works only from the machine running the control service.`:i.status===404?`The control service does not offer this: ${i.message}`:i.status===409?`${i.message}. Wait for it to finish, or pick another repo.`:i.message:i instanceof Error?i.message:"could not reach the control service"}const hf={display:"flex",flexDirection:"column",gap:4,fontSize:"var(--cp-text-sm)",color:"var(--cp-text-muted)"},D2={padding:"8px 10px",borderRadius:"var(--cp-radius-md)",border:"1px solid var(--cp-border)",background:"var(--cp-bg)",color:"var(--cp-text)",font:"inherit",fontSize:"var(--cp-text-md)"};function M2({preset:i,onDone:r}){const[o,c]=N.useState(null),[d,m]=N.useState(null),[p,g]=N.useState(""),[b,v]=N.useState({state:"idle"}),[R,y]=N.useState(null),[A,L]=N.useState(""),[Q,at]=N.useState(!1),[H,Y]=N.useState(!1),[J,M]=N.useState(null),B=N.useRef(!1),$=i?A2.exec(i):null;N.useEffect(()=>{let P=!0;return zb().then(xt=>{P&&(c(xt),$&&(xt.includes($[2])?(g($[2]),at(!0)):M(`${$[1]}/${$[2]} is not a registered repo, so a run cannot start from here.`)))},xt=>P&&m(xt.message)),()=>{P=!1}},[]),N.useEffect(()=>{if(!p||$)return;let P=!0;return v({state:"loading"}),y(null),Ob(p).then(xt=>P&&v({state:"ok",list:xt}),xt=>P&&v({state:"error",message:B0(xt)})),()=>{P=!1}},[p]);const ot=$?i:R?w2(R.url):A.trim(),tt=p!==""&&ot!=="",et=$||R?ot:`"${ot}"`,Kt=async()=>{if(!(B.current||!tt)){B.current=!0,Y(!0),M(null);try{await og({target:ot,repo:p}),r(),location.hash="#/runs"}catch(P){M(B0(P)),Y(!1)}finally{B.current=!1}}};return d?u.jsxs("p",{role:"alert","data-testid":"picker-error",style:{color:"var(--cp-error)"},children:["Could not load registered repos: ",d]}):o===null?u.jsx(Bt,{label:"Loading repos"}):o.length===0?u.jsx("p",{"data-testid":"picker-no-repos",style:{color:"var(--cp-text-muted)"},children:"No registered repos. Run loki in a repo once so it appears here."}):Q?u.jsxs("div",{"data-testid":"confirm-step",style:{display:"flex",flexDirection:"column",gap:16},children:[u.jsxs("p",{"data-testid":"confirm-text",style:{margin:0,fontSize:"var(--cp-text-md)"},children:["Start a run on ",u.jsx("strong",{children:et})," in ",u.jsx("strong",{children:p}),"?"]}),J?u.jsx("p",{role:"alert","data-testid":"picker-error",style:{margin:0,color:"var(--cp-error)"},children:J}):null,u.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[u.jsx(gt,{variant:"ghost",onClick:$?r:()=>at(!1),children:$?"Cancel":"Back"}),u.jsx(gt,{"data-testid":"confirm-start",disabled:H||!tt,onClick:()=>void Kt(),children:"Start run"})]})]}):u.jsxs("form",{"data-testid":"picker",style:{display:"flex",flexDirection:"column",gap:16},onSubmit:P=>{P.preventDefault(),tt&&at(!0)},children:[u.jsxs("label",{style:hf,children:["Repo",u.jsxs("select",{"aria-label":"Repo","data-testid":"picker-repo",value:p,onChange:P=>g(P.target.value),onInput:P=>g(P.target.value),style:D2,children:[u.jsx("option",{value:"",children:"Choose a registered repo"}),o.map(P=>u.jsx("option",{value:P,children:P},P))]})]}),p?u.jsxs("div",{style:hf,children:["Open issues",b.state==="loading"?u.jsx(Bt,{label:"Loading issues"}):null,b.state==="error"?u.jsxs("p",{role:"alert","data-testid":"issues-error",style:{margin:0,color:"var(--cp-error)"},children:["Could not load issues: ",b.message]}):null,b.state==="ok"&&b.list.length===0?u.jsx("p",{"data-testid":"issues-empty",style:{margin:0},children:"No open issues in this repo."}):null,b.state==="ok"&&b.list.length>0?u.jsx("ul",{role:"listbox","aria-label":"Open issues",style:{listStyle:"none",margin:0,padding:0,maxHeight:220,overflowY:"auto",border:"1px solid var(--cp-border)",borderRadius:"var(--cp-radius-md)"},children:b.list.map(P=>u.jsxs("li",{role:"option","aria-selected":(R==null?void 0:R.number)===P.number,"data-testid":"issue-option",onClick:()=>{y(P),L("")},style:{padding:"8px 10px",cursor:"pointer",color:"var(--cp-text)",background:(R==null?void 0:R.number)===P.number?"var(--cp-accent-glow)":"transparent",fontSize:"var(--cp-text-md)"},children:[u.jsxs("span",{style:{color:"var(--cp-text-muted)"},children:["#",P.number]})," ",P.title]},P.number))}):null]}):null,p?u.jsxs("label",{style:hf,children:["Or describe a task",u.jsx(Fn,{"aria-label":"Task","data-testid":"picker-task",value:A,maxLength:500,placeholder:"A short task for this repo",onChange:P=>{L(P.target.value),P.target.value&&y(null)}})]}):null,J?u.jsx("p",{role:"alert","data-testid":"picker-error",style:{margin:0,color:"var(--cp-error)"},children:J}):null,u.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[u.jsx(gt,{variant:"ghost",onClick:r,children:"Cancel"}),u.jsx(gt,{type:"submit","data-testid":"picker-continue",disabled:!tt,children:"Review"})]})]})}function k2(){const{open:i,preset:r}=jj();return u.jsx(ib,{open:i,title:"New run",onClose:O0,children:u.jsx(M2,{preset:r,onDone:O0},r??"pick")})}function U2({active:i=!1,size:r=26}){const o=i?"var(--cp-accent)":"var(--cp-text)";return u.jsxs("svg",{"data-testid":"mascot","data-state":i?"active":"idle",role:"img","aria-label":i?"Loki, working":"Loki",width:r,height:r,viewBox:"0 0 32 32",children:[u.jsx("rect",{x:"3",y:"4",width:"26",height:"22",rx:"6",fill:"var(--cp-card)",stroke:"var(--cp-accent)",strokeWidth:"2"}),u.jsx("path",{d:"M3 10h26",stroke:"var(--cp-accent)",strokeWidth:"1.5",opacity:"0.5"}),u.jsx("circle",{cx:"12",cy:"17",r:"2",fill:o}),u.jsx("circle",{cx:"20",cy:"17",r:"2",fill:o}),u.jsx("path",{d:"M12.5 21.5c2 1.6 5 1.6 7 0",fill:"none",stroke:"var(--cp-text)",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M10 26v3M22 26v3",stroke:"var(--cp-accent)",strokeWidth:"2",strokeLinecap:"round"})]})}const Ht=i=>`var(--cp-${i})`;function H2(){var o;const[i,r]=N.useState(((o=globalThis.location)==null?void 0:o.hash)??"");return N.useEffect(()=>{const c=()=>r(location.hash);return c(),addEventListener("hashchange",c),()=>removeEventListener("hashchange",c)},[]),i}const L2=[{href:"#/",label:"Overview",icon:u.jsx(j1,{size:14,"aria-hidden":"true"}),match:i=>i==="/"||i==="/home"},{href:"#/runs",label:"Runs",icon:u.jsx(_1,{size:14,"aria-hidden":"true"}),match:i=>i==="/runs"||i.startsWith("/runs/")||i.startsWith("/r/")},{href:"#/pulls",label:"Pull requests",icon:u.jsx(G0,{size:14,"aria-hidden":"true"}),match:i=>i==="/pulls"},{href:"#/repos",label:"Repos",icon:u.jsx(y1,{size:14,"aria-hidden":"true"}),match:i=>i==="/repos"},{href:"#/receipts",label:"Receipts",icon:u.jsx(D1,{size:14,"aria-hidden":"true"}),match:i=>i.startsWith("/receipts")}];function B2({activePath:i,onNavigate:r}){const o=kg();return o.enabled?u.jsxs("section",{"data-testid":"ask-history","aria-label":"Ask Loki",style:{marginTop:16},children:[u.jsx(nb,{children:"Ask Loki"}),u.jsx(Wu,{href:"#/ask",active:i==="/ask",icon:u.jsx(O1,{size:14,"aria-hidden":"true"}),onClick:r,children:"New question"}),o.threads.map(c=>{const d=`#/ask/${encodeURIComponent(c.id)}`,m=cs(d)===i;return u.jsx("a",{"data-testid":"ask-thread-link",href:d,title:c.title,"aria-current":m?"page":void 0,onClick:r,style:{display:"block",padding:"6px 12px",borderRadius:Ht("radius-nav"),textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:Ht("text-md"),color:Ht(m?"accent":"text"),background:m?Ht("accent-glow"):"transparent"},children:c.title},c.id)})]}):null}function q2(){const i=Sg(),r=i==="dark"?"light":"dark";return u.jsxs("button",{type:"button","data-testid":"theme-toggle",onClick:er,"aria-label":`Switch to ${r} theme`,style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"7px 12px",marginTop:2,border:0,borderRadius:Ht("radius-nav"),background:"transparent",color:Ht("text-2"),cursor:"pointer",fontSize:Ht("text-md"),fontFamily:"inherit"},children:[i==="dark"?u.jsx(q1,{size:14,"aria-hidden":"true"}):u.jsx(A1,{size:14,"aria-hidden":"true"}),i==="dark"?"Light theme":"Dark theme"]})}function q0({hash:i,onNavigate:r}){const o=cs(i);return u.jsxs(u.Fragment,{children:[u.jsxs("a",{href:"#/",onClick:r,style:{display:"flex",alignItems:"center",gap:8,padding:"4px 12px 12px",textDecoration:"none",color:Ht("text")},children:[u.jsx(U2,{active:!1}),u.jsx("span",{style:{fontFamily:Ht("font-serif"),fontSize:Ht("text-2xl")},children:"Loki Mode"})]}),u.jsx("div",{style:{padding:"0 12px 12px"},children:u.jsx(gt,{"data-testid":"sidebar-new-run",style:{width:"100%"},onClick:()=>{r==null||r(),Ia()},children:"New run"})}),u.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"0 8px"},children:[u.jsx("div",{"data-testid":"nav-links",children:L2.map(c=>u.jsx(Wu,{href:c.href,active:c.match(o),icon:c.icon,onClick:r,children:c.label},c.href))}),u.jsx(B2,{activePath:o,onNavigate:r})]}),u.jsxs("div",{style:{padding:8,borderTop:`1px solid ${Ht("border")}`},children:[u.jsx(Wu,{href:"#/settings",active:o.startsWith("/settings"),icon:u.jsx(U1,{size:14,"aria-hidden":"true"}),onClick:r,children:"Settings"}),u.jsx(q2,{})]})]})}const $2={width:Ht("sidebar-w"),flexShrink:0,flexDirection:"column",height:"100vh",position:"sticky",top:0,paddingTop:16,background:Ht("glass"),borderRight:`1px solid ${Ht("glass-border")}`,boxShadow:Ht("glass-shadow")};function Y2({path:i}){const r=gb();if(r.length===0)return u.jsx(Rt,{title:"No settings available"});const o=r.find(d=>cs(d.path)===i)??r[0],c=o.component;return u.jsxs("div",{"data-testid":"settings-area",style:{display:"flex",flexWrap:"wrap",gap:24},children:[u.jsxs("nav",{"aria-label":"Settings","data-testid":"settings-nav",style:{width:200,flexShrink:0},children:[u.jsx("h1",{style:{fontFamily:Ht("font-serif"),fontWeight:400,fontSize:Ht("text-2xl"),margin:"0 0 12px 12px"},children:"Settings"}),r.map(d=>u.jsx(Wu,{href:`#${d.path}`,active:d.id===o.id,children:d.title},d.id))]}),u.jsx("div",{style:{flex:1,minWidth:0},children:u.jsx(c,{params:{}})})]})}function V2({hash:i}){N.useSyncExternalStore(sg,Pu,Pu);const r=cs(i);if(r==="/settings"||r.startsWith("/settings/"))return u.jsx(Y2,{path:r});const o=yb(i);if(!o)return u.jsx(Rt,{title:"Page not found",hint:u.jsx("a",{href:"#/",style:{color:Ht("accent")},children:"Back to home"})});const c=o.page.component;return u.jsx(c,{params:o.params})}function G2(){const i=H2(),[r,o]=N.useState(!1);return N.useEffect(()=>{ur()},[]),N.useEffect(()=>{const c=d=>{if(!(d.metaKey||d.ctrlKey))return;const m=d.key.toLowerCase();m==="k"&&ns().enabled?(d.preventDefault(),location.hash="#/ask"):(m==="k"||m==="/")&&j2()&&d.preventDefault()};return addEventListener("keydown",c),()=>removeEventListener("keydown",c)},[]),u.jsxs("div",{"data-testid":"app-shell",className:"flex min-h-screen",style:{background:Ht("bg"),color:Ht("text"),fontFamily:Ht("font-sans")},children:[u.jsx("nav",{"data-testid":"nav","aria-label":"Main",className:"hidden md:flex",style:$2,children:u.jsx(q0,{hash:i})}),u.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[u.jsxs("header",{className:"flex items-center gap-2 p-2 md:hidden",style:{borderBottom:`1px solid ${Ht("border")}`},children:[u.jsx(gt,{variant:"ghost","aria-label":"Open navigation","data-testid":"open-drawer",onClick:()=>o(!0),children:u.jsx(T1,{size:16,"aria-hidden":"true"})}),u.jsx("span",{style:{fontFamily:Ht("font-serif"),fontSize:Ht("text-xl")},children:"Loki Mode"})]}),u.jsx("main",{"data-testid":"outlet",className:"min-w-0 flex-1 overflow-x-auto p-3 md:p-6",style:{maxWidth:"100%"},children:u.jsx(V2,{hash:i})})]}),u.jsx(k2,{}),u.jsx(sb,{open:r,title:"Loki Mode",side:"left",onClose:()=>o(!1),children:u.jsx("div",{style:{display:"flex",flexDirection:"column",minHeight:"80vh"},children:u.jsx(q0,{hash:i,onNavigate:()=>o(!1)})})})]})}const xn="not recorded";function Jg(i){return i.cost_usd!==null&&i.cost_usd!==void 0?Pe(i.cost_usd):i.total_sessions>0&&i.measured_sessions<i.total_sessions?`unpriced (${i.measured_sessions} of ${i.total_sessions} sessions priced)`:"unpriced"}const Q2=i=>i.started_at&&i.ended_at?(Date.parse(i.ended_at)-Date.parse(i.started_at))/1e3:null,Ig=i=>typeof i=="number"?`${i.toFixed(1)}s`:xn,Fg=i=>i?i.replace("T"," ").replace(/\.\d+Z$/,"Z"):xn,X2={[Et.VERIFIED]:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 ring-emerald-500/30",[Et.PARTIAL]:"bg-amber-500/15 text-amber-700 dark:text-amber-300 ring-amber-500/30",[Et.FAILED]:"bg-red-500/15 text-red-700 dark:text-red-300 ring-red-500/30",[Et.TAMPERED]:"bg-red-600/20 text-red-700 dark:text-red-300 ring-red-600/50",[Et.VERIFIED_UNCHECKED]:"bg-sky-500/15 text-sky-700 dark:text-sky-300 ring-sky-500/30",[Et.UNVERIFIED]:"bg-amber-500/15 text-amber-700 dark:text-amber-300 ring-amber-500/30",[Et.SPEC_CONFLICT]:"bg-violet-500/15 text-violet-700 dark:text-violet-300 ring-violet-500/30"};function Sf({verdict:i,run:r}){const o=r?jl(r):i??null,c=o?X2[o]??"bg-slate-500/15 text-slate-600 dark:text-slate-300 ring-slate-500/30":"bg-slate-500/15 text-slate-600 dark:text-slate-300 ring-slate-500/30";return u.jsx("span",{"data-testid":"verdict",className:`inline-block rounded px-2 py-0.5 text-xs font-medium ring-1 ${c}`,children:o??"in progress"})}function Wg({url:i}){return i?/^https?:\/\//.test(i)?u.jsxs("a",{href:i,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-sky-600 hover:underline dark:text-sky-400",children:["PR ",u.jsx(Ef,{size:12})]}):u.jsx("span",{className:"break-all font-mono text-xs",title:"local origin, no web URL",children:i}):u.jsx("span",{className:"text-slate-500",children:"no PR"})}const $0=3e3;function Pg(i,r,o){const[c,d]=N.useState({data:null,error:null});return N.useEffect(()=>{let m=!0,p;d({data:null,error:null});const g=()=>i().then(b=>{m&&(d({data:b,error:null}),o!=null&&o(b)&&(p=setTimeout(g,$0)))},b=>{m&&(d(v=>({data:v.data,error:b.message})),o&&(p=setTimeout(g,$0)))});return g(),()=>{m=!1,clearTimeout(p)}},r),c}const yn=i=>i.status==="running";function tv({run:i}){const[r]=N.useState(()=>({at:Date.now(),s:i.elapsed_s??0})),[,o]=N.useState(0),c=yn(i);N.useEffect(()=>{if(!c)return;const m=setInterval(()=>o(p=>p+1),1e3);return()=>clearInterval(m)},[c]);const d=c?Math.max(i.elapsed_s??0,r.s+(Date.now()-r.at)/1e3):i.elapsed_s??i.wall_s;return u.jsx("span",{"data-testid":"elapsed",children:typeof d=="number"?`${Math.floor(d)}s`:xn})}function Z2({onOpen:i}){const[r,o]=N.useState(""),[c,d]=N.useState(""),[m,p]=N.useState(""),{data:g,error:b}=Pg(()=>In({verdict:r,repo:c,since:m?`${m}T00:00:00Z`:""}),[r,c,m],y=>y.runs.some(yn)),v=!!(r||c||m),R="rounded border border-slate-300 bg-white px-2 py-2 text-sm md:py-1 dark:border-slate-700 dark:bg-slate-900";return u.jsxs("section",{children:[u.jsx("h1",{className:"mb-4 text-xl font-semibold",children:"Runs"}),u.jsxs("div",{className:"mb-4 grid grid-cols-1 gap-3 text-sm sm:flex sm:flex-wrap sm:items-end",children:[u.jsxs("label",{className:"flex flex-col gap-1",children:["Verdict",u.jsxs("select",{"aria-label":"Verdict",className:R,value:r,onChange:y=>o(y.target.value),children:[u.jsx("option",{value:"",children:"All"}),P1.map(y=>u.jsx("option",{value:y,children:Ae(y).label},y))]})]}),u.jsxs("label",{className:"flex flex-col gap-1",children:["Repo",u.jsx("input",{"aria-label":"Repo",className:R,value:c,onChange:y=>d(y.target.value),placeholder:"owner/name"})]}),u.jsxs("label",{className:"flex flex-col gap-1",children:["Since",u.jsx("input",{"aria-label":"Since",type:"date",className:R,value:m,onChange:y=>p(y.target.value)})]})]}),b&&u.jsxs("p",{role:"alert",className:"text-red-600",children:["Could not load runs: ",b]}),!g&&!b&&u.jsx("p",{className:"text-slate-500",children:"Loading runs"}),g&&g.runs.length===0&&(v?u.jsx("p",{children:"No runs match these filters."}):u.jsx(Cf,{})),g&&g.runs.length>0&&u.jsx("div",{className:"overflow-x-auto rounded border border-slate-200 dark:border-slate-800",children:u.jsxs("table",{className:"w-full text-left text-sm",children:[u.jsx("thead",{className:"bg-slate-100 text-xs uppercase text-slate-500 dark:bg-slate-900",children:u.jsxs("tr",{children:[u.jsx("th",{className:"p-2",children:"Verdict"}),u.jsx("th",{className:"p-2",children:"Run"}),u.jsx("th",{className:"hidden p-2 md:table-cell",children:"Repo"}),u.jsx("th",{className:"hidden p-2 md:table-cell",children:"Started"}),u.jsx("th",{className:"p-2",children:"Progress"}),u.jsx("th",{className:"p-2",children:"Cost"}),u.jsx("th",{className:"p-2",children:"PR"})]})}),u.jsx("tbody",{children:g.runs.map(y=>u.jsxs("tr",{"data-testid":"run-row",className:"border-t border-slate-200 dark:border-slate-800",children:[u.jsx("td",{className:"p-2",children:u.jsx(Sf,{run:y})}),u.jsx("td",{className:"p-2 font-mono text-xs",children:u.jsx("a",{href:`#/runs/${encodeURIComponent(y.source_id)}/${encodeURIComponent(y.run_id)}`,onClick:()=>i==null?void 0:i(y),className:"inline-block break-all py-2 text-sky-600 hover:underline md:py-0 dark:text-sky-400",children:y.run_id})}),u.jsx("td",{className:"hidden p-2 md:table-cell",children:y.origin_repo??xn}),u.jsx("td",{className:"hidden p-2 md:table-cell",children:Fg(y.started_at)}),u.jsx("td",{className:"p-2 text-xs","data-testid":"progress",children:yn(y)?u.jsxs(u.Fragment,{children:[y.current_stage??"starting",", ",u.jsx(tv,{run:y}),", ",(y.files_touched??[]).length," files"]}):""}),u.jsx("td",{className:"p-2","data-testid":"cost",children:Jg(y)}),u.jsx("td",{className:"p-2",children:u.jsx(Wg,{url:y.pr_url})})]},`${y.source_id}/${y.run_id}`))})]})})]})}function as({title:i,children:r}){return u.jsxs("div",{className:"rounded border border-slate-200 p-4 dark:border-slate-800",children:[u.jsx("h2",{className:"mb-2 text-sm font-semibold uppercase text-slate-500",children:i}),r]})}function K2({stages:i}){return i.length===0?u.jsx("p",{className:"text-slate-500",children:"No stages ingested for this run."}):u.jsx("ol",{className:"space-y-1 text-sm",children:i.map(r=>u.jsxs("li",{"data-testid":"stage",className:"flex items-center justify-between gap-4",children:[u.jsx("span",{className:"font-medium",children:r.stage}),u.jsx("span",{className:"text-slate-500",children:r.status==="started"?"running":Ig(Q2(r))})]},r.stage))})}function J2({source:i,run:r,question:o}){const[c,d]=N.useState(""),[m,p]=N.useState(null),g=async()=>{try{const b=await X0(i,r,c);p({ok:!0,text:`Saved to ${b.path}. Resume: ${b.resume}`})}catch(b){p({ok:!1,text:b.message})}};return u.jsxs(as,{title:"Blocked: your answer is needed",children:[u.jsx("p",{"data-testid":"blocked-question",className:"mb-2 text-sm",children:o}),u.jsx("textarea",{"data-testid":"answer-input","aria-label":"Answer",maxLength:4e3,value:c,onChange:b=>d(b.target.value),className:"w-full rounded border border-slate-300 p-2 text-sm dark:border-slate-700 dark:bg-slate-900",rows:3}),u.jsx("button",{type:"button","data-testid":"answer-submit",disabled:c.trim()==="",onClick:g,className:"mt-2 min-h-11 rounded bg-sky-600 px-4 py-2 text-sm md:min-h-0 md:px-3 md:py-1 text-white disabled:opacity-50",children:"Submit answer"}),m&&u.jsx("p",{role:m.ok?"status":"alert",className:`mt-2 break-all text-sm ${m.ok?"text-emerald-600":"text-red-600"}`,children:m.text})]})}function I2({source:i,run:r}){const[o,c]=N.useState(!1),[d,m]=N.useState(!1),[p,g]=N.useState(null),b=async()=>{m(!0),g(null);try{await J1(i,r),location.hash="#/runs"}catch(R){g(R.message),m(!1)}},v="min-h-11 rounded px-4 py-2 text-sm md:min-h-0 md:px-3 md:py-1";return u.jsxs(as,{title:"Remove run",children:[o?u.jsxs("div",{className:"space-y-2 text-sm",children:[u.jsx("p",{"data-testid":"remove-confirm-text",children:"Permanently delete this run and its events from the local control database? This cannot be undone."}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{type:"button","data-testid":"remove-confirm",disabled:d,onClick:b,className:`${v} bg-red-600 text-white disabled:opacity-50`,children:d?"Removing":"Yes, remove"}),u.jsx("button",{type:"button","data-testid":"remove-cancel",disabled:d,onClick:()=>{c(!1),g(null)},className:`${v} border border-slate-300 dark:border-slate-700`,children:"Cancel"})]})]}):u.jsx("button",{type:"button","data-testid":"remove-run",onClick:()=>c(!0),className:`${v} border border-red-500/50 text-red-600`,children:"Remove"}),p&&u.jsxs("p",{role:"alert","data-testid":"remove-error",className:"mt-2 break-all text-sm text-red-600",children:["Could not remove run: ",p]})]})}function F2({source:i,run:r}){const{data:o,error:c}=Pg(()=>ar(i,r),[i,r],yn);if(c)return u.jsxs("p",{role:"alert",className:"text-red-600",children:["Could not load run: ",c]});if(!o)return u.jsx("p",{className:"text-slate-500",children:"Loading run"});const d=o;return u.jsxs("section",{className:"space-y-4",children:[u.jsx("a",{href:"#/runs",className:"text-sm text-sky-600 hover:underline dark:text-sky-400",children:"Back to runs"}),u.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[u.jsx("h1",{className:"font-mono text-lg font-semibold",children:d.run_id}),u.jsx(Sf,{run:d}),d.tampered&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-red-600",children:[u.jsx(x0,{size:14}),"event log tampered"]}),d.conflict&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-amber-600",children:[u.jsx(x0,{size:14}),"conflicting events ingested"]})]}),u.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[u.jsx(as,{title:"Summary",children:u.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm",children:[u.jsx("dt",{className:"text-slate-500",children:"Repo"}),u.jsx("dd",{children:d.origin_repo??xn}),u.jsx("dt",{className:"text-slate-500",children:"Issue"}),u.jsx("dd",{children:d.issue_ref??xn}),u.jsx("dt",{className:"text-slate-500",children:"Provider"}),u.jsx("dd",{children:d.provider??xn}),u.jsx("dt",{className:"text-slate-500",children:"Model"}),u.jsx("dd",{children:d.model??xn}),u.jsx("dt",{className:"text-slate-500",children:"Started"}),u.jsx("dd",{children:Fg(d.started_at)}),yn(d)&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{className:"text-slate-500",children:"Current stage"}),u.jsx("dd",{"data-testid":"current-stage",children:d.current_stage??"starting"})]}),u.jsx("dt",{className:"text-slate-500",children:yn(d)?"Elapsed":"Wall time"}),u.jsx("dd",{children:yn(d)?u.jsx(tv,{run:d}):Ig(d.wall_s)}),yn(d)&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{className:"text-slate-500",children:"Files touched"}),u.jsx("dd",{"data-testid":"files-touched",children:(d.files_touched??[]).join(", ")||"none yet"})]}),u.jsx("dt",{className:"text-slate-500",children:"Cost"}),u.jsx("dd",{"data-testid":"cost",children:Jg(d)}),u.jsx("dt",{className:"text-slate-500",children:"PR"}),u.jsx("dd",{children:u.jsx(Wg,{url:d.pr_url})})]})}),u.jsx(as,{title:"Stage timeline",children:u.jsx(K2,{stages:o.stages})})]}),o.blocked_question&&u.jsx(J2,{source:i,run:r,question:o.blocked_question}),u.jsx(as,{title:"Receipt",children:u.jsxs("div",{className:"space-y-3 text-sm",children:[o.receipt?u.jsxs("p",{children:["Receipt verdict: ",u.jsx(Sf,{run:{verdict:o.receipt.verdict,tampered:d.tampered,attested:d.attested,sig_checked:d.sig_checked}})," ",u.jsx("span",{className:"ml-2 font-mono text-xs text-slate-500",children:o.receipt.sha256})]}):u.jsx("p",{className:"text-slate-500",children:"No receipt ingested for this run."}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-medium",children:"NOT PROVEN"}),o.not_proven.length===0?u.jsx("p",{className:"text-slate-500",children:"Nothing listed as not proven."}):u.jsx("ul",{className:"list-disc pl-5",children:o.not_proven.map(m=>u.jsx("li",{"data-testid":"not-proven",children:m},m))})]})]})}),u.jsx(I2,{source:i,run:r})]})}const Uf=u.jsx(Z2,{});Ce({id:"home",path:"/",title:"Home",component:()=>u.jsx(lg,{fallback:Uf})});Ce({id:"overview",path:"/overview",title:"Overview",component:()=>u.jsx(lg,{overview:!0,fallback:Uf})});Ce({id:"runs",path:"/runs",title:"Runs",component:()=>Uf});Ce({id:"run-detail",path:"/runs/:source/:run",title:"Run",component:({params:i})=>u.jsx(F2,{source:i.source,run:i.run})});Ce({id:"live-run",path:"/live/:source/:run",title:"Live run",component:({params:i})=>u.jsx(eg,{source:i.source,run:i.run})});Ce({id:"settings-general",path:"/settings/general",title:"General",inSettings:!0,component:bj});b2();function W2(){return u.jsxs(u.Fragment,{children:[u.jsx(G2,{}),u.jsx(O2,{})]})}ur();s1.createRoot(document.getElementById("root")).render(u.jsx(W2,{}));