model-debugger 0.4.0__py3-none-any.whl

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 (177) hide show
  1. mdb/__init__.py +43 -0
  2. mdb/__main__.py +5 -0
  3. mdb/analysis/__init__.py +34 -0
  4. mdb/analysis/circuits/__init__.py +6 -0
  5. mdb/analysis/circuits/build.py +690 -0
  6. mdb/analysis/circuits/test.py +600 -0
  7. mdb/analysis/features/__init__.py +5 -0
  8. mdb/analysis/features/basis.py +685 -0
  9. mdb/analysis/features/sae.py +374 -0
  10. mdb/analysis/features/watch.py +268 -0
  11. mdb/analysis/measure/__init__.py +7 -0
  12. mdb/analysis/measure/branches.py +806 -0
  13. mdb/analysis/measure/bridge.py +379 -0
  14. mdb/analysis/measure/changes.py +201 -0
  15. mdb/analysis/measure/compare.py +348 -0
  16. mdb/analysis/measure/donors.py +193 -0
  17. mdb/analysis/measure/novelty.py +227 -0
  18. mdb/analysis/measure/paths.py +146 -0
  19. mdb/analysis/measure/pools.py +454 -0
  20. mdb/analysis/measure/readout.py +387 -0
  21. mdb/analysis/measure/reads.py +455 -0
  22. mdb/analysis/measure/sweep.py +215 -0
  23. mdb/analysis/numerics/__init__.py +6 -0
  24. mdb/analysis/numerics/accumulation.py +180 -0
  25. mdb/analysis/numerics/finite.py +1712 -0
  26. mdb/analysis/numerics/labels.py +80 -0
  27. mdb/analysis/numerics/pooling.py +89 -0
  28. mdb/analysis/numerics/stability.py +183 -0
  29. mdb/analysis/numerics/summary.py +306 -0
  30. mdb/analysis/numerics/units.py +86 -0
  31. mdb/analysis/numerics/verdict.py +244 -0
  32. mdb/analysis/numerics/why_frames.py +162 -0
  33. mdb/analysis/predict/__init__.py +7 -0
  34. mdb/analysis/predict/capture.py +265 -0
  35. mdb/analysis/predict/consumers.py +52 -0
  36. mdb/analysis/predict/explain.py +776 -0
  37. mdb/analysis/predict/forecast.py +635 -0
  38. mdb/analysis/predict/plan.py +248 -0
  39. mdb/analysis/predict/propagate.py +596 -0
  40. mdb/analysis/predict/rounding.py +95 -0
  41. mdb/analysis/predict/rowmodel.py +817 -0
  42. mdb/analysis/predict/supplied.py +103 -0
  43. mdb/analysis/predict/verify.py +433 -0
  44. mdb/analysis/predict/whatif.py +840 -0
  45. mdb/analysis/symbols/__init__.py +7 -0
  46. mdb/analysis/symbols/binding.py +138 -0
  47. mdb/analysis/symbols/candidates.py +320 -0
  48. mdb/analysis/symbols/circuit_map.py +592 -0
  49. mdb/analysis/symbols/components.py +436 -0
  50. mdb/analysis/symbols/frame.py +451 -0
  51. mdb/analysis/symbols/hop.py +439 -0
  52. mdb/analysis/symbols/liveness.py +292 -0
  53. mdb/analysis/symbols/probe.py +393 -0
  54. mdb/analysis/symbols/rows.py +400 -0
  55. mdb/analysis/symbols/sealed.py +149 -0
  56. mdb/analysis/symbols/subspace.py +380 -0
  57. mdb/analysis/symbols/symbol_finite.py +417 -0
  58. mdb/analysis/symbols/symbol_runs.py +683 -0
  59. mdb/analysis/symbols/table.py +1110 -0
  60. mdb/cli.py +105 -0
  61. mdb/core/__init__.py +4 -0
  62. mdb/core/address.py +1353 -0
  63. mdb/core/bounded.py +101 -0
  64. mdb/core/checkpoint_schema.py +202 -0
  65. mdb/core/checkpoint_store.py +377 -0
  66. mdb/core/circuit_pages.py +117 -0
  67. mdb/core/custody.py +629 -0
  68. mdb/core/errors.py +51 -0
  69. mdb/core/foreign_names.py +152 -0
  70. mdb/core/graph_seal.py +426 -0
  71. mdb/core/index.py +403 -0
  72. mdb/core/kinds.py +255 -0
  73. mdb/core/locate.py +161 -0
  74. mdb/core/migrate.py +280 -0
  75. mdb/core/neuronpedia.py +116 -0
  76. mdb/core/plugins.py +78 -0
  77. mdb/core/pointers.py +621 -0
  78. mdb/core/project.py +248 -0
  79. mdb/core/project_read.py +1038 -0
  80. mdb/core/recipe.py +457 -0
  81. mdb/core/records.py +1027 -0
  82. mdb/core/resolve.py +296 -0
  83. mdb/core/settings.py +718 -0
  84. mdb/engine/__init__.py +21 -0
  85. mdb/engine/attention_observer.py +53 -0
  86. mdb/engine/attention_port.py +903 -0
  87. mdb/engine/breakpoints.py +1465 -0
  88. mdb/engine/bundle.py +137 -0
  89. mdb/engine/checkpoint.py +1265 -0
  90. mdb/engine/core_file.py +306 -0
  91. mdb/engine/edits.py +323 -0
  92. mdb/engine/holds.py +256 -0
  93. mdb/engine/models.py +172 -0
  94. mdb/engine/ports.py +1424 -0
  95. mdb/engine/refs.py +223 -0
  96. mdb/engine/run.py +2162 -0
  97. mdb/engine/selfcheck.py +347 -0
  98. mdb/engine/trace.py +536 -0
  99. mdb/interop/__init__.py +17 -0
  100. mdb/interop/circuit_tracer_graph.py +253 -0
  101. mdb/interop/circuit_tracer_names.py +44 -0
  102. mdb/interop/clone.py +22 -0
  103. mdb/interop/names.py +295 -0
  104. mdb/interop/nn.py +431 -0
  105. mdb/interop/pyvene_compat.py +40 -0
  106. mdb/interop/pyvene_names.py +82 -0
  107. mdb/interop/tl.py +149 -0
  108. mdb/interop/verify.py +85 -0
  109. mdb/machines/__init__.py +53 -0
  110. mdb/machines/x86/__init__.py +13 -0
  111. mdb/machines/x86/address.py +171 -0
  112. mdb/machines/x86/binary.py +285 -0
  113. mdb/machines/x86/grid.py +188 -0
  114. mdb/machines/x86/index.py +184 -0
  115. mdb/machines/x86/interchange.py +156 -0
  116. mdb/machines/x86/lanes.py +281 -0
  117. mdb/machines/x86/method.py +252 -0
  118. mdb/machines/x86/method_v2.py +105 -0
  119. mdb/machines/x86/mlp.py +430 -0
  120. mdb/machines/x86/records.py +138 -0
  121. mdb/machines/x86/session.py +631 -0
  122. mdb/machines/x86/trace.py +351 -0
  123. mdb/ops/__init__.py +31 -0
  124. mdb/ops/builtin.py +1977 -0
  125. mdb/ops/context.py +60 -0
  126. mdb/ops/debugger.py +926 -0
  127. mdb/ops/errors.py +8 -0
  128. mdb/ops/features.py +513 -0
  129. mdb/ops/graph.py +58 -0
  130. mdb/ops/inspect.py +906 -0
  131. mdb/ops/lines.py +496 -0
  132. mdb/ops/named.py +672 -0
  133. mdb/ops/predict.py +450 -0
  134. mdb/ops/registry.py +332 -0
  135. mdb/ops/sets.py +988 -0
  136. mdb/ops/sweep.py +574 -0
  137. mdb/repl/__init__.py +5 -0
  138. mdb/repl/__main__.py +244 -0
  139. mdb/repl/config.py +213 -0
  140. mdb/repl/remote.py +324 -0
  141. mdb/repl/render.py +1699 -0
  142. mdb/repl/shell.py +409 -0
  143. mdb/serve/__init__.py +17 -0
  144. mdb/serve/__main__.py +180 -0
  145. mdb/serve/_legacy.py +97 -0
  146. mdb/serve/app.py +526 -0
  147. mdb/serve/blobs.py +280 -0
  148. mdb/serve/caps.py +148 -0
  149. mdb/serve/export.py +9 -0
  150. mdb/serve/guard.py +216 -0
  151. mdb/serve/live.py +412 -0
  152. mdb/serve/live_reduce.py +90 -0
  153. mdb/serve/recorded.py +515 -0
  154. mdb/serve/reduce.py +449 -0
  155. mdb/serve/schema.py +969 -0
  156. mdb/serve/states.py +125 -0
  157. mdb/serve/static/assets/index-BJpByNCO.js +58 -0
  158. mdb/serve/static/assets/index-H9zlNeqq.css +1 -0
  159. mdb/serve/static/index.html +14 -0
  160. mdb/serve/static/manifest.json +5 -0
  161. mdb/serve/stored.py +34 -0
  162. mdb/serve/typegen.py +131 -0
  163. mdb/serve/views/__init__.py +1 -0
  164. mdb/serve/views/common.py +201 -0
  165. mdb/serve/views/frame.py +235 -0
  166. mdb/serve/views/graph.py +224 -0
  167. mdb/serve/views/live.py +402 -0
  168. mdb/serve/views/records.py +557 -0
  169. mdb/serve/views/sessions.py +151 -0
  170. mdb/serve/views/symbols.py +185 -0
  171. mdb/serve/views/timeline.py +121 -0
  172. model_debugger-0.4.0.dist-info/METADATA +1516 -0
  173. model_debugger-0.4.0.dist-info/RECORD +177 -0
  174. model_debugger-0.4.0.dist-info/WHEEL +4 -0
  175. model_debugger-0.4.0.dist-info/entry_points.txt +2 -0
  176. model_debugger-0.4.0.dist-info/licenses/LICENSE +202 -0
  177. model_debugger-0.4.0.dist-info/licenses/NOTICE +6 -0
@@ -0,0 +1,58 @@
1
+ var ay=Object.defineProperty;var sy=(l,i,u)=>i in l?ay(l,i,{enumerable:!0,configurable:!0,writable:!0,value:u}):l[i]=u;var kr=(l,i,u)=>sy(l,typeof i!="symbol"?i+"":i,u);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))r(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const f of h.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&r(f)}).observe(document,{childList:!0,subtree:!0});function u(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function r(d){if(d.ep)return;d.ep=!0;const h=u(d);fetch(d.href,h)}})();function iy(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var $r={exports:{}},xs={};/**
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 Cm;function uy(){if(Cm)return xs;Cm=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function u(r,d,h){var f=null;if(h!==void 0&&(f=""+h),d.key!==void 0&&(f=""+d.key),"key"in d){h={};for(var v in d)v!=="key"&&(h[v]=d[v])}else h=d;return d=h.ref,{$$typeof:l,type:r,key:f,ref:d!==void 0?d:null,props:h}}return xs.Fragment=i,xs.jsx=u,xs.jsxs=u,xs}var Om;function cy(){return Om||(Om=1,$r.exports=uy()),$r.exports}var s=cy(),Hr={exports:{}},he={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Dm;function ry(){if(Dm)return he;Dm=1;var l=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),f=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),j=Symbol.iterator;function M(N){return N===null||typeof N!="object"?null:(N=j&&N[j]||N["@@iterator"],typeof N=="function"?N:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,q={};function X(N,B,J){this.props=N,this.context=B,this.refs=q,this.updater=J||k}X.prototype.isReactComponent={},X.prototype.setState=function(N,B){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,B,"setState")},X.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function ce(){}ce.prototype=X.prototype;function z(N,B,J){this.props=N,this.context=B,this.refs=q,this.updater=J||k}var T=z.prototype=new ce;T.constructor=z,G(T,X.prototype),T.isPureReactComponent=!0;var K=Array.isArray;function V(){}var W={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function oe(N,B,J){var ee=J.ref;return{$$typeof:l,type:N,key:B,ref:ee!==void 0?ee:null,props:J}}function _e(N,B){return oe(N.type,B,N.props)}function we(N){return typeof N=="object"&&N!==null&&N.$$typeof===l}function ae(N){var B={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(J){return B[J]})}var Ye=/\/+/g;function I(N,B){return typeof N=="object"&&N!==null&&N.key!=null?ae(""+N.key):B.toString(36)}function Z(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(V,V):(N.status="pending",N.then(function(B){N.status==="pending"&&(N.status="fulfilled",N.value=B)},function(B){N.status==="pending"&&(N.status="rejected",N.reason=B)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function O(N,B,J,ee,me){var ye=typeof N;(ye==="undefined"||ye==="boolean")&&(N=null);var Te=!1;if(N===null)Te=!0;else switch(ye){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(N.$$typeof){case l:case i:Te=!0;break;case x:return Te=N._init,O(Te(N._payload),B,J,ee,me)}}if(Te)return me=me(N),Te=ee===""?"."+I(N,0):ee,K(me)?(J="",Te!=null&&(J=Te.replace(Ye,"$&/")+"/"),O(me,B,J,"",function(wa){return wa})):me!=null&&(we(me)&&(me=_e(me,J+(me.key==null||N&&N.key===me.key?"":(""+me.key).replace(Ye,"$&/")+"/")+Te)),B.push(me)),1;Te=0;var ot=ee===""?".":ee+":";if(K(N))for(var Qe=0;Qe<N.length;Qe++)ee=N[Qe],ye=ot+I(ee,Qe),Te+=O(ee,B,J,ye,me);else if(Qe=M(N),typeof Qe=="function")for(N=Qe.call(N),Qe=0;!(ee=N.next()).done;)ee=ee.value,ye=ot+I(ee,Qe++),Te+=O(ee,B,J,ye,me);else if(ye==="object"){if(typeof N.then=="function")return O(Z(N),B,J,ee,me);throw B=String(N),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return Te}function Q(N,B,J){if(N==null)return N;var ee=[],me=0;return O(N,ee,"","",function(ye){return B.call(J,ye,me++)}),ee}function P(N){if(N._status===-1){var B=N._result;B=B(),B.then(function(J){(N._status===0||N._status===-1)&&(N._status=1,N._result=J)},function(J){(N._status===0||N._status===-1)&&(N._status=2,N._result=J)}),N._status===-1&&(N._status=0,N._result=B)}if(N._status===1)return N._result.default;throw N._result}var xe=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},fe={map:Q,forEach:function(N,B,J){Q(N,function(){B.apply(this,arguments)},J)},count:function(N){var B=0;return Q(N,function(){B++}),B},toArray:function(N){return Q(N,function(B){return B})||[]},only:function(N){if(!we(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return he.Activity=g,he.Children=fe,he.Component=X,he.Fragment=u,he.Profiler=d,he.PureComponent=z,he.StrictMode=r,he.Suspense=y,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,he.__COMPILER_RUNTIME={__proto__:null,c:function(N){return W.H.useMemoCache(N)}},he.cache=function(N){return function(){return N.apply(null,arguments)}},he.cacheSignal=function(){return null},he.cloneElement=function(N,B,J){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ee=G({},N.props),me=N.key;if(B!=null)for(ye in B.key!==void 0&&(me=""+B.key),B)!Y.call(B,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&B.ref===void 0||(ee[ye]=B[ye]);var ye=arguments.length-2;if(ye===1)ee.children=J;else if(1<ye){for(var Te=Array(ye),ot=0;ot<ye;ot++)Te[ot]=arguments[ot+2];ee.children=Te}return oe(N.type,me,ee)},he.createContext=function(N){return N={$$typeof:f,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:h,_context:N},N},he.createElement=function(N,B,J){var ee,me={},ye=null;if(B!=null)for(ee in B.key!==void 0&&(ye=""+B.key),B)Y.call(B,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(me[ee]=B[ee]);var Te=arguments.length-2;if(Te===1)me.children=J;else if(1<Te){for(var ot=Array(Te),Qe=0;Qe<Te;Qe++)ot[Qe]=arguments[Qe+2];me.children=ot}if(N&&N.defaultProps)for(ee in Te=N.defaultProps,Te)me[ee]===void 0&&(me[ee]=Te[ee]);return oe(N,ye,me)},he.createRef=function(){return{current:null}},he.forwardRef=function(N){return{$$typeof:v,render:N}},he.isValidElement=we,he.lazy=function(N){return{$$typeof:x,_payload:{_status:-1,_result:N},_init:P}},he.memo=function(N,B){return{$$typeof:p,type:N,compare:B===void 0?null:B}},he.startTransition=function(N){var B=W.T,J={};W.T=J;try{var ee=N(),me=W.S;me!==null&&me(J,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(V,xe)}catch(ye){xe(ye)}finally{B!==null&&J.types!==null&&(B.types=J.types),W.T=B}},he.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},he.use=function(N){return W.H.use(N)},he.useActionState=function(N,B,J){return W.H.useActionState(N,B,J)},he.useCallback=function(N,B){return W.H.useCallback(N,B)},he.useContext=function(N){return W.H.useContext(N)},he.useDebugValue=function(){},he.useDeferredValue=function(N,B){return W.H.useDeferredValue(N,B)},he.useEffect=function(N,B){return W.H.useEffect(N,B)},he.useEffectEvent=function(N){return W.H.useEffectEvent(N)},he.useId=function(){return W.H.useId()},he.useImperativeHandle=function(N,B,J){return W.H.useImperativeHandle(N,B,J)},he.useInsertionEffect=function(N,B){return W.H.useInsertionEffect(N,B)},he.useLayoutEffect=function(N,B){return W.H.useLayoutEffect(N,B)},he.useMemo=function(N,B){return W.H.useMemo(N,B)},he.useOptimistic=function(N,B){return W.H.useOptimistic(N,B)},he.useReducer=function(N,B,J){return W.H.useReducer(N,B,J)},he.useRef=function(N){return W.H.useRef(N)},he.useState=function(N){return W.H.useState(N)},he.useSyncExternalStore=function(N,B,J){return W.H.useSyncExternalStore(N,B,J)},he.useTransition=function(){return W.H.useTransition()},he.version="19.2.8",he}var Rm;function fo(){return Rm||(Rm=1,Hr.exports=ry()),Hr.exports}var L=fo();const Vi=iy(L);var qr={exports:{}},ys={},Br={exports:{}},Lr={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Um;function oy(){return Um||(Um=1,(function(l){function i(O,Q){var P=O.length;O.push(Q);e:for(;0<P;){var xe=P-1>>>1,fe=O[xe];if(0<d(fe,Q))O[xe]=Q,O[P]=fe,P=xe;else break e}}function u(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var Q=O[0],P=O.pop();if(P!==Q){O[0]=P;e:for(var xe=0,fe=O.length,N=fe>>>1;xe<N;){var B=2*(xe+1)-1,J=O[B],ee=B+1,me=O[ee];if(0>d(J,P))ee<fe&&0>d(me,J)?(O[xe]=me,O[ee]=P,xe=ee):(O[xe]=J,O[B]=P,xe=B);else if(ee<fe&&0>d(me,P))O[xe]=me,O[ee]=P,xe=ee;else break e}}return Q}function d(O,Q){var P=O.sortIndex-Q.sortIndex;return P!==0?P:O.id-Q.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;l.unstable_now=function(){return h.now()}}else{var f=Date,v=f.now();l.unstable_now=function(){return f.now()-v}}var y=[],p=[],x=1,g=null,j=3,M=!1,k=!1,G=!1,q=!1,X=typeof setTimeout=="function"?setTimeout:null,ce=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function T(O){for(var Q=u(p);Q!==null;){if(Q.callback===null)r(p);else if(Q.startTime<=O)r(p),Q.sortIndex=Q.expirationTime,i(y,Q);else break;Q=u(p)}}function K(O){if(G=!1,T(O),!k)if(u(y)!==null)k=!0,V||(V=!0,ae());else{var Q=u(p);Q!==null&&Z(K,Q.startTime-O)}}var V=!1,W=-1,Y=5,oe=-1;function _e(){return q?!0:!(l.unstable_now()-oe<Y)}function we(){if(q=!1,V){var O=l.unstable_now();oe=O;var Q=!0;try{e:{k=!1,G&&(G=!1,ce(W),W=-1),M=!0;var P=j;try{t:{for(T(O),g=u(y);g!==null&&!(g.expirationTime>O&&_e());){var xe=g.callback;if(typeof xe=="function"){g.callback=null,j=g.priorityLevel;var fe=xe(g.expirationTime<=O);if(O=l.unstable_now(),typeof fe=="function"){g.callback=fe,T(O),Q=!0;break t}g===u(y)&&r(y),T(O)}else r(y);g=u(y)}if(g!==null)Q=!0;else{var N=u(p);N!==null&&Z(K,N.startTime-O),Q=!1}}break e}finally{g=null,j=P,M=!1}Q=void 0}}finally{Q?ae():V=!1}}}var ae;if(typeof z=="function")ae=function(){z(we)};else if(typeof MessageChannel<"u"){var Ye=new MessageChannel,I=Ye.port2;Ye.port1.onmessage=we,ae=function(){I.postMessage(null)}}else ae=function(){X(we,0)};function Z(O,Q){W=X(function(){O(l.unstable_now())},Q)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(O){O.callback=null},l.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<O?Math.floor(1e3/O):5},l.unstable_getCurrentPriorityLevel=function(){return j},l.unstable_next=function(O){switch(j){case 1:case 2:case 3:var Q=3;break;default:Q=j}var P=j;j=Q;try{return O()}finally{j=P}},l.unstable_requestPaint=function(){q=!0},l.unstable_runWithPriority=function(O,Q){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var P=j;j=O;try{return Q()}finally{j=P}},l.unstable_scheduleCallback=function(O,Q,P){var xe=l.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?xe+P:xe):P=xe,O){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=P+fe,O={id:x++,callback:Q,priorityLevel:O,startTime:P,expirationTime:fe,sortIndex:-1},P>xe?(O.sortIndex=P,i(p,O),u(y)===null&&O===u(p)&&(G?(ce(W),W=-1):G=!0,Z(K,P-xe))):(O.sortIndex=fe,i(y,O),k||M||(k=!0,V||(V=!0,ae()))),O},l.unstable_shouldYield=_e,l.unstable_wrapCallback=function(O){var Q=j;return function(){var P=j;j=Q;try{return O.apply(this,arguments)}finally{j=P}}}})(Lr)),Lr}var km;function dy(){return km||(km=1,Br.exports=oy()),Br.exports}var Yr={exports:{}},rt={};/**
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 $m;function fy(){if($m)return rt;$m=1;var l=fo();function i(y){var p="https://react.dev/errors/"+y;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)p+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+y+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var r={d:{f:u,r:function(){throw Error(i(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function h(y,p,x){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:g==null?null:""+g,children:y,containerInfo:p,implementation:x}}var f=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(y,p){if(y==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,rt.createPortal=function(y,p){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(i(299));return h(y,p,null,x)},rt.flushSync=function(y){var p=f.T,x=r.p;try{if(f.T=null,r.p=2,y)return y()}finally{f.T=p,r.p=x,r.d.f()}},rt.preconnect=function(y,p){typeof y=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(y,p))},rt.prefetchDNS=function(y){typeof y=="string"&&r.d.D(y)},rt.preinit=function(y,p){if(typeof y=="string"&&p&&typeof p.as=="string"){var x=p.as,g=v(x,p.crossOrigin),j=typeof p.integrity=="string"?p.integrity:void 0,M=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;x==="style"?r.d.S(y,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:j,fetchPriority:M}):x==="script"&&r.d.X(y,{crossOrigin:g,integrity:j,fetchPriority:M,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},rt.preinitModule=function(y,p){if(typeof y=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var x=v(p.as,p.crossOrigin);r.d.M(y,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(y)},rt.preload=function(y,p){if(typeof y=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var x=p.as,g=v(x,p.crossOrigin);r.d.L(y,x,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},rt.preloadModule=function(y,p){if(typeof y=="string")if(p){var x=v(p.as,p.crossOrigin);r.d.m(y,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(y)},rt.requestFormReset=function(y){r.d.r(y)},rt.unstable_batchedUpdates=function(y,p){return y(p)},rt.useFormState=function(y,p,x){return f.H.useFormState(y,p,x)},rt.useFormStatus=function(){return f.H.useHostTransitionStatus()},rt.version="19.2.8",rt}var Hm;function hy(){if(Hm)return Yr.exports;Hm=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),Yr.exports=fy(),Yr.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 qm;function my(){if(qm)return ys;qm=1;var l=dy(),i=fo(),u=hy();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(h(e)!==e)throw Error(r(188))}function p(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(r(188));return t!==e?null:e}for(var n=e,a=t;;){var c=n.return;if(c===null)break;var o=c.alternate;if(o===null){if(a=c.return,a!==null){n=a;continue}break}if(c.child===o.child){for(o=c.child;o;){if(o===n)return y(c),e;if(o===a)return y(c),t;o=o.sibling}throw Error(r(188))}if(n.return!==a.return)n=c,a=o;else{for(var m=!1,b=c.child;b;){if(b===n){m=!0,n=c,a=o;break}if(b===a){m=!0,a=c,n=o;break}b=b.sibling}if(!m){for(b=o.child;b;){if(b===n){m=!0,n=o,a=c;break}if(b===a){m=!0,a=o,n=c;break}b=b.sibling}if(!m)throw Error(r(189))}}if(n.alternate!==a)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,j=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),ce=Symbol.for("react.consumer"),z=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),_e=Symbol.for("react.memo_cache_sentinel"),we=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=we&&e[we]||e["@@iterator"],typeof e=="function"?e:null)}var Ye=Symbol.for("react.client.reference");function I(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case G:return"Fragment";case X:return"Profiler";case q:return"StrictMode";case K:return"Suspense";case V:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case z:return e.displayName||"Context";case ce:return(e._context.displayName||"Context")+".Consumer";case T:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return t=e.displayName||null,t!==null?t:I(e.type)||"Memo";case Y:t=e._payload,e=e._init;try{return I(e(t))}catch{}}return null}var Z=Array.isArray,O=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},xe=[],fe=-1;function N(e){return{current:e}}function B(e){0>fe||(e.current=xe[fe],xe[fe]=null,fe--)}function J(e,t){fe++,xe[fe]=e.current,e.current=t}var ee=N(null),me=N(null),ye=N(null),Te=N(null);function ot(e,t){switch(J(ye,t),J(me,e),J(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?em(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=em(t),e=tm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(ee),J(ee,e)}function Qe(){B(ee),B(me),B(ye)}function wa(e){e.memoizedState!==null&&J(Te,e);var t=ee.current,n=tm(t,e.type);t!==n&&(J(me,e),J(ee,n))}function Ts(e){me.current===e&&(B(ee),B(me)),Te.current===e&&(B(Te),hs._currentValue=P)}var yu,To;function Wn(e){if(yu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);yu=t&&t[1]||"",To=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+yu+e+To}var gu=!1;function bu(e,t){if(!e||gu)return"";gu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(D){var C=D}Reflect.construct(e,[],H)}else{try{H.call()}catch(D){C=D}e.call(H.prototype)}}else{try{throw Error()}catch(D){C=D}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(D){if(D&&C&&typeof D.stack=="string")return[D.stack,C.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=a.DetermineComponentFrameRoot(),m=o[0],b=o[1];if(m&&b){var S=m.split(`
44
+ `),A=b.split(`
45
+ `);for(c=a=0;a<S.length&&!S[a].includes("DetermineComponentFrameRoot");)a++;for(;c<A.length&&!A[c].includes("DetermineComponentFrameRoot");)c++;if(a===S.length||c===A.length)for(a=S.length-1,c=A.length-1;1<=a&&0<=c&&S[a]!==A[c];)c--;for(;1<=a&&0<=c;a--,c--)if(S[a]!==A[c]){if(a!==1||c!==1)do if(a--,c--,0>c||S[a]!==A[c]){var U=`
46
+ `+S[a].replace(" at new "," at ");return e.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",e.displayName)),U}while(1<=a&&0<=c);break}}}finally{gu=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Wn(n):""}function Uv(e,t){switch(e.tag){case 26:case 27:case 5:return Wn(e.type);case 16:return Wn("Lazy");case 13:return e.child!==t&&t!==null?Wn("Suspense Fallback"):Wn("Suspense");case 19:return Wn("SuspenseList");case 0:case 15:return bu(e.type,!1);case 11:return bu(e.type.render,!1);case 1:return bu(e.type,!0);case 31:return Wn("Activity");default:return""}}function zo(e){try{var t="",n=null;do t+=Uv(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}var ju=Object.prototype.hasOwnProperty,Su=l.unstable_scheduleCallback,Nu=l.unstable_cancelCallback,kv=l.unstable_shouldYield,$v=l.unstable_requestPaint,bt=l.unstable_now,Hv=l.unstable_getCurrentPriorityLevel,Co=l.unstable_ImmediatePriority,Oo=l.unstable_UserBlockingPriority,zs=l.unstable_NormalPriority,qv=l.unstable_LowPriority,Do=l.unstable_IdlePriority,Bv=l.log,Lv=l.unstable_setDisableYieldValue,Ma=null,jt=null;function jn(e){if(typeof Bv=="function"&&Lv(e),jt&&typeof jt.setStrictMode=="function")try{jt.setStrictMode(Ma,e)}catch{}}var St=Math.clz32?Math.clz32:Xv,Yv=Math.log,Gv=Math.LN2;function Xv(e){return e>>>=0,e===0?32:31-(Yv(e)/Gv|0)|0}var Cs=256,Os=262144,Ds=4194304;function Fn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Rs(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var c=0,o=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var b=a&134217727;return b!==0?(a=b&~o,a!==0?c=Fn(a):(m&=b,m!==0?c=Fn(m):n||(n=b&~e,n!==0&&(c=Fn(n))))):(b=a&~o,b!==0?c=Fn(b):m!==0?c=Fn(m):n||(n=a&~e,n!==0&&(c=Fn(n)))),c===0?0:t!==0&&t!==c&&(t&o)===0&&(o=c&-c,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:c}function Ea(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qv(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ro(){var e=Ds;return Ds<<=1,(Ds&62914560)===0&&(Ds=4194304),e}function wu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function _a(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Zv(e,t,n,a,c,o){var m=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var b=e.entanglements,S=e.expirationTimes,A=e.hiddenUpdates;for(n=m&~n;0<n;){var U=31-St(n),H=1<<U;b[U]=0,S[U]=-1;var C=A[U];if(C!==null)for(A[U]=null,U=0;U<C.length;U++){var D=C[U];D!==null&&(D.lane&=-536870913)}n&=~H}a!==0&&Uo(e,a,0),o!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=o&~(m&~t))}function Uo(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-St(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function ko(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-St(n),c=1<<a;c&t|e[a]&t&&(e[a]|=t),n&=~c}}function $o(e,t){var n=t&-t;return n=(n&42)!==0?1:Mu(n),(n&(e.suspendedLanes|t))!==0?0:n}function Mu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Eu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ho(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:wm(e.type))}function qo(e,t){var n=Q.p;try{return Q.p=e,t()}finally{Q.p=n}}var Sn=Math.random().toString(36).slice(2),lt="__reactFiber$"+Sn,ft="__reactProps$"+Sn,Al="__reactContainer$"+Sn,_u="__reactEvents$"+Sn,Vv="__reactListeners$"+Sn,Kv="__reactHandles$"+Sn,Bo="__reactResources$"+Sn,Aa="__reactMarker$"+Sn;function Au(e){delete e[lt],delete e[ft],delete e[_u],delete e[Vv],delete e[Kv]}function Tl(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Al]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=cm(e);e!==null;){if(n=e[lt])return n;e=cm(e)}return t}e=n,n=e.parentNode}return null}function zl(e){if(e=e[lt]||e[Al]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ta(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Cl(e){var t=e[Bo];return t||(t=e[Bo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[Aa]=!0}var Lo=new Set,Yo={};function In(e,t){Ol(e,t),Ol(e+"Capture",t)}function Ol(e,t){for(Yo[e]=t,e=0;e<t.length;e++)Lo.add(t[e])}var Jv=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]*$"),Go={},Xo={};function Wv(e){return ju.call(Xo,e)?!0:ju.call(Go,e)?!1:Jv.test(e)?Xo[e]=!0:(Go[e]=!0,!1)}function Us(e,t,n){if(Wv(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function ks(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function tn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fv(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,o=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(m){n=""+m,o.call(this,m)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tu(e){if(!e._valueTracker){var t=Qo(e)?"checked":"value";e._valueTracker=Fv(e,t,""+e[t])}}function Zo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Qo(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function $s(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Iv=/[\n"\\]/g;function Ct(e){return e.replace(Iv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function zu(e,t,n,a,c,o,m,b){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?Cu(e,m,zt(t)):n!=null?Cu(e,m,zt(n)):a!=null&&e.removeAttribute("value"),c==null&&o!=null&&(e.defaultChecked=!!o),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+zt(b):e.removeAttribute("name")}function Vo(e,t,n,a,c,o,m,b){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Tu(e);return}n=n!=null?""+zt(n):"",t=t!=null?""+zt(t):n,b||t===e.value||(e.value=t),e.defaultValue=t}a=a??c,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=b?e.checked:!!a,e.defaultChecked=!!a,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),Tu(e)}function Cu(e,t,n){t==="number"&&$s(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Dl(e,t,n,a){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&a&&(e[n].defaultSelected=!0)}else{for(n=""+zt(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,a&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Ko(e,t,n){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+zt(n):""}function Jo(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(r(92));if(Z(a)){if(1<a.length)throw Error(r(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=zt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Tu(e)}function Rl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pv=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 Wo(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||Pv.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Fo(e,t,n){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var c in t)a=t[c],t.hasOwnProperty(c)&&n[c]!==a&&Wo(e,c,a)}else for(var o in t)t.hasOwnProperty(o)&&Wo(e,o,t[o])}function Ou(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ex=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),tx=/^[\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 Hs(e){return tx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function nn(){}var Du=null;function Ru(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ul=null,kl=null;function Io(e){var t=zl(e);if(t&&(e=t.stateNode)){var n=e[ft]||null;e:switch(e=t.stateNode,t.type){case"input":if(zu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ct(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var c=a[ft]||null;if(!c)throw Error(r(90));zu(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Zo(a)}break e;case"textarea":Ko(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Dl(e,!!n.multiple,t,!1)}}}var Uu=!1;function Po(e,t,n){if(Uu)return e(t,n);Uu=!0;try{var a=e(t);return a}finally{if(Uu=!1,(Ul!==null||kl!==null)&&(Mi(),Ul&&(t=Ul,e=kl,kl=Ul=null,Io(t),e)))for(t=0;t<e.length;t++)Io(e[t])}}function za(e,t){var n=e.stateNode;if(n===null)return null;var a=n[ft]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(r(231,t,typeof n));return n}var ln=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ku=!1;if(ln)try{var Ca={};Object.defineProperty(Ca,"passive",{get:function(){ku=!0}}),window.addEventListener("test",Ca,Ca),window.removeEventListener("test",Ca,Ca)}catch{ku=!1}var Nn=null,$u=null,qs=null;function ed(){if(qs)return qs;var e,t=$u,n=t.length,a,c="value"in Nn?Nn.value:Nn.textContent,o=c.length;for(e=0;e<n&&t[e]===c[e];e++);var m=n-e;for(a=1;a<=m&&t[n-a]===c[o-a];a++);return qs=c.slice(e,1<a?1-a:void 0)}function Bs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ls(){return!0}function td(){return!1}function ht(e){function t(n,a,c,o,m){this._reactName=n,this._targetInst=c,this.type=a,this.nativeEvent=o,this.target=m,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(n=e[b],this[b]=n?n(o):o[b]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ls:td,this.isPropagationStopped=td,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ls)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ls)},persist:function(){},isPersistent:Ls}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ys=ht(Pn),Oa=g({},Pn,{view:0,detail:0}),nx=ht(Oa),Hu,qu,Da,Gs=g({},Oa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Da&&(Da&&e.type==="mousemove"?(Hu=e.screenX-Da.screenX,qu=e.screenY-Da.screenY):qu=Hu=0,Da=e),Hu)},movementY:function(e){return"movementY"in e?e.movementY:qu}}),nd=ht(Gs),lx=g({},Gs,{dataTransfer:0}),ax=ht(lx),sx=g({},Oa,{relatedTarget:0}),Bu=ht(sx),ix=g({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0}),ux=ht(ix),cx=g({},Pn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rx=ht(cx),ox=g({},Pn,{data:0}),ld=ht(ox),dx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fx={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"},hx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hx[e])?!!t[e]:!1}function Lu(){return mx}var px=g({},Oa,{key:function(e){if(e.key){var t=dx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Lu,charCode:function(e){return e.type==="keypress"?Bs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vx=ht(px),xx=g({},Gs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ad=ht(xx),yx=g({},Oa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lu}),gx=ht(yx),bx=g({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0}),jx=ht(bx),Sx=g({},Gs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Nx=ht(Sx),wx=g({},Pn,{newState:0,oldState:0}),Mx=ht(wx),Ex=[9,13,27,32],Yu=ln&&"CompositionEvent"in window,Ra=null;ln&&"documentMode"in document&&(Ra=document.documentMode);var _x=ln&&"TextEvent"in window&&!Ra,sd=ln&&(!Yu||Ra&&8<Ra&&11>=Ra),id=" ",ud=!1;function cd(e,t){switch(e){case"keyup":return Ex.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $l=!1;function Ax(e,t){switch(e){case"compositionend":return rd(t);case"keypress":return t.which!==32?null:(ud=!0,id);case"textInput":return e=t.data,e===id&&ud?null:e;default:return null}}function Tx(e,t){if($l)return e==="compositionend"||!Yu&&cd(e,t)?(e=ed(),qs=$u=Nn=null,$l=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return sd&&t.locale!=="ko"?null:t.data;default:return null}}var zx={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 od(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zx[e.type]:t==="textarea"}function dd(e,t,n,a){Ul?kl?kl.push(a):kl=[a]:Ul=a,t=Oi(t,"onChange"),0<t.length&&(n=new Ys("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Ua=null,ka=null;function Cx(e){Kh(e,0)}function Xs(e){var t=Ta(e);if(Zo(t))return e}function fd(e,t){if(e==="change")return t}var hd=!1;if(ln){var Gu;if(ln){var Xu="oninput"in document;if(!Xu){var md=document.createElement("div");md.setAttribute("oninput","return;"),Xu=typeof md.oninput=="function"}Gu=Xu}else Gu=!1;hd=Gu&&(!document.documentMode||9<document.documentMode)}function pd(){Ua&&(Ua.detachEvent("onpropertychange",vd),ka=Ua=null)}function vd(e){if(e.propertyName==="value"&&Xs(ka)){var t=[];dd(t,ka,e,Ru(e)),Po(Cx,t)}}function Ox(e,t,n){e==="focusin"?(pd(),Ua=t,ka=n,Ua.attachEvent("onpropertychange",vd)):e==="focusout"&&pd()}function Dx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xs(ka)}function Rx(e,t){if(e==="click")return Xs(t)}function Ux(e,t){if(e==="input"||e==="change")return Xs(t)}function kx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:kx;function $a(e,t){if(Nt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var c=n[a];if(!ju.call(t,c)||!Nt(e[c],t[c]))return!1}return!0}function xd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yd(e,t){var n=xd(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xd(n)}}function gd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$s(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=$s(e.document)}return t}function Qu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var $x=ln&&"documentMode"in document&&11>=document.documentMode,Hl=null,Zu=null,Ha=null,Vu=!1;function jd(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vu||Hl==null||Hl!==$s(a)||(a=Hl,"selectionStart"in a&&Qu(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ha&&$a(Ha,a)||(Ha=a,a=Oi(Zu,"onSelect"),0<a.length&&(t=new Ys("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Hl)))}function el(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ql={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionrun:el("Transition","TransitionRun"),transitionstart:el("Transition","TransitionStart"),transitioncancel:el("Transition","TransitionCancel"),transitionend:el("Transition","TransitionEnd")},Ku={},Sd={};ln&&(Sd=document.createElement("div").style,"AnimationEvent"in window||(delete ql.animationend.animation,delete ql.animationiteration.animation,delete ql.animationstart.animation),"TransitionEvent"in window||delete ql.transitionend.transition);function tl(e){if(Ku[e])return Ku[e];if(!ql[e])return e;var t=ql[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Sd)return Ku[e]=t[n];return e}var Nd=tl("animationend"),wd=tl("animationiteration"),Md=tl("animationstart"),Hx=tl("transitionrun"),qx=tl("transitionstart"),Bx=tl("transitioncancel"),Ed=tl("transitionend"),_d=new Map,Ju="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ju.push("scrollEnd");function Bt(e,t){_d.set(e,t),In(t,[e])}var Qs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ot=[],Bl=0,Wu=0;function Zs(){for(var e=Bl,t=Wu=Bl=0;t<e;){var n=Ot[t];Ot[t++]=null;var a=Ot[t];Ot[t++]=null;var c=Ot[t];Ot[t++]=null;var o=Ot[t];if(Ot[t++]=null,a!==null&&c!==null){var m=a.pending;m===null?c.next=c:(c.next=m.next,m.next=c),a.pending=c}o!==0&&Ad(n,c,o)}}function Vs(e,t,n,a){Ot[Bl++]=e,Ot[Bl++]=t,Ot[Bl++]=n,Ot[Bl++]=a,Wu|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Fu(e,t,n,a){return Vs(e,t,n,a),Ks(e)}function nl(e,t){return Vs(e,null,null,t),Ks(e)}function Ad(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var c=!1,o=e.return;o!==null;)o.childLanes|=n,a=o.alternate,a!==null&&(a.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(c=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,c&&t!==null&&(c=31-St(n),e=o.hiddenUpdates,a=e[c],a===null?e[c]=[t]:a.push(t),t.lane=n|536870912),o):null}function Ks(e){if(50<is)throw is=0,ir=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ll={};function Lx(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wt(e,t,n,a){return new Lx(e,t,n,a)}function Iu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function an(e,t){var n=e.alternate;return n===null?(n=wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Td(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Js(e,t,n,a,c,o){var m=0;if(a=e,typeof e=="function")Iu(e)&&(m=1);else if(typeof e=="string")m=Z0(e,n,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case oe:return e=wt(31,n,t,c),e.elementType=oe,e.lanes=o,e;case G:return ll(n.children,c,o,t);case q:m=8,c|=24;break;case X:return e=wt(12,n,t,c|2),e.elementType=X,e.lanes=o,e;case K:return e=wt(13,n,t,c),e.elementType=K,e.lanes=o,e;case V:return e=wt(19,n,t,c),e.elementType=V,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case z:m=10;break e;case ce:m=9;break e;case T:m=11;break e;case W:m=14;break e;case Y:m=16,a=null;break e}m=29,n=Error(r(130,e===null?"null":typeof e,"")),a=null}return t=wt(m,n,t,c),t.elementType=e,t.type=a,t.lanes=o,t}function ll(e,t,n,a){return e=wt(7,e,a,t),e.lanes=n,e}function Pu(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function zd(e){var t=wt(18,null,null,0);return t.stateNode=e,t}function ec(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Cd=new WeakMap;function Dt(e,t){if(typeof e=="object"&&e!==null){var n=Cd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:zo(t)},Cd.set(e,t),t)}return{value:e,source:t,stack:zo(t)}}var Yl=[],Gl=0,Ws=null,qa=0,Rt=[],Ut=0,wn=null,Zt=1,Vt="";function sn(e,t){Yl[Gl++]=qa,Yl[Gl++]=Ws,Ws=e,qa=t}function Od(e,t,n){Rt[Ut++]=Zt,Rt[Ut++]=Vt,Rt[Ut++]=wn,wn=e;var a=Zt;e=Vt;var c=32-St(a)-1;a&=~(1<<c),n+=1;var o=32-St(t)+c;if(30<o){var m=c-c%5;o=(a&(1<<m)-1).toString(32),a>>=m,c-=m,Zt=1<<32-St(t)+c|n<<c|a,Vt=o+e}else Zt=1<<o|n<<c|a,Vt=e}function tc(e){e.return!==null&&(sn(e,1),Od(e,1,0))}function nc(e){for(;e===Ws;)Ws=Yl[--Gl],Yl[Gl]=null,qa=Yl[--Gl],Yl[Gl]=null;for(;e===wn;)wn=Rt[--Ut],Rt[Ut]=null,Vt=Rt[--Ut],Rt[Ut]=null,Zt=Rt[--Ut],Rt[Ut]=null}function Dd(e,t){Rt[Ut++]=Zt,Rt[Ut++]=Vt,Rt[Ut++]=wn,Zt=t.id,Vt=t.overflow,wn=e}var at=null,He=null,Ne=!1,Mn=null,kt=!1,lc=Error(r(519));function En(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ba(Dt(t,e)),lc}function Rd(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[lt]=e,t[ft]=a,n){case"dialog":be("cancel",t),be("close",t);break;case"iframe":case"object":case"embed":be("load",t);break;case"video":case"audio":for(n=0;n<cs.length;n++)be(cs[n],t);break;case"source":be("error",t);break;case"img":case"image":case"link":be("error",t),be("load",t);break;case"details":be("toggle",t);break;case"input":be("invalid",t),Vo(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":be("invalid",t);break;case"textarea":be("invalid",t),Jo(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Ih(t.textContent,n)?(a.popover!=null&&(be("beforetoggle",t),be("toggle",t)),a.onScroll!=null&&be("scroll",t),a.onScrollEnd!=null&&be("scrollend",t),a.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||En(e,!0)}function Ud(e){for(at=e.return;at;)switch(at.tag){case 5:case 31:case 13:kt=!1;return;case 27:case 3:kt=!0;return;default:at=at.return}}function Xl(e){if(e!==at)return!1;if(!Ne)return Ud(e),Ne=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||jr(e.type,e.memoizedProps)),n=!n),n&&He&&En(e),Ud(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));He=um(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));He=um(e)}else t===27?(t=He,Bn(e.type)?(e=Er,Er=null,He=e):He=t):He=at?Ht(e.stateNode.nextSibling):null;return!0}function al(){He=at=null,Ne=!1}function ac(){var e=Mn;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),Mn=null),e}function Ba(e){Mn===null?Mn=[e]:Mn.push(e)}var sc=N(null),sl=null,un=null;function _n(e,t,n){J(sc,t._currentValue),t._currentValue=n}function cn(e){e._currentValue=sc.current,B(sc)}function ic(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function uc(e,t,n,a){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var o=c.dependencies;if(o!==null){var m=c.child;o=o.firstContext;e:for(;o!==null;){var b=o;o=c;for(var S=0;S<t.length;S++)if(b.context===t[S]){o.lanes|=n,b=o.alternate,b!==null&&(b.lanes|=n),ic(o.return,n,e),a||(m=null);break e}o=b.next}}else if(c.tag===18){if(m=c.return,m===null)throw Error(r(341));m.lanes|=n,o=m.alternate,o!==null&&(o.lanes|=n),ic(m,n,e),m=null}else m=c.child;if(m!==null)m.return=c;else for(m=c;m!==null;){if(m===e){m=null;break}if(c=m.sibling,c!==null){c.return=m.return,m=c;break}m=m.return}c=m}}function Ql(e,t,n,a){e=null;for(var c=t,o=!1;c!==null;){if(!o){if((c.flags&524288)!==0)o=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var m=c.alternate;if(m===null)throw Error(r(387));if(m=m.memoizedProps,m!==null){var b=c.type;Nt(c.pendingProps.value,m.value)||(e!==null?e.push(b):e=[b])}}else if(c===Te.current){if(m=c.alternate,m===null)throw Error(r(387));m.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(hs):e=[hs])}c=c.return}e!==null&&uc(t,e,n,a),t.flags|=262144}function Fs(e){for(e=e.firstContext;e!==null;){if(!Nt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function il(e){sl=e,un=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function st(e){return kd(sl,e)}function Is(e,t){return sl===null&&il(e),kd(e,t)}function kd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},un===null){if(e===null)throw Error(r(308));un=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else un=un.next=t;return n}var Yx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Gx=l.unstable_scheduleCallback,Xx=l.unstable_NormalPriority,Ke={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cc(){return{controller:new Yx,data:new Map,refCount:0}}function La(e){e.refCount--,e.refCount===0&&Gx(Xx,function(){e.controller.abort()})}var Ya=null,rc=0,Zl=0,Vl=null;function Qx(e,t){if(Ya===null){var n=Ya=[];rc=0,Zl=fr(),Vl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return rc++,t.then($d,$d),t}function $d(){if(--rc===0&&Ya!==null){Vl!==null&&(Vl.status="fulfilled");var e=Ya;Ya=null,Zl=0,Vl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Zx(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(a.status="rejected",a.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),a}var Hd=O.S;O.S=function(e,t){Sh=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qx(e,t),Hd!==null&&Hd(e,t)};var ul=N(null);function oc(){var e=ul.current;return e!==null?e:ke.pooledCache}function Ps(e,t){t===null?J(ul,ul.current):J(ul,t.pool)}function qd(){var e=oc();return e===null?null:{parent:Ke._currentValue,pool:e}}var Kl=Error(r(460)),dc=Error(r(474)),ei=Error(r(542)),ti={then:function(){}};function Bd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ld(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nn,nn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Gd(e),e;default:if(typeof t.status=="string")t.then(nn,nn);else{if(e=ke,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=a}},function(a){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Gd(e),e}throw rl=t,Kl}}function cl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(rl=n,Kl):n}}var rl=null;function Yd(){if(rl===null)throw Error(r(459));var e=rl;return rl=null,e}function Gd(e){if(e===Kl||e===ei)throw Error(r(483))}var Jl=null,Ga=0;function ni(e){var t=Ga;return Ga+=1,Jl===null&&(Jl=[]),Ld(Jl,e,t)}function Xa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function li(e,t){throw t.$$typeof===j?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Xd(e){function t(E,w){if(e){var _=E.deletions;_===null?(E.deletions=[w],E.flags|=16):_.push(w)}}function n(E,w){if(!e)return null;for(;w!==null;)t(E,w),w=w.sibling;return null}function a(E){for(var w=new Map;E!==null;)E.key!==null?w.set(E.key,E):w.set(E.index,E),E=E.sibling;return w}function c(E,w){return E=an(E,w),E.index=0,E.sibling=null,E}function o(E,w,_){return E.index=_,e?(_=E.alternate,_!==null?(_=_.index,_<w?(E.flags|=67108866,w):_):(E.flags|=67108866,w)):(E.flags|=1048576,w)}function m(E){return e&&E.alternate===null&&(E.flags|=67108866),E}function b(E,w,_,$){return w===null||w.tag!==6?(w=Pu(_,E.mode,$),w.return=E,w):(w=c(w,_),w.return=E,w)}function S(E,w,_,$){var se=_.type;return se===G?U(E,w,_.props.children,$,_.key):w!==null&&(w.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===Y&&cl(se)===w.type)?(w=c(w,_.props),Xa(w,_),w.return=E,w):(w=Js(_.type,_.key,_.props,null,E.mode,$),Xa(w,_),w.return=E,w)}function A(E,w,_,$){return w===null||w.tag!==4||w.stateNode.containerInfo!==_.containerInfo||w.stateNode.implementation!==_.implementation?(w=ec(_,E.mode,$),w.return=E,w):(w=c(w,_.children||[]),w.return=E,w)}function U(E,w,_,$,se){return w===null||w.tag!==7?(w=ll(_,E.mode,$,se),w.return=E,w):(w=c(w,_),w.return=E,w)}function H(E,w,_){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Pu(""+w,E.mode,_),w.return=E,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case M:return _=Js(w.type,w.key,w.props,null,E.mode,_),Xa(_,w),_.return=E,_;case k:return w=ec(w,E.mode,_),w.return=E,w;case Y:return w=cl(w),H(E,w,_)}if(Z(w)||ae(w))return w=ll(w,E.mode,_,null),w.return=E,w;if(typeof w.then=="function")return H(E,ni(w),_);if(w.$$typeof===z)return H(E,Is(E,w),_);li(E,w)}return null}function C(E,w,_,$){var se=w!==null?w.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return se!==null?null:b(E,w,""+_,$);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case M:return _.key===se?S(E,w,_,$):null;case k:return _.key===se?A(E,w,_,$):null;case Y:return _=cl(_),C(E,w,_,$)}if(Z(_)||ae(_))return se!==null?null:U(E,w,_,$,null);if(typeof _.then=="function")return C(E,w,ni(_),$);if(_.$$typeof===z)return C(E,w,Is(E,_),$);li(E,_)}return null}function D(E,w,_,$,se){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return E=E.get(_)||null,b(w,E,""+$,se);if(typeof $=="object"&&$!==null){switch($.$$typeof){case M:return E=E.get($.key===null?_:$.key)||null,S(w,E,$,se);case k:return E=E.get($.key===null?_:$.key)||null,A(w,E,$,se);case Y:return $=cl($),D(E,w,_,$,se)}if(Z($)||ae($))return E=E.get(_)||null,U(w,E,$,se,null);if(typeof $.then=="function")return D(E,w,_,ni($),se);if($.$$typeof===z)return D(E,w,_,Is(w,$),se);li(w,$)}return null}function F(E,w,_,$){for(var se=null,Me=null,ne=w,ve=w=0,Se=null;ne!==null&&ve<_.length;ve++){ne.index>ve?(Se=ne,ne=null):Se=ne.sibling;var Ee=C(E,ne,_[ve],$);if(Ee===null){ne===null&&(ne=Se);break}e&&ne&&Ee.alternate===null&&t(E,ne),w=o(Ee,w,ve),Me===null?se=Ee:Me.sibling=Ee,Me=Ee,ne=Se}if(ve===_.length)return n(E,ne),Ne&&sn(E,ve),se;if(ne===null){for(;ve<_.length;ve++)ne=H(E,_[ve],$),ne!==null&&(w=o(ne,w,ve),Me===null?se=ne:Me.sibling=ne,Me=ne);return Ne&&sn(E,ve),se}for(ne=a(ne);ve<_.length;ve++)Se=D(ne,E,ve,_[ve],$),Se!==null&&(e&&Se.alternate!==null&&ne.delete(Se.key===null?ve:Se.key),w=o(Se,w,ve),Me===null?se=Se:Me.sibling=Se,Me=Se);return e&&ne.forEach(function(Qn){return t(E,Qn)}),Ne&&sn(E,ve),se}function re(E,w,_,$){if(_==null)throw Error(r(151));for(var se=null,Me=null,ne=w,ve=w=0,Se=null,Ee=_.next();ne!==null&&!Ee.done;ve++,Ee=_.next()){ne.index>ve?(Se=ne,ne=null):Se=ne.sibling;var Qn=C(E,ne,Ee.value,$);if(Qn===null){ne===null&&(ne=Se);break}e&&ne&&Qn.alternate===null&&t(E,ne),w=o(Qn,w,ve),Me===null?se=Qn:Me.sibling=Qn,Me=Qn,ne=Se}if(Ee.done)return n(E,ne),Ne&&sn(E,ve),se;if(ne===null){for(;!Ee.done;ve++,Ee=_.next())Ee=H(E,Ee.value,$),Ee!==null&&(w=o(Ee,w,ve),Me===null?se=Ee:Me.sibling=Ee,Me=Ee);return Ne&&sn(E,ve),se}for(ne=a(ne);!Ee.done;ve++,Ee=_.next())Ee=D(ne,E,ve,Ee.value,$),Ee!==null&&(e&&Ee.alternate!==null&&ne.delete(Ee.key===null?ve:Ee.key),w=o(Ee,w,ve),Me===null?se=Ee:Me.sibling=Ee,Me=Ee);return e&&ne.forEach(function(ly){return t(E,ly)}),Ne&&sn(E,ve),se}function Ue(E,w,_,$){if(typeof _=="object"&&_!==null&&_.type===G&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case M:e:{for(var se=_.key;w!==null;){if(w.key===se){if(se=_.type,se===G){if(w.tag===7){n(E,w.sibling),$=c(w,_.props.children),$.return=E,E=$;break e}}else if(w.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===Y&&cl(se)===w.type){n(E,w.sibling),$=c(w,_.props),Xa($,_),$.return=E,E=$;break e}n(E,w);break}else t(E,w);w=w.sibling}_.type===G?($=ll(_.props.children,E.mode,$,_.key),$.return=E,E=$):($=Js(_.type,_.key,_.props,null,E.mode,$),Xa($,_),$.return=E,E=$)}return m(E);case k:e:{for(se=_.key;w!==null;){if(w.key===se)if(w.tag===4&&w.stateNode.containerInfo===_.containerInfo&&w.stateNode.implementation===_.implementation){n(E,w.sibling),$=c(w,_.children||[]),$.return=E,E=$;break e}else{n(E,w);break}else t(E,w);w=w.sibling}$=ec(_,E.mode,$),$.return=E,E=$}return m(E);case Y:return _=cl(_),Ue(E,w,_,$)}if(Z(_))return F(E,w,_,$);if(ae(_)){if(se=ae(_),typeof se!="function")throw Error(r(150));return _=se.call(_),re(E,w,_,$)}if(typeof _.then=="function")return Ue(E,w,ni(_),$);if(_.$$typeof===z)return Ue(E,w,Is(E,_),$);li(E,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,w!==null&&w.tag===6?(n(E,w.sibling),$=c(w,_),$.return=E,E=$):(n(E,w),$=Pu(_,E.mode,$),$.return=E,E=$),m(E)):n(E,w)}return function(E,w,_,$){try{Ga=0;var se=Ue(E,w,_,$);return Jl=null,se}catch(ne){if(ne===Kl||ne===ei)throw ne;var Me=wt(29,ne,null,E.mode);return Me.lanes=$,Me.return=E,Me}finally{}}}var ol=Xd(!0),Qd=Xd(!1),An=!1;function fc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Tn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zn(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ae&2)!==0){var c=a.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),a.pending=t,t=Ks(e),Ad(e,null,n),t}return Vs(e,a,t,n),Ks(e)}function Qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,ko(e,n)}}function mc(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var c=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?c=o=m:o=o.next=m,n=n.next}while(n!==null);o===null?c=o=t:o=o.next=t}else c=o=t;n={baseState:a.baseState,firstBaseUpdate:c,lastBaseUpdate:o,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var pc=!1;function Za(){if(pc){var e=Vl;if(e!==null)throw e}}function Va(e,t,n,a){pc=!1;var c=e.updateQueue;An=!1;var o=c.firstBaseUpdate,m=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var S=b,A=S.next;S.next=null,m===null?o=A:m.next=A,m=S;var U=e.alternate;U!==null&&(U=U.updateQueue,b=U.lastBaseUpdate,b!==m&&(b===null?U.firstBaseUpdate=A:b.next=A,U.lastBaseUpdate=S))}if(o!==null){var H=c.baseState;m=0,U=A=S=null,b=o;do{var C=b.lane&-536870913,D=C!==b.lane;if(D?(je&C)===C:(a&C)===C){C!==0&&C===Zl&&(pc=!0),U!==null&&(U=U.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var F=e,re=b;C=t;var Ue=n;switch(re.tag){case 1:if(F=re.payload,typeof F=="function"){H=F.call(Ue,H,C);break e}H=F;break e;case 3:F.flags=F.flags&-65537|128;case 0:if(F=re.payload,C=typeof F=="function"?F.call(Ue,H,C):F,C==null)break e;H=g({},H,C);break e;case 2:An=!0}}C=b.callback,C!==null&&(e.flags|=64,D&&(e.flags|=8192),D=c.callbacks,D===null?c.callbacks=[C]:D.push(C))}else D={lane:C,tag:b.tag,payload:b.payload,callback:b.callback,next:null},U===null?(A=U=D,S=H):U=U.next=D,m|=C;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;D=b,b=D.next,D.next=null,c.lastBaseUpdate=D,c.shared.pending=null}}while(!0);U===null&&(S=H),c.baseState=S,c.firstBaseUpdate=A,c.lastBaseUpdate=U,o===null&&(c.shared.lanes=0),Un|=m,e.lanes=m,e.memoizedState=H}}function Zd(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function Vd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Zd(n[e],t)}var Wl=N(null),ai=N(0);function Kd(e,t){e=xn,J(ai,e),J(Wl,t),xn=e|t.baseLanes}function vc(){J(ai,xn),J(Wl,Wl.current)}function xc(){xn=ai.current,B(Wl),B(ai)}var Mt=N(null),$t=null;function Cn(e){var t=e.alternate;J(Ze,Ze.current&1),J(Mt,e),$t===null&&(t===null||Wl.current!==null||t.memoizedState!==null)&&($t=e)}function yc(e){J(Ze,Ze.current),J(Mt,e),$t===null&&($t=e)}function Jd(e){e.tag===22?(J(Ze,Ze.current),J(Mt,e),$t===null&&($t=e)):On()}function On(){J(Ze,Ze.current),J(Mt,Mt.current)}function Et(e){B(Mt),$t===e&&($t=null),B(Ze)}var Ze=N(0);function si(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||wr(n)||Mr(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rn=0,pe=null,De=null,Je=null,ii=!1,Fl=!1,dl=!1,ui=0,Ka=0,Il=null,Vx=0;function Ge(){throw Error(r(321))}function gc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Nt(e[n],t[n]))return!1;return!0}function bc(e,t,n,a,c,o){return rn=o,pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Df:Uc,dl=!1,o=n(a,c),dl=!1,Fl&&(o=Fd(t,n,a,c)),Wd(e),o}function Wd(e){O.H=Fa;var t=De!==null&&De.next!==null;if(rn=0,Je=De=pe=null,ii=!1,Ka=0,Il=null,t)throw Error(r(300));e===null||We||(e=e.dependencies,e!==null&&Fs(e)&&(We=!0))}function Fd(e,t,n,a){pe=e;var c=0;do{if(Fl&&(Il=null),Ka=0,Fl=!1,25<=c)throw Error(r(301));if(c+=1,Je=De=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=Rf,o=t(n,a)}while(Fl);return o}function Kx(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?Ja(t):t,e=e.useState()[0],(De!==null?De.memoizedState:null)!==e&&(pe.flags|=1024),t}function jc(){var e=ui!==0;return ui=0,e}function Sc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Nc(e){if(ii){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ii=!1}rn=0,Je=De=pe=null,Fl=!1,Ka=ui=0,Il=null}function dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?pe.memoizedState=Je=e:Je=Je.next=e,Je}function Ve(){if(De===null){var e=pe.alternate;e=e!==null?e.memoizedState:null}else e=De.next;var t=Je===null?pe.memoizedState:Je.next;if(t!==null)Je=t,De=e;else{if(e===null)throw pe.alternate===null?Error(r(467)):Error(r(310));De=e,e={memoizedState:De.memoizedState,baseState:De.baseState,baseQueue:De.baseQueue,queue:De.queue,next:null},Je===null?pe.memoizedState=Je=e:Je=Je.next=e}return Je}function ci(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ja(e){var t=Ka;return Ka+=1,Il===null&&(Il=[]),e=Ld(Il,e,t),t=pe,(Je===null?t.memoizedState:Je.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Df:Uc),e}function ri(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ja(e);if(e.$$typeof===z)return st(e)}throw Error(r(438,String(e)))}function wc(e){var t=null,n=pe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=pe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ci(),pe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=_e;return t.index++,n}function on(e,t){return typeof t=="function"?t(e):t}function oi(e){var t=Ve();return Mc(t,De,e)}function Mc(e,t,n){var a=e.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=n;var c=e.baseQueue,o=a.pending;if(o!==null){if(c!==null){var m=c.next;c.next=o.next,o.next=m}t.baseQueue=c=o,a.pending=null}if(o=e.baseState,c===null)e.memoizedState=o;else{t=c.next;var b=m=null,S=null,A=t,U=!1;do{var H=A.lane&-536870913;if(H!==A.lane?(je&H)===H:(rn&H)===H){var C=A.revertLane;if(C===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),H===Zl&&(U=!0);else if((rn&C)===C){A=A.next,C===Zl&&(U=!0);continue}else H={lane:0,revertLane:A.revertLane,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},S===null?(b=S=H,m=o):S=S.next=H,pe.lanes|=C,Un|=C;H=A.action,dl&&n(o,H),o=A.hasEagerState?A.eagerState:n(o,H)}else C={lane:H,revertLane:A.revertLane,gesture:A.gesture,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},S===null?(b=S=C,m=o):S=S.next=C,pe.lanes|=H,Un|=H;A=A.next}while(A!==null&&A!==t);if(S===null?m=o:S.next=b,!Nt(o,e.memoizedState)&&(We=!0,U&&(n=Vl,n!==null)))throw n;e.memoizedState=o,e.baseState=m,e.baseQueue=S,a.lastRenderedState=o}return c===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ec(e){var t=Ve(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var a=n.dispatch,c=n.pending,o=t.memoizedState;if(c!==null){n.pending=null;var m=c=c.next;do o=e(o,m.action),m=m.next;while(m!==c);Nt(o,t.memoizedState)||(We=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,a]}function Id(e,t,n){var a=pe,c=Ve(),o=Ne;if(o){if(n===void 0)throw Error(r(407));n=n()}else n=t();var m=!Nt((De||c).memoizedState,n);if(m&&(c.memoizedState=n,We=!0),c=c.queue,Tc(tf.bind(null,a,c,e),[e]),c.getSnapshot!==t||m||Je!==null&&Je.memoizedState.tag&1){if(a.flags|=2048,Pl(9,{destroy:void 0},ef.bind(null,a,c,n,t),null),ke===null)throw Error(r(349));o||(rn&127)!==0||Pd(a,t,n)}return n}function Pd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=pe.updateQueue,t===null?(t=ci(),pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ef(e,t,n,a){t.value=n,t.getSnapshot=a,nf(t)&&lf(e)}function tf(e,t,n){return n(function(){nf(t)&&lf(e)})}function nf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nt(e,n)}catch{return!0}}function lf(e){var t=nl(e,2);t!==null&&yt(t,e,2)}function _c(e){var t=dt();if(typeof e=="function"){var n=e;if(e=n(),dl){jn(!0);try{n()}finally{jn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:e},t}function af(e,t,n,a){return e.baseState=n,Mc(e,De,typeof a=="function"?a:on)}function Jx(e,t,n,a,c){if(hi(e))throw Error(r(485));if(e=t.action,e!==null){var o={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){o.listeners.push(m)}};O.T!==null?n(!0):o.isTransition=!1,a(o),n=t.pending,n===null?(o.next=t.pending=o,sf(t,o)):(o.next=n.next,t.pending=n.next=o)}}function sf(e,t){var n=t.action,a=t.payload,c=e.state;if(t.isTransition){var o=O.T,m={};O.T=m;try{var b=n(c,a),S=O.S;S!==null&&S(m,b),uf(e,t,b)}catch(A){Ac(e,t,A)}finally{o!==null&&m.types!==null&&(o.types=m.types),O.T=o}}else try{o=n(c,a),uf(e,t,o)}catch(A){Ac(e,t,A)}}function uf(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){cf(e,t,a)},function(a){return Ac(e,t,a)}):cf(e,t,n)}function cf(e,t,n){t.status="fulfilled",t.value=n,rf(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,sf(e,n)))}function Ac(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,rf(t),t=t.next;while(t!==a)}e.action=null}function rf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function of(e,t){return t}function df(e,t){if(Ne){var n=ke.formState;if(n!==null){e:{var a=pe;if(Ne){if(He){t:{for(var c=He,o=kt;c.nodeType!==8;){if(!o){c=null;break t}if(c=Ht(c.nextSibling),c===null){c=null;break t}}o=c.data,c=o==="F!"||o==="F"?c:null}if(c){He=Ht(c.nextSibling),a=c.data==="F!";break e}}En(a)}a=!1}a&&(t=n[0])}}return n=dt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:of,lastRenderedState:t},n.queue=a,n=zf.bind(null,pe,a),a.dispatch=n,a=_c(!1),o=Rc.bind(null,pe,!1,a.queue),a=dt(),c={state:t,dispatch:null,action:e,pending:null},a.queue=c,n=Jx.bind(null,pe,c,o,n),c.dispatch=n,a.memoizedState=e,[t,n,!1]}function ff(e){var t=Ve();return hf(t,De,e)}function hf(e,t,n){if(t=Mc(e,t,of)[0],e=oi(on)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Ja(t)}catch(m){throw m===Kl?ei:m}else a=t;t=Ve();var c=t.queue,o=c.dispatch;return n!==t.memoizedState&&(pe.flags|=2048,Pl(9,{destroy:void 0},Wx.bind(null,c,n),null)),[a,o,e]}function Wx(e,t){e.action=t}function mf(e){var t=Ve(),n=De;if(n!==null)return hf(t,n,e);Ve(),t=t.memoizedState,n=Ve();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Pl(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=pe.updateQueue,t===null&&(t=ci(),pe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function pf(){return Ve().memoizedState}function di(e,t,n,a){var c=dt();pe.flags|=e,c.memoizedState=Pl(1|t,{destroy:void 0},n,a===void 0?null:a)}function fi(e,t,n,a){var c=Ve();a=a===void 0?null:a;var o=c.memoizedState.inst;De!==null&&a!==null&&gc(a,De.memoizedState.deps)?c.memoizedState=Pl(t,o,n,a):(pe.flags|=e,c.memoizedState=Pl(1|t,o,n,a))}function vf(e,t){di(8390656,8,e,t)}function Tc(e,t){fi(2048,8,e,t)}function Fx(e){pe.flags|=4;var t=pe.updateQueue;if(t===null)t=ci(),pe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function xf(e){var t=Ve().memoizedState;return Fx({ref:t,nextImpl:e}),function(){if((Ae&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function yf(e,t){return fi(4,2,e,t)}function gf(e,t){return fi(4,4,e,t)}function bf(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jf(e,t,n){n=n!=null?n.concat([e]):null,fi(4,4,bf.bind(null,t,e),n)}function zc(){}function Sf(e,t){var n=Ve();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&gc(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Nf(e,t){var n=Ve();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&gc(t,a[1]))return a[0];if(a=e(),dl){jn(!0);try{e()}finally{jn(!1)}}return n.memoizedState=[a,t],a}function Cc(e,t,n){return n===void 0||(rn&1073741824)!==0&&(je&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=wh(),pe.lanes|=e,Un|=e,n)}function wf(e,t,n,a){return Nt(n,t)?n:Wl.current!==null?(e=Cc(e,n,a),Nt(e,t)||(We=!0),e):(rn&42)===0||(rn&1073741824)!==0&&(je&261930)===0?(We=!0,e.memoizedState=n):(e=wh(),pe.lanes|=e,Un|=e,t)}function Mf(e,t,n,a,c){var o=Q.p;Q.p=o!==0&&8>o?o:8;var m=O.T,b={};O.T=b,Rc(e,!1,t,n);try{var S=c(),A=O.S;if(A!==null&&A(b,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var U=Zx(S,a);Wa(e,t,U,Tt(e))}else Wa(e,t,a,Tt(e))}catch(H){Wa(e,t,{then:function(){},status:"rejected",reason:H},Tt())}finally{Q.p=o,m!==null&&b.types!==null&&(m.types=b.types),O.T=m}}function Ix(){}function Oc(e,t,n,a){if(e.tag!==5)throw Error(r(476));var c=Ef(e).queue;Mf(e,c,t,P,n===null?Ix:function(){return _f(e),n(a)})}function Ef(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function _f(e){var t=Ef(e);t.next===null&&(t=e.alternate.memoizedState),Wa(e,t.next.queue,{},Tt())}function Dc(){return st(hs)}function Af(){return Ve().memoizedState}function Tf(){return Ve().memoizedState}function Px(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=Tn(n);var a=zn(t,e,n);a!==null&&(yt(a,t,n),Qa(a,t,n)),t={cache:cc()},e.payload=t;return}t=t.return}}function e0(e,t,n){var a=Tt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},hi(e)?Cf(t,n):(n=Fu(e,t,n,a),n!==null&&(yt(n,e,a),Of(n,t,a)))}function zf(e,t,n){var a=Tt();Wa(e,t,n,a)}function Wa(e,t,n,a){var c={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(hi(e))Cf(t,c);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var m=t.lastRenderedState,b=o(m,n);if(c.hasEagerState=!0,c.eagerState=b,Nt(b,m))return Vs(e,t,c,0),ke===null&&Zs(),!1}catch{}finally{}if(n=Fu(e,t,c,a),n!==null)return yt(n,e,a),Of(n,t,a),!0}return!1}function Rc(e,t,n,a){if(a={lane:2,revertLane:fr(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},hi(e)){if(t)throw Error(r(479))}else t=Fu(e,n,a,2),t!==null&&yt(t,e,2)}function hi(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function Cf(e,t){Fl=ii=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Of(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,ko(e,n)}}var Fa={readContext:st,use:ri,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useLayoutEffect:Ge,useInsertionEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useSyncExternalStore:Ge,useId:Ge,useHostTransitionStatus:Ge,useFormState:Ge,useActionState:Ge,useOptimistic:Ge,useMemoCache:Ge,useCacheRefresh:Ge};Fa.useEffectEvent=Ge;var Df={readContext:st,use:ri,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:st,useEffect:vf,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,di(4194308,4,bf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return di(4194308,4,e,t)},useInsertionEffect:function(e,t){di(4,2,e,t)},useMemo:function(e,t){var n=dt();t=t===void 0?null:t;var a=e();if(dl){jn(!0);try{e()}finally{jn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=dt();if(n!==void 0){var c=n(t);if(dl){jn(!0);try{n(t)}finally{jn(!1)}}}else c=t;return a.memoizedState=a.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},a.queue=e,e=e.dispatch=e0.bind(null,pe,e),[a.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:function(e){e=_c(e);var t=e.queue,n=zf.bind(null,pe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:zc,useDeferredValue:function(e,t){var n=dt();return Cc(n,e,t)},useTransition:function(){var e=_c(!1);return e=Mf.bind(null,pe,e.queue,!0,!1),dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=pe,c=dt();if(Ne){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),ke===null)throw Error(r(349));(je&127)!==0||Pd(a,t,n)}c.memoizedState=n;var o={value:n,getSnapshot:t};return c.queue=o,vf(tf.bind(null,a,o,e),[e]),a.flags|=2048,Pl(9,{destroy:void 0},ef.bind(null,a,o,n,t),null),n},useId:function(){var e=dt(),t=ke.identifierPrefix;if(Ne){var n=Vt,a=Zt;n=(a&~(1<<32-St(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ui++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Vx++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Dc,useFormState:df,useActionState:df,useOptimistic:function(e){var t=dt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Rc.bind(null,pe,!0,n),n.dispatch=t,[e,t]},useMemoCache:wc,useCacheRefresh:function(){return dt().memoizedState=Px.bind(null,pe)},useEffectEvent:function(e){var t=dt(),n={impl:e};return t.memoizedState=n,function(){if((Ae&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},Uc={readContext:st,use:ri,useCallback:Sf,useContext:st,useEffect:Tc,useImperativeHandle:jf,useInsertionEffect:yf,useLayoutEffect:gf,useMemo:Nf,useReducer:oi,useRef:pf,useState:function(){return oi(on)},useDebugValue:zc,useDeferredValue:function(e,t){var n=Ve();return wf(n,De.memoizedState,e,t)},useTransition:function(){var e=oi(on)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Ja(e),t]},useSyncExternalStore:Id,useId:Af,useHostTransitionStatus:Dc,useFormState:ff,useActionState:ff,useOptimistic:function(e,t){var n=Ve();return af(n,De,e,t)},useMemoCache:wc,useCacheRefresh:Tf};Uc.useEffectEvent=xf;var Rf={readContext:st,use:ri,useCallback:Sf,useContext:st,useEffect:Tc,useImperativeHandle:jf,useInsertionEffect:yf,useLayoutEffect:gf,useMemo:Nf,useReducer:Ec,useRef:pf,useState:function(){return Ec(on)},useDebugValue:zc,useDeferredValue:function(e,t){var n=Ve();return De===null?Cc(n,e,t):wf(n,De.memoizedState,e,t)},useTransition:function(){var e=Ec(on)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Ja(e),t]},useSyncExternalStore:Id,useId:Af,useHostTransitionStatus:Dc,useFormState:mf,useActionState:mf,useOptimistic:function(e,t){var n=Ve();return De!==null?af(n,De,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:wc,useCacheRefresh:Tf};Rf.useEffectEvent=xf;function kc(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:g({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $c={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Tt(),c=Tn(a);c.payload=t,n!=null&&(c.callback=n),t=zn(e,c,a),t!==null&&(yt(t,e,a),Qa(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Tt(),c=Tn(a);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=zn(e,c,a),t!==null&&(yt(t,e,a),Qa(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),a=Tn(n);a.tag=2,t!=null&&(a.callback=t),t=zn(e,a,n),t!==null&&(yt(t,e,n),Qa(t,e,n))}};function Uf(e,t,n,a,c,o,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,o,m):t.prototype&&t.prototype.isPureReactComponent?!$a(n,a)||!$a(c,o):!0}function kf(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&$c.enqueueReplaceState(t,t.state,null)}function fl(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=g({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function $f(e){Qs(e)}function Hf(e){console.error(e)}function qf(e){Qs(e)}function mi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Bf(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Hc(e,t,n){return n=Tn(n),n.tag=3,n.payload={element:null},n.callback=function(){mi(e,t)},n}function Lf(e){return e=Tn(e),e.tag=3,e}function Yf(e,t,n,a){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var o=a.value;e.payload=function(){return c(o)},e.callback=function(){Bf(t,n,a)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){Bf(t,n,a),typeof c!="function"&&(kn===null?kn=new Set([this]):kn.add(this));var b=a.stack;this.componentDidCatch(a.value,{componentStack:b!==null?b:""})})}function t0(e,t,n,a,c){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Ql(t,n,c,!0),n=Mt.current,n!==null){switch(n.tag){case 31:case 13:return $t===null?Ei():n.alternate===null&&Xe===0&&(Xe=3),n.flags&=-257,n.flags|=65536,n.lanes=c,a===ti?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),rr(e,a,c)),!1;case 22:return n.flags|=65536,a===ti?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),rr(e,a,c)),!1}throw Error(r(435,n.tag))}return rr(e,a,c),Ei(),!1}if(Ne)return t=Mt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,a!==lc&&(e=Error(r(422),{cause:a}),Ba(Dt(e,n)))):(a!==lc&&(t=Error(r(423),{cause:a}),Ba(Dt(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,a=Dt(a,n),c=Hc(e.stateNode,a,c),mc(e,c),Xe!==4&&(Xe=2)),!1;var o=Error(r(520),{cause:a});if(o=Dt(o,n),ss===null?ss=[o]:ss.push(o),Xe!==4&&(Xe=2),t===null)return!0;a=Dt(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=Hc(n.stateNode,a,e),mc(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(kn===null||!kn.has(o))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Lf(c),Yf(c,e,n,a),mc(n,c),!1}n=n.return}while(n!==null);return!1}var qc=Error(r(461)),We=!1;function it(e,t,n,a){t.child=e===null?Qd(t,null,n,a):ol(t,e.child,n,a)}function Gf(e,t,n,a,c){n=n.render;var o=t.ref;if("ref"in a){var m={};for(var b in a)b!=="ref"&&(m[b]=a[b])}else m=a;return il(t),a=bc(e,t,n,m,o,c),b=jc(),e!==null&&!We?(Sc(e,t,c),dn(e,t,c)):(Ne&&b&&tc(t),t.flags|=1,it(e,t,a,c),t.child)}function Xf(e,t,n,a,c){if(e===null){var o=n.type;return typeof o=="function"&&!Iu(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,Qf(e,t,o,a,c)):(e=Js(n.type,null,a,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Vc(e,c)){var m=o.memoizedProps;if(n=n.compare,n=n!==null?n:$a,n(m,a)&&e.ref===t.ref)return dn(e,t,c)}return t.flags|=1,e=an(o,a),e.ref=t.ref,e.return=t,t.child=e}function Qf(e,t,n,a,c){if(e!==null){var o=e.memoizedProps;if($a(o,a)&&e.ref===t.ref)if(We=!1,t.pendingProps=a=o,Vc(e,c))(e.flags&131072)!==0&&(We=!0);else return t.lanes=e.lanes,dn(e,t,c)}return Bc(e,t,n,a,c)}function Zf(e,t,n,a){var c=a.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(a=t.child=e.child,c=0;a!==null;)c=c|a.lanes|a.childLanes,a=a.sibling;a=c&~o}else a=0,t.child=null;return Vf(e,t,o,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ps(t,o!==null?o.cachePool:null),o!==null?Kd(t,o):vc(),Jd(t);else return a=t.lanes=536870912,Vf(e,t,o!==null?o.baseLanes|n:n,n,a)}else o!==null?(Ps(t,o.cachePool),Kd(t,o),On(),t.memoizedState=null):(e!==null&&Ps(t,null),vc(),On());return it(e,t,c,n),t.child}function Ia(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vf(e,t,n,a,c){var o=oc();return o=o===null?null:{parent:Ke._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&Ps(t,null),vc(),Jd(t),e!==null&&Ql(e,t,a,!0),t.childLanes=c,null}function pi(e,t){return t=xi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Kf(e,t,n){return ol(t,e.child,null,n),e=pi(t,t.pendingProps),e.flags|=2,Et(t),t.memoizedState=null,e}function n0(e,t,n){var a=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ne){if(a.mode==="hidden")return e=pi(t,a),t.lanes=536870912,Ia(null,e);if(yc(t),(e=He)?(e=im(e,kt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wn!==null?{id:Zt,overflow:Vt}:null,retryLane:536870912,hydrationErrors:null},n=zd(e),n.return=t,t.child=n,at=t,He=null)):e=null,e===null)throw En(t);return t.lanes=536870912,null}return pi(t,a)}var o=e.memoizedState;if(o!==null){var m=o.dehydrated;if(yc(t),c)if(t.flags&256)t.flags&=-257,t=Kf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(We||Ql(e,t,n,!1),c=(n&e.childLanes)!==0,We||c){if(a=ke,a!==null&&(m=$o(a,n),m!==0&&m!==o.retryLane))throw o.retryLane=m,nl(e,m),yt(a,e,m),qc;Ei(),t=Kf(e,t,n)}else e=o.treeContext,He=Ht(m.nextSibling),at=t,Ne=!0,Mn=null,kt=!1,e!==null&&Dd(t,e),t=pi(t,a),t.flags|=4096;return t}return e=an(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function vi(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,a,c){return il(t),n=bc(e,t,n,a,void 0,c),a=jc(),e!==null&&!We?(Sc(e,t,c),dn(e,t,c)):(Ne&&a&&tc(t),t.flags|=1,it(e,t,n,c),t.child)}function Jf(e,t,n,a,c,o){return il(t),t.updateQueue=null,n=Fd(t,a,n,c),Wd(e),a=jc(),e!==null&&!We?(Sc(e,t,o),dn(e,t,o)):(Ne&&a&&tc(t),t.flags|=1,it(e,t,n,o),t.child)}function Wf(e,t,n,a,c){if(il(t),t.stateNode===null){var o=Ll,m=n.contextType;typeof m=="object"&&m!==null&&(o=st(m)),o=new n(a,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=$c,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=a,o.state=t.memoizedState,o.refs={},fc(t),m=n.contextType,o.context=typeof m=="object"&&m!==null?st(m):Ll,o.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(kc(t,n,m,a),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(m=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),m!==o.state&&$c.enqueueReplaceState(o,o.state,null),Va(t,a,o,c),Za(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){o=t.stateNode;var b=t.memoizedProps,S=fl(n,b);o.props=S;var A=o.context,U=n.contextType;m=Ll,typeof U=="object"&&U!==null&&(m=st(U));var H=n.getDerivedStateFromProps;U=typeof H=="function"||typeof o.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,U||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(b||A!==m)&&kf(t,o,a,m),An=!1;var C=t.memoizedState;o.state=C,Va(t,a,o,c),Za(),A=t.memoizedState,b||C!==A||An?(typeof H=="function"&&(kc(t,n,H,a),A=t.memoizedState),(S=An||Uf(t,n,S,a,C,A,m))?(U||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=A),o.props=a,o.state=A,o.context=m,a=S):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{o=t.stateNode,hc(e,t),m=t.memoizedProps,U=fl(n,m),o.props=U,H=t.pendingProps,C=o.context,A=n.contextType,S=Ll,typeof A=="object"&&A!==null&&(S=st(A)),b=n.getDerivedStateFromProps,(A=typeof b=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(m!==H||C!==S)&&kf(t,o,a,S),An=!1,C=t.memoizedState,o.state=C,Va(t,a,o,c),Za();var D=t.memoizedState;m!==H||C!==D||An||e!==null&&e.dependencies!==null&&Fs(e.dependencies)?(typeof b=="function"&&(kc(t,n,b,a),D=t.memoizedState),(U=An||Uf(t,n,U,a,C,D,S)||e!==null&&e.dependencies!==null&&Fs(e.dependencies))?(A||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(a,D,S),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(a,D,S)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&C===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&C===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=D),o.props=a,o.state=D,o.context=S,a=U):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&C===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&C===e.memoizedState||(t.flags|=1024),a=!1)}return o=a,vi(e,t),a=(t.flags&128)!==0,o||a?(o=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&a?(t.child=ol(t,e.child,null,c),t.child=ol(t,null,n,c)):it(e,t,n,c),t.memoizedState=o.state,e=t.child):e=dn(e,t,c),e}function Ff(e,t,n,a){return al(),t.flags|=256,it(e,t,n,a),t.child}var Lc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yc(e){return{baseLanes:e,cachePool:qd()}}function Gc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=At),e}function If(e,t,n){var a=t.pendingProps,c=!1,o=(t.flags&128)!==0,m;if((m=o)||(m=e!==null&&e.memoizedState===null?!1:(Ze.current&2)!==0),m&&(c=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(c?Cn(t):On(),(e=He)?(e=im(e,kt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wn!==null?{id:Zt,overflow:Vt}:null,retryLane:536870912,hydrationErrors:null},n=zd(e),n.return=t,t.child=n,at=t,He=null)):e=null,e===null)throw En(t);return Mr(e)?t.lanes=32:t.lanes=536870912,null}var b=a.children;return a=a.fallback,c?(On(),c=t.mode,b=xi({mode:"hidden",children:b},c),a=ll(a,c,n,null),b.return=t,a.return=t,b.sibling=a,t.child=b,a=t.child,a.memoizedState=Yc(n),a.childLanes=Gc(e,m,n),t.memoizedState=Lc,Ia(null,a)):(Cn(t),Xc(t,b))}var S=e.memoizedState;if(S!==null&&(b=S.dehydrated,b!==null)){if(o)t.flags&256?(Cn(t),t.flags&=-257,t=Qc(e,t,n)):t.memoizedState!==null?(On(),t.child=e.child,t.flags|=128,t=null):(On(),b=a.fallback,c=t.mode,a=xi({mode:"visible",children:a.children},c),b=ll(b,c,n,null),b.flags|=2,a.return=t,b.return=t,a.sibling=b,t.child=a,ol(t,e.child,null,n),a=t.child,a.memoizedState=Yc(n),a.childLanes=Gc(e,m,n),t.memoizedState=Lc,t=Ia(null,a));else if(Cn(t),Mr(b)){if(m=b.nextSibling&&b.nextSibling.dataset,m)var A=m.dgst;m=A,a=Error(r(419)),a.stack="",a.digest=m,Ba({value:a,source:null,stack:null}),t=Qc(e,t,n)}else if(We||Ql(e,t,n,!1),m=(n&e.childLanes)!==0,We||m){if(m=ke,m!==null&&(a=$o(m,n),a!==0&&a!==S.retryLane))throw S.retryLane=a,nl(e,a),yt(m,e,a),qc;wr(b)||Ei(),t=Qc(e,t,n)}else wr(b)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,He=Ht(b.nextSibling),at=t,Ne=!0,Mn=null,kt=!1,e!==null&&Dd(t,e),t=Xc(t,a.children),t.flags|=4096);return t}return c?(On(),b=a.fallback,c=t.mode,S=e.child,A=S.sibling,a=an(S,{mode:"hidden",children:a.children}),a.subtreeFlags=S.subtreeFlags&65011712,A!==null?b=an(A,b):(b=ll(b,c,n,null),b.flags|=2),b.return=t,a.return=t,a.sibling=b,t.child=a,Ia(null,a),a=t.child,b=e.child.memoizedState,b===null?b=Yc(n):(c=b.cachePool,c!==null?(S=Ke._currentValue,c=c.parent!==S?{parent:S,pool:S}:c):c=qd(),b={baseLanes:b.baseLanes|n,cachePool:c}),a.memoizedState=b,a.childLanes=Gc(e,m,n),t.memoizedState=Lc,Ia(e.child,a)):(Cn(t),n=e.child,e=n.sibling,n=an(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function Xc(e,t){return t=xi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function xi(e,t){return e=wt(22,e,null,t),e.lanes=0,e}function Qc(e,t,n){return ol(t,e.child,null,n),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pf(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ic(e.return,t,n)}function Zc(e,t,n,a,c,o){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:c,treeForkCount:o}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=a,m.tail=n,m.tailMode=c,m.treeForkCount=o)}function eh(e,t,n){var a=t.pendingProps,c=a.revealOrder,o=a.tail;a=a.children;var m=Ze.current,b=(m&2)!==0;if(b?(m=m&1|2,t.flags|=128):m&=1,J(Ze,m),it(e,t,a,n),a=Ne?qa:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pf(e,n,t);else if(e.tag===19)Pf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&si(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),Zc(t,!1,c,n,o,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&si(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}Zc(t,!0,n,null,o,a);break;case"together":Zc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Un|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ql(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=an(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=an(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Vc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fs(e)))}function l0(e,t,n){switch(t.tag){case 3:ot(t,t.stateNode.containerInfo),_n(t,Ke,e.memoizedState.cache),al();break;case 27:case 5:wa(t);break;case 4:ot(t,t.stateNode.containerInfo);break;case 10:_n(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Cn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?If(e,t,n):(Cn(t),e=dn(e,t,n),e!==null?e.sibling:null);Cn(t);break;case 19:var c=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Ql(e,t,n,!1),a=(n&t.childLanes)!==0),c){if(a)return eh(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),J(Ze,Ze.current),a)break;return null;case 22:return t.lanes=0,Zf(e,t,n,t.pendingProps);case 24:_n(t,Ke,e.memoizedState.cache)}return dn(e,t,n)}function th(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)We=!0;else{if(!Vc(e,n)&&(t.flags&128)===0)return We=!1,l0(e,t,n);We=(e.flags&131072)!==0}else We=!1,Ne&&(t.flags&1048576)!==0&&Od(t,qa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=cl(t.elementType),t.type=e,typeof e=="function")Iu(e)?(a=fl(e,a),t.tag=1,t=Wf(null,t,e,a,n)):(t.tag=0,t=Bc(null,t,e,a,n));else{if(e!=null){var c=e.$$typeof;if(c===T){t.tag=11,t=Gf(null,t,e,a,n);break e}else if(c===W){t.tag=14,t=Xf(null,t,e,a,n);break e}}throw t=I(e)||e,Error(r(306,t,""))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,c=fl(a,t.pendingProps),Wf(e,t,a,c,n);case 3:e:{if(ot(t,t.stateNode.containerInfo),e===null)throw Error(r(387));a=t.pendingProps;var o=t.memoizedState;c=o.element,hc(e,t),Va(t,a,null,n);var m=t.memoizedState;if(a=m.cache,_n(t,Ke,a),a!==o.cache&&uc(t,[Ke],n,!0),Za(),a=m.element,o.isDehydrated)if(o={element:a,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Ff(e,t,a,n);break e}else if(a!==c){c=Dt(Error(r(424)),t),Ba(c),t=Ff(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(He=Ht(e.firstChild),at=t,Ne=!0,Mn=null,kt=!0,n=Qd(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(al(),a===c){t=dn(e,t,n);break e}it(e,t,a,n)}t=t.child}return t;case 26:return vi(e,t),e===null?(n=fm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ne||(n=t.type,e=t.pendingProps,a=Di(ye.current).createElement(n),a[lt]=t,a[ft]=e,ut(a,n,e),et(a),t.stateNode=a):t.memoizedState=fm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return wa(t),e===null&&Ne&&(a=t.stateNode=rm(t.type,t.pendingProps,ye.current),at=t,kt=!0,c=He,Bn(t.type)?(Er=c,He=Ht(a.firstChild)):He=c),it(e,t,t.pendingProps.children,n),vi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((c=a=He)&&(a=D0(a,t.type,t.pendingProps,kt),a!==null?(t.stateNode=a,at=t,He=Ht(a.firstChild),kt=!1,c=!0):c=!1),c||En(t)),wa(t),c=t.type,o=t.pendingProps,m=e!==null?e.memoizedProps:null,a=o.children,jr(c,o)?a=null:m!==null&&jr(c,m)&&(t.flags|=32),t.memoizedState!==null&&(c=bc(e,t,Kx,null,null,n),hs._currentValue=c),vi(e,t),it(e,t,a,n),t.child;case 6:return e===null&&Ne&&((e=n=He)&&(n=R0(n,t.pendingProps,kt),n!==null?(t.stateNode=n,at=t,He=null,e=!0):e=!1),e||En(t)),null;case 13:return If(e,t,n);case 4:return ot(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ol(t,null,a,n):it(e,t,a,n),t.child;case 11:return Gf(e,t,t.type,t.pendingProps,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,_n(t,t.type,a.value),it(e,t,a.children,n),t.child;case 9:return c=t.type._context,a=t.pendingProps.children,il(t),c=st(c),a=a(c),t.flags|=1,it(e,t,a,n),t.child;case 14:return Xf(e,t,t.type,t.pendingProps,n);case 15:return Qf(e,t,t.type,t.pendingProps,n);case 19:return eh(e,t,n);case 31:return n0(e,t,n);case 22:return Zf(e,t,n,t.pendingProps);case 24:return il(t),a=st(Ke),e===null?(c=oc(),c===null&&(c=ke,o=cc(),c.pooledCache=o,o.refCount++,o!==null&&(c.pooledCacheLanes|=n),c=o),t.memoizedState={parent:a,cache:c},fc(t),_n(t,Ke,c)):((e.lanes&n)!==0&&(hc(e,t),Va(t,null,null,n),Za()),c=e.memoizedState,o=t.memoizedState,c.parent!==a?(c={parent:a,cache:a},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),_n(t,Ke,a)):(a=o.cache,_n(t,Ke,a),a!==c.cache&&uc(t,[Ke],n,!0))),it(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function fn(e){e.flags|=4}function Kc(e,t,n,a,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Ah())e.flags|=8192;else throw rl=ti,dc}else e.flags&=-16777217}function nh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!xm(t))if(Ah())e.flags|=8192;else throw rl=ti,dc}function yi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ro():536870912,e.lanes|=t,la|=t)}function Pa(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,a|=c.subtreeFlags&65011712,a|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,a|=c.subtreeFlags,a|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function a0(e,t,n){var a=t.pendingProps;switch(nc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),cn(Ke),Qe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Xl(t)?fn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ac())),qe(t),null;case 26:var c=t.type,o=t.memoizedState;return e===null?(fn(t),o!==null?(qe(t),nh(t,o)):(qe(t),Kc(t,c,null,a,n))):o?o!==e.memoizedState?(fn(t),qe(t),nh(t,o)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&fn(t),qe(t),Kc(t,c,e,a,n)),null;case 27:if(Ts(t),n=ye.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&fn(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return qe(t),null}e=ee.current,Xl(t)?Rd(t):(e=rm(c,a,n),t.stateNode=e,fn(t))}return qe(t),null;case 5:if(Ts(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&fn(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return qe(t),null}if(o=ee.current,Xl(t))Rd(t);else{var m=Di(ye.current);switch(o){case 1:o=m.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:o=m.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":o=m.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":o=m.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":o=m.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof a.is=="string"?m.createElement("select",{is:a.is}):m.createElement("select"),a.multiple?o.multiple=!0:a.size&&(o.size=a.size);break;default:o=typeof a.is=="string"?m.createElement(c,{is:a.is}):m.createElement(c)}}o[lt]=t,o[ft]=a;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=o;e:switch(ut(o,c,a),c){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&fn(t)}}return qe(t),Kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&fn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=ye.current,Xl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,c=at,c!==null)switch(c.tag){case 27:case 5:a=c.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Ih(e.nodeValue,n)),e||En(t,!0)}else e=Di(e).createTextNode(a),e[lt]=t,t.stateNode=e}return qe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Xl(t),n!==null){if(e===null){if(!a)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[lt]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else n=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Et(t),t):(Et(t),null);if((t.flags&128)!==0)throw Error(r(558))}return qe(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Xl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!c)throw Error(r(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));c[lt]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),c=!1}else c=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Et(t),t):(Et(t),null)}return Et(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,c=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(c=a.alternate.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==c&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),yi(t,t.updateQueue),qe(t),null);case 4:return Qe(),e===null&&vr(t.stateNode.containerInfo),qe(t),null;case 10:return cn(t.type),qe(t),null;case 19:if(B(Ze),a=t.memoizedState,a===null)return qe(t),null;if(c=(t.flags&128)!==0,o=a.rendering,o===null)if(c)Pa(a,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=si(e),o!==null){for(t.flags|=128,Pa(a,!1),e=o.updateQueue,t.updateQueue=e,yi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Td(n,e),n=n.sibling;return J(Ze,Ze.current&1|2),Ne&&sn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&bt()>Ni&&(t.flags|=128,c=!0,Pa(a,!1),t.lanes=4194304)}else{if(!c)if(e=si(o),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,yi(t,e),Pa(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Ne)return qe(t),null}else 2*bt()-a.renderingStartTime>Ni&&n!==536870912&&(t.flags|=128,c=!0,Pa(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e!==null?e.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=bt(),e.sibling=null,n=Ze.current,J(Ze,c?n&1|2:n&1),Ne&&sn(t,a.treeForkCount),e):(qe(t),null);case 22:case 23:return Et(t),xc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),n=t.updateQueue,n!==null&&yi(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&B(ul),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),cn(Ke),qe(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function s0(e,t){switch(nc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cn(Ke),Qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ts(t),null;case 31:if(t.memoizedState!==null){if(Et(t),t.alternate===null)throw Error(r(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Et(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(Ze),null;case 4:return Qe(),null;case 10:return cn(t.type),null;case 22:case 23:return Et(t),xc(),e!==null&&B(ul),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return cn(Ke),null;case 25:return null;default:return null}}function lh(e,t){switch(nc(t),t.tag){case 3:cn(Ke),Qe();break;case 26:case 27:case 5:Ts(t);break;case 4:Qe();break;case 31:t.memoizedState!==null&&Et(t);break;case 13:Et(t);break;case 19:B(Ze);break;case 10:cn(t.type);break;case 22:case 23:Et(t),xc(),e!==null&&B(ul);break;case 24:cn(Ke)}}function es(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var c=a.next;n=c;do{if((n.tag&e)===e){a=void 0;var o=n.create,m=n.inst;a=o(),m.destroy=a}n=n.next}while(n!==c)}}catch(b){Oe(t,t.return,b)}}function Dn(e,t,n){try{var a=t.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var o=c.next;a=o;do{if((a.tag&e)===e){var m=a.inst,b=m.destroy;if(b!==void 0){m.destroy=void 0,c=t;var S=n,A=b;try{A()}catch(U){Oe(c,S,U)}}}a=a.next}while(a!==o)}}catch(U){Oe(t,t.return,U)}}function ah(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Vd(t,n)}catch(a){Oe(e,e.return,a)}}}function sh(e,t,n){n.props=fl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Oe(e,t,a)}}function ts(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(c){Oe(e,t,c)}}function Kt(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(c){Oe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){Oe(e,t,c)}else n.current=null}function ih(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(c){Oe(e,e.return,c)}}function Jc(e,t,n){try{var a=e.stateNode;_0(a,e.type,n,t),a[ft]=t}catch(c){Oe(e,e.return,c)}}function uh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Bn(e.type)||e.tag===4}function Wc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Bn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fc(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nn));else if(a!==4&&(a===27&&Bn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Fc(e,t,n),e=e.sibling;e!==null;)Fc(e,t,n),e=e.sibling}function gi(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Bn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(gi(e,t,n),e=e.sibling;e!==null;)gi(e,t,n),e=e.sibling}function ch(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);ut(t,a,n),t[lt]=e,t[ft]=n}catch(o){Oe(e,e.return,o)}}var hn=!1,Fe=!1,Ic=!1,rh=typeof WeakSet=="function"?WeakSet:Set,tt=null;function i0(e,t){if(e=e.containerInfo,gr=Bi,e=bd(e),Qu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var c=a.anchorOffset,o=a.focusNode;a=a.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var m=0,b=-1,S=-1,A=0,U=0,H=e,C=null;t:for(;;){for(var D;H!==n||c!==0&&H.nodeType!==3||(b=m+c),H!==o||a!==0&&H.nodeType!==3||(S=m+a),H.nodeType===3&&(m+=H.nodeValue.length),(D=H.firstChild)!==null;)C=H,H=D;for(;;){if(H===e)break t;if(C===n&&++A===c&&(b=m),C===o&&++U===a&&(S=m),(D=H.nextSibling)!==null)break;H=C,C=H.parentNode}H=D}n=b===-1||S===-1?null:{start:b,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(br={focusedElem:e,selectionRange:n},Bi=!1,tt=t;tt!==null;)if(t=tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tt=e;else for(;tt!==null;){switch(t=tt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,n=t,c=o.memoizedProps,o=o.memoizedState,a=n.stateNode;try{var F=fl(n.type,c);e=a.getSnapshotBeforeUpdate(F,o),a.__reactInternalSnapshotBeforeUpdate=e}catch(re){Oe(n,n.return,re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Nr(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nr(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=t.sibling,e!==null){e.return=t.return,tt=e;break}tt=t.return}}function oh(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:pn(e,n),a&4&&es(5,n);break;case 1:if(pn(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){Oe(n,n.return,m)}else{var c=fl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Oe(n,n.return,m)}}a&64&&ah(n),a&512&&ts(n,n.return);break;case 3:if(pn(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Vd(e,t)}catch(m){Oe(n,n.return,m)}}break;case 27:t===null&&a&4&&ch(n);case 26:case 5:pn(e,n),t===null&&a&4&&ih(n),a&512&&ts(n,n.return);break;case 12:pn(e,n);break;case 31:pn(e,n),a&4&&hh(e,n);break;case 13:pn(e,n),a&4&&mh(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=p0.bind(null,n),U0(e,n))));break;case 22:if(a=n.memoizedState!==null||hn,!a){t=t!==null&&t.memoizedState!==null||Fe,c=hn;var o=Fe;hn=a,(Fe=t)&&!o?vn(e,n,(n.subtreeFlags&8772)!==0):pn(e,n),hn=c,Fe=o}break;case 30:break;default:pn(e,n)}}function dh(e){var t=e.alternate;t!==null&&(e.alternate=null,dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Au(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Le=null,mt=!1;function mn(e,t,n){for(n=n.child;n!==null;)fh(e,t,n),n=n.sibling}function fh(e,t,n){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(Ma,n)}catch{}switch(n.tag){case 26:Fe||Kt(n,t),mn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Fe||Kt(n,t);var a=Le,c=mt;Bn(n.type)&&(Le=n.stateNode,mt=!1),mn(e,t,n),os(n.stateNode),Le=a,mt=c;break;case 5:Fe||Kt(n,t);case 6:if(a=Le,c=mt,Le=null,mn(e,t,n),Le=a,mt=c,Le!==null)if(mt)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(n.stateNode)}catch(o){Oe(n,t,o)}else try{Le.removeChild(n.stateNode)}catch(o){Oe(n,t,o)}break;case 18:Le!==null&&(mt?(e=Le,am(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),da(e)):am(Le,n.stateNode));break;case 4:a=Le,c=mt,Le=n.stateNode.containerInfo,mt=!0,mn(e,t,n),Le=a,mt=c;break;case 0:case 11:case 14:case 15:Dn(2,n,t),Fe||Dn(4,n,t),mn(e,t,n);break;case 1:Fe||(Kt(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&sh(n,t,a)),mn(e,t,n);break;case 21:mn(e,t,n);break;case 22:Fe=(a=Fe)||n.memoizedState!==null,mn(e,t,n),Fe=a;break;default:mn(e,t,n)}}function hh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{da(e)}catch(n){Oe(t,t.return,n)}}}function mh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{da(e)}catch(n){Oe(t,t.return,n)}}function u0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rh),t;default:throw Error(r(435,e.tag))}}function bi(e,t){var n=u0(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var c=v0.bind(null,e,a);a.then(c,c)}})}function pt(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var c=n[a],o=e,m=t,b=m;e:for(;b!==null;){switch(b.tag){case 27:if(Bn(b.type)){Le=b.stateNode,mt=!1;break e}break;case 5:Le=b.stateNode,mt=!1;break e;case 3:case 4:Le=b.stateNode.containerInfo,mt=!0;break e}b=b.return}if(Le===null)throw Error(r(160));fh(o,m,c),Le=null,mt=!1,o=c.alternate,o!==null&&(o.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ph(t,e),t=t.sibling}var Lt=null;function ph(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pt(t,e),vt(e),a&4&&(Dn(3,e,e.return),es(3,e),Dn(5,e,e.return));break;case 1:pt(t,e),vt(e),a&512&&(Fe||n===null||Kt(n,n.return)),a&64&&hn&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var c=Lt;if(pt(t,e),vt(e),a&512&&(Fe||n===null||Kt(n,n.return)),a&4){var o=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(a){case"title":o=c.getElementsByTagName("title")[0],(!o||o[Aa]||o[lt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=c.createElement(a),c.head.insertBefore(o,c.querySelector("head > title"))),ut(o,a,n),o[lt]=e,et(o),a=o;break e;case"link":var m=pm("link","href",c).get(a+(n.href||""));if(m){for(var b=0;b<m.length;b++)if(o=m[b],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){m.splice(b,1);break t}}o=c.createElement(a),ut(o,a,n),c.head.appendChild(o);break;case"meta":if(m=pm("meta","content",c).get(a+(n.content||""))){for(b=0;b<m.length;b++)if(o=m[b],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){m.splice(b,1);break t}}o=c.createElement(a),ut(o,a,n),c.head.appendChild(o);break;default:throw Error(r(468,a))}o[lt]=e,et(o),a=o}e.stateNode=a}else vm(c,e.type,e.stateNode);else e.stateNode=mm(c,a,e.memoizedProps);else o!==a?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,a===null?vm(c,e.type,e.stateNode):mm(c,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Jc(e,e.memoizedProps,n.memoizedProps)}break;case 27:pt(t,e),vt(e),a&512&&(Fe||n===null||Kt(n,n.return)),n!==null&&a&4&&Jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pt(t,e),vt(e),a&512&&(Fe||n===null||Kt(n,n.return)),e.flags&32){c=e.stateNode;try{Rl(c,"")}catch(F){Oe(e,e.return,F)}}a&4&&e.stateNode!=null&&(c=e.memoizedProps,Jc(e,c,n!==null?n.memoizedProps:c)),a&1024&&(Ic=!0);break;case 6:if(pt(t,e),vt(e),a&4){if(e.stateNode===null)throw Error(r(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(F){Oe(e,e.return,F)}}break;case 3:if(ki=null,c=Lt,Lt=Ri(t.containerInfo),pt(t,e),Lt=c,vt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{da(t.containerInfo)}catch(F){Oe(e,e.return,F)}Ic&&(Ic=!1,vh(e));break;case 4:a=Lt,Lt=Ri(e.stateNode.containerInfo),pt(t,e),vt(e),Lt=a;break;case 12:pt(t,e),vt(e);break;case 31:pt(t,e),vt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,bi(e,a)));break;case 13:pt(t,e),vt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Si=bt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,bi(e,a)));break;case 22:c=e.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,A=hn,U=Fe;if(hn=A||c,Fe=U||S,pt(t,e),Fe=U,hn=A,vt(e),a&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||S||hn||Fe||hl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){S=n=t;try{if(o=S.stateNode,c)m=o.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{b=S.stateNode;var H=S.memoizedProps.style,C=H!=null&&H.hasOwnProperty("display")?H.display:null;b.style.display=C==null||typeof C=="boolean"?"":(""+C).trim()}}catch(F){Oe(S,S.return,F)}}}else if(t.tag===6){if(n===null){S=t;try{S.stateNode.nodeValue=c?"":S.memoizedProps}catch(F){Oe(S,S.return,F)}}}else if(t.tag===18){if(n===null){S=t;try{var D=S.stateNode;c?sm(D,!0):sm(S.stateNode,!1)}catch(F){Oe(S,S.return,F)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,bi(e,n))));break;case 19:pt(t,e),vt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,bi(e,a)));break;case 30:break;case 21:break;default:pt(t,e),vt(e)}}function vt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(uh(a)){n=a;break}a=a.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var c=n.stateNode,o=Wc(e);gi(e,o,c);break;case 5:var m=n.stateNode;n.flags&32&&(Rl(m,""),n.flags&=-33);var b=Wc(e);gi(e,b,m);break;case 3:case 4:var S=n.stateNode.containerInfo,A=Wc(e);Fc(e,A,S);break;default:throw Error(r(161))}}catch(U){Oe(e,e.return,U)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function pn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)oh(e,t.alternate,t),t=t.sibling}function hl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Dn(4,t,t.return),hl(t);break;case 1:Kt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&sh(t,t.return,n),hl(t);break;case 27:os(t.stateNode);case 26:case 5:Kt(t,t.return),hl(t);break;case 22:t.memoizedState===null&&hl(t);break;case 30:hl(t);break;default:hl(t)}e=e.sibling}}function vn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,c=e,o=t,m=o.flags;switch(o.tag){case 0:case 11:case 15:vn(c,o,n),es(4,o);break;case 1:if(vn(c,o,n),a=o,c=a.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(A){Oe(a,a.return,A)}if(a=o,c=a.updateQueue,c!==null){var b=a.stateNode;try{var S=c.shared.hiddenCallbacks;if(S!==null)for(c.shared.hiddenCallbacks=null,c=0;c<S.length;c++)Zd(S[c],b)}catch(A){Oe(a,a.return,A)}}n&&m&64&&ah(o),ts(o,o.return);break;case 27:ch(o);case 26:case 5:vn(c,o,n),n&&a===null&&m&4&&ih(o),ts(o,o.return);break;case 12:vn(c,o,n);break;case 31:vn(c,o,n),n&&m&4&&hh(c,o);break;case 13:vn(c,o,n),n&&m&4&&mh(c,o);break;case 22:o.memoizedState===null&&vn(c,o,n),ts(o,o.return);break;case 30:break;default:vn(c,o,n)}t=t.sibling}}function Pc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&La(n))}function er(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&La(e))}function Yt(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xh(e,t,n,a),t=t.sibling}function xh(e,t,n,a){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Yt(e,t,n,a),c&2048&&es(9,t);break;case 1:Yt(e,t,n,a);break;case 3:Yt(e,t,n,a),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&La(e)));break;case 12:if(c&2048){Yt(e,t,n,a),e=t.stateNode;try{var o=t.memoizedProps,m=o.id,b=o.onPostCommit;typeof b=="function"&&b(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Oe(t,t.return,S)}}else Yt(e,t,n,a);break;case 31:Yt(e,t,n,a);break;case 13:Yt(e,t,n,a);break;case 23:break;case 22:o=t.stateNode,m=t.alternate,t.memoizedState!==null?o._visibility&2?Yt(e,t,n,a):ns(e,t):o._visibility&2?Yt(e,t,n,a):(o._visibility|=2,ea(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Pc(m,t);break;case 24:Yt(e,t,n,a),c&2048&&er(t.alternate,t);break;default:Yt(e,t,n,a)}}function ea(e,t,n,a,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,m=t,b=n,S=a,A=m.flags;switch(m.tag){case 0:case 11:case 15:ea(o,m,b,S,c),es(8,m);break;case 23:break;case 22:var U=m.stateNode;m.memoizedState!==null?U._visibility&2?ea(o,m,b,S,c):ns(o,m):(U._visibility|=2,ea(o,m,b,S,c)),c&&A&2048&&Pc(m.alternate,m);break;case 24:ea(o,m,b,S,c),c&&A&2048&&er(m.alternate,m);break;default:ea(o,m,b,S,c)}t=t.sibling}}function ns(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,c=a.flags;switch(a.tag){case 22:ns(n,a),c&2048&&Pc(a.alternate,a);break;case 24:ns(n,a),c&2048&&er(a.alternate,a);break;default:ns(n,a)}t=t.sibling}}var ls=8192;function ta(e,t,n){if(e.subtreeFlags&ls)for(e=e.child;e!==null;)yh(e,t,n),e=e.sibling}function yh(e,t,n){switch(e.tag){case 26:ta(e,t,n),e.flags&ls&&e.memoizedState!==null&&V0(n,Lt,e.memoizedState,e.memoizedProps);break;case 5:ta(e,t,n);break;case 3:case 4:var a=Lt;Lt=Ri(e.stateNode.containerInfo),ta(e,t,n),Lt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ls,ls=16777216,ta(e,t,n),ls=a):ta(e,t,n));break;default:ta(e,t,n)}}function gh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function as(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];tt=a,jh(a,e)}gh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bh(e),e=e.sibling}function bh(e){switch(e.tag){case 0:case 11:case 15:as(e),e.flags&2048&&Dn(9,e,e.return);break;case 3:as(e);break;case 12:as(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ji(e)):as(e);break;default:as(e)}}function ji(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];tt=a,jh(a,e)}gh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Dn(8,t,t.return),ji(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ji(t));break;default:ji(t)}e=e.sibling}}function jh(e,t){for(;tt!==null;){var n=tt;switch(n.tag){case 0:case 11:case 15:Dn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:La(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,tt=a;else e:for(n=e;tt!==null;){a=tt;var c=a.sibling,o=a.return;if(dh(a),a===n){tt=null;break e}if(c!==null){c.return=o,tt=c;break e}tt=o}}}var c0={getCacheForType:function(e){var t=st(Ke),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return st(Ke).controller.signal}},r0=typeof WeakMap=="function"?WeakMap:Map,Ae=0,ke=null,ge=null,je=0,Ce=0,_t=null,Rn=!1,na=!1,tr=!1,xn=0,Xe=0,Un=0,ml=0,nr=0,At=0,la=0,ss=null,xt=null,lr=!1,Si=0,Sh=0,Ni=1/0,wi=null,kn=null,Pe=0,$n=null,aa=null,yn=0,ar=0,sr=null,Nh=null,is=0,ir=null;function Tt(){return(Ae&2)!==0&&je!==0?je&-je:O.T!==null?fr():Ho()}function wh(){if(At===0)if((je&536870912)===0||Ne){var e=Os;Os<<=1,(Os&3932160)===0&&(Os=262144),At=e}else At=536870912;return e=Mt.current,e!==null&&(e.flags|=32),At}function yt(e,t,n){(e===ke&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(sa(e,0),Hn(e,je,At,!1)),_a(e,n),((Ae&2)===0||e!==ke)&&(e===ke&&((Ae&2)===0&&(ml|=n),Xe===4&&Hn(e,je,At,!1)),Jt(e))}function Mh(e,t,n){if((Ae&6)!==0)throw Error(r(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ea(e,t),c=a?f0(e,t):cr(e,t,!0),o=a;do{if(c===0){na&&!a&&Hn(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!o0(n)){c=cr(e,t,!1),o=!1;continue}if(c===2){if(o=t,e.errorRecoveryDisabledLanes&o)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var b=e;c=ss;var S=b.current.memoizedState.isDehydrated;if(S&&(sa(b,m).flags|=256),m=cr(b,m,!1),m!==2){if(tr&&!S){b.errorRecoveryDisabledLanes|=o,ml|=o,c=4;break e}o=xt,xt=c,o!==null&&(xt===null?xt=o:xt.push.apply(xt,o))}c=m}if(o=!1,c!==2)continue}}if(c===1){sa(e,0),Hn(e,t,0,!0);break}e:{switch(a=e,o=c,o){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:Hn(a,t,At,!Rn);break e;case 2:xt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(c=Si+300-bt(),10<c)){if(Hn(a,t,At,!Rn),Rs(a,0,!0)!==0)break e;yn=t,a.timeoutHandle=nm(Eh.bind(null,a,n,xt,wi,lr,t,At,ml,la,Rn,o,"Throttled",-0,0),c);break e}Eh(a,n,xt,wi,lr,t,At,ml,la,Rn,o,null,-0,0)}}break}while(!0);Jt(e)}function Eh(e,t,n,a,c,o,m,b,S,A,U,H,C,D){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},yh(t,o,H);var F=(o&62914560)===o?Si-bt():(o&4194048)===o?Sh-bt():0;if(F=K0(H,F),F!==null){yn=o,e.cancelPendingCommit=F(Rh.bind(null,e,t,o,n,a,c,m,b,S,U,H,null,C,D)),Hn(e,o,m,!A);return}}Rh(e,t,o,n,a,c,m,b,S)}function o0(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var c=n[a],o=c.getSnapshot;c=c.value;try{if(!Nt(o(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Hn(e,t,n,a){t&=~nr,t&=~ml,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var c=t;0<c;){var o=31-St(c),m=1<<o;a[o]=-1,c&=~m}n!==0&&Uo(e,n,t)}function Mi(){return(Ae&6)===0?(us(0),!1):!0}function ur(){if(ge!==null){if(Ce===0)var e=ge.return;else e=ge,un=sl=null,Nc(e),Jl=null,Ga=0,e=ge;for(;e!==null;)lh(e.alternate,e),e=e.return;ge=null}}function sa(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,z0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),yn=0,ur(),ke=e,ge=n=an(e.current,null),je=t,Ce=0,_t=null,Rn=!1,na=Ea(e,t),tr=!1,la=At=nr=ml=Un=Xe=0,xt=ss=null,lr=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var c=31-St(a),o=1<<c;t|=e[c],a&=~o}return xn=t,Zs(),n}function _h(e,t){pe=null,O.H=Fa,t===Kl||t===ei?(t=Yd(),Ce=3):t===dc?(t=Yd(),Ce=4):Ce=t===qc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,_t=t,ge===null&&(Xe=1,mi(e,Dt(t,e.current)))}function Ah(){var e=Mt.current;return e===null?!0:(je&4194048)===je?$t===null:(je&62914560)===je||(je&536870912)!==0?e===$t:!1}function Th(){var e=O.H;return O.H=Fa,e===null?Fa:e}function zh(){var e=O.A;return O.A=c0,e}function Ei(){Xe=4,Rn||(je&4194048)!==je&&Mt.current!==null||(na=!0),(Un&134217727)===0&&(ml&134217727)===0||ke===null||Hn(ke,je,At,!1)}function cr(e,t,n){var a=Ae;Ae|=2;var c=Th(),o=zh();(ke!==e||je!==t)&&(wi=null,sa(e,t)),t=!1;var m=Xe;e:do try{if(Ce!==0&&ge!==null){var b=ge,S=_t;switch(Ce){case 8:ur(),m=6;break e;case 3:case 2:case 9:case 6:Mt.current===null&&(t=!0);var A=Ce;if(Ce=0,_t=null,ia(e,b,S,A),n&&na){m=0;break e}break;default:A=Ce,Ce=0,_t=null,ia(e,b,S,A)}}d0(),m=Xe;break}catch(U){_h(e,U)}while(!0);return t&&e.shellSuspendCounter++,un=sl=null,Ae=a,O.H=c,O.A=o,ge===null&&(ke=null,je=0,Zs()),m}function d0(){for(;ge!==null;)Ch(ge)}function f0(e,t){var n=Ae;Ae|=2;var a=Th(),c=zh();ke!==e||je!==t?(wi=null,Ni=bt()+500,sa(e,t)):na=Ea(e,t);e:do try{if(Ce!==0&&ge!==null){t=ge;var o=_t;t:switch(Ce){case 1:Ce=0,_t=null,ia(e,t,o,1);break;case 2:case 9:if(Bd(o)){Ce=0,_t=null,Oh(t);break}t=function(){Ce!==2&&Ce!==9||ke!==e||(Ce=7),Jt(e)},o.then(t,t);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:Bd(o)?(Ce=0,_t=null,Oh(t)):(Ce=0,_t=null,ia(e,t,o,7));break;case 5:var m=null;switch(ge.tag){case 26:m=ge.memoizedState;case 5:case 27:var b=ge;if(m?xm(m):b.stateNode.complete){Ce=0,_t=null;var S=b.sibling;if(S!==null)ge=S;else{var A=b.return;A!==null?(ge=A,_i(A)):ge=null}break t}}Ce=0,_t=null,ia(e,t,o,5);break;case 6:Ce=0,_t=null,ia(e,t,o,6);break;case 8:ur(),Xe=6;break e;default:throw Error(r(462))}}h0();break}catch(U){_h(e,U)}while(!0);return un=sl=null,O.H=a,O.A=c,Ae=n,ge!==null?0:(ke=null,je=0,Zs(),Xe)}function h0(){for(;ge!==null&&!kv();)Ch(ge)}function Ch(e){var t=th(e.alternate,e,xn);e.memoizedProps=e.pendingProps,t===null?_i(e):ge=t}function Oh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jf(n,t,t.pendingProps,t.type,void 0,je);break;case 11:t=Jf(n,t,t.pendingProps,t.type.render,t.ref,je);break;case 5:Nc(t);default:lh(n,t),t=ge=Td(t,xn),t=th(n,t,xn)}e.memoizedProps=e.pendingProps,t===null?_i(e):ge=t}function ia(e,t,n,a){un=sl=null,Nc(t),Jl=null,Ga=0;var c=t.return;try{if(t0(e,c,t,n,je)){Xe=1,mi(e,Dt(n,e.current)),ge=null;return}}catch(o){if(c!==null)throw ge=c,o;Xe=1,mi(e,Dt(n,e.current)),ge=null;return}t.flags&32768?(Ne||a===1?e=!0:na||(je&536870912)!==0?e=!1:(Rn=e=!0,(a===2||a===9||a===3||a===6)&&(a=Mt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Dh(t,e)):_i(t)}function _i(e){var t=e;do{if((t.flags&32768)!==0){Dh(t,Rn);return}e=t.return;var n=a0(t.alternate,t,xn);if(n!==null){ge=n;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);Xe===0&&(Xe=5)}function Dh(e,t){do{var n=s0(e.alternate,e);if(n!==null){n.flags&=32767,ge=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ge=e;return}ge=e=n}while(e!==null);Xe=6,ge=null}function Rh(e,t,n,a,c,o,m,b,S){e.cancelPendingCommit=null;do Ai();while(Pe!==0);if((Ae&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(o=t.lanes|t.childLanes,o|=Wu,Zv(e,n,o,m,b,S),e===ke&&(ge=ke=null,je=0),aa=t,$n=e,yn=n,ar=o,sr=c,Nh=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,x0(zs,function(){return qh(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=O.T,O.T=null,c=Q.p,Q.p=2,m=Ae,Ae|=4;try{i0(e,t,n)}finally{Ae=m,Q.p=c,O.T=a}}Pe=1,Uh(),kh(),$h()}}function Uh(){if(Pe===1){Pe=0;var e=$n,t=aa,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=O.T,O.T=null;var a=Q.p;Q.p=2;var c=Ae;Ae|=4;try{ph(t,e);var o=br,m=bd(e.containerInfo),b=o.focusedElem,S=o.selectionRange;if(m!==b&&b&&b.ownerDocument&&gd(b.ownerDocument.documentElement,b)){if(S!==null&&Qu(b)){var A=S.start,U=S.end;if(U===void 0&&(U=A),"selectionStart"in b)b.selectionStart=A,b.selectionEnd=Math.min(U,b.value.length);else{var H=b.ownerDocument||document,C=H&&H.defaultView||window;if(C.getSelection){var D=C.getSelection(),F=b.textContent.length,re=Math.min(S.start,F),Ue=S.end===void 0?re:Math.min(S.end,F);!D.extend&&re>Ue&&(m=Ue,Ue=re,re=m);var E=yd(b,re),w=yd(b,Ue);if(E&&w&&(D.rangeCount!==1||D.anchorNode!==E.node||D.anchorOffset!==E.offset||D.focusNode!==w.node||D.focusOffset!==w.offset)){var _=H.createRange();_.setStart(E.node,E.offset),D.removeAllRanges(),re>Ue?(D.addRange(_),D.extend(w.node,w.offset)):(_.setEnd(w.node,w.offset),D.addRange(_))}}}}for(H=[],D=b;D=D.parentNode;)D.nodeType===1&&H.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<H.length;b++){var $=H[b];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}Bi=!!gr,br=gr=null}finally{Ae=c,Q.p=a,O.T=n}}e.current=t,Pe=2}}function kh(){if(Pe===2){Pe=0;var e=$n,t=aa,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=O.T,O.T=null;var a=Q.p;Q.p=2;var c=Ae;Ae|=4;try{oh(e,t.alternate,t)}finally{Ae=c,Q.p=a,O.T=n}}Pe=3}}function $h(){if(Pe===4||Pe===3){Pe=0,$v();var e=$n,t=aa,n=yn,a=Nh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pe=5:(Pe=0,aa=$n=null,Hh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(kn=null),Eu(n),t=t.stateNode,jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(Ma,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=O.T,c=Q.p,Q.p=2,O.T=null;try{for(var o=e.onRecoverableError,m=0;m<a.length;m++){var b=a[m];o(b.value,{componentStack:b.stack})}}finally{O.T=t,Q.p=c}}(yn&3)!==0&&Ai(),Jt(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===ir?is++:(is=0,ir=e):is=0,us(0)}}function Hh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,La(t)))}function Ai(){return Uh(),kh(),$h(),qh()}function qh(){if(Pe!==5)return!1;var e=$n,t=ar;ar=0;var n=Eu(yn),a=O.T,c=Q.p;try{Q.p=32>n?32:n,O.T=null,n=sr,sr=null;var o=$n,m=yn;if(Pe=0,aa=$n=null,yn=0,(Ae&6)!==0)throw Error(r(331));var b=Ae;if(Ae|=4,bh(o.current),xh(o,o.current,m,n),Ae=b,us(0,!1),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(Ma,o)}catch{}return!0}finally{Q.p=c,O.T=a,Hh(e,t)}}function Bh(e,t,n){t=Dt(n,t),t=Hc(e.stateNode,t,2),e=zn(e,t,2),e!==null&&(_a(e,2),Jt(e))}function Oe(e,t,n){if(e.tag===3)Bh(e,e,n);else for(;t!==null;){if(t.tag===3){Bh(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(kn===null||!kn.has(a))){e=Dt(n,e),n=Lf(2),a=zn(t,n,2),a!==null&&(Yf(n,a,t,e),_a(a,2),Jt(a));break}}t=t.return}}function rr(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new r0;var c=new Set;a.set(t,c)}else c=a.get(t),c===void 0&&(c=new Set,a.set(t,c));c.has(n)||(tr=!0,c.add(n),e=m0.bind(null,e,t,n),t.then(e,e))}function m0(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ke===e&&(je&n)===n&&(Xe===4||Xe===3&&(je&62914560)===je&&300>bt()-Si?(Ae&2)===0&&sa(e,0):nr|=n,la===je&&(la=0)),Jt(e)}function Lh(e,t){t===0&&(t=Ro()),e=nl(e,t),e!==null&&(_a(e,t),Jt(e))}function p0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Lh(e,n)}function v0(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(t),Lh(e,n)}function x0(e,t){return Su(e,t)}var Ti=null,ua=null,or=!1,zi=!1,dr=!1,qn=0;function Jt(e){e!==ua&&e.next===null&&(ua===null?Ti=ua=e:ua=ua.next=e),zi=!0,or||(or=!0,g0())}function us(e,t){if(!dr&&zi){dr=!0;do for(var n=!1,a=Ti;a!==null;){if(e!==0){var c=a.pendingLanes;if(c===0)var o=0;else{var m=a.suspendedLanes,b=a.pingedLanes;o=(1<<31-St(42|e)+1)-1,o&=c&~(m&~b),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,Qh(a,o))}else o=je,o=Rs(a,a===ke?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||Ea(a,o)||(n=!0,Qh(a,o));a=a.next}while(n);dr=!1}}function y0(){Yh()}function Yh(){zi=or=!1;var e=0;qn!==0&&T0()&&(e=qn);for(var t=bt(),n=null,a=Ti;a!==null;){var c=a.next,o=Gh(a,t);o===0?(a.next=null,n===null?Ti=c:n.next=c,c===null&&(ua=n)):(n=a,(e!==0||(o&3)!==0)&&(zi=!0)),a=c}Pe!==0&&Pe!==5||us(e),qn!==0&&(qn=0)}function Gh(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,c=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var m=31-St(o),b=1<<m,S=c[m];S===-1?((b&n)===0||(b&a)!==0)&&(c[m]=Qv(b,t)):S<=t&&(e.expiredLanes|=b),o&=~b}if(t=ke,n=je,n=Rs(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Nu(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ea(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Nu(a),Eu(n)){case 2:case 8:n=Oo;break;case 32:n=zs;break;case 268435456:n=Do;break;default:n=zs}return a=Xh.bind(null,e),n=Su(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Nu(a),e.callbackPriority=2,e.callbackNode=null,2}function Xh(e,t){if(Pe!==0&&Pe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ai()&&e.callbackNode!==n)return null;var a=je;return a=Rs(e,e===ke?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Mh(e,a,t),Gh(e,bt()),e.callbackNode!=null&&e.callbackNode===n?Xh.bind(null,e):null)}function Qh(e,t){if(Ai())return null;Mh(e,t,!0)}function g0(){C0(function(){(Ae&6)!==0?Su(Co,y0):Yh()})}function fr(){if(qn===0){var e=Zl;e===0&&(e=Cs,Cs<<=1,(Cs&261888)===0&&(Cs=256)),qn=e}return qn}function Zh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Hs(""+e)}function Vh(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function b0(e,t,n,a,c){if(t==="submit"&&n&&n.stateNode===c){var o=Zh((c[ft]||null).action),m=a.submitter;m&&(t=(t=m[ft]||null)?Zh(t.formAction):m.getAttribute("formAction"),t!==null&&(o=t,m=null));var b=new Ys("action","action",null,a,c);e.push({event:b,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(qn!==0){var S=m?Vh(c,m):new FormData(c);Oc(n,{pending:!0,data:S,method:c.method,action:o},null,S)}}else typeof o=="function"&&(b.preventDefault(),S=m?Vh(c,m):new FormData(c),Oc(n,{pending:!0,data:S,method:c.method,action:o},o,S))},currentTarget:c}]})}}for(var hr=0;hr<Ju.length;hr++){var mr=Ju[hr],j0=mr.toLowerCase(),S0=mr[0].toUpperCase()+mr.slice(1);Bt(j0,"on"+S0)}Bt(Nd,"onAnimationEnd"),Bt(wd,"onAnimationIteration"),Bt(Md,"onAnimationStart"),Bt("dblclick","onDoubleClick"),Bt("focusin","onFocus"),Bt("focusout","onBlur"),Bt(Hx,"onTransitionRun"),Bt(qx,"onTransitionStart"),Bt(Bx,"onTransitionCancel"),Bt(Ed,"onTransitionEnd"),Ol("onMouseEnter",["mouseout","mouseover"]),Ol("onMouseLeave",["mouseout","mouseover"]),Ol("onPointerEnter",["pointerout","pointerover"]),Ol("onPointerLeave",["pointerout","pointerover"]),In("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),In("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),In("onBeforeInput",["compositionend","keypress","textInput","paste"]),In("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),In("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),In("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cs="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(" "),N0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cs));function Kh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],c=a.event;a=a.listeners;e:{var o=void 0;if(t)for(var m=a.length-1;0<=m;m--){var b=a[m],S=b.instance,A=b.currentTarget;if(b=b.listener,S!==o&&c.isPropagationStopped())break e;o=b,c.currentTarget=A;try{o(c)}catch(U){Qs(U)}c.currentTarget=null,o=S}else for(m=0;m<a.length;m++){if(b=a[m],S=b.instance,A=b.currentTarget,b=b.listener,S!==o&&c.isPropagationStopped())break e;o=b,c.currentTarget=A;try{o(c)}catch(U){Qs(U)}c.currentTarget=null,o=S}}}}function be(e,t){var n=t[_u];n===void 0&&(n=t[_u]=new Set);var a=e+"__bubble";n.has(a)||(Jh(t,e,2,!1),n.add(a))}function pr(e,t,n){var a=0;t&&(a|=4),Jh(n,e,a,t)}var Ci="_reactListening"+Math.random().toString(36).slice(2);function vr(e){if(!e[Ci]){e[Ci]=!0,Lo.forEach(function(n){n!=="selectionchange"&&(N0.has(n)||pr(n,!1,e),pr(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ci]||(t[Ci]=!0,pr("selectionchange",!1,t))}}function Jh(e,t,n,a){switch(wm(t)){case 2:var c=F0;break;case 8:c=I0;break;default:c=Cr}n=c.bind(null,t,n,e),c=void 0,!ku||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),a?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function xr(e,t,n,a,c){var o=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var m=a.tag;if(m===3||m===4){var b=a.stateNode.containerInfo;if(b===c)break;if(m===4)for(m=a.return;m!==null;){var S=m.tag;if((S===3||S===4)&&m.stateNode.containerInfo===c)return;m=m.return}for(;b!==null;){if(m=Tl(b),m===null)return;if(S=m.tag,S===5||S===6||S===26||S===27){a=o=m;continue e}b=b.parentNode}}a=a.return}Po(function(){var A=o,U=Ru(n),H=[];e:{var C=_d.get(e);if(C!==void 0){var D=Ys,F=e;switch(e){case"keypress":if(Bs(n)===0)break e;case"keydown":case"keyup":D=vx;break;case"focusin":F="focus",D=Bu;break;case"focusout":F="blur",D=Bu;break;case"beforeblur":case"afterblur":D=Bu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":D=nd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":D=ax;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":D=gx;break;case Nd:case wd:case Md:D=ux;break;case Ed:D=jx;break;case"scroll":case"scrollend":D=nx;break;case"wheel":D=Nx;break;case"copy":case"cut":case"paste":D=rx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":D=ad;break;case"toggle":case"beforetoggle":D=Mx}var re=(t&4)!==0,Ue=!re&&(e==="scroll"||e==="scrollend"),E=re?C!==null?C+"Capture":null:C;re=[];for(var w=A,_;w!==null;){var $=w;if(_=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||_===null||E===null||($=za(w,E),$!=null&&re.push(rs(w,$,_))),Ue)break;w=w.return}0<re.length&&(C=new D(C,F,null,n,U),H.push({event:C,listeners:re}))}}if((t&7)===0){e:{if(C=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",C&&n!==Du&&(F=n.relatedTarget||n.fromElement)&&(Tl(F)||F[Al]))break e;if((D||C)&&(C=U.window===U?U:(C=U.ownerDocument)?C.defaultView||C.parentWindow:window,D?(F=n.relatedTarget||n.toElement,D=A,F=F?Tl(F):null,F!==null&&(Ue=h(F),re=F.tag,F!==Ue||re!==5&&re!==27&&re!==6)&&(F=null)):(D=null,F=A),D!==F)){if(re=nd,$="onMouseLeave",E="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(re=ad,$="onPointerLeave",E="onPointerEnter",w="pointer"),Ue=D==null?C:Ta(D),_=F==null?C:Ta(F),C=new re($,w+"leave",D,n,U),C.target=Ue,C.relatedTarget=_,$=null,Tl(U)===A&&(re=new re(E,w+"enter",F,n,U),re.target=_,re.relatedTarget=Ue,$=re),Ue=$,D&&F)t:{for(re=w0,E=D,w=F,_=0,$=E;$;$=re($))_++;$=0;for(var se=w;se;se=re(se))$++;for(;0<_-$;)E=re(E),_--;for(;0<$-_;)w=re(w),$--;for(;_--;){if(E===w||w!==null&&E===w.alternate){re=E;break t}E=re(E),w=re(w)}re=null}else re=null;D!==null&&Wh(H,C,D,re,!1),F!==null&&Ue!==null&&Wh(H,Ue,F,re,!0)}}e:{if(C=A?Ta(A):window,D=C.nodeName&&C.nodeName.toLowerCase(),D==="select"||D==="input"&&C.type==="file")var Me=fd;else if(od(C))if(hd)Me=Ux;else{Me=Dx;var ne=Ox}else D=C.nodeName,!D||D.toLowerCase()!=="input"||C.type!=="checkbox"&&C.type!=="radio"?A&&Ou(A.elementType)&&(Me=fd):Me=Rx;if(Me&&(Me=Me(e,A))){dd(H,Me,n,U);break e}ne&&ne(e,C,A),e==="focusout"&&A&&C.type==="number"&&A.memoizedProps.value!=null&&Cu(C,"number",C.value)}switch(ne=A?Ta(A):window,e){case"focusin":(od(ne)||ne.contentEditable==="true")&&(Hl=ne,Zu=A,Ha=null);break;case"focusout":Ha=Zu=Hl=null;break;case"mousedown":Vu=!0;break;case"contextmenu":case"mouseup":case"dragend":Vu=!1,jd(H,n,U);break;case"selectionchange":if($x)break;case"keydown":case"keyup":jd(H,n,U)}var ve;if(Yu)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else $l?cd(e,n)&&(Se="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Se="onCompositionStart");Se&&(sd&&n.locale!=="ko"&&($l||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&$l&&(ve=ed()):(Nn=U,$u="value"in Nn?Nn.value:Nn.textContent,$l=!0)),ne=Oi(A,Se),0<ne.length&&(Se=new ld(Se,e,null,n,U),H.push({event:Se,listeners:ne}),ve?Se.data=ve:(ve=rd(n),ve!==null&&(Se.data=ve)))),(ve=_x?Ax(e,n):Tx(e,n))&&(Se=Oi(A,"onBeforeInput"),0<Se.length&&(ne=new ld("onBeforeInput","beforeinput",null,n,U),H.push({event:ne,listeners:Se}),ne.data=ve)),b0(H,e,A,n,U)}Kh(H,t)})}function rs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Oi(e,t){for(var n=t+"Capture",a=[];e!==null;){var c=e,o=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||o===null||(c=za(e,n),c!=null&&a.unshift(rs(e,c,o)),c=za(e,t),c!=null&&a.push(rs(e,c,o))),e.tag===3)return a;e=e.return}return[]}function w0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Wh(e,t,n,a,c){for(var o=t._reactName,m=[];n!==null&&n!==a;){var b=n,S=b.alternate,A=b.stateNode;if(b=b.tag,S!==null&&S===a)break;b!==5&&b!==26&&b!==27||A===null||(S=A,c?(A=za(n,o),A!=null&&m.unshift(rs(n,A,S))):c||(A=za(n,o),A!=null&&m.push(rs(n,A,S)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var M0=/\r\n?/g,E0=/\u0000|\uFFFD/g;function Fh(e){return(typeof e=="string"?e:""+e).replace(M0,`
49
+ `).replace(E0,"")}function Ih(e,t){return t=Fh(t),Fh(e)===t}function Re(e,t,n,a,c,o){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Rl(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Rl(e,""+a);break;case"className":ks(e,"class",a);break;case"tabIndex":ks(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":ks(e,n,a);break;case"style":Fo(e,a,o);break;case"data":if(t!=="object"){ks(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Hs(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(n==="formAction"?(t!=="input"&&Re(e,t,"name",c.name,c,null),Re(e,t,"formEncType",c.formEncType,c,null),Re(e,t,"formMethod",c.formMethod,c,null),Re(e,t,"formTarget",c.formTarget,c,null)):(Re(e,t,"encType",c.encType,c,null),Re(e,t,"method",c.method,c,null),Re(e,t,"target",c.target,c,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Hs(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=nn);break;case"onScroll":a!=null&&be("scroll",e);break;case"onScrollEnd":a!=null&&be("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(n=a.__html,n!=null){if(c.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Hs(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":be("beforetoggle",e),be("toggle",e),Us(e,"popover",a);break;case"xlinkActuate":tn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":tn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":tn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":tn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":tn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":tn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":tn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":tn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":tn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Us(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=ex.get(n)||n,Us(e,n,a))}}function yr(e,t,n,a,c,o){switch(n){case"style":Fo(e,a,o);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(n=a.__html,n!=null){if(c.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Rl(e,a):(typeof a=="number"||typeof a=="bigint")&&Rl(e,""+a);break;case"onScroll":a!=null&&be("scroll",e);break;case"onScrollEnd":a!=null&&be("scrollend",e);break;case"onClick":a!=null&&(e.onclick=nn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Yo.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),o=e[ft]||null,o=o!=null?o[n]:null,typeof o=="function"&&e.removeEventListener(t,o,c),typeof a=="function")){typeof o!="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,c);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):Us(e,n,a)}}}function ut(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",e),be("load",e);var a=!1,c=!1,o;for(o in n)if(n.hasOwnProperty(o)){var m=n[o];if(m!=null)switch(o){case"src":a=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Re(e,t,o,m,n,null)}}c&&Re(e,t,"srcSet",n.srcSet,n,null),a&&Re(e,t,"src",n.src,n,null);return;case"input":be("invalid",e);var b=o=m=c=null,S=null,A=null;for(a in n)if(n.hasOwnProperty(a)){var U=n[a];if(U!=null)switch(a){case"name":c=U;break;case"type":m=U;break;case"checked":S=U;break;case"defaultChecked":A=U;break;case"value":o=U;break;case"defaultValue":b=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,t));break;default:Re(e,t,a,U,n,null)}}Vo(e,o,b,S,A,m,c,!1);return;case"select":be("invalid",e),a=m=o=null;for(c in n)if(n.hasOwnProperty(c)&&(b=n[c],b!=null))switch(c){case"value":o=b;break;case"defaultValue":m=b;break;case"multiple":a=b;default:Re(e,t,c,b,n,null)}t=o,n=m,e.multiple=!!a,t!=null?Dl(e,!!a,t,!1):n!=null&&Dl(e,!!a,n,!0);return;case"textarea":be("invalid",e),o=c=a=null;for(m in n)if(n.hasOwnProperty(m)&&(b=n[m],b!=null))switch(m){case"value":a=b;break;case"defaultValue":c=b;break;case"children":o=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:Re(e,t,m,b,n,null)}Jo(e,a,c,o);return;case"option":for(S in n)if(n.hasOwnProperty(S)&&(a=n[S],a!=null))switch(S){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Re(e,t,S,a,n,null)}return;case"dialog":be("beforetoggle",e),be("toggle",e),be("cancel",e),be("close",e);break;case"iframe":case"object":be("load",e);break;case"video":case"audio":for(a=0;a<cs.length;a++)be(cs[a],e);break;case"image":be("error",e),be("load",e);break;case"details":be("toggle",e);break;case"embed":case"source":case"link":be("error",e),be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(A in n)if(n.hasOwnProperty(A)&&(a=n[A],a!=null))switch(A){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Re(e,t,A,a,n,null)}return;default:if(Ou(t)){for(U in n)n.hasOwnProperty(U)&&(a=n[U],a!==void 0&&yr(e,t,U,a,n,void 0));return}}for(b in n)n.hasOwnProperty(b)&&(a=n[b],a!=null&&Re(e,t,b,a,n,null))}function _0(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,o=null,m=null,b=null,S=null,A=null,U=null;for(D in n){var H=n[D];if(n.hasOwnProperty(D)&&H!=null)switch(D){case"checked":break;case"value":break;case"defaultValue":S=H;default:a.hasOwnProperty(D)||Re(e,t,D,null,a,H)}}for(var C in a){var D=a[C];if(H=n[C],a.hasOwnProperty(C)&&(D!=null||H!=null))switch(C){case"type":o=D;break;case"name":c=D;break;case"checked":A=D;break;case"defaultChecked":U=D;break;case"value":m=D;break;case"defaultValue":b=D;break;case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(137,t));break;default:D!==H&&Re(e,t,C,D,a,H)}}zu(e,m,b,S,A,U,o,c);return;case"select":D=m=b=C=null;for(o in n)if(S=n[o],n.hasOwnProperty(o)&&S!=null)switch(o){case"value":break;case"multiple":D=S;default:a.hasOwnProperty(o)||Re(e,t,o,null,a,S)}for(c in a)if(o=a[c],S=n[c],a.hasOwnProperty(c)&&(o!=null||S!=null))switch(c){case"value":C=o;break;case"defaultValue":b=o;break;case"multiple":m=o;default:o!==S&&Re(e,t,c,o,a,S)}t=b,n=m,a=D,C!=null?Dl(e,!!n,C,!1):!!a!=!!n&&(t!=null?Dl(e,!!n,t,!0):Dl(e,!!n,n?[]:"",!1));return;case"textarea":D=C=null;for(b in n)if(c=n[b],n.hasOwnProperty(b)&&c!=null&&!a.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Re(e,t,b,null,a,c)}for(m in a)if(c=a[m],o=n[m],a.hasOwnProperty(m)&&(c!=null||o!=null))switch(m){case"value":C=c;break;case"defaultValue":D=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(r(91));break;default:c!==o&&Re(e,t,m,c,a,o)}Ko(e,C,D);return;case"option":for(var F in n)if(C=n[F],n.hasOwnProperty(F)&&C!=null&&!a.hasOwnProperty(F))switch(F){case"selected":e.selected=!1;break;default:Re(e,t,F,null,a,C)}for(S in a)if(C=a[S],D=n[S],a.hasOwnProperty(S)&&C!==D&&(C!=null||D!=null))switch(S){case"selected":e.selected=C&&typeof C!="function"&&typeof C!="symbol";break;default:Re(e,t,S,C,a,D)}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 re in n)C=n[re],n.hasOwnProperty(re)&&C!=null&&!a.hasOwnProperty(re)&&Re(e,t,re,null,a,C);for(A in a)if(C=a[A],D=n[A],a.hasOwnProperty(A)&&C!==D&&(C!=null||D!=null))switch(A){case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(r(137,t));break;default:Re(e,t,A,C,a,D)}return;default:if(Ou(t)){for(var Ue in n)C=n[Ue],n.hasOwnProperty(Ue)&&C!==void 0&&!a.hasOwnProperty(Ue)&&yr(e,t,Ue,void 0,a,C);for(U in a)C=a[U],D=n[U],!a.hasOwnProperty(U)||C===D||C===void 0&&D===void 0||yr(e,t,U,C,a,D);return}}for(var E in n)C=n[E],n.hasOwnProperty(E)&&C!=null&&!a.hasOwnProperty(E)&&Re(e,t,E,null,a,C);for(H in a)C=a[H],D=n[H],!a.hasOwnProperty(H)||C===D||C==null&&D==null||Re(e,t,H,C,a,D)}function Ph(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function A0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var c=n[a],o=c.transferSize,m=c.initiatorType,b=c.duration;if(o&&b&&Ph(m)){for(m=0,b=c.responseEnd,a+=1;a<n.length;a++){var S=n[a],A=S.startTime;if(A>b)break;var U=S.transferSize,H=S.initiatorType;U&&Ph(H)&&(S=S.responseEnd,m+=U*(S<b?1:(b-A)/(S-A)))}if(--a,t+=8*(o+m)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var gr=null,br=null;function Di(e){return e.nodeType===9?e:e.ownerDocument}function em(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function tm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function jr(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sr=null;function T0(){var e=window.event;return e&&e.type==="popstate"?e===Sr?!1:(Sr=e,!0):(Sr=null,!1)}var nm=typeof setTimeout=="function"?setTimeout:void 0,z0=typeof clearTimeout=="function"?clearTimeout:void 0,lm=typeof Promise=="function"?Promise:void 0,C0=typeof queueMicrotask=="function"?queueMicrotask:typeof lm<"u"?function(e){return lm.resolve(null).then(e).catch(O0)}:nm;function O0(e){setTimeout(function(){throw e})}function Bn(e){return e==="head"}function am(e,t){var n=t,a=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(c),da(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")os(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,os(n);for(var o=n.firstChild;o;){var m=o.nextSibling,b=o.nodeName;o[Aa]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=m}}else n==="body"&&os(e.ownerDocument.body);n=c}while(n);da(t)}function sm(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Nr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Nr(n),Au(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function D0(e,t,n,a){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Aa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=Ht(e.nextSibling),e===null)break}return null}function R0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ht(e.nextSibling),e===null))return null;return e}function im(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ht(e.nextSibling),e===null))return null;return e}function wr(e){return e.data==="$?"||e.data==="$~"}function Mr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function U0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Ht(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Er=null;function um(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ht(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function cm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function rm(e,t,n){switch(t=Di(n),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function os(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Au(e)}var qt=new Map,om=new Set;function Ri(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gn=Q.d;Q.d={f:k0,r:$0,D:H0,C:q0,L:B0,m:L0,X:G0,S:Y0,M:X0};function k0(){var e=gn.f(),t=Mi();return e||t}function $0(e){var t=zl(e);t!==null&&t.tag===5&&t.type==="form"?_f(t):gn.r(e)}var ca=typeof document>"u"?null:document;function dm(e,t,n){var a=ca;if(a&&typeof t=="string"&&t){var c=Ct(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),om.has(c)||(om.add(c),e={rel:e,crossOrigin:n,href:t},a.querySelector(c)===null&&(t=a.createElement("link"),ut(t,"link",e),et(t),a.head.appendChild(t)))}}function H0(e){gn.D(e),dm("dns-prefetch",e,null)}function q0(e,t){gn.C(e,t),dm("preconnect",e,t)}function B0(e,t,n){gn.L(e,t,n);var a=ca;if(a&&e&&t){var c='link[rel="preload"][as="'+Ct(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+Ct(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+Ct(n.imageSizes)+'"]')):c+='[href="'+Ct(e)+'"]';var o=c;switch(t){case"style":o=ra(e);break;case"script":o=oa(e)}qt.has(o)||(e=g({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),qt.set(o,e),a.querySelector(c)!==null||t==="style"&&a.querySelector(ds(o))||t==="script"&&a.querySelector(fs(o))||(t=a.createElement("link"),ut(t,"link",e),et(t),a.head.appendChild(t)))}}function L0(e,t){gn.m(e,t);var n=ca;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Ct(a)+'"][href="'+Ct(e)+'"]',o=c;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=oa(e)}if(!qt.has(o)&&(e=g({rel:"modulepreload",href:e},t),qt.set(o,e),n.querySelector(c)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(fs(o)))return}a=n.createElement("link"),ut(a,"link",e),et(a),n.head.appendChild(a)}}}function Y0(e,t,n){gn.S(e,t,n);var a=ca;if(a&&e){var c=Cl(a).hoistableStyles,o=ra(e);t=t||"default";var m=c.get(o);if(!m){var b={loading:0,preload:null};if(m=a.querySelector(ds(o)))b.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},n),(n=qt.get(o))&&_r(e,n);var S=m=a.createElement("link");et(S),ut(S,"link",e),S._p=new Promise(function(A,U){S.onload=A,S.onerror=U}),S.addEventListener("load",function(){b.loading|=1}),S.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Ui(m,t,a)}m={type:"stylesheet",instance:m,count:1,state:b},c.set(o,m)}}}function G0(e,t){gn.X(e,t);var n=ca;if(n&&e){var a=Cl(n).hoistableScripts,c=oa(e),o=a.get(c);o||(o=n.querySelector(fs(c)),o||(e=g({src:e,async:!0},t),(t=qt.get(c))&&Ar(e,t),o=n.createElement("script"),et(o),ut(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(c,o))}}function X0(e,t){gn.M(e,t);var n=ca;if(n&&e){var a=Cl(n).hoistableScripts,c=oa(e),o=a.get(c);o||(o=n.querySelector(fs(c)),o||(e=g({src:e,async:!0,type:"module"},t),(t=qt.get(c))&&Ar(e,t),o=n.createElement("script"),et(o),ut(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(c,o))}}function fm(e,t,n,a){var c=(c=ye.current)?Ri(c):null;if(!c)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ra(n.href),n=Cl(c).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ra(n.href);var o=Cl(c).hoistableStyles,m=o.get(e);if(m||(c=c.ownerDocument||c,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,m),(o=c.querySelector(ds(e)))&&!o._p&&(m.instance=o,m.state.loading=5),qt.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},qt.set(e,n),o||Q0(c,e,n,m.state))),t&&a===null)throw Error(r(528,""));return m}if(t&&a!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=oa(n),n=Cl(c).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function ra(e){return'href="'+Ct(e)+'"'}function ds(e){return'link[rel="stylesheet"]['+e+"]"}function hm(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Q0(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),ut(t,"link",n),et(t),e.head.appendChild(t))}function oa(e){return'[src="'+Ct(e)+'"]'}function fs(e){return"script[async]"+e}function mm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ct(n.href)+'"]');if(a)return t.instance=a,et(a),a;var c=g({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),et(a),ut(a,"style",c),Ui(a,n.precedence,e),t.instance=a;case"stylesheet":c=ra(n.href);var o=e.querySelector(ds(c));if(o)return t.state.loading|=4,t.instance=o,et(o),o;a=hm(n),(c=qt.get(c))&&_r(a,c),o=(e.ownerDocument||e).createElement("link"),et(o);var m=o;return m._p=new Promise(function(b,S){m.onload=b,m.onerror=S}),ut(o,"link",a),t.state.loading|=4,Ui(o,n.precedence,e),t.instance=o;case"script":return o=oa(n.src),(c=e.querySelector(fs(o)))?(t.instance=c,et(c),c):(a=n,(c=qt.get(o))&&(a=g({},n),Ar(a,c)),e=e.ownerDocument||e,c=e.createElement("script"),et(c),ut(c,"link",a),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ui(a,n.precedence,e));return t.instance}function Ui(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=a.length?a[a.length-1]:null,o=c,m=0;m<a.length;m++){var b=a[m];if(b.dataset.precedence===t)o=b;else if(o!==c)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function _r(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ar(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ki=null;function pm(e,t,n){if(ki===null){var a=new Map,c=ki=new Map;c.set(n,a)}else c=ki,a=c.get(n),a||(a=new Map,c.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var o=n[c];if(!(o[Aa]||o[lt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var m=o.getAttribute(t)||"";m=e+m;var b=a.get(m);b?b.push(o):a.set(m,[o])}}return a}function vm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Z0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function xm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function V0(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=ra(a.href),o=t.querySelector(ds(c));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=$i.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,et(o);return}o=t.ownerDocument||t,a=hm(a),(c=qt.get(c))&&_r(a,c),o=o.createElement("link"),et(o);var m=o;m._p=new Promise(function(b,S){m.onload=b,m.onerror=S}),ut(o,"link",a),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=$i.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Tr=0;function K0(e,t){return e.stylesheets&&e.count===0&&qi(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&qi(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Tr===0&&(Tr=62500*A0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&qi(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Tr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(c)}}:null}function $i(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hi=null;function qi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hi=new Map,t.forEach(J0,e),Hi=null,$i.call(e))}function J0(e,t){if(!(t.state.loading&4)){var n=Hi.get(e);if(n)var a=n.get(null);else{n=new Map,Hi.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<c.length;o++){var m=c[o];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),a=m)}a&&n.set(null,a)}c=t.instance,m=c.getAttribute("data-precedence"),o=n.get(m)||a,o===a&&n.set(null,c),n.set(m,c),this.count++,a=$i.bind(this),c.addEventListener("load",a),c.addEventListener("error",a),o?o.parentNode.insertBefore(c,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var hs={$$typeof:z,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function W0(e,t,n,a,c,o,m,b,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wu(0),this.hiddenUpdates=wu(null),this.identifierPrefix=a,this.onUncaughtError=c,this.onCaughtError=o,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function ym(e,t,n,a,c,o,m,b,S,A,U,H){return e=new W0(e,t,n,m,S,A,U,H,b),t=1,o===!0&&(t|=24),o=wt(3,null,null,t),e.current=o,o.stateNode=e,t=cc(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:a,isDehydrated:n,cache:t},fc(o),e}function gm(e){return e?(e=Ll,e):Ll}function bm(e,t,n,a,c,o){c=gm(c),a.context===null?a.context=c:a.pendingContext=c,a=Tn(t),a.payload={element:n},o=o===void 0?null:o,o!==null&&(a.callback=o),n=zn(e,a,t),n!==null&&(yt(n,e,t),Qa(n,e,t))}function jm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function zr(e,t){jm(e,t),(e=e.alternate)&&jm(e,t)}function Sm(e){if(e.tag===13||e.tag===31){var t=nl(e,67108864);t!==null&&yt(t,e,67108864),zr(e,67108864)}}function Nm(e){if(e.tag===13||e.tag===31){var t=Tt();t=Mu(t);var n=nl(e,t);n!==null&&yt(n,e,t),zr(e,t)}}var Bi=!0;function F0(e,t,n,a){var c=O.T;O.T=null;var o=Q.p;try{Q.p=2,Cr(e,t,n,a)}finally{Q.p=o,O.T=c}}function I0(e,t,n,a){var c=O.T;O.T=null;var o=Q.p;try{Q.p=8,Cr(e,t,n,a)}finally{Q.p=o,O.T=c}}function Cr(e,t,n,a){if(Bi){var c=Or(a);if(c===null)xr(e,t,a,Li,n),Mm(e,a);else if(ey(c,e,t,n,a))a.stopPropagation();else if(Mm(e,a),t&4&&-1<P0.indexOf(e)){for(;c!==null;){var o=zl(c);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var m=Fn(o.pendingLanes);if(m!==0){var b=o;for(b.pendingLanes|=2,b.entangledLanes|=2;m;){var S=1<<31-St(m);b.entanglements[1]|=S,m&=~S}Jt(o),(Ae&6)===0&&(Ni=bt()+500,us(0))}}break;case 31:case 13:b=nl(o,2),b!==null&&yt(b,o,2),Mi(),zr(o,2)}if(o=Or(a),o===null&&xr(e,t,a,Li,n),o===c)break;c=o}c!==null&&a.stopPropagation()}else xr(e,t,a,null,n)}}function Or(e){return e=Ru(e),Dr(e)}var Li=null;function Dr(e){if(Li=null,e=Tl(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=f(t),e!==null)return e;e=null}else if(n===31){if(e=v(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Li=e,null}function wm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Hv()){case Co:return 2;case Oo:return 8;case zs:case qv:return 32;case Do:return 268435456;default:return 32}default:return 32}}var Rr=!1,Ln=null,Yn=null,Gn=null,ms=new Map,ps=new Map,Xn=[],P0="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 Mm(e,t){switch(e){case"focusin":case"focusout":Ln=null;break;case"dragenter":case"dragleave":Yn=null;break;case"mouseover":case"mouseout":Gn=null;break;case"pointerover":case"pointerout":ms.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ps.delete(t.pointerId)}}function vs(e,t,n,a,c,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:o,targetContainers:[c]},t!==null&&(t=zl(t),t!==null&&Sm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function ey(e,t,n,a,c){switch(t){case"focusin":return Ln=vs(Ln,e,t,n,a,c),!0;case"dragenter":return Yn=vs(Yn,e,t,n,a,c),!0;case"mouseover":return Gn=vs(Gn,e,t,n,a,c),!0;case"pointerover":var o=c.pointerId;return ms.set(o,vs(ms.get(o)||null,e,t,n,a,c)),!0;case"gotpointercapture":return o=c.pointerId,ps.set(o,vs(ps.get(o)||null,e,t,n,a,c)),!0}return!1}function Em(e){var t=Tl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=f(n),t!==null){e.blockedOn=t,qo(e.priority,function(){Nm(n)});return}}else if(t===31){if(t=v(n),t!==null){e.blockedOn=t,qo(e.priority,function(){Nm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Yi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Or(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Du=a,n.target.dispatchEvent(a),Du=null}else return t=zl(n),t!==null&&Sm(t),e.blockedOn=n,!1;t.shift()}return!0}function _m(e,t,n){Yi(e)&&n.delete(t)}function ty(){Rr=!1,Ln!==null&&Yi(Ln)&&(Ln=null),Yn!==null&&Yi(Yn)&&(Yn=null),Gn!==null&&Yi(Gn)&&(Gn=null),ms.forEach(_m),ps.forEach(_m)}function Gi(e,t){e.blockedOn===t&&(e.blockedOn=null,Rr||(Rr=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,ty)))}var Xi=null;function Am(e){Xi!==e&&(Xi=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Xi===e&&(Xi=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],c=e[t+2];if(typeof a!="function"){if(Dr(a||n)===null)continue;break}var o=zl(n);o!==null&&(e.splice(t,3),t-=3,Oc(o,{pending:!0,data:c,method:n.method,action:a},a,c))}}))}function da(e){function t(S){return Gi(S,e)}Ln!==null&&Gi(Ln,e),Yn!==null&&Gi(Yn,e),Gn!==null&&Gi(Gn,e),ms.forEach(t),ps.forEach(t);for(var n=0;n<Xn.length;n++){var a=Xn[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Xn.length&&(n=Xn[0],n.blockedOn===null);)Em(n),n.blockedOn===null&&Xn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var c=n[a],o=n[a+1],m=c[ft]||null;if(typeof o=="function")m||Am(n);else if(m){var b=null;if(o&&o.hasAttribute("formAction")){if(c=o,m=o[ft]||null)b=m.formAction;else if(Dr(c)!==null)continue}else b=m.action;typeof b=="function"?n[a+1]=b:(n.splice(a,3),a-=3),Am(n)}}}function Tm(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(m){return c=m})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Ur(e){this._internalRoot=e}Qi.prototype.render=Ur.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,a=Tt();bm(n,a,e,t,null,null)},Qi.prototype.unmount=Ur.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bm(e.current,2,null,e,null,null),Mi(),t[Al]=null}};function Qi(e){this._internalRoot=e}Qi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ho();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Xn.length&&t!==0&&t<Xn[n].priority;n++);Xn.splice(n,0,e),n===0&&Em(e)}};var zm=i.version;if(zm!=="19.2.8")throw Error(r(527,zm,"19.2.8"));Q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=p(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var ny={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zi.isDisabled&&Zi.supportsFiber)try{Ma=Zi.inject(ny),jt=Zi}catch{}}return ys.createRoot=function(e,t){if(!d(e))throw Error(r(299));var n=!1,a="",c=$f,o=Hf,m=qf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=ym(e,1,!1,null,null,n,a,null,c,o,m,Tm),e[Al]=t.current,vr(e),new Ur(t)},ys.hydrateRoot=function(e,t,n){if(!d(e))throw Error(r(299));var a=!1,c="",o=$f,m=Hf,b=qf,S=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),t=ym(e,1,!0,t,n??null,a,c,S,o,m,b,Tm),t.context=gm(null),n=t.current,a=Tt(),a=Mu(a),c=Tn(a),c.callback=null,zn(n,c,a),n=a,t.current.lanes=n,_a(t,n),Jt(t),e[Al]=t.current,vr(e),new Qi(t)},ys.version="19.2.8",ys}var Bm;function py(){if(Bm)return qr.exports;Bm=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(i){console.error(i)}}return l(),qr.exports=my(),qr.exports}var vy=py();const Lm=l=>{let i;const u=new Set,r=(p,x)=>{const g=typeof p=="function"?p(i):p;if(!Object.is(g,i)){const j=i;i=x??(typeof g!="object"||g===null)?g:Object.assign({},i,g),u.forEach(M=>M(i,j))}},d=()=>i,v={setState:r,getState:d,getInitialState:()=>y,subscribe:p=>(u.add(p),()=>u.delete(p))},y=i=l(r,d,v);return v},xy=(l=>l?Lm(l):Lm),yy=l=>l;function gy(l,i=yy){const u=Vi.useSyncExternalStore(l.subscribe,Vi.useCallback(()=>i(l.getState()),[l,i]),Vi.useCallback(()=>i(l.getInitialState()),[l,i]));return Vi.useDebugValue(u),u}const Ym=l=>{const i=xy(l),u=r=>gy(i,r);return Object.assign(u,i),u},El=(l=>l?Ym(l):Ym);function by(l){const i=encodeURIComponent(l.sid),u=l.addr?`#/${i}/${encodeURIComponent(l.addr)}`:`#/${i}`,r=[];return l.record&&r.push(`record=${encodeURIComponent(l.record)}`),l.symbol&&r.push(`symbol=${encodeURIComponent(l.symbol)}`),r.length?`${u}?${r.join("&")}`:u}function jy(l){const i=l.replace(/^#\/?/,"");if(!i)return null;const u=i.indexOf("?"),r=u<0?i:i.slice(0,u),d=u<0?"":i.slice(u+1),h=r.indexOf("/");try{const f={record:null,symbol:null};for(const p of d.split("&")){const x=p.indexOf("=");if(x<0)continue;const g=p.slice(0,x),j=decodeURIComponent(p.slice(x+1));g==="record"?f.record=j||null:g==="symbol"&&(f.symbol=j||null)}if(h<0){const p=decodeURIComponent(r);return p?{sid:p,addr:null,...f}:null}const v=decodeURIComponent(r.slice(0,h)),y=decodeURIComponent(r.slice(h+1));return v?{sid:v,addr:y||null,...f}:null}catch{return null}}function ho(l){const i=l.indexOf('"'),u=l.indexOf(":");if(u<0||i>=0&&i<u)return"";const r=l.slice(0,u);return/^(@[A-Za-z0-9_-]+(\+[A-Za-z0-9_-]+)*|[A-Za-z_][A-Za-z0-9_-]*)$/.test(r)?`${r}:`:""}function Sy(l){if(!l)return null;const i=ho(l);return i&&!i.startsWith("@")?i.slice(0,-1):null}function tu(l,i,u,r=""){var y,p;const d=(y=l[0])==null?void 0:y.ticks[i],h=(p=l[1])==null?void 0:p.ticks[u];if(!d||!h)throw new Error(`cell ${i},${u} is outside the axes`);if(!d.addressable||!h.addressable)return null;const f=[d.frag,h.frag].filter(x=>x),v=h.port??d.port??"h";return`${r}${f.join(".")}.${v}`}function Gm(l,i){if(i===l.addr)return null;const u=[...l.history.slice(0,l.index+1),i].slice(-200);return{addr:i,history:u,index:u.length-1}}function Ny(l){const i=El((u,r)=>({sid:null,addr:null,record:null,symbol:null,history:[],index:-1,go(d){const h=Gm(r(),d);h&&u(h)},open(d){const h={};d.record!==void 0&&d.record!==r().record&&(h.record=d.record),d.symbol!==void 0&&d.symbol!==r().symbol&&(h.symbol=d.symbol),Object.keys(h).length&&u(h)},setSession(d,h=null,f={}){u({sid:d,addr:h,record:f.record??null,symbol:f.symbol??null,history:h?[h]:[],index:h?0:-1})},back(){const{history:d,index:h}=r();h>0&&u({index:h-1,addr:d[h-1]??null})},forward(){const{history:d,index:h}=r();h<d.length-1&&u({index:h+1,addr:d[h+1]??null})},syncFromLocation(){const d=jy(l.read());if(!d)return;const{sid:h}=r();if(d.sid!==h){r().setSession(d.sid,d.addr,d);return}u({...d.addr?Gm(r(),d.addr):null,record:d.record,symbol:d.symbol})}}));return i.subscribe((u,r)=>{if(!u.sid||u.sid===r.sid&&u.addr===r.addr&&u.record===r.record&&u.symbol===r.symbol)return;const d=by({sid:u.sid,addr:u.addr,record:u.record,symbol:u.symbol});l.read()!==d&&l.write(d)}),l.listen(()=>i.getState().syncFromLocation()),i}const wy={read:()=>typeof window>"u"?"":window.location.hash,write:l=>{typeof window<"u"&&window.history.pushState(null,"",l)},listen:l=>typeof window>"u"?()=>{}:(window.addEventListener("hashchange",l),window.addEventListener("popstate",l),()=>{window.removeEventListener("hashchange",l),window.removeEventListener("popstate",l)})},de=Ny(wy),My=1600,Be=El(l=>({lens:"cuts",zoom:"slice",drawerOpen:!0,inspectorOpen:typeof window<"u"&&window.innerWidth>=My,recordKind:null,symbolsAtCursor:!1,inspect:null,help:!1,command:!1,theme:"system",set:i=>l(i)}));de.subscribe((l,i)=>{(l.addr!==i.addr||l.sid!==i.sid)&&Be.getState().inspect&&Be.setState({inspect:null})});const $p="mdb-address";function Ey(){const l=de(x=>x.addr),i=de(x=>x.go),u=de(x=>x.back),r=de(x=>x.forward),d=de(x=>x.index),h=de(x=>x.history.length),f=Be(x=>x.set),[v,y]=L.useState(l??""),p=L.useRef(null);return L.useEffect(()=>y(l??""),[l]),s.jsxs("form",{className:"address-bar",onSubmit:x=>{var j;x.preventDefault();const g=v.trim();g&&i(g),f({inspect:null}),(j=p.current)==null||j.blur()},children:[s.jsx("button",{type:"button",onClick:u,disabled:d<=0,title:"cursor history back (Alt+←)",children:"‹"}),s.jsx("button",{type:"button",onClick:r,disabled:d>=h-1,title:"cursor history forward (Alt+→)",children:"›"}),s.jsx("input",{id:$p,ref:p,className:"mono address-input",value:v,spellCheck:!1,"aria-label":"occurrence address",placeholder:"address, e.g. t2.L1.h",onChange:x=>y(x.target.value),onKeyDown:x=>{var g;x.key==="Escape"&&(y(l??""),(g=p.current)==null||g.blur())}})]})}function _y(l){const i=l.trim().replace(/^\//,""),[u="",...r]=i.split(/\s+/),d=r.join(" ");switch(u){case"go":return d?{kind:"go",addr:d}:{kind:"error",message:"go needs an address"};case"session":case"s":return d?{kind:"session",sid:d}:{kind:"error",message:"session needs an id"};case"lens":return d?{kind:"lens",lens:d}:{kind:"error",message:"lens needs a name"};case"zoom":return d==="slice"||d==="session"?{kind:"zoom",zoom:d}:{kind:"error",message:"zoom is slice or session"};case"record":case"r":return d?{kind:"record",id:d}:{kind:"error",message:"record needs an id"};case"symbol":return d?{kind:"symbol",id:d}:{kind:"error",message:"symbol needs an id"};case"":return{kind:"error",message:"empty command"};default:return{kind:"go",addr:i}}}function Ay(){const l=Be(x=>x.command),i=Be(x=>x.set),u=de(x=>x.go),r=de(x=>x.open),d=de(x=>x.setSession),[h,f]=L.useState(""),[v,y]=L.useState(null);if(!l)return null;const p=()=>{const x=_y(h);if(x.kind==="error")return y(x.message);x.kind==="go"&&u(x.addr),x.kind==="session"&&d(x.sid),x.kind==="lens"&&i({lens:x.lens}),x.kind==="zoom"&&i({zoom:x.zoom}),x.kind==="record"&&(r({record:x.id}),i({drawerOpen:!0})),x.kind==="symbol"&&r({symbol:x.id}),f(""),y(null),i({command:!1})};return s.jsxs("div",{className:"command",role:"dialog","aria-label":"command line",children:[s.jsx("form",{onSubmit:x=>{x.preventDefault(),p()},children:s.jsx("input",{autoFocus:!0,className:"mono",style:{width:"100%"},value:h,placeholder:"address | go ADDR | session ID | lens NAME | zoom slice|session | record ID | symbol ID",onChange:x=>f(x.target.value),onKeyDown:x=>{x.key==="Escape"&&i({command:!1})}})}),v&&s.jsx("div",{className:"muted",children:v})]})}class pl extends L.Component{constructor(){super(...arguments);kr(this,"state",{error:null})}static getDerivedStateFromError(u){return{error:u}}render(){return this.state.error?s.jsxs("div",{className:"na",role:"alert",children:[s.jsxs("strong",{children:[this.props.name," failed:"]})," ",this.state.error.message," ",s.jsx("button",{type:"button",onClick:()=>this.setState({error:null}),children:"retry"})]}):this.props.children}}const Hp=["measured","derived-exact","derived-local","bound","supplied","unresolved","refused"];function fu(l){switch(l){case"measured":return"solid";case"derived-exact":case"derived-local":case"bound":return"hollow";case"supplied":return"hatched";case"unresolved":return"dashed-empty";case"refused":return"refused"}}function Ty(l){return fu(l)==="hollow"}function mo(l){return typeof l=="string"&&Hp.includes(l)}function zy(l){if(typeof l!="object"||l===null||!("ev"in l)||!mo(l.ev))return!1;if("v"in l){const i=l.v;return typeof i=="number"||i===null}return!1}function lu(l){if(zy(l))return l;if(typeof l!="object"||l===null||Array.isArray(l))return null;const i=l;return!mo(i.authority)||!("value"in i)||i.value!==null&&(typeof i.value!="number"||typeof i.value=="boolean")?null:{v:i.value,ev:i.authority,unit:typeof i.unit=="string"?i.unit:null,proof:typeof i.proof=="string"?i.proof:null,ptr:typeof i.ptr=="string"?i.ptr:null,reason:typeof i.reason=="string"?i.reason:null,note:typeof i.note=="string"?i.note:null,recorded_authority:typeof i.recorded_authority=="string"?i.recorded_authority:null}}function Cy(l){return l.note||null}function Oy(l){return Ry(Dy(l))}function Dy(l){if(!Number.isFinite(l))return String(l);if(Number.isInteger(l)&&Math.abs(l)<1e15)return l.toString();const i=Math.abs(l);return i!==0&&(i<.001||i>=1e6)?l.toExponential(3):Number(l.toPrecision(4)).toString()}function Ry(l){return l.replace(/-/g,"−")}function Gt({ev:l,size:i=10,proof:u=null}){const r=`${l}${u?` · proof ${u}`:""}`,d=fu(l),h=i/2-1,f=i/2;return s.jsxs("svg",{width:i,height:i,viewBox:`0 0 ${i} ${i}`,role:"img","aria-label":`${r} evidence`,"data-ev":l,style:{verticalAlign:"middle",flex:"none"},children:[s.jsx("title",{children:r}),d==="solid"&&s.jsx("circle",{cx:f,cy:f,r:h,fill:"currentColor"}),d==="hollow"&&s.jsx("circle",{cx:f,cy:f,r:h,fill:"none",stroke:"currentColor",strokeWidth:1.4}),d==="hatched"&&s.jsxs("g",{stroke:"currentColor",strokeWidth:1,children:[s.jsx("circle",{cx:f,cy:f,r:h,fill:"none"}),s.jsx("line",{x1:f-h*.7,y1:f+h*.7,x2:f+h*.7,y2:f-h*.7}),s.jsx("line",{x1:f-h,y1:f,x2:f,y2:f-h}),s.jsx("line",{x1:f,y1:f+h,x2:f+h,y2:f})]}),d==="dashed-empty"&&s.jsx("circle",{cx:f,cy:f,r:h,fill:"none",stroke:"currentColor",strokeWidth:1,strokeDasharray:"2 1.5",opacity:.7}),d==="refused"&&s.jsxs("g",{stroke:"currentColor",strokeWidth:1.4,children:[s.jsx("line",{x1:1,y1:1,x2:i-1,y2:i-1}),s.jsx("line",{x1:i-1,y1:1,x2:1,y2:i-1})]})]})}const Uy=[["← / ↑","previous recorded state on this branch"],["→ / ↓","next recorded state on this branch"],["Alt+← / Alt+→","cursor history back / forward"],["g","go to address (focus the address bar)"],["/","command line (navigation only)"],["?","this help"],["Esc","close overlays"]],ky={measured:"read from retained bytes or a native receipt","derived-exact":"computed exactly from measured values (chip names the proof)","derived-local":"local approximation, e.g. a linearisation (chip names the proof)",bound:"a proven bound, not a value",supplied:"given by a person or a declaration, not measured",unresolved:"the project does not hold this value; shown empty, never zero",refused:"the server or renderer refused to show it"};function $y(){const l=Be(u=>u.help),i=Be(u=>u.set);return l?s.jsx("div",{className:"overlay",role:"dialog","aria-label":"help",onClick:()=>i({help:!1}),children:s.jsxs("div",{className:"panel panel-body",onClick:u=>u.stopPropagation(),style:{maxWidth:560},children:[s.jsx("h3",{style:{marginTop:0},children:"Keys"}),s.jsx("table",{children:s.jsx("tbody",{children:Uy.map(([u,r])=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:u}),s.jsx("td",{children:r})]},u))})}),s.jsx("h3",{children:"Evidence"}),s.jsx("table",{children:s.jsx("tbody",{children:Hp.map(u=>s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx(Gt,{ev:u})," ",u]}),s.jsx("td",{children:ky[u]})]},u))})}),s.jsx("p",{className:"muted",children:"Colour marks roles only. Evidence is shape and fill."})]})}):null}function po({what:l,reason:i}){return s.jsxs("div",{className:"na",role:"note","data-testid":"not-available",children:[s.jsxs("strong",{children:[l,": not available."]})," ",i??"The project holds no data for this."]})}const Xm={host_not_allowed:"The server does not accept this Host header; open it at the address it printed (localhost or 127.0.0.1).",origin_not_allowed:"The server does not accept requests from this page origin.",over_limit:"The request exceeds a server limit (size, count or rate); narrow it and retry.",over_cap:"The answer would exceed the response cap, so the server sent nothing.",missing_host:"The request carried no Host header, so the server refused it.",method_not_allowed:"The server does not allow this HTTP method on that route (it is read-only).",bad_request:"The server could not parse the request.",http_error:"The server answered with an HTTP error it could not describe further.",internal_error:"The server failed on this request; its log has the detail.",bad_params:"The server could not use the request parameters.",web_build_absent:"The web build is not installed on the server, so there is no page to show.",bad_envelope:"The server answered with a body this page cannot read.",bad_response:"The server answer was not JSON.",network:"The server could not be reached."};function Kn({what:l,refused:i}){return s.jsxs("div",{className:"na",role:"note","data-refused":i.refused,children:[s.jsxs("strong",{children:[l,": refused"]})," ",s.jsx("code",{children:i.refused}),Xm[i.refused]?s.jsxs("span",{className:"muted",children:[" ",Xm[i.refused]]}):null,i.detail?s.jsxs("span",{className:"muted",children:[" ",i.detail]}):null,i.bytes!=null?s.jsxs("span",{className:"faint",children:[" ","(",String(i.bytes)," bytes",i.cap!=null?`, cap ${String(i.cap)}`:"",")"]}):null]})}function ie(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)}function ue(l,...i){let u=l;for(const r of i)if(Array.isArray(u)&&typeof r=="number")u=u[r];else if(ie(u)&&typeof r=="string")u=u[r];else return;return u}function R(l){return typeof l=="string"?l:null}function wl(l){return Array.isArray(l)?l.filter(i=>typeof i=="string"):[]}function Ft(l){return Array.isArray(l)?l.filter(ie):[]}function Ie(l){return typeof l=="number"&&Number.isInteger(l)?l:null}function Gr(l,i="unresolved"){return{v:null,ev:i,reason:l,unit:null,proof:null,ptr:null,note:null,recorded_authority:null}}const Hy=["max_abs","norm","mean","min","max"];function ga(l,i="value"){if(l==null)return{kind:"absent",n:Gr(`the op result has no ${i}`)};const u=lu(l);if(u)return{kind:"num",n:u};if(ie(l)){const r=R(l.state);if(r==="unresolved"||r==="refused")return{kind:"absent",n:Gr(R(l.reason)??r,r)};const d=[];for(const h of Hy){const f=lu(l[h]);f&&d.push([h,f])}if(d.length)return{kind:"summary",parts:d};if("value"in l&&!("authority"in l))return ga(l.value,i)}return{kind:"absent",n:Gr(`${i} is not a labelled value`,"refused")}}function to(l){if(l.kind==="num")return l.n.v===null?null:{v:l.n.v,signed:!0};if(l.kind==="summary"){const i=l.parts.find(([u])=>u==="norm")??l.parts[0];return i&&i[1].v!==null?{v:i[1].v,signed:!1}:null}return null}function qp(l){const i=l.replace(/\s*\(unlisted\)$/,"").trim(),u=/^t(\d+)\.(.+)$/.exec(i);if(!u)return null;const r=(u[2]??"").split("[")[0]??"";return r==="M"||r==="logits"?`t${u[1]}.logits`:/^(L\d+\.)?[A-Za-z_]+$/.test(r)?`t${u[1]}.${r}`:null}function vo(l,i){const u=typeof i=="string"?i.trim():"";return!u||l.includes("[")?l:`${l}[${u}]`}function qy(l){const i=/^t(\d+)\.(?:L(\d+)\.)?/.exec(l);return i?[Number(i[1]),i[2]===void 0?null:Number(i[2])]:null}function Bp(l){const i=/src=(\d+)/.exec(l);return i?Number(i[1]):null}const By=["at","i","x","y","x0","x1","y0","y1","w","h","level","lane","count","bytes","cap","seq","page","pages","total","order","mask","k","bins","axis","axes","fixed","shape","outShape","full","index","selector","select","item","block","head","kvGroup","step","clock","pos","token","layer","nonfinite","counts","cuts","receipts","symbols","records","sessions","rows","id","locationsMore","readersMore","usesMore","evidenceMore","limits","kinds","attention_selector","contrast","decision","edges","kv_group","kv_head","left","right","local_clock","logical_step","native_payload_reads","native_transition_index","neuron","feature","nodes","own_tokens","query_head","receiver_row","repeated_argument_groups","row","size","source_row","src","steps","stride","token_id","token_ids","tokens","torch_num_threads","transition","n","depth","heads","offset","limit","omitted"],no={hello:"mdb-view-hello-v1",sessions:"mdb-view-sessions-v1",capabilities:"mdb-view-capabilities-v1",frame:"mdb-view-frame-v1",timeline:"mdb-view-timeline-v1",branches:"mdb-view-branches-v1",symbols:"mdb-view-symbols-v1",symbol:"mdb-view-symbol-v1",graph:"mdb-view-graph-v1",records:"mdb-view-records-v1",record:"mdb-view-record-v1",stored:"mdb-view-stored-v1",reduce:"mdb-view-reduce-v1",op:"mdb-view-op-v1",console:"mdb-view-console-v1",interrupt:"mdb-view-interrupt-v1",live:"mdb-view-live-v1","live-timeline":"mdb-view-live-timeline-v1","live-items":"mdb-view-live-items-v1","live-ledger":"mdb-view-live-ledger-v1",event:"mdb-view-event-v1"};class xl extends Error{}const Lp="/api/v1";function Ly(l){if(!l)return"";const i=Object.entries(l).filter(([,u])=>u!=null&&u!=="").map(([u,r])=>`${encodeURIComponent(u)}=${encodeURIComponent(String(r))}`);return i.length?`?${i.join("&")}`:""}function Yy(l){return typeof l=="object"&&l!==null&&typeof l.refused=="string"}const Gy=["resolved","unresolved","refused"];function Xy(l,i,u){if(Yy(i)){if(i.state!=="refused")throw new xl(`${l}: refusal ${i.refused} lacks state "refused"`);return{ok:!1,refused:i,status:u}}if(typeof i!="object"||i===null||Array.isArray(i))throw new xl(`${l}: response is not a JSON object`);const r=i;if(r.schema!==no[l])throw new xl(`${l}: expected schema ${no[l]}, got ${String(r.schema)}`);if(!("data"in r)||typeof r.digest!="string"||typeof r.bytes!="number")throw new xl(`${l}: envelope lacks data, digest or bytes`);if(typeof r.state!="string"||!Gy.includes(r.state))throw new xl(`${l}: envelope lacks a valid state (got ${String(r.state)})`);if(r.state!=="resolved"&&(typeof r.reason!="string"||!r.reason))throw new xl(`${l}: envelope is ${r.state} but gives no reason`);return{ok:!0,env:r,status:u}}async function Yp(l,i){let u;try{u=await i.json()}catch{return{ok:!1,refused:{refused:"bad_response",detail:`HTTP ${i.status}: not JSON`},status:i.status}}try{return Xy(l,u,i.status)}catch(r){if(!(r instanceof xl))throw r;return{ok:!1,refused:{refused:"bad_envelope",detail:r.message},status:i.status}}}function hu(l,i){return`${Lp}${l}${Ly(i)}`}async function xo(l,i,u={},r=fetch){let d;try{d=await r(i,u.signal?{signal:u.signal}:void 0)}catch(h){return{ok:!1,refused:{refused:"network",detail:String(h)},status:0}}return Yp(l,d)}function yl(l,i,u,r=fetch,d={}){return xo(l,hu(i,u),d,r)}async function js(l,i,u,r=fetch,d={}){let h;try{h=await r(hu(i),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(u),...d.signal?{signal:d.signal}:{}})}catch(f){return{ok:!1,refused:{refused:"network",detail:String(f)},status:0}}return Yp(l,h)}function ha(l,i,u,r){const d=new Map(l);for(d.delete(i),d.set(i,u);d.size>r;){const h=d.keys().next();if(h.done)break;d.delete(h.value)}return d}const Qy=new Set(["breakpoint","watch","advance","reached","budget","end-of-context","error","no-breakpoints"]);function Zy(l,i,u){if(typeof u.interrupted=="string")return{kind:"interrupted",op:l,seq:i,where:u.interrupted};const r=typeof u.reason=="string"?u.reason:"",d=typeof u.where=="string"?u.where:null;if(u.error&&typeof u.error=="object"){const h=u.error.type;return{kind:"refused",op:l,seq:i,reason:r,type:typeof h=="string"?h:null}}return u.state==="unresolved"?{kind:"unresolved",op:l,seq:i,where:d,reason:r}:{kind:"ok",op:l,seq:i,where:d,stopped:Qy.has(r)?r:null}}const Vy=160;function yo(l,i){return`${l}|${i}`}function Ky(l,i){return(l==null?void 0:l.more.find(u=>u.field===i))??null}function Gp(l){return l.startsWith("upstream:")?["upstream",l.slice(9)]:[l,null]}function Jy(l,i){var h,f,v;const[u,r]=Gp(i),d=l.edits??{};switch(u){case"staged":case"committed":return((h=d[u])==null?void 0:h.length)??0;case"breakpoints":return l.breakpoints.length;case"displays":return l.displays.length;case"checkpoints":return l.checkpoints.length;case"upstream":return((v=(f=l.ports.find(y=>y.addr===r))==null?void 0:f.edit)==null?void 0:v.upstream.length)??0;default:return 0}}function Zn(l,i){return`/s/${encodeURIComponent(l)}/${i}`}async function Qm(l,i,u){const r=await js("reduce",Zn(l,"reduce"),{pointer:{kind:"occurrence",address:i},op:u,params:u==="topk"?{k:3}:{}});return r.ok?{state:"ok",result:r.env.data}:{state:"refused",refused:r.refused}}const It=El((l,i)=>{let u=0;async function r(f){var p;const v=i().sid;if(!v)return;const y=++u;for(const x of f.ports){if(!x.computed)continue;if(((p=i().frame)==null?void 0:p.seq)!==f.seq||u!==y)return;const g=i().visible,j=x.cursor||x.addr===i().expanded;if(g&&!g.has(x.addr)&&!j)continue;const M=yo(f.seq,x.addr),k=i().summaries.get(M);if(k&&(k.topk||!j))continue;const G=(k==null?void 0:k.stats)??await Qm(v,x.addr,"stats"),q=j?await Qm(v,x.addr,"topk"):null;l(X=>({summaries:ha(X.summaries,M,{stats:G,topk:q},Vy)}))}}let d=!1;function h(){d||(d=!0,queueMicrotask(()=>{d=!1;const f=i().frame;f&&r(f)}))}return{sid:null,frame:null,timeline:null,refused:null,running:null,last:null,console:[],summaries:new Map,expanded:null,visible:null,extra:new Map,ledger:null,ledgerRefused:null,setSid(f){f!==i().sid&&(l({sid:f,frame:null,timeline:null,last:null,refused:null,summaries:new Map,extra:new Map,ledger:null,ledgerRefused:null}),f&&i().refresh())},async refresh(){const f=i().sid;if(!f)return;const[v,y,p]=await Promise.all([yl("live",Zn(f,"live")),yl("live-timeline",Zn(f,"live/timeline")),yl("live-ledger",Zn(f,"live/ledger"))]);if(i().sid!==f)return;if(p.ok?l({ledger:p.env.data,ledgerRefused:null}):l({ledgerRefused:p.refused}),!v.ok)return l({refused:v.refused});const x=i().frame;if(x&&x.seq>v.env.data.seq)return;l({frame:v.env.data,extra:(x==null?void 0:x.seq)===v.env.data.seq?i().extra:new Map,timeline:y.ok?y.env.data:null,refused:y.ok?null:y.refused});const g=v.env.data.where,j=de.getState();g&&j.sid===f&&j.go(g),r(v.env.data)},async op(f,v={}){await i().run(f,v)},async run(f,v={}){const y=i().sid;if(!y||i().running)return null;l({running:f,refused:null});const p=await js("op",Zn(y,"op"),{op:f,args:v,request_id:`${f}-${Date.now()}`});let x;if(p.ok){const g=p.env.data;l({running:null,last:Zy(g.op,g.seq,g.result)}),x={ok:!0,op:g.op,seq:g.seq,result:g.result,state:p.env.state,reason:p.env.reason??null}}else l({running:null,refused:p.refused}),x={ok:!1,op:f,refused:p.refused};return await i().refresh(),x},async command(f){const v=i().sid;if(!v||i().running)return;l({running:f.split(/\s+/)[0]||"console",refused:null});const y=await js("console",Zn(v,"console"),{line:f});if(y.ok){const p=y.env.data;l(x=>({running:null,console:[...x.console,{seq:p.seq,line:p.line,text:p.text}].slice(-200)}))}else l({running:null,refused:y.refused});await i().refresh()},async interrupt(){const f=i().sid;if(!f)return;const v=await js("interrupt",Zn(f,"interrupt"),{});v.ok||l({refused:v.refused})},expand(f){l({expanded:f}),h()},setVisible(f,v){const y=new Set(i().visible??[]);if(v===y.has(f)){i().visible===null&&l({visible:y});return}v?y.add(f):y.delete(f),l({visible:y}),v&&h()},async more(f){var G;const v=i().sid,y=i().frame;if(!v||!y)return;const p=i().extra.get(f);if(p&&p.next===null)return;const[x,g]=Gp(f),j=(p==null?void 0:p.next)??Jy(y,f),M=await yl("live-items",Zn(v,"live/items"),{list:x,offset:j,addr:g});if(((G=i().frame)==null?void 0:G.seq)!==y.seq)return;const k=new Map(i().extra);M.ok?k.set(f,{items:[...(p==null?void 0:p.items)??[],...M.env.data.items],next:M.env.data.next,refused:null}):k.set(f,{items:(p==null?void 0:p.items)??[],next:(p==null?void 0:p.next)??j,refused:M.refused}),l({extra:k})},onEvent(f){var y;const v=typeof f.seq=="number"?f.seq:null;v===null||i().running||(((y=i().frame)==null?void 0:y.seq)??-1)>=v||i().refresh()}}}),vl={state:"idle"};function Xp(l,i){if(i===null)return{state:"request-refused",label:l,refused:{refused:"busy",detail:"another op of this page is running"}};if(!i.ok)return{state:"request-refused",label:l,refused:i.refused};const u=i.result;return typeof u.interrupted=="string"?{state:"interrupted",label:l,where:u.interrupted}:ie(u.error)||u.state==="refused"?{state:"refused",label:l,reason:R(u.reason)??i.reason??"refused",type:R(ue(u,"error","type"))}:{state:"done",label:l,seq:i.seq,result:u,partial:i.state==="unresolved"?i.reason??"partly unresolved":null}}function Zm(l,i){const u=Ie(l.id),r=ue(l,"record","body");if(u===null||!ie(r))return null;const d=Array.isArray(l.tests)?l.tests.filter(ie):[];return{id:u,body:r,test:d[d.length-1]??(i==null?void 0:i.test)??null,ablated:ie(l.ablated)?l.ablated:(i==null?void 0:i.ablated)??null}}function Wy(l){return{retained:ue(l,"nodes","circuit","refs")??[],complement:ue(l,"nodes","group","refs")??[]}}const Ki={tab:"pipeline",slots:{symbols:vl,reads:vl,circuit:vl,test:vl,whatif:vl,compare:vl,forecast:vl},symbolsArgs:{},circuits:new Map,selected:null,node:null,overlay:!0,focus:null,seek:null,labels:{pipeline:!1,symbols:!1,graph:!1,predict:!1}},bl=El((l,i)=>({...Ki,set:u=>l(u),reset:()=>l({...Ki,circuits:new Map,slots:{...Ki.slots},labels:{...Ki.labels}}),async exec(u,r,d,h){l(v=>({slots:{...v.slots,[u]:{state:"running",label:h}}}));const f=Xp(h,await It.getState().run(r,d));return l(v=>({slots:{...v.slots,[u]:f}})),f},async symbols(u){l({symbolsArgs:u});const r=Object.entries(u).map(([d,h])=>`${d}=${String(h)}`);await i().exec("symbols","symbols",u,["symbols",...r].join(" "))},async build(u,r,d){const h=await i().exec("circuit","circuit",{target:u,top:r,depth:d},`circuit ${u} top=${r} depth=${d}`);if(h.state!=="done")return;const f=Zm(h.result,void 0);if(!f)return;const v=new Map(i().circuits);v.set(f.id,f),l({circuits:v,selected:f.id,node:null})},async show(u){const r=await i().exec("circuit","circuit",{target:"show",id:u},`circuit show ${u}`);if(r.state!=="done")return;const d=Zm(r.result,i().circuits.get(u));if(!d)return;const h=new Map(i().circuits);h.set(d.id,d),l({circuits:h,selected:d.id})},async test(u,r){const d=await i().exec("test","circuit",{target:"test",id:u,ref:r},`circuit test ${u} ref=${r}`);if(d.state!=="done"||!ie(d.result.test))return;const h=i().circuits.get(u);if(!h)return;const f=new Map(i().circuits);f.set(u,{...h,test:d.result.test,ablated:Wy(d.result.test)}),l({circuits:f})},async confirmSeek(){const u=i().seek;u&&(l({seek:null}),await It.getState().run("seek",{target:u.target}))}}));class Fy{constructor(){kr(this,"entries",new Map)}get size(){return this.entries.size}subscribe(i,u,r,d){let h=this.entries.get(i);if(!h){const y=new AbortController,p={promise:u(y.signal),controller:y,refs:0,settled:!1};h=p,this.entries.set(i,p);const x=()=>{p.settled=!0,this.entries.get(i)===p&&this.entries.delete(i)};p.promise.then(x,x)}const f=h;f.refs+=1;let v=!0;return f.promise.then(y=>{v&&r(y)},y=>{v&&d(y)}),()=>{v&&(v=!1,f.refs-=1,f.refs===0&&!f.settled&&(f.controller.abort(),this.entries.get(i)===f&&this.entries.delete(i)))}}}const Vm=96,Km=256,Xr=El(l=>({byDigest:new Map,byUrl:new Map,put(i,u){l(r=>({byDigest:ha(r.byDigest,u.digest,u,Vm),byUrl:ha(r.byUrl,i,u.digest,Km)}))},touch(i){l(u=>{const r=u.byUrl.get(i),d=r===void 0?void 0:u.byDigest.get(r);return r===void 0||!d?u:{byDigest:ha(u.byDigest,r,d,Vm),byUrl:ha(u.byUrl,i,r,Km)}})}})),Iy=new Fy;function gt(l,i,u){const r=i===null?null:hu(i,u),d=Xr(y=>r?y.byDigest.get(y.byUrl.get(r)??""):void 0),h=d!==void 0,[f,v]=L.useState(null);return L.useEffect(()=>{if(r){if(h){Xr.getState().touch(r);return}return Iy.subscribe(r,y=>xo(l,r,{signal:y}),y=>{y.ok?(Xr.getState().put(r,y.env),v({key:r,value:{state:"ok",env:y.env}})):v({key:r,value:{state:"refused",refused:y.refused,status:y.status}})},y=>v({key:r,value:{state:"error",message:String(y)}}))}},[r,l,h]),d?{state:"ok",env:d}:f&&f.key===r?f.value:{state:"loading"}}const Vn=El((l,i)=>({hello:null,sessions:[],caps:null,capsFor:null,refused:null,async boot(){const u=await yl("hello","/hello");if(!u.ok)return l({refused:u.refused});const r=await yl("sessions","/sessions");if(!r.ok)return l({hello:u.env.data,refused:r.refused});l({hello:u.env.data,sessions:r.env.data,refused:null})},async loadCaps(u){if(i().capsFor===u)return;l({capsFor:u,caps:null});const r=await yl("capabilities",`/s/${encodeURIComponent(u)}/capabilities`);i().capsFor===u&&(r.ok?l({caps:r.env.data,refused:null}):l({refused:r.refused}))}}));function ze({n:l,showReason:i=!1,bare:u=!1,compact:r=!1}){if(!l||!mo(l.ev))return s.jsx("span",{className:"num-refused","data-ev":"refused",title:"number has no evidence class",children:"refused: no evidence class"});if(l.ev==="unresolved"){const v=l.reason??"unresolved";return s.jsx("span",{"data-ev":"unresolved",title:v,children:s.jsx("span",{className:"num-unresolved","aria-label":`unresolved: ${v}`,children:i?v:" "})})}if(l.ev==="refused"||l.v===null||l.v===void 0){const v=l.reason??"refused";return s.jsxs("span",{className:"num-refused","data-ev":"refused",title:v,children:["refused",i?`: ${v}`:""]})}const d=Oy(l.v),h=Cy(l),f=[l.ev,l.unit,l.proof&&`proof ${l.proof}`,l.ptr&&`from ${l.ptr}`,l.recorded_authority&&`recorded as ${l.recorded_authority}`,h,`value ${String(l.v)}`].filter(Boolean).join(" · ");return s.jsxs("span",{className:"num","data-ev":l.ev,title:f,children:[!u&&s.jsx(Gt,{ev:l.ev,proof:l.proof})," ",d,l.unit?s.jsxs("span",{className:"faint",children:[" ",l.unit]}):null,i&&h&&s.jsxs("span",{className:"faint",children:[" ",h]}),Ty(l.ev)&&s.jsxs("span",{className:"ev-chip",children:[l.ev,l.proof&&!r?` · ${l.proof}`:""]})]})}function le({n:l,unit:i}){return s.jsxs("span",{className:"num","data-structural":"",children:[String(Math.trunc(l)),i?` ${i}`:""]})}function Qt({what:l,loaded:i,children:u}){return i.state==="loading"?s.jsxs("div",{className:"faint",children:["loading ",l,"…"]}):i.state==="refused"?s.jsx(Kn,{what:l,refused:i.refused}):i.state==="error"?s.jsxs("div",{className:"na",children:[s.jsxs("strong",{children:[l,": client error"]})," ",i.message]}):s.jsx(s.Fragment,{children:u(i.env.data,i.env)})}function _s({env:l}){var i;return(i=l.omitted)!=null&&i.length?s.jsxs("div",{className:"faint",role:"note",children:["left out:"," ",l.omitted.map(u=>s.jsxs("span",{className:"chip",title:u.reason??"",children:[u.field," ",s.jsx(le,{n:u.count})]},u.field))]}):null}const Wt=28,ct=20,Ji=6,Py=22,lo=11,fa=9;function Jm(l,i=Py){return l.length<=i?l:`${l.slice(0,i-1)}…`}function Wm(l,i){const u=new Map;for(const r of l){const d=i(r),h=u.get(d);h?h.push(r):u.set(d,[r])}return u}function eg(l,i=[]){const u=l.map(Y=>Jm(Y.label)),r=Math.max(4,...u.map(Y=>Y.length)),d=lo+r*Ji+24,h=l.filter(Y=>Y.x!==null&&Y.y!==null),f=[...new Set(h.map(Y=>Y.x??0))].sort((Y,oe)=>Y-oe),v=[...new Set(h.map(Y=>Y.y??0))].sort((Y,oe)=>Y-oe),y=Wm(h,Y=>`${Y.x},${Y.y}`),p=new Map;let x=0;for(const Y of v){p.set(Y,x);const oe=Math.max(...f.map(_e=>{var we;return((we=y.get(`${_e},${Y}`))==null?void 0:we.length)??0}));x+=oe*ct+10}const g=Wm(l.filter(Y=>Y.x===null||Y.y===null),Y=>String(Y.lane)),j=[...g.keys()].map(Number).sort((Y,oe)=>Y-oe),M=Math.max(f.length,3),k=new Map;for(const Y of j){const oe=g.get(String(Y))??[];oe.forEach((_e,we)=>k.set(_e.id,{col:we%M,y:x+Math.floor(we/M)*ct})),x+=Math.ceil(oe.length/M)*ct+10}const G=i.map(Y=>({id:Y.id,full:`${Y.label} · ${Y.verdict}`})),q=Wt+(G.length?G.length*ct+8:0),X=Math.max(0,...G.map(Y=>Math.min(Y.full.length,48)*Ji)),ce=G.map((Y,oe)=>({id:Y.id,full:Y.full,text:Jm(Y.full,48),box:{x:Wt+30,y:Wt+oe*ct-ct/2,w:Math.min(Y.full.length,48)*Ji,h:ct}})),z=(Y,oe,_e,we)=>({node:Y,cx:_e,cy:we,label:u[oe]??"",labelBox:{x:_e+lo,y:we-ct/2,w:(u[oe]??"").length*Ji,h:ct},markBox:{x:_e-fa,y:we-fa,w:2*fa,h:2*fa}}),T=new Map,K=l.map((Y,oe)=>{if(Y.x!==null&&Y.y!==null){const we=`${Y.x},${Y.y}`,ae=T.get(we)??0;return T.set(we,ae+1),z(Y,oe,Wt+f.indexOf(Y.x)*d+fa,q+(p.get(Y.y)??0)+ae*ct+ct/2)}const _e=k.get(Y.id)??{col:0,y:0};return z(Y,oe,Wt+_e.col*d+fa,q+_e.y+ct/2)}),V=Math.max(240,Wt*2+Math.max(f.length,j.length?M:0)*d,Wt*2+30+X),W=q+Math.max(x,ct)+Wt;return{placed:K,legend:ce,width:V,height:W,top:q}}function tg(l){const i=[...l].sort((h,f)=>h[0]-f[0]||h[1]-f[1]);if(i.length<3)return i;const u=(h,f,v)=>(f[0]-h[0])*(v[1]-h[1])-(f[1]-h[1])*(v[0]-h[0]),r=[];for(const h of i){for(;r.length>=2&&u(r[r.length-2],r[r.length-1],h)<=0;)r.pop();r.push(h)}const d=[];for(const h of[...i].reverse()){for(;d.length>=2&&u(d[d.length-2],d[d.length-1],h)<=0;)d.pop();d.push(h)}return[...r.slice(0,-1),...d.slice(0,-1)]}function ng(l,i){const r=[];for(const h of l.nodes){const f=i.get(h);f&&r.push([f.cx-14,f.cy-14],[f.cx+14,f.cy-14],[f.cx-14,f.cy+14],[f.cx+14,f.cy+14])}return r.length?`M${tg(r).map(([h,f])=>`${h},${f}`).join("L")}Z`:null}const lg={symbol:"--role-symbol",cursor:"--role-input",readout:"--role-output",carrier:"--role-intervention",state:"--role-state",cache:"--role-cache"};function ag(l){return`var(${lg[l]??"--role-other"})`}const sg={dataflow:void 0,read:"1 3",kv_write:"6 2 1 2",attribution:"8 3",intervention:void 0,declared:"3 3",unknown:"1 5"},Fm=260;function Im(){const l=de(j=>j.sid),i=de(j=>j.addr),u=Be(j=>j.zoom),r=Be(j=>j.set),[d,h]=L.useState(null),[f,v]=L.useState(3),y=l?`/s/${encodeURIComponent(l)}/graph`:null,p=gt("graph",y,{addr:i,zoom:u,depth:f,k:48,slice:d}),x=gt("frame",l&&i?`/s/${encodeURIComponent(l)}/frame`:null,{addr:i}),g=x.state==="ok"?x.env.data.key??x.env.data.addr:i;return l?s.jsxs("section",{className:"panel panel-col","aria-label":"graph",children:[s.jsxs("h2",{children:["Graph",s.jsxs("select",{"aria-label":"zoom",value:u,onChange:j=>r({zoom:j.target.value}),children:[s.jsx("option",{value:"slice",children:"slice"}),s.jsx("option",{value:"session",children:"session"})]}),p.state==="ok"&&p.env.data.slices.length>0&&u==="slice"&&s.jsxs("select",{"aria-label":"slice",value:d??"",onChange:j=>h(j.target.value||null),children:[s.jsx("option",{value:"",children:"slice at cursor"}),p.env.data.slices.map(j=>s.jsxs("option",{value:j.id,children:[j.component," ",j.complete?"":"(gaps)"]},j.id))]}),s.jsxs("label",{className:"muted",children:["depth"," ",s.jsx("select",{"aria-label":"depth",value:f,onChange:j=>v(Number(j.target.value)),children:[1,2,3,4,6].map(j=>s.jsx("option",{value:j,children:String(j)},j))})]})]}),s.jsx("div",{className:"panel-body panel-col-body",children:s.jsx(Qt,{what:"graph",loaded:p,children:(j,M)=>s.jsxs(s.Fragment,{children:[s.jsx(ig,{view:j,cursor:g}),s.jsxs("div",{className:"faint panel-foot",children:[j.authority," · ",s.jsx(le,{n:j.nodes.length})," nodes · ",s.jsx(le,{n:j.edges.length})," ","edges",j.pruned.map(k=>s.jsxs("span",{className:"chip",children:[k.group," +",s.jsx(le,{n:k.count})]},k.group))]}),s.jsx(_s,{env:M})]})})})]}):null}function ig({view:l,cursor:i}){const u=de(x=>x.go),r=`hatch-${L.useId().replace(/:/g,"")}`,{placed:d,legend:h,width:f,height:v}=L.useMemo(()=>eg(l.nodes,l.overlays),[l.nodes,l.overlays]),y=L.useMemo(()=>new Map(d.map(x=>[x.node.id,x])),[d]),p=Math.max(f,...h.map(x=>{var g;return(g=l.overlays.find(j=>j.id===x.id))!=null&&g.interaction?x.box.x+x.box.w+8+Fm:0}));return l.nodes.length?s.jsx("div",{className:"panel-scroll",children:s.jsxs("svg",{width:p,height:v,role:"img","aria-label":"state graph",style:{display:"block"},children:[s.jsxs("defs",{children:[s.jsx("pattern",{id:r,width:"4",height:"4",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:s.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"4",stroke:"var(--ink-2)",strokeWidth:"1.2"})}),s.jsx("marker",{id:`${r}-arrow`,viewBox:"0 0 6 6",refX:"6",refY:"3",markerWidth:"6",markerHeight:"6",orient:"auto",children:s.jsx("path",{d:"M0,0L6,3L0,6Z",fill:"var(--ink-3)"})})]}),l.overlays.map(x=>{const g=ng(x,y),j=x.nodes.map(M=>y.get(M)).find(Boolean);return!g||!j?null:s.jsx("g",{"aria-label":`overlay ${x.label}`,children:s.jsx("path",{d:g,fill:"none",stroke:"var(--ink-2)",strokeDasharray:"5 3"})},x.id)}),h.map(x=>{var j;const g=(j=l.overlays.find(M=>M.id===x.id))==null?void 0:j.interaction;return s.jsxs("g",{children:[s.jsx("title",{children:x.full}),s.jsx("line",{x1:Wt,x2:Wt+24,y1:x.box.y+ct/2,y2:x.box.y+ct/2,stroke:"var(--ink-2)",strokeDasharray:"5 3"}),s.jsx("text",{x:x.box.x,y:x.box.y+ct/2+3.5,fontSize:10,fill:"var(--ink-2)",children:x.text}),g?s.jsx("foreignObject",{x:x.box.x+x.box.w+8,y:x.box.y,width:Fm,height:ct,children:s.jsxs("span",{className:"overlay-num",style:{fontSize:10},children:["interaction ",s.jsx(ze,{n:g})]})}):null]},x.id)}),l.edges.map(x=>{const g=y.get(x.source),j=y.get(x.target);return!g||!j?null:s.jsx("line",{x1:g.cx,y1:g.cy,x2:j.cx,y2:j.cy,stroke:"var(--ink-3)",strokeWidth:x.type==="intervention"?2.2:1,strokeDasharray:sg[x.type],markerEnd:`url(#${r}-arrow)`,children:s.jsx("title",{children:`${x.type} ${x.relation} (${x.evidence})`})},x.id)}),d.map(x=>s.jsx(ug,{p:x,hatch:r,active:!!i&&x.node.addr===i,onGo:u},x.node.id))]})}):s.jsx("div",{className:"na",children:"The graph at this address has no nodes."})}function ug({p:l,hatch:i,active:u,onGo:r}){const{node:d,cx:h,cy:f}=l,v=()=>d.addr&&r(d.addr),y=ag(d.role),p=d.ev?fu(d.ev):"hollow",x=p==="solid"?y:p==="hatched"?`url(#${i})`:"var(--panel)",g=p==="dashed-empty"?"2 2":void 0,j=`${d.label}
50
+ ${d.kind} · role ${d.role}${d.ev?` · ${d.ev}`:""}${d.addr?`
51
+ ${d.addr}`:""}`,M=!!d.addr,k={stroke:y,strokeWidth:u?3:1.6,strokeDasharray:g,fill:x,style:{cursor:M?"pointer":"default"},onClick:v};return s.jsxs("g",{tabIndex:M?0:void 0,role:M?"button":void 0,"aria-label":M?j.split(`
52
+ `)[0]:void 0,onKeyDown:G=>{M&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),v())},children:[s.jsx("title",{children:j}),d.kind==="aggregate"?s.jsx("rect",{x:h-8,y:f-8,width:16,height:16,rx:4,...k,fill:"var(--panel-2)"}):d.kind==="action"?s.jsx("rect",{x:h-6,y:f-6,width:12,height:12,...k}):s.jsx("circle",{cx:h,cy:f,r:7,...k}),s.jsx("text",{x:h+lo,y:f+3.5,fontSize:10,fill:"var(--ink-2)",children:l.label})]})}function cg(l){const i=ie(l)?R(l.url):null;return i&&/^https:\/\/www\.neuronpedia\.org\/(?!\.{1,2}\/)[A-Za-z0-9_.-]+\/(?!\.{1,2}\/)[A-Za-z0-9_.-]+\/\d+$/.test(i)?i:null}function go({value:l}){const i=cg(l);if(!i){const r=ie(l)?R(l.reason):null;return s.jsxs("span",{className:"faint",children:["Neuronpedia unavailable: ",r??"no valid feature link recorded"]})}const u=ie(l)&&ie(l.origin)?R(l.origin.kind):null;return s.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",title:`Supplied identity${u?` (${u})`:""}; opens Neuronpedia`,children:"Neuronpedia ↗"})}const rg=new Set(By);function Qp(l){return l!==null&&rg.has(l)}const Qr=50;function mu({value:l,name:i=null,depth:u=0}){return s.jsx(Zp,{value:l,keyName:i,structural:Qp(i),depth:u})}function Zp({value:l,keyName:i,structural:u,depth:r}){const[d,h]=L.useState(r<2);if(l==null)return s.jsx("span",{className:"faint",children:"null"});if(typeof l=="number")return u&&Number.isInteger(l)?s.jsx(le,{n:l}):s.jsx(ze,{n:{v:null,ev:"refused",unit:null,proof:null,ptr:null,note:null,recorded_authority:null,reason:`number at "${i??"?"}" has no evidence class`},showReason:!0});if(i==="neuronpedia"&&typeof l=="object"&&!Array.isArray(l))return s.jsx(go,{value:l});if(typeof l=="string")return s.jsx("span",{className:"mono json-str",children:JSON.stringify(l)});if(typeof l=="boolean")return s.jsx("span",{className:"mono",children:String(l)});const f=lu(l);if(f)return s.jsx(ze,{n:f,showReason:!0});const v=Array.isArray(l)?l.map(p=>[null,p]):Object.entries(l),y=Array.isArray(l)?`[${v.length}]`:`{${v.length}}`;return v.length?s.jsxs("span",{children:[s.jsxs("button",{type:"button",className:"chip",onClick:()=>h(!d),"aria-expanded":d,children:[d?"−":"+"," ",y]}),d&&s.jsxs("ul",{style:{listStyle:"none",margin:0,paddingLeft:14},children:[v.slice(0,Qr).map(([p,x],g)=>s.jsxs("li",{children:[p!==null&&s.jsxs("span",{className:"muted mono",children:[p,": "]}),s.jsx(Zp,{value:x,keyName:p??i,structural:p===null?u:Qp(p),depth:r+1})]},p??g)),v.length>Qr&&s.jsxs("li",{className:"faint",children:["+",s.jsx(le,{n:v.length-Qr})," more not shown"]})]})]}):s.jsx("span",{className:"faint mono",children:Array.isArray(l)?"[]":"{}"})}function og(l){const i=l.spec;if(!i)return l.addr??l.digest.slice(0,10);if(i.kind==="slot"){const u=i.item===null?"":`[${String(i.item)}]`;return`${i.slot}${u}@${i.cut.slice(0,8)}`}return i.kind==="blob"?`blob ${i.ref.slice(0,10)}`:i.address}function Vp({pointer:l}){const i=de(f=>f.go),u=Be(f=>f.inspect),r=Be(f=>f.set),d=(u==null?void 0:u.digest)===l.digest,h=l.shape?`[${l.shape.join("×")}]`:"";return s.jsxs("button",{type:"button",className:`chip${d?" selected-row":""}`,"data-status":l.status,style:l.status==="frontier"?{borderStyle:"dashed"}:void 0,title:[l.status,l.reason,l.addr,...l.via].filter(Boolean).join(`
53
+ `),onClick:()=>{l.addr&&i(l.addr),r({inspect:l})},children:[s.jsx("span",{className:"mono",children:og(l)}),h&&s.jsx("span",{className:"faint mono",children:h}),l.dtype&&s.jsx("span",{className:"faint",children:l.dtype}),l.status==="frontier"&&s.jsx("span",{className:"faint",children:"frontier"})]})}function dg({id:l}){return s.jsxs("button",{type:"button",className:"chip mono",title:`receipt ${l} (click to copy)`,onClick:()=>{var i;return void((i=navigator.clipboard)==null?void 0:i.writeText(l).catch(()=>{}))},children:["receipt ",l.slice(0,10)]})}function Kp(l){return!l||l.ev==="measured"?"stated":l.ev==="unresolved"||l.ev==="refused"||l.v===null?"unknown":"inferred"}function fg(l){return l.inferred}const bs=16,$e=7,ba=136,hg=56,jl=$e+5,Pm=jl+ba+hg+$e,pa=34,ep=21,Jp=.8;function pu(l){var h;const i=ie(l)?l.root:void 0;if(!ie(i))return[];const u=[],r=[[i,0,null,"0"]];for(;r.length;){const[f,v,y,p]=r.shift(),x=R(f.id)??`p${p}`,g=Ft(f.children),j={id:x,name:R(f.name)??R(f.address)??x,kind:R(f.kind)??"node",address:R(f.address)??"",value:f.value,note:R(f.note),proof:R(f.proof),depth:v,parent:y,children:[],paged:ie(f.paged)?f.paged:null,raw:Object.fromEntries(Object.entries(f).filter(([M])=>M!=="children"))};u.push(j),g.forEach((M,k)=>r.push([M,v+1,x,`${p}.${k}`]))}const d=new Map(u.map(f=>[f.id,f]));for(const f of u)f.parent&&((h=d.get(f.parent))==null||h.children.push(f.id));return u}function Wp(l){return l.kind==="more"?`more|${l.address}`:`${l.kind}|${l.address}|${l.name}`}function mg(l){const i=new Map,u=new Map;for(const r of l){const d=pu(r),h=new Map(d.map(f=>[f.id,Wp(f)]));for(const f of d){const v=h.get(f.id);if(i.has(v))continue;const y=f.parent?i.get(h.get(f.parent)??""):void 0,p=f.depth,x=u.get(p)??new Set;let g=(y==null?void 0:y.slot)??0;for(;x.has(g);)g+=1;x.add(g),u.set(p,x),i.set(v,{col:p,slot:g})}}return i}function pg(l){return l.length<=ep?l:`${l.slice(0,ep-1)}…`}function Fp(l,i){const u=mg(i.includes(l)?i:[...i,l]),r=pu(l);let d=0,h=0;for(const g of u.values())d=Math.max(d,g.col),h=Math.max(h,g.slot);const f=r.map(g=>{const j=Wp(g),M=u.get(j)??{col:g.depth,slot:0};return{node:g,key:j,col:M.col,slot:M.slot,x:bs+$e+M.col*Pm,y:bs+pa/2+M.slot*pa,label:pg(g.name)}}),v=new Map(f.map(g=>[g.node.id,g])),y=f.filter(g=>g.node.parent!==null).map(g=>to(ga(g.node.value))).filter(g=>g!==null).map(g=>Math.abs(g.v)),p=Math.max(0,...y),x=[];for(const g of f){const j=g.node.parent?v.get(g.node.parent):void 0;if(!j)continue;const M=to(ga(g.node.value));x.push({from:j,to:g,width:M===null?null:1+(p>0?5*Math.abs(M.v)/p:0),sign:M===null||!M.signed?"none":M.v<0?"neg":"pos"})}return{placed:f,edges:x,width:bs*2+d*Pm+$e+jl+ba,height:bs*2+(h+1)*pa}}function vg(l,i,u){var x,g;const r=new Map(l.placed.map(j=>[j.node.id,j])),d=i?r.get(i):void 0;if(!d)return((x=l.placed[0])==null?void 0:x.node.id)??null;const h=j=>j.map(M=>r.get(M)).filter(M=>!!M).sort((M,k)=>M.slot-k.slot);if(u==="left")return d.node.parent??d.node.id;if(u==="right")return((g=h(d.node.children)[0])==null?void 0:g.node.id)??d.node.id;const f=d.node.parent?r.get(d.node.parent):void 0,v=f?h(f.node.children):[d],y=v.findIndex(j=>j.node.id===d.node.id),p=v[u==="up"?y-1:y+1];return(p==null?void 0:p.node.id)??d.node.id}function xg(l,i){return l.filter(u=>R(u.body.consumer)===i).sort((u,r)=>u.id-r.id)}function yg(l,i,u){return l!=="fit"?l:u===null||u<=0?1:Math.max(Jp,Math.min(1,u/i))}function gg(l,i){const u=l.placed.find(r=>r.node.parent===null)??l.placed[0];return u?{left:Math.max(0,Math.floor((u.x-$e-bs)*i)),top:Math.max(0,Math.floor((u.y-pa)*i))}:{left:0,top:0}}function ao(l){return Array.isArray(l)?`[${l.map(ao).join(",")}]`:l&&typeof l=="object"?`{${Object.entries(l).sort(([u],[r])=>u<r?-1:u>r?1:0).map(([u,r])=>`${JSON.stringify(u)}:${ao(r)}`).join(",")}}`:JSON.stringify(l)}function Ip(l,i,u,r){return`${l}|${i}|${u}|${ao(r)}`}const bg=64;function Zr(l,i,u){l(r=>({entries:ha(r.entries,i,u,bg)}))}const tp=El((l,i)=>({entries:new Map,async run(u,r,d,h={}){const f=Ip(u,r.digest,d,h),v=i().entries.get(f);if(v&&v.state!=="refused")return;if(!r.spec){Zr(l,f,{state:"refused",refused:{refused:"frontier",detail:r.reason}});return}Zr(l,f,{state:"loading"});const y=await js("reduce",`/s/${encodeURIComponent(u)}/reduce`,{pointer:r.spec,op:d,params:h}),p=y.ok?{state:"ok",result:y.env.data}:{state:"refused",refused:y.refused};Zr(l,f,p)}}));function nu(l,i){return l==null||i==null?NaN:l<i?-1:l>i?1:l>=i?0:NaN}function jg(l,i){return l==null||i==null?NaN:i<l?-1:i>l?1:i>=l?0:NaN}function Pp(l){let i,u,r;l.length!==2?(i=nu,u=(v,y)=>nu(l(v),y),r=(v,y)=>l(v)-y):(i=l===nu||l===jg?l:Sg,u=l,r=l);function d(v,y,p=0,x=v.length){if(p<x){if(i(y,y)!==0)return x;do{const g=p+x>>>1;u(v[g],y)<0?p=g+1:x=g}while(p<x)}return p}function h(v,y,p=0,x=v.length){if(p<x){if(i(y,y)!==0)return x;do{const g=p+x>>>1;u(v[g],y)<=0?p=g+1:x=g}while(p<x)}return p}function f(v,y,p=0,x=v.length){const g=d(v,y,p,x-1);return g>p&&r(v[g-1],y)>-r(v[g],y)?g-1:g}return{left:d,center:f,right:h}}function Sg(){return 0}function Ng(l){return l===null?NaN:+l}const wg=Pp(nu),Mg=wg.right;Pp(Ng).center;class np extends Map{constructor(i,u=Ag){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:u}}),i!=null)for(const[r,d]of i)this.set(r,d)}get(i){return super.get(lp(this,i))}has(i){return super.has(lp(this,i))}set(i,u){return super.set(Eg(this,i),u)}delete(i){return super.delete(_g(this,i))}}function lp({_intern:l,_key:i},u){const r=i(u);return l.has(r)?l.get(r):u}function Eg({_intern:l,_key:i},u){const r=i(u);return l.has(r)?l.get(r):(l.set(r,u),u)}function _g({_intern:l,_key:i},u){const r=i(u);return l.has(r)&&(u=l.get(r),l.delete(r)),u}function Ag(l){return l!==null&&typeof l=="object"?l.valueOf():l}const Tg=Math.sqrt(50),zg=Math.sqrt(10),Cg=Math.sqrt(2);function au(l,i,u){const r=(i-l)/Math.max(0,u),d=Math.floor(Math.log10(r)),h=r/Math.pow(10,d),f=h>=Tg?10:h>=zg?5:h>=Cg?2:1;let v,y,p;return d<0?(p=Math.pow(10,-d)/f,v=Math.round(l*p),y=Math.round(i*p),v/p<l&&++v,y/p>i&&--y,p=-p):(p=Math.pow(10,d)*f,v=Math.round(l/p),y=Math.round(i/p),v*p<l&&++v,y*p>i&&--y),y<v&&.5<=u&&u<2?au(l,i,u*2):[v,y,p]}function Og(l,i,u){if(i=+i,l=+l,u=+u,!(u>0))return[];if(l===i)return[l];const r=i<l,[d,h,f]=r?au(i,l,u):au(l,i,u);if(!(h>=d))return[];const v=h-d+1,y=new Array(v);if(r)if(f<0)for(let p=0;p<v;++p)y[p]=(h-p)/-f;else for(let p=0;p<v;++p)y[p]=(h-p)*f;else if(f<0)for(let p=0;p<v;++p)y[p]=(d+p)/-f;else for(let p=0;p<v;++p)y[p]=(d+p)*f;return y}function so(l,i,u){return i=+i,l=+l,u=+u,au(l,i,u)[2]}function Dg(l,i,u){i=+i,l=+l,u=+u;const r=i<l,d=r?so(i,l,u):so(l,i,u);return(r?-1:1)*(d<0?1/-d:d)}function ev(l,i){let u;if(i===void 0)for(const r of l)r!=null&&(u<r||u===void 0&&r>=r)&&(u=r);else{let r=-1;for(let d of l)(d=i(d,++r,l))!=null&&(u<d||u===void 0&&d>=d)&&(u=d)}return u}function Rg(l,i,u){l=+l,i=+i,u=(d=arguments.length)<2?(i=l,l=0,1):d<3?1:+u;for(var r=-1,d=Math.max(0,Math.ceil((i-l)/u))|0,h=new Array(d);++r<d;)h[r]=l+r*u;return h}function bo(l,i){switch(arguments.length){case 0:break;case 1:this.range(l);break;default:this.range(i).domain(l);break}return this}const ap=Symbol("implicit");function tv(){var l=new np,i=[],u=[],r=ap;function d(h){let f=l.get(h);if(f===void 0){if(r!==ap)return r;l.set(h,f=i.push(h)-1)}return u[f%u.length]}return d.domain=function(h){if(!arguments.length)return i.slice();i=[],l=new np;for(const f of h)l.has(f)||l.set(f,i.push(f)-1);return d},d.range=function(h){return arguments.length?(u=Array.from(h),d):u.slice()},d.unknown=function(h){return arguments.length?(r=h,d):r},d.copy=function(){return tv(i,u).unknown(r)},bo.apply(d,arguments),d}function nv(){var l=tv().unknown(void 0),i=l.domain,u=l.range,r=0,d=1,h,f,v=!1,y=0,p=0,x=.5;delete l.unknown;function g(){var j=i().length,M=d<r,k=M?d:r,G=M?r:d;h=(G-k)/Math.max(1,j-y+p*2),v&&(h=Math.floor(h)),k+=(G-k-h*(j-y))*x,f=h*(1-y),v&&(k=Math.round(k),f=Math.round(f));var q=Rg(j).map(function(X){return k+h*X});return u(M?q.reverse():q)}return l.domain=function(j){return arguments.length?(i(j),g()):i()},l.range=function(j){return arguments.length?([r,d]=j,r=+r,d=+d,g()):[r,d]},l.rangeRound=function(j){return[r,d]=j,r=+r,d=+d,v=!0,g()},l.bandwidth=function(){return f},l.step=function(){return h},l.round=function(j){return arguments.length?(v=!!j,g()):v},l.padding=function(j){return arguments.length?(y=Math.min(1,p=+j),g()):y},l.paddingInner=function(j){return arguments.length?(y=Math.min(1,j),g()):y},l.paddingOuter=function(j){return arguments.length?(p=+j,g()):p},l.align=function(j){return arguments.length?(x=Math.max(0,Math.min(1,j)),g()):x},l.copy=function(){return nv(i(),[r,d]).round(v).paddingInner(y).paddingOuter(p).align(x)},bo.apply(g(),arguments)}function Na(l,i,u){l.prototype=i.prototype=u,u.constructor=l}function As(l,i){var u=Object.create(l.prototype);for(var r in i)u[r]=i[r];return u}function Jn(){}var Ml=.7,ja=1/Ml,va="\\s*([+-]?\\d+)\\s*",Ss="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ug=/^#([0-9a-f]{3,8})$/,kg=new RegExp(`^rgb\\(${va},${va},${va}\\)$`),$g=new RegExp(`^rgb\\(${Pt},${Pt},${Pt}\\)$`),Hg=new RegExp(`^rgba\\(${va},${va},${va},${Ss}\\)$`),qg=new RegExp(`^rgba\\(${Pt},${Pt},${Pt},${Ss}\\)$`),Bg=new RegExp(`^hsl\\(${Ss},${Pt},${Pt}\\)$`),Lg=new RegExp(`^hsla\\(${Ss},${Pt},${Pt},${Ss}\\)$`),sp={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Na(Jn,Ns,{copy(l){return Object.assign(new this.constructor,this,l)},displayable(){return this.rgb().displayable()},hex:ip,formatHex:ip,formatHex8:Yg,formatHsl:Gg,formatRgb:up,toString:up});function ip(){return this.rgb().formatHex()}function Yg(){return this.rgb().formatHex8()}function Gg(){return lv(this).formatHsl()}function up(){return this.rgb().formatRgb()}function Ns(l){var i,u;return l=(l+"").trim().toLowerCase(),(i=Ug.exec(l))?(u=i[1].length,i=parseInt(i[1],16),u===6?cp(i):u===3?new nt(i>>8&15|i>>4&240,i>>4&15|i&240,(i&15)<<4|i&15,1):u===8?Wi(i>>24&255,i>>16&255,i>>8&255,(i&255)/255):u===4?Wi(i>>12&15|i>>8&240,i>>8&15|i>>4&240,i>>4&15|i&240,((i&15)<<4|i&15)/255):null):(i=kg.exec(l))?new nt(i[1],i[2],i[3],1):(i=$g.exec(l))?new nt(i[1]*255/100,i[2]*255/100,i[3]*255/100,1):(i=Hg.exec(l))?Wi(i[1],i[2],i[3],i[4]):(i=qg.exec(l))?Wi(i[1]*255/100,i[2]*255/100,i[3]*255/100,i[4]):(i=Bg.exec(l))?dp(i[1],i[2]/100,i[3]/100,1):(i=Lg.exec(l))?dp(i[1],i[2]/100,i[3]/100,i[4]):sp.hasOwnProperty(l)?cp(sp[l]):l==="transparent"?new nt(NaN,NaN,NaN,0):null}function cp(l){return new nt(l>>16&255,l>>8&255,l&255,1)}function Wi(l,i,u,r){return r<=0&&(l=i=u=NaN),new nt(l,i,u,r)}function jo(l){return l instanceof Jn||(l=Ns(l)),l?(l=l.rgb(),new nt(l.r,l.g,l.b,l.opacity)):new nt}function io(l,i,u,r){return arguments.length===1?jo(l):new nt(l,i,u,r??1)}function nt(l,i,u,r){this.r=+l,this.g=+i,this.b=+u,this.opacity=+r}Na(nt,io,As(Jn,{brighter(l){return l=l==null?ja:Math.pow(ja,l),new nt(this.r*l,this.g*l,this.b*l,this.opacity)},darker(l){return l=l==null?Ml:Math.pow(Ml,l),new nt(this.r*l,this.g*l,this.b*l,this.opacity)},rgb(){return this},clamp(){return new nt(Sl(this.r),Sl(this.g),Sl(this.b),su(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rp,formatHex:rp,formatHex8:Xg,formatRgb:op,toString:op}));function rp(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}`}function Xg(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}${gl((isNaN(this.opacity)?1:this.opacity)*255)}`}function op(){const l=su(this.opacity);return`${l===1?"rgb(":"rgba("}${Sl(this.r)}, ${Sl(this.g)}, ${Sl(this.b)}${l===1?")":`, ${l})`}`}function su(l){return isNaN(l)?1:Math.max(0,Math.min(1,l))}function Sl(l){return Math.max(0,Math.min(255,Math.round(l)||0))}function gl(l){return l=Sl(l),(l<16?"0":"")+l.toString(16)}function dp(l,i,u,r){return r<=0?l=i=u=NaN:u<=0||u>=1?l=i=NaN:i<=0&&(l=NaN),new Xt(l,i,u,r)}function lv(l){if(l instanceof Xt)return new Xt(l.h,l.s,l.l,l.opacity);if(l instanceof Jn||(l=Ns(l)),!l)return new Xt;if(l instanceof Xt)return l;l=l.rgb();var i=l.r/255,u=l.g/255,r=l.b/255,d=Math.min(i,u,r),h=Math.max(i,u,r),f=NaN,v=h-d,y=(h+d)/2;return v?(i===h?f=(u-r)/v+(u<r)*6:u===h?f=(r-i)/v+2:f=(i-u)/v+4,v/=y<.5?h+d:2-h-d,f*=60):v=y>0&&y<1?0:f,new Xt(f,v,y,l.opacity)}function Qg(l,i,u,r){return arguments.length===1?lv(l):new Xt(l,i,u,r??1)}function Xt(l,i,u,r){this.h=+l,this.s=+i,this.l=+u,this.opacity=+r}Na(Xt,Qg,As(Jn,{brighter(l){return l=l==null?ja:Math.pow(ja,l),new Xt(this.h,this.s,this.l*l,this.opacity)},darker(l){return l=l==null?Ml:Math.pow(Ml,l),new Xt(this.h,this.s,this.l*l,this.opacity)},rgb(){var l=this.h%360+(this.h<0)*360,i=isNaN(l)||isNaN(this.s)?0:this.s,u=this.l,r=u+(u<.5?u:1-u)*i,d=2*u-r;return new nt(Vr(l>=240?l-240:l+120,d,r),Vr(l,d,r),Vr(l<120?l+240:l-120,d,r),this.opacity)},clamp(){return new Xt(fp(this.h),Fi(this.s),Fi(this.l),su(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const l=su(this.opacity);return`${l===1?"hsl(":"hsla("}${fp(this.h)}, ${Fi(this.s)*100}%, ${Fi(this.l)*100}%${l===1?")":`, ${l})`}`}}));function fp(l){return l=(l||0)%360,l<0?l+360:l}function Fi(l){return Math.max(0,Math.min(1,l||0))}function Vr(l,i,u){return(l<60?i+(u-i)*l/60:l<180?u:l<240?i+(u-i)*(240-l)/60:i)*255}const av=Math.PI/180,sv=180/Math.PI,iu=18,iv=.96422,uv=1,cv=.82521,rv=4/29,xa=6/29,ov=3*xa*xa,Zg=xa*xa*xa;function dv(l){if(l instanceof en)return new en(l.l,l.a,l.b,l.opacity);if(l instanceof bn)return fv(l);l instanceof nt||(l=jo(l));var i=Fr(l.r),u=Fr(l.g),r=Fr(l.b),d=Kr((.2225045*i+.7168786*u+.0606169*r)/uv),h,f;return i===u&&u===r?h=f=d:(h=Kr((.4360747*i+.3850649*u+.1430804*r)/iv),f=Kr((.0139322*i+.0971045*u+.7141733*r)/cv)),new en(116*d-16,500*(h-d),200*(d-f),l.opacity)}function Vg(l,i,u,r){return arguments.length===1?dv(l):new en(l,i,u,r??1)}function en(l,i,u,r){this.l=+l,this.a=+i,this.b=+u,this.opacity=+r}Na(en,Vg,As(Jn,{brighter(l){return new en(this.l+iu*(l??1),this.a,this.b,this.opacity)},darker(l){return new en(this.l-iu*(l??1),this.a,this.b,this.opacity)},rgb(){var l=(this.l+16)/116,i=isNaN(this.a)?l:l+this.a/500,u=isNaN(this.b)?l:l-this.b/200;return i=iv*Jr(i),l=uv*Jr(l),u=cv*Jr(u),new nt(Wr(3.1338561*i-1.6168667*l-.4906146*u),Wr(-.9787684*i+1.9161415*l+.033454*u),Wr(.0719453*i-.2289914*l+1.4052427*u),this.opacity)}}));function Kr(l){return l>Zg?Math.pow(l,1/3):l/ov+rv}function Jr(l){return l>xa?l*l*l:ov*(l-rv)}function Wr(l){return 255*(l<=.0031308?12.92*l:1.055*Math.pow(l,1/2.4)-.055)}function Fr(l){return(l/=255)<=.04045?l/12.92:Math.pow((l+.055)/1.055,2.4)}function Kg(l){if(l instanceof bn)return new bn(l.h,l.c,l.l,l.opacity);if(l instanceof en||(l=dv(l)),l.a===0&&l.b===0)return new bn(NaN,0<l.l&&l.l<100?0:NaN,l.l,l.opacity);var i=Math.atan2(l.b,l.a)*sv;return new bn(i<0?i+360:i,Math.sqrt(l.a*l.a+l.b*l.b),l.l,l.opacity)}function Jg(l,i,u,r){return arguments.length===1?Kg(l):new bn(l,i,u,r??1)}function bn(l,i,u,r){this.h=+l,this.c=+i,this.l=+u,this.opacity=+r}function fv(l){if(isNaN(l.h))return new en(l.l,0,0,l.opacity);var i=l.h*av;return new en(l.l,Math.cos(i)*l.c,Math.sin(i)*l.c,l.opacity)}Na(bn,Jg,As(Jn,{brighter(l){return new bn(this.h,this.c,this.l+iu*(l??1),this.opacity)},darker(l){return new bn(this.h,this.c,this.l-iu*(l??1),this.opacity)},rgb(){return fv(this).rgb()}}));var hv=-.14861,So=1.78277,No=-.29227,vu=-.90649,ws=1.97294,hp=ws*vu,mp=ws*So,pp=So*No-vu*hv;function Wg(l){if(l instanceof Nl)return new Nl(l.h,l.s,l.l,l.opacity);l instanceof nt||(l=jo(l));var i=l.r/255,u=l.g/255,r=l.b/255,d=(pp*r+hp*i-mp*u)/(pp+hp-mp),h=r-d,f=(ws*(u-d)-No*h)/vu,v=Math.sqrt(f*f+h*h)/(ws*d*(1-d)),y=v?Math.atan2(f,h)*sv-120:NaN;return new Nl(y<0?y+360:y,v,d,l.opacity)}function uo(l,i,u,r){return arguments.length===1?Wg(l):new Nl(l,i,u,r??1)}function Nl(l,i,u,r){this.h=+l,this.s=+i,this.l=+u,this.opacity=+r}Na(Nl,uo,As(Jn,{brighter(l){return l=l==null?ja:Math.pow(ja,l),new Nl(this.h,this.s,this.l*l,this.opacity)},darker(l){return l=l==null?Ml:Math.pow(Ml,l),new Nl(this.h,this.s,this.l*l,this.opacity)},rgb(){var l=isNaN(this.h)?0:(this.h+120)*av,i=+this.l,u=isNaN(this.s)?0:this.s*i*(1-i),r=Math.cos(l),d=Math.sin(l);return new nt(255*(i+u*(hv*r+So*d)),255*(i+u*(No*r+vu*d)),255*(i+u*(ws*r)),this.opacity)}}));var xu=l=>()=>l;function mv(l,i){return function(u){return l+u*i}}function Fg(l,i,u){return l=Math.pow(l,u),i=Math.pow(i,u)-l,u=1/u,function(r){return Math.pow(l+r*i,u)}}function Ig(l,i){var u=i-l;return u?mv(l,u>180||u<-180?u-360*Math.round(u/360):u):xu(isNaN(l)?i:l)}function Pg(l){return(l=+l)==1?ya:function(i,u){return u-i?Fg(i,u,l):xu(isNaN(i)?u:i)}}function ya(l,i){var u=i-l;return u?mv(l,u):xu(isNaN(l)?i:l)}var vp=(function l(i){var u=Pg(i);function r(d,h){var f=u((d=io(d)).r,(h=io(h)).r),v=u(d.g,h.g),y=u(d.b,h.b),p=ya(d.opacity,h.opacity);return function(x){return d.r=f(x),d.g=v(x),d.b=y(x),d.opacity=p(x),d+""}}return r.gamma=l,r})(1);function eb(l,i){i||(i=[]);var u=l?Math.min(i.length,l.length):0,r=i.slice(),d;return function(h){for(d=0;d<u;++d)r[d]=l[d]*(1-h)+i[d]*h;return r}}function tb(l){return ArrayBuffer.isView(l)&&!(l instanceof DataView)}function nb(l,i){var u=i?i.length:0,r=l?Math.min(u,l.length):0,d=new Array(r),h=new Array(u),f;for(f=0;f<r;++f)d[f]=wo(l[f],i[f]);for(;f<u;++f)h[f]=i[f];return function(v){for(f=0;f<r;++f)h[f]=d[f](v);return h}}function lb(l,i){var u=new Date;return l=+l,i=+i,function(r){return u.setTime(l*(1-r)+i*r),u}}function uu(l,i){return l=+l,i=+i,function(u){return l*(1-u)+i*u}}function ab(l,i){var u={},r={},d;(l===null||typeof l!="object")&&(l={}),(i===null||typeof i!="object")&&(i={});for(d in i)d in l?u[d]=wo(l[d],i[d]):r[d]=i[d];return function(h){for(d in u)r[d]=u[d](h);return r}}var co=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ir=new RegExp(co.source,"g");function sb(l){return function(){return l}}function ib(l){return function(i){return l(i)+""}}function ub(l,i){var u=co.lastIndex=Ir.lastIndex=0,r,d,h,f=-1,v=[],y=[];for(l=l+"",i=i+"";(r=co.exec(l))&&(d=Ir.exec(i));)(h=d.index)>u&&(h=i.slice(u,h),v[f]?v[f]+=h:v[++f]=h),(r=r[0])===(d=d[0])?v[f]?v[f]+=d:v[++f]=d:(v[++f]=null,y.push({i:f,x:uu(r,d)})),u=Ir.lastIndex;return u<i.length&&(h=i.slice(u),v[f]?v[f]+=h:v[++f]=h),v.length<2?y[0]?ib(y[0].x):sb(i):(i=y.length,function(p){for(var x=0,g;x<i;++x)v[(g=y[x]).i]=g.x(p);return v.join("")})}function wo(l,i){var u=typeof i,r;return i==null||u==="boolean"?xu(i):(u==="number"?uu:u==="string"?(r=Ns(i))?(i=r,vp):ub:i instanceof Ns?vp:i instanceof Date?lb:tb(i)?eb:Array.isArray(i)?nb:typeof i.valueOf!="function"&&typeof i.toString!="function"||isNaN(i)?ab:uu)(l,i)}function cb(l,i){return l=+l,i=+i,function(u){return Math.round(l*(1-u)+i*u)}}var rb=1e-12;function xp(l){return((l=Math.exp(l))+1/l)/2}function ob(l){return((l=Math.exp(l))-1/l)/2}function db(l){return((l=Math.exp(2*l))-1)/(l+1)}(function l(i,u,r){function d(h,f){var v=h[0],y=h[1],p=h[2],x=f[0],g=f[1],j=f[2],M=x-v,k=g-y,G=M*M+k*k,q,X;if(G<rb)X=Math.log(j/p)/i,q=function(W){return[v+W*M,y+W*k,p*Math.exp(i*W*X)]};else{var ce=Math.sqrt(G),z=(j*j-p*p+r*G)/(2*p*u*ce),T=(j*j-p*p-r*G)/(2*j*u*ce),K=Math.log(Math.sqrt(z*z+1)-z),V=Math.log(Math.sqrt(T*T+1)-T);X=(V-K)/i,q=function(W){var Y=W*X,oe=xp(K),_e=p/(u*ce)*(oe*db(i*Y+K)-ob(K));return[v+_e*M,y+_e*k,p*oe/xp(i*Y+K)]}}return q.duration=Math.abs(X)*1e3*i/Math.SQRT2,q}return d.rho=function(h){var f=Math.max(.001,+h),v=f*f,y=v*v;return l(f,v,y)},d})(Math.SQRT2,2,4);function pv(l){return(function i(u){u=+u;function r(d,h){var f=l((d=uo(d)).h,(h=uo(h)).h),v=ya(d.s,h.s),y=ya(d.l,h.l),p=ya(d.opacity,h.opacity);return function(x){return d.h=f(x),d.s=v(x),d.l=y(Math.pow(x,u)),d.opacity=p(x),d+""}}return r.gamma=i,r})(1)}pv(Ig);pv(ya);function fb(l){return function(){return l}}function hb(l){return+l}var yp=[0,1];function ma(l){return l}function ro(l,i){return(i-=l=+l)?function(u){return(u-l)/i}:fb(isNaN(i)?NaN:.5)}function mb(l,i){var u;return l>i&&(u=l,l=i,i=u),function(r){return Math.max(l,Math.min(i,r))}}function pb(l,i,u){var r=l[0],d=l[1],h=i[0],f=i[1];return d<r?(r=ro(d,r),h=u(f,h)):(r=ro(r,d),h=u(h,f)),function(v){return h(r(v))}}function vb(l,i,u){var r=Math.min(l.length,i.length)-1,d=new Array(r),h=new Array(r),f=-1;for(l[r]<l[0]&&(l=l.slice().reverse(),i=i.slice().reverse());++f<r;)d[f]=ro(l[f],l[f+1]),h[f]=u(i[f],i[f+1]);return function(v){var y=Mg(l,v,1,r)-1;return h[y](d[y](v))}}function xb(l,i){return i.domain(l.domain()).range(l.range()).interpolate(l.interpolate()).clamp(l.clamp()).unknown(l.unknown())}function yb(){var l=yp,i=yp,u=wo,r,d,h,f=ma,v,y,p;function x(){var j=Math.min(l.length,i.length);return f!==ma&&(f=mb(l[0],l[j-1])),v=j>2?vb:pb,y=p=null,g}function g(j){return j==null||isNaN(j=+j)?h:(y||(y=v(l.map(r),i,u)))(r(f(j)))}return g.invert=function(j){return f(d((p||(p=v(i,l.map(r),uu)))(j)))},g.domain=function(j){return arguments.length?(l=Array.from(j,hb),x()):l.slice()},g.range=function(j){return arguments.length?(i=Array.from(j),x()):i.slice()},g.rangeRound=function(j){return i=Array.from(j),u=cb,x()},g.clamp=function(j){return arguments.length?(f=j?!0:ma,x()):f!==ma},g.interpolate=function(j){return arguments.length?(u=j,x()):u},g.unknown=function(j){return arguments.length?(h=j,g):h},function(j,M){return r=j,d=M,x()}}function gb(){return yb()(ma,ma)}function bb(l){return Math.abs(l=Math.round(l))>=1e21?l.toLocaleString("en").replace(/,/g,""):l.toString(10)}function cu(l,i){if(!isFinite(l)||l===0)return null;var u=(l=i?l.toExponential(i-1):l.toExponential()).indexOf("e"),r=l.slice(0,u);return[r.length>1?r[0]+r.slice(2):r,+l.slice(u+1)]}function Sa(l){return l=cu(Math.abs(l)),l?l[1]:NaN}function jb(l,i){return function(u,r){for(var d=u.length,h=[],f=0,v=l[0],y=0;d>0&&v>0&&(y+v+1>r&&(v=Math.max(1,r-y)),h.push(u.substring(d-=v,d+v)),!((y+=v+1)>r));)v=l[f=(f+1)%l.length];return h.reverse().join(i)}}function Sb(l){return function(i){return i.replace(/[0-9]/g,function(u){return l[+u]})}}var Nb=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ru(l){if(!(i=Nb.exec(l)))throw new Error("invalid format: "+l);var i;return new Mo({fill:i[1],align:i[2],sign:i[3],symbol:i[4],zero:i[5],width:i[6],comma:i[7],precision:i[8]&&i[8].slice(1),trim:i[9],type:i[10]})}ru.prototype=Mo.prototype;function Mo(l){this.fill=l.fill===void 0?" ":l.fill+"",this.align=l.align===void 0?">":l.align+"",this.sign=l.sign===void 0?"-":l.sign+"",this.symbol=l.symbol===void 0?"":l.symbol+"",this.zero=!!l.zero,this.width=l.width===void 0?void 0:+l.width,this.comma=!!l.comma,this.precision=l.precision===void 0?void 0:+l.precision,this.trim=!!l.trim,this.type=l.type===void 0?"":l.type+""}Mo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function wb(l){e:for(var i=l.length,u=1,r=-1,d;u<i;++u)switch(l[u]){case".":r=d=u;break;case"0":r===0&&(r=u),d=u;break;default:if(!+l[u])break e;r>0&&(r=0);break}return r>0?l.slice(0,r)+l.slice(d+1):l}var ou;function Mb(l,i){var u=cu(l,i);if(!u)return ou=void 0,l.toPrecision(i);var r=u[0],d=u[1],h=d-(ou=Math.max(-8,Math.min(8,Math.floor(d/3)))*3)+1,f=r.length;return h===f?r:h>f?r+new Array(h-f+1).join("0"):h>0?r.slice(0,h)+"."+r.slice(h):"0."+new Array(1-h).join("0")+cu(l,Math.max(0,i+h-1))[0]}function gp(l,i){var u=cu(l,i);if(!u)return l+"";var r=u[0],d=u[1];return d<0?"0."+new Array(-d).join("0")+r:r.length>d+1?r.slice(0,d+1)+"."+r.slice(d+1):r+new Array(d-r.length+2).join("0")}var bp={"%":(l,i)=>(l*100).toFixed(i),b:l=>Math.round(l).toString(2),c:l=>l+"",d:bb,e:(l,i)=>l.toExponential(i),f:(l,i)=>l.toFixed(i),g:(l,i)=>l.toPrecision(i),o:l=>Math.round(l).toString(8),p:(l,i)=>gp(l*100,i),r:gp,s:Mb,X:l=>Math.round(l).toString(16).toUpperCase(),x:l=>Math.round(l).toString(16)};function jp(l){return l}var Sp=Array.prototype.map,Np=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Eb(l){var i=l.grouping===void 0||l.thousands===void 0?jp:jb(Sp.call(l.grouping,Number),l.thousands+""),u=l.currency===void 0?"":l.currency[0]+"",r=l.currency===void 0?"":l.currency[1]+"",d=l.decimal===void 0?".":l.decimal+"",h=l.numerals===void 0?jp:Sb(Sp.call(l.numerals,String)),f=l.percent===void 0?"%":l.percent+"",v=l.minus===void 0?"−":l.minus+"",y=l.nan===void 0?"NaN":l.nan+"";function p(g,j){g=ru(g);var M=g.fill,k=g.align,G=g.sign,q=g.symbol,X=g.zero,ce=g.width,z=g.comma,T=g.precision,K=g.trim,V=g.type;V==="n"?(z=!0,V="g"):bp[V]||(T===void 0&&(T=12),K=!0,V="g"),(X||M==="0"&&k==="=")&&(X=!0,M="0",k="=");var W=(j&&j.prefix!==void 0?j.prefix:"")+(q==="$"?u:q==="#"&&/[boxX]/.test(V)?"0"+V.toLowerCase():""),Y=(q==="$"?r:/[%p]/.test(V)?f:"")+(j&&j.suffix!==void 0?j.suffix:""),oe=bp[V],_e=/[defgprs%]/.test(V);T=T===void 0?6:/[gprs]/.test(V)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function we(ae){var Ye=W,I=Y,Z,O,Q;if(V==="c")I=oe(ae)+I,ae="";else{ae=+ae;var P=ae<0||1/ae<0;if(ae=isNaN(ae)?y:oe(Math.abs(ae),T),K&&(ae=wb(ae)),P&&+ae==0&&G!=="+"&&(P=!1),Ye=(P?G==="("?G:v:G==="-"||G==="("?"":G)+Ye,I=(V==="s"&&!isNaN(ae)&&ou!==void 0?Np[8+ou/3]:"")+I+(P&&G==="("?")":""),_e){for(Z=-1,O=ae.length;++Z<O;)if(Q=ae.charCodeAt(Z),48>Q||Q>57){I=(Q===46?d+ae.slice(Z+1):ae.slice(Z))+I,ae=ae.slice(0,Z);break}}}z&&!X&&(ae=i(ae,1/0));var xe=Ye.length+ae.length+I.length,fe=xe<ce?new Array(ce-xe+1).join(M):"";switch(z&&X&&(ae=i(fe+ae,fe.length?ce-I.length:1/0),fe=""),k){case"<":ae=Ye+ae+I+fe;break;case"=":ae=Ye+fe+ae+I;break;case"^":ae=fe.slice(0,xe=fe.length>>1)+Ye+ae+I+fe.slice(xe);break;default:ae=fe+Ye+ae+I;break}return h(ae)}return we.toString=function(){return g+""},we}function x(g,j){var M=Math.max(-8,Math.min(8,Math.floor(Sa(j)/3)))*3,k=Math.pow(10,-M),G=p((g=ru(g),g.type="f",g),{suffix:Np[8+M/3]});return function(q){return G(k*q)}}return{format:p,formatPrefix:x}}var Ii,vv,xv;_b({thousands:",",grouping:[3],currency:["$",""]});function _b(l){return Ii=Eb(l),vv=Ii.format,xv=Ii.formatPrefix,Ii}function Ab(l){return Math.max(0,-Sa(Math.abs(l)))}function Tb(l,i){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sa(i)/3)))*3-Sa(Math.abs(l)))}function zb(l,i){return l=Math.abs(l),i=Math.abs(i)-l,Math.max(0,Sa(i)-Sa(l))+1}function Cb(l,i,u,r){var d=Dg(l,i,u),h;switch(r=ru(r??",f"),r.type){case"s":{var f=Math.max(Math.abs(l),Math.abs(i));return r.precision==null&&!isNaN(h=Tb(d,f))&&(r.precision=h),xv(r,f)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(h=zb(d,Math.max(Math.abs(l),Math.abs(i))))&&(r.precision=h-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(h=Ab(d))&&(r.precision=h-(r.type==="%")*2);break}}return vv(r)}function Ob(l){var i=l.domain;return l.ticks=function(u){var r=i();return Og(r[0],r[r.length-1],u??10)},l.tickFormat=function(u,r){var d=i();return Cb(d[0],d[d.length-1],u??10,r)},l.nice=function(u){u==null&&(u=10);var r=i(),d=0,h=r.length-1,f=r[d],v=r[h],y,p,x=10;for(v<f&&(p=f,f=v,v=p,p=d,d=h,h=p);x-- >0;){if(p=so(f,v,u),p===y)return r[d]=f,r[h]=v,i(r);if(p>0)f=Math.floor(f/p)*p,v=Math.ceil(v/p)*p;else if(p<0)f=Math.ceil(f*p)/p,v=Math.floor(v*p)/p;else break;y=p}return l},l}function Eo(){var l=gb();return l.copy=function(){return xb(l,Eo())},bo.apply(l,arguments),Ob(l)}function yv(l){const i=atob(l),u=new Uint8Array(i.length);for(let r=0;r<i.length;r++)u[r]=i.charCodeAt(r);return u}function Db(l){const i=yv(l),u=new DataView(i.buffer,i.byteOffset,i.byteLength),r=new Float32Array(i.byteLength/4);for(let d=0;d<r.length;d++)r[d]=u.getFloat32(d*4,!0);return r}const Pr=64;function Ms(l,i,u=null,r=null){return l===void 0||!Number.isFinite(l)?{v:null,ev:"unresolved",unit:u,proof:r,ptr:null,reason:"non-finite value",note:null,recorded_authority:null}:{v:l,ev:i,unit:u,proof:r,ptr:null,reason:null,note:null,recorded_authority:null}}function Rb({r:l}){const i=s.jsxs("div",{className:"faint",children:[l.op," of [",l.shape.map(String).join("×"),"] ",l.dtype,l.note?` · ${l.note}`:""]});switch(l.op){case"stats":return s.jsxs("div",{children:[i,s.jsx("table",{children:s.jsx("tbody",{children:["count","finite","min","max","mean","std","absmax","l2"].map(u=>s.jsxs("tr",{children:[s.jsx("td",{className:"muted",children:u}),s.jsx("td",{children:s.jsx(ze,{n:l[u],showReason:!0})})]},u))})})]});case"topk":return s.jsxs("div",{children:[i,s.jsxs("div",{className:"faint",children:["ranked by ",l.score]}),s.jsx("table",{children:s.jsx("tbody",{children:l.entries.map((u,r)=>s.jsxs("tr",{children:[s.jsxs("td",{className:"mono",children:["[",u.index.map(String).join(","),"]"]}),s.jsx("td",{children:s.jsx(ze,{n:u.v,showReason:!0})})]},r))})})]});case"slice":case"project":{const u=Db(l.data),r=l.ev;return s.jsxs("div",{children:[i,s.jsxs("div",{className:"faint",children:["out [",l.outShape.map(String).join("×"),"]"," ",l.op==="project"&&s.jsxs(s.Fragment,{children:["· direction norm ",s.jsx(ze,{n:l.directionNorm})]})]}),s.jsx("table",{children:s.jsx("tbody",{children:Array.from(u.slice(0,Pr)).map((d,h)=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono faint",children:s.jsx(le,{n:h})}),s.jsx("td",{children:s.jsx(ze,{n:Ms(d,r,null,l.op==="project"?"dot product with direction":null)})})]},h))})}),u.length>Pr&&s.jsxs("div",{className:"faint",children:["+",s.jsx(le,{n:u.length-Pr})," more values (narrow the selector)"]})]})}case"histogram":return s.jsxs("div",{children:[i,s.jsx(Ub,{r:l})]});case"tile":return s.jsxs("div",{children:[i,s.jsx(kb,{r:l})]})}}function Ub({r:l}){const[i,u]=L.useState(null),r=260,d=80,h=Eo().domain([0,Math.max(1,ev(l.counts)??1)]).range([0,d]),f=nv().domain(l.counts.map((y,p)=>p)).range([0,r]).paddingInner(.08),v=l.edges.vs;return s.jsxs("div",{children:[s.jsx("svg",{width:r,height:d,role:"img","aria-label":"histogram",onMouseLeave:()=>u(null),children:l.counts.map((y,p)=>s.jsx("rect",{x:f(p)??0,y:d-h(y),width:Math.max(1,f.bandwidth()),height:h(y),fill:i===p?"var(--ink)":"var(--ink-2)",onMouseEnter:()=>u(p)},p))}),s.jsx("div",{className:"muted",style:{minHeight:20},children:i!==null?s.jsxs(s.Fragment,{children:["[",s.jsx(ze,{n:Ms(v[i],l.edges.ev,null,l.edges.proof),bare:!0}),","," ",s.jsx(ze,{n:Ms(v[i+1],l.edges.ev,null,l.edges.proof),bare:!0}),")"," ",s.jsx(le,{n:l.counts[i]??0})," values"]}):s.jsxs(s.Fragment,{children:[s.jsx(le,{n:l.bins})," bins · ",s.jsx(le,{n:l.nonfinite})," non-finite"]})})]})}function kb({r:l}){const i=L.useRef(null),u=Math.max(1,Math.floor(256/Math.max(l.w,l.h,1)));L.useEffect(()=>{var y;const h=(y=i.current)==null?void 0:y.getContext("2d");if(!h||!l.w||!l.h)return;const f=yv(l.data),v=h.createImageData(l.w,l.h);for(let p=0;p<f.length;p++){const x=f[p]??0,g=x===0?0:Math.round((x-1)/254*255);v.data[p*4]=g,v.data[p*4+1]=g,v.data[p*4+2]=g,v.data[p*4+3]=x===0?0:255}h.putImageData(v,0,0)},[l]);const[r,d]=l.domain.vs;return s.jsxs("div",{children:[s.jsx("canvas",{ref:i,width:l.w,height:l.h,style:{width:l.w*u,height:l.h*u,imageRendering:"pixelated",border:"1px dashed var(--ink-3)",display:"block"},"aria-label":"tile"}),s.jsxs("div",{className:"muted",children:[l.scale," · black ",s.jsx(ze,{n:Ms(r,l.domain.ev,null,l.domain.proof),bare:!0})," → white"," ",s.jsx(ze,{n:Ms(d,l.domain.ev,null,l.domain.proof),bare:!0})," · ",l.agg," · level"," ",s.jsx(le,{n:l.level})," of [",l.full.map(String).join("×"),"] · ",s.jsx(le,{n:l.nonfinite})," empty blocks"]})]})}function wp(l){try{return JSON.parse(l)}catch{return}}function $b({sid:l,pointer:i}){const u=tp(V=>V.run),r=tp(V=>V.entries),[d,h]=L.useState("stats"),[f,v]=L.useState(8),[y,p]=L.useState(32),[x,g]=L.useState(0),[j,M]=L.useState("[0]"),[k,G]=L.useState(""),[q,X]=L.useState(null),z=(()=>{if(d==="topk")return{k:f};if(d==="histogram")return{bins:y};if(d==="tile")return{level:x};if(d==="slice"){const V=wp(j);return Array.isArray(V)?{selector:V}:null}if(d==="project"){const V=wp(k);return V&&typeof V=="object"?{direction:V}:null}return{}})(),T=z?Ip(l,i.digest,d,z):null,K=T?r.get(T):void 0;return i.status==="frontier"||!i.spec?s.jsx(Kn,{what:"reduce",refused:{refused:"frontier",detail:i.reason}}):s.jsxs("div",{style:{display:"grid",gap:6},children:[s.jsxs("form",{style:{display:"flex",gap:4,flexWrap:"wrap",alignItems:"center"},onSubmit:V=>{if(V.preventDefault(),!z)return X(d==="slice"?"selector is a JSON list":"direction is a JSON pointer spec");X(null),u(l,i,d,z)},children:[s.jsx("select",{"aria-label":"reduce op",value:d,onChange:V=>h(V.target.value),children:["stats","topk","histogram","tile","slice","project"].map(V=>s.jsx("option",{value:V,children:V},V))}),d==="topk"&&s.jsx("input",{"aria-label":"k",type:"number",min:1,max:64,value:f,onChange:V=>v(Number(V.target.value)),style:{width:56}}),d==="histogram"&&s.jsx("input",{"aria-label":"bins",type:"number",min:1,max:256,value:y,onChange:V=>p(Number(V.target.value)),style:{width:56}}),d==="tile"&&s.jsx("input",{"aria-label":"level",type:"number",min:0,max:16,value:x,onChange:V=>g(Number(V.target.value)),style:{width:56}}),d==="slice"&&s.jsx("input",{"aria-label":"selector",className:"mono",value:j,onChange:V=>M(V.target.value),placeholder:"[0, [0, 16]]"}),d==="project"&&s.jsx("input",{"aria-label":"direction",className:"mono",value:k,onChange:V=>G(V.target.value),placeholder:'{"kind":"blob","ref":"…"}'}),s.jsx("button",{type:"submit",children:"run"})]}),q&&s.jsx("div",{className:"muted",children:q}),(K==null?void 0:K.state)==="loading"&&s.jsx("div",{className:"faint",children:"reducing…"}),(K==null?void 0:K.state)==="refused"&&s.jsx(Kn,{what:d,refused:K.refused}),(K==null?void 0:K.state)==="ok"&&s.jsx(Rb,{r:K.result})]})}function Hb(){const l=Vn(f=>{var v;return((v=f.hello)==null?void 0:v.live)??null}),i=de(f=>f.sid),u=bl(f=>f.selected),r=bl(f=>f.node),d=bl(f=>u===null?null:f.circuits.get(u)??null);if(!l||i!==l||!d||r===null)return null;const h=pu(d.body).find(f=>f.id===r);return h?s.jsxs("div",{className:"inspector-node","data-testid":"inspector-node",children:[s.jsxs("div",{className:"muted",children:["circuit ",String(d.id)," node ",s.jsx("strong",{children:h.name})]}),s.jsx(mu,{value:h.raw,name:"node",depth:2}),h.children.length>0&&s.jsxs("div",{className:"faint",children:[s.jsx(le,{n:h.children.length})," children (walk right to reach them)"]})]}):null}function qb(){const l=de(r=>r.sid),i=de(r=>r.addr),u=gt("frame",l&&i?`/s/${encodeURIComponent(l)}/frame`:null,{addr:i});return l?s.jsxs("section",{className:"panel","aria-label":"inspector",children:[s.jsx("h2",{children:"Inspector"}),s.jsxs("div",{className:"panel-body",children:[s.jsx(Hb,{}),i?s.jsx(Qt,{what:"frame",loaded:u,children:r=>s.jsx(Bb,{sid:l,f:r})}):s.jsx(po,{what:"cursor",reason:"No address yet: click a cell, or press g."})]})]}):null}function Bb({sid:l,f:i}){var p;const u=de(x=>x.go),r=Be(x=>x.inspect),d=Be(x=>x.set),h=de(x=>x.open),f=Kp(Vn(x=>{var g;return((g=x.caps)==null?void 0:g.layers)??null})),v=((p=i.focus)==null?void 0:p.pointers)??[],y=(r&&v.find(x=>x.digest===r.digest))??r??v.find(x=>x.status==="resolvable")??null;return s.jsxs("div",{style:{display:"grid",gap:8},children:[s.jsxs("div",{children:[s.jsx("code",{style:{wordBreak:"break-all"},children:i.addr}),s.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[s.jsx("button",{type:"button",disabled:!i.prev,onClick:()=>i.prev&&u(i.prev),title:"previous recorded state (←)",children:"← prev"}),s.jsx("button",{type:"button",disabled:!i.next,onClick:()=>i.next&&u(i.next),title:"next recorded state (→)",children:"next →"})]})]}),s.jsx("div",{className:"table-scroll",children:s.jsx("table",{children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsx("td",{className:"muted",children:"run"}),s.jsx("td",{className:"mono",children:i.occ.run})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"muted",children:"branch"}),s.jsx("td",{children:i.occ.branch??s.jsx("span",{className:"faint",children:"none"})})]}),i.axes.map(x=>{var g;return s.jsxs("tr",{children:[s.jsx("td",{className:"muted",children:x.label}),s.jsx("td",{children:i.pos[x.id]===null||i.pos[x.id]===void 0?s.jsx("span",{className:"faint",children:"not on this axis"}):s.jsxs(s.Fragment,{children:[((g=x.ticks[i.pos[x.id]??0])==null?void 0:g.label)??""," ",s.jsxs("span",{className:"faint",children:["(index ",s.jsx(le,{n:i.pos[x.id]??0}),")"]})]})})]},x.id)}),s.jsxs("tr",{children:[s.jsx("td",{className:"muted",children:"live"}),s.jsxs("td",{children:[i.live.state,i.live.frontier.map(x=>s.jsx("div",{className:"faint",children:x},x))]})]})]})})}),i.key===null&&f==="unknown"&&s.jsx("div",{className:"na","data-testid":"cell-identity-unknown",children:"cell identity unknown: layer count not recorded"}),i.focus?s.jsxs("div",{style:{display:"grid",gap:4},children:[i.focus.note&&s.jsx("div",{className:"muted",children:i.focus.note}),i.focus.cut&&s.jsxs("div",{children:["cut ",s.jsx("code",{title:i.focus.cut,children:i.focus.cut.slice(0,16)})]}),s.jsx("div",{children:i.focus.receipts.map(x=>s.jsx(dg,{id:x},x))}),i.focus.symbols.length>0&&s.jsxs("div",{children:["symbols"," ",i.focus.symbols.map(x=>s.jsx("button",{type:"button",className:"chip",onClick:()=>h({symbol:x}),children:x.slice(0,24)},x))]}),i.focus.records.length>0&&s.jsxs("div",{children:["records"," ",i.focus.records.map(x=>s.jsx("button",{type:"button",className:"chip",onClick:()=>{h({record:x}),d({drawerOpen:!0})},children:x.slice(0,24)},x))]}),s.jsxs("div",{children:["pointers"," ",v.length?v.map(x=>s.jsx(Vp,{pointer:x},x.digest)):s.jsx("span",{className:"faint",children:"none retained here"})]})]}):s.jsx(po,{what:"state at this address",reason:"Nothing recorded at this address."}),y&&s.jsx($b,{sid:l,pointer:y}),i.stateClock&&s.jsxs("details",{children:[s.jsx("summary",{className:"muted",children:"state clock (provenance)"}),s.jsx(mu,{value:i.stateClock,name:"stateClock",depth:1})]})]})}function Lb(l,i){const u=[{key:"in",label:"in",layer:null,stops:[]}];for(let d=0;d<i;d+=1)u.push({key:`L${d}`,label:`L${d}`,layer:d,stops:[]});u.push({key:"out",label:"out",layer:null,stops:[]});const r=l.findIndex(d=>/^L\d+\./.test(d));return l.forEach((d,h)=>{var v;const f=/^L(\d+)\./.exec(d);f?(v=u[1+Number(f[1])])==null||v.stops.push(d):(r<0||h<r?u[0]:u[u.length-1]).stops.push(d)}),u}function Pi(l){const i=/^t(\d+)\.(?:L(\d+)\.|([A-Za-z_]+))/.exec(l);return i?i[2]!==void 0?{row:Number(i[1]),lane:`L${i[2]}`}:{row:Number(i[1]),lane:i[3]==="start"||i[3]==="emb"?"in":"out"}:null}function Yb(l,i,u){if(l===null)return u.layer===null?"empty":"cache";const r=new Set(i.slice(0,l)),d=u.stops.filter(h=>r.has(h)).length;return!u.stops.length||d===0?"empty":d===u.stops.length?"full":"partial"}function Gb(l,i){return i.layer!==null?`t${l}.L${i.layer}.h`:i.key==="in"?`t${l}.emb`:`t${l}.logits`}function Xb({frame:l,timeline:i,circuit:u,checkpoints:r=[],busy:d,seek:h}){var G;if(!i||!i.cursor||l.where===null)return s.jsx("div",{className:"arch na","data-testid":"arch",children:"architecture: no run yet"});const f=i.limits.layers??l.limits.layers??0,v=Lb(i.stops,f),y=new Map,p=(q,X)=>{if(!q)return;const ce=`${q.row}|${q.lane}`;y.set(ce,[...y.get(ce)??[],X])};for(const q of i.rows)for(const X of q.edits)p(Pi(`t${q.row}.${X}`),`edit ${X}`);for(const q of[...l.checkpoints,...r])p(Pi(q.where),`checkpoint ${q.name}`);const x=new Set,g=new Set;for(const q of u){const X=Pi(q);if(!X)continue;x.add(`${X.row}|${X.lane}`);const ce=Bp(q);ce!==null&&X.lane.startsWith("L")&&g.add(`${ce}|${X.lane}`)}const j=i.cursor,M=((G=Pi(`t${j.row}.${j.label}`))==null?void 0:G.lane)??null,k=new Set(u.map(q=>q.split("[")[0]));return s.jsxs("div",{className:"arch","data-testid":"arch","aria-label":"architecture",children:[s.jsx("div",{className:"arch-grid-wrap",children:s.jsxs("table",{className:"arch-grid",role:"grid","aria-label":"token rows by layers",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{}),i.rows.map(q=>s.jsxs("th",{scope:"col",className:q.row===j.row?"arch-here-col":void 0,children:["t",q.row]},q.row))]})}),s.jsx("tbody",{children:v.map(q=>s.jsxs("tr",{children:[s.jsx("th",{scope:"row",className:"mono",children:q.label}),i.rows.map(X=>{const ce=Yb(X.count,i.stops,q),z=`${X.row}|${q.key}`,T=X.row===j.row&&q.key===M,K=y.get(z)??[],V=x.has(z),W=g.has(z),Y=Gb(X.row,q),oe=[`t${X.row} ${q.label}: ${Qb[ce]}`,T?"cursor here":"",...K,V?"a node of the selected circuit":"",W?"read by the selected circuit":"",`click: seek ${Y} (asks first)`].filter(Boolean).join(`
54
+ `);return s.jsx("td",{className:"arch-td",children:s.jsxs("button",{type:"button",className:`arch-cell arch-${ce}${T?" arch-cursor":""}${V?" arch-node":""}${W?" arch-read":""}`,disabled:d,title:oe,"aria-label":oe.replace(/\n/g,"; "),"data-cell":z,"data-state":ce,onClick:()=>h(Y,`architecture cell t${X.row} ${q.label}`),children:[K.some(_e=>_e.startsWith("edit"))?"✎":"",K.some(_e=>_e.startsWith("checkpoint"))?"⚑":"",V?"◆":W?"○":""]})},X.row)})]},q.key))})]})}),s.jsxs("div",{className:"arch-ports","aria-label":`port program of t${l.row}.L${l.layer}`,children:[s.jsxs("span",{className:"faint mono",children:["t",l.row??"?",".L",l.layer??"?"]}),l.ports.map(q=>{const X=k.has(q.addr);return s.jsxs("button",{type:"button",className:`arch-port${q.computed?" arch-full":" arch-empty"}${q.cursor?" arch-cursor":""}${X?" arch-node":""}`,disabled:d,title:`${q.addr}: ${q.computed?"computed":"not computed yet"}${q.cursor?" (cursor)":""}${X?"; a node of the selected circuit":""}; click: seek (asks first)`,onClick:()=>h(q.addr,`port ${q.addr}`),children:[q.port,X?"◆":""]},q.port)})]}),s.jsxs("div",{className:"faint arch-legend",children:[s.jsx("span",{className:"arch-cell arch-full"})," computed ",s.jsx("span",{className:"arch-cell arch-partial"})," ","part computed ",s.jsx("span",{className:"arch-cell arch-cache"})," cache only (prefilled)"," ",s.jsx("span",{className:"arch-cell arch-empty"})," not computed (no value) · ✎ edit · ⚑ checkpoint · ◆ circuit node · ○ read by the circuit · outlined: cursor"]})]})}const Qb={full:"computed",partial:"partly computed",cache:"cache only (prefilled, not stepped)",empty:"not computed (no value)"};function te({value:l,what:i,showReason:u=!0,compact:r=!1}){const d=ga(l,i);return d.kind==="num"?s.jsx(ze,{n:d.n,compact:r,showReason:u}):d.kind==="absent"?s.jsx(ze,{n:d.n,showReason:u}):s.jsx("span",{className:"op-summary",children:d.parts.map(([h,f])=>s.jsxs("span",{children:[s.jsxs("span",{className:"faint",children:[h," "]}),s.jsx(ze,{n:f,compact:r})," "]},h))})}function _l({slot:l,what:i,onInterrupt:u,idle:r}){switch(l.state){case"idle":return s.jsx("div",{className:"faint","data-testid":`${i}-idle`,children:r});case"running":return s.jsxs("div",{className:"slot-running",role:"status","data-testid":`${i}-running`,children:[s.jsxs("span",{"data-testid":"state-running",children:["running ",l.label,"…"]})," ",s.jsx("button",{type:"button",onClick:u,title:"Ctrl-C the running op",children:"interrupt"})]});case"refused":return s.jsxs("div",{className:"na",role:"note","data-testid":`${i}-refused`,"data-ev":"refused",children:[s.jsxs("strong",{children:[l.label,": refused",l.type?` (${l.type})`:""]})," ",s.jsx("span",{className:"num-refused",children:l.reason})]});case"interrupted":return s.jsxs("div",{className:"na",role:"note","data-testid":`${i}-interrupted`,children:[s.jsxs("strong",{children:[l.label,": interrupted"]})," at ",s.jsx("code",{children:l.where}),"; no result. The engine rolled any half-done move back."]});case"request-refused":return s.jsx(Kn,{what:l.label,refused:l.refused});case"done":return s.jsxs("div",{className:"faint","data-testid":`${i}-done`,children:[s.jsx("code",{children:l.label}),l.partial&&s.jsxs("span",{"data-testid":`${i}-unresolved`,title:l.partial,children:[" ","· partly unresolved: ",l.partial]})]})}}function Mp(l){return Ie(ue(l,"value"))}function Zb(l){return l?{children:Mp(l.children)??0,descendants:Mp(l.descendants)??0}:null}function Vb(l,i){return!i.size||!ie(l.root)?l:{...l,root:gv(l.root,i)}}function gv(l,i){const u=R(l.id),r=u!==null&&ie(l.paged)?i.get(u):void 0,d=r?{...r,was_paged:l.paged}:l,h=Ft(d.children);return h.length?{...d,children:h.map(f=>gv(f,i))}:d}function Kb(l){switch(l.state){case"refused":return l.reason;case"request-refused":return l.refused.detail??l.refused.refused;case"interrupted":return`interrupted at ${l.where}`;default:return"no answer"}}async function Jb(l,i){if(l.kind==="live"){const h=`circuit show ${l.id} node=${i}`,f=Xp(h,await It.getState().run("circuit",{target:"show",id:l.id,node:i}));if(f.state!=="done")return Kb(f);const v=ue(f.result,"page","node");return ie(v)?v:"the answer holds no page"}const u=`/s/${encodeURIComponent(l.sid)}/stored/${encodeURIComponent(l.record)}`,r=await xo("stored",hu(u,{node:i}));if(!r.ok)return r.refused.detail??r.refused.refused;const d=ue(r.env.data.body,"node");return ie(d)?d:"the answer holds no page"}function Wb(l){const[i,u]=L.useState(new Map),[r,d]=L.useState(new Map),h=L.useRef(new Set),f=l.kind==="live"?`live:${l.id}`:`${l.sid}:${l.record}`,v=L.useCallback(async y=>{if(h.current.has(y))return;h.current.add(y),d(x=>new Map(x).set(y,{state:"loading"}));const p=await Jb(l,y);if(h.current.delete(y),typeof p=="string"){d(x=>new Map(x).set(y,{state:"failed",reason:p}));return}u(x=>new Map(x).set(y,p)),d(x=>{const g=new Map(x);return g.delete(y),g})},[f]);return{pages:i,status:r,load:v}}function Fb(l){const{circuits:i,selected:u,act:r}=l,d=u!==null?i.get(u)??null:null;return s.jsxs("div",{className:"circuit-view","data-testid":"circuit-view",children:[s.jsx(Pb,{busy:l.busy,act:r,focus:l.focus,entry:d}),s.jsx(_l,{slot:l.slot,what:"circuit",onInterrupt:r.interrupt,idle:"No circuit built in this page yet: name a consumer and press build, or show one from the list."}),s.jsx(ej,{...l}),l.focus&&s.jsx(tj,{focus:l.focus,entry:d}),d?s.jsxs(s.Fragment,{children:[s.jsx(bv,{entry:d}),s.jsx(Sv,{entry:d,source:{kind:"live",id:d.id},...l},d.id),s.jsx(hj,{entry:d,...l})]}):u!==null&&s.jsxs("div",{className:"na","data-testid":"circuit-unseen",children:["circuit ",u,": not loaded in this page; press show in the list."]})]})}function Ib({id:l,body:i,source:u=null}){const[r,d]=L.useState(null),h=L.useMemo(()=>({id:l,body:i,test:null,ablated:null}),[l,i]),f=L.useMemo(()=>new Map([[l,h]]),[l,h]),v=L.useMemo(()=>({build:()=>{},select:()=>{},test:()=>{},node:d,seek:()=>{},overlay:()=>{},interrupt:()=>{}}),[]);return s.jsxs("div",{className:"circuit-view","data-testid":"stored-circuit",children:[s.jsx(bv,{entry:h}),s.jsx(Sv,{entry:h,source:u,ledger:[],circuits:f,selected:l,node:r,focus:null,slot:{state:"idle"},testSlot:{state:"idle"},busy:!1,overlay:!1,act:v,readOnly:!0},`${l}:${(u==null?void 0:u.kind)==="stored"?u.record:""}`)]})}function Pb({busy:l,act:i,focus:u,entry:r}){const[d,h]=L.useState(""),[f,v]=L.useState(2),[y,p]=L.useState(3),x=R(r==null?void 0:r.body.consumer)??"",g=d.trim()||x;return s.jsxs("form",{className:"circuit-build","aria-label":"build a circuit",onSubmit:j=>{j.preventDefault(),g&&i.build(g,f,y)},children:[s.jsx("span",{className:"muted",children:"circuit"}),s.jsx("input",{className:"mono","aria-label":"circuit consumer",placeholder:x||"M[4,9] | logits[7] | L1.o",value:d,onChange:j=>h(j.target.value),size:14}),s.jsxs("label",{children:["top K"," ",s.jsx("select",{"aria-label":"top K",value:f,onChange:j=>v(Number(j.target.value)),children:[1,2,3,4,5,6,7,8].map(j=>s.jsx("option",{value:j,children:j},j))})]}),s.jsxs("label",{children:["depth"," ",s.jsxs("select",{"aria-label":"depth",value:y,onChange:j=>p(Number(j.target.value)),children:[s.jsx("option",{value:1,children:"1 layer terms"}),s.jsx("option",{value:2,children:"2 heads, neurons"}),s.jsx("option",{value:3,children:"3 source rows"})]})]}),s.jsx("button",{type:"submit",disabled:l||!g,children:"build"}),u&&s.jsx("span",{className:"faint",children:"(depth 3 shows which source rows each head reads)"})]})}function ej({ledger:l,circuits:i,selected:u,busy:r,overlay:d,act:h}){return s.jsxs("section",{className:"circuit-ledger","aria-label":"circuits built in this run",children:[s.jsx("h3",{children:"Circuits built in this run"}),l.length?s.jsx("div",{className:"table-scroll",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"id"}),s.jsx("th",{children:"consumer"}),s.jsx("th",{children:"K"}),s.jsx("th",{children:"D"}),s.jsx("th",{children:"nodes"}),s.jsx("th",{children:"built at"}),s.jsx("th",{children:"last test"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:l.map(f=>s.jsxs("tr",{className:f.id===u?"selected-row":void 0,"data-circuit":f.id,children:[s.jsx("td",{children:s.jsx(le,{n:f.id})}),s.jsxs("td",{className:"mono",children:[f.consumer,f.from_previous_run&&s.jsxs(s.Fragment,{children:[" ",s.jsx("span",{className:"chip faint","data-testid":"previous-run",title:"built by an earlier run (before start/restart): its cursor and source rows are that run's prompt, not this one's",children:"previous run"})]})]}),s.jsx("td",{children:s.jsx(le,{n:f.k})}),s.jsx("td",{children:s.jsx(le,{n:f.depth})}),s.jsx("td",{children:s.jsx(le,{n:f.count})}),s.jsx("td",{className:"mono faint",children:f.where}),s.jsx("td",{children:f.verdict?s.jsx("span",{className:"chip verdict-chip",children:f.verdict}):s.jsx("span",{className:"faint",children:"not tested"})}),s.jsx("td",{children:s.jsx("button",{type:"button",disabled:r&&!i.has(f.id),"aria-pressed":f.id===u,onClick:()=>h.select(f.id),title:i.has(f.id)?"draw it":"circuit show ID (fetch and draw it)",children:f.id===u?"shown":"show"})})]},f.id))})]})}):s.jsx("div",{className:"faint",children:"none yet"}),s.jsxs("label",{className:"muted",children:[s.jsx("input",{type:"checkbox",checked:d,onChange:f=>h.overlay(f.target.checked)})," ","highlight the selected circuit's nodes on the pipeline and the architecture strip"]})]})}function bv({entry:l}){const i=l.body,u=i.closure;return s.jsxs("div",{className:"circuit-head",children:["circuit ",s.jsx(le,{n:l.id})," ",s.jsx("code",{children:R(i.consumer)??"?"})," · top"," ",s.jsx(le,{n:Ie(i.k)??0})," depth ",s.jsx(le,{n:Ie(i.depth)??0})," ·"," ",s.jsx(le,{n:Ie(i.count)??0})," nodes · built at ",s.jsx("code",{children:R(i.where)??"?"}),s.jsxs("div",{children:["closure ",s.jsx(te,{value:ue(u,"value"),what:"closure"})," ",s.jsx("span",{className:"faint",children:"within"})," ",s.jsx(te,{value:ue(u,"bound"),what:"bound"}),ue(u,"within")===!0?" within":ue(u,"within")===!1?" OUTSIDE":"",R(ue(u,"meaning"))&&s.jsxs("span",{className:"faint",children:[" (",R(ue(u,"meaning")),")"]})]}),i.remainders_within!==void 0&&s.jsxs("div",{className:"faint",children:["remainders"," ",i.remainders_within===!0?"all within their rounding bounds":i.remainders_within===!1?"NOT all within their rounding bounds":i.unexamined===!0?"not all checked: the subtrees under the +N more groups were never expanded":"within: not stated (a bound was refused)",i.unexamined===!0&&i.unexamined_count!==void 0&&s.jsxs(s.Fragment,{children:[" ","(",s.jsx(te,{value:i.unexamined_count,what:"unexamined_count",compact:!0})," unexamined)"]})]}),ie(i.edits)&&s.jsxs("div",{className:"faint",children:["edit nodes: ",s.jsx(le,{n:Ie(i.edits.count)??0}),R(i.edits.meaning)?` (${R(i.edits.meaning)})`:""]})]})}function jv(l,i,u){if(!l||!i||!u)return new Set;const r=/^t(\d+)\.L(\d+)\.h(\d+)$/.exec(i.reader);if(!r)return new Set;const[,d,h,f]=r,v=new Set;for(const y of u.placed){const p=y.node.address;p===`t${d}.L${h}.A[h${f}]`&&y.node.kind==="head"&&v.add(y.node.id);const x=Bp(p);x!==null&&i.rows.includes(x)&&p.startsWith(`t${d}.L${h}.p[h${f},`)&&v.add(y.node.id)}return v}function tj({focus:l,entry:i}){const u=L.useMemo(()=>i?Fp(i.body,[i.body]):null,[i]),r=jv(i,l,u);return s.jsxs("div",{className:"circuit-focus","data-testid":"circuit-focus",children:["read ",s.jsx("code",{children:l.reader})," of ",s.jsx("code",{children:l.binding})," (rows"," ",l.rows.map(d=>`t${d}`).join(", "),"):"," ",i?r.size?s.jsxs("span",{children:["highlighted in circuit ",i.id," (",r.size," node",r.size===1?"":"s",")."]}):s.jsxs("span",{className:"faint",children:["not among circuit ",i.id,"'s listed nodes (it may sit in a +N more group or a paged group not expanded, or need depth 3 or a larger K)."]}):s.jsx("span",{className:"faint",children:"no circuit shown; build one for the consumer to place this read."})]})}const nj={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"};function Sv({entry:l,circuits:i,node:u,focus:r,busy:d,act:h,readOnly:f=!1,source:v}){const y=R(l.body.consumer),p=Wb(v??{kind:"live",id:l.id}),x=L.useMemo(()=>Vb(l.body,p.pages),[l.body,p.pages]),g=L.useMemo(()=>xg([...i.values()],y).map(Z=>Z.id===l.id?x:Z.body),[i,y,l.id,x]),j=L.useMemo(()=>Fp(x,g),[x,g]),M=L.useMemo(()=>aj(l),[l]),k=jv(l,r,j),G=L.useRef(null),[q,X]=L.useState(null),[ce,z]=L.useState("fit");L.useEffect(()=>{const Z=G.current;if(!Z||typeof ResizeObserver>"u")return;const O=new ResizeObserver(()=>X(Z.clientWidth));return O.observe(Z),X(Z.clientWidth),()=>O.disconnect()},[]);const T=yg(ce,j.width,q),K=Math.ceil(j.width*T),V=Math.ceil(j.height*T),W=q!==null&&K>q+1,Y=j.placed.find(Z=>Z.node.id===u)??null;L.useEffect(()=>{const Z=G.current;if(!Y||!Z||typeof Z.scrollTo!="function")return;const O=(Y.x-$e-8)*T,Q=(Y.x+jl+ba+8)*T,P=(Y.y-pa)*T,xe=(Y.y+pa)*T;let fe=Z.scrollLeft,N=Z.scrollTop;O<fe?fe=O:Q>fe+Z.clientWidth&&(fe=Q-Z.clientWidth),P<N?N=P:xe>N+Z.clientHeight&&(N=xe-Z.clientHeight),(fe!==Z.scrollLeft||N!==Z.scrollTop)&&Z.scrollTo({left:Math.max(0,fe),top:Math.max(0,N)})},[Y,T]);const[oe,_e]=L.useState(0),we=L.useRef(null);L.useEffect(()=>{const Z=G.current;if(!Z||typeof Z.scrollTo!="function")return;Z.scrollTo(gg(j,T));const O=Z.querySelector('[data-kind="consumer"]'),Q=lj(Z.parentElement);if(O&&Q&&we.current&&typeof we.current.scrollIntoView=="function"){const P=O.getBoundingClientRect(),xe=Q.getBoundingClientRect(),fe=Math.max(xe.top,0),N=Math.min(xe.bottom,window.innerHeight);(P.top<fe||P.bottom>N)&&we.current.scrollIntoView({block:"start"})}},[l.id,oe]);const ae=Z=>{const O=nj[Z.key];if(O)Z.preventDefault(),O==="right"&&(Y!=null&&Y.node.paged)&&!Y.node.children.length&&v&&p.load(Y.node.id),h.node(vg(j,u,O));else if(Z.key==="Enter"&&Y&&!f){Z.preventDefault();const Q=qp(Y.node.address);Q&&!d&&h.seek(Q,`circuit ${l.id} node ${Y.node.name}`)}else Z.key==="Escape"&&h.node(null)},Ye=Z=>{z(Z),(Z==="fit"||!Y)&&_e(O=>O+1)},I=Z=>Ye(Math.round(Math.max(.4,Math.min(2,T+Z))*10)/10);return s.jsxs("div",{className:"circuit-graph-wrap",children:[s.jsxs("div",{ref:we,className:"circuit-zoom",role:"group","aria-label":"graph zoom",children:[s.jsx("button",{type:"button","aria-pressed":ce==="fit",onClick:()=>Ye("fit"),children:"fit"}),s.jsx("button",{type:"button",onClick:()=>I(-.1),"aria-label":"zoom out",children:"−"}),s.jsx("button",{type:"button",onClick:()=>I(.1),"aria-label":"zoom in",children:"+"}),s.jsx("button",{type:"button","aria-pressed":ce===1,onClick:()=>Ye(1),children:"100%"}),s.jsxs("span",{className:"faint","data-testid":"graph-scale",children:[Math.round(T*100),"%",ce==="fit"&&T<=Jp&&W?" (smallest readable scale; the graph is wider than the pane)":""]}),W&&s.jsx("span",{className:"scroll-cue","data-testid":"graph-scroll-cue",children:"scroll sideways for more columns →"})]}),s.jsx("div",{ref:G,className:W?"circuit-graph circuit-graph-overflow":"circuit-graph",tabIndex:0,"data-own-keys":"",role:"tree","aria-label":`circuit ${l.id} for ${y??"?"}: arrows walk${f?"":", Enter asks to seek"}`,"aria-activedescendant":Y?`cnode-${l.id}-${Y.node.id}`:void 0,onKeyDown:ae,onFocus:()=>{!u&&j.placed[0]&&h.node(j.placed[0].node.id)},"data-testid":"circuit-graph",children:s.jsxs("svg",{width:K,height:V,viewBox:`0 0 ${j.width} ${j.height}`,role:"presentation",style:{display:"block"},children:[j.edges.map(Z=>s.jsx(sj,{e:Z},`${Z.from.node.id}-${Z.to.node.id}`)),j.placed.map(Z=>s.jsx(ij,{id:`cnode-${l.id}-${Z.node.id}`,p:Z,selected:Z.node.id===u,read:k.has(Z.node.id),ablated:M.get(Z.node.id)??null,paged:Z.node.paged!==null&&Z.node.children.length===0,onSelect:()=>h.node(Z.node.id)},Z.node.id))]})}),s.jsx(uj,{readOnly:f}),Y&&s.jsx(cj,{p:Y,entry:l,busy:d,act:h,readOnly:f,paging:v?p:null})]})}function lj(l){for(let i=l;i;i=i.parentElement){const u=getComputedStyle(i).overflowY;if((u==="auto"||u==="scroll")&&i.scrollHeight>i.clientHeight)return i}return document.scrollingElement??null}function aj(l){const i=new Map;for(const u of["retained","complement"])for(const r of wl(ue(l.ablated,u)))i.set(r,u);for(const u of wl(ue(l.test,"excluded","nodes")))i.set(u,"excluded");return i}function sj({e:l}){const i=l.from.x+jl+ba,u=l.to.x-$e,r=(i+u)/2,d=`M${i},${l.from.y} C${r},${l.from.y} ${r},${l.to.y} ${u},${l.to.y}`,h=l.sign==="pos"?"var(--sign-pos)":l.sign==="neg"?"var(--sign-neg)":"var(--ink-3)";return s.jsx("path",{d,fill:"none",stroke:h,strokeWidth:l.width??1,strokeDasharray:l.width===null?"1 4":l.sign==="neg"?"6 3":void 0,opacity:.8,"data-sign":l.sign,children:s.jsx("title",{children:`${l.to.node.name} → ${l.from.node.name}: ${l.width===null?"no value":l.sign==="none"?"size (a norm: no sign)":l.sign==="neg"?"negative contribution":"positive contribution"}`})})}function ij({id:l,p:i,selected:u,read:r,ablated:d,paged:h,onSelect:f}){const{node:v,x:y,y:p}=i,x=ga(v.value),g=x.kind==="num"?x.n.ev:x.kind==="summary"?x.parts[0][1].ev:x.n.ev,j=v.kind==="more"||v.kind==="remainder",M=j?"hollow":fu(g),q={stroke:"var(--ink)",strokeWidth:u?3:1.4,strokeDasharray:j?"3 2":M==="dashed-empty"?"2 2":void 0,fill:M==="solid"?"var(--ink-2)":"var(--panel)"};return s.jsxs("g",{id:l,role:"treeitem","aria-selected":u,"aria-label":`${v.name} (${v.kind}) ${v.address}`,"data-node":v.id,"data-kind":v.kind,"data-slot":`${i.col},${i.slot}`,onClick:f,style:{cursor:"pointer"},children:[s.jsx("title",{children:`${v.name} · ${v.kind} · ${v.address}${v.note?`
55
+ ${v.note}`:""}${h?`
56
+ children examined, stored as a page: walk right or expand to fetch it`:""}`}),(r||d)&&s.jsx("rect",{x:y-$e-4,y:p-$e-4,width:2*$e+8,height:2*$e+8,fill:"none",stroke:r?"var(--role-symbol)":"var(--role-intervention)",strokeWidth:2,strokeDasharray:d==="complement"&&!r?"2 2":void 0}),v.children.length>0&&s.jsx("line",{x1:y+$e,x2:y+jl+ba,y1:p,y2:p,stroke:"var(--ink-3)",strokeWidth:1,opacity:.45}),v.kind==="consumer"?s.jsx("rect",{x:y-$e,y:p-$e,width:2*$e,height:2*$e,...q}):v.kind==="more"?s.jsx("rect",{x:y-$e-2,y:p-$e+1,width:2*$e+4,height:2*$e-2,rx:4,...q}):v.kind==="remainder"?s.jsx("path",{d:`M${y},${p-$e} L${y+$e},${p} L${y},${p+$e} L${y-$e},${p}Z`,...q}):s.jsx("circle",{cx:y,cy:p,r:$e,...q}),h&&s.jsx("text",{x:y-4,y:p+$e+9,fontSize:9,fill:"var(--ink-2)","data-testid":"paged-mark",children:"▸"}),s.jsx("text",{x:y+jl,y:p-3,fontSize:10,fill:"var(--ink)",stroke:"var(--panel)",strokeWidth:3,paintOrder:"stroke",children:i.label}),s.jsx("foreignObject",{x:y+jl-2,y:p,width:ba,height:14,children:s.jsxs("span",{className:"cnode-value",children:[s.jsx(te,{value:v.value,what:"value",compact:!0,showReason:!1}),d==="retained"?" ✕R":d==="complement"?" ✕C":d?" excl.":""]})})]})}function uj({readOnly:l=!1}){return s.jsxs("div",{className:"faint circuit-legend","data-testid":"circuit-legend",children:[s.jsxs("span",{children:[s.jsx("svg",{width:28,height:8,"aria-hidden":"true",children:s.jsx("line",{x1:0,x2:28,y1:4,y2:4,stroke:"var(--sign-pos)",strokeWidth:3})})," ","positive"]})," ",s.jsxs("span",{children:[s.jsx("svg",{width:28,height:8,"aria-hidden":"true",children:s.jsx("line",{x1:0,x2:28,y1:4,y2:4,stroke:"var(--sign-neg)",strokeWidth:3,strokeDasharray:"6 3"})})," ","negative (dashed)"]})," ","· width ∝ |exact contribution| · ",s.jsx(Gt,{ev:"measured"})," measured"," ",s.jsx(Gt,{ev:"derived-exact"})," derived · rounded box: +N more (their Σ) · diamond: remainder (measured, with its bound; never dropped) · ▸ paged: children examined, stored as a page (fetched on expand; not +N more, which is a sum never expanded) · square: consumer",l?" · arrows walk (recorded: no seek, no test)":" · after a test: ✕R patched from the reference in the knock-out (circuit), ✕C in the keep-only (complement) · arrows walk, Enter asks to seek"]})}function cj({p:l,entry:i,busy:u,act:r,readOnly:d=!1,paging:h}){const f=d?null:qp(l.node.address),v=l.node.children.length===0?Zb(l.node.paged):null,y=h==null?void 0:h.status.get(l.node.id);return s.jsxs("div",{className:"circuit-node-line","data-testid":"circuit-node-line",children:[s.jsx("strong",{children:l.node.name})," ",s.jsx("span",{className:"faint",children:l.node.kind})," ",s.jsx("code",{children:l.node.address})," ",s.jsx(te,{value:l.node.value,what:"value"}),l.node.raw.neuronpedia!==void 0&&s.jsx(go,{value:l.node.raw.neuronpedia}),l.node.raw.bound!==void 0&&s.jsxs(s.Fragment,{children:[" ",s.jsx("span",{className:"faint",children:"bound"})," ",s.jsx(te,{value:l.node.raw.bound,what:"bound"}),l.node.raw.within===!0?" within":l.node.raw.within===!1?" OUTSIDE":""]}),l.node.note&&s.jsxs("span",{className:"faint",children:[" · ",l.node.note]})," ",v&&s.jsxs("span",{"data-testid":"paged-node",children:[s.jsx("span",{className:"chip",children:"paged"})," ",s.jsxs("span",{className:"faint",children:[v.children," children examined (",v.descendants," nodes below), stored as a page, not listed here"]})," ",h&&s.jsx("button",{type:"button",disabled:(y==null?void 0:y.state)==="loading",onClick:()=>void h.load(l.node.id),children:(y==null?void 0:y.state)==="loading"?"fetching…":"expand"})," ",(y==null?void 0:y.state)==="failed"&&s.jsxs("span",{className:"na","data-testid":"paged-failed",children:["page refused: ",y.reason]})]})," ",f?s.jsxs("button",{type:"button",disabled:u,onClick:()=>r.seek(f,`circuit ${i.id} node ${l.node.name}`),children:["seek ",f,"…"]}):d?s.jsx("span",{className:"faint",children:"(recorded: no session to seek)"}):s.jsx("span",{className:"faint",children:"(no occurrence to seek)"})," ",!d&&s.jsx("span",{className:"faint",children:"full record in the Inspector"})]})}const rj=["base","ref","ko","keep","full"],oj=[["faithfulness","faithfulness"],["knockout_share","knock-out share"]],dj=["total","circuit","complement","from_groups","unexamined"],fj=new Set(["schema","id","circuit","consumer","where","reference","components","nodes","margins","meaning","resolution","ratios","reading","full_equals_ref","full_meaning","cost","session","record"]),Ep="circuit test patches the circuit from a reference run (zero-ablation is not offered, issue M4): pick another run of this debugger, or type set:NAME for a prompt set mean";function hj({entry:l,testSlot:i,act:u,busy:r,runs:d=[]}){const h=i.state==="running",f=l.test,[v,y]=L.useState(d[0]??"");L.useEffect(()=>{!v&&d.length&&y(d[0]??"")},[v,d]);const p=new Set(d);return s.jsxs("section",{className:"circuit-test","aria-label":"circuit test",children:[s.jsxs("div",{children:[s.jsxs("label",{children:["reference"," ",s.jsxs("select",{value:p.has(v)?v:"",onChange:x=>y(x.target.value),"data-testid":"test-ref-picker","aria-label":"reference run",children:[s.jsx("option",{value:"",children:d.length?"(pick a run)":"(no other run)"}),d.map(x=>s.jsx("option",{value:x,children:x},x))]})]})," ",s.jsx("input",{type:"text",value:v,placeholder:"run name or set:NAME",onChange:x=>y(x.target.value.trim()),"aria-label":"reference (run name or set:NAME)",size:14})," ",s.jsxs("button",{type:"button",disabled:r||!v,onClick:()=>u.test(l.id,v),title:v?`circuit test ${l.id} ref=${v}`:Ep,children:["circuit test ",l.id]})," ",!v&&s.jsx("span",{className:"faint","data-testid":"test-needs-ref",children:Ep})]}),(i.state!=="idle"||h)&&s.jsx(_l,{slot:i,what:"test",onInterrupt:u.interrupt,idle:""}),f?s.jsx(mj,{test:f}):s.jsx("div",{className:"faint",children:"not tested in this page"})]})}function mj({test:l}){const i=Object.entries(l).filter(([p,x])=>!fj.has(p)&&(typeof x=="string"||ie(x))),u=ie(l.reference)?l.reference:{},r=ie(l.components)?l.components:{},d=ie(l.margins)?l.margins:{},h=ie(l.meaning)?l.meaning:{},f=ie(l.ratios)?l.ratios:{},v=ie(l.reading)?l.reading:{},y=p=>Ie(ue(r,p,"value"));return s.jsxs("div",{className:"test-result","data-testid":"test-result",children:[s.jsxs("div",{"data-testid":"test-reference",children:["reference ",s.jsx("code",{children:R(u.name)??"?"})," ",s.jsx("span",{className:"faint",children:R(u.kind)==="set-mean"?`(per-component mean over ${Ie(ue(u,"items","value"))??"?"} items at their @last)`:`(run, row t${Ie(ue(u,"row","value"))??"?"})`})]}),s.jsxs("div",{"data-testid":"test-components",children:["components"," ",dj.map(p=>s.jsxs("span",{"data-count":p,children:[p.replace("_"," ")," ",y(p)!==null?s.jsx(le,{n:y(p)}):"?"," "]},p)),s.jsx("span",{className:"faint",children:"[derived-exact]"}),R(r.definition)&&s.jsx("div",{className:"faint",children:R(r.definition)}),R(r.rows)&&s.jsx("div",{className:"faint",children:R(r.rows)})]}),s.jsx("div",{className:"table-scroll",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"margin"}),s.jsx("th",{className:"n",children:"value"}),s.jsx("th",{children:"what was patched"})]})}),s.jsx("tbody",{children:rj.map(p=>s.jsxs("tr",{"data-margin":p,children:[s.jsx("td",{children:p}),s.jsx("td",{className:"n",children:s.jsx(te,{value:d[p],what:p})}),s.jsxs("td",{className:"faint",children:[R(h[p])??"",p==="full"&&typeof l.full_equals_ref=="boolean"?l.full_equals_ref?" (= ref bit for bit)":" (differs from ref)":""]})]},p))})]})}),R(f.state)?s.jsxs("div",{"data-testid":"test-ratios-refused",children:["ratios ",R(f.state),": ",R(f.reason)??""]}):oj.map(([p,x])=>s.jsxs("div",{"data-ratio":p,children:[x," ",s.jsx("code",{children:R(ue(f,"formulas",p))??""})," ="," ",s.jsx(te,{value:f[p],what:p})," ",s.jsx("span",{className:"faint",children:R(ue(f,"meaning",p))??""})]},p)),s.jsxs("div",{"data-testid":"test-reading",children:["reading: knock-out ",R(v.knockout)??"?","; ",R(v.keep_vs_base)??"?",";"," ",R(v.keep_vs_ref)??"?"," ",s.jsxs("span",{className:"faint",children:["(one spacing ",s.jsx(te,{value:ue(l,"resolution","spacing"),what:"spacing"})," ",R(ue(l,"resolution","dtype"))??"","; ",R(v.rule)??"",")"]})]}),i.map(([p,x])=>s.jsxs("div",{className:"faint","data-field":p,children:[p,": ",typeof x=="string"?x:s.jsx(te,{value:x,what:p})]},p))]})}function pj(l){if(!l)return null;const i=[];for(const u of l.trim().split(/\s+/)){const r=/^t(\d+):(.*)$/.exec(u);if(!r)return null;i.push({row:Number(r[1]),marks:[...r[2]??""]})}return i}const vj={"#":"some head reads it with mass above min_mass",".":"computed, every read below min_mass","?":"not computed yet"};function xj(l){if(!ie(l))return null;const i=l.legend;if(ie(i)){const u={};for(const[r,d]of Object.entries(i))typeof d=="string"&&(u[r]=d);return Object.keys(u).length?u:null}if(Array.isArray(i)){const u={};for(const r of i){if(!ie(r))continue;const d=R(r.mark)??R(r.char),h=R(r.meaning);d&&h&&(u[d]=h)}return Object.keys(u).length?u:null}return null}function du(l,i){const u=(i[l]??"").toLowerCase();return l==="#"?"life-read":l==="?"||u.includes("not computed")?"life-pending":l==="."?"life-below":u.includes("not part")||u.includes("not in")?"life-none":u.includes("below")?"life-below":"life-other"}function yj({components:l}){const i=Ft(l);return i.length?s.jsxs("section",{"aria-label":"feature component graphs","data-testid":"feature-graphs",children:[s.jsx("h3",{children:"Feature components"}),s.jsx("p",{className:"faint",children:"Components → carrier → consumer. Shares use fixed attention and readout; they are not finite intervention effects. Neuronpedia identities are supplied metadata."}),i.map((u,r)=>s.jsxs("div",{className:"feature-graph",role:"group","aria-label":`components of ${R(u.binding)??r}`,children:[s.jsxs("div",{className:"feature-graph-sources",children:[!Ft(u.components).length&&s.jsxs("span",{className:"faint",children:["Component rows unavailable in this view",u.components_full?" (stored in a separate payload)":"","."]}),Ft(u.components).map((d,h)=>{const f=Ie(d.feature),v=ie(d.saelens)?d.saelens:{};return s.jsxs("div",{className:"feature-graph-node",children:[s.jsx("strong",{children:R(d.component)??(f===null?"component":`feature ${f}`)}),f!==null&&s.jsxs(s.Fragment,{children:[" ",s.jsx(go,{value:d.neuronpedia}),s.jsxs("div",{className:"faint",children:[R(v.release)," ",R(v.sae_id)," · feature ",s.jsx(le,{n:f})]}),s.jsxs("div",{children:["activation ",s.jsx(te,{value:d.activation,what:"activation"})]})]}),s.jsxs("div",{children:["to consumer ",s.jsx(te,{value:d.to_consumer,what:"component share"})]})]},h)})]}),s.jsx("span",{"aria-label":"components feed carrier",children:"→"}),s.jsxs("div",{className:"feature-graph-node",children:[s.jsx("strong",{children:R(u.binding)??"carrier"}),s.jsx("div",{children:s.jsx("code",{children:R(u.cell)})}),s.jsxs("div",{children:["rounding ",s.jsx(te,{value:u.rounding_to_consumer,what:"rounding"})]})]}),s.jsx("span",{"aria-label":"carrier feeds consumer",children:"→"}),s.jsxs("div",{className:"feature-graph-node",children:[s.jsx("code",{children:R(u.consumer)??"consumer"}),s.jsxs("div",{children:["share ",s.jsx(te,{value:u.cell_to_consumer,what:"carrier share"})]})]})]},r))]}):null}const gj=new Set(["symbol","kind","rows","definitions","lifetime","mass","readers","status","token","text","to_consumer","edited_by","omitted","count","mean_mass"]);function bj(l){const{slot:i,act:u}=l,r=i.state==="done"?i.result:null;return s.jsxs("div",{className:"live-symbols","data-testid":"live-symbols",children:[s.jsx(Sj,{args:l.args,busy:l.busy,act:u}),s.jsx(_l,{slot:i,what:"symbols",onInterrupt:u.interrupt,idle:"No symbol table yet: choose a consumer (or none) and press show."}),r&&s.jsx(Nv,{result:r,...l}),s.jsx(Uj,{busy:l.busy,declared:l.declared,act:u})]})}function jj(l,i,u,r){return l==="margin"?i.trim()&&u.trim()?`M[${i.trim()},${u.trim()}]`:null:l==="logit"?i.trim()?`logits[${i.trim()}]`:null:l==="port"&&r.trim()||null}function Sj({args:l,busy:i,act:u}){const[r,d]=L.useState("none"),[h,f]=L.useState(""),[v,y]=L.useState(""),[p,x]=L.useState(""),g=jj(r,h,v,p),j=r==="none"||g!==null;return s.jsxs("form",{className:"symbols-consumer","aria-label":"symbols consumer",onSubmit:M=>{M.preventDefault(),j&&u.run(g?{consumer:g}:{})},children:[s.jsxs("label",{children:["consumer"," ",s.jsxs("select",{"aria-label":"consumer kind",value:r,onChange:M=>d(M.target.value),children:[s.jsx("option",{value:"none",children:"none (per-layer o)"}),s.jsx("option",{value:"margin",children:"margin M[a,b]"}),s.jsx("option",{value:"logit",children:"logit"}),s.jsx("option",{value:"port",children:"a port"})]})]}),(r==="margin"||r==="logit")&&s.jsx("input",{className:"mono","aria-label":r==="margin"?"margin token a":"logit index",placeholder:r==="margin"?"a (id)":"i",value:h,onChange:M=>f(M.target.value),size:6}),r==="margin"&&s.jsx("input",{className:"mono","aria-label":"margin token b",placeholder:"b (id)",value:v,onChange:M=>y(M.target.value),size:6}),r==="port"&&s.jsx("input",{className:"mono","aria-label":"consumer port",placeholder:"L1.h_out",value:p,onChange:M=>x(M.target.value),size:12}),s.jsx("button",{type:"submit",disabled:i||!j,children:"show symbols"}),typeof l.consumer=="string"&&s.jsxs("span",{className:"faint",children:["last asked: ",s.jsxs("code",{children:["consumer=",l.consumer]})]})]})}function Nj(l,i,u){const r=new Map;if(l.state!=="done")return r;const d=l.result;if(Ie(ue(d,"source","row"))!==i||u!==null&&R(d.consumer)!==u)return r;for(const h of Ft(d.reads)){const f=R(h.name);f&&ie(h.causal)&&r.set(f,h.causal)}return r}const wj={run:()=>{},declare:()=>{},measure:()=>{},openRead:()=>{},seek:()=>{},interrupt:()=>{}};function Mj({result:l}){return s.jsx(Nv,{result:l,slot:{state:"idle"},reads:{state:"idle"},args:{},where:null,busy:!1,declared:[],act:wj,readOnly:!0})}function Nv({result:l,reads:i,where:u,busy:r,act:d,args:h,readOnly:f=!1}){const v=Ft(l.bindings),y=R(l.consumer),p=qy(R(l.where)??u??""),x=u!==null&&R(l.where)!==null&&R(l.where)!==u,g=ie(l.page)?l.page:{},j=Ie(g.offset)??0,M=Ie(g.limit)??v.length,k=Ie(g.total),G=v.map(z=>xj(z.lifetime)).find(Boolean)??null,q=G??vj,[X,ce]=L.useState(new Map);return s.jsxs("div",{className:"symbols-result",children:[s.jsxs("div",{className:"symbols-head",children:["symbols at ",s.jsx("code",{children:R(l.where)??"?"})," · consumer"," ",s.jsx("code",{children:y??"none"}),l.consumer_total!==void 0&&s.jsxs(s.Fragment,{children:[" ","= ",s.jsx(te,{value:l.consumer_total,what:"consumer_total"})]})," ","· min_mass ",s.jsx(te,{value:l.min_mass,what:"min_mass"}),x&&s.jsxs("span",{className:"chip","data-testid":"symbols-stale",title:"the cursor moved since",children:["cursor moved to ",u,":"," ",s.jsx("button",{type:"button",className:"linklike",disabled:r,onClick:()=>d.run(h),children:"refresh"})]})]}),s.jsx("div",{className:"table-scroll",children:s.jsxs("table",{className:"symbols-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"symbol"}),s.jsx("th",{children:"status"}),s.jsx("th",{title:"reader rows x layers; the cursor's cell is outlined",children:"lifetime"}),s.jsx("th",{className:"n",title:"attention weight its rows receive, summed over heads and layers: a sum of weights, not a probability",children:"mass (Σ heads, layers)"}),s.jsx("th",{className:"n",children:"reads"}),s.jsx("th",{className:"n",children:"mean per read"}),s.jsx("th",{className:"n",children:"to consumer"})]})}),s.jsxs("tbody",{children:[v.map((z,T)=>{const K=R(z.symbol)??`#${T}`,V=wv(z),W=i.state==="done"?Ie(ue(i.result,"source","row")):null,Y=T===0||p!==null&&V.includes(p[0])||W!==null&&V.length===1&&V[0]===W,oe=X.get(K)??Y;return s.jsx(Aj,{b:z,open:oe,onToggle:()=>ce(new Map(X).set(K,!oe)),here:p,legend:q,reads:i,consumer:y,busy:r,act:d,readOnly:f},K)}),s.jsx(Oj,{unbound:l.unbound})]})]})}),s.jsx(Cj,{legend:q,fromOp:G!==null}),s.jsx(Dj,{accounting:l.accounting}),s.jsx(Rj,{named:l.named}),s.jsx(yj,{components:l.components}),k!==null&&f&&s.jsxs("div",{className:"symbols-page",children:["bindings ",s.jsx(le,{n:k===0?0:j+1}),"–",s.jsx(le,{n:j+v.length})," ","of ",s.jsx(le,{n:k})," ",s.jsx("span",{className:"faint",children:"(as recorded: one page)"})]}),k!==null&&!f&&s.jsxs("div",{className:"symbols-page",children:["bindings ",s.jsx(le,{n:k===0?0:j+1}),"–",s.jsx(le,{n:j+v.length})," ","of ",s.jsx(le,{n:k})," ",s.jsx("button",{type:"button",disabled:r||j<=0,onClick:()=>d.run({...h,offset:Math.max(0,j-M)}),children:"‹ previous"})," ",s.jsx("button",{type:"button",disabled:r||j+v.length>=k,onClick:()=>d.run({...h,offset:j+M}),children:"next ›"})]}),s.jsx(Ej,{reads:i,act:d})]})}function Ej({reads:l,act:i}){return l.state==="idle"||l.state==="done"&&l.partial===null?null:s.jsxs("div",{className:"symbols-reads",children:["verdicts: ",s.jsx(_l,{slot:l,what:"reads",onInterrupt:i.interrupt,idle:""})]})}function _j(l){const i=l.replace(/\s*\(.*\)$/,"").trim(),u=/^cache\.L(\d+)\.([kv])\[.*row=(\d+).*\]$/.exec(i);if(u)return`t${u[3]}.L${u[1]}.${u[2]}`;const r=/^t(\d+)$/.exec(i);if(r)return`t${r[1]}.L0.k`;const d=/^t(\d+)\.L(\*|\d+)\.([A-Za-z_]+)/.exec(i);return d?`t${d[1]}.L${d[2]==="*"?"0":d[2]}.${d[3]}`:null}function wv(l){return Array.isArray(l.rows)?l.rows.filter(i=>typeof i=="number"):[]}function eu(l,i=32){if(l.length<=i)return l;const u=i-1;return`${l.slice(0,Math.ceil(u/2))}…${l.slice(l.length-Math.floor(u/2))}`}function Aj({b:l,open:i,onToggle:u,here:r,legend:d,reads:h,consumer:f,busy:v,act:y,readOnly:p}){const x=R(l.symbol)??"?",g=wv(l),j=g.length===1?Nj(h,g[0]??-1,f):new Map,M=Ie(l.token),k=R(l.status)??"unknown",G=Ft(l.readers),q=Ie(l.omitted),X=Object.entries(l).filter(([z])=>!gj.has(z)),ce=`symbol-sub-${x.replace(/[^A-Za-z0-9_-]/g,"_")}`;return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"symbol-row","data-symbol":x,"data-status":k,"data-open":i?"yes":"no",children:[s.jsxs("td",{className:"symbol-name",children:[s.jsx("button",{type:"button",className:"disclosure","aria-expanded":i,"aria-controls":ce,title:i?"hide sites and readers":"show sites and readers",onClick:u,children:i?"▾":"▸"})," ",s.jsx("strong",{className:"mono",children:x}),M!==null&&s.jsxs("span",{className:"faint",children:[" ","id ",s.jsx(le,{n:M})]}),R(l.text)!==null&&s.jsxs("span",{className:"mono",children:[" “",R(l.text),"”"]})," ",s.jsx("span",{className:"faint",children:R(l.kind)??""})]}),s.jsxs("td",{children:[s.jsx("span",{className:`chip status-chip status-${k}`,"data-testid":"status-chip",children:k}),Array.isArray(l.edited_by)&&s.jsxs("span",{className:"faint",title:JSON.stringify(l.edited_by).slice(0,400),children:[" ","by ",s.jsx(le,{n:l.edited_by.length})," edit",l.edited_by.length===1?"":"s"]})]}),s.jsx("td",{children:s.jsx(zj,{lifetime:l.lifetime,here:r,legend:d})}),s.jsx("td",{className:"n","data-label":"mass",children:s.jsx(te,{value:l.mass,what:"mass"})}),s.jsx("td",{className:"n","data-label":"reads",children:Ie(l.count)!==null?s.jsx(le,{n:Ie(l.count)}):s.jsx("span",{className:"faint",children:"—"})}),s.jsx("td",{className:"n","data-label":"mean per read",children:l.mean_mass!==void 0?s.jsx(te,{value:l.mean_mass,what:"mean_mass"}):s.jsx("span",{className:"faint",children:"—"})}),s.jsx("td",{className:"n","data-label":"to consumer",children:s.jsx(te,{value:l.to_consumer,what:"to_consumer"})})]}),i&&s.jsx("tr",{className:"symbol-sub",id:ce,"data-sub":x,children:s.jsxs("td",{colSpan:7,children:[s.jsxs("div",{className:"sub-line",children:[s.jsx("span",{className:"faint",children:"defined at"})," ",wl(l.definitions).map(z=>{const T=p?null:_j(z);return T?s.jsx("button",{type:"button",className:"linklike mono site",title:`${z}: seek ${T} (asks first: it moves the session)`,onClick:()=>y.seek(T,`definition ${z} of ${x}`),children:eu(z)},z):s.jsx("span",{className:"mono site",title:z,children:eu(z)},z)}),X.map(([z,T])=>s.jsxs("span",{className:"faint","data-field":z,children:[" ","· ",z," ",typeof T=="number"&&Number.isInteger(T)?s.jsx(le,{n:T}):s.jsx(te,{value:T,what:z})]},z))]}),s.jsxs("div",{className:"reader-lines",role:"table","aria-label":`readers of ${x}`,children:[s.jsxs("div",{className:"reader-line reader-head faint",role:"row",children:[s.jsx("span",{role:"columnheader",children:"reader"}),s.jsx("span",{role:"columnheader",className:"n",children:"mass"}),s.jsx("span",{role:"columnheader",className:"n",children:"exact effect"}),s.jsx("span",{role:"columnheader",children:"causal verdict"})]}),G.map((z,T)=>{const K=R(z.name)??"?",V=j.get(K);return s.jsxs("div",{className:"reader-line",role:"row","data-reader":K,children:[s.jsx("span",{role:"cell",children:p?s.jsx("span",{className:"mono",title:K,children:eu(K,24)}):s.jsx("button",{type:"button",className:"linklike mono",title:`${K}: open this read in the Circuits view`,onClick:()=>y.openRead({reader:K,binding:x,rows:g}),children:eu(K,24)})}),s.jsx("span",{role:"cell",className:"n",children:s.jsx(te,{value:z.mass,what:"mass"})}),s.jsx("span",{role:"cell",className:"n",children:s.jsx(te,{value:z.effect,what:"effect"})}),s.jsx("span",{role:"cell",children:V?s.jsx(Tj,{causal:V}):s.jsx("span",{className:"faint",title:p?"a native verdict needs the live model":"press measure verdicts for a native verdict",children:"not measured"})})]},`${K}-${T}`)}),q!==null&&q>0&&s.jsx("div",{className:"reader-line faint",role:"row",children:s.jsxs("span",{role:"cell",children:["+",s.jsx(le,{n:q})," more reads"]})})]}),p?s.jsxs("span",{className:"faint",children:["recorded: causal verdicts need the live model (",s.jsxs("code",{children:["reads t",g[0]??"?"]}),")"]}):g.length===1?s.jsx("button",{type:"button",disabled:v,title:"reads tN: measures each listed read natively (moves the session and restores it)",onClick:()=>y.measure(`t${g[0]}`,f),children:"measure verdicts"}):s.jsx("span",{className:"faint",children:"verdicts are measured per source row"})]})})]})}function Tj({causal:l}){const i=R(l.verdict)??"no verdict",u=R(l.reason);return s.jsxs("span",{className:"verdict","data-verdict":i,children:[s.jsx("span",{className:"chip verdict-chip",title:u??void 0,children:i}),u&&s.jsxs("span",{className:"faint",children:[" ",u]})," ",s.jsx("span",{className:"faint",children:"Δ"})," ",s.jsx(te,{value:l.delta,what:"delta"})," ",s.jsx("span",{className:"faint",children:"pred"})," ",s.jsx(te,{value:l.predicted,what:"predicted"})," ",s.jsx("span",{className:"faint",children:"≤"})," ",s.jsx(te,{value:l.rounding_bound,what:"rounding_bound"})]})}function zj({lifetime:l,here:i,legend:u}){const r=pj(R(ue(l,"strip")));if(!r)return s.jsx(te,{value:void 0,what:"lifetime strip"});const d=R(ue(l,"first")),h=R(ue(l,"last"));return s.jsx("div",{className:"lifetime",title:`${d??"—"} .. ${h??"—"}`,children:r.map(f=>s.jsxs("div",{className:"life-row",children:[s.jsxs("span",{className:"faint mono",children:["t",f.row]}),f.marks.map((v,y)=>{const p=i!==null&&i[0]===f.row&&i[1]===y;return s.jsx("span",{className:`life-cell ${du(v,u)}${p?" life-cursor":""}`,"data-mark":v,title:`t${f.row}.L${y}: ${u[v]??`mark ${v} (no legend)`}${p?" (cursor)":""}`,"aria-label":`t${f.row}.L${y} ${u[v]??v}`,children:du(v,u)==="life-other"?v:""},y)})]},f.row))})}function Cj({legend:l,fromOp:i}){return s.jsxs("div",{className:"life-legend faint","data-testid":"life-legend",children:["lifetime (",i?"legend from the op":"marks as the op documents them","):"," ",Object.entries(l).map(([u,r])=>s.jsxs("span",{className:"life-key",children:[s.jsx("span",{className:`life-cell ${du(u,l)}`,children:du(u,l)==="life-other"?u:""})," ",s.jsx("code",{children:u})," ",r]},u)),s.jsxs("span",{className:"life-key",children:[s.jsx("span",{className:"life-cell life-cursor"})," cursor"]})]})}function Oj({unbound:l}){if(!ie(l))return s.jsxs("tr",{className:"symbol-row unbound","data-symbol":"Unbound",children:[s.jsx("td",{children:s.jsx("strong",{children:"Unbound"})}),s.jsx("td",{colSpan:6,children:s.jsx(te,{value:void 0,what:"Unbound row"})})]});const i=ie(l.parts)?l.parts:{},u=Object.entries(i).filter(([d])=>d!=="meaning"),r=[R(l.meaning),R(i.meaning)].filter(Boolean).join(" ");return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"symbol-row unbound","data-symbol":"Unbound","data-status":"unbound",children:[s.jsxs("td",{className:"symbol-name",children:[s.jsx("strong",{children:"Unbound"})," ",s.jsx("span",{className:"faint",title:r||void 0,children:"what no listed binding carries"})]}),s.jsx("td",{}),s.jsx("td",{}),s.jsx("td",{className:"n","data-label":"mass",children:s.jsx(te,{value:l.mass,what:"mass"})}),s.jsx("td",{}),s.jsx("td",{}),s.jsx("td",{className:"n","data-label":"to consumer",children:s.jsx(te,{value:l.readout,what:"readout"})})]}),s.jsx("tr",{className:"symbol-sub unbound","data-sub":"Unbound",children:s.jsxs("td",{colSpan:7,children:[u.length?s.jsx("span",{className:"unbound-parts",children:u.map(([d,h])=>s.jsxs("span",{"data-part":d,className:"unbound-part",children:[s.jsx("span",{className:"faint",children:d.replace(/_/g," ")})," ",s.jsx(te,{value:h,what:d}),ie(h)&&h.bound!==void 0&&s.jsxs(s.Fragment,{children:[" ",s.jsx("span",{className:"faint",children:"≤"})," ",s.jsx(te,{value:h.bound,what:"bound"}),h.within===!0?" within":h.within===!1?" OUTSIDE":""]})]},d))}):s.jsx("span",{className:"faint",children:"no parts given"}),r&&s.jsxs("details",{className:"unbound-meaning faint",children:[s.jsx("summary",{children:"what the parts are"}),r]})]})})]})}function Dj({accounting:l}){return ie(l)?s.jsxs("div",{className:"faint symbols-accounting",children:["accounting: ",s.jsx(le,{n:Ie(l.heads)??0})," heads · listed mass"," ",s.jsx(te,{value:l.listed_mass,what:"listed_mass"})," · max |Σp − 1|"," ",s.jsx(te,{value:l.max_head_deviation,what:"max_head_deviation"})," ≤"," ",s.jsx(te,{value:l.deviation_bound,what:"deviation_bound"})," ",l.within_bound===!0?"within bound":l.within_bound===!1?"OUTSIDE bound":""]}):null}function Rj({named:l}){const i=Ft(l);return i.length===0?null:s.jsxs("div",{className:"symbols-named","data-testid":"symbols-named",children:["named (from transplants):",s.jsx("ul",{children:i.map((u,r)=>{const d=ie(u.here)?u.here:{},h=R(d.address);return s.jsxs("li",{"data-named":R(u.symbol)??"",children:[s.jsx("strong",{children:R(u.symbol)??"?"})," = ",s.jsx("code",{children:R(u.source)??"?"})," →"," ",s.jsx("code",{children:R(u.consumer)??"?"})," · Δ ",s.jsx(te,{value:u.delta,what:"delta"})," ",R(u.verdict)??""," · here"," ",h!==null?s.jsx("code",{children:h}):s.jsxs("span",{className:"faint",children:[R(d.state)??"refused",": ",R(d.reason)??""]})]},R(u.symbol)??r)})})]})}function Uj({busy:l,declared:i,act:u}){const[r,d]=L.useState(""),[h,f]=L.useState("");return s.jsxs("section",{className:"symbols-declare","aria-label":"declare a symbol",children:[s.jsxs("form",{onSubmit:v=>{v.preventDefault(),!(!r.trim()||!h.trim())&&(u.declare(r.trim(),h.trim()),d(""),f(""))},children:[s.jsx("span",{className:"muted",children:"symbol"}),s.jsx("input",{className:"mono","aria-label":"symbol name",placeholder:"NAME",value:r,onChange:v=>d(v.target.value),size:8}),"=",s.jsx("input",{className:"mono","aria-label":"symbol addresses",placeholder:"t1, cache.L1.v[row=2]",value:h,onChange:v=>f(v.target.value),size:22}),s.jsx("button",{type:"submit",disabled:l||!r.trim()||!h.trim(),children:"declare"})]}),i.length>0&&s.jsxs("div",{className:"faint",children:["declared on this run:"," ",i.map(v=>s.jsxs("span",{className:"chip",title:v.definitions.join(", "),children:[v.name," = ",v.definitions.join(", ")]},v.name))]})]})}const eo=320,gs=18;function kj({split:l}){const i=Ft(ie(l)?l.terms:void 0);if(!i.length)return s.jsx(te,{value:void 0,what:"error split"});const u=i.map(x=>({name:R(x.name)??"?",value:x.value,meaning:R(x.meaning),bound:x.bound,within:x.within_bound,note:R(x.bound_note),m:to(ga(x.value))})),r=u.every(x=>x.m===null||x.m.signed),d=u.reduce((x,g)=>x+(g.m&&g.m.v>0?g.m.v:0),0),h=u.reduce((x,g)=>x+(g.m&&g.m.v<0?-g.m.v:0),0),f=r?d+h:Math.max(0,...u.map(x=>x.m?Math.abs(x.m.v):0)),v=r&&f>0?h/f*eo:0;let y=v,p=v;return s.jsxs("div",{className:"split","data-testid":"split",children:[s.jsxs("div",{className:"faint",children:["error split",R(ue(l,"proof"))?` (${R(ue(l,"proof"))})`:"",":"," ",R(ue(l,"rule"))??"",!r&&" · a vector consumer: each term is a summary (norm drawn); they do not add"]}),s.jsxs("svg",{width:eo+2,height:r?gs+14:u.length*(gs+4),role:"img","aria-label":"error split bar",children:[u.map((x,g)=>{if(!x.m||f===0)return null;const j=Math.abs(x.m.v)/f*eo;let M,k=0;return r?x.m.v>=0?(M=y,y+=j):(p-=j,M=p):(M=0,k=g*(gs+4)),s.jsxs("g",{"data-term":x.name,children:[s.jsx("rect",{x:M+1,y:k,width:Math.max(j,1),height:gs,fill:g%2?"var(--panel-2)":"var(--panel)",stroke:"var(--ink-2)",strokeDasharray:x.m.v<0?"4 2":void 0,children:s.jsx("title",{children:`${x.name}${x.meaning?`: ${x.meaning}`:""}`})}),s.jsx("text",{x:M+4,y:k+13,fontSize:10,fill:"var(--ink)",children:j>x.name.length*6+6?x.name:j>10?String(g+1):""})]},x.name)}),r&&f>0&&s.jsx("line",{x1:v+1,x2:v+1,y1:0,y2:gs+4,stroke:"var(--ink)",children:s.jsx("title",{children:"origin (0)"})})]}),s.jsx("ol",{className:"split-terms",children:u.map(x=>s.jsxs("li",{"data-term":x.name,children:[s.jsx("strong",{children:x.name})," ",s.jsx(te,{value:x.value,what:x.name}),x.bound!==void 0&&s.jsxs(L.Fragment,{children:[" ",s.jsx("span",{className:"faint",children:"bound"})," ",s.jsx(te,{value:x.bound,what:"bound"}),x.within===!0?" within":x.within===!1?" OUTSIDE":""]}),x.bound===void 0&&x.note&&s.jsxs("span",{className:"faint",children:[" (",x.note,")"]}),x.meaning&&s.jsxs("span",{className:"faint",children:[" — ",x.meaning]})]},x.name))})]})}function _o({v:l,status:i}){const u=R(l==null?void 0:l.verdict)??i,r=R(l==null?void 0:l.reason);return s.jsxs(s.Fragment,{children:[s.jsx("span",{className:`chip verdict-chip${u==="not confirmed"?" verdict-not":""}`,"data-verdict":u,title:R(l==null?void 0:l.criterion)??r??void 0,children:u}),r&&s.jsxs("span",{className:"faint",children:[" ",r]})]})}function Mv({v:l}){if(l.residual_max_abs===void 0)return null;const i=R(l.verdict),u=l.within_bound===!0?"holds":l.within_bound===!1?"exceeded":null;return s.jsxs("span",{className:"residual-floor","data-testid":"residual-floor",children:[s.jsx(te,{value:l.residual_max_abs,what:"residual",compact:!0}),l.floor!==void 0&&s.jsxs(s.Fragment,{children:[" ",i==="confirmed"?"≤":i==="not confirmed"?">":"vs"," ",s.jsx("span",{className:"faint",children:"floor"})," ",s.jsx(te,{value:l.floor,what:"floor",compact:!0}),R(l.dtype)&&s.jsxs("span",{className:"faint",children:[" (",R(l.dtype),")"]})]}),l.bound_max!==void 0&&s.jsxs("span",{className:"faint",title:"the worst-case propagated bound: information, not the verdict",children:[" ","· bound ",s.jsx(te,{value:l.bound_max,what:"bound",compact:!0}),u?` ${u}`:""]}),l.bound_max===void 0&&R(l.bound_note)&&s.jsxs("span",{className:"faint","data-testid":"verify-bound-note",children:[" ","· ",R(l.bound_note)]})]})}function $j(l){return s.jsxs("div",{className:"predict","data-testid":"predict",children:[s.jsx(Hj,{...l}),s.jsx(Xj,{...l}),s.jsx(Zj,{...l})]})}function Hj({whatif:l,port:i,busy:u,act:r}){const[d,h]=L.useState(""),[f,v]=L.useState("add"),[y,p]=L.useState(""),[x,g]=L.useState(""),j=d.trim()||i||"",M=Number(y),G=y.trim()!==""&&Number.isFinite(M)&&!!j&&!!x.trim(),q=l.state==="done"?l.result:null;return s.jsxs("section",{className:"predict-panel","aria-label":"what if",children:[s.jsx("h3",{children:"What if"}),s.jsxs("form",{onSubmit:X=>{X.preventDefault(),G&&r.whatif(j,M,f,x.trim())},children:[s.jsx("input",{className:"mono","aria-label":"whatif target",placeholder:i??"L1.m",value:d,onChange:X=>h(X.target.value),size:10}),s.jsxs("select",{"aria-label":"whatif op",value:f,onChange:X=>v(X.target.value),children:[s.jsx("option",{value:"replace",children:"replace"}),s.jsx("option",{value:"add",children:"add"}),s.jsx("option",{value:"scale",children:"scale"})]}),s.jsx("input",{className:"mono","aria-label":"whatif value",inputMode:"decimal",placeholder:"value",value:y,onChange:X=>p(X.target.value),size:6}),s.jsx("span",{className:"muted",children:"→"}),s.jsx("input",{className:"mono","aria-label":"whatif consumer",placeholder:"M[4,9] | logits[7] | L1.h_out",value:x,onChange:X=>g(X.target.value),size:14}),s.jsx("button",{type:"submit",disabled:u||!G,children:"predict and measure"})]}),s.jsxs("div",{className:"faint",children:["Runs ",s.jsx("code",{children:"whatif"}),": seals the prediction, then measures natively and restores the session. It does not stage the edit."]}),s.jsx(_l,{slot:l,what:"whatif",onInterrupt:r.interrupt,idle:"No what-if yet."}),q&&s.jsx(Lj,{result:q,busy:u,act:r})]})}const qj=["replace","add","scale"];function Ev(l){const i=ie(l.edit)?l.edit:{},u=R(i.address);return u===null?null:vo(u,i.selection)}function Bj(l){const i=ie(l.edit)?l.edit:{},u=Ev(l),r=R(i.op),d=ue(i,"value","value");return u===null||typeof d!="number"||r===null||!qj.includes(r)?null:{target:u.replace(/^t\d+\./,""),value:d,op:r}}function Lj({result:l,busy:i,act:u}){const r=ie(l.edit)?l.edit:{},d=ie(l.prediction)?l.prediction:{},h=ie(l.measured)?l.measured:{},f=ie(l.session)?l.session:{},v=wl(h.moves),y=Ev(l),p=R(r.op),x=Bj(l),g=d.exact,j=d.emulated,M=ie(l.effect)?l.effect:{},k=wl(ue(d,"other_edits","applied"));return s.jsxs("div",{className:"whatif-result","data-testid":"whatif-result",children:[s.jsxs("div",{children:["edit ",s.jsx("code",{"data-testid":"whatif-edit-address",children:y??"?"})," ",p??"?"," ",s.jsx(te,{value:r.value,what:"edit value"})," → consumer"," ",s.jsx("code",{children:R(ue(l,"consumer","address"))??"?"})," ",s.jsxs("span",{className:"faint",children:["(mode ",R(l.mode)??"?",R(l.record)?`, record ${R(l.record).slice(0,16)}`:"",")"]})]}),s.jsx("table",{className:"whatif-table",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsx("th",{children:"sealed linear Δ"}),s.jsxs("td",{children:[s.jsx(te,{value:ue(d,"linear","value")??d.linear,what:"linear"}),R(ue(d,"linear","meaning"))&&s.jsx("div",{className:"faint",children:R(ue(d,"linear","meaning"))})]})]}),s.jsxs("tr",{children:[s.jsx("th",{children:"sealed exact Δ"}),s.jsxs("td",{children:[s.jsx(te,{value:ue(g,"value")??g,what:"exact"})," ",s.jsx(_p,{holder:g})]})]}),s.jsxs("tr",{children:[s.jsx("th",{children:"sealed emulated Δ"}),s.jsxs("td",{children:[s.jsx(te,{value:ue(j,"value")??j,what:"emulated"}),R(ue(j,"meaning"))&&s.jsx("div",{className:"faint",children:R(ue(j,"meaning"))})]})]}),s.jsxs("tr",{children:[s.jsx("th",{children:"native Δ"}),s.jsxs("td",{children:[s.jsx(te,{value:h.delta,what:"measured delta"})," ",s.jsxs("span",{className:"faint",children:["(base ",s.jsx(te,{value:h.base,what:"base",compact:!0})," → edited"," ",s.jsx(te,{value:h.edited,what:"edited",compact:!0}),")"]})]})]}),s.jsxs("tr",{children:[s.jsx("th",{children:"native − exact"}),s.jsxs("td",{children:[s.jsx(te,{value:ue(l,"difference","native_minus_exact"),what:"native minus exact"})," ",s.jsx(_p,{holder:ue(l,"difference","native_minus_exact")})]})]}),s.jsxs("tr",{children:[s.jsx("th",{children:"verdict"}),s.jsxs("td",{"data-testid":"whatif-verdict",children:[s.jsx(_o,{v:M,status:"?"})," ",M.residual!==void 0&&s.jsxs("span",{className:"faint",children:["residual ",s.jsx(te,{value:M.residual,what:"residual",compact:!0}),M.floor!==void 0&&s.jsxs(s.Fragment,{children:[" ","vs floor ",s.jsx(te,{value:M.floor,what:"floor",compact:!0})]})]}),[R(M.rests_on),R(M.note)].filter(Boolean).map(G=>s.jsx("div",{className:"faint",children:G},G))]})]})]})}),s.jsx(kj,{split:l.split}),s.jsx(Yj,{stages:l.stages}),k.length>0&&s.jsxs("div",{className:"faint","data-testid":"whatif-other-edits",children:["other edits in the chains: ",k.join(", "),R(ue(d,"other_edits","rule"))&&` (${R(ue(d,"other_edits","rule"))})`]}),s.jsx("div",{className:"whatif-session","data-testid":"whatif-session",children:f.unchanged===!0?s.jsxs(s.Fragment,{children:["The session was restored: unchanged at ",s.jsx("code",{children:R(l.where)??"?"})," after"," ",s.jsx(le,{n:v.length})," move",v.length===1?"":"s",v.length?` (last: ${v[v.length-1]})`:"","."]}):f.unchanged===!1?s.jsx("span",{className:"num-refused",children:"The op reports the session CHANGED."}):s.jsx(te,{value:void 0,what:"session restore report"})}),s.jsxs("div",{className:"whatif-stage",children:[s.jsx("button",{type:"button",disabled:i||!x,onClick:()=>x&&u.stage(x.target,x.value,x.op),title:"the set op: stages this edit at the pending layer (commit applies it)",children:"stage this edit"})," ",s.jsxs("span",{className:"faint",children:["(",s.jsx("code",{children:"set"}),"; the only button here that changes the session)"]})]})]})}function _p({holder:l}){if(!ie(l))return null;if(l.bound!==void 0)return s.jsxs("span",{title:"worst-case rounding interval through the chain: information, not the verdict",children:[s.jsx("span",{className:"faint",children:"worst-case interval"})," ",s.jsx(te,{value:l.bound,what:"bound"}),l.within_bound===!0?" within":l.within_bound===!1?" OUTSIDE":""]});const i=R(l.bound_note);return i?s.jsxs("span",{className:"faint","data-testid":"bound-note",children:["(",i,")"]}):null}function Yj({stages:l}){if(!ie(l))return null;const i="text"in l||"state"in l?[["",l]]:Object.entries(l);return s.jsx("div",{className:"stage-lines","data-testid":"stage-lines",children:i.map(([u,r])=>ie(r)?s.jsxs("div",{className:"faint","data-stages":u||"one",children:[u?`${u} run `:"","stages"," ",r.state==="refused"||r.state==="unresolved"?s.jsxs(s.Fragment,{children:[R(r.state)," (",R(r.reason)??"?",")"]}):s.jsxs(s.Fragment,{children:["[per-stage bound, not a chain bound]: ",R(r.text)??"?",R(r.cost)&&s.jsxs("span",{title:"cost",children:[" · ",R(r.cost)]})]})]},u):null)})}const Gj=["base","A","B","A+B"];function Xj({compare:l,checkpoints:i,busy:u,act:r}){const[d,h]=L.useState(""),[f,v]=L.useState(""),[y,p]=L.useState(""),x=l.state==="done"?l.result:null;return s.jsxs("section",{className:"predict-panel","aria-label":"compare",children:[s.jsx("h3",{children:"Compare two edits or checkpoints"}),s.jsxs("form",{onSubmit:g=>{g.preventDefault(),d.trim()&&f.trim()&&r.compare(d.trim(),f.trim(),y.trim()||null)},children:[s.jsx("input",{className:"mono","aria-label":"compare A",placeholder:"A: L1.m=0.5 add | checkpoint",list:"compare-checkpoints",value:d,onChange:g=>h(g.target.value),size:16}),s.jsx("input",{className:"mono","aria-label":"compare B",placeholder:"B: L0.v=0.25 add",list:"compare-checkpoints",value:f,onChange:g=>v(g.target.value),size:16}),s.jsx("input",{className:"mono","aria-label":"compare consumer",placeholder:"consumer (default logits)",value:y,onChange:g=>p(g.target.value),size:12}),s.jsx("datalist",{id:"compare-checkpoints",children:i.map(g=>s.jsx("option",{value:g.name},g.name))}),s.jsx("button",{type:"submit",disabled:u||!d.trim()||!f.trim(),children:"compare"})]}),s.jsx(_l,{slot:l,what:"compare",onInterrupt:r.interrupt,idle:"No comparison yet."}),x&&s.jsx(Qj,{result:x})]})}function Qj({result:l}){const i=ie(l.measured)?l.measured:{},u=ie(l.effects)?l.effects:{},r=ie(l.interaction)?l.interaction:void 0,d=ie(l.session)?l.session:{};return s.jsxs("div",{className:"compare-result","data-testid":"compare-result",children:[s.jsxs("div",{children:["A ",s.jsx("code",{children:R(ue(l,"sides","A"))??"?"})," · B"," ",s.jsx("code",{children:R(ue(l,"sides","B"))??"?"})," →"," ",s.jsx("code",{children:R(l.consumer)??"?"})]}),s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"arm"}),s.jsx("th",{className:"n",children:"consumer (native)"}),s.jsx("th",{className:"n",children:"effect vs base"}),s.jsx("th",{className:"n",children:"moves"})]})}),s.jsx("tbody",{children:Gj.map(h=>{const f=i[h],v=f===void 0&&h==="A+B";return s.jsxs("tr",{"data-arm":h,children:[s.jsx("td",{children:h}),s.jsx("td",{className:"n",children:v?s.jsx("span",{className:"faint",children:"not run (see interaction)"}):s.jsx(te,{value:ue(f,"value")??f,what:`${h} value`})}),s.jsx("td",{className:"n",children:h==="base"?s.jsx("span",{className:"faint",children:"—"}):v&&u[h]===void 0?s.jsx("span",{className:"faint",children:"not run"}):s.jsx(te,{value:u[h],what:`${h} effect`})}),s.jsx("td",{className:"n faint",title:wl(ue(f,"moves")).join("; "),children:wl(ue(f,"moves")).length||""})]},h)})})]}),s.jsxs("div",{"data-testid":"compare-interaction",children:["interaction"," ",R(ue(r,"formula"))&&s.jsxs("span",{className:"faint",children:[R(ue(r,"formula"))," = "]}),s.jsx(te,{value:ue(r,"value")??r,what:"interaction"})]}),s.jsx("div",{className:"faint",children:d.unchanged===!0?`session unchanged at ${R(l.where)??"?"} (restored after each arm)`:d.unchanged===!1?"the op reports the session CHANGED":"no session report"})]})}function Zj({forecast:l,forecasts:i,where:u,busy:r,act:d}){const[h,f]=L.useState(""),v=i.filter(y=>y.status==="open").length;return s.jsxs("section",{className:"predict-panel","aria-label":"forecasts",children:[s.jsx("h3",{children:"Forecasts sealed on this run"}),s.jsxs("form",{onSubmit:y=>{y.preventDefault(),d.forecast(h.trim()||null),f("")},children:[s.jsx("input",{className:"mono","aria-label":"forecast target",placeholder:"next stop, ADDR or M[a,b]",value:h,onChange:y=>f(y.target.value),size:16}),s.jsx("button",{type:"submit",disabled:r||u===null,children:"forecast"}),s.jsxs("button",{type:"button",disabled:r||v===0,onClick:()=>d.verify(null),title:"verify every open forecast whose target the cursor has passed",children:["verify reached (",v," open)"]})]}),s.jsx(_l,{slot:l,what:"forecast",onInterrupt:d.interrupt,idle:""}),i.length?s.jsx("div",{className:"table-scroll",children:s.jsxs("table",{className:"forecast-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"id"}),s.jsx("th",{children:"target"}),s.jsx("th",{children:"sealed at"}),s.jsx("th",{className:"n",children:"predicted"}),s.jsx("th",{className:"n",children:"native"}),s.jsx("th",{className:"n",title:"the verdict compares the measured residual with the floor (dtype spacings); the bound is information",children:"residual vs floor"}),s.jsx("th",{children:"verdict"})]})}),s.jsx("tbody",{children:i.map(y=>s.jsx(Vj,{f:y,busy:r,act:d},y.id))})]})}):s.jsx("div",{className:"faint",children:"none sealed"})]})}function Vj({f:l,busy:i,act:u}){const r=l.verdict;return s.jsxs("tr",{"data-forecast":l.id,"data-status":l.status,children:[s.jsx("td",{children:s.jsx(le,{n:l.id})}),s.jsx("td",{className:"mono",children:l.target}),s.jsx("td",{className:"mono faint",children:l.sealed_at}),s.jsx("td",{className:"n",children:s.jsx(te,{value:l.predicted,what:"predicted",compact:!0})}),s.jsx("td",{className:"n",children:r&&r.native!==void 0?s.jsx(te,{value:r.native,what:"native",compact:!0}):s.jsx("span",{className:"faint",children:"not measured"})}),s.jsx("td",{className:"n",children:r&&r.residual_max_abs!==void 0?s.jsx(Mv,{v:r}):l.bound.max!==void 0?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"faint",children:"bound"})," ",s.jsx(te,{value:ue(l.bound,"max"),what:"bound",compact:!0})]}):s.jsx("span",{className:"faint","data-testid":"forecast-bound-note",children:R(l.bound.note)??(R(l.bound.state)?`worst-case interval ${R(l.bound.state)} (${R(l.bound.reason)??"?"})`:"no worst-case interval")})}),s.jsxs("td",{children:[s.jsx(_o,{v:r,status:l.status}),l.status==="open"&&s.jsx("button",{type:"button",disabled:i,onClick:()=>u.verify([l.id]),children:"verify"})]})]})}function Ao({labels:l,onLabels:i}){return s.jsxs("div",{className:"view-legend faint","data-testid":"view-legend",children:[s.jsxs("span",{children:[s.jsx(Gt,{ev:"measured"})," measured"]}),s.jsxs("span",{children:[s.jsx(Gt,{ev:"derived-exact"})," derived or bound"]}),s.jsxs("span",{children:[s.jsx(Gt,{ev:"supplied"})," supplied"]}),s.jsxs("span",{children:[s.jsx(Gt,{ev:"unresolved"})," unresolved"]}),s.jsxs("span",{children:[s.jsx(Gt,{ev:"refused"})," refused"]}),s.jsx("span",{children:"· hover a value for its authority, proof and full value"}),s.jsxs("label",{className:"view-legend-toggle",children:[s.jsx("input",{type:"checkbox",checked:l,onChange:u=>i(u.target.checked)})," ","show labels"]})]})}const Kj=[["pipeline","Pipeline"],["symbols","Symbols"],["graph","Circuits"],["predict","Predict"]];function Jj(l){var y;const{frame:i,running:u,act:r}=l,d=l.extra??new Map;if(!i)return s.jsxs("div",{className:`live ${l.labels?"labels-on":"labels-off"}`,"data-testid":"live","data-running":u?"yes":"no",children:[s.jsxs("div",{className:"live-status",role:"status",children:[s.jsx("span",{className:"faint",children:l.refused?"no live frame":"loading live session…"}),s.jsx("span",{className:"live-state",children:u?s.jsxs("span",{"data-testid":"state-running",children:["running ",u,"…"]}):s.jsx(_v,{last:l.last})})]}),s.jsx(Ap,{frame:null,running:u,act:r,urlAddr:null}),l.refused&&s.jsx(Kn,{what:"live frame",refused:l.refused}),s.jsx(zp,{lines:l.console,disabled:!!u,act:r})]});const h=i.where!==null,f=l.tab??"pipeline",v=f==="pipeline"?null:(y=l.panes)==null?void 0:y[f];return s.jsxs("div",{className:`live ${l.labels?"labels-on":"labels-off"}`,"data-testid":"live","data-running":u?"yes":"no",children:[s.jsx(Ij,{...l,frame:i}),s.jsx(Ap,{frame:i,running:u,act:r,urlAddr:l.urlAddr}),l.refused&&s.jsx(Kn,{what:"request",refused:l.refused}),l.seekLine,h&&l.strip,l.panes&&r.tab&&s.jsx("div",{className:"live-tabs",role:"tablist","aria-label":"live views",children:Kj.map(([p,x])=>s.jsx("button",{type:"button",role:"tab",id:`live-tab-${p}`,"aria-selected":f===p,className:f===p?"live-tab here":"live-tab",onClick:()=>{var g;return(g=r.tab)==null?void 0:g.call(r,p)},children:x},p))}),h&&l.onLabels&&s.jsx(Ao,{labels:!!l.labels,onLabels:l.onLabels}),v?s.jsx("div",{role:"tabpanel","aria-labelledby":`live-tab-${f}`,className:"live-pane",children:v}):h?s.jsxs(s.Fragment,{children:[l.timeline&&s.jsx(e1,{timeline:l.timeline,disabled:!!u,act:r}),s.jsx(t1,{frame:i,summaries:l.summaries,expanded:l.expanded,act:r,watchRow:l.watchRow,forecasts:l.forecasts,circuitPorts:l.circuitPorts,disabled:!!u})]}):s.jsx("div",{className:"na","data-testid":"no-run",children:"No run yet: give token ids (or text, when the model has a tokenizer) and press start."}),!v&&s.jsxs("div",{className:"live-tables",children:[s.jsx(Fj,{frame:i,extra:d,summaries:l.summaries,disabled:!!u,act:r}),s.jsx(i1,{frame:i,extra:d,disabled:!!u,act:r}),s.jsx(u1,{frame:i,extra:d,disabled:!!u||!h,act:r}),s.jsx(c1,{frame:i,extra:d,disabled:!!u,act:r})]}),s.jsx(zp,{lines:l.console,disabled:!!u,act:r})]})}function Wj(l,i){return/^t\d+\./.test(l)?l:i===null?null:`t${i}.${l}`}function Fj({frame:l,extra:i,summaries:u,disabled:r,act:d}){var y;const[h,f]=L.useState(""),v=[...l.displays,...((y=i.get("displays"))==null?void 0:y.items)??[]];return s.jsxs("section",{"aria-label":"displays","data-testid":"displays",children:[s.jsx("h3",{children:"Displays"}),v.length?s.jsx("table",{children:s.jsx("tbody",{children:v.map((p,x)=>{const g=typeof p.id=="number"?p.id:null,j=typeof p.address=="string"?p.address:"?",M=Wj(j,l.row),k=M?u.get(yo(l.seq,M))??null:null;return s.jsxs("tr",{"data-display":g??"",children:[s.jsx("td",{children:g!==null?s.jsx(le,{n:g}):"?"}),s.jsx("td",{className:"mono",children:j}),s.jsx("td",{className:"mono faint",children:M&&M!==j?`→ ${M}`:""}),s.jsx("td",{className:"n",children:k?s.jsx(Tv,{entry:k.stats,pick:G=>"l2"in G?G.l2:null}):s.jsx("span",{className:"faint",title:"not a port of the layer on screen",children:"print to read"})}),s.jsxs("td",{children:[s.jsx("button",{type:"button",disabled:r,onClick:()=>d.command(`print ${M??j}`),children:"print"}),g!==null&&s.jsx("button",{type:"button",disabled:r,onClick:()=>d.op("undisplay",{ids:[g]}),children:"undisplay"})]})]},g??`d${x}`)})})}):s.jsx("div",{className:"faint",children:"none"}),s.jsx(Es,{frame:l,field:"displays",extra:i,act:d,noun:"displays"}),s.jsxs("form",{onSubmit:p=>{p.preventDefault(),h.trim()&&(d.op("display",{address:h.trim()}),f(""))},children:[s.jsx("input",{className:"mono","aria-label":"display address",placeholder:"L0.h (each stop) or t3.L0.a",value:h,onChange:p=>f(p.target.value),size:14}),s.jsx("button",{type:"submit",disabled:r||!h.trim(),children:"display"})]})]})}function Es({frame:l,field:i,extra:u,act:r,noun:d}){const h=Ky(l,i);if(!h)return null;const f=u.get(i),v=h.count-((f==null?void 0:f.items.length)??0);return s.jsxs("div",{className:"live-more","data-testid":`more-${i}`,children:[v>0?s.jsxs("button",{type:"button",className:"linklike",onClick:()=>r.more(i),children:[s.jsx(le,{n:v})," more ",d," not shown — show more"]}):s.jsx("span",{className:"faint",children:"all shown"}),(f==null?void 0:f.refused)&&s.jsx(Kn,{what:`more ${d}`,refused:f.refused})]})}function Ij({frame:l,running:i,last:u}){var d;const r=l.stop;return s.jsxs("div",{className:"live-status",role:"status",children:[s.jsx("code",{className:"live-where",children:l.where??"no run"}),(r==null?void 0:r.operator)&&s.jsxs("span",{className:"mono muted",children:[" ",r.operator]}),(d=r==null?void 0:r.proofs)==null?void 0:d.map(h=>s.jsx("span",{className:"chip",children:h},h)),s.jsx("span",{className:"live-state",children:i?s.jsxs("span",{"data-testid":"state-running",children:["running ",i,"…"]}):s.jsx(_v,{last:u})})]})}function _v({last:l}){if(!l)return s.jsx("span",{className:"faint",children:"paused"});switch(l.kind){case"ok":return s.jsxs("span",{"data-testid":"state-stopped","data-stopped":l.stopped??"",children:[l.op,l.stopped?` stopped: ${l.stopped}`:" done"]});case"unresolved":return s.jsxs("span",{"data-testid":"state-unresolved",title:l.reason,children:[l.op,": partly unresolved (",l.reason,")"]});case"interrupted":return s.jsxs("span",{"data-testid":"state-interrupted",children:[l.op," interrupted at ",l.where]});case"refused":return s.jsxs("span",{className:"num-refused","data-testid":"state-refused","data-ev":"refused",children:[l.op," refused",l.type?` (${l.type})`:"",": ",l.reason]})}}function Ap({frame:l,running:i,act:u,urlAddr:r}){const[d,h]=L.useState(""),[f,v]=L.useState(""),y=!!i,p=l!==null&&l.where===null,x=(g,j,M)=>s.jsx("button",{type:"button",disabled:y||p,onClick:()=>u.op(j),title:M,children:g});return s.jsxs("div",{className:"live-controls",role:"toolbar","aria-label":"stepping controls",children:[s.jsxs("form",{onSubmit:g=>{g.preventDefault();const j=d.trim();j&&u.op("start",{prompt:Pj(j)})},children:[s.jsx("input",{className:"mono","aria-label":"prompt",placeholder:"token ids: 1 5 9 3",value:d,onChange:g=>h(g.target.value)}),s.jsx("button",{type:"submit",disabled:y||!d.trim(),children:"start"})]}),x("step","step","step one port"),x("next","next","to the end of the sublayer"),x("finish","finish","to the end of the layer"),x("continue","continue","to the next breakpoint or watch hit"),x("reverse-step","reverse-step","step back one port"),s.jsxs("form",{onSubmit:g=>{g.preventDefault(),f.trim()&&u.op("until",{target:f.trim()})},children:[s.jsx("input",{className:"mono","aria-label":"until address",placeholder:"until ADDR (t3.L1.p)",value:f,onChange:g=>v(g.target.value)}),s.jsx("button",{type:"submit",disabled:y||p||!f.trim(),children:"until"})]}),s.jsx("button",{type:"button",disabled:!y,onClick:()=>u.interrupt(),title:"Ctrl-C the running op",children:"interrupt"}),r&&!y&&!p&&s.jsxs("span",{className:"chip","data-testid":"url-addr",children:["link names ",s.jsx("code",{children:r}),s.jsx("button",{type:"button",onClick:()=>u.op("until",{target:r}),children:"until there"})]})]})}function Pj(l){const i=l.split(/[\s,]+/).filter(Boolean);return i.length&&i.every(u=>/^\d+$/.test(u))?i.map(Number):l}function e1({timeline:l,disabled:i,act:u}){const r=l.cursor;if(!r)return null;const d=l.rows.find(f=>f.row===r.row),h=new Set(((d==null?void 0:d.edits)??[]).map(f=>f.replace(" (staged)","").replace(/\[.*\]$/,"")));return s.jsxs("div",{className:"live-clock","aria-label":"clock",children:[s.jsxs("div",{className:"faint",children:["rows"," ",l.rows.map(f=>s.jsxs("span",{className:f.row===r.row?"chip live-row-here":"chip",title:f.count===null?"prefilled (not stepped)":`${f.count} stops computed`,children:["t",f.row,f.token!==null&&s.jsxs("span",{className:"faint",children:[" #",f.token]}),f.edits.length>0&&s.jsx("span",{title:f.edits.join(", "),children:" ✎"})]},f.row))]}),s.jsx("div",{className:"live-stops",role:"list",children:l.stops.map((f,v)=>{const y=v===r.index,p=v<r.index,x=`t${r.row}.${f}`;return s.jsx("button",{type:"button",role:"listitem",className:`live-stop${y?" here":""}${p?" done":""}`,"data-edited":h.has(f)?"yes":void 0,disabled:i||v<=r.index,title:y?`${x} (cursor)`:p?`${x} (computed)`:`until ${x}`,onClick:()=>u.op("until",{target:x}),children:f},f)})})]})}function t1({frame:l,summaries:i,expanded:u,act:r,watchRow:d,forecasts:h,circuitPorts:f,disabled:v}){return s.jsx("div",{className:"table-scroll","aria-label":"pipeline",children:s.jsxs("table",{className:"live-pipeline",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{"aria-label":"cursor"}),s.jsxs("th",{children:["t",l.row??"?",".L",l.layer??"?"]}),s.jsx("th",{children:"operator"}),s.jsx("th",{children:"proof"}),s.jsx("th",{children:"‖value‖"}),s.jsx("th",{children:"top |value|"}),s.jsx("th",{children:"edit"}),h&&s.jsx("th",{title:"sealed prediction (hollow) beside the native value once verified",children:"forecast"})]})}),s.jsx("tbody",{children:l.ports.map(y=>s.jsx(n1,{port:y,summary:i.get(yo(l.seq,y.addr))??null,open:y.cursor||y.addr===u,act:r,watchRow:d,forecasts:h,inCircuit:(f==null?void 0:f.has(y.addr))??!1,disabled:v},y.port))})]})})}function n1({port:l,summary:i,open:u,act:r,watchRow:d,forecasts:h,inCircuit:f,disabled:v}){const y=L.useRef(null),p=l.addr,x=l.computed;return L.useEffect(()=>{if(!(!d||!x||!y.current))return d(p,y.current)},[d,p,x]),s.jsxs("tr",{ref:y,className:l.cursor?"live-port here":"live-port","data-port":l.port,"data-computed":l.computed?"yes":"no","data-circuit":f?"yes":void 0,"aria-current":l.cursor?"step":void 0,children:[s.jsxs("td",{children:[l.cursor?"▶":"",f&&s.jsx("span",{className:"circuit-mark",title:"a node of the selected circuit",children:"◆"})]}),s.jsx("td",{className:"mono",children:l.computed?s.jsx("button",{type:"button",className:"linklike",onClick:()=>r.expand(u?null:l.addr),children:l.port}):l.port}),s.jsx("td",{className:"mono muted",children:l.operator}),s.jsx("td",{children:l.proofs.map(g=>s.jsx("span",{className:"chip",children:g},g))}),l.computed?s.jsxs(s.Fragment,{children:[s.jsx("td",{children:s.jsx(Tv,{entry:(i==null?void 0:i.stats)??null,pick:g=>"l2"in g?g.l2:null})}),s.jsx("td",{children:u?s.jsx(a1,{entry:(i==null?void 0:i.topk)??null}):null})]}):s.jsx("td",{colSpan:2,className:"faint","data-testid":"not-computed",children:"not computed yet"}),s.jsx("td",{className:"live-edit-cell",children:s.jsx(s1,{edit:l.edit})}),h&&s.jsx("td",{className:"live-forecast","data-testid":"forecast-cell",children:s.jsx(l1,{port:l,forecasts:h,act:r,disabled:v})})]})}function l1({port:l,forecasts:i,act:u,disabled:r}){const d=i.filter(f=>f.target===l.addr).sort((f,v)=>v.id-f.id)[0];if(!d)return l.computed?null:s.jsx("button",{type:"button",className:"linklike",disabled:r||!u.forecast,title:`forecast ${l.addr}: seal a prediction from values at the cursor`,onClick:()=>{var f;return(f=u.forecast)==null?void 0:f.call(u,l.addr)},children:"forecast"});const h=d.verdict;return s.jsxs("span",{className:"forecast","data-forecast":d.id,"data-status":d.status,children:[s.jsxs("span",{className:"faint",children:["#",d.id," pred"]})," ",s.jsx(te,{value:d.predicted,compact:!0}),h&&h.native!==void 0?s.jsxs(s.Fragment,{children:[" ",s.jsx("span",{className:"faint",children:"native"})," ",s.jsx(te,{value:h.native,compact:!0})," ",s.jsx("span",{className:"faint",children:"resid"})," ",s.jsx(Mv,{v:h})," ",s.jsx(_o,{v:h,status:d.status})]}):l.computed?s.jsxs(s.Fragment,{children:[" ",s.jsx("button",{type:"button",disabled:r||!u.verify,onClick:()=>{var f;return(f=u.verify)==null?void 0:f.call(u,[d.id])},title:"compare with the native value now that the cursor has passed it",children:"verify"})]}):s.jsxs("span",{className:"faint",title:"hollow until measured",children:[" ","awaiting native · bound"," ",s.jsx(te,{value:d.bound.max,compact:!0})]})]})}function Av(l){return{v:null,ev:"unresolved",reason:l,unit:null,proof:null,ptr:null,note:null,recorded_authority:null}}function Tv({entry:l,pick:i}){if(!l||l.state==="loading")return s.jsx("span",{className:"faint",children:"…"});if(l.state==="refused")return s.jsx(ze,{n:Av(l.refused.detail??l.refused.refused),showReason:!0});const u=i(l.result);return u?s.jsx(ze,{n:u}):s.jsx("span",{className:"faint",children:"n/a"})}function a1({entry:l}){if(!l||l.state==="loading")return s.jsx("span",{className:"faint",children:"…"});if(l.state==="refused")return s.jsx(ze,{n:Av(l.refused.detail??l.refused.refused)});const i=l.result;return i.op!=="topk"?null:s.jsx("span",{className:"live-top",children:i.entries.map(u=>s.jsxs("span",{className:"chip",children:["[",u.index.join(","),"] ",s.jsx(ze,{n:u.v})]},u.index.join(",")))})}function s1({edit:l}){if(!l)return null;if(l.state!=="resolved"||!l.authority)return s.jsxs("span",{className:"num-refused","data-ev":"refused",title:l.reason??"",children:["label refused: ",l.reason??"no reason given"]});const i=[];if(l.edited){const r=`edited (${l.kind}${l.by?` by ${l.by}`:""}) · ${l.authority}`;i.push(s.jsxs("span",{className:"chip live-mark","data-testid":"edited","data-ev":l.authority,title:r,children:[s.jsx(Gt,{ev:l.authority})," ",r]},"e"))}const u=l.upstream_total;if(u){const r=l.upstream.map(h=>`t${h.row}.${h.port.startsWith("cache.")?"":`L${h.layer}.`}${vo(h.port,h.selection)} ${h.op}`),d=`downstream of ${u} edit${u===1?"":"s"}: ${r.join(", ")}${u>r.length?`, and ${u-r.length} more`:""}`;i.push(s.jsxs("span",{className:"chip live-mark","data-testid":"downstream",title:d,children:["downstream of ",s.jsx(le,{n:u})," edit",u===1?"":"s"]},"u"))}return i.length?s.jsx(s.Fragment,{children:i}):s.jsx("span",{className:"faint",children:"native"})}function i1({frame:l,extra:i,disabled:u,act:r}){var g;const[d,h]=L.useState("break"),[f,v]=L.useState(""),[y,p]=L.useState(""),x=[...l.breakpoints,...((g=i.get("breakpoints"))==null?void 0:g.items)??[]];return s.jsxs("section",{"aria-label":"breakpoints and watches",children:[s.jsx("h3",{children:"Breakpoints and watches"}),x.length?s.jsx("table",{children:s.jsx("tbody",{children:x.map(j=>s.jsxs("tr",{"data-enabled":j.enabled?"yes":"no",children:[s.jsx("td",{children:s.jsx(le,{n:j.id})}),s.jsx("td",{children:j.kind}),s.jsx("td",{className:"mono",children:j.pattern}),s.jsx("td",{className:"mono faint live-clip",title:j.condition??j.predicate??"",children:j.condition??j.predicate??j.mode??""}),s.jsxs("td",{title:"hits",children:[s.jsx(le,{n:j.hits})," hits"]}),s.jsxs("td",{children:[s.jsx("button",{type:"button",disabled:u,onClick:()=>r.op(j.enabled?"disable":"enable",{ids:[j.id]}),children:j.enabled?"disable":"enable"}),s.jsx("button",{type:"button",disabled:u,onClick:()=>r.op("delete",{ids:[j.id]}),children:"delete"})]})]},j.id))})}):s.jsx("div",{className:"faint",children:"none"}),s.jsx(Es,{frame:l,field:"breakpoints",extra:i,act:r,noun:"breakpoints"}),s.jsxs("form",{onSubmit:j=>{if(j.preventDefault(),!f.trim())return;const M=y.trim();d==="break"?r.op("break",M?{pattern:f.trim(),condition:M}:{pattern:f.trim()}):r.op("watch",M?{address:f.trim(),predicate:M}:{address:f.trim()}),v(""),p("")},children:[s.jsxs("select",{"aria-label":"kind",value:d,onChange:j=>h(j.target.value),children:[s.jsx("option",{value:"break",children:"break"}),s.jsx("option",{value:"watch",children:"watch"})]}),s.jsx("input",{className:"mono","aria-label":"pattern",placeholder:d==="break"?"L*.p":"L1.h",value:f,onChange:j=>v(j.target.value)}),s.jsx("input",{className:"mono","aria-label":"condition",placeholder:d==="break"?"if: norm > 3":"predicate (optional)",value:y,onChange:j=>p(j.target.value)}),s.jsx("button",{type:"submit",disabled:u||!f.trim(),children:"add"})]})]})}function Tp({e:l}){const i=lu(l.value);return s.jsxs("span",{className:"mono","data-testid":"edit-address",children:[l.layer!==void 0?`L${l.layer}.`:"",vo(l.port,l.selection)," ",l.op," ",i?s.jsx(ze,{n:i}):s.jsx("span",{className:"faint",children:l.kind})]})}function u1({frame:l,extra:i,disabled:u,act:r}){var ce,z;const d=l.ports.filter(T=>T.editable).map(T=>T.port),[h,f]=L.useState(""),[v,y]=L.useState("scale"),[p,x]=L.useState(""),g=l.edits??{},j=[...g.staged??[],...((ce=i.get("staged"))==null?void 0:ce.items)??[]],M=[...g.committed??[],...((z=i.get("committed"))==null?void 0:z.items)??[]],k=(g.staged_total??j.length)>0,G=h||d[0]||"",q=Number(p),X=p.trim()!==""&&Number.isFinite(q);return s.jsxs("section",{"aria-label":"edits",children:[s.jsx("h3",{children:"Edits"}),s.jsxs("div",{children:["staged:"," ",j.length?j.map((T,K)=>s.jsx("div",{"data-testid":"staged-edit",children:s.jsx(Tp,{e:T})},K)):s.jsx("span",{className:"faint",children:"none"}),s.jsx(Es,{frame:l,field:"staged",extra:i,act:r,noun:"staged edits"})]}),M.length>0&&s.jsxs("div",{children:["committed:"," ",M.map((T,K)=>s.jsxs("div",{"data-testid":"committed-edit",children:[s.jsxs("span",{className:"faint",children:["t",T.row??"?"," "]}),s.jsx(Tp,{e:T})]},K)),s.jsx(Es,{frame:l,field:"committed",extra:i,act:r,noun:"committed edits"})]}),s.jsxs("form",{onSubmit:T=>{T.preventDefault(),!(!X||!G||l.layer===null)&&(r.op("set",{target:`L${l.layer}.${G}`,value:q,op:v}),x(""))},children:[s.jsx("select",{"aria-label":"edit port",value:G,onChange:T=>f(T.target.value),children:d.map(T=>s.jsxs("option",{value:T,children:["L",l.layer??"?",".",T]},T))}),s.jsxs("select",{"aria-label":"edit op",value:v,onChange:T=>y(T.target.value),children:[s.jsx("option",{value:"replace",children:"replace"}),s.jsx("option",{value:"add",children:"add"}),s.jsx("option",{value:"scale",children:"scale"})]}),s.jsx("input",{className:"mono","aria-label":"scalar",inputMode:"decimal",placeholder:"scalar",value:p,onChange:T=>x(T.target.value)}),s.jsx("button",{type:"submit",disabled:u||!X||!G,children:"stage"})]}),s.jsx("button",{type:"button",disabled:u||!k,onClick:()=>r.op("commit"),children:"commit"}),s.jsx("button",{type:"button",disabled:u||!k,onClick:()=>r.op("abort"),children:"abort"})]})}function c1({frame:l,extra:i,disabled:u,act:r}){var v;const[d,h]=L.useState(""),f=[...l.checkpoints,...((v=i.get("checkpoints"))==null?void 0:v.items)??[]];return s.jsxs("section",{"aria-label":"checkpoints",children:[s.jsx("h3",{children:"Checkpoints"}),f.length?s.jsx("table",{children:s.jsx("tbody",{children:f.map(y=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:y.name}),s.jsx("td",{className:"mono faint",children:y.where}),s.jsx("td",{className:"faint",title:y.store==="durable"?"stored in the project":"this process",children:y.store}),s.jsx("td",{children:s.jsx("button",{type:"button",disabled:u,onClick:()=>r.op("restart",{name:y.name}),children:"restart"})})]},y.name))})}):s.jsx("div",{className:"faint",children:"none"}),s.jsx(Es,{frame:l,field:"checkpoints",extra:i,act:r,noun:"checkpoints"}),s.jsxs("form",{onSubmit:y=>{y.preventDefault(),r.op("checkpoint",d.trim()?{name:d.trim()}:{}),h("")},children:[s.jsx("input",{className:"mono","aria-label":"checkpoint name",placeholder:"name (optional)",maxLength:64,value:d,onChange:y=>h(y.target.value)}),s.jsx("button",{type:"submit",disabled:u||l.where===null,children:"checkpoint"})]})]})}function zp({lines:l,disabled:i,act:u}){const[r,d]=L.useState("");return s.jsxs("section",{className:"live-console","aria-label":"console",children:[s.jsx("h3",{children:"Console"}),s.jsx("pre",{className:"mono","data-testid":"console-log",children:l.slice(-40).map(h=>`(mdb) ${h.line}
57
+ ${h.text}
58
+ `).join("")}),s.jsxs("form",{onSubmit:h=>{h.preventDefault(),r.trim()&&(u.command(r),d(""))},children:[s.jsx("input",{className:"mono","aria-label":"command",placeholder:"any REPL command: print L0.q top=3 | info edits | help",value:r,onChange:h=>d(h.target.value),style:{width:"100%"}}),s.jsx("button",{type:"submit",disabled:i||!r.trim(),children:"run"})]})]})}function r1(){return L.useMemo(()=>{if(typeof IntersectionObserver>"u")return;const l=new WeakMap,i=new IntersectionObserver(u=>{for(const r of u){const d=l.get(r.target);d&&It.getState().setVisible(d,r.isIntersecting)}});return(u,r)=>(l.set(r,u),i.observe(r),()=>{i.unobserve(r),It.getState().setVisible(u,!1)})},[])}function o1({seek:l,where:i,busy:u,onConfirm:r,onCancel:d}){return l?s.jsxs("div",{className:"seek-line",role:"alertdialog","aria-label":"confirm seek","data-testid":"seek-line",children:[s.jsxs("span",{children:[s.jsxs("code",{children:["seek ",l.target]})," moves the session from ",s.jsx("code",{children:i??"no run"})," to it (forward with ",s.jsx("code",{children:"until"}),", back by layers, or by replaying a stored recipe); asked from ",l.from,"."]})," ",s.jsx("button",{type:"button",disabled:u,onClick:r,ref:h=>{var f;h&&((f=document.activeElement)!=null&&f.closest("[data-own-keys]"))&&h.focus()},children:"seek"})," ",s.jsx("button",{type:"button",onClick:d,children:"cancel"})]}):null}function d1({sid:l}){var G,q,X,ce;const i=It(),u=bl(),r=de(z=>z.addr),d=r1();L.useEffect(()=>{d&&It.setState({visible:new Set})},[d]),L.useEffect(()=>{It.getState().setSid(l),bl.getState().reset()},[l]);const h=((G=i.frame)==null?void 0:G.where)??null,f=!!i.running,v=i.ledger,y=()=>void i.interrupt(),p=(z,T)=>u.set({seek:{target:z,from:T}}),x=u.selected!==null?u.circuits.get(u.selected)??null:null,g=L.useMemo(()=>x&&u.overlay?pu(x.body).map(z=>z.address):[],[x,u.overlay]),j=L.useMemo(()=>new Set(g.map(z=>z.split("[")[0]??z)),[g]),M=((q=i.frame)==null?void 0:q.layer)!==null&&((X=i.frame)==null?void 0:X.layer)!==void 0?(()=>{const z=i.frame.stop,T=ie(z)?R(z.port):null;return T?`L${i.frame.layer}.${T}`:null})():null,k=(v==null?void 0:v.forecasts)??[];return s.jsxs("section",{className:"panel","aria-label":"live",children:[s.jsxs("h2",{children:["Live · ",l]}),s.jsx("div",{className:"panel-body",children:s.jsx(Jj,{frame:i.frame,timeline:i.timeline,running:i.running,last:i.last,refused:i.refused,summaries:i.summaries,console:i.console,expanded:i.expanded,extra:i.extra,watchRow:d,urlAddr:r&&h&&r!==h?r:null,tab:u.tab,labels:u.labels[u.tab],onLabels:z=>u.set({labels:{...u.labels,[u.tab]:z}}),forecasts:k,circuitPorts:j,seekLine:s.jsx(o1,{seek:u.seek,where:h,busy:f,onConfirm:()=>void u.confirmSeek(),onCancel:()=>u.set({seek:null})}),strip:i.frame&&s.jsx(Xb,{frame:i.frame,timeline:i.timeline,circuit:g,busy:f,seek:p}),panes:{symbols:s.jsx(bj,{slot:u.slots.symbols,reads:u.slots.reads,args:u.symbolsArgs,where:h,busy:f,declared:(v==null?void 0:v.symbols)??[],act:{run:z=>void u.symbols(z),declare:(z,T)=>void u.exec("symbols","symbol",{name:z,addresses:T},`symbol ${z} = ${T}`).then(K=>{K.state==="done"&&u.symbols(bl.getState().symbolsArgs)}),measure:(z,T)=>void u.exec("reads","reads",T?{source:z,consumer:T}:{source:z},`reads ${z}${T?` consumer=${T}`:""}`),openRead:z=>u.set({focus:z,tab:"graph"}),seek:p,interrupt:y}}),graph:s.jsx(Fb,{ledger:(v==null?void 0:v.circuits)??[],runs:(v==null?void 0:v.runs)??[],circuits:u.circuits,selected:u.selected,node:u.node,focus:u.focus,slot:u.slots.circuit,testSlot:u.slots.test,busy:f,overlay:u.overlay,act:{build:(z,T,K)=>void u.build(z,T,K),select:z=>{u.circuits.has(z)?u.set({selected:z,node:null}):u.show(z)},test:(z,T)=>void u.test(z,T),node:z=>u.set({node:z}),seek:p,overlay:z=>u.set({overlay:z}),interrupt:y}}),predict:s.jsx($j,{whatif:u.slots.whatif,compare:u.slots.compare,forecast:u.slots.forecast,forecasts:k,checkpoints:((ce=i.frame)==null?void 0:ce.checkpoints)??[],port:M,where:h,busy:f,act:{whatif:(z,T,K,V)=>void u.exec("whatif","whatif",{target:z,value:T,op:K,consumer:V},`whatif ${z} = ${T} ${K} consumer=${V}`),stage:(z,T,K)=>void i.op("set",{target:z,value:T,op:K}),compare:(z,T,K)=>void u.exec("compare","compare",K?{a:z,b:T,consumer:K}:{a:z,b:T},`compare ${z} | ${T}${K?` consumer=${K}`:""}`),forecast:z=>void u.exec("forecast","forecast",z?{target:z}:{},`forecast${z?` ${z}`:""}`),verify:z=>void u.exec("forecast","verify",z?{ids:z}:{},`verify${z?` ${z.join(" ")}`:""}`),interrupt:y}})},act:{op:(z,T)=>void i.op(z,T),command:z=>void i.command(z),interrupt:y,expand:z=>i.expand(z),more:z=>void i.more(z),tab:z=>u.set({tab:z}),forecast:z=>void u.exec("forecast","forecast",{target:z},`forecast ${z}`),verify:z=>void u.exec("forecast","verify",{ids:z},`verify ${z.join(" ")}`)}})})]})}function zv(){const[l,i]=L.useState(!1);return[l,i,l?"labels-on":"labels-off"]}function f1(l){const i=gt("records",l?`/s/${encodeURIComponent(l)}/records`:null,{page:0});return i.state==="ok"?i.env.data.kinds:null}function h1(l,i){return`this session holds ${(l?`${l.records} record${l.records===1?"":"s"}`:"")||"records"} and no state cuts, so the ${i} has nothing to draw (a project written by \`mdb engine --project --script\` keeps records only)`}function Cp({title:l,what:i,session:u,children:r}){return s.jsxs("section",{className:"panel","aria-label":l.toLowerCase(),"data-testid":`no-cuts-${l}`,children:[s.jsx("h2",{children:l}),s.jsxs("div",{className:"panel-body",children:[s.jsxs("div",{className:"na","data-testid":"no-cuts",children:[s.jsx("strong",{children:"no retained cuts"}),": ",h1(u,i)]}),r]})]})}function Cv(l,i){var g;const u=`/s/${encodeURIComponent(l)}`,[r,d]=L.useState(0),h=gt("records",`${u}/records`,{kind:i,page:r}),[f,v]=L.useState(null),y=h.state==="ok"?h.env.data.rows:[],p=f??((g=y[0])==null?void 0:g.id)??null,x=gt("stored",p?`${u}/stored/${encodeURIComponent(p)}`:null);return{list:h,rows:y,id:p,setChosen:v,body:x,page:r,setPage:d}}function Ov({label:l,list:i,id:u,choose:r,page:d,setPage:h}){return s.jsxs("div",{className:"recorded-picker",children:[s.jsx("select",{"aria-label":l,value:u??"",onChange:f=>r(f.target.value),children:i.rows.map(f=>s.jsxs("option",{value:f.id,children:[f.title," · ",f.id.slice(0,12)]},f.id))})," ",s.jsxs("span",{className:"faint",children:[s.jsx(le,{n:i.total})," recorded"]}),i.pages>1&&s.jsxs(s.Fragment,{children:[" ",s.jsx("button",{type:"button",disabled:d<=0,onClick:()=>h(d-1),children:"‹"})," ","page ",s.jsx(le,{n:d+1})," of ",s.jsx(le,{n:i.pages})," ",s.jsx("button",{type:"button",disabled:d>=i.pages-1,onClick:()=>h(d+1),children:"›"})]})]})}function Dv({stored:l}){return s.jsxs("div",{className:"faint recorded-origin",children:["record ",s.jsx("code",{title:l.id,children:l.id.slice(0,16)})," · sealed ",l.authority," · read-only (no live model: nothing here seeks or measures)"]})}function Op({sid:l}){const i=Cv(l,"symbol-table"),[u,r,d]=zv();return s.jsxs("section",{className:"panel","aria-label":"symbols","data-testid":"recorded-symbols",children:[s.jsx("h2",{children:"Symbols (recorded tables)"}),s.jsxs("div",{className:`panel-body ${d}`,children:[s.jsx(Ao,{labels:u,onLabels:r}),s.jsx(Qt,{what:"symbol-table records",loaded:i.list,children:h=>h.total===0?s.jsxs("div",{className:"na",children:["No ",s.jsx("code",{children:"symbol-table"})," record in this session (run ",s.jsx("code",{children:"symbols"})," with a project attached to record one)."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ov,{label:"symbol table",list:h,id:i.id,choose:i.setChosen,page:i.page,setPage:f=>{i.setPage(f),i.setChosen(null)}}),i.id&&s.jsx(Qt,{what:"symbol table",loaded:i.body,children:f=>s.jsxs(s.Fragment,{children:[s.jsx(Dv,{stored:f}),s.jsx(Mj,{result:f.body})]})})]})})]})]})}function Dp({sid:l}){const i=Cv(l,"circuit"),[u,r,d]=zv();return s.jsxs("section",{className:"panel","aria-label":"circuits","data-testid":"recorded-circuits",children:[s.jsx("h2",{children:"Circuits (recorded)"}),s.jsxs("div",{className:`panel-body ${d}`,children:[s.jsx(Ao,{labels:u,onLabels:r}),s.jsx(Qt,{what:"circuit records",loaded:i.list,children:h=>h.total===0?s.jsxs("div",{className:"na",children:["No ",s.jsx("code",{children:"circuit"})," record in this session (run ",s.jsx("code",{children:"circuit CONSUMER"})," ","with a project attached to record one)."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ov,{label:"circuit",list:h,id:i.id,choose:i.setChosen,page:i.page,setPage:f=>{i.setPage(f),i.setChosen(null)}}),i.id&&s.jsx(Qt,{what:"circuit",loaded:i.body,children:f=>s.jsxs(s.Fragment,{children:[s.jsx(Dv,{stored:f}),s.jsx(Ib,{id:f.ledger_id??h.rows.findIndex(v=>v.id===f.id)+1+i.page*25,body:f.body,source:{kind:"stored",sid:l,record:f.id}}),f.ledger_id===null&&s.jsx("div",{className:"faint","data-testid":"no-ledger-id",children:"this record stores no ledger id: the number above is its position in this list"})]})})]})})]})]})}function m1({sid:l,id:i}){const u=gt("record",`/s/${encodeURIComponent(l)}/records/${encodeURIComponent(i)}`),r=de(h=>h.open),d=de(h=>h.go);return s.jsx(Qt,{what:"record",loaded:u,children:(h,f)=>s.jsxs("div",{style:{display:"grid",gap:6},children:[s.jsxs("div",{children:[s.jsx("strong",{children:h.summary.title||h.summary.id})," ",s.jsx("span",{className:"chip mono",title:"record schema",children:h.summary.schema})," ",s.jsx("span",{className:"chip",children:h.summary.status})]}),s.jsx("div",{className:"faint mono",style:{wordBreak:"break-all"},children:h.summary.id}),s.jsxs("div",{className:"muted",children:["authority: ",h.summary.authority||"not stated",h.summary.addr&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("button",{type:"button",className:"chip mono",onClick:()=>d(h.summary.addr??""),children:h.summary.addr})]})]}),h.arms&&s.jsx(p1,{arms:h.arms,onOpen:v=>r({record:v})}),h.pointers.length>0&&s.jsxs("div",{children:[s.jsx("strong",{children:"pointers"})," ",h.pointers.map(v=>s.jsx(Vp,{pointer:v},v.digest))]}),h.links.length>0&&s.jsxs("div",{children:[s.jsx("strong",{children:"links"})," ",h.links.map(v=>s.jsxs("button",{type:"button",className:"chip",onClick:()=>r({record:v.id}),children:[v.rel," ",v.id.slice(0,24)]},`${v.rel}:${v.id}`))]}),s.jsx(mu,{value:h.body,name:"body",depth:1}),s.jsx(_s,{env:f})]})})}function p1({arms:l,onOpen:i}){return s.jsx("div",{className:"table-scroll arms-table",children:s.jsxs("table",{"aria-label":"comparison arms",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"arm"}),s.jsx("th",{children:"status"}),s.jsx("th",{children:"value"}),s.jsx("th",{children:"effect vs sham"}),s.jsx("th",{children:"prediction"}),s.jsx("th",{children:"residual"}),s.jsx("th",{children:"decision"})]})}),s.jsx("tbody",{children:l.map(u=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:"row-button",onClick:()=>i(u.record),children:[u.label," ",s.jsxs("span",{className:"faint",children:["mask ",s.jsx(le,{n:u.mask})]})]})}),s.jsx("td",{children:u.status}),s.jsx("td",{children:s.jsx(ze,{n:u.value,compact:!0})}),s.jsx("td",{children:s.jsx(ze,{n:u.effect,compact:!0})}),s.jsx("td",{children:u.prediction?s.jsx(ze,{n:u.prediction,compact:!0}):s.jsx("span",{className:"faint",children:"none"})}),s.jsx("td",{children:u.residual?s.jsx(ze,{n:u.residual,compact:!0}):s.jsx("span",{className:"faint",children:"none"})}),s.jsx("td",{children:u.decision??s.jsx("span",{className:"faint",children:"none"})})]},u.record))})]})})}function v1(){const l=de(g=>g.sid),i=de(g=>g.go),u=de(g=>g.record),r=de(g=>g.open),d=Be(g=>g.recordKind),h=Be(g=>g.drawerOpen),f=Be(g=>g.set),[v,y]=L.useState(0),p=l?`/s/${encodeURIComponent(l)}/records`:null,x=gt("records",p,{kind:d,page:v});return l?s.jsxs("section",{className:"panel","aria-label":"records",children:[s.jsxs("h2",{children:[s.jsxs("button",{type:"button",className:"chip","aria-expanded":h,onClick:()=>f({drawerOpen:!h}),children:[h?"▾":"▸"," Records"]}),x.state==="ok"&&s.jsxs("select",{"aria-label":"record kind",value:d??"",onChange:g=>{f({recordKind:g.target.value||null}),y(0)},children:[s.jsx("option",{value:"",children:"all kinds"}),Object.keys(x.env.data.kinds).map(g=>s.jsx("option",{value:g,children:g},g))]})]}),h&&s.jsxs("div",{className:"panel-body records-body",children:[s.jsx("div",{style:{overflow:"auto",minWidth:0},children:s.jsx(Qt,{what:"records",loaded:x,children:(g,j)=>s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"table-scroll",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"kind"}),s.jsx("th",{children:"title"}),s.jsx("th",{children:"status"}),s.jsx("th",{children:"schema"}),s.jsx("th",{children:"values"})]})}),s.jsx("tbody",{children:g.rows.map(M=>s.jsxs("tr",{className:u===M.id?"selected-row":void 0,children:[s.jsx("td",{children:M.kind}),s.jsx("td",{children:s.jsx("button",{type:"button",className:"row-button",title:M.id,onClick:()=>{r({record:M.id}),M.addr&&i(M.addr)},children:M.title||M.id})}),s.jsx("td",{children:M.status}),s.jsx("td",{className:"mono faint",children:M.schema}),s.jsx("td",{children:M.nums.map(k=>s.jsxs("div",{children:[s.jsx("span",{className:"faint",children:k.name})," ",s.jsx(ze,{n:k.n})]},k.name))})]},M.id))})]})}),g.pages>1&&s.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[s.jsx("button",{type:"button",disabled:v<=0,onClick:()=>y(v-1),children:"‹"}),"page ",s.jsx(le,{n:g.page+1})," of ",s.jsx(le,{n:g.pages})," (",s.jsx(le,{n:g.total})," records)",s.jsx("button",{type:"button",disabled:v>=g.pages-1,onClick:()=>y(v+1),children:"›"})]}),s.jsx(_s,{env:j})]})})}),s.jsx("div",{style:{overflow:"auto",minWidth:0},children:u?s.jsx(m1,{sid:l,id:u}):s.jsx("div",{className:"faint",children:"Open a record to see its detail."})})]})]}):null}function x1({row:l}){const i=de(d=>d.sid),u=de(d=>d.go),r=gt("symbol",i?`/s/${encodeURIComponent(i)}/symbols/${encodeURIComponent(l.id)}`:null);return s.jsxs("div",{style:{display:"grid",gap:6},children:[s.jsx("div",{className:"muted",children:l.claim}),l.abstainReason&&s.jsxs("div",{className:"muted",children:["abstained: ",l.abstainReason]}),s.jsxs("div",{children:[s.jsx("strong",{children:"locations"})," ",l.locations.map(d=>s.jsx("button",{type:"button",className:"chip mono",onClick:()=>u(d),children:d},d)),l.locationsMore>0&&s.jsxs("span",{className:"faint",children:[" ","+",s.jsx(le,{n:l.locationsMore})," more"]})]}),l.readers.length>0&&s.jsx("div",{className:"table-scroll",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"reader"}),s.jsx("th",{children:"source rows"}),s.jsx("th",{children:"mass"}),s.jsx("th",{children:"verdict"})]})}),s.jsx("tbody",{children:l.readers.map(d=>s.jsxs("tr",{children:[s.jsxs("td",{children:[d.addr?s.jsx("button",{type:"button",className:"chip mono",onClick:()=>u(d.addr??""),children:d.addr}):s.jsxs("span",{className:"mono",children:["L",String(d.reader.block)," h",String(d.reader.head)]}),d.reader.kvGroup!==null&&s.jsxs("span",{className:"faint",children:[" kv",String(d.reader.kvGroup)]})]}),s.jsxs("td",{className:"mono",children:[d.source.name," [",d.source.rows.map(String).join(","),"]"]}),s.jsxs("td",{children:[s.jsx(ze,{n:d.mass}),s.jsx("div",{className:"faint",children:d.massKind})]}),s.jsx("td",{children:s.jsx("span",{className:"chip",children:d.verdict})})]},d.id))})]})}),l.readersMore>0&&s.jsxs("div",{className:"faint",children:["+",s.jsx(le,{n:l.readersMore})," more readers not shown"]}),s.jsxs("div",{children:[s.jsx("strong",{children:"lifetime"})," ",[...l.lifetime.defs.map(d=>["def",d]),...l.lifetime.reads.map(d=>["read",d])].map(([d,h],f)=>s.jsxs("span",{className:"chip",title:h.cut??"",children:[d," ",h.label]},f)),!l.lifetime.defs.length&&!l.lifetime.reads.length&&s.jsx("span",{className:"faint",children:"no recorded lifetime points"})]}),l.uses.length>0&&s.jsxs("div",{children:[s.jsx("strong",{children:"uses"})," ",l.uses.map(d=>s.jsxs("span",{className:"chip",title:d.closure??"",children:[d.consumer,": ",d.support]},d.id))]}),s.jsx(Qt,{what:"symbol detail",loaded:r,children:d=>s.jsxs("div",{children:[d.claimBoundary&&s.jsxs("div",{className:"muted",children:["claim boundary: ",d.claimBoundary]}),s.jsx("div",{children:Object.entries(d.statuses).map(([h,f])=>s.jsxs("span",{className:"chip",children:[h,": ",f]},h))}),s.jsx(mu,{value:d.binding,name:"binding",depth:1})]})})]})}function Rp(){const l=de(x=>x.sid),i=de(x=>x.addr),u=Be(x=>x.symbolsAtCursor),r=Be(x=>x.set),[d,h]=L.useState(""),[f,v]=L.useState(0),y=l?`/s/${encodeURIComponent(l)}/symbols`:null,p=gt("symbols",y,{at:u?i:null,q:d||null,page:f});return l?s.jsxs("section",{className:"panel","aria-label":"symbols",children:[s.jsx("h2",{children:"Symbols"}),s.jsxs("div",{className:"panel-body",children:[s.jsxs("div",{style:{display:"flex",gap:6,marginBottom:6,flexWrap:"wrap"},children:[s.jsx("input",{"aria-label":"filter symbols",placeholder:"filter",value:d,onChange:x=>{h(x.target.value),v(0)},style:{flex:1,minWidth:80}}),s.jsxs("label",{className:"muted",title:"only symbols defined at or before the cursor's token row",children:[s.jsx("input",{type:"checkbox",checked:u,onChange:x=>r({symbolsAtCursor:x.target.checked})})," ","at cursor"]})]}),s.jsx(Qt,{what:"symbols",loaded:p,children:(x,g)=>s.jsxs(s.Fragment,{children:[s.jsx(y1,{data:x}),x.pages>1&&s.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center",marginTop:6},children:[s.jsx("button",{type:"button",disabled:f<=0,onClick:()=>v(f-1),children:"‹"}),"page ",s.jsx(le,{n:x.page+1})," of ",s.jsx(le,{n:x.pages}),s.jsx("button",{type:"button",disabled:f>=x.pages-1,onClick:()=>v(f+1),children:"›"})]}),s.jsx(_s,{env:g})]})})]})]}):null}function y1({data:l}){const i=de(r=>r.symbol),u=de(r=>r.open);return s.jsx("div",{className:"table-scroll",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"symbol"}),s.jsx("th",{children:"status"}),s.jsx("th",{children:"readers"}),s.jsx("th",{children:"verdict"})]})}),s.jsxs("tbody",{children:[l.rows.map(r=>s.jsx(g1,{row:r,open:i===r.id,toggle:()=>u({symbol:i===r.id?null:r.id})},r.id)),s.jsxs("tr",{"data-testid":"unbound-row",children:[s.jsx("td",{children:s.jsx("em",{children:"Unbound"})}),s.jsxs("td",{colSpan:3,children:[s.jsx(ze,{n:l.unbound,showReason:!0}),s.jsx("div",{className:"faint",children:l.coverage})]})]})]})]})})}function g1({row:l,open:i,toggle:u}){const r=de(h=>h.go),d=l.locations[0];return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:i?"selected-row":void 0,children:[s.jsxs("td",{children:[s.jsxs("button",{type:"button",className:"row-button","aria-expanded":i,onClick:u,children:[s.jsx("span",{style:{color:"var(--role-symbol)"},children:"●"})," ",s.jsx("strong",{children:l.symbol}),l.assignment&&s.jsx("div",{className:"faint mono",children:l.assignment})]}),d&&s.jsx("button",{type:"button",className:"chip mono",onClick:()=>r(d),title:"go to first location",children:d})]}),s.jsxs("td",{children:[l.status,l.confidence&&s.jsx("div",{children:s.jsx(ze,{n:l.confidence})})]}),s.jsx("td",{children:s.jsx(le,{n:l.readers.length+l.readersMore})}),s.jsx("td",{children:l.verdict})]}),i&&s.jsx("tr",{children:s.jsx("td",{colSpan:4,children:s.jsx(x1,{row:l})})})]})}function b1({sid:l}){const i=de(v=>v.addr),u=de(v=>v.go),r=gt("branches",`/s/${encodeURIComponent(l)}/branches`);if(r.state!=="ok")return null;const d=i?ho(i):"",h=i?i.slice(d.length):null,f=d&&!d.startsWith("@")?d.slice(0,-1):"main";return s.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},"aria-label":"branches",children:r.env.data.branches.map(v=>s.jsxs("button",{type:"button",className:`chip${v.name===f?" selected-row":""}`,"aria-pressed":v.name===f,title:`head ${v.head}${v.base?`, forked from ${v.base}`:""}`,disabled:!h,onClick:()=>h&&u(v.name==="main"?h:`${v.name}:${h}`),children:[v.name," ",s.jsx(le,{n:v.cuts,unit:"cuts"})]},v.name))})}function j1(l){const i=getComputedStyle(l),u=(r,d)=>i.getPropertyValue(r).trim()||d;return{ink:u("--ink","#222"),faint:u("--ink-3","#999"),cell:u("--cell","#333"),cursor:u("--cursor","#000"),symbol:u("--role-symbol","#2f6fb3"),bg:u("--panel","#fff")}}function S1(l,i,u,r){var y,p;const d=Math.floor((u-l.left)/l.cw)+i.win.x0,h=Math.floor((r-l.top)/l.ch)+i.win.y0;if(u<l.left||r<l.top||d>=i.win.x1||h>=i.win.y1)return null;const f=((y=i.axes[0])==null?void 0:y.ticks.length)??0,v=((p=i.axes[1])==null?void 0:p.ticks.length)??0;return d<f&&h<v?{x:d,y:h}:null}function N1(l,i,u,r,d,h=null){var j;const{win:f}=i,v=i.axes[1],y=Math.min(f.x1,((j=i.axes[0])==null?void 0:j.ticks.length)??0),p=Math.min(f.y1,(v==null?void 0:v.ticks.length)??0);l.clearRect(0,0,l.canvas.width,l.canvas.height),l.font="11px ui-monospace, Menlo, monospace",l.textBaseline="middle",l.fillStyle=r.faint;for(let M=f.y0;M<p;M++){const k=v==null?void 0:v.ticks[M],G=u.top+(M-f.y0+.5)*u.ch,q=!!k&&fg(k);q&&(l.beginPath(),l.arc(7,G,2.6,0,Math.PI*2),l.strokeStyle=r.faint,l.stroke()),l.fillText((k==null?void 0:k.label)??"",q?13:4,G)}const x=new Map(i.cells.map(M=>[`${M.x},${M.y}`,M])),g=Eo().domain([0,Math.max(1,ev(i.cells,M=>M.v??0)??1)]).range([.3,1]);for(let M=f.y0;M<p;M++)for(let k=f.x0;k<y;k++){const G=u.left+(k-f.x0)*u.cw,q=u.top+(M-f.y0)*u.ch,X=x.get(`${k},${M}`);if(!X||X.v===null){l.save(),l.setLineDash([2,2]),l.strokeStyle=r.faint,l.globalAlpha=.45,l.strokeRect(G+2.5,q+2.5,u.cw-5,u.ch-5),l.restore();continue}l.fillStyle=r.cell,X.v>0?(l.globalAlpha=g(X.v),l.fillRect(G+2,q+2,u.cw-4,u.ch-4),l.globalAlpha=1):(l.beginPath(),l.arc(G+u.cw/2,q+u.ch/2,1.8,0,Math.PI*2),l.fill()),w1(l,X.glyphs,G,q,u,r)}if(d.x!==null&&d.y!==null){const M=u.left+(d.x-f.x0)*u.cw,k=u.top+(d.y-f.y0)*u.ch;l.strokeStyle=r.cursor,l.lineWidth=2,l.strokeRect(M+1,k+1,u.cw-2,u.ch-2),l.lineWidth=1}if(h){const M=u.left+(h.x-f.x0)*u.cw,k=u.top+(h.y-f.y0)*u.ch;l.save(),l.setLineDash([3,2]),l.strokeStyle=r.ink,l.lineWidth=1.5,l.strokeRect(M+.25,k+.25,u.cw-.5,u.ch-.5),l.restore()}}function w1(l,i,u,r,d,h){i.includes("selected")&&(l.strokeStyle=h.bg,l.strokeRect(u+4.5,r+4.5,d.cw-9,d.ch-9)),i.includes("fork")&&(l.fillStyle=h.ink,l.beginPath(),l.moveTo(u,r),l.lineTo(u+6,r),l.lineTo(u,r+6),l.fill()),i.includes("symbol")&&(l.fillStyle=h.symbol,l.beginPath(),l.arc(u+d.cw-4,r+4,2.6,0,Math.PI*2),l.fill()),i.includes("record")&&(l.fillStyle=h.ink,l.fillRect(u+d.cw-6,r+d.ch-6,4,4))}const Up=18,oo=64,kp=4;function M1(){var y;const l=de(p=>p.sid),i=de(p=>p.addr),u=Be(p=>p.lens),r=Be(p=>p.set),d=Sy(i),h=l?`/s/${encodeURIComponent(l)}`:null,f=gt("timeline",h&&`${h}/timeline`,{lens:u,branch:d}),v=gt("frame",h&&i?`${h}/frame`:null,{addr:i});return l?s.jsxs("section",{className:"panel","aria-label":"timeline",children:[s.jsxs("h2",{children:["Timeline",s.jsx(b1,{sid:l}),s.jsx("span",{style:{flex:1}}),f.state==="ok"&&s.jsx("select",{"aria-label":"lens",value:u,onChange:p=>r({lens:p.target.value}),title:(y=f.env.data.lenses.find(p=>p.id===u))==null?void 0:y.note,children:f.env.data.lenses.map(p=>s.jsxs("option",{value:p.id,title:p.note,children:[p.label,p.hasData?"":" (no data)"]},p.id))})]}),s.jsx("div",{className:"panel-body",children:s.jsx(Qt,{what:"timeline",loaded:f,children:(p,x)=>s.jsxs(s.Fragment,{children:[s.jsx(E1,{block:p,frame:v.state==="ok"?v.env.data:null}),s.jsx(_s,{env:x})]})})})]}):null}function E1({block:l,frame:i}){var ae,Ye;const u=de(I=>I.addr),r=de(I=>I.go),d=L.useRef(null),[h,f]=L.useState(null),[v,y]=L.useState(null),[p,x]=L.useState(!1),[g,j]=l.axes,M=Vn(I=>{var Z;return((Z=I.caps)==null?void 0:Z.layers)??null}),k=Kp(M),G=Math.min(l.win.x1,(g==null?void 0:g.ticks.length)??0)-l.win.x0,q=Math.min(l.win.y1,(j==null?void 0:j.ticks.length)??0)-l.win.y0,X=Math.max(14,Math.min(28,Math.floor(900/Math.max(1,G)))),ce=L.useMemo(()=>({cw:X,ch:Up,left:oo,top:kp}),[X]),z={x:i&&g?i.pos[g.id]??null:null,y:i&&j?i.pos[j.id]??null:null},T=oo+G*X+4,K=kp+q*Up+4;L.useEffect(()=>{const I=d.current,Z=I==null?void 0:I.getContext("2d");if(!I||!Z)return;const O=window.devicePixelRatio||1;I.width=T*O,I.height=K*O,Z.setTransform(O,0,0,O,0,0),N1(Z,l,ce,j1(I),z,p?v:null)});const V=L.useMemo(()=>new Map(l.cells.map(I=>[`${I.x},${I.y}`,I])),[l.cells]),W=h??(p?v:null),Y=W?V.get(`${W.x},${W.y}`):void 0,oe=u?ho(u):"",_e={x:z.x??l.win.x0,y:z.y??l.win.y0},we=I=>{const Z=I.currentTarget.getBoundingClientRect();return S1(ce,l,I.clientX-Z.left,I.clientY-Z.top)};return s.jsxs("div",{children:[s.jsx(_1,{block:l,cw:X,cursorX:z.x,origin:oe,cursorY:z.y}),s.jsx("div",{style:{overflow:"auto"},children:s.jsx("canvas",{ref:d,style:{width:T,height:K,display:"block",cursor:"pointer"},tabIndex:0,role:"application","data-own-keys":"","aria-label":`${(g==null?void 0:g.label)??""} by ${(j==null?void 0:j.label)??""} grid; arrow keys move the focus cell, Enter goes to its address`,onFocus:()=>{x(!0),y(I=>I??_e)},onBlur:()=>x(!1),onKeyDown:I=>{if(I.metaKey||I.ctrlKey||I.altKey)return;const Z=v??_e,Q={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[I.key];if(Q)I.preventDefault(),y({x:Math.min(l.win.x0+G-1,Math.max(l.win.x0,Z.x+Q[0])),y:Math.min(l.win.y0+q-1,Math.max(l.win.y0,Z.y+Q[1]))});else if(I.key==="Enter"||I.key===" "){I.preventDefault();const P=tu(l.axes,Z.x,Z.y,oe);P&&r(P)}},onMouseMove:I=>f(we(I)),onMouseLeave:()=>f(null),onClick:I=>{const Z=we(I),O=Z&&tu(l.axes,Z.x,Z.y,oe);O&&r(O)}})}),((j==null?void 0:j.note)||M)&&s.jsxs("div",{className:"faint","data-testid":"axis-note","data-status":k,children:[k!=="stated"&&s.jsx(Gt,{ev:k==="inferred"?"derived-local":"unresolved"})," ",j==null?void 0:j.label,": ",j==null?void 0:j.note,M&&s.jsxs(s.Fragment,{children:[" ","layers ",s.jsx(ze,{n:M,showReason:!0})]}),k==="inferred"&&" (layer count inferred; hollow ticks are inferred)",k==="unknown"&&" (layer count unknown)"]}),s.jsx("div",{className:"muted",style:{minHeight:20},"aria-live":"polite",children:W?s.jsxs(s.Fragment,{children:[s.jsx("code",{children:tu(l.axes,W.x,W.y,oe)??`${((ae=j==null?void 0:j.ticks[W.y])==null?void 0:ae.label)??""}: ${((Ye=j==null?void 0:j.ticks[W.y])==null?void 0:Ye.detail)??"no address"}`})," ",Y?s.jsxs(s.Fragment,{children:[s.jsx(ze,{n:{v:Y.v,ev:Y.ev,unit:l.unit,proof:null,ptr:null,reason:null,note:null,recorded_authority:null}})," ",Y.glyphs.join(" ")]}):s.jsx(ze,{n:l.fill,showReason:!0})]}):s.jsxs("span",{className:"faint",children:[g==null?void 0:g.label," × ",j==null?void 0:j.label,"; ",s.jsx(le,{n:l.cells.length})," reached cells; empty dashed cells: ",l.fill.reason]})})]})}function _1({block:l,cw:i,cursorX:u,cursorY:r,origin:d}){const h=de(f=>f.go);return l.tokens?s.jsx("div",{style:{display:"flex",marginLeft:oo,height:18},"aria-label":"tokens",children:l.tokens.map(f=>s.jsx("button",{type:"button",className:"row-button mono",style:{width:i,flex:"none",fontSize:9,textAlign:"center",overflow:"hidden",border:f.ev==="unresolved"?"1px dashed var(--ink-3)":void 0,fontWeight:f.x===u?700:400},title:f.id===null?f.reason??"token unresolved":`token id ${String(f.id)}${f.text?` ${JSON.stringify(f.text)}`:""}`,onClick:()=>{var x;const v=((x=l.axes[1])==null?void 0:x.ticks)??[],y=r??v.findIndex(g=>g.addressable),p=tu(l.axes,f.x,Math.max(0,y),d);p&&h(p)},children:f.id===null?" ":s.jsx(le,{n:f.id})},f.x))}):null}function A1(l){const[i,u]=L.useState("connecting");return L.useEffect(()=>{if(!l||typeof WebSocket>"u")return;const r=window.location.protocol==="https:"?"wss":"ws",d=new WebSocket(`${r}://${window.location.host}${Lp}/s/${encodeURIComponent(l)}/events`);return u("connecting"),d.onmessage=h=>{var f;try{const v=JSON.parse(String(h.data));u(v.schema===no.event?"open":"closed"),((f=v.data)==null?void 0:f.type)==="op"&&v.data.data&&It.getState().sid===l&&It.getState().onEvent(v.data.data)}catch{u("closed")}},d.onclose=()=>u("closed"),d.onerror=()=>u("closed"),()=>d.close()},[l]),i}function T1(l){const i=l;return!i||typeof i.tagName!="string"?!1:i.isContentEditable===!0||["INPUT","TEXTAREA","SELECT"].includes(i.tagName)||typeof i.closest=="function"&&i.closest("[data-own-keys]")!==null}function z1(l,i){return l.defaultPrevented||l.isComposing?null:l.key==="Escape"?{kind:"close"}:l.metaKey||l.ctrlKey||T1(l.target)?null:l.altKey?l.key==="ArrowLeft"?{kind:"back"}:l.key==="ArrowRight"?{kind:"forward"}:null:(l.key==="ArrowLeft"||l.key==="ArrowUp")&&(i!=null&&i.prev)?{kind:"go",addr:i.prev}:(l.key==="ArrowRight"||l.key==="ArrowDown")&&(i!=null&&i.next)?{kind:"go",addr:i.next}:l.key==="g"?{kind:"focus-address"}:l.key==="/"?{kind:"command"}:l.key==="?"?{kind:"help"}:null}function C1(l){L.useEffect(()=>{const i=u=>{var f;const r=z1(u,l);if(!r)return;const d=Be.getState(),h=de.getState();switch(r.kind){case"close":d.set({help:!1,command:!1});return;case"back":u.preventDefault(),h.back();return;case"forward":u.preventDefault(),h.forward();return;case"go":u.preventDefault(),h.go(r.addr);return;case"focus-address":u.preventDefault(),(f=document.getElementById($p))==null||f.focus();return;case"command":u.preventDefault(),d.set({command:!0});return;case"help":d.set({help:!d.help});return}};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[l])}function O1(){const l=Vn(T=>T.boot),i=Vn(T=>T.hello),u=Vn(T=>T.sessions),r=Vn(T=>T.refused),d=Vn(T=>T.loadCaps),h=de(T=>T.sid),f=de(T=>T.addr),v=de(T=>T.setSession),y=Be(T=>T.theme),p=Be(T=>T.set),x=A1(h),g=gt("frame",h&&f?`/s/${encodeURIComponent(h)}/frame`:null,{addr:f});C1(g.state==="ok"?g.env.data:null),L.useEffect(()=>{de.getState().syncFromLocation(),l()},[l]);const j=(i==null?void 0:i.live)??null,M=!!j&&h===j,k=u.find(T=>T.id===h),G=f1(M?null:h),q=!M&&k!==void 0&&k.cuts===0,X=((G==null?void 0:G["symbol-table"])??0)>0,ce=((G==null?void 0:G.circuit)??0)>0;L.useEffect(()=>{const T=u[0];if(!h&&j)v(j);else if(!h&&T)v(T.id,T.home);else if(h&&!f){const K=u.find(V=>V.id===h);K!=null&&K.home&&de.getState().go(K.home)}},[h,f,u,v,j]),L.useEffect(()=>{h&&d(h)},[h,d]),L.useEffect(()=>{if(!M)return;p({drawerOpen:!1});const T=bl.subscribe((V,W)=>{V.node!==null&&V.node!==W.node&&p({inspectorOpen:!0})}),K=Be.subscribe((V,W)=>{V.inspect&&V.inspect!==W.inspect&&!V.inspectorOpen&&p({inspectorOpen:!0})});return()=>{T(),K()}},[M,p]);const z=Be(T=>T.inspectorOpen);return L.useEffect(()=>{y==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=y},[y]),s.jsxs("div",{className:M?"app app-live":q?"app app-records":"app",children:[s.jsxs("header",{className:"app-header",children:[s.jsx("strong",{children:"mdb"}),s.jsxs("select",{"aria-label":"session",value:h??"",onChange:T=>{const K=u.find(V=>V.id===T.target.value);T.target.value===j?v(j):K&&v(K.id,K.home)},children:[j&&!u.some(T=>T.id===j)&&s.jsxs("option",{value:j,children:[j," · live"]}),u.map(T=>s.jsxs("option",{value:T.id,children:[T.id," · ",T.id===j?"live":T.model]},T.id))]}),s.jsx(Ey,{}),s.jsxs("span",{className:"chip header-chip",title:j?`live session ${j}`:"server link (recorded project: no live model)",children:[j?"live":i!=null&&i.readOnly?"read-only":"writable"," · ",x]}),j&&!M&&s.jsx("button",{type:"button",onClick:()=>v(j),title:"open the live debugger",children:"live"}),s.jsxs("select",{"aria-label":"theme",value:y,onChange:T=>p({theme:T.target.value}),children:[s.jsx("option",{value:"system",children:"system"}),s.jsx("option",{value:"light",children:"light"}),s.jsx("option",{value:"dark",children:"dark"})]}),s.jsx("button",{type:"button",onClick:()=>p({help:!0}),title:"help (?)",children:"?"})]}),r&&s.jsx("div",{className:"app-banner",children:s.jsx(Kn,{what:"server",refused:r})}),i&&!u.length&&!j?s.jsx("div",{className:"app-banner",children:s.jsx(po,{what:"sessions",reason:"This project holds no sessions."})}):s.jsxs(s.Fragment,{children:[!M&&s.jsx("aside",{className:"app-left",children:s.jsx(pl,{name:"Symbols",children:X&&h?q?s.jsx(Op,{sid:h}):s.jsxs("div",{className:"app-left-stack",children:[s.jsx(Op,{sid:h}),s.jsx(Rp,{})]}):s.jsx(Rp,{})})}),M&&j?s.jsx("main",{className:"app-centre app-centre-live",children:s.jsx(pl,{name:"Live",children:s.jsx(d1,{sid:j})})}):q&&h?s.jsxs("main",{className:"app-centre app-centre-records",children:[s.jsx(Cp,{title:"Timeline",what:"timeline (token row by depth)",session:k}),s.jsx(pl,{name:"Circuits",children:ce?s.jsx(Dp,{sid:h}):s.jsx(Cp,{title:"Graph",what:"recorded-history graph",session:k})})]}):s.jsxs("main",{className:"app-centre",children:[s.jsx(pl,{name:"Timeline",children:s.jsx(M1,{})}),s.jsx(pl,{name:"Graph",children:ce&&h?s.jsxs("div",{className:"app-centre-stack",children:[s.jsx(Im,{}),s.jsx(Dp,{sid:h})]}):s.jsx(Im,{})})]}),s.jsxs("aside",{className:M&&!z?"app-right app-right-closed":"app-right","data-testid":"inspector-aside",children:[M&&s.jsx("button",{type:"button",className:"chip inspector-toggle","aria-expanded":z,"aria-controls":"inspector-panel",onClick:()=>p({inspectorOpen:!z}),title:z?"collapse the Inspector":"open the Inspector",children:z?"Inspector ▸":"◂ Inspector"}),(!M||z)&&s.jsx("div",{id:"inspector-panel",className:"inspector-panel",children:s.jsx(pl,{name:"Inspector",children:s.jsx(qb,{})})})]}),s.jsx("footer",{className:"app-bottom",children:s.jsx(pl,{name:"Records",children:s.jsx(v1,{})})})]}),s.jsx(Ay,{}),s.jsx($y,{})]})}const Rv=document.getElementById("root");if(!Rv)throw new Error("index.html lacks #root");vy.createRoot(Rv).render(s.jsx(L.StrictMode,{children:s.jsx(O1,{})}));