@tea-agent/loop-agent 0.40.0-next.8 → 0.40.0-next.9

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 (78) hide show
  1. package/CHANGELOG.md +2 -1
  2. package/dist/build-stamp.json +3 -3
  3. package/dist/executors/dag-pi-executor.js +3 -0
  4. package/dist/executors/pi-executor.js +4 -2
  5. package/dist/executors/pi-sdk-executor.js +46 -1
  6. package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-BYBmDfPW.js → abnfDiagram-N423BO3Z-Bs-CDAXM.js} +1 -1
  7. package/dist/worker/console/static/assets/{arc-BKMmxpGF.js → arc-CAkA3We3.js} +1 -1
  8. package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-DJpwxr1d.js → architectureDiagram-T3A2C74G-DEmI_zqr.js} +1 -1
  9. package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-BaPj_ZlY.js → blockDiagram-VBNYF7ZC-uDHANebE.js} +1 -1
  10. package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-B8iGmHlm.js → c4Diagram-5PPSVZJV-Bv97b4_B.js} +1 -1
  11. package/dist/worker/console/static/assets/channel-amxUpk7o.js +1 -0
  12. package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-DaxXQayc.js → chunk-2GRJ4B5K-shmQKsFz.js} +1 -1
  13. package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-DqQKGA7q.js → chunk-2Q5K7J3B-BAraNvcN.js} +1 -1
  14. package/dist/worker/console/static/assets/{chunk-5RXB4S5H-CgMKpJBB.js → chunk-5RXB4S5H-BirhxUop.js} +1 -1
  15. package/dist/worker/console/static/assets/{chunk-5VM5RSS4-BpToUlaW.js → chunk-5VM5RSS4-C9LgUJpR.js} +1 -1
  16. package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-BsEWOHxv.js → chunk-6Q2QTUOP-DrU-s-t7.js} +1 -1
  17. package/dist/worker/console/static/assets/{chunk-GF5L2VYU-CKGSCe71.js → chunk-GF5L2VYU-Tx-H_FA2.js} +1 -1
  18. package/dist/worker/console/static/assets/{chunk-JWPE2WC7-Bm1U5299.js → chunk-JWPE2WC7-BjLtNFrR.js} +1 -1
  19. package/dist/worker/console/static/assets/{chunk-KBJHAD2P-BI0ov870.js → chunk-KBJHAD2P-UNLVwSsy.js} +1 -1
  20. package/dist/worker/console/static/assets/{chunk-RYQCIY6F-BmnQo0iJ.js → chunk-RYQCIY6F-CBEUX8XD.js} +1 -1
  21. package/dist/worker/console/static/assets/{chunk-XXDRQBXY-BJBqa6Xc.js → chunk-XXDRQBXY-WTL7IZOq.js} +1 -1
  22. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-bejwBVIz.js +1 -0
  23. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-bejwBVIz.js +1 -0
  24. package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-BuN9-7AR.js → cose-bilkent-JH36ORCC-CkHG6W3s.js} +1 -1
  25. package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-Bw22jc2k.js → cynefin-VYW2F7L2-BRzFqTaL.js} +1 -1
  26. package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-BHnSH8Dr.js → cynefinDiagram-MW4NZA55-2_CFp_i7.js} +1 -1
  27. package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-BoXXIegj.js → dagre-VZM6K2ZE-BJtsmdkE.js} +1 -1
  28. package/dist/worker/console/static/assets/{diagram-7IWD3JNH-CU8qyPhT.js → diagram-7IWD3JNH-DNEFFo6w.js} +1 -1
  29. package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-lrjhF0S8.js → diagram-B4RE2ZJO-B_IWV7eo.js} +1 -1
  30. package/dist/worker/console/static/assets/{diagram-LBJQPF4R-DL0QDEpo.js → diagram-LBJQPF4R-DvvRx2dz.js} +1 -1
  31. package/dist/worker/console/static/assets/{diagram-Q27KOJAE-DxVMJMBH.js → diagram-Q27KOJAE-CsibsWLg.js} +1 -1
  32. package/dist/worker/console/static/assets/{diagram-UB23O5K3-CFg9FzvG.js → diagram-UB23O5K3-les_djBQ.js} +1 -1
  33. package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-CQgP9fTG.js → ebnfDiagram-BXEA7PRR-BEm2n7qJ.js} +1 -1
  34. package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-A5vQXx9U.js → erDiagram-JOGREHBK-BI7vHHVm.js} +1 -1
  35. package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-ytXnLyXD.js → flowDiagram-UKHOOZJN-CUFCERrB.js} +1 -1
  36. package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-CYuksfnS.js → ganttDiagram-PKOTCBZU-wxyLiGWt.js} +1 -1
  37. package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-f_jW3zgU.js → gitGraphDiagram-DS77QQ5N-Bt897K8Z.js} +1 -1
  38. package/dist/worker/console/static/assets/{index-BB6KxwT_.css → index-BHhUOTri.css} +1 -1
  39. package/dist/worker/console/static/assets/index-DqJbO3-p.js +407 -0
  40. package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-C3HLE-xV.js → infoDiagram-6WML65LV-DYNx_IPv.js} +1 -1
  41. package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-DwpgejS6.js → ishikawaDiagram-WSZJBQD7-CzpLNEu6.js} +1 -1
  42. package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-ll0YWX1y.js → journeyDiagram-NVQOT4AX-97f9owNU.js} +1 -1
  43. package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-Hq3rchvU.js → kanban-definition-27J2QSJJ-BxM9hyBn.js} +1 -1
  44. package/dist/worker/console/static/assets/{linear-BaGjJx8z.js → linear-ByuxcHvp.js} +1 -1
  45. package/dist/worker/console/static/assets/{mermaid.core-CKGQHWX_.js → mermaid.core-DwPGvpCv.js} +5 -5
  46. package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-DM1FA6Dr.js → mindmap-definition-FAOFIHXS-DCoqG9RT.js} +1 -1
  47. package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-Xa9fHkE2.js → pegDiagram-VL7TDLO6-BLSBmBMx.js} +1 -1
  48. package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-pCd4PDqJ.js → pieDiagram-7S7Q4E2Y-B0t_0oJW.js} +1 -1
  49. package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-KqjpEBLk.js → quadrantDiagram-CIZ2JOQS-sTzDk7Nt.js} +1 -1
  50. package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-DgvR7LZD.js → railroadDiagram-AXF67PYL-B3jRdATC.js} +1 -1
  51. package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-Bys1UCWA.js → requirementDiagram-LRYGKXZP-D-cTtXEN.js} +1 -1
  52. package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-Ms9npnZt.js → sankeyDiagram-W5VNT64P-B25igJRE.js} +1 -1
  53. package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-DEIWrtQZ.js → sequenceDiagram-SI44F4Z6-jW_lM1_D.js} +1 -1
  54. package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-DELJ0AhZ.js → sizeCapture-X5ZJPWSS-CrzTgsHE.js} +1 -1
  55. package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-BpHt9wKh.js → stateDiagram-OKZ733FA-B01MvlqE.js} +1 -1
  56. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BvFKEtm2.js +1 -0
  57. package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-GKRsBluT.js → swimlanes-SLNWSIFB-YcF12FiU.js} +2 -2
  58. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-DIB2eVg-.js +8 -0
  59. package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-Cwsq1DxL.js → timeline-definition-Z64GVDOM-ClnRcg2s.js} +1 -1
  60. package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-CfaqtKx0.js → vennDiagram-T6HMQDX7-B6gr_z-q.js} +1 -1
  61. package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-BlEUtK_g.js → wardleyDiagram-T6FBY63Y-CvSgguGH.js} +1 -1
  62. package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-CHSRXPvO.js → xychartDiagram-ELKLHX3M-23OtSZCb.js} +1 -1
  63. package/dist/worker/console/static/index.html +2 -2
  64. package/dist/worker/console/static-src/operator-chat/spatial-overlay.js +1 -2
  65. package/dist/workflows/dag/backend-test-writer-completeness.js +7 -12
  66. package/dist/workflows/dag/init-hybrid.js +27 -5
  67. package/dist/workflows/dag/types.js +13 -0
  68. package/docs/templates/agent-dag.schema.json +18 -0
  69. package/docs/templates/backend-test-dag.json +22 -5
  70. package/package.json +1 -1
  71. package/dist/worker/console/static/assets/channel-CrzAa3FA.js +0 -1
  72. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-B7QwCCb4.js +0 -1
  73. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-B7QwCCb4.js +0 -1
  74. package/dist/worker/console/static/assets/index-D_wxbadT.js +0 -407
  75. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BEeSswlv.js +0 -1
  76. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-B2m_wca8.js +0 -8
  77. package/dist/worker/console/static-src/operator-chat/activity-rail-presentation.js +0 -73
  78. package/dist/worker/console/static-src/operator-chat/useActivityRailTransition.js +0 -59
@@ -1,407 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function md(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bf={exports:{}},vl={};var ob;function hw(){if(ob)return vl;ob=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,o){var c=null;if(o!==void 0&&(c=""+o),s.key!==void 0&&(c=""+s.key),"key"in s){o={};for(var d in s)d!=="key"&&(o[d]=s[d])}else o=s;return s=o.ref,{$$typeof:e,type:a,key:c,ref:s!==void 0?s:null,props:o}}return vl.Fragment=t,vl.jsx=n,vl.jsxs=n,vl}var lb;function mw(){return lb||(lb=1,Bf.exports=hw()),Bf.exports}var u=mw(),qf={exports:{}},wt={};var cb;function pw(){if(cb)return wt;cb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function v(G){return G===null||typeof G!="object"?null:(G=x&&G[x]||G["@@iterator"],typeof G=="function"?G:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,N={};function R(G,W,D){this.props=G,this.context=W,this.refs=N,this.updater=D||S}R.prototype.isReactComponent={},R.prototype.setState=function(G,W){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,W,"setState")},R.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function O(){}O.prototype=R.prototype;function _(G,W,D){this.props=G,this.context=W,this.refs=N,this.updater=D||S}var P=_.prototype=new O;P.constructor=_,T(P,R.prototype),P.isPureReactComponent=!0;var U=Array.isArray;function A(){}var z={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function H(G,W,D){var ye=D.ref;return{$$typeof:e,type:G,key:W,ref:ye!==void 0?ye:null,props:D}}function $(G,W){return H(G.type,W,G.props)}function F(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function Y(G){var W={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(D){return W[D]})}var oe=/\/+/g;function ee(G,W){return typeof G=="object"&&G!==null&&G.key!=null?Y(""+G.key):W.toString(36)}function q(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(A,A):(G.status="pending",G.then(function(W){G.status==="pending"&&(G.status="fulfilled",G.value=W)},function(W){G.status==="pending"&&(G.status="rejected",G.reason=W)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function I(G,W,D,ye,se){var V=typeof G;(V==="undefined"||V==="boolean")&&(G=null);var Z=!1;if(G===null)Z=!0;else switch(V){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(G.$$typeof){case e:case t:Z=!0;break;case p:return Z=G._init,I(Z(G._payload),W,D,ye,se)}}if(Z)return se=se(G),Z=ye===""?"."+ee(G,0):ye,U(se)?(D="",Z!=null&&(D=Z.replace(oe,"$&/")+"/"),I(se,W,D,"",function(he){return he})):se!=null&&(F(se)&&(se=$(se,D+(se.key==null||G&&G.key===se.key?"":(""+se.key).replace(oe,"$&/")+"/")+Z)),W.push(se)),1;Z=0;var ne=ye===""?".":ye+":";if(U(G))for(var ue=0;ue<G.length;ue++)ye=G[ue],V=ne+ee(ye,ue),Z+=I(ye,W,D,V,se);else if(ue=v(G),typeof ue=="function")for(G=ue.call(G),ue=0;!(ye=G.next()).done;)ye=ye.value,V=ne+ee(ye,ue++),Z+=I(ye,W,D,V,se);else if(V==="object"){if(typeof G.then=="function")return I(q(G),W,D,ye,se);throw W=String(G),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return Z}function K(G,W,D){if(G==null)return G;var ye=[],se=0;return I(G,ye,"","",function(V){return W.call(D,V,se++)}),ye}function Q(G){if(G._status===-1){var W=G._result;W=W(),W.then(function(D){(G._status===0||G._status===-1)&&(G._status=1,G._result=D)},function(D){(G._status===0||G._status===-1)&&(G._status=2,G._result=D)}),G._status===-1&&(G._status=0,G._result=W)}if(G._status===1)return G._result.default;throw G._result}var pe=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)},j={map:K,forEach:function(G,W,D){K(G,function(){W.apply(this,arguments)},D)},count:function(G){var W=0;return K(G,function(){W++}),W},toArray:function(G){return K(G,function(W){return W})||[]},only:function(G){if(!F(G))throw Error("React.Children.only expected to receive a single React element child.");return G}};return wt.Activity=g,wt.Children=j,wt.Component=R,wt.Fragment=n,wt.Profiler=s,wt.PureComponent=_,wt.StrictMode=a,wt.Suspense=h,wt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,wt.__COMPILER_RUNTIME={__proto__:null,c:function(G){return z.H.useMemoCache(G)}},wt.cache=function(G){return function(){return G.apply(null,arguments)}},wt.cacheSignal=function(){return null},wt.cloneElement=function(G,W,D){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var ye=T({},G.props),se=G.key;if(W!=null)for(V in W.key!==void 0&&(se=""+W.key),W)!X.call(W,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&W.ref===void 0||(ye[V]=W[V]);var V=arguments.length-2;if(V===1)ye.children=D;else if(1<V){for(var Z=Array(V),ne=0;ne<V;ne++)Z[ne]=arguments[ne+2];ye.children=Z}return H(G.type,se,ye)},wt.createContext=function(G){return G={$$typeof:c,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:o,_context:G},G},wt.createElement=function(G,W,D){var ye,se={},V=null;if(W!=null)for(ye in W.key!==void 0&&(V=""+W.key),W)X.call(W,ye)&&ye!=="key"&&ye!=="__self"&&ye!=="__source"&&(se[ye]=W[ye]);var Z=arguments.length-2;if(Z===1)se.children=D;else if(1<Z){for(var ne=Array(Z),ue=0;ue<Z;ue++)ne[ue]=arguments[ue+2];se.children=ne}if(G&&G.defaultProps)for(ye in Z=G.defaultProps,Z)se[ye]===void 0&&(se[ye]=Z[ye]);return H(G,V,se)},wt.createRef=function(){return{current:null}},wt.forwardRef=function(G){return{$$typeof:d,render:G}},wt.isValidElement=F,wt.lazy=function(G){return{$$typeof:p,_payload:{_status:-1,_result:G},_init:Q}},wt.memo=function(G,W){return{$$typeof:m,type:G,compare:W===void 0?null:W}},wt.startTransition=function(G){var W=z.T,D={};z.T=D;try{var ye=G(),se=z.S;se!==null&&se(D,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&ye.then(A,pe)}catch(V){pe(V)}finally{W!==null&&D.types!==null&&(W.types=D.types),z.T=W}},wt.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},wt.use=function(G){return z.H.use(G)},wt.useActionState=function(G,W,D){return z.H.useActionState(G,W,D)},wt.useCallback=function(G,W){return z.H.useCallback(G,W)},wt.useContext=function(G){return z.H.useContext(G)},wt.useDebugValue=function(){},wt.useDeferredValue=function(G,W){return z.H.useDeferredValue(G,W)},wt.useEffect=function(G,W){return z.H.useEffect(G,W)},wt.useEffectEvent=function(G){return z.H.useEffectEvent(G)},wt.useId=function(){return z.H.useId()},wt.useImperativeHandle=function(G,W,D){return z.H.useImperativeHandle(G,W,D)},wt.useInsertionEffect=function(G,W){return z.H.useInsertionEffect(G,W)},wt.useLayoutEffect=function(G,W){return z.H.useLayoutEffect(G,W)},wt.useMemo=function(G,W){return z.H.useMemo(G,W)},wt.useOptimistic=function(G,W){return z.H.useOptimistic(G,W)},wt.useReducer=function(G,W,D){return z.H.useReducer(G,W,D)},wt.useRef=function(G){return z.H.useRef(G)},wt.useState=function(G){return z.H.useState(G)},wt.useSyncExternalStore=function(G,W,D){return z.H.useSyncExternalStore(G,W,D)},wt.useTransition=function(){return z.H.useTransition()},wt.version="19.2.8",wt}var ub;function M1(){return ub||(ub=1,qf.exports=pw()),qf.exports}var w=M1();const nt=md(w);var Hf={exports:{}},yl={},Uf={exports:{}},Ff={};var db;function gw(){return db||(db=1,(function(e){function t(I,K){var Q=I.length;I.push(K);e:for(;0<Q;){var pe=Q-1>>>1,j=I[pe];if(0<s(j,K))I[pe]=K,I[Q]=j,Q=pe;else break e}}function n(I){return I.length===0?null:I[0]}function a(I){if(I.length===0)return null;var K=I[0],Q=I.pop();if(Q!==K){I[0]=Q;e:for(var pe=0,j=I.length,G=j>>>1;pe<G;){var W=2*(pe+1)-1,D=I[W],ye=W+1,se=I[ye];if(0>s(D,Q))ye<j&&0>s(se,D)?(I[pe]=se,I[ye]=Q,pe=ye):(I[pe]=D,I[W]=Q,pe=W);else if(ye<j&&0>s(se,Q))I[pe]=se,I[ye]=Q,pe=ye;else break e}}return K}function s(I,K){var Q=I.sortIndex-K.sortIndex;return Q!==0?Q:I.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],m=[],p=1,g=null,x=3,v=!1,S=!1,T=!1,N=!1,R=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function P(I){for(var K=n(m);K!==null;){if(K.callback===null)a(m);else if(K.startTime<=I)a(m),K.sortIndex=K.expirationTime,t(h,K);else break;K=n(m)}}function U(I){if(T=!1,P(I),!S)if(n(h)!==null)S=!0,A||(A=!0,Y());else{var K=n(m);K!==null&&q(U,K.startTime-I)}}var A=!1,z=-1,X=5,H=-1;function $(){return N?!0:!(e.unstable_now()-H<X)}function F(){if(N=!1,A){var I=e.unstable_now();H=I;var K=!0;try{e:{S=!1,T&&(T=!1,O(z),z=-1),v=!0;var Q=x;try{t:{for(P(I),g=n(h);g!==null&&!(g.expirationTime>I&&$());){var pe=g.callback;if(typeof pe=="function"){g.callback=null,x=g.priorityLevel;var j=pe(g.expirationTime<=I);if(I=e.unstable_now(),typeof j=="function"){g.callback=j,P(I),K=!0;break t}g===n(h)&&a(h),P(I)}else a(h);g=n(h)}if(g!==null)K=!0;else{var G=n(m);G!==null&&q(U,G.startTime-I),K=!1}}break e}finally{g=null,x=Q,v=!1}K=void 0}}finally{K?Y():A=!1}}}var Y;if(typeof _=="function")Y=function(){_(F)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,ee=oe.port2;oe.port1.onmessage=F,Y=function(){ee.postMessage(null)}}else Y=function(){R(F,0)};function q(I,K){z=R(function(){I(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(I){switch(x){case 1:case 2:case 3:var K=3;break;default:K=x}var Q=x;x=K;try{return I()}finally{x=Q}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(I,K){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var Q=x;x=I;try{return K()}finally{x=Q}},e.unstable_scheduleCallback=function(I,K,Q){var pe=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?pe+Q:pe):Q=pe,I){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Q+j,I={id:p++,callback:K,priorityLevel:I,startTime:Q,expirationTime:j,sortIndex:-1},Q>pe?(I.sortIndex=Q,t(m,I),n(h)===null&&I===n(m)&&(T?(O(z),z=-1):T=!0,q(U,Q-pe))):(I.sortIndex=j,t(h,I),S||v||(S=!0,A||(A=!0,Y()))),I},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(I){var K=x;return function(){var Q=x;x=K;try{return I.apply(this,arguments)}finally{x=Q}}}})(Ff)),Ff}var fb;function bw(){return fb||(fb=1,Uf.exports=gw()),Uf.exports}var $f={exports:{}},or={};var hb;function vw(){if(hb)return or;hb=1;var e=M1();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,m,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:h,containerInfo:m,implementation:p}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return or.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,or.createPortal=function(h,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return o(h,m,null,p)},or.flushSync=function(h){var m=c.T,p=a.p;try{if(c.T=null,a.p=2,h)return h()}finally{c.T=m,a.p=p,a.d.f()}},or.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},or.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},or.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var p=m.as,g=d(p,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:v}):p==="script"&&a.d.X(h,{crossOrigin:g,integrity:x,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},or.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=d(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},or.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,g=d(p,m.crossOrigin);a.d.L(h,p,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},or.preloadModule=function(h,m){if(typeof h=="string")if(m){var p=d(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},or.requestFormReset=function(h){a.d.r(h)},or.unstable_batchedUpdates=function(h,m){return h(m)},or.useFormState=function(h,m,p){return c.H.useFormState(h,m,p)},or.useFormStatus=function(){return c.H.useHostTransitionStatus()},or.version="19.2.8",or}var mb;function P3(){if(mb)return $f.exports;mb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$f.exports=vw(),$f.exports}var pb;function yw(){if(pb)return yl;pb=1;var e=bw(),t=M1(),n=P3();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function d(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(o(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var l=r,f=i;;){var b=l.return;if(b===null)break;var y=b.alternate;if(y===null){if(f=b.return,f!==null){l=f;continue}break}if(b.child===y.child){for(y=b.child;y;){if(y===l)return h(b),r;if(y===f)return h(b),i;y=y.sibling}throw Error(a(188))}if(l.return!==f.return)l=b,f=y;else{for(var C=!1,L=b.child;L;){if(L===l){C=!0,l=b,f=y;break}if(L===f){C=!0,f=b,l=y;break}L=L.sibling}if(!C){for(L=y.child;L;){if(L===l){C=!0,l=y,f=b;break}if(L===f){C=!0,f=y,l=b;break}L=L.sibling}if(!C)throw Error(a(189))}}if(l.alternate!==f)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:i}function p(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=p(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function Y(r){return r===null||typeof r!="object"?null:(r=F&&r[F]||r["@@iterator"],typeof r=="function"?r:null)}var oe=Symbol.for("react.client.reference");function ee(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===oe?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case T:return"Fragment";case R:return"Profiler";case N:return"StrictMode";case U:return"Suspense";case A:return"SuspenseList";case H:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case _:return r.displayName||"Context";case O:return(r._context.displayName||"Context")+".Consumer";case P:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case z:return i=r.displayName||null,i!==null?i:ee(r.type)||"Memo";case X:i=r._payload,r=r._init;try{return ee(r(i))}catch{}}return null}var q=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},pe=[],j=-1;function G(r){return{current:r}}function W(r){0>j||(r.current=pe[j],pe[j]=null,j--)}function D(r,i){j++,pe[j]=r.current,r.current=i}var ye=G(null),se=G(null),V=G(null),Z=G(null);function ne(r,i){switch(D(V,i),D(se,r),D(ye,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?I2(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=I2(i),r=_2(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}W(ye),D(ye,r)}function ue(){W(ye),W(se),W(V)}function he(r){r.memoizedState!==null&&D(Z,r);var i=ye.current,l=_2(i,r.type);i!==l&&(D(se,r),D(ye,l))}function Re(r){se.current===r&&(W(ye),W(se)),Z.current===r&&(W(Z),ml._currentValue=Q)}var ze,Ke;function ft(r){if(ze===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);ze=i&&i[1]||"",Ke=-1<l.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ze+r+Ke}var gt=!1;function Rt(r,i){if(!r||gt)return"";gt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(xe){var ve=xe}Reflect.construct(r,[],Ce)}else{try{Ce.call()}catch(xe){ve=xe}r.call(Ce.prototype)}}else{try{throw Error()}catch(xe){ve=xe}(Ce=r())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(xe){if(xe&&ve&&typeof xe.stack=="string")return[xe.stack,ve.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=f.DetermineComponentFrameRoot(),C=y[0],L=y[1];if(C&&L){var ie=C.split(`
4
- `),be=L.split(`
5
- `);for(b=f=0;f<ie.length&&!ie[f].includes("DetermineComponentFrameRoot");)f++;for(;b<be.length&&!be[b].includes("DetermineComponentFrameRoot");)b++;if(f===ie.length||b===be.length)for(f=ie.length-1,b=be.length-1;1<=f&&0<=b&&ie[f]!==be[b];)b--;for(;1<=f&&0<=b;f--,b--)if(ie[f]!==be[b]){if(f!==1||b!==1)do if(f--,b--,0>b||ie[f]!==be[b]){var Se=`
6
- `+ie[f].replace(" at new "," at ");return r.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",r.displayName)),Se}while(1<=f&&0<=b);break}}}finally{gt=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?ft(l):""}function Bt(r,i){switch(r.tag){case 26:case 27:case 5:return ft(r.type);case 16:return ft("Lazy");case 13:return r.child!==i&&i!==null?ft("Suspense Fallback"):ft("Suspense");case 19:return ft("SuspenseList");case 0:case 15:return Rt(r.type,!1);case 11:return Rt(r.type.render,!1);case 1:return Rt(r.type,!0);case 31:return ft("Activity");default:return""}}function rt(r){try{var i="",l=null;do i+=Bt(r,l),l=r,r=r.return;while(r);return i}catch(f){return`
7
- Error generating stack: `+f.message+`
8
- `+f.stack}}var Mt=Object.prototype.hasOwnProperty,mt=e.unstable_scheduleCallback,qt=e.unstable_cancelCallback,Be=e.unstable_shouldYield,Qe=e.unstable_requestPaint,Ue=e.unstable_now,st=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,fe=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,we=e.unstable_LowPriority,Fe=e.unstable_IdlePriority,ct=e.log,Ie=e.unstable_setDisableYieldValue,Pt=null,bt=null;function _t(r){if(typeof ct=="function"&&Ie(r),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Pt,r)}catch{}}var Et=Math.clz32?Math.clz32:it,$n=Math.log,en=Math.LN2;function it(r){return r>>>=0,r===0?32:31-($n(r)/en|0)|0}var We=256,vt=262144,ot=4194304;function Yt(r){var i=r&42;if(i!==0)return i;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ae(r,i,l){var f=r.pendingLanes;if(f===0)return 0;var b=0,y=r.suspendedLanes,C=r.pingedLanes;r=r.warmLanes;var L=f&134217727;return L!==0?(f=L&~y,f!==0?b=Yt(f):(C&=L,C!==0?b=Yt(C):l||(l=L&~r,l!==0&&(b=Yt(l))))):(L=f&~y,L!==0?b=Yt(L):C!==0?b=Yt(C):l||(l=f&~r,l!==0&&(b=Yt(l)))),b===0?0:i!==0&&i!==b&&(i&y)===0&&(y=b&-b,l=i&-i,y>=l||y===32&&(l&4194048)!==0)?i:b}function ke(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Ne(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Je(){var r=ot;return ot<<=1,(ot&62914560)===0&&(ot=4194304),r}function kt(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function Tt(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function De(r,i,l,f,b,y){var C=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var L=r.entanglements,ie=r.expirationTimes,be=r.hiddenUpdates;for(l=C&~l;0<l;){var Se=31-Et(l),Ce=1<<Se;L[Se]=0,ie[Se]=-1;var ve=be[Se];if(ve!==null)for(be[Se]=null,Se=0;Se<ve.length;Se++){var xe=ve[Se];xe!==null&&(xe.lane&=-536870913)}l&=~Ce}f!==0&&Pe(r,f,0),y!==0&&b===0&&r.tag!==0&&(r.suspendedLanes|=y&~(C&~i))}function Pe(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var f=31-Et(i);r.entangledLanes|=i,r.entanglements[f]=r.entanglements[f]|1073741824|l&261930}function ut(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var f=31-Et(l),b=1<<f;b&i|r[f]&i&&(r[f]|=i),l&=~b}}function xn(r,i){var l=i&-i;return l=(l&42)!==0?1:fn(l),(l&(r.suspendedLanes|i))!==0?0:l}function fn(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function oa(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ga(){var r=K.p;return r!==0?r:(r=window.event,r===void 0?32:eb(r.type))}function yr(r,i){var l=K.p;try{return K.p=r,i()}finally{K.p=l}}var dr=Math.random().toString(36).slice(2),Wt="__reactFiber$"+dr,Tn="__reactProps$"+dr,Kr="__reactContainer$"+dr,ba="__reactEvents$"+dr,ui="__reactListeners$"+dr,di="__reactHandles$"+dr,Ms="__reactResources$"+dr,Oa="__reactMarker$"+dr;function Da(r){delete r[Wt],delete r[Tn],delete r[ba],delete r[ui],delete r[di]}function Xn(r){var i=r[Wt];if(i)return i;for(var l=r.parentNode;l;){if(i=l[Kr]||l[Wt]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=B2(r);r!==null;){if(l=r[Wt])return l;r=B2(r)}return i}r=l,l=r.parentNode}return null}function la(r){if(r=r[Wt]||r[Kr]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function va(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function ca(r){var i=r[Ms];return i||(i=r[Ms]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function wn(r){r[Oa]=!0}var Os=new Set,Mr={};function Yr(r,i){Me(r,i),Me(r+"Capture",i)}function Me(r,i){for(Mr[r]=i,r=0;r<i.length;r++)Os.add(i[r])}var et=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]*$"),Nt={},Gt={};function hn(r){return Mt.call(Gt,r)?!0:Mt.call(Nt,r)?!1:et.test(r)?Gt[r]=!0:(Nt[r]=!0,!1)}function Pn(r,i,l){if(hn(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function ir(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function Qn(r,i,l,f){if(f===null)r.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+f)}}function J(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Te(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Dt(r,i,l){var f=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,y=f.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return b.call(this)},set:function(C){l=""+C,y.call(this,C)}}),Object.defineProperty(r,i,{enumerable:f.enumerable}),{getValue:function(){return l},setValue:function(C){l=""+C},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Jt(r){if(!r._valueTracker){var i=Te(r)?"checked":"value";r._valueTracker=Dt(r,i,""+r[i])}}function fr(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),f="";return r&&(f=Te(r)?r.checked?"true":"false":r.value),r=f,r!==l?(i.setValue(r),!0):!1}function Wn(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var sr=/[\n"\\]/g;function gn(r){return r.replace(sr,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Or(r,i,l,f,b,y,C,L){r.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?r.type=C:r.removeAttribute("type"),i!=null?C==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+J(i)):r.value!==""+J(i)&&(r.value=""+J(i)):C!=="submit"&&C!=="reset"||r.removeAttribute("value"),i!=null?ua(r,C,J(i)):l!=null?ua(r,C,J(l)):f!=null&&r.removeAttribute("value"),b==null&&y!=null&&(r.defaultChecked=!!y),b!=null&&(r.checked=b&&typeof b!="function"&&typeof b!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?r.name=""+J(L):r.removeAttribute("name")}function Jn(r,i,l,f,b,y,C,L){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){Jt(r);return}l=l!=null?""+J(l):"",i=i!=null?""+J(i):l,L||i===r.value||(r.value=i),r.defaultValue=i}f=f??b,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=L?r.checked:!!f,r.defaultChecked=!!f,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(r.name=C),Jt(r)}function ua(r,i,l){i==="number"&&Wn(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function er(r,i,l,f){if(r=r.options,i){i={};for(var b=0;b<l.length;b++)i["$"+l[b]]=!0;for(l=0;l<r.length;l++)b=i.hasOwnProperty("$"+r[l].value),r[l].selected!==b&&(r[l].selected=b),b&&f&&(r[l].defaultSelected=!0)}else{for(l=""+J(l),i=null,b=0;b<r.length;b++){if(r[b].value===l){r[b].selected=!0,f&&(r[b].defaultSelected=!0);return}i!==null||r[b].disabled||(i=r[b])}i!==null&&(i.selected=!0)}}function sc(r,i,l){if(i!=null&&(i=""+J(i),i!==r.value&&(r.value=i),l==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=l!=null?""+J(l):""}function Ds(r,i,l,f){if(i==null){if(f!=null){if(l!=null)throw Error(a(92));if(q(f)){if(1<f.length)throw Error(a(93));f=f[0]}l=f}l==null&&(l=""),i=l}l=J(i),r.defaultValue=l,f=r.textContent,f===l&&f!==""&&f!==null&&(r.value=f),Jt(r)}function ht(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var oc=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 On(r,i,l){var f=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?f?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":f?r.setProperty(i,l):typeof l!="number"||l===0||oc.has(i)?i==="float"?r.cssFloat=l:r[i]=(""+l).trim():r[i]=l+"px"}function tn(r,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,l!=null){for(var f in l)!l.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?r.setProperty(f,""):f==="float"?r.cssFloat="":r[f]="");for(var b in i)f=i[b],i.hasOwnProperty(b)&&l[b]!==f&&On(r,b,f)}else for(var y in i)i.hasOwnProperty(y)&&On(r,y,i[y])}function fi(r){if(r.indexOf("-")===-1)return!1;switch(r){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 ja=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"]]),Ao=/^[\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 hi(r){return Ao.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function $e(){}var Ze=null;function St(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ht=null,kn=null;function Wr(r){var i=la(r);if(i&&(r=i.stateNode)){var l=r[Tn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Or(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+gn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var f=l[i];if(f!==r&&f.form===r.form){var b=f[Tn]||null;if(!b)throw Error(a(90));Or(f,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(i=0;i<l.length;i++)f=l[i],f.form===r.form&&fr(f)}break e;case"textarea":sc(r,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&er(r,!!l.multiple,i,!1)}}}var Io=!1;function lc(r,i,l){if(Io)return r(i,l);Io=!0;try{var f=r(i);return f}finally{if(Io=!1,(Ht!==null||kn!==null)&&(Wc(),Ht&&(i=Ht,r=kn,kn=Ht=null,Wr(i),r)))for(i=0;i<r.length;i++)Wr(r[i])}}function _o(r,i){var l=r.stateNode;if(l===null)return null;var f=l[Tn]||null;if(f===null)return null;l=f[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var La=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zd=!1;if(La)try{var Mo={};Object.defineProperty(Mo,"passive",{get:function(){zd=!0}}),window.addEventListener("test",Mo,Mo),window.removeEventListener("test",Mo,Mo)}catch{zd=!1}var mi=null,Bd=null,cc=null;function _p(){if(cc)return cc;var r,i=Bd,l=i.length,f,b="value"in mi?mi.value:mi.textContent,y=b.length;for(r=0;r<l&&i[r]===b[r];r++);var C=l-r;for(f=1;f<=C&&i[l-f]===b[y-f];f++);return cc=b.slice(r,1<f?1-f:void 0)}function uc(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function dc(){return!0}function Mp(){return!1}function xr(r){function i(l,f,b,y,C){this._reactName=l,this._targetInst=b,this.type=f,this.nativeEvent=y,this.target=C,this.currentTarget=null;for(var L in r)r.hasOwnProperty(L)&&(l=r[L],this[L]=l?l(y):y[L]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?dc:Mp,this.isPropagationStopped=Mp,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=dc)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=dc)},persist:function(){},isPersistent:dc}),i}var Qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fc=xr(Qi),Oo=g({},Qi,{view:0,detail:0}),dx=xr(Oo),qd,Hd,Do,hc=g({},Oo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fd,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Do&&(Do&&r.type==="mousemove"?(qd=r.screenX-Do.screenX,Hd=r.screenY-Do.screenY):Hd=qd=0,Do=r),qd)},movementY:function(r){return"movementY"in r?r.movementY:Hd}}),Op=xr(hc),fx=g({},hc,{dataTransfer:0}),hx=xr(fx),mx=g({},Oo,{relatedTarget:0}),Ud=xr(mx),px=g({},Qi,{animationName:0,elapsedTime:0,pseudoElement:0}),gx=xr(px),bx=g({},Qi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),vx=xr(bx),yx=g({},Qi,{data:0}),Dp=xr(yx),xx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wx={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"},kx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sx(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=kx[r])?!!i[r]:!1}function Fd(){return Sx}var Ex=g({},Oo,{key:function(r){if(r.key){var i=xx[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=uc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?wx[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fd,charCode:function(r){return r.type==="keypress"?uc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?uc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Tx=xr(Ex),Cx=g({},hc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jp=xr(Cx),Rx=g({},Oo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fd}),Nx=xr(Rx),Ax=g({},Qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ix=xr(Ax),_x=g({},hc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Mx=xr(_x),Ox=g({},Qi,{newState:0,oldState:0}),Dx=xr(Ox),jx=[9,13,27,32],$d=La&&"CompositionEvent"in window,jo=null;La&&"documentMode"in document&&(jo=document.documentMode);var Lx=La&&"TextEvent"in window&&!jo,Lp=La&&(!$d||jo&&8<jo&&11>=jo),zp=" ",Bp=!1;function qp(r,i){switch(r){case"keyup":return jx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var js=!1;function zx(r,i){switch(r){case"compositionend":return Hp(i);case"keypress":return i.which!==32?null:(Bp=!0,zp);case"textInput":return r=i.data,r===zp&&Bp?null:r;default:return null}}function Bx(r,i){if(js)return r==="compositionend"||!$d&&qp(r,i)?(r=_p(),cc=Bd=mi=null,js=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Lp&&i.locale!=="ko"?null:i.data;default:return null}}var qx={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 Up(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!qx[r.type]:i==="textarea"}function Fp(r,i,l,f){Ht?kn?kn.push(f):kn=[f]:Ht=f,i=nu(i,"onChange"),0<i.length&&(l=new fc("onChange","change",null,l,f),r.push({event:l,listeners:i}))}var Lo=null,zo=null;function Hx(r){E2(r,0)}function mc(r){var i=va(r);if(fr(i))return r}function $p(r,i){if(r==="change")return i}var Pp=!1;if(La){var Pd;if(La){var Gd="oninput"in document;if(!Gd){var Gp=document.createElement("div");Gp.setAttribute("oninput","return;"),Gd=typeof Gp.oninput=="function"}Pd=Gd}else Pd=!1;Pp=Pd&&(!document.documentMode||9<document.documentMode)}function Vp(){Lo&&(Lo.detachEvent("onpropertychange",Kp),zo=Lo=null)}function Kp(r){if(r.propertyName==="value"&&mc(zo)){var i=[];Fp(i,zo,r,St(r)),lc(Hx,i)}}function Ux(r,i,l){r==="focusin"?(Vp(),Lo=i,zo=l,Lo.attachEvent("onpropertychange",Kp)):r==="focusout"&&Vp()}function Fx(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return mc(zo)}function $x(r,i){if(r==="click")return mc(i)}function Px(r,i){if(r==="input"||r==="change")return mc(i)}function Gx(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Dr=typeof Object.is=="function"?Object.is:Gx;function Bo(r,i){if(Dr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),f=Object.keys(i);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var b=l[f];if(!Mt.call(i,b)||!Dr(r[b],i[b]))return!1}return!0}function Yp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Wp(r,i){var l=Yp(r);r=0;for(var f;l;){if(l.nodeType===3){if(f=r+l.textContent.length,r<=i&&f>=i)return{node:l,offset:i-r};r=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Yp(l)}}function Zp(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Zp(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Xp(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Wn(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=Wn(r.document)}return i}function Vd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var Vx=La&&"documentMode"in document&&11>=document.documentMode,Ls=null,Kd=null,qo=null,Yd=!1;function Qp(r,i,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Yd||Ls==null||Ls!==Wn(f)||(f=Ls,"selectionStart"in f&&Vd(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),qo&&Bo(qo,f)||(qo=f,f=nu(Kd,"onSelect"),0<f.length&&(i=new fc("onSelect","select",null,i,l),r.push({event:i,listeners:f}),i.target=Ls)))}function Ji(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var zs={animationend:Ji("Animation","AnimationEnd"),animationiteration:Ji("Animation","AnimationIteration"),animationstart:Ji("Animation","AnimationStart"),transitionrun:Ji("Transition","TransitionRun"),transitionstart:Ji("Transition","TransitionStart"),transitioncancel:Ji("Transition","TransitionCancel"),transitionend:Ji("Transition","TransitionEnd")},Wd={},Jp={};La&&(Jp=document.createElement("div").style,"AnimationEvent"in window||(delete zs.animationend.animation,delete zs.animationiteration.animation,delete zs.animationstart.animation),"TransitionEvent"in window||delete zs.transitionend.transition);function es(r){if(Wd[r])return Wd[r];if(!zs[r])return r;var i=zs[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Jp)return Wd[r]=i[l];return r}var eg=es("animationend"),tg=es("animationiteration"),ng=es("animationstart"),Kx=es("transitionrun"),Yx=es("transitionstart"),Wx=es("transitioncancel"),rg=es("transitionend"),ag=new Map,Zd="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(" ");Zd.push("scrollEnd");function da(r,i){ag.set(r,i),Yr(i,[r])}var pc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Zr=[],Bs=0,Xd=0;function gc(){for(var r=Bs,i=Xd=Bs=0;i<r;){var l=Zr[i];Zr[i++]=null;var f=Zr[i];Zr[i++]=null;var b=Zr[i];Zr[i++]=null;var y=Zr[i];if(Zr[i++]=null,f!==null&&b!==null){var C=f.pending;C===null?b.next=b:(b.next=C.next,C.next=b),f.pending=b}y!==0&&ig(l,b,y)}}function bc(r,i,l,f){Zr[Bs++]=r,Zr[Bs++]=i,Zr[Bs++]=l,Zr[Bs++]=f,Xd|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function Qd(r,i,l,f){return bc(r,i,l,f),vc(r)}function ts(r,i){return bc(r,null,null,i),vc(r)}function ig(r,i,l){r.lanes|=l;var f=r.alternate;f!==null&&(f.lanes|=l);for(var b=!1,y=r.return;y!==null;)y.childLanes|=l,f=y.alternate,f!==null&&(f.childLanes|=l),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(b=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,b&&i!==null&&(b=31-Et(l),r=y.hiddenUpdates,f=r[b],f===null?r[b]=[i]:f.push(i),i.lane=l|536870912),y):null}function vc(r){if(50<ol)throw ol=0,lf=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var qs={};function Zx(r,i,l,f){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(r,i,l,f){return new Zx(r,i,l,f)}function Jd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function za(r,i){var l=r.alternate;return l===null?(l=jr(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function sg(r,i){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,i=l.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function yc(r,i,l,f,b,y){var C=0;if(f=r,typeof r=="function")Jd(r)&&(C=1);else if(typeof r=="string")C=tw(r,l,ye.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case H:return r=jr(31,l,i,b),r.elementType=H,r.lanes=y,r;case T:return ns(l.children,b,y,i);case N:C=8,b|=24;break;case R:return r=jr(12,l,i,b|2),r.elementType=R,r.lanes=y,r;case U:return r=jr(13,l,i,b),r.elementType=U,r.lanes=y,r;case A:return r=jr(19,l,i,b),r.elementType=A,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case _:C=10;break e;case O:C=9;break e;case P:C=11;break e;case z:C=14;break e;case X:C=16,f=null;break e}C=29,l=Error(a(130,r===null?"null":typeof r,"")),f=null}return i=jr(C,l,i,b),i.elementType=r,i.type=f,i.lanes=y,i}function ns(r,i,l,f){return r=jr(7,r,f,i),r.lanes=l,r}function e0(r,i,l){return r=jr(6,r,null,i),r.lanes=l,r}function og(r){var i=jr(18,null,null,0);return i.stateNode=r,i}function t0(r,i,l){return i=jr(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var lg=new WeakMap;function Xr(r,i){if(typeof r=="object"&&r!==null){var l=lg.get(r);return l!==void 0?l:(i={value:r,source:i,stack:rt(i)},lg.set(r,i),i)}return{value:r,source:i,stack:rt(i)}}var Hs=[],Us=0,xc=null,Ho=0,Qr=[],Jr=0,pi=null,ya=1,xa="";function Ba(r,i){Hs[Us++]=Ho,Hs[Us++]=xc,xc=r,Ho=i}function cg(r,i,l){Qr[Jr++]=ya,Qr[Jr++]=xa,Qr[Jr++]=pi,pi=r;var f=ya;r=xa;var b=32-Et(f)-1;f&=~(1<<b),l+=1;var y=32-Et(i)+b;if(30<y){var C=b-b%5;y=(f&(1<<C)-1).toString(32),f>>=C,b-=C,ya=1<<32-Et(i)+b|l<<b|f,xa=y+r}else ya=1<<y|l<<b|f,xa=r}function n0(r){r.return!==null&&(Ba(r,1),cg(r,1,0))}function r0(r){for(;r===xc;)xc=Hs[--Us],Hs[Us]=null,Ho=Hs[--Us],Hs[Us]=null;for(;r===pi;)pi=Qr[--Jr],Qr[Jr]=null,xa=Qr[--Jr],Qr[Jr]=null,ya=Qr[--Jr],Qr[Jr]=null}function ug(r,i){Qr[Jr++]=ya,Qr[Jr++]=xa,Qr[Jr++]=pi,ya=i.id,xa=i.overflow,pi=r}var tr=null,mn=null,$t=!1,gi=null,ea=!1,a0=Error(a(519));function bi(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Uo(Xr(i,r)),a0}function dg(r){var i=r.stateNode,l=r.type,f=r.memoizedProps;switch(i[Wt]=r,i[Tn]=f,l){case"dialog":Lt("cancel",i),Lt("close",i);break;case"iframe":case"object":case"embed":Lt("load",i);break;case"video":case"audio":for(l=0;l<cl.length;l++)Lt(cl[l],i);break;case"source":Lt("error",i);break;case"img":case"image":case"link":Lt("error",i),Lt("load",i);break;case"details":Lt("toggle",i);break;case"input":Lt("invalid",i),Jn(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Lt("invalid",i);break;case"textarea":Lt("invalid",i),Ds(i,f.value,f.defaultValue,f.children)}l=f.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||f.suppressHydrationWarning===!0||N2(i.textContent,l)?(f.popover!=null&&(Lt("beforetoggle",i),Lt("toggle",i)),f.onScroll!=null&&Lt("scroll",i),f.onScrollEnd!=null&&Lt("scrollend",i),f.onClick!=null&&(i.onclick=$e),i=!0):i=!1,i||bi(r,!0)}function fg(r){for(tr=r.return;tr;)switch(tr.tag){case 5:case 31:case 13:ea=!1;return;case 27:case 3:ea=!0;return;default:tr=tr.return}}function Fs(r){if(r!==tr)return!1;if(!$t)return fg(r),$t=!0,!1;var i=r.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||Sf(r.type,r.memoizedProps)),l=!l),l&&mn&&bi(r),fg(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));mn=z2(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));mn=z2(r)}else i===27?(i=mn,_i(r.type)?(r=Nf,Nf=null,mn=r):mn=i):mn=tr?na(r.stateNode.nextSibling):null;return!0}function rs(){mn=tr=null,$t=!1}function i0(){var r=gi;return r!==null&&(Er===null?Er=r:Er.push.apply(Er,r),gi=null),r}function Uo(r){gi===null?gi=[r]:gi.push(r)}var s0=G(null),as=null,qa=null;function vi(r,i,l){D(s0,i._currentValue),i._currentValue=l}function Ha(r){r._currentValue=s0.current,W(s0)}function o0(r,i,l){for(;r!==null;){var f=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),r===l)break;r=r.return}}function l0(r,i,l,f){var b=r.child;for(b!==null&&(b.return=r);b!==null;){var y=b.dependencies;if(y!==null){var C=b.child;y=y.firstContext;e:for(;y!==null;){var L=y;y=b;for(var ie=0;ie<i.length;ie++)if(L.context===i[ie]){y.lanes|=l,L=y.alternate,L!==null&&(L.lanes|=l),o0(y.return,l,r),f||(C=null);break e}y=L.next}}else if(b.tag===18){if(C=b.return,C===null)throw Error(a(341));C.lanes|=l,y=C.alternate,y!==null&&(y.lanes|=l),o0(C,l,r),C=null}else C=b.child;if(C!==null)C.return=b;else for(C=b;C!==null;){if(C===r){C=null;break}if(b=C.sibling,b!==null){b.return=C.return,C=b;break}C=C.return}b=C}}function $s(r,i,l,f){r=null;for(var b=i,y=!1;b!==null;){if(!y){if((b.flags&524288)!==0)y=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var C=b.alternate;if(C===null)throw Error(a(387));if(C=C.memoizedProps,C!==null){var L=b.type;Dr(b.pendingProps.value,C.value)||(r!==null?r.push(L):r=[L])}}else if(b===Z.current){if(C=b.alternate,C===null)throw Error(a(387));C.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(r!==null?r.push(ml):r=[ml])}b=b.return}r!==null&&l0(i,r,l,f),i.flags|=262144}function wc(r){for(r=r.firstContext;r!==null;){if(!Dr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function is(r){as=r,qa=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function nr(r){return hg(as,r)}function kc(r,i){return as===null&&is(r),hg(r,i)}function hg(r,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},qa===null){if(r===null)throw Error(a(308));qa=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else qa=qa.next=i;return l}var Xx=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,f){r.push(f)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},Qx=e.unstable_scheduleCallback,Jx=e.unstable_NormalPriority,Dn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function c0(){return{controller:new Xx,data:new Map,refCount:0}}function Fo(r){r.refCount--,r.refCount===0&&Qx(Jx,function(){r.controller.abort()})}var $o=null,u0=0,Ps=0,Gs=null;function e8(r,i){if($o===null){var l=$o=[];u0=0,Ps=mf(),Gs={status:"pending",value:void 0,then:function(f){l.push(f)}}}return u0++,i.then(mg,mg),i}function mg(){if(--u0===0&&$o!==null){Gs!==null&&(Gs.status="fulfilled");var r=$o;$o=null,Ps=0,Gs=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function t8(r,i){var l=[],f={status:"pending",value:null,reason:null,then:function(b){l.push(b)}};return r.then(function(){f.status="fulfilled",f.value=i;for(var b=0;b<l.length;b++)(0,l[b])(i)},function(b){for(f.status="rejected",f.reason=b,b=0;b<l.length;b++)(0,l[b])(void 0)}),f}var pg=I.S;I.S=function(r,i){Q4=Ue(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&e8(r,i),pg!==null&&pg(r,i)};var ss=G(null);function d0(){var r=ss.current;return r!==null?r:ln.pooledCache}function Sc(r,i){i===null?D(ss,ss.current):D(ss,i.pool)}function gg(){var r=d0();return r===null?null:{parent:Dn._currentValue,pool:r}}var Vs=Error(a(460)),f0=Error(a(474)),Ec=Error(a(542)),Tc={then:function(){}};function bg(r){return r=r.status,r==="fulfilled"||r==="rejected"}function vg(r,i,l){switch(l=r[l],l===void 0?r.push(i):l!==i&&(i.then($e,$e),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,xg(r),r;default:if(typeof i.status=="string")i.then($e,$e);else{if(r=ln,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(f){if(i.status==="pending"){var b=i;b.status="fulfilled",b.value=f}},function(f){if(i.status==="pending"){var b=i;b.status="rejected",b.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,xg(r),r}throw ls=i,Vs}}function os(r){try{var i=r._init;return i(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ls=l,Vs):l}}var ls=null;function yg(){if(ls===null)throw Error(a(459));var r=ls;return ls=null,r}function xg(r){if(r===Vs||r===Ec)throw Error(a(483))}var Ks=null,Po=0;function Cc(r){var i=Po;return Po+=1,Ks===null&&(Ks=[]),vg(Ks,r,i)}function Go(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Rc(r,i){throw i.$$typeof===x?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function wg(r){function i(de,le){if(r){var ge=de.deletions;ge===null?(de.deletions=[le],de.flags|=16):ge.push(le)}}function l(de,le){if(!r)return null;for(;le!==null;)i(de,le),le=le.sibling;return null}function f(de){for(var le=new Map;de!==null;)de.key!==null?le.set(de.key,de):le.set(de.index,de),de=de.sibling;return le}function b(de,le){return de=za(de,le),de.index=0,de.sibling=null,de}function y(de,le,ge){return de.index=ge,r?(ge=de.alternate,ge!==null?(ge=ge.index,ge<le?(de.flags|=67108866,le):ge):(de.flags|=67108866,le)):(de.flags|=1048576,le)}function C(de){return r&&de.alternate===null&&(de.flags|=67108866),de}function L(de,le,ge,Ee){return le===null||le.tag!==6?(le=e0(ge,de.mode,Ee),le.return=de,le):(le=b(le,ge),le.return=de,le)}function ie(de,le,ge,Ee){var at=ge.type;return at===T?Se(de,le,ge.props.children,Ee,ge.key):le!==null&&(le.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===X&&os(at)===le.type)?(le=b(le,ge.props),Go(le,ge),le.return=de,le):(le=yc(ge.type,ge.key,ge.props,null,de.mode,Ee),Go(le,ge),le.return=de,le)}function be(de,le,ge,Ee){return le===null||le.tag!==4||le.stateNode.containerInfo!==ge.containerInfo||le.stateNode.implementation!==ge.implementation?(le=t0(ge,de.mode,Ee),le.return=de,le):(le=b(le,ge.children||[]),le.return=de,le)}function Se(de,le,ge,Ee,at){return le===null||le.tag!==7?(le=ns(ge,de.mode,Ee,at),le.return=de,le):(le=b(le,ge),le.return=de,le)}function Ce(de,le,ge){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return le=e0(""+le,de.mode,ge),le.return=de,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case v:return ge=yc(le.type,le.key,le.props,null,de.mode,ge),Go(ge,le),ge.return=de,ge;case S:return le=t0(le,de.mode,ge),le.return=de,le;case X:return le=os(le),Ce(de,le,ge)}if(q(le)||Y(le))return le=ns(le,de.mode,ge,null),le.return=de,le;if(typeof le.then=="function")return Ce(de,Cc(le),ge);if(le.$$typeof===_)return Ce(de,kc(de,le),ge);Rc(de,le)}return null}function ve(de,le,ge,Ee){var at=le!==null?le.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return at!==null?null:L(de,le,""+ge,Ee);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case v:return ge.key===at?ie(de,le,ge,Ee):null;case S:return ge.key===at?be(de,le,ge,Ee):null;case X:return ge=os(ge),ve(de,le,ge,Ee)}if(q(ge)||Y(ge))return at!==null?null:Se(de,le,ge,Ee,null);if(typeof ge.then=="function")return ve(de,le,Cc(ge),Ee);if(ge.$$typeof===_)return ve(de,le,kc(de,ge),Ee);Rc(de,ge)}return null}function xe(de,le,ge,Ee,at){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return de=de.get(ge)||null,L(le,de,""+Ee,at);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case v:return de=de.get(Ee.key===null?ge:Ee.key)||null,ie(le,de,Ee,at);case S:return de=de.get(Ee.key===null?ge:Ee.key)||null,be(le,de,Ee,at);case X:return Ee=os(Ee),xe(de,le,ge,Ee,at)}if(q(Ee)||Y(Ee))return de=de.get(ge)||null,Se(le,de,Ee,at,null);if(typeof Ee.then=="function")return xe(de,le,ge,Cc(Ee),at);if(Ee.$$typeof===_)return xe(de,le,ge,kc(le,Ee),at);Rc(le,Ee)}return null}function Ye(de,le,ge,Ee){for(var at=null,Vt=null,Xe=le,At=le=0,Ft=null;Xe!==null&&At<ge.length;At++){Xe.index>At?(Ft=Xe,Xe=null):Ft=Xe.sibling;var Kt=ve(de,Xe,ge[At],Ee);if(Kt===null){Xe===null&&(Xe=Ft);break}r&&Xe&&Kt.alternate===null&&i(de,Xe),le=y(Kt,le,At),Vt===null?at=Kt:Vt.sibling=Kt,Vt=Kt,Xe=Ft}if(At===ge.length)return l(de,Xe),$t&&Ba(de,At),at;if(Xe===null){for(;At<ge.length;At++)Xe=Ce(de,ge[At],Ee),Xe!==null&&(le=y(Xe,le,At),Vt===null?at=Xe:Vt.sibling=Xe,Vt=Xe);return $t&&Ba(de,At),at}for(Xe=f(Xe);At<ge.length;At++)Ft=xe(Xe,de,At,ge[At],Ee),Ft!==null&&(r&&Ft.alternate!==null&&Xe.delete(Ft.key===null?At:Ft.key),le=y(Ft,le,At),Vt===null?at=Ft:Vt.sibling=Ft,Vt=Ft);return r&&Xe.forEach(function(Li){return i(de,Li)}),$t&&Ba(de,At),at}function dt(de,le,ge,Ee){if(ge==null)throw Error(a(151));for(var at=null,Vt=null,Xe=le,At=le=0,Ft=null,Kt=ge.next();Xe!==null&&!Kt.done;At++,Kt=ge.next()){Xe.index>At?(Ft=Xe,Xe=null):Ft=Xe.sibling;var Li=ve(de,Xe,Kt.value,Ee);if(Li===null){Xe===null&&(Xe=Ft);break}r&&Xe&&Li.alternate===null&&i(de,Xe),le=y(Li,le,At),Vt===null?at=Li:Vt.sibling=Li,Vt=Li,Xe=Ft}if(Kt.done)return l(de,Xe),$t&&Ba(de,At),at;if(Xe===null){for(;!Kt.done;At++,Kt=ge.next())Kt=Ce(de,Kt.value,Ee),Kt!==null&&(le=y(Kt,le,At),Vt===null?at=Kt:Vt.sibling=Kt,Vt=Kt);return $t&&Ba(de,At),at}for(Xe=f(Xe);!Kt.done;At++,Kt=ge.next())Kt=xe(Xe,de,At,Kt.value,Ee),Kt!==null&&(r&&Kt.alternate!==null&&Xe.delete(Kt.key===null?At:Kt.key),le=y(Kt,le,At),Vt===null?at=Kt:Vt.sibling=Kt,Vt=Kt);return r&&Xe.forEach(function(fw){return i(de,fw)}),$t&&Ba(de,At),at}function on(de,le,ge,Ee){if(typeof ge=="object"&&ge!==null&&ge.type===T&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case v:e:{for(var at=ge.key;le!==null;){if(le.key===at){if(at=ge.type,at===T){if(le.tag===7){l(de,le.sibling),Ee=b(le,ge.props.children),Ee.return=de,de=Ee;break e}}else if(le.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===X&&os(at)===le.type){l(de,le.sibling),Ee=b(le,ge.props),Go(Ee,ge),Ee.return=de,de=Ee;break e}l(de,le);break}else i(de,le);le=le.sibling}ge.type===T?(Ee=ns(ge.props.children,de.mode,Ee,ge.key),Ee.return=de,de=Ee):(Ee=yc(ge.type,ge.key,ge.props,null,de.mode,Ee),Go(Ee,ge),Ee.return=de,de=Ee)}return C(de);case S:e:{for(at=ge.key;le!==null;){if(le.key===at)if(le.tag===4&&le.stateNode.containerInfo===ge.containerInfo&&le.stateNode.implementation===ge.implementation){l(de,le.sibling),Ee=b(le,ge.children||[]),Ee.return=de,de=Ee;break e}else{l(de,le);break}else i(de,le);le=le.sibling}Ee=t0(ge,de.mode,Ee),Ee.return=de,de=Ee}return C(de);case X:return ge=os(ge),on(de,le,ge,Ee)}if(q(ge))return Ye(de,le,ge,Ee);if(Y(ge)){if(at=Y(ge),typeof at!="function")throw Error(a(150));return ge=at.call(ge),dt(de,le,ge,Ee)}if(typeof ge.then=="function")return on(de,le,Cc(ge),Ee);if(ge.$$typeof===_)return on(de,le,kc(de,ge),Ee);Rc(de,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,le!==null&&le.tag===6?(l(de,le.sibling),Ee=b(le,ge),Ee.return=de,de=Ee):(l(de,le),Ee=e0(ge,de.mode,Ee),Ee.return=de,de=Ee),C(de)):l(de,le)}return function(de,le,ge,Ee){try{Po=0;var at=on(de,le,ge,Ee);return Ks=null,at}catch(Xe){if(Xe===Vs||Xe===Ec)throw Xe;var Vt=jr(29,Xe,null,de.mode);return Vt.lanes=Ee,Vt.return=de,Vt}}}var cs=wg(!0),kg=wg(!1),yi=!1;function h0(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function m0(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function xi(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function wi(r,i,l){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(Zt&2)!==0){var b=f.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),f.pending=i,i=vc(r),ig(r,null,l),i}return bc(r,f,i,l),vc(r)}function Vo(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,ut(r,l)}}function p0(r,i){var l=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var b=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var C={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?b=y=C:y=y.next=C,l=l.next}while(l!==null);y===null?b=y=i:y=y.next=i}else b=y=i;l={baseState:f.baseState,firstBaseUpdate:b,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}var g0=!1;function Ko(){if(g0){var r=Gs;if(r!==null)throw r}}function Yo(r,i,l,f){g0=!1;var b=r.updateQueue;yi=!1;var y=b.firstBaseUpdate,C=b.lastBaseUpdate,L=b.shared.pending;if(L!==null){b.shared.pending=null;var ie=L,be=ie.next;ie.next=null,C===null?y=be:C.next=be,C=ie;var Se=r.alternate;Se!==null&&(Se=Se.updateQueue,L=Se.lastBaseUpdate,L!==C&&(L===null?Se.firstBaseUpdate=be:L.next=be,Se.lastBaseUpdate=ie))}if(y!==null){var Ce=b.baseState;C=0,Se=be=ie=null,L=y;do{var ve=L.lane&-536870913,xe=ve!==L.lane;if(xe?(Ut&ve)===ve:(f&ve)===ve){ve!==0&&ve===Ps&&(g0=!0),Se!==null&&(Se=Se.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Ye=r,dt=L;ve=i;var on=l;switch(dt.tag){case 1:if(Ye=dt.payload,typeof Ye=="function"){Ce=Ye.call(on,Ce,ve);break e}Ce=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=dt.payload,ve=typeof Ye=="function"?Ye.call(on,Ce,ve):Ye,ve==null)break e;Ce=g({},Ce,ve);break e;case 2:yi=!0}}ve=L.callback,ve!==null&&(r.flags|=64,xe&&(r.flags|=8192),xe=b.callbacks,xe===null?b.callbacks=[ve]:xe.push(ve))}else xe={lane:ve,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Se===null?(be=Se=xe,ie=Ce):Se=Se.next=xe,C|=ve;if(L=L.next,L===null){if(L=b.shared.pending,L===null)break;xe=L,L=xe.next,xe.next=null,b.lastBaseUpdate=xe,b.shared.pending=null}}while(!0);Se===null&&(ie=Ce),b.baseState=ie,b.firstBaseUpdate=be,b.lastBaseUpdate=Se,y===null&&(b.shared.lanes=0),Ci|=C,r.lanes=C,r.memoizedState=Ce}}function Sg(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Eg(r,i){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)Sg(l[r],i)}var Ys=G(null),Nc=G(0);function Tg(r,i){r=Wa,D(Nc,r),D(Ys,i),Wa=r|i.baseLanes}function b0(){D(Nc,Wa),D(Ys,Ys.current)}function v0(){Wa=Nc.current,W(Ys),W(Nc)}var Lr=G(null),ta=null;function ki(r){var i=r.alternate;D(In,In.current&1),D(Lr,r),ta===null&&(i===null||Ys.current!==null||i.memoizedState!==null)&&(ta=r)}function y0(r){D(In,In.current),D(Lr,r),ta===null&&(ta=r)}function Cg(r){r.tag===22?(D(In,In.current),D(Lr,r),ta===null&&(ta=r)):Si()}function Si(){D(In,In.current),D(Lr,Lr.current)}function zr(r){W(Lr),ta===r&&(ta=null),W(In)}var In=G(0);function Ac(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Cf(l)||Rf(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ua=0,Ct=null,an=null,jn=null,Ic=!1,Ws=!1,us=!1,_c=0,Wo=0,Zs=null,n8=0;function Cn(){throw Error(a(321))}function x0(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!Dr(r[l],i[l]))return!1;return!0}function w0(r,i,l,f,b,y){return Ua=y,Ct=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,I.H=r===null||r.memoizedState===null?c4:L0,us=!1,y=l(f,b),us=!1,Ws&&(y=Ng(i,l,f,b)),Rg(r),y}function Rg(r){I.H=Qo;var i=an!==null&&an.next!==null;if(Ua=0,jn=an=Ct=null,Ic=!1,Wo=0,Zs=null,i)throw Error(a(300));r===null||Ln||(r=r.dependencies,r!==null&&wc(r)&&(Ln=!0))}function Ng(r,i,l,f){Ct=r;var b=0;do{if(Ws&&(Zs=null),Wo=0,Ws=!1,25<=b)throw Error(a(301));if(b+=1,jn=an=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}I.H=u4,y=i(l,f)}while(Ws);return y}function r8(){var r=I.H,i=r.useState()[0];return i=typeof i.then=="function"?Zo(i):i,r=r.useState()[0],(an!==null?an.memoizedState:null)!==r&&(Ct.flags|=1024),i}function k0(){var r=_c!==0;return _c=0,r}function S0(r,i,l){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~l}function E0(r){if(Ic){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ic=!1}Ua=0,jn=an=Ct=null,Ws=!1,Wo=_c=0,Zs=null}function hr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?Ct.memoizedState=jn=r:jn=jn.next=r,jn}function _n(){if(an===null){var r=Ct.alternate;r=r!==null?r.memoizedState:null}else r=an.next;var i=jn===null?Ct.memoizedState:jn.next;if(i!==null)jn=i,an=r;else{if(r===null)throw Ct.alternate===null?Error(a(467)):Error(a(310));an=r,r={memoizedState:an.memoizedState,baseState:an.baseState,baseQueue:an.baseQueue,queue:an.queue,next:null},jn===null?Ct.memoizedState=jn=r:jn=jn.next=r}return jn}function Mc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zo(r){var i=Wo;return Wo+=1,Zs===null&&(Zs=[]),r=vg(Zs,r,i),i=Ct,(jn===null?i.memoizedState:jn.next)===null&&(i=i.alternate,I.H=i===null||i.memoizedState===null?c4:L0),r}function Oc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Zo(r);if(r.$$typeof===_)return nr(r)}throw Error(a(438,String(r)))}function T0(r){var i=null,l=Ct.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var f=Ct.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(b){return b.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Mc(),Ct.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(r),f=0;f<r;f++)l[f]=$;return i.index++,l}function Fa(r,i){return typeof i=="function"?i(r):i}function Dc(r){var i=_n();return C0(i,an,r)}function C0(r,i,l){var f=r.queue;if(f===null)throw Error(a(311));f.lastRenderedReducer=l;var b=r.baseQueue,y=f.pending;if(y!==null){if(b!==null){var C=b.next;b.next=y.next,y.next=C}i.baseQueue=b=y,f.pending=null}if(y=r.baseState,b===null)r.memoizedState=y;else{i=b.next;var L=C=null,ie=null,be=i,Se=!1;do{var Ce=be.lane&-536870913;if(Ce!==be.lane?(Ut&Ce)===Ce:(Ua&Ce)===Ce){var ve=be.revertLane;if(ve===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),Ce===Ps&&(Se=!0);else if((Ua&ve)===ve){be=be.next,ve===Ps&&(Se=!0);continue}else Ce={lane:0,revertLane:be.revertLane,gesture:null,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},ie===null?(L=ie=Ce,C=y):ie=ie.next=Ce,Ct.lanes|=ve,Ci|=ve;Ce=be.action,us&&l(y,Ce),y=be.hasEagerState?be.eagerState:l(y,Ce)}else ve={lane:Ce,revertLane:be.revertLane,gesture:be.gesture,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null},ie===null?(L=ie=ve,C=y):ie=ie.next=ve,Ct.lanes|=Ce,Ci|=Ce;be=be.next}while(be!==null&&be!==i);if(ie===null?C=y:ie.next=L,!Dr(y,r.memoizedState)&&(Ln=!0,Se&&(l=Gs,l!==null)))throw l;r.memoizedState=y,r.baseState=C,r.baseQueue=ie,f.lastRenderedState=y}return b===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function R0(r){var i=_n(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var f=l.dispatch,b=l.pending,y=i.memoizedState;if(b!==null){l.pending=null;var C=b=b.next;do y=r(y,C.action),C=C.next;while(C!==b);Dr(y,i.memoizedState)||(Ln=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),l.lastRenderedState=y}return[y,f]}function Ag(r,i,l){var f=Ct,b=_n(),y=$t;if(y){if(l===void 0)throw Error(a(407));l=l()}else l=i();var C=!Dr((an||b).memoizedState,l);if(C&&(b.memoizedState=l,Ln=!0),b=b.queue,I0(Mg.bind(null,f,b,r),[r]),b.getSnapshot!==i||C||jn!==null&&jn.memoizedState.tag&1){if(f.flags|=2048,Xs(9,{destroy:void 0},_g.bind(null,f,b,l,i),null),ln===null)throw Error(a(349));y||(Ua&127)!==0||Ig(f,i,l)}return l}function Ig(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=Ct.updateQueue,i===null?(i=Mc(),Ct.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function _g(r,i,l,f){i.value=l,i.getSnapshot=f,Og(i)&&Dg(r)}function Mg(r,i,l){return l(function(){Og(i)&&Dg(r)})}function Og(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Dr(r,l)}catch{return!0}}function Dg(r){var i=ts(r,2);i!==null&&Tr(i,r,2)}function N0(r){var i=hr();if(typeof r=="function"){var l=r;if(r=l(),us){_t(!0);try{l()}finally{_t(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:r},i}function jg(r,i,l,f){return r.baseState=l,C0(r,an,typeof f=="function"?f:Fa)}function a8(r,i,l,f,b){if(zc(r))throw Error(a(485));if(r=i.action,r!==null){var y={payload:b,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){y.listeners.push(C)}};I.T!==null?l(!0):y.isTransition=!1,f(y),l=i.pending,l===null?(y.next=i.pending=y,Lg(i,y)):(y.next=l.next,i.pending=l.next=y)}}function Lg(r,i){var l=i.action,f=i.payload,b=r.state;if(i.isTransition){var y=I.T,C={};I.T=C;try{var L=l(b,f),ie=I.S;ie!==null&&ie(C,L),zg(r,i,L)}catch(be){A0(r,i,be)}finally{y!==null&&C.types!==null&&(y.types=C.types),I.T=y}}else try{y=l(b,f),zg(r,i,y)}catch(be){A0(r,i,be)}}function zg(r,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(f){Bg(r,i,f)},function(f){return A0(r,i,f)}):Bg(r,i,l)}function Bg(r,i,l){i.status="fulfilled",i.value=l,qg(i),r.state=l,i=r.pending,i!==null&&(l=i.next,l===i?r.pending=null:(l=l.next,i.next=l,Lg(r,l)))}function A0(r,i,l){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=l,qg(i),i=i.next;while(i!==f)}r.action=null}function qg(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Hg(r,i){return i}function Ug(r,i){if($t){var l=ln.formState;if(l!==null){e:{var f=Ct;if($t){if(mn){t:{for(var b=mn,y=ea;b.nodeType!==8;){if(!y){b=null;break t}if(b=na(b.nextSibling),b===null){b=null;break t}}y=b.data,b=y==="F!"||y==="F"?b:null}if(b){mn=na(b.nextSibling),f=b.data==="F!";break e}}bi(f)}f=!1}f&&(i=l[0])}}return l=hr(),l.memoizedState=l.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hg,lastRenderedState:i},l.queue=f,l=s4.bind(null,Ct,f),f.dispatch=l,f=N0(!1),y=j0.bind(null,Ct,!1,f.queue),f=hr(),b={state:i,dispatch:null,action:r,pending:null},f.queue=b,l=a8.bind(null,Ct,b,y,l),b.dispatch=l,f.memoizedState=r,[i,l,!1]}function Fg(r){var i=_n();return $g(i,an,r)}function $g(r,i,l){if(i=C0(r,i,Hg)[0],r=Dc(Fa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=Zo(i)}catch(C){throw C===Vs?Ec:C}else f=i;i=_n();var b=i.queue,y=b.dispatch;return l!==i.memoizedState&&(Ct.flags|=2048,Xs(9,{destroy:void 0},i8.bind(null,b,l),null)),[f,y,r]}function i8(r,i){r.action=i}function Pg(r){var i=_n(),l=an;if(l!==null)return $g(i,l,r);_n(),i=i.memoizedState,l=_n();var f=l.queue.dispatch;return l.memoizedState=r,[i,f,!1]}function Xs(r,i,l,f){return r={tag:r,create:l,deps:f,inst:i,next:null},i=Ct.updateQueue,i===null&&(i=Mc(),Ct.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=r.next=r:(f=l.next,l.next=r,r.next=f,i.lastEffect=r),r}function Gg(){return _n().memoizedState}function jc(r,i,l,f){var b=hr();Ct.flags|=r,b.memoizedState=Xs(1|i,{destroy:void 0},l,f===void 0?null:f)}function Lc(r,i,l,f){var b=_n();f=f===void 0?null:f;var y=b.memoizedState.inst;an!==null&&f!==null&&x0(f,an.memoizedState.deps)?b.memoizedState=Xs(i,y,l,f):(Ct.flags|=r,b.memoizedState=Xs(1|i,y,l,f))}function Vg(r,i){jc(8390656,8,r,i)}function I0(r,i){Lc(2048,8,r,i)}function s8(r){Ct.flags|=4;var i=Ct.updateQueue;if(i===null)i=Mc(),Ct.updateQueue=i,i.events=[r];else{var l=i.events;l===null?i.events=[r]:l.push(r)}}function Kg(r){var i=_n().memoizedState;return s8({ref:i,nextImpl:r}),function(){if((Zt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Yg(r,i){return Lc(4,2,r,i)}function Wg(r,i){return Lc(4,4,r,i)}function Zg(r,i){if(typeof i=="function"){r=r();var l=i(r);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Xg(r,i,l){l=l!=null?l.concat([r]):null,Lc(4,4,Zg.bind(null,i,r),l)}function _0(){}function Qg(r,i){var l=_n();i=i===void 0?null:i;var f=l.memoizedState;return i!==null&&x0(i,f[1])?f[0]:(l.memoizedState=[r,i],r)}function Jg(r,i){var l=_n();i=i===void 0?null:i;var f=l.memoizedState;if(i!==null&&x0(i,f[1]))return f[0];if(f=r(),us){_t(!0);try{r()}finally{_t(!1)}}return l.memoizedState=[f,i],f}function M0(r,i,l){return l===void 0||(Ua&1073741824)!==0&&(Ut&261930)===0?r.memoizedState=i:(r.memoizedState=l,r=e2(),Ct.lanes|=r,Ci|=r,l)}function e4(r,i,l,f){return Dr(l,i)?l:Ys.current!==null?(r=M0(r,l,f),Dr(r,i)||(Ln=!0),r):(Ua&42)===0||(Ua&1073741824)!==0&&(Ut&261930)===0?(Ln=!0,r.memoizedState=l):(r=e2(),Ct.lanes|=r,Ci|=r,i)}function t4(r,i,l,f,b){var y=K.p;K.p=y!==0&&8>y?y:8;var C=I.T,L={};I.T=L,j0(r,!1,i,l);try{var ie=b(),be=I.S;if(be!==null&&be(L,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Se=t8(ie,f);Xo(r,i,Se,Hr(r))}else Xo(r,i,f,Hr(r))}catch(Ce){Xo(r,i,{then:function(){},status:"rejected",reason:Ce},Hr())}finally{K.p=y,C!==null&&L.types!==null&&(C.types=L.types),I.T=C}}function o8(){}function O0(r,i,l,f){if(r.tag!==5)throw Error(a(476));var b=n4(r).queue;t4(r,b,i,Q,l===null?o8:function(){return r4(r),l(f)})}function n4(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:Q},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function r4(r){var i=n4(r);i.next===null&&(i=r.alternate.memoizedState),Xo(r,i.next.queue,{},Hr())}function D0(){return nr(ml)}function a4(){return _n().memoizedState}function i4(){return _n().memoizedState}function l8(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Hr();r=xi(l);var f=wi(i,r,l);f!==null&&(Tr(f,i,l),Vo(f,i,l)),i={cache:c0()},r.payload=i;return}i=i.return}}function c8(r,i,l){var f=Hr();l={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},zc(r)?o4(i,l):(l=Qd(r,i,l,f),l!==null&&(Tr(l,r,f),l4(l,i,f)))}function s4(r,i,l){var f=Hr();Xo(r,i,l,f)}function Xo(r,i,l,f){var b={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(zc(r))o4(i,b);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var C=i.lastRenderedState,L=y(C,l);if(b.hasEagerState=!0,b.eagerState=L,Dr(L,C))return bc(r,i,b,0),ln===null&&gc(),!1}catch{}if(l=Qd(r,i,b,f),l!==null)return Tr(l,r,f),l4(l,i,f),!0}return!1}function j0(r,i,l,f){if(f={lane:2,revertLane:mf(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},zc(r)){if(i)throw Error(a(479))}else i=Qd(r,l,f,2),i!==null&&Tr(i,r,2)}function zc(r){var i=r.alternate;return r===Ct||i!==null&&i===Ct}function o4(r,i){Ws=Ic=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function l4(r,i,l){if((l&4194048)!==0){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,ut(r,l)}}var Qo={readContext:nr,use:Oc,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useLayoutEffect:Cn,useInsertionEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useSyncExternalStore:Cn,useId:Cn,useHostTransitionStatus:Cn,useFormState:Cn,useActionState:Cn,useOptimistic:Cn,useMemoCache:Cn,useCacheRefresh:Cn};Qo.useEffectEvent=Cn;var c4={readContext:nr,use:Oc,useCallback:function(r,i){return hr().memoizedState=[r,i===void 0?null:i],r},useContext:nr,useEffect:Vg,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,jc(4194308,4,Zg.bind(null,i,r),l)},useLayoutEffect:function(r,i){return jc(4194308,4,r,i)},useInsertionEffect:function(r,i){jc(4,2,r,i)},useMemo:function(r,i){var l=hr();i=i===void 0?null:i;var f=r();if(us){_t(!0);try{r()}finally{_t(!1)}}return l.memoizedState=[f,i],f},useReducer:function(r,i,l){var f=hr();if(l!==void 0){var b=l(i);if(us){_t(!0);try{l(i)}finally{_t(!1)}}}else b=i;return f.memoizedState=f.baseState=b,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:b},f.queue=r,r=r.dispatch=c8.bind(null,Ct,r),[f.memoizedState,r]},useRef:function(r){var i=hr();return r={current:r},i.memoizedState=r},useState:function(r){r=N0(r);var i=r.queue,l=s4.bind(null,Ct,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:_0,useDeferredValue:function(r,i){var l=hr();return M0(l,r,i)},useTransition:function(){var r=N0(!1);return r=t4.bind(null,Ct,r.queue,!0,!1),hr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var f=Ct,b=hr();if($t){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),ln===null)throw Error(a(349));(Ut&127)!==0||Ig(f,i,l)}b.memoizedState=l;var y={value:l,getSnapshot:i};return b.queue=y,Vg(Mg.bind(null,f,y,r),[r]),f.flags|=2048,Xs(9,{destroy:void 0},_g.bind(null,f,y,l,i),null),l},useId:function(){var r=hr(),i=ln.identifierPrefix;if($t){var l=xa,f=ya;l=(f&~(1<<32-Et(f)-1)).toString(32)+l,i="_"+i+"R_"+l,l=_c++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=n8++,i="_"+i+"r_"+l.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:D0,useFormState:Ug,useActionState:Ug,useOptimistic:function(r){var i=hr();i.memoizedState=i.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=j0.bind(null,Ct,!0,l),l.dispatch=i,[r,i]},useMemoCache:T0,useCacheRefresh:function(){return hr().memoizedState=l8.bind(null,Ct)},useEffectEvent:function(r){var i=hr(),l={impl:r};return i.memoizedState=l,function(){if((Zt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},L0={readContext:nr,use:Oc,useCallback:Qg,useContext:nr,useEffect:I0,useImperativeHandle:Xg,useInsertionEffect:Yg,useLayoutEffect:Wg,useMemo:Jg,useReducer:Dc,useRef:Gg,useState:function(){return Dc(Fa)},useDebugValue:_0,useDeferredValue:function(r,i){var l=_n();return e4(l,an.memoizedState,r,i)},useTransition:function(){var r=Dc(Fa)[0],i=_n().memoizedState;return[typeof r=="boolean"?r:Zo(r),i]},useSyncExternalStore:Ag,useId:a4,useHostTransitionStatus:D0,useFormState:Fg,useActionState:Fg,useOptimistic:function(r,i){var l=_n();return jg(l,an,r,i)},useMemoCache:T0,useCacheRefresh:i4};L0.useEffectEvent=Kg;var u4={readContext:nr,use:Oc,useCallback:Qg,useContext:nr,useEffect:I0,useImperativeHandle:Xg,useInsertionEffect:Yg,useLayoutEffect:Wg,useMemo:Jg,useReducer:R0,useRef:Gg,useState:function(){return R0(Fa)},useDebugValue:_0,useDeferredValue:function(r,i){var l=_n();return an===null?M0(l,r,i):e4(l,an.memoizedState,r,i)},useTransition:function(){var r=R0(Fa)[0],i=_n().memoizedState;return[typeof r=="boolean"?r:Zo(r),i]},useSyncExternalStore:Ag,useId:a4,useHostTransitionStatus:D0,useFormState:Pg,useActionState:Pg,useOptimistic:function(r,i){var l=_n();return an!==null?jg(l,an,r,i):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:T0,useCacheRefresh:i4};u4.useEffectEvent=Kg;function z0(r,i,l,f){i=r.memoizedState,l=l(f,i),l=l==null?i:g({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var B0={enqueueSetState:function(r,i,l){r=r._reactInternals;var f=Hr(),b=xi(f);b.payload=i,l!=null&&(b.callback=l),i=wi(r,b,f),i!==null&&(Tr(i,r,f),Vo(i,r,f))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var f=Hr(),b=xi(f);b.tag=1,b.payload=i,l!=null&&(b.callback=l),i=wi(r,b,f),i!==null&&(Tr(i,r,f),Vo(i,r,f))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=Hr(),f=xi(l);f.tag=2,i!=null&&(f.callback=i),i=wi(r,f,l),i!==null&&(Tr(i,r,l),Vo(i,r,l))}};function d4(r,i,l,f,b,y,C){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,y,C):i.prototype&&i.prototype.isPureReactComponent?!Bo(l,f)||!Bo(b,y):!0}function f4(r,i,l,f){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,f),i.state!==r&&B0.enqueueReplaceState(i,i.state,null)}function ds(r,i){var l=i;if("ref"in i){l={};for(var f in i)f!=="ref"&&(l[f]=i[f])}if(r=r.defaultProps){l===i&&(l=g({},l));for(var b in r)l[b]===void 0&&(l[b]=r[b])}return l}function h4(r){pc(r)}function m4(r){console.error(r)}function p4(r){pc(r)}function Bc(r,i){try{var l=r.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function g4(r,i,l){try{var f=r.onCaughtError;f(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function q0(r,i,l){return l=xi(l),l.tag=3,l.payload={element:null},l.callback=function(){Bc(r,i)},l}function b4(r){return r=xi(r),r.tag=3,r}function v4(r,i,l,f){var b=l.type.getDerivedStateFromError;if(typeof b=="function"){var y=f.value;r.payload=function(){return b(y)},r.callback=function(){g4(i,l,f)}}var C=l.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(r.callback=function(){g4(i,l,f),typeof b!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var L=f.stack;this.componentDidCatch(f.value,{componentStack:L!==null?L:""})})}function u8(r,i,l,f,b){if(l.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=l.alternate,i!==null&&$s(i,l,b,!0),l=Lr.current,l!==null){switch(l.tag){case 31:case 13:return ta===null?Zc():l.alternate===null&&Rn===0&&(Rn=3),l.flags&=-257,l.flags|=65536,l.lanes=b,f===Tc?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([f]):i.add(f),df(r,f,b)),!1;case 22:return l.flags|=65536,f===Tc?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([f]):l.add(f)),df(r,f,b)),!1}throw Error(a(435,l.tag))}return df(r,f,b),Zc(),!1}if($t)return i=Lr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=b,f!==a0&&(r=Error(a(422),{cause:f}),Uo(Xr(r,l)))):(f!==a0&&(i=Error(a(423),{cause:f}),Uo(Xr(i,l))),r=r.current.alternate,r.flags|=65536,b&=-b,r.lanes|=b,f=Xr(f,l),b=q0(r.stateNode,f,b),p0(r,b),Rn!==4&&(Rn=2)),!1;var y=Error(a(520),{cause:f});if(y=Xr(y,l),sl===null?sl=[y]:sl.push(y),Rn!==4&&(Rn=2),i===null)return!0;f=Xr(f,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,r=b&-b,l.lanes|=r,r=q0(l.stateNode,f,r),p0(l,r),!1;case 1:if(i=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ri===null||!Ri.has(y))))return l.flags|=65536,b&=-b,l.lanes|=b,b=b4(b),v4(b,r,l,f),p0(l,b),!1}l=l.return}while(l!==null);return!1}var H0=Error(a(461)),Ln=!1;function rr(r,i,l,f){i.child=r===null?kg(i,null,l,f):cs(i,r.child,l,f)}function y4(r,i,l,f,b){l=l.render;var y=i.ref;if("ref"in f){var C={};for(var L in f)L!=="ref"&&(C[L]=f[L])}else C=f;return is(i),f=w0(r,i,l,C,y,b),L=k0(),r!==null&&!Ln?(S0(r,i,b),$a(r,i,b)):($t&&L&&n0(i),i.flags|=1,rr(r,i,f,b),i.child)}function x4(r,i,l,f,b){if(r===null){var y=l.type;return typeof y=="function"&&!Jd(y)&&y.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=y,w4(r,i,y,f,b)):(r=yc(l.type,null,f,i,i.mode,b),r.ref=i.ref,r.return=i,i.child=r)}if(y=r.child,!Y0(r,b)){var C=y.memoizedProps;if(l=l.compare,l=l!==null?l:Bo,l(C,f)&&r.ref===i.ref)return $a(r,i,b)}return i.flags|=1,r=za(y,f),r.ref=i.ref,r.return=i,i.child=r}function w4(r,i,l,f,b){if(r!==null){var y=r.memoizedProps;if(Bo(y,f)&&r.ref===i.ref)if(Ln=!1,i.pendingProps=f=y,Y0(r,b))(r.flags&131072)!==0&&(Ln=!0);else return i.lanes=r.lanes,$a(r,i,b)}return U0(r,i,l,f,b)}function k4(r,i,l,f){var b=f.children,y=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(y=y!==null?y.baseLanes|l:l,r!==null){for(f=i.child=r.child,b=0;f!==null;)b=b|f.lanes|f.childLanes,f=f.sibling;f=b&~y}else f=0,i.child=null;return S4(r,i,y,l,f)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Sc(i,y!==null?y.cachePool:null),y!==null?Tg(i,y):b0(),Cg(i);else return f=i.lanes=536870912,S4(r,i,y!==null?y.baseLanes|l:l,l,f)}else y!==null?(Sc(i,y.cachePool),Tg(i,y),Si(),i.memoizedState=null):(r!==null&&Sc(i,null),b0(),Si());return rr(r,i,b,l),i.child}function Jo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function S4(r,i,l,f,b){var y=d0();return y=y===null?null:{parent:Dn._currentValue,pool:y},i.memoizedState={baseLanes:l,cachePool:y},r!==null&&Sc(i,null),b0(),Cg(i),r!==null&&$s(r,i,f,!0),i.childLanes=b,null}function qc(r,i){return i=Uc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function E4(r,i,l){return cs(i,r.child,null,l),r=qc(i,i.pendingProps),r.flags|=2,zr(i),i.memoizedState=null,r}function d8(r,i,l){var f=i.pendingProps,b=(i.flags&128)!==0;if(i.flags&=-129,r===null){if($t){if(f.mode==="hidden")return r=qc(i,f),i.lanes=536870912,Jo(null,r);if(y0(i),(r=mn)?(r=L2(r,ea),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:pi!==null?{id:ya,overflow:xa}:null,retryLane:536870912,hydrationErrors:null},l=og(r),l.return=i,i.child=l,tr=i,mn=null)):r=null,r===null)throw bi(i);return i.lanes=536870912,null}return qc(i,f)}var y=r.memoizedState;if(y!==null){var C=y.dehydrated;if(y0(i),b)if(i.flags&256)i.flags&=-257,i=E4(r,i,l);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Ln||$s(r,i,l,!1),b=(l&r.childLanes)!==0,Ln||b){if(f=ln,f!==null&&(C=xn(f,l),C!==0&&C!==y.retryLane))throw y.retryLane=C,ts(r,C),Tr(f,r,C),H0;Zc(),i=E4(r,i,l)}else r=y.treeContext,mn=na(C.nextSibling),tr=i,$t=!0,gi=null,ea=!1,r!==null&&ug(i,r),i=qc(i,f),i.flags|=4096;return i}return r=za(r.child,{mode:f.mode,children:f.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Hc(r,i){var l=i.ref;if(l===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(r===null||r.ref!==l)&&(i.flags|=4194816)}}function U0(r,i,l,f,b){return is(i),l=w0(r,i,l,f,void 0,b),f=k0(),r!==null&&!Ln?(S0(r,i,b),$a(r,i,b)):($t&&f&&n0(i),i.flags|=1,rr(r,i,l,b),i.child)}function T4(r,i,l,f,b,y){return is(i),i.updateQueue=null,l=Ng(i,f,l,b),Rg(r),f=k0(),r!==null&&!Ln?(S0(r,i,y),$a(r,i,y)):($t&&f&&n0(i),i.flags|=1,rr(r,i,l,y),i.child)}function C4(r,i,l,f,b){if(is(i),i.stateNode===null){var y=qs,C=l.contextType;typeof C=="object"&&C!==null&&(y=nr(C)),y=new l(f,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=B0,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=f,y.state=i.memoizedState,y.refs={},h0(i),C=l.contextType,y.context=typeof C=="object"&&C!==null?nr(C):qs,y.state=i.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(z0(i,l,C,f),y.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(C=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),C!==y.state&&B0.enqueueReplaceState(y,y.state,null),Yo(i,f,y,b),Ko(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(r===null){y=i.stateNode;var L=i.memoizedProps,ie=ds(l,L);y.props=ie;var be=y.context,Se=l.contextType;C=qs,typeof Se=="object"&&Se!==null&&(C=nr(Se));var Ce=l.getDerivedStateFromProps;Se=typeof Ce=="function"||typeof y.getSnapshotBeforeUpdate=="function",L=i.pendingProps!==L,Se||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(L||be!==C)&&f4(i,y,f,C),yi=!1;var ve=i.memoizedState;y.state=ve,Yo(i,f,y,b),Ko(),be=i.memoizedState,L||ve!==be||yi?(typeof Ce=="function"&&(z0(i,l,Ce,f),be=i.memoizedState),(ie=yi||d4(i,l,ie,f,ve,be,C))?(Se||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=be),y.props=f,y.state=be,y.context=C,f=ie):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{y=i.stateNode,m0(r,i),C=i.memoizedProps,Se=ds(l,C),y.props=Se,Ce=i.pendingProps,ve=y.context,be=l.contextType,ie=qs,typeof be=="object"&&be!==null&&(ie=nr(be)),L=l.getDerivedStateFromProps,(be=typeof L=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(C!==Ce||ve!==ie)&&f4(i,y,f,ie),yi=!1,ve=i.memoizedState,y.state=ve,Yo(i,f,y,b),Ko();var xe=i.memoizedState;C!==Ce||ve!==xe||yi||r!==null&&r.dependencies!==null&&wc(r.dependencies)?(typeof L=="function"&&(z0(i,l,L,f),xe=i.memoizedState),(Se=yi||d4(i,l,Se,f,ve,xe,ie)||r!==null&&r.dependencies!==null&&wc(r.dependencies))?(be||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,xe,ie),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,xe,ie)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||C===r.memoizedProps&&ve===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&ve===r.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=xe),y.props=f,y.state=xe,y.context=ie,f=Se):(typeof y.componentDidUpdate!="function"||C===r.memoizedProps&&ve===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&ve===r.memoizedState||(i.flags|=1024),f=!1)}return y=f,Hc(r,i),f=(i.flags&128)!==0,y||f?(y=i.stateNode,l=f&&typeof l.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,r!==null&&f?(i.child=cs(i,r.child,null,b),i.child=cs(i,null,l,b)):rr(r,i,l,b),i.memoizedState=y.state,r=i.child):r=$a(r,i,b),r}function R4(r,i,l,f){return rs(),i.flags|=256,rr(r,i,l,f),i.child}var F0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $0(r){return{baseLanes:r,cachePool:gg()}}function P0(r,i,l){return r=r!==null?r.childLanes&~l:0,i&&(r|=qr),r}function N4(r,i,l){var f=i.pendingProps,b=!1,y=(i.flags&128)!==0,C;if((C=y)||(C=r!==null&&r.memoizedState===null?!1:(In.current&2)!==0),C&&(b=!0,i.flags&=-129),C=(i.flags&32)!==0,i.flags&=-33,r===null){if($t){if(b?ki(i):Si(),(r=mn)?(r=L2(r,ea),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:pi!==null?{id:ya,overflow:xa}:null,retryLane:536870912,hydrationErrors:null},l=og(r),l.return=i,i.child=l,tr=i,mn=null)):r=null,r===null)throw bi(i);return Rf(r)?i.lanes=32:i.lanes=536870912,null}var L=f.children;return f=f.fallback,b?(Si(),b=i.mode,L=Uc({mode:"hidden",children:L},b),f=ns(f,b,l,null),L.return=i,f.return=i,L.sibling=f,i.child=L,f=i.child,f.memoizedState=$0(l),f.childLanes=P0(r,C,l),i.memoizedState=F0,Jo(null,f)):(ki(i),G0(i,L))}var ie=r.memoizedState;if(ie!==null&&(L=ie.dehydrated,L!==null)){if(y)i.flags&256?(ki(i),i.flags&=-257,i=V0(r,i,l)):i.memoizedState!==null?(Si(),i.child=r.child,i.flags|=128,i=null):(Si(),L=f.fallback,b=i.mode,f=Uc({mode:"visible",children:f.children},b),L=ns(L,b,l,null),L.flags|=2,f.return=i,L.return=i,f.sibling=L,i.child=f,cs(i,r.child,null,l),f=i.child,f.memoizedState=$0(l),f.childLanes=P0(r,C,l),i.memoizedState=F0,i=Jo(null,f));else if(ki(i),Rf(L)){if(C=L.nextSibling&&L.nextSibling.dataset,C)var be=C.dgst;C=be,f=Error(a(419)),f.stack="",f.digest=C,Uo({value:f,source:null,stack:null}),i=V0(r,i,l)}else if(Ln||$s(r,i,l,!1),C=(l&r.childLanes)!==0,Ln||C){if(C=ln,C!==null&&(f=xn(C,l),f!==0&&f!==ie.retryLane))throw ie.retryLane=f,ts(r,f),Tr(C,r,f),H0;Cf(L)||Zc(),i=V0(r,i,l)}else Cf(L)?(i.flags|=192,i.child=r.child,i=null):(r=ie.treeContext,mn=na(L.nextSibling),tr=i,$t=!0,gi=null,ea=!1,r!==null&&ug(i,r),i=G0(i,f.children),i.flags|=4096);return i}return b?(Si(),L=f.fallback,b=i.mode,ie=r.child,be=ie.sibling,f=za(ie,{mode:"hidden",children:f.children}),f.subtreeFlags=ie.subtreeFlags&65011712,be!==null?L=za(be,L):(L=ns(L,b,l,null),L.flags|=2),L.return=i,f.return=i,f.sibling=L,i.child=f,Jo(null,f),f=i.child,L=r.child.memoizedState,L===null?L=$0(l):(b=L.cachePool,b!==null?(ie=Dn._currentValue,b=b.parent!==ie?{parent:ie,pool:ie}:b):b=gg(),L={baseLanes:L.baseLanes|l,cachePool:b}),f.memoizedState=L,f.childLanes=P0(r,C,l),i.memoizedState=F0,Jo(r.child,f)):(ki(i),l=r.child,r=l.sibling,l=za(l,{mode:"visible",children:f.children}),l.return=i,l.sibling=null,r!==null&&(C=i.deletions,C===null?(i.deletions=[r],i.flags|=16):C.push(r)),i.child=l,i.memoizedState=null,l)}function G0(r,i){return i=Uc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Uc(r,i){return r=jr(22,r,null,i),r.lanes=0,r}function V0(r,i,l){return cs(i,r.child,null,l),r=G0(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function A4(r,i,l){r.lanes|=i;var f=r.alternate;f!==null&&(f.lanes|=i),o0(r.return,i,l)}function K0(r,i,l,f,b,y){var C=r.memoizedState;C===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:b,treeForkCount:y}:(C.isBackwards=i,C.rendering=null,C.renderingStartTime=0,C.last=f,C.tail=l,C.tailMode=b,C.treeForkCount=y)}function I4(r,i,l){var f=i.pendingProps,b=f.revealOrder,y=f.tail;f=f.children;var C=In.current,L=(C&2)!==0;if(L?(C=C&1|2,i.flags|=128):C&=1,D(In,C),rr(r,i,f,l),f=$t?Ho:0,!L&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&A4(r,l,i);else if(r.tag===19)A4(r,l,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(b){case"forwards":for(l=i.child,b=null;l!==null;)r=l.alternate,r!==null&&Ac(r)===null&&(b=l),l=l.sibling;l=b,l===null?(b=i.child,i.child=null):(b=l.sibling,l.sibling=null),K0(i,!1,b,l,y,f);break;case"backwards":case"unstable_legacy-backwards":for(l=null,b=i.child,i.child=null;b!==null;){if(r=b.alternate,r!==null&&Ac(r)===null){i.child=b;break}r=b.sibling,b.sibling=l,l=b,b=r}K0(i,!0,l,null,y,f);break;case"together":K0(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function $a(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),Ci|=i.lanes,(l&i.childLanes)===0)if(r!==null){if($s(r,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,l=za(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=za(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function Y0(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&wc(r)))}function f8(r,i,l){switch(i.tag){case 3:ne(i,i.stateNode.containerInfo),vi(i,Dn,r.memoizedState.cache),rs();break;case 27:case 5:he(i);break;case 4:ne(i,i.stateNode.containerInfo);break;case 10:vi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,y0(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(ki(i),i.flags|=128,null):(l&i.child.childLanes)!==0?N4(r,i,l):(ki(i),r=$a(r,i,l),r!==null?r.sibling:null);ki(i);break;case 19:var b=(r.flags&128)!==0;if(f=(l&i.childLanes)!==0,f||($s(r,i,l,!1),f=(l&i.childLanes)!==0),b){if(f)return I4(r,i,l);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),D(In,In.current),f)break;return null;case 22:return i.lanes=0,k4(r,i,l,i.pendingProps);case 24:vi(i,Dn,r.memoizedState.cache)}return $a(r,i,l)}function _4(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps)Ln=!0;else{if(!Y0(r,l)&&(i.flags&128)===0)return Ln=!1,f8(r,i,l);Ln=(r.flags&131072)!==0}else Ln=!1,$t&&(i.flags&1048576)!==0&&cg(i,Ho,i.index);switch(i.lanes=0,i.tag){case 16:e:{var f=i.pendingProps;if(r=os(i.elementType),i.type=r,typeof r=="function")Jd(r)?(f=ds(r,f),i.tag=1,i=C4(null,i,r,f,l)):(i.tag=0,i=U0(null,i,r,f,l));else{if(r!=null){var b=r.$$typeof;if(b===P){i.tag=11,i=y4(null,i,r,f,l);break e}else if(b===z){i.tag=14,i=x4(null,i,r,f,l);break e}}throw i=ee(r)||r,Error(a(306,i,""))}}return i;case 0:return U0(r,i,i.type,i.pendingProps,l);case 1:return f=i.type,b=ds(f,i.pendingProps),C4(r,i,f,b,l);case 3:e:{if(ne(i,i.stateNode.containerInfo),r===null)throw Error(a(387));f=i.pendingProps;var y=i.memoizedState;b=y.element,m0(r,i),Yo(i,f,null,l);var C=i.memoizedState;if(f=C.cache,vi(i,Dn,f),f!==y.cache&&l0(i,[Dn],l,!0),Ko(),f=C.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:C.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=R4(r,i,f,l);break e}else if(f!==b){b=Xr(Error(a(424)),i),Uo(b),i=R4(r,i,f,l);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,mn=na(r.firstChild),tr=i,$t=!0,gi=null,ea=!0,l=kg(i,null,f,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(rs(),f===b){i=$a(r,i,l);break e}rr(r,i,f,l)}i=i.child}return i;case 26:return Hc(r,i),r===null?(l=F2(i.type,null,i.pendingProps,null))?i.memoizedState=l:$t||(l=i.type,r=i.pendingProps,f=ru(V.current).createElement(l),f[Wt]=i,f[Tn]=r,ar(f,l,r),wn(f),i.stateNode=f):i.memoizedState=F2(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return he(i),r===null&&$t&&(f=i.stateNode=q2(i.type,i.pendingProps,V.current),tr=i,ea=!0,b=mn,_i(i.type)?(Nf=b,mn=na(f.firstChild)):mn=b),rr(r,i,i.pendingProps.children,l),Hc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&$t&&((b=f=mn)&&(f=F8(f,i.type,i.pendingProps,ea),f!==null?(i.stateNode=f,tr=i,mn=na(f.firstChild),ea=!1,b=!0):b=!1),b||bi(i)),he(i),b=i.type,y=i.pendingProps,C=r!==null?r.memoizedProps:null,f=y.children,Sf(b,y)?f=null:C!==null&&Sf(b,C)&&(i.flags|=32),i.memoizedState!==null&&(b=w0(r,i,r8,null,null,l),ml._currentValue=b),Hc(r,i),rr(r,i,f,l),i.child;case 6:return r===null&&$t&&((r=l=mn)&&(l=$8(l,i.pendingProps,ea),l!==null?(i.stateNode=l,tr=i,mn=null,r=!0):r=!1),r||bi(i)),null;case 13:return N4(r,i,l);case 4:return ne(i,i.stateNode.containerInfo),f=i.pendingProps,r===null?i.child=cs(i,null,f,l):rr(r,i,f,l),i.child;case 11:return y4(r,i,i.type,i.pendingProps,l);case 7:return rr(r,i,i.pendingProps,l),i.child;case 8:return rr(r,i,i.pendingProps.children,l),i.child;case 12:return rr(r,i,i.pendingProps.children,l),i.child;case 10:return f=i.pendingProps,vi(i,i.type,f.value),rr(r,i,f.children,l),i.child;case 9:return b=i.type._context,f=i.pendingProps.children,is(i),b=nr(b),f=f(b),i.flags|=1,rr(r,i,f,l),i.child;case 14:return x4(r,i,i.type,i.pendingProps,l);case 15:return w4(r,i,i.type,i.pendingProps,l);case 19:return I4(r,i,l);case 31:return d8(r,i,l);case 22:return k4(r,i,l,i.pendingProps);case 24:return is(i),f=nr(Dn),r===null?(b=d0(),b===null&&(b=ln,y=c0(),b.pooledCache=y,y.refCount++,y!==null&&(b.pooledCacheLanes|=l),b=y),i.memoizedState={parent:f,cache:b},h0(i),vi(i,Dn,b)):((r.lanes&l)!==0&&(m0(r,i),Yo(i,null,null,l),Ko()),b=r.memoizedState,y=i.memoizedState,b.parent!==f?(b={parent:f,cache:f},i.memoizedState=b,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=b),vi(i,Dn,f)):(f=y.cache,vi(i,Dn,f),f!==b.cache&&l0(i,[Dn],l,!0))),rr(r,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Pa(r){r.flags|=4}function W0(r,i,l,f,b){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(b&335544128)===b)if(r.stateNode.complete)r.flags|=8192;else if(a2())r.flags|=8192;else throw ls=Tc,f0}else r.flags&=-16777217}function M4(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!K2(i))if(a2())r.flags|=8192;else throw ls=Tc,f0}function Fc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Je():536870912,r.lanes|=i,to|=i)}function el(r,i){if(!$t)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function pn(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,f=0;if(i)for(var b=r.child;b!==null;)l|=b.lanes|b.childLanes,f|=b.subtreeFlags&65011712,f|=b.flags&65011712,b.return=r,b=b.sibling;else for(b=r.child;b!==null;)l|=b.lanes|b.childLanes,f|=b.subtreeFlags,f|=b.flags,b.return=r,b=b.sibling;return r.subtreeFlags|=f,r.childLanes=l,i}function h8(r,i,l){var f=i.pendingProps;switch(r0(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(i),null;case 1:return pn(i),null;case 3:return l=i.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),Ha(Dn),ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Fs(i)?Pa(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,i0())),pn(i),null;case 26:var b=i.type,y=i.memoizedState;return r===null?(Pa(i),y!==null?(pn(i),M4(i,y)):(pn(i),W0(i,b,null,f,l))):y?y!==r.memoizedState?(Pa(i),pn(i),M4(i,y)):(pn(i),i.flags&=-16777217):(r=r.memoizedProps,r!==f&&Pa(i),pn(i),W0(i,b,r,f,l)),null;case 27:if(Re(i),l=V.current,b=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&Pa(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return pn(i),null}r=ye.current,Fs(i)?dg(i):(r=q2(b,f,l),i.stateNode=r,Pa(i))}return pn(i),null;case 5:if(Re(i),b=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&Pa(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return pn(i),null}if(y=ye.current,Fs(i))dg(i);else{var C=ru(V.current);switch(y){case 1:y=C.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:y=C.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":y=C.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":y=C.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":y=C.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?C.createElement("select",{is:f.is}):C.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?C.createElement(b,{is:f.is}):C.createElement(b)}}y[Wt]=i,y[Tn]=f;e:for(C=i.child;C!==null;){if(C.tag===5||C.tag===6)y.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===i)break e;for(;C.sibling===null;){if(C.return===null||C.return===i)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}i.stateNode=y;e:switch(ar(y,b,f),b){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Pa(i)}}return pn(i),W0(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,l),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==f&&Pa(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(a(166));if(r=V.current,Fs(i)){if(r=i.stateNode,l=i.memoizedProps,f=null,b=tr,b!==null)switch(b.tag){case 27:case 5:f=b.memoizedProps}r[Wt]=i,r=!!(r.nodeValue===l||f!==null&&f.suppressHydrationWarning===!0||N2(r.nodeValue,l)),r||bi(i,!0)}else r=ru(r).createTextNode(f),r[Wt]=i,i.stateNode=r}return pn(i),null;case 31:if(l=i.memoizedState,r===null||r.memoizedState!==null){if(f=Fs(i),l!==null){if(r===null){if(!f)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Wt]=i}else rs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;pn(i),r=!1}else l=i0(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return i.flags&256?(zr(i),i):(zr(i),null);if((i.flags&128)!==0)throw Error(a(558))}return pn(i),null;case 13:if(f=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(b=Fs(i),f!==null&&f.dehydrated!==null){if(r===null){if(!b)throw Error(a(318));if(b=i.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(a(317));b[Wt]=i}else rs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;pn(i),b=!1}else b=i0(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=b),b=!0;if(!b)return i.flags&256?(zr(i),i):(zr(i),null)}return zr(i),(i.flags&128)!==0?(i.lanes=l,i):(l=f!==null,r=r!==null&&r.memoizedState!==null,l&&(f=i.child,b=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(b=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==b&&(f.flags|=2048)),l!==r&&l&&(i.child.flags|=8192),Fc(i,i.updateQueue),pn(i),null);case 4:return ue(),r===null&&vf(i.stateNode.containerInfo),pn(i),null;case 10:return Ha(i.type),pn(i),null;case 19:if(W(In),f=i.memoizedState,f===null)return pn(i),null;if(b=(i.flags&128)!==0,y=f.rendering,y===null)if(b)el(f,!1);else{if(Rn!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=Ac(r),y!==null){for(i.flags|=128,el(f,!1),r=y.updateQueue,i.updateQueue=r,Fc(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)sg(l,r),l=l.sibling;return D(In,In.current&1|2),$t&&Ba(i,f.treeForkCount),i.child}r=r.sibling}f.tail!==null&&Ue()>Kc&&(i.flags|=128,b=!0,el(f,!1),i.lanes=4194304)}else{if(!b)if(r=Ac(y),r!==null){if(i.flags|=128,b=!0,r=r.updateQueue,i.updateQueue=r,Fc(i,r),el(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!$t)return pn(i),null}else 2*Ue()-f.renderingStartTime>Kc&&l!==536870912&&(i.flags|=128,b=!0,el(f,!1),i.lanes=4194304);f.isBackwards?(y.sibling=i.child,i.child=y):(r=f.last,r!==null?r.sibling=y:i.child=y,f.last=y)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=Ue(),r.sibling=null,l=In.current,D(In,b?l&1|2:l&1),$t&&Ba(i,f.treeForkCount),r):(pn(i),null);case 22:case 23:return zr(i),v0(),f=i.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(l&536870912)!==0&&(i.flags&128)===0&&(pn(i),i.subtreeFlags&6&&(i.flags|=8192)):pn(i),l=i.updateQueue,l!==null&&Fc(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==l&&(i.flags|=2048),r!==null&&W(ss),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ha(Dn),pn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function m8(r,i){switch(r0(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ha(Dn),ue(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Re(i),null;case 31:if(i.memoizedState!==null){if(zr(i),i.alternate===null)throw Error(a(340));rs()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(zr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));rs()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return W(In),null;case 4:return ue(),null;case 10:return Ha(i.type),null;case 22:case 23:return zr(i),v0(),r!==null&&W(ss),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ha(Dn),null;case 25:return null;default:return null}}function O4(r,i){switch(r0(i),i.tag){case 3:Ha(Dn),ue();break;case 26:case 27:case 5:Re(i);break;case 4:ue();break;case 31:i.memoizedState!==null&&zr(i);break;case 13:zr(i);break;case 19:W(In);break;case 10:Ha(i.type);break;case 22:case 23:zr(i),v0(),r!==null&&W(ss);break;case 24:Ha(Dn)}}function tl(r,i){try{var l=i.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var b=f.next;l=b;do{if((l.tag&r)===r){f=void 0;var y=l.create,C=l.inst;f=y(),C.destroy=f}l=l.next}while(l!==b)}}catch(L){rn(i,i.return,L)}}function Ei(r,i,l){try{var f=i.updateQueue,b=f!==null?f.lastEffect:null;if(b!==null){var y=b.next;f=y;do{if((f.tag&r)===r){var C=f.inst,L=C.destroy;if(L!==void 0){C.destroy=void 0,b=i;var ie=l,be=L;try{be()}catch(Se){rn(b,ie,Se)}}}f=f.next}while(f!==y)}}catch(Se){rn(i,i.return,Se)}}function D4(r){var i=r.updateQueue;if(i!==null){var l=r.stateNode;try{Eg(i,l)}catch(f){rn(r,r.return,f)}}}function j4(r,i,l){l.props=ds(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(f){rn(r,i,f)}}function nl(r,i){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof l=="function"?r.refCleanup=l(f):l.current=f}}catch(b){rn(r,i,b)}}function wa(r,i){var l=r.ref,f=r.refCleanup;if(l!==null)if(typeof f=="function")try{f()}catch(b){rn(r,i,b)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(b){rn(r,i,b)}else l.current=null}function L4(r){var i=r.type,l=r.memoizedProps,f=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&f.focus();break e;case"img":l.src?f.src=l.src:l.srcSet&&(f.srcset=l.srcSet)}}catch(b){rn(r,r.return,b)}}function Z0(r,i,l){try{var f=r.stateNode;L8(f,r.type,l,i),f[Tn]=i}catch(b){rn(r,r.return,b)}}function z4(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&_i(r.type)||r.tag===4}function X0(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||z4(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&_i(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Q0(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(r),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=$e));else if(f!==4&&(f===27&&_i(r.type)&&(l=r.stateNode,i=null),r=r.child,r!==null))for(Q0(r,i,l),r=r.sibling;r!==null;)Q0(r,i,l),r=r.sibling}function $c(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(f!==4&&(f===27&&_i(r.type)&&(l=r.stateNode),r=r.child,r!==null))for($c(r,i,l),r=r.sibling;r!==null;)$c(r,i,l),r=r.sibling}function B4(r){var i=r.stateNode,l=r.memoizedProps;try{for(var f=r.type,b=i.attributes;b.length;)i.removeAttributeNode(b[0]);ar(i,f,l),i[Wt]=r,i[Tn]=l}catch(y){rn(r,r.return,y)}}var Ga=!1,zn=!1,J0=!1,q4=typeof WeakSet=="function"?WeakSet:Set,Zn=null;function p8(r,i){if(r=r.containerInfo,wf=uu,r=Xp(r),Vd(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var b=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var C=0,L=-1,ie=-1,be=0,Se=0,Ce=r,ve=null;t:for(;;){for(var xe;Ce!==l||b!==0&&Ce.nodeType!==3||(L=C+b),Ce!==y||f!==0&&Ce.nodeType!==3||(ie=C+f),Ce.nodeType===3&&(C+=Ce.nodeValue.length),(xe=Ce.firstChild)!==null;)ve=Ce,Ce=xe;for(;;){if(Ce===r)break t;if(ve===l&&++be===b&&(L=C),ve===y&&++Se===f&&(ie=C),(xe=Ce.nextSibling)!==null)break;Ce=ve,ve=Ce.parentNode}Ce=xe}l=L===-1||ie===-1?null:{start:L,end:ie}}else l=null}l=l||{start:0,end:0}}else l=null;for(kf={focusedElem:r,selectionRange:l},uu=!1,Zn=i;Zn!==null;)if(i=Zn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Zn=r;else for(;Zn!==null;){switch(i=Zn,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)b=r[l],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,l=i,b=y.memoizedProps,y=y.memoizedState,f=l.stateNode;try{var Ye=ds(l.type,b);r=f.getSnapshotBeforeUpdate(Ye,y),f.__reactInternalSnapshotBeforeUpdate=r}catch(dt){rn(l,l.return,dt)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,l=r.nodeType,l===9)Tf(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Tf(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,Zn=r;break}Zn=i.return}}function H4(r,i,l){var f=l.flags;switch(l.tag){case 0:case 11:case 15:Ka(r,l),f&4&&tl(5,l);break;case 1:if(Ka(r,l),f&4)if(r=l.stateNode,i===null)try{r.componentDidMount()}catch(C){rn(l,l.return,C)}else{var b=ds(l.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(b,i,r.__reactInternalSnapshotBeforeUpdate)}catch(C){rn(l,l.return,C)}}f&64&&D4(l),f&512&&nl(l,l.return);break;case 3:if(Ka(r,l),f&64&&(r=l.updateQueue,r!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Eg(r,i)}catch(C){rn(l,l.return,C)}}break;case 27:i===null&&f&4&&B4(l);case 26:case 5:Ka(r,l),i===null&&f&4&&L4(l),f&512&&nl(l,l.return);break;case 12:Ka(r,l);break;case 31:Ka(r,l),f&4&&$4(r,l);break;case 13:Ka(r,l),f&4&&P4(r,l),f&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=E8.bind(null,l),P8(r,l))));break;case 22:if(f=l.memoizedState!==null||Ga,!f){i=i!==null&&i.memoizedState!==null||zn,b=Ga;var y=zn;Ga=f,(zn=i)&&!y?Ya(r,l,(l.subtreeFlags&8772)!==0):Ka(r,l),Ga=b,zn=y}break;case 30:break;default:Ka(r,l)}}function U4(r){var i=r.alternate;i!==null&&(r.alternate=null,U4(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Da(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var bn=null,wr=!1;function Va(r,i,l){for(l=l.child;l!==null;)F4(r,i,l),l=l.sibling}function F4(r,i,l){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Pt,l)}catch{}switch(l.tag){case 26:zn||wa(l,i),Va(r,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:zn||wa(l,i);var f=bn,b=wr;_i(l.type)&&(bn=l.stateNode,wr=!1),Va(r,i,l),dl(l.stateNode),bn=f,wr=b;break;case 5:zn||wa(l,i);case 6:if(f=bn,b=wr,bn=null,Va(r,i,l),bn=f,wr=b,bn!==null)if(wr)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(l.stateNode)}catch(y){rn(l,i,y)}else try{bn.removeChild(l.stateNode)}catch(y){rn(l,i,y)}break;case 18:bn!==null&&(wr?(r=bn,D2(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),co(r)):D2(bn,l.stateNode));break;case 4:f=bn,b=wr,bn=l.stateNode.containerInfo,wr=!0,Va(r,i,l),bn=f,wr=b;break;case 0:case 11:case 14:case 15:Ei(2,l,i),zn||Ei(4,l,i),Va(r,i,l);break;case 1:zn||(wa(l,i),f=l.stateNode,typeof f.componentWillUnmount=="function"&&j4(l,i,f)),Va(r,i,l);break;case 21:Va(r,i,l);break;case 22:zn=(f=zn)||l.memoizedState!==null,Va(r,i,l),zn=f;break;default:Va(r,i,l)}}function $4(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{co(r)}catch(l){rn(i,i.return,l)}}}function P4(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{co(r)}catch(l){rn(i,i.return,l)}}function g8(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new q4),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new q4),i;default:throw Error(a(435,r.tag))}}function Pc(r,i){var l=g8(r);i.forEach(function(f){if(!l.has(f)){l.add(f);var b=T8.bind(null,r,f);f.then(b,b)}})}function kr(r,i){var l=i.deletions;if(l!==null)for(var f=0;f<l.length;f++){var b=l[f],y=r,C=i,L=C;e:for(;L!==null;){switch(L.tag){case 27:if(_i(L.type)){bn=L.stateNode,wr=!1;break e}break;case 5:bn=L.stateNode,wr=!1;break e;case 3:case 4:bn=L.stateNode.containerInfo,wr=!0;break e}L=L.return}if(bn===null)throw Error(a(160));F4(y,C,b),bn=null,wr=!1,y=b.alternate,y!==null&&(y.return=null),b.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)G4(i,r),i=i.sibling}var fa=null;function G4(r,i){var l=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:kr(i,r),Sr(r),f&4&&(Ei(3,r,r.return),tl(3,r),Ei(5,r,r.return));break;case 1:kr(i,r),Sr(r),f&512&&(zn||l===null||wa(l,l.return)),f&64&&Ga&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?f:l.concat(f))));break;case 26:var b=fa;if(kr(i,r),Sr(r),f&512&&(zn||l===null||wa(l,l.return)),f&4){var y=l!==null?l.memoizedState:null;if(f=r.memoizedState,l===null)if(f===null)if(r.stateNode===null){e:{f=r.type,l=r.memoizedProps,b=b.ownerDocument||b;t:switch(f){case"title":y=b.getElementsByTagName("title")[0],(!y||y[Oa]||y[Wt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=b.createElement(f),b.head.insertBefore(y,b.querySelector("head > title"))),ar(y,f,l),y[Wt]=r,wn(y),f=y;break e;case"link":var C=G2("link","href",b).get(f+(l.href||""));if(C){for(var L=0;L<C.length;L++)if(y=C[L],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){C.splice(L,1);break t}}y=b.createElement(f),ar(y,f,l),b.head.appendChild(y);break;case"meta":if(C=G2("meta","content",b).get(f+(l.content||""))){for(L=0;L<C.length;L++)if(y=C[L],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){C.splice(L,1);break t}}y=b.createElement(f),ar(y,f,l),b.head.appendChild(y);break;default:throw Error(a(468,f))}y[Wt]=r,wn(y),f=y}r.stateNode=f}else V2(b,r.type,r.stateNode);else r.stateNode=P2(b,f,r.memoizedProps);else y!==f?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,f===null?V2(b,r.type,r.stateNode):P2(b,f,r.memoizedProps)):f===null&&r.stateNode!==null&&Z0(r,r.memoizedProps,l.memoizedProps)}break;case 27:kr(i,r),Sr(r),f&512&&(zn||l===null||wa(l,l.return)),l!==null&&f&4&&Z0(r,r.memoizedProps,l.memoizedProps);break;case 5:if(kr(i,r),Sr(r),f&512&&(zn||l===null||wa(l,l.return)),r.flags&32){b=r.stateNode;try{ht(b,"")}catch(Ye){rn(r,r.return,Ye)}}f&4&&r.stateNode!=null&&(b=r.memoizedProps,Z0(r,b,l!==null?l.memoizedProps:b)),f&1024&&(J0=!0);break;case 6:if(kr(i,r),Sr(r),f&4){if(r.stateNode===null)throw Error(a(162));f=r.memoizedProps,l=r.stateNode;try{l.nodeValue=f}catch(Ye){rn(r,r.return,Ye)}}break;case 3:if(su=null,b=fa,fa=au(i.containerInfo),kr(i,r),fa=b,Sr(r),f&4&&l!==null&&l.memoizedState.isDehydrated)try{co(i.containerInfo)}catch(Ye){rn(r,r.return,Ye)}J0&&(J0=!1,V4(r));break;case 4:f=fa,fa=au(r.stateNode.containerInfo),kr(i,r),Sr(r),fa=f;break;case 12:kr(i,r),Sr(r);break;case 31:kr(i,r),Sr(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Pc(r,f)));break;case 13:kr(i,r),Sr(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Vc=Ue()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Pc(r,f)));break;case 22:b=r.memoizedState!==null;var ie=l!==null&&l.memoizedState!==null,be=Ga,Se=zn;if(Ga=be||b,zn=Se||ie,kr(i,r),zn=Se,Ga=be,Sr(r),f&8192)e:for(i=r.stateNode,i._visibility=b?i._visibility&-2:i._visibility|1,b&&(l===null||ie||Ga||zn||fs(r)),l=null,i=r;;){if(i.tag===5||i.tag===26){if(l===null){ie=l=i;try{if(y=ie.stateNode,b)C=y.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{L=ie.stateNode;var Ce=ie.memoizedProps.style,ve=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;L.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Ye){rn(ie,ie.return,Ye)}}}else if(i.tag===6){if(l===null){ie=i;try{ie.stateNode.nodeValue=b?"":ie.memoizedProps}catch(Ye){rn(ie,ie.return,Ye)}}}else if(i.tag===18){if(l===null){ie=i;try{var xe=ie.stateNode;b?j2(xe,!0):j2(ie.stateNode,!1)}catch(Ye){rn(ie,ie.return,Ye)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=r.updateQueue,f!==null&&(l=f.retryQueue,l!==null&&(f.retryQueue=null,Pc(r,l))));break;case 19:kr(i,r),Sr(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Pc(r,f)));break;case 30:break;case 21:break;default:kr(i,r),Sr(r)}}function Sr(r){var i=r.flags;if(i&2){try{for(var l,f=r.return;f!==null;){if(z4(f)){l=f;break}f=f.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var b=l.stateNode,y=X0(r);$c(r,y,b);break;case 5:var C=l.stateNode;l.flags&32&&(ht(C,""),l.flags&=-33);var L=X0(r);$c(r,L,C);break;case 3:case 4:var ie=l.stateNode.containerInfo,be=X0(r);Q0(r,be,ie);break;default:throw Error(a(161))}}catch(Se){rn(r,r.return,Se)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function V4(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;V4(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Ka(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)H4(r,i.alternate,i),i=i.sibling}function fs(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ei(4,i,i.return),fs(i);break;case 1:wa(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&j4(i,i.return,l),fs(i);break;case 27:dl(i.stateNode);case 26:case 5:wa(i,i.return),fs(i);break;case 22:i.memoizedState===null&&fs(i);break;case 30:fs(i);break;default:fs(i)}r=r.sibling}}function Ya(r,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,b=r,y=i,C=y.flags;switch(y.tag){case 0:case 11:case 15:Ya(b,y,l),tl(4,y);break;case 1:if(Ya(b,y,l),f=y,b=f.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(be){rn(f,f.return,be)}if(f=y,b=f.updateQueue,b!==null){var L=f.stateNode;try{var ie=b.shared.hiddenCallbacks;if(ie!==null)for(b.shared.hiddenCallbacks=null,b=0;b<ie.length;b++)Sg(ie[b],L)}catch(be){rn(f,f.return,be)}}l&&C&64&&D4(y),nl(y,y.return);break;case 27:B4(y);case 26:case 5:Ya(b,y,l),l&&f===null&&C&4&&L4(y),nl(y,y.return);break;case 12:Ya(b,y,l);break;case 31:Ya(b,y,l),l&&C&4&&$4(b,y);break;case 13:Ya(b,y,l),l&&C&4&&P4(b,y);break;case 22:y.memoizedState===null&&Ya(b,y,l),nl(y,y.return);break;case 30:break;default:Ya(b,y,l)}i=i.sibling}}function ef(r,i){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&Fo(l))}function tf(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Fo(r))}function ha(r,i,l,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)K4(r,i,l,f),i=i.sibling}function K4(r,i,l,f){var b=i.flags;switch(i.tag){case 0:case 11:case 15:ha(r,i,l,f),b&2048&&tl(9,i);break;case 1:ha(r,i,l,f);break;case 3:ha(r,i,l,f),b&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Fo(r)));break;case 12:if(b&2048){ha(r,i,l,f),r=i.stateNode;try{var y=i.memoizedProps,C=y.id,L=y.onPostCommit;typeof L=="function"&&L(C,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ie){rn(i,i.return,ie)}}else ha(r,i,l,f);break;case 31:ha(r,i,l,f);break;case 13:ha(r,i,l,f);break;case 23:break;case 22:y=i.stateNode,C=i.alternate,i.memoizedState!==null?y._visibility&2?ha(r,i,l,f):rl(r,i):y._visibility&2?ha(r,i,l,f):(y._visibility|=2,Qs(r,i,l,f,(i.subtreeFlags&10256)!==0||!1)),b&2048&&ef(C,i);break;case 24:ha(r,i,l,f),b&2048&&tf(i.alternate,i);break;default:ha(r,i,l,f)}}function Qs(r,i,l,f,b){for(b=b&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var y=r,C=i,L=l,ie=f,be=C.flags;switch(C.tag){case 0:case 11:case 15:Qs(y,C,L,ie,b),tl(8,C);break;case 23:break;case 22:var Se=C.stateNode;C.memoizedState!==null?Se._visibility&2?Qs(y,C,L,ie,b):rl(y,C):(Se._visibility|=2,Qs(y,C,L,ie,b)),b&&be&2048&&ef(C.alternate,C);break;case 24:Qs(y,C,L,ie,b),b&&be&2048&&tf(C.alternate,C);break;default:Qs(y,C,L,ie,b)}i=i.sibling}}function rl(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=r,f=i,b=f.flags;switch(f.tag){case 22:rl(l,f),b&2048&&ef(f.alternate,f);break;case 24:rl(l,f),b&2048&&tf(f.alternate,f);break;default:rl(l,f)}i=i.sibling}}var al=8192;function Js(r,i,l){if(r.subtreeFlags&al)for(r=r.child;r!==null;)Y4(r,i,l),r=r.sibling}function Y4(r,i,l){switch(r.tag){case 26:Js(r,i,l),r.flags&al&&r.memoizedState!==null&&nw(l,fa,r.memoizedState,r.memoizedProps);break;case 5:Js(r,i,l);break;case 3:case 4:var f=fa;fa=au(r.stateNode.containerInfo),Js(r,i,l),fa=f;break;case 22:r.memoizedState===null&&(f=r.alternate,f!==null&&f.memoizedState!==null?(f=al,al=16777216,Js(r,i,l),al=f):Js(r,i,l));break;default:Js(r,i,l)}}function W4(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function il(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];Zn=f,X4(f,r)}W4(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Z4(r),r=r.sibling}function Z4(r){switch(r.tag){case 0:case 11:case 15:il(r),r.flags&2048&&Ei(9,r,r.return);break;case 3:il(r);break;case 12:il(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Gc(r)):il(r);break;default:il(r)}}function Gc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];Zn=f,X4(f,r)}W4(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ei(8,i,i.return),Gc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Gc(i));break;default:Gc(i)}r=r.sibling}}function X4(r,i){for(;Zn!==null;){var l=Zn;switch(l.tag){case 0:case 11:case 15:Ei(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var f=l.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Fo(l.memoizedState.cache)}if(f=l.child,f!==null)f.return=l,Zn=f;else e:for(l=r;Zn!==null;){f=Zn;var b=f.sibling,y=f.return;if(U4(f),f===l){Zn=null;break e}if(b!==null){b.return=y,Zn=b;break e}Zn=y}}}var b8={getCacheForType:function(r){var i=nr(Dn),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l},cacheSignal:function(){return nr(Dn).controller.signal}},v8=typeof WeakMap=="function"?WeakMap:Map,Zt=0,ln=null,jt=null,Ut=0,nn=0,Br=null,Ti=!1,eo=!1,nf=!1,Wa=0,Rn=0,Ci=0,hs=0,rf=0,qr=0,to=0,sl=null,Er=null,af=!1,Vc=0,Q4=0,Kc=1/0,Yc=null,Ri=null,Gn=0,Ni=null,no=null,Za=0,sf=0,of=null,J4=null,ol=0,lf=null;function Hr(){return(Zt&2)!==0&&Ut!==0?Ut&-Ut:I.T!==null?mf():ga()}function e2(){if(qr===0)if((Ut&536870912)===0||$t){var r=vt;vt<<=1,(vt&3932160)===0&&(vt=262144),qr=r}else qr=536870912;return r=Lr.current,r!==null&&(r.flags|=32),qr}function Tr(r,i,l){(r===ln&&(nn===2||nn===9)||r.cancelPendingCommit!==null)&&(ro(r,0),Ai(r,Ut,qr,!1)),Tt(r,l),((Zt&2)===0||r!==ln)&&(r===ln&&((Zt&2)===0&&(hs|=l),Rn===4&&Ai(r,Ut,qr,!1)),ka(r))}function t2(r,i,l){if((Zt&6)!==0)throw Error(a(327));var f=!l&&(i&127)===0&&(i&r.expiredLanes)===0||ke(r,i),b=f?w8(r,i):uf(r,i,!0),y=f;do{if(b===0){eo&&!f&&Ai(r,i,0,!1);break}else{if(l=r.current.alternate,y&&!y8(l)){b=uf(r,i,!1),y=!1;continue}if(b===2){if(y=i,r.errorRecoveryDisabledLanes&y)var C=0;else C=r.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){i=C;e:{var L=r;b=sl;var ie=L.current.memoizedState.isDehydrated;if(ie&&(ro(L,C).flags|=256),C=uf(L,C,!1),C!==2){if(nf&&!ie){L.errorRecoveryDisabledLanes|=y,hs|=y,b=4;break e}y=Er,Er=b,y!==null&&(Er===null?Er=y:Er.push.apply(Er,y))}b=C}if(y=!1,b!==2)continue}}if(b===1){ro(r,0),Ai(r,i,0,!0);break}e:{switch(f=r,y=b,y){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Ai(f,i,qr,!Ti);break e;case 2:Er=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(b=Vc+300-Ue(),10<b)){if(Ai(f,i,qr,!Ti),ae(f,0,!0)!==0)break e;Za=i,f.timeoutHandle=M2(n2.bind(null,f,l,Er,Yc,af,i,qr,hs,to,Ti,y,"Throttled",-0,0),b);break e}n2(f,l,Er,Yc,af,i,qr,hs,to,Ti,y,null,-0,0)}}break}while(!0);ka(r)}function n2(r,i,l,f,b,y,C,L,ie,be,Se,Ce,ve,xe){if(r.timeoutHandle=-1,Ce=i.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$e},Y4(i,y,Ce);var Ye=(y&62914560)===y?Vc-Ue():(y&4194048)===y?Q4-Ue():0;if(Ye=rw(Ce,Ye),Ye!==null){Za=y,r.cancelPendingCommit=Ye(u2.bind(null,r,i,y,l,f,b,C,L,ie,Se,Ce,null,ve,xe)),Ai(r,y,C,!be);return}}u2(r,i,y,l,f,b,C,L,ie)}function y8(r){for(var i=r;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var f=0;f<l.length;f++){var b=l[f],y=b.getSnapshot;b=b.value;try{if(!Dr(y(),b))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ai(r,i,l,f){i&=~rf,i&=~hs,r.suspendedLanes|=i,r.pingedLanes&=~i,f&&(r.warmLanes|=i),f=r.expirationTimes;for(var b=i;0<b;){var y=31-Et(b),C=1<<y;f[y]=-1,b&=~C}l!==0&&Pe(r,l,i)}function Wc(){return(Zt&6)===0?(ll(0),!1):!0}function cf(){if(jt!==null){if(nn===0)var r=jt.return;else r=jt,qa=as=null,E0(r),Ks=null,Po=0,r=jt;for(;r!==null;)O4(r.alternate,r),r=r.return;jt=null}}function ro(r,i){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,q8(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),Za=0,cf(),ln=r,jt=l=za(r.current,null),Ut=i,nn=0,Br=null,Ti=!1,eo=ke(r,i),nf=!1,to=qr=rf=hs=Ci=Rn=0,Er=sl=null,af=!1,(i&8)!==0&&(i|=i&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=i;0<f;){var b=31-Et(f),y=1<<b;i|=r[b],f&=~y}return Wa=i,gc(),l}function r2(r,i){Ct=null,I.H=Qo,i===Vs||i===Ec?(i=yg(),nn=3):i===f0?(i=yg(),nn=4):nn=i===H0?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Br=i,jt===null&&(Rn=1,Bc(r,Xr(i,r.current)))}function a2(){var r=Lr.current;return r===null?!0:(Ut&4194048)===Ut?ta===null:(Ut&62914560)===Ut||(Ut&536870912)!==0?r===ta:!1}function i2(){var r=I.H;return I.H=Qo,r===null?Qo:r}function s2(){var r=I.A;return I.A=b8,r}function Zc(){Rn=4,Ti||(Ut&4194048)!==Ut&&Lr.current!==null||(eo=!0),(Ci&134217727)===0&&(hs&134217727)===0||ln===null||Ai(ln,Ut,qr,!1)}function uf(r,i,l){var f=Zt;Zt|=2;var b=i2(),y=s2();(ln!==r||Ut!==i)&&(Yc=null,ro(r,i)),i=!1;var C=Rn;e:do try{if(nn!==0&&jt!==null){var L=jt,ie=Br;switch(nn){case 8:cf(),C=6;break e;case 3:case 2:case 9:case 6:Lr.current===null&&(i=!0);var be=nn;if(nn=0,Br=null,ao(r,L,ie,be),l&&eo){C=0;break e}break;default:be=nn,nn=0,Br=null,ao(r,L,ie,be)}}x8(),C=Rn;break}catch(Se){r2(r,Se)}while(!0);return i&&r.shellSuspendCounter++,qa=as=null,Zt=f,I.H=b,I.A=y,jt===null&&(ln=null,Ut=0,gc()),C}function x8(){for(;jt!==null;)o2(jt)}function w8(r,i){var l=Zt;Zt|=2;var f=i2(),b=s2();ln!==r||Ut!==i?(Yc=null,Kc=Ue()+500,ro(r,i)):eo=ke(r,i);e:do try{if(nn!==0&&jt!==null){i=jt;var y=Br;t:switch(nn){case 1:nn=0,Br=null,ao(r,i,y,1);break;case 2:case 9:if(bg(y)){nn=0,Br=null,l2(i);break}i=function(){nn!==2&&nn!==9||ln!==r||(nn=7),ka(r)},y.then(i,i);break e;case 3:nn=7;break e;case 4:nn=5;break e;case 7:bg(y)?(nn=0,Br=null,l2(i)):(nn=0,Br=null,ao(r,i,y,7));break;case 5:var C=null;switch(jt.tag){case 26:C=jt.memoizedState;case 5:case 27:var L=jt;if(C?K2(C):L.stateNode.complete){nn=0,Br=null;var ie=L.sibling;if(ie!==null)jt=ie;else{var be=L.return;be!==null?(jt=be,Xc(be)):jt=null}break t}}nn=0,Br=null,ao(r,i,y,5);break;case 6:nn=0,Br=null,ao(r,i,y,6);break;case 8:cf(),Rn=6;break e;default:throw Error(a(462))}}k8();break}catch(Se){r2(r,Se)}while(!0);return qa=as=null,I.H=f,I.A=b,Zt=l,jt!==null?0:(ln=null,Ut=0,gc(),Rn)}function k8(){for(;jt!==null&&!Be();)o2(jt)}function o2(r){var i=_4(r.alternate,r,Wa);r.memoizedProps=r.pendingProps,i===null?Xc(r):jt=i}function l2(r){var i=r,l=i.alternate;switch(i.tag){case 15:case 0:i=T4(l,i,i.pendingProps,i.type,void 0,Ut);break;case 11:i=T4(l,i,i.pendingProps,i.type.render,i.ref,Ut);break;case 5:E0(i);default:O4(l,i),i=jt=sg(i,Wa),i=_4(l,i,Wa)}r.memoizedProps=r.pendingProps,i===null?Xc(r):jt=i}function ao(r,i,l,f){qa=as=null,E0(i),Ks=null,Po=0;var b=i.return;try{if(u8(r,b,i,l,Ut)){Rn=1,Bc(r,Xr(l,r.current)),jt=null;return}}catch(y){if(b!==null)throw jt=b,y;Rn=1,Bc(r,Xr(l,r.current)),jt=null;return}i.flags&32768?($t||f===1?r=!0:eo||(Ut&536870912)!==0?r=!1:(Ti=r=!0,(f===2||f===9||f===3||f===6)&&(f=Lr.current,f!==null&&f.tag===13&&(f.flags|=16384))),c2(i,r)):Xc(i)}function Xc(r){var i=r;do{if((i.flags&32768)!==0){c2(i,Ti);return}r=i.return;var l=h8(i.alternate,i,Wa);if(l!==null){jt=l;return}if(i=i.sibling,i!==null){jt=i;return}jt=i=r}while(i!==null);Rn===0&&(Rn=5)}function c2(r,i){do{var l=m8(r.alternate,r);if(l!==null){l.flags&=32767,jt=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(r=r.sibling,r!==null)){jt=r;return}jt=r=l}while(r!==null);Rn=6,jt=null}function u2(r,i,l,f,b,y,C,L,ie){r.cancelPendingCommit=null;do Qc();while(Gn!==0);if((Zt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(y=i.lanes|i.childLanes,y|=Xd,De(r,l,y,C,L,ie),r===ln&&(jt=ln=null,Ut=0),no=i,Ni=r,Za=l,sf=y,of=b,J4=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,C8(He,function(){return p2(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=I.T,I.T=null,b=K.p,K.p=2,C=Zt,Zt|=4;try{p8(r,i,l)}finally{Zt=C,K.p=b,I.T=f}}Gn=1,d2(),f2(),h2()}}function d2(){if(Gn===1){Gn=0;var r=Ni,i=no,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=I.T,I.T=null;var f=K.p;K.p=2;var b=Zt;Zt|=4;try{G4(i,r);var y=kf,C=Xp(r.containerInfo),L=y.focusedElem,ie=y.selectionRange;if(C!==L&&L&&L.ownerDocument&&Zp(L.ownerDocument.documentElement,L)){if(ie!==null&&Vd(L)){var be=ie.start,Se=ie.end;if(Se===void 0&&(Se=be),"selectionStart"in L)L.selectionStart=be,L.selectionEnd=Math.min(Se,L.value.length);else{var Ce=L.ownerDocument||document,ve=Ce&&Ce.defaultView||window;if(ve.getSelection){var xe=ve.getSelection(),Ye=L.textContent.length,dt=Math.min(ie.start,Ye),on=ie.end===void 0?dt:Math.min(ie.end,Ye);!xe.extend&&dt>on&&(C=on,on=dt,dt=C);var de=Wp(L,dt),le=Wp(L,on);if(de&&le&&(xe.rangeCount!==1||xe.anchorNode!==de.node||xe.anchorOffset!==de.offset||xe.focusNode!==le.node||xe.focusOffset!==le.offset)){var ge=Ce.createRange();ge.setStart(de.node,de.offset),xe.removeAllRanges(),dt>on?(xe.addRange(ge),xe.extend(le.node,le.offset)):(ge.setEnd(le.node,le.offset),xe.addRange(ge))}}}}for(Ce=[],xe=L;xe=xe.parentNode;)xe.nodeType===1&&Ce.push({element:xe,left:xe.scrollLeft,top:xe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Ce.length;L++){var Ee=Ce[L];Ee.element.scrollLeft=Ee.left,Ee.element.scrollTop=Ee.top}}uu=!!wf,kf=wf=null}finally{Zt=b,K.p=f,I.T=l}}r.current=i,Gn=2}}function f2(){if(Gn===2){Gn=0;var r=Ni,i=no,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=I.T,I.T=null;var f=K.p;K.p=2;var b=Zt;Zt|=4;try{H4(r,i.alternate,i)}finally{Zt=b,K.p=f,I.T=l}}Gn=3}}function h2(){if(Gn===4||Gn===3){Gn=0,Qe();var r=Ni,i=no,l=Za,f=J4;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Gn=5:(Gn=0,no=Ni=null,m2(r,r.pendingLanes));var b=r.pendingLanes;if(b===0&&(Ri=null),oa(l),i=i.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Pt,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=I.T,b=K.p,K.p=2,I.T=null;try{for(var y=r.onRecoverableError,C=0;C<f.length;C++){var L=f[C];y(L.value,{componentStack:L.stack})}}finally{I.T=i,K.p=b}}(Za&3)!==0&&Qc(),ka(r),b=r.pendingLanes,(l&261930)!==0&&(b&42)!==0?r===lf?ol++:(ol=0,lf=r):ol=0,ll(0)}}function m2(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Fo(i)))}function Qc(){return d2(),f2(),h2(),p2()}function p2(){if(Gn!==5)return!1;var r=Ni,i=sf;sf=0;var l=oa(Za),f=I.T,b=K.p;try{K.p=32>l?32:l,I.T=null,l=of,of=null;var y=Ni,C=Za;if(Gn=0,no=Ni=null,Za=0,(Zt&6)!==0)throw Error(a(331));var L=Zt;if(Zt|=4,Z4(y.current),K4(y,y.current,C,l),Zt=L,ll(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Pt,y)}catch{}return!0}finally{K.p=b,I.T=f,m2(r,i)}}function g2(r,i,l){i=Xr(l,i),i=q0(r.stateNode,i,2),r=wi(r,i,2),r!==null&&(Tt(r,2),ka(r))}function rn(r,i,l){if(r.tag===3)g2(r,r,l);else for(;i!==null;){if(i.tag===3){g2(i,r,l);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ri===null||!Ri.has(f))){r=Xr(l,r),l=b4(2),f=wi(i,l,2),f!==null&&(v4(l,f,i,r),Tt(f,2),ka(f));break}}i=i.return}}function df(r,i,l){var f=r.pingCache;if(f===null){f=r.pingCache=new v8;var b=new Set;f.set(i,b)}else b=f.get(i),b===void 0&&(b=new Set,f.set(i,b));b.has(l)||(nf=!0,b.add(l),r=S8.bind(null,r,i,l),i.then(r,r))}function S8(r,i,l){var f=r.pingCache;f!==null&&f.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,ln===r&&(Ut&l)===l&&(Rn===4||Rn===3&&(Ut&62914560)===Ut&&300>Ue()-Vc?(Zt&2)===0&&ro(r,0):rf|=l,to===Ut&&(to=0)),ka(r)}function b2(r,i){i===0&&(i=Je()),r=ts(r,i),r!==null&&(Tt(r,i),ka(r))}function E8(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),b2(r,l)}function T8(r,i){var l=0;switch(r.tag){case 31:case 13:var f=r.stateNode,b=r.memoizedState;b!==null&&(l=b.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(a(314))}f!==null&&f.delete(i),b2(r,l)}function C8(r,i){return mt(r,i)}var Jc=null,io=null,ff=!1,eu=!1,hf=!1,Ii=0;function ka(r){r!==io&&r.next===null&&(io===null?Jc=io=r:io=io.next=r),eu=!0,ff||(ff=!0,N8())}function ll(r,i){if(!hf&&eu){hf=!0;do for(var l=!1,f=Jc;f!==null;){if(r!==0){var b=f.pendingLanes;if(b===0)var y=0;else{var C=f.suspendedLanes,L=f.pingedLanes;y=(1<<31-Et(42|r)+1)-1,y&=b&~(C&~L),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,w2(f,y))}else y=Ut,y=ae(f,f===ln?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||ke(f,y)||(l=!0,w2(f,y));f=f.next}while(l);hf=!1}}function R8(){v2()}function v2(){eu=ff=!1;var r=0;Ii!==0&&B8()&&(r=Ii);for(var i=Ue(),l=null,f=Jc;f!==null;){var b=f.next,y=y2(f,i);y===0?(f.next=null,l===null?Jc=b:l.next=b,b===null&&(io=l)):(l=f,(r!==0||(y&3)!==0)&&(eu=!0)),f=b}Gn!==0&&Gn!==5||ll(r),Ii!==0&&(Ii=0)}function y2(r,i){for(var l=r.suspendedLanes,f=r.pingedLanes,b=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var C=31-Et(y),L=1<<C,ie=b[C];ie===-1?((L&l)===0||(L&f)!==0)&&(b[C]=Ne(L,i)):ie<=i&&(r.expiredLanes|=L),y&=~L}if(i=ln,l=Ut,l=ae(r,r===i?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,l===0||r===i&&(nn===2||nn===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&qt(f),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||ke(r,l)){if(i=l&-l,i===r.callbackPriority)return i;switch(f!==null&&qt(f),oa(l)){case 2:case 8:l=fe;break;case 32:l=He;break;case 268435456:l=Fe;break;default:l=He}return f=x2.bind(null,r),l=mt(l,f),r.callbackPriority=i,r.callbackNode=l,i}return f!==null&&f!==null&&qt(f),r.callbackPriority=2,r.callbackNode=null,2}function x2(r,i){if(Gn!==0&&Gn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(Qc()&&r.callbackNode!==l)return null;var f=Ut;return f=ae(r,r===ln?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(t2(r,f,i),y2(r,Ue()),r.callbackNode!=null&&r.callbackNode===l?x2.bind(null,r):null)}function w2(r,i){if(Qc())return null;t2(r,i,!0)}function N8(){H8(function(){(Zt&6)!==0?mt(me,R8):v2()})}function mf(){if(Ii===0){var r=Ps;r===0&&(r=We,We<<=1,(We&261888)===0&&(We=256)),Ii=r}return Ii}function k2(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:hi(""+r)}function S2(r,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,r.id&&l.setAttribute("form",r.id),i.parentNode.insertBefore(l,i),r=new FormData(r),l.parentNode.removeChild(l),r}function A8(r,i,l,f,b){if(i==="submit"&&l&&l.stateNode===b){var y=k2((b[Tn]||null).action),C=f.submitter;C&&(i=(i=C[Tn]||null)?k2(i.formAction):C.getAttribute("formAction"),i!==null&&(y=i,C=null));var L=new fc("action","action",null,f,b);r.push({event:L,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Ii!==0){var ie=C?S2(b,C):new FormData(b);O0(l,{pending:!0,data:ie,method:b.method,action:y},null,ie)}}else typeof y=="function"&&(L.preventDefault(),ie=C?S2(b,C):new FormData(b),O0(l,{pending:!0,data:ie,method:b.method,action:y},y,ie))},currentTarget:b}]})}}for(var pf=0;pf<Zd.length;pf++){var gf=Zd[pf],I8=gf.toLowerCase(),_8=gf[0].toUpperCase()+gf.slice(1);da(I8,"on"+_8)}da(eg,"onAnimationEnd"),da(tg,"onAnimationIteration"),da(ng,"onAnimationStart"),da("dblclick","onDoubleClick"),da("focusin","onFocus"),da("focusout","onBlur"),da(Kx,"onTransitionRun"),da(Yx,"onTransitionStart"),da(Wx,"onTransitionCancel"),da(rg,"onTransitionEnd"),Me("onMouseEnter",["mouseout","mouseover"]),Me("onMouseLeave",["mouseout","mouseover"]),Me("onPointerEnter",["pointerout","pointerover"]),Me("onPointerLeave",["pointerout","pointerover"]),Yr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cl="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(" "),M8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cl));function E2(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var f=r[l],b=f.event;f=f.listeners;e:{var y=void 0;if(i)for(var C=f.length-1;0<=C;C--){var L=f[C],ie=L.instance,be=L.currentTarget;if(L=L.listener,ie!==y&&b.isPropagationStopped())break e;y=L,b.currentTarget=be;try{y(b)}catch(Se){pc(Se)}b.currentTarget=null,y=ie}else for(C=0;C<f.length;C++){if(L=f[C],ie=L.instance,be=L.currentTarget,L=L.listener,ie!==y&&b.isPropagationStopped())break e;y=L,b.currentTarget=be;try{y(b)}catch(Se){pc(Se)}b.currentTarget=null,y=ie}}}}function Lt(r,i){var l=i[ba];l===void 0&&(l=i[ba]=new Set);var f=r+"__bubble";l.has(f)||(T2(i,r,2,!1),l.add(f))}function bf(r,i,l){var f=0;i&&(f|=4),T2(l,r,f,i)}var tu="_reactListening"+Math.random().toString(36).slice(2);function vf(r){if(!r[tu]){r[tu]=!0,Os.forEach(function(l){l!=="selectionchange"&&(M8.has(l)||bf(l,!1,r),bf(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[tu]||(i[tu]=!0,bf("selectionchange",!1,i))}}function T2(r,i,l,f){switch(eb(i)){case 2:var b=sw;break;case 8:b=ow;break;default:b=Of}l=b.bind(null,i,l,r),b=void 0,!zd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),f?b!==void 0?r.addEventListener(i,l,{capture:!0,passive:b}):r.addEventListener(i,l,!0):b!==void 0?r.addEventListener(i,l,{passive:b}):r.addEventListener(i,l,!1)}function yf(r,i,l,f,b){var y=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var C=f.tag;if(C===3||C===4){var L=f.stateNode.containerInfo;if(L===b)break;if(C===4)for(C=f.return;C!==null;){var ie=C.tag;if((ie===3||ie===4)&&C.stateNode.containerInfo===b)return;C=C.return}for(;L!==null;){if(C=Xn(L),C===null)return;if(ie=C.tag,ie===5||ie===6||ie===26||ie===27){f=y=C;continue e}L=L.parentNode}}f=f.return}lc(function(){var be=y,Se=St(l),Ce=[];e:{var ve=ag.get(r);if(ve!==void 0){var xe=fc,Ye=r;switch(r){case"keypress":if(uc(l)===0)break e;case"keydown":case"keyup":xe=Tx;break;case"focusin":Ye="focus",xe=Ud;break;case"focusout":Ye="blur",xe=Ud;break;case"beforeblur":case"afterblur":xe=Ud;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=Op;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=hx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=Nx;break;case eg:case tg:case ng:xe=gx;break;case rg:xe=Ix;break;case"scroll":case"scrollend":xe=dx;break;case"wheel":xe=Mx;break;case"copy":case"cut":case"paste":xe=vx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=jp;break;case"toggle":case"beforetoggle":xe=Dx}var dt=(i&4)!==0,on=!dt&&(r==="scroll"||r==="scrollend"),de=dt?ve!==null?ve+"Capture":null:ve;dt=[];for(var le=be,ge;le!==null;){var Ee=le;if(ge=Ee.stateNode,Ee=Ee.tag,Ee!==5&&Ee!==26&&Ee!==27||ge===null||de===null||(Ee=_o(le,de),Ee!=null&&dt.push(ul(le,Ee,ge))),on)break;le=le.return}0<dt.length&&(ve=new xe(ve,Ye,null,l,Se),Ce.push({event:ve,listeners:dt}))}}if((i&7)===0){e:{if(ve=r==="mouseover"||r==="pointerover",xe=r==="mouseout"||r==="pointerout",ve&&l!==Ze&&(Ye=l.relatedTarget||l.fromElement)&&(Xn(Ye)||Ye[Kr]))break e;if((xe||ve)&&(ve=Se.window===Se?Se:(ve=Se.ownerDocument)?ve.defaultView||ve.parentWindow:window,xe?(Ye=l.relatedTarget||l.toElement,xe=be,Ye=Ye?Xn(Ye):null,Ye!==null&&(on=o(Ye),dt=Ye.tag,Ye!==on||dt!==5&&dt!==27&&dt!==6)&&(Ye=null)):(xe=null,Ye=be),xe!==Ye)){if(dt=Op,Ee="onMouseLeave",de="onMouseEnter",le="mouse",(r==="pointerout"||r==="pointerover")&&(dt=jp,Ee="onPointerLeave",de="onPointerEnter",le="pointer"),on=xe==null?ve:va(xe),ge=Ye==null?ve:va(Ye),ve=new dt(Ee,le+"leave",xe,l,Se),ve.target=on,ve.relatedTarget=ge,Ee=null,Xn(Se)===be&&(dt=new dt(de,le+"enter",Ye,l,Se),dt.target=ge,dt.relatedTarget=on,Ee=dt),on=Ee,xe&&Ye)t:{for(dt=O8,de=xe,le=Ye,ge=0,Ee=de;Ee;Ee=dt(Ee))ge++;Ee=0;for(var at=le;at;at=dt(at))Ee++;for(;0<ge-Ee;)de=dt(de),ge--;for(;0<Ee-ge;)le=dt(le),Ee--;for(;ge--;){if(de===le||le!==null&&de===le.alternate){dt=de;break t}de=dt(de),le=dt(le)}dt=null}else dt=null;xe!==null&&C2(Ce,ve,xe,dt,!1),Ye!==null&&on!==null&&C2(Ce,on,Ye,dt,!0)}}e:{if(ve=be?va(be):window,xe=ve.nodeName&&ve.nodeName.toLowerCase(),xe==="select"||xe==="input"&&ve.type==="file")var Vt=$p;else if(Up(ve))if(Pp)Vt=Px;else{Vt=Fx;var Xe=Ux}else xe=ve.nodeName,!xe||xe.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?be&&fi(be.elementType)&&(Vt=$p):Vt=$x;if(Vt&&(Vt=Vt(r,be))){Fp(Ce,Vt,l,Se);break e}Xe&&Xe(r,ve,be),r==="focusout"&&be&&ve.type==="number"&&be.memoizedProps.value!=null&&ua(ve,"number",ve.value)}switch(Xe=be?va(be):window,r){case"focusin":(Up(Xe)||Xe.contentEditable==="true")&&(Ls=Xe,Kd=be,qo=null);break;case"focusout":qo=Kd=Ls=null;break;case"mousedown":Yd=!0;break;case"contextmenu":case"mouseup":case"dragend":Yd=!1,Qp(Ce,l,Se);break;case"selectionchange":if(Vx)break;case"keydown":case"keyup":Qp(Ce,l,Se)}var At;if($d)e:{switch(r){case"compositionstart":var Ft="onCompositionStart";break e;case"compositionend":Ft="onCompositionEnd";break e;case"compositionupdate":Ft="onCompositionUpdate";break e}Ft=void 0}else js?qp(r,l)&&(Ft="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ft="onCompositionStart");Ft&&(Lp&&l.locale!=="ko"&&(js||Ft!=="onCompositionStart"?Ft==="onCompositionEnd"&&js&&(At=_p()):(mi=Se,Bd="value"in mi?mi.value:mi.textContent,js=!0)),Xe=nu(be,Ft),0<Xe.length&&(Ft=new Dp(Ft,r,null,l,Se),Ce.push({event:Ft,listeners:Xe}),At?Ft.data=At:(At=Hp(l),At!==null&&(Ft.data=At)))),(At=Lx?zx(r,l):Bx(r,l))&&(Ft=nu(be,"onBeforeInput"),0<Ft.length&&(Xe=new Dp("onBeforeInput","beforeinput",null,l,Se),Ce.push({event:Xe,listeners:Ft}),Xe.data=At)),A8(Ce,r,be,l,Se)}E2(Ce,i)})}function ul(r,i,l){return{instance:r,listener:i,currentTarget:l}}function nu(r,i){for(var l=i+"Capture",f=[];r!==null;){var b=r,y=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||y===null||(b=_o(r,l),b!=null&&f.unshift(ul(r,b,y)),b=_o(r,i),b!=null&&f.push(ul(r,b,y))),r.tag===3)return f;r=r.return}return[]}function O8(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function C2(r,i,l,f,b){for(var y=i._reactName,C=[];l!==null&&l!==f;){var L=l,ie=L.alternate,be=L.stateNode;if(L=L.tag,ie!==null&&ie===f)break;L!==5&&L!==26&&L!==27||be===null||(ie=be,b?(be=_o(l,y),be!=null&&C.unshift(ul(l,be,ie))):b||(be=_o(l,y),be!=null&&C.push(ul(l,be,ie)))),l=l.return}C.length!==0&&r.push({event:i,listeners:C})}var D8=/\r\n?/g,j8=/\u0000|\uFFFD/g;function R2(r){return(typeof r=="string"?r:""+r).replace(D8,`
9
- `).replace(j8,"")}function N2(r,i){return i=R2(i),R2(r)===i}function sn(r,i,l,f,b,y){switch(l){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||ht(r,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&ht(r,""+f);break;case"className":ir(r,"class",f);break;case"tabIndex":ir(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":ir(r,l,f);break;case"style":tn(r,f,y);break;case"data":if(i!=="object"){ir(r,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=hi(""+f),r.setAttribute(l,f);break;case"action":case"formAction":if(typeof f=="function"){r.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(i!=="input"&&sn(r,i,"name",b.name,b,null),sn(r,i,"formEncType",b.formEncType,b,null),sn(r,i,"formMethod",b.formMethod,b,null),sn(r,i,"formTarget",b.formTarget,b,null)):(sn(r,i,"encType",b.encType,b,null),sn(r,i,"method",b.method,b,null),sn(r,i,"target",b.target,b,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=hi(""+f),r.setAttribute(l,f);break;case"onClick":f!=null&&(r.onclick=$e);break;case"onScroll":f!=null&&Lt("scroll",r);break;case"onScrollEnd":f!=null&&Lt("scrollend",r);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":r.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){r.removeAttribute("xlink:href");break}l=hi(""+f),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""+f):r.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":f===!0?r.setAttribute(l,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,f):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(l,f):r.removeAttribute(l);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(l):r.setAttribute(l,f);break;case"popover":Lt("beforetoggle",r),Lt("toggle",r),Pn(r,"popover",f);break;case"xlinkActuate":Qn(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Qn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Qn(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Qn(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Qn(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Qn(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Qn(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Qn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Qn(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Pn(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=ja.get(l)||l,Pn(r,l,f))}}function xf(r,i,l,f,b,y){switch(l){case"style":tn(r,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof f=="string"?ht(r,f):(typeof f=="number"||typeof f=="bigint")&&ht(r,""+f);break;case"onScroll":f!=null&&Lt("scroll",r);break;case"onScrollEnd":f!=null&&Lt("scrollend",r);break;case"onClick":f!=null&&(r.onclick=$e);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(b=l.endsWith("Capture"),i=l.slice(2,b?l.length-7:void 0),y=r[Tn]||null,y=y!=null?y[l]:null,typeof y=="function"&&r.removeEventListener(i,y,b),typeof f=="function")){typeof y!="function"&&y!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(i,f,b);break e}l in r?r[l]=f:f===!0?r.setAttribute(l,""):Pn(r,l,f)}}}function ar(r,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Lt("error",r),Lt("load",r);var f=!1,b=!1,y;for(y in l)if(l.hasOwnProperty(y)){var C=l[y];if(C!=null)switch(y){case"src":f=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:sn(r,i,y,C,l,null)}}b&&sn(r,i,"srcSet",l.srcSet,l,null),f&&sn(r,i,"src",l.src,l,null);return;case"input":Lt("invalid",r);var L=y=C=b=null,ie=null,be=null;for(f in l)if(l.hasOwnProperty(f)){var Se=l[f];if(Se!=null)switch(f){case"name":b=Se;break;case"type":C=Se;break;case"checked":ie=Se;break;case"defaultChecked":be=Se;break;case"value":y=Se;break;case"defaultValue":L=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(a(137,i));break;default:sn(r,i,f,Se,l,null)}}Jn(r,y,L,ie,be,C,b,!1);return;case"select":Lt("invalid",r),f=C=y=null;for(b in l)if(l.hasOwnProperty(b)&&(L=l[b],L!=null))switch(b){case"value":y=L;break;case"defaultValue":C=L;break;case"multiple":f=L;default:sn(r,i,b,L,l,null)}i=y,l=C,r.multiple=!!f,i!=null?er(r,!!f,i,!1):l!=null&&er(r,!!f,l,!0);return;case"textarea":Lt("invalid",r),y=b=f=null;for(C in l)if(l.hasOwnProperty(C)&&(L=l[C],L!=null))switch(C){case"value":f=L;break;case"defaultValue":b=L;break;case"children":y=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(a(91));break;default:sn(r,i,C,L,l,null)}Ds(r,f,b,y);return;case"option":for(ie in l)l.hasOwnProperty(ie)&&(f=l[ie],f!=null)&&(ie==="selected"?r.selected=f&&typeof f!="function"&&typeof f!="symbol":sn(r,i,ie,f,l,null));return;case"dialog":Lt("beforetoggle",r),Lt("toggle",r),Lt("cancel",r),Lt("close",r);break;case"iframe":case"object":Lt("load",r);break;case"video":case"audio":for(f=0;f<cl.length;f++)Lt(cl[f],r);break;case"image":Lt("error",r),Lt("load",r);break;case"details":Lt("toggle",r);break;case"embed":case"source":case"link":Lt("error",r),Lt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(be in l)if(l.hasOwnProperty(be)&&(f=l[be],f!=null))switch(be){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:sn(r,i,be,f,l,null)}return;default:if(fi(i)){for(Se in l)l.hasOwnProperty(Se)&&(f=l[Se],f!==void 0&&xf(r,i,Se,f,l,void 0));return}}for(L in l)l.hasOwnProperty(L)&&(f=l[L],f!=null&&sn(r,i,L,f,l,null))}function L8(r,i,l,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,y=null,C=null,L=null,ie=null,be=null,Se=null;for(xe in l){var Ce=l[xe];if(l.hasOwnProperty(xe)&&Ce!=null)switch(xe){case"checked":break;case"value":break;case"defaultValue":ie=Ce;default:f.hasOwnProperty(xe)||sn(r,i,xe,null,f,Ce)}}for(var ve in f){var xe=f[ve];if(Ce=l[ve],f.hasOwnProperty(ve)&&(xe!=null||Ce!=null))switch(ve){case"type":y=xe;break;case"name":b=xe;break;case"checked":be=xe;break;case"defaultChecked":Se=xe;break;case"value":C=xe;break;case"defaultValue":L=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(a(137,i));break;default:xe!==Ce&&sn(r,i,ve,xe,f,Ce)}}Or(r,C,L,ie,be,Se,y,b);return;case"select":xe=C=L=ve=null;for(y in l)if(ie=l[y],l.hasOwnProperty(y)&&ie!=null)switch(y){case"value":break;case"multiple":xe=ie;default:f.hasOwnProperty(y)||sn(r,i,y,null,f,ie)}for(b in f)if(y=f[b],ie=l[b],f.hasOwnProperty(b)&&(y!=null||ie!=null))switch(b){case"value":ve=y;break;case"defaultValue":L=y;break;case"multiple":C=y;default:y!==ie&&sn(r,i,b,y,f,ie)}i=L,l=C,f=xe,ve!=null?er(r,!!l,ve,!1):!!f!=!!l&&(i!=null?er(r,!!l,i,!0):er(r,!!l,l?[]:"",!1));return;case"textarea":xe=ve=null;for(L in l)if(b=l[L],l.hasOwnProperty(L)&&b!=null&&!f.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:sn(r,i,L,null,f,b)}for(C in f)if(b=f[C],y=l[C],f.hasOwnProperty(C)&&(b!=null||y!=null))switch(C){case"value":ve=b;break;case"defaultValue":xe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(a(91));break;default:b!==y&&sn(r,i,C,b,f,y)}sc(r,ve,xe);return;case"option":for(var Ye in l)ve=l[Ye],l.hasOwnProperty(Ye)&&ve!=null&&!f.hasOwnProperty(Ye)&&(Ye==="selected"?r.selected=!1:sn(r,i,Ye,null,f,ve));for(ie in f)ve=f[ie],xe=l[ie],f.hasOwnProperty(ie)&&ve!==xe&&(ve!=null||xe!=null)&&(ie==="selected"?r.selected=ve&&typeof ve!="function"&&typeof ve!="symbol":sn(r,i,ie,ve,f,xe));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 dt in l)ve=l[dt],l.hasOwnProperty(dt)&&ve!=null&&!f.hasOwnProperty(dt)&&sn(r,i,dt,null,f,ve);for(be in f)if(ve=f[be],xe=l[be],f.hasOwnProperty(be)&&ve!==xe&&(ve!=null||xe!=null))switch(be){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(a(137,i));break;default:sn(r,i,be,ve,f,xe)}return;default:if(fi(i)){for(var on in l)ve=l[on],l.hasOwnProperty(on)&&ve!==void 0&&!f.hasOwnProperty(on)&&xf(r,i,on,void 0,f,ve);for(Se in f)ve=f[Se],xe=l[Se],!f.hasOwnProperty(Se)||ve===xe||ve===void 0&&xe===void 0||xf(r,i,Se,ve,f,xe);return}}for(var de in l)ve=l[de],l.hasOwnProperty(de)&&ve!=null&&!f.hasOwnProperty(de)&&sn(r,i,de,null,f,ve);for(Ce in f)ve=f[Ce],xe=l[Ce],!f.hasOwnProperty(Ce)||ve===xe||ve==null&&xe==null||sn(r,i,Ce,ve,f,xe)}function A2(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function z8(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,l=performance.getEntriesByType("resource"),f=0;f<l.length;f++){var b=l[f],y=b.transferSize,C=b.initiatorType,L=b.duration;if(y&&L&&A2(C)){for(C=0,L=b.responseEnd,f+=1;f<l.length;f++){var ie=l[f],be=ie.startTime;if(be>L)break;var Se=ie.transferSize,Ce=ie.initiatorType;Se&&A2(Ce)&&(ie=ie.responseEnd,C+=Se*(ie<L?1:(L-be)/(ie-be)))}if(--f,i+=8*(y+C)/(b.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var wf=null,kf=null;function ru(r){return r.nodeType===9?r:r.ownerDocument}function I2(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _2(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function Sf(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Ef=null;function B8(){var r=window.event;return r&&r.type==="popstate"?r===Ef?!1:(Ef=r,!0):(Ef=null,!1)}var M2=typeof setTimeout=="function"?setTimeout:void 0,q8=typeof clearTimeout=="function"?clearTimeout:void 0,O2=typeof Promise=="function"?Promise:void 0,H8=typeof queueMicrotask=="function"?queueMicrotask:typeof O2<"u"?function(r){return O2.resolve(null).then(r).catch(U8)}:M2;function U8(r){setTimeout(function(){throw r})}function _i(r){return r==="head"}function D2(r,i){var l=i,f=0;do{var b=l.nextSibling;if(r.removeChild(l),b&&b.nodeType===8)if(l=b.data,l==="/$"||l==="/&"){if(f===0){r.removeChild(b),co(i);return}f--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")f++;else if(l==="html")dl(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,dl(l);for(var y=l.firstChild;y;){var C=y.nextSibling,L=y.nodeName;y[Oa]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=C}}else l==="body"&&dl(r.ownerDocument.body);l=b}while(l);co(i)}function j2(r,i){var l=r;r=0;do{var f=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),f&&f.nodeType===8)if(l=f.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=f}while(l)}function Tf(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Tf(l),Da(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function F8(r,i,l,f){for(;r.nodeType===1;){var b=l;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[Oa])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==b.rel||r.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||r.getAttribute("title")!==(b.title==null?null:b.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(b.src==null?null:b.src)||r.getAttribute("type")!==(b.type==null?null:b.type)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var y=b.name==null?null:""+b.name;if(b.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=na(r.nextSibling),r===null)break}return null}function $8(r,i,l){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=na(r.nextSibling),r===null))return null;return r}function L2(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=na(r.nextSibling),r===null))return null;return r}function Cf(r){return r.data==="$?"||r.data==="$~"}function Rf(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function P8(r,i){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||l.readyState!=="loading")i();else{var f=function(){i(),l.removeEventListener("DOMContentLoaded",f)};l.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}function na(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var Nf=null;function z2(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(i===0)return na(r.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}r=r.nextSibling}return null}function B2(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return r;i--}else l!=="/$"&&l!=="/&"||i++}r=r.previousSibling}return null}function q2(r,i,l){switch(i=ru(l),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function dl(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Da(r)}var ra=new Map,H2=new Set;function au(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Xa=K.d;K.d={f:G8,r:V8,D:K8,C:Y8,L:W8,m:Z8,X:Q8,S:X8,M:J8};function G8(){var r=Xa.f(),i=Wc();return r||i}function V8(r){var i=la(r);i!==null&&i.tag===5&&i.type==="form"?r4(i):Xa.r(r)}var so=typeof document>"u"?null:document;function U2(r,i,l){var f=so;if(f&&typeof i=="string"&&i){var b=gn(i);b='link[rel="'+r+'"][href="'+b+'"]',typeof l=="string"&&(b+='[crossorigin="'+l+'"]'),H2.has(b)||(H2.add(b),r={rel:r,crossOrigin:l,href:i},f.querySelector(b)===null&&(i=f.createElement("link"),ar(i,"link",r),wn(i),f.head.appendChild(i)))}}function K8(r){Xa.D(r),U2("dns-prefetch",r,null)}function Y8(r,i){Xa.C(r,i),U2("preconnect",r,i)}function W8(r,i,l){Xa.L(r,i,l);var f=so;if(f&&r&&i){var b='link[rel="preload"][as="'+gn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(b+='[imagesrcset="'+gn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(b+='[imagesizes="'+gn(l.imageSizes)+'"]')):b+='[href="'+gn(r)+'"]';var y=b;switch(i){case"style":y=oo(r);break;case"script":y=lo(r)}ra.has(y)||(r=g({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),ra.set(y,r),f.querySelector(b)!==null||i==="style"&&f.querySelector(fl(y))||i==="script"&&f.querySelector(hl(y))||(i=f.createElement("link"),ar(i,"link",r),wn(i),f.head.appendChild(i)))}}function Z8(r,i){Xa.m(r,i);var l=so;if(l&&r){var f=i&&typeof i.as=="string"?i.as:"script",b='link[rel="modulepreload"][as="'+gn(f)+'"][href="'+gn(r)+'"]',y=b;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=lo(r)}if(!ra.has(y)&&(r=g({rel:"modulepreload",href:r},i),ra.set(y,r),l.querySelector(b)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(hl(y)))return}f=l.createElement("link"),ar(f,"link",r),wn(f),l.head.appendChild(f)}}}function X8(r,i,l){Xa.S(r,i,l);var f=so;if(f&&r){var b=ca(f).hoistableStyles,y=oo(r);i=i||"default";var C=b.get(y);if(!C){var L={loading:0,preload:null};if(C=f.querySelector(fl(y)))L.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},l),(l=ra.get(y))&&Af(r,l);var ie=C=f.createElement("link");wn(ie),ar(ie,"link",r),ie._p=new Promise(function(be,Se){ie.onload=be,ie.onerror=Se}),ie.addEventListener("load",function(){L.loading|=1}),ie.addEventListener("error",function(){L.loading|=2}),L.loading|=4,iu(C,i,f)}C={type:"stylesheet",instance:C,count:1,state:L},b.set(y,C)}}}function Q8(r,i){Xa.X(r,i);var l=so;if(l&&r){var f=ca(l).hoistableScripts,b=lo(r),y=f.get(b);y||(y=l.querySelector(hl(b)),y||(r=g({src:r,async:!0},i),(i=ra.get(b))&&If(r,i),y=l.createElement("script"),wn(y),ar(y,"link",r),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(b,y))}}function J8(r,i){Xa.M(r,i);var l=so;if(l&&r){var f=ca(l).hoistableScripts,b=lo(r),y=f.get(b);y||(y=l.querySelector(hl(b)),y||(r=g({src:r,async:!0,type:"module"},i),(i=ra.get(b))&&If(r,i),y=l.createElement("script"),wn(y),ar(y,"link",r),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(b,y))}}function F2(r,i,l,f){var b=(b=V.current)?au(b):null;if(!b)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=oo(l.href),l=ca(b).hoistableStyles,f=l.get(i),f||(f={type:"style",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=oo(l.href);var y=ca(b).hoistableStyles,C=y.get(r);if(C||(b=b.ownerDocument||b,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,C),(y=b.querySelector(fl(r)))&&!y._p&&(C.instance=y,C.state.loading=5),ra.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ra.set(r,l),y||ew(b,r,l,C.state))),i&&f===null)throw Error(a(528,""));return C}if(i&&f!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=lo(l),l=ca(b).hoistableScripts,f=l.get(i),f||(f={type:"script",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function oo(r){return'href="'+gn(r)+'"'}function fl(r){return'link[rel="stylesheet"]['+r+"]"}function $2(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function ew(r,i,l,f){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=r.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),ar(i,"link",l),wn(i),r.head.appendChild(i))}function lo(r){return'[src="'+gn(r)+'"]'}function hl(r){return"script[async]"+r}function P2(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var f=r.querySelector('style[data-href~="'+gn(l.href)+'"]');if(f)return i.instance=f,wn(f),f;var b=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),wn(f),ar(f,"style",b),iu(f,l.precedence,r),i.instance=f;case"stylesheet":b=oo(l.href);var y=r.querySelector(fl(b));if(y)return i.state.loading|=4,i.instance=y,wn(y),y;f=$2(l),(b=ra.get(b))&&Af(f,b),y=(r.ownerDocument||r).createElement("link"),wn(y);var C=y;return C._p=new Promise(function(L,ie){C.onload=L,C.onerror=ie}),ar(y,"link",f),i.state.loading|=4,iu(y,l.precedence,r),i.instance=y;case"script":return y=lo(l.src),(b=r.querySelector(hl(y)))?(i.instance=b,wn(b),b):(f=l,(b=ra.get(y))&&(f=g({},l),If(f,b)),r=r.ownerDocument||r,b=r.createElement("script"),wn(b),ar(b,"link",f),r.head.appendChild(b),i.instance=b);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,iu(f,l.precedence,r));return i.instance}function iu(r,i,l){for(var f=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=f.length?f[f.length-1]:null,y=b,C=0;C<f.length;C++){var L=f[C];if(L.dataset.precedence===i)y=L;else if(y!==b)break}y?y.parentNode.insertBefore(r,y.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(r,i.firstChild))}function Af(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function If(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var su=null;function G2(r,i,l){if(su===null){var f=new Map,b=su=new Map;b.set(l,f)}else b=su,f=b.get(l),f||(f=new Map,b.set(l,f));if(f.has(r))return f;for(f.set(r,null),l=l.getElementsByTagName(r),b=0;b<l.length;b++){var y=l[b];if(!(y[Oa]||y[Wt]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var C=y.getAttribute(i)||"";C=r+C;var L=f.get(C);L?L.push(y):f.set(C,[y])}}return f}function V2(r,i,l){r=r.ownerDocument||r,r.head.insertBefore(l,i==="title"?r.querySelector("head > title"):null)}function tw(r,i,l){if(l===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function K2(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function nw(r,i,l,f){if(l.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var b=oo(f.href),y=i.querySelector(fl(b));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ou.bind(r),i.then(r,r)),l.state.loading|=4,l.instance=y,wn(y);return}y=i.ownerDocument||i,f=$2(f),(b=ra.get(b))&&Af(f,b),y=y.createElement("link"),wn(y);var C=y;C._p=new Promise(function(L,ie){C.onload=L,C.onerror=ie}),ar(y,"link",f),l.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=ou.bind(r),i.addEventListener("load",l),i.addEventListener("error",l))}}var _f=0;function rw(r,i){return r.stylesheets&&r.count===0&&cu(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var f=setTimeout(function(){if(r.stylesheets&&cu(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+i);0<r.imgBytes&&_f===0&&(_f=62500*z8());var b=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&cu(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>_f?50:800)+i);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(f),clearTimeout(b)}}:null}function ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var lu=null;function cu(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,lu=new Map,i.forEach(aw,r),lu=null,ou.call(r))}function aw(r,i){if(!(i.state.loading&4)){var l=lu.get(r);if(l)var f=l.get(null);else{l=new Map,lu.set(r,l);for(var b=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<b.length;y++){var C=b[y];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(l.set(C.dataset.precedence,C),f=C)}f&&l.set(null,f)}b=i.instance,C=b.getAttribute("data-precedence"),y=l.get(C)||f,y===f&&l.set(null,b),l.set(C,b),this.count++,f=ou.bind(this),b.addEventListener("load",f),b.addEventListener("error",f),y?y.parentNode.insertBefore(b,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(b,r.firstChild)),i.state.loading|=4}}var ml={$$typeof:_,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function iw(r,i,l,f,b,y,C,L,ie){this.tag=1,this.containerInfo=r,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=kt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kt(0),this.hiddenUpdates=kt(null),this.identifierPrefix=f,this.onUncaughtError=b,this.onCaughtError=y,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function Y2(r,i,l,f,b,y,C,L,ie,be,Se,Ce){return r=new iw(r,i,l,C,ie,be,Se,Ce,L),i=1,y===!0&&(i|=24),y=jr(3,null,null,i),r.current=y,y.stateNode=r,i=c0(),i.refCount++,r.pooledCache=i,i.refCount++,y.memoizedState={element:f,isDehydrated:l,cache:i},h0(y),r}function W2(r){return r?(r=qs,r):qs}function Z2(r,i,l,f,b,y){b=W2(b),f.context===null?f.context=b:f.pendingContext=b,f=xi(i),f.payload={element:l},y=y===void 0?null:y,y!==null&&(f.callback=y),l=wi(r,f,i),l!==null&&(Tr(l,r,i),Vo(l,r,i))}function X2(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function Mf(r,i){X2(r,i),(r=r.alternate)&&X2(r,i)}function Q2(r){if(r.tag===13||r.tag===31){var i=ts(r,67108864);i!==null&&Tr(i,r,67108864),Mf(r,67108864)}}function J2(r){if(r.tag===13||r.tag===31){var i=Hr();i=fn(i);var l=ts(r,i);l!==null&&Tr(l,r,i),Mf(r,i)}}var uu=!0;function sw(r,i,l,f){var b=I.T;I.T=null;var y=K.p;try{K.p=2,Of(r,i,l,f)}finally{K.p=y,I.T=b}}function ow(r,i,l,f){var b=I.T;I.T=null;var y=K.p;try{K.p=8,Of(r,i,l,f)}finally{K.p=y,I.T=b}}function Of(r,i,l,f){if(uu){var b=Df(f);if(b===null)yf(r,i,f,du,l),tb(r,f);else if(cw(b,r,i,l,f))f.stopPropagation();else if(tb(r,f),i&4&&-1<lw.indexOf(r)){for(;b!==null;){var y=la(b);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var C=Yt(y.pendingLanes);if(C!==0){var L=y;for(L.pendingLanes|=2,L.entangledLanes|=2;C;){var ie=1<<31-Et(C);L.entanglements[1]|=ie,C&=~ie}ka(y),(Zt&6)===0&&(Kc=Ue()+500,ll(0))}}break;case 31:case 13:L=ts(y,2),L!==null&&Tr(L,y,2),Wc(),Mf(y,2)}if(y=Df(f),y===null&&yf(r,i,f,du,l),y===b)break;b=y}b!==null&&f.stopPropagation()}else yf(r,i,f,null,l)}}function Df(r){return r=St(r),jf(r)}var du=null;function jf(r){if(du=null,r=Xn(r),r!==null){var i=o(r);if(i===null)r=null;else{var l=i.tag;if(l===13){if(r=c(i),r!==null)return r;r=null}else if(l===31){if(r=d(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return du=r,null}function eb(r){switch(r){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(st()){case me:return 2;case fe:return 8;case He:case we:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var Lf=!1,Mi=null,Oi=null,Di=null,pl=new Map,gl=new Map,ji=[],lw="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 tb(r,i){switch(r){case"focusin":case"focusout":Mi=null;break;case"dragenter":case"dragleave":Oi=null;break;case"mouseover":case"mouseout":Di=null;break;case"pointerover":case"pointerout":pl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":gl.delete(i.pointerId)}}function bl(r,i,l,f,b,y){return r===null||r.nativeEvent!==y?(r={blockedOn:i,domEventName:l,eventSystemFlags:f,nativeEvent:y,targetContainers:[b]},i!==null&&(i=la(i),i!==null&&Q2(i)),r):(r.eventSystemFlags|=f,i=r.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),r)}function cw(r,i,l,f,b){switch(i){case"focusin":return Mi=bl(Mi,r,i,l,f,b),!0;case"dragenter":return Oi=bl(Oi,r,i,l,f,b),!0;case"mouseover":return Di=bl(Di,r,i,l,f,b),!0;case"pointerover":var y=b.pointerId;return pl.set(y,bl(pl.get(y)||null,r,i,l,f,b)),!0;case"gotpointercapture":return y=b.pointerId,gl.set(y,bl(gl.get(y)||null,r,i,l,f,b)),!0}return!1}function nb(r){var i=Xn(r.target);if(i!==null){var l=o(i);if(l!==null){if(i=l.tag,i===13){if(i=c(l),i!==null){r.blockedOn=i,yr(r.priority,function(){J2(l)});return}}else if(i===31){if(i=d(l),i!==null){r.blockedOn=i,yr(r.priority,function(){J2(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function fu(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=Df(r.nativeEvent);if(l===null){l=r.nativeEvent;var f=new l.constructor(l.type,l);Ze=f,l.target.dispatchEvent(f),Ze=null}else return i=la(l),i!==null&&Q2(i),r.blockedOn=l,!1;i.shift()}return!0}function rb(r,i,l){fu(r)&&l.delete(i)}function uw(){Lf=!1,Mi!==null&&fu(Mi)&&(Mi=null),Oi!==null&&fu(Oi)&&(Oi=null),Di!==null&&fu(Di)&&(Di=null),pl.forEach(rb),gl.forEach(rb)}function hu(r,i){r.blockedOn===i&&(r.blockedOn=null,Lf||(Lf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,uw)))}var mu=null;function ab(r){mu!==r&&(mu=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mu===r&&(mu=null);for(var i=0;i<r.length;i+=3){var l=r[i],f=r[i+1],b=r[i+2];if(typeof f!="function"){if(jf(f||l)===null)continue;break}var y=la(l);y!==null&&(r.splice(i,3),i-=3,O0(y,{pending:!0,data:b,method:l.method,action:f},f,b))}}))}function co(r){function i(ie){return hu(ie,r)}Mi!==null&&hu(Mi,r),Oi!==null&&hu(Oi,r),Di!==null&&hu(Di,r),pl.forEach(i),gl.forEach(i);for(var l=0;l<ji.length;l++){var f=ji[l];f.blockedOn===r&&(f.blockedOn=null)}for(;0<ji.length&&(l=ji[0],l.blockedOn===null);)nb(l),l.blockedOn===null&&ji.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(f=0;f<l.length;f+=3){var b=l[f],y=l[f+1],C=b[Tn]||null;if(typeof y=="function")C||ab(l);else if(C){var L=null;if(y&&y.hasAttribute("formAction")){if(b=y,C=y[Tn]||null)L=C.formAction;else if(jf(b)!==null)continue}else L=C.action;typeof L=="function"?l[f+1]=L:(l.splice(f,3),f-=3),ab(l)}}}function ib(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(C){return b=C})},focusReset:"manual",scroll:"manual"})}function i(){b!==null&&(b(),b=null),f||setTimeout(l,20)}function l(){if(!f&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,b=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){f=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),b!==null&&(b(),b=null)}}}function zf(r){this._internalRoot=r}pu.prototype.render=zf.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,f=Hr();Z2(l,f,r,i,null,null)},pu.prototype.unmount=zf.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Z2(r.current,2,null,r,null,null),Wc(),i[Kr]=null}};function pu(r){this._internalRoot=r}pu.prototype.unstable_scheduleHydration=function(r){if(r){var i=ga();r={blockedOn:null,target:r,priority:i};for(var l=0;l<ji.length&&i!==0&&i<ji[l].priority;l++);ji.splice(l,0,r),l===0&&nb(r)}};var sb=t.version;if(sb!=="19.2.8")throw Error(a(527,sb,"19.2.8"));K.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=m(i),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var dw={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gu.isDisabled&&gu.supportsFiber)try{Pt=gu.inject(dw),bt=gu}catch{}}return yl.createRoot=function(r,i){if(!s(r))throw Error(a(299));var l=!1,f="",b=h4,y=m4,C=p4;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(b=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError)),i=Y2(r,1,!1,null,null,l,f,null,b,y,C,ib),r[Kr]=i.current,vf(r),new zf(i)},yl.hydrateRoot=function(r,i,l){if(!s(r))throw Error(a(299));var f=!1,b="",y=h4,C=m4,L=p4,ie=null;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(b=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(C=l.onCaughtError),l.onRecoverableError!==void 0&&(L=l.onRecoverableError),l.formState!==void 0&&(ie=l.formState)),i=Y2(r,1,!0,i,l??null,f,b,ie,y,C,L,ib),i.context=W2(null),l=i.current,f=Hr(),f=fn(f),b=xi(f),b.callback=null,wi(l,b,f),l=f,i.current.lanes=l,Tt(i,l),ka(i),r[Kr]=i.current,vf(r),new pu(i)},yl.version="19.2.8",yl}var gb;function xw(){if(gb)return Hf.exports;gb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hf.exports=yw(),Hf.exports}var ww=xw();const Il={"worker-managed-rerun-unsupported":"这次运行由 Console/Worker 启动,不能只从某个节点续跑","workspace-drift":"工作区在上次运行后又改过文件,旧结果不能接着用","controller-drift":"控制器版本已变化,不能接到上次运行上继续","binding-drift":"任务契约或源文件已变化,不能只续跑旧计划","restart-subgraph-contains-unsafe-shell":"下游包含会执行命令的验证步骤,不能只重跑这一段","restart-subgraph-contains-writer":"下游包含会改代码的写入步骤,不能只重跑这一段","restart-subgraph-contains-decision-gate":"下游包含需要人工决策的门禁,不能只重跑这一段","dynamic-rerun-unsupported":"这次运行含动态展开节点,不支持从节点续跑","parent-lifecycle-ineligible":"当前运行状态不允许从节点续跑","convergence-rerun-unsupported":"收敛型运行不支持从节点续跑","evaluation-rerun-unsupported":"带评估的运行不支持从节点续跑","budget-rerun-unsupported":"硬预算运行不支持从节点续跑","workspace-checkpoint-missing":"缺少工作区快照,无法安全地只续跑一段","skill-snapshot-invalid":"技能快照缺失或损坏,不能接到上次运行上继续","unresolved-errors-outside-reset-closure":"选中节点之外还有未解决的失败,只重跑这一段不够","selected-node-missing":"找不到要续跑的起始节点","ambiguous-skipped-rewrite":"跳过的节点有多个上游失败,无法自动选定起点","skipped-without-upstream-error":"该节点被跳过且没有明确的上游失败","parent-facts-invalid":"上次运行的证据不完整或已损坏,不能只续跑一段",RUN_NOT_ACTIVE:"这次运行不在活动状态,不能协作中止",RUN_NOT_CONSOLE_OWNED:"此运行不由当前 Console 持有,暂不支持协作中止",RUNNER_IDENTITY_MISMATCH:"运行身份已变化,不能中止这份过期请求",INTERRUPT_ALREADY_PENDING:"已有一条中止请求等待结算",RUN_ALREADY_TERMINAL:"运行已经结束,没有可中止的活 runner",INTERRUPT_NEEDS_RECONCILE:"中止请求已登记但无法确认 runner 已处理,需要对账"};function kw(){return Object.keys(Il)}function Uu(e){const t=e.trim().replace(/[.…]+$/,"");if(!t)return null;if(Il[t])return{code:t};const n=t.lastIndexOf(":");if(n>0){const a=t.slice(n+1),s=t.slice(0,n);if(Il[a])return{code:a,nodeId:s};const o=kw().find(c=>a.length>=3&&c.startsWith(a));if(o)return{code:o,nodeId:s}}return Il[t]?{code:t}:null}function Sw(e){const t=[];for(const n of e.blockedReasons??[]){const a=Uu(String(n));a&&t.push(a)}for(const n of e.blockingNodes??[]){const a=n.reasonCode?.trim();if(!a)continue;const s=Uu(n.nodeId?`${n.nodeId}:${a}`:a);s&&t.push(s)}if(t.length===0&&e.fallbackMessage?.trim()){const n=e.fallbackMessage.trim().replace(/^从节点重跑不具备安全资格[::]?\s*/,"").replace(/[。..]+$/,"");for(const a of n.split(/[;;]/)){const s=Uu(a);s&&t.push(s)}}return t}function Ew(e){const t=new Map;for(const a of e){const s=t.get(a.code)??[];a.nodeId&&!s.includes(a.nodeId)&&s.push(a.nodeId),t.set(a.code,s)}const n=[];for(const[a,s]of t){const o=Il[a];o&&(s.length>0&&a.startsWith("restart-subgraph-contains-")?n.push(`${o}(${s.join("、")})`):n.push(o))}return n}function Tw(e){return e.join("; ").includes("worker-managed-rerun-unsupported")||e.some(n=>Uu(n)?.code==="worker-managed-rerun-unsupported")?"下一步:请点下方「重新排队 Worker Task」,从头完整执行。":"下一步:请改用「带反馈重新执行任务」,重新生成完整 DAG。"}function G3(e){const t=e.fallbackMessage?.trim();if(t?.startsWith("无法从该节点续跑"))return t;const n=Sw(e),a=Ew(n),s=n.map(c=>c.code),o=Tw(s.length>0?s:[t??""]);return a.length===0?["无法从该节点续跑。这次续跑不够安全(工作区、控制器或下游步骤不允许只重跑一段)。",o].join(`
10
- `):["无法从该节点续跑,因为:",...a.map(c=>`• ${c}`),"",o].join(`
11
- `)}function Cw(e){const t=e.trim();if(!t)return null;if(t.startsWith("无法从该节点续跑"))return t;if(/从节点重跑不具备安全资格|worker-managed-rerun-unsupported|restart-subgraph-contains-|workspace-drift|controller-drift|binding-drift/.test(t))return G3({fallbackMessage:t});if(/action must be a mutation-gate target/i.test(t))return"这个操作不能再走确认门。Worker 启动的任务请直接点「重新排队 Worker Task」;独立运行请点「带反馈重新执行任务」。";if(/cannot read dagReport run facts/i.test(t))return"读不到这次运行的失败报告,不能完整重跑。请先点「查看报告」或「Doctor 诊断」。";if(/dagRerunPlan run facts unavailable/i.test(t))return"读不到节点恢复资格,不能直接改走完整重跑。请先点「从失败节点恢复」查看资格,或先「查看报告」。";if(/node rerun plan is eligible/i.test(t))return"节点恢复是安全的,请改用「从失败节点恢复」,不必重新执行完整任务。";if(/does not support autonomous standaloneTaskRerun/i.test(t))return"当前失败不适合自动完整重跑。请先点「查看报告」,按建议操作。";if(/primaryRecovery requires a human decision/i.test(t))return"这次失败需要人工决策,不能自动重跑。请先点「查看报告」。";if(/is not bound to run/i.test(t))return"填写的任务 ID 与这次运行不匹配。请使用该运行绑定的原任务 ID。";if(/cannot read pool doctor/i.test(t))return"读不到任务队列状态,暂时不能重新排队。请稍后重试,或先跑 Doctor 诊断。";if(/not found in the pool doctor inventory/i.test(t))return"任务队列里找不到这个任务,不能重新排队。请确认 Task ID 来自 Worker 队列,而不是只填了 DAG 运行 ID。";if(/only Failed tasks are retry-eligible/i.test(t)){const n=t.match(/is ([A-Za-z_]+); only Failed/)?.[1];return n?`该任务当前是「${n}」,只有失败(Failed)的任务才能重新排队。`:"只有失败(Failed)的任务才能重新排队。请先确认任务已失败。"}return/featureId .+ does not match the pool task/i.test(t)?"Feature ID 与队列中的任务不一致。请改用队列里记录的 Feature ID,或留空后重试。":/RUN_NOT_CONSOLE_OWNED|不由当前 Console 持有/.test(t)?"此运行不由当前 Console 持有,暂不支持协作中止。请用 Doctor / 报告查看。":/RUNNER_IDENTITY_MISMATCH|运行身份已变化/.test(t)?"运行身份已变化,不能中止这份过期请求。请刷新后再试。":/INTERRUPT_ALREADY_PENDING|已有一条中止请求/.test(t)?"已有一条中止请求等待当前节点安全收敛。请稍候刷新,不要重复提交。":/RUN_ALREADY_TERMINAL|运行已经结束/.test(t)?"运行已经结束,没有可中止的活 runner。请改用报告或对账。":/INTERRUPT_NEEDS_RECONCILE|无法确认 runner 已处理/.test(t)?"中止请求已登记,但无法确认 runner 已处理。请用 Doctor 对账,不要当成已经中止。":/RUN_NOT_ACTIVE/.test(t)?"这次运行不在本机活动目录,或已经不是 running,不能协作中止。":null}function Rw(e){return e==="validate"||e==="apply"||e==="spine"?"contract":e}async function Nw(e,t){const a=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(e)}/prewrite-result`),{credentials:"same-origin"});if(!a.ok)return{ok:!1,status:a.status};const s=await a.json();return!s||typeof s.classification!="string"?{ok:!1,status:a.status}:{ok:!0,result:{schemaVersion:typeof s.schemaVersion=="number"?s.schemaVersion:1,schemaId:typeof s.schemaId=="string"?s.schemaId:"",classification:s.classification,failureCode:typeof s.failureCode=="string"?s.failureCode:null,failureReason:typeof s.failureReason=="string"?s.failureReason:null}}}function Aw(e){return e==="fail"?"未通过":e==="pass"?"通过":"未知/不可判定"}const O1="X-Loop-Console-Confirmation",V3="agent-worker console doctor --repo .",D1=["LOW","MED","HIGH"];function Iw(e){if(e.length===0)return"模型值不能为空";if(e.trim()!==e)return"模型值不能包含首尾空白";if(e==="default")return"default 是保留哨兵,不能作为模型值";if(e.startsWith("/")||e.endsWith("/")||e.includes("//"))return"provider/model 格式非法:不允许 /model、provider/ 或 a//b"}function _w(e){const t={};for(const n of D1){const a=Iw(e[n]);a&&(t[n]=a)}return t}function bb(e){return{LOW:e?.LOW?.value??"",MED:e?.MED?.value??"",HIGH:e?.HIGH?.value??""}}function Mw(e){return D1.every(t=>e[t]===void 0)}const Bm=[{kind:"standard",label:"后端研发(默认 DAG)",hint:"生成标准 hybrid DAG(contract → implement → verify)"},{kind:"frontend-implementation",label:"前端研发",hint:"生成 frontend-implementation 专用节点链"},{kind:"backend-test",label:"后端测试",hint:"生成 backend-test-dag(分析 / 用例 / pytest)"},{kind:"frontend-test",label:"前端测试",hint:"生成 frontend-test-dag(RAG 用例 + Playwright CLI)"}],K3={"setup-required":"需要设置",ready:"已就绪",degraded:"降级可用",unknown:"未知"},Ow={idle:"未探测",match:"匹配",mismatch:"仓库不匹配",unavailable:"不可用"},Y3={low:"低",medium:"中",high:"高"},W3={"validation-failed":"校验失败","contract-drift":"契约漂移","runtime-mismatch":"运行时不匹配","pause-on-human":"等待人工","verification-failed":"验证失败","orphan-unknown":"孤立/未知","terminal-failed":"已终止(失败)","terminal-succeeded":"已终止(成功)","needs-reconcile":"需要对账","running-active":"正在运行"},Dw={idle:"空闲","not-started":"未开始","not-run":"未运行","n/a (MVP)":"不适用(MVP)",accepted:"已接受",succeeded:"已成功",running:"运行中",ran:"已执行"};function bu(e){return Dw[e]??e}function j1(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function Vu(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Z3(e=typeof globalThis.location?.hash=="string"?globalThis.location.hash:""){const t=e.indexOf("?");if(!(t<0))return new URLSearchParams(e.slice(t+1)).get("workspaceId")?.trim()||void 0}function X3(e,t){const n=t?.trim()||Z3();if(!n)return e;const a=e.includes("?")?"&":"?";return`${e}${a}workspaceId=${encodeURIComponent(n)}`}function Ir(e,t){return X3(e,t)}async function zl(e,t={},n,a){const s=a?.trim()||Z3(),o={"Content-Type":"application/json",[O1]:j1()},c=await fetch("/api/operator/v1/operations",{method:"POST",credentials:"same-origin",headers:o,body:JSON.stringify({action:e,actionParams:t,...s?{workspaceId:s}:{},...n?{clientRequestId:n}:{}})});let d={};try{d=await c.json()}catch{d={ok:!1,error:{code:"INVALID_INPUT",message:"操作响应不是合法 JSON"}}}return{status:c.status,body:d}}const jw=new Set(["runDag","dagRerun","dagReconcileRun","dagRequestInterrupt","standaloneTaskRerun","consoleUpdateAndInit"]);function Pf(e,t){return G3({blockedReasons:e.blockedReasons,blockingNodes:e.blockingNodes,fallbackMessage:t})}async function vb(e,t=3e5,n){const a=X3(`/api/operator/v1/operations/${encodeURIComponent(e)}`,n),s=Date.now();for(;Date.now()-s<t;){const o=await fetch(a,{credentials:"same-origin"});if(!o.ok)return null;const c=await o.json(),d=c.operation??c,h=d.state??"";if(h==="succeeded"||h==="failed"||h==="needs-reconcile"||h==="timed-out"||h==="restarting")return d;await new Promise(m=>setTimeout(m,250))}return{state:"needs-reconcile",errorMessage:"等待操作结果超时"}}function ms(e){if(e==null)return null;if(typeof e=="string")return e.trim()||null;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="object"){const t=e;if(typeof t.text=="string"&&t.text.trim())return t.text.trim();if(typeof t.errorMessage=="string"&&t.errorMessage.trim())return t.errorMessage.trim();if(Array.isArray(t.content)){const n=t.content.map(a=>{if(typeof a=="string")return a;if(a&&typeof a=="object"){const s=a;if(typeof s.text=="string")return s.text}return""}).filter(Boolean);if(n.length)return n.join(`
12
- `).slice(0,240)}if(typeof t.role=="string")return`${t.role} 消息`}return null}function Lw(e){const t=ms(e.at)??ms(e.timestamp)??ms(e.recordedAt)??"",n=ms(e.errorMessage)??ms(e.label)??ms(e.type)??ms(e.message)??"运行事件";return t?`${t} · ${n}`:n}function _l(e){return String(e.nodeId??e.id??"").trim()}function Gf(e){const t=_l(e);return String(e.label??e.name??(t||"未命名节点"))}function yb(e,t){if(e.length===0)return;const n=t?.trim();if(n){const o=e.find(c=>_l(c)===n);if(o)return o}const a=e.find(o=>{const c=String(o.status??"").toLowerCase();return c.includes("fail")||c.includes("error")||c==="blocked"});return a||(e.find(o=>{const c=String(o.status??"").toLowerCase();return c==="running"||c==="in_progress"||c==="active"})??e[0])}const zw=new Set(["finished","failed","partial_failed","superseded","abandoned"]);function qm(e){if(!e)return!1;const t=String(e.effectiveStatus??e.status??"").toLowerCase();return zw.has(t)}const Bw=5e3;function qw({dagRunId:e,nodeId:t,onClose:n,onOpenFull:a}){const s=w.useRef(null),[o,c]=w.useState(null),[d,h]=w.useState([]),[m,p]=w.useState(null),[g,x]=w.useState(!0),[v,S]=w.useState(null),T=qm(o);w.useEffect(()=>{s.current?.focus();const P=U=>{U.key==="Escape"&&n()};return document.addEventListener("keydown",P),document.title=`检视 · DAG ${e} · Loop Operator`,()=>document.removeEventListener("keydown",P)},[e,n]),w.useEffect(()=>{const P=new AbortController;let U;const A=async z=>{z&&(x(!0),p(null),h([]));try{const X=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(e)}`),{signal:P.signal,credentials:"same-origin"});if(!X.ok)throw new Error(`DAG 查询失败(HTTP ${X.status})`);const H=await X.json();if(P.signal.aborted)return;c(H),p(null);const $=Array.isArray(H.nodes)?H.nodes:[];try{const oe=await Nw(e);if(P.signal.aborted)return;oe.ok?S({status:"success",...oe.result}):oe.status===404&&S({status:"missing"})}catch{}const F=yb($,t),Y=F?_l(F):t?.trim();if(Y){const oe=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(e)}/nodes/${encodeURIComponent(Y)}/session-events`),{signal:P.signal,credentials:"same-origin"});if(oe.ok){const ee=await oe.json();P.signal.aborted||h((ee.events??[]).slice(-20))}}qm(H)&&U!==void 0&&(window.clearInterval(U),U=void 0)}catch(X){P.signal.aborted||p(X instanceof Error?X.message:String(X))}finally{!P.signal.aborted&&z&&x(!1)}};return A(!0),U=window.setInterval(()=>{A(!1)},Bw),()=>{P.abort(),U!==void 0&&window.clearInterval(U)}},[e,t]);const N=w.useMemo(()=>Array.isArray(o?.nodes)?o.nodes:[],[o]),R=yb(N,t),O=R?_l(R):"",_=String(o?.effectiveStatus??o?.status??(g?"加载中…":"未知"));return u.jsxs("aside",{className:"inspect-split-panel","aria-label":"DAG 紧凑检视",children:[u.jsxs("div",{className:"inspect-split-header",children:[u.jsxs("div",{children:[u.jsx("p",{className:"inspect-split-kicker",children:"Inspect"}),u.jsx("h2",{children:"检视 DAG"})]}),u.jsx("button",{ref:s,type:"button","aria-label":"关闭检视面板",onClick:n,children:"关闭"})]}),u.jsx("p",{className:"inspect-split-id",children:u.jsx("code",{children:e})}),o?u.jsx("p",{className:`inspect-split-refresh${T?" is-terminal":""}`,"data-testid":"inspect-split-refresh",children:T?"已结束 · 停止自动刷新":"进行中 · 每 5 秒自动刷新"}):null,m?u.jsx("p",{className:"error",children:m}):null,g&&!o?u.jsx("p",{className:"muted",children:"正在加载 DAG…"}):null,u.jsxs("dl",{className:"inspect-split-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"状态"}),u.jsx("dd",{children:_})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"当前节点"}),u.jsx("dd",{children:R?Gf(R):"暂无节点"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"节点状态"}),u.jsx("dd",{children:R?.status??"—"})]}),R?.errorPreview?u.jsxs("div",{children:[u.jsx("dt",{children:"错误摘要"}),u.jsx("dd",{children:R.errorPreview})]}):null,v?u.jsxs("div",{"data-testid":"inspect-prewrite-gate",children:[u.jsx("dt",{children:"prewrite 门禁"}),u.jsx("dd",{children:v.status==="missing"?u.jsx("span",{className:"muted",children:"prewrite 门禁结果尚未生成"}):u.jsxs(u.Fragment,{children:[v.classification,v.failureCode?u.jsxs("code",{"data-testid":"inspect-prewrite-failure-code",children:[" ",v.failureCode]}):null,v.failureReason?u.jsxs("span",{className:"muted",children:[" ","— ",v.failureReason]}):null]})})]}):null]}),u.jsxs("section",{children:[u.jsxs("h3",{children:["节点(",N.length,")"]}),N.length?u.jsx("ul",{className:"inspect-split-nodes",children:N.slice(0,24).map(P=>{const U=_l(P)||Gf(P),A=U===O;return u.jsxs("li",{"data-active":A?"true":void 0,className:A?"is-active":void 0,children:[u.jsx("span",{children:Gf(P)}),u.jsx("code",{children:P.status??"—"})]},U)})}):u.jsx("p",{className:"muted",children:g?"加载节点中…":"该运行暂无节点。"})]}),u.jsxs("section",{children:[u.jsxs("h3",{children:["最近事件",O?` · ${O}`:""]}),d.length?u.jsx("ul",{className:"inspect-split-events",children:d.map((P,U)=>u.jsx("li",{children:Lw(P)},`${P.at??U}-${U}`))}):u.jsx("p",{className:"muted",children:g?"加载事件中…":"节点事件将在可用时显示。"})]}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:a,children:"全屏观测"}),u.jsx("p",{className:"muted",children:"全屏后点顶栏「返回操作台」可回来。"})]})}const ri="loop-console.operator-chat.active-session.v1",Ku="loop-console.operator-chat.active-session-by-workspace.v1",Hw="loop-console.operator-chat.default-landing.v1";function L1(e){try{const t=JSON.parse(e.getItem(Ku)??"{}");return!t||typeof t!="object"||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(n=>!!n[0].trim()&&typeof n[1]=="string"&&!!n[1].trim()))}catch{return{}}}function Uw(e,t){const n=t?.trim();if(n){const a=L1(e),s=a[n]?.trim();if(s)return s;if(Object.keys(a).length>0)return null}return e.getItem(ri)?.trim()||null}function Vf(e,t,n){const a=n.trim();if(!a)return;e.setItem(ri,a);const s=t?.trim();if(!s)return;const o=L1(e);o[s]=a,e.setItem(Ku,JSON.stringify(o))}function vu(e,t,n){const a=t?.trim();if(a){const o=L1(e);(!n||o[a]===n)&&delete o[a],Object.keys(o).length>0?e.setItem(Ku,JSON.stringify(o)):e.removeItem(Ku)}const s=e.getItem(ri)?.trim();(!n||s===n)&&e.removeItem(ri)}function Yu(e){const t=e?.trim().toLowerCase();if(t==="chat")return"chat";if(t==="tasks")return"tasks"}function Fw(e){const t=e?.trim().toLowerCase();if(t==="chat"||t==="tasks"||t==="recovery"||t==="night"||t==="models"||t==="settings")return t}function $w(e){const t=n=>e.get(n)?.trim()||void 0;return{...t("taskId")?{taskId:t("taskId")}:{},...t("dagRunId")?{dagRunId:t("dagRunId")}:{},...t("fromNodeId")?{fromNodeId:t("fromNodeId")}:{},...t("featureId")?{featureId:t("featureId")}:{},...t("intent")?{intent:t("intent")}:{},...t("workspaceId")?{workspaceId:t("workspaceId")}:{},...t("sessionId")?{sessionId:t("sessionId")}:{}}}function Pw(e){const t=String(e??"").replace(/^#/,"");if(!t)return null;const n=t.indexOf("?"),a=n>=0?t.slice(0,n):t,s=n>=0?t.slice(n+1):"",o=(a||"/").split("?")[0]||"/";if(o==="/"||o==="")return null;const c=o.replace(/^\//,"").split("/")[0],d=Fw(c);return d?{workspace:d,...$w(new URLSearchParams(s))}:null}function Gw(e){if(!e)return;const t=Pw(e.hash);if(t)return t.workspace;const n=new URLSearchParams(e.search),a=Yu(n.get("landing")??n.get("workspace"));if(a)return a;const s=e.hash.startsWith("#")?e.hash.slice(1):e.hash;return Yu(new URLSearchParams(s).get("workspace"))}function Vw(e){return Gw(e.location)??Yu(e.storage?.getItem(Hw))??Yu(e.env)??"chat"}function Kw(e,t={}){const n=new URLSearchParams;for(const[o,c]of Object.entries(t))c?.trim()&&n.set(o,c.trim());const a=n.toString(),s=`/${e}`;return a?`${s}?${a}`:s}function Yw(e,t={}){return`#${Kw(e,t)}`}const Ww={};function Zw(){const[e,t]=w.useState(()=>Vw({env:Ww?.VITE_OPERATOR_CHAT_DEFAULT_LANDING,storage:window.localStorage,location:window.location})),[n,a]=w.useState(null),[s,o]=w.useState("unknown"),[c,d]=w.useState(null),[h,m]=w.useState(null),[p,g]=w.useState(!1),[x,v]=w.useState(!1),[S,T]=w.useState(null),[N,R]=w.useState(null),[O,_]=w.useState(null),[P,U]=w.useState(null),[A,z]=w.useState({command:"idle",dag:"not-started",verification:"not-run",promote:"n/a (MVP)"}),[X,H]=w.useState("setup"),$=w.useCallback(q=>{H(I=>Rw(typeof q=="function"?q(I):q))},[]),F=s==="setup-required",Y=s==="degraded",oe=w.useCallback(q=>{q!==e&&(T(null),_(null),R(null)),t(q)},[e]),ee=w.useCallback(async q=>{const I=q?.trim(),K=pe=>{o(pe),$(pe==="ready"||pe==="degraded"?j=>j==="setup"?"import-prd":j:"setup")};let Q="setup-required";try{const j=await(await fetch("/api/health")).json();a(j),Q=j.piReadiness??"setup-required",m(null)}catch(pe){m(pe instanceof Error?pe.message:String(pe))}if(!I){K(Q);return}try{const pe=await fetch(`/api/operator/v1/readiness?workspaceId=${encodeURIComponent(I)}`);if(!pe.ok){K(Q);return}const j=await pe.json();d(j),K(j.state??Q)}catch{K(Q)}},[$]);return{nav:e,setNav:t,selectNav:oe,health:n,readiness:s,setReadiness:o,readinessReport:c,healthError:h,loadHealth:ee,busy:p,setBusy:g,observeBusy:x,setObserveBusy:v,opError:S,setOpError:T,opMessage:N,setOpMessage:R,opErrorCode:O,setOpErrorCode:_,lastOpState:P,setLastOpState:U,layers:A,setLayers:z,step:X,setStep:$,setupBlocked:F,degraded:Y}}const Xw=[{pattern:/invalid (boot capability|confirmation header) token/i,copy:"页面凭证已失效(控制台可能已重启),请刷新页面(F5)后重试。"},{pattern:/mutation requires boot capability cookie|mutation requires confirmation header token/i,copy:"页面状态异常,请刷新页面(F5)后重试。"},{pattern:/Host header is required for non-loopback/i,copy:"请求主机校验失败:非回环绑定时要求 Host 头,请刷新页面或检查访问地址。"}];function ni(e){const t=(e??"").trim();if(!t)return"操作失败";const n=Cw(t);if(n)return n;if(/controller identity changed|package fingerprint changed|entry binary sha256 changed/i.test(t))return"控制器版本已变更(Console 启动后代码被重新编译,或提交了 package.json / bin / dist / skills 等指纹范围文件)。请重启 Console 进程使其重新加载当前构建后再重试本操作;一次会话中途不要重建控制器。";if(/Pi session file missing or not openable|cannot reopen chat session .* no persisted Pi session file/i.test(t))return"该对话的 Pi 会话文件已丢失,无法恢复上下文。请新建对话继续(历史记录无法重开)。";if(/reopened Pi sessionId mismatch/i.test(t))return"重开对话失败:Pi 会话身份与记录不一致(常见于会话文件丢失后被误建)。请新建对话继续。";if(/base HEAD .+ != frozen baseCommit|exact-base|not a descendant of frozen baseCommit/i.test(t))return"主分支已相对夜间冻结的 baseCommit 前进,无法安全 fast-forward harvest。请人工核对后使用 Discard(必要时勾选强制),或改走日间合并流程。";if(/force-required|requires --force/i.test(t))return"该终态需要强制 Discard。请确认后勾选强制再试。";for(const a of Xw)if(a.pattern.test(t))return a.copy;return t}const Qw={bootstrapFromPrd:"正在导入 PRD 并创建任务:归档文档 → 确定性解析 → 语义结构化(MED→HIGH→LOW,每档最多 300 秒,请勿关闭页面)",importPrd:"正在导入 PRD:归档文档 → 确定性解析 → 语义结构化(MED→HIGH→LOW,每档最多 300 秒,请勿关闭页面)",interviewStart:"正在启动需求访谈…",interviewTurn:"正在提交访谈回答…",interviewSkip:"正在跳过访谈并生成评估…",contractValidate:"正在校验契约草稿…",contractDiff:"正在计算契约差异…",contractApply:"正在应用契约(写入需求与执行约束)…",spineCheck:"正在运行 Spine 审计…",dagGenerate:"正在生成 DAG…",standaloneTaskRerun:"正在带反馈重新执行任务:服务端校验资格后生成并启动新 DAG…",consoleUpdateAndInit:"正在检查活动运行、所选 npm 渠道与安全初始化;完成后 Console 将自动刷新…",workerTaskRetry:"正在重新排队 Worker Task…"};function Jw(e){const{shell:t,applyInterviewPayload:n,workspaceId:a}=e,{setBusy:s,setOpError:o,setOpErrorCode:c,setOpMessage:d,setReadiness:h,setStep:m,setNav:p,setLastOpState:g,setLayers:x,step:v,nav:S}=t,[T,N]=w.useState(null),[R,O]=w.useState(null),[_,P]=w.useState([]),[U,A]=w.useState(!0),z=w.useRef(null),[X,H]=w.useState(null),[$,F]=w.useState(null),Y=w.useCallback(async(Q,pe={},j)=>{const G=a?.trim()||null;if(!G){const W="当前 Workspace 不可用;请先选择有效 Workspace 后再执行操作";return o(W),c("WORKSPACE_REQUIRED"),{ok:!1,error:{code:"WORKSPACE_REQUIRED",message:W}}}s(!0),o(null),c(null),d(Qw[Q]??null);try{const{status:W,body:D}=await zl(Q,pe,j?.clientRequestId,G);if(W===412||D.error?.code==="PI_SETUP_REQUIRED")return o(ni(D.error?.message??"Pi 未就绪或已降级:该操作暂不可用")),c(D.error?.code??"PI_SETUP_REQUIRED"),h("setup-required"),m("setup"),p("models"),D;if(W>=400||D.ok===!1)return o(ni(D.error?.message??D.message??`操作失败(HTTP ${W})`)),c(D.error?.code??String(W)),g(D.state??`failed:${W}`),x(V=>({...V,command:D.error?.message??`failed:${D.error?.code??W}`})),D;if(D.operationId){O(G??null);const V=window.localStorage.getItem(ri)?.trim();if(V&&fetch(`/api/operator/v1/chat/sessions/${encodeURIComponent(V)}/operation-links`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",[O1]:j1()},body:JSON.stringify({operationId:D.operationId})}).then(Z=>{Z.ok||console.warn("Operator Chat operation link failed",Z.status)}).catch(Z=>console.warn("Operator Chat operation link failed",Z)),N(D.operationId),g(D.state??"accepted"),x(Z=>({...Z,command:D.state??"accepted",dag:Q==="runDag"?"running":Z.dag})),jw.has(Q)){A(!0),d(`操作已接受,后台运行中:${D.operationId}(请看事件流;可同时打开 Observe)`);const Z=D.operationId;vb(Z,30*6e4,G).then(ne=>{if(ne){if(g(ne.state??null),ne.state==="failed"||ne.state==="needs-reconcile"||ne.state==="timed-out"){o(ni(ne.errorMessage??ne.stderrPreview??`操作失败:${ne.state}`)),c(ne.errorCode??ne.state??null),x(ue=>({...ue,command:`failed:${ne.errorCode??ne.state}`}));return}ne.state==="succeeded"&&(d(`${Q} 已成功`),x(ue=>({...ue,command:"succeeded"}))),Q==="consoleUpdateAndInit"&&ne.state==="restarting"&&(d("新 Console 正在接棒,页面即将刷新…"),setTimeout(()=>window.location.reload(),800))}})}else{d(`操作已接受:${D.operationId}`);const Z=await vb(D.operationId,3e5,G);if(Z){if(g(Z.state??null),Z.state==="failed"||Z.state==="needs-reconcile"||Z.state==="timed-out")return o(ni(Z.errorMessage??Z.stderrPreview??`操作失败:${Z.state}`)),c(Z.errorCode??Z.state??null),x(Re=>({...Re,command:`failed:${Z.errorCode??Z.state}`})),{ok:!1,operationId:D.operationId,state:Z.state,error:{code:Z.errorCode??Z.state??"INTERNAL_ERROR",message:Z.errorMessage??Z.stderrPreview??`操作失败:${Z.state}`}};d(Z.errorMessage?`${Q}:${Z.errorMessage}`:`${Q} 已成功`),x(Re=>({...Re,command:Z.state??"succeeded"}));const ne=Z.result??{},ue={ok:!0,operationId:D.operationId,state:Z.state??"succeeded",result:ne};(Q==="interviewStart"||Q==="interviewTurn"||Q==="interviewSkip")&&n(ne);const he=ne.confirmation;return he?.confirmationId&&(H(he.confirmationId),F(ne)),j?.advanceTo&&m(j.advanceTo),ue}}}else d(`${Q} 已完成`),g(D.state??"succeeded"),x(V=>({...V,command:"succeeded",verification:Q==="contractValidate"||Q==="spineCheck"?"ran":V.verification}));const ye=D.result??{};(Q==="interviewStart"||Q==="interviewTurn"||Q==="interviewSkip")&&n(ye);const se=ye.confirmation;return se?.confirmationId&&(H(se.confirmationId),F(ye)),j?.advanceTo&&m(j.advanceTo),D}catch(W){o(W instanceof Error?W.message:String(W));return}finally{s(!1)}},[n,s,o,c,d,h,m,p,g,x,a]),oe=w.useCallback(Q=>{if(!Q)return"无响应";if(Q.error?.message)return Q.error.message;if(Q.message)return Q.message;const pe=Q.result;if(pe&&typeof pe=="object")try{return JSON.stringify(pe).slice(0,1200)}catch{return"已返回结果"}return Q.ok===!1?"失败":"成功"},[]),ee=w.useCallback(Q=>{if(!Q||Q.ok===!1||Q.error)return!1;const pe=Q.result;if(!pe)return!0;if(typeof pe.valid=="boolean")return pe.valid;const j=pe.result;return j&&typeof j.valid=="boolean"?j.valid:!0},[]),q=w.useCallback(async Q=>{z.current?.abort();const pe=new AbortController;z.current=pe,P(j=>[...j,`开始跟随事件流 ${Q}`]);try{const j=R?`?workspaceId=${encodeURIComponent(R)}`:"",G=await fetch(`/api/operator/v1/operations/${encodeURIComponent(Q)}/events${j}`,{credentials:"same-origin",signal:pe.signal});if(!G.ok||!G.body){P(se=>[...se,`事件流 HTTP ${G.status}`]);return}const W=G.body.getReader(),D=new TextDecoder;let ye="";for(;U;){const{done:se,value:V}=await W.read();if(se)break;ye+=D.decode(V,{stream:!0});const Z=ye.split(`
13
-
14
- `);ye=Z.pop()??"";for(const ne of Z){const ue=ne.split(`
15
- `).find(Re=>Re.startsWith("data:"));if(!ue)continue;const he=ue.slice(5).trim();P(Re=>[...Re.slice(-80),he.slice(0,240)])}}}catch(j){j.name!=="AbortError"&&P(G=>[...G,`事件流错误:${j instanceof Error?j.message:String(j)}`])}},[U,R]);w.useEffect(()=>(T&&U&&(v==="run"||S==="recovery")&&q(T),()=>z.current?.abort()),[T,U,v,S,q]);const I=w.useCallback(()=>{A(!1),z.current?.abort(),d("已停止跟随日志(未取消子进程)")},[d]),K=w.useCallback(()=>{z.current?.abort(),N(null),O(null),P([]),A(!0),H(null),F(null)},[]);return{runAction:Y,summarizeEnvelope:oe,isActionSuccess:ee,operationId:T,setOperationId:N,sseLog:_,followSse:U,setFollowSse:A,stopFollowSse:I,resetForWorkspaceScope:K,confirmationId:X,setConfirmationId:H,confirmationDetails:$,setConfirmationDetails:F}}const Hm=8*1024*1024,e9=10*1024*1024,Wu=8,t9=".md,.markdown,.txt,text/markdown,text/plain",n9=[".md",".markdown",".txt"],z1=/\.[^.]+$/;function r9(e){const t=z1.exec(e.trim());return t?t[0].toLowerCase():""}function a9(e){const t=r9(e);return n9.includes(t)}function Um(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${e} B`;if(e<1024*1024){const n=e/1024;return`${n>=10?n.toFixed(0):n.toFixed(1)} KiB`}const t=e/(1024*1024);return`${t>=10?t.toFixed(1):t.toFixed(2)} MiB`}function ti(e,t){return{ok:!1,code:e,message:t}}function i9(e,t){const n=e?Array.from(e):[],a=t?.maxFiles??Wu,s=t?.existingCount??0;return n.length===0?ti("file-count","请选择至少一个 .md / .markdown / .txt 文件"):s+n.length>a?ti("file-count",`最多支持 ${a} 个文件(当前已有 ${s} 个)`):null}async function s9(e){const t=e.name?.trim()||"untitled.md";if(!a9(t))return ti("unsupported-extension","仅支持 .md、.markdown、.txt 文件");if(e.size>Hm)return ti("file-too-large",`文件不能超过 ${Um(Hm)}`);let n;try{n=await e.arrayBuffer()}catch{return ti("read-failed","文件读取失败,请重试或直接粘贴")}let a;try{a=new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{return ti("invalid-utf8","文件不是有效 UTF-8,请另存为 UTF-8")}if(a.trim().length===0)return ti("empty-content","文件内容不能为空或只有空白");const s=new TextEncoder().encode(a).byteLength;return{ok:!0,text:a,fileName:t,sourceBytes:e.size,textBytes:s}}async function o9(e){if(e.length===0)return ti("file-count","请选择至少一个 .md / .markdown / .txt 文件");if(e.length>Wu)return ti("file-count",`最多支持 ${Wu} 个文件`);const t=[];for(const n of e){const a=await s9(n);if(!a.ok)return a;t.push({fileName:a.fileName,text:a.text,sourceBytes:a.sourceBytes,textBytes:a.textBytes})}return{ok:!0,documents:t}}function l9(e,t){const n=e.split(/\r?\n/);for(const s of n){const o=/^(#{1,6})\s+(.+)$/.exec(s.trim());if(o?.[2])return o[2].trim()}for(const s of n){const o=s.trim();if(o&&!/^---+$/.test(o)&&!/^```/.test(o)&&!/^<!--/.test(o))return o.replace(/^>\s+/,"").slice(0,120)}return t.replace(z1,"").trim()||"需求"}function c9(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")||"requirement"}function u9(e,t){const n=e.replace(z1,"").trim(),a=c9(n);return a==="requirement"&&/[^\u0000-\u007f]/.test(n)?`part-${t+1}`:a==="requirement"?n?`part-${t+1}`:`part-${t+1}`:a}function d9(e){const t=new Set;return e.map((n,a)=>{let s=u9(n.fileName,a);if(t.has(s)){let o=2;for(;t.has(`${s}-${o}`);)o+=1;s=`${s}-${o}`}return t.add(s),{name:s,content:n.text,fileName:n.fileName}})}function f9(e,t){if(e.length===0)return"";if(e.length===1)return e[0].text;const n=Math.min(Math.max(0,t?.primaryIndex??0),e.length-1),a=e[n],s=l9(a.text,a.fileName),c=[`<!-- composed-from: ${e.map(d=>d.fileName).join(", ")} -->`,"",`# ${s}`,""];for(const d of e)c.push(`## 来源:${d.fileName}`,"",d.text.trim(),"");return`${c.join(`
16
- `).trimEnd()}
17
- `}function h9(e,t,n){const a={action:e,actionParams:t};return new TextEncoder().encode(JSON.stringify(a)).byteLength<=e9}function m9(){return"最终内容导致请求体超过服务端限制,请缩小文档或减少文件数量"}function p9(){const[e,t]=w.useState(""),[n,a]=w.useState([]),[s,o]=w.useState(0),[c,d]=w.useState(!1),[h,m]=w.useState(null),[p,g]=w.useState(!1),[x,v]=w.useState(!1),S=w.useRef(0),T=w.useRef(0),N=w.useCallback((F,Y)=>{const oe=F.length===0?0:Math.min(Math.max(0,Y),F.length-1);o(oe),t(f9(F,{primaryIndex:oe})),d(!1)},[]),R=w.useCallback(async F=>{const Y=i9(F,{existingCount:n.length});if(Y){m(Y.message);return}const oe=Array.from(F),ee=++T.current;g(!0),m(null);try{const q=await o9(oe);if(ee!==T.current)return;if(!q.ok){m(q.message);return}const I=[...n,...q.documents],K=n.length===0?0:s;a(I),n.length===0||!c?(N(I,K),m(null)):m("已追加文件,未改正文(正文已手动编辑);可点「按文件重新合成」覆盖。")}catch{if(ee!==T.current)return;m("文件读取失败,请重试或直接粘贴")}finally{ee===T.current&&g(!1)}},[N,c,n,s]),O=w.useCallback(F=>{t(F),n.length>0&&d(!0)},[n.length]),_=w.useCallback(F=>{o(F),c||N(n,F)},[N,c,n]),P=w.useCallback((F,Y)=>{const oe=F+Y,ee=[...n],q=ee[oe];ee[oe]=ee[F],ee[F]=q;const I=s===F?oe:s===oe?F:s;a(ee),o(I),c||N(ee,I)},[N,c,n,s]),U=w.useCallback(F=>{const Y=n.filter((ee,q)=>q!==F),oe=Y.length===0?0:Math.min(s>=F?Math.max(0,s-1):s,Math.max(0,Y.length-1));a(Y),o(oe),Y.length===0?d(!1):c||N(Y,oe)},[N,c,n,s]),A=w.useCallback(()=>{a([]),o(0),d(!1),m(null)},[]),z=w.useCallback(()=>{c&&!window.confirm("将用当前文件列表重新合成正文,覆盖你在编辑区的修改。继续?")||(N(n,s),m(null))},[N,c,n,s]),X=w.useCallback((F,Y)=>{F.preventDefault(),F.stopPropagation(),!Y&&(S.current+=1,v(!0))},[]),H=w.useCallback(F=>{F.preventDefault(),F.stopPropagation(),S.current=Math.max(0,S.current-1),S.current===0&&v(!1)},[]),$=w.useCallback((F,Y)=>{F.preventDefault(),F.stopPropagation(),S.current=0,v(!1),!Y&&R(F.dataTransfer.files)},[R]);return{prdText:e,setPrdText:t,onPrdTextChange:O,prdDocuments:n,prdPrimaryIndex:s,prdComposedDirty:c,prdFileError:h,setPrdFileError:m,prdFileReading:p,prdDragOver:x,loadPrdFromFiles:R,applyPrdComposition:N,setPrimaryDocument:_,moveDocument:P,removeDocument:U,clearDocuments:A,recomposeDocuments:z,onDragEnter:X,onDragLeave:H,onDrop:$}}const g9={report:{id:"report",label:"查看报告",action:"dagReport",lane:"dag",guide:"看失败分类与建议动作(交接报告摘要)",commandHint:"loop-agent dag report --run-id <run-id> --json"},doctor:{id:"doctor",label:"Doctor 诊断",action:"doctor",lane:"dag",guide:"只读诊断:检查 Console / Pi / 仓库就绪,不是重跑前置",commandHint:"agent-worker console doctor --repo ."},decision:{id:"decision",label:"人工决策",lane:"dag",guide:"暂停等人时:先看 doctor 输出再做决策(经 CLI)",commandHint:"loop-agent dag doctor --run-id <run-id> --markdown"},resume:{id:"resume",label:"恢复运行",lane:"dag",guide:"仅当运行可安全 resume 时使用(经 CLI)",commandHint:"loop-agent task advance <task-id> --json"},reconcile:{id:"reconcile",label:"对账 / reconcile",requiresReason:!0,action:"dagReconcileRun",lane:"dag",guide:"Orphan/中断时先对账归档(默认 supersede);runner 仍存活时勿盲 supersede",commandHint:"loop-agent dag reconcile-run --run-id <run-id> --action supersede --reason <structured-reason>"},regenerate:{id:"regenerate",label:"重新生成契约/计划",lane:"dag",guide:"契约/计划过期时:回任务页或经 CLI 重新 task advance(本页仅提示)",commandHint:"loop-agent task advance <task-id> --json"},observeLink:{id:"observeLink",label:"全屏观测",action:"observeLink",lane:"dag",guide:"打开完整 Inspect 画布;顶栏可返回操作台",commandHint:"agent-worker console --repo . --port 8790"},dagRerun:{id:"dagRerun",label:"从失败节点恢复",requiresReason:!0,action:"dagRerun",lane:"dag",guide:"Provider、网络、限流或超时等非代码问题的首选:先评估安全子图,合格后创建 continuation run 从有效节点恢复(无需 Human Gate)。Worker 持有的 run、workspace/controller 漂移或含 unsafe shell 时不要强跑子图",commandHint:"loop-agent dag rerun --run-id <run-id> --from-node <node-id> --plan"},standaloneTaskRerun:{id:"standaloneTaskRerun",label:"带反馈重新执行任务",requiresReason:!0,action:"standaloneTaskRerun",lane:"dag",guide:"独立 DAG run 无法安全从节点恢复时,重新生成完整 DAG,并带入上一轮仍未解决的 verify/review 反馈;没有可继承反馈时会明确说明(无需 Human Gate)。Worker 持有的 run 请用下方「重新排队 Worker Task」",commandHint:"loop-agent dag rerun-task --run-id <run-id> --reason <text> --json"},workerTaskRetry:{id:"workerTaskRetry",label:"重新排队 Worker Task",requiresReason:!0,action:"workerTaskRetry",lane:"worker",guide:"仅 Worker 队列任务失败时直调执行,服务端校验 Failed 状态,无需 Human Gate;不要与 DAG 完整重跑混用",commandHint:"agent-worker task retry <task-id> --feature-id <feature-id> --repo . --reason <reason>"},interrupt:{id:"interrupt",label:"中止运行",requiresReason:!0,action:"dagRequestInterrupt",lane:"dag",guide:"仅本机 Console 持有的正在运行 DAG:经 Human Gate 登记协作中止,等待当前节点安全收敛。不会立即强杀进程",commandHint:"loop-agent dag request-interrupt --run-id <run-id> --reason-code operator-request --reason <structured-reason>"}},xb={"validation-failed":["report","doctor","regenerate"],"contract-drift":["report","doctor","decision","reconcile","regenerate"],"runtime-mismatch":["report","doctor","reconcile","regenerate"],"pause-on-human":["decision","resume","report","doctor"],"verification-failed":["report","doctor","dagRerun","standaloneTaskRerun","resume","regenerate"],"orphan-unknown":["report","doctor"],"terminal-failed":["report","doctor","dagRerun","standaloneTaskRerun","workerTaskRetry","regenerate"],"terminal-succeeded":["report","observeLink"],"needs-reconcile":["report","doctor","reconcile","regenerate"],"running-active":["interrupt","report","doctor","observeLink"]},b9=new Set(["succeeded","failed","timed-out"]);function v9(e){const t=(e.interruptStatus??"").trim();if(!t||t==="none")return null;if(t==="requested")return"请求已登记,等待 runner 确认。";if(t==="acknowledged")return"等待当前节点安全收敛(不会立即强杀)。";if(t==="needs-reconcile")return"需要对账:中止请求未能确认。";if(t==="settled"){const n=e.dagStatus==="failed"||e.dagStatus==="partial_failed",a=(e.failureCategory??"").includes("controller-interrupted"),s=b9.has(e.targetOperationState??"");return n&&a&&s?"已中止。":"正在对账,尚未确认退出。"}return null}function y9(e){return(xb[e]??xb["orphan-unknown"]).map(n=>g9[n])}function x9(e){const t=[],n=[];for(const a of e)a.lane==="worker"?n.push(a):t.push(a);return{dag:t,worker:n}}function w9(e){return typeof e.action=="string"&&e.action.trim().length>0}function Q3(e){return y9(e).filter(w9)}function k9(e){const t=new Set(Q3(e).map(a=>a.id)),n=(...a)=>{for(const s of a)if(t.has(s))return s;return null};switch(e){case"terminal-failed":case"verification-failed":return n("dagRerun","standaloneTaskRerun","doctor","report");case"pause-on-human":return n("doctor","report");case"needs-reconcile":return n("doctor","reconcile","report");case"running-active":return n("interrupt","doctor","report");case"runtime-mismatch":case"contract-drift":return n("doctor","report");case"validation-failed":return n("doctor","report");case"terminal-succeeded":return n("observeLink","report");default:return n("doctor","report")}}function S9(e){if(e.needsReconcile)return"needs-reconcile";const t=(e.errorCode??"").toLowerCase(),n=(e.operationState??"").toLowerCase(),a=(e.dagStatus??"").toLowerCase(),s=(e.failureCategory??"").toLowerCase();return t.includes("validation")||t.includes("invalid")||n.includes("validation")?"validation-failed":t.includes("contract")||t.includes("drift")||t.includes("binding")?"contract-drift":t.includes("runtime")||t.includes("mismatch")||t.includes("fingerprint")?"runtime-mismatch":t.includes("human")||n.includes("paused")||a.includes("paused")||n.includes("awaiting")?"pause-on-human":t.includes("verif")||n.includes("verif")?"verification-failed":s==="controller-interrupted"||t.includes("controller-interrupted")||t.includes("interrupted")||a==="interrupted"||a==="orphaned"||n.includes("controller-interrupted")||n.includes("interrupted")?"needs-reconcile":a==="running-suspected-stall"||a==="running-quiet"||a==="suspected-stall"||a.includes("suspected-stall")||n.includes("suspected-stall")?"orphan-unknown":a==="running"||a==="active"?"running-active":n==="succeeded"||n==="completed"||n==="finished"||a==="succeeded"||a==="completed"||a==="finished"?"terminal-succeeded":n==="failed"||n.includes("fail")||a==="failed"||a==="partial_failed"||t.includes("fail")?"terminal-failed":t.includes("reconcil")||n.includes("reconcil")?"needs-reconcile":"orphan-unknown"}const B1=new Set(["failed","error","partial_failed"]),J3=new Set(["blocked","paused","awaiting_human"]);function pd(e){return(e??"").trim().toLowerCase()}function E9(e){return B1.has(pd(e))}function wb(e){const t=pd(e.status);return B1.has(t)||t.includes("fail")?0:e.lifecycle==="paused"||t==="paused"?1:e.lifecycle==="active"?2:3}function T9(e){return[...e].sort((t,n)=>{const a=wb(t)-wb(n);return a!==0?a:n.mtimeMs-t.mtimeMs})}function C9(e){return T9(e)[0]?.dagRunId}function kb(e){const t=pd(e.status);return B1.has(t)?0:J3.has(t)?1:2}function e5(e){return[...e].sort((t,n)=>{const a=kb(t)-kb(n);return a!==0?a:t.nodeId.localeCompare(n.nodeId)})}function R9(e){const t=e5(e);return t.find(a=>E9(a.status)||J3.has(pd(a.status)))?.nodeId??t[0]?.nodeId}function N9(e){const t=e.status?.trim()||e.lifecycle;return`${e.dagRunId.length>36?`${e.dagRunId.slice(0,18)}…${e.dagRunId.slice(-8)}`:e.dagRunId} · ${t}`}function A9(e){const t=e.status?.trim()||"unknown",n=e.label?.trim();return n&&n!==e.nodeId?`${e.nodeId} · ${t} · ${n}`:`${e.nodeId} · ${t}`}function I9(e){const n=[`operator-recovery: ${e.actionLabel?.trim()||"恢复"}`],a=e.dagRunId?.trim();if(a){const d=e.runStatus?.trim();n.push(d?`run=${a} (${d})`:`run=${a}`)}const s=e.fromNodeId?.trim();if(s){const d=e.nodeStatus?.trim();n.push(d?`from-node=${s} (${d})`:`from-node=${s}`)}const o=e.factClassLabel?.trim();o&&n.push(`fact=${o}`);const c=e.nodeError?.trim()||e.errorMessage?.trim()||(e.errorCode?.trim()?`code=${e.errorCode.trim()}`:"");return c&&n.push(`detail=${c.replace(/\s+/g," ").slice(0,280)}`),n.join(`
18
- `).slice(0,500)}function t5(e){const t=e.trim();return t?t==="operator-recovery"||t.startsWith("operator-recovery:")||t.startsWith("recovery:"):!0}async function Sb(e){const t=await e.runAction("prepareMutationGate",{action:e.action,actionParams:e.actionParams});if(!e.isActionSuccess(t))return;const n=t?.result??t,a=n.receiptId?n:n.result??n;if(!a.receiptId||!a.humanGateToken){e.setOpError("prepareMutationGate 未返回可消费的 Human Gate receipt");return}await e.runAction(e.action,{...e.actionParams,confirmationId:a.receiptId,humanGateToken:a.humanGateToken},{clientRequestId:e.clientRequestId})}function _9(e){const{shell:t,actions:n,taskId:a,dagRunId:s,fromNodeId:o,featureId:c,recoveryReason:d,recoveryReasonTouched:h,recoveryConfirm:m,recoveryPlanSummary:p,interruptReasonCode:g,setRecoveryConfirm:x,setRecoveryPlanSummary:v,setRecoveryReport:S,setRecoveryReason:T,setRecoveryReasonTouched:N,buildCurrentRecoveryReason:R,openFullCanvas:O}=e,{setOpError:_,setOpErrorCode:P,setOpMessage:U,setBusy:A}=t,{runAction:z,isActionSuccess:X}=n,H=w.useCallback(async F=>{if(F.requiresReason||(x(null),v(null)),F.action==="doctor"){S(null),z("doctor",{});return}if(F.action==="dagReport"||F.id==="report"){const Y=s.trim();if(Y){x(null),v(null);const oe=await z("dagReport",{runId:Y}),ee=oe?.result??{},q=(ee.raw?.runs??ee.runs)?.[0];oe&&oe.ok!==!1&&!oe.error&&q&&(S({runId:q.runId??Y,title:q.title,status:q.status,category:q.productLineFailureCategory,recommendation:q.recoveryRecommendation?.summary??q.recommendedFollowUp??void 0}),U(null));return}if(a.trim()){S(null),z("status",{taskId:a});return}_("查看报告需要先选择 DAG 运行 ID(或填写任务 ID)");return}if(F.action==="observeLink"){S(null),O();return}if(F.requiresReason){if(S(null),x(F),v(null),F.id!=="dagRerun"&&(_(null),P(null)),(!h||t5(d))&&(T(R(F.label)),N(!1)),F.id==="dagRerun"&&s.trim()&&o.trim()){A(!0);try{const{status:Y,body:oe}=await zl("dagRerunPlan",{runId:s.trim(),fromNode:o.trim()}),ee=oe.result??{};ee&&typeof ee=="object"&&("eligible"in ee||ee.planHash)&&v(ee),Y<400&&oe.ok!==!1&&ee.eligible!==!1?U(null):ee.eligible===!1?_(ni(Pf(ee,oe.error?.message))):U(oe.error?.message??"无法预检重跑计划;确认后仍将尝试提交(CLI 可能尚未就绪)")}finally{A(!1)}}return}_(null),P(null),U(`${F.label}:请经 CLI — ${F.commandHint??""}`)},[R,s,o,O,d,h,z,A,_,P,U,x,v,S,T,N,a]),$=w.useCallback(async()=>{const F=m;if(!F)return;const Y=d.trim();if(!Y){_("恢复操作需要结构化原因");return}const oe=Vu(`recovery-${F.id}`);if(x(null),F.id==="dagRerun"){const ee=s.trim(),q=o.trim();if(!ee||!q){_("从失败节点恢复需要 DAG 运行 ID 与起始节点 ID");return}let I=p?.planHash?.trim(),K=p?.eligible;if(!I||K===void 0){const Q=await z("dagRerunPlan",{runId:ee,fromNode:q}),pe=Q?.result??{};if((pe.planHash||pe.eligible!==void 0)&&v(pe),I=pe.planHash?.trim()||I,K=pe.eligible,pe.eligible===!1){_(ni(Pf(pe,Q?.error?.message)));return}if(Q&&Q.ok===!1&&!I){_(Q.error?.message??"无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}}if(K===!1){_(ni(Pf(p??{})));return}if(!I){_("无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}await z("dagRerun",{runId:ee,fromNode:q,planHash:I,reason:Y},{clientRequestId:oe});return}if(F.id==="standaloneTaskRerun"){const ee=s.trim();if(!ee){_("带反馈重新执行任务需要 DAG 运行 ID");return}await z("standaloneTaskRerun",{runId:ee,reason:Y,...a.trim()?{taskId:a.trim()}:{}},{clientRequestId:oe});return}if(F.id==="workerTaskRetry"){const ee=a.trim();if(!ee){_("重新排队 Worker Task 需要任务 ID");return}await z("workerTaskRetry",{taskId:ee,reason:Y,...c.trim()?{featureId:c.trim()}:{}},{clientRequestId:oe});return}if(F.id==="interrupt"){const ee=s.trim();if(!ee){_("中止运行需要 DAG 运行 ID");return}if(Y.trim().length<10||Y.trim().length>500){_("中止原因去首尾空白后必须是 10–500 个字符,请手写说明,不要用占位句。");return}await Sb({runAction:z,isActionSuccess:X,setOpError:_,action:"dagRequestInterrupt",actionParams:{runId:ee,reasonCode:g.trim()||"operator-request",reasonDetail:Y},clientRequestId:oe});return}if(F.id==="reconcile"){const ee=s.trim();if(!ee){_("对账恢复需要 DAG 运行 ID");return}await Sb({runAction:z,isActionSuccess:X,setOpError:_,action:"dagReconcileRun",actionParams:{runId:ee,reason:Y,reconcileAction:"supersede"},clientRequestId:oe});return}U(`${F.label}:请经 CLI — ${F.commandHint??""}`)},[s,c,o,m,p?.planHash,d,g,z,X,_,U,x,v,a]);return{handleRecoveryCta:H,submitRecoveryConfirm:$}}function M9(e,t){const n=e?.trim();return n?t.includes(n)?{status:"ok",workspaceId:n}:{status:"unknown-workspace",workspaceId:n}:{status:"ok",workspaceId:void 0}}const n5="loop-console.operator-shell.last-operate-tab.v1",r5="loop-console.operator-shell.last-inspect-hash.v1",ko="tasks",q1="/#/chat",Bl="/#/inspect",Fm=/^(dag|run|task|feature|batch|night|pool|failures|dags)(\/|$)/;function ql(e){const t=String(e??"").replace(/^#/,""),n=t.indexOf("?"),a=n>=0?t.slice(0,n):t,s=a?a.startsWith("/")?a:`/${a}`:"/",o=new URLSearchParams(n>=0?t.slice(n+1):"");return{path:s,query:o}}function Hl(e){return e==="/inspect"||e==="/inspect/"?"/":e.startsWith("/inspect/")?e.slice(8)||"/":e}function $m(e){return e==="tasks"||e==="recovery"||e==="night"||e==="models"||e==="settings"}function Cr(e,t){return e.get(t)?.trim()||void 0}function Zu(e){return{...Cr(e,"taskId")?{taskId:Cr(e,"taskId")}:{},...Cr(e,"dagRunId")?{dagRunId:Cr(e,"dagRunId")}:{},...Cr(e,"fromNodeId")?{fromNodeId:Cr(e,"fromNodeId")}:{},...Cr(e,"featureId")?{featureId:Cr(e,"featureId")}:{},...Cr(e,"intent")?{intent:Cr(e,"intent")}:{},...Cr(e,"workspaceId")?{workspaceId:Cr(e,"workspaceId")}:{},...Cr(e,"sessionId")?{sessionId:Cr(e,"sessionId")}:{}}}function a5(e){const t=new URLSearchParams;for(const n of["taskId","dagRunId","fromNodeId","featureId","intent","workspaceId","sessionId"]){const a=e[n]?.trim();a&&t.set(n,a)}return t.toString()}function Kf(e){try{const t=e?.getItem(n5);if($m(t))return t}catch{}return ko}function O9(e,t){try{t?.setItem(n5,e)}catch{}}function D9(e){try{const t=e?.getItem(r5)?.trim();if(t?.startsWith("/#/inspect"))return t}catch{}return Bl}function j9(e,t){const n=e.startsWith("/#/inspect")?e:Pi(e);if(n.startsWith("/#/inspect"))try{t?.setItem(r5,n)}catch{}}function Xu(e=ko,t={}){const n=a5(t);return`/#/operate/${e}${n?`?${n}`:""}`}function ma(e="/",t){const n=Hl(e.startsWith("/")?e:`/${e}`),a=n==="/"||n===""?"/inspect":`/inspect${n}`,s=typeof t=="string"?t.replace(/^\?/,""):t?.toString()??"";return`/#${a}${s?`?${s}`:""}`}function H1(e={}){return q1}function Yf(e,t){const n=e.startsWith("/#")?e:e.startsWith("#")?`/${e}`:Pi(e),{path:a,query:s}=ql(n.slice(2));if(a==="/chat")return q1;const o=t?.trim();o?s.set("workspaceId",o):s.delete("workspaceId");const c=s.toString();return`/#${a}${c?`?${c}`:""}`}function Wf(e){return e.workspace==="chat"?H1(e):e.workspace==="operate"?Xu(e.operateTab??ko,e):ma(e.inspectPath??"/",e.inspectQuery)}function Zf(e,t,n){const a=t.toString(),s=ma(e,a);return{workspace:"inspect",operateTab:ko,inspectPath:Hl(e),canonicalHash:s.slice(2),canonicalHref:s,replace:n,...Zu(t)}}function yu(e,t,n){const a=Xu(e,Zu(t));return{workspace:"operate",operateTab:e,inspectPath:"/",canonicalHash:a.slice(2),canonicalHref:a,replace:n,...Zu(t)}}function L9(e,t){const n=t??{},a=q1;return{workspace:"chat",operateTab:ko,inspectPath:"/",canonicalHash:a.slice(2),canonicalHref:a,replace:e||a5(n).length>0,...n}}function Xf(e,t={}){const n=String(e.pathname??"/").replace(/\/+$/,"")||"/",a=t.lastOperateTab??ko;if(n==="/inspect"){const{path:d,query:h}=ql(e.hash??"#/");return Zf(d,h,!0)}const{path:s,query:o}=ql(e.hash??"");if(!e.hash||s==="/")return null;if(s==="/inspect"||s.startsWith("/inspect/"))return Zf(Hl(s),o,!1);if(s==="/chat")return L9(!1,Zu(o));if(s==="/operate")return yu(a,o,!0);if(s.startsWith("/operate/")){const d=s.slice(9).split("/")[0]??"";return $m(d)?yu(d,o,!1):yu(a,o,!0)}if($m(s.replace(/^\//,"").split("/")[0]??"")){const d=s.replace(/^\//,"").split("/")[0];return yu(d,o,!0)}const c=Hl(s).replace(/^\//,"");return Fm.test(c)?Zf(s,o,!0):null}function Pi(e,t=typeof globalThis.location?.href=="string"?globalThis.location.href:"http://local.invalid/"){const n=String(e??"").trim();if(!n)return Bl;if(n.startsWith("/#/inspect"))return n;if(n.startsWith("#/inspect"))return`/${n}`;if(n.startsWith("/#/operate")||n.startsWith("/#/chat"))return n;if(n.startsWith("#/operate")||n.startsWith("#/chat"))return`/${n}`;try{const a=new URL(n,t);if((a.pathname.replace(/\/+$/,"")||"/")==="/inspect"){const{path:h,query:m}=ql(a.hash||"#/"),p=new URLSearchParams(a.search);for(const[g,x]of m)p.set(g,x);return ma(h,p)}const{path:o,query:c}=ql(a.hash||"");if(o==="/inspect"||o.startsWith("/inspect/"))return ma(Hl(o),c);const d=o.replace(/^\//,"");if(Fm.test(d))return ma(o,c)}catch{}return n.startsWith("#/")&&Fm.test(n.slice(2))?ma(n.slice(1)):Bl}function z9(e){const t=e.startsWith("/#")?e:e.startsWith("#")?`/${e}`:Pi(e);return t.startsWith("/#")?t.slice(1):t}function Ts(e){const t=z9(e);if(typeof window>"u")return t;const n=window.location.hash||"",a=n.startsWith("#")?n:`#${n}`,s=t.startsWith("#")?t:`#${t}`;return a!==s&&(window.location.hash=s),s}function B9(e){const{shell:t,actions:n,wizard:a}=e,{nav:s,opError:o,opErrorCode:c,lastOpState:d,setOpError:h,setObserveBusy:m}=t,{taskId:p}=a,[g,x]=w.useState(""),[v,S]=w.useState(""),[T,N]=w.useState(""),[R,O]=w.useState(""),[_,P]=w.useState(!1),[U,A]=w.useState(null),[z,X]=w.useState(null),[H,$]=w.useState(!1),[F,Y]=w.useState("operator-request"),[oe,ee]=w.useState(null),[q,I]=w.useState([]),[K,Q]=w.useState([]),[pe,j]=w.useState(!1),[G,W]=w.useState(!1),[D,ye]=w.useState(null),[se,V]=w.useState(null),[Z,ne]=w.useState(null),[ue,he]=w.useState(!1),[Re,ze]=w.useState(!1),[Ke,ft]=w.useState(null),[gt,Rt]=w.useState("idle"),[Bt,rt]=w.useState(null),[Mt,mt]=w.useState(null),[qt,Be]=w.useState(!1),Qe=w.useCallback(()=>g.trim()?ma(`/dag/${encodeURIComponent(g.trim())}`,"from=recovery"):"/#/inspect",[g]),Ue=w.useCallback(()=>{Ts(Qe())},[Qe]),st=w.useCallback(async()=>{if(g.trim())return g.trim();const it=p.trim();if(!it)return h("打开 DAG 检视需要任务 ID 或 DAG 运行 ID"),null;m(!0),h(null);try{const{status:We,body:vt}=await zl("observeLink",{taskId:it}),ot=vt.result??{};if(We>=400||vt.ok===!1)return h(vt.error?.message??"无法解析 DAG 画布地址"),Rt("unavailable"),rt(vt.error?.message??null),null;const Yt=typeof ot.dagRunId=="string"?ot.dagRunId.trim():"";return Yt?(x(Yt),Rt("match"),rt(null),mt(ma(`/dag/${encodeURIComponent(Yt)}`)),Yt):(h("尚未找到该任务的 DAG 运行,请稍后再打开检视"),Rt("unavailable"),rt(ot.message??"未解析到 DAG run"),null)}catch(We){return h(We instanceof Error?We.message:String(We)),null}finally{m(!1)}},[g,p,h,m]),me=w.useCallback(async()=>{await st()&&Be(!0)},[st]),fe=w.useCallback(async()=>{const it=await st();it&&Ts(ma(`/dag/${encodeURIComponent(it)}`,"from=recovery"))},[st]),He=w.useCallback(async()=>{j(!0);try{const it=p.trim(),We=new URLSearchParams;it&&We.set("taskId",it),We.set("limit","40");const vt=await fetch(Ir(`/api/operator/v1/recovery/candidates?${We.toString()}`),{credentials:"same-origin"});if(!vt.ok){I([]);return}const ot=await vt.json();I(Array.isArray(ot.runs)?ot.runs:[])}catch{I([])}finally{j(!1)}},[p]),we=w.useCallback(async it=>{const We=it.trim();if(!We){Q([]),ye(null),V(null),ne(null);return}W(!0);try{const vt=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(We)}`),{credentials:"same-origin"});if(!vt.ok){Q([]),ye(null),V(null);return}const ot=await vt.json(),Yt=typeof ot.effectiveStatus=="string"&&ot.effectiveStatus||typeof ot.status=="string"&&ot.status||null;ye(Yt);const ae=Array.isArray(ot.nodes)?ot.nodes:[],ke=e5(ae.map(kt=>{const Tt=(kt.nodeId??kt.id??"").trim();return Tt?{nodeId:Tt,status:kt.status,label:kt.label??kt.name,errorPreview:kt.errorPreview}:null}).filter(kt=>kt!==null));Q(ke);const Ne=typeof ot.failureCategory=="string"&&ot.failureCategory||void 0,Je=ae.find(kt=>typeof kt.failureCategory=="string"&&kt.failureCategory&&kt.failureCategory!=="success")?.failureCategory;V(Ne??Je??null),ne(ot.frontendRecovery??null)}catch{Q([]),ye(null),V(null),ne(null)}finally{W(!1)}},[]);w.useEffect(()=>{s==="recovery"&&He()},[s,p,He]),w.useEffect(()=>{if(s!=="recovery"||ue||q.length===0)return;const it=g.trim(),We=it?q.some(vt=>vt.dagRunId===it):!1;if(!it||!We){const vt=C9(q);vt&&vt!==it&&x(vt)}},[s,q,g,ue]),w.useEffect(()=>{s==="recovery"&&we(g)},[s,g,we]),w.useEffect(()=>{if(s!=="recovery")return;const it=g.trim();if(!it){ee(null);return}const vt=D&&new Set(["finished","failed","partial_failed","superseded","abandoned","interrupted"]).has(D)?3e4:4e3,ot=vt===4e3;let Yt=!1;const ae=async()=>{const{body:Ne}=await zl("dagInterruptEligibility",{runId:it});if(Yt)return;const Je=Ne.result??Ne;if(ee({eligible:Je.eligible===!0,ownerKind:Je.ownerKind,message:Je.message,interruptStatus:Je.interruptStatus,reasonCodes:Je.reasonCodes,targetOperationId:Je.targetOperationId,targetOperationState:Je.targetOperationState}),!!ot)try{const kt=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(it)}`),{credentials:"same-origin"});if(!kt.ok||Yt)return;const Tt=await kt.json();if(Yt)return;const De=typeof Tt.effectiveStatus=="string"&&Tt.effectiveStatus||typeof Tt.status=="string"&&Tt.status||null;ye(De)}catch{}};ae();const ke=window.setInterval(()=>{ae()},vt);return()=>{Yt=!0,window.clearInterval(ke)}},[s,g,D]),w.useEffect(()=>{if(s!=="recovery"||Re||K.length===0)return;const it=v.trim(),We=it?K.some(vt=>vt.nodeId===it):!1;if(!it||!We){const vt=R9(K);vt&&vt!==it&&S(vt)}},[s,K,v,Re]);const Fe=S9({operationState:D?null:d,errorCode:D?null:c,dagStatus:D,failureCategory:se}),ct=w.useMemo(()=>{const it=Q3(Fe);return Fe!=="running-active"||oe?.eligible?it:it.filter(We=>We.id!=="interrupt")},[Fe,oe?.eligible]),Ie=w.useMemo(()=>x9(ct),[ct]),Pt=w.useMemo(()=>k9(Fe),[Fe]),bt=w.useMemo(()=>K.find(it=>it.nodeId===v.trim()),[K,v]),_t=w.useRef(null);w.useEffect(()=>{z&&_t.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},[z?.id]);const Et=w.useCallback(it=>I9({actionLabel:it,dagRunId:g.trim()||void 0,fromNodeId:v.trim()||void 0,runStatus:D,nodeStatus:bt?.status,nodeError:bt?.errorPreview,factClassLabel:W3[Fe],errorMessage:o,errorCode:c}),[g,v,o,c,Fe,D,bt?.errorPreview,bt?.status]);w.useEffect(()=>{if(s!=="recovery"||_&&!t5(R))return;const it=Et(z?.label);it&&it!==R&&O(it)},[s,g,v,D,bt,Fe,o,c,z?.label,_,R,Et]);const{handleRecoveryCta:$n,submitRecoveryConfirm:en}=_9({shell:t,actions:n,taskId:p,dagRunId:g,fromNodeId:v,featureId:T,recoveryReason:R,recoveryReasonTouched:_,recoveryConfirm:z,recoveryPlanSummary:U,interruptReasonCode:F,setRecoveryConfirm:X,setRecoveryPlanSummary:A,setRecoveryReport:ft,setRecoveryReason:O,setRecoveryReasonTouched:P,buildCurrentRecoveryReason:Et,openFullCanvas:fe});return w.useEffect(()=>{if(s!=="recovery"||!H||!oe?.eligible)return;const it=ct.find(We=>We.id==="interrupt");it&&(X(it),O(Et(it.label)),P(!1),$(!1))},[s,H,oe?.eligible,ct,Et]),{dagRunId:g,setDagRunId:x,fromNodeId:v,setFromNodeId:S,featureId:T,setFeatureId:N,recoveryReason:R,setRecoveryReason:O,recoveryReasonTouched:_,setRecoveryReasonTouched:P,recoveryPlanSummary:U,recoveryConfirm:z,setRecoveryConfirm:X,setRecoveryPlanSummary:A,recoveryRuns:q,recoveryNodes:K,recoveryRunsLoading:pe,recoveryNodesLoading:G,recoveryRunStatus:D,recoveryFailureCategory:se,frontendRecovery:Z,manualRunId:ue,setManualRunId:he,manualNodeId:Re,setManualNodeId:ze,recoveryReport:Ke,setRecoveryReport:ft,observeLinkStatus:gt,observeLinkMessage:Bt,observeUrl:Mt,inspectSplitOpen:qt,setInspectSplitOpen:Be,inspectPath:Qe,openFullInspect:Ue,resolveDagRunForInspect:st,openInspectSplit:me,openFullCanvas:fe,loadRecoveryRuns:He,loadRecoveryNodes:we,recoveryFact:Fe,recoveryCtas:ct,recoveryLanes:Ie,recommendedCtaId:Pt,interruptIntent:H,setInterruptIntent:$,interruptReasonCode:F,setInterruptReasonCode:Y,interruptEligibility:oe,recoveryConfirmRef:_t,buildCurrentRecoveryReason:Et,handleRecoveryCta:$n,submitRecoveryConfirm:en}}async function q9(e,t){const a=await fetch(Ir(`/api/tasks/${encodeURIComponent(e)}/ledger`),{credentials:"same-origin"});return a.ok?{ok:!0,summary:await a.json()}:{ok:!1}}function H9(e){const{shell:t,actions:n,prd:a}=e,{step:s,setStep:o,setOpMessage:c}=t,{runAction:d,isActionSuccess:h,summarizeEnvelope:m}=n,[p,g]=w.useState(""),[x,v]=w.useState(""),[S,T]=w.useState("standard"),[N,R]=w.useState(""),[O,_]=w.useState(""),[P,U]=w.useState(""),A=Bm.find(we=>we.kind===S)??Bm[0],[z,X]=w.useState(null),[H,$]=w.useState(null),[F,Y]=w.useState(""),[oe,ee]=w.useState(null),[q,I]=w.useState(null),[K,Q]=w.useState(null),[pe,j]=w.useState(null),[G,W]=w.useState(null),[D,ye]=w.useState(!1),[se,V]=w.useState(null),[Z,ne]=w.useState(!1),[ue,he]=w.useState(null),[Re,ze]=w.useState(null),[Ke,ft]=w.useState(null),gt=w.useRef(!1),Rt=w.useRef(0),Bt=w.useCallback(()=>{Q(null),j(null),W(null),ye(!1),V(null),ne(!1),he(null),ze(null),ft(null),gt.current=!1,Rt.current=0},[]),rt=w.useCallback(()=>{Bt(),o("contract")},[Bt,o]),Mt=w.useCallback(we=>{const Fe=we.session;Fe?.sessionId&&X(Fe.sessionId);const ct=we.question;$(ct),ee(we.summary??null);const Ie=we.assessmentId;typeof Ie=="string"&&Ie&&I(Ie),(we.complete===!0||typeof Ie=="string"&&Ie)&&(rt(),c(we.skipped===!0?"已跳过访谈:已按推荐补齐草稿并签发评估":"访谈已完成:草稿已绑定完整评估结果"))},[rt,c]),mt=w.useCallback(async(we,Fe)=>{const ct=++Rt.current;ne(!0),he(null);try{const Ie=await q9(we);if(Rt.current!==ct)return;if(!Ie.ok){ze(null),Fe&&he("ledger 接口不可达(安全降级)");return}ze(Ie.summary)}catch{if(Rt.current!==ct)return;he("ledger 接口不可达(安全降级)"),ze(null)}finally{Rt.current===ct&&ne(!1)}},[]),qt=w.useCallback(async(we=!1)=>{const Fe=p.trim();if(!Fe)return;const ct=`${Fe}:${q??""}`;if(!(!we&&Ke===ct&&K!==null)&&!gt.current){gt.current=!0,Q(null),j(null),W(null),V(null),ye(!1),await mt(Fe,!1);try{const Ie=await d("contractValidate",{taskId:Fe}),Pt=h(Ie);if(Q(Pt),j(m(Ie)),!Pt){ft(ct),c("契约校验未通过:请先修正草稿后再应用");return}const bt=await d("contractDiff",{taskId:Fe});W(m(bt)),ft(ct),c(h(bt)?"校验与差异已就绪:确认后可应用契约":"校验通过,但差异查询失败(仍可查看下方摘要)")}finally{gt.current=!1}}},[q,Ke,K,h,mt,d,c,m,p]),Be=w.useCallback(async()=>{const we=p.trim();if(!we||!q)return;const Fe=await d("contractApply",{taskId:we,assessmentId:q},{clientRequestId:Vu("apply")});if(!h(Fe)){ye(!1);return}ye(!0),await mt(we,!0);const ct=await d("spineCheck",{taskId:we});if(h(ct)){V(!0),o("dag-confirm"),c("契约已应用并通过 Spine 审计,可生成并运行 DAG");return}V(!1),c("契约已应用,但 Spine 审计未通过:可重试 Spine")},[q,h,mt,d,c,o,p]),Qe=w.useCallback(async()=>{const we=p.trim();if(!we)return;const Fe=await d("spineCheck",{taskId:we});if(h(Fe)){V(!0),o("dag-confirm"),c("Spine 审计已通过,可生成并运行 DAG");return}V(!1)},[h,d,c,o,p]),Ue=w.useCallback(async()=>{const we=n.confirmationId?.trim();if(!we)return;const Fe=n.confirmationDetails?.confirmation?.humanGateToken,ct=await d("confirmDagConfirmation",{confirmationId:we,humanGateToken:Fe});h(ct)&&(o("run"),await d("runDag",{confirmationId:we},{clientRequestId:Vu("run")}))},[n.confirmationId,n.confirmationDetails,h,d,o]);w.useEffect(()=>{s==="contract"&&p.trim()&&qt(!1)},[s,p,q,qt]);const st=w.useCallback(we=>we.split(/[\n,;,;]+/).map(Fe=>Fe.trim()).filter(Boolean),[]),me=w.useCallback(async()=>{const we=a.prdDocuments.length>0?d9(a.prdDocuments):void 0,Fe=st(N),ct=st(O),Ie=st(P),Pt={content:a.prdText,taskKind:S,...we?{documents:we}:{},...Fe.length>0?{allowedPaths:Fe}:{},...ct.length>0?{forbiddenPaths:ct}:{},...Ie.length>0?{verifyCommands:Ie}:{}};if(!h9("bootstrapFromPrd",Pt)){a.setPrdFileError(m9());return}const bt=await d("bootstrapFromPrd",Pt);if(!bt||bt.ok===!1)return;const _t=bt.result??{};_t.taskId&&g(_t.taskId),_t.title&&v(_t.title);const Et=_t.parseStatus??"pending",$n=_t.draftPreview?.objective?.trim(),en=Array.isArray(_t.gaps)?_t.gaps.length:0,it=_t.semanticIntake?.applied?"semantic":_t.semanticIntake?.code??"no-semantic",We=(_t.autoImportedReferences??[]).filter(ot=>ot.repoRelative),vt=(_t.unresolvedReferences??[]).filter(ot=>ot.token);c([`已创建任务「${_t.title??""}」(${_t.taskId??""})`,`来源:${_t.identitySource??"prd"}`,`解析:${Et}(${it})`,$n?`目标:${$n.slice(0,120)}`:null,en>0?`缺口 ${en} 项待确认`:null,We.length>0?`已自动导入 ${We.length} 个引用文档(${We.map(ot=>`${ot.repoRelative}${ot.role?`:${ot.role}`:""}`).join("、")})`:null,vt.length>0?`有 ${vt.length} 个引用未能解析:${vt.map(ot=>`${ot.token}(${ot.reason??"未知原因"})`).join("、")}`:null].filter(Boolean).join(" · ")),o("interview")},[N,O,a,d,c,o,st,S,P]),fe=[{id:"setup",label:"就绪检查"},{id:"import-prd",label:"导入需求"},{id:"interview",label:"需求访谈(可跳过)"},{id:"contract",label:"契约落地"},{id:"dag-confirm",label:"确认 DAG"},{id:"run",label:"运行"}],He=fe.findIndex(we=>we.id===s);return{taskId:p,setTaskId:g,taskTitle:x,taskKind:S,setTaskKind:T,engineering:{allowedPathsText:N,forbiddenPathsText:O,verifyCommandsText:P},setEngineering:we=>{we.allowedPathsText!==void 0&&R(we.allowedPathsText),we.forbiddenPathsText!==void 0&&_(we.forbiddenPathsText),we.verifyCommandsText!==void 0&&U(we.verifyCommandsText)},workflowMeta:A,sessionId:z,question:H,answerText:F,setAnswerText:Y,draftSummary:oe,assessmentId:q,contractValidateOk:K,contractValidateSummary:pe,contractDiffSummary:G,ledgerLoading:Z,ledgerError:ue,ledgerSummary:Re,contractApplied:D,spineOk:se,applyInterviewPayload:Mt,runContractPreflight:qt,applyContractThenSpine:Be,retrySpineOnly:Qe,confirmAndRunDag:Ue,importPrdAndCreate:me,wizardSteps:fe,stepIndex:He}}async function U9(e){return await import(e)}function F9(e){const{nav:t,primary:n,chatHref:a,operateHref:s,readiness:o,setupBlocked:c,degraded:d,inspectHref:h,workspaces:m,workspaceId:p,workspacesLoading:g,onSelectWorkspace:x,onNavigate:v}=e,S=c||d?"models":"settings",T=c?"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。点击前往模型与认证。":d?"Pi 暂时降级:仍可恢复草稿与需求访谈。点击查看详情。":"Pi 已就绪。点击打开设置查看详情。",N=n==="operate"?`/#/operate/${t==="chat"?"tasks":t}`:n==="inspect"?h:null,R=n==="chat";return{mode:n,activeTabHref:N,chatHref:a,operateHref:s,inspectHref:h||Bl,freshness:!1,readinessState:o,readinessHref:`/#/operate/${S}`,readinessTitle:T,onNavigate:v,repo:null,statusVisible:!1,workspaceSwitcher:R?null:{activeId:p,loading:g,items:m.map(O=>({workspaceId:O.workspaceId,name:O.name,displayPath:O.displayPath}))},onSelectWorkspace:x}}function $9(e){const t=w.useRef(null),n=w.useRef(null),[a,s]=w.useState(!1),o=w.useMemo(()=>F9(e),[e.nav,e.primary,e.chatHref,e.operateHref,e.readiness,e.setupBlocked,e.degraded,e.inspectHref,e.workspaces,e.workspaceId,e.workspacesLoading,e.onSelectWorkspace,e.onNavigate]),c=w.useRef(o);c.current=o,w.useEffect(()=>{let h=!1;return U9("/inspect/operator-chrome.js").then(m=>{h||!t.current||(n.current=m.mountOperatorChrome(t.current,c.current))}).catch(()=>{h||s(!0)}),()=>{h=!0,n.current?.destroy(),n.current=null}},[]),w.useEffect(()=>{n.current?.update(o)},[o]);const d=h=>{e.onNavigate?e.onNavigate(h):window.location.hash=h.startsWith("/#")?h.slice(1):h};return u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:t,"data-testid":"operator-chrome"}),a?u.jsxs("nav",{className:"operator-chrome-fallback","aria-label":"产品模式",children:[u.jsx("select",{"aria-label":"切换工作区",value:e.workspaceId??"",onChange:h=>e.onSelectWorkspace(h.target.value),children:e.workspaces.map(h=>u.jsx("option",{value:h.workspaceId,children:h.name},h.workspaceId))}),u.jsx("button",{type:"button",onClick:()=>d(e.chatHref),children:"对话"}),u.jsx("button",{type:"button",onClick:()=>d(e.operateHref),children:"操作"}),u.jsx("button",{type:"button",onClick:()=>d(e.inspectHref),children:"观测"}),u.jsx("span",{role:"status",children:"共享导航加载失败,请刷新页面"})]}):null]})}function P9(e){const[t,n]=w.useState(!1),[a,s]=w.useState("latest"),o=w.useId(),c=e.busy||t;return u.jsxs("div",{className:"console-update-control","aria-live":"polite",children:[u.jsx("span",{className:"console-update-badge",children:a==="latest"?"稳定版更新":"预发布更新"}),u.jsx("label",{className:"console-update-channel-label",htmlFor:o,children:"更新渠道"}),u.jsxs("select",{id:o,className:"console-update-channel",value:a,disabled:c,onChange:d=>s(d.target.value==="next"?"next":"latest"),children:[u.jsx("option",{value:"latest",children:"稳定版(latest)"}),u.jsx("option",{value:"next",children:"预发布版(next)"})]}),u.jsx("button",{type:"button",className:"console-update-button",disabled:c,onClick:()=>{n(!0),e.runAction("consoleUpdateAndInit",{channel:a},{clientRequestId:`console-update-${crypto.randomUUID()}`}).then(d=>{if(d?.state==="restarting"){setTimeout(()=>window.location.reload(),800);return}n(!1)})},children:t?"正在更新…":"更新并初始化"})]})}function G9(e){return u.jsxs(u.Fragment,{children:[e.opError?u.jsxs("div",{className:"flash flash-error","data-testid":"op-error",children:[u.jsx("span",{className:"flash-label",children:"错误"}),u.jsx("p",{className:"flash-body",children:e.opError})]}):null,e.opMessage?u.jsxs("div",{className:"flash flash-info","data-testid":"op-message",children:[u.jsx("span",{className:"flash-label",children:"状态"}),u.jsx("p",{className:"flash-body",children:e.opMessage})]}):null]})}const Qu=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"})),gd=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),V9=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})),i5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"})),K9=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})),Y9=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"})),s5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M6.99979 7V3C6.99979 2.44772 7.4475 2 7.99979 2H20.9998C21.5521 2 21.9998 2.44772 21.9998 3V16C21.9998 16.5523 21.5521 17 20.9998 17H17V20.9925C17 21.5489 16.551 22 15.9925 22H3.00728C2.45086 22 2 21.5511 2 20.9925L2.00276 8.00748C2.00288 7.45107 2.4518 7 3.01025 7H6.99979ZM8.99979 7H15.9927C16.549 7 17 7.44892 17 8.00748V15H19.9998V4H8.99979V7ZM15 9H4.00255L4.00021 20H15V9ZM8.50242 18L4.96689 14.4645L6.3811 13.0503L8.50242 15.1716L12.7451 10.9289L14.1593 12.3431L8.50242 18Z"})),Cs=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})),U1=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"})),F1=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z"})),W9=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"})),Z9=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M21 8V20.9932C21 21.5501 20.5552 22 20.0066 22H3.9934C3.44495 22 3 21.556 3 21.0082V2.9918C3 2.45531 3.4487 2 4.00221 2H14.9968L21 8ZM19 9H14V4H5V20H19V9ZM8 7H11V9H8V7ZM8 11H16V13H8V11ZM8 15H16V17H8V15Z"})),X9=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM9.71002 19.6674C8.74743 17.6259 8.15732 15.3742 8.02731 13H4.06189C4.458 16.1765 6.71639 18.7747 9.71002 19.6674ZM10.0307 13C10.1811 15.4388 10.8778 17.7297 12 19.752C13.1222 17.7297 13.8189 15.4388 13.9693 13H10.0307ZM19.9381 13H15.9727C15.8427 15.3742 15.2526 17.6259 14.29 19.6674C17.2836 18.7747 19.542 16.1765 19.9381 13ZM4.06189 11H8.02731C8.15732 8.62577 8.74743 6.37407 9.71002 4.33256C6.71639 5.22533 4.458 7.8235 4.06189 11ZM10.0307 11H13.9693C13.8189 8.56122 13.1222 6.27025 12 4.24799C10.8778 6.27025 10.1811 8.56122 10.0307 11ZM14.29 4.33256C15.2526 6.37407 15.8427 8.62577 15.9727 11H19.9381C19.542 7.8235 17.2836 5.22533 14.29 4.33256Z"})),Q9=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12H4C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.25022 4 6.82447 5.38734 5.38451 7.50024L8 7.5V9.5H2V3.5H4L3.99989 5.99918C5.82434 3.57075 8.72873 2 12 2ZM13 7L12.9998 11.585L16.2426 14.8284L14.8284 16.2426L10.9998 12.413L11 7H13Z"})),o5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})),J9=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M18.364 5.63604L16.9497 7.05025C15.683 5.7835 13.933 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19C15.866 19 19 15.866 19 12H21C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C14.4853 3 16.7353 4.00736 18.364 5.63604Z"})),l5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 3C10.9 3 10 3.9 10 5C10 6.1 10.9 7 12 7C13.1 7 14 6.1 14 5C14 3.9 13.1 3 12 3ZM12 17C10.9 17 10 17.9 10 19C10 20.1 10.9 21 12 21C13.1 21 14 20.1 14 19C14 17.9 13.1 17 12 17ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"})),ek=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M13 18V20H19V22H13C11.8954 22 11 21.1046 11 20V18H8C5.79086 18 4 16.2091 4 14V7C4 6.44772 4.44772 6 5 6H8V2H10V6H14V2H16V6H19C19.5523 6 20 6.44772 20 7V14C20 16.2091 18.2091 18 16 18H13ZM8 16H16C17.1046 16 18 15.1046 18 14V11H6V14C6 15.1046 6.89543 16 8 16ZM18 8H6V9H18V8ZM12 14.5C11.4477 14.5 11 14.0523 11 13.5C11 12.9477 11.4477 12.5 12 12.5C12.5523 12.5 13 12.9477 13 13.5C13 14.0523 12.5523 14.5 12 14.5Z"})),tk=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z"})),Pm=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"})),nk=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M3.5 1.34558C3.58425 1.34558 3.66714 1.36687 3.74096 1.40747L22.2034 11.5618C22.4454 11.6949 22.5337 11.9989 22.4006 12.2409C22.3549 12.324 22.2865 12.3924 22.2034 12.4381L3.74096 22.5924C3.499 22.7255 3.19497 22.6372 3.06189 22.3953C3.02129 22.3214 3 22.2386 3 22.1543V1.84558C3 1.56944 3.22386 1.34558 3.5 1.34558ZM5 4.38249V10.9999H10V12.9999H5V19.6174L18.8499 11.9999L5 4.38249Z"})),c5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M3.33946 17.0002C2.90721 16.2515 2.58277 15.4702 2.36133 14.6741C3.3338 14.1779 3.99972 13.1668 3.99972 12.0002C3.99972 10.8345 3.3348 9.824 2.36353 9.32741C2.81025 7.71651 3.65857 6.21627 4.86474 4.99001C5.7807 5.58416 6.98935 5.65534 7.99972 5.072C9.01009 4.48866 9.55277 3.40635 9.4962 2.31604C11.1613 1.8846 12.8847 1.90004 14.5031 2.31862C14.4475 3.40806 14.9901 4.48912 15.9997 5.072C17.0101 5.65532 18.2187 5.58416 19.1346 4.99007C19.7133 5.57986 20.2277 6.25151 20.66 7.00021C21.0922 7.7489 21.4167 8.53025 21.6381 9.32628C20.6656 9.82247 19.9997 10.8336 19.9997 12.0002C19.9997 13.166 20.6646 14.1764 21.6359 14.673C21.1892 16.2839 20.3409 17.7841 19.1347 19.0104C18.2187 18.4163 17.0101 18.3451 15.9997 18.9284C14.9893 19.5117 14.4467 20.5941 14.5032 21.6844C12.8382 22.1158 11.1148 22.1004 9.49633 21.6818C9.55191 20.5923 9.00929 19.5113 7.99972 18.9284C6.98938 18.3451 5.78079 18.4162 4.86484 19.0103C4.28617 18.4205 3.77172 17.7489 3.33946 17.0002ZM8.99972 17.1964C10.0911 17.8265 10.8749 18.8227 11.2503 19.9659C11.7486 20.0133 12.2502 20.014 12.7486 19.9675C13.1238 18.8237 13.9078 17.8268 14.9997 17.1964C16.0916 16.5659 17.347 16.3855 18.5252 16.6324C18.8146 16.224 19.0648 15.7892 19.2729 15.334C18.4706 14.4373 17.9997 13.2604 17.9997 12.0002C17.9997 10.74 18.4706 9.5632 19.2729 8.6665C19.1688 8.4405 19.0538 8.21822 18.9279 8.00021C18.802 7.78219 18.667 7.57148 18.5233 7.36842C17.3457 7.61476 16.0911 7.43414 14.9997 6.80405C13.9083 6.17395 13.1246 5.17768 12.7491 4.03455C12.2509 3.98714 11.7492 3.98646 11.2509 4.03292C10.8756 5.17671 10.0916 6.17364 8.99972 6.80405C7.9078 7.43447 6.65245 7.61494 5.47428 7.36803C5.18485 7.77641 4.93463 8.21117 4.72656 8.66637C5.52881 9.56311 5.99972 10.74 5.99972 12.0002C5.99972 13.2604 5.52883 14.4372 4.72656 15.3339C4.83067 15.5599 4.94564 15.7822 5.07152 16.0002C5.19739 16.2182 5.3324 16.4289 5.47612 16.632C6.65377 16.3857 7.90838 16.5663 8.99972 17.1964ZM11.9997 15.0002C10.3429 15.0002 8.99972 13.6571 8.99972 12.0002C8.99972 10.3434 10.3429 9.00021 11.9997 9.00021C13.6566 9.00021 14.9997 10.3434 14.9997 12.0002C14.9997 13.6571 13.6566 15.0002 11.9997 15.0002ZM11.9997 13.0002C12.552 13.0002 12.9997 12.5525 12.9997 12.0002C12.9997 11.4479 12.552 11.0002 11.9997 11.0002C11.4474 11.0002 10.9997 11.4479 10.9997 12.0002C10.9997 12.5525 11.4474 13.0002 11.9997 13.0002Z"})),rk=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M10 3V5H5V19H19V14H21V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H10ZM17.5858 5H13V3H21V11H19V6.41421L12 13.4142L10.5858 12L17.5858 5Z"})),ak=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M20.0833 15.1999L21.2854 15.9212C21.5221 16.0633 21.5989 16.3704 21.4569 16.6072C21.4146 16.6776 21.3557 16.7365 21.2854 16.7787L12.5144 22.0412C12.1977 22.2313 11.8021 22.2313 11.4854 22.0412L2.71451 16.7787C2.47772 16.6366 2.40093 16.3295 2.54301 16.0927C2.58523 16.0223 2.64413 15.9634 2.71451 15.9212L3.9166 15.1999L11.9999 20.0499L20.0833 15.1999ZM20.0833 10.4999L21.2854 11.2212C21.5221 11.3633 21.5989 11.6704 21.4569 11.9072C21.4146 11.9776 21.3557 12.0365 21.2854 12.0787L11.9999 17.6499L2.71451 12.0787C2.47772 11.9366 2.40093 11.6295 2.54301 11.3927C2.58523 11.3223 2.64413 11.2634 2.71451 11.2212L3.9166 10.4999L11.9999 15.3499L20.0833 10.4999ZM12.5144 1.30864L21.2854 6.5712C21.5221 6.71327 21.5989 7.0204 21.4569 7.25719C21.4146 7.32757 21.3557 7.38647 21.2854 7.42869L11.9999 12.9999L2.71451 7.42869C2.47772 7.28662 2.40093 6.97949 2.54301 6.7427C2.58523 6.67232 2.64413 6.61343 2.71451 6.5712L11.4854 1.30864C11.8021 1.11864 12.1977 1.11864 12.5144 1.30864ZM11.9999 3.33233L5.88723 6.99995L11.9999 10.6676L18.1126 6.99995L11.9999 3.33233Z"})),ik=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM4 5V19H20V5H4ZM12 15H18V17H12V15ZM8.66685 12L5.83842 9.17157L7.25264 7.75736L11.4953 12L7.25264 16.2426L5.83842 14.8284L8.66685 12Z"})),sk=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M9 4C10.1046 4 11 4.89543 11 6V12.8271C10.1058 12.1373 8.96602 11.7305 7.6644 11.5136L7.3356 13.4864C8.71622 13.7165 9.59743 14.1528 10.1402 14.7408C10.67 15.3147 11 16.167 11 17.5C11 18.8807 9.88071 20 8.5 20C7.11929 20 6 18.8807 6 17.5V17.1493C6.43007 17.2926 6.87634 17.4099 7.3356 17.4864L7.6644 15.5136C6.92149 15.3898 6.1752 15.1144 5.42909 14.7599C4.58157 14.3573 4 13.499 4 12.5C4 11.6653 4.20761 11.0085 4.55874 10.5257C4.90441 10.0504 5.4419 9.6703 6.24254 9.47014L7 9.28078V6C7 4.89543 7.89543 4 9 4ZM12 3.35418C11.2671 2.52376 10.1947 2 9 2C6.79086 2 5 3.79086 5 6V7.77422C4.14895 8.11644 3.45143 8.64785 2.94126 9.34933C2.29239 10.2415 2 11.3347 2 12.5C2 14.0652 2.79565 15.4367 4 16.2422V17.5C4 19.9853 6.01472 22 8.5 22C9.91363 22 11.175 21.3482 12 20.3287C12.825 21.3482 14.0864 22 15.5 22C17.9853 22 20 19.9853 20 17.5V16.2422C21.2044 15.4367 22 14.0652 22 12.5C22 11.3347 21.7076 10.2415 21.0587 9.34933C20.5486 8.64785 19.8511 8.11644 19 7.77422V6C19 3.79086 17.2091 2 15 2C13.8053 2 12.7329 2.52376 12 3.35418ZM18 17.1493V17.5C18 18.8807 16.8807 20 15.5 20C14.1193 20 13 18.8807 13 17.5C13 16.167 13.33 15.3147 13.8598 14.7408C14.4026 14.1528 15.2838 13.7165 16.6644 13.4864L16.3356 11.5136C15.034 11.7305 13.8942 12.1373 13 12.8271V6C13 4.89543 13.8954 4 15 4C16.1046 4 17 4.89543 17 6V9.28078L17.7575 9.47014C18.5581 9.6703 19.0956 10.0504 19.4413 10.5257C19.7924 11.0085 20 11.6653 20 12.5C20 13.499 19.4184 14.3573 18.5709 14.7599C17.8248 15.1144 17.0785 15.3898 16.3356 15.5136L16.6644 17.4864C17.1237 17.4099 17.5699 17.2926 18 17.1493Z"})),ok=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M18.793 5.79285 12.5859 12 18.793 18.2071 20.2072 16.7928 15.4143 12 20.2072 7.20706 18.793 5.79285ZM5.20694 18.2072 11.414 12.0001 5.20694 5.793 3.79272 7.20721 8.58562 12.0001 3.79272 16.793 5.20694 18.2072Z"})),lk=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M14 4.4375C15.3462 4.4375 16.4375 3.34619 16.4375 2H17.5625C17.5625 3.34619 18.6538 4.4375 20 4.4375V5.5625C18.6538 5.5625 17.5625 6.65381 17.5625 8H16.4375C16.4375 6.65381 15.3462 5.5625 14 5.5625V4.4375ZM1 11C4.31371 11 7 8.31371 7 5H9C9 8.31371 11.6863 11 15 11V13C11.6863 13 9 15.6863 9 19H7C7 15.6863 4.31371 13 1 13V11ZM4.87601 12C6.18717 12.7276 7.27243 13.8128 8 15.124 8.72757 13.8128 9.81283 12.7276 11.124 12 9.81283 11.2724 8.72757 10.1872 8 8.87601 7.27243 10.1872 6.18717 11.2724 4.87601 12ZM17.25 14C17.25 15.7949 15.7949 17.25 14 17.25V18.75C15.7949 18.75 17.25 20.2051 17.25 22H18.75C18.75 20.2051 20.2051 18.75 22 18.75V17.25C20.2051 17.25 18.75 15.7949 18.75 14H17.25Z"})),Eb=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z"}));var Zl=P3();const $1=10,Tb='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Xl(e){const{open:t,containerRef:n,triggerRef:a,onEscape:s}=e,o=w.useRef(null),c=w.useRef(!1);w.useEffect(()=>{if(t){if(!c.current){const d=document.activeElement;o.current=a?.current??(d instanceof HTMLElement?d:null);const h=n.current;h&&(h.querySelector(Tb)??h).focus?.(),c.current=!0}return()=>{if(!c.current)return;const d=a?.current??o.current;d&&document.contains(d)&&d.focus(),o.current=null,c.current=!1}}c.current=!1},[t,n,a]),w.useEffect(()=>{if(!t)return;const d=n.current;if(!d)return;const h=m=>{if(m.key==="Escape"){m.preventDefault(),s?.();return}if(m.key!=="Tab")return;const p=Array.from(d.querySelectorAll(Tb)).filter(S=>!S.hasAttribute("disabled")&&S.tabIndex!==-1);if(p.length===0){m.preventDefault(),d.focus?.();return}const g=p[0],x=p[p.length-1],v=document.activeElement;m.shiftKey?(v===g||!d.contains(v))&&(m.preventDefault(),x.focus()):(v===x||!d.contains(v))&&(m.preventDefault(),g.focus())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[t,n,s])}const ck=["command","query","operation","tool","server","symbol","path","file_path","filePath","pattern","glob","url"],uk=120,dk=800;function Ju(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function fk(e){if(e!=null){if(typeof e=="string"){const t=e.trim();if(!t)return;try{return Ju(JSON.parse(t))}catch{return}}return Ju(e)}}function Ja(e,t){const n=e.replace(/\s+/g," ").trim();return n?n.length>t?`${n.slice(0,t)}…`:n:""}function Vn(e,t){const n=e[t];if(typeof n=="string"&&n.trim())return n.trim();if(typeof n=="number"&&Number.isFinite(n))return String(n)}function hk(e,t,n){const a=(e??"").toLowerCase();if(a==="bash"||a==="shell"){const s=Vn(t,"command");return s?Ja(s,n):void 0}if(a==="mcp"||a.startsWith("mcp_")){const s=Vn(t,"server"),o=Vn(t,"tool")??Vn(t,"name"),c=Vn(t,"query");return s&&o?Ja(`${s} · ${o}`,n):o?Ja(o,n):c?Ja(c,n):s?Ja(s,n):void 0}if(a==="lsp_navigation"||a.includes("lsp")){const s=[Vn(t,"operation"),Vn(t,"symbol"),Vn(t,"path")??Vn(t,"file_path")??Vn(t,"filePath")].filter(Boolean),o=Vn(t,"line")??Vn(t,"position");if(s.length===0&&!o)return;const c=s.join(" · ");return Ja(o?`${c}${c?":":""}${o}`:c,n)}if(a==="symbol_search"||a.includes("symbol_search")){const s=Vn(t,"query")??Vn(t,"symbol");return s?Ja(s,n):void 0}if(a==="read"||a==="read_symbol"||a==="read_enclosing"||a.startsWith("read_")){const s=Vn(t,"path")??Vn(t,"file_path")??Vn(t,"filePath"),o=Vn(t,"symbol"),c=Vn(t,"line");if(!s&&!o)return;const d=[s,o,c].filter(Boolean);return Ja(d.join(" · "),n)}}function mk(e,t){const n=t?.maxLen??uk,a=fk(e);if(!a){if(typeof e=="string"){const h=e.replace(/\s+/g," ").trim();return!h||h==="{}"?"":h.length>n?`${h.slice(0,n)}…`:h}return""}const s=hk(t?.toolName,a,n);if(s)return s;for(const h of ck){const m=a[h];if(typeof m=="string"&&m.trim())return Ja(m,n)}const o=Object.keys(a);if(o.length===0)return"";const c=a[o[0]],d=String(c??"").replace(/\s+/g," ").trim();return d?d.length>n?`${d.slice(0,n)}…`:d:""}function pk(e){const t=e?.trim()||"Tool",n=t.toLowerCase();return n==="bash"||n==="shell"||n.includes("exec_command")?{kind:"bash",label:"Bash"}:n==="read"||n==="read_file"||n.startsWith("read_")||n.includes("view_file")?{kind:"read",label:"Read"}:n==="search"||n==="grep"||n==="glob"||n.includes("search")||n.includes("codegraph")||n.includes("lsp")?{kind:"search",label:n==="glob"?"Glob":"Search"}:n==="write"||n==="edit"||n.includes("apply_patch")||n.includes("write_file")||n.includes("edit_file")?{kind:"write",label:n==="write"||n.includes("write_file")?"Write":"Edit"}:n==="web"||n.includes("browser")||n.includes("fetch")||n.includes("web_")?{kind:"web",label:"Web"}:n==="mcp"||n.startsWith("mcp_")||n.includes("__")?{kind:"mcp",label:n==="mcp"?"MCP":t}:{kind:"tool",label:t}}function gk(e){const t=(e??"").toLowerCase();return t==="bash"||t==="shell"?{argsLabel:"命令",resultLabel:"输出"}:t==="mcp"||t.startsWith("mcp_")?{argsLabel:"参数",resultLabel:"结果"}:{argsLabel:"入参",resultLabel:"结果"}}function u5(e){if(e==null)return"";if(typeof e=="string"){const a=e.trim();if(!a)return"";if(a.startsWith("{")&&a.endsWith("}")||a.startsWith("[")&&a.endsWith("]"))try{return u5(JSON.parse(a))}catch{return e}return e}if(typeof e=="number"||typeof e=="boolean")return String(e);const t=Ju(e);if(!t)try{return JSON.stringify(e,null,2)}catch{return String(e)}const n=t.content;if(Array.isArray(n)){const a=[];for(const s of n){const o=Ju(s);o&&(o.type==="text"&&typeof o.text=="string"||typeof o.text=="string")&&a.push(o.text)}if(a.length>0)return a.join(`
19
- `)}if(typeof t.text=="string")return t.text;if(typeof t.output=="string")return t.output;if(typeof t.message=="string")return t.message;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function bk(e){if(e==null)return"";try{return typeof e=="string"?e:JSON.stringify(e,null,2)}catch{return String(e)}}function vk(e,t){if(e===void 0)return{text:"",truncated:!1};const n=t?.maxLen??dk;return e.length<=n?{text:e,truncated:!1}:{text:`${e.slice(0,n)}…`,truncated:!0}}function yk(e,t){if(t===void 0||!Number.isFinite(e)||!Number.isFinite(t))return;const n=Math.round((t-e)/1e3);return n>0?n:void 0}function qn(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function Ui(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function Qf(e,t){return new Promise((n,a)=>{if(t?.aborted){a(new DOMException("Aborted","AbortError"));return}const s=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e),o=()=>{clearTimeout(s),a(new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",o)})}function Ul(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Jf(e){const t=new Date(e),n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()?"今天":t.toLocaleDateString([],{month:"long",day:"numeric"})}function xk(e,t){return e?e.taskId===t.taskId&&e.updatedAt===t.updatedAt&&e.lastEventId===t.lastEventId&&e.operations.length===t.operations.length:!1}const d5={status:"idle",snapshot:null,error:null,reloading:!1,reloadError:null,mutationBusy:!1,mutationToken:null};function P1(e){if(!e||typeof e!="object")return{message:"runtime snapshot request failed"};const t=e,n=t.error;if(n&&typeof n=="object"){const a=n;return{...typeof a.code=="string"&&a.code?{code:a.code}:{},...typeof t.status=="number"?{status:t.status}:{},message:typeof a.message=="string"&&a.message?a.message:"runtime snapshot request failed"}}return{...typeof t.status=="number"?{status:t.status}:{},message:typeof t=="object"&&"message"in t&&typeof t.message=="string"&&t.message?t.message:"runtime snapshot request failed"}}function wk(e,t){switch(t.type){case"load-start":return{...e,sessionId:t.sessionId,status:"loading",error:null};case"load-success":return e.snapshot&&e.sessionId===t.sessionId&&t.snapshot.revision<e.snapshot.revision?e:{...e,sessionId:t.sessionId,status:"ready",snapshot:t.snapshot,error:null,reloadError:null,reloading:!1};case"load-failure":return{...e,sessionId:t.sessionId,status:"error",error:t.error,snapshot:null};case"reload-start":return e.reloading?e:{...e,reloading:!0,reloadError:null,...e.status==="error"?{error:null}:{}};case"reload-success":return{...e,status:"ready",snapshot:t.snapshot,reloading:!1,reloadError:null,error:null,sessionId:t.snapshot.sessionId||e.sessionId};case"reload-failure":return{...e,reloading:!1,reloadError:t.error};case"mutation-start":return{...e,mutationBusy:!0,mutationToken:t.token};case"mutation-adopt":return e.mutationToken!==t.token||e.sessionId!==void 0&&e.sessionId!==t.sessionId||e.snapshot&&t.snapshot.revision<e.snapshot.revision?e:{...e,sessionId:t.sessionId,status:"ready",snapshot:t.snapshot,error:null,reloadError:null,reloading:!1};case"mutation-settle":return e.mutationToken!==t.token?e:{...e,mutationBusy:!1,mutationToken:null};case"mutation-reset":return{...e,mutationBusy:!1,mutationToken:null};case"reset":return{...d5};default:return e}}function f5(e){const t=e.selection;return{...t.model?{model:{provider:t.model.provider,modelId:t.model.id}}:{},...t.thinkingSelection==="auto"?t.effectiveThinkingLevel?{thinkingLevel:t.effectiveThinkingLevel}:{}:{thinkingLevel:t.thinkingSelection}}}function kk(e,t,n,a){const s=n&&n.sessionId===a?f5(n):{},o=s.model??e?.model,c=s.thinkingLevel??e?.thinkingLevel;return{readOnly:t.readOnly,systemPrompt:t.systemPrompt,resources:t.resources,suffix:t.suffix,...o?{model:o}:{},...c?{thinkingLevel:c}:{}}}function Sk(e=d5){let t=e;const n=new Set;return{getState:()=>t,dispatch:a=>{t=wk(t,a);for(const s of n)s();return t},subscribe:a=>(n.add(a),()=>n.delete(a))}}function Ek(e,t,n){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}/auto-invocation`}async function Tk(e){const t=e.fetchImpl??fetch;try{const n=await t(Ek(e.origin,e.sessionId,e.resourceId),{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":e.confirmationToken},body:JSON.stringify({autoInvocationEnabled:e.autoInvocationEnabled})}),a=await n.json().catch(()=>({}));if(!n.ok||a.ok===!1)return{ok:!1,error:{...P1(a),status:n.status}};const s=a.preferenceSaved===!0,o=a.reloadApplied===!0;if(!s)return{ok:!1,error:{status:n.status,code:"PI_RESOURCE_PREFERENCES_WRITE_FAILED",message:"preference was not saved"}};if(!o){const c=a.error?.code??"PI_SESSION_BUSY",d=a.error?.message??"preference saved; current session is busy and was not reloaded";return{ok:!0,preferenceSaved:!0,reloadApplied:!1,...a.snapshot?{snapshot:a.snapshot}:{},partialBusy:{code:c,message:d}}}return{ok:!0,preferenceSaved:!0,reloadApplied:!0,...a.snapshot?{snapshot:a.snapshot}:{}}}catch(n){return{ok:!1,error:{message:n instanceof Error?n.message:String(n)}}}}const An=Sk();let $i;function h5(e){return`/api/operator/v1/chat/sessions/${encodeURIComponent(e)}`}function Ck(e){const t=$i;if($i=e,!(t&&t.sessionId===e.sessionId&&t.origin===e.origin)){if((!t||t.sessionId!==e.sessionId)&&An.dispatch({type:"mutation-reset"}),!e.sessionId){An.dispatch({type:"reset"});return}An.dispatch({type:"load-start",sessionId:e.sessionId}),m5(e.sessionId,e.origin)}}async function m5(e,t){try{const n=await fetch(`${t}${h5(e)}/runtime-snapshot`,{credentials:"include"}),a=await n.json().catch(()=>({}));if($i?.sessionId!==e)return;if(!n.ok){An.dispatch({type:"load-failure",sessionId:e,error:{...P1(a),status:n.status}});return}if(!a.snapshot){An.dispatch({type:"load-failure",sessionId:e,error:{status:n.status,message:"runtime snapshot missing in response"}});return}An.dispatch({type:"load-success",sessionId:e,snapshot:a.snapshot})}catch(n){if($i?.sessionId!==e)return;An.dispatch({type:"load-failure",sessionId:e,error:{message:n instanceof Error?n.message:String(n)}})}}async function ed(){const e=$i;if(!e?.sessionId||An.getState().reloading)return!1;const t=e.sessionId;An.dispatch({type:"reload-start"});try{const n=await fetch(`${e.origin}${h5(t)}/reload`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:"{}"}),a=await n.json().catch(()=>({}));return $i?.sessionId!==t?!1:n.ok?a.snapshot?(An.dispatch({type:"reload-success",snapshot:a.snapshot}),!0):(An.dispatch({type:"reload-failure",error:{status:n.status,message:"reload succeeded but snapshot missing"}}),!1):(An.dispatch({type:"reload-failure",error:{...P1(a),status:n.status}}),!1)}catch(n){return $i?.sessionId!==t||An.dispatch({type:"reload-failure",error:{message:n instanceof Error?n.message:String(n)}}),!1}}async function Gm(){const e=$i;if(!e?.sessionId)return!1;const t=e.sessionId;return An.dispatch({type:"load-start",sessionId:t}),m5(t,e.origin),!0}function Rk(e,t,n){return n?(An.dispatch({type:"mutation-adopt",token:e,sessionId:t,snapshot:n}),An.getState().snapshot===n):!1}function Nk(e,t,n){return n.sessionRef.current?.sessionId!==t||An.getState().mutationToken!==e?!1:(An.dispatch({type:"mutation-settle",token:e}),!0)}function Ql(){return w.useSyncExternalStore(An.subscribe,An.getState)}function p5(e){An.dispatch(e)}function Ak(){return An.getState()}const Cb=[{id:"version",label:"版本信息"},{id:"models",label:"模型"},{id:"skills",label:"技能"},{id:"plugins",label:"插件"},{id:"mcp",label:"MCP"}];function ps({children:e}){return u.jsx("p",{className:"oc-settings-empty",children:e})}function Ik(e){return e==="loaded"?"已加载":e==="configured"?"已配置":e==="disabled"?"未启用":"状态未知"}function _k(e){return e==="ready"?"可正常使用":e==="setup-required"?"需要完成模型设置":e==="degraded"?"部分功能暂时不可用":"正在检查…"}function Mk(e){const[t,n]=w.useState("version"),[a,s]=w.useState(null),[o,c]=w.useState(null),[d,h]=w.useState(null),[m,p]=w.useState({}),[g,x]=w.useState(null),[v,S]=w.useState(null),T=w.useRef(null),N=Ql(),R=N.snapshot;Xl({open:e.open,containerRef:T,triggerRef:e.triggerRef,onEscape:e.onClose}),w.useEffect(()=>{if(!e.open)return;let A=!0;return c(null),fetch(`${e.origin}/api/health`,{credentials:"include"}).then(async z=>{const X=await z.json();if(!z.ok)throw new Error("版本信息读取失败");A&&s(X)}).catch(z=>{A&&c(z instanceof Error?z.message:String(z))}),()=>{A=!1}},[e.open,e.origin]);const O=w.useMemo(()=>[...R?.packages.map(A=>({name:A.packageName??A.spec,detail:A.version?`v${A.version}`:A.spec,enabled:A.enabled}))??[],...R?.extensions.map(A=>({name:A.name,detail:A.scope,enabled:A.enabled}))??[]],[R]);w.useEffect(()=>{h(null),p({}),x(null),S(null)},[R?.sessionId]);const _=(A,z)=>Object.hasOwn(m,A)?m[A]:z,P=async A=>{if(!R?.sessionId||!A.resourceId||d)return;const z=!_(A.resourceId,A.autoInvocationEnabled);h(A.resourceId),S(null),x(null),p(H=>({...H,[A.resourceId]:z}));const X=await Tk({origin:e.origin,sessionId:R.sessionId,resourceId:A.resourceId,autoInvocationEnabled:z,confirmationToken:qn()});if(h(null),!X.ok){p(H=>{const $={...H};return delete $[A.resourceId],$}),S(`${X.error.code?`${X.error.code}:`:""}${X.error.message}`);return}if(X.reloadApplied&&X.snapshot){p5({type:"load-success",sessionId:R.sessionId,snapshot:X.snapshot}),p(H=>{const $={...H};return delete $[A.resourceId],$});return}X.partialBusy&&x("设置已保存,将在本轮对话结束并重新加载会话后生效。")};if(!e.open||typeof document>"u")return null;const U=()=>{if(t==="version")return u.jsxs("div",{className:"oc-settings-version-grid",children:[u.jsxs("div",{children:[u.jsx("span",{children:"产品"}),u.jsx("strong",{children:a?.productName??a?.product??"Loop Agent"})]}),u.jsxs("div",{children:[u.jsx("span",{children:"版本"}),u.jsx("strong",{children:a?.packageVersion??(o?"读取失败":"读取中…")})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Pi 状态"}),u.jsx("strong",{children:_k(e.readiness)})]}),o?u.jsx("p",{className:"oc-settings-error",children:o}):null]});if(N.status==="loading"||N.status==="idle")return u.jsx(ps,{children:"正在读取当前会话的运行配置…"});if(N.status==="error")return u.jsx(ps,{children:N.error?.message??"运行配置读取失败"});if(!R)return u.jsx(ps,{children:"新建或打开一个会话后即可查看。"});if(t==="models")return R.models.length?u.jsx("ul",{className:"oc-settings-list",children:R.models.map(z=>{const X=R.selection.model?.provider===z.provider&&R.selection.model.id===z.id;return u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:z.name??z.id}),u.jsxs("span",{children:[z.provider," / ",z.id]})]}),X?u.jsx("em",{children:"当前"}):null]},`${z.provider}/${z.id}`)})}):u.jsx(ps,{children:"当前会话没有可用模型。"});if(t==="skills")return R.skills.length?u.jsxs("div",{className:"oc-settings-skill-section",children:[u.jsx("p",{className:"oc-settings-help",children:"开启后允许模型自动选择并注入该技能上下文;关闭后仍可手动调用。"}),v?u.jsx("p",{className:"oc-settings-error",role:"alert",children:v}):null,g?u.jsx("p",{className:"oc-settings-notice",role:"status",children:g}):null,u.jsx("ul",{className:"oc-settings-list",children:R.skills.map(z=>{const X=_(z.resourceId,z.autoInvocationEnabled),H=d===z.resourceId;return u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:z.name}),u.jsx("span",{children:z.description||z.scope})]}),u.jsxs("div",{className:"oc-settings-skill-control",children:[u.jsx("em",{children:X?"已启用":"未启用"}),u.jsx("button",{type:"button",className:`oc-toggle${X?" is-on":""}`,role:"switch","aria-checked":X,"aria-label":`${X?"关闭":"开启"} ${z.name} 自动注入上下文`,disabled:H||!!d||!z.resourceId,title:H?"保存中…":"控制模型是否可自动选择该技能",onClick:()=>{P(z)},children:u.jsx("span",{className:"oc-toggle-knob","aria-hidden":"true"})})]})]},z.resourceId)})})]}):u.jsx(ps,{children:"当前会话没有加载技能。"});if(t==="plugins")return O.length?u.jsx("ul",{className:"oc-settings-list",children:O.map((z,X)=>u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:z.name}),u.jsx("span",{children:z.detail})]}),u.jsx("em",{children:z.enabled?"已启用":"未启用"})]},`${z.name}-${X}`))}):u.jsx(ps,{children:"当前会话没有加载插件。"});const A=R.mcp?.servers??[];return A.length?u.jsx("ul",{className:"oc-settings-list",children:A.map(z=>u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:z.name}),u.jsxs("span",{children:[z.tools.length," 个工具 · ",z.transport??z.scope]})]}),u.jsx("em",{children:Ik(z.status)})]},z.name))}):u.jsx(ps,{children:"当前会话没有加载 MCP 服务。"})};return Zl.createPortal(u.jsx("div",{className:"oc-settings-backdrop",onMouseDown:A=>{A.target===A.currentTarget&&e.onClose()},children:u.jsxs("section",{ref:T,className:"oc-settings-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"oc-settings-title",tabIndex:-1,children:[u.jsxs("header",{className:"oc-settings-head",children:[u.jsxs("div",{children:[u.jsx("h2",{id:"oc-settings-title",children:"设置"}),u.jsx("p",{children:"Loop Agent Console"})]}),u.jsx("button",{type:"button",onClick:e.onClose,"aria-label":"关闭设置",title:"关闭",children:u.jsx(Cs,{size:18,"aria-hidden":"true"})})]}),u.jsxs("div",{className:"oc-settings-layout",children:[u.jsx("nav",{"aria-label":"设置分类",children:Cb.map(A=>u.jsx("button",{type:"button",className:t===A.id?"is-active":"","aria-current":t===A.id?"page":void 0,onClick:()=>n(A.id),children:A.label},A.id))}),u.jsxs("div",{className:"oc-settings-content",children:[u.jsx("h3",{children:Cb.find(A=>A.id===t)?.label}),U()]})]})]})}),document.body)}function Ok(){return u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),u.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function Dk(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Rb(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),u.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function jk(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:u.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Vm({side:e="left"}){return u.jsx("svg",{className:`oc-panel-icon${e==="right"?" is-right":""}`,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.67272 0.522841C10.8339 0.522841 11.76 0.522714 12.4963 0.602493C13.2453 0.683657 13.8789 0.854248 14.4264 1.25197C14.7504 1.48739 15.0355 1.77247 15.2709 2.0965C15.6686 2.64394 15.8392 3.27758 15.9204 4.02655C16.0002 4.7629 16 5.68895 16 6.85014V9.14986C16 10.3111 16.0002 11.2371 15.9204 11.9735C15.8392 12.7224 15.6686 13.3561 15.2709 13.9035C15.0355 14.2275 14.7504 14.5126 14.4264 14.748C13.8789 15.1458 13.2453 15.3163 12.4963 15.3975C11.76 15.4773 10.8339 15.4772 9.67272 15.4772H6.3273C5.16611 15.4772 4.24006 15.4773 3.50371 15.3975C2.75474 15.3163 2.1211 15.1458 1.57366 14.748C1.24963 14.5126 0.964549 14.2275 0.729131 13.9035C0.331407 13.3561 0.160817 12.7224 0.0796529 11.9735C-0.000126137 11.2371 0 10.3111 0 9.14986V6.85014C0 5.68895-0.000126137 4.7629 0.0796529 4.02655C0.160817 3.27758 0.331407 2.64394 0.729131 2.0965C0.964549 1.77247 1.24963 1.48739 1.57366 1.25197C2.1211 0.854248 2.75474 0.683657 3.50371 0.602493C4.24006 0.522714 5.16611 0.522841 6.3273 0.522841H9.67272ZM5.54303 1.88715V14.1118C5.78636 14.1128 6.04709 14.1169 6.3273 14.1169H9.67272C10.8639 14.1169 11.7032 14.1164 12.3493 14.0465C12.9824 13.9779 13.3497 13.8494 13.6268 13.6482C13.8354 13.4966 14.0195 13.3125 14.1711 13.1039C14.3723 12.8268 14.5007 12.4595 14.5693 11.8264C14.6393 11.1803 14.6398 10.341 14.6398 9.14986V6.85014C14.6398 5.65896 14.6393 4.81967 14.5693 4.1736C14.5007 3.54048 14.3723 3.17318 14.1711 2.89609C14.0195 2.68747 13.8354 2.50337 13.6268 2.35179C13.3497 2.1506 12.9824 2.02212 12.3493 1.95353C11.7032 1.88358 10.8639 1.88307 9.67272 1.88307H6.3273C6.04709 1.88307 5.78636 1.8862 5.54303 1.88715ZM4.1828 1.91166C3.99125 1.9216 3.8148 1.93577 3.65076 1.95353C3.01764 2.02212 2.65034 2.1506 2.37325 2.35179C2.16463 2.50337 1.98052 2.68747 1.82895 2.89609C1.62776 3.17318 1.49928 3.54048 1.43069 4.1736C1.36074 4.81967 1.36023 5.65896 1.36023 6.85014V9.14986C1.36023 10.341 1.36074 11.1803 1.43069 11.8264C1.49928 12.4595 1.62776 12.8268 1.82895 13.1039C1.98052 13.3125 2.16463 13.4966 2.37325 13.6482C2.65034 13.8494 3.01764 13.9779 3.65076 14.0465C3.81478 14.0642 3.99127 14.0774 4.1828 14.0873V1.91166Z",fill:"currentColor"})})}function Lk(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function g5(){return u.jsx("svg",{className:"oc-tool-chevron",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("polyline",{points:"2.5 4 6 7.5 9.5 4"})})}function zk({open:e}){return u.jsx("svg",{className:`oc-tree-chevron${e?" is-open":""}`,width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"M4.2 2.4 7.8 6 4.2 9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Bk({open:e}){return u.jsx("svg",{className:`oc-workspace-chevron${e?" is-open":""}`,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M4.25 2.82782V11.1722C4.25 11.6622 4.84243 11.9076 5.18891 11.5611L9.36109 7.38891C9.57588 7.17412 9.57588 6.82588 9.36109 6.61109L5.18891 2.43891C4.84243 2.09243 4.25 2.33782 4.25 2.82782Z",fill:"currentColor"})})}function qk(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M3 3.5h10v2H3v-2Zm0 3.5h10v2H3V7Zm0 3.5h7V13H3v-2Z",fill:"currentColor"})})}function Hk(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M8 3v10M3 8h10",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function b5(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M2 4h5l1 1.5h6V13H2V4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function Uk({open:e}){return u.jsx("svg",{className:`oc-tree-glyph${e?" is-folder-open":" is-folder"}`,width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"M1.5 4h3.2l1 1.1H12a.8.8 0 0 1 .8.8v5.3a.8.8 0 0 1-.8.8H2a.8.8 0 0 1-.8-.8V4.8a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:e?.9:.68})})}function Fk(){return u.jsx("svg",{className:"oc-tree-glyph is-file",width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"M3.2 1.6h5.1L10.8 4v8.4a.8.8 0 0 1-.8.8H3.2a.8.8 0 0 1-.8-.8V2.4a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:"0.55"})})}function $k(e){return[...e].sort((t,n)=>t.kind!==n.kind?t.kind==="directory"?-1:1:t.name.localeCompare(n.name,void 0,{sensitivity:"base"}))}function v5(e){const t=w.useMemo(()=>$k(e.entries),[e.entries]);return t.length?u.jsx("ul",{className:"oc-tree",role:e.depth===0?"tree":"group",children:t.map(n=>{const a=n.kind==="directory"&&e.expanded.has(n.path);return u.jsxs("li",{className:`oc-tree-node is-${n.kind}${a?" is-open":""}`,role:"treeitem","aria-expanded":n.kind==="directory"?a:void 0,children:[u.jsxs("button",{type:"button",className:`oc-tree-row oc-tree-${n.kind==="directory"?"dir":"file"}`,style:{paddingLeft:`${8+e.depth*12}px`},onClick:()=>n.kind==="directory"?e.onToggle(n.path):e.onPreview(n.path),children:[n.kind==="directory"?u.jsxs(u.Fragment,{children:[u.jsx(zk,{open:a}),u.jsx(Uk,{open:a})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-tree-chevron-spacer","aria-hidden":"true"}),u.jsx(Fk,{})]}),u.jsx("span",{className:"oc-tree-label",children:n.name}),u.jsx("span",{className:"oc-tree-at",role:"button",tabIndex:0,"aria-label":`插入 ${n.name} 引用`,onClick:s=>{s.stopPropagation(),e.onInsert(n.kind==="directory"?`${n.path}/`:n.path)},onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),e.onInsert(n.kind==="directory"?`${n.path}/`:n.path))},children:"@"})]}),n.kind==="directory"&&a?u.jsx(v5,{...e,entries:e.tree[n.path]??[],depth:e.depth+1}):null]},n.path)})}):u.jsx("p",{className:"oc-tree-empty",children:"此目录为空或没有可安全浏览的文件。"})}function Nb(e){return u.jsxs("section",{className:"oc-details-files","aria-label":"Workspace 文件",children:[u.jsxs("header",{children:[u.jsx("span",{className:"oc-details-workspace-name",title:e.workspaceName,children:e.workspaceName}),u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:e.onRefresh,"aria-label":"刷新文件",title:"刷新文件",children:u.jsx(tk,{size:15,"aria-hidden":"true"})})]}),e.treeError?u.jsx("p",{className:"oc-sidebar-error",role:"alert",children:e.treeError}):null,u.jsx("div",{className:"oc-details-tree-scroll",children:u.jsx(v5,{entries:e.tree[""]??[],tree:e.tree,expanded:e.expanded,depth:0,onToggle:e.onToggle,onInsert:e.onInsert,onPreview:e.onPreview})})]})}function Ab(e,t=Date.now()){const n=new Date(e).getTime();if(!Number.isFinite(n))return"";const a=Math.max(0,t-n),s=Math.floor(a/6e4);if(s<1)return"刚刚";if(s<60)return`${s}分钟`;const o=Math.floor(s/60);if(o<24)return`${o}小时`;const c=Math.floor(o/24);if(c<30)return`${c}天`;const d=Math.floor(c/30);return d<12?`${d}个月`:`${Math.floor(d/12)}年`}function y5(e){const t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"时间未知"}function x5(e=!1){const[t,n]=w.useState(null),a=w.useRef(null),s=w.useRef(null),o=w.useCallback(()=>{a.current!==null&&window.clearTimeout(a.current),s.current!==null&&window.clearTimeout(s.current),a.current=null,s.current=null},[]),c=w.useCallback(()=>{o(),n(null)},[o]);w.useEffect(()=>{e&&c()},[c,e]),w.useEffect(()=>c,[c]);const d=w.useCallback(p=>{if(e||(s.current!==null&&(window.clearTimeout(s.current),s.current=null),t))return;const g=p.currentTarget.getBoundingClientRect();a.current=window.setTimeout(()=>{n({left:Math.min(g.right+8,window.innerWidth-252),top:Math.max(8,Math.min(g.top,window.innerHeight-180))})},500)},[e,t]),h=w.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null),t&&(s.current=window.setTimeout(c,180))},[c,t]),m=w.useCallback(()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null)},[]);return{position:t,close:c,onPointerEnter:d,onPointerLeave:h,onCardPointerEnter:m}}function w5(e){return!e.position||typeof document>"u"?null:Zl.createPortal(u.jsx("div",{className:"oc-sidebar-hover-card",style:{left:e.position.left,top:e.position.top},onPointerEnter:e.onPointerEnter,onPointerLeave:e.onPointerLeave,children:e.children}),document.body)}function Pk(e){const{item:t,active:n,streamingNow:a,turnPhaseNow:s,state:o,deleteConfirming:c,deleting:d}=e,h=s??t.turnPhase,m=a||h==="running"||h==="stopping"||!!t.activeTurnId,p=t.deferredTurn?.state==="failed"?"发送失败":t.deferredTurn?.state==="dispatching"||t.deferredTurn?.state==="accepted"?"发送中":t.deferredTurn?.state==="queued"?"待发送":null,g=t.title||t.displayTitle||"未命名对话",x=y5(t.updatedAt),v=new Date(t.updatedAt),S=Number.isFinite(v.getTime())?v.toISOString():void 0,T=w.useRef(null),N=w.useRef(null),R=w.useRef(null),[O,_]=w.useState(null),P=x5(!!O||c);return w.useEffect(()=>{const U=X=>{R.current?.contains(X.target)||N.current?.contains(X.target)||(c&&e.onCancelDelete(),_(null))},A=()=>{P.close(),_(null)},z=X=>{X.key==="Escape"&&(P.close(),c&&e.onCancelDelete(),_(null))};return document.addEventListener("mousedown",U),window.addEventListener("scroll",A,!0),window.addEventListener("keydown",z),()=>{document.removeEventListener("mousedown",U),window.removeEventListener("scroll",A,!0),window.removeEventListener("keydown",z)}},[c,P.close,e.onCancelDelete]),w.useEffect(()=>{c&&T.current?.focus()},[c]),u.jsxs("div",{className:`oc-session-item${n?" is-active":""}${c?" is-delete-confirming":""}${O?" is-menu-open":""}`,"data-session-id":t.sessionId,onPointerEnter:P.onPointerEnter,onPointerLeave:P.onPointerLeave,children:[u.jsxs("a",{href:e.href,className:"oc-session-main","aria-disabled":d||void 0,tabIndex:d?-1:void 0,onClick:U=>{if(d){U.preventDefault();return}e.onActivate()},children:[u.jsx("strong",{children:g}),u.jsx("time",{dateTime:S,title:x,children:Ab(t.updatedAt,e.now)})]}),m?u.jsx("span",{className:"oc-session-running","aria-label":"对话进行中",title:"对话进行中",children:u.jsx("span",{className:"oc-spinner","aria-hidden":"true"})}):null,p?u.jsx("span",{className:`oc-session-queue-state is-${t.deferredTurn?.state}`,children:p}):null,u.jsx("div",{className:"oc-session-actions",children:u.jsx("button",{type:"button",ref:N,className:"oc-session-menu","data-session-delete-id":t.sessionId,title:"更多","aria-label":`${g} 更多操作`,"aria-expanded":!!O,onClick:U=>{if(U.stopPropagation(),P.close(),O){_(null);return}const A=U.currentTarget.getBoundingClientRect();_({left:Math.max(8,Math.min(A.right-176,window.innerWidth-184)),top:Math.min(A.bottom+5,window.innerHeight-128)})},children:u.jsx(l5,{size:16,"aria-hidden":"true"})})}),u.jsxs(w5,{position:P.position,onPointerEnter:P.onCardPointerEnter,onPointerLeave:P.onPointerLeave,children:[u.jsx("strong",{children:g}),u.jsxs("span",{children:[Ab(t.updatedAt,e.now)," · ",x]}),u.jsxs("span",{className:"oc-sidebar-hover-status",children:[u.jsx("i",{className:m?"is-running":""}),p??(m?"对话进行中":o==="archived"?"已归档":"空闲")]})]}),O&&typeof document<"u"?Zl.createPortal(u.jsx("div",{ref:R,className:"oc-session-popover-menu",role:"menu",style:{left:O.left,top:O.top},children:c?u.jsxs("div",{className:"oc-session-menu-confirm",children:[u.jsx("span",{children:"确定删除这个会话?"}),u.jsxs("div",{children:[u.jsx("button",{type:"button",ref:T,className:"is-danger",disabled:d,"aria-label":`确认删除会话:${g}`,"aria-busy":d||void 0,onClick:()=>e.onConfirmDelete(),children:d?"删除中…":"删除"}),u.jsx("button",{type:"button",disabled:d,"aria-label":"取消删除会话",onClick:()=>{e.onCancelDelete(),_(null)},children:"取消"})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{_(null);const U=window.prompt("会话名称",t.title||t.displayTitle||"");U!==null&&e.onRename(U)},children:[u.jsx(F1,{size:16,"aria-hidden":"true"}),"编辑标题"]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{_(null),e.onSetState(o==="active"?"archived":"active")},children:[u.jsx(Q9,{size:16,"aria-hidden":"true"}),o==="active"?"归档会话":"恢复会话"]}),u.jsxs("button",{type:"button",role:"menuitem",className:"is-danger",onClick:()=>e.onRequestDelete(),children:[u.jsx(U1,{size:16,"aria-hidden":"true"}),"删除会话"]})]})}),document.body):null]})}function Gk(e){const{workspace:t,active:n}=e,a=e.deletingSessionId,s=e.cancelDelete,[o,c]=w.useState(!0),[d,h]=w.useState(!1),m=w.useRef(null),p=x5(d);w.useEffect(()=>{if(!d)return;const x=S=>{m.current?.contains(S.target)||h(!1)},v=S=>{S.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",x),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",v)}},[d]);const g=w.useMemo(()=>e.sessions.filter(x=>x.workspaceId===t.workspaceId||n&&!x.workspaceId),[n,e.sessions,t.workspaceId]);return u.jsxs("div",{className:`oc-workspace-item${n?" is-active":""}`,"data-workspace-id":t.workspaceId,"aria-current":n?"true":void 0,children:[u.jsxs("div",{className:"oc-workspace-row",children:[u.jsxs("button",{type:"button",className:"oc-workspace-main",onMouseDown:x=>x.preventDefault(),onClick:()=>{if(n){c(x=>!x);return}c(!0),e.onActivateWorkspaceRow()},"aria-expanded":n&&o,onPointerEnter:p.onPointerEnter,onPointerLeave:p.onPointerLeave,children:[u.jsx("span",{className:"oc-workspace-caret","aria-hidden":"true",children:u.jsx(Bk,{open:o&&n})}),u.jsx("span",{className:"oc-workspace-folder","aria-hidden":"true",children:u.jsx(b5,{})}),u.jsx("strong",{children:t.name})]}),u.jsxs("div",{className:"oc-workspace-actions",ref:m,children:[u.jsx("button",{type:"button",title:"更多","aria-label":`${t.name} 更多操作`,"aria-expanded":d,onClick:x=>{x.stopPropagation(),h(v=>!v)},children:u.jsx(l5,{size:16,"aria-hidden":"true"})}),u.jsx("button",{type:"button",title:"新建对话","aria-label":`在 ${t.name} 新建对话`,disabled:e.creatingSession,onClick:x=>{x.stopPropagation(),e.onCreateSession()},children:e.creatingSession?u.jsx("span",{className:"oc-spinner","aria-hidden":"true"}):u.jsx(Qu,{size:16,"aria-hidden":"true"})}),d?u.jsxs("div",{className:"oc-workspace-menu",role:"menu",children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),e.onCreateSession()},children:[u.jsx(Qu,{size:15,"aria-hidden":"true"}),"新建对话"]}),u.jsxs("button",{type:"button",role:"menuitem",className:"is-danger",disabled:e.removing,onClick:()=>{h(!1),e.onRemove()},children:[u.jsx(U1,{size:15,"aria-hidden":"true"}),e.removing?"移除中…":"移除工作区"]})]}):null]}),u.jsxs(w5,{position:p.position,onPointerEnter:p.onCardPointerEnter,onPointerLeave:p.onPointerLeave,children:[u.jsx("strong",{children:t.name}),u.jsx("span",{className:"oc-sidebar-hover-path",children:t.displayPath}),t.createdAt?u.jsxs("span",{children:["添加于 ",y5(t.createdAt)]}):null]})]}),n&&o?u.jsxs("div",{className:"oc-workspace-sessions",children:[["active","archived"].map(x=>{const v=g.filter(S=>S.state===x);return v.length?u.jsx("div",{className:"oc-session-group",children:v.map(S=>u.jsx(Pk,{item:S,href:H1(),active:e.activeSessionId===S.sessionId,streamingNow:e.activeSessionId===S.sessionId&&e.activeSessionStreaming===!0,turnPhaseNow:e.activeSessionId===S.sessionId?e.activeSessionTurnPhase:void 0,state:x,deleteConfirming:e.pendingDeleteSessionId===S.sessionId,deleting:e.deletingSessionId===S.sessionId,onActivate:()=>{a||(s(!1),e.onActivate(S.sessionId))},onRename:T=>e.onRenameSession(S.sessionId,T),onSetState:T=>e.onSetSessionState(S.sessionId,T),onRequestDelete:()=>e.onRequestDeleteSession(S),onConfirmDelete:()=>e.onConfirmDeleteSession(S.sessionId),onCancelDelete:()=>e.onCancelDeleteSession(),now:e.now},S.sessionId))},x):null}),g.length===0?u.jsx("p",{className:"oc-tree-empty",children:"此工作区暂无会话。"}):null]}):null]})}function Vk(e){const[t,n]=w.useState(!1),[a,s]=w.useState(""),[o,c]=w.useState(!1),[d,h]=w.useState(()=>Date.now()),m=w.useRef(null),p=w.useMemo(()=>{const q=a.trim().toLocaleLowerCase();return e.sessions.slice(0,$1).filter(I=>!q||(I.title||I.displayTitle||"未命名对话").toLocaleLowerCase().includes(q))},[e.sessions,a]);w.useEffect(()=>{const q=window.setInterval(()=>h(Date.now()),6e4);return()=>window.clearInterval(q)},[]);const[g,x]=w.useState(null),[v,S]=w.useState(null),T=w.useRef(null),N=w.useRef(!1),R=e.layoutMode==="comfortable"&&e.open,O=e.layoutMode==="compact",_=e.drawerOpen&&(e.layoutMode==="compact"||e.layoutMode==="narrow"),P=w.useCallback((q=!0)=>{if(v)return;const I=g;x(null),!(!q||!I)&&window.requestAnimationFrame(()=>{const K=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(I):I.replace(/["\\]/g,"\\$&");document.querySelector(`[data-session-delete-id="${K}"]`)?.focus()})},[v,g]),U=w.useCallback(()=>{v||(x(null),e.onCloseDrawer())},[v,e.onCloseDrawer]),A=w.useCallback(()=>{if(g){P();return}U()},[P,U,g]);Xl({open:_,containerRef:T,triggerRef:e.drawerTriggerRef,onEscape:A}),w.useEffect(()=>{N.current&&!_&&!v&&x(null),N.current=_},[v,_]),w.useEffect(()=>{g&&!p.some(q=>q.sessionId===g)&&x(null),v&&!p.some(q=>q.sessionId===v)&&S(null)},[v,g,p]),w.useEffect(()=>{if(_||!g)return;const q=I=>{I.key==="Escape"&&(I.preventDefault(),P())};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[P,g,_]);const z=w.useCallback(async q=>{if(!(v||g!==q)){S(q);try{await e.onDelete(q)}finally{S(null),x(null)}}},[v,g,e.onDelete]),X=w.useCallback(()=>{v||(P(!1),e.onCreate())},[P,v,e.onCreate]),H=w.useCallback(q=>{v||(P(!1),e.onCreateInWorkspace?e.onCreateInWorkspace(q):e.onCreate())},[P,v,e.onCreateInWorkspace,e.onCreate]),$=w.useCallback(()=>{v||(P(!1),e.onToggleOpen())},[P,v,e.onToggleOpen]),[F,Y]=w.useState(!1),oe=w.useCallback(async()=>{if(!(F||e.addingWorkspace)){Y(!0);try{const q=await e.onPickWorkspaceDirectory();q&&await e.onAddWorkspace(q)}finally{Y(!1)}}},[F,e.addingWorkspace,e.onAddWorkspace,e.onPickWorkspaceDirectory]),ee=u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-sidebar-primary-actions",children:[u.jsxs("button",{type:"button",className:"oc-sidebar-new-session",onClick:X,disabled:e.creatingSession,"aria-busy":e.creatingSession||void 0,children:[u.jsx(Qu,{size:17,"aria-hidden":"true"}),e.creatingSession?"创建中…":"新会话"]}),e.layoutMode==="comfortable"?u.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:$,"aria-expanded":!0,"aria-label":"收起侧栏",title:"收起侧栏",children:u.jsx(Vm,{})}):u.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:U,"aria-label":"关闭侧栏抽屉",title:"关闭",children:u.jsx(Cs,{size:16,"aria-hidden":"true"})})]}),u.jsxs("section",{className:"oc-sidebar-section oc-workspaces","aria-busy":e.workspacesLoading||void 0,"aria-label":"Workspace 与会话",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"工作区"}),u.jsxs("div",{className:"oc-sidebar-header-actions",children:[u.jsx("button",{type:"button",className:"oc-sidebar-icon-action","aria-label":"搜索会话",title:"搜索会话","aria-expanded":t,"aria-controls":"oc-session-search",onClick:()=>n(q=>!q),children:u.jsx(Pm,{size:16,"aria-hidden":"true"})}),u.jsx("button",{type:"button",className:"oc-sidebar-icon-action","aria-label":"添加工作区",title:F?"选择目录中…":"添加工作区","aria-busy":F||void 0,disabled:F||e.addingWorkspace,onClick:()=>{oe()},children:u.jsx(Qu,{size:16,"aria-hidden":"true"})})]})]}),t?u.jsxs("div",{className:"oc-session-search-wrap",children:[u.jsx(Pm,{size:15,"aria-hidden":"true"}),u.jsx("input",{id:"oc-session-search",type:"search",value:a,onChange:q=>s(q.target.value),placeholder:"搜索会话…","aria-label":"搜索会话",autoFocus:!0})]}):null,e.workspacesError?u.jsxs("p",{className:"oc-sidebar-error",role:"alert",children:[e.workspacesError," ",u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:e.onDismissWorkspaceError,"aria-label":"关闭错误提示",children:u.jsx(Cs,{size:12,"aria-hidden":"true"})})]}):null,u.jsx("div",{className:"oc-workspace-list",children:e.workspacesLoading&&e.workspaces.length===0?u.jsx("p",{className:"oc-workspace-loading",children:"正在加载 Workspace…"}):e.workspaces.length===0?u.jsx("p",{className:"oc-workspace-empty",children:"还没有工作区。点击右上角的 + 选择一个文件夹开始。"}):e.workspaces.map(q=>u.jsx(Gk,{workspace:q,active:e.activeWorkspaceId===q.workspaceId,removing:e.removingWorkspaceId===q.workspaceId,sessions:p,activeSessionId:e.activeSessionId,activeSessionStreaming:e.activeSessionStreaming,activeSessionTurnPhase:e.activeSessionTurnPhase,creatingSession:e.creatingSession,pendingDeleteSessionId:g,deletingSessionId:v,cancelDelete:P,onActivateWorkspaceRow:()=>e.onActivateWorkspace(q.workspaceId),onRemove:()=>e.onRemoveWorkspace(q.workspaceId),onCreateSession:()=>H(q.workspaceId),onActivate:I=>{v||(P(!1),e.onActivate(I))},onRenameSession:e.onRename,onSetSessionState:e.onSetState,onRequestDeleteSession:I=>{v||x(I.sessionId)},onConfirmDeleteSession:I=>{z(I)},onCancelDeleteSession:()=>P(),now:d},q.workspaceId))})]}),u.jsx("div",{className:"oc-sidebar-footer",children:u.jsxs("button",{type:"button",ref:m,className:"oc-sidebar-settings",onClick:()=>c(!0),"aria-label":"打开设置",title:"设置",children:[u.jsx(c5,{size:16,"aria-hidden":"true"}),"设置"]})}),u.jsx(Mk,{open:o,origin:e.origin,readiness:e.readiness,onClose:()=>c(!1),triggerRef:m})]});return u.jsxs(u.Fragment,{children:[O?u.jsxs("nav",{className:"oc-sidebar-rail","aria-label":"紧凑侧栏",children:[u.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"打开 Workspace 与会话",title:"Workspace 与会话","aria-expanded":_,onClick:()=>_?U():e.onOpenDrawer(),children:u.jsx(qk,{})}),u.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":e.creatingSession?"创建会话中":"新建会话",title:e.creatingSession?"创建中…":"新建会话",onClick:X,disabled:e.creatingSession,"aria-busy":e.creatingSession||void 0,children:u.jsx(Hk,{})}),u.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"Workspace",title:"Workspace",onClick:()=>_?U():e.onOpenDrawer(),children:u.jsx(b5,{})})]}):null,e.layoutMode==="comfortable"?u.jsx("aside",{className:`oc-sidebar${R?"":" is-collapsed"}`,"aria-label":"Workspace 与会话",children:R?ee:u.jsx("button",{type:"button",className:"oc-sidebar-toggle is-collapsed",onClick:$,"aria-expanded":!1,"aria-label":"展开侧栏",title:"展开侧栏",children:u.jsx(Vm,{})})}):null,_?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"oc-overlay-backdrop","aria-label":"关闭侧栏遮罩",onClick:U}),u.jsx("aside",{ref:T,className:"oc-sidebar oc-sidebar-drawer","aria-label":"Workspace 与会话抽屉",role:"dialog","aria-modal":"true",tabIndex:-1,children:ee})]}):null]})}const Kk="modulepreload",Yk=function(e){return"/"+e},Ib={},Wk=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let h=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");s=h(n.map(m=>{if(m=Yk(m),m in Ib)return;Ib[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":Kk,p||(x.as="script"),x.crossOrigin="",x.href=m,d&&x.setAttribute("nonce",d),document.head.appendChild(x),p)return new Promise((v,S)=>{x.addEventListener("load",v),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return s.then(c=>{for(const d of c||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};function _b(e){const t=[],n=String(e||"");let a=n.indexOf(","),s=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const c=n.slice(s,a).trim();(c||!o)&&t.push(c),s=a+1,a=n.indexOf(",",s)}return t}function Zk(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Xk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jk={};function Mb(e,t){return(Jk.jsx?Qk:Xk).test(e)}const eS=/[ \t\n\f\r]/g;function tS(e){return typeof e=="object"?e.type==="text"?Ob(e.value):!1:Ob(e)}function Ob(e){return e.replace(eS,"")===""}class Jl{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Jl.prototype.normal={};Jl.prototype.property={};Jl.prototype.space=void 0;function k5(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Jl(n,a,t)}function Fl(e){return e.toLowerCase()}class _r{constructor(t,n){this.attribute=n,this.property=t}}_r.prototype.attribute="";_r.prototype.booleanish=!1;_r.prototype.boolean=!1;_r.prototype.commaOrSpaceSeparated=!1;_r.prototype.commaSeparated=!1;_r.prototype.defined=!1;_r.prototype.mustUseProperty=!1;_r.prototype.number=!1;_r.prototype.overloadedBoolean=!1;_r.prototype.property="";_r.prototype.spaceSeparated=!1;_r.prototype.space=void 0;let nS=0;const yt=As(),Bn=As(),Km=As(),je=As(),cn=As(),Es=As(),Ur=As();function As(){return 2**++nS}const Ym=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Bn,commaOrSpaceSeparated:Ur,commaSeparated:Es,number:je,overloadedBoolean:Km,spaceSeparated:cn},Symbol.toStringTag,{value:"Module"})),eh=Object.keys(Ym);class G1 extends _r{constructor(t,n,a,s){let o=-1;if(super(t,n),Db(this,"space",s),typeof a=="number")for(;++o<eh.length;){const c=eh[o];Db(this,eh[o],(a&Ym[c])===Ym[c])}}}G1.prototype.defined=!0;function Db(e,t,n){n&&(e[t]=n)}function So(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const o=new G1(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Fl(a)]=a,n[Fl(o.attribute)]=a}return new Jl(t,n,e.space)}const S5=So({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:cn,ariaCurrent:null,ariaDescribedBy:cn,ariaDetails:null,ariaDisabled:Bn,ariaDropEffect:cn,ariaErrorMessage:null,ariaExpanded:Bn,ariaFlowTo:cn,ariaGrabbed:Bn,ariaHasPopup:null,ariaHidden:Bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:cn,ariaLevel:je,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:cn,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:cn,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:Bn,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function E5(e,t){return t in e?e[t]:t}function T5(e,t){return E5(e,t.toLowerCase())}const rS=So({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Es,acceptCharset:cn,accessKey:cn,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alpha:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:cn,autoFocus:yt,autoPlay:yt,blocking:cn,capture:null,charSet:null,checked:yt,cite:null,className:cn,closedBy:null,colorSpace:null,cols:je,colSpan:je,command:null,commandFor:null,content:null,contentEditable:Bn,controls:yt,controlsList:cn,coords:je|Es,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:Km,draggable:Bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:cn,height:je,hidden:Km,high:je,href:null,hrefLang:null,htmlFor:cn,httpEquiv:cn,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:cn,itemRef:cn,itemScope:yt,itemType:cn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yt,optimum:je,pattern:null,ping:cn,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:cn,required:yt,reversed:yt,rows:je,rowSpan:je,sandbox:cn,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootCustomElementRegistry:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shadowRootSerializable:yt,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:Bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Bn,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:cn,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:Bn,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:yt,disablePictureInPicture:yt,disableRemotePlayback:yt,exportParts:Es,part:cn,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:T5}),aS=So({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ur,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:cn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Es,g2:Es,glyphName:Es,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:Ur,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:cn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ur,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ur,rev:Ur,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ur,requiredFeatures:Ur,requiredFonts:Ur,requiredFormats:Ur,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:Ur,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ur,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ur,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:E5}),C5=So({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),R5=So({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:T5}),N5=So({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),iS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},sS=/[A-Z]/g,jb=/-[a-z]/g,oS=/^data[-\w.:]+$/i;function A5(e,t){const n=Fl(t);let a=t,s=_r;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oS.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(jb,cS);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!jb.test(o)){let c=o.replace(sS,lS);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}s=G1}return new s(a,t)}function lS(e){return"-"+e.toLowerCase()}function cS(e){return e.charAt(1).toUpperCase()}const I5=k5([S5,rS,C5,R5,N5],"html"),bd=k5([S5,aS,C5,R5,N5],"svg");function Lb(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function uS(e){return e.join(" ").trim()}var uo={},th,zb;function dS(){if(zb)return th;zb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
20
- `,m="/",p="*",g="",x="comment",v="declaration";function S(N,R){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];R=R||{};var O=1,_=1;function P(ee){var q=ee.match(t);q&&(O+=q.length);var I=ee.lastIndexOf(h);_=~I?ee.length-I:_+ee.length}function U(){var ee={line:O,column:_};return function(q){return q.position=new A(ee),H(),q}}function A(ee){this.start=ee,this.end={line:O,column:_},this.source=R.source}A.prototype.content=N;function z(ee){var q=new Error(R.source+":"+O+":"+_+": "+ee);if(q.reason=ee,q.filename=R.source,q.line=O,q.column=_,q.source=N,!R.silent)throw q}function X(ee){var q=ee.exec(N);if(q){var I=q[0];return P(I),N=N.slice(I.length),q}}function H(){X(n)}function $(ee){var q;for(ee=ee||[];q=F();)q!==!1&&ee.push(q);return ee}function F(){var ee=U();if(!(m!=N.charAt(0)||p!=N.charAt(1))){for(var q=2;g!=N.charAt(q)&&(p!=N.charAt(q)||m!=N.charAt(q+1));)++q;if(q+=2,g===N.charAt(q-1))return z("End of comment missing");var I=N.slice(2,q-2);return _+=2,P(I),N=N.slice(q),_+=2,ee({type:x,comment:I})}}function Y(){var ee=U(),q=X(a);if(q){if(F(),!X(s))return z("property missing ':'");var I=X(o),K=ee({type:v,property:T(q[0].replace(e,g)),value:I?T(I[0].replace(e,g)):g});return X(c),K}}function oe(){var ee=[];$(ee);for(var q;q=Y();)q!==!1&&(ee.push(q),$(ee));return ee}return H(),oe()}function T(N){return N?N.replace(d,g):g}return th=S,th}var Bb;function fS(){if(Bb)return uo;Bb=1;var e=uo&&uo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(uo,"__esModule",{value:!0}),uo.default=n;const t=e(dS());function n(a,s){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),d=typeof s=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:p}=h;d?s(m,p,h):p&&(o=o||{},o[m]=p)}),o}return uo}var xl={},qb;function hS(){if(qb)return xl;qb=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(m){return!m||n.test(m)||e.test(m)},c=function(m,p){return p.toUpperCase()},d=function(m,p){return"".concat(p,"-")},h=function(m,p){return p===void 0&&(p={}),o(m)?m:(m=m.toLowerCase(),p.reactCompat?m=m.replace(s,d):m=m.replace(a,d),m.replace(t,c))};return xl.camelCase=h,xl}var wl,Hb;function mS(){if(Hb)return wl;Hb=1;var e=wl&&wl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(fS()),n=hS();function a(s,o){var c={};return!s||typeof s!="string"||(0,t.default)(s,function(d,h){d&&h&&(c[(0,n.camelCase)(d,o)]=h)}),c}return a.default=a,wl=a,wl}var pS=mS();const gS=md(pS),_5=M5("end"),V1=M5("start");function M5(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function bS(e){const t=V1(e),n=_5(e);if(t&&n)return{start:t,end:n}}function Ml(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ub(e.position):"start"in e||"end"in e?Ub(e):"line"in e||"column"in e?Wm(e):""}function Wm(e){return Fb(e&&e.line)+":"+Fb(e&&e.column)}function Ub(e){return Wm(e&&e.start)+"-"+Wm(e&&e.end)}function Fb(e){return e&&typeof e=="number"?e:1}class ur extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(c=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?o.ruleId=a:(o.source=a.slice(0,h),o.ruleId=a.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=Ml(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ur.prototype.file="";ur.prototype.name="";ur.prototype.reason="";ur.prototype.message="";ur.prototype.stack="";ur.prototype.column=void 0;ur.prototype.line=void 0;ur.prototype.ancestors=void 0;ur.prototype.cause=void 0;ur.prototype.fatal=void 0;ur.prototype.place=void 0;ur.prototype.ruleId=void 0;ur.prototype.source=void 0;const K1={}.hasOwnProperty,vS=new Map,yS=/[A-Z]/g,xS=new Set(["table","tbody","thead","tfoot","tr"]),wS=new Set(["td","th"]),O5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=IS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=AS(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?bd:I5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=D5(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function D5(e,t,n){if(t.type==="element")return SS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ES(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return CS(e,t,n);if(t.type==="mdxjsEsm")return TS(e,t);if(t.type==="root")return RS(e,t,n);if(t.type==="text")return NS(e,t)}function SS(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=bd,e.schema=s),e.ancestors.push(t);const o=L5(e,t.tagName,!1),c=_S(e,t);let d=W1(e,t);return xS.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!tS(h):!0})),j5(e,c,o,t),Y1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function ES(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}$l(e,t.position)}function TS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$l(e,t.position)}function CS(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=bd,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:L5(e,t.name,!0),c=MS(e,t),d=W1(e,t);return j5(e,c,o,t),Y1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function RS(e,t,n){const a={};return Y1(a,W1(e,t)),e.create(t,e.Fragment,a,n)}function NS(e,t){return t.value}function j5(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Y1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function AS(e,t,n){return a;function a(s,o,c,d){const m=Array.isArray(c.children)?n:t;return d?m(o,c,d):m(o,c)}}function IS(e,t){return n;function n(a,s,o,c){const d=Array.isArray(o.children),h=V1(a);return t(s,o,c,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function _S(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&K1.call(t.properties,s)){const o=OS(e,s,t.properties[s]);if(o){const[c,d]=o;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&wS.has(t.tagName)?a=d:n[c]=d}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function MS(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else $l(e,t.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else $l(e,t.position);else o=a.value===null?!0:a.value;n[s]=o}return n}function W1(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:vS;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const m=s.get(h)||0;c=h+"-"+m,s.set(h,m+1)}}const d=D5(e,o,c);d!==void 0&&n.push(d)}return n}function OS(e,t,n){const a=A5(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?Zk(n):uS(n)),a.property==="style"){let s=typeof n=="object"?n:DS(e,String(n));return e.stylePropertyNameCase==="css"&&(s=jS(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?iS[a.property]||a.property:a.attribute,n]}}function DS(e,t){try{return gS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new ur("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=O5+"#cannot-parse-style-attribute",s}}function L5(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,c;for(;++o<s.length;){const d=Mb(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}a=c}else a=Mb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return K1.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);$l(e)}function $l(e,t){const n=new ur("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=O5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function jS(e){const t={};let n;for(n in e)K1.call(e,n)&&(t[LS(n)]=e[n]);return t}function LS(e){let t=e.replace(yS,zS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function zS(e){return"-"+e.toLowerCase()}const nh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},BS={};function Z1(e,t){const n=BS,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return z5(e,a,s)}function z5(e,t,n){if(qS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return $b(e.children,t,n)}return Array.isArray(e)?$b(e,t,n):""}function $b(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=z5(e[s],t,n);return a.join("")}function qS(e){return!!(e&&typeof e=="object")}const Pb=document.createElement("i");function X1(e){const t="&"+e+";";Pb.innerHTML=t;const n=Pb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Fr(e,t,n,a){const s=e.length;let o=0,c;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function aa(e,t){return e.length>0?(Fr(e,e.length,0,t),e):t}const Gb={}.hasOwnProperty;function B5(e){const t={};let n=-1;for(;++n<e.length;)HS(t,e[n]);return t}function HS(e,t){let n;for(n in t){const s=(Gb.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){Gb.call(s,c)||(s[c]=[]);const d=o[c];US(s[c],Array.isArray(d)?d:d?[d]:[])}}}function US(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Fr(e,0,0,a)}function q5(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function pa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const gr=Zi(/[A-Za-z]/),lr=Zi(/[\dA-Za-z]/),FS=Zi(/[#-'*+\--9=?A-Z^-~]/);function td(e){return e!==null&&(e<32||e===127)}const Zm=Zi(/\d/),$S=Zi(/[\dA-Fa-f]/),PS=Zi(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function un(e){return e!==null&&(e<0||e===32)}function zt(e){return e===-2||e===-1||e===32}const vd=Zi(new RegExp("\\p{P}|\\p{S}","u")),Rs=Zi(/\s/);function Zi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Eo(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&lr(e.charCodeAt(n+1))&&lr(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(c=String.fromCharCode(o,d),s=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+s+1,c=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function Ot(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(h){return zt(h)?(e.enter(n),d(h)):t(h)}function d(h){return zt(h)&&o++<s?(e.consume(h),d):(e.exit(n),t(h))}}const GS={tokenize:VS};function VS(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Ot(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),o(d)}function o(d){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return tt(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),c)}}const KS={tokenize:YS},Vb={tokenize:WS};function YS(e){const t=this,n=[];let a=0,s,o,c;return d;function d(_){if(a<n.length){const P=n[a];return t.containerState=P[1],e.attempt(P[0].continuation,h,m)(_)}return m(_)}function h(_){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&O();const P=t.events.length;let U=P,A;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){A=t.events[U][1].end;break}R(a);let z=P;for(;z<t.events.length;)t.events[z][1].end={...A},z++;return Fr(t.events,U+1,0,t.events.slice(P)),t.events.length=z,m(_)}return d(_)}function m(_){if(a===n.length){if(!s)return x(_);if(s.currentConstruct&&s.currentConstruct.concrete)return S(_);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Vb,p,g)(_)}function p(_){return s&&O(),R(a),x(_)}function g(_){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,S(_)}function x(_){return t.containerState={},e.attempt(Vb,v,S)(_)}function v(_){return a++,n.push([t.currentConstruct,t.containerState]),x(_)}function S(_){if(_===null){s&&O(),R(0),e.consume(_);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),T(_)}function T(_){if(_===null){N(e.exit("chunkFlow"),!0),R(0),e.consume(_);return}return tt(_)?(e.consume(_),N(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(_),T)}function N(_,P){const U=t.sliceStream(_);if(P&&U.push(null),_.previous=o,o&&(o.next=_),o=_,s.defineSkip(_.start),s.write(U),t.parser.lazy[_.start.line]){let A=s.events.length;for(;A--;)if(s.events[A][1].start.offset<c&&(!s.events[A][1].end||s.events[A][1].end.offset>c))return;const z=t.events.length;let X=z,H,$;for(;X--;)if(t.events[X][0]==="exit"&&t.events[X][1].type==="chunkFlow"){if(H){$=t.events[X][1].end;break}H=!0}for(R(a),A=z;A<t.events.length;)t.events[A][1].end={...$},A++;Fr(t.events,X+1,0,t.events.slice(z)),t.events.length=A}}function R(_){let P=n.length;for(;P-- >_;){const U=n[P];t.containerState=U[1],U[0].exit.call(t,e)}n.length=_}function O(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function WS(e,t,n){return Ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bo(e){if(e===null||un(e)||Rs(e))return 1;if(vd(e))return 2}function yd(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Xm={name:"attention",resolveAll:ZS,tokenize:XS};function ZS(e,t){let n=-1,a,s,o,c,d,h,m,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},x={...e[n][1].start};Kb(g,-h),Kb(x,h),c={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[n][1].start={...d.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=aa(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=aa(m,[["enter",s,t],["enter",c,t],["exit",c,t],["enter",o,t]]),m=aa(m,yd(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=aa(m,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,m=aa(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Fr(e,a-1,n-a+3,m),n=a+m.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function XS(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=bo(a);let o;return c;function c(h){return o=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===o)return e.consume(h),d;const m=e.exit("attentionSequence"),p=bo(h),g=!p||p===2&&s||n.includes(h),x=!s||s===2&&p||n.includes(a);return m._open=!!(o===42?g:g&&(s||!x)),m._close=!!(o===42?x:x&&(p||!g)),t(h)}}function Kb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const QS={name:"autolink",tokenize:JS};function JS(e,t,n){let a=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return gr(v)?(e.consume(v),c):v===64?n(v):m(v)}function c(v){return v===43||v===45||v===46||lr(v)?(a=1,d(v)):m(v)}function d(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||lr(v))&&a++<32?(e.consume(v),d):(a=0,m(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||td(v)?n(v):(e.consume(v),h)}function m(v){return v===64?(e.consume(v),p):FS(v)?(e.consume(v),m):n(v)}function p(v){return lr(v)?g(v):n(v)}function g(v){return v===46?(e.consume(v),a=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):x(v)}function x(v){if((v===45||lr(v))&&a++<63){const S=v===45?x:g;return e.consume(v),S}return n(v)}}const ec={partial:!0,tokenize:eE};function eE(e,t,n){return a;function a(o){return zt(o)?Ot(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||tt(o)?t(o):n(o)}}const H5={continuation:{tokenize:nE},exit:rE,name:"blockQuote",tokenize:tE};function tE(e,t,n){const a=this;return s;function s(c){if(c===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return zt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function nE(e,t,n){const a=this;return s;function s(c){return zt(c)?Ot(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(H5,t,n)(c)}}function rE(e){e.exit("blockQuote")}const U5={name:"characterEscape",tokenize:aE};function aE(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return PS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const F5={name:"characterReference",tokenize:iE};function iE(e,t,n){const a=this;let s=0,o,c;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),o=31,c=lr,p(g))}function m(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=$S,p):(e.enter("characterReferenceValue"),o=7,c=Zm,p(g))}function p(g){if(g===59&&s){const x=e.exit("characterReferenceValue");return c===lr&&!X1(a.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&s++<o?(e.consume(g),p):n(g)}}const Yb={partial:!0,tokenize:oE},Wb={concrete:!0,name:"codeFenced",tokenize:sE};function sE(e,t,n){const a=this,s={partial:!0,tokenize:U};let o=0,c=0,d;return h;function h(A){return m(A)}function m(A){const z=a.events[a.events.length-1];return o=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,d=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(A)}function p(A){return A===d?(c++,e.consume(A),p):c<3?n(A):(e.exit("codeFencedFenceSequence"),zt(A)?Ot(e,g,"whitespace")(A):g(A))}function g(A){return A===null||tt(A)?(e.exit("codeFencedFence"),a.interrupt?t(A):e.check(Yb,T,P)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(A)):zt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ot(e,v,"whitespace")(A)):A===96&&A===d?n(A):(e.consume(A),x)}function v(A){return A===null||tt(A)?g(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(A))}function S(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(A)):A===96&&A===d?n(A):(e.consume(A),S)}function T(A){return e.attempt(s,P,N)(A)}function N(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),R}function R(A){return o>0&&zt(A)?Ot(e,O,"linePrefix",o+1)(A):O(A)}function O(A){return A===null||tt(A)?e.check(Yb,T,P)(A):(e.enter("codeFlowValue"),_(A))}function _(A){return A===null||tt(A)?(e.exit("codeFlowValue"),O(A)):(e.consume(A),_)}function P(A){return e.exit("codeFenced"),t(A)}function U(A,z,X){let H=0;return $;function $(q){return A.enter("lineEnding"),A.consume(q),A.exit("lineEnding"),F}function F(q){return A.enter("codeFencedFence"),zt(q)?Ot(A,Y,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):Y(q)}function Y(q){return q===d?(A.enter("codeFencedFenceSequence"),oe(q)):X(q)}function oe(q){return q===d?(H++,A.consume(q),oe):H>=c?(A.exit("codeFencedFenceSequence"),zt(q)?Ot(A,ee,"whitespace")(q):ee(q)):X(q)}function ee(q){return q===null||tt(q)?(A.exit("codeFencedFence"),z(q)):X(q)}}}function oE(e,t,n){const a=this;return s;function s(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const rh={name:"codeIndented",tokenize:cE},lE={partial:!0,tokenize:uE};function cE(e,t,n){const a=this;return s;function s(m){return e.enter("codeIndented"),Ot(e,o,"linePrefix",5)(m)}function o(m){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?h(m):tt(m)?e.attempt(lE,c,h)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||tt(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),d)}function h(m){return e.exit("codeIndented"),t(m)}}function uE(e,t,n){const a=this;return s;function s(c){return a.parser.lazy[a.now().line]?n(c):tt(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):Ot(e,o,"linePrefix",5)(c)}function o(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):tt(c)?s(c):n(c)}}const dE={name:"codeText",previous:hE,resolve:fE,tokenize:mE};function fE(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function hE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function mE(e,t,n){let a=0,s,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),a++,d):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(o=e.enter("codeTextSequence"),s=0,p(g)):tt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||tt(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),m)}function p(g){return g===96?(e.consume(g),s++,p):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",m(g))}}class pE{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&kl(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);kl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);kl(this.left,n.reverse())}}}function kl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $5(e){const t={};let n=-1,a,s,o,c,d,h,m;const p=new pE(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(a=p.get(n),n&&a[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,gE(p,n)),n=t[n],m=!0);else if(a[1]._container){for(o=n,s=void 0;o--;)if(c=p.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),c[1].type="lineEnding",s=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;s&&(a[1].end={...p.get(s)[1].start},d=p.slice(s,n),d.unshift(a),p.splice(s,n-s+1,d))}}return Fr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!m}function gE(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,h=[],m={};let p,g,x=-1,v=n,S=0,T=0;const N=[T];for(;v;){for(;e.get(++s)[1]!==v;);o.push(s),v._tokenizer||(p=a.sliceStream(v),v.next||p.push(null),g&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=n;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(T=x+1,N.push(T),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),x=N.length;x--;){const R=d.slice(N[x],N[x+1]),O=o.pop();h.push([O,O+R.length-1]),e.splice(O,2,R)}for(h.reverse(),x=-1;++x<h.length;)m[S+h[x][0]]=S+h[x][1],S+=h[x][1]-h[x][0]-1;return m}const bE={resolve:yE,tokenize:xE},vE={partial:!0,tokenize:wE};function yE(e){return $5(e),e}function xE(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?o(d):tt(d)?e.check(vE,c,o)(d):(e.consume(d),s)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function wE(e,t,n){const a=this;return s;function s(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ot(e,o,"linePrefix")}function o(c){if(c===null||tt(c))return n(c);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function P5(e,t,n,a,s,o,c,d,h){const m=h||Number.POSITIVE_INFINITY;let p=0;return g;function g(R){return R===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(R),e.exit(o),x):R===null||R===32||R===41||td(R)?n(R):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),T(R))}function x(R){return R===62?(e.enter(o),e.consume(R),e.exit(o),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===62?(e.exit("chunkString"),e.exit(d),x(R)):R===null||R===60||tt(R)?n(R):(e.consume(R),R===92?S:v)}function S(R){return R===60||R===62||R===92?(e.consume(R),v):v(R)}function T(R){return!p&&(R===null||R===41||un(R))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),t(R)):p<m&&R===40?(e.consume(R),p++,T):R===41?(e.consume(R),p--,T):R===null||R===32||R===40||td(R)?n(R):(e.consume(R),R===92?N:T)}function N(R){return R===40||R===41||R===92?(e.consume(R),T):T(R)}}function G5(e,t,n,a,s,o){const c=this;let d=0,h;return m;function m(v){return e.enter(a),e.enter(s),e.consume(v),e.exit(s),e.enter(o),p}function p(v){return d>999||v===null||v===91||v===93&&!h||v===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(v):v===93?(e.exit(o),e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):tt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||tt(v)||d++>999?(e.exit("chunkString"),p(v)):(e.consume(v),h||(h=!zt(v)),v===92?x:g)}function x(v){return v===91||v===92||v===93?(e.consume(v),d++,g):g(v)}}function V5(e,t,n,a,s,o){let c;return d;function d(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),c=x===40?41:x,h):n(x)}function h(x){return x===c?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):(e.enter(o),m(x))}function m(x){return x===c?(e.exit(o),h(c)):x===null?n(x):tt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Ot(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===c||x===null||tt(x)?(e.exit("chunkString"),m(x)):(e.consume(x),x===92?g:p)}function g(x){return x===c||x===92?(e.consume(x),p):p(x)}}function Ol(e,t){let n;return a;function a(s){return tt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):zt(s)?Ot(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const kE={name:"definition",tokenize:EE},SE={partial:!0,tokenize:TE};function EE(e,t,n){const a=this;let s;return o;function o(v){return e.enter("definition"),c(v)}function c(v){return G5.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return s=pa(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):n(v)}function h(v){return un(v)?Ol(e,m)(v):m(v)}function m(v){return P5(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(SE,g,g)(v)}function g(v){return zt(v)?Ot(e,x,"whitespace")(v):x(v)}function x(v){return v===null||tt(v)?(e.exit("definition"),a.parser.defined.push(s),t(v)):n(v)}}function TE(e,t,n){return a;function a(d){return un(d)?Ol(e,s)(d):n(d)}function s(d){return V5(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return zt(d)?Ot(e,c,"whitespace")(d):c(d)}function c(d){return d===null||tt(d)?t(d):n(d)}}const CE={name:"hardBreakEscape",tokenize:RE};function RE(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return tt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const NE={name:"headingAtx",resolve:AE,tokenize:IE};function AE(e,t){let n=e.length-2,a=3,s,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Fr(e,a,n-a+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function IE(e,t,n){let a=0;return s;function s(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&a++<6?(e.consume(p),c):p===null||un(p)?(e.exit("atxHeadingSequence"),d(p)):n(p)}function d(p){return p===35?(e.enter("atxHeadingSequence"),h(p)):p===null||tt(p)?(e.exit("atxHeading"),t(p)):zt(p)?Ot(e,d,"whitespace")(p):(e.enter("atxHeadingText"),m(p))}function h(p){return p===35?(e.consume(p),h):(e.exit("atxHeadingSequence"),d(p))}function m(p){return p===null||p===35||un(p)?(e.exit("atxHeadingText"),d(p)):(e.consume(p),m)}}const _E=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Zb=["pre","script","style","textarea"],ME={concrete:!0,name:"htmlFlow",resolveTo:jE,tokenize:LE},OE={partial:!0,tokenize:BE},DE={partial:!0,tokenize:zE};function jE(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function LE(e,t,n){const a=this;let s,o,c,d,h;return m;function m(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),g}function g(D){return D===33?(e.consume(D),x):D===47?(e.consume(D),o=!0,T):D===63?(e.consume(D),s=3,a.interrupt?t:j):gr(D)?(e.consume(D),c=String.fromCharCode(D),N):n(D)}function x(D){return D===45?(e.consume(D),s=2,v):D===91?(e.consume(D),s=5,d=0,S):gr(D)?(e.consume(D),s=4,a.interrupt?t:j):n(D)}function v(D){return D===45?(e.consume(D),a.interrupt?t:j):n(D)}function S(D){const ye="CDATA[";return D===ye.charCodeAt(d++)?(e.consume(D),d===ye.length?a.interrupt?t:Y:S):n(D)}function T(D){return gr(D)?(e.consume(D),c=String.fromCharCode(D),N):n(D)}function N(D){if(D===null||D===47||D===62||un(D)){const ye=D===47,se=c.toLowerCase();return!ye&&!o&&Zb.includes(se)?(s=1,a.interrupt?t(D):Y(D)):_E.includes(c.toLowerCase())?(s=6,ye?(e.consume(D),R):a.interrupt?t(D):Y(D)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(D):o?O(D):_(D))}return D===45||lr(D)?(e.consume(D),c+=String.fromCharCode(D),N):n(D)}function R(D){return D===62?(e.consume(D),a.interrupt?t:Y):n(D)}function O(D){return zt(D)?(e.consume(D),O):$(D)}function _(D){return D===47?(e.consume(D),$):D===58||D===95||gr(D)?(e.consume(D),P):zt(D)?(e.consume(D),_):$(D)}function P(D){return D===45||D===46||D===58||D===95||lr(D)?(e.consume(D),P):U(D)}function U(D){return D===61?(e.consume(D),A):zt(D)?(e.consume(D),U):_(D)}function A(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),h=D,z):zt(D)?(e.consume(D),A):X(D)}function z(D){return D===h?(e.consume(D),h=null,H):D===null||tt(D)?n(D):(e.consume(D),z)}function X(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||un(D)?U(D):(e.consume(D),X)}function H(D){return D===47||D===62||zt(D)?_(D):n(D)}function $(D){return D===62?(e.consume(D),F):n(D)}function F(D){return D===null||tt(D)?Y(D):zt(D)?(e.consume(D),F):n(D)}function Y(D){return D===45&&s===2?(e.consume(D),I):D===60&&s===1?(e.consume(D),K):D===62&&s===4?(e.consume(D),G):D===63&&s===3?(e.consume(D),j):D===93&&s===5?(e.consume(D),pe):tt(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(OE,W,oe)(D)):D===null||tt(D)?(e.exit("htmlFlowData"),oe(D)):(e.consume(D),Y)}function oe(D){return e.check(DE,ee,W)(D)}function ee(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),q}function q(D){return D===null||tt(D)?oe(D):(e.enter("htmlFlowData"),Y(D))}function I(D){return D===45?(e.consume(D),j):Y(D)}function K(D){return D===47?(e.consume(D),c="",Q):Y(D)}function Q(D){if(D===62){const ye=c.toLowerCase();return Zb.includes(ye)?(e.consume(D),G):Y(D)}return gr(D)&&c.length<8?(e.consume(D),c+=String.fromCharCode(D),Q):Y(D)}function pe(D){return D===93?(e.consume(D),j):Y(D)}function j(D){return D===62?(e.consume(D),G):D===45&&s===2?(e.consume(D),j):Y(D)}function G(D){return D===null||tt(D)?(e.exit("htmlFlowData"),W(D)):(e.consume(D),G)}function W(D){return e.exit("htmlFlow"),t(D)}}function zE(e,t,n){const a=this;return s;function s(c){return tt(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function BE(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ec,t,n)}}const qE={name:"htmlText",tokenize:HE};function HE(e,t,n){const a=this;let s,o,c;return d;function d(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),m):j===47?(e.consume(j),U):j===63?(e.consume(j),_):gr(j)?(e.consume(j),X):n(j)}function m(j){return j===45?(e.consume(j),p):j===91?(e.consume(j),o=0,S):gr(j)?(e.consume(j),O):n(j)}function p(j){return j===45?(e.consume(j),v):n(j)}function g(j){return j===null?n(j):j===45?(e.consume(j),x):tt(j)?(c=g,K(j)):(e.consume(j),g)}function x(j){return j===45?(e.consume(j),v):g(j)}function v(j){return j===62?I(j):j===45?x(j):g(j)}function S(j){const G="CDATA[";return j===G.charCodeAt(o++)?(e.consume(j),o===G.length?T:S):n(j)}function T(j){return j===null?n(j):j===93?(e.consume(j),N):tt(j)?(c=T,K(j)):(e.consume(j),T)}function N(j){return j===93?(e.consume(j),R):T(j)}function R(j){return j===62?I(j):j===93?(e.consume(j),R):T(j)}function O(j){return j===null||j===62?I(j):tt(j)?(c=O,K(j)):(e.consume(j),O)}function _(j){return j===null?n(j):j===63?(e.consume(j),P):tt(j)?(c=_,K(j)):(e.consume(j),_)}function P(j){return j===62?I(j):_(j)}function U(j){return gr(j)?(e.consume(j),A):n(j)}function A(j){return j===45||lr(j)?(e.consume(j),A):z(j)}function z(j){return tt(j)?(c=z,K(j)):zt(j)?(e.consume(j),z):I(j)}function X(j){return j===45||lr(j)?(e.consume(j),X):j===47||j===62||un(j)?H(j):n(j)}function H(j){return j===47?(e.consume(j),I):j===58||j===95||gr(j)?(e.consume(j),$):tt(j)?(c=H,K(j)):zt(j)?(e.consume(j),H):I(j)}function $(j){return j===45||j===46||j===58||j===95||lr(j)?(e.consume(j),$):F(j)}function F(j){return j===61?(e.consume(j),Y):tt(j)?(c=F,K(j)):zt(j)?(e.consume(j),F):H(j)}function Y(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),s=j,oe):tt(j)?(c=Y,K(j)):zt(j)?(e.consume(j),Y):(e.consume(j),ee)}function oe(j){return j===s?(e.consume(j),s=void 0,q):j===null?n(j):tt(j)?(c=oe,K(j)):(e.consume(j),oe)}function ee(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||un(j)?H(j):(e.consume(j),ee)}function q(j){return j===47||j===62||un(j)?H(j):n(j)}function I(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function K(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),Q}function Q(j){return zt(j)?Ot(e,pe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):pe(j)}function pe(j){return e.enter("htmlTextData"),c(j)}}const Q1={name:"labelEnd",resolveAll:PE,resolveTo:GE,tokenize:VE},UE={tokenize:KE},FE={tokenize:YE},$E={tokenize:WE};function PE(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&Fr(e,0,e.length,n),e}function GE(e,t){let n=e.length,a=0,s,o,c,d;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(c=n);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},p={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",h,t],["enter",m,t]],d=aa(d,e.slice(o+1,o+a+3)),d=aa(d,[["enter",p,t]]),d=aa(d,yd(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),d=aa(d,[["exit",p,t],e[c-2],e[c-1],["exit",m,t]]),d=aa(d,e.slice(c+1)),d=aa(d,[["exit",h,t]]),Fr(e,o,e.length,d),e}function VE(e,t,n){const a=this;let s=a.events.length,o,c;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return d;function d(x){return o?o._inactive?g(x):(c=a.parser.defined.includes(pa(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):n(x)}function h(x){return x===40?e.attempt(UE,p,c?p:g)(x):x===91?e.attempt(FE,p,c?m:g)(x):c?p(x):g(x)}function m(x){return e.attempt($E,p,g)(x)}function p(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function KE(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return un(g)?Ol(e,o)(g):o(g)}function o(g){return g===41?p(g):P5(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return un(g)?Ol(e,h)(g):p(g)}function d(g){return n(g)}function h(g){return g===34||g===39||g===40?V5(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function m(g){return un(g)?Ol(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function YE(e,t,n){const a=this;return s;function s(d){return G5.call(a,e,o,c,"reference","referenceMarker","referenceString")(d)}function o(d){return a.parser.defined.includes(pa(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function WE(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const ZE={name:"labelStartImage",resolveAll:Q1.resolveAll,tokenize:XE};function XE(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const QE={name:"labelStartLink",resolveAll:Q1.resolveAll,tokenize:JE};function JE(e,t,n){const a=this;return s;function s(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const ah={name:"lineEnding",tokenize:eT};function eT(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ot(e,t,"linePrefix")}}const Fu={name:"thematicBreak",tokenize:tT};function tT(e,t,n){let a=0,s;return o;function o(m){return e.enter("thematicBreak"),c(m)}function c(m){return s=m,d(m)}function d(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||tt(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),zt(m)?Ot(e,d,"whitespace")(m):d(m))}}const Nr={continuation:{tokenize:iT},exit:oT,name:"list",tokenize:aT},nT={partial:!0,tokenize:lT},rT={partial:!0,tokenize:sT};function aT(e,t,n){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,c=0;return d;function d(v){const S=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:Zm(v)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Fu,n,m)(v):m(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return n(v)}function h(v){return Zm(v)&&++c<10?(e.consume(v),h):(!a.interrupt||c<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):n(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(ec,a.interrupt?n:p,e.attempt(nT,x,g))}function p(v){return a.containerState.initialBlankLine=!0,o++,x(v)}function g(v){return zt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),x):n(v)}function x(v){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function iT(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(ec,s,o);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Ot(e,t,"listItemIndent",a.containerState.size+1)(d)}function o(d){return a.containerState.furtherBlankLines||!zt(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(rT,t,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Ot(e,e.attempt(Nr,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function sT(e,t,n){const a=this;return Ot(e,s,"listItemIndent",a.containerState.size+1);function s(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function oT(e){e.exit(this.containerState.type)}function lT(e,t,n){const a=this;return Ot(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const c=a.events[a.events.length-1];return!zt(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Xb={name:"setextUnderline",resolveTo:cT,tokenize:uT};function cT(e,t){let n=e.length,a,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function uT(e,t,n){const a=this;let s;return o;function o(m){let p=a.events.length,g;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){g=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),s=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===s?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),zt(m)?Ot(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||tt(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const dT={tokenize:fT};function fT(e){const t=this,n=e.attempt(ec,a,e.attempt(this.parser.constructs.flowInitial,s,Ot(e,e.attempt(this.parser.constructs.flow,s,e.attempt(bE,s)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const hT={resolveAll:Y5()},mT=K5("string"),pT=K5("text");function K5(e){return{resolveAll:Y5(e==="text"?gT:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],o=n.attempt(s,c,d);return c;function c(p){return m(p)?o(p):d(p)}function d(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),h}function h(p){return m(p)?(n.exit("data"),o(p)):(n.consume(p),h)}function m(p){if(p===null)return!0;const g=s[p];let x=-1;if(g)for(;++x<g.length;){const v=g[x];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function Y5(e){return t;function t(n,a){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,a):n}}function gT(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],s=t.sliceStream(a);let o=s.length,c=-1,d=0,h;for(;o--;){const m=s[o];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(m===-2)h=!0,d++;else if(m!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const bT={42:Nr,43:Nr,45:Nr,48:Nr,49:Nr,50:Nr,51:Nr,52:Nr,53:Nr,54:Nr,55:Nr,56:Nr,57:Nr,62:H5},vT={91:kE},yT={[-2]:rh,[-1]:rh,32:rh},xT={35:NE,42:Fu,45:[Xb,Fu],60:ME,61:Xb,95:Fu,96:Wb,126:Wb},wT={38:F5,92:U5},kT={[-5]:ah,[-4]:ah,[-3]:ah,33:ZE,38:F5,42:Xm,60:[QS,qE],91:QE,92:[CE,U5],93:Q1,95:Xm,96:dE},ST={null:[Xm,hT]},ET={null:[42,95]},TT={null:[]},CT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ET,contentInitial:vT,disable:TT,document:bT,flow:xT,flowInitial:yT,insideSpan:ST,string:wT,text:kT},Symbol.toStringTag,{value:"Module"}));function RT(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},o=[];let c=[],d=[];const h={attempt:z(U),check:z(A),consume:O,enter:_,exit:P,interrupt:z(A,{interrupt:!0})},m={code:null,containerState:{},defineSkip:T,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:v,write:g};let p=t.tokenize.call(m,h);return t.resolveAll&&o.push(t),m;function g(F){return c=aa(c,F),N(),c[c.length-1]!==null?[]:(X(t,0),m.events=yd(o,m.events,m),m.events)}function x(F,Y){return AT(v(F),Y)}function v(F){return NT(c,F)}function S(){const{_bufferIndex:F,_index:Y,line:oe,column:ee,offset:q}=a;return{_bufferIndex:F,_index:Y,line:oe,column:ee,offset:q}}function T(F){s[F.line]=F.column,$()}function N(){let F;for(;a._index<c.length;){const Y=c[a._index];if(typeof Y=="string")for(F=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===F&&a._bufferIndex<Y.length;)R(Y.charCodeAt(a._bufferIndex));else R(Y)}}function R(F){p=p(F)}function O(F){tt(F)?(a.line++,a.column=1,a.offset+=F===-3?2:1,$()):F!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=F}function _(F,Y){const oe=Y||{};return oe.type=F,oe.start=S(),m.events.push(["enter",oe,m]),d.push(oe),oe}function P(F){const Y=d.pop();return Y.end=S(),m.events.push(["exit",Y,m]),Y}function U(F,Y){X(F,Y.from)}function A(F,Y){Y.restore()}function z(F,Y){return oe;function oe(ee,q,I){let K,Q,pe,j;return Array.isArray(ee)?W(ee):"tokenize"in ee?W([ee]):G(ee);function G(V){return Z;function Z(ne){const ue=ne!==null&&V[ne],he=ne!==null&&V.null,Re=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(he)?he:he?[he]:[]];return W(Re)(ne)}}function W(V){return K=V,Q=0,V.length===0?I:D(V[Q])}function D(V){return Z;function Z(ne){return j=H(),pe=V,V.partial||(m.currentConstruct=V),V.name&&m.parser.constructs.disable.null.includes(V.name)?se():V.tokenize.call(Y?Object.assign(Object.create(m),Y):m,h,ye,se)(ne)}}function ye(V){return F(pe,j),q}function se(V){return j.restore(),++Q<K.length?D(K[Q]):I}}}function X(F,Y){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&Fr(m.events,Y,m.events.length-Y,F.resolve(m.events.slice(Y),m)),F.resolveTo&&(m.events=F.resolveTo(m.events,m))}function H(){const F=S(),Y=m.previous,oe=m.currentConstruct,ee=m.events.length,q=Array.from(d);return{from:ee,restore:I};function I(){a=F,m.previous=Y,m.currentConstruct=oe,m.events.length=ee,d=q,$()}}function $(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function NT(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let c;if(n===s)c=[e[n].slice(a,o)];else{if(c=e.slice(n,s),a>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}o>0&&c.push(e[s].slice(0,o))}return c}function AT(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
21
- `;break}case-3:{c=`\r
22
- `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&s)continue;c=" ";break}default:c=String.fromCharCode(o)}s=o===-2,a.push(c)}return a.join("")}function IT(e){const a={constructs:B5([CT,...(e||{}).extensions||[]]),content:s(GS),defined:[],document:s(KS),flow:s(dT),lazy:{},string:s(mT),text:s(pT)};return a;function s(o){return c;function c(d){return RT(a,o,d)}}}function _T(e){for(;!$5(e););return e}const Qb=/[\0\t\n\r]/g;function MT(){let e=1,t="",n=!0,a;return s;function s(o,c,d){const h=[];let m,p,g,x,v;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(Qb.lastIndex=g,m=Qb.exec(o),x=m&&m.index!==void 0?m.index:o.length,v=o.charCodeAt(x),!m){t=o.slice(g);break}if(v===10&&g===x&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),g<x&&(h.push(o.slice(g,x)),e+=x-g),v){case 0:{h.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,h.push(-2);e++<p;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}g=x+1}return d&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const OT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DT(e){return e.replace(OT,jT)}function jT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return q5(n.slice(o?2:1),o?16:10)}return X1(n)||e}const W5={}.hasOwnProperty;function LT(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),zT(n)(_T(IT(n).document().write(MT()(e,t,!0))))}function zT(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Mt),autolinkProtocol:H,autolinkEmail:H,atxHeading:o(gt),blockQuote:o(he),characterEscape:H,characterReference:H,codeFenced:o(Re),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Re,c),codeText:o(ze,c),codeTextData:H,data:H,codeFlowValue:H,definition:o(Ke),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(ft),hardBreakEscape:o(Rt),hardBreakTrailing:o(Rt),htmlFlow:o(Bt,c),htmlFlowData:H,htmlText:o(Bt,c),htmlTextData:H,image:o(rt),label:c,link:o(Mt),listItem:o(qt),listItemValue:x,listOrdered:o(mt,g),listUnordered:o(mt),paragraph:o(Be),reference:D,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(gt),strong:o(Qe),thematicBreak:o(st)},exit:{atxHeading:h(),atxHeadingSequence:U,autolink:h(),autolinkEmail:ue,autolinkProtocol:ne,blockQuote:h(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:V,characterReference:Z,codeFenced:h(N),codeFencedFence:T,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:$,codeIndented:h(R),codeText:h(q),codeTextData:$,data:$,definition:h(),definitionDestinationString:P,definitionLabelString:O,definitionTitleString:_,emphasis:h(),hardBreakEscape:h(Y),hardBreakTrailing:h(Y),htmlFlow:h(oe),htmlFlowData:$,htmlText:h(ee),htmlTextData:$,image:h(K),label:pe,labelText:Q,lineEnding:F,link:h(I),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ye,resourceDestinationString:j,resourceTitleString:G,resource:W,setextHeading:h(X),setextHeadingLineSequence:z,setextHeadingText:A,strong:h(),thematicBreak:h()}};Z5(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(me){let fe={type:"root",children:[]};const He={stack:[fe],tokenStack:[],config:t,enter:d,exit:m,buffer:c,resume:p,data:n},we=[];let Fe=-1;for(;++Fe<me.length;)if(me[Fe][1].type==="listOrdered"||me[Fe][1].type==="listUnordered")if(me[Fe][0]==="enter")we.push(Fe);else{const ct=we.pop();Fe=s(me,ct,Fe)}for(Fe=-1;++Fe<me.length;){const ct=t[me[Fe][0]];W5.call(ct,me[Fe][1].type)&&ct[me[Fe][1].type].call(Object.assign({sliceSerialize:me[Fe][2].sliceSerialize},He),me[Fe][1])}if(He.tokenStack.length>0){const ct=He.tokenStack[He.tokenStack.length-1];(ct[1]||Jb).call(He,void 0,ct[0])}for(fe.position={start:zi(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:zi(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)fe=t.transforms[Fe](fe)||fe;return fe}function s(me,fe,He){let we=fe-1,Fe=-1,ct=!1,Ie,Pt,bt,_t;for(;++we<=He;){const Et=me[we];switch(Et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Et[0]==="enter"?Fe++:Fe--,_t=void 0;break}case"lineEndingBlank":{Et[0]==="enter"&&(Ie&&!_t&&!Fe&&!bt&&(bt=we),_t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_t=void 0}if(!Fe&&Et[0]==="enter"&&Et[1].type==="listItemPrefix"||Fe===-1&&Et[0]==="exit"&&(Et[1].type==="listUnordered"||Et[1].type==="listOrdered")){if(Ie){let $n=we;for(Pt=void 0;$n--;){const en=me[$n];if(en[1].type==="lineEnding"||en[1].type==="lineEndingBlank"){if(en[0]==="exit")continue;Pt&&(me[Pt][1].type="lineEndingBlank",ct=!0),en[1].type="lineEnding",Pt=$n}else if(!(en[1].type==="linePrefix"||en[1].type==="blockQuotePrefix"||en[1].type==="blockQuotePrefixWhitespace"||en[1].type==="blockQuoteMarker"||en[1].type==="listItemIndent"))break}bt&&(!Pt||bt<Pt)&&(Ie._spread=!0),Ie.end=Object.assign({},Pt?me[Pt][1].start:Et[1].end),me.splice(Pt||we,0,["exit",Ie,Et[2]]),we++,He++}if(Et[1].type==="listItemPrefix"){const $n={type:"listItem",_spread:!1,start:Object.assign({},Et[1].start),end:void 0};Ie=$n,me.splice(we,0,["enter",$n,Et[2]]),we++,He++,bt=void 0,_t=!0}}}return me[fe][1]._spread=ct,He}function o(me,fe){return He;function He(we){d.call(this,me(we),we),fe&&fe.call(this,we)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(me,fe,He){this.stack[this.stack.length-1].children.push(me),this.stack.push(me),this.tokenStack.push([fe,He||void 0]),me.position={start:zi(fe.start),end:void 0}}function h(me){return fe;function fe(He){me&&me.call(this,He),m.call(this,He)}}function m(me,fe){const He=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==me.type&&(fe?fe.call(this,me,we[0]):(we[1]||Jb).call(this,me,we[0]));else throw new Error("Cannot close `"+me.type+"` ("+Ml({start:me.start,end:me.end})+"): it’s not open");He.position.end=zi(me.end)}function p(){return Z1(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(me){if(this.data.expectingFirstListItemValue){const fe=this.stack[this.stack.length-2];fe.start=Number.parseInt(this.sliceSerialize(me),10),this.data.expectingFirstListItemValue=void 0}}function v(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.lang=me}function S(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.meta=me}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.value=me.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function R(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.value=me.replace(/(\r?\n|\r)$/g,"")}function O(me){const fe=this.resume(),He=this.stack[this.stack.length-1];He.label=fe,He.identifier=pa(this.sliceSerialize(me)).toLowerCase()}function _(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.title=me}function P(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.url=me}function U(me){const fe=this.stack[this.stack.length-1];if(!fe.depth){const He=this.sliceSerialize(me).length;fe.depth=He}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function z(me){const fe=this.stack[this.stack.length-1];fe.depth=this.sliceSerialize(me).codePointAt(0)===61?1:2}function X(){this.data.setextHeadingSlurpLineEnding=void 0}function H(me){const He=this.stack[this.stack.length-1].children;let we=He[He.length-1];(!we||we.type!=="text")&&(we=Ue(),we.position={start:zi(me.start),end:void 0},He.push(we)),this.stack.push(we)}function $(me){const fe=this.stack.pop();fe.value+=this.sliceSerialize(me),fe.position.end=zi(me.end)}function F(me){const fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const He=fe.children[fe.children.length-1];He.position.end=zi(me.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(fe.type)&&(H.call(this,me),$.call(this,me))}function Y(){this.data.atHardBreak=!0}function oe(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.value=me}function ee(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.value=me}function q(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.value=me}function I(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=fe,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function K(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=fe,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function Q(me){const fe=this.sliceSerialize(me),He=this.stack[this.stack.length-2];He.label=DT(fe),He.identifier=pa(fe).toLowerCase()}function pe(){const me=this.stack[this.stack.length-1],fe=this.resume(),He=this.stack[this.stack.length-1];if(this.data.inReference=!0,He.type==="link"){const we=me.children;He.children=we}else He.alt=fe}function j(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.url=me}function G(){const me=this.resume(),fe=this.stack[this.stack.length-1];fe.title=me}function W(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function ye(me){const fe=this.resume(),He=this.stack[this.stack.length-1];He.label=fe,He.identifier=pa(this.sliceSerialize(me)).toLowerCase(),this.data.referenceType="full"}function se(me){this.data.characterReferenceType=me.type}function V(me){const fe=this.sliceSerialize(me),He=this.data.characterReferenceType;let we;He?(we=q5(fe,He==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=X1(fe);const Fe=this.stack[this.stack.length-1];Fe.value+=we}function Z(me){const fe=this.stack.pop();fe.position.end=zi(me.end)}function ne(me){$.call(this,me);const fe=this.stack[this.stack.length-1];fe.url=this.sliceSerialize(me)}function ue(me){$.call(this,me);const fe=this.stack[this.stack.length-1];fe.url="mailto:"+this.sliceSerialize(me)}function he(){return{type:"blockquote",children:[]}}function Re(){return{type:"code",lang:null,meta:null,value:""}}function ze(){return{type:"inlineCode",value:""}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ft(){return{type:"emphasis",children:[]}}function gt(){return{type:"heading",depth:0,children:[]}}function Rt(){return{type:"break"}}function Bt(){return{type:"html",value:""}}function rt(){return{type:"image",title:null,url:"",alt:null}}function Mt(){return{type:"link",title:null,url:"",children:[]}}function mt(me){return{type:"list",ordered:me.type==="listOrdered",start:null,spread:me._spread,children:[]}}function qt(me){return{type:"listItem",spread:me._spread,checked:null,children:[]}}function Be(){return{type:"paragraph",children:[]}}function Qe(){return{type:"strong",children:[]}}function Ue(){return{type:"text",value:""}}function st(){return{type:"thematicBreak"}}}function zi(e){return{line:e.line,column:e.column,offset:e.offset}}function Z5(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?Z5(e,a):BT(e,a)}}function BT(e,t){let n;for(n in t)if(W5.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function Jb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ml({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ml({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ml({start:t.start,end:t.end})+") is still open")}function qT(e){const t=this;t.parser=n;function n(a){return LT(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function HT(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function UT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
23
- `}]}function FT(e,t){const n=t.value?t.value+`
24
- `:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function $T(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GT(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=Eo(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,d+=1,e.footnoteCounts.set(a,d);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function VT(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function X5(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const c=s[s.length-1];return c&&c.type==="text"?c.value+=a:s.push({type:"text",value:a}),s}function YT(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return X5(e,t);const s={src:Eo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function WT(e,t){const n={src:Eo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function ZT(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function XT(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return X5(e,t);const s={href:Eo(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function QT(e,t){const n={href:Eo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function JT(e,t,n){const a=e.all(t),s=n?eC(n):Q5(t),o={},c=[];if(typeof t.checked=="boolean"){const p=a[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const p=a[d];(s||d!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
25
- `}),p.type==="element"&&p.tagName==="p"&&!s?c.push(...p.children):c.push(p)}const h=a[a.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
26
- `});const m={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,m),e.applyData(t,m)}function eC(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=Q5(n[a])}return t}function Q5(e){const t=e.spread;return t??e.children.length>1}function tC(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const c=a[s];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function nC(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rC(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function aC(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iC(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),s.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=V1(t.children[1]),h=_5(t.children[t.children.length-1]);d&&h&&(c.position={start:d,end:h}),s.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function sC(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let h=-1;const m=[];for(;++h<d;){const g=t.children[h],x={},v=c?c[h]:void 0;v&&(x.align=v);let S={type:"element",tagName:o,properties:x,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),m.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,p),e.applyData(t,p)}function oC(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ev=9,tv=32;function lC(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const o=[];for(;a;)o.push(nv(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return o.push(nv(t.slice(s),s>0,!1)),o.join("")}function nv(e,t,n){let a=0,s=e.length;if(t){let o=e.codePointAt(a);for(;o===ev||o===tv;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(s-1);for(;o===ev||o===tv;)s--,o=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function cC(e,t){const n={type:"text",value:lC(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function uC(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const dC={blockquote:HT,break:UT,code:FT,delete:$T,emphasis:PT,footnoteReference:GT,heading:VT,html:KT,imageReference:YT,image:WT,inlineCode:ZT,linkReference:XT,link:QT,listItem:JT,list:tC,paragraph:nC,root:rC,strong:aC,table:iC,tableCell:oC,tableRow:sC,text:cC,thematicBreak:uC,toml:xu,yaml:xu,definition:xu,footnoteDefinition:xu};function xu(){}const J5=-1,xd=0,Dl=1,nd=2,J1=3,ep=4,tp=5,np=6,e6=7,t6=8,n6=typeof self=="object"?self:globalThis,rv=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new n6[e](t)},fC=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),a=s=>{if(e.has(s))return e.get(s);const[o,c]=t[s];switch(o){case xd:case J5:return n(c,s);case Dl:{const d=n([],s);for(const h of c)d.push(a(h));return d}case nd:{const d=n({},s);for(const[h,m]of c)d[a(h)]=a(m);return d}case J1:return n(new Date(c),s);case ep:{const{source:d,flags:h}=c;return n(new RegExp(d,h),s)}case tp:{const d=n(new Map,s);for(const[h,m]of c)d.set(a(h),a(m));return d}case np:{const d=n(new Set,s);for(const h of c)d.add(a(h));return d}case e6:{const{name:d,message:h}=c;return n(typeof n6[d]=="function"?rv(d,h):new Error(h),s)}case t6:return n(BigInt(c),s);case"BigInt":return n(Object(BigInt(c)),s);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(rv(o,c),s)};return a},av=e=>fC(new Map,e)(0),ys="",{toString:hC}={},{keys:mC}=Object,Sl=e=>{const t=typeof e;if(t!=="object"||!e)return[xd,t];const n=hC.call(e).slice(8,-1);switch(n){case"Array":return[Dl,ys];case"Object":return[nd,ys];case"Date":return[J1,ys];case"RegExp":return[ep,ys];case"Map":return[tp,ys];case"Set":return[np,ys];case"DataView":return[Dl,n]}return n.includes("Array")?[Dl,n]:e instanceof Error?[e6,e.name||"Error"]:[nd,n]},wu=([e,t])=>e===xd&&(t==="function"||t==="symbol"),pC=(e,t,n,a)=>{const s=(c,d)=>{const h=a.push(c)-1;return n.set(d,h),h},o=c=>{if(n.has(c))return n.get(c);let[d,h]=Sl(c);switch(d){case xd:{let p=c;switch(h){case"bigint":d=t6,p=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);p=null;break;case"undefined":return s([J5],c)}return s([d,p],c)}case Dl:{if(h){let x=c;return h==="DataView"?x=new Uint8Array(c.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(c)),s([h,[...x]],c)}const p=[],g=s([d,p],c);for(const x of c)p.push(o(x));return g}case nd:{if(h)switch(h){case"BigInt":return s([h,c.toString()],c);case"Boolean":case"Number":case"String":return s([h,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const p=[],g=s([d,p],c);for(const x of mC(c))(e||!wu(Sl(c[x])))&&p.push([o(x),o(c[x])]);return g}case J1:return s([d,isNaN(c.getTime())?ys:c.toISOString()],c);case ep:{const{source:p,flags:g}=c;return s([d,{source:p,flags:g}],c)}case tp:{const p=[],g=s([d,p],c);for(const[x,v]of c)(e||!(wu(Sl(x))||wu(Sl(v))))&&p.push([o(x),o(v)]);return g}case np:{const p=[],g=s([d,p],c);for(const x of c)(e||!wu(Sl(x)))&&p.push(o(x));return g}}const{message:m}=c;return s([d,{name:h,message:m}],c)};return o},iv=(e,{json:t,lossy:n}={})=>{const a=[];return pC(!(t||n),!!t,new Map,a)(e),a},rd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?av(iv(e,t)):structuredClone(e):(e,t)=>av(iv(e,t));function gC(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function bC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function vC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||gC,a=e.options.footnoteBackLabel||bC,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const p=e.all(m),g=String(m.identifier).toUpperCase(),x=Eo(g.toLowerCase());let v=0;const S=[],T=e.footnoteCounts.get(g);for(;T!==void 0&&++v<=T;){S.length>0&&S.push({type:"text",value:" "});let O=typeof n=="string"?n:n(h,v);typeof O=="string"&&(O={type:"text",value:O}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const N=p[p.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const O=N.children[N.children.length-1];O&&O.type==="text"?O.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...S)}else p.push(...S);const R={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(p,!0)};e.patch(m,R),d.push(R)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...rd(c),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
27
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
28
- `}]}}const tc=(function(e){if(e==null)return kC;if(typeof e=="function")return wd(e);if(typeof e=="object")return Array.isArray(e)?yC(e):xC(e);if(typeof e=="string")return wC(e);throw new Error("Expected function, string, or object as test")});function yC(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=tc(e[n]);return wd(a);function a(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function xC(e){const t=e;return wd(n);function n(a){const s=a;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function wC(e){return wd(t);function t(n){return n&&n.type===e}}function wd(e){return t;function t(n,a,s){return!!(SC(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function kC(){return!0}function SC(e){return e!==null&&typeof e=="object"&&"type"in e}const r6=[],EC=!0,Qm=!1,a6="skip";function rp(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const o=tc(s),c=a?-1:1;d(e,void 0,[])();function d(h,m,p){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return x;function x(){let v=r6,S,T,N;if((!t||o(h,m,p[p.length-1]||void 0))&&(v=TC(n(h,p)),v[0]===Qm))return v;if("children"in h&&h.children){const R=h;if(R.children&&v[0]!==a6)for(T=(a?R.children.length:-1)+c,N=p.concat(R);T>-1&&T<R.children.length;){const O=R.children[T];if(S=d(O,T,N)(),S[0]===Qm)return S;T=typeof S[1]=="number"?S[1]:T+c}}return v}}}function TC(e){return Array.isArray(e)?e:typeof e=="number"?[EC,e]:e==null?r6:[e]}function ap(e,t,n,a){let s,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,s=n):(o=t,c=n,s=a),rp(e,o,d,s);function d(h,m){const p=m[m.length-1],g=p?p.children.indexOf(h):void 0;return c(h,g,p)}}const Jm={}.hasOwnProperty,CC={};function RC(e,t){const n=t||CC,a=new Map,s=new Map,o=new Map,c={...dC,...n.handlers},d={all:m,applyData:AC,definitionById:a,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:c,one:h,options:n,patch:NC,wrap:_C};return ap(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?a:s,x=String(p.identifier).toUpperCase();g.has(x)||g.set(x,p)}}),d;function h(p,g){const x=p.type,v=d.handlers[x];if(Jm.call(d.handlers,x)&&v)return v(d,p,g);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in p){const{children:T,...N}=p,R=rd(N);return R.children=d.all(p),R}return rd(p)}return(d.options.unknownHandler||IC)(d,p,g)}function m(p){const g=[];if("children"in p){const x=p.children;let v=-1;for(;++v<x.length;){const S=d.one(x[v],p);if(S){if(v&&x[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=sv(S.value)),!Array.isArray(S)&&S.type==="element")){const T=S.children[0];T&&T.type==="text"&&(T.value=sv(T.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function NC(e,t){e.position&&(t.position=bS(e))}function AC(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,rd(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function IC(e,t){const n=t.data||{},a="value"in t&&!(Jm.call(n,"hProperties")||Jm.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function _C(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
29
- `});++a<e.length;)a&&n.push({type:"text",value:`
30
- `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
31
- `}),n}function sv(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ov(e,t){const n=RC(e,t),a=n.one(e,void 0),s=vC(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
32
- `},s),o}function MC(e,t){return e&&"run"in e?async function(n,a){const s=ov(n,{file:a,...t});await e.run(s,a)}:function(n,a){return ov(n,{file:a,...e||t})}}function lv(e){if(e)throw e}var ih,cv;function OC(){if(cv)return ih;cv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},o=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var p=e.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!p&&!g)return!1;var x;for(x in m);return typeof x>"u"||e.call(m,x)},c=function(m,p){n&&p.name==="__proto__"?n(m,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):m[p.name]=p.newValue},d=function(m,p){if(p==="__proto__")if(e.call(m,p)){if(a)return a(m,p).value}else return;return m[p]};return ih=function h(){var m,p,g,x,v,S,T=arguments[0],N=1,R=arguments.length,O=!1;for(typeof T=="boolean"&&(O=T,T=arguments[1]||{},N=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});N<R;++N)if(m=arguments[N],m!=null)for(p in m)g=d(T,p),x=d(m,p),T!==x&&(O&&x&&(o(x)||(v=s(x)))?(v?(v=!1,S=g&&s(g)?g:[]):S=g&&o(g)?g:{},c(T,{name:p,newValue:h(O,S,x)})):typeof x<"u"&&c(T,{name:p,newValue:x}));return T},ih}var DC=OC();const sh=md(DC);function e1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jC(){const e=[],t={run:n,use:a};return t;function n(...s){let o=-1;const c=s.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...s);function d(h,...m){const p=e[++o];let g=-1;if(h){c(h);return}for(;++g<s.length;)(m[g]===null||m[g]===void 0)&&(m[g]=s[g]);s=m,p?LC(p,d)(...m):c(null,...m)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function LC(e,t){let n;return a;function a(...c){const d=e.length>c.length;let h;d&&c.push(s);try{h=e.apply(this,c)}catch(m){const p=m;if(d&&n)throw p;return s(p)}d||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(c,...d){n||(n=!0,t(c,...d))}function o(c){s(null,c)}}const Ca={basename:zC,dirname:BC,extname:qC,join:HC,sep:"/"};function zC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nc(e);let n=0,a=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else c<0&&(o=!0,c=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function BC(e){if(nc(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function qC(e){nc(e);let t=e.length,n=-1,a=0,s=-1,o=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function HC(...e){let t=-1,n;for(;++t<e.length;)nc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":UC(n)}function UC(e){nc(e);const t=e.codePointAt(0)===47;let n=FC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function FC(e,t){let n="",a=0,s=-1,o=0,c=-1,d,h;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(s===c-1||o===1))if(s!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",a=0):(n=n.slice(0,h),a=n.length-1-n.lastIndexOf("/")),s=c,o=0;continue}}else if(n.length>0){n="",a=0,s=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,c):n=e.slice(s+1,c),a=c-s-1;s=c,o=0}else d===46&&o>-1?o++:o=-1}return n}function nc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $C={cwd:PC};function PC(){return"/"}function t1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function GC(e){if(typeof e=="string")e=new URL(e);else if(!t1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return VC(e)}function VC(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const oh=["history","path","basename","stem","extname","dirname"];class i6{constructor(t){let n;t?t1(t)?n={path:t}:typeof t=="string"||KC(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":$C.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<oh.length;){const o=oh[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)oh.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Ca.basename(this.path):void 0}set basename(t){ch(t,"basename"),lh(t,"basename"),this.path=Ca.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ca.dirname(this.path):void 0}set dirname(t){uv(this.basename,"dirname"),this.path=Ca.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ca.extname(this.path):void 0}set extname(t){if(lh(t,"extname"),uv(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ca.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){t1(t)&&(t=GC(t)),ch(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ca.basename(this.path,this.extname):void 0}set stem(t){ch(t,"stem"),lh(t,"stem"),this.path=Ca.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new ur(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lh(e,t){if(e&&e.includes(Ca.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ca.sep+"`")}function ch(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function uv(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function KC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const YC=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),WC={}.hasOwnProperty;class ip extends YC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=jC()}copy(){const t=new ip;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(sh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fh("data",this.frozen),this.namespace[t]=n,this):WC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ku(t),a=this.parser||this.Parser;return uh("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),uh("process",this.parser||this.Parser),dh("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,c){const d=ku(t),h=a.parse(d);a.run(h,d,function(p,g,x){if(p||!g||!x)return m(p);const v=g,S=a.stringify(v,x);QC(S)?x.value=S:x.result=S,m(p,x)});function m(p,g){p||!g?c(p):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),uh("processSync",this.parser||this.Parser),dh("processSync",this.compiler||this.Compiler),this.process(t,s),fv("processSync","process",n),a;function s(o,c){n=!0,lv(o),a=c}}run(t,n,a){dv(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,d){const h=ku(n);s.run(t,h,m);function m(p,g,x){const v=g||t;p?d(p):c?c(v):a(void 0,v,x)}}}runSync(t,n){let a=!1,s;return this.run(t,n,o),fv("runSync","run",a),s;function o(c,d){lv(c),s=d,a=!0}}stringify(t,n){this.freeze();const a=ku(n),s=this.compiler||this.Compiler;return dh("stringify",s),dv(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(fh("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[p,...g]=m;h(p,g)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(m.plugins),m.settings&&(s.settings=sh(!0,s.settings,m.settings))}function d(m){let p=-1;if(m!=null)if(Array.isArray(m))for(;++p<m.length;){const g=m[p];o(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,p){let g=-1,x=-1;for(;++g<a.length;)if(a[g][0]===m){x=g;break}if(x===-1)a.push([m,...p]);else if(p.length>0){let[v,...S]=p;const T=a[x][1];e1(T)&&e1(v)&&(v=sh(!0,T,v)),a[x]=[m,v,...S]}}}}const ZC=new ip().freeze();function uh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function fh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function dv(e){if(!e1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ku(e){return XC(e)?e:new i6(e)}function XC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function QC(e){return typeof e=="string"||JC(e)}function JC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hv=[],mv={allowDangerousHtml:!0},tR=/^(https?|ircs?|mailto|xmpp)$/i,nR=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rR(e){const t=aR(e),n=iR(e);return sR(t.runSync(t.parse(n),n),e)}function aR(e){const t=e.rehypePlugins||hv,n=e.remarkPlugins||hv,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...mv}:mv;return ZC().use(qT).use(n).use(MC,a).use(t)}function iR(e){const t=e.children||"",n=new i6;return typeof t=="string"&&(n.value=t),n}function sR(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,o=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||oR;for(const p of nR)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+eR+p.id,void 0);return ap(e,m),kS(e,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function m(p,g,x){if(p.type==="raw"&&x&&typeof g=="number")return c?x.children.splice(g,1):x.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let v;for(v in nh)if(Object.hasOwn(nh,v)&&Object.hasOwn(p.properties,v)){const S=p.properties[v],T=nh[v];(T===null||T.includes(p.tagName))&&(p.properties[v]=h(String(S||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!v&&a&&typeof g=="number"&&(v=!a(p,g,x)),v&&x&&typeof g=="number")return d&&p.children?x.children.splice(g,1,...p.children):x.children.splice(g,1),g}}}function oR(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||tR.test(e.slice(0,t))?e:""}function pv(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}function lR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function cR(e,t,n){const s=tc((n||{}).ignore||[]),o=uR(t);let c=-1;for(;++c<o.length;)rp(e,"text",d);function d(m,p){let g=-1,x;for(;++g<p.length;){const v=p[g],S=x?x.children:void 0;if(s(v,S?S.indexOf(v):void 0,x))return;x=v}if(x)return h(m,p)}function h(m,p){const g=p[p.length-1],x=o[c][0],v=o[c][1];let S=0;const N=g.children.indexOf(m);let R=!1,O=[];x.lastIndex=0;let _=x.exec(m.value);for(;_;){const P=_.index,U={index:_.index,input:_.input,stack:[...p,m]};let A=v(..._,U);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?x.lastIndex=P+1:(S!==P&&O.push({type:"text",value:m.value.slice(S,P)}),Array.isArray(A)?O.push(...A):A&&O.push(A),S=P+_[0].length,R=!0),!x.global)break;_=x.exec(m.value)}return R?(S<m.value.length&&O.push({type:"text",value:m.value.slice(S)}),g.children.splice(N,1,...O)):O=[m],N+O.length}}function uR(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const s=n[a];t.push([dR(s[0]),fR(s[1])])}return t}function dR(e){return typeof e=="string"?new RegExp(lR(e),"g"):e}function fR(e){return typeof e=="function"?e:function(){return e}}const hh="phrasing",mh=["autolink","link","image","label"];function hR(){return{transforms:[xR],enter:{literalAutolink:pR,literalAutolinkEmail:ph,literalAutolinkHttp:ph,literalAutolinkWww:ph},exit:{literalAutolink:yR,literalAutolinkEmail:vR,literalAutolinkHttp:gR,literalAutolinkWww:bR}}}function mR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hh,notInConstruct:mh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hh,notInConstruct:mh},{character:":",before:"[ps]",after:"\\/",inConstruct:hh,notInConstruct:mh}]}}function pR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ph(e){this.config.enter.autolinkProtocol.call(this,e)}function gR(e){this.config.exit.autolinkProtocol.call(this,e)}function bR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function vR(e){this.config.exit.autolinkEmail.call(this,e)}function yR(e){this.exit(e)}function xR(e){cR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wR],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),kR]],{ignore:["link","linkReference"]})}function wR(e,t,n,a,s){let o="";if(!s6(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!SR(n)))return!1;const c=ER(n+a);if(!c[0])return!1;const d={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function kR(e,t,n,a){return!s6(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function SR(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ER(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const s=pv(e,"(");let o=pv(e,")");for(;a!==-1&&s>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function s6(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Rs(n)||vd(n))&&(!t||n!==47)}o6.peek=OR;function TR(){this.buffer()}function CR(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function RR(){this.buffer()}function NR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function AR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function IR(e){this.exit(e)}function _R(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function MR(e){this.exit(e)}function OR(){return"["}function o6(e,t,n,a){const s=n.createTracker(a);let o=s.move("[^");const c=n.enter("footnoteReference"),d=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),c(),o+=s.move("]"),o}function DR(){return{enter:{gfmFootnoteCallString:TR,gfmFootnoteCall:CR,gfmFootnoteDefinitionLabelString:RR,gfmFootnoteDefinition:NR},exit:{gfmFootnoteCallString:AR,gfmFootnoteCall:IR,gfmFootnoteDefinitionLabelString:_R,gfmFootnoteDefinition:MR}}}function jR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:o6},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,o,c){const d=o.createTracker(c);let h=d.move("[^");const m=o.enter("footnoteDefinition"),p=o.enter("label");return h+=d.move(o.safe(o.associationId(a),{before:h,after:"]"})),p(),h+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),h+=d.move((t?`
33
- `:" ")+o.indentLines(o.containerFlow(a,d.current()),t?l6:LR))),m(),h}}function LR(e,t,n){return t===0?e:l6(e,t,n)}function l6(e,t,n){return(n?"":" ")+e}const zR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];c6.peek=FR;function BR(){return{canContainEols:["delete"],enter:{strikethrough:HR},exit:{strikethrough:UR}}}function qR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:zR}],handlers:{delete:c6}}}function HR(e){this.enter({type:"delete",children:[]},e)}function UR(e){this.exit(e)}function c6(e,t,n,a){const s=n.createTracker(a),o=n.enter("strikethrough");let c=s.move("~~");return c+=n.containerPhrasing(e,{...s.current(),before:c,after:"~"}),c+=s.move("~~"),o(),c}function FR(){return"~"}function $R(e){return e.length}function PR(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||$R,o=[],c=[],d=[],h=[];let m=0,p=-1;for(;++p<e.length;){const T=[],N=[];let R=-1;for(e[p].length>m&&(m=e[p].length);++R<e[p].length;){const O=GR(e[p][R]);if(n.alignDelimiters!==!1){const _=s(O);N[R]=_,(h[R]===void 0||_>h[R])&&(h[R]=_)}T.push(O)}c[p]=T,d[p]=N}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<m;)o[g]=gv(a[g]);else{const T=gv(a);for(;++g<m;)o[g]=T}g=-1;const x=[],v=[];for(;++g<m;){const T=o[g];let N="",R="";T===99?(N=":",R=":"):T===108?N=":":T===114&&(R=":");let O=n.alignDelimiters===!1?1:Math.max(1,h[g]-N.length-R.length);const _=N+"-".repeat(O)+R;n.alignDelimiters!==!1&&(O=N.length+O+R.length,O>h[g]&&(h[g]=O),v[g]=O),x[g]=_}c.splice(1,0,x),d.splice(1,0,v),p=-1;const S=[];for(;++p<c.length;){const T=c[p],N=d[p];g=-1;const R=[];for(;++g<m;){const O=T[g]||"";let _="",P="";if(n.alignDelimiters!==!1){const U=h[g]-(N[g]||0),A=o[g];A===114?_=" ".repeat(U):A===99?U%2?(_=" ".repeat(U/2+.5),P=" ".repeat(U/2-.5)):(_=" ".repeat(U/2),P=_):P=" ".repeat(U)}n.delimiterStart!==!1&&!g&&R.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&O==="")&&(n.delimiterStart!==!1||g)&&R.push(" "),n.alignDelimiters!==!1&&R.push(_),R.push(O),n.alignDelimiters!==!1&&R.push(P),n.padding!==!1&&R.push(" "),(n.delimiterEnd!==!1||g!==m-1)&&R.push("|")}S.push(n.delimiterEnd===!1?R.join("").replace(/ +$/,""):R.join(""))}return S.join(`
34
- `)}function GR(e){return e==null?"":String(e)}function gv(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function VR(e,t,n,a){const s=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),KR);return s(),c}function KR(e,t,n){return">"+(n?"":" ")+e}function YR(e,t){return bv(e,t.inConstruct,!0)&&!bv(e,t.notInConstruct,!1)}function bv(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function vv(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
35
- `&&YR(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
36
- `}function u6(e,t){const n=String(e);let a=n.indexOf(t),s=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++o>c&&(c=o):o=1,s=a+t.length,a=n.indexOf(t,s);return c}function WR(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ZR(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function XR(e,t,n,a){const s=ZR(n),o=e.value||"",c=s==="`"?"GraveAccent":"Tilde";if(WR(e,n)){const g=n.enter("codeIndented"),x=n.indentLines(o,QR);return g(),x}const d=n.createTracker(a),h=s.repeat(Math.max(u6(o,s)+1,3)),m=n.enter("codeFenced");let p=d.move(h);if(e.lang){const g=n.enter(`codeFencedLang${c}`);p+=d.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...d.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);p+=d.move(" "),p+=d.move(n.safe(e.meta,{before:p,after:`
37
- `,encode:["`"],...d.current()})),g()}return p+=d.move(`
38
- `),o&&(p+=d.move(o+`
39
- `)),p+=d.move(h),m(),p}function QR(e,t,n){return(n?"":" ")+e}function sp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function JR(e,t,n,a){const s=sp(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("definition");let d=n.enter("label");const h=n.createTracker(a);let m=h.move("[");return m+=h.move(n.safe(n.associationId(e),{before:m,after:"]",...h.current()})),m+=h.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":`
40
- `,...h.current()}))),d(),e.title&&(d=n.enter(`title${o}`),m+=h.move(" "+s),m+=h.move(n.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),d()),c(),m}function eN(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Pl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ad(e,t,n){const a=bo(e),s=bo(t);return a===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}d6.peek=tN;function d6(e,t,n,a){const s=eN(n),o=n.enter("emphasis"),c=n.createTracker(a),d=c.move(s);let h=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const m=h.charCodeAt(0),p=ad(a.before.charCodeAt(a.before.length-1),m,s);p.inside&&(h=Pl(m)+h.slice(1));const g=h.charCodeAt(h.length-1),x=ad(a.after.charCodeAt(0),g,s);x.inside&&(h=h.slice(0,-1)+Pl(g));const v=c.move(s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},d+h+v}function tN(e,t,n){return n.options.emphasis||"*"}function nN(e,t){let n=!1;return ap(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Qm}),!!((!e.depth||e.depth<3)&&Z1(e)&&(t.options.setext||n))}function rN(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(nN(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(e,{...o.current(),before:`
41
- `,after:`
42
- `});return g(),p(),x+`
43
- `+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
44
- `))+1))}const c="#".repeat(s),d=n.enter("headingAtx"),h=n.enter("phrasing");o.move(c+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
45
- `,...o.current()});return/^[\t ]/.test(m)&&(m=Pl(m.charCodeAt(0))+m.slice(1)),m=m?c+" "+m:c,n.options.closeAtx&&(m+=" "+c),h(),d(),m}f6.peek=aN;function f6(e){return e.value||""}function aN(){return"<"}h6.peek=iN;function h6(e,t,n,a){const s=sp(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("image");let d=n.enter("label");const h=n.createTracker(a);let m=h.move("![");return m+=h.move(n.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),d(),e.title&&(d=n.enter(`title${o}`),m+=h.move(" "+s),m+=h.move(n.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),d()),m+=h.move(")"),c(),m}function iN(){return"!"}m6.peek=sN;function m6(e,t,n,a){const s=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const d=n.createTracker(a);let h=d.move("![");const m=n.safe(e.alt,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:h,after:"]",...d.current()});return c(),n.stack=p,o(),s==="full"||!m||m!==g?h+=d.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function sN(){return"!"}p6.peek=oN;function p6(e,t,n){let a=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],d=n.compilePattern(c);let h;if(c.atBreak)for(;h=d.exec(a);){let m=h.index;a.charCodeAt(m)===10&&a.charCodeAt(m-1)===13&&m--,a=a.slice(0,m)+" "+a.slice(h.index+1)}}return s+a+s}function oN(){return"`"}function g6(e,t){const n=Z1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}b6.peek=lN;function b6(e,t,n,a){const s=sp(n),o=s==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let d,h;if(g6(e,n)){const p=n.stack;n.stack=[],d=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),d(),n.stack=p,g}d=n.enter("link"),h=n.enter("label");let m=c.move("[");return m+=c.move(n.containerPhrasing(e,{before:m,after:"](",...c.current()})),m+=c.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),m+=c.move("<"),m+=c.move(n.safe(e.url,{before:m,after:">",...c.current()})),m+=c.move(">")):(h=n.enter("destinationRaw"),m+=c.move(n.safe(e.url,{before:m,after:e.title?" ":")",...c.current()}))),h(),e.title&&(h=n.enter(`title${o}`),m+=c.move(" "+s),m+=c.move(n.safe(e.title,{before:m,after:s,...c.current()})),m+=c.move(s),h()),m+=c.move(")"),d(),m}function lN(e,t,n){return g6(e,n)?"<":"["}v6.peek=cN;function v6(e,t,n,a){const s=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const d=n.createTracker(a);let h=d.move("[");const m=n.containerPhrasing(e,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:h,after:"]",...d.current()});return c(),n.stack=p,o(),s==="full"||!m||m!==g?h+=d.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function cN(){return"["}function op(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function uN(e){const t=op(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function dN(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function y6(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function fN(e,t,n,a){const s=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?dN(n):op(n);const d=e.ordered?c==="."?")":".":uN(n);let h=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),y6(n)===c&&p){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(c=d),n.bulletCurrent=c;const m=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,s(),m}function hN(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function mN(e,t,n,a){const s=hN(n);let o=n.bulletCurrent||op(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=n.createTracker(a);d.move(o+" ".repeat(c-o.length)),d.shift(c);const h=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,d.current()),p);return h(),m;function p(g,x,v){return x?(v?"":" ".repeat(c))+g:(v?o:o+" ".repeat(c-o.length))+g}}function pN(e,t,n,a){const s=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),s(),c}const gN=tc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function bN(e,t,n,a){return(e.children.some(function(c){return gN(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function vN(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}x6.peek=yN;function x6(e,t,n,a){const s=vN(n),o=n.enter("strong"),c=n.createTracker(a),d=c.move(s+s);let h=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const m=h.charCodeAt(0),p=ad(a.before.charCodeAt(a.before.length-1),m,s);p.inside&&(h=Pl(m)+h.slice(1));const g=h.charCodeAt(h.length-1),x=ad(a.after.charCodeAt(0),g,s);x.inside&&(h=h.slice(0,-1)+Pl(g));const v=c.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},d+h+v}function yN(e,t,n){return n.options.strong||"*"}function xN(e,t,n,a){return n.safe(e.value,a)}function wN(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function kN(e,t,n){const a=(y6(n)+(n.options.ruleSpaces?" ":"")).repeat(wN(n));return n.options.ruleSpaces?a.slice(0,-1):a}const w6={blockquote:VR,break:vv,code:XR,definition:JR,emphasis:d6,hardBreak:vv,heading:rN,html:f6,image:h6,imageReference:m6,inlineCode:p6,link:b6,linkReference:v6,list:fN,listItem:mN,paragraph:pN,root:bN,strong:x6,text:xN,thematicBreak:kN};function SN(){return{enter:{table:EN,tableData:yv,tableHeader:yv,tableRow:CN},exit:{codeText:RN,table:TN,tableData:gh,tableHeader:gh,tableRow:gh}}}function EN(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function TN(e){this.exit(e),this.data.inTable=void 0}function CN(e){this.enter({type:"tableRow",children:[]},e)}function gh(e){this.exit(e)}function yv(e){this.enter({type:"tableCell",children:[]},e)}function RN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,NN));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function NN(e,t){return t==="|"?t:e}function AN(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
46
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:c,tableCell:h,tableRow:d}};function c(v,S,T,N){return m(p(v,T,N),v.align)}function d(v,S,T,N){const R=g(v,T,N),O=m([R]);return O.slice(0,O.indexOf(`
47
- `))}function h(v,S,T,N){const R=T.enter("tableCell"),O=T.enter("phrasing"),_=T.containerPhrasing(v,{...N,before:o,after:o});return O(),R(),_}function m(v,S){return PR(v,{align:S,alignDelimiters:a,padding:n,stringLength:s})}function p(v,S,T){const N=v.children;let R=-1;const O=[],_=S.enter("table");for(;++R<N.length;)O[R]=g(N[R],S,T);return _(),O}function g(v,S,T){const N=v.children;let R=-1;const O=[],_=S.enter("tableRow");for(;++R<N.length;)O[R]=h(N[R],v,S,T);return _(),O}function x(v,S,T){let N=w6.inlineCode(v,S,T);return T.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function IN(){return{exit:{taskListCheckValueChecked:xv,taskListCheckValueUnchecked:xv,paragraph:MN}}}function _N(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ON}}}function xv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function MN(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const s=t.children;let o=-1,c;for(;++o<s.length;){const d=s[o];if(d.type==="paragraph"){c=d;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function ON(e,t,n,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);o&&d.move(c);let h=w6.listItem(e,t,n,{...a,...d.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(p){return p+c}}function DN(){return[hR(),DR(),BR(),SN(),IN()]}function jN(e){return{extensions:[mR(),jR(e),qR(),AN(e),_N()]}}const LN={tokenize:FN,partial:!0},k6={tokenize:$N,partial:!0},S6={tokenize:PN,partial:!0},E6={tokenize:GN,partial:!0},zN={tokenize:VN,partial:!0},T6={name:"wwwAutolink",tokenize:HN,previous:R6},C6={name:"protocolAutolink",tokenize:UN,previous:N6},si={name:"emailAutolink",tokenize:qN,previous:A6},Aa={};function BN(){return{text:Aa}}let gs=48;for(;gs<123;)Aa[gs]=si,gs++,gs===58?gs=65:gs===91&&(gs=97);Aa[43]=si;Aa[45]=si;Aa[46]=si;Aa[95]=si;Aa[72]=[si,C6];Aa[104]=[si,C6];Aa[87]=[si,T6];Aa[119]=[si,T6];function qN(e,t,n){const a=this;let s,o;return c;function c(g){return!n1(g)||!A6.call(a,a.previous)||lp(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return n1(g)?(e.consume(g),d):g===64?(e.consume(g),h):n(g)}function h(g){return g===46?e.check(zN,p,m)(g):g===45||g===95||lr(g)?(o=!0,e.consume(g),h):p(g)}function m(g){return e.consume(g),s=!0,h}function p(g){return o&&s&&gr(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function HN(e,t,n){const a=this;return s;function s(c){return c!==87&&c!==119||!R6.call(a,a.previous)||lp(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(LN,e.attempt(k6,e.attempt(S6,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function UN(e,t,n){const a=this;let s="",o=!1;return c;function c(g){return(g===72||g===104)&&N6.call(a,a.previous)&&!lp(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),d):n(g)}function d(g){if(gr(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(g),h}return n(g)}function h(g){return g===47?(e.consume(g),o?m:(o=!0,h)):n(g)}function m(g){return g===null||td(g)||un(g)||Rs(g)||vd(g)?n(g):e.attempt(k6,e.attempt(S6,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function FN(e,t,n){let a=0;return s;function s(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),s):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function $N(e,t,n){let a,s,o;return c;function c(m){return m===46||m===95?e.check(E6,h,d)(m):m===null||un(m)||Rs(m)||m!==45&&vd(m)?h(m):(o=!0,e.consume(m),c)}function d(m){return m===95?a=!0:(s=a,a=void 0),e.consume(m),c}function h(m){return s||a||!o?n(m):t(m)}}function PN(e,t){let n=0,a=0;return s;function s(c){return c===40?(n++,e.consume(c),s):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(E6,t,o)(c):c===null||un(c)||Rs(c)?t(c):(e.consume(c),s)}function o(c){return c===41&&a++,e.consume(c),s}}function GN(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),o):d===93?(e.consume(d),s):d===60||d===null||un(d)||Rs(d)?t(d):n(d)}function s(d){return d===null||d===40||d===91||un(d)||Rs(d)?t(d):a(d)}function o(d){return gr(d)?c(d):n(d)}function c(d){return d===59?(e.consume(d),a):gr(d)?(e.consume(d),c):n(d)}}function VN(e,t,n){return a;function a(o){return e.consume(o),s}function s(o){return lr(o)?n(o):t(o)}}function R6(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||un(e)}function N6(e){return!gr(e)}function A6(e){return!(e===47||n1(e))}function n1(e){return e===43||e===45||e===46||e===95||lr(e)}function lp(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const KN={tokenize:tA,partial:!0};function YN(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:QN,continuation:{tokenize:JN},exit:eA}},text:{91:{name:"gfmFootnoteCall",tokenize:XN},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:WN,resolveTo:ZN}}}}function WN(e,t,n){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;s--;){const h=a.events[s][1];if(h.type==="labelImage"){c=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return d;function d(h){if(!c||!c._balanced)return n(h);const m=pa(a.sliceSerialize({start:c.end,end:a.now()}));return m.codePointAt(0)!==94||!o.includes(m.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function ZN(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function XN(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return d;function d(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),h}function h(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(g){if(o>999||g===93&&!c||g===null||g===91||un(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(pa(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return un(g)||(c=!0),o++,e.consume(g),g===92?p:m}function p(g){return g===91||g===92||g===93?(e.consume(g),o++,m):m(g)}}function QN(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,d;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(S)}function p(S){if(c>999||S===93&&!d||S===null||S===91||un(S))return n(S);if(S===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return o=pa(a.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return un(S)||(d=!0),c++,e.consume(S),S===92?g:p}function g(S){return S===91||S===92||S===93?(e.consume(S),c++,p):p(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(o)||s.push(o),Ot(e,v,"gfmFootnoteDefinitionWhitespace")):n(S)}function v(S){return t(S)}}function JN(e,t,n){return e.check(ec,t,e.attempt(KN,t,n))}function eA(e){e.exit("gfmFootnoteDefinition")}function tA(e,t,n){const a=this;return Ot(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function nA(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(c,d){let h=-1;for(;++h<c.length;)if(c[h][0]==="enter"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._close){let m=h;for(;m--;)if(c[m][0]==="exit"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._open&&c[h][1].end.offset-c[h][1].start.offset===c[m][1].end.offset-c[m][1].start.offset){c[h][1].type="strikethroughSequence",c[m][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},c[m][1].start),end:Object.assign({},c[h][1].end)},g={type:"strikethroughText",start:Object.assign({},c[m][1].end),end:Object.assign({},c[h][1].start)},x=[["enter",p,d],["enter",c[m][1],d],["exit",c[m][1],d],["enter",g,d]],v=d.parser.constructs.insideSpan.null;v&&Fr(x,x.length,0,yd(v,c.slice(m+1,h),d)),Fr(x,x.length,0,[["exit",g,d],["enter",c[h][1],d],["exit",c[h][1],d],["exit",p,d]]),Fr(c,m-1,h-m+3,x),h=m+x.length-2;break}}for(h=-1;++h<c.length;)c[h][1].type==="strikethroughSequenceTemporary"&&(c[h][1].type="data");return c}function o(c,d,h){const m=this.previous,p=this.events;let g=0;return x;function x(S){return m===126&&p[p.length-1][1].type!=="characterEscape"?h(S):(c.enter("strikethroughSequenceTemporary"),v(S))}function v(S){const T=bo(m);if(S===126)return g>1?h(S):(c.consume(S),g++,v);if(g<2&&!n)return h(S);const N=c.exit("strikethroughSequenceTemporary"),R=bo(S);return N._open=!R||R===2&&!!T,N._close=!T||T===2&&!!R,d(S)}}}class rA{constructor(){this.map=[]}add(t,n,a){aA(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const o of s)t.push(o);s=a.pop()}this.map.length=0}}function aA(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function iA(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function sA(){return{flow:{null:{name:"table",tokenize:oA,resolveAll:lA}}}}function oA(e,t,n){const a=this;let s=0,o=0,c;return d;function d($){let F=a.events.length-1;for(;F>-1;){const ee=a.events[F][1].type;if(ee==="lineEnding"||ee==="linePrefix")F--;else break}const Y=F>-1?a.events[F][1].type:null,oe=Y==="tableHead"||Y==="tableRow"?A:h;return oe===A&&a.parser.lazy[a.now().line]?n($):oe($)}function h($){return e.enter("tableHead"),e.enter("tableRow"),m($)}function m($){return $===124||(c=!0,o+=1),p($)}function p($){return $===null?n($):tt($)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),v):n($):zt($)?Ot(e,p,"whitespace")($):(o+=1,c&&(c=!1,s+=1),$===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),c=!0,p):(e.enter("data"),g($)))}function g($){return $===null||$===124||un($)?(e.exit("data"),p($)):(e.consume($),$===92?x:g)}function x($){return $===92||$===124?(e.consume($),g):g($)}function v($){return a.interrupt=!1,a.parser.lazy[a.now().line]?n($):(e.enter("tableDelimiterRow"),c=!1,zt($)?Ot(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):S($))}function S($){return $===45||$===58?N($):$===124?(c=!0,e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),T):U($)}function T($){return zt($)?Ot(e,N,"whitespace")($):N($)}function N($){return $===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),R):$===45?(o+=1,R($)):$===null||tt($)?P($):U($)}function R($){return $===45?(e.enter("tableDelimiterFiller"),O($)):U($)}function O($){return $===45?(e.consume($),O):$===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_($))}function _($){return zt($)?Ot(e,P,"whitespace")($):P($)}function P($){return $===124?S($):$===null||tt($)?!c||s!==o?U($):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t($)):U($)}function U($){return n($)}function A($){return e.enter("tableRow"),z($)}function z($){return $===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),z):$===null||tt($)?(e.exit("tableRow"),t($)):zt($)?Ot(e,z,"whitespace")($):(e.enter("data"),X($))}function X($){return $===null||$===124||un($)?(e.exit("data"),z($)):(e.consume($),$===92?H:X)}function H($){return $===92||$===124?(e.consume($),X):X($)}}function lA(e,t){let n=-1,a=!0,s=0,o=[0,0,0,0],c=[0,0,0,0],d=!1,h=0,m,p,g;const x=new rA;for(;++n<e.length;){const v=e[n],S=v[1];v[0]==="enter"?S.type==="tableHead"?(d=!1,h!==0&&(wv(x,t,h,m,p),p=void 0,h=0),m={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",m,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],c=[0,n+1,0,0],d&&(d=!1,p={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",p,t]])),s=S.type==="tableDelimiterRow"?2:p?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=Su(x,t,o,s,void 0,g),o=[0,0,0,0]),c[2]=n)):S.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=Su(x,t,o,s,void 0,g)),o=c,c=[o[1],n,0,0])):S.type==="tableHead"?(d=!0,h=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=n,o[1]!==0?(c[0]=c[1],g=Su(x,t,o,s,n,g)):c[1]!==0&&(g=Su(x,t,c,s,n,g)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=n)}for(h!==0&&wv(x,t,h,m,p),x.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=iA(t.events,n))}return e}function Su(e,t,n,a,s,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},mo(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const h=mo(t.events,n[1]);if(o={type:c,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const m=mo(t.events,n[2]),p=mo(t.events,n[3]),g={type:d,start:Object.assign({},m),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const x=t.events[n[2]],v=t.events[n[3]];if(x[1].end=Object.assign({},v[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,T=n[3]-n[2]-1;e.add(S,T,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(o.end=Object.assign({},mo(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function wv(e,t,n,a,s){const o=[],c=mo(t.events,n);s&&(s.end=Object.assign({},c),o.push(["exit",s,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function mo(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const cA={name:"tasklistCheck",tokenize:dA};function uA(){return{text:{91:cA}}}function dA(e,t,n){const a=this;return s;function s(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return un(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),c):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),c):n(h)}function c(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(h)}function d(h){return tt(h)?t(h):zt(h)?e.check({tokenize:fA},t,n)(h):n(h)}}function fA(e,t,n){return Ot(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function hA(e){return B5([BN(),YN(),nA(e),sA(),uA()])}const mA={};function pA(e){const t=this,n=e||mA,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(hA(n)),o.push(DN()),c.push(jN(n))}function gA(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:s,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:d,mathText:c,mathTextData:d}};function e(h){const m={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[m]}},h)}function t(){this.buffer()}function n(){const h=this.resume(),m=this.stack[this.stack.length-1];m.type,m.meta=h}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(h){const m=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(h),p.value=m;const g=p.data.hChildren[0];g.type,g.tagName,g.children.push({type:"text",value:m}),this.data.mathFlowInside=void 0}function o(h){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},h),this.buffer()}function c(h){const m=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(h),p.value=m,p.data.hChildren.push({type:"text",value:m})}function d(h){this.config.enter.data.call(this,h),this.config.exit.data.call(this,h)}}function bA(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
48
- `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(o,c,d,h){const m=o.value||"",p=d.createTracker(h),g="$".repeat(Math.max(u6(m,"$")+1,2)),x=d.enter("mathFlow");let v=p.move(g);if(o.meta){const S=d.enter("mathFlowMeta");v+=p.move(d.safe(o.meta,{after:`
49
- `,before:v,encode:["$"],...p.current()})),S()}return v+=p.move(`
50
- `),m&&(v+=p.move(m+`
51
- `)),v+=p.move(g),x(),v}function a(o,c,d){let h=o.value||"",m=1;for(t||m++;new RegExp("(^|[^$])"+"\\$".repeat(m)+"([^$]|$)").test(h);)m++;const p="$".repeat(m);/[^ \r\n]/.test(h)&&(/^[ \r\n]/.test(h)&&/[ \r\n]$/.test(h)||/^\$|\$$/.test(h))&&(h=" "+h+" ");let g=-1;for(;++g<d.unsafe.length;){const x=d.unsafe[g];if(!x.atBreak)continue;const v=d.compilePattern(x);let S;for(;S=v.exec(h);){let T=S.index;h.codePointAt(T)===10&&h.codePointAt(T-1)===13&&T--,h=h.slice(0,T)+" "+h.slice(S.index+1)}}return p+h+p}function s(){return"$"}}const vA={tokenize:yA,concrete:!0,name:"mathFlow"},kv={tokenize:xA,partial:!0};function yA(e,t,n){const a=this,s=a.events[a.events.length-1],o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0;let c=0;return d;function d(O){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),h(O)}function h(O){return O===36?(e.consume(O),c++,h):c<2?n(O):(e.exit("mathFlowFenceSequence"),Ot(e,m,"whitespace")(O))}function m(O){return O===null||tt(O)?g(O):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||tt(O)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),g(O)):O===36?n(O):(e.consume(O),p)}function g(O){return e.exit("mathFlowFence"),a.interrupt?t(O):e.attempt(kv,x,N)(O)}function x(O){return e.attempt({tokenize:R,partial:!0},N,v)(O)}function v(O){return(o?Ot(e,S,"linePrefix",o+1):S)(O)}function S(O){return O===null?N(O):tt(O)?e.attempt(kv,x,N)(O):(e.enter("mathFlowValue"),T(O))}function T(O){return O===null||tt(O)?(e.exit("mathFlowValue"),S(O)):(e.consume(O),T)}function N(O){return e.exit("mathFlow"),t(O)}function R(O,_,P){let U=0;return Ot(O,A,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function A(H){return O.enter("mathFlowFence"),O.enter("mathFlowFenceSequence"),z(H)}function z(H){return H===36?(U++,O.consume(H),z):U<c?P(H):(O.exit("mathFlowFenceSequence"),Ot(O,X,"whitespace")(H))}function X(H){return H===null||tt(H)?(O.exit("mathFlowFence"),_(H)):P(H)}}}function xA(e,t,n){const a=this;return s;function s(c){return c===null?t(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function wA(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:kA,previous:SA,name:"mathText"};function a(s,o,c){let d=0,h,m;return p;function p(T){return s.enter("mathText"),s.enter("mathTextSequence"),g(T)}function g(T){return T===36?(s.consume(T),d++,g):d<2&&!n?c(T):(s.exit("mathTextSequence"),x(T))}function x(T){return T===null?c(T):T===36?(m=s.enter("mathTextSequence"),h=0,S(T)):T===32?(s.enter("space"),s.consume(T),s.exit("space"),x):tt(T)?(s.enter("lineEnding"),s.consume(T),s.exit("lineEnding"),x):(s.enter("mathTextData"),v(T))}function v(T){return T===null||T===32||T===36||tt(T)?(s.exit("mathTextData"),x(T)):(s.consume(T),v)}function S(T){return T===36?(s.consume(T),h++,S):h===d?(s.exit("mathTextSequence"),s.exit("mathText"),o(T)):(m.type="mathTextData",v(T))}}}function kA(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="mathTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function SA(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function EA(e){return{flow:{36:vA},text:{36:wA(e)}}}class Oe extends Error{constructor(t,n){var a="KaTeX parse error: "+t,s,o,c=n&&n.loc;if(c&&c.start<=c.end){var d=c.lexer.input;s=c.start,o=c.end,s===d.length?a+=" at end of input: ":a+=" at position "+(s+1)+": ";var h=d.slice(s,o).replace(/[^]/g,"$&̲"),m;s>15?m="…"+d.slice(s-15,s):m=d.slice(0,s);var p;o+15<d.length?p=d.slice(o,o+15)+"…":p=d.slice(o),a+=m+h+p}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Oe.prototype),this.position=s,s!=null&&o!=null&&(this.length=o-s),this.rawMessage=t}}var TA=/([A-Z])/g,CA=e=>e.replace(TA,"-$1").toLowerCase(),RA={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},NA=/[&><"']/g,cr=e=>String(e).replace(NA,t=>RA[t]),$u=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?$u(e.body[0]):e:e.type==="font"?$u(e.body):e,AA=new Set(["mathord","textord","atom"]),oi=e=>AA.has($u(e).type),IA=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},id={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function _A(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function MA(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return _A(t)}function OA(e,t,n,a){var s=n[t];e[t]=s!==void 0?a.processor?a.processor(s):s:MA(a)}class cp{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(id)){var a=id[n];a&&OA(this,n,t,a)}}reportNonstrict(t,n,a){var s=this.strict;if(typeof s=="function"&&(s=s(t,n,a)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Oe("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var s=this.strict;if(typeof s=="function")try{s=s(t,n,a)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=IA(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class Bi{constructor(t,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=a}sup(){return Ra[DA[this.id]]}sub(){return Ra[jA[this.id]]}fracNum(){return Ra[LA[this.id]]}fracDen(){return Ra[zA[this.id]]}cramp(){return Ra[BA[this.id]]}text(){return Ra[qA[this.id]]}isTight(){return this.size>=2}}var up=0,sd=1,po=2,ai=3,Gl=4,ia=5,vo=6,br=7,Ra=[new Bi(up,0,!1),new Bi(sd,0,!0),new Bi(po,1,!1),new Bi(ai,1,!0),new Bi(Gl,2,!1),new Bi(ia,2,!0),new Bi(vo,3,!1),new Bi(br,3,!0)],DA=[Gl,ia,Gl,ia,vo,br,vo,br],jA=[ia,ia,ia,ia,br,br,br,br],LA=[po,ai,Gl,ia,vo,br,vo,br],zA=[ai,ai,ia,ia,br,br,br,br],BA=[sd,sd,ai,ai,ia,ia,br,br],qA=[up,sd,po,ai,po,ai,po,ai],xt={DISPLAY:Ra[up],TEXT:Ra[po],SCRIPT:Ra[Gl],SCRIPTSCRIPT:Ra[vo]},r1=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function HA(e){for(var t=0;t<r1.length;t++)for(var n=r1[t],a=0;a<n.blocks.length;a++){var s=n.blocks[a];if(e>=s[0]&&e<=s[1])return n.name}return null}var Pu=[];r1.forEach(e=>e.blocks.forEach(t=>Pu.push(...t)));function I6(e){for(var t=0;t<Pu.length;t+=2)if(e>=Pu[t]&&e<=Pu[t+1])return!0;return!1}var Kn=e=>e+" "+e,fo=80,UA=function(t,n){return"M95,"+(622+t+n)+`
52
- c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
53
- c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
54
- c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
55
- s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
56
- c69,-144,104.5,-217.7,106.5,-221
57
- l`+t/2.075+" -"+t+`
58
- c5.3,-9.3,12,-14,20,-14
59
- H400000v`+(40+t)+`H845.2724
60
- s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
61
- c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
62
- M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},FA=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
63
- c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
64
- c340,-704.7,510.7,-1060.3,512,-1067
65
- l`+t/2.084+" -"+t+`
66
- c4.7,-7.3,11,-11,19,-11
67
- H40000v`+(40+t)+`H1012.3
68
- s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
69
- c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
70
- s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
71
- c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
72
- M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},$A=function(t,n){return"M983 "+(10+t+n)+`
73
- l`+t/3.13+" -"+t+`
74
- c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
75
- H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
76
- s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
77
- c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
78
- c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
79
- c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
80
- c53.7,-170.3,84.5,-266.8,92.5,-289.5z
81
- M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},PA=function(t,n){return"M424,"+(2398+t+n)+`
82
- c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
83
- c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
84
- s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
85
- s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
86
- l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
87
- v`+(40+t)+`H1014.6
88
- s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
89
- c-2,6,-10,9,-24,9
90
- c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
91
- h400000v`+(40+t)+"h-400000z"},GA=function(t,n){return"M473,"+(2713+t+n)+`
92
- c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
93
- c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
94
- s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
95
- c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
96
- c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
97
- s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
98
- 606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},VA=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},KA=function(t,n,a){var s=a-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
99
- H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
100
- h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
101
- c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
102
- 219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},YA=function(t,n,a){n=1e3*n;var s="";switch(t){case"sqrtMain":s=UA(n,fo);break;case"sqrtSize1":s=FA(n,fo);break;case"sqrtSize2":s=$A(n,fo);break;case"sqrtSize3":s=PA(n,fo);break;case"sqrtSize4":s=GA(n,fo);break;case"sqrtTall":s=KA(n,fo,a)}return s},WA=function(t,n){switch(t){case"⎜":return Kn("M291 0 H417 V"+n+" H291z");case"∣":return Kn("M145 0 H188 V"+n+" H145z");case"∥":return Kn("M145 0 H188 V"+n+" H145z")+Kn("M367 0 H410 V"+n+" H367z");case"⎟":return Kn("M457 0 H583 V"+n+" H457z");case"⎢":return Kn("M319 0 H403 V"+n+" H319z");case"⎥":return Kn("M263 0 H347 V"+n+" H263z");case"⎪":return Kn("M384 0 H504 V"+n+" H384z");case"⏐":return Kn("M312 0 H355 V"+n+" H312z");case"‖":return Kn("M257 0 H300 V"+n+" H257z")+Kn("M478 0 H521 V"+n+" H478z");default:return""}},Sv={doubleleftarrow:`M262 157
103
- l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
104
- 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
105
- 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
106
- c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
107
- 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
108
- -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
109
- -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
110
- m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
111
- -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
112
- 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
113
- -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
114
- -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
115
- -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
116
- c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
117
- -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
118
- 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
119
- -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
120
- c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
121
- 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
122
- 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
123
- l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
124
- -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
125
- 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
126
- 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
127
- 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
128
- -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
129
- H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
130
- 435 0h399565z`,leftgroupunder:`M400000 262
131
- H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
132
- 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
133
- -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
134
- -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
135
- -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
136
- 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
137
- -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
138
- -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
139
- m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
140
- 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
141
- 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
142
- -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
143
- 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
144
- -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
145
- v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
146
- -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
147
- -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
148
- 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Kn("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Kn("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Kn("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Kn("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
149
- -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
150
- c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
151
- 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Kn("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
152
- c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
153
- -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
154
- 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
155
- 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
156
- c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
157
- 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
158
- 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
159
- -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
160
- -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
161
- m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
162
- 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
163
- -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
164
- m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
165
- c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
166
- -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
167
- m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
168
- 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
169
- -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
170
- m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
171
- c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
172
- -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
173
- 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
174
- 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
175
- -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
176
- -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
177
- 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
178
- -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
179
- s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
180
- c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
181
- 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
182
- -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
183
- 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
184
- 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
185
- -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
186
- -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
187
- 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
188
- -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
189
- 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
190
- m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
191
- 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
192
- -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
193
- -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
194
- 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
195
- 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
196
- -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
197
- m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
198
- 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
199
- -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
200
- 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Kn("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Kn("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Kn("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
201
- 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
202
- -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
203
- -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
204
- 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
205
- -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
206
- -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
207
- -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
208
- 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
209
- c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
210
- 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
211
- 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
212
- -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
213
- 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
214
- -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
215
- 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
216
- 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
217
- -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
218
- -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
219
- 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
220
- c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
221
- 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
222
- -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
223
- 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
224
- 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
225
- -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
226
- -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
227
- 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
228
- 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
229
- -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
230
- 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
231
- 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
232
- -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
233
- -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
234
- H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
235
- c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
236
- c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
237
- -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
238
- -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
239
- -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
240
- -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
241
- -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
242
- -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
243
- -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
244
- c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
245
- c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
246
- s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
247
- 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
248
- s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
249
- c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
250
- M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
251
- -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
252
- 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
253
- -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
254
- -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
255
- -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
256
- 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
257
- c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
258
- c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
259
- c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
260
- c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
261
- M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
262
- c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
263
- -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
264
- c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
265
- M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
266
- c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
267
- 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
268
- -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
269
- M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
270
- c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
271
- -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
272
- c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
273
- M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},ZA=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
274
- H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
275
- M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
276
- c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
277
- c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
278
- c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
279
- c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
280
- M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
281
- c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
282
- c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
283
- MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
284
- MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
285
- M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
286
- M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
287
- c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
288
- -36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
289
- 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
290
- c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
291
- -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
292
- l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
293
- -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
294
- 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
295
- c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
296
- c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
297
- c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
298
- c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
299
- c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
300
- l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
301
- -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function XA(e){return"toText"in e}class To{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(XA(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var a1={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},QA={ex:!0,em:!0,mu:!0},_6=function(t){return typeof t!="string"&&(t=t.unit),t in a1||t in QA||t==="ex"},En=function(t,n){var a;if(t.unit in a1)a=a1[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,t.unit==="ex")a=s.fontMetrics().xHeight;else if(t.unit==="em")a=s.fontMetrics().quad;else throw new Oe("Invalid unit: '"+t.unit+"'");s!==n&&(a*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},qe=function(t){return+t.toFixed(4)+"em"},Gi=function(t){return t.filter(n=>n).join(" ")},dp=function(t){var n="";for(var a of Object.keys(t)){var s=t[a];s!==void 0&&(n+=CA(a)+":"+s+";")}return n},M6=function(t,n,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},O6=function(t){var n=document.createElement(t);n.className=Gi(this.classes),Object.assign(n.style,this.style);for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n},JA=/[\s"'>/=\x00-\x1f]/,D6=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+cr(Gi(this.classes))+'"');var a=dp(this.style);a&&(n+=' style="'+cr(a)+'"');for(var s of Object.keys(this.attributes)){if(JA.test(s))throw new Oe("Invalid attribute name '"+s+"'");n+=" "+s+'="'+cr(this.attributes[s])+'"'}n+=">";for(var o=0;o<this.children.length;o++)n+=this.children[o].toMarkup();return n+="</"+t+">",n};class Co{constructor(t,n,a,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,M6.call(this,t,a,s),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return O6.call(this,"span")}toMarkup(){return D6.call(this,"span")}}class kd{constructor(t,n,a,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,M6.call(this,n,s),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return O6.call(this,"a")}toMarkup(){return D6.call(this,"a")}}class eI{constructor(t,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+cr(this.src)+'"'+(' alt="'+cr(this.alt)+'"'),n=dp(this.style);return n&&(t+=' style="'+cr(n)+'"'),t+="'/>",t}}var tI={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Pr{constructor(t,n,a,s,o,c,d,h){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=a||0,this.italic=s||0,this.skew=o||0,this.width=c||0,this.classes=d||[],this.style=h||{},this.maxFontSize=0;var m=HA(this.text.charCodeAt(0));m&&this.classes.push(m+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=tI[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=qe(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Gi(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=cr(Gi(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+qe(this.italic)+";"),a+=dp(this.style),a&&(t=!0,n+=' style="'+cr(a)+'"');var s=cr(this.text);return t?(n+=">",n+=s,n+="</span>",n):s}}class ii{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+cr(this.attributes[n])+'"';t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Vi{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Sv[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+cr(this.alternate)+'"/>':'<path d="'+cr(Sv[this.pathName])+'"/>'}}class i1{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+cr(this.attributes[n])+'"';return t+="/>",t}}function nI(e){if(e instanceof Pr)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function rI(e){if(e instanceof Co)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var aI=e=>e instanceof Co||e instanceof kd||e instanceof To,Na={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Eu={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Ev={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function j6(e,t){Na[e]=t}function fp(e,t,n){if(!Na[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),s=Na[t][a];if(!s&&e[0]in Ev&&(a=Ev[e[0]].charCodeAt(0),s=Na[t][a]),!s&&n==="text"&&I6(a)&&(s=Na[t][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var bh={};function iI(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!bh[t]){var n=bh[t]={cssEmPerMu:Eu.quad[t]/18};for(var a in Eu)Eu.hasOwnProperty(a)&&(n[a]=Eu[a][t])}return bh[t]}var vn={math:{},text:{}};function k(e,t,n,a,s,o){vn[e][s]={font:t,group:n,replace:a},o&&a&&(vn[e][a]=vn[e][s])}var E="math",Ae="text",M="main",te="ams",yn="accent-token",Ve="bin",vr="close",Ro="inner",lt="mathord",Fn="op-token",Gr="open",rc="punct",re="rel",li="spacing",ce="textord";k(E,M,re,"≡","\\equiv",!0);k(E,M,re,"≺","\\prec",!0);k(E,M,re,"≻","\\succ",!0);k(E,M,re,"∼","\\sim",!0);k(E,M,re,"⊥","\\perp");k(E,M,re,"⪯","\\preceq",!0);k(E,M,re,"⪰","\\succeq",!0);k(E,M,re,"≃","\\simeq",!0);k(E,M,re,"∣","\\mid",!0);k(E,M,re,"≪","\\ll",!0);k(E,M,re,"≫","\\gg",!0);k(E,M,re,"≍","\\asymp",!0);k(E,M,re,"∥","\\parallel");k(E,M,re,"⋈","\\bowtie",!0);k(E,M,re,"⌣","\\smile",!0);k(E,M,re,"⊑","\\sqsubseteq",!0);k(E,M,re,"⊒","\\sqsupseteq",!0);k(E,M,re,"≐","\\doteq",!0);k(E,M,re,"⌢","\\frown",!0);k(E,M,re,"∋","\\ni",!0);k(E,M,re,"∝","\\propto",!0);k(E,M,re,"⊢","\\vdash",!0);k(E,M,re,"⊣","\\dashv",!0);k(E,M,re,"∋","\\owns");k(E,M,rc,".","\\ldotp");k(E,M,rc,"⋅","\\cdotp");k(E,M,rc,"⋅","·");k(Ae,M,ce,"⋅","·");k(E,M,ce,"#","\\#");k(Ae,M,ce,"#","\\#");k(E,M,ce,"&","\\&");k(Ae,M,ce,"&","\\&");k(E,M,ce,"ℵ","\\aleph",!0);k(E,M,ce,"∀","\\forall",!0);k(E,M,ce,"ℏ","\\hbar",!0);k(E,M,ce,"∃","\\exists",!0);k(E,M,ce,"∇","\\nabla",!0);k(E,M,ce,"♭","\\flat",!0);k(E,M,ce,"ℓ","\\ell",!0);k(E,M,ce,"♮","\\natural",!0);k(E,M,ce,"♣","\\clubsuit",!0);k(E,M,ce,"℘","\\wp",!0);k(E,M,ce,"♯","\\sharp",!0);k(E,M,ce,"♢","\\diamondsuit",!0);k(E,M,ce,"ℜ","\\Re",!0);k(E,M,ce,"♡","\\heartsuit",!0);k(E,M,ce,"ℑ","\\Im",!0);k(E,M,ce,"♠","\\spadesuit",!0);k(E,M,ce,"§","\\S",!0);k(Ae,M,ce,"§","\\S");k(E,M,ce,"¶","\\P",!0);k(Ae,M,ce,"¶","\\P");k(E,M,ce,"†","\\dag");k(Ae,M,ce,"†","\\dag");k(Ae,M,ce,"†","\\textdagger");k(E,M,ce,"‡","\\ddag");k(Ae,M,ce,"‡","\\ddag");k(Ae,M,ce,"‡","\\textdaggerdbl");k(E,M,vr,"⎱","\\rmoustache",!0);k(E,M,Gr,"⎰","\\lmoustache",!0);k(E,M,vr,"⟯","\\rgroup",!0);k(E,M,Gr,"⟮","\\lgroup",!0);k(E,M,Ve,"∓","\\mp",!0);k(E,M,Ve,"⊖","\\ominus",!0);k(E,M,Ve,"⊎","\\uplus",!0);k(E,M,Ve,"⊓","\\sqcap",!0);k(E,M,Ve,"∗","\\ast");k(E,M,Ve,"⊔","\\sqcup",!0);k(E,M,Ve,"◯","\\bigcirc",!0);k(E,M,Ve,"∙","\\bullet",!0);k(E,M,Ve,"‡","\\ddagger");k(E,M,Ve,"≀","\\wr",!0);k(E,M,Ve,"⨿","\\amalg");k(E,M,Ve,"&","\\And");k(E,M,re,"⟵","\\longleftarrow",!0);k(E,M,re,"⇐","\\Leftarrow",!0);k(E,M,re,"⟸","\\Longleftarrow",!0);k(E,M,re,"⟶","\\longrightarrow",!0);k(E,M,re,"⇒","\\Rightarrow",!0);k(E,M,re,"⟹","\\Longrightarrow",!0);k(E,M,re,"↔","\\leftrightarrow",!0);k(E,M,re,"⟷","\\longleftrightarrow",!0);k(E,M,re,"⇔","\\Leftrightarrow",!0);k(E,M,re,"⟺","\\Longleftrightarrow",!0);k(E,M,re,"↦","\\mapsto",!0);k(E,M,re,"⟼","\\longmapsto",!0);k(E,M,re,"↗","\\nearrow",!0);k(E,M,re,"↩","\\hookleftarrow",!0);k(E,M,re,"↪","\\hookrightarrow",!0);k(E,M,re,"↘","\\searrow",!0);k(E,M,re,"↼","\\leftharpoonup",!0);k(E,M,re,"⇀","\\rightharpoonup",!0);k(E,M,re,"↙","\\swarrow",!0);k(E,M,re,"↽","\\leftharpoondown",!0);k(E,M,re,"⇁","\\rightharpoondown",!0);k(E,M,re,"↖","\\nwarrow",!0);k(E,M,re,"⇌","\\rightleftharpoons",!0);k(E,te,re,"≮","\\nless",!0);k(E,te,re,"","\\@nleqslant");k(E,te,re,"","\\@nleqq");k(E,te,re,"⪇","\\lneq",!0);k(E,te,re,"≨","\\lneqq",!0);k(E,te,re,"","\\@lvertneqq");k(E,te,re,"⋦","\\lnsim",!0);k(E,te,re,"⪉","\\lnapprox",!0);k(E,te,re,"⊀","\\nprec",!0);k(E,te,re,"⋠","\\npreceq",!0);k(E,te,re,"⋨","\\precnsim",!0);k(E,te,re,"⪹","\\precnapprox",!0);k(E,te,re,"≁","\\nsim",!0);k(E,te,re,"","\\@nshortmid");k(E,te,re,"∤","\\nmid",!0);k(E,te,re,"⊬","\\nvdash",!0);k(E,te,re,"⊭","\\nvDash",!0);k(E,te,re,"⋪","\\ntriangleleft");k(E,te,re,"⋬","\\ntrianglelefteq",!0);k(E,te,re,"⊊","\\subsetneq",!0);k(E,te,re,"","\\@varsubsetneq");k(E,te,re,"⫋","\\subsetneqq",!0);k(E,te,re,"","\\@varsubsetneqq");k(E,te,re,"≯","\\ngtr",!0);k(E,te,re,"","\\@ngeqslant");k(E,te,re,"","\\@ngeqq");k(E,te,re,"⪈","\\gneq",!0);k(E,te,re,"≩","\\gneqq",!0);k(E,te,re,"","\\@gvertneqq");k(E,te,re,"⋧","\\gnsim",!0);k(E,te,re,"⪊","\\gnapprox",!0);k(E,te,re,"⊁","\\nsucc",!0);k(E,te,re,"⋡","\\nsucceq",!0);k(E,te,re,"⋩","\\succnsim",!0);k(E,te,re,"⪺","\\succnapprox",!0);k(E,te,re,"≆","\\ncong",!0);k(E,te,re,"","\\@nshortparallel");k(E,te,re,"∦","\\nparallel",!0);k(E,te,re,"⊯","\\nVDash",!0);k(E,te,re,"⋫","\\ntriangleright");k(E,te,re,"⋭","\\ntrianglerighteq",!0);k(E,te,re,"","\\@nsupseteqq");k(E,te,re,"⊋","\\supsetneq",!0);k(E,te,re,"","\\@varsupsetneq");k(E,te,re,"⫌","\\supsetneqq",!0);k(E,te,re,"","\\@varsupsetneqq");k(E,te,re,"⊮","\\nVdash",!0);k(E,te,re,"⪵","\\precneqq",!0);k(E,te,re,"⪶","\\succneqq",!0);k(E,te,re,"","\\@nsubseteqq");k(E,te,Ve,"⊴","\\unlhd");k(E,te,Ve,"⊵","\\unrhd");k(E,te,re,"↚","\\nleftarrow",!0);k(E,te,re,"↛","\\nrightarrow",!0);k(E,te,re,"⇍","\\nLeftarrow",!0);k(E,te,re,"⇏","\\nRightarrow",!0);k(E,te,re,"↮","\\nleftrightarrow",!0);k(E,te,re,"⇎","\\nLeftrightarrow",!0);k(E,te,re,"△","\\vartriangle");k(E,te,ce,"ℏ","\\hslash");k(E,te,ce,"▽","\\triangledown");k(E,te,ce,"◊","\\lozenge");k(E,te,ce,"Ⓢ","\\circledS");k(E,te,ce,"®","\\circledR");k(Ae,te,ce,"®","\\circledR");k(E,te,ce,"∡","\\measuredangle",!0);k(E,te,ce,"∄","\\nexists");k(E,te,ce,"℧","\\mho");k(E,te,ce,"Ⅎ","\\Finv",!0);k(E,te,ce,"⅁","\\Game",!0);k(E,te,ce,"‵","\\backprime");k(E,te,ce,"▲","\\blacktriangle");k(E,te,ce,"▼","\\blacktriangledown");k(E,te,ce,"■","\\blacksquare");k(E,te,ce,"⧫","\\blacklozenge");k(E,te,ce,"★","\\bigstar");k(E,te,ce,"∢","\\sphericalangle",!0);k(E,te,ce,"∁","\\complement",!0);k(E,te,ce,"ð","\\eth",!0);k(Ae,M,ce,"ð","ð");k(E,te,ce,"╱","\\diagup");k(E,te,ce,"╲","\\diagdown");k(E,te,ce,"□","\\square");k(E,te,ce,"□","\\Box");k(E,te,ce,"◊","\\Diamond");k(E,te,ce,"¥","\\yen",!0);k(Ae,te,ce,"¥","\\yen",!0);k(E,te,ce,"✓","\\checkmark",!0);k(Ae,te,ce,"✓","\\checkmark");k(E,te,ce,"ℶ","\\beth",!0);k(E,te,ce,"ℸ","\\daleth",!0);k(E,te,ce,"ℷ","\\gimel",!0);k(E,te,ce,"ϝ","\\digamma",!0);k(E,te,ce,"ϰ","\\varkappa");k(E,te,Gr,"┌","\\@ulcorner",!0);k(E,te,vr,"┐","\\@urcorner",!0);k(E,te,Gr,"└","\\@llcorner",!0);k(E,te,vr,"┘","\\@lrcorner",!0);k(E,te,re,"≦","\\leqq",!0);k(E,te,re,"⩽","\\leqslant",!0);k(E,te,re,"⪕","\\eqslantless",!0);k(E,te,re,"≲","\\lesssim",!0);k(E,te,re,"⪅","\\lessapprox",!0);k(E,te,re,"≊","\\approxeq",!0);k(E,te,Ve,"⋖","\\lessdot");k(E,te,re,"⋘","\\lll",!0);k(E,te,re,"≶","\\lessgtr",!0);k(E,te,re,"⋚","\\lesseqgtr",!0);k(E,te,re,"⪋","\\lesseqqgtr",!0);k(E,te,re,"≑","\\doteqdot");k(E,te,re,"≓","\\risingdotseq",!0);k(E,te,re,"≒","\\fallingdotseq",!0);k(E,te,re,"∽","\\backsim",!0);k(E,te,re,"⋍","\\backsimeq",!0);k(E,te,re,"⫅","\\subseteqq",!0);k(E,te,re,"⋐","\\Subset",!0);k(E,te,re,"⊏","\\sqsubset",!0);k(E,te,re,"≼","\\preccurlyeq",!0);k(E,te,re,"⋞","\\curlyeqprec",!0);k(E,te,re,"≾","\\precsim",!0);k(E,te,re,"⪷","\\precapprox",!0);k(E,te,re,"⊲","\\vartriangleleft");k(E,te,re,"⊴","\\trianglelefteq");k(E,te,re,"⊨","\\vDash",!0);k(E,te,re,"⊪","\\Vvdash",!0);k(E,te,re,"⌣","\\smallsmile");k(E,te,re,"⌢","\\smallfrown");k(E,te,re,"≏","\\bumpeq",!0);k(E,te,re,"≎","\\Bumpeq",!0);k(E,te,re,"≧","\\geqq",!0);k(E,te,re,"⩾","\\geqslant",!0);k(E,te,re,"⪖","\\eqslantgtr",!0);k(E,te,re,"≳","\\gtrsim",!0);k(E,te,re,"⪆","\\gtrapprox",!0);k(E,te,Ve,"⋗","\\gtrdot");k(E,te,re,"⋙","\\ggg",!0);k(E,te,re,"≷","\\gtrless",!0);k(E,te,re,"⋛","\\gtreqless",!0);k(E,te,re,"⪌","\\gtreqqless",!0);k(E,te,re,"≖","\\eqcirc",!0);k(E,te,re,"≗","\\circeq",!0);k(E,te,re,"≜","\\triangleq",!0);k(E,te,re,"∼","\\thicksim");k(E,te,re,"≈","\\thickapprox");k(E,te,re,"⫆","\\supseteqq",!0);k(E,te,re,"⋑","\\Supset",!0);k(E,te,re,"⊐","\\sqsupset",!0);k(E,te,re,"≽","\\succcurlyeq",!0);k(E,te,re,"⋟","\\curlyeqsucc",!0);k(E,te,re,"≿","\\succsim",!0);k(E,te,re,"⪸","\\succapprox",!0);k(E,te,re,"⊳","\\vartriangleright");k(E,te,re,"⊵","\\trianglerighteq");k(E,te,re,"⊩","\\Vdash",!0);k(E,te,re,"∣","\\shortmid");k(E,te,re,"∥","\\shortparallel");k(E,te,re,"≬","\\between",!0);k(E,te,re,"⋔","\\pitchfork",!0);k(E,te,re,"∝","\\varpropto");k(E,te,re,"◀","\\blacktriangleleft");k(E,te,re,"∴","\\therefore",!0);k(E,te,re,"∍","\\backepsilon");k(E,te,re,"▶","\\blacktriangleright");k(E,te,re,"∵","\\because",!0);k(E,te,re,"⋘","\\llless");k(E,te,re,"⋙","\\gggtr");k(E,te,Ve,"⊲","\\lhd");k(E,te,Ve,"⊳","\\rhd");k(E,te,re,"≂","\\eqsim",!0);k(E,M,re,"⋈","\\Join");k(E,te,re,"≑","\\Doteq",!0);k(E,te,Ve,"∔","\\dotplus",!0);k(E,te,Ve,"∖","\\smallsetminus");k(E,te,Ve,"⋒","\\Cap",!0);k(E,te,Ve,"⋓","\\Cup",!0);k(E,te,Ve,"⩞","\\doublebarwedge",!0);k(E,te,Ve,"⊟","\\boxminus",!0);k(E,te,Ve,"⊞","\\boxplus",!0);k(E,te,Ve,"⋇","\\divideontimes",!0);k(E,te,Ve,"⋉","\\ltimes",!0);k(E,te,Ve,"⋊","\\rtimes",!0);k(E,te,Ve,"⋋","\\leftthreetimes",!0);k(E,te,Ve,"⋌","\\rightthreetimes",!0);k(E,te,Ve,"⋏","\\curlywedge",!0);k(E,te,Ve,"⋎","\\curlyvee",!0);k(E,te,Ve,"⊝","\\circleddash",!0);k(E,te,Ve,"⊛","\\circledast",!0);k(E,te,Ve,"⋅","\\centerdot");k(E,te,Ve,"⊺","\\intercal",!0);k(E,te,Ve,"⋒","\\doublecap");k(E,te,Ve,"⋓","\\doublecup");k(E,te,Ve,"⊠","\\boxtimes",!0);k(E,te,re,"⇢","\\dashrightarrow",!0);k(E,te,re,"⇠","\\dashleftarrow",!0);k(E,te,re,"⇇","\\leftleftarrows",!0);k(E,te,re,"⇆","\\leftrightarrows",!0);k(E,te,re,"⇚","\\Lleftarrow",!0);k(E,te,re,"↞","\\twoheadleftarrow",!0);k(E,te,re,"↢","\\leftarrowtail",!0);k(E,te,re,"↫","\\looparrowleft",!0);k(E,te,re,"⇋","\\leftrightharpoons",!0);k(E,te,re,"↶","\\curvearrowleft",!0);k(E,te,re,"↺","\\circlearrowleft",!0);k(E,te,re,"↰","\\Lsh",!0);k(E,te,re,"⇈","\\upuparrows",!0);k(E,te,re,"↿","\\upharpoonleft",!0);k(E,te,re,"⇃","\\downharpoonleft",!0);k(E,M,re,"⊶","\\origof",!0);k(E,M,re,"⊷","\\imageof",!0);k(E,te,re,"⊸","\\multimap",!0);k(E,te,re,"↭","\\leftrightsquigarrow",!0);k(E,te,re,"⇉","\\rightrightarrows",!0);k(E,te,re,"⇄","\\rightleftarrows",!0);k(E,te,re,"↠","\\twoheadrightarrow",!0);k(E,te,re,"↣","\\rightarrowtail",!0);k(E,te,re,"↬","\\looparrowright",!0);k(E,te,re,"↷","\\curvearrowright",!0);k(E,te,re,"↻","\\circlearrowright",!0);k(E,te,re,"↱","\\Rsh",!0);k(E,te,re,"⇊","\\downdownarrows",!0);k(E,te,re,"↾","\\upharpoonright",!0);k(E,te,re,"⇂","\\downharpoonright",!0);k(E,te,re,"⇝","\\rightsquigarrow",!0);k(E,te,re,"⇝","\\leadsto");k(E,te,re,"⇛","\\Rrightarrow",!0);k(E,te,re,"↾","\\restriction");k(E,M,ce,"‘","`");k(E,M,ce,"$","\\$");k(Ae,M,ce,"$","\\$");k(Ae,M,ce,"$","\\textdollar");k(E,M,ce,"%","\\%");k(Ae,M,ce,"%","\\%");k(E,M,ce,"_","\\_");k(Ae,M,ce,"_","\\_");k(Ae,M,ce,"_","\\textunderscore");k(E,M,ce,"∠","\\angle",!0);k(E,M,ce,"∞","\\infty",!0);k(E,M,ce,"′","\\prime");k(E,M,ce,"△","\\triangle");k(E,M,ce,"Γ","\\Gamma",!0);k(E,M,ce,"Δ","\\Delta",!0);k(E,M,ce,"Θ","\\Theta",!0);k(E,M,ce,"Λ","\\Lambda",!0);k(E,M,ce,"Ξ","\\Xi",!0);k(E,M,ce,"Π","\\Pi",!0);k(E,M,ce,"Σ","\\Sigma",!0);k(E,M,ce,"Υ","\\Upsilon",!0);k(E,M,ce,"Φ","\\Phi",!0);k(E,M,ce,"Ψ","\\Psi",!0);k(E,M,ce,"Ω","\\Omega",!0);k(E,M,ce,"A","Α");k(E,M,ce,"B","Β");k(E,M,ce,"E","Ε");k(E,M,ce,"Z","Ζ");k(E,M,ce,"H","Η");k(E,M,ce,"I","Ι");k(E,M,ce,"K","Κ");k(E,M,ce,"M","Μ");k(E,M,ce,"N","Ν");k(E,M,ce,"O","Ο");k(E,M,ce,"P","Ρ");k(E,M,ce,"T","Τ");k(E,M,ce,"X","Χ");k(E,M,ce,"¬","\\neg",!0);k(E,M,ce,"¬","\\lnot");k(E,M,ce,"⊤","\\top");k(E,M,ce,"⊥","\\bot");k(E,M,ce,"∅","\\emptyset");k(E,te,ce,"∅","\\varnothing");k(E,M,lt,"α","\\alpha",!0);k(E,M,lt,"β","\\beta",!0);k(E,M,lt,"γ","\\gamma",!0);k(E,M,lt,"δ","\\delta",!0);k(E,M,lt,"ϵ","\\epsilon",!0);k(E,M,lt,"ζ","\\zeta",!0);k(E,M,lt,"η","\\eta",!0);k(E,M,lt,"θ","\\theta",!0);k(E,M,lt,"ι","\\iota",!0);k(E,M,lt,"κ","\\kappa",!0);k(E,M,lt,"λ","\\lambda",!0);k(E,M,lt,"μ","\\mu",!0);k(E,M,lt,"ν","\\nu",!0);k(E,M,lt,"ξ","\\xi",!0);k(E,M,lt,"ο","\\omicron",!0);k(E,M,lt,"π","\\pi",!0);k(E,M,lt,"ρ","\\rho",!0);k(E,M,lt,"σ","\\sigma",!0);k(E,M,lt,"τ","\\tau",!0);k(E,M,lt,"υ","\\upsilon",!0);k(E,M,lt,"ϕ","\\phi",!0);k(E,M,lt,"χ","\\chi",!0);k(E,M,lt,"ψ","\\psi",!0);k(E,M,lt,"ω","\\omega",!0);k(E,M,lt,"ε","\\varepsilon",!0);k(E,M,lt,"ϑ","\\vartheta",!0);k(E,M,lt,"ϖ","\\varpi",!0);k(E,M,lt,"ϱ","\\varrho",!0);k(E,M,lt,"ς","\\varsigma",!0);k(E,M,lt,"φ","\\varphi",!0);k(E,M,Ve,"∗","*",!0);k(E,M,Ve,"+","+");k(E,M,Ve,"−","-",!0);k(E,M,Ve,"⋅","\\cdot",!0);k(E,M,Ve,"∘","\\circ",!0);k(E,M,Ve,"÷","\\div",!0);k(E,M,Ve,"±","\\pm",!0);k(E,M,Ve,"×","\\times",!0);k(E,M,Ve,"∩","\\cap",!0);k(E,M,Ve,"∪","\\cup",!0);k(E,M,Ve,"∖","\\setminus",!0);k(E,M,Ve,"∧","\\land");k(E,M,Ve,"∨","\\lor");k(E,M,Ve,"∧","\\wedge",!0);k(E,M,Ve,"∨","\\vee",!0);k(E,M,ce,"√","\\surd");k(E,M,Gr,"⟨","\\langle",!0);k(E,M,Gr,"∣","\\lvert");k(E,M,Gr,"∥","\\lVert");k(E,M,vr,"?","?");k(E,M,vr,"!","!");k(E,M,vr,"⟩","\\rangle",!0);k(E,M,vr,"∣","\\rvert");k(E,M,vr,"∥","\\rVert");k(E,M,re,"=","=");k(E,M,re,":",":");k(E,M,re,"≈","\\approx",!0);k(E,M,re,"≅","\\cong",!0);k(E,M,re,"≥","\\ge");k(E,M,re,"≥","\\geq",!0);k(E,M,re,"←","\\gets");k(E,M,re,">","\\gt",!0);k(E,M,re,"∈","\\in",!0);k(E,M,re,"","\\@not");k(E,M,re,"⊂","\\subset",!0);k(E,M,re,"⊃","\\supset",!0);k(E,M,re,"⊆","\\subseteq",!0);k(E,M,re,"⊇","\\supseteq",!0);k(E,te,re,"⊈","\\nsubseteq",!0);k(E,te,re,"⊉","\\nsupseteq",!0);k(E,M,re,"⊨","\\models");k(E,M,re,"←","\\leftarrow",!0);k(E,M,re,"≤","\\le");k(E,M,re,"≤","\\leq",!0);k(E,M,re,"<","\\lt",!0);k(E,M,re,"→","\\rightarrow",!0);k(E,M,re,"→","\\to");k(E,te,re,"≱","\\ngeq",!0);k(E,te,re,"≰","\\nleq",!0);k(E,M,li," ","\\ ");k(E,M,li," ","\\space");k(E,M,li," ","\\nobreakspace");k(Ae,M,li," ","\\ ");k(Ae,M,li," "," ");k(Ae,M,li," ","\\space");k(Ae,M,li," ","\\nobreakspace");k(E,M,li,"","\\nobreak");k(E,M,li,"","\\allowbreak");k(E,M,rc,",",",");k(E,M,rc,";",";");k(E,te,Ve,"⊼","\\barwedge",!0);k(E,te,Ve,"⊻","\\veebar",!0);k(E,M,Ve,"⊙","\\odot",!0);k(E,M,Ve,"⊕","\\oplus",!0);k(E,M,Ve,"⊗","\\otimes",!0);k(E,M,ce,"∂","\\partial",!0);k(E,M,Ve,"⊘","\\oslash",!0);k(E,te,Ve,"⊚","\\circledcirc",!0);k(E,te,Ve,"⊡","\\boxdot",!0);k(E,M,Ve,"△","\\bigtriangleup");k(E,M,Ve,"▽","\\bigtriangledown");k(E,M,Ve,"†","\\dagger");k(E,M,Ve,"⋄","\\diamond");k(E,M,Ve,"⋆","\\star");k(E,M,Ve,"◃","\\triangleleft");k(E,M,Ve,"▹","\\triangleright");k(E,M,Gr,"{","\\{");k(Ae,M,ce,"{","\\{");k(Ae,M,ce,"{","\\textbraceleft");k(E,M,vr,"}","\\}");k(Ae,M,ce,"}","\\}");k(Ae,M,ce,"}","\\textbraceright");k(E,M,Gr,"{","\\lbrace");k(E,M,vr,"}","\\rbrace");k(E,M,Gr,"[","\\lbrack",!0);k(Ae,M,ce,"[","\\lbrack",!0);k(E,M,vr,"]","\\rbrack",!0);k(Ae,M,ce,"]","\\rbrack",!0);k(E,M,Gr,"(","\\lparen",!0);k(E,M,vr,")","\\rparen",!0);k(Ae,M,ce,"<","\\textless",!0);k(Ae,M,ce,">","\\textgreater",!0);k(E,M,Gr,"⌊","\\lfloor",!0);k(E,M,vr,"⌋","\\rfloor",!0);k(E,M,Gr,"⌈","\\lceil",!0);k(E,M,vr,"⌉","\\rceil",!0);k(E,M,ce,"\\","\\backslash");k(E,M,ce,"∣","|");k(E,M,ce,"∣","\\vert");k(Ae,M,ce,"|","\\textbar",!0);k(E,M,ce,"∥","\\|");k(E,M,ce,"∥","\\Vert");k(Ae,M,ce,"∥","\\textbardbl");k(Ae,M,ce,"~","\\textasciitilde");k(Ae,M,ce,"\\","\\textbackslash");k(Ae,M,ce,"^","\\textasciicircum");k(E,M,re,"↑","\\uparrow",!0);k(E,M,re,"⇑","\\Uparrow",!0);k(E,M,re,"↓","\\downarrow",!0);k(E,M,re,"⇓","\\Downarrow",!0);k(E,M,re,"↕","\\updownarrow",!0);k(E,M,re,"⇕","\\Updownarrow",!0);k(E,M,Fn,"∐","\\coprod");k(E,M,Fn,"⋁","\\bigvee");k(E,M,Fn,"⋀","\\bigwedge");k(E,M,Fn,"⨄","\\biguplus");k(E,M,Fn,"⋂","\\bigcap");k(E,M,Fn,"⋃","\\bigcup");k(E,M,Fn,"∫","\\int");k(E,M,Fn,"∫","\\intop");k(E,M,Fn,"∬","\\iint");k(E,M,Fn,"∭","\\iiint");k(E,M,Fn,"∏","\\prod");k(E,M,Fn,"∑","\\sum");k(E,M,Fn,"⨂","\\bigotimes");k(E,M,Fn,"⨁","\\bigoplus");k(E,M,Fn,"⨀","\\bigodot");k(E,M,Fn,"∮","\\oint");k(E,M,Fn,"∯","\\oiint");k(E,M,Fn,"∰","\\oiiint");k(E,M,Fn,"⨆","\\bigsqcup");k(E,M,Fn,"∫","\\smallint");k(Ae,M,Ro,"…","\\textellipsis");k(E,M,Ro,"…","\\mathellipsis");k(Ae,M,Ro,"…","\\ldots",!0);k(E,M,Ro,"…","\\ldots",!0);k(E,M,Ro,"⋯","\\@cdots",!0);k(E,M,Ro,"⋱","\\ddots",!0);k(E,M,ce,"⋮","\\varvdots");k(Ae,M,ce,"⋮","\\varvdots");k(E,M,yn,"ˊ","\\acute");k(E,M,yn,"ˋ","\\grave");k(E,M,yn,"¨","\\ddot");k(E,M,yn,"~","\\tilde");k(E,M,yn,"ˉ","\\bar");k(E,M,yn,"˘","\\breve");k(E,M,yn,"ˇ","\\check");k(E,M,yn,"^","\\hat");k(E,M,yn,"⃗","\\vec");k(E,M,yn,"˙","\\dot");k(E,M,yn,"˚","\\mathring");k(E,M,lt,"","\\@imath");k(E,M,lt,"","\\@jmath");k(E,M,ce,"ı","ı");k(E,M,ce,"ȷ","ȷ");k(Ae,M,ce,"ı","\\i",!0);k(Ae,M,ce,"ȷ","\\j",!0);k(Ae,M,ce,"ß","\\ss",!0);k(Ae,M,ce,"æ","\\ae",!0);k(Ae,M,ce,"œ","\\oe",!0);k(Ae,M,ce,"ø","\\o",!0);k(Ae,M,ce,"Æ","\\AE",!0);k(Ae,M,ce,"Œ","\\OE",!0);k(Ae,M,ce,"Ø","\\O",!0);k(Ae,M,yn,"ˊ","\\'");k(Ae,M,yn,"ˋ","\\`");k(Ae,M,yn,"ˆ","\\^");k(Ae,M,yn,"˜","\\~");k(Ae,M,yn,"ˉ","\\=");k(Ae,M,yn,"˘","\\u");k(Ae,M,yn,"˙","\\.");k(Ae,M,yn,"¸","\\c");k(Ae,M,yn,"˚","\\r");k(Ae,M,yn,"ˇ","\\v");k(Ae,M,yn,"¨",'\\"');k(Ae,M,yn,"˝","\\H");k(Ae,M,yn,"◯","\\textcircled");var L6={"--":!0,"---":!0,"``":!0,"''":!0};k(Ae,M,ce,"–","--",!0);k(Ae,M,ce,"–","\\textendash");k(Ae,M,ce,"—","---",!0);k(Ae,M,ce,"—","\\textemdash");k(Ae,M,ce,"‘","`",!0);k(Ae,M,ce,"‘","\\textquoteleft");k(Ae,M,ce,"’","'",!0);k(Ae,M,ce,"’","\\textquoteright");k(Ae,M,ce,"“","``",!0);k(Ae,M,ce,"“","\\textquotedblleft");k(Ae,M,ce,"”","''",!0);k(Ae,M,ce,"”","\\textquotedblright");k(E,M,ce,"°","\\degree",!0);k(Ae,M,ce,"°","\\degree");k(Ae,M,ce,"°","\\textdegree",!0);k(E,M,ce,"£","\\pounds");k(E,M,ce,"£","\\mathsterling",!0);k(Ae,M,ce,"£","\\pounds");k(Ae,M,ce,"£","\\textsterling",!0);k(E,te,ce,"✠","\\maltese");k(Ae,te,ce,"✠","\\maltese");var Tv='0123456789/@."';for(var vh=0;vh<Tv.length;vh++){var Cv=Tv.charAt(vh);k(E,M,ce,Cv,Cv)}var Rv='0123456789!@*()-=+";:?/.,';for(var yh=0;yh<Rv.length;yh++){var Nv=Rv.charAt(yh);k(Ae,M,ce,Nv,Nv)}var od="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var xh=0;xh<od.length;xh++){var Tu=od.charAt(xh);k(E,M,lt,Tu,Tu),k(Ae,M,ce,Tu,Tu)}k(E,te,ce,"C","ℂ");k(Ae,te,ce,"C","ℂ");k(E,te,ce,"H","ℍ");k(Ae,te,ce,"H","ℍ");k(E,te,ce,"N","ℕ");k(Ae,te,ce,"N","ℕ");k(E,te,ce,"P","ℙ");k(Ae,te,ce,"P","ℙ");k(E,te,ce,"Q","ℚ");k(Ae,te,ce,"Q","ℚ");k(E,te,ce,"R","ℝ");k(Ae,te,ce,"R","ℝ");k(E,te,ce,"Z","ℤ");k(Ae,te,ce,"Z","ℤ");k(E,M,lt,"h","ℎ");k(Ae,M,lt,"h","ℎ");var pt;for(var mr=0;mr<od.length;mr++){var Nn=od.charAt(mr);pt=String.fromCharCode(55349,56320+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),pt=String.fromCharCode(55349,56372+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),pt=String.fromCharCode(55349,56424+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),pt=String.fromCharCode(55349,56580+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),pt=String.fromCharCode(55349,56684+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),pt=String.fromCharCode(55349,56736+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),pt=String.fromCharCode(55349,56788+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),pt=String.fromCharCode(55349,56840+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),pt=String.fromCharCode(55349,56944+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),mr<26&&(pt=String.fromCharCode(55349,56632+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt),pt=String.fromCharCode(55349,56476+mr),k(E,M,lt,Nn,pt),k(Ae,M,ce,Nn,pt))}pt="𝕜";k(E,M,lt,"k",pt);k(Ae,M,ce,"k",pt);for(var bs=0;bs<10;bs++){var qi=bs.toString();pt=String.fromCharCode(55349,57294+bs),k(E,M,lt,qi,pt),k(Ae,M,ce,qi,pt),pt=String.fromCharCode(55349,57314+bs),k(E,M,lt,qi,pt),k(Ae,M,ce,qi,pt),pt=String.fromCharCode(55349,57324+bs),k(E,M,lt,qi,pt),k(Ae,M,ce,qi,pt),pt=String.fromCharCode(55349,57334+bs),k(E,M,lt,qi,pt),k(Ae,M,ce,qi,pt)}var s1="ÐÞþ";for(var wh=0;wh<s1.length;wh++){var Cu=s1.charAt(wh);k(E,M,lt,Cu,Cu),k(Ae,M,ce,Cu,Cu)}var o1={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Av={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Iv={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},sI={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},ws={mathClass:"",textClass:"",font:""},_v={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},Mv={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},Ov={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},l1={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},c1={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},Dv={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},u1={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},jv=[o1,o1,Av,Av,Iv,Iv,sI,ws,ws,ws,_v,_v,Mv,Mv,Ov,Ov,l1,l1,c1,c1,Dv,Dv,ws,ws,u1,u1],oI=[o1,ws,l1,c1,u1],lI=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),a=(t-55296)*1024+(n-56320)+65536;if(119808<=a&&a<120484){var s=Math.floor((a-119808)/26);return jv[s]}else if(120782<=a&&a<=120831){var o=Math.floor((a-120782)/10);return oI[o]}else{if(a===120485||a===120486)return jv[0];if(120486<a&&a<120782)return ws;throw new Oe("Unsupported character: "+e)}},Sd=function(t,n,a){if(vn[a][t]){var s=vn[a][t].replace;s&&(t=s)}return{value:t,metrics:fp(t,n,a)}},pr=function(t,n,a,s,o){var c=Sd(t,n,a),d=c.metrics;t=c.value;var h;if(d){var m=d.italic;(a==="text"||s&&s.font==="mathit")&&(m=0),h=new Pr(t,d.height,d.depth,m,d.skew,d.width,o)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+a+"'")),h=new Pr(t,0,0,0,0,0,o);if(s){h.maxFontSize=s.sizeMultiplier,s.style.isTight()&&h.classes.push("mtight");var p=s.getColor();p&&(h.style.color=p)}return h},hp=function(t,n,a,s){return s===void 0&&(s=[]),a.font==="boldsymbol"&&Sd(t,"Main-Bold",n).metrics?pr(t,"Main-Bold",n,a,s.concat(["mathbf"])):t==="\\"||vn[n][t].font==="main"?pr(t,"Main-Regular",n,a,s):pr(t,"AMS-Regular",n,a,s.concat(["amsrm"]))},cI=function(t,n,a){return a!=="textord"&&Sd(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Ed=function(t,n,a){var s=t.mode,o=t.text,c=["mord"],{font:d,fontFamily:h,fontWeight:m,fontShape:p}=n,g=s==="math"||s==="text"&&!!d,x=g?d:h,v="",S="";if(o.charCodeAt(0)===55349){var T=lI(o);v=T.font,S=T[s+"Class"]}if(v)return pr(o,v,s,n,c.concat(S));if(x){var N,R;if(x==="boldsymbol"){var O=cI(o,s,a);N=O.fontName,R=[O.fontClass]}else g?(N=d1[d].fontName,R=[d]):(N=Ru(h,m,p),R=[h,m,p]);if(Sd(o,N,s).metrics)return pr(o,N,s,n,c.concat(R));if(L6.hasOwnProperty(o)&&N.slice(0,10)==="Typewriter"){for(var _=[],P=0;P<o.length;P++)_.push(pr(o[P],N,s,n,c.concat(R)));return ci(_)}}if(a==="mathord")return pr(o,"Math-Italic",s,n,c.concat(["mathnormal"]));if(a==="textord"){var U=vn[s][o]&&vn[s][o].font;if(U==="ams"){var A=Ru("amsrm",m,p);return pr(o,A,s,n,c.concat("amsrm",m,p))}else if(U==="main"||!U){var z=Ru("textrm",m,p);return pr(o,z,s,n,c.concat(m,p))}else{var X=Ru(U,m,p);return pr(o,X,s,n,c.concat(X,m,p))}}else throw new Error("unexpected type: "+a+" in makeOrd")},uI=(e,t)=>{if(Gi(e.classes)!==Gi(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var a of Object.keys(e.style))if(e.style[a]!==t.style[a])return!1;for(var s of Object.keys(t.style))if(e.style[s]!==t.style[s])return!1;return!0},z6=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],a=e[t+1];n instanceof Pr&&a instanceof Pr&&uI(n,a)&&(n.text+=a.text,n.height=Math.max(n.height,a.height),n.depth=Math.max(n.depth,a.depth),n.italic=a.italic,e.splice(t+1,1),t--)}return e},mp=function(t){for(var n=0,a=0,s=0,o=0;o<t.children.length;o++){var c=t.children[o];c.height>n&&(n=c.height),c.depth>a&&(a=c.depth),c.maxFontSize>s&&(s=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=s},_e=function(t,n,a,s){var o=new Co(t,n,a,s);return mp(o),o},Ki=(e,t,n,a)=>new Co(e,t,n,a),yo=function(t,n,a){var s=_e([t],[],n);return s.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=qe(s.height),s.maxFontSize=1,s},dI=function(t,n,a,s){var o=new kd(t,n,a,s);return mp(o),o},ci=function(t){var n=new To(t);return mp(n),n},xo=function(t,n){return t instanceof To?_e([],[t],n):t},fI=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],s=-n[0].shift-n[0].elem.depth,o=s,c=1;c<n.length;c++){var d=-n[c].shift-o-n[c].elem.depth,h=d-(n[c-1].elem.height+n[c-1].elem.depth);o=o+d,a.push({type:"kern",size:h}),a.push(n[c])}return{children:a,depth:s}}var m;if(t.positionType==="top"){for(var p=t.positionData,g=0;g<t.children.length;g++){var x=t.children[g];p-=x.type==="kern"?x.size:x.elem.height+x.elem.depth}m=p}else if(t.positionType==="bottom")m=-t.positionData;else{var v=t.children[0];if(v.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")m=-v.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")m=-v.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:m}},Xt=function(t,n){for(var{children:a,depth:s}=fI(t),o=0,c=0;c<a.length;c++){var d=a[c];if(d.type==="elem"){var h=d.elem;o=Math.max(o,h.maxFontSize,h.height)}}o+=2;var m=_e(["pstrut"],[]);m.style.height=qe(o);for(var p=[],g=s,x=s,v=s,S=0;S<a.length;S++){var T=a[S];if(T.type==="kern")v+=T.size;else{var N=T.elem,R=T.wrapperClasses||[],O=T.wrapperStyle||{},_=_e(R,[m,N],void 0,O);_.style.top=qe(-o-v-N.depth),T.marginLeft&&(_.style.marginLeft=T.marginLeft),T.marginRight&&(_.style.marginRight=T.marginRight),p.push(_),v+=N.height+N.depth}g=Math.min(g,v),x=Math.max(x,v)}var P=_e(["vlist"],p);P.style.height=qe(x);var U;if(g<0){var A=_e([],[]),z=_e(["vlist"],[A]);z.style.height=qe(-g);var X=_e(["vlist-s"],[new Pr("​")]);U=[_e(["vlist-r"],[P,X]),_e(["vlist-r"],[z])]}else U=[_e(["vlist-r"],[P])];var H=_e(["vlist-t"],U);return U.length===2&&H.classes.push("vlist-t2"),H.height=x,H.depth=-g,H},B6=(e,t)=>{var n=_e(["mspace"],[],t),a=En(e,t);return n.style.marginRight=qe(a),n},Ru=(e,t,n)=>{var a,s;switch(e){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=e}return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":n==="textit"?s="Italic":s="Regular",a+"-"+s},d1={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},q6={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},H6=function(t,n){var[a,s,o]=q6[t],c=new Vi(a),d=new ii([c],{width:qe(s),height:qe(o),style:"width:"+qe(s),viewBox:"0 0 "+1e3*s+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),h=Ki(["overlay"],[d],n);return h.height=o,h.style.height=qe(o),h.style.width=qe(s),h},Sn={number:3,unit:"mu"},vs={number:4,unit:"mu"},Qa={number:5,unit:"mu"},hI={mord:{mop:Sn,mbin:vs,mrel:Qa,minner:Sn},mop:{mord:Sn,mop:Sn,mrel:Qa,minner:Sn},mbin:{mord:vs,mop:vs,mopen:vs,minner:vs},mrel:{mord:Qa,mop:Qa,mopen:Qa,minner:Qa},mopen:{},mclose:{mop:Sn,mbin:vs,mrel:Qa,minner:Sn},mpunct:{mord:Sn,mop:Sn,mrel:Qa,mopen:Sn,mclose:Sn,mpunct:Sn,minner:Sn},minner:{mord:Sn,mop:Sn,mbin:vs,mrel:Qa,mopen:Sn,mpunct:Sn,minner:Sn}},mI={mord:{mop:Sn},mop:{mord:Sn,mop:Sn},mbin:{},mrel:{},mopen:{},mclose:{mop:Sn},mpunct:{},minner:{mop:Sn}},U6={},ld={},cd={};function Ge(e){for(var{type:t,names:n,props:a,handler:s,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:s},h=0;h<n.length;++h)U6[n[h]]=d;t&&(o&&(ld[t]=o),c&&(cd[t]=c))}function Is(e){var{type:t,htmlBuilder:n,mathmlBuilder:a}=e;Ge({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var ud=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Hn=function(t){return t.type==="ordgroup"?t.body:[t]},pI=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),gI=new Set(["rightmost","mrel","mclose","mpunct"]),bI={display:xt.DISPLAY,text:xt.TEXT,script:xt.SCRIPT,scriptscript:xt.SCRIPTSCRIPT},vI={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Yn=function(t,n,a,s){s===void 0&&(s=[null,null]);for(var o=[],c=0;c<t.length;c++){var d=Qt(t[c],n);if(d instanceof To){var h=d.children;o.push(...h)}else o.push(d)}if(z6(o),!a)return o;var m=n;if(t.length===1){var p=t[0];p.type==="sizing"?m=n.havingSize(p.size):p.type==="styling"&&(m=n.havingStyle(bI[p.style]))}var g=_e([s[0]||"leftmost"],[],n),x=_e([s[1]||"rightmost"],[],n),v=a==="root";return f1(o,(S,T)=>{var N=T.classes[0],R=S.classes[0];N==="mbin"&&gI.has(R)?T.classes[0]="mord":R==="mbin"&&pI.has(N)&&(S.classes[0]="mord")},{node:g},x,v),f1(o,(S,T)=>{var N,R,O=m1(T),_=m1(S),P=O&&_?S.hasClass("mtight")?(N=mI[O])==null?void 0:N[_]:(R=hI[O])==null?void 0:R[_]:null;if(P)return B6(P,m)},{node:g},x,v),o},f1=function(t,n,a,s,o){s&&t.push(s);for(var c=0;c<t.length;c++){var d=t[c],h=F6(d);if(h){f1(h.children,n,a,null,o);continue}var m=!d.hasClass("mspace");if(m){var p=n(d,a.node);p&&(a.insertAfter?a.insertAfter(p):(t.unshift(p),c++))}m?a.node=d:o&&d.hasClass("newline")&&(a.node=_e(["leftmost"])),a.insertAfter=(g=>x=>{t.splice(g+1,0,x),c++})(c)}s&&t.pop()},F6=function(t){return t instanceof To||t instanceof kd||t instanceof Co&&t.hasClass("enclosing")?t:null},h1=function(t,n){var a=F6(t);if(a){var s=a.children;if(s.length){if(n==="right")return h1(s[s.length-1],"right");if(n==="left")return h1(s[0],"left")}}return t},m1=function(t,n){if(!t)return null;n&&(t=h1(t,n));var a=t.classes[0];return vI[a]||null},Vl=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return _e(n.concat(a))},Qt=function(t,n,a){if(!t)return _e();if(ld[t.type]){var s=ld[t.type](t,n);if(a&&n.size!==a.size){s=_e(n.sizingClasses(a),[s],n);var o=n.sizeMultiplier/a.sizeMultiplier;s.height*=o,s.depth*=o}return s}else throw new Oe("Got group of unknown type: '"+t.type+"'")};function Nu(e,t){var n=_e(["base"],e,t),a=_e(["strut"]);return a.style.height=qe(n.height+n.depth),n.depth&&(a.style.verticalAlign=qe(-n.depth)),n.children.unshift(a),n}function p1(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=Yn(e,t,"root"),s;a.length===2&&a[1].hasClass("tag")&&(s=a.pop());for(var o=[],c=[],d=0;d<a.length;d++)if(c.push(a[d]),a[d].hasClass("mbin")||a[d].hasClass("mrel")||a[d].hasClass("allowbreak")){for(var h=!1;d<a.length-1&&a[d+1].hasClass("mspace")&&!a[d+1].hasClass("newline");)d++,c.push(a[d]),a[d].hasClass("nobreak")&&(h=!0);h||(o.push(Nu(c,t)),c=[])}else a[d].hasClass("newline")&&(c.pop(),c.length>0&&(o.push(Nu(c,t)),c=[]),o.push(a[d]));c.length>0&&o.push(Nu(c,t));var m;n?(m=Nu(Yn(n,t,!0),t),m.classes=["tag"],o.push(m)):s&&o.push(s);var p=_e(["katex-html"],o);if(p.setAttribute("aria-hidden","true"),m){var g=m.children[0];g.style.height=qe(p.height+p.depth),p.depth&&(g.style.verticalAlign=qe(-p.depth))}return p}function $6(e){return new To(e)}class Le{constructor(t,n,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=a||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Gi(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof Un&&this.children[a+1]instanceof Un){for(var s=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof Un;)s+=this.children[++a].toText();t.appendChild(new Un(s).toNode())}else t.appendChild(this.children[a].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=cr(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+cr(Gi(this.classes))+'"'),t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Un{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return cr(this.toText())}toText(){return this.text}}class P6{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",qe(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+qe(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var yI=new Set(["\\imath","\\jmath"]),xI=new Set(["mrow","mtable"]),sa=function(t,n,a){return vn[n][t]&&vn[n][t].replace&&t.charCodeAt(0)!==55349&&!(L6.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=vn[n][t].replace),new Un(t)},pp=function(t){return t.length===1?t[0]:new Le("mrow",t)},wI={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},gp=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var a=e.mode,s=wI[n];if(s)return typeof s=="function"?s(e):s;var o=e.text;if(yI.has(o))return null;if(vn[a][o]){var c=vn[a][o].replace;c&&(o=c)}var d=d1[n].fontName;return fp(o,d,a)?d1[n].variant:null};function kh(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Un&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Un&&n.text===","}else return!1}var Vr=function(t,n,a){if(t.length===1){var s=dn(t[0],n);return a&&s instanceof Le&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var o=[],c,d=0;d<t.length;d++){var h=dn(t[d],n);if(h instanceof Le&&c instanceof Le){if(h.type==="mtext"&&c.type==="mtext"&&h.getAttribute("mathvariant")===c.getAttribute("mathvariant")){c.children.push(...h.children);continue}else if(h.type==="mn"&&c.type==="mn"){c.children.push(...h.children);continue}else if(kh(h)&&c.type==="mn"){c.children.push(...h.children);continue}else if(h.type==="mn"&&kh(c))h.children=[...c.children,...h.children],o.pop();else if((h.type==="msup"||h.type==="msub")&&h.children.length>=1&&(c.type==="mn"||kh(c))){var m=h.children[0];m instanceof Le&&m.type==="mn"&&(m.children=[...c.children,...m.children],o.pop())}else if(c.type==="mi"&&c.children.length===1){var p=c.children[0];if(p instanceof Un&&p.text==="̸"&&(h.type==="mo"||h.type==="mi"||h.type==="mn")){var g=h.children[0];g instanceof Un&&g.text.length>0&&(g.text=g.text.slice(0,1)+"̸"+g.text.slice(1),o.pop())}}}o.push(h),c=h}return o},Yi=function(t,n,a){return pp(Vr(t,n,a))},dn=function(t,n){if(!t)return new Le("mrow");if(cd[t.type])return cd[t.type](t,n);throw new Oe("Got group of unknown type: '"+t.type+"'")};function Lv(e,t,n,a,s){var o=Vr(e,n),c;o.length===1&&o[0]instanceof Le&&xI.has(o[0].type)?c=o[0]:c=new Le("mrow",o);var d=new Le("annotation",[new Un(t)]);d.setAttribute("encoding","application/x-tex");var h=new Le("semantics",[c,d]),m=new Le("math",[h]);m.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&m.setAttribute("display","block");var p=s?"katex":"katex-mathml";return _e([p],[m])}var kI=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],zv=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Bv=function(t,n){return n.size<2?t:kI[t-1][n.size-1]};class ei{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||ei.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=zv[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new ei(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Bv(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:zv[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=Bv(ei.BASESIZE,t);return this.size===n&&this.textSize===ei.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==ei.BASESIZE?["sizing","reset-size"+this.size,"size"+ei.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=iI(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}ei.BASESIZE=6;var G6=function(t){return new ei({style:t.displayMode?xt.DISPLAY:xt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},V6=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=_e(a,[t])}return t},SI=function(t,n,a){var s=G6(a),o;if(a.output==="mathml")return Lv(t,n,s,a.displayMode,!0);if(a.output==="html"){var c=p1(t,s);o=_e(["katex"],[c])}else{var d=Lv(t,n,s,a.displayMode,!1),h=p1(t,s);o=_e(["katex"],[d,h])}return V6(o,a)},EI=function(t,n,a){var s=G6(a),o=p1(t,s),c=_e(["katex"],[o]);return V6(c,a)},TI={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Td=function(t){var n=new Le("mo",[new Un(TI[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},CI={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},RI=new Set(["widehat","widecheck","widetilde","utilde"]),Cd=function(t,n){function a(){var d=4e5,h=t.label.slice(1);if(RI.has(h)&&"base"in t){var m=t.base.type==="ordgroup"?t.base.body.length:1,p,g,x;if(m>5)h==="widehat"||h==="widecheck"?(p=420,d=2364,x=.42,g=h+"4"):(p=312,d=2340,x=.34,g="tilde4");else{var v=[1,1,2,2,3,3][m];h==="widehat"||h==="widecheck"?(d=[0,1062,2364,2364,2364][v],p=[0,239,300,360,420][v],x=[0,.24,.3,.3,.36,.42][v],g=h+v):(d=[0,600,1033,2339,2340][v],p=[0,260,286,306,312][v],x=[0,.26,.286,.3,.306,.34][v],g="tilde"+v)}var S=new Vi(g),T=new ii([S],{width:"100%",height:qe(x),viewBox:"0 0 "+d+" "+p,preserveAspectRatio:"none"});return{span:Ki([],[T],n),minWidth:0,height:x}}else{var N=[],R=CI[h];if(!R)throw new Error('No SVG data for "'+h+'".');var[O,_,P]=R,U=P/1e3,A=O.length,z,X;if(A===1){if(R.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+h+'".');z=["hide-tail"],X=[R[3]]}else if(A===2)z=["halfarrow-left","halfarrow-right"],X=["xMinYMin","xMaxYMin"];else if(A===3)z=["brace-left","brace-center","brace-right"],X=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
302
- `+A+" children.");for(var H=0;H<A;H++){var $=new Vi(O[H]),F=new ii([$],{width:"400em",height:qe(U),viewBox:"0 0 "+d+" "+P,preserveAspectRatio:X[H]+" slice"}),Y=Ki([z[H]],[F],n);if(A===1)return{span:Y,minWidth:_,height:U};Y.style.height=qe(U),N.push(Y)}return{span:_e(["stretchy"],N,n),minWidth:_,height:U}}}var{span:s,minWidth:o,height:c}=a();return s.height=c,s.style.height=qe(c),o>0&&(s.style.minWidth=qe(o)),s},NI=function(t,n,a,s,o){var c,d=t.height+t.depth+a+s;if(/fbox|color|angl/.test(n)){if(c=_e(["stretchy",n],[],o),n==="fbox"){var h=o.color&&o.getColor();h&&(c.style.borderColor=h)}}else{var m=[];/^[bx]cancel$/.test(n)&&m.push(new i1({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&m.push(new i1({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new ii(m,{width:"100%",height:qe(d)});c=Ki([],[p],o)}return c.height=d,c.style.height=qe(d),c},AI={bin:1,close:1,inner:1,open:1,punct:1,rel:1},II={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function _I(e){return e in AI}function It(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Rd(e){var t=Nd(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Nd(e){return e&&(e.type==="atom"||II.hasOwnProperty(e.type))?e:null}var K6=e=>{if(e instanceof Pr)return e;if(aI(e)&&e.children.length===1)return K6(e.children[0])},bp=(e,t)=>{var n,a,s;e&&e.type==="supsub"?(a=It(e.base,"accent"),n=a.base,e.base=n,s=rI(Qt(e,t)),e.base=a):(a=It(e,"accent"),n=a.base);var o=Qt(n,t.havingCrampedStyle()),c=a.isShifty&&oi(n),d=0;if(c){var h,m;d=(h=(m=K6(o))==null?void 0:m.skew)!=null?h:0}var p=a.label==="\\c",g=p?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight),x;if(a.isStretchy)x=Cd(a,t),x=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:x,wrapperClasses:["svg-align"],wrapperStyle:d>0?{width:"calc(100% - "+qe(2*d)+")",marginLeft:qe(2*d)}:void 0}]});else{var v,S;a.label==="\\vec"?(v=H6("vec",t),S=q6.vec[1]):(v=Ed({mode:a.mode,text:a.label},t,"textord"),v=nI(v),v.italic=0,S=v.width,p&&(g+=v.depth)),x=_e(["accent-body"],[v]);var T=a.label==="\\textcircled";T&&(x.classes.push("accent-full"),g=o.height);var N=d;T||(N-=S/2),x.style.left=qe(N),a.label==="\\textcircled"&&(x.style.top=".2em"),x=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-g},{type:"elem",elem:x}]})}var R=_e(["mord","accent"],[x],t);return s?(s.children[0]=R,s.height=Math.max(R.height,s.height),s.classes[0]="mord",s):R},Y6=(e,t)=>{var n=e.isStretchy?Td(e.label):new Le("mo",[sa(e.label,e.mode)]),a=new Le("mover",[dn(e.base,t),n]);return a.setAttribute("accent","true"),a},MI=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ge({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=ud(t[0]),a=!MI.test(e.funcName),s=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:s,base:n}},htmlBuilder:bp,mathmlBuilder:Y6});Ge({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:bp,mathmlBuilder:Y6});Ge({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:s}},htmlBuilder:(e,t)=>{var n=Qt(e.base,t),a=Cd(e,t),s=e.label==="\\utilde"?.12:0,o=Xt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]});return _e(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=Td(e.label),a=new Le("munder",[dn(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var Au=e=>{var t=new Le("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ge({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a,funcName:s}=e;return{type:"xArrow",mode:a.mode,label:s,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),s=xo(Qt(e.body,a,t),t),o=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(o+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=xo(Qt(e.below,a,t),t),c.classes.push(o+"-arrow-pad"));var d=Cd(e,t),h=-t.fontMetrics().axisHeight+.5*d.height,m=-t.fontMetrics().axisHeight-.5*d.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(m-=s.depth);var p;if(c){var g=-t.fontMetrics().axisHeight+c.height+.5*d.height+.111;p=Xt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:m},{type:"elem",elem:d,shift:h,wrapperClasses:["svg-align"]},{type:"elem",elem:c,shift:g}]})}else p=Xt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:m},{type:"elem",elem:d,shift:h,wrapperClasses:["svg-align"]}]});return _e(["mrel","x-arrow"],[p],t)},mathmlBuilder(e,t){var n=Td(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var s=Au(dn(e.body,t));if(e.below){var o=Au(dn(e.below,t));a=new Le("munderover",[n,o,s])}else a=new Le("mover",[n,s])}else if(e.below){var c=Au(dn(e.below,t));a=new Le("munder",[n,c])}else a=Au(),a=new Le("mover",[n,a]);return a}});function W6(e,t){var n=Yn(e.body,t,!0);return _e([e.mclass],n,t)}function Z6(e,t){var n,a=Vr(e.body,t);return e.mclass==="minner"?n=new Le("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new Le("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new Le("mo",a),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ge({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:Hn(s),isCharacterBox:oi(s)}},htmlBuilder:W6,mathmlBuilder:Z6});var Ad=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Ge({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Ad(t[0]),body:Hn(t[1]),isCharacterBox:oi(t[1])}}});Ge({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,s=t[1],o=t[0],c;a!=="\\stackrel"?c=Ad(s):c="mrel";var d={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Hn(s)},h={type:"supsub",mode:o.mode,base:d,sup:a==="\\underset"?null:o,sub:a==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:c,body:[h],isCharacterBox:oi(h)}},htmlBuilder:W6,mathmlBuilder:Z6});Ge({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Ad(t[0]),body:Hn(t[0])}},htmlBuilder(e,t){var n=Yn(e.body,t,!0),a=_e([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=Vr(e.body,t),a=new Le("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var OI={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},qv=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Hv=e=>e.type==="textord"&&e.text==="@",DI=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function jI(e,t,n){var a=OI[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[o],[]),d=n.callFunction("\\\\cdright",[t[1]],[]),h={type:"ordgroup",mode:"math",body:[s,c,d]};return n.callFunction("\\\\cdparent",[h],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var m={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[m],[])}default:return{type:"textord",text:" ",mode:"math"}}}function LI(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Oe("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],s=[a],o=0;o<t.length;o++){for(var c=t[o],d=qv(),h=0;h<c.length;h++)if(!Hv(c[h]))d.body.push(c[h]);else{a.push(d),h+=1;var m=Rd(c[h]).text,p=new Array(2);if(p[0]={type:"ordgroup",mode:"math",body:[]},p[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(m))if("<>AV".includes(m))for(var g=0;g<2;g++){for(var x=!0,v=h+1;v<c.length;v++){if(DI(c[v],m)){x=!1,h=v;break}if(Hv(c[v]))throw new Oe("Missing a "+m+" character to complete a CD arrow.",c[v]);p[g].body.push(c[v])}if(x)throw new Oe("Missing a "+m+" character to complete a CD arrow.",c[h])}else throw new Oe('Expected one of "<>AV=|." after @',c[h]);var S=jI(m,p,e),T={type:"styling",body:[S],mode:"math",style:"display",resetFont:!0};a.push(T),d=qv()}o%2===0?a.push(d):a.shift(),a=[],s.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var N=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:N,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}Ge({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),a=xo(Qt(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=qe(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new Le("mrow",[dn(e.label,t)]);return n=new Le("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Le("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ge({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=xo(Qt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Le("mrow",[dn(e.fragment,t)])}});Ge({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=It(t[0],"ordgroup"),s=a.body,o="",c=0;c<s.length;c++){var d=It(s[c],"textord");o+=d.text}var h=parseInt(o),m;if(isNaN(h))throw new Oe("\\@char has non-numeric argument "+o);if(h<0||h>=1114111)throw new Oe("\\@char with invalid code point "+o);return h<=65535?m=String.fromCharCode(h):(h-=65536,m=String.fromCharCode((h>>10)+55296,(h&1023)+56320)),{type:"textord",mode:n.mode,text:m}}});var X6=(e,t)=>{var n=Yn(e.body,t.withColor(e.color),!1);return ci(n)},Q6=(e,t)=>{var n=Vr(e.body,t.withColor(e.color)),a=new Le("mstyle",n);return a.setAttribute("mathcolor",e.color),a};Ge({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=It(t[0],"color-token").color,s=t[1];return{type:"color",mode:n.mode,color:a,body:Hn(s)}},htmlBuilder:X6,mathmlBuilder:Q6});Ge({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,s=It(t[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var o=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:s,body:o}},htmlBuilder:X6,mathmlBuilder:Q6});Ge({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,s=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,o=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:o,size:s&&It(s,"size").value}},htmlBuilder(e,t){var n=_e(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=qe(En(e.size,t)))),n},mathmlBuilder(e,t){var n=new Le("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",qe(En(e.size,t)))),n}});var g1={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},J6=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Oe("Expected a control sequence",e);return t},zI=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},e7=(e,t,n,a)=>{var s=e.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,s,a)};Ge({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var a=t.fetch();if(g1[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=g1[a.text]),It(t.parseFunction(),"internal");throw new Oe("Invalid token after macro prefix",a)}});Ge({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=t.gullet.popToken(),s=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Oe("Expected a control sequence",a);for(var o=0,c,d=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),d[o].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new Oe('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==o+1)throw new Oe('Argument number "'+a.text+'" out of order');o++,d.push([])}else{if(a.text==="EOF")throw new Oe("Expected a macro definition");d[o].push(a.text)}var{tokens:h}=t.gullet.consumeArg();return c&&h.unshift(c),(n==="\\edef"||n==="\\xdef")&&(h=t.gullet.expandTokens(h),h.reverse()),t.gullet.macros.set(s,{tokens:h,numArgs:o,delimiters:d},n===g1[n]),{type:"internal",mode:t.mode}}});Ge({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=J6(t.gullet.popToken());t.gullet.consumeSpaces();var s=zI(t);return e7(t,a,s,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ge({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=J6(t.gullet.popToken()),s=t.gullet.popToken(),o=t.gullet.popToken();return e7(t,a,o,n==="\\\\globalfuture"),t.gullet.pushToken(o),t.gullet.pushToken(s),{type:"internal",mode:t.mode}}});var Cl=function(t,n,a){var s=vn.math[t]&&vn.math[t].replace,o=fp(s||t,n,a);if(!o)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return o},vp=function(t,n,a,s){var o=a.havingBaseStyle(n),c=_e(s.concat(o.sizingClasses(a)),[t],a),d=o.sizeMultiplier/a.sizeMultiplier;return c.height*=d,c.depth*=d,c.maxFontSize=o.sizeMultiplier,c},t7=function(t,n,a){var s=n.havingBaseStyle(a),o=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=qe(o),t.height-=o,t.depth+=o},BI=function(t,n,a,s,o,c){var d=pr(t,"Main-Regular",o,s),h=vp(d,n,s,c);return t7(h,s,n),h},qI=function(t,n,a,s){return pr(t,"Size"+n+"-Regular",a,s)},n7=function(t,n,a,s,o,c){var d=qI(t,n,o,s),h=vp(_e(["delimsizing","size"+n],[d],s),xt.TEXT,s,c);return a&&t7(h,s,xt.TEXT),h},Sh=function(t,n,a){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var o=_e(["delimsizinginner",s],[_e([],[pr(t,n,a)])]);return{type:"elem",elem:o}},Eh=function(t,n,a){var s=Na["Size4-Regular"][t.charCodeAt(0)]?Na["Size4-Regular"][t.charCodeAt(0)][4]:Na["Size1-Regular"][t.charCodeAt(0)][4],o=new Vi("inner",WA(t,Math.round(1e3*n))),c=new ii([o],{width:qe(s),height:qe(n),style:"width:"+qe(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),d=Ki([],[c],a);return d.height=n,d.style.height=qe(n),d.style.width=qe(s),{type:"elem",elem:d}},b1=.008,Iu={type:"kern",size:-1*b1},HI=new Set(["|","\\lvert","\\rvert","\\vert"]),UI=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),r7=function(t,n,a,s,o,c){var d,h,m,p,g="",x=0;d=m=p=t,h=null;var v="Size1-Regular";t==="\\uparrow"?m=p="⏐":t==="\\Uparrow"?m=p="‖":t==="\\downarrow"?d=m="⏐":t==="\\Downarrow"?d=m="‖":t==="\\updownarrow"?(d="\\uparrow",m="⏐",p="\\downarrow"):t==="\\Updownarrow"?(d="\\Uparrow",m="‖",p="\\Downarrow"):HI.has(t)?(m="∣",g="vert",x=333):UI.has(t)?(m="∥",g="doublevert",x=556):t==="["||t==="\\lbrack"?(d="⎡",m="⎢",p="⎣",v="Size4-Regular",g="lbrack",x=667):t==="]"||t==="\\rbrack"?(d="⎤",m="⎥",p="⎦",v="Size4-Regular",g="rbrack",x=667):t==="\\lfloor"||t==="⌊"?(m=d="⎢",p="⎣",v="Size4-Regular",g="lfloor",x=667):t==="\\lceil"||t==="⌈"?(d="⎡",m=p="⎢",v="Size4-Regular",g="lceil",x=667):t==="\\rfloor"||t==="⌋"?(m=d="⎥",p="⎦",v="Size4-Regular",g="rfloor",x=667):t==="\\rceil"||t==="⌉"?(d="⎤",m=p="⎥",v="Size4-Regular",g="rceil",x=667):t==="("||t==="\\lparen"?(d="⎛",m="⎜",p="⎝",v="Size4-Regular",g="lparen",x=875):t===")"||t==="\\rparen"?(d="⎞",m="⎟",p="⎠",v="Size4-Regular",g="rparen",x=875):t==="\\{"||t==="\\lbrace"?(d="⎧",h="⎨",p="⎩",m="⎪",v="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(d="⎫",h="⎬",p="⎭",m="⎪",v="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(d="⎧",p="⎩",m="⎪",v="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(d="⎫",p="⎭",m="⎪",v="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(d="⎧",p="⎭",m="⎪",v="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(d="⎫",p="⎩",m="⎪",v="Size4-Regular");var S=Cl(d,v,o),T=S.height+S.depth,N=Cl(m,v,o),R=N.height+N.depth,O=Cl(p,v,o),_=O.height+O.depth,P=0,U=1;if(h!==null){var A=Cl(h,v,o);P=A.height+A.depth,U=2}var z=T+_+P,X=Math.max(0,Math.ceil((n-z)/(U*R))),H=z+X*U*R,$=s.fontMetrics().axisHeight;a&&($*=s.sizeMultiplier);var F=H/2-$,Y=[];if(g.length>0){var oe=H-T-_,ee=Math.round(H*1e3),q=ZA(g,Math.round(oe*1e3)),I=new Vi(g,q),K=qe(x/1e3),Q=qe(ee/1e3),pe=new ii([I],{width:K,height:Q,viewBox:"0 0 "+x+" "+ee}),j=Ki([],[pe],s);j.height=ee/1e3,j.style.width=K,j.style.height=Q,Y.push({type:"elem",elem:j})}else{if(Y.push(Sh(p,v,o)),Y.push(Iu),h===null){var G=H-T-_+2*b1;Y.push(Eh(m,G,s))}else{var W=(H-T-_-P)/2+2*b1;Y.push(Eh(m,W,s)),Y.push(Iu),Y.push(Sh(h,v,o)),Y.push(Iu),Y.push(Eh(m,W,s))}Y.push(Iu),Y.push(Sh(d,v,o))}var D=s.havingBaseStyle(xt.TEXT),ye=Xt({positionType:"bottom",positionData:F,children:Y});return vp(_e(["delimsizing","mult"],[ye],D),xt.TEXT,s,c)},Th=80,Ch=.08,Rh=function(t,n,a,s,o){var c=YA(t,s,a),d=new Vi(t,c),h=new ii([d],{width:"400em",height:qe(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return Ki(["hide-tail"],[h],o)},FI=function(t,n){var a=n.havingBaseSizing(),s=l7("\\surd",t*a.sizeMultiplier,o7,a),o=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),d,h,m,p,g;return s.type==="small"?(p=1e3+1e3*c+Th,t<1?o=1:t<1.4&&(o=.7),h=(1+c+Ch)/o,m=(1+c)/o,d=Rh("sqrtMain",h,p,c,n),d.style.minWidth="0.853em",g=.833/o):s.type==="large"?(p=(1e3+Th)*jl[s.size],m=(jl[s.size]+c)/o,h=(jl[s.size]+c+Ch)/o,d=Rh("sqrtSize"+s.size,h,p,c,n),d.style.minWidth="1.02em",g=1/o):(h=t+c+Ch,m=t+c,p=Math.floor(1e3*t+c)+Th,d=Rh("sqrtTall",h,p,c,n),d.style.minWidth="0.742em",g=1.056),d.height=m,d.style.height=qe(h),{span:d,advanceWidth:g,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*o}},a7=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),$I=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),i7=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),jl=[0,1.2,1.8,2.4,3],s7=function(t,n,a,s,o){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),a7.has(t)||i7.has(t))return n7(t,n,!1,a,s,o);if($I.has(t))return r7(t,jl[n],!1,a,s,o);throw new Oe("Illegal delimiter: '"+t+"'")},PI=[{type:"small",style:xt.SCRIPTSCRIPT},{type:"small",style:xt.SCRIPT},{type:"small",style:xt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],GI=[{type:"small",style:xt.SCRIPTSCRIPT},{type:"small",style:xt.SCRIPT},{type:"small",style:xt.TEXT},{type:"stack"}],o7=[{type:"small",style:xt.SCRIPTSCRIPT},{type:"small",style:xt.SCRIPT},{type:"small",style:xt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],VI=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},l7=function(t,n,a,s){for(var o=Math.min(2,3-s.style.size),c=o;c<a.length;c++){var d=a[c];if(d.type==="stack")break;var h=Cl(t,VI(d),"math"),m=h.height+h.depth;if(d.type==="small"){var p=s.havingBaseStyle(d.style);m*=p.sizeMultiplier}if(m>n)return d}return a[a.length-1]},v1=function(t,n,a,s,o,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var d;i7.has(t)?d=PI:a7.has(t)?d=o7:d=GI;var h=l7(t,n,d,s);return h.type==="small"?BI(t,h.style,a,s,o,c):h.type==="large"?n7(t,h.size,a,s,o,c):r7(t,n,a,s,o,c)},Nh=function(t,n,a,s,o,c){var d=s.fontMetrics().axisHeight*s.sizeMultiplier,h=901,m=5/s.fontMetrics().ptPerEm,p=Math.max(n-d,a+d),g=Math.max(p/500*h,2*p-m);return v1(t,g,!0,s,o,c)},Uv={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},KI=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function Fv(e){return"isMiddle"in e}function Id(e,t){var n=Nd(e);if(n&&KI.has(n.text))return n;throw n?new Oe("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Oe("Invalid delimiter type '"+e.type+"'",e)}Ge({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Id(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Uv[e.funcName].size,mclass:Uv[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?_e([e.mclass]):s7(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(sa(e.delim,e.mode));var n=new Le("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=qe(jl[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function $v(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ge({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Oe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Id(t[0],e).text,color:n}}});Ge({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Id(t[0],e),a=e.parser;++a.leftrightDepth;var s=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var o=It(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:s,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{$v(e);for(var n=Yn(e.body,t,!0,["mopen","mclose"]),a=0,s=0,o=!1,c=0;c<n.length;c++){var d=n[c];Fv(d)?o=!0:(a=Math.max(n[c].height,a),s=Math.max(n[c].depth,s))}a*=t.sizeMultiplier,s*=t.sizeMultiplier;var h;if(e.left==="."?h=Vl(t,["mopen"]):h=Nh(e.left,a,s,t,e.mode,["mopen"]),n.unshift(h),o)for(var m=1;m<n.length;m++){var p=n[m];if(Fv(p)){var g=p.isMiddle;n[m]=Nh(g.delim,a,s,g.options,e.mode,[])}}var x;if(e.right===".")x=Vl(t,["mclose"]);else{var v=e.rightColor?t.withColor(e.rightColor):t;x=Nh(e.right,a,s,v,e.mode,["mclose"])}return n.push(x),_e(["minner"],n,t)},mathmlBuilder:(e,t)=>{$v(e);var n=Vr(e.body,t);if(e.left!=="."){var a=new Le("mo",[sa(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var s=new Le("mo",[sa(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),n.push(s)}return pp(n)}});Ge({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Id(t[0],e);if(!e.parser.leftrightDepth)throw new Oe("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Vl(t,[]):(n=s7(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?sa("|","text"):sa(e.delim,e.mode),a=new Le("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var _d=(e,t)=>{var n=xo(Qt(e.body,t),t),a=e.label.slice(1),s=t.sizeMultiplier,o,c,d=oi(e.body);if(a==="sout")o=_e(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/s,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var h=En({number:.6,unit:"pt"},t),m=En({number:.35,unit:"ex"},t),p=t.havingBaseSizing();s=s/p.sizeMultiplier;var g=n.height+n.depth+h+m;n.style.paddingLeft=qe(g/2+h);var x=Math.floor(1e3*g*s),v=VA(x),S=new ii([new Vi("phase",v)],{width:"400em",height:qe(x/1e3),viewBox:"0 0 400000 "+x,preserveAspectRatio:"xMinYMin slice"});o=Ki(["hide-tail"],[S],t),o.style.height=qe(g),c=n.depth+h+m}else{/cancel/.test(a)?d||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var T,N,R=0;/box/.test(a)?(R=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),T=t.fontMetrics().fboxsep+(a==="colorbox"?0:R),N=T):a==="angl"?(R=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),T=4*R,N=Math.max(0,.25-n.depth)):(T=d?.2:0,N=T),o=NI(n,a,T,N,t),/fbox|boxed|fcolorbox/.test(a)?(o.style.borderStyle="solid",o.style.borderWidth=qe(R)):a==="angl"&&R!==.049&&(o.style.borderTopWidth=qe(R),o.style.borderRightWidth=qe(R)),c=n.depth+N,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var O;if(e.backgroundColor)O=Xt({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:n,shift:0}]});else{var _=/cancel|phase/.test(a)?["svg-align"]:[];O=Xt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:c,wrapperClasses:_}]})}return/cancel/.test(a)&&(O.height=n.height,O.depth=n.depth),/cancel/.test(a)&&!d?_e(["mord","cancel-lap"],[O],t):_e(["mord"],[O],t)},Md=(e,t)=>{var n,a=new Le(e.label.includes("colorbox")?"mpadded":"menclose",[dn(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var s=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+qe(s)+" solid "+e.borderColor)}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Ge({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:a,funcName:s}=e,o=It(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:s,backgroundColor:o,body:c}},htmlBuilder:_d,mathmlBuilder:Md});Ge({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:a,funcName:s}=e,o=It(t[0],"color-token").color,c=It(t[1],"color-token").color,d=t[2];return{type:"enclose",mode:a.mode,label:s,backgroundColor:c,borderColor:o,body:d}},htmlBuilder:_d,mathmlBuilder:Md});Ge({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Ge({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"enclose",mode:n.mode,label:a,body:s}},htmlBuilder:_d,mathmlBuilder:Md});Ge({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=t[0];return{type:"enclose",mode:n.mode,label:a,body:s}},htmlBuilder:_d,mathmlBuilder:Md});Ge({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var c7={};function Ia(e){for(var{type:t,names:n,props:a,handler:s,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},h=0;h<n.length;++h)c7[n[h]]=d;o&&(ld[t]=o),c&&(cd[t]=c)}var u7={};function B(e,t){u7[e]=t}class Ar{constructor(t,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=a}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new Ar(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class $r{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new $r(n,Ar.range(this,t))}}function Pv(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Od=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Oe("{"+e.envName+"} can be used only in display mode.")},YI=new Set(["gather","gather*"]);function yp(e){if(!e.includes("ed"))return!e.includes("*")}function Xi(e,t,n){var{hskipBeforeAndAfter:a,addJot:s,cols:o,arraystretch:c,colSeparationType:d,autoTag:h,singleRow:m,emptySingleRow:p,maxNumCols:g,leqno:x}=t;if(e.gullet.beginGroup(),m||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var v=e.gullet.expandMacroAsText("\\arraystretch");if(v==null)c=1;else if(c=parseFloat(v),!c||c<0)throw new Oe("Invalid \\arraystretch: "+v)}e.gullet.beginGroup();var S=[],T=[S],N=[],R=[],O=h!=null?[]:void 0;function _(){h&&e.gullet.macros.set("\\@eqnsw","1",!0)}function P(){O&&(e.gullet.macros.get("\\df@tag")?(O.push(e.subparse([new $r("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):O.push(!!h&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(_(),R.push(Pv(e));;){var U=e.parseExpression(!1,m?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var A={type:"ordgroup",mode:e.mode,body:U};n&&(A={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[A]}),S.push(A);var z=e.fetch().text;if(z==="&"){if(g&&S.length===g){if(m||d)throw new Oe("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(z==="\\end"){P(),S.length===1&&A.type==="styling"&&A.body.length===1&&A.body[0].type==="ordgroup"&&A.body[0].body.length===0&&(T.length>1||!p)&&T.pop(),R.length<T.length+1&&R.push([]);break}else if(z==="\\\\"){e.consume();var X=void 0;e.gullet.future().text!==" "&&(X=e.parseSizeGroup(!0)),N.push(X?X.value:null),P(),R.push(Pv(e)),S=[],T.push(S),_()}else throw new Oe("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:s,arraystretch:c,body:T,cols:o,rowGaps:N,hskipBeforeAndAfter:a,hLinesBeforeRow:R,colSeparationType:d,tags:O,leqno:x}}function xp(e){return e.slice(0,1)==="d"?"display":"text"}var _a=function(t,n){var a,s,o=t.body.length,c=t.hLinesBeforeRow,d=0,h=new Array(o),m=[],p=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),g=1/n.fontMetrics().ptPerEm,x=5*g;if(t.colSeparationType&&t.colSeparationType==="small"){var v=n.havingStyle(xt.SCRIPT).sizeMultiplier;x=.2778*(v/n.sizeMultiplier)}var S=t.colSeparationType==="CD"?En({number:3,unit:"ex"},n):12*g,T=3*g,N=t.arraystretch*S,R=.7*N,O=.3*N,_=0;function P(He){for(var we=0;we<He.length;++we)we>0&&(_+=.25),m.push({pos:_,isDashed:He[we]})}for(P(c[0]),a=0;a<t.body.length;++a){var U=t.body[a],A=R,z=O;d<U.length&&(d=U.length);var X={cells:new Array(U.length),height:0,depth:0,pos:0};for(s=0;s<U.length;++s){var H=Qt(U[s],n);z<H.depth&&(z=H.depth),A<H.height&&(A=H.height),X.cells[s]=H}var $=t.rowGaps[a],F=0;$&&(F=En($,n),F>0&&(F+=O,z<F&&(z=F),F=0)),t.addJot&&a<t.body.length-1&&(z+=T),X.height=A,X.depth=z,_+=A,X.pos=_,_+=z+F,h[a]=X,P(c[a+1])}var Y=_/2+n.fontMetrics().axisHeight,oe=t.cols||[],ee=[],q,I,K=[];if(t.tags&&t.tags.some(He=>He))for(a=0;a<o;++a){var Q=h[a],pe=Q.pos-Y,j=t.tags[a],G=void 0;j===!0?G=_e(["eqn-num"],[],n):j===!1?G=_e([],[],n):G=_e([],Yn(j,n,!0),n),G.depth=Q.depth,G.height=Q.height,K.push({type:"elem",elem:G,shift:pe})}for(s=0,I=0;s<d||I<oe.length;++s,++I){for(var W,D=oe[I],ye=!0;((se=D)==null?void 0:se.type)==="separator";){var se;if(ye||(q=_e(["arraycolsep"],[]),q.style.width=qe(n.fontMetrics().doubleRuleSep),ee.push(q)),D.separator==="|"||D.separator===":"){var V=D.separator==="|"?"solid":"dashed",Z=_e(["vertical-separator"],[],n);Z.style.height=qe(_),Z.style.borderRightWidth=qe(p),Z.style.borderRightStyle=V,Z.style.margin="0 "+qe(-p/2);var ne=_-Y;ne&&(Z.style.verticalAlign=qe(-ne)),ee.push(Z)}else throw new Oe("Invalid separator type: "+D.separator);I++,D=oe[I],ye=!1}if(!(s>=d)){var ue=void 0;if(s>0||t.hskipBeforeAndAfter){var he,Re;ue=(he=(Re=D)==null?void 0:Re.pregap)!=null?he:x,ue!==0&&(q=_e(["arraycolsep"],[]),q.style.width=qe(ue),ee.push(q))}var ze=[];for(a=0;a<o;++a){var Ke=h[a],ft=Ke.cells[s];if(ft){var gt=Ke.pos-Y;ft.depth=Ke.depth,ft.height=Ke.height,ze.push({type:"elem",elem:ft,shift:gt})}}var Rt=Xt({positionType:"individualShift",children:ze}),Bt=_e(["col-align-"+(((W=D)==null?void 0:W.align)||"c")],[Rt]);if(ee.push(Bt),s<d-1||t.hskipBeforeAndAfter){var rt,Mt;ue=(rt=(Mt=D)==null?void 0:Mt.postgap)!=null?rt:x,ue!==0&&(q=_e(["arraycolsep"],[]),q.style.width=qe(ue),ee.push(q))}}}var mt=_e(["mtable"],ee);if(m.length>0){for(var qt=yo("hline",n,p),Be=yo("hdashline",n,p),Qe=[{type:"elem",elem:mt,shift:0}];m.length>0;){var Ue=m.pop(),st=Ue.pos-Y;Ue.isDashed?Qe.push({type:"elem",elem:Be,shift:st}):Qe.push({type:"elem",elem:qt,shift:st})}mt=Xt({positionType:"individualShift",children:Qe})}if(K.length===0)return _e(["mord"],[mt],n);var me=Xt({positionType:"individualShift",children:K}),fe=_e(["tag"],[me],n);return ci([mt,fe])},WI={c:"center ",l:"left ",r:"right "},Ma=function(t,n){for(var a=[],s=new Le("mtd",[],["mtr-glue"]),o=new Le("mtd",[],["mml-eqn-num"]),c=0;c<t.body.length;c++){for(var d=t.body[c],h=[],m=0;m<d.length;m++)h.push(new Le("mtd",[dn(d[m],n)]));t.tags&&t.tags[c]&&(h.unshift(s),h.push(s),t.leqno?h.unshift(o):h.push(o)),a.push(new Le("mtr",h))}var p=new Le("mtable",a),g=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);p.setAttribute("rowspacing",qe(g));var x="",v="";if(t.cols&&t.cols.length>0){var S=t.cols,T="",N=!1,R=0,O=S.length;S[0].type==="separator"&&(x+="top ",R=1),S[S.length-1].type==="separator"&&(x+="bottom ",O-=1);for(var _=R;_<O;_++){var P=S[_];P.type==="align"?(v+=WI[P.align],N&&(T+="none "),N=!0):P.type==="separator"&&N&&(T+=P.separator==="|"?"solid ":"dashed ",N=!1)}p.setAttribute("columnalign",v.trim()),/[sd]/.test(T)&&p.setAttribute("columnlines",T.trim())}if(t.colSeparationType==="align"){for(var U=t.cols||[],A="",z=1;z<U.length;z++)A+=z%2?"0em ":"1em ";p.setAttribute("columnspacing",A.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?p.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?p.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?p.setAttribute("columnspacing","0.5em"):p.setAttribute("columnspacing","1em");var X="",H=t.hLinesBeforeRow;x+=H[0].length>0?"left ":"",x+=H[H.length-1].length>0?"right ":"";for(var $=1;$<H.length-1;$++)X+=H[$].length===0?"none ":H[$][0]?"dashed ":"solid ";return/[sd]/.test(X)&&p.setAttribute("rowlines",X.trim()),x!==""&&(p=new Le("menclose",[p]),p.setAttribute("notation",x.trim())),t.arraystretch&&t.arraystretch<1&&(p=new Le("mstyle",[p]),p.setAttribute("scriptlevel","1")),p},d7=function(t,n){t.envName.includes("ed")||Od(t);var a=[],s=t.envName.includes("at")?"alignat":"align",o=t.envName==="split",c=Xi(t.parser,{cols:a,addJot:!0,autoTag:o?void 0:yp(t.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:o?2:void 0,leqno:t.parser.settings.leqno},"display"),d=0,h=0,m={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var p="",g=0;g<n[0].body.length;g++){var x=It(n[0].body[g],"textord");p+=x.text}d=Number(p),h=d*2}var v=!h;c.body.forEach(function(R){for(var O=1;O<R.length;O+=2){var _=It(R[O],"styling"),P=It(_.body[0],"ordgroup");P.body.unshift(m)}if(v)h<R.length&&(h=R.length);else{var U=R.length/2;if(d<U)throw new Oe("Too many math in a row: "+("expected "+d+", but got "+U),R[0])}});for(var S=0;S<h;++S){var T="r",N=0;S%2===1?T="l":S>0&&v&&(N=1),a[S]={type:"align",align:T,pregap:N,postgap:0}}return c.colSeparationType=v?"align":"alignat",c};Ia({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Nd(t[0]),a=n?[t[0]]:It(t[0],"ordgroup").body,s=a.map(function(c){var d=Rd(c),h=d.text;if("lcr".includes(h))return{type:"align",align:h};if(h==="|")return{type:"separator",separator:"|"};if(h===":")return{type:"separator",separator:":"};throw new Oe("Unknown column alignment: "+h,c)}),o={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Xi(e.parser,o,xp(e.envName))},htmlBuilder:_a,mathmlBuilder:Ma});Ia({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,!"lcr".includes(n))throw new Oe("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),a.cols=[{type:"align",align:n}]}}var o=Xi(e.parser,a,xp(e.envName)),c=Math.max(0,...o.body.map(d=>d.length));return o.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:_a,mathmlBuilder:Ma});Ia({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Xi(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:_a,mathmlBuilder:Ma});Ia({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Nd(t[0]),a=n?[t[0]]:It(t[0],"ordgroup").body,s=a.map(function(d){var h=Rd(d),m=h.text;if("lc".includes(m))return{type:"align",align:m};throw new Oe("Unknown column alignment: "+m,d)});if(s.length>1)throw new Oe("{subarray} can contain only one column");var o={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},c=Xi(e.parser,o,"script");if(c.body.length>0&&c.body[0].length>1)throw new Oe("{subarray} can contain only one column");return c},htmlBuilder:_a,mathmlBuilder:Ma});Ia({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Xi(e.parser,t,xp(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:_a,mathmlBuilder:Ma});Ia({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:d7,htmlBuilder:_a,mathmlBuilder:Ma});Ia({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){YI.has(e.envName)&&Od(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:yp(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Xi(e.parser,t,"display")},htmlBuilder:_a,mathmlBuilder:Ma});Ia({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:d7,htmlBuilder:_a,mathmlBuilder:Ma});Ia({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Od(e);var t={autoTag:yp(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Xi(e.parser,t,"display")},htmlBuilder:_a,mathmlBuilder:Ma});Ia({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Od(e),LI(e.parser)},htmlBuilder:_a,mathmlBuilder:Ma});B("\\nonumber","\\gdef\\@eqnsw{0}");B("\\notag","\\nonumber");Ge({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Oe(e.funcName+" valid only within array environment")}});var Gv=c7;Ge({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];if(s.type!=="ordgroup")throw new Oe("Invalid environment name",s);for(var o="",c=0;c<s.body.length;++c)o+=It(s.body[c],"textord").text;if(a==="\\begin"){if(!Gv.hasOwnProperty(o))throw new Oe("No such environment: "+o,s);var d=Gv[o],{args:h,optArgs:m}=n.parseArguments("\\begin{"+o+"}",d),p={mode:n.mode,envName:o,parser:n},g=d.handler(p,h,m);n.expect("\\end",!1);var x=n.nextToken,v=It(n.parseFunction(),"environment");if(v.name!==o)throw new Oe("Mismatch: \\begin{"+o+"} matched by \\end{"+v.name+"}",x);return g}return{type:"environment",mode:n.mode,name:o,nameGroup:s}}});var f7=(e,t)=>{var n=e.font,a=t.withFont(n);return Qt(e.body,a)},h7=(e,t)=>{var n=e.font,a=t.withFont(n);return dn(e.body,a)},Vv={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ge({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=ud(t[0]),o=a;return o in Vv&&(o=Vv[o]),{type:"font",mode:n.mode,font:o.slice(1),body:s}},htmlBuilder:f7,mathmlBuilder:h7});Ge({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"mclass",mode:n.mode,mclass:Ad(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:oi(a)}}});Ge({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:s}=e,{mode:o}=n,c=n.parseExpression(!0,s);return{type:"font",mode:o,font:"math"+a.slice(1),body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:f7,mathmlBuilder:h7});var ZI=(e,t)=>{var n=t.style,a=n.fracNum(),s=n.fracDen(),o;o=t.havingStyle(a);var c=Qt(e.numer,o,t);if(e.continued){var d=8.5/t.fontMetrics().ptPerEm,h=3.5/t.fontMetrics().ptPerEm;c.height=c.height<d?d:c.height,c.depth=c.depth<h?h:c.depth}o=t.havingStyle(s);var m=Qt(e.denom,o,t),p,g,x;e.hasBarLine?(e.barSize?(g=En(e.barSize,t),p=yo("frac-line",t,g)):p=yo("frac-line",t),g=p.height,x=p.height):(p=null,g=0,x=t.fontMetrics().defaultRuleThickness);var v,S,T;n.size===xt.DISPLAY.size?(v=t.fontMetrics().num1,g>0?S=3*x:S=7*x,T=t.fontMetrics().denom1):(g>0?(v=t.fontMetrics().num2,S=x):(v=t.fontMetrics().num3,S=3*x),T=t.fontMetrics().denom2);var N;if(p){var O=t.fontMetrics().axisHeight;v-c.depth-(O+.5*g)<S&&(v+=S-(v-c.depth-(O+.5*g))),O-.5*g-(m.height-T)<S&&(T+=S-(O-.5*g-(m.height-T)));var _=-(O-.5*g);N=Xt({positionType:"individualShift",children:[{type:"elem",elem:m,shift:T},{type:"elem",elem:p,shift:_},{type:"elem",elem:c,shift:-v}]})}else{var R=v-c.depth-(m.height-T);R<S&&(v+=.5*(S-R),T+=.5*(S-R)),N=Xt({positionType:"individualShift",children:[{type:"elem",elem:m,shift:T},{type:"elem",elem:c,shift:-v}]})}o=t.havingStyle(n),N.height*=o.sizeMultiplier/t.sizeMultiplier,N.depth*=o.sizeMultiplier/t.sizeMultiplier;var P;n.size===xt.DISPLAY.size?P=t.fontMetrics().delim1:n.size===xt.SCRIPTSCRIPT.size?P=t.havingStyle(xt.SCRIPT).fontMetrics().delim2:P=t.fontMetrics().delim2;var U,A;return e.leftDelim==null?U=Vl(t,["mopen"]):U=v1(e.leftDelim,P,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?A=_e([]):e.rightDelim==null?A=Vl(t,["mclose"]):A=v1(e.rightDelim,P,!0,t.havingStyle(n),e.mode,["mclose"]),_e(["mord"].concat(o.sizingClasses(t)),[U,_e(["mfrac"],[N]),A],t)},XI=(e,t)=>{var n=new Le("mfrac",[dn(e.numer,t),dn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=En(e.barSize,t);n.setAttribute("linethickness",qe(a))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var o=new Le("mo",[new Un(e.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(n),e.rightDelim!=null){var c=new Le("mo",[new Un(e.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),s.push(c)}return pp(s)}return n},m7=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Ge({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0],o=t[1],c,d=null,h=null;switch(a){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,d="(",h=")";break;case"\\\\bracefrac":c=!1,d="\\{",h="\\}";break;case"\\\\brackfrac":c=!1,d="[",h="]";break;default:throw new Error("Unrecognized genfrac command")}var m=a==="\\cfrac",p=null;return m||a.startsWith("\\d")?p="display":a.startsWith("\\t")&&(p="text"),m7({type:"genfrac",mode:n.mode,numer:s,denom:o,continued:m,hasBarLine:c,leftDelim:d,rightDelim:h,barSize:null},p)},htmlBuilder:ZI,mathmlBuilder:XI});Ge({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:s,token:a}}});var Kv=["display","text","script","scriptscript"],Yv=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Ge({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,a=t[4],s=t[5],o=ud(t[0]),c=o.type==="atom"&&o.family==="open"?Yv(o.text):null,d=ud(t[1]),h=d.type==="atom"&&d.family==="close"?Yv(d.text):null,m=It(t[2],"size"),p,g=null;m.isBlank?p=!0:(g=m.value,p=g.number>0);var x=null,v=t[3];if(v.type==="ordgroup"){if(v.body.length>0){var S=It(v.body[0],"textord");x=Kv[Number(S.text)]}}else v=It(v,"textord"),x=Kv[Number(v.text)];return m7({type:"genfrac",mode:n.mode,numer:a,denom:s,continued:!1,hasBarLine:p,barSize:g,leftDelim:c,rightDelim:h},x)}});Ge({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:s}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:It(t[0],"size").value,token:s}}});Ge({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0],o=It(t[1],"infix").size;if(!o)throw new Error("\\\\abovefrac expected size, but got "+String(o));var c=t[2],d=o.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:c,continued:!1,hasBarLine:d,barSize:o,leftDelim:null,rightDelim:null}}});var p7=(e,t)=>{var n=t.style,a,s;e.type==="supsub"?(a=e.sup?Qt(e.sup,t.havingStyle(n.sup()),t):Qt(e.sub,t.havingStyle(n.sub()),t),s=It(e.base,"horizBrace")):s=It(e,"horizBrace");var o=Qt(s.base,t.havingBaseStyle(xt.DISPLAY)),c=Cd(s,t),d;if(s.isOver?d=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:c,wrapperClasses:["svg-align"]}]}):d=Xt({positionType:"bottom",positionData:o.depth+.1+c.height,children:[{type:"elem",elem:c,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:o}]}),a){var h=_e(["minner",s.isOver?"mover":"munder"],[d],t);s.isOver?d=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:.2},{type:"elem",elem:a}]}):d=Xt({positionType:"bottom",positionData:h.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:h}]})}return _e(["minner",s.isOver?"mover":"munder"],[d],t)},QI=(e,t)=>{var n=Td(e.label);return new Le(e.isOver?"mover":"munder",[dn(e.base,t),n])};Ge({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"horizBrace",mode:n.mode,label:a,isOver:a.includes("\\over"),base:t[0]}},htmlBuilder:p7,mathmlBuilder:QI});Ge({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],s=It(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Hn(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Yn(e.body,t,!1);return dI(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Yi(e.body,t);return n instanceof Le||(n=new Le("mrow",[n])),n.setAttribute("href",e.href),n}});Ge({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=It(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var s=[],o=0;o<a.length;o++){var c=a[o];c==="~"&&(c="\\textasciitilde"),s.push({type:"textord",mode:"text",text:c})}var d={type:"text",mode:n.mode,font:"\\texttt",body:s};return{type:"href",mode:n.mode,href:a,body:Hn(d)}}});Ge({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Hn(t[0])}},htmlBuilder(e,t){var n=Yn(e.body,t.withFont(""),!1);return ci(n)},mathmlBuilder(e,t){return new Le("mrow",Vr(e.body,t.withFont("")))}});Ge({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,token:s}=e,o=It(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var d,h={};switch(a){case"\\htmlClass":h.class=o,d={command:"\\htmlClass",class:o};break;case"\\htmlId":h.id=o,d={command:"\\htmlId",id:o};break;case"\\htmlStyle":h.style=o,d={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var m=o.split(","),p=0;p<m.length;p++){var g=m[p],x=g.indexOf("=");if(x<0)throw new Oe("\\htmlData key/value '"+g+"' missing equals sign");var v=g.slice(0,x),S=g.slice(x+1);h["data-"+v.trim()]=S}d={command:"\\htmlData",attributes:h};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(d)?{type:"html",mode:n.mode,attributes:h,body:Hn(c)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var n=Yn(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var s=_e(a,n,t);for(var o in e.attributes)o!=="class"&&e.attributes.hasOwnProperty(o)&&s.setAttribute(o,e.attributes[o]);return s},mathmlBuilder:(e,t)=>Yi(e.body,t)});Ge({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Hn(t[0]),mathml:Hn(t[1])}},htmlBuilder:(e,t)=>{var n=Yn(e.html,t,!1);return ci(n)},mathmlBuilder:(e,t)=>Yi(e.mathml,t)});var Ah=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Oe("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!_6(a))throw new Oe("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Ge({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,s={number:0,unit:"em"},o={number:.9,unit:"em"},c={number:0,unit:"em"},d="";if(n[0])for(var h=It(n[0],"raw").string,m=h.split(","),p=0;p<m.length;p++){var g=m[p].split("=");if(g.length===2){var x=g[1].trim();switch(g[0].trim()){case"alt":d=x;break;case"width":s=Ah(x);break;case"height":o=Ah(x);break;case"totalheight":c=Ah(x);break;default:throw new Oe("Invalid key: '"+g[0]+"' in \\includegraphics.")}}}var v=It(t[0],"url").url;return d===""&&(d=v,d=d.replace(/^.*[\\/]/,""),d=d.substring(0,d.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:v})?{type:"includegraphics",mode:a.mode,alt:d,width:s,height:o,totalheight:c,src:v}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=En(e.height,t),a=0;e.totalheight.number>0&&(a=En(e.totalheight,t)-n);var s=0;e.width.number>0&&(s=En(e.width,t));var o={height:qe(n+a)};s>0&&(o.width=qe(s)),a>0&&(o.verticalAlign=qe(-a));var c=new eI(e.src,e.alt,o);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new Le("mglyph",[]);n.setAttribute("alt",e.alt);var a=En(e.height,t),s=0;if(e.totalheight.number>0&&(s=En(e.totalheight,t)-a,n.setAttribute("valign",qe(-s))),n.setAttribute("height",qe(a+s)),e.width.number>0){var o=En(e.width,t);n.setAttribute("width",qe(o))}return n.setAttribute("src",e.src),n}});Ge({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,s=It(t[0],"size");if(n.settings.strict){var o=a[1]==="m",c=s.value.unit==="mu";o?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(e,t){return B6(e.dimension,t)},mathmlBuilder(e,t){var n=En(e.dimension,t);return new P6(n)}});Ge({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:s}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=_e([],[Qt(e.body,t)]),n=_e(["inner"],[n],t)):n=_e(["inner"],[Qt(e.body,t)]);var a=_e(["fix"],[]),s=_e([e.alignment],[n,a],t),o=_e(["strut"]);return o.style.height=qe(s.height+s.depth),s.depth&&(o.style.verticalAlign=qe(-s.depth)),s.children.unshift(o),s=_e(["thinbox"],[s],t),_e(["mord","vbox"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Le("mpadded",[dn(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});Ge({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,s=a.mode;a.switchMode("math");var o=n==="\\("?"\\)":"$",c=a.parseExpression(!1,o);return a.expect(o),a.switchMode(s),{type:"styling",mode:a.mode,style:"text",resetFont:!0,body:c}}});Ge({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Oe("Mismatched "+e.funcName)}});var Wv=(e,t)=>{switch(t.style.size){case xt.DISPLAY.size:return e.display;case xt.TEXT.size:return e.text;case xt.SCRIPT.size:return e.script;case xt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ge({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Hn(t[0]),text:Hn(t[1]),script:Hn(t[2]),scriptscript:Hn(t[3])}},htmlBuilder:(e,t)=>{var n=Wv(e,t),a=Yn(n,t,!1);return ci(a)},mathmlBuilder:(e,t)=>{var n=Wv(e,t);return Yi(n,t)}});var g7=(e,t,n,a,s,o,c)=>{e=_e([],[e]);var d=n&&oi(n),h,m;if(t){var p=Qt(t,a.havingStyle(s.sup()),a);m={elem:p,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-p.depth)}}if(n){var g=Qt(n,a.havingStyle(s.sub()),a);h={elem:g,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-g.height)}}var x;if(m&&h){var v=a.fontMetrics().bigOpSpacing5+h.elem.height+h.elem.depth+h.kern+e.depth+c;x=Xt({positionType:"bottom",positionData:v,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:qe(-o)},{type:"kern",size:h.kern},{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:qe(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else if(h){var S=e.height-c;x=Xt({positionType:"top",positionData:S,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:qe(-o)},{type:"kern",size:h.kern},{type:"elem",elem:e}]})}else if(m){var T=e.depth+c;x=Xt({positionType:"bottom",positionData:T,children:[{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:qe(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else return e;var N=[x];if(h&&o!==0&&!d){var R=_e(["mspace"],[],a);R.style.marginRight=qe(o),N.unshift(R)}return _e(["mop","op-limits"],N,a)},b7=new Set(["\\smallint"]),No=(e,t)=>{var n,a,s=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=It(e.base,"op"),s=!0):o=It(e,"op");var c=t.style,d=!1;c.size===xt.DISPLAY.size&&o.symbol&&!b7.has(o.name)&&(d=!0);var h,m;if(o.symbol){var p=d?"Size2-Regular":"Size1-Regular",g="";if((o.name==="\\oiint"||o.name==="\\oiiint")&&(g=o.name.slice(1),o.name=g==="oiint"?"\\iint":"\\iiint"),h=pr(o.name,p,"math",t,["mop","op-symbol",d?"large-op":"small-op"]),m=h.italic,g.length>0){var x=H6(g+"Size"+(d?"2":"1"),t);h=Xt({positionType:"individualShift",children:[{type:"elem",elem:h,shift:0},{type:"elem",elem:x,shift:d?.08:0}]}),o.name="\\"+g,h.classes.unshift("mop"),h.italic=m}}else if(o.body){var v=Yn(o.body,t,!0);v.length===1&&v[0]instanceof Pr?(h=v[0],h.classes[0]="mop"):h=_e(["mop"],v,t)}else{for(var S=[],T=1;T<o.name.length;T++)S.push(hp(o.name[T],o.mode,t));h=_e(["mop"],S,t)}var N=0,R=0;if((h instanceof Pr||o.name==="\\oiint"||o.name==="\\oiiint")&&!o.suppressBaseShift){var O;N=(h.height-h.depth)/2-t.fontMetrics().axisHeight,R=(O=h.italic)!=null?O:0}return s?g7(h,n,a,t,c,R,N):(N&&(h.style.position="relative",h.style.top=qe(N)),h)},ac=(e,t)=>{var n;if(e.symbol)n=new Le("mo",[sa(e.name,e.mode)]),b7.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Le("mo",Vr(e.body,t));else{n=new Le("mi",[new Un(e.name.slice(1))]);var a=new Le("mo",[sa("⁡","text")]);e.parentIsSupSub?n=new Le("mrow",[n,a]):n=$6([n,a])}return n},JI={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ge({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=a;return s.length===1&&(s=JI[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:No,mathmlBuilder:ac});Ge({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Hn(a)}},htmlBuilder:No,mathmlBuilder:ac});var e_={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ge({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:No,mathmlBuilder:ac});Ge({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:No,mathmlBuilder:ac});Ge({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,a=n;return a.length===1&&(a=e_[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:No,mathmlBuilder:ac});var v7=(e,t)=>{var n,a,s=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=It(e.base,"operatorname"),s=!0):o=It(e,"operatorname");var c;if(o.body.length>0){for(var d=o.body.map(g=>{var x="text"in g?g.text:void 0;return typeof x=="string"?{type:"textord",mode:g.mode,text:x}:g}),h=Yn(d,t.withFont("mathrm"),!0),m=0;m<h.length;m++){var p=h[m];p instanceof Pr&&(p.text=p.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}c=_e(["mop"],h,t)}else c=_e(["mop"],[],t);return s?g7(c,n,a,t,t.style,0,0):c},t_=(e,t)=>{for(var n=Vr(e.body,t.withFont("mathrm")),a=!0,s=0;s<n.length;s++){var o=n[s];if(!(o instanceof P6))if(o instanceof Le)switch(o.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var c=o.children[0];o.children.length===1&&c instanceof Un?c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var d=n.map(p=>p.toText()).join("");n=[new Un(d)]}var h=new Le("mi",n);h.setAttribute("mathvariant","normal");var m=new Le("mo",[sa("⁡","text")]);return e.parentIsSupSub?new Le("mrow",[h,m]):$6([h,m])};Ge({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"operatorname",mode:n.mode,body:Hn(s),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:v7,mathmlBuilder:t_});B("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Is({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?ci(Yn(e.body,t,!1)):_e(["mord"],Yn(e.body,t,!0),t)},mathmlBuilder(e,t){return Yi(e.body,t,!0)}});Ge({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,a=t[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(e,t){var n=Qt(e.body,t.havingCrampedStyle()),a=yo("overline-line",t),s=t.fontMetrics().defaultRuleThickness,o=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:a},{type:"kern",size:s}]});return _e(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new Le("mo",[new Un("‾")]);n.setAttribute("stretchy","true");var a=new Le("mover",[dn(e.body,t),n]);return a.setAttribute("accent","true"),a}});Ge({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"phantom",mode:n.mode,body:Hn(a)}},htmlBuilder:(e,t)=>{var n=Yn(e.body,t.withPhantom(),!1);return ci(n)},mathmlBuilder:(e,t)=>{var n=Vr(e.body,t);return new Le("mphantom",n)}});B("\\hphantom","\\smash{\\phantom{#1}}");Ge({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=_e(["inner"],[Qt(e.body,t.withPhantom())]),a=_e(["fix"],[]);return _e(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=Vr(Hn(e.body),t),a=new Le("mphantom",n),s=new Le("mpadded",[a]);return s.setAttribute("width","0px"),s}});Ge({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=It(t[0],"size").value,s=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:s}},htmlBuilder(e,t){var n=Qt(e.body,t),a=En(e.dy,t);return Xt({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Le("mpadded",[dn(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});Ge({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ge({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:a}=e,s=n[0],o=It(t[0],"size"),c=It(t[1],"size");return{type:"rule",mode:a.mode,shift:s&&It(s,"size").value,width:o.value,height:c.value}},htmlBuilder(e,t){var n=_e(["mord","rule"],[],t),a=En(e.width,t),s=En(e.height,t),o=e.shift?En(e.shift,t):0;return n.style.borderRightWidth=qe(a),n.style.borderTopWidth=qe(s),n.style.bottom=qe(o),n.width=a,n.height=s+o,n.depth=-o,n.maxFontSize=s*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=En(e.width,t),a=En(e.height,t),s=e.shift?En(e.shift,t):0,o=t.color&&t.getColor()||"black",c=new Le("mspace");c.setAttribute("mathbackground",o),c.setAttribute("width",qe(n)),c.setAttribute("height",qe(a));var d=new Le("mpadded",[c]);return s>=0?d.setAttribute("height",qe(s)):(d.setAttribute("height",qe(s)),d.setAttribute("depth",qe(-s))),d.setAttribute("voffset",qe(s)),d}});function y7(e,t,n){for(var a=Yn(e,t,!1),s=t.sizeMultiplier/n.sizeMultiplier,o=0;o<a.length;o++){var c=a[o].classes.indexOf("sizing");c<0?Array.prototype.push.apply(a[o].classes,t.sizingClasses(n)):a[o].classes[c+1]==="reset-size"+t.size&&(a[o].classes[c+1]="reset-size"+n.size),a[o].height*=s,a[o].depth*=s}return ci(a)}var Zv=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],n_=(e,t)=>{var n=t.havingSize(e.size);return y7(e.body,n,t)};Ge({type:"sizing",names:Zv,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:s}=e,o=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:Zv.indexOf(a)+1,body:o}},htmlBuilder:n_,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=Vr(e.body,n),s=new Le("mstyle",a);return s.setAttribute("mathsize",qe(n.sizeMultiplier)),s}});Ge({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,s=!1,o=!1,c=n[0]&&It(n[0],"ordgroup");if(c)for(var d,h=0;h<c.body.length;++h){var m=c.body[h];if(d=Rd(m).text,d==="t")s=!0;else if(d==="b")o=!0;else{s=!1,o=!1;break}}else s=!0,o=!0;var p=t[0];return{type:"smash",mode:a.mode,body:p,smashHeight:s,smashDepth:o}},htmlBuilder:(e,t)=>{var n=_e([],[Qt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return _e(["mord","smash"],[n],t);if(n.children)for(var a=0;a<n.children.length;a++)e.smashHeight&&(n.children[a].height=0),e.smashDepth&&(n.children[a].depth=0);var s=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return _e(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Le("mpadded",[dn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Ge({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,s=n[0],o=t[0];return{type:"sqrt",mode:a.mode,body:o,index:s}},htmlBuilder(e,t){var n=Qt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=xo(n,t);var a=t.fontMetrics(),s=a.defaultRuleThickness,o=s;t.style.id<xt.TEXT.id&&(o=t.fontMetrics().xHeight);var c=s+o/4,d=n.height+n.depth+c+s,{span:h,ruleWidth:m,advanceWidth:p}=FI(d,t),g=h.height-m;g>n.height+n.depth+c&&(c=(c+g-n.height-n.depth)/2);var x=h.height-n.height-c-m;n.style.paddingLeft=qe(p);var v=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+x)},{type:"elem",elem:h},{type:"kern",size:m}]});if(e.index){var S=t.havingStyle(xt.SCRIPTSCRIPT),T=Qt(e.index,S,t),N=.6*(v.height-v.depth),R=Xt({positionType:"shift",positionData:-N,children:[{type:"elem",elem:T}]}),O=_e(["root"],[R]);return _e(["mord","sqrt"],[O,v],t)}else return _e(["mord","sqrt"],[v],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new Le("mroot",[dn(n,t),dn(a,t)]):new Le("msqrt",[dn(n,t)])}});var y1={display:xt.DISPLAY,text:xt.TEXT,script:xt.SCRIPT,scriptscript:xt.SCRIPTSCRIPT};function r_(e){return e in y1}Ge({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:s}=e,o=s.parseExpression(!0,n),c=a.slice(1,a.length-5);if(!r_(c))throw new Error("Unknown style: "+c);return{type:"styling",mode:s.mode,style:c,body:o}},htmlBuilder(e,t){var n=y1[e.style],a=t.havingStyle(n);return e.resetFont&&(a=a.withFont("")),y7(e.body,a,t)},mathmlBuilder(e,t){var n=y1[e.style],a=t.havingStyle(n);e.resetFont&&(a=a.withFont(""));var s=Vr(e.body,a),o=new Le("mstyle",s),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},d=c[e.style];return o.setAttribute("scriptlevel",d[0]),o.setAttribute("displaystyle",d[1]),o}});var a_=function(t,n){var a=t.base;if(a)if(a.type==="op"){var s=a.limits&&(n.style.size===xt.DISPLAY.size||a.alwaysHandleSupSub);return s?No:null}else if(a.type==="operatorname"){var o=a.alwaysHandleSupSub&&(n.style.size===xt.DISPLAY.size||a.limits);return o?v7:null}else{if(a.type==="accent")return oi(a.base)?bp:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?p7:null}else return null}else return null};Is({type:"supsub",htmlBuilder(e,t){var n=a_(e,t);if(n)return n(e,t);var{base:a,sup:s,sub:o}=e,c=Qt(a,t),d,h,m=t.fontMetrics(),p=0,g=0,x=a&&oi(a);if(s){var v=t.havingStyle(t.style.sup());d=Qt(s,v,t),x||(p=c.height-v.fontMetrics().supDrop*v.sizeMultiplier/t.sizeMultiplier)}if(o){var S=t.havingStyle(t.style.sub());h=Qt(o,S,t),x||(g=c.depth+S.fontMetrics().subDrop*S.sizeMultiplier/t.sizeMultiplier)}var T;t.style===xt.DISPLAY?T=m.sup1:t.style.cramped?T=m.sup3:T=m.sup2;var N=t.sizeMultiplier,R=qe(.5/m.ptPerEm/N),O=null;if(h){var _=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(c instanceof Pr||_){var P;O=qe(-((P=c.italic)!=null?P:0))}}var U;if(d&&h){p=Math.max(p,T,d.depth+.25*m.xHeight),g=Math.max(g,m.sub2);var A=m.defaultRuleThickness,z=4*A;if(p-d.depth-(h.height-g)<z){g=z-(p-d.depth)+h.height;var X=.8*m.xHeight-(p-d.depth);X>0&&(p+=X,g-=X)}var H=[{type:"elem",elem:h,shift:g,marginRight:R,marginLeft:O},{type:"elem",elem:d,shift:-p,marginRight:R}];U=Xt({positionType:"individualShift",children:H})}else if(h){g=Math.max(g,m.sub1,h.height-.8*m.xHeight);var $=[{type:"elem",elem:h,marginLeft:O,marginRight:R}];U=Xt({positionType:"shift",positionData:g,children:$})}else if(d)p=Math.max(p,T,d.depth+.25*m.xHeight),U=Xt({positionType:"shift",positionData:-p,children:[{type:"elem",elem:d,marginRight:R}]});else throw new Error("supsub must have either sup or sub.");var F=m1(c,"right")||"mord";return _e([F],[c,_e(["msupsub"],[U])],t)},mathmlBuilder(e,t){var n=!1,a,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(n=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var o=[dn(e.base,t)];e.sub&&o.push(dn(e.sub,t)),e.sup&&o.push(dn(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var m=e.base;m&&m.type==="op"&&m.limits&&t.style===xt.DISPLAY||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(t.style===xt.DISPLAY||m.limits)?c="munderover":c="msubsup"}else{var h=e.base;h&&h.type==="op"&&h.limits&&(t.style===xt.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||t.style===xt.DISPLAY)?c="munder":c="msub"}else{var d=e.base;d&&d.type==="op"&&d.limits&&(t.style===xt.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||t.style===xt.DISPLAY)?c="mover":c="msup"}return new Le(c,o)}});Is({type:"atom",htmlBuilder(e,t){return hp(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Le("mo",[sa(e.text,e.mode)]);if(e.family==="bin"){var a=gp(e,t);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var x7={mi:"italic",mn:"normal",mtext:"normal"};Is({type:"mathord",htmlBuilder(e,t){return Ed(e,t,"mathord")},mathmlBuilder(e,t){var n=new Le("mi",[sa(e.text,e.mode,t)]),a=gp(e,t)||"italic";return a!==x7[n.type]&&n.setAttribute("mathvariant",a),n}});Is({type:"textord",htmlBuilder(e,t){return Ed(e,t,"textord")},mathmlBuilder(e,t){var n=sa(e.text,e.mode,t),a=gp(e,t)||"normal",s;return e.mode==="text"?s=new Le("mtext",[n]):/[0-9]/.test(e.text)?s=new Le("mn",[n]):e.text==="\\prime"?s=new Le("mo",[n]):s=new Le("mi",[n]),a!==x7[s.type]&&s.setAttribute("mathvariant",a),s}});var Ih={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},_h={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Is({type:"spacing",htmlBuilder(e,t){if(_h.hasOwnProperty(e.text)){var n=_h[e.text].className||"";if(e.mode==="text"){var a=Ed(e,t,"textord");return a.classes.push(n),a}else return _e(["mspace",n],[hp(e.text,e.mode,t)],t)}else{if(Ih.hasOwnProperty(e.text))return _e(["mspace",Ih[e.text]],[],t);throw new Oe('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(_h.hasOwnProperty(e.text))n=new Le("mtext",[new Un(" ")]);else{if(Ih.hasOwnProperty(e.text))return new Le("mspace");throw new Oe('Unknown type of space "'+e.text+'"')}return n}});var Xv=()=>{var e=new Le("mtd",[]);return e.setAttribute("width","50%"),e};Is({type:"tag",mathmlBuilder(e,t){var n=new Le("mtable",[new Le("mtr",[Xv(),new Le("mtd",[Yi(e.body,t)]),Xv(),new Le("mtd",[Yi(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Qv={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Jv={"\\textbf":"textbf","\\textmd":"textmd"},i_={"\\textit":"textit","\\textup":"textup"},ey=(e,t)=>{var n=e.font;if(n){if(Qv[n])return t.withTextFontFamily(Qv[n]);if(Jv[n])return t.withTextFontWeight(Jv[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(i_[n])};Ge({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"text",mode:n.mode,body:Hn(s),font:a}},htmlBuilder(e,t){var n=ey(e,t),a=Yn(e.body,n,!0);return _e(["mord","text"],a,n)},mathmlBuilder(e,t){var n=ey(e,t);return Yi(e.body,n)}});Ge({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Qt(e.body,t),a=yo("underline-line",t),s=t.fontMetrics().defaultRuleThickness,o=Xt({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:a},{type:"kern",size:3*s},{type:"elem",elem:n}]});return _e(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new Le("mo",[new Un("‾")]);n.setAttribute("stretchy","true");var a=new Le("munder",[dn(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});Ge({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Qt(e.body,t),a=t.fontMetrics().axisHeight,s=.5*(n.height-a-(n.depth+a));return Xt({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Le("mpadded",[dn(e.body,t)],["vcenter"]);return new Le("mrow",[n])}});Ge({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Oe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=ty(e),a=[],s=t.havingStyle(t.style.text()),o=0;o<n.length;o++){var c=n[o];c==="~"&&(c="\\textasciitilde"),a.push(pr(c,"Typewriter-Regular",e.mode,s,["mord","texttt"]))}return _e(["mord","text"].concat(s.sizingClasses(t)),z6(a),s)},mathmlBuilder(e,t){var n=new Un(ty(e)),a=new Le("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var ty=e=>e.body.replace(/ /g,e.star?"␣":" "),Fi=U6,w7=`[ \r
303
- ]`,s_="\\\\[a-zA-Z@]+",o_="\\\\[^\uD800-\uDFFF]",l_="("+s_+")"+w7+"*",c_=`\\\\(
304
- |[ \r ]+
305
- ?)[ \r ]*`,x1="[̀-ͯ]",u_=new RegExp(x1+"+$"),d_="("+w7+"+)|"+(c_+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(x1+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(x1+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+l_)+("|"+o_+")");class ny{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(d_,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new $r("EOF",new Ar(this,n,n));var a=this.tokenRegex.exec(t);if(a===null||a.index!==n)throw new Oe("Unexpected character: '"+t[n]+"'",new $r(t[n],new Ar(this,n,n+1)));var s=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[s]===14){var o=t.indexOf(`
306
- `,this.tokenRegex.lastIndex);return o===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new $r(s,new Ar(this,n,this.tokenRegex.lastIndex))}}class f_{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Oe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,a){if(a===void 0&&(a=!1),a){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(t)&&(o[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var h_=u7;B("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});B("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});B("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});B("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});B("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});B("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");B("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var ry={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};B("\\char",function(e){var t=e.popToken(),n,a=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")a=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Oe("\\char` missing argument");a=t.text.charCodeAt(0)}else n=10;if(n){if(a=ry[t.text],a==null||a>=n)throw new Oe("Invalid base-"+n+" digit "+t.text);for(var s;(s=ry[e.future().text])!=null&&s<n;)a*=n,a+=s,e.popToken()}return"\\@char{"+a+"}"});var wp=(e,t,n,a)=>{var s=e.consumeArg().tokens;if(s.length!==1)throw new Oe("\\newcommand's first argument must be a macro name");var o=s[0].text,c=e.isDefined(o);if(c&&!t)throw new Oe("\\newcommand{"+o+"} attempting to redefine "+(o+"; use \\renewcommand"));if(!c&&!n)throw new Oe("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var d=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var h="",m=e.expandNextToken();m.text!=="]"&&m.text!=="EOF";)h+=m.text,m=e.expandNextToken();if(!h.match(/^\s*[0-9]+\s*$/))throw new Oe("Invalid number of arguments: "+h);d=parseInt(h),s=e.consumeArg().tokens}return c&&a||e.macros.set(o,{tokens:s,numArgs:d}),""};B("\\newcommand",e=>wp(e,!1,!0,!1));B("\\renewcommand",e=>wp(e,!0,!1,!1));B("\\providecommand",e=>wp(e,!0,!0,!0));B("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});B("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});B("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Fi[n],vn.math[n],vn.text[n]),""});B("\\bgroup","{");B("\\egroup","}");B("~","\\nobreakspace");B("\\lq","`");B("\\rq","'");B("\\aa","\\r a");B("\\AA","\\r A");B("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");B("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");B("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");B("ℬ","\\mathscr{B}");B("ℰ","\\mathscr{E}");B("ℱ","\\mathscr{F}");B("ℋ","\\mathscr{H}");B("ℐ","\\mathscr{I}");B("ℒ","\\mathscr{L}");B("ℳ","\\mathscr{M}");B("ℛ","\\mathscr{R}");B("ℭ","\\mathfrak{C}");B("ℌ","\\mathfrak{H}");B("ℨ","\\mathfrak{Z}");B("\\Bbbk","\\Bbb{k}");B("\\llap","\\mathllap{\\textrm{#1}}");B("\\rlap","\\mathrlap{\\textrm{#1}}");B("\\clap","\\mathclap{\\textrm{#1}}");B("\\mathstrut","\\vphantom{(}");B("\\underbar","\\underline{\\text{#1}}");B("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');B("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");B("\\ne","\\neq");B("≠","\\neq");B("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");B("∉","\\notin");B("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");B("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");B("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");B("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");B("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");B("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");B("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");B("⟂","\\perp");B("‼","\\mathclose{!\\mkern-0.8mu!}");B("∌","\\notni");B("⌜","\\ulcorner");B("⌝","\\urcorner");B("⌞","\\llcorner");B("⌟","\\lrcorner");B("©","\\copyright");B("®","\\textregistered");B("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');B("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');B("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');B("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');B("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");B("⋮","\\vdots");B("\\varGamma","\\mathit{\\Gamma}");B("\\varDelta","\\mathit{\\Delta}");B("\\varTheta","\\mathit{\\Theta}");B("\\varLambda","\\mathit{\\Lambda}");B("\\varXi","\\mathit{\\Xi}");B("\\varPi","\\mathit{\\Pi}");B("\\varSigma","\\mathit{\\Sigma}");B("\\varUpsilon","\\mathit{\\Upsilon}");B("\\varPhi","\\mathit{\\Phi}");B("\\varPsi","\\mathit{\\Psi}");B("\\varOmega","\\mathit{\\Omega}");B("\\substack","\\begin{subarray}{c}#1\\end{subarray}");B("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");B("\\boxed","\\fbox{$\\displaystyle{#1}$}");B("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");B("\\implies","\\DOTSB\\;\\Longrightarrow\\;");B("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");B("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");B("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var ay={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},m_=new Set(["bin","rel"]);B("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in ay?t=ay[n]:(n.slice(0,4)==="\\not"||n in vn.math&&m_.has(vn.math[n].group))&&(t="\\dotsb"),t});var kp={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};B("\\dotso",function(e){var t=e.future().text;return t in kp?"\\ldots\\,":"\\ldots"});B("\\dotsc",function(e){var t=e.future().text;return t in kp&&t!==","?"\\ldots\\,":"\\ldots"});B("\\cdots",function(e){var t=e.future().text;return t in kp?"\\@cdots\\,":"\\@cdots"});B("\\dotsb","\\cdots");B("\\dotsm","\\cdots");B("\\dotsi","\\!\\cdots");B("\\dotsx","\\ldots\\,");B("\\DOTSI","\\relax");B("\\DOTSB","\\relax");B("\\DOTSX","\\relax");B("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");B("\\,","\\tmspace+{3mu}{.1667em}");B("\\thinspace","\\,");B("\\>","\\mskip{4mu}");B("\\:","\\tmspace+{4mu}{.2222em}");B("\\medspace","\\:");B("\\;","\\tmspace+{5mu}{.2777em}");B("\\thickspace","\\;");B("\\!","\\tmspace-{3mu}{.1667em}");B("\\negthinspace","\\!");B("\\negmedspace","\\tmspace-{4mu}{.2222em}");B("\\negthickspace","\\tmspace-{5mu}{.277em}");B("\\enspace","\\kern.5em ");B("\\enskip","\\hskip.5em\\relax");B("\\quad","\\hskip1em\\relax");B("\\qquad","\\hskip2em\\relax");B("\\tag","\\@ifstar\\tag@literal\\tag@paren");B("\\tag@paren","\\tag@literal{({#1})}");B("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Oe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});B("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");B("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");B("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");B("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");B("\\newline","\\\\\\relax");B("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var k7=qe(Na["Main-Regular"][84][1]-.7*Na["Main-Regular"][65][1]);B("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+k7+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");B("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+k7+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");B("\\hspace","\\@ifstar\\@hspacer\\@hspace");B("\\@hspace","\\hskip #1\\relax");B("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");B("\\ordinarycolon",":");B("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");B("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');B("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');B("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');B("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');B("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');B("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');B("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');B("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');B("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');B("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');B("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');B("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');B("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');B("∷","\\dblcolon");B("∹","\\eqcolon");B("≔","\\coloneqq");B("≕","\\eqqcolon");B("⩴","\\Coloneqq");B("\\ratio","\\vcentcolon");B("\\coloncolon","\\dblcolon");B("\\colonequals","\\coloneqq");B("\\coloncolonequals","\\Coloneqq");B("\\equalscolon","\\eqqcolon");B("\\equalscoloncolon","\\Eqqcolon");B("\\colonminus","\\coloneq");B("\\coloncolonminus","\\Coloneq");B("\\minuscolon","\\eqcolon");B("\\minuscoloncolon","\\Eqcolon");B("\\coloncolonapprox","\\Colonapprox");B("\\coloncolonsim","\\Colonsim");B("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");B("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");B("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");B("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");B("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");B("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");B("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");B("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");B("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");B("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");B("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");B("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");B("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");B("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");B("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");B("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");B("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");B("\\nleqq","\\html@mathml{\\@nleqq}{≰}");B("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");B("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");B("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");B("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");B("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");B("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");B("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");B("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");B("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");B("\\imath","\\html@mathml{\\@imath}{ı}");B("\\jmath","\\html@mathml{\\@jmath}{ȷ}");B("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");B("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");B("⟦","\\llbracket");B("⟧","\\rrbracket");B("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");B("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");B("⦃","\\lBrace");B("⦄","\\rBrace");B("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");B("⦵","\\minuso");B("\\darr","\\downarrow");B("\\dArr","\\Downarrow");B("\\Darr","\\Downarrow");B("\\lang","\\langle");B("\\rang","\\rangle");B("\\uarr","\\uparrow");B("\\uArr","\\Uparrow");B("\\Uarr","\\Uparrow");B("\\N","\\mathbb{N}");B("\\R","\\mathbb{R}");B("\\Z","\\mathbb{Z}");B("\\alef","\\aleph");B("\\alefsym","\\aleph");B("\\Alpha","\\mathrm{A}");B("\\Beta","\\mathrm{B}");B("\\bull","\\bullet");B("\\Chi","\\mathrm{X}");B("\\clubs","\\clubsuit");B("\\cnums","\\mathbb{C}");B("\\Complex","\\mathbb{C}");B("\\Dagger","\\ddagger");B("\\diamonds","\\diamondsuit");B("\\empty","\\emptyset");B("\\Epsilon","\\mathrm{E}");B("\\Eta","\\mathrm{H}");B("\\exist","\\exists");B("\\harr","\\leftrightarrow");B("\\hArr","\\Leftrightarrow");B("\\Harr","\\Leftrightarrow");B("\\hearts","\\heartsuit");B("\\image","\\Im");B("\\infin","\\infty");B("\\Iota","\\mathrm{I}");B("\\isin","\\in");B("\\Kappa","\\mathrm{K}");B("\\larr","\\leftarrow");B("\\lArr","\\Leftarrow");B("\\Larr","\\Leftarrow");B("\\lrarr","\\leftrightarrow");B("\\lrArr","\\Leftrightarrow");B("\\Lrarr","\\Leftrightarrow");B("\\Mu","\\mathrm{M}");B("\\natnums","\\mathbb{N}");B("\\Nu","\\mathrm{N}");B("\\Omicron","\\mathrm{O}");B("\\plusmn","\\pm");B("\\rarr","\\rightarrow");B("\\rArr","\\Rightarrow");B("\\Rarr","\\Rightarrow");B("\\real","\\Re");B("\\reals","\\mathbb{R}");B("\\Reals","\\mathbb{R}");B("\\Rho","\\mathrm{P}");B("\\sdot","\\cdot");B("\\sect","\\S");B("\\spades","\\spadesuit");B("\\sub","\\subset");B("\\sube","\\subseteq");B("\\supe","\\supseteq");B("\\Tau","\\mathrm{T}");B("\\thetasym","\\vartheta");B("\\weierp","\\wp");B("\\Zeta","\\mathrm{Z}");B("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");B("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");B("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");B("\\bra","\\mathinner{\\langle{#1}|}");B("\\ket","\\mathinner{|{#1}\\rangle}");B("\\braket","\\mathinner{\\langle{#1}\\rangle}");B("\\Bra","\\left\\langle#1\\right|");B("\\Ket","\\left|#1\\right\\rangle");var S7=e=>t=>{var n=t.consumeArg().tokens,a=t.consumeArg().tokens,s=t.consumeArg().tokens,o=t.consumeArg().tokens,c=t.macros.get("|"),d=t.macros.get("\\|");t.macros.beginGroup();var h=g=>x=>{e&&(x.macros.set("|",c),s.length&&x.macros.set("\\|",d));var v=g;if(!g&&s.length){var S=x.future();S.text==="|"&&(x.popToken(),v=!0)}return{tokens:v?s:a,numArgs:0}};t.macros.set("|",h(!1)),s.length&&t.macros.set("\\|",h(!0));var m=t.consumeArg().tokens,p=t.expandTokens([...o,...m,...n]);return t.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};B("\\bra@ket",S7(!1));B("\\bra@set",S7(!0));B("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");B("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");B("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");B("\\angln","{\\angl n}");B("\\blue","\\textcolor{##6495ed}{#1}");B("\\orange","\\textcolor{##ffa500}{#1}");B("\\pink","\\textcolor{##ff00af}{#1}");B("\\red","\\textcolor{##df0030}{#1}");B("\\green","\\textcolor{##28ae7b}{#1}");B("\\gray","\\textcolor{gray}{#1}");B("\\purple","\\textcolor{##9d38bd}{#1}");B("\\blueA","\\textcolor{##ccfaff}{#1}");B("\\blueB","\\textcolor{##80f6ff}{#1}");B("\\blueC","\\textcolor{##63d9ea}{#1}");B("\\blueD","\\textcolor{##11accd}{#1}");B("\\blueE","\\textcolor{##0c7f99}{#1}");B("\\tealA","\\textcolor{##94fff5}{#1}");B("\\tealB","\\textcolor{##26edd5}{#1}");B("\\tealC","\\textcolor{##01d1c1}{#1}");B("\\tealD","\\textcolor{##01a995}{#1}");B("\\tealE","\\textcolor{##208170}{#1}");B("\\greenA","\\textcolor{##b6ffb0}{#1}");B("\\greenB","\\textcolor{##8af281}{#1}");B("\\greenC","\\textcolor{##74cf70}{#1}");B("\\greenD","\\textcolor{##1fab54}{#1}");B("\\greenE","\\textcolor{##0d923f}{#1}");B("\\goldA","\\textcolor{##ffd0a9}{#1}");B("\\goldB","\\textcolor{##ffbb71}{#1}");B("\\goldC","\\textcolor{##ff9c39}{#1}");B("\\goldD","\\textcolor{##e07d10}{#1}");B("\\goldE","\\textcolor{##a75a05}{#1}");B("\\redA","\\textcolor{##fca9a9}{#1}");B("\\redB","\\textcolor{##ff8482}{#1}");B("\\redC","\\textcolor{##f9685d}{#1}");B("\\redD","\\textcolor{##e84d39}{#1}");B("\\redE","\\textcolor{##bc2612}{#1}");B("\\maroonA","\\textcolor{##ffbde0}{#1}");B("\\maroonB","\\textcolor{##ff92c6}{#1}");B("\\maroonC","\\textcolor{##ed5fa6}{#1}");B("\\maroonD","\\textcolor{##ca337c}{#1}");B("\\maroonE","\\textcolor{##9e034e}{#1}");B("\\purpleA","\\textcolor{##ddd7ff}{#1}");B("\\purpleB","\\textcolor{##c6b9fc}{#1}");B("\\purpleC","\\textcolor{##aa87ff}{#1}");B("\\purpleD","\\textcolor{##7854ab}{#1}");B("\\purpleE","\\textcolor{##543b78}{#1}");B("\\mintA","\\textcolor{##f5f9e8}{#1}");B("\\mintB","\\textcolor{##edf2df}{#1}");B("\\mintC","\\textcolor{##e0e5cc}{#1}");B("\\grayA","\\textcolor{##f6f7f7}{#1}");B("\\grayB","\\textcolor{##f0f1f2}{#1}");B("\\grayC","\\textcolor{##e3e5e6}{#1}");B("\\grayD","\\textcolor{##d6d8da}{#1}");B("\\grayE","\\textcolor{##babec2}{#1}");B("\\grayF","\\textcolor{##888d93}{#1}");B("\\grayG","\\textcolor{##626569}{#1}");B("\\grayH","\\textcolor{##3b3e40}{#1}");B("\\grayI","\\textcolor{##21242c}{#1}");B("\\kaBlue","\\textcolor{##314453}{#1}");B("\\kaGreen","\\textcolor{##71B307}{#1}");var E7={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class p_{constructor(t,n,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new f_(h_,n.macros),this.mode=a,this.stack=[]}feed(t){this.lexer=new ny(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,a,s;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:a}=this.consumeArg(["]"])}else({tokens:s,start:n,end:a}=this.consumeArg());return this.pushToken(new $r("EOF",a.loc)),this.pushTokens(s),new $r("",Ar.range(n,a))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],a=t&&t.length>0;a||this.consumeSpaces();var s=this.future(),o,c=0,d=0;do{if(o=this.popToken(),n.push(o),o.text==="{")++c;else if(o.text==="}"){if(--c,c===-1)throw new Oe("Extra }",o)}else if(o.text==="EOF")throw new Oe("Unexpected end of input in a macro argument, expected '"+(t&&a?t[d]:"}")+"'",o);if(t&&a)if((c===0||c===1&&t[d]==="{")&&o.text===t[d]){if(++d,d===t.length){n.splice(-d,d);break}}else d=0}while(c!==0||a);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:o}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Oe("The length of delimiters doesn't match the number of args!");for(var a=n[0],s=0;s<a.length;s++){var o=this.popToken();if(a[s]!==o.text)throw new Oe("Use of the macro doesn't match its definition",o)}}for(var c=[],d=0;d<t;d++)c.push(this.consumeArg(n&&n[d+1]).tokens);return c}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Oe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),a=n.text,s=n.noexpand?null:this._getExpansion(a);if(s==null||t&&s.unexpandable){if(t&&s==null&&a[0]==="\\"&&!this.isDefined(a))throw new Oe("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var o=s.tokens,c=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){o=o.slice();for(var d=o.length-1;d>=0;--d){var h=o[d];if(h.text==="#"){if(d===0)throw new Oe("Incomplete placeholder at end of macro body",h);if(h=o[--d],h.text==="#")o.splice(d+1,1);else if(/^[1-9]$/.test(h.text))o.splice(d,2,...c[+h.text-1]);else throw new Oe("Not a valid argument number",h)}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new $r(t)]):void 0}expandTokens(t){var n=[],a=this.stack.length;for(this.pushTokens(t);this.stack.length>a;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(a=>a.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var a=this.lexer.catcodes[t];if(a!=null&&a!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var o=0;if(s.includes("#"))for(var c=s.replace(/##/g,"");c.includes("#"+(o+1));)++o;for(var d=new ny(s,this.settings),h=[],m=d.lex();m.text!=="EOF";)h.push(m),m=d.lex();h.reverse();var p={tokens:h,numArgs:o};return p}return s}isDefined(t){return this.macros.has(t)||Fi.hasOwnProperty(t)||vn.math.hasOwnProperty(t)||vn.text.hasOwnProperty(t)||E7.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Fi.hasOwnProperty(t)&&!Fi[t].primitive}}var iy=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,_u=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Mh={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},sy={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Dd{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new p_(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Oe("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new $r("}")),this.gullet.pushTokens(t);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(t,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Dd.endOfExpression.has(s.text)||n&&s.text===n||t&&Fi[s.text]&&Fi[s.text].infix)break;var o=this.parseAtom(n);if(o){if(o.type==="internal")continue}else break;a.push(o)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(t){for(var n=-1,a,s=0;s<t.length;s++){var o=t[s];if(o.type==="infix"){if(n!==-1)throw new Oe("only one infix operator per group",o.token);n=s,a=o.replaceWith}}if(n!==-1&&a){var c,d,h=t.slice(0,n),m=t.slice(n+1);h.length===1&&h[0].type==="ordgroup"?c=h[0]:c={type:"ordgroup",mode:this.mode,body:h},m.length===1&&m[0].type==="ordgroup"?d=m[0]:d={type:"ordgroup",mode:this.mode,body:m};var p;return a==="\\\\abovefrac"?p=this.callFunction(a,[c,t[n],d],[]):p=this.callFunction(a,[c,d],[]),[p]}else return t}handleSupSubscript(t){var n=this.fetch(),a=n.text;this.consume(),this.consumeSpaces();var s;do{var o;s=this.parseGroup(t)}while(((o=s)==null?void 0:o.type)==="internal");if(!s)throw new Oe("Expected group after '"+a+"'",n);return s}formatUnsupportedCmd(t){for(var n=[],a=0;a<t.length;a++)n.push({type:"textord",mode:"text",text:t[a]});var s={type:"text",mode:this.mode,body:n},o={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return o}parseAtom(t){var n=this.parseGroup("atom",t);if(n?.type==="internal"||this.mode==="text")return n;for(var a,s;;){this.consumeSpaces();var o=this.fetch();if(o.text==="\\limits"||o.text==="\\nolimits"){if(n&&n.type==="op"){var c=o.text==="\\limits";n.limits=c,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=o.text==="\\limits");else throw new Oe("Limit controls must follow a math operator",o);this.consume()}else if(o.text==="^"){if(a)throw new Oe("Double superscript",o);a=this.handleSupSubscript("superscript")}else if(o.text==="_"){if(s)throw new Oe("Double subscript",o);s=this.handleSupSubscript("subscript")}else if(o.text==="'"){if(a)throw new Oe("Double superscript",o);var d={type:"textord",mode:this.mode,text:"\\prime"},h=[d];for(this.consume();this.fetch().text==="'";)h.push(d),this.consume();this.fetch().text==="^"&&h.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:h}}else if(_u[o.text]){var m=iy.test(o.text),p=[];for(p.push(new $r(_u[o.text])),this.consume();;){var g=this.fetch().text;if(!_u[g]||iy.test(g)!==m)break;p.unshift(new $r(_u[g])),this.consume()}var x=this.subparse(p);m?s={type:"ordgroup",mode:"math",body:x}:a={type:"ordgroup",mode:"math",body:x}}else break}return a||s?{type:"supsub",mode:this.mode,base:n,sup:a,sub:s}:n}parseFunction(t,n){var a=this.fetch(),s=a.text,o=Fi[s];if(!o)return null;if(this.consume(),n&&n!=="atom"&&!o.allowedInArgument)throw new Oe("Got function '"+s+"' with no arguments"+(n?" as "+n:""),a);if(this.mode==="text"&&!o.allowedInText)throw new Oe("Can't use function '"+s+"' in text mode",a);if(this.mode==="math"&&o.allowedInMath===!1)throw new Oe("Can't use function '"+s+"' in math mode",a);var{args:c,optArgs:d}=this.parseArguments(s,o);return this.callFunction(s,c,d,a,t)}callFunction(t,n,a,s,o){var c={funcName:t,parser:this,token:s,breakOnTokenText:o},d=Fi[t];if(d&&d.handler)return d.handler(c,n,a);throw new Oe("No function handler for "+t)}parseArguments(t,n){var a=n.numArgs+n.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var s=[],o=[],c=0;c<a;c++){var d=n.argTypes&&n.argTypes[c],h=c<n.numOptionalArgs;("primitive"in n&&n.primitive&&d==null||n.type==="sqrt"&&c===1&&o[0]==null)&&(d="primitive");var m=this.parseGroupOfType("argument to '"+t+"'",d,h);if(h)o.push(m);else if(m!=null)s.push(m);else throw new Oe("Null argument, please report this as a bug")}return{args:s,optArgs:o}}parseGroupOfType(t,n,a){switch(n){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,n);case"hbox":{var s=this.parseArgumentGroup(a,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text",resetFont:!0}:null}case"raw":{var o=this.parseStringGroup("raw",a);return o!=null?{type:"raw",mode:"text",string:o.text}:null}case"primitive":{if(a)throw new Oe("A primitive argument cannot be optional");var c=this.parseGroup(t);if(c==null)throw new Oe("Expected group as "+t,this.fetch());return c}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new Oe("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var a=this.gullet.scanArgument(n);if(a==null)return null;for(var s="",o;(o=this.fetch()).text!=="EOF";)s+=o.text,this.consume();return this.consume(),a.text=s,a}parseRegexGroup(t,n){for(var a=this.fetch(),s=a,o="",c;(c=this.fetch()).text!=="EOF"&&t.test(o+c.text);)s=c,o+=s.text,this.consume();if(o==="")throw new Oe("Invalid "+n+": '"+a.text+"'",a);return a.range(s,o)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!a)throw new Oe("Invalid color: '"+n.text+"'",n);var s=a[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(t){var n,a=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",a=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!s)throw new Oe("Invalid size: '"+n.text+"'",n);var o={number:+(s[1]+s[2]),unit:s[3]};if(!_6(o))throw new Oe("Invalid unit: '"+o.unit+"'",n);return{type:"size",mode:this.mode,value:o,isBlank:a}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var a=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(t,n){var a=this.gullet.scanArgument(t);if(a==null)return null;var s=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var c={type:"ordgroup",mode:this.mode,loc:a.loc,body:o};return n&&this.switchMode(s),c}parseGroup(t,n){var a=this.fetch(),s=a.text,o;if(s==="{"||s==="\\begingroup"){this.consume();var c=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var d=this.parseExpression(!1,c),h=this.fetch();this.expect(c),this.gullet.endGroup(),o={type:"ordgroup",mode:this.mode,loc:Ar.range(a,h),body:d,semisimple:s==="\\begingroup"||void 0}}else if(o=this.parseFunction(n,t)||this.parseSymbol(),o==null&&s[0]==="\\"&&!E7.hasOwnProperty(s)){if(this.settings.throwOnError)throw new Oe("Undefined control sequence: "+s,a);o=this.formatUnsupportedCmd(s),this.consume()}return o}formLigatures(t){for(var n=t.length-1,a=0;a<n;++a){var s=t[a];if(s.type==="textord"){var o=s.text,c=t[a+1];if(!(!c||c.type!=="textord")){if(o==="-"&&c.text==="-"){var d=t[a+2];a+1<n&&d&&d.type==="textord"&&d.text==="-"?(t.splice(a,3,{type:"textord",mode:"text",loc:Ar.range(s,d),text:"---"}),n-=2):(t.splice(a,2,{type:"textord",mode:"text",loc:Ar.range(s,c),text:"--"}),n-=1)}(o==="'"||o==="`")&&c.text===o&&(t.splice(a,2,{type:"textord",mode:"text",loc:Ar.range(s,c),text:o+o}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var a=n.slice(5),s=a.charAt(0)==="*";if(s&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new Oe(`\\verb assertion failed --
307
- please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:s}}sy.hasOwnProperty(n[0])&&!vn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=sy[n[0]]+n.slice(1));var o=u_.exec(n);o&&(n=n.substring(0,o.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var c;if(vn[this.mode][n]){this.settings.strict&&this.mode==="math"&&s1.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var d=vn[this.mode][n].group,h=Ar.range(t),m;_I(d)?m={type:"atom",mode:this.mode,family:d,loc:h,text:n}:m={type:d,mode:this.mode,loc:h,text:n},c=m}else if(n.charCodeAt(0)>=128)this.settings.strict&&(I6(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),c={type:"textord",mode:"text",loc:Ar.range(t),text:n};else return null;if(this.consume(),o)for(var p=0;p<o[0].length;p++){var g=o[0][p];if(!Mh[g])throw new Oe("Unknown accent ' "+g+"'",t);var x=Mh[g][this.mode]||Mh[g].text;if(!x)throw new Oe("Accent "+g+" unsupported in "+this.mode+" mode",t);c={type:"accent",mode:this.mode,loc:Ar.range(t),label:x,isStretchy:!1,isShifty:!0,base:c}}return c}}Dd.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Sp=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new Dd(t,n);delete a.gullet.macros.current["\\df@tag"];var s=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Oe("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:a.subparse([new $r("\\df@tag")])}]}return s},Ep=function(t,n,a){n.textContent="";var s=jd(t,a).toNode();n.appendChild(s)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Ep=function(){throw new Oe("KaTeX doesn't work in quirks mode.")});var T7=function(t,n){var a=jd(t,n).toMarkup();return a},C7=function(t,n){var a=new cp(n);return Sp(t,a)},R7=function(t,n,a){if(a.throwOnError||!(t instanceof Oe))throw t;var s=_e(["katex-error"],[new Pr(n)]);return s.setAttribute("title",t.toString()),s.setAttribute("style","color:"+a.errorColor),s},jd=function(t,n){var a=new cp(n);try{var s=Sp(t,a);return SI(s,t,a)}catch(o){return R7(o,t,a)}},N7=function(t,n){var a=new cp(n);try{var s=Sp(t,a);return EI(s,t,a)}catch(o){return R7(o,t,a)}},A7="0.16.47",I7={Span:Co,Anchor:kd,SymbolNode:Pr,SvgNode:ii,PathNode:Vi,LineNode:i1},w1={version:A7,render:Ep,renderToString:T7,ParseError:Oe,SETTINGS_SCHEMA:id,__parse:C7,__renderToDomTree:jd,__renderToHTMLTree:N7,__setFontMetrics:j6,__defineSymbol:k,__defineFunction:Ge,__defineMacro:B,__domTree:I7};const fz=Object.freeze(Object.defineProperty({__proto__:null,ParseError:Oe,SETTINGS_SCHEMA:id,__defineFunction:Ge,__defineMacro:B,__defineSymbol:k,__domTree:I7,__parse:C7,__renderToDomTree:jd,__renderToHTMLTree:N7,__setFontMetrics:j6,default:w1,get render(){return Ep},renderToString:T7,version:A7},Symbol.toStringTag,{value:"Module"})),g_={};function b_(e){const t=this,n=e||g_,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(EA(n)),o.push(gA()),c.push(bA(n))}const oy=/[#.]/g;function v_(e,t){const n=e||"",a={};let s=0,o,c;for(;s<n.length;){oy.lastIndex=s;const d=oy.exec(n),h=n.slice(s,d?d.index:n.length);h&&(o?o==="#"?a.id=h:Array.isArray(a.className)?a.className.push(h):a.className=[h]:c=h,s+=h.length),d&&(o=d[0],s++)}return{type:"element",tagName:c||t||"div",properties:a,children:[]}}function _7(e,t,n){const a=n?k_(n):void 0;function s(o,c,...d){let h;if(o==null){h={type:"root",children:[]};const m=c;d.unshift(m)}else{h=v_(o,t);const m=h.tagName.toLowerCase(),p=a?a.get(m):void 0;if(h.tagName=p||m,y_(c))d.unshift(c);else for(const[g,x]of Object.entries(c))x_(e,h.properties,g,x)}for(const m of d)k1(h.children,m);return h.type==="element"&&h.tagName==="template"&&(h.content={type:"root",children:h.children},h.children=[]),h}return s}function y_(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const a of n){const s=t[a];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const o=s;for(const c of o)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function x_(e,t,n,a){const s=A5(e,n);let o;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;o=a}else typeof a=="boolean"?o=a:typeof a=="string"?s.spaceSeparated?o=Lb(a):s.commaSeparated?o=_b(a):s.commaOrSpaceSeparated?o=Lb(_b(a).join(" ")):o=ly(s,s.property,a):Array.isArray(a)?o=[...a]:o=s.property==="style"?w_(a):String(a);if(Array.isArray(o)){const c=[];for(const d of o)c.push(ly(s,s.property,d));o=c}s.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[s.property]=o}}function k1(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)k1(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?k1(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function ly(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Fl(n)===Fl(t)))return!0}return n}function w_(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function k_(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const S_=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],E_=_7(I5,"div"),T_=_7(bd,"g",S_),Oh={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function C_(e,t){return M7(e,{})||{type:"root",children:[]}}function M7(e,t){const n=R_(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function R_(e,t){switch(e.nodeType){case 1:return __(e,t);case 3:return A_(e);case 8:return I_(e);case 9:return cy(e,t);case 10:return N_();case 11:return cy(e,t);default:return}}function cy(e,t){return{type:"root",children:O7(e,t)}}function N_(){return{type:"doctype"}}function A_(e){return{type:"text",value:e.nodeValue||""}}function I_(e){return{type:"comment",value:e.nodeValue||""}}function __(e,t){const n=e.namespaceURI,a=n===Oh.svg?T_:E_,s=n===Oh.html?e.tagName.toLowerCase():e.tagName,o=n===Oh.html&&s==="template"?e.content:e,c=e.getAttributeNames(),d={};let h=-1;for(;++h<c.length;)d[c[h]]=e.getAttribute(c[h])||"";return a(s,d,O7(o,t))}function O7(e,t){const n=e.childNodes,a=[];let s=-1;for(;++s<n.length;){const o=M7(n[s],t);o!==void 0&&a.push(o)}return a}new DOMParser;function M_(e,t){const n=O_(e);return C_(n)}function O_(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const uy=(function(e,t,n){const a=tc(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]}),_s=(function(e){if(e==null)return L_;if(typeof e=="string")return j_(e);if(typeof e=="object")return D_(e);if(typeof e=="function")return Tp(e);throw new Error("Expected function, string, or array as `test`")});function D_(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=_s(e[n]);return Tp(a);function a(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function j_(e){return Tp(t);function t(n){return n.tagName===e}}function Tp(e){return t;function t(n,a,s){return!!(z_(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function L_(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function z_(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const dy=/\n/g,fy=/[\t ]+/g,S1=_s("br"),hy=_s(G_),B_=_s("p"),my=_s("tr"),q_=_s(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",P_,V_]),D7=_s(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function H_(e,t){const n=t||{},a="children"in e?e.children:[],s=D7(e),o=z7(e,{whitespace:n.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...L7(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<a.length;)c.push(...j7(a[d],e,{whitespace:o,breakBefore:d?void 0:s,breakAfter:d<a.length-1?S1(a[d+1]):s}));const h=[];let m;for(d=-1;++d<c.length;){const p=c[d];typeof p=="number"?m!==void 0&&p>m&&(m=p):p&&(m!==void 0&&m>-1&&h.push(`
308
- `.repeat(m)||" "),m=-1,h.push(p))}return h.join("")}function j7(e,t,n){return e.type==="element"?U_(e,t,n):e.type==="text"?n.whitespace==="normal"?L7(e,n):F_(e):[]}function U_(e,t,n){const a=z7(e,n),s=e.children||[];let o=-1,c=[];if(q_(e))return c;let d,h;for(S1(e)||my(e)&&uy(t,e,my)?h=`
309
- `:B_(e)?(d=2,h=2):D7(e)&&(d=1,h=1);++o<s.length;)c=c.concat(j7(s[o],e,{whitespace:a,breakBefore:o?void 0:d,breakAfter:o<s.length-1?S1(s[o+1]):h}));return hy(e)&&uy(t,e,hy)&&c.push(" "),d&&c.unshift(d),h&&c.push(h),c}function L7(e,t){const n=String(e.value),a=[],s=[];let o=0;for(;o<=n.length;){dy.lastIndex=o;const h=dy.exec(n),m=h&&"index"in h?h.index:n.length;a.push($_(n.slice(o,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,m===n.length?t.breakAfter:!0)),o=m+1}let c=-1,d;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(s.push(a[c]),d=void 0):a[c]?(typeof d=="number"&&s.push(d),s.push(a[c]),d=0):(c===0||c===a.length-1)&&s.push(0);return s}function F_(e){return[String(e.value)]}function $_(e,t,n){const a=[];let s=0,o;for(;s<e.length;){fy.lastIndex=s;const c=fy.exec(e);o=c?c.index:e.length,!s&&!o&&c&&!t&&a.push(""),s!==o&&a.push(e.slice(s,o)),s=c?o+c[0].length:o}return s!==o&&!n&&a.push(""),a.join(" ")}function z7(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function P_(e){return!!(e.properties||{}).hidden}function G_(e){return e.tagName==="td"||e.tagName==="th"}function V_(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const K_={},Y_=[];function W_(e){const t=e||K_;return function(n,a){rp(n,"element",function(s,o){const c=Array.isArray(s.properties.className)?s.properties.className:Y_,d=c.includes("language-math"),h=c.includes("math-display"),m=c.includes("math-inline");let p=h;if(!d&&!h&&!m)return;let g=o[o.length-1],x=s;if(s.tagName==="code"&&d&&g&&g.type==="element"&&g.tagName==="pre"&&(x=g,g=o[o.length-2],p=!0),!g)return;const v=H_(x,{whitespace:"pre"});let S;try{S=w1.renderToString(v,{...t,displayMode:p,throwOnError:!0})}catch(N){const R=N,O=R.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...o,s],cause:R,place:s.position,ruleId:O,source:"rehype-katex"});try{S=w1.renderToString(v,{...t,displayMode:p,strict:"ignore",throwOnError:!1})}catch{S=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(N)},children:[{type:"text",value:v}]}]}}typeof S=="string"&&(S=M_(S).children);const T=g.children.indexOf(x);return g.children.splice(T,1,...S),a6})}}var Dh,py;function Z_(){if(py)return Dh;py=1;function e(ae){return ae instanceof Map?ae.clear=ae.delete=ae.set=function(){throw new Error("map is read-only")}:ae instanceof Set&&(ae.add=ae.clear=ae.delete=function(){throw new Error("set is read-only")}),Object.freeze(ae),Object.getOwnPropertyNames(ae).forEach(ke=>{const Ne=ae[ke],Je=typeof Ne;(Je==="object"||Je==="function")&&!Object.isFrozen(Ne)&&e(Ne)}),ae}class t{constructor(ke){ke.data===void 0&&(ke.data={}),this.data=ke.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(ae){return ae.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(ae,...ke){const Ne=Object.create(null);for(const Je in ae)Ne[Je]=ae[Je];return ke.forEach(function(Je){for(const kt in Je)Ne[kt]=Je[kt]}),Ne}const s="</span>",o=ae=>!!ae.scope,c=(ae,{prefix:ke})=>{if(ae.startsWith("language:"))return ae.replace("language:","language-");if(ae.includes(".")){const Ne=ae.split(".");return[`${ke}${Ne.shift()}`,...Ne.map((Je,kt)=>`${Je}${"_".repeat(kt+1)}`)].join(" ")}return`${ke}${ae}`};class d{constructor(ke,Ne){this.buffer="",this.classPrefix=Ne.classPrefix,ke.walk(this)}addText(ke){this.buffer+=n(ke)}openNode(ke){if(!o(ke))return;const Ne=c(ke.scope,{prefix:this.classPrefix});this.span(Ne)}closeNode(ke){o(ke)&&(this.buffer+=s)}value(){return this.buffer}span(ke){this.buffer+=`<span class="${ke}">`}}const h=(ae={})=>{const ke={children:[]};return Object.assign(ke,ae),ke};class m{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ke){this.top.children.push(ke)}openNode(ke){const Ne=h({scope:ke});this.add(Ne),this.stack.push(Ne)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ke){return this.constructor._walk(ke,this.rootNode)}static _walk(ke,Ne){return typeof Ne=="string"?ke.addText(Ne):Ne.children&&(ke.openNode(Ne),Ne.children.forEach(Je=>this._walk(ke,Je)),ke.closeNode(Ne)),ke}static _collapse(ke){typeof ke!="string"&&ke.children&&(ke.children.every(Ne=>typeof Ne=="string")?ke.children=[ke.children.join("")]:ke.children.forEach(Ne=>{m._collapse(Ne)}))}}class p extends m{constructor(ke){super(),this.options=ke}addText(ke){ke!==""&&this.add(ke)}startScope(ke){this.openNode(ke)}endScope(){this.closeNode()}__addSublanguage(ke,Ne){const Je=ke.root;Ne&&(Je.scope=`language:${Ne}`),this.add(Je)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(ae){return ae?typeof ae=="string"?ae:ae.source:null}function x(ae){return T("(?=",ae,")")}function v(ae){return T("(?:",ae,")*")}function S(ae){return T("(?:",ae,")?")}function T(...ae){return ae.map(Ne=>g(Ne)).join("")}function N(ae){const ke=ae[ae.length-1];return typeof ke=="object"&&ke.constructor===Object?(ae.splice(ae.length-1,1),ke):{}}function R(...ae){return"("+(N(ae).capture?"":"?:")+ae.map(Je=>g(Je)).join("|")+")"}function O(ae){return new RegExp(ae.toString()+"|").exec("").length-1}function _(ae,ke){const Ne=ae&&ae.exec(ke);return Ne&&Ne.index===0}const P=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function U(ae,{joinWith:ke}){let Ne=0;return ae.map(Je=>{Ne+=1;const kt=Ne;let Tt=g(Je),De="";for(;Tt.length>0;){const Pe=P.exec(Tt);if(!Pe){De+=Tt;break}De+=Tt.substring(0,Pe.index),Tt=Tt.substring(Pe.index+Pe[0].length),Pe[0][0]==="\\"&&Pe[1]?De+="\\"+String(Number(Pe[1])+kt):(De+=Pe[0],Pe[0]==="("&&Ne++)}return De}).map(Je=>`(${Je})`).join(ke)}const A=/\b\B/,z="[a-zA-Z]\\w*",X="[a-zA-Z_]\\w*",H="\\b\\d+(\\.\\d+)?",$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",Y="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",oe=(ae={})=>{const ke=/^#![ ]*\//;return ae.binary&&(ae.begin=T(ke,/.*\b/,ae.binary,/\b.*/)),a({scope:"meta",begin:ke,end:/$/,relevance:0,"on:begin":(Ne,Je)=>{Ne.index!==0&&Je.ignoreMatch()}},ae)},ee={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ee]},I={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ee]},K={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Q=function(ae,ke,Ne={}){const Je=a({scope:"comment",begin:ae,end:ke,contains:[]},Ne);Je.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const kt=R("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Je.contains.push({begin:T(/[ ]+/,"(",kt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Je},pe=Q("//","$"),j=Q("/\\*","\\*/"),G=Q("#","$"),W={scope:"number",begin:H,relevance:0},D={scope:"number",begin:$,relevance:0},ye={scope:"number",begin:F,relevance:0},se={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ee,{begin:/\[/,end:/\]/,relevance:0,contains:[ee]}]},V={scope:"title",begin:z,relevance:0},Z={scope:"title",begin:X,relevance:0},ne={begin:"\\.\\s*"+X,relevance:0};var he=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:ee,BINARY_NUMBER_MODE:ye,BINARY_NUMBER_RE:F,COMMENT:Q,C_BLOCK_COMMENT_MODE:j,C_LINE_COMMENT_MODE:pe,C_NUMBER_MODE:D,C_NUMBER_RE:$,END_SAME_AS_BEGIN:function(ae){return Object.assign(ae,{"on:begin":(ke,Ne)=>{Ne.data._beginMatch=ke[1]},"on:end":(ke,Ne)=>{Ne.data._beginMatch!==ke[1]&&Ne.ignoreMatch()}})},HASH_COMMENT_MODE:G,IDENT_RE:z,MATCH_NOTHING_RE:A,METHOD_GUARD:ne,NUMBER_MODE:W,NUMBER_RE:H,PHRASAL_WORDS_MODE:K,QUOTE_STRING_MODE:I,REGEXP_MODE:se,RE_STARTERS_RE:Y,SHEBANG:oe,TITLE_MODE:V,UNDERSCORE_IDENT_RE:X,UNDERSCORE_TITLE_MODE:Z});function Re(ae,ke){ae.input[ae.index-1]==="."&&ke.ignoreMatch()}function ze(ae,ke){ae.className!==void 0&&(ae.scope=ae.className,delete ae.className)}function Ke(ae,ke){ke&&ae.beginKeywords&&(ae.begin="\\b("+ae.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ae.__beforeBegin=Re,ae.keywords=ae.keywords||ae.beginKeywords,delete ae.beginKeywords,ae.relevance===void 0&&(ae.relevance=0))}function ft(ae,ke){Array.isArray(ae.illegal)&&(ae.illegal=R(...ae.illegal))}function gt(ae,ke){if(ae.match){if(ae.begin||ae.end)throw new Error("begin & end are not supported with match");ae.begin=ae.match,delete ae.match}}function Rt(ae,ke){ae.relevance===void 0&&(ae.relevance=1)}const Bt=(ae,ke)=>{if(!ae.beforeMatch)return;if(ae.starts)throw new Error("beforeMatch cannot be used with starts");const Ne=Object.assign({},ae);Object.keys(ae).forEach(Je=>{delete ae[Je]}),ae.keywords=Ne.keywords,ae.begin=T(Ne.beforeMatch,x(Ne.begin)),ae.starts={relevance:0,contains:[Object.assign(Ne,{endsParent:!0})]},ae.relevance=0,delete Ne.beforeMatch},rt=["of","and","for","in","not","or","if","then","parent","list","value"],Mt="keyword";function mt(ae,ke,Ne=Mt){const Je=Object.create(null);return typeof ae=="string"?kt(Ne,ae.split(" ")):Array.isArray(ae)?kt(Ne,ae):Object.keys(ae).forEach(function(Tt){Object.assign(Je,mt(ae[Tt],ke,Tt))}),Je;function kt(Tt,De){ke&&(De=De.map(Pe=>Pe.toLowerCase())),De.forEach(function(Pe){const ut=Pe.split("|");Je[ut[0]]=[Tt,qt(ut[0],ut[1])]})}}function qt(ae,ke){return ke?Number(ke):Be(ae)?0:1}function Be(ae){return rt.includes(ae.toLowerCase())}const Qe={},Ue=ae=>{console.error(ae)},st=(ae,...ke)=>{console.log(`WARN: ${ae}`,...ke)},me=(ae,ke)=>{Qe[`${ae}/${ke}`]||(console.log(`Deprecated as of ${ae}. ${ke}`),Qe[`${ae}/${ke}`]=!0)},fe=new Error;function He(ae,ke,{key:Ne}){let Je=0;const kt=ae[Ne],Tt={},De={};for(let Pe=1;Pe<=ke.length;Pe++)De[Pe+Je]=kt[Pe],Tt[Pe+Je]=!0,Je+=O(ke[Pe-1]);ae[Ne]=De,ae[Ne]._emit=Tt,ae[Ne]._multi=!0}function we(ae){if(Array.isArray(ae.begin)){if(ae.skip||ae.excludeBegin||ae.returnBegin)throw Ue("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),fe;if(typeof ae.beginScope!="object"||ae.beginScope===null)throw Ue("beginScope must be object"),fe;He(ae,ae.begin,{key:"beginScope"}),ae.begin=U(ae.begin,{joinWith:""})}}function Fe(ae){if(Array.isArray(ae.end)){if(ae.skip||ae.excludeEnd||ae.returnEnd)throw Ue("skip, excludeEnd, returnEnd not compatible with endScope: {}"),fe;if(typeof ae.endScope!="object"||ae.endScope===null)throw Ue("endScope must be object"),fe;He(ae,ae.end,{key:"endScope"}),ae.end=U(ae.end,{joinWith:""})}}function ct(ae){ae.scope&&typeof ae.scope=="object"&&ae.scope!==null&&(ae.beginScope=ae.scope,delete ae.scope)}function Ie(ae){ct(ae),typeof ae.beginScope=="string"&&(ae.beginScope={_wrap:ae.beginScope}),typeof ae.endScope=="string"&&(ae.endScope={_wrap:ae.endScope}),we(ae),Fe(ae)}function Pt(ae){function ke(De,Pe){return new RegExp(g(De),"m"+(ae.case_insensitive?"i":"")+(ae.unicodeRegex?"u":"")+(Pe?"g":""))}class Ne{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Pe,ut){ut.position=this.position++,this.matchIndexes[this.matchAt]=ut,this.regexes.push([ut,Pe]),this.matchAt+=O(Pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Pe=this.regexes.map(ut=>ut[1]);this.matcherRe=ke(U(Pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Pe){this.matcherRe.lastIndex=this.lastIndex;const ut=this.matcherRe.exec(Pe);if(!ut)return null;const xn=ut.findIndex((oa,ga)=>ga>0&&oa!==void 0),fn=this.matchIndexes[xn];return ut.splice(0,xn),Object.assign(ut,fn)}}class Je{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Pe){if(this.multiRegexes[Pe])return this.multiRegexes[Pe];const ut=new Ne;return this.rules.slice(Pe).forEach(([xn,fn])=>ut.addRule(xn,fn)),ut.compile(),this.multiRegexes[Pe]=ut,ut}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Pe,ut){this.rules.push([Pe,ut]),ut.type==="begin"&&this.count++}exec(Pe){const ut=this.getMatcher(this.regexIndex);ut.lastIndex=this.lastIndex;let xn=ut.exec(Pe);if(this.resumingScanAtSamePosition()&&!(xn&&xn.index===this.lastIndex)){const fn=this.getMatcher(0);fn.lastIndex=this.lastIndex+1,xn=fn.exec(Pe)}return xn&&(this.regexIndex+=xn.position+1,this.regexIndex===this.count&&this.considerAll()),xn}}function kt(De){const Pe=new Je;return De.contains.forEach(ut=>Pe.addRule(ut.begin,{rule:ut,type:"begin"})),De.terminatorEnd&&Pe.addRule(De.terminatorEnd,{type:"end"}),De.illegal&&Pe.addRule(De.illegal,{type:"illegal"}),Pe}function Tt(De,Pe){const ut=De;if(De.isCompiled)return ut;[ze,gt,Ie,Bt].forEach(fn=>fn(De,Pe)),ae.compilerExtensions.forEach(fn=>fn(De,Pe)),De.__beforeBegin=null,[Ke,ft,Rt].forEach(fn=>fn(De,Pe)),De.isCompiled=!0;let xn=null;return typeof De.keywords=="object"&&De.keywords.$pattern&&(De.keywords=Object.assign({},De.keywords),xn=De.keywords.$pattern,delete De.keywords.$pattern),xn=xn||/\w+/,De.keywords&&(De.keywords=mt(De.keywords,ae.case_insensitive)),ut.keywordPatternRe=ke(xn,!0),Pe&&(De.begin||(De.begin=/\B|\b/),ut.beginRe=ke(ut.begin),!De.end&&!De.endsWithParent&&(De.end=/\B|\b/),De.end&&(ut.endRe=ke(ut.end)),ut.terminatorEnd=g(ut.end)||"",De.endsWithParent&&Pe.terminatorEnd&&(ut.terminatorEnd+=(De.end?"|":"")+Pe.terminatorEnd)),De.illegal&&(ut.illegalRe=ke(De.illegal)),De.contains||(De.contains=[]),De.contains=[].concat(...De.contains.map(function(fn){return _t(fn==="self"?De:fn)})),De.contains.forEach(function(fn){Tt(fn,ut)}),De.starts&&Tt(De.starts,Pe),ut.matcher=kt(ut),ut}if(ae.compilerExtensions||(ae.compilerExtensions=[]),ae.contains&&ae.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ae.classNameAliases=a(ae.classNameAliases||{}),Tt(ae)}function bt(ae){return ae?ae.endsWithParent||bt(ae.starts):!1}function _t(ae){return ae.variants&&!ae.cachedVariants&&(ae.cachedVariants=ae.variants.map(function(ke){return a(ae,{variants:null},ke)})),ae.cachedVariants?ae.cachedVariants:bt(ae)?a(ae,{starts:ae.starts?a(ae.starts):null}):Object.isFrozen(ae)?a(ae):ae}var Et="11.11.2";class $n extends Error{constructor(ke,Ne){super(ke),this.name="HTMLInjectionError",this.html=Ne}}const en=n,it=a,We=Symbol("nomatch"),vt=7,ot=function(ae){const ke=Object.create(null),Ne=Object.create(null),Je=[];let kt=!0;const Tt="Could not find the language '{}', did you forget to load/include a language module?",De={disableAutodetect:!0,name:"Plain text",contains:[]};let Pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function ut(Me){return Pe.noHighlightRe.test(Me)}function xn(Me){let et=Me.className+" ";et+=Me.parentNode?Me.parentNode.className:"";const Nt=Pe.languageDetectRe.exec(et);if(Nt){const Gt=Xn(Nt[1]);return Gt||(st(Tt.replace("{}",Nt[1])),st("Falling back to no-highlight mode for this block.",Me)),Gt?Nt[1]:"no-highlight"}return et.split(/\s+/).find(Gt=>ut(Gt)||Xn(Gt))}function fn(Me,et,Nt){let Gt="",hn="";typeof et=="object"?(Gt=Me,Nt=et.ignoreIllegals,hn=et.language):(me("10.7.0","highlight(lang, code, ...args) has been deprecated."),me("10.7.0",`Please use highlight(code, options) instead.
310
- https://github.com/highlightjs/highlight.js/issues/2277`),hn=Me,Gt=et),Nt===void 0&&(Nt=!0);const Pn={code:Gt,language:hn};Mr("before:highlight",Pn);const ir=Pn.result?Pn.result:oa(Pn.language,Pn.code,Nt);return ir.code=Pn.code,Mr("after:highlight",ir),ir}function oa(Me,et,Nt,Gt){const hn=Object.create(null);function Pn($e,Ze){return $e.keywords[Ze]}function ir(){if(!ht.keywords){On.addText(tn);return}let $e=0;ht.keywordPatternRe.lastIndex=0;let Ze=ht.keywordPatternRe.exec(tn),St="";for(;Ze;){St+=tn.substring($e,Ze.index);const Ht=er.case_insensitive?Ze[0].toLowerCase():Ze[0],kn=Pn(ht,Ht);if(kn){const[Wr,Io]=kn;if(On.addText(St),St="",hn[Ht]=(hn[Ht]||0)+1,hn[Ht]<=vt&&(fi+=Io),Wr.startsWith("_"))St+=Ze[0];else{const lc=er.classNameAliases[Wr]||Wr;Te(Ze[0],lc)}}else St+=Ze[0];$e=ht.keywordPatternRe.lastIndex,Ze=ht.keywordPatternRe.exec(tn)}St+=tn.substring($e),On.addText(St)}function Qn(){if(tn==="")return;let $e=null;if(typeof ht.subLanguage=="string"){if(!ke[ht.subLanguage]){On.addText(tn);return}$e=oa(ht.subLanguage,tn,!0,oc[ht.subLanguage]),oc[ht.subLanguage]=$e._top}else $e=yr(tn,ht.subLanguage.length?ht.subLanguage:null);ht.relevance>0&&(fi+=$e.relevance),On.__addSublanguage($e._emitter,$e.language)}function J(){ht.subLanguage!=null?Qn():ir(),tn=""}function Te($e,Ze){$e!==""&&(On.startScope(Ze),On.addText($e),On.endScope())}function Dt($e,Ze){let St=1;const Ht=Ze.length-1;for(;St<=Ht;){if(!$e._emit[St]){St++;continue}const kn=er.classNameAliases[$e[St]]||$e[St],Wr=Ze[St];kn?Te(Wr,kn):(tn=Wr,ir(),tn=""),St++}}function Jt($e,Ze){return $e.scope&&typeof $e.scope=="string"&&On.openNode(er.classNameAliases[$e.scope]||$e.scope),$e.beginScope&&($e.beginScope._wrap?(Te(tn,er.classNameAliases[$e.beginScope._wrap]||$e.beginScope._wrap),tn=""):$e.beginScope._multi&&(Dt($e.beginScope,Ze),tn="")),ht=Object.create($e,{parent:{value:ht}}),ht}function fr($e,Ze,St){let Ht=_($e.endRe,St);if(Ht){if($e["on:end"]){const kn=new t($e);$e["on:end"](Ze,kn),kn.isMatchIgnored&&(Ht=!1)}if(Ht){for(;$e.endsParent&&$e.parent;)$e=$e.parent;return $e}}if($e.endsWithParent)return fr($e.parent,Ze,St)}function Wn($e){return ht.matcher.regexIndex===0?(tn+=$e[0],1):(hi=!0,0)}function sr($e){const Ze=$e[0],St=$e.rule,Ht=new t(St),kn=[St.__beforeBegin,St["on:begin"]];for(const Wr of kn)if(Wr&&(Wr($e,Ht),Ht.isMatchIgnored))return Wn(Ze);return St.skip?tn+=Ze:(St.excludeBegin&&(tn+=Ze),J(),!St.returnBegin&&!St.excludeBegin&&(tn=Ze)),Jt(St,$e),St.returnBegin?0:Ze.length}function gn($e){const Ze=$e[0],St=et.substring($e.index),Ht=fr(ht,$e,St);if(!Ht)return We;const kn=ht;ht.endScope&&ht.endScope._wrap?(J(),Te(Ze,ht.endScope._wrap)):ht.endScope&&ht.endScope._multi?(J(),Dt(ht.endScope,$e)):kn.skip?tn+=Ze:(kn.returnEnd||kn.excludeEnd||(tn+=Ze),J(),kn.excludeEnd&&(tn=Ze));do ht.scope&&On.closeNode(),!ht.skip&&!ht.subLanguage&&(fi+=ht.relevance),ht=ht.parent;while(ht!==Ht.parent);return Ht.starts&&Jt(Ht.starts,$e),kn.returnEnd?0:Ze.length}function Or(){const $e=[];for(let Ze=ht;Ze!==er;Ze=Ze.parent)Ze.scope&&$e.unshift(Ze.scope);$e.forEach(Ze=>On.openNode(Ze))}let Jn={};function ua($e,Ze){const St=Ze&&Ze[0];if(tn+=$e,St==null)return J(),0;if(Jn.type==="begin"&&Ze.type==="end"&&Jn.index===Ze.index&&St===""){if(tn+=et.slice(Ze.index,Ze.index+1),!kt){const Ht=new Error(`0 width match regex (${Me})`);throw Ht.languageName=Me,Ht.badRule=Jn.rule,Ht}return 1}if(Jn=Ze,Ze.type==="begin")return sr(Ze);if(Ze.type==="illegal"&&!Nt){const Ht=new Error('Illegal lexeme "'+St+'" for mode "'+(ht.scope||"<unnamed>")+'"');throw Ht.mode=ht,Ht}else if(Ze.type==="end"){const Ht=gn(Ze);if(Ht!==We)return Ht}if(Ze.type==="illegal"&&St==="")return Ze.index===et.length||(tn+=`
311
- `),1;if(Ao>1e5&&Ao>Ze.index*3)throw new Error("potential infinite loop, way more iterations than matches");return tn+=St,St.length}const er=Xn(Me);if(!er)throw Ue(Tt.replace("{}",Me)),new Error('Unknown language: "'+Me+'"');const sc=Pt(er);let Ds="",ht=Gt||sc;const oc={},On=new Pe.__emitter(Pe);Or();let tn="",fi=0,ja=0,Ao=0,hi=!1;try{if(er.__emitTokens)er.__emitTokens(et,On);else{for(ht.matcher.considerAll();;){Ao++,hi?hi=!1:ht.matcher.considerAll(),ht.matcher.lastIndex=ja;const $e=ht.matcher.exec(et);if(!$e)break;const Ze=et.substring(ja,$e.index),St=ua(Ze,$e);ja=$e.index+St}ua(et.substring(ja))}return On.finalize(),Ds=On.toHTML(),{language:Me,value:Ds,relevance:fi,illegal:!1,_emitter:On,_top:ht}}catch($e){if($e.message&&$e.message.includes("Illegal"))return{language:Me,value:en(et),illegal:!0,relevance:0,_illegalBy:{message:$e.message,index:ja,context:et.slice(ja-100,ja+100),mode:$e.mode,resultSoFar:Ds},_emitter:On};if(kt)return{language:Me,value:en(et),illegal:!1,relevance:0,errorRaised:$e,_emitter:On,_top:ht};throw $e}}function ga(Me){const et={value:en(Me),illegal:!1,relevance:0,_top:De,_emitter:new Pe.__emitter(Pe)};return et._emitter.addText(Me),et}function yr(Me,et){et=et||Pe.languages||Object.keys(ke);const Nt=ga(Me),Gt=et.filter(Xn).filter(va).map(J=>oa(J,Me,!1));Gt.unshift(Nt);const hn=Gt.sort((J,Te)=>{if(J.relevance!==Te.relevance)return Te.relevance-J.relevance;if(J.language&&Te.language){if(Xn(J.language).supersetOf===Te.language)return 1;if(Xn(Te.language).supersetOf===J.language)return-1}return 0}),[Pn,ir]=hn,Qn=Pn;return Qn.secondBest=ir,Qn}function dr(Me,et,Nt){const Gt=et&&Ne[et]||Nt;Me.classList.add("hljs"),Me.classList.add(`language-${Gt}`)}function Wt(Me){let et=null;const Nt=xn(Me);if(ut(Nt))return;if(Mr("before:highlightElement",{el:Me,language:Nt}),Me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Me);return}if(Me.children.length>0&&(Pe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Me)),Pe.throwUnescapedHTML))throw new $n("One of your code blocks includes unescaped HTML.",Me.innerHTML);et=Me;const Gt=et.textContent,hn=Nt?fn(Gt,{language:Nt,ignoreIllegals:!0}):yr(Gt);Me.innerHTML=hn.value,Me.dataset.highlighted="yes",dr(Me,Nt,hn.language),Me.result={language:hn.language,re:hn.relevance,relevance:hn.relevance},hn.secondBest&&(Me.secondBest={language:hn.secondBest.language,relevance:hn.secondBest.relevance}),Mr("after:highlightElement",{el:Me,result:hn,text:Gt})}function Tn(Me){Pe=it(Pe,Me)}const Kr=()=>{di(),me("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ba(){di(),me("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ui=!1;function di(){function Me(){di()}if(document.readyState==="loading"){ui||window.addEventListener("DOMContentLoaded",Me,!1),ui=!0;return}document.querySelectorAll(Pe.cssSelector).forEach(Wt)}function Ms(Me,et){let Nt=null;try{Nt=et(ae)}catch(Gt){if(Ue("Language definition for '{}' could not be registered.".replace("{}",Me)),kt)Ue(Gt);else throw Gt;Nt=De}Nt.name||(Nt.name=Me),ke[Me]=Nt,Nt.rawDefinition=et.bind(null,ae),Nt.aliases&&la(Nt.aliases,{languageName:Me})}function Oa(Me){delete ke[Me];for(const et of Object.keys(Ne))Ne[et]===Me&&delete Ne[et]}function Da(){return Object.keys(ke)}function Xn(Me){return Me=(Me||"").toLowerCase(),ke[Me]||ke[Ne[Me]]}function la(Me,{languageName:et}){typeof Me=="string"&&(Me=[Me]),Me.forEach(Nt=>{Ne[Nt.toLowerCase()]=et})}function va(Me){const et=Xn(Me);return et&&!et.disableAutodetect}function ca(Me){Me["before:highlightBlock"]&&!Me["before:highlightElement"]&&(Me["before:highlightElement"]=et=>{Me["before:highlightBlock"](Object.assign({block:et.el},et))}),Me["after:highlightBlock"]&&!Me["after:highlightElement"]&&(Me["after:highlightElement"]=et=>{Me["after:highlightBlock"](Object.assign({block:et.el},et))})}function wn(Me){ca(Me),Je.push(Me)}function Os(Me){const et=Je.indexOf(Me);et!==-1&&Je.splice(et,1)}function Mr(Me,et){const Nt=Me;Je.forEach(function(Gt){Gt[Nt]&&Gt[Nt](et)})}function Yr(Me){return me("10.7.0","highlightBlock will be removed entirely in v12.0"),me("10.7.0","Please use highlightElement now."),Wt(Me)}Object.assign(ae,{highlight:fn,highlightAuto:yr,highlightAll:di,highlightElement:Wt,highlightBlock:Yr,configure:Tn,initHighlighting:Kr,initHighlightingOnLoad:ba,registerLanguage:Ms,unregisterLanguage:Oa,listLanguages:Da,getLanguage:Xn,registerAliases:la,autoDetection:va,inherit:it,addPlugin:wn,removePlugin:Os}),ae.debugMode=function(){kt=!1},ae.safeMode=function(){kt=!0},ae.versionString=Et,ae.regex={concat:T,lookahead:x,either:R,optional:S,anyNumberOfTimes:v};for(const Me in he)typeof he[Me]=="object"&&e(he[Me]);return Object.assign(ae,he),ae},Yt=ot({});return Yt.newInstance=()=>ot({}),Dh=Yt,Yt.HighlightJS=Yt,Yt.default=Yt,Dh}var jh,gy;function X_(){if(gy)return jh;gy=1;function e(t){const n=t.regex,a=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=t.inherit(c,{begin:/\(/,end:/\)/}),h=t.inherit(t.APOS_STRING_MODE,{className:"string"}),m=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,m,h,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,d,m,h]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[m]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(a,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:p}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return jh=e,jh}var Lh,by;function Q_(){if(by)return Lh;by=1;function e(t){const n=t.regex,a={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},h={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,a,o]};o.contains.push(h);const m={match:/\\"/},p={className:"string",begin:/'/,end:/'/},g={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,a]},v=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],S=t.SHEBANG({binary:`(${v.join("|")})`,relevance:10}),T={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],R=["true","false"],O={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],P=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],U=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],A=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:R,built_in:[..._,...P,"set","shopt",...U,...A]},contains:[S,t.SHEBANG(),T,x,c,d,O,h,m,p,g,a]}}return Lh=e,Lh}var zh,vy;function J_(){if(vy)return zh;vy=1;function e(t){const n=t.regex,a=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="("+s+"|"+n.optional(o)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",h={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},x={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},a,t.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:n.optional(o)+t.IDENT_RE,relevance:0},S=n.optional(o)+t.IDENT_RE+"\\s*\\(",R={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},O=[x,h,a,t.C_BLOCK_COMMENT_MODE,g,p],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:R,contains:O.concat([{begin:/\(/,end:/\)/,keywords:R,contains:O.concat(["self"]),relevance:0}]),relevance:0},P={begin:"("+d+"[\\*&\\s]+)+"+S,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:R,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:R,relevance:0},{begin:S,returnBegin:!0,contains:[t.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:[a,t.C_BLOCK_COMMENT_MODE,p,g,h,{begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:["self",a,t.C_BLOCK_COMMENT_MODE,p,g,h]}]},h,a,t.C_BLOCK_COMMENT_MODE,x]};return{name:"C",aliases:["h"],keywords:R,disableAutodetect:!0,illegal:"</",contains:[].concat(_,P,O,[x,{begin:t.IDENT_RE+"::",keywords:R},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:x,strings:p,keywords:R}}}return zh=e,zh}var Bh,yy;function eM(){if(yy)return Bh;yy=1;function e(t){const n=t.regex,a=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+n.optional(o)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",h={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},x={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},a,t.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:n.optional(o)+t.IDENT_RE,relevance:0},S=n.optional(o)+t.IDENT_RE+"\\s*\\(",T=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],R=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],O=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],U={type:N,keyword:T,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:R},A={className:"function.dispatch",relevance:0,keywords:{_hint:O},begin:n.concat(/\b/,`(?!${T.join("|")})`,t.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},z=[A,x,h,a,t.C_BLOCK_COMMENT_MODE,g,p],X={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:U,contains:z.concat([{begin:/\(/,end:/\)/,keywords:U,contains:z.concat(["self"]),relevance:0}]),relevance:0},H={className:"function",begin:"("+d+"[\\*&\\s]+)+"+S,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:U,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:U,relevance:0},{begin:S,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:[a,t.C_BLOCK_COMMENT_MODE,p,g,h,{begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:["self",a,t.C_BLOCK_COMMENT_MODE,p,g,h]}]},h,a,t.C_BLOCK_COMMENT_MODE,x]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:U,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(X,H,A,z,[x,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:U,contains:["self",h]},{begin:t.IDENT_RE+"::",keywords:U},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Bh=e,Bh}var qh,xy;function tM(){if(xy)return qh;xy=1;function e(t){const n=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],c=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:o.concat(c),built_in:n,literal:s},h=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),m={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],relevance:0},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},g={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},x=t.inherit(g,{illegal:/\n/}),v={className:"subst",begin:/\{/,end:/\}/,keywords:d},S=t.inherit(v,{illegal:/\n/}),T={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,S]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},R=t.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},S]});v.contains=[N,T,g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,t.C_BLOCK_COMMENT_MODE],S.contains=[R,T,x,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const O={variants:[p,N,T,g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},_={begin:"<",end:">",contains:[{beginKeywords:"in out"},h]},P=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",U={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},O,m,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},h,_,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[h,_,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+P+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,_],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[O,m,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},U]}}return qh=e,qh}var Hh,wy;function nM(){if(wy)return Hh;wy=1;const e=m=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:m.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:m.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function h(m){const p=m.regex,g=e(m),x={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},v="and or not only",S=/@-?\w[\w]*(-\w+)*/,T="[a-zA-Z-][a-zA-Z0-9_-]*",N=[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[g.BLOCK_COMMENT,x,g.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+T,relevance:0},g.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+o.join("|")+")"},{begin:":(:)?("+c.join("|")+")"}]},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[g.BLOCK_COMMENT,g.HEXCOLOR,g.IMPORTANT,g.CSS_NUMBER_MODE,g.UNICODE_RANGE,...N,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...N,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},g.FUNCTION_DISPATCH]},{begin:p.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:S},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:v,attribute:s.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...N,g.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+a.join("|")+")\\b"}]}}return Hh=h,Hh}var Uh,ky;function rM(){if(ky)return Uh;ky=1;function e(t){const n=t.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},h=/[A-Za-z][A-Za-z0-9+.-]*/,m={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,h,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),v=t.inherit(g,{contains:[]});p.contains.push(v),g.contains.push(x);let S=[a,m];return[p,g,x,v].forEach(O=>{O.contains=O.contains.concat(S)}),S=S.concat(p,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:S},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:S}]}]},a,c,p,g,{className:"quote",begin:"^>\\s+",contains:S,end:"$"},o,s,m,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return Uh=e,Uh}var Fh,Sy;function aM(){if(Sy)return Fh;Sy=1;function e(t){const n=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return Fh=e,Fh}var $h,Ey;function iM(){if(Ey)return $h;Ey=1;function e(t){const n=t.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=n.concat(s,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},h={className:"doctag",begin:"@[A-Za-z]+"},m={begin:"#<",end:">"},p=[t.COMMENT("#","$",{contains:[h]}),t.COMMENT("^=begin","^=end",{contains:[h],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:d},x={className:"string",contains:[t.BACKSLASH_ESCAPE,g],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,g]})]}]},v="[1-9](_?[0-9])*|0",S="[0-9](_?[0-9])*",T={className:"number",relevance:0,variants:[{begin:`\\b(${v})(\\.(${S}))?([eE][+-]?(${S})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},z=[x,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:d},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[x,{begin:a}],relevance:0},T,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:d},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,g],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(m,p),relevance:0}].concat(m,p);g.contains=z,N.contains=z;const F=[{begin:/^\s*=>/,starts:{end:"$",contains:z}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:z}}];return p.unshift(m),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(F).concat(p).concat(z)}}return $h=e,$h}var Ph,Ty;function sM(){if(Ty)return Ph;Ty=1;function e(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}return Ph=e,Ph}var Gh,Cy;function oM(){if(Cy)return Gh;Cy=1;function e(t){const n=t.regex,a=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:n.concat(a,n.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return Gh=e,Gh}var Vh,Ry;function lM(){if(Ry)return Vh;Ry=1;function e(t){const n=t.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},s=t.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},h={begin:/\[/,end:/\]/,contains:[s,c,o,d,a,"self"],relevance:0},m=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,g=/'[^']*'/,x=n.either(m,p,g),v=n.concat(x,"(\\s*\\.\\s*",x,")*",n.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:v,className:"attr",starts:{end:/$/,contains:[s,h,c,o,d,a]}}]}}return Vh=e,Vh}var Kh,Ny;function cM(){if(Ny)return Kh;Ny=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function s(c,d,h){return h===-1?"":c.replace(d,m=>s(c,d,h-1))}function o(c){const d=c.regex,h="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",m=h+s("(?:<"+h+"~~~(?:\\s*,\\s*"+h+"~~~)*>)?",/~~~/g,2),S={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},T={className:"meta",begin:"@"+h,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},N={className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[c.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:S,illegal:/<\/|#/,contains:[c.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[c.BACKSLASH_ESCAPE]},c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,h],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[d.concat(/(?!else)/,h),/\s+/,h,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,h],className:{1:"keyword",3:"title.class"},contains:[N,c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+m+"\\s+)",c.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:S,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[T,c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,a,c.C_BLOCK_COMMENT_MODE]},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},a,T]}}return Kh=o,Kh}var Yh,Ay;function uM(){if(Ay)return Yh;Ay=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d=[].concat(o,a,s);function h(m){const p=m.regex,g=(Z,{after:ne})=>{const ue="</"+Z[0].slice(1);return Z.input.indexOf(ue,ne)!==-1},x=e,v={begin:"<>",end:"</>"},S=/<[A-Za-z0-9\\._:-]+\s*\/>/,T={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Z,ne)=>{const ue=Z[0].length+Z.index,he=Z.input[ue];if(he==="<"||he===","){ne.ignoreMatch();return}he===">"&&(g(Z,{after:ue})||ne.ignoreMatch());let Re;const ze=Z.input.substring(ue);if(Re=ze.match(/^\s*=/)){ne.ignoreMatch();return}if((Re=ze.match(/^\s+extends\s+/))&&Re.index===0){ne.ignoreMatch();return}}},N={$pattern:e,keyword:t,literal:n,built_in:d,"variable.language":c},R="[0-9](_?[0-9])*",O=`\\.(${R})`,_="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",P={className:"number",variants:[{begin:`(\\b(${_})((${O})|\\.)?|(${O}))[eE][+-]?(${R})\\b`},{begin:`\\b(${_})\\b((${O})\\b|\\.)?|(${O})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},U={className:"subst",begin:"\\$\\{",end:"\\}",keywords:N,contains:[]},A={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[m.BACKSLASH_ESCAPE,U],subLanguage:"xml"}},z={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[m.BACKSLASH_ESCAPE,U],subLanguage:"css"}},X={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[m.BACKSLASH_ESCAPE,U],subLanguage:"graphql"}},H={className:"string",begin:"`",end:"`",contains:[m.BACKSLASH_ESCAPE,U]},F={className:"comment",variants:[m.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:x+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),m.C_BLOCK_COMMENT_MODE,m.C_LINE_COMMENT_MODE]},Y=[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE,A,z,X,H,{match:/\$\d+/},P];U.contains=Y.concat({begin:/\{/,end:/\}/,keywords:N,contains:["self"].concat(Y)});const oe=[].concat(F,U.contains),ee=oe.concat([{begin:/(\s*)\(/,end:/\)/,keywords:N,contains:["self"].concat(oe)}]),q={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:ee},I={variants:[{match:[/class/,/\s+/,x,/\s+/,/extends/,/\s+/,p.concat(x,"(",p.concat(/\./,x),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,x],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:p.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...a,...s]}},Q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[q],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Z){return p.concat("(?!",Z.join("|"),")")}const W={match:p.concat(/\b/,G([...o,"super","import","await"].map(Z=>`${Z}\\s*\\(`)),x,p.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:p.concat(/\./,p.lookahead(p.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},q]},se="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+m.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,p.lookahead(se)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[q]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:N,exports:{PARAMS_CONTAINS:ee,CLASS_REFERENCE:K},illegal:/#(?![$_A-Za-z])/,contains:[m.SHEBANG({label:"shebang",binary:"node",relevance:5}),Q,m.APOS_STRING_MODE,m.QUOTE_STRING_MODE,A,z,X,H,F,{match:/\$\d+/},P,K,{scope:"attr",match:x+p.lookahead(":"),relevance:0},V,{begin:"("+m.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,m.REGEXP_MODE,{className:"function",begin:se,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:m.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:ee}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:v.begin,end:v.end},{match:S},{begin:T.begin,"on:begin":T.isTrulyOpeningTag,end:T.end}],subLanguage:"xml",contains:[{begin:T.begin,end:T.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+m.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[q,m.inherit(m.TITLE_MODE,{begin:x,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[q]},W,j,I,ye,{match:/\$[(.]/}]}}return Yh=h,Yh}var Wh,Iy;function dM(){if(Iy)return Wh;Iy=1;const t={scope:"number",match:"([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",relevance:0};function n(a){const s={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},o={match:/[{}[\],:]/,className:"punctuation",relevance:0},c=["true","false","null"],d={scope:"literal",beginKeywords:c.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:c},contains:[s,o,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,d,t,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return Wh=n,Wh}var Zh,_y;function fM(){if(_y)return Zh;_y=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function s(o){const c={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},d={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},h={className:"symbol",begin:o.UNDERSCORE_IDENT_RE+"@"},m={className:"subst",begin:/\$\{/,end:/\}/,contains:[o.C_NUMBER_MODE]},p={className:"variable",begin:"\\$"+o.UNDERSCORE_IDENT_RE},g={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[p,m]},{begin:"'",end:"'",illegal:/\n/,contains:[o.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[o.BACKSLASH_ESCAPE,p,m]}]};m.contains.push(g);const x={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+o.UNDERSCORE_IDENT_RE+")?"},v={className:"meta",begin:"@"+o.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[o.inherit(g,{className:"string"}),"self"]}]},S=a,T=o.COMMENT("/\\*","\\*/",{contains:[o.C_BLOCK_COMMENT_MODE]}),N={variants:[{className:"type",begin:o.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},R=N;return R.variants[1].contains=[N],N.variants[1].contains=[R],{name:"Kotlin",aliases:["kt","kts"],keywords:c,contains:[o.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),o.C_LINE_COMMENT_MODE,T,d,h,x,v,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:c,relevance:5,contains:[{begin:o.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[o.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[N,o.C_LINE_COMMENT_MODE,T],relevance:0},o.C_LINE_COMMENT_MODE,T,x,v,g,o.C_NUMBER_MODE]},T]},{begin:[/class|interface|trait/,/\s+/,o.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},o.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},x,v]},g,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
312
- `},S]}}return Zh=s,Zh}var Xh,My;function hM(){if(My)return Xh;My=1;const e=p=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:p.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:p.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),h=o.concat(c).sort().reverse();function m(p){const g=e(p),x=h,v="and or not only",S="[\\w-]+",T="("+S+"|@\\{"+S+"\\})",N=[],R=[],O=function(oe){return{className:"string",begin:"~?"+oe+".*?"+oe}},_=function(oe,ee,q){return{className:oe,begin:ee,relevance:q}},P={$pattern:/[a-z-]+/,keyword:v,attribute:s.join(" ")},U={begin:"\\(",end:"\\)",contains:R,keywords:P,relevance:0};R.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,O("'"),O('"'),g.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},g.UNICODE_RANGE,g.HEXCOLOR,U,_("variable","@@?"+S,10),_("variable","@\\{"+S+"\\}"),_("built_in","~?`[^`]*?`"),{className:"attribute",begin:S+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},g.IMPORTANT,{beginKeywords:"and not"},g.FUNCTION_DISPATCH);const A=R.concat({begin:/\{/,end:/\}/,contains:N}),z={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(R)},X={begin:T+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:R}}]},H={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:P,returnEnd:!0,contains:R,relevance:0}},$={className:"variable",variants:[{begin:"@"+S+"\\s*:",relevance:15},{begin:"@"+S}],starts:{end:"[;}]",returnEnd:!0,contains:A}},F={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:T,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,z,_("keyword","all\\b"),_("variable","@\\{"+S+"\\}"),{begin:"\\b("+a.join("|")+")\\b",className:"selector-tag"},g.CSS_NUMBER_MODE,_("selector-tag",T,0),_("selector-id","#"+T),_("selector-class","\\."+T,0),_("selector-tag","&",0),g.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+o.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+c.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:A},{begin:"!important"},g.FUNCTION_DISPATCH]},Y={begin:S+`:(:)?(${x.join("|")})`,returnBegin:!0,contains:[F]};return N.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,H,$,Y,X,F,z,g.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:N}}return Xh=m,Xh}var Qh,Oy;function mM(){if(Oy)return Qh;Oy=1;function e(t){const n="\\[=*\\[",a="\\]=*\\]",s={begin:n,end:a,contains:["self"]},o=[t.COMMENT("--(?!"+n+")","$"),t.COMMENT("--"+n,a,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:n,end:a,contains:[s],relevance:5}])}}return Qh=e,Qh}var Jh,Dy;function pM(){if(Dy)return Jh;Dy=1;function e(t){const n={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[n,a]},o={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,n,a,s,o,c,d]}}return Jh=e,Jh}var em,jy;function gM(){if(jy)return em;jy=1;function e(t){const n=t.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:a.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},d={begin:/->\{/,end:/\}/},h={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},m={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[h]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},g=[t.BACKSLASH_ESCAPE,c,m],x=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],v=(N,R,O="\\1")=>{const _=O==="\\1"?O:n.concat(O,R);return n.concat(n.concat("(?:",N,")"),R,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,O,s)},S=(N,R,O)=>n.concat(n.concat("(?:",N,")"),R,/(?:\\.|[^\\\/])*?/,O,s),T=[m,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:g,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:v("s|tr|y",n.either(...x,{capture:!0}))},{begin:v("s|tr|y","\\(","\\)")},{begin:v("s|tr|y","\\[","\\]")},{begin:v("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:S("(?:m|qr)?",/\//,/\//)},{begin:S("m|qr",n.either(...x,{capture:!0}),/\1/)},{begin:S("m|qr",/\(/,/\)/)},{begin:S("m|qr",/\[/,/\]/)},{begin:S("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,h]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,h,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=T,d.contains=T,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:T}}return em=e,em}var tm,Ly;function bM(){if(Ly)return tm;Ly=1;function e(t){const n={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,h={"variable.language":["this","super"],$pattern:a,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},m={$pattern:a,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:h,illegal:"</",contains:[n,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+m.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:m,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return tm=e,tm}var nm,zy;function vM(){if(zy)return nm;zy=1;function e(t){const n=t.regex,a=/(?![A-Za-z0-9])(?![$])/,s=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),o=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),c=n.concat(/[A-Z]+/,a),d={scope:"variable",match:"\\$+"+s},h={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},m={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=t.inherit(t.APOS_STRING_MODE,{illegal:null}),g=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(m)}),x={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(m),"on:begin":(q,I)=>{I.data._beginMatch=q[1]||q[2]},"on:end":(q,I)=>{I.data._beginMatch!==q[1]&&I.ignoreMatch()}},v=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),S=`[
313
- ]`,T={scope:"string",variants:[g,p,x,v]},N={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},R=["false","null","true"],O=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],_=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],U={keyword:O,literal:(q=>{const I=[];return q.forEach(K=>{I.push(K),K.toLowerCase()===K?I.push(K.toUpperCase()):I.push(K.toLowerCase())}),I})(R),built_in:_},A=q=>q.map(I=>I.replace(/\|\d+$/,"")),z={variants:[{match:[/new/,n.concat(S,"+"),n.concat("(?!",A(_).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},X=n.concat(s,"\\b(?!\\()"),H={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),X],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,n.concat(/::/,n.lookahead(/(?!class\b)/)),X],scope:{1:"title.class",3:"variable.constant"}},{match:[o,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},$={scope:"attr",match:n.concat(s,n.lookahead(":"),n.lookahead(/(?!::)/))},F={relevance:0,begin:/\(/,end:/\)/,keywords:U,contains:[$,d,H,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,N,z]},Y={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",A(O).join("\\b|"),"|",A(_).join("\\b|"),"\\b)"),s,n.concat(S,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[F]};F.contains.push(Y);const oe=[$,H,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,N,z],ee={begin:n.concat(/#\[\s*\\?/,n.either(o,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:R,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:R,keyword:["new","array"]},contains:["self",...oe]},...oe,{scope:"meta",variants:[{match:o},{match:c}]}]};return{case_insensitive:!1,keywords:U,contains:[ee,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},h,{scope:"variable.language",match:/\$this\b/},d,Y,H,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},z,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:U,contains:["self",ee,d,H,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,N]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},T,N]}}return nm=e,nm}var rm,By;function yM(){if(By)return rm;By=1;function e(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return rm=e,rm}var am,qy;function xM(){if(qy)return am;qy=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return am=e,am}var im,Hy;function wM(){if(Hy)return im;Hy=1;function e(t){const n=t.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],h={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},m={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:h,illegal:/#/},g={begin:/\{\{/,relevance:0},x={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,m,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,m,g,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,g,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",S=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,T=`\\b|${s.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${S}))[eE][+-]?(${v})[jJ]?(?=${T})`},{begin:`(${S})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${T})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${T})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${T})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${T})`},{begin:`\\b(${v})[jJ](?=${T})`}]},R={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:h,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},O={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:["self",m,N,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,N,m],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:h,illegal:/(<\/|\?)|=>/,contains:[m,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,R,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[O]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,O,x]}]}}return im=e,im}var sm,Uy;function kM(){if(Uy)return sm;Uy=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return sm=e,sm}var om,Fy;function SM(){if(Fy)return om;Fy=1;function e(t){const n=t.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[c,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return om=e,om}var lm,$y;function EM(){if($y)return lm;$y=1;function e(t){const n=t.regex,a=/(r#)?/,s=n.concat(a,t.UNDERSCORE_IDENT_RE),o=n.concat(a,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,n.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",h=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],m=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],g=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:g,keyword:h,literal:m,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:g}},{className:"punctuation",begin:"->"},c]}}return lm=e,lm}var cm,Py;function TM(){if(Py)return cm;Py=1;const e=m=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:m.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:m.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function h(m){const p=e(m),g=c,x=o,v="@[a-z-]+",S="and or not only",N={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[m.C_LINE_COMMENT_MODE,m.C_BLOCK_COMMENT_MODE,p.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},p.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+a.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+x.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+g.join("|")+")"},N,{begin:/\(/,end:/\)/,contains:[p.CSS_NUMBER_MODE]},p.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[p.BLOCK_COMMENT,N,p.HEXCOLOR,p.CSS_NUMBER_MODE,p.UNICODE_RANGE,m.QUOTE_STRING_MODE,m.APOS_STRING_MODE,p.IMPORTANT,p.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:v,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:S,attribute:s.join(" ")},contains:[{begin:v,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},N,m.QUOTE_STRING_MODE,m.APOS_STRING_MODE,p.HEXCOLOR,p.CSS_NUMBER_MODE]},p.FUNCTION_DISPATCH]}}return cm=h,cm}var um,Gy;function CM(){if(Gy)return um;Gy=1;function e(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return um=e,um}var dm,Vy;function RM(){if(Vy)return dm;Vy=1;function e(t){const n=t.regex,a=t.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],h=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],m=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],g=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],v=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],S=g,T=[...p,...m].filter(A=>!g.includes(A)),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},R={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},O={match:n.concat(/\b/,n.either(...S),/\s*\(/),relevance:0,keywords:{built_in:S}};function _(A){return n.concat(/\b/,n.either(...A.map(z=>z.replace(/\s+/,"\\s+"))),/\b/)}const P={scope:"keyword",match:_(v),relevance:0};function U(A,{exceptions:z,when:X}={}){const H=X;return z=z||[],A.map($=>$.match(/\|\d+$/)||z.includes($)?$:H($)?`${$}|0`:$)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:U(T,{when:A=>A.length<3}),literal:c,type:h,built_in:x},contains:[{scope:"type",match:_(d)},P,O,N,s,o,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,a,R]}}return dm=e,dm}var fm,Ky;function NM(){if(Ky)return fm;Ky=1;function e(X){return X?typeof X=="string"?X:X.source:null}function t(X){return n("(?=",X,")")}function n(...X){return X.map($=>e($)).join("")}function a(X){const H=X[X.length-1];return typeof H=="object"&&H.constructor===Object?(X.splice(X.length-1,1),H):{}}function s(...X){return"("+(a(X).capture?"":"?:")+X.map(F=>e(F)).join("|")+")"}const o=X=>n(/\b/,X,/\w$/.test(X)?/\b/:/\B/),c=["Protocol","Type"].map(o),d=["init","self"].map(o),h=["Any","Self"],m=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],p=["false","nil","true"],g=["assignment","associativity","higherThan","left","lowerThan","none","right"],x=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],v=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],S=s(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),T=s(S,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),N=n(S,T,"*"),R=s(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),O=s(R,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),_=n(R,O,"*"),P=n(/[A-Z]/,O,"*"),U=["attached","autoclosure",n(/convention\(/,s("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",n(/objc\(/,_,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],A=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function z(X){const H={match:/\s+/,relevance:0},$=X.COMMENT("/\\*","\\*/",{contains:["self"]}),F=[X.C_LINE_COMMENT_MODE,$],Y={match:[/\./,s(...c,...d)],className:{2:"keyword"}},oe={match:n(/\./,s(...m)),relevance:0},ee=m.filter(We=>typeof We=="string").concat(["_|0"]),q=m.filter(We=>typeof We!="string").concat(h).map(o),I={variants:[{className:"keyword",match:s(...q,...d)}]},K={$pattern:s(/\b\w+/,/#\w+/),keyword:ee.concat(x),literal:p},Q=[Y,oe,I],pe={match:n(/\./,s(...v)),relevance:0},j={className:"built_in",match:n(/\b/,s(...v),/(?=\()/)},G=[pe,j],W={match:/->/,relevance:0},D={className:"operator",relevance:0,variants:[{match:N},{match:`\\.(\\.|${T})+`}]},ye=[W,D],se="([0-9]_*)+",V="([0-9a-fA-F]_*)+",Z={className:"number",relevance:0,variants:[{match:`\\b(${se})(\\.(${se}))?([eE][+-]?(${se}))?\\b`},{match:`\\b0x(${V})(\\.(${V}))?([pP][+-]?(${se}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},ne=(We="")=>({className:"subst",variants:[{match:n(/\\/,We,/[0\\tnr"']/)},{match:n(/\\/,We,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ue=(We="")=>({className:"subst",match:n(/\\/,We,/[\t ]*(?:[\r\n]|\r\n)/)}),he=(We="")=>({className:"subst",label:"interpol",begin:n(/\\/,We,/\(/),end:/\)/}),Re=(We="")=>({begin:n(We,/"""/),end:n(/"""/,We),contains:[ne(We),ue(We),he(We)]}),ze=(We="")=>({begin:n(We,/"/),end:n(/"/,We),contains:[ne(We),he(We)]}),Ke={className:"string",variants:[Re(),Re("#"),Re("##"),Re("###"),ze(),ze("#"),ze("##"),ze("###")]},ft=[X.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[X.BACKSLASH_ESCAPE]}],gt={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:ft},Rt=We=>{const vt=n(We,/\//),ot=n(/\//,We);return{begin:vt,end:ot,contains:[...ft,{scope:"comment",begin:`#(?!.*${ot})`,end:/$/}]}},Bt={scope:"regexp",variants:[Rt("###"),Rt("##"),Rt("#"),gt]},rt={match:n(/`/,_,/`/)},Mt={className:"variable",match:/\$\d+/},mt={className:"variable",match:`\\$${O}+`},qt=[rt,Mt,mt],Be={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:A,contains:[...ye,Z,Ke]}]}},Qe={scope:"keyword",match:n(/@/,s(...U),t(s(/\(/,/\s+/)))},Ue={scope:"meta",match:n(/@/,_)},st=[Be,Qe,Ue],me={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:n(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,O,"+")},{className:"type",match:P,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:n(/\s+&\s+/,t(P)),relevance:0}]},fe={begin:/</,end:/>/,keywords:K,contains:[...F,...Q,...st,W,me]};me.contains.push(fe);const He={match:n(_,/\s*:/),keywords:"_|0",relevance:0},we={begin:/\(/,end:/\)/,relevance:0,keywords:K,contains:["self",He,...F,Bt,...Q,...G,...ye,Z,Ke,...qt,...st,me]},Fe={begin:/</,end:/>/,keywords:"repeat each",contains:[...F,me]},ct={begin:s(t(n(_,/\s*:/)),t(n(_,/\s+/,_,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:_}]},Ie={begin:/\(/,end:/\)/,keywords:K,contains:[ct,...F,...Q,...ye,Z,Ke,...st,me,we],endsParent:!0,illegal:/["']/},Pt={match:[/(func|macro)/,/\s+/,s(rt.match,_,N)],className:{1:"keyword",3:"title.function"},contains:[Fe,Ie,H],illegal:[/\[/,/%/]},bt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Fe,Ie,H],illegal:/\[|%/},_t={match:[/operator/,/\s+/,N],className:{1:"keyword",3:"title"}},Et={begin:[/precedencegroup/,/\s+/,P],className:{1:"keyword",3:"title"},contains:[me],keywords:[...g,...p],end:/}/},$n={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},en={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},it={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,_,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:K,contains:[Fe,...Q,{begin:/:/,end:/\{/,keywords:K,contains:[{scope:"title.class.inherited",match:P},...Q],relevance:0}]};for(const We of Ke.variants){const vt=We.contains.find(Yt=>Yt.label==="interpol");vt.keywords=K;const ot=[...Q,...G,...ye,Z,Ke,...qt];vt.contains=[...ot,{begin:/\(/,end:/\)/,contains:["self",...ot]}]}return{name:"Swift",keywords:K,contains:[...F,Pt,bt,$n,en,it,_t,Et,{beginKeywords:"import",end:/$/,contains:[...F],relevance:0},Bt,...Q,...G,...ye,Z,Ke,...qt,...st,me,we]}}return fm=z,fm}var hm,Yy;function AM(){if(Yy)return hm;Yy=1;function e(t){const n="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,o]},h=t.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),v={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},S={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},T={begin:/\{/,end:/\}/,contains:[S],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[S],illegal:"\\n",relevance:0},R=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},v,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},T,N,c,d],O=[...R];return O.pop(),O.push(h),S.contains=O,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:R}}return hm=e,hm}var mm,Wy;function IM(){if(Wy)return mm;Wy=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d=[].concat(o,a,s);function h(p){const g=p.regex,x=(ne,{after:ue})=>{const he="</"+ne[0].slice(1);return ne.input.indexOf(he,ue)!==-1},v=e,S={begin:"<>",end:"</>"},T=/<[A-Za-z0-9\\._:-]+\s*\/>/,N={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,ue)=>{const he=ne[0].length+ne.index,Re=ne.input[he];if(Re==="<"||Re===","){ue.ignoreMatch();return}Re===">"&&(x(ne,{after:he})||ue.ignoreMatch());let ze;const Ke=ne.input.substring(he);if(ze=Ke.match(/^\s*=/)){ue.ignoreMatch();return}if((ze=Ke.match(/^\s+extends\s+/))&&ze.index===0){ue.ignoreMatch();return}}},R={$pattern:e,keyword:t,literal:n,built_in:d,"variable.language":c},O="[0-9](_?[0-9])*",_=`\\.(${O})`,P="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",U={className:"number",variants:[{begin:`(\\b(${P})((${_})|\\.)?|(${_}))[eE][+-]?(${O})\\b`},{begin:`\\b(${P})\\b((${_})\\b|\\.)?|(${_})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},A={className:"subst",begin:"\\$\\{",end:"\\}",keywords:R,contains:[]},z={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,A],subLanguage:"xml"}},X={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,A],subLanguage:"css"}},H={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,A],subLanguage:"graphql"}},$={className:"string",begin:"`",end:"`",contains:[p.BACKSLASH_ESCAPE,A]},Y={className:"comment",variants:[p.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:v+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),p.C_BLOCK_COMMENT_MODE,p.C_LINE_COMMENT_MODE]},oe=[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,z,X,H,$,{match:/\$\d+/},U];A.contains=oe.concat({begin:/\{/,end:/\}/,keywords:R,contains:["self"].concat(oe)});const ee=[].concat(Y,A.contains),q=ee.concat([{begin:/(\s*)\(/,end:/\)/,keywords:R,contains:["self"].concat(ee)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:R,contains:q},K={variants:[{match:[/class/,/\s+/,v,/\s+/,/extends/,/\s+/,g.concat(v,"(",g.concat(/\./,v),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,v],scope:{1:"keyword",3:"title.class"}}]},Q={relevance:0,match:g.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...a,...s]}},pe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,v,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(ne){return g.concat("(?!",ne.join("|"),")")}const D={match:g.concat(/\b/,W([...o,"super","import","await"].map(ne=>`${ne}\\s*\\(`)),v,g.lookahead(/\s*\(/)),className:"title.function",relevance:0},ye={begin:g.concat(/\./,g.lookahead(g.concat(v,/(?![0-9A-Za-z$_(])/))),end:v,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},se={match:[/get|set/,/\s+/,v,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},V="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+p.UNDERSCORE_IDENT_RE+")\\s*=>",Z={match:[/const|var|let/,/\s+/,v,/\s*/,/=\s*/,/(async\s*)?/,g.lookahead(V)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:R,exports:{PARAMS_CONTAINS:q,CLASS_REFERENCE:Q},illegal:/#(?![$_A-Za-z])/,contains:[p.SHEBANG({label:"shebang",binary:"node",relevance:5}),pe,p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,z,X,H,$,Y,{match:/\$\d+/},U,Q,{scope:"attr",match:v+g.lookahead(":"),relevance:0},Z,{begin:"("+p.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Y,p.REGEXP_MODE,{className:"function",begin:V,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:p.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:R,contains:q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:S.begin,end:S.end},{match:T},{begin:N.begin,"on:begin":N.isTrulyOpeningTag,end:N.end}],subLanguage:"xml",contains:[{begin:N.begin,end:N.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+p.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,p.inherit(p.TITLE_MODE,{begin:v,className:"title.function"})]},{match:/\.\.\./,relevance:0},ye,{match:"\\$"+v,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},D,G,K,se,{match:/\$[(.]/}]}}function m(p){const g=p.regex,x=h(p),v=e,S=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],T={begin:[/namespace/,/\s+/,p.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},N={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:S},contains:[x.exports.CLASS_REFERENCE]},R={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},O=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],_={$pattern:e,keyword:t.concat(O),literal:n,built_in:d.concat(S),"variable.language":c},P={className:"meta",begin:"@"+v},U=(H,$,F)=>{const Y=H.contains.findIndex(oe=>oe.label===$);if(Y===-1)throw new Error("can not find mode to replace");H.contains.splice(Y,1,F)};Object.assign(x.keywords,_),x.exports.PARAMS_CONTAINS.push(P);const A=x.contains.find(H=>H.scope==="attr"),z=Object.assign({},A,{match:g.concat(v,g.lookahead(/\s*\?:/))});x.exports.PARAMS_CONTAINS.push([x.exports.CLASS_REFERENCE,A,z]),x.contains=x.contains.concat([P,T,N,z]),U(x,"shebang",p.SHEBANG()),U(x,"use_strict",R);const X=x.contains.find(H=>H.label==="func.def");return X.relevance=0,Object.assign(x,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),x}return mm=m,mm}var pm,Zy;function _M(){if(Zy)return pm;Zy=1;function e(t){const n=t.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,h=/\d{1,2}(:\d{1,2}){1,2}/,m={className:"literal",variants:[{begin:n.concat(/# */,n.either(c,o),/ *#/)},{begin:n.concat(/# */,h,/ *#/)},{begin:n.concat(/# */,d,/ *#/)},{begin:n.concat(/# */,n.either(c,o),/ +/,n.either(d,h),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},g={className:"label",begin:/^\w+:/},x=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),v=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[a,s,m,p,g,x,v,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[v]}]}}return pm=e,pm}var gm,Xy;function MM(){if(Xy)return gm;Xy=1;function e(t){t.regex;const n=t.COMMENT(/\(;/,/;\)/);n.contains.push("self");const a=t.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},h={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},m={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[a,n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},c,d,o,t.QUOTE_STRING_MODE,m,p,h]}}return gm=e,gm}var bm,Qy;function OM(){if(Qy)return bm;Qy=1;var e=Z_();return e.registerLanguage("xml",X_()),e.registerLanguage("bash",Q_()),e.registerLanguage("c",J_()),e.registerLanguage("cpp",eM()),e.registerLanguage("csharp",tM()),e.registerLanguage("css",nM()),e.registerLanguage("markdown",rM()),e.registerLanguage("diff",aM()),e.registerLanguage("ruby",iM()),e.registerLanguage("go",sM()),e.registerLanguage("graphql",oM()),e.registerLanguage("ini",lM()),e.registerLanguage("java",cM()),e.registerLanguage("javascript",uM()),e.registerLanguage("json",dM()),e.registerLanguage("kotlin",fM()),e.registerLanguage("less",hM()),e.registerLanguage("lua",mM()),e.registerLanguage("makefile",pM()),e.registerLanguage("perl",gM()),e.registerLanguage("objectivec",bM()),e.registerLanguage("php",vM()),e.registerLanguage("php-template",yM()),e.registerLanguage("plaintext",xM()),e.registerLanguage("python",wM()),e.registerLanguage("python-repl",kM()),e.registerLanguage("r",SM()),e.registerLanguage("rust",EM()),e.registerLanguage("scss",TM()),e.registerLanguage("shell",CM()),e.registerLanguage("sql",RM()),e.registerLanguage("swift",NM()),e.registerLanguage("yaml",AM()),e.registerLanguage("typescript",IM()),e.registerLanguage("vbnet",_M()),e.registerLanguage("wasm",MM()),e.HighlightJS=e,e.default=e,bm=e,bm}var DM=OM();const Jy=md(DM),B7=/^(javascript|vbscript|data):/i;function jM(e){if(!e)return!1;const t=e.trim();return!(!t||B7.test(t))}function LM(e){if(!e)return!1;const t=e.trim();return!t||B7.test(t)||t.startsWith("blob:")||t.startsWith("data:image/")||/^https?:\/\//i.test(t)?!1:!!(t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t))}const zM=[[pA,{singleTilde:!1}],[b_,{singleDollarTextMath:!0}]],BM=[W_];let vm=null,e3=null;async function qM(){return vm||(e3??=Wk(()=>import("./mermaid.core-CKGQHWX_.js").then(e=>e.bp),[]).then(e=>{e.default.initialize({startOnLoad:!1,securityLevel:"strict",theme:"neutral"});const t=async(n,a)=>{const{svg:s}=await e.default.render(`oc-mermaid-${Math.random().toString(36).slice(2,10)}`,a);n.innerHTML=s};return vm=t,t}).catch(()=>null),e3)}function HM({code:e}){const t=w.useRef(null),[n,a]=w.useState(!1);return w.useEffect(()=>{let s=!1;return qM().then(o=>{if(s||!o||!t.current){o||a(!0);return}o(t.current,e).catch(()=>{s||a(!0)})}),()=>{s=!0}},[e]),n?u.jsx(E1,{lang:"mermaid",text:e}):u.jsx("div",{className:"oc-mermaid",ref:t,role:"img","aria-label":"Mermaid 图表"})}function E1({lang:e,text:t,children:n}){const[a,s]=w.useState(!1),o=w.useMemo(()=>{const d=Jy.getLanguage(e)?e:"";return d?Jy.highlight(t,{language:d,ignoreIllegals:!0}).value:void 0},[e,t]),c=()=>{navigator.clipboard?.writeText(t).then(()=>{s(!0),window.setTimeout(()=>s(!1),1600)},()=>{})};return u.jsxs("div",{className:"oc-codeblock",children:[u.jsxs("div",{className:"oc-codeblock-head",children:[u.jsx("span",{className:"oc-codeblock-lang",children:e||"text"}),u.jsx("button",{type:"button",className:"oc-codeblock-copy",onClick:c,children:a?"已复制":"复制"})]}),u.jsx("pre",{children:o!==void 0?u.jsx("code",{className:`hljs language-${e}`,dangerouslySetInnerHTML:{__html:o}}):u.jsx("code",{className:e?`hljs language-${e}`:"hljs",children:n??t})})]})}function UM(e){return e?.children?.find(a=>a.tagName==="thead"||a.tagName==="tbody")?.children?.find(a=>a.tagName==="tr")?.children?.filter(a=>a.tagName==="th"||a.tagName==="td").length??0}function T1(e){if(e==null||typeof e=="boolean")return"";if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(T1).join("");if(typeof e=="object"&&"props"in e){const t=e.props;return T1(t?.children)}return""}const FM={pre({children:e}){return u.jsx(u.Fragment,{children:e})},code({className:e,children:t,...n}){const a=T1(t).replace(/\n$/,""),s=/language-([\w-]+)/.exec(e??"");return s?.[1]==="mermaid"?u.jsx(HM,{code:a}):s||e&&a.includes(`
314
- `)?u.jsx(E1,{lang:s?.[1]??"",text:a}):a.includes(`
315
- `)?u.jsx(E1,{lang:"",text:a}):u.jsx("code",{className:e,...n,children:t})},a({href:e,children:t,...n}){if(!jM(e))return u.jsx("span",{...n,children:t});const a=/^https?:\/\//i.test(e??"");return u.jsx("a",{href:e,...a?{target:"_blank",rel:"noopener noreferrer"}:{},...n,children:t})},img({src:e,alt:t}){return LM(e)?u.jsxs(u.Fragment,{children:[u.jsx("img",{src:e,alt:t??"",loading:"lazy",onError:n=>{const a=n.currentTarget;a.hidden=!0,a.nextElementSibling?.removeAttribute("hidden")}}),u.jsx("span",{className:"oc-md-img-fallback",hidden:!0,title:e??void 0,children:t?`[图片加载失败: ${t}]`:"[图片加载失败]"})]}):u.jsx("span",{className:"oc-md-img-fallback",title:e??void 0,children:t?`[图片: ${t}]`:"[图片已屏蔽]"})},table({children:e,node:t}){const n=UM(t)>=4;return u.jsx("div",{className:`oc-md-table-wrap ${n?"is-wide":"is-fill"}`,tabIndex:n?0:void 0,children:u.jsx("table",{children:e})})},input(e){return e.type==="checkbox"?u.jsx("input",{type:"checkbox",checked:!!e.checked,disabled:!0,readOnly:!0}):u.jsx("input",{...e,disabled:!0,readOnly:!0})}};class $M extends w.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){}componentDidUpdate(t){t.text!==this.props.text&&this.state.hasError&&this.setState({hasError:!1})}render(){return this.state.hasError?u.jsx("div",{className:"oc-md",children:u.jsx("pre",{className:"oc-md-fallback",children:this.props.text})}):this.props.children}}function ic({text:e}){try{return u.jsx($M,{text:e,children:u.jsx("div",{className:"oc-md",children:u.jsx(rR,{remarkPlugins:zM,rehypePlugins:BM,components:FM,children:e})})})}catch{return u.jsx("div",{className:"oc-md",children:u.jsx("pre",{className:"oc-md-fallback",children:e})})}}const t3="无法在浏览器中打开:弹窗被拦截",PM="内容已截断,以下为已加载片段。";function GM(e){const t=e?.availWidth??1440,n=e?.availHeight??900,a=Math.min(1280,Math.max(880,Math.floor(t*.82))),s=Math.min(960,Math.max(640,Math.floor(n*.88)));return["popup=yes",`width=${a}`,`height=${s}`,"left=72","top=36","menubar=yes","toolbar=yes","location=yes","status=yes","resizable=yes","scrollbars=yes"].join(",")}function go(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Ld(e){return e.trim().toLowerCase()}function VM(e){const t=Ld(e);return t==="html"||t==="htm"}function KM(e){const t=Ld(e);return t==="md"||t==="markdown"}function YM(e){if(Ld(e.language)!=="json")return e.content;try{return JSON.stringify(JSON.parse(e.content),null,2)}catch{return e.content}}function WM(e){return/^https?:\/\//i.test(e.trim())}function Rl(e){const t=[];return e.replace(/`([^`]+)`/g,(o,c)=>(t.push(`<code>${c}</code>`),`\0${t.length-1}\0`)).replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(o,c,d)=>WM(d)?`<a href="${d}" rel="noopener noreferrer" target="_blank">${c}</a>`:c).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/__([^_]+)__/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/\u0000(\d+)\u0000/g,(o,c)=>t[Number(c)]??"")}function ZM(e){return e.length?`<p>${Rl(e.join(" "))}</p>`:""}function n3(e){const t=e.replaceAll(`\r
316
- `,`
317
- `).split(`
318
- `),n=[];let a=[],s=null;const o=()=>{s&&(n.push(s==="ul"?"</ul>":"</ol>"),s=null)},c=()=>{a.length&&(n.push(ZM(a)),a=[])};for(const d of t){const h=/^(#{1,6})\s+(.+)$/.exec(d);if(h){c(),o();const x=h[1].length;n.push(`<h${x}>${Rl(h[2])}</h${x}>`);continue}if(/^---+$/.test(d.trim())||/^\*\*\*+$/.test(d.trim())){c(),o(),n.push("<hr>");continue}const m=/^&gt;\s?(.*)$/.exec(d);if(m){c(),o(),n.push(`<blockquote><p>${Rl(m[1]??"")}</p></blockquote>`);continue}const p=/^[-*]\s+(.+)$/.exec(d);if(p){c(),s!=="ul"&&(o(),n.push("<ul>"),s="ul"),n.push(`<li>${Rl(p[1])}</li>`);continue}const g=/^\d+\.\s+(.+)$/.exec(d);if(g){c(),s!=="ol"&&(o(),n.push("<ol>"),s="ol"),n.push(`<li>${Rl(g[1])}</li>`);continue}if(d.trim()===""){c(),o();continue}o(),a.push(d)}return c(),o(),n.join(`
319
- `)}function XM(e){const t=go(e),n=[],a=/```([^\n`]*)\n([\s\S]*?)```/g;let s=0,o;for(;o=a.exec(t);)o.index>s&&n.push(n3(t.slice(s,o.index))),n.push(`<pre class="md-code"><code>${o[2]??""}</code></pre>`),s=o.index+o[0].length;return s<t.length&&n.push(n3(t.slice(s))),n.filter(Boolean).join(`
320
- `)}function QM(){return`
321
- :root { color-scheme: light dark; }
322
- html, body { margin: 0; min-height: 100%; background: #f7f5f0; color: #1f1b16; }
323
- body { font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
324
- .bar { position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: center; padding: 10px 16px 10px 20px; border-bottom: 1px solid #e4ddd2; background: #fffdf8; }
325
- .bar .meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
326
- .bar strong { font-size: 13px; font-weight: 650; word-break: break-all; }
327
- .bar .kind { color: #6b6258; font-size: 12px; }
328
- .modes { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #e4ddd2; border-radius: 8px; background: #f3eee6; }
329
- .modes button { appearance: none; border: 0; background: transparent; color: #6b6258; font: 12px/1.2 inherit; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
330
- .modes button:hover { color: #1f1b16; }
331
- .modes button.is-active { background: #fff; color: #1f1b16; font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
332
- .notice { margin: 0; padding: 8px 20px; background: #fff6d8; color: #5c4b00; font-size: 13px; }
333
- .pane { display: none; }
334
- .pane.is-active { display: block; }
335
- .doc { max-width: 52rem; margin: 0 auto; padding: 32px 24px 96px; }
336
- .doc.md h1, .doc.md h2, .doc.md h3, .doc.md h4 { line-height: 1.25; margin: 1.4em 0 0.5em; }
337
- .doc.md h1 { font-size: 2rem; }
338
- .doc.md h2 { font-size: 1.45rem; }
339
- .doc.md p { margin: 0.8em 0; }
340
- .doc.md ul, .doc.md ol { margin: 0.6em 0; padding-left: 1.4em; }
341
- .doc.md blockquote { margin: 0.8em 0; padding: 0.2em 0.9em; border-left: 3px solid #d9cfc0; color: #4a433c; }
342
- .doc.md hr { border: 0; border-top: 1px solid #e4ddd2; margin: 1.6em 0; }
343
- .doc.md a { color: #0b57d0; }
344
- .doc.md code, .md-code, .source { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
345
- .doc.md :not(pre) > code { padding: 0.1em 0.35em; border-radius: 4px; background: #efe8dc; }
346
- .md-code, .source { margin: 1em 0; padding: 14px 16px; overflow: auto; white-space: pre-wrap; background: #fff; border: 1px solid #e4ddd2; border-radius: 8px; }
347
- .frame { margin: 0; padding: 0; }
348
- iframe.page { display: block; width: 100%; height: calc(100vh - 53px); border: 0; background: #fff; }
349
- `.trim()}function q7(e){return go(YM(e))}function JM(e){return VM(e.language)?`<div class="frame"><iframe class="page" sandbox="" srcdoc="${go(e.content)}"></iframe></div>`:KM(e.language)?`<article class="doc md">${XM(e.content)}</article>`:`<article class="doc"><pre class="source">${q7(e)}</pre></article>`}function eO(e){return`<article class="doc"><pre class="source">${q7(e)}</pre></article>`}function tO(){return`<script>
350
- (function () {
351
- var previewBtn = document.getElementById("view-preview");
352
- var sourceBtn = document.getElementById("view-source");
353
- var previewPane = document.getElementById("pane-preview");
354
- var sourcePane = document.getElementById("pane-source");
355
- if (!previewBtn || !sourceBtn || !previewPane || !sourcePane) return;
356
- function show(mode) {
357
- var source = mode === "source";
358
- previewBtn.classList.toggle("is-active", !source);
359
- sourceBtn.classList.toggle("is-active", source);
360
- previewBtn.setAttribute("aria-pressed", String(!source));
361
- sourceBtn.setAttribute("aria-pressed", String(source));
362
- previewPane.classList.toggle("is-active", !source);
363
- sourcePane.classList.toggle("is-active", source);
364
- }
365
- previewBtn.addEventListener("click", function () { show("preview"); });
366
- sourceBtn.addEventListener("click", function () { show("source"); });
367
- })();
368
- <\/script>`}function nO(e){const t=go(e.path),n=e.truncated?`<p class="notice">${go(PM)}</p>`:"",a=Ld(e.language);return`<!doctype html>
369
- <html lang="zh-CN">
370
- <head>
371
- <meta charset="utf-8">
372
- <meta name="viewport" content="width=device-width, initial-scale=1">
373
- <title>${t}</title>
374
- <style>
375
- ${QM()}
376
- </style>
377
- </head>
378
- <body>
379
- <header class="bar">
380
- <div class="meta">
381
- <strong>${t}</strong>
382
- <span class="kind">${go(a||"text")}${e.truncated?" · 已截断":""}</span>
383
- </div>
384
- <div class="modes" role="group" aria-label="查看模式">
385
- <button type="button" id="view-preview" class="is-active" aria-pressed="true">预览</button>
386
- <button type="button" id="view-source" aria-pressed="false">查看原文</button>
387
- </div>
388
- </header>
389
- ${n}
390
- <div id="pane-preview" class="pane is-active">${JM(e)}</div>
391
- <div id="pane-source" class="pane">${eO(e)}</div>
392
- ${tO()}
393
- </body>
394
- </html>`}function rO(){const e=globalThis.screen;return{availWidth:e?.availWidth,availHeight:e?.availHeight}}function aO(){const e=globalThis;if(typeof e.open!="function")throw new Error("window.open is unavailable");return{open:e.open.bind(e),createObjectURL:e.URL.createObjectURL.bind(e.URL),revokeObjectURL:e.URL.revokeObjectURL.bind(e.URL)}}function iO(e,t=aO(),n=GM(rO())){let a;try{const s=nO(e),o=new Blob([s],{type:"text/html;charset=utf-8"});a=t.createObjectURL(o);const c=t.open(a,"_blank",n);if(!c)return t.revokeObjectURL(a),{ok:!1,error:t3};try{c.opener=null}catch{}return{ok:!0}}catch{return a&&t.revokeObjectURL(a),{ok:!1,error:t3}}}function Mu(e){const t=e.nodes.length,n=e.nodes.filter(a=>["succeeded","completed","passed"].includes(a.status)).length;return{completed:n,total:t,pct:t?Math.round(n/t*100):0}}function r3(e){const[t,n]=w.useState("files"),a=e.activeTab??t,s=!!e.dagRunId,o=[{id:"files",label:"文件"},...e.contextContent?[{id:"context",label:"上下文"}]:[],...e.callsContent?[{id:"calls",label:"调用记录"}]:[],...s?[{id:"dag",label:"DAG"}]:[]],c=o.some(N=>N.id===a)?a:"files",d=w.useRef(null),h=w.useRef(null),m=w.useRef(null),p=w.useRef(null),g=w.useRef(null),x=w.useRef(e.open),v=N=>{n(N),e.onSelectTab?.(N)},S=N=>{switch(N){case"context":return h;case"calls":return m;case"dag":return p;default:return d}};w.useEffect(()=>{c!==a&&v(c)},[a,c]),w.useEffect(()=>{const N=x.current;x.current=e.open,!N&&e.open&&g.current?.focus()},[e.open]);const T=N=>{if(o.length<2)return;let R=null;const O=Math.max(0,o.findIndex(_=>_.id===c));if(N.key==="ArrowLeft"||N.key==="ArrowRight"){const _=N.key==="ArrowRight"?1:-1;R=o[(O+_+o.length)%o.length]?.id??null}else N.key==="Home"?R=o[0]?.id??null:N.key==="End"&&(R=o[o.length-1]?.id??null);R&&(N.preventDefault(),v(R),S(R).current?.focus())};return e.open?u.jsxs("aside",{className:"oc-details-rail","aria-label":"辅助栏",children:[u.jsxs("header",{className:"oc-details-rail-head",children:[u.jsx("div",{className:"oc-details-tabs",role:"tablist","aria-label":"辅助栏",children:o.map(N=>{const R=N.id==="context"||N.id==="calls"?N.id:null;return u.jsxs("div",{className:`oc-details-tab${c===N.id?" is-active":""}`,role:"presentation",children:[u.jsx("button",{type:"button",id:`oc-details-tab-${N.id}`,ref:S(N.id),role:"tab","aria-selected":c===N.id,"aria-controls":"oc-details-rail-body",tabIndex:c===N.id?0:-1,className:"oc-details-tab-select",onClick:()=>v(N.id),onKeyDown:T,children:N.label}),R&&e.onCloseTab?u.jsx("button",{type:"button",className:"oc-details-tab-close","aria-label":`关闭${N.label}标签页`,title:`关闭${N.label}`,onClick:()=>e.onCloseTab?.(R),children:u.jsx(Cs,{size:13,"aria-hidden":"true"})}):null]},N.id)})}),u.jsx("button",{type:"button",className:"oc-details-rail-toggle",ref:g,onClick:e.onToggleOpen,"aria-label":"关闭辅助栏","aria-expanded":e.open,"aria-controls":"oc-details-rail-body",title:"关闭辅助栏",children:u.jsx(Lk,{})})]}),e.open?u.jsx("div",{id:"oc-details-rail-body",className:"oc-details-rail-body",role:"tabpanel","aria-labelledby":`oc-details-tab-${c}`,"data-tab":c,children:c==="dag"&&e.dagRunId?u.jsxs("section",{className:"oc-details-dag","aria-label":"当前 DAG",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"当前 DAG"}),u.jsx("code",{children:e.dagRunId})]}),e.dagRun?u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"oc-details-dag-point",children:["运行点:",u.jsx("code",{children:e.dagRun.currentNodeId??"—"}),e.dagRun.status?u.jsxs("span",{children:["(",e.dagRun.status,")"]}):null]}),u.jsx("ul",{className:"oc-details-dag-nodes","aria-label":"DAG 节点",children:e.dagRun.nodes.map(N=>u.jsxs("li",{"data-status":N.status,children:[u.jsx("span",{className:"oc-details-dag-node-id",children:N.id}),u.jsx("span",{className:"oc-details-dag-node-status",children:N.status})]},N.id))}),u.jsxs("p",{className:"oc-details-dag-progress",children:["完成 ",Mu(e.dagRun).completed,"/",Mu(e.dagRun).total]}),u.jsx("div",{className:"oc-details-dag-progressbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Mu(e.dagRun).pct,"aria-label":"DAG 完成进度",children:u.jsx("div",{className:"oc-details-dag-progressfill",style:{width:`${Mu(e.dagRun).pct}%`}})})]}):u.jsx("p",{className:"oc-details-dag-empty-reason",children:"当前运行暂无安全汇总数据,等待运行数据同步。"})]}):c==="context"?e.contextContent:c==="calls"?e.callsContent:e.children},c):null]}):u.jsx("aside",{className:"oc-details-rail is-collapsed","aria-label":"辅助栏","aria-hidden":"true",inert:!0})}function sO(e){return e.language==="md"||e.language==="markdown"}function a3(e){const t=e.previews.find(d=>d.path===e.activePath),n=t?sO(t):!1,[a,s]=w.useState(n?"preview":"source"),[o,c]=w.useState(null);return w.useEffect(()=>{s(n?"preview":"source"),c(null)},[t?.path,n]),!t&&!e.loading?null:u.jsxs(u.Fragment,{children:[t&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"oc-file-preview-backdrop",onMouseDown:d=>{d.target===d.currentTarget&&e.onClose(t.path)}}),u.jsxs("section",{className:"oc-file-preview","aria-label":`文件预览 ${t.path}`,children:[u.jsxs("header",{children:[u.jsx("div",{className:"oc-file-tabs",role:"tablist","aria-label":"文件预览 Tabs",children:e.previews.map(d=>{const h=d.path===t.path;return u.jsxs("div",{className:`oc-file-tab${h?" is-active":""}`,title:d.path,children:[u.jsx("button",{type:"button",role:"tab","aria-selected":h,className:"oc-file-tab-activate",onClick:()=>e.onActivate(d.path),children:d.path}),u.jsx("button",{type:"button",className:"oc-file-preview-close","aria-label":`关闭预览 ${d.path}`,title:"关闭预览",onClick:()=>e.onClose(d.path),children:u.jsx(Cs,{size:14,"aria-hidden":"true"})})]},d.path)})}),u.jsxs("span",{children:[t.bytes," bytes",t.truncated?" · 已截断":""]}),u.jsxs("div",{className:"oc-file-preview-actions",children:[n&&u.jsxs("div",{className:"oc-file-view-modes",role:"group","aria-label":"文件查看模式",children:[u.jsx("button",{type:"button",className:`oc-file-view-mode${a==="preview"?" is-active":""}`,"aria-pressed":a==="preview",onClick:()=>s("preview"),children:"预览"}),u.jsx("button",{type:"button",className:`oc-file-view-mode${a==="source"?" is-active":""}`,"aria-pressed":a==="source",onClick:()=>s("source"),children:"源文件"})]}),u.jsx("button",{type:"button",className:"oc-file-preview-open",title:"新窗口打开","aria-label":`新窗口打开 ${t.path}`,onClick:()=>{const d=iO(t);c(d.ok?null:d.error)},children:u.jsx(rk,{size:16,"aria-hidden":"true"})})]})]}),o?u.jsx("p",{className:"oc-file-preview-open-error",role:"alert",children:o}):null,a==="preview"&&n?u.jsx("div",{className:"oc-file-preview-rendered",children:u.jsx(ic,{text:t.content})}):u.jsx("pre",{children:u.jsx("code",{children:t.content})})]})]}),e.loading&&u.jsx("div",{className:"oc-file-preview-loading",children:"正在读取文件…"})]})}const H7=[{command:"/task",label:"Task context",description:"查看当前任务、Draft 与 assessment",action:"focus-panel:task",source:"operator"},{command:"/contract",label:"Contract",description:"查看 contract diff 与 apply gate",action:"focus-panel:contract",source:"operator"},{command:"/dag",label:"DAG",description:"查看 DAG spine、确认与运行状态",action:"focus-panel:dag",source:"operator"},{command:"/interview",label:"Interview",description:"打开 Requirement Interview",action:"focus:interview",source:"operator"},{command:"/reload",label:"Reload session",description:"重新加载当前 Pi 会话的设置、扩展、技能、提示词、主题与上下文文件(不产生消息)",action:"reload",source:"operator"}],U7=[{command:"/compact",label:"压缩上下文",description:"压缩当前会话上下文,释放 token",action:"compact",source:"web"},{command:"/name",label:"重命名会话",description:"设置当前会话标题",action:"name",source:"web"},{command:"/session",label:"会话信息",description:"显示当前会话元信息",action:"session",source:"web"},{command:"/copy",label:"复制回复",description:"复制最后一条助手消息原文",action:"copy",source:"web"}],ks={operator:0,web:1,extension:2,skill:3,prompt:4};function i3(e){const t=e.trim().split(/\s+/,1)[0]??"";return t?t.startsWith("/")?t.toLowerCase():`/${t.toLowerCase()}`:""}function s3(e){const t=e.trim().split(/\s+/,1)[0]?.toLowerCase();if(!t?.startsWith("/"))return;const n=[...H7,...U7].find(a=>a.command===t);return n?{command:n.command,action:n.action}:{command:t,action:"unknown"}}function oO(e){if(e==="focus-panel:task"||e==="focus-panel:contract")return"tasks";if(e==="focus-panel:dag")return"recovery"}function lO(e=[]){const t=new Map,n=a=>{const s=i3(a.command);if(!s)return;const o=t.get(s);if(!o){t.set(s,{...a,command:s});return}ks[a.source]<ks[o.source]&&t.set(s,{...a,command:s})};for(const a of H7)n({command:a.command,label:a.label,description:a.description,source:a.source,action:a.action});for(const a of U7)n({command:a.command,label:a.label,description:a.description,source:a.source,action:a.action});for(const a of e){const s=i3(a.command);s&&n({command:s,label:a.label||s,description:a.description||"",source:a.source,action:"pi-prompt"})}return[...t.values()].sort((a,s)=>{const o=ks[a.source]-ks[s.source];return o!==0?o:a.command.localeCompare(s.command)})}function cO(e,t){const n=(t.trim().split(/\s+/,1)[0]??"").toLowerCase();if((/\s/.test(t.trimStart().slice(1))||t.includes(" "))&&t.trimStart().includes(" "))return[];const a=n.startsWith("/")?n:n?`/${n}`:"/",s=a==="/"?"":a.slice(1),o=[];for(const c of e){const d=c.command.toLowerCase(),h=d.startsWith("/")?d.slice(1):d,m=c.description.toLowerCase();let p=100;if(!s)p=10+ks[c.source];else if(d===a||h===s)p=0;else if(d.startsWith(a)||h.startsWith(s))p=1;else if(h.includes(s)||d.includes(s))p=2;else if(m.includes(s))p=3;else continue;o.push({...c,score:p})}return o.sort((c,d)=>{if(c.score!==d.score)return c.score-d.score;const h=ks[c.source]-ks[d.source];return h!==0?h:c.command.localeCompare(d.command)})}const uO={operator:"Operator",web:"Pi Web",extension:"Extensions",prompt:"Prompts",skill:"Skills"},dO=new Set(["operatorCapabilities","operationList","operationGet","operationEventSummary","statsContext","sourceInstructions","spineCheck","inspect","observeLink"]);function fO(e){return dO.has(e)?"technical-only":e==="doctor"?"inline-detail":"activity-detail"}const hO={newTask:"创建任务",importPrd:"任务需求",contractShow:"任务边界",contractApply:"更新任务契约",contractDiff:"任务契约差异",contractDraftSave:"任务契约草稿",contractValidate:"检查任务契约",taskAdvance:"推进任务准备",dagRunTask:"执行流程",dagValidate:"校验执行流程",prepareDagConfirmation:"执行确认",confirmDagConfirmation:"确认执行边界",prepareDagExecution:"执行边界",runDag:"任务执行",operationWait:"执行监督",operationGet:"任务活动详情",operationList:"会话活动",operationEventSummary:"执行进展摘要",dagStatus:"执行状态",dagDoctor:"执行诊断",dagReport:"执行结果",dagRerunPlan:"节点恢复评估",dagRerun:"从失败节点恢复",dagInterruptEligibility:"中止资格",standaloneTaskRerun:"带反馈重新执行",workerTaskRetry:"重试 Worker 任务",workerPoolDoctor:"任务池诊断",promoteRun:"任务推进",status:"任务状态"},mO={newTask:{running:"正在创建任务",success:"任务已经创建",error:"创建任务时遇到问题"},importPrd:{running:"正在整理并导入任务需求",success:"任务需求已经导入",error:"导入任务需求时遇到问题"},contractShow:{running:"正在读取任务目标和执行边界",success:"任务目标与执行边界已经读取",error:"读取任务边界时遇到问题"},taskAdvance:{running:"正在推进任务契约并准备执行流程",success:"任务已经推进到下一安全阶段",error:"任务推进被契约或执行边界阻塞"},dagRunTask:{running:"正在生成并校验执行流程",success:"执行流程已经准备好",error:"准备执行流程时遇到问题"},prepareDagExecution:{running:"正在确认任务可以安全执行",success:"执行边界已经确认",error:"执行边界尚未通过确认"},runDag:{running:"正在启动任务执行",success:"任务执行已经启动",error:"启动任务执行时遇到问题"},dagReport:{running:"正在读取本次执行结果",success:"本次执行结果已经读取",error:"读取执行结果时遇到问题"},dagRerunPlan:{running:"正在评估能否从失败节点安全恢复",success:"节点恢复条件评估已经完成",error:"暂时无法确定安全的恢复方式"},dagRerun:{running:"正在创建节点恢复 run",success:"节点恢复 run 已经启动",error:"从失败节点恢复时遇到问题"},dagInterruptEligibility:{running:"正在检查能否协作中止此运行",success:"中止资格已经确认",error:"当前运行不能协作中止"},standaloneTaskRerun:{running:"正在创建新的完整 DAG,并带入上一轮未解决反馈",success:"新的完整 DAG 已经按上一轮反馈重新执行",error:"带反馈重新执行任务时遇到问题"},workerPoolDoctor:{running:"正在读取任务池状态",success:"任务池状态已经读取",error:"读取任务池状态时遇到问题"},promoteRun:{running:"正在推进任务状态",success:"任务状态已经更新",error:"推进任务状态时遇到问题"},status:{running:"正在读取任务状态",success:"任务状态已经更新",error:"读取任务状态时遇到问题"},contractApply:{running:"正在应用任务契约变更",success:"任务契约已经更新",error:"应用任务契约变更时遇到问题"},contractDiff:{running:"正在比较任务契约版本",success:"任务契约差异已经读取",error:"比较任务契约时遇到问题"},contractDraftSave:{running:"正在保存任务契约草稿",success:"任务契约草稿已经保存",error:"保存任务契约草稿时遇到问题"},contractValidate:{running:"正在检查任务契约",success:"任务契约检查已经完成",error:"任务契约检查没有通过"},dagValidate:{running:"正在校验执行流程",success:"执行流程校验已经通过",error:"执行流程校验没有通过"},prepareDagConfirmation:{running:"正在准备执行确认",success:"执行确认已经准备好",error:"准备执行确认时遇到问题"},confirmDagConfirmation:{running:"正在确认执行边界",success:"执行边界已经确认",error:"执行边界尚未通过确认"},operationGet:{running:"正在读取任务活动详情",success:"任务活动详情已经读取",error:"读取任务活动详情时遇到问题"},operationList:{running:"正在读取本次对话的活动",success:"本次对话的活动已经读取",error:"读取对话活动时遇到问题"},operationEventSummary:{running:"正在汇总执行进展",success:"执行进展已经汇总",error:"汇总执行进展时遇到问题"},dagStatus:{running:"正在读取执行状态",success:"执行状态已经更新",error:"读取执行状态时遇到问题"},dagDoctor:{running:"正在诊断本次任务执行",success:"任务执行诊断已经完成",error:"诊断任务执行时遇到问题"},workerTaskRetry:{running:"正在重试失败的任务",success:"失败任务已经重新开始",error:"重试失败任务时遇到问题"},doctor:{running:"正在检查运行环境",success:"运行环境检查已经完成",error:"运行环境检查发现问题"},inspect:{running:"正在读取详细运行信息",success:"详细运行信息已经读取",error:"读取详细运行信息时遇到问题"},observeLink:{running:"正在准备运行看板入口",success:"运行看板入口已经准备好",error:"准备运行看板入口时遇到问题"},operatorCapabilities:{running:"正在读取可用操作能力",success:"可用操作能力已经读取",error:"读取可用操作能力时遇到问题"},sourceInstructions:{running:"正在读取任务来源说明",success:"任务来源说明已经读取",error:"读取任务来源说明时遇到问题"},spineCheck:{running:"正在检查计划执行步骤",success:"计划执行步骤检查已经完成",error:"计划执行步骤检查发现问题"},statsContext:{running:"正在统计上下文使用情况",success:"上下文使用情况已经统计完成",error:"统计上下文使用情况时遇到问题"}},pO=[{pattern:/(?:^|-)contract(?:-pi)?$/i,running:"正在核对任务目标和执行边界",finished:"任务目标与执行边界已确认",error:"任务边界存在冲突,需要先处理"},{pattern:/scout-src/i,running:"正在梳理与任务相关的代码",finished:"相关代码范围已梳理",error:"梳理相关代码时遇到问题"},{pattern:/scout-tests/i,running:"正在检查现有测试和验证方式",finished:"现有测试与验证方式已确认",error:"检查现有测试时遇到问题"},{pattern:/plan/i,running:"正在整理具体实施步骤",finished:"实施步骤已经准备好",error:"实施方案还需要进一步完善"},{pattern:/implement|writer/i,running:"正在修改并保存相关文件",finished:"文件修改已经完成",error:"修改文件时遇到问题"},{pattern:/verify|reverify/i,running:"正在验证本次修改",finished:"本次修改已通过验证",error:"验证没有通过,正在检查原因"},{pattern:/review/i,running:"正在检查改动是否完整",finished:"改动完整性检查已通过",error:"发现需要补充或修正的内容"},{pattern:/closeout/i,running:"正在整理交付结果",finished:"任务已经完成并形成交付记录",error:"交付结果尚未整理完整"}];function F7(e){if(!(!e||typeof e!="object"))return e}function Cp(e){if(e&&typeof e=="object")return e;if(typeof e=="string")try{return F7(JSON.parse(e))}catch{return}}function ym(e){const n=Cp(e)?.operationId;return typeof n=="string"&&n?n:void 0}function gO(e){const n=Cp(e)?.maxWaitMs;if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return Math.max(1,Math.round(n/1e3))}function $7(e){const t=e.operationId??ym(e.args)??ym(e.result)??ym(e.resultText);return t?`operation:${t}`:`tool:${e.id}`}function bO(e){return e==="running"?"progress":e==="error"?"error":"success"}function vO(e){return Cp(e.resultText??e.result)}function yO(e){return Array.isArray(e.events)?e.events.flatMap(t=>{const n=F7(t);if(!n)return[];const a=n.messagePreview??n.message;return typeof a=="string"?[a]:[]}):[]}function xO(e,t,n){const a=[];for(const h of e)for(const m of h.matchAll(/node-(started|finished)[^\n]*?node=([^\s,]+)/gi)){const p=m[1]?.toLowerCase(),g=m[2]??"",x=h.match(/status=([^\s,]+)/i)?.[1]?.toUpperCase();let v="finished";x==="ERROR"||x==="FAILED"?v="error":p==="started"&&(v="running"),a.push({node:g,status:v})}const s=a.at(-1);if(!s)return;const o=a.some(h=>/scout-src/i.test(h.node)&&h.status==="finished"),c=a.some(h=>/scout-tests/i.test(h.node)&&h.status==="finished");if(o&&c)return{id:t,kind:"success",title:"代码与测试的影响范围已确认",activityRef:n};const d=pO.find(h=>h.pattern.test(s.node));return d?s.status==="running"?{id:t,kind:"progress",title:d.running,activityRef:n}:s.status==="error"?{id:t,kind:"error",title:d.error,activityRef:n}:{id:t,kind:"success",title:d.finished,activityRef:n}:{id:t,kind:"success",title:"执行状态已经更新",activityRef:n}}function wO(e){const t=$7(e),n=`activity:${e.id}`,a=gO(e.args);if(e.status==="running")return{id:n,kind:"progress",title:a?`正在等待新的执行进展,最长等待时间 ${a} 秒`:"正在等待新的执行进展",activityRef:t};if(e.status==="error")return{id:n,kind:"error",title:"等待执行进展时遇到问题",activityRef:t};let s="";typeof e.resultText=="string"?s=e.resultText:typeof e.result=="string"&&(s=e.result);const o=vO(e),c=xO([s,...o?yO(o):[]],n,t);if(c)return c;if(o){if(o.timedOut===!0||o.changed===!1)return{id:n,kind:"warning",title:"等待期间没有新的执行进展",activityRef:t};if(o.changed===!0)return{id:n,kind:"success",title:"已经收到新的执行进展",activityRef:t}}return{id:n,kind:"success",title:"执行状态已经更新",activityRef:t}}function kO(e){const t=fO(e.toolName);if(t==="technical-only"||t==="inline-detail")return;if(e.toolName==="operationWait")return wO(e);const n=mO[e.toolName];if(!n)return;let a=n.success;return e.status==="running"?a=n.running:e.status==="error"&&(a=n.error),{id:`activity:${e.id}`,kind:bO(e.status),title:a,activityRef:$7(e)}}function P7(e){return hO[e]??"任务活动"}function Rp(e){switch(e){case"starting":return{label:"正在启动",kind:"progress"};case"running":return{label:"运行中",kind:"progress"};case"succeeded":case"finished":case"FINISHED":case"pass":return{label:"已完成",kind:"success"};case"failed":case"partial_failed":case"ERROR":case"FAILED":case"timed-out":return{label:"未完成",kind:"error"};case"needs-reconcile":return{label:"需要同步",kind:"warning"};case"cancelled":case"abandoned":case"superseded":return{label:"已停止",kind:"warning"};default:return{label:"状态已更新",kind:"success"}}}function G7(e){return[e.activityRef??`operation:${e.operationId}`,`operation:${e.operationId}`,...e.toolCallId?[`tool:${e.toolCallId}`]:[]]}function V7(e){return[e.activityRef??`gate:${e.cardId}`]}function K7(e){return[e.activityRef??`artifact:${e.artifactId}`]}function SO(e){return new Set([...e.operations.flatMap(G7),...e.gates.flatMap(V7),...e.artifacts.flatMap(K7)])}function o3(e){return e.updatedSeq??e.eventSeq}function l3(e){const t=Date.parse(e.updatedAt);return Number.isFinite(t)?t:0}function Np(e,t){const n=o3(e),a=o3(t);return n!==void 0&&a!==void 0?n-a:l3(e)-l3(t)}function EO(e){return e.taskId?`task:${e.taskId}`:e.dagRunId?`run:${e.dagRunId}`:`operation:${e.operationId}`}function TO(e){return e.taskId?e.taskId.replace(/^\d{4}-\d{2}-\d{2}-/,"").replace(/[-_]+/g," ").trim()||e.taskId:P7(e.action)}function CO(e){return[...new Set(e)]}function RO(e){const t=new Map;for(const n of e)t.set(n.action,n);return[...t.values()].sort(Np).map(n=>{const a=Rp(n.state);return{id:n.operationId,label:P7(n.action),stateLabel:a.label,kind:a.kind,at:n.updatedAt}})}function NO(e){const t=new Map;for(const n of e){const a=n.dagRunId??n.runSummary?.runId;if(!a)continue;const s=t.get(a)??[];s.push(n),t.set(a,s)}return[...t.entries()].flatMap(([n,a])=>{const s=[...a].sort((m,p)=>Np(p,m)),o=s[0];if(!o)return[];const c=s.find(m=>m.runSummary)?.runSummary,d=c?.status??o.state,h=Rp(d);return[{runId:n,state:d,stateLabel:h.label,kind:h.kind,updatedAt:o.updatedAt,operationCount:a.length,firstFailedNode:c?.nodes.find(m=>m.status==="ERROR")?.id,failureCategory:c?.failureCategory,inspectHref:o.inspectHref}]}).sort((n,a)=>Date.parse(a.updatedAt)-Date.parse(n.updatedAt))}function Y7(e){const t=new Map;for(const n of e){const a=EO(n),s=t.get(a)??[];s.push(n),t.set(a,s)}return[...t.entries()].flatMap(([n,a])=>{const s=[...a].sort(Np),o=s.at(-1);if(!o)return[];const c=Rp(o.state);return[{key:n,taskId:o.taskId,displayTitle:TO(o),state:o.state,stateLabel:c.label,kind:c.kind,updatedAt:o.updatedAt,latestOperation:o,operations:s,steps:RO(s),runs:NO(s),activityRefs:CO(s.flatMap(G7)),compactEligible:c.kind==="success"}]}).sort((n,a)=>{const s=n.kind==="progress"||n.kind==="error"?0:1,o=a.kind==="progress"||a.kind==="error"?0:1;return s!==o?s-o:Date.parse(a.updatedAt)-Date.parse(n.updatedAt)})}const AO={operation:"执行记录",contract:"任务契约",dag:"执行流程",report:"报告",html:"HTML 预览"};function IO(e){const{artifact:t}=e,n=!!(t.reportText||t.htmlPreview);return u.jsxs("section",{className:"oc-artifact-card","aria-label":`任务产物:${t.title??t.artifactId}`,"data-activity-ref":t.activityRef??`artifact:${t.artifactId}`,children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("small",{children:"任务产物"}),u.jsx("strong",{children:t.title??t.artifactId}),u.jsx("code",{children:t.artifactId})]}),u.jsx("span",{children:AO[t.kind]})]}),t.summary?u.jsx("p",{children:t.summary}):null,n?u.jsxs("details",{className:"oc-artifact-details",children:[u.jsx("summary",{children:"预览与技术详情"}),t.reportText?u.jsx("pre",{children:t.reportText}):null,t.htmlPreview?u.jsx("iframe",{title:`${t.title??t.artifactId} preview`,sandbox:"",srcDoc:t.htmlPreview}):null]}):null,t.inspectHref?u.jsx("footer",{children:u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>Ts(Pi(t.inspectHref??"")),children:"打开产物"})}):null]})}const c3={prepared:"等待确认",confirmed:"已经确认",dispatched:"正在执行",consumed:"已经完成",stale:"已经失效",expired:"已经过期",error:"处理失败"};function u3(e){return e.gateType==="contract-apply"?"确认任务契约变更":e.gateType==="mutation"?"确认执行工作区修改":"确认启动任务执行"}function _O({card:e,origin:t,sessionId:n}){const[a,s]=w.useState(!1),[o,c]=w.useState(),d=async()=>{s(!0),c(void 0);try{let g="contract-apply";e.gateType==="dag-run"?g=e.state==="prepared"?"dag-confirm":"dag-run":e.gateType==="mutation"&&(g="mutation-apply");const x=e.gateType==="dag-run"?{confirmationId:e.confirmationId,...e.state==="prepared"?{humanGateToken:e.humanGateToken}:{}}:{receiptId:e.receiptId,humanGateToken:e.humanGateToken},v=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/human-gate/${g}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify(x)}),S=await v.json();if(!v.ok)throw new Error(S.error?.message??`HTTP ${v.status}`)}catch(g){c(g instanceof Error?g.message:String(g))}finally{s(!1)}},h=e.state==="prepared"||e.gateType==="dag-run"&&e.state==="confirmed";let m="确认接受";e.gateType==="mutation"?m="确认执行":e.gateType==="dag-run"&&(m=e.state==="prepared"?"确认边界":"启动执行");const p=(e.displayOnlyChallenges?.length??0)+(e.dagSpine?.length??0);return u.jsxs("section",{className:`oc-human-gate-card is-${e.state}`,"aria-label":`${u3(e)}:${c3[e.state]}`,"data-activity-ref":e.activityRef??`gate:${e.cardId}`,children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("small",{children:"人工门禁"}),u.jsx("strong",{children:u3(e)}),u.jsx("code",{children:e.taskId})]}),u.jsx("span",{children:c3[e.state]})]}),e.contractDiffSummary?u.jsx("p",{className:"oc-human-gate-summary",children:e.contractDiffSummary}):null,p>0||e.errorMessage?u.jsxs("details",{className:"oc-human-gate-details",children:[u.jsxs("summary",{children:["门禁详情 · ",p," 项"]}),e.displayOnlyChallenges?.length?u.jsxs("div",{className:"oc-human-gate-challenges",children:[u.jsx("b",{children:"确认前请检查"}),u.jsx("ul",{children:e.displayOnlyChallenges.map(g=>u.jsx("li",{children:g},g))})]}):null,e.dagSpine?.length?u.jsxs("div",{children:[u.jsx("b",{children:"计划执行步骤"}),u.jsx("ol",{children:e.dagSpine.map(g=>u.jsx("li",{children:u.jsx("code",{children:g})},g))})]}):null,e.errorMessage?u.jsx("p",{className:"oc-human-gate-error",children:e.errorMessage}):null]}):null,u.jsxs("footer",{children:[u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>Ts(Pi(e.inspectHref)),children:"查看记录"}),u.jsx("button",{className:"btn btn-primary",type:"button",disabled:!h||a,onClick:()=>{d()},children:a?"提交中…":m})]}),o?u.jsx("div",{className:"oc-human-gate-error",children:o}):null]})}const MO={validation:"节点输出未通过契约或门禁校验。可在恢复页从失败节点重跑;若错误指向任务契约(如验证命令、Mock 策略),先修正任务配置并重新生成 DAG。",executor:"执行器或模型提供方调用失败(网络、配额或运行时错误)。稍后可在恢复页从失败节点重跑;反复出现请到「模型与认证」页检查配置与凭据。","write-guard":"写入越过了授权边界(writeSet / allowedPaths)。检查计划中的写入路径是否越界,修正后从失败节点重跑。",timeout:"节点执行超时。可在恢复页从失败节点重跑;反复超时建议缩小任务范围或排查卡住的命令。",auth:"模型或服务认证失败。请先到「模型与认证」页检查 API Key 与模型配置,再从失败节点重跑。","human-required":"节点正在等待人工审批。完成审批后该节点可继续执行;也可在恢复页查看对账状态。","human-rejected":"人工审批被拒绝。请调整任务描述或契约后重新发起任务。","shell-command":"验证/构建命令以非零退出。进入 DAG 查看命令输出定位具体失败,修复后从失败节点重跑。","static-error":"静态检查(typecheck / lint 等)失败。修复对应代码错误后从失败节点重跑。","decision-envelope":"决策与证据不匹配(决策包络校验失败)。进入 DAG 查看节点决策依据,修正后重跑。",unknown:"失败原因未归类。进入 DAG 查看节点详情,或在恢复页使用对账 / 诊断入口。"};function OO(e){if(e)return MO[e]}function d3(e,t=900){if(e)return e.length>t?`${e.slice(0,t)}…`:e}function xm(e){return new Date(e).toLocaleString()}function f3(e){if(!e)return;const t=e.trim();if(/taskId[^\n]*(?:placeholder|占位)|["']?<id>["']?/i.test(t))return"任务编号仍是占位符;请提供实际的 YYYY-MM-DD-<slug> 任务编号后重试。";if(/ENOENT|no such file or directory/i.test(t))return"任务活动缺少所需文件或目录,可进入 DAG 查看详情。";if(/command failed|exited with code/i.test(t))return"相关命令没有成功完成,可进入 DAG 查看详情。";if(!(t.length>220||t.startsWith("{")||t.startsWith("[")||t.includes("[dag execute]")||t.includes("schemaVersion")||/[A-Za-z]:\\/.test(t)))return t}function DO(e){const t=e.latestOperation,n=t.runSummary;if(e.kind==="success"||e.kind==="progress")return;const a=n?.nodes.find(c=>c.status==="ERROR")?.id;if(a){const c=n?.failureCategory?`,原因分类为 ${n.failureCategory}`:"";return`执行在 ${a} 阶段未完成${c}。`}const s=n?.next?.description;if(s&&/fail|error|block|cannot|unable/i.test(s))return s;const o=f3(t.stderrPreview)??f3(t.summaryPreview);return o||(e.kind==="error"?"本次任务活动没有完成,可进入 DAG 查看详情或使用恢复选项。":"本次任务活动需要进一步确认,请查看相关记录。")}function jO(e){const{journey:t}=e,n=t.latestOperation,a=t.runs[0],s=t.runs.slice(1),o=Pi(n.inspectHref),c=DO(t),d=t.kind==="error"||t.kind==="warning",h=t.latestOperation.runSummary,m=h?.nodes.find(x=>x.failureCategory)?.failureCategory??h?.failureCategory,p=d?OO(m):void 0,g=(x,v)=>{e.onNavigateWorkspace?e.onNavigateWorkspace(x,v):window.location.assign(Yw(x,v))};return e.compact?u.jsxs("details",{className:"oc-journey-compact",children:[u.jsxs("summary",{children:[u.jsx("span",{className:`oc-journey-dot is-${t.kind}`,"aria-hidden":"true"}),u.jsxs("span",{children:[u.jsx("strong",{children:t.displayTitle}),u.jsxs("small",{children:[t.stateLabel," · ",xm(t.updatedAt)]})]}),u.jsx("span",{"aria-hidden":"true",children:"›"})]}),u.jsxs("div",{className:"oc-journey-compact-body",children:[t.taskId?u.jsx("code",{children:t.taskId}):null,u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>Ts(o),children:"查看记录"})]})]}):u.jsxs("section",{className:`oc-task-journey-card is-${t.kind}`,"aria-label":`${t.displayTitle}:${t.stateLabel}`,children:[u.jsxs("header",{className:"oc-journey-head",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"oc-journey-state-line",children:[u.jsx("span",{className:`oc-journey-dot is-${t.kind}`,"aria-hidden":"true"}),u.jsx("span",{children:t.stateLabel})]}),u.jsx("strong",{children:t.displayTitle}),t.taskId?u.jsxs("small",{children:["Task · ",u.jsx("code",{children:t.taskId})]}):null]}),u.jsx("time",{dateTime:t.updatedAt,children:xm(t.updatedAt)})]}),u.jsx("div",{className:"oc-journey-steps","aria-label":"任务旅程",children:t.steps.slice(-6).map(x=>u.jsxs("div",{className:"oc-journey-step",children:[u.jsx("span",{className:`oc-journey-step-icon is-${x.kind}`,"aria-hidden":"true",children:x.kind==="success"?"✓":x.kind==="error"?"!":"•"}),u.jsx("span",{children:x.label}),u.jsx("small",{children:x.stateLabel})]},x.id))}),c?u.jsxs("div",{className:`oc-journey-outcome is-${t.kind}`,children:[u.jsx("strong",{children:d?"当前问题":"最新结果"}),u.jsx("p",{children:c}),p?u.jsxs("p",{className:"oc-journey-advice","data-testid":"oc-journey-advice",children:["建议:",p]}):null]}):null,a?u.jsxs("div",{className:"oc-journey-latest-run",children:[u.jsx("span",{children:"最新执行"}),u.jsx("code",{children:a.runId}),u.jsx("b",{className:`is-${a.kind}`,children:a.stateLabel}),a.firstFailedNode?u.jsxs("small",{children:["失败阶段 · ",a.firstFailedNode]}):null]}):null,s.length>0?u.jsxs("details",{className:"oc-journey-history",children:[u.jsxs("summary",{children:["执行历史 ",t.runs.length," 次"]}),u.jsx("div",{children:t.runs.map(x=>u.jsxs("div",{className:"oc-journey-run-row",children:[u.jsx("code",{children:x.runId}),u.jsx("span",{className:`is-${x.kind}`,children:x.stateLabel}),x.firstFailedNode?u.jsx("small",{children:x.firstFailedNode}):null,u.jsx("time",{dateTime:x.updatedAt,children:xm(x.updatedAt)})]},x.runId))})]}):null,u.jsxs("footer",{className:"oc-journey-actions",children:[u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>{const x=n.dagRunId??a?.runId,v=x?Pi(`/#/inspect/dag/${encodeURIComponent(x)}`):o;Ts(v)},children:"进入 DAG"}),d&&(t.taskId||n.dagRunId)?u.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>g("recovery",{taskId:t.taskId,dagRunId:n.dagRunId}),children:"恢复选项"}):null]}),u.jsxs("details",{className:"oc-journey-technical",children:[u.jsxs("summary",{children:["技术详情 · ",t.operations.length," 项活动"]}),u.jsx("div",{className:"oc-journey-technical-body",children:t.operations.map(x=>u.jsxs("div",{className:"oc-journey-operation-row",children:[u.jsxs("div",{children:[u.jsx("code",{children:x.operationId}),u.jsx("span",{children:x.action})]}),x.dagRunId?u.jsxs("small",{children:["run · ",x.dagRunId]}):null,x.controller?u.jsxs("small",{children:["controller · ",x.controller]}):null,x.stderrPreview?u.jsx("pre",{className:"is-error",children:d3(x.stderrPreview)}):null,x.summaryPreview?u.jsx("pre",{children:d3(x.summaryPreview)}):null]},x.operationId))})]})]})}function h3(e){return e.state==="prepared"||e.state==="confirmed"?0:e.state==="dispatched"?1:e.state==="error"?2:3}function wm(e,t){return e!==null&&t.includes(e)}function LO(e){return e.operations>0?"operations":e.gates>0?"gates":"artifacts"}function zO(e){const t=e.presentation==="sidecar",n=t||e.open,a=w.useRef(null),[s,o]=w.useState("operations"),c=w.useMemo(()=>Y7(e.operationCards),[e.operationCards]),d=c.length+e.humanGateCards.length+e.artifactCards.length,h=w.useMemo(()=>[...e.humanGateCards].sort((v,S)=>{const T=h3(v)-h3(S);return T!==0?T:(S.eventSeq??0)-(v.eventSeq??0)}),[e.humanGateCards]),m=w.useMemo(()=>[...e.artifactCards].sort((v,S)=>(S.eventSeq??0)-(v.eventSeq??0)),[e.artifactCards]);if(Xl({open:n&&!t,containerRef:a,triggerRef:e.triggerRef,onEscape:e.onClose}),w.useEffect(()=>{o(LO({operations:c.length,gates:e.humanGateCards.length,artifacts:e.artifactCards.length}))},[e.sessionId]),w.useEffect(()=>{e.focusRef&&(e.focusRef.startsWith("gate:")?o("gates"):e.focusRef.startsWith("artifact:")?o("artifacts"):o("operations"))},[e.focusRef]),w.useEffect(()=>{if(!n||!e.focusRef)return;const v=window.requestAnimationFrame(()=>{const S=a.current;if(!S)return;Array.from(S.querySelectorAll("[data-activity-ref], [data-tool-call-id], [data-activity-refs]")).find(R=>{const O=R.dataset.activityRefs?.split(" ")??[];return R.dataset.activityRef===e.focusRef||O.includes(e.focusRef??"")||R.dataset.toolCallId&&`tool:${R.dataset.toolCallId}`===e.focusRef})?.scrollIntoView({block:"nearest",behavior:"smooth"})});return()=>window.cancelAnimationFrame(v)},[n,s,e.focusRef]),!n||d===0)return null;let p="is-drawer";t?p="is-sidecar":e.presentation==="sheet"&&(p="is-sheet");const g=t&&e.sidecarRect?{top:e.sidecarRect.top,left:e.sidecarRect.left,height:e.sidecarRect.height,width:e.sidecarRect.width}:void 0,x=u.jsxs("aside",{ref:a,id:"oc-activity-rail",className:`oc-activity-rail ${p} is-${e.phase}`,style:g,"aria-label":"本次对话的活动","aria-busy":e.phase==="switching",tabIndex:-1,children:[u.jsxs("header",{className:"oc-activity-rail-head",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"本次对话的活动"}),u.jsx("small",{children:"运行、门禁与任务产物"})]}),u.jsx("span",{className:"oc-activity-count",children:d}),t?null:u.jsx("button",{type:"button",className:"oc-activity-close","aria-label":"关闭运行活动",onClick:e.onClose,children:"×"})]}),u.jsxs("div",{className:"oc-activity-content",children:[u.jsxs("div",{className:"oc-activity-tabs",role:"tablist","aria-label":"活动类型",children:[u.jsxs("button",{type:"button",role:"tab","aria-selected":s==="operations",className:s==="operations"?"is-active":"",onClick:()=>o("operations"),children:["运行 ",u.jsx("span",{children:c.length})]}),u.jsxs("button",{type:"button",role:"tab","aria-selected":s==="gates",className:s==="gates"?"is-active":"",onClick:()=>o("gates"),children:["门禁 ",u.jsx("span",{children:h.length})]}),u.jsxs("button",{type:"button",role:"tab","aria-selected":s==="artifacts",className:s==="artifacts"?"is-active":"",onClick:()=>o("artifacts"),children:["产物 ",u.jsx("span",{children:m.length})]})]}),u.jsxs("div",{className:"oc-activity-list",children:[s==="operations"&&c.length===0?u.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有任务执行记录。"}):null,s==="operations"?c.map((v,S)=>{const T=v.activityRefs;return u.jsxs("div",{"data-activity-refs":T.join(" "),className:`oc-activity-card-wrap${wm(e.focusRef,T)?" is-focused":""}`,children:[u.jsx(jO,{journey:v,compact:S>0&&v.compactEligible,origin:e.origin,onNavigateWorkspace:e.onNavigateWorkspace}),u.jsx("button",{type:"button",className:"oc-activity-locate",onClick:()=>e.onLocateConversation(T),children:"查看对话位置"})]},v.key)}):null,s==="gates"&&h.length===0?u.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有需要展示的门禁。"}):null,s==="gates"?h.map(v=>{const S=V7(v);return u.jsx("div",{className:`oc-activity-card-wrap${wm(e.focusRef,S)?" is-focused":""}`,children:u.jsx(_O,{card:v,origin:e.origin,sessionId:e.sessionId})},v.cardId)}):null,s==="artifacts"&&m.length===0?u.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有任务产物。"}):null,s==="artifacts"?m.map(v=>{const S=K7(v);return u.jsx("div",{className:`oc-activity-card-wrap${wm(e.focusRef,S)?" is-focused":""}`,children:u.jsx(IO,{artifact:v})},v.artifactId)}):null]})]},e.sessionId)]});return t?Zl.createPortal(x,document.body):x}const W7=420,Z7=12;function BO(e){if(e.layoutMode==="narrow")return"sheet";const t=e.railWidth??W7,n=e.gap??Z7;return e.viewportWidth-e.mainRight>=t+n?"sidecar":"drawer"}const qO={presentation:"drawer",sidecarRect:null};function HO(e,t,n){const[a,s]=w.useState(qO);return w.useLayoutEffect(()=>{const o=e.current;if(!o)return;const c=o.closest(".panel--chat")??o;let d=0;const h=()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{const p=o.getBoundingClientRect(),g=c.getBoundingClientRect(),x=BO({layoutMode:t,viewportWidth:window.innerWidth,mainRight:p.right}),v=x==="sidecar"?{top:g.top,left:p.right+Z7,height:g.height,width:W7}:null;s(S=>S.presentation===x&&S.sidecarRect?.top===v?.top&&S.sidecarRect?.left===v?.left&&S.sidecarRect?.height===v?.height&&S.sidecarRect?.width===v?.width?S:{presentation:x,sidecarRect:v})})};h();const m=new ResizeObserver(h);return m.observe(o),c!==o&&m.observe(c),window.addEventListener("resize",h),()=>{window.cancelAnimationFrame(d),m.disconnect(),window.removeEventListener("resize",h)}},[t,e,n]),a}const m3={comfortableMin:620,compactMin:480};function UO(e){return!Number.isFinite(e)||e<0?"extra-compact":e>=m3.comfortableMin?"comfortable":e>=m3.compactMin?"compact":"extra-compact"}function FO(e){return`is-landing-${e}`}const $O=[{label:"新建任务",hint:"先走需求分析 skills,再导入创建任务",prompt:["我要新建任务。请先做需求分析,不要用一句话直接 bootstrapFromPrd。","1. 先问我需求内容和范围(frontend / backend / both,默认 both)。","2. 读取并严格执行 `.agents/skills/analyze-product-requirements/SKILL.md`(`loop-agent init --profile full` 会投影该 skill):按规程澄清访谈、校验,并把产物写到 `docs/product-analysis/<requirement-id>/`(product-analysis.md、requirement-clarification.md、product-requirement.md)。","3. product-requirement 为 complete 且校验通过后,再严格执行 `.agents/skills/analyze-product-dependencies/SKILL.md`,生成 dependency-analysis.md 和按需的 api-documentation.md。","4. 两套产物都校验通过后,再用这些文件 bootstrapFromPrd 创建任务,并建议 taskKind。","若上述 skill 不存在,先说明缺失,并提示运行 `loop-agent init --repo-root . --profile full --merge`。"].join(`
395
- `)},{label:"查看任务状态",hint:"列出任务与就绪/阻塞状态",prompt:"列出当前所有 task 及其状态,重点说明哪些是 Ready 可以推进、哪些 Blocked 及阻塞原因。"},{label:"诊断 DAG 运行",hint:"对失败运行跑 Doctor",prompt:"帮我诊断最近失败或异常的 DAG 运行:先列出最近的 DAG 运行,对有问题的运行执行 doctor,总结根因和可执行的恢复方案。"},{label:"恢复或重跑任务",hint:"默认从节点续跑,勿无故新开 task",prompt:"我要恢复失败或卡住的 DAG。请先 dagReport/dagDoctor 看 primaryFailure.nodeId 与 primaryRecovery;默认用 dagRerunPlan→dagRerun 从失败节点续跑(plan 合格后直接 dagRerun,不要 prepareMutationGate)。不要新建 task-id。plan 不合格时:Worker Task Pool Failed 用 workerPoolDoctor 确认后再 workerTaskRetry;独立 Console run 用 standaloneTaskRerun(整单重生,不是从节点续跑)。paused/中断需要 resume 时准备 Human Gate,不要自己调 dagResume。确定后直接帮我发起。"}];function X7(e){const t=e.readiness==="setup-required",n=!!e.disabled||t,a=e.density??"comfortable",s=e.mode==="no-session"?"开始一段新的对话":"今天想推进什么?",o=e.mode==="no-session"?"用自然语言编排 loop-agent:查询状态、诊断问题、创建与恢复任务。可先点选下方建议,或新建空白对话。":"会话已就绪。点选建议快速开场,或在下方输入框直接描述目标。业务写入仍经受治理 DAG。";return u.jsxs("div",{className:`oc-empty ${FO(a)}`,role:"status","data-landing-density":a,children:[u.jsxs("div",{className:"oc-empty-hero",children:[u.jsx("img",{className:"oc-empty-icon oc-empty-brand",src:"/favicon.svg",alt:"","aria-hidden":"true",draggable:!1}),u.jsxs("div",{className:"oc-empty-copy",children:[u.jsx("h3",{children:s}),u.jsx("p",{children:o})]})]}),u.jsx("div",{className:"oc-suggestions","aria-label":"开场建议",children:$O.map(c=>u.jsxs("button",{type:"button",className:"oc-suggestion",onClick:()=>e.onSuggest(c.prompt),disabled:n,children:[u.jsx("strong",{children:c.label}),u.jsx("span",{children:a==="extra-compact"?c.hint.replace(/[,,].*$/,""):c.hint})]},c.label))}),u.jsxs("ul",{className:"oc-empty-tips",children:[u.jsxs("li",{children:[u.jsx("kbd",{children:"@"}),u.jsx("span",{children:"引用仓库文件"})]}),u.jsxs("li",{children:[u.jsx("kbd",{children:"/"}),u.jsx("span",{children:"快捷命令"})]}),u.jsxs("li",{children:[u.jsx("kbd",{children:"Enter"}),u.jsx("span",{children:"发送 · Shift+Enter 换行"})]})]}),e.mode==="no-session"&&e.onCreateSession?u.jsx("button",{type:"button",className:"btn btn-primary oc-empty-cta",onClick:e.onCreateSession,disabled:n,"aria-busy":e.disabled||void 0,children:t?"需先完成 Pi setup":e.disabled?"创建中…":"新建空白对话"}):null]})}function PO(e){const{interview:t,interviewAnswer:n,onAnswerChange:a,onAnswer:s}=e;return u.jsxs("section",{className:"oc-draft-card","aria-label":"Requirement Interview",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Requirement Interview"}),u.jsx("span",{children:t.state})]}),t.question&&u.jsxs("div",{className:"oc-interview-bubble",children:[u.jsx("strong",{children:t.question.text}),u.jsxs("p",{children:["建议:",t.question.recommendation]}),u.jsx("textarea",{value:n,onChange:o=>a(o.target.value),placeholder:"输入答案"}),u.jsxs("div",{children:[u.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>s("override"),disabled:!n.trim(),children:"提交答案"}),u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>s("accept-recommendation"),children:"接受建议"})]})]}),t.draft&&u.jsxs("details",{open:!0,children:[u.jsxs("summary",{children:["TaskContractDraftV1 · ",t.draftSha256?.slice(0,12)]}),u.jsx("pre",{children:JSON.stringify(t.draft,null,2)})]}),t.assessment&&u.jsxs("div",{className:`oc-assessment${t.assessment.fresh?" is-fresh":""}`,children:[u.jsxs("strong",{children:["完整性:",t.assessment.outcome]}),(t.assessment.missingFields??[]).length>0&&u.jsxs("p",{children:["缺失:",t.assessment.missingFields?.join("、")]})]}),t.taskKindRecommendation&&u.jsxs("div",{className:"oc-task-kind-card",children:[u.jsx("span",{children:"taskKind 建议"}),u.jsx("strong",{children:t.taskKindRecommendation}),u.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>e.onConfirmTaskKind(),children:"由我确认"}),u.jsx("small",{children:"模型不能代替人类确认。"})]}),t.confirmedTaskKind&&u.jsxs("div",{className:"oc-task-kind-card is-confirmed",children:["已由人类确认:",u.jsx("strong",{children:t.confirmedTaskKind})]})]})}function Gu(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function C1(e){const[t,n]=w.useState(!1),a=()=>{navigator.clipboard?.writeText(e.text).then(()=>{n(!0),window.setTimeout(()=>n(!1),1600)},()=>{})};return u.jsx("button",{type:"button",className:`oc-message-copy${t?" is-copied":""}`,"aria-label":t?"已复制":"复制消息",title:t?"已复制":"复制",onClick:a,children:t?u.jsx(Dk,{}):u.jsx(Ok,{})})}function GO({message:e,streaming:t}){const[n,a]=w.useState(!1),s=e.text.trim().length>0,o=e.compaction,c=o?.status??"completed",d=o?.tokensBefore,h=o?.estimatedTokensAfter;let m;return c==="running"?m=o?.reason==="overflow"?"检测到上下文过大,正在压缩上下文…":o?.reason==="threshold"?"上下文接近上限,正在压缩上下文…":"正在压缩上下文…":c==="failed"?m="上下文压缩失败":c==="aborted"?m="上下文压缩已取消":d!==void 0&&h!==void 0?m=`已压缩历史上下文(${Gu(d)} → ${Gu(h)} tokens)`:d!==void 0?m=`已压缩历史上下文(压缩前约 ${Gu(d)} tokens)`:m="已压缩历史上下文",c==="completed"&&o?.willRetry&&(m+=t?" · 正在继续原请求…":" · 已继续原请求"),u.jsxs("div",{className:`oc-compaction-card is-${c}${n?" is-expanded":""}`,role:c==="failed"?"alert":"status",children:[u.jsxs("button",{type:"button",className:"oc-compaction-trigger",disabled:!s,"aria-busy":c==="running","aria-expanded":s?n:void 0,onClick:()=>a(p=>!p),children:[u.jsxs("span",{className:"oc-compaction-leading","aria-hidden":"true",children:[u.jsx("span",{className:"oc-compaction-icon",children:c==="running"?u.jsx("span",{className:"oc-spinner oc-spinner-inline"}):u.jsx(ok,{size:15})}),u.jsx("span",{className:"oc-compaction-chevron",children:n?u.jsx(gd,{size:15}):u.jsx(V9,{size:15})})]}),u.jsx("strong",{children:"compact"}),u.jsx("span",{className:"oc-compaction-separator","aria-hidden":"true"}),u.jsx("span",{className:"oc-compaction-summary-line",children:m}),u.jsx("span",{className:"oc-compaction-time",children:Ul(e.createdAt)})]}),n&&s?u.jsx("div",{className:"oc-compaction-details",children:u.jsx(ic,{text:e.text})}):null]})}function p3(e){const{message:t,streaming:n,activeAssistantId:a}=e;if(t.kind==="compaction")return u.jsx(GO,{message:t,streaming:n});const s=t.role==="user",o=s?"你":"助手",c=!s&&n&&a!==null&&t.id===a,d=c&&t.text.length===0,h=t.text.trim().length>0,m=u.jsxs("div",{className:"oc-meta",children:[!s&&u.jsx("span",{className:"oc-role oc-role-assistant","aria-hidden":"true",children:"π"}),u.jsxs("span",{className:"oc-time",children:[Ul(t.createdAt),u.jsxs("span",{className:"sr-only",children:["(",o,")"]})]}),h&&u.jsx(C1,{text:t.text})]}),p=u.jsxs("div",{className:`oc-bubble ${s?"oc-bubble-user":"oc-bubble-assistant"}`,children:[h?s?u.jsx("div",{style:{whiteSpace:"pre-wrap"},children:t.text}):u.jsx(ic,{text:t.text}):d?u.jsx("span",{className:"oc-cursor","aria-hidden":"true"}):null,c&&h&&u.jsx("span",{className:"oc-cursor","aria-hidden":"true"})]});return u.jsx("div",{className:`oc-row ${s?"is-user":"is-assistant"}`,"data-user-message-id":s?t.id:void 0,children:s?u.jsxs("div",{className:"oc-user-stack",children:[p,m]}):u.jsxs(u.Fragment,{children:[m,p]})})}function VO(e){switch(e){case"authentication":return"认证失败";case"context-overflow":return"上下文过大";case"rate-limit":return"请求过于频繁";default:return"Provider 请求失败"}}function KO(){return u.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[u.jsx("path",{d:"M10 2.4 18 16H2L10 2.4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),u.jsx("path",{d:"M10 7v4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),u.jsx("circle",{cx:"10",cy:"14",r:".9",fill:"currentColor"})]})}function YO({error:e}){const[t,n]=w.useState(!1),a=[e.code===void 0?void 0:`HTTP ${e.code}`,e.type].filter(Boolean);return u.jsxs("section",{className:"oc-provider-error",role:"status",children:[u.jsx("div",{className:"oc-provider-error-mark",children:u.jsx(KO,{})}),u.jsxs("div",{className:"oc-provider-error-body",children:[u.jsxs("div",{className:"oc-provider-error-heading",children:[u.jsx("strong",{children:VO(e.category)}),a.length>0&&u.jsx("span",{className:"oc-provider-error-meta",children:a.join(" · ")})]}),u.jsx("p",{children:e.message}),u.jsxs("details",{className:"oc-provider-error-details",open:t,onToggle:s=>n(s.currentTarget.open),children:[u.jsx("summary",{children:t?"收起原始响应":"查看原始响应"}),u.jsx("pre",{children:e.raw})]})]})]})}function WO(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return null}if(!t||typeof t!="object")return null;const n=t.todos;return Array.isArray(n)?n.filter(a=>!!a&&typeof a=="object"&&typeof a.content=="string"&&(a.status==="pending"||a.status==="in_progress"||a.status==="completed")):null}function ZO(e){const t=WO(e);if(!t)return null;const n=t.filter(s=>s.status==="completed").length,a=t.filter(s=>s.status==="in_progress");return{text:`${n}/${t.length} 已完成${a[0]?.content?` · ${a[0].content}`:""}`,extra:Math.max(0,a.length-1)}}function XO(e){const t={size:14,"aria-hidden":!0};return e.kind==="bash"?u.jsx(ik,{...t}):e.kind==="read"?u.jsx(Z9,{...t}):e.kind==="search"?u.jsx(Pm,{...t}):e.kind==="write"?u.jsx(F1,{...t}):e.kind==="web"?u.jsx(X9,{...t}):e.kind==="mcp"?u.jsx(ek,{...t}):u.jsx(lk,{...t})}function QO(e,t){const n=e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean);return(t?n.at(-1):n[0])??"…"}function JO(e){const t=e.split(/\r?\n/).map(n=>n.replace(/\s+/g," ").trim()).find(Boolean);return t?t.length>180?`${t.slice(0,180)}…`:t:"工具调用失败"}function Q7(e){const{entry:t}=e,[n,a]=w.useState(t.status==="error"),[s,o]=w.useState(!1),c=t.status==="running"?"运行中":t.status==="error"?"出错":"完成",d=mk(t.args,{toolName:t.toolName}),h=yk(t.createdAt,t.finishedAt),m=gk(t.toolName),p=pk(t.toolName),g=t.toolName==="todo_write",x=g?ZO(t.args):null,v=u5(t.resultText??t.result),S=t.status==="error"?JO(v):d,T=x?.text??S,N=vk(v,s?{maxLen:Number.MAX_SAFE_INTEGER}:void 0);return w.useEffect(()=>{t.status==="error"&&a(!0)},[t.status]),u.jsxs("div",{className:`oc-tool ${t.status==="error"?"is-error":""} ${t.status==="running"?"is-running":""} is-${p.kind}`,"data-tool-kind":p.kind,children:[u.jsxs("button",{type:"button",className:"oc-tool-head","aria-expanded":n,onClick:()=>a(R=>!R),children:[u.jsxs("span",{className:"oc-tool-leading",children:[t.status==="error"?u.jsx("span",{className:"oc-tool-state-dot","aria-hidden":"true"}):u.jsx("span",{className:"oc-tool-icon",children:g?u.jsx(s5,{size:14,"aria-hidden":"true"}):u.jsx(XO,{kind:p.kind})}),u.jsx(g5,{})]}),u.jsx("span",{className:"oc-tool-name",children:g?"更新任务清单":p.label}),S&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-tool-separator","aria-hidden":"true"}),u.jsx("span",{className:`oc-tool-args${t.status==="error"?" is-error":""}`,children:T})]}),x&&x.extra>0?u.jsxs("span",{className:"oc-tool-summary-suffix",children:["+",x.extra]}):null,h!==void 0&&u.jsxs("span",{className:"oc-tool-duration",children:[h,"s"]}),u.jsx("span",{className:"sr-only",children:c})]}),n&&u.jsxs("div",{className:"oc-tool-body",children:[t.args!==void 0&&u.jsxs("div",{className:"oc-tool-section",children:[u.jsx("div",{className:"oc-tool-label",children:m.argsLabel}),u.jsx("pre",{className:"oc-tool-code",children:bk(t.args)})]}),(t.resultText!==void 0||t.result!==void 0)&&u.jsxs("div",{className:"oc-tool-section",children:[u.jsx("div",{className:"oc-tool-label",children:t.status==="error"?"错误":m.resultLabel}),u.jsx("pre",{className:"oc-tool-code",children:N.text}),N.truncated&&!s&&u.jsx("button",{type:"button",className:"btn btn-ghost oc-tool-expand-result",onClick:()=>o(!0),children:"展开全部"})]}),t.status==="running"&&t.resultText===void 0&&t.result===void 0&&t.args===void 0&&u.jsx("div",{className:"oc-tool-section",children:u.jsx("div",{className:"oc-tool-waiting",children:"等待结果…"})})]})]})}function eD(e){const{thinking:t,defaultOpen:n}=e,[a,s]=w.useState(n),o=QO(t,n);return w.useEffect(()=>{s(n)},[n]),u.jsxs("div",{className:`oc-thinking${n?" is-running":""}`,children:[n?u.jsx("span",{className:"sr-only",children:"运行中"}):null,u.jsxs("button",{type:"button",className:`oc-thinking-summary${a?" is-open":""}`,"aria-expanded":a,onClick:()=>s(c=>!c),children:[u.jsxs("span",{className:"oc-tool-leading",children:[u.jsx("span",{className:"oc-tool-icon",children:u.jsx(sk,{size:14,"aria-hidden":"true"})}),u.jsx(g5,{})]}),u.jsx("span",{className:"oc-thinking-label",children:"Think"}),a?null:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-tool-separator","aria-hidden":"true"}),u.jsx("span",{className:"oc-thinking-preview",children:o})]})]}),a?u.jsx("pre",{className:"oc-thinking-body",children:t||"…"}):null]})}function tD(e){return e.kind==="progress"?"••":e.kind==="success"?"✓":e.kind==="warning"?"!":"×"}function nD(e){const{activity:t,onActivate:n}=e,a=!!(t.activityRef&&n&&(e.canActivate?.(t.activityRef)??!0)),s=u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-semantic-activity-icon","aria-hidden":"true",children:tD(t)}),u.jsxs("span",{className:"oc-semantic-activity-copy",children:[u.jsx("strong",{children:t.title}),t.detail?u.jsx("small",{children:t.detail}):null]}),a?u.jsx("span",{className:"oc-semantic-activity-link",children:"查看详情"}):null]});if(a&&t.activityRef&&n){const o=t.activityRef;return u.jsx("button",{type:"button",className:`oc-semantic-activity is-${t.kind}`,"data-activity-ref":o,onClick:()=>n(o),children:s})}return u.jsx("div",{className:`oc-semantic-activity is-${t.kind}`,"data-activity-ref":t.activityRef,children:s})}function rD(e){const{items:t,live:n}=e;return u.jsx(u.Fragment,{children:t.map((a,s)=>{if(a.kind==="thinking")return u.jsx(eD,{thinking:a.thinking,defaultOpen:n},`thinking-${s}`);if(a.kind==="text")return u.jsx("div",{className:"oc-process-text",children:u.jsx(ic,{text:a.text})},`text-${s}`);if(a.kind==="activity")return u.jsx(nD,{activity:a.activity,onActivate:e.onActivateActivity,canActivate:e.canActivateActivity},a.activity.id);if(a.kind==="tool")return u.jsx(Q7,{entry:a.tool},a.tool.id);if(a.kind==="provider-error")return u.jsx(YO,{error:a.error},`provider-error-${s}`)})})}function aD(e){const{scrollContainerRef:t,messagesEndRef:n,onScroll:a,showScrollToLatest:s,onScrollToLatest:o,hasThread:c,readiness:d,streaming:h,streamingAssistantId:m,messagesCount:p,visibleCount:g,onLoadMore:x,turnGroups:v,interview:S}=e;return u.jsxs("div",{ref:t,className:`oc-messages${c?" has-thread":" is-empty"}`,onScroll:a,children:[c?null:u.jsx(X7,{mode:"empty-session",readiness:d,disabled:h,onSuggest:e.onSuggest}),c?u.jsxs("div",{className:"oc-message-column",children:[p>g&&u.jsx("button",{type:"button",className:"btn btn-ghost oc-load-history",onClick:x,children:"加载更早消息"}),v.map((T,N)=>{const R=T.user??T.assistants[0],O=N>0?v[N-1].user??v[N-1].assistants[0]:void 0,_=!!R&&(!O||Jf(O.createdAt)!==Jf(R.createdAt)),P=T.answer,U=!!P?.text.trim(),A=T.live&&T.processItems.length===0;return u.jsxs("div",{className:"oc-turn-group","aria-live":T.live?"polite":void 0,children:[_&&R&&u.jsx("div",{className:"oc-day-sep",children:Jf(R.createdAt)}),T.user&&u.jsx(p3,{message:T.user,streaming:h,activeAssistantId:m}),T.processItems.length>0&&u.jsx(rD,{items:T.processItems,live:T.live,onActivateActivity:e.onActivateActivity,canActivateActivity:e.canActivateActivity}),P&&(U||A)?u.jsx(p3,{message:P,streaming:h,activeAssistantId:m}):null]},T.key)}),S&&u.jsx(PO,{interview:S,interviewAnswer:e.interviewAnswer,onAnswerChange:e.onInterviewAnswerChange,onAnswer:e.onAnswerInterview,onConfirmTaskKind:e.onConfirmTaskKind}),u.jsx("div",{ref:n})]}):u.jsx("div",{ref:n}),c&&s?u.jsx("div",{className:"oc-scroll-to-latest-slot",children:u.jsx("button",{type:"button",className:"oc-scroll-to-latest","aria-label":"跳转到最新输出",title:"跳转到最新输出",onClick:o,children:u.jsx(gd,{size:19,"aria-hidden":"true"})})}):null]})}const iD=13,g3=240;function sD(e){const t=e.trim();return t.length>g3?`${t.slice(0,g3).trimEnd()}…`:t}function km(e,t=64){const n=e.trim().replace(/\s+/g," ");return n.length>t?`${n.slice(0,t)}…`:n}function oD(e,t){if(e.length===0)return[];const n=t>0?Math.max(1,Math.floor(t/iD)):e.length;if(e.length<=n)return e.map((s,o)=>({key:`b${o}`,members:[s]}));const a=[];for(let s=0;s<n;s+=1){const o=Math.floor(s*e.length/n),c=Math.floor((s+1)*e.length/n),d=e.slice(o,Math.max(c,o+1));d.length>0&&a.push({key:`b${s}`,members:d})}return a}function lD(e){const{scrollContainerRef:t,turnGroups:n,measureKey:a}=e,s=w.useRef(null),o=w.useMemo(()=>n.filter(_=>_.user).map((_,P)=>{const U=_.user;return{id:U.id,index:P+1,text:U.text,createdAt:U.createdAt}}),[n]),[c,d]=w.useState(0),[h,m]=w.useState(null),[p,g]=w.useState(null),x=w.useRef(new Map),v=w.useRef(0),S=w.useRef(null),T=w.useCallback(()=>{const _=t.current;if(!_)return;const P=_.offsetTop,U=new Map;for(const z of o){const X=_.querySelector(`[data-user-message-id="${CSS.escape(z.id)}"]`);X&&U.set(z.id,Math.max(0,X.offsetTop-P))}x.current=U;const A=s.current?.clientHeight??_.clientHeight;A!==v.current&&(v.current=A,d(A))},[t,o]),N=w.useCallback(()=>{const _=t.current;if(!_)return;const P=48;let U=null;for(const A of o){const z=x.current.get(A.id);if(z!==void 0)if(z<=_.scrollTop+P)U=A.id;else break}m(U)},[t,o]);w.useEffect(()=>{const _=window.requestAnimationFrame(T);return()=>window.cancelAnimationFrame(_)},[T,a]),w.useEffect(()=>{const _=t.current;if(!_)return;const P=()=>{S.current=null,T(),N()},U=()=>{S.current===null&&(S.current=window.requestAnimationFrame(P))};U(),_.addEventListener("scroll",U,{passive:!0}),window.addEventListener("resize",U);const A=new MutationObserver(U);return A.observe(_,{childList:!0,subtree:!0}),()=>{_.removeEventListener("scroll",U),window.removeEventListener("resize",U),A.disconnect(),S.current!==null&&(window.cancelAnimationFrame(S.current),S.current=null)}},[T,N,t]);const R=w.useMemo(()=>oD(o,c),[o,c]),O=w.useCallback(_=>{const P=t.current,U=x.current.get(_);!P||U===void 0||P.scrollTo({top:Math.max(0,U-8),behavior:"smooth"})},[t]);return o.length===0?null:u.jsx("nav",{ref:s,className:"oc-anchor-rail","aria-label":`用户消息锚点(共 ${o.length} 条)`,children:R.map(_=>{const P=_.members[0],U=h!==null&&_.members.some(X=>X.id===h),A=_.members.length,z=p===_.key;return u.jsxs("div",{className:"oc-anchor-cluster",onMouseEnter:()=>g(_.key),onMouseLeave:()=>g(null),children:[u.jsx("button",{type:"button",className:`oc-anchor-bar${U?" is-active":""}${A>1?" is-cluster":""}`,title:A>1?`${A} 条相邻输入`:void 0,"aria-label":A>1?`定位到 ${A} 条聚合输入中的第 ${P.index} 条:${km(P.text,40)}`:`定位到第 ${P.index} 条输入:${km(P.text,80)}`,onClick:()=>O(P.id),onFocus:()=>g(_.key),onBlur:()=>g(null)}),z?u.jsx("div",{className:"oc-anchor-popover",role:"tooltip",children:A>1?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-anchor-popover-head",children:[u.jsxs("span",{children:[A," 条聚合输入"]}),u.jsxs("span",{children:["第 ",P.index,"–",_.members[_.members.length-1].index," 条"]})]}),u.jsx("ul",{className:"oc-anchor-popover-list",children:_.members.map(X=>u.jsx("li",{children:u.jsxs("button",{type:"button",className:"oc-anchor-popover-item",onClick:()=>O(X.id),children:[u.jsx("span",{className:"oc-anchor-popover-item-time",children:Ul(X.createdAt)}),u.jsx("span",{className:"oc-anchor-popover-item-text",children:km(X.text)})]})},X.id))})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-anchor-popover-head",children:[u.jsxs("span",{children:["第 ",P.index,"/",o.length," 条输入"]}),u.jsx("span",{children:Ul(P.createdAt)})]}),u.jsx("div",{className:"oc-anchor-popover-body",children:sD(P.text)})]})}):null]},_.key)})})}function J7(e){return e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens}function cD(e){const t=J7(e);return t>0?Math.round(e.cacheReadTokens/t*100):null}function Sm(e){const t=e/1e3;if(t<60)return`${Math.round(t*10)/10}s`;const n=Math.round(t);return`${Math.floor(n/60)}m${n%60}s`}function b3(e){const t=n=>n>=100?String(Math.round(n)):String(Math.round(n*10)/10);return e<1e3?String(e):e<1e6?`${t(e/1e3)}K`:`${t(e/1e6)}M`}const uD={auto:"auto(跟随 Pi 默认等级)",off:"off · 关闭",minimal:"minimal · 极简",low:"low · 低",medium:"medium · 中",high:"high · 高",xhigh:"xhigh · 极高",max:"max · 最高"};function ex(e,t){const n=t.trim().toLowerCase(),a=new Map;for(const s of e){if(n&&!s.provider.toLowerCase().includes(n)&&!s.id.toLowerCase().includes(n)&&!(s.name??"").toLowerCase().includes(n))continue;const o=a.get(s.provider)??[];o.push(s),a.set(s.provider,o)}return[...a.entries()].map(([s,o])=>({provider:s,models:o}))}function dD(e,t){const n=new Set,a=[],s=o=>{n.has(o)||(n.add(o),a.push({value:o,label:uD[o]??o,...o==="auto"&&t?{effective:t}:{}}))};s("auto");for(const o of e)s(o);return a}function Ns(e,t){return`${e}/${t}`}function R1(e){return{...e.modelProvider&&e.modelId?{model:{provider:e.modelProvider,modelId:e.modelId}}:{},...e.thinkingLevel?{thinkingLevel:e.thinkingLevel}:{}}}function tx(e,t){return{...e,model:t.model??e.model,thinkingLevel:t.thinkingLevel??e.thinkingLevel}}function fD(e,t){const n=tx(e,t);return n.model?.provider===e.model?.provider&&n.model?.modelId===e.model?.modelId&&n.thinkingLevel===e.thinkingLevel}const v3={auto:"Auto",off:"Off",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",xhigh:"XHigh",max:"Max"};function hD(e,t){const n=e,a=v3[n]??n;return n!=="auto"||!t?a:`${a} · ${v3[t]??t}`}function mD(e,t){if(!t)return"选择模型";const n=e.find(s=>Ns(s.provider,s.id)===t);if(n)return n.name?.trim()||n.id;const a=t.indexOf("/");return a===-1?t:t.slice(a+1)}function pD(){return u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function y3(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"m5 3.5 3.5 3.5L5 10.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function gD(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"M9 3.5 5.5 7 9 10.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function bD(e){const t=Ql(),[n,a]=w.useState(!1),[s,o]=w.useState("root"),[c,d]=w.useState(""),[h,m]=w.useState(0),[p,g]=w.useState(0),[x,v]=w.useState(0),S=w.useRef(null),T=w.useRef(null),N=w.useRef(null),R=t.snapshot,O=t.status==="loading",_=t.status==="error"?t.error:null,P=R?.selection?.effectiveThinkingLevel,U=w.useMemo(()=>R?.thinkingLevels?.length?R.thinkingLevels.map(W=>W.value):void 0,[R?.thinkingLevels]),A=w.useMemo(()=>dD(U??e.thinkingLevels,P),[U,e.thinkingLevels,P]),z=w.useMemo(()=>R?(R.models??[]).map(W=>({provider:W.provider,id:W.id,...W.name?{name:W.name}:{},...W.hasCredentials!==void 0?{hasCredentials:W.hasCredentials}:{}})):e.models,[R,e.models]),X=w.useMemo(()=>ex(z,c),[z,c]),H=w.useMemo(()=>X.flatMap(W=>W.models),[X]),$=mD(z,e.activeModelRef),F=e.activeThinkingLevel||"auto",Y=hD(F,P),oe=!!e.activeModelRef&&(!e.activeModelListed||!z.some(W=>Ns(W.provider,W.id)===e.activeModelRef)),ee=()=>{a(!1),o("root"),d("")};w.useEffect(()=>{if(!n)return;const W=ye=>{ye.target instanceof Node&&S.current&&!S.current.contains(ye.target)&&ee()},D=ye=>{ye.key==="Escape"&&ee()};return document.addEventListener("mousedown",W),document.addEventListener("keydown",D),()=>{document.removeEventListener("mousedown",W),document.removeEventListener("keydown",D)}},[n]),w.useEffect(()=>{if(!n)return;if(s==="root"){m(0),window.setTimeout(()=>T.current?.focus(),0);return}if(s==="model"){d(""),g(0),window.setTimeout(()=>N.current?.focus(),0);return}const W=A.findIndex(D=>D.value===F);v(W<0?0:W),window.setTimeout(()=>T.current?.focus(),0)},[n,s,A,F]);const q=W=>{e.disabled||o(W)},I=W=>{if(e.disabled)return;const D=H[W];D&&(ee(),e.onSelectModel(D.provider,D.id))},K=W=>{if(e.disabled)return;const D=A[W];D&&(ee(),e.onSelectThinking(D.value))},Q=W=>{if(W.key==="ArrowDown"||W.key==="ArrowUp"){W.preventDefault(),m(D=>D===0?1:0);return}(W.key==="Enter"||W.key==="ArrowRight")&&(W.preventDefault(),q(h===0?"model":"thinking"))},pe=W=>{if(W.key==="ArrowDown"){W.preventDefault(),g(D=>H.length?(D+1)%H.length:0);return}if(W.key==="ArrowUp"){W.preventDefault(),g(D=>H.length?(D-1+H.length)%H.length:0);return}if(W.key==="Enter"){W.preventDefault(),I(p);return}W.key==="ArrowLeft"&&(W.preventDefault(),o("root"))},j=W=>{if(W.key==="ArrowDown"){W.preventDefault(),v(D=>A.length?(D+1)%A.length:0);return}if(W.key==="ArrowUp"){W.preventDefault(),v(D=>A.length?(D-1+A.length)%A.length:0);return}if(W.key==="Enter"){W.preventDefault(),K(x);return}W.key==="ArrowLeft"&&(W.preventDefault(),o("root"))},G=`选择模型,当前 ${$},推理等级 ${Y}`;return u.jsxs("div",{className:"oc-select-menu oc-runtime-selection-menu",ref:S,children:[u.jsxs("button",{type:"button",className:"oc-select-trigger oc-runtime-selection-trigger","aria-haspopup":"menu","aria-expanded":n,"aria-label":G,title:G,disabled:e.disabled,onClick:()=>{n?ee():(o("root"),a(!0))},children:[u.jsx("span",{className:"oc-runtime-selection-model",children:$}),u.jsx("span",{className:"oc-runtime-selection-effort",children:Y}),u.jsx(pD,{})]}),n&&u.jsx("div",{ref:T,className:"oc-select-panel oc-runtime-selection-panel",role:"menu","aria-label":"模型与推理等级",tabIndex:-1,onKeyDown:s==="root"?Q:s==="model"?pe:j,children:s==="root"?u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",className:`oc-runtime-selection-root-row${h===0?" is-highlighted":""}`,onMouseEnter:()=>m(0),onClick:()=>q("model"),children:[u.jsx("span",{className:"oc-runtime-selection-row-label",children:"模型"}),u.jsxs("span",{className:"oc-runtime-selection-row-value",children:[$,oe?"(不可用)":""]}),u.jsx(y3,{})]}),u.jsxs("button",{type:"button",role:"menuitem",className:`oc-runtime-selection-root-row${h===1?" is-highlighted":""}`,onMouseEnter:()=>m(1),onClick:()=>q("thinking"),children:[u.jsx("span",{className:"oc-runtime-selection-row-label",children:"推理等级"}),u.jsx("span",{className:"oc-runtime-selection-row-value",children:Y}),u.jsx(y3,{})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",className:"oc-runtime-selection-back",onClick:()=>o("root"),children:[u.jsx(gD,{}),u.jsx("span",{children:s==="model"?"选择模型":"推理等级"})]}),s==="model"?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:N,className:"oc-select-search",placeholder:"搜索模型或供应商…","aria-label":"搜索模型或供应商",value:c,onChange:W=>{d(W.target.value),g(0)}}),u.jsxs("div",{className:"oc-runtime-selection-groups",children:[O&&u.jsx("div",{className:"oc-select-status",children:"模型列表加载中…"}),_&&u.jsxs("div",{className:"oc-select-status is-error",children:[u.jsxs("span",{children:[_.code?`${_.code}:`:"",_.message]}),u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Gm()},children:"重试"})]}),!O&&!_&&X.length===0&&u.jsx("div",{className:"oc-select-status",children:"没有匹配的可用模型"}),X.map(W=>u.jsxs("div",{className:"oc-model-group",children:[u.jsx("div",{className:"oc-model-group-head",children:W.provider}),W.models.map(D=>{const ye=Ns(D.provider,D.id),se=ye===e.activeModelRef,V=H[p]===D;return u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":se,title:ye,disabled:e.disabled,className:`oc-select-option oc-model-option${V?" is-highlighted":""}${se?" is-active":""}`,onMouseEnter:()=>g(H.indexOf(D)),onClick:()=>{e.disabled||(ee(),e.onSelectModel(D.provider,D.id))},children:[u.jsx("span",{className:"oc-model-option-name",children:D.name?.trim()||D.id}),se&&u.jsx("span",{className:"oc-model-option-check",children:"✓"})]},ye)})]},W.provider))]})]}):A.map((W,D)=>{const ye=W.value===F;return u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":ye,disabled:e.disabled,className:`oc-select-option oc-thinking-option${x===D?" is-highlighted":""}${ye?" is-active":""}`,onMouseEnter:()=>v(D),onClick:()=>K(D),children:[u.jsx("span",{className:"oc-thinking-option-label",children:W.label}),W.value==="auto"&&W.effective?u.jsxs("span",{className:"oc-thinking-badge",children:["Pi 实际:",W.effective]}):null,ye&&u.jsx("span",{className:"oc-model-option-check",children:"✓"})]},W.value)})]})})]})}const Em="--oc-shortcut-palette-available-height",vD=8,yD=8;function xD(e){const t=e.viewportTop??0,n=e.topInset??vD,a=e.anchorGap??yD;if([e.boundaryTop,e.anchorTop,t,n,a].some(c=>!Number.isFinite(c)))return null;const o=Math.max(e.boundaryTop,t);return Math.max(0,Math.floor(e.anchorTop-o-n-a))}function wD(e){const t=w.useMemo(()=>e.items.filter(v=>v.state==="queued"||v.state==="failed"),[e.items]),[n,a]=w.useState(!0),[s,o]=w.useState(null),[c,d]=w.useState(null),h=w.useId();if(w.useEffect(()=>{t.length===0&&!n&&a(!0),s!==null&&!t.some(v=>v.clientRequestId===s.id)&&o(null)},[n,s,t]),t.length===0)return null;const m=s!==null||c!==null,p=!n||m,g=t.length===1||p,x=(v,S,T)=>{d(v),S().then(()=>T?.()).catch(()=>{}).finally(()=>d(N=>N===v?null:N))};return u.jsx("div",{className:"oc-queue-dock","data-queue-dock":"",children:u.jsxs("div",{className:"oc-queue-panel",children:[t.length>1?u.jsxs("button",{type:"button",className:"oc-queue-header","aria-controls":h,"aria-expanded":p,disabled:m,onClick:()=>a(v=>!v),children:[u.jsx("span",{className:"oc-queue-lead","aria-hidden":"true",children:u.jsx(Eb,{size:14})}),u.jsxs("span",{className:"oc-queue-count",children:[t.length," 条排队消息"]}),u.jsx("span",{className:"oc-queue-chevron","aria-hidden":"true",children:p?u.jsx(gd,{size:14}):u.jsx(i5,{size:14})})]}):null,u.jsx("ul",{id:h,className:"oc-queue-list",hidden:!g,children:g?t.map(v=>{const S=v.clientRequestId,T={clientRequestId:S,revision:v.revision},N="textPreview"in v?v.textPreview:v.text,R=("text"in v?v.text:N)??"",O="imageCount"in v?v.imageCount:v.images?.length??0;return u.jsxs("li",{className:`oc-queue-row is-${v.state}`,children:[t.length===1?u.jsx("span",{className:"oc-queue-lead","aria-hidden":"true",children:u.jsx(Eb,{size:14})}):null,s?.id===S?u.jsx("input",{autoFocus:!0,className:"oc-queue-editor","aria-label":"编辑排队消息",value:s.text,onChange:_=>o({id:S,text:_.currentTarget.value}),onKeyDown:_=>{_.key==="Escape"&&o(null),_.key==="Enter"&&!_.nativeEvent.isComposing&&(_.preventDefault(),x(S,()=>e.onEdit(T,s.text),()=>o(null)))}}):u.jsx("span",{className:"oc-queue-preview",title:R,children:N||(O>0?`${O} 张图片`:"待发送消息")}),u.jsx("div",{className:"oc-queue-actions",children:s?.id===S?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"保存排队消息",title:"保存排队消息",disabled:c!==null||s.text.trim()==="",onClick:()=>x(S,()=>e.onEdit(T,s.text),()=>o(null)),children:u.jsx(K9,{size:15})}),u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"取消编辑",title:"取消编辑",disabled:c!==null,onClick:()=>o(null),children:u.jsx(Cs,{size:15})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"编辑排队消息",title:"编辑排队消息",disabled:c!==null||!("text"in v),onClick:()=>o({id:S,text:R}),children:u.jsx(F1,{size:15})}),u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"删除排队消息",title:"删除排队消息",disabled:c!==null,onClick:()=>x(S,()=>e.onRemove(T)),children:u.jsx(U1,{size:15})}),u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"插话发送",title:"插话发送",disabled:c!==null||e.turnPhase==="idle",onClick:()=>x(S,()=>e.onSteer(T)),children:u.jsx(nk,{size:15})})]})})]},S)}):null})]})})}function kD(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),u.jsx("circle",{cx:"8.5",cy:"10",r:"1.5"}),u.jsx("path",{d:"m21 16-5.5-5.5L9 17"})]})}function SD(e){const{composer:t,streaming:n,turnPhase:a,deferredTurn:s,deferredTurns:o=s?[s]:[],hasThread:c}=e,d=w.useRef(null),h=Ql(),m=h.reloading,p=h.reloadError,x=h.mutationBusy||m||a!=="idle",v=w.useCallback(()=>{t.setInput(""),t.setShortcutOpen(!1),ed()},[t.setInput,t.setShortcutOpen]),S=w.useCallback(H=>{const $=t.isComposingNow()||H.nativeEvent.isComposing,F=t.recentlyComposedNow();if(H.key==="Enter"&&!H.shiftKey&&!$&&!F&&(!n||a!=="idle")){if(t.shortcutOpen&&t.filteredShortcuts.length>0){if((t.filteredShortcuts[t.shortcutIndex]??t.filteredShortcuts[0])?.command==="/reload"){H.preventDefault(),v();return}}else if(t.input.trim()==="/reload"){H.preventDefault(),v();return}}e.onKeyDown(H)},[t.isComposingNow,t.recentlyComposedNow,t.shortcutOpen,t.filteredShortcuts,t.shortcutIndex,t.input,v,n,a,e.onKeyDown]),T=w.useCallback((H,$)=>{if($==="pi-prompt"||H==="/name"||H==="/compact"){t.setInput(`${H} `),t.setShortcutOpen(!1),t.textareaRef.current?.focus();return}if(H==="/reload"){v();return}e.onRunShortcut(H)},[v,e.onRunShortcut,t]),N=w.useCallback(()=>{if(t.input.trim()==="/reload"){v();return}e.onSend(t.input)},[t.input,v,e.onSend]);w.useEffect(()=>{if(!t.shortcutOpen||t.filteredShortcuts.length===0||!e.paletteKeyboardNavRef.current)return;const H=e.shortcutPaletteRef.current;if(!H)return;H.querySelector(`[data-shortcut-index="${t.shortcutIndex}"]`)?.scrollIntoView({block:"nearest",inline:"nearest"}),e.paletteKeyboardNavRef.current=!1},[t.shortcutOpen,t.filteredShortcuts,t.shortcutIndex,e.shortcutPaletteRef,e.paletteKeyboardNavRef]),w.useEffect(()=>{if(!t.shortcutOpen||t.filteredShortcuts.length===0)return;const H=d.current,$=e.shortcutPaletteRef.current,F=H?.closest(".oc-main")??null;if(!H||!$||!F)return;let Y=0;const oe=()=>{Y=0;const I=F.getBoundingClientRect(),K=H.getBoundingClientRect(),Q=xD({boundaryTop:I.top,anchorTop:K.top,viewportTop:window.visualViewport?.offsetTop??0});if(Q===null){$.style.removeProperty(Em);return}$.style.setProperty(Em,`${Q}px`)},ee=()=>{Y!==0&&window.cancelAnimationFrame(Y),Y=window.requestAnimationFrame(oe)};oe();const q=typeof ResizeObserver>"u"?null:new ResizeObserver(ee);return q?.observe(F),q?.observe(H),window.addEventListener("resize",ee),window.visualViewport?.addEventListener("resize",ee),window.visualViewport?.addEventListener("scroll",ee),()=>{Y!==0&&window.cancelAnimationFrame(Y),q?.disconnect(),window.removeEventListener("resize",ee),window.visualViewport?.removeEventListener("resize",ee),window.visualViewport?.removeEventListener("scroll",ee),$.style.removeProperty(Em)}},[t.shortcutOpen,t.filteredShortcuts.length,e.layoutMode,e.shortcutPaletteRef]);const R=(()=>{const H=e.processSummary;return H?H.statusKind==="error"?`查看工具调用记录,共 ${H.count} 次,其中 ${H.statusLabel}`:H.statusKind==="running"?`查看工具调用记录,共 ${H.count} 次,${H.statusLabel||"正在运行"}`:`查看工具调用记录,共 ${H.count} 次,全部已完成`:"查看工具调用记录"})(),O=(()=>{const H=e.sessionStats,$=[];if(H.steps>0){$.push(`${H.turns} 轮 · ${H.steps} 步`);const oe=[];H.llmMs>0&&oe.push(`LLM ${Sm(H.llmMs)}`),H.toolMs>0&&oe.push(`工具调用 ${Sm(H.toolMs)}`),oe.length>0&&$.push(oe.join(" · "));const ee=[];if(H.ttftSteps>0&&ee.push(`首 token 平均 ${Sm(H.ttftMs/H.ttftSteps)}`),H.decodeMs>0){const q=H.decodeTokens/(H.decodeMs/1e3),I=q>=10?String(Math.round(q)):String(Math.round(q*10)/10);ee.push(`${I} tok/s`)}ee.length>0&&$.push(ee.join(" · "))}const F=J7(e.usage),Y=e.usage.outputTokens;if(F>0||Y>0){const oe=cD(e.usage);oe!==null&&$.push(`缓存命中 ${oe}%`),$.push(`输入 ${b3(F)} tok · 输出 ${b3(Y)} tok`)}return $})(),_=O.join(" | "),P=e.usage.contextUsage,U=P?.percent??null,A=P?`上下文 ${U===null?"—":`${Math.round(U*10)/10}%`} / ${P.contextWindow>0?Gu(P.contextWindow):"—"}`:"上下文 —",z=u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"oc-attach-button oc-attach-icon",title:"添加图片","aria-label":"添加图片",children:[u.jsx(kD,{}),u.jsx("span",{className:"sr-only",children:"添加图片"}),u.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:H=>{t.addImagesFromFiles(Array.from(H.target.files??[]).slice(0,4)),H.target.value=""}})]}),u.jsx("span",{className:"oc-composer-actions-spacer"}),u.jsx("div",{className:"oc-composer-model-controls",children:u.jsx(bD,{models:e.models,activeModelRef:e.activeModelRef,activeModelListed:e.activeModelListed,activeThinkingLevel:e.activeThinkingLevel||"auto",thinkingLevels:e.thinkingLevels,disabled:x,onSelectModel:(H,$)=>e.onSwitchRuntime({provider:H,modelId:$}),onSelectThinking:H=>e.onSwitchRuntime({thinkingLevel:H})})}),u.jsxs("button",{type:"button",className:"btn btn-ghost oc-composer-compact",onClick:e.onCompact,disabled:a!=="idle"||!c||e.compacting,title:e.compacting?"正在压缩上下文…":c?a!=="idle"?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文","aria-label":e.compacting?"正在压缩上下文…":c?a!=="idle"?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文",children:[e.compacting?u.jsx("span",{className:"oc-spinner oc-spinner-inline","aria-hidden":"true"}):u.jsx(ak,{size:16,"aria-hidden":"true"}),u.jsx("span",{className:"sr-only",children:e.compacting?"正在压缩上下文":"压缩上下文"})]}),e.runtimeContext?u.jsxs("button",{type:"button",ref:e.runtimeContextTriggerRef,className:`oc-runtime-context-toggle${e.runtimeContextOpen?" is-active":""}`,style:{"--oc-context-percent":`${Math.max(0,Math.min(100,U??0))}%`},"aria-expanded":e.runtimeContextOpen,"aria-controls":"oc-runtime-context-panel",title:A,"aria-label":e.runtimeContextOpen?"关闭注入上下文(当前运行时上下文与活跃工具)":"展开注入上下文(当前运行时上下文与活跃工具)",onClick:e.onToggleRuntimeContext,children:[u.jsx("span",{className:"oc-context-ring","aria-hidden":"true"}),u.jsx("span",{className:"sr-only",children:A})]}):null]}),X=u.jsxs("div",{className:"oc-telemetry",title:_||void 0,children:[a!=="idle"?u.jsx("span",{className:"oc-usage-state",children:a==="stopping"?"正在停止":"运行中"}):null,e.unread>0?u.jsxs("span",{children:[e.unread," 未读"]}):null,O.length>0?u.jsx("span",{className:"oc-telemetry-stats",children:O.map((H,$)=>u.jsx("span",{className:"oc-telemetry-group",children:H},`${$}:${H}`))}):null,e.processSummary?u.jsxs("button",{type:"button",ref:e.processTriggerRef,className:`oc-process-summary is-${e.processSummary.statusKind}${e.processOpen?" is-open":""}`,"aria-expanded":e.processOpen,"aria-controls":"oc-process-panel","aria-label":R,title:R,onClick:e.onToggleProcess,children:["调用记录 ",e.processSummary.count]}):null]});return u.jsx("div",{className:"oc-composer",children:u.jsxs("div",{className:"oc-composer-inner",ref:d,children:[t.fileOptions.length>0&&u.jsx("div",{className:"oc-file-palette",role:"listbox","aria-label":"Repository files",children:t.fileOptions.map(H=>u.jsx("button",{type:"button",role:"option",className:H.endsWith("/")?"is-dir":void 0,onMouseDown:$=>$.preventDefault(),onClick:()=>t.insertFileReference(H),children:u.jsxs("code",{children:["@",H]})},H))}),t.pendingImages.length>0&&u.jsx("div",{className:"oc-attachment-list",children:t.pendingImages.map(H=>u.jsxs("span",{children:[H.name,u.jsx("button",{type:"button","aria-label":`移除 ${H.name}`,onClick:()=>t.removeImage(H),children:"×"})]},H.name))}),t.shortcutOpen&&t.filteredShortcuts.length>0&&u.jsxs("div",{className:"oc-shortcut-palette",id:"oc-shortcut-palette",ref:e.shortcutPaletteRef,role:"listbox","aria-label":"命令","aria-busy":t.dynamicCommandsLoading||void 0,"data-layout-mode":e.layoutMode,children:[u.jsxs("div",{className:"oc-shortcut-palette-head",children:[u.jsxs("strong",{children:["命令 · ",t.filteredShortcuts.length]}),t.dynamicCommandsLoading?u.jsx("span",{className:"oc-shortcut-palette-meta",children:"正在加载扩展、提示词与技能…"}):null,t.dynamicCommandsError?u.jsxs("span",{className:"oc-shortcut-palette-meta is-error",children:[t.dynamicCommandsError,u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>t.retryDynamicCommands(),children:"重试"})]}):null]}),u.jsx("div",{className:"oc-shortcut-palette-body",children:e.paletteModel.map(H=>u.jsxs("div",{className:"oc-shortcut-group",children:[u.jsxs("small",{children:[H.label," · ",H.items.length]}),H.items.map(({entry:$,globalIndex:F})=>u.jsxs("button",{type:"button",role:"option",id:`oc-shortcut-option-${F}`,"aria-label":$.command,"aria-describedby":`oc-shortcut-option-desc-${F}`,"aria-selected":F===t.shortcutIndex,className:F===t.shortcutIndex?"is-active":"","data-shortcut-index":F,title:$.command,onMouseEnter:()=>t.setShortcutIndex(F),onMouseDown:Y=>Y.preventDefault(),onClick:Y=>{Y.currentTarget.scrollIntoView({block:"nearest"}),T($.command,$.action)},children:[u.jsx("code",{children:$.command}),u.jsx("small",{id:`oc-shortcut-option-desc-${F}`,children:$.description})]},`${$.source}:${$.command}`))]},H.source))})," "]}),u.jsx(wD,{items:o,turnPhase:a,onEdit:e.onEditDeferred,onRemove:H=>e.onDiscardDeferred(H),onSteer:e.onSteerDeferred}),u.jsxs("div",{className:`oc-composer-shell${a!=="idle"?" is-busy":""}`,children:[u.jsx("textarea",{ref:t.textareaRef,className:"oc-textarea",value:t.input,rows:2,placeholder:a==="stopping"?"上一轮正在停止…输入后可排队自动发送":n?"正在执行…继续输入以排队,当前回合结束后自动发送":c?"输入消息… Enter 发送 · Shift+Enter 换行 · ↑ 召回历史输入":"描述目标,或点选上方建议开始…",onChange:H=>t.handleInputChange(H.target.value),onKeyDown:S,onCompositionStart:t.onCompositionStart,onCompositionEnd:t.onCompositionEnd,"aria-expanded":t.shortcutOpen,"aria-controls":t.shortcutOpen?"oc-shortcut-palette":void 0,"aria-activedescendant":t.shortcutOpen&&t.filteredShortcuts.length>0?`oc-shortcut-option-${t.shortcutIndex}`:void 0}),u.jsxs("div",{className:"oc-composer-actions",children:[z,a==="running"?u.jsxs(u.Fragment,{children:[(t.input.trim()!==""||t.pendingImages.length>0)&&u.jsx("button",{type:"button",className:"oc-send is-queue",title:"排队发送:当前回合结束后自动发送","aria-label":"排队发送:当前回合结束后自动发送",onClick:N,disabled:m,children:u.jsx(Rb,{})}),u.jsxs("button",{type:"button",className:"oc-stop",title:s?"对话进行中,点击停止后立即发送排队消息":"对话进行中,点击停止","aria-label":s?"对话进行中,点击停止后立即发送排队消息":"对话进行中,点击停止",onClick:e.onStop,children:[u.jsx("span",{className:"oc-spinner","aria-hidden":"true"}),u.jsx(jk,{})]})]}):u.jsx("button",{type:"button",className:"oc-send",title:a==="stopping"?"停止后发送":"发送","aria-label":a==="stopping"?"停止后发送":"发送",onClick:N,disabled:!t.input.trim()&&t.pendingImages.length===0||m,children:u.jsx(Rb,{})})]})]}),p&&u.jsxs("div",{className:"oc-reload-banner is-error",role:"alert",children:[u.jsxs("span",{children:[p.code?`${p.code}:`:"",p.message]}),u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{ed()},children:"重试"})]}),m?u.jsx("div",{className:"oc-reload-status",children:"正在重新加载会话…"}):null,X]})})}function ED(e){return e.nativeEvent.isComposing||e.nativeEvent.keyCode===229}function TD(e){const t=/\s*(?:\((?:recommended|推荐)\)|((?:recommended|推荐)))\s*$/i;return t.test(e)?{label:e.replace(t,""),recommended:!0}:{label:e,recommended:!1}}function Tm(e){const t={left:"9 2.5 5.5 6 9 9.5",right:"3 2.5 6.5 6 3 9.5",up:"2.5 8 6 4.5 9.5 8",down:"2.5 4 6 7.5 9.5 4"}[e.direction];return u.jsx("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("polyline",{points:t})})}function CD(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"m4 4 8 8m0-8-8 8"})})}function x3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"m3.25 8.25 3.1 3.1 6.4-6.7"})})}function RD(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("path",{d:"m3.2 11.9-.7 2.6 2.6-.7L12.8 6a1.7 1.7 0 0 0-2.4-2.4L3.2 11.9Z"}),u.jsx("path",{d:"m9.5 4.5 2 2"})]})}function ND(e){return u.jsxs("div",{className:"oc-question-answer-field",children:[u.jsx("div",{className:"oc-question-field-mirror","aria-hidden":"true",children:`${e.value}
396
- `}),u.jsx("textarea",{className:"oc-question-field-input",rows:1,value:e.value,disabled:e.disabled,autoFocus:e.autoFocus,placeholder:e.placeholder,onFocus:e.onFocus,onChange:e.onChange,onKeyDown:e.onKeyDown})]})}function AD(e){const t=e.pending.questions,[n,a]=w.useState(0),[s,o]=w.useState(()=>t.map(()=>({selected:[],custom:"",skipped:!1}))),[c,d]=w.useState(null),[h,m]=w.useState(null),[p,g]=w.useState(!1),x=w.useRef(new Set),v=t[n],S=s[n],T=!!v.options?.length,N=H=>{o($=>$.map((F,Y)=>Y===n?H(F):F)),m(null)},R=H=>H.selected.length>0||H.custom.trim().length>0,O=H=>R(H)||H.skipped,_=async(H,$)=>{const F=e.workspaceId?`?workspaceId=${encodeURIComponent(e.workspaceId)}`:"",Y=await fetch(`${e.origin}/api/operator/v1/chat/sessions/${encodeURIComponent(e.pending.sessionId)}/questions/${encodeURIComponent(e.pending.requestId)}/${H}${F}`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify($)}),oe=await Y.json().catch(()=>({}));if(!Y.ok){if(Y.status===404||Y.status===409){e.onSettled();return}throw new Error(oe.error?.message??`请求失败 (${Y.status})`)}e.onSettled()},P=H=>{const $=H.findIndex(Y=>!O(Y));if($>=0){a($),m("请回答或跳过这个问题");return}const F={answers:t.map((Y,oe)=>{const ee=H[oe];if(ee.skipped)return{id:Y.id,selected:[]};const q=ee.custom.trim();return{id:Y.id,selected:q&&Y.multiSelect!==!0?[]:ee.selected,...q?{custom:q}:{}}})};d("answer"),m(null),_("answer",F).catch(Y=>{d(null),m(Y instanceof Error?Y.message:String(Y))})},U=()=>{if(!R(S)){m("请选择一个选项或填写回答");return}if(n<t.length-1){a(H=>H+1),m(null);return}P(s)},A=H=>{N($=>v.multiSelect?{...$,selected:$.selected.includes(H)?$.selected.filter(F=>F!==H):[...$.selected,H],skipped:!1}:{selected:[H],custom:"",skipped:!1}),!v.multiSelect&&n<t.length-1&&a($=>$+1)},z=H=>{const $=H.target.value;N(F=>({...F,selected:v.multiSelect?F.selected:[],custom:$,skipped:!1}))},X=()=>{const H=s.map(($,F)=>F===n?{selected:[],custom:"",skipped:!0}:$);o(H),m(null),n<t.length-1?a($=>$+1):P(H)};return u.jsx("div",{className:"oc-question-composer","data-question-request":e.pending.requestId,children:u.jsxs("section",{className:`oc-question-card${p?" is-minimized":""}`,"aria-labelledby":`oc-question-${e.pending.requestId}-${n}`,children:[u.jsxs("header",{className:"oc-question-header",children:[u.jsxs("div",{className:"oc-question-heading",children:[v.header?u.jsx("div",{className:"oc-question-eyebrow",children:v.header}):null,u.jsx("h2",{id:`oc-question-${e.pending.requestId}-${n}`,children:v.question})]}),u.jsxs("div",{className:"oc-question-header-actions",children:[u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":p?"展开问题":"收起问题",title:p?"展开问题":"收起问题","aria-expanded":!p,disabled:c!==null,onClick:()=>g(H=>!H),children:u.jsx(Tm,{direction:p?"up":"down"})}),u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":"取消回答",title:"取消回答",disabled:c!==null,onClick:()=>{d("cancel"),m(null),_("cancel",{reason:"USER_CANCELLED"}).catch(H=>{d(null),m(H instanceof Error?H.message:String(H))})},children:u.jsx(CD,{})})]})]}),p?null:u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-question-body",children:[v.detail!==void 0?u.jsx("div",{className:"oc-question-detail",children:u.jsx(ic,{text:v.detail})}):null,u.jsxs("div",{className:"oc-question-options",role:v.multiSelect?"group":"radiogroup",children:[(v.options??[]).map((H,$)=>{const F=S.selected.includes(H.label),Y=TD(H.label);return u.jsxs("button",{type:"button",className:`oc-question-option${F&&!v.multiSelect?" is-selected":""}`,role:v.multiSelect?"checkbox":"radio","aria-checked":F,disabled:c!==null,onClick:()=>A(H.label),children:[v.multiSelect?u.jsx("span",{className:`oc-question-checkbox${F?" is-checked":""}`,"aria-hidden":"true",children:F?u.jsx(x3,{}):null}):u.jsx("span",{className:"oc-question-number",children:$+1}),u.jsx("span",{className:"oc-question-option-copy",children:u.jsxs("span",{className:"oc-question-option-main",children:[u.jsx("span",{className:"oc-question-option-label",children:Y.label}),Y.recommended?u.jsx("span",{className:"oc-question-badge",children:"推荐"}):null,H.description?u.jsx("span",{className:"oc-question-description",children:H.description}):null]})})]},`${H.label}-${$}`)}),u.jsxs("div",{className:`oc-question-custom${S.custom?" is-active":""}`,children:[T?v.multiSelect===!0?u.jsx("span",{className:`oc-question-checkbox${S.custom?" is-checked":""}`,"aria-hidden":"true",children:S.custom?u.jsx(x3,{}):null}):u.jsx("span",{className:"oc-question-number",children:u.jsx(RD,{})}):null,u.jsx(ND,{value:S.custom,disabled:c!==null,placeholder:"输入自定义回答…",autoFocus:!T&&!x.current.has(n),onFocus:()=>x.current.add(n),onChange:z,onKeyDown:H=>{H.key!=="Enter"||H.shiftKey||ED(H)||(H.preventDefault(),U())}})]})]})]}),u.jsxs("footer",{className:"oc-question-footer",children:[u.jsxs("div",{className:"oc-question-pager",children:[u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":"上一题",title:"上一题",disabled:n===0||c!==null,onClick:()=>{a(n-1),m(null)},children:u.jsx(Tm,{direction:"left"})}),u.jsxs("span",{children:[n+1," / ",t.length]}),u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":"下一题",title:"下一题",disabled:n===t.length-1||c!==null,onClick:()=>{a(n+1),m(null)},children:u.jsx(Tm,{direction:"right"})})]}),u.jsx("div",{className:"oc-question-feedback",role:"status",children:h}),u.jsxs("div",{className:"oc-question-actions",children:[u.jsx("button",{type:"button",className:"oc-question-button is-secondary",disabled:c!==null,onClick:X,children:"跳过"}),u.jsx("button",{type:"button",className:"oc-question-button is-primary",disabled:c!==null||!R(S),onClick:U,children:c==="answer"?"提交中…":n===t.length-1?"提交":"下一题"})]})]})]})]})})}function ID({status:e}){return e==="completed"?u.jsx(Y9,{size:15,"aria-hidden":"true"}):e==="in_progress"?u.jsx(J9,{size:15,"aria-hidden":"true",className:"oc-todo-spin"}):u.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":"true",children:u.jsx("circle",{cx:"7.5",cy:"7.5",r:"6.4",stroke:"currentColor",strokeWidth:"1.2",strokeDasharray:"2.4 2.4"})})}function _D({todos:e}){const[t,n]=w.useState(!0);if(e.length===0)return null;const a=e.filter(d=>d.status==="completed").length,s=e.filter(d=>d.status==="in_progress").length,o=e.length-a-s,c=[a?`${a} 已完成`:"",s?`${s} 进行中`:"",o?`${o} 待处理`:""].filter(Boolean).join(" · ");return u.jsxs("section",{className:"oc-todo-panel","aria-label":"任务",children:[u.jsxs("button",{type:"button",className:"oc-todo-head","aria-expanded":!t,onClick:()=>n(d=>!d),children:[u.jsx("span",{className:"oc-todo-leading",children:u.jsx(s5,{size:15,"aria-hidden":"true"})}),u.jsx("strong",{children:"任务"}),u.jsx("span",{className:"oc-todo-summary",children:c}),u.jsx("span",{className:"oc-todo-chevron","aria-hidden":"true",children:t?u.jsx(i5,{size:16}):u.jsx(gd,{size:16})})]}),t?null:u.jsx("ul",{className:"oc-todo-list",children:e.map(d=>u.jsxs("li",{className:`oc-todo-item is-${d.status}`,children:[u.jsx("span",{className:"oc-todo-status","aria-hidden":"true",children:u.jsx(ID,{status:d.status})}),u.jsx("span",{children:d.content})]},d.content))})]})}function MD(e){const{toolCalls:t,onClose:n,overlay:a=!1,embedded:s=!1}=e,o=w.useRef(null);return Xl({open:a&&!s,containerRef:o,triggerRef:e.triggerRef,onEscape:n}),u.jsxs("aside",{ref:o,id:"oc-process-panel",className:`oc-process${a?" is-process-overlay":""}${s?" is-details-tab":""}`,"aria-label":"工具调用记录",role:a&&!s?"dialog":"region","aria-modal":a&&!s?!0:void 0,tabIndex:-1,children:[s?null:u.jsxs("header",{className:"oc-process-head",children:[u.jsxs("div",{className:"oc-process-title",children:[u.jsx("span",{className:"oc-process-title-mark","aria-hidden":"true"}),"工具调用记录",u.jsxs("span",{className:"oc-process-count",children:[t.length," 次"]})]}),u.jsx("button",{type:"button",className:"btn btn-ghost oc-process-close","aria-label":"关闭工具调用记录",onClick:n,children:"关闭"})]}),u.jsx("div",{className:"oc-process-timeline",children:t.length===0?u.jsx("div",{className:"oc-process-empty",children:"本轮对话尚无工具调用。诊断细节会在这里按时间线展示。"}):t.map((c,d)=>u.jsxs("div",{className:`oc-process-item${d===0?" is-first":""}${d===t.length-1?" is-last":""}${c.status==="error"?" is-error":""}${c.status==="running"?" is-running":""}`,children:[u.jsx("div",{className:"oc-process-rail","aria-hidden":"true",children:u.jsx("span",{className:"oc-process-dot"})}),u.jsx("div",{className:"oc-process-time",children:Ul(c.createdAt)}),u.jsx("div",{className:"oc-process-body",children:u.jsx(Q7,{entry:c})})]},c.id))})]})}const w3=[{id:"overview",label:"概览"},{id:"system",label:"System prompt"},{id:"files",label:"Context files"},{id:"skills",label:"Skills"},{id:"extensions",label:"Extensions"},{id:"packages",label:"Plugins"},{id:"tools",label:"Active tools"},{id:"raw",label:"原始 JSON"}];function Ou(e){const t=Array.isArray(e.items)?e.items:void 0;return u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsx("strong",{children:e.title}),u.jsx("span",{className:"oc-runtime-context-meta",children:t?`${t.length} 项`:"未投影"})]}),t===void 0?u.jsx("p",{className:"oc-runtime-context-empty",children:"该 session 未提供资源投影"}):t.length===0?u.jsx("p",{className:"oc-runtime-context-empty",children:e.emptyText}):u.jsx("ul",{className:"oc-runtime-context-resources",children:t.map((n,a)=>u.jsx(OD,{item:n},`${n.name??n.path??a}:${a}`))})]})}function OD(e){const t=e.item,a=[t.scope?`scope ${t.scope}`:"",t.source??"",t.version?`v${t.version}`:"",t.cwd?`cwd ${t.cwd}`:""].filter(Boolean).join(" · "),s=t.path?`${t.path}${t.baseDir?`(base: ${t.baseDir})`:""}`:"";return u.jsxs("li",{children:[u.jsxs("div",{className:"oc-runtime-context-resource-head",children:[u.jsx("strong",{className:"oc-runtime-context-resource-name",title:t.path??t.name,children:t.name||t.path||"未命名资源"}),t.enabled===!1?u.jsx("span",{className:"oc-runtime-context-resource-flag",children:"未启用"}):null,a?u.jsx("span",{className:"oc-runtime-context-meta",title:a,children:a}):null]}),t.description?u.jsx("span",{className:"oc-runtime-context-resource-desc",children:t.description}):null,t.path?u.jsx("code",{className:"oc-runtime-context-resource-path",title:s,children:s}):null,t.error?u.jsxs("span",{className:"oc-runtime-context-diag is-error",children:[u.jsx("span",{className:"oc-runtime-context-diag-icon","aria-hidden":"true",children:"✕"}),t.error]}):null,Array.isArray(t.diagnostics)&&t.diagnostics.length>0?u.jsxs("span",{className:"oc-runtime-context-diag",children:[u.jsx("span",{className:"oc-runtime-context-diag-icon","aria-hidden":"true",children:"⚠"}),t.diagnostics.join(";")]}):null,Array.isArray(t.resolved)&&t.resolved.length>0?u.jsxs("details",{className:"oc-runtime-context-resolved",children:[u.jsxs("summary",{children:["已解析 ",t.resolved.length," 项"]}),u.jsx("ul",{className:"oc-runtime-context-resolved-list",children:t.resolved.map((o,c)=>{const d=`${o.type??"?"}:${o.name??o.path??"?"}`;return u.jsx("li",{children:u.jsx("code",{title:d,children:d})},c)})})]}):null]})}const DD=w.forwardRef(function({open:t,onToggle:n,onClose:a,context:s,panelOnly:o=!1,embedded:c=!1,triggerOnly:d=!1,triggerRef:h},m){const p=Ql(),g=p.reloading,x=p.reloadError,[v,S]=w.useState("overview"),T=w.useRef(null);Xl({open:t&&!d&&!c,containerRef:T,triggerRef:h,onEscape:a}),w.useEffect(()=>{t||S("overview")},[t]);const N=Array.isArray(s.resources.activeTools)?s.resources.activeTools:[],R=typeof s.resources.activeToolCount=="number"?s.resources.activeToolCount:N.length,O=s.systemPrompt.text??s.systemPrompt.summary??"",_=s.systemPrompt.charCount??O.length,P=s.suffix.present?s.suffix.text??s.suffix.summary??"":"",U=s.model?Ns(s.model.provider,s.model.modelId):"",A=s.resources,z=String(s.resources.mode??"closed"),X=z.includes("open")?"open":"closed",H={files:A.contextFiles?.length??0,skills:A.skills?.length??0,extensions:A.extensions?.length??0,packages:A.packages?.length??0},$=["files","skills","extensions","packages"].map(oe=>({id:oe,label:w3.find(ee=>ee.id===oe)?.label??oe,count:H[oe]??0})),F=u.jsx("button",{type:"button",ref:oe=>{typeof m=="function"?m(oe):m&&(m.current=oe)},className:`btn btn-ghost oc-runtime-context-toggle${t?" is-active":""}`,"aria-expanded":t,"aria-controls":"oc-runtime-context-panel",onClick:n,children:"注入上下文"});if(d)return F;const Y=t?u.jsxs("div",{ref:T,id:"oc-runtime-context-panel",className:`oc-runtime-context-sidepanel${c?" is-details-tab":""}`,role:c?"region":"dialog","aria-modal":c?void 0:!0,"aria-label":"注入上下文",tabIndex:-1,children:[c?null:u.jsxs("header",{className:"oc-runtime-context-head",children:[u.jsxs("div",{className:"oc-runtime-context-head-copy",children:[u.jsx("strong",{children:"注入上下文"}),u.jsx("span",{className:"oc-runtime-context-meta",children:"只读 · 本轮实际注入的 system prompt / 资源(已脱敏)"})]}),u.jsx("button",{type:"button",className:"btn btn-ghost oc-runtime-context-close","aria-label":"关闭注入上下文",onClick:a,children:"关闭"})]}),u.jsxs("div",{className:"oc-runtime-context-layout",children:[u.jsx("nav",{className:"oc-runtime-context-nav","aria-label":"上下文分类",children:w3.map(oe=>{const ee=H[oe.id];return u.jsxs("button",{type:"button",className:`oc-runtime-context-nav-item${v===oe.id?" is-active":""}`,"aria-current":v===oe.id?"page":void 0,onClick:()=>S(oe.id),children:[u.jsx("span",{className:"oc-runtime-context-nav-label",title:oe.label,children:oe.label}),typeof ee=="number"?u.jsx("span",{className:"oc-runtime-context-nav-count",children:ee}):null]},oe.id)})}),u.jsxs("div",{className:"oc-runtime-context-body",children:[v==="overview"?u.jsxs("div",{className:"oc-runtime-context-overview",children:[s.model?u.jsxs("section",{className:"oc-runtime-context-model-card",children:[u.jsx("span",{className:"oc-runtime-context-model-label",children:"模型"}),u.jsx("code",{className:"oc-runtime-context-model-ref",title:U,children:U})]}):null,u.jsxs("div",{className:"oc-runtime-context-stat-grid",children:[u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"Prompt 字数"}),u.jsxs("strong",{className:"oc-runtime-context-stat-value",children:[_.toLocaleString()," 字"]})]}),u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"工具"}),u.jsx("strong",{className:"oc-runtime-context-stat-value",children:R})]}),u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"思考"}),u.jsx("strong",{className:"oc-runtime-context-stat-value",children:s.thinkingLevel??"—"})]}),u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"资源面"}),u.jsxs("strong",{className:`oc-runtime-context-stat-value oc-runtime-context-mode is-${X}`,title:z,children:[u.jsx("span",{className:"oc-runtime-context-mode-dot","aria-hidden":"true"}),z]})]})]}),u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsx("header",{className:"oc-runtime-context-section-head",children:u.jsx("strong",{children:"已加载资源"})}),u.jsx("div",{className:"oc-runtime-context-resource-links",children:$.map(oe=>u.jsxs("button",{type:"button",className:"oc-runtime-context-resource-link",onClick:()=>S(oe.id),children:[u.jsx("span",{className:"oc-runtime-context-resource-label",children:oe.label}),u.jsx("span",{className:`oc-runtime-context-resource-count${oe.count===0?" is-zero":""}`,children:oe.count}),u.jsx("span",{className:"oc-runtime-context-resource-chevron","aria-hidden":"true",children:"›"})]},oe.id))})]})]}):null,v==="system"?u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"System prompt"}),u.jsxs("code",{className:"oc-runtime-context-hash",children:[s.systemPrompt.hash.slice(0,12),"…"]})]}),O?u.jsx(C1,{text:O}):null]}),u.jsx("pre",{className:"oc-runtime-context-text",children:O||"(空)"})]}),u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsxs("div",{className:"oc-runtime-context-section-title",children:[u.jsx("strong",{children:"Session suffix"}),u.jsx("span",{className:"oc-runtime-context-meta",children:s.suffix.present?`${(s.suffix.charCount??0).toLocaleString()} 字`:"未注入"})]}),P?u.jsx(C1,{text:P}):null]}),s.suffix.present?u.jsx("pre",{className:"oc-runtime-context-text",children:P||"已注入"}):u.jsx("p",{className:"oc-runtime-context-empty",children:"本会话无额外 suffix"})]})]}):null,v==="files"?u.jsx(Ou,{title:"Context files",items:A.contextFiles?.map(oe=>({name:oe.path,description:`${oe.characters.toLocaleString()} 字符`})),emptyText:"该 session 未加载任何上下文文件"}):null,v==="skills"?u.jsx(Ou,{title:"Skills",items:A.skills,emptyText:"该 session 未加载任何 Skills"}):null,v==="extensions"?u.jsx(Ou,{title:"Extensions",items:A.extensions,emptyText:"该 session 未加载任何 Extensions"}):null,v==="packages"?u.jsx(Ou,{title:"Plugins",items:A.packages,emptyText:"该会话没有插件"}):null,v==="tools"?u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsx("strong",{children:"Active tools"}),u.jsxs("span",{className:"oc-runtime-context-meta",children:[R," 项"]})]}),N.length===0?u.jsx("p",{className:"oc-runtime-context-empty",children:"无激活工具"}):u.jsx("ul",{className:"oc-runtime-context-tools",children:N.map(oe=>u.jsx("li",{children:u.jsx("code",{children:oe})},oe))}),Array.isArray(A.diagnostics)&&A.diagnostics.length>0?u.jsx("ul",{className:"oc-runtime-context-resources",children:A.diagnostics.map((oe,ee)=>u.jsxs("li",{children:[u.jsxs("span",{className:`oc-runtime-context-diag is-${oe.type??"warning"}`,children:[oe.type,": ",oe.message]}),oe.path?u.jsx("code",{children:oe.path}):null]},ee))}):null]}):null,v==="raw"?u.jsxs("details",{className:"oc-runtime-context-raw",open:!0,children:[u.jsx("summary",{children:"原始投影 JSON"}),u.jsx("pre",{children:JSON.stringify(s,null,2)})]}):null]},v)]}),u.jsxs("footer",{className:"oc-runtime-context-foot",children:[u.jsx("span",{className:"oc-runtime-context-meta",children:g?"正在重新加载会话…":"重新加载 Pi 会话设置、扩展、技能、提示词与上下文文件"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:g,onClick:()=>{ed()},children:"重新加载会话"}),x&&u.jsxs("span",{className:"oc-runtime-context-diag is-error",role:"alert",children:[x.code?`${x.code}:`:"",x.message,u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{ed()},children:"重试"})]})]})]}):null;return o?Y:u.jsxs("div",{className:"oc-runtime-context-menu",children:[F,Y]})});function jD(){const e=w.useRef(null),t=w.useRef(!1),n=w.useRef(null),a=w.useRef(new Map),s=w.useRef(new Set),o=w.useRef(null),c=w.useRef(null),d=w.useRef(0),h=w.useRef(null),m=w.useRef(new Set),p=w.useRef(new Set),g=w.useRef(new Map),x=w.useRef(new Set),v=w.useRef(null),S=w.useRef(null),T=w.useRef(!1),N=w.useRef(0),R=w.useRef(null),O=w.useRef(!1),_=w.useRef(!1),P=w.useRef(null),U=w.useRef(new Set),A=w.useRef(new Set),z=w.useRef(new Set),X=w.useRef(new Map),H=w.useRef(!1),$=w.useRef(0);return w.useMemo(()=>({sessionRef:e,streamingRef:t,abortRef:n,sessionAbortControllersRef:a,inlineStreamSessionIdsRef:s,assistantIdRef:o,lastEventIdRef:c,sessionGenerationRef:d,eventsStreamStateRef:h,settledTurnIdsRef:m,seenEventIdsRef:p,turnAssistantIdsRef:g,sealedAssistantIdsRef:x,reconnectAbortRef:v,activeTurnIdRef:S,submitInFlightRef:T,submitGenerationRef:N,pendingSubmissionRef:R,stopInFlightRef:O,stopRequestedRef:_,stoppingTurnIdRef:P,abortPostedTurnIdsRef:U,releasedClientRequestIdsRef:A,usageResponseKeysRef:z,unlinkedOperationIdsRef:X,isComposingRef:H,compositionEndedAtRef:$}),[e,t,n,a,s,o,c,d,h,m,p,g,x,v,S,T,N,R,O,_,P,U,A,z,X,H,$])}function LD(e){if(!(!e||typeof e!="object"))return e}function Hi(e){return typeof e=="string"?e:void 0}function N1(e){if(!Array.isArray(e))return;const t=[];for(const n of e){const a=LD(n);if(!a)continue;const s=Hi(a.type)??"";if(s==="thinking"||s==="reasoning"){const o=Hi(a.thinking)??Hi(a.text)??"";t.push({type:"thinking",thinking:o});continue}if(s==="toolCall"||s==="tool_call"||s==="toolUse"||s==="tool_use"){const o=Hi(a.toolCallId)??Hi(a.id)??"";if(!o)continue;const c=Hi(a.toolName)??Hi(a.name);t.push({type:"toolCall",toolCallId:o,...c?{toolName:c}:{}});continue}if(s==="text"||s==="output_text"||s===""){const o=Hi(a.text);o!==void 0&&t.push({type:"text",text:o})}}return t}function zD(e,t={}){return e.type==="thinking"&&!t.isStreaming&&e.thinking.trim()===""}function A1(e,t={}){return e.filter(n=>!zD(n,t))}function BD(e){return e.type==="text"}function qD(e,t={}){const n=A1(e,t);let a=-1;for(let s=n.length-1;s>=0;s--)if(!BD(n[s])){a=s;break}return a===-1?{answerBlocks:n,processBlocks:[]}:{answerBlocks:n.slice(a+1),processBlocks:n.slice(0,a+1)}}function HD(e){return e.filter(t=>t.type==="text").map(t=>t.text).join("")}function UD(e){return{key:e,assistants:[],tools:[],processItems:[],live:!1}}function I1(e){const t=[],n=[];let a,s=[];const o=c=>{for(const d of s)d.assistantMessageId||(d.assistantMessageId=c),d.turnId||(d.turnId=a);s=[]};for(const c of e){const d=Date.parse(c.at)||Date.now();if(c.role==="user"){a=`restored-${c.id}`,s=[],t.push({id:c.id,role:"user",text:c.text,createdAt:d});continue}if(c.role==="assistant"){a||(a=`restored-${c.id}`);const h=N1(c.content);t.push({id:c.id,role:"assistant",text:c.text,createdAt:d,...c.kind==="provider-error"&&c.providerError?{kind:c.kind,providerError:c.providerError}:{},...h&&h.length>0?{content:h}:{}}),o(c.id);continue}if(c.role==="tool"){a||(a=`restored-tool-${c.id}`);const h={id:c.toolCallId||c.id,toolName:c.toolName||"tool",status:c.isError===!0?"error":"ok",resultText:c.text,result:c.text,createdAt:d,finishedAt:d,turnId:a,...c.operationId?{operationId:c.operationId}:{}};n.push(h),s.push(h)}}return{messages:t,toolCalls:n}}function FD(e){return[...e].sort((t,n)=>t.eventSeq!==void 0&&n.eventSeq!==void 0&&t.eventSeq!==n.eventSeq?t.eventSeq-n.eventSeq:t.createdAt!==n.createdAt?t.createdAt-n.createdAt:t.id<n.id?-1:1)}function Ll(e,t){if(t.length===0)return;const n=FD(t);for(const a of n){const s=kO(a);s?e.push({kind:"activity",activity:s}):e.push({kind:"tool",tool:a})}}function Cm(e,t,n,a){let s=[];for(const o of e){if(o.type==="thinking"){Ll(n,s),s=[],n.push({kind:"thinking",thinking:o.thinking});continue}if(o.type==="text"){Ll(n,s),s=[],o.text.trim()&&n.push({kind:"text",text:o.text});continue}const c=t.tools.find(d=>d.id===o.toolCallId);c&&!a.has(c.id)&&(s.push(c),a.add(c.id))}Ll(n,s)}function Rm(e,t,n,a){const s=e.tools.filter(o=>!a.has(o.id)&&o.assistantMessageId===t.id);if(s.length!==0){for(const o of s)a.add(o.id);Ll(n,s)}}function $D(e){const t=new Set,n=[],a=e.assistants.at(-1),s=a?.kind==="provider-error"?void 0:a,o=s?e.assistants.lastIndexOf(s):-1;for(const[p,g]of e.assistants.entries())if(p!==o){if(g.kind==="provider-error"&&g.providerError){Cm(A1(g.content??[]),e,n,t),Rm(e,g,n,t),n.push({kind:"provider-error",error:g.providerError});continue}Cm(A1(g.content??[]),e,n,t),Rm(e,g,n,t)}const c=s?.content??[],d=qD(c,{isStreaming:e.live});Cm(d.processBlocks,e,n,t),s&&Rm(e,s,n,t);const h=e.tools.filter(p=>!t.has(p.id));if(h.length>0&&Ll(n,h),e.processItems=n,!s)return;if(c.length===0){e.answer=s;return}const m=HD(d.answerBlocks);e.answer={...s,text:m,content:d.answerBlocks}}function PD(e){const t=e.messages.filter(d=>d.role==="user"||d.role==="assistant"),n=[];let a=null;const s=d=>{const h=UD(d);return n.push(h),h};for(const d of t){if(d.role==="user"){a=s(`user-${d.id}`),a.user=d;continue}if(d.kind==="compaction"){a=s(`compaction-${d.id}`),a.assistants.push(d),a=null;continue}a||(a=s(`assistant-${d.id}`)),a.assistants.push(d)}const o=new Set,c=new Map;for(const d of n)for(const h of d.assistants)c.set(h.id,d);for(const d of e.toolCalls)if(d.assistantMessageId){const h=c.get(d.assistantMessageId);h&&(h.tools.push(d),o.add(d.id))}for(const d of e.toolCalls)if(!o.has(d.id)&&d.turnId){const h=n.find(p=>p.tools.some(g=>g.turnId===d.turnId)||p.key===`turn-${d.turnId}`||p.user&&`restored-${p.user.id}`===d.turnId);if(h){h.tools.push(d),o.add(d.id);continue}const m=n.find(p=>d.turnId===`restored-${p.user?.id}`||p.assistants.some(g=>d.turnId===`restored-${g.id}`));m&&(m.tools.push(d),o.add(d.id))}for(const d of e.toolCalls){if(o.has(d.id))continue;const h=n.find((m,p)=>{const g=m.user?.createdAt??m.assistants[0]?.createdAt??0,v=n[p+1]?.user?.createdAt??Number.POSITIVE_INFINITY;return d.createdAt>=g&&d.createdAt<v});h&&(h.tools.push(d),o.add(d.id))}for(const d of n)d.tools.sort((h,m)=>h.eventSeq!==void 0&&m.eventSeq!==void 0?h.eventSeq-m.eventSeq:h.createdAt-m.createdAt),d.live=e.streaming&&e.activeAssistantId!==null&&d.assistants.some(h=>h.id===e.activeAssistantId),$D(d);return n}function GD(e,t){return t<=0?[]:e.length<=t?[...e]:e.slice(-t)}function nx(e,t){const n=e.findIndex(a=>a.operationId===t.operationId);return n<0?[...e,t]:e.map((a,s)=>{if(s!==n)return a;let o=a.eventSeq;return o===void 0?o=t.eventSeq:t.eventSeq!==void 0&&(o=Math.min(o,t.eventSeq)),{...a,...t,...o===void 0?{}:{eventSeq:o},updatedSeq:Math.max(a.updatedSeq??a.eventSeq??0,t.updatedSeq??t.eventSeq??0),toolCallId:a.toolCallId??t.toolCallId,activityRef:a.activityRef??t.activityRef}})}function VD(e){const t=e.operation;if(!t||typeof t!="object")return;const n=t;if(n.schemaVersion!==1||typeof n.operationId!="string"||typeof n.action!="string"||typeof n.state!="string"||typeof n.inspectHref!="string"||typeof n.createdAt!="string"||typeof n.updatedAt!="string"||typeof n.previewHash!="string")return;const a=KD(n.runSummary),{runSummary:s,...o}=n;return{...o,...a?{runSummary:a}:{}}}function KD(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(typeof t.runId!="string"||!t.runId||typeof t.status!="string"||!t.status)return;let n=[];Array.isArray(t.nodes)&&(n=t.nodes.flatMap(o=>{if(!o||typeof o!="object")return[];const c=String(o.id??""),d=String(o.status??"");if(!c||!d)return[];const h=String(o.failureCategory??"");return[{id:c,status:d,...h?{failureCategory:h}:{}}]}).slice(0,20));let a;if(t.next&&typeof t.next=="object"){const o=t.next;a={kind:String(o.kind??""),...typeof o.description=="string"?{description:o.description}:{}}}return{runId:t.runId,status:t.status,nodes:n,...typeof t.verdict=="string"?{verdict:t.verdict}:{},...typeof t.failureCategory=="string"?{failureCategory:t.failureCategory}:{},...a&&a.kind?{next:a}:{}}}const YD=["operation","contract","dag","report","html"];function WD(e){const t=e.artifact;if(!t||typeof t!="object")return;const n=t;if(!(n.schemaVersion!==1||typeof n.artifactId!="string"||!n.artifactId||typeof n.kind!="string"||!YD.includes(n.kind)||typeof n.previewHash!="string")){for(const a of["title","summary","htmlPreview","reportText","inspectHref"])if(n[a]!==void 0&&typeof n[a]!="string")return;return n}}function ZD(e,t){const n=e.findIndex(a=>a.artifactId===t.artifactId);return n<0?[...e,t]:e.map((a,s)=>s===n?{...a,...t,eventSeq:a.eventSeq??t.eventSeq,activityRef:a.activityRef??t.activityRef}:a)}function XD(e){if(!e||typeof e!="object")return;const t=e;if(!(t.schemaVersion!==1||typeof t.cardId!="string"||t.gateType!=="contract-apply"&&t.gateType!=="dag-run"||typeof t.taskId!="string"||typeof t.state!="string"||typeof t.expiresAt!="string"||typeof t.inspectHref!="string"||typeof t.previewHash!="string"))return t}function QD(e,t){const n=e.findIndex(o=>o.cardId===t.cardId);if(n<0)return[...e,t];const a=[...e],s=a[n];return s?(a[n]={...s,...t,eventSeq:s.eventSeq??t.eventSeq,activityRef:s.activityRef??t.activityRef},a):[...e,t]}function Du(e){return typeof e=="number"&&Number.isFinite(e)?Math.max(0,Math.floor(e)):void 0}function JD(e){const t=e.data&&typeof e.data=="object"?e.data:{},n=typeof e.eventId=="string"?e.eventId:void 0,a=typeof t.compactionId=="string"&&t.compactionId?t.compactionId:n;if(!a)return;const s=t.status==="running"||t.status==="completed"||t.status==="failed"||t.status==="aborted"?t.status:"completed",o=t.reason==="manual"||t.reason==="threshold"||t.reason==="overflow"?t.reason:"manual",c=typeof t.summary=="string"?t.summary:"",d=typeof t.errorMessage=="string"?t.errorMessage:void 0;return{id:`compaction-${a}`,role:"assistant",kind:"compaction",text:c||d||(s==="completed"?"历史上下文已精简,关键决策与当前任务已保留。":""),createdAt:Date.parse(e.at??"")||Date.now(),compaction:{compactionId:a,status:s,reason:o,willRetry:t.willRetry===!0,...Du(t.tokensBefore)===void 0?{}:{tokensBefore:Du(t.tokensBefore)},...Du(t.estimatedTokensAfter)===void 0?{}:{estimatedTokensAfter:Du(t.estimatedTokensAfter)},...typeof t.firstKeptEntryId=="string"&&t.firstKeptEntryId?{firstKeptEntryId:t.firstKeptEntryId}:{},...d?{errorMessage:d}:{},...n?{eventId:n}:{}}}}function Ap(e,t){const n=JD(t);return n?(e.find(o=>o.id===n.id)?e.map(o=>o.id===n.id?{...o,...n,createdAt:Math.min(o.createdAt,n.createdAt),text:n.text||o.text,compaction:{...o.compaction,...n.compaction}}:o):[...e,n]).sort((o,c)=>o.createdAt-c.createdAt):e}function ej(e){const{refs:t,onReconcile:n,setError:a,setInterview:s,setHumanGateCards:o,setArtifactCards:c,setStreaming:d,setTurnPhase:h=()=>{},setDeferredTurn:m=()=>{},setDeferredTurns:p=()=>{},setStreamingAssistantId:g,setUnread:x,setOperationCards:v,setUsage:S,onTelemetryRefresh:T,setMessages:N,setToolCalls:R,setPendingQuestion:O=()=>{},setTodos:_=()=>{}}=e;let P,U=-1;return(A,z,X,H)=>{if(H?.generation!==void 0&&t.sessionGenerationRef.current!==H.generation)return;const $=H?.replay===!0;if(A==="stream_ready")return;if(A==="reconcile"){const K={reason:typeof z.reason=="string"?z.reason:"cursor_expired",...typeof z.minSeq=="number"?{minSeq:z.minSeq}:{},...typeof z.epoch=="string"?{epoch:z.epoch}:{},...typeof z.latestTurnId=="string"?{latestTurnId:z.latestTurnId}:{}};(typeof z.latestEventId=="string"||z.latestEventId===null)&&(K.latestEventId=z.latestEventId),n?.(K);return}const F=z.data&&typeof z.data=="object"?z.data:z;if(A==="todo_updated"||A==="todo_cleared"){const I=Array.isArray(F.todos)?F.todos:[];_(I.filter(K=>!!K&&typeof K=="object"&&typeof K.content=="string"&&(K.status==="pending"||K.status==="in_progress"||K.status==="completed")));return}if((A==="question_requested"||A==="question_resolved"||A==="question_cancelled")&&F.question&&typeof F.question=="object"){const I=F.question;typeof I.requestId=="string"&&typeof I.sessionId=="string"&&I.sessionId===t.sessionRef.current?.sessionId&&O(A==="question_requested"&&I.status==="pending"?I:null);return}const Y=typeof z.turnId=="string"?z.turnId:void 0,oe=typeof z.seq=="number"&&Number.isFinite(z.seq)?z.seq:void 0,ee=typeof z.at=="string"&&Number.isFinite(Date.parse(z.at))?Date.parse(z.at):Date.now();if(A==="queue_update"){const I=typeof F.revision=="number"?F.revision:-1,K=t.sessionRef.current?.sessionId;if(K!==P&&(P=K,U=-1),I<U)return;U=I,m(F.deferredTurn&&typeof F.deferredTurn=="object"?F.deferredTurn:null),Array.isArray(F.deferredTurns)&&p(F.deferredTurns);return}if(A==="user_message"){const I=F.message&&typeof F.message=="object"?F.message:null;if(I&&typeof I.id=="string"&&typeof I.text=="string"){const K=typeof I.at=="string"&&Number.isFinite(Date.parse(I.at))?Date.parse(I.at):Date.now();N(Q=>Q.some(pe=>pe.id===I.id)?Q:[...Q,{id:I.id,role:"user",text:I.text,createdAt:K}])}return}if(A==="compact"||A==="compaction_start"||A==="compaction_end"){N(I=>Ap(I,{eventId:typeof z.eventId=="string"?z.eventId:void 0,at:new Date(ee).toISOString(),data:F}));return}if(Y&&(A==="agent_start"||A==="message_update")&&t.settledTurnIdsRef.current.has(Y))return;let q=X;if(Y){const I=t.turnAssistantIdsRef.current.get(Y);I?q=I:t.turnAssistantIdsRef.current.set(Y,X)}if(A==="interview-turn"){s(I=>({...I??{},interviewSessionId:typeof F.interviewSessionId=="string"?F.interviewSessionId:I?.interviewSessionId,taskId:typeof F.taskId=="string"?F.taskId:I?.taskId,state:typeof F.state=="string"?F.state:I?.state,question:F.question&&typeof F.question=="object"?F.question:void 0}));return}if(A==="draft"){s(I=>({...I??{},taskId:typeof F.taskId=="string"?F.taskId:I?.taskId,draft:F.draft&&typeof F.draft=="object"?F.draft:I?.draft,draftSha256:typeof F.draftSha256=="string"?F.draftSha256:I?.draftSha256,taskKindRecommendation:typeof F.taskKindRecommendation=="string"?F.taskKindRecommendation:I?.taskKindRecommendation}));return}if(A==="assessment"){s(I=>({...I??{},assessment:F}));return}if(A==="taskKind-confirmed"){s(I=>({...I??{},confirmedTaskKind:typeof F.taskKind=="string"?F.taskKind:I?.confirmedTaskKind,taskKindRecommendation:void 0}));return}if(A==="human-gate-card"){const I=XD(F);I&&o(K=>QD(K,{...I,...oe===void 0?{}:{eventSeq:oe},...Y?{turnId:Y}:{},activityRef:`gate:${I.cardId}`}));return}if(A==="artifact-ref"){const I=WD(F);I&&c(K=>ZD(K,{...I,...oe===void 0?{}:{eventSeq:oe},...Y?{turnId:Y}:{},activityRef:`artifact:${I.artifactId}`}));return}if(A==="agent_start"){if($&&Y!==void 0&&Y!==t.activeTurnIdRef.current)return;if(Y&&(t.settledTurnIdsRef.current.delete(Y),t.activeTurnIdRef.current=Y),t.stopRequestedRef.current&&(!Y||Y===t.stoppingTurnIdRef.current||Y===t.activeTurnIdRef.current)){t.streamingRef.current=!1,d(!1),h("idle"),g(null);return}t.streamingRef.current=!0,d(!0),h("running"),g(q);return}if(A==="agent_settled"||A==="agent_end"){if(Y&&t.settledTurnIdsRef.current.add(Y),A==="agent_end")return;const I=t.pendingSubmissionRef.current;I&&Y&&I.acceptedTurnId===Y&&(t.releasedClientRequestIdsRef.current.add(I.clientRequestId),t.pendingSubmissionRef.current=null,t.submitInFlightRef.current=!1),(!Y||Y===t.stoppingTurnIdRef.current||Y===t.activeTurnIdRef.current)&&(t.stoppingTurnIdRef.current=null,t.stopRequestedRef.current=!1),Y===t.activeTurnIdRef.current&&(t.activeTurnIdRef.current=null),t.streamingRef.current=!1,t.assistantIdRef.current=null,d(!1),h("idle"),g(null),A==="agent_settled"&&!$&&typeof document<"u"&&document.hidden&&x(Q=>Q+1);let K=!1;R(Q=>(K=Q.some(pe=>pe.assistantMessageId===q),Q.map(pe=>pe.status==="running"&&(Y!==void 0&&pe.turnId===Y||pe.assistantMessageId===q)?{...pe,status:"error",finishedAt:Date.now()}:pe))),N(Q=>Q.filter(pe=>pe.id!==q||pe.role!=="assistant"||pe.text.trim()||pe.content&&pe.content.length>0?!0:K)),$||T?.();return}if(A==="operation-ref"||A==="operation-status"){const I=VD(F),K=t.sessionRef.current?.sessionId;if(I&&K&&t.unlinkedOperationIdsRef.current.get(K)?.has(I.operationId))return;if(I){const Q=typeof F.toolCallId=="string"?F.toolCallId:void 0;v(pe=>nx(pe,{...I,...oe===void 0?{}:{eventSeq:oe,updatedSeq:oe},...Y?{turnId:Y}:{},...Q?{toolCallId:Q}:{},activityRef:`operation:${I.operationId}`}))}return}if(A==="operation-unlinked"){const I=typeof F.operationId=="string"?F.operationId:"",K=t.sessionRef.current?.sessionId;if(I&&K){const Q=t.unlinkedOperationIdsRef.current.get(K)??new Set;Q.add(I),t.unlinkedOperationIdsRef.current.set(K,Q),v(pe=>pe.filter(j=>j.operationId!==I))}return}if(A==="usage"){if($)return;const I=F,K=typeof I.responseKey=="string"&&I.responseKey?I.responseKey:void 0;if(K&&t.usageResponseKeysRef.current.has(K))return;K&&t.usageResponseKeysRef.current.add(K),S(Q=>{const pe=I.inputTokens??0,j=I.outputTokens??0,G=I.cacheReadTokens??0,W=I.cacheWriteTokens??0,D=I.totalTokens??pe+j+G+W,ye=I.contextUsage,se=ye&&typeof ye=="object"?{tokens:typeof ye.tokens=="number"?ye.tokens:null,contextWindow:typeof ye.contextWindow=="number"?ye.contextWindow:0,percent:typeof ye.percent=="number"?ye.percent:null}:Q.contextUsage;return{inputTokens:Q.inputTokens+pe,outputTokens:Q.outputTokens+j,cacheReadTokens:Q.cacheReadTokens+G,cacheWriteTokens:Q.cacheWriteTokens+W,totalTokens:Q.totalTokens+D,cost:I.cost===void 0?Q.cost:(Q.cost??0)+I.cost,...se?{contextUsage:se}:{}}});return}if(A==="message_update"||A==="message_end"){if($)return;const I=t.sealedAssistantIdsRef.current;if(A==="message_update"&&I.has(q)){const j=Ui("a");Y&&t.turnAssistantIdsRef.current.set(Y,j);const G=q;R(W=>W.map(D=>D.assistantMessageId===G?{...D,assistantMessageId:j}:D)),q=j,g(j)}const K=typeof F.text=="string"?F.text:"",Q=N1(F.content),pe=q;N(j=>j.some(W=>W.id===pe)?j.map(W=>W.id!==pe?W:{...W,text:K,...Q?{content:Q}:{}}):[...j,{id:pe,role:"assistant",text:K,createdAt:ee,...Q?{content:Q}:{}}]),A==="message_end"&&I.add(pe)}else if(A==="tool_call"){const I=typeof F.toolCallId=="string"?F.toolCallId:Ui("t"),K=typeof F.toolName=="string"?F.toolName:"tool",Q=typeof F.argsPreview=="string"?F.argsPreview:"{}";R(pe=>pe.some(j=>j.id===I)?pe.map(j=>j.id!==I?j:{...j,args:Q,status:"running",turnId:Y??j.turnId,assistantMessageId:q,...oe===void 0?{}:{eventSeq:oe}}):[...pe,{id:I,toolName:K,args:Q,status:"running",createdAt:ee,...oe===void 0?{}:{eventSeq:oe},turnId:Y,assistantMessageId:q}])}else if(A==="tool_result"){const I=typeof F.toolCallId=="string"?F.toolCallId:Ui("r"),K=typeof F.toolName=="string"?F.toolName:"tool",Q=F.isError===!0,pe=typeof F.resultPreview=="string"?F.resultPreview:"{}",j=typeof F.operationId=="string"&&F.operationId?F.operationId:void 0;R(G=>G.find(D=>D.id===I)?G.map(D=>D.id!==I?D:{...D,result:pe,resultText:pe,status:Q?"error":"ok",finishedAt:ee,...oe===void 0?{}:{finishedSeq:oe},turnId:Y??D.turnId,assistantMessageId:D.assistantMessageId??q,...j?{operationId:j}:D.operationId?{operationId:D.operationId}:{}}):[...G,{id:I,toolName:K,result:pe,resultText:pe,status:Q?"error":"ok",createdAt:ee,finishedAt:ee,...oe===void 0?{}:{eventSeq:oe,finishedSeq:oe},turnId:Y,assistantMessageId:q,...j?{operationId:j}:{}}])}else if(A==="error"){const I=F.providerError&&typeof F.providerError=="object"?F.providerError:void 0;if(I&&typeof I.message=="string"&&typeof I.raw=="string"&&(I.category==="authentication"||I.category==="context-overflow"||I.category==="rate-limit"||I.category==="provider")){if($)return;const K=I,Q=N1(F.content),pe=Y&&oe!==void 0?`provider-error-${Y}-${oe}`:Ui("provider-error");N(j=>{if(j.some(W=>W.id===pe))return j;const G=j.some(W=>W.id===q&&!!W.content?.length);return[...j,{id:pe,role:"assistant",kind:"provider-error",text:K.message,createdAt:ee,providerError:K,...!G&&Q?{content:Q}:{}}]});return}a(typeof F.message=="string"?F.message:"chat error")}}}const Nm={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,totalTokens:0},Am={turns:0,steps:0,llmMs:0,toolMs:0,ttftMs:0,ttftSteps:0,decodeMs:0,decodeTokens:0};function tj(e){const t=h=>{const m=e[h];return typeof m=="string"&&m?m:void 0},n=t("operationId"),a=t("action"),s=t("state"),o=t("createdAt");if(!n||!a||!s||!o)return;const c=t("updatedAt")??t("finishedAt")??t("startedAt")??o,d=t("dagRunId");return{schemaVersion:1,operationId:n,action:a,state:s,createdAt:o,updatedAt:c,inspectHref:`/inspect/?operationId=${encodeURIComponent(n)}#/`,...t("taskId")?{taskId:t("taskId")}:{},...d?{dagRunId:d}:{},...t("errorCode")?{errorCode:t("errorCode")}:{},activityRef:`operation:${n}`,previewHash:`${n}:${s}:${c}`}}async function nj(e){const{identity:t}=e,n=()=>{const a=e.currentOwner();return a.sessionId===t.sessionId&&a.workspaceId===t.workspaceId};if(!t.workspaceId||!n())return!1;if(t.action==="remove")return e.setOperationCards(a=>a.filter(s=>s.operationId!==t.operationId)),!0;try{const a=new URLSearchParams({workspaceId:t.workspaceId}),o=await(e.fetchFn??fetch)(`${e.origin}/api/operator/v1/operations/${encodeURIComponent(t.operationId)}?${a.toString()}`,{credentials:"include"});if(!o.ok||!n())return!1;const c=await o.json(),d=c.operation;if(c.workspaceId!==t.workspaceId||!d||d.workspaceId!==t.workspaceId||d.operationId!==t.operationId||!n())return!1;const h=tj(d);return h?(e.setOperationCards(m=>n()?nx(m,h):m),n()):!1}catch{return!1}}function rj(e,t){return(t??[]).reduce((n,a)=>Ap(n,a),e)}function aj(e){const{origin:t,refs:n,sessionId:a,workspaceId:s,setError:o,onReconcile:c}=e,[d,h]=w.useState([]),[m,p]=w.useState([]),[g,x]=w.useState([]),[v,S]=w.useState([]),[T,N]=w.useState(50),[R,O]=w.useState(0),[_,P]=w.useState([]),[U,A]=w.useState(null),[z,X]=w.useState(null),[H,$]=w.useState(!1),[F,Y]=w.useState(Nm),[oe,ee]=w.useState(Am),[q,I]=w.useState(!1),[K,Q]=w.useState("idle"),[pe,j]=w.useState(null),[G,W]=w.useState([]),[D,ye]=w.useState(null),[se,V]=w.useState([]),[Z,ne]=w.useState(null),[ue]=w.useState(!1),he=w.useCallback(async()=>{const Be=n.sessionRef.current?.sessionId;if(Be)try{const Qe=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Be)}`,{credentials:"include"});if(!Qe.ok)return;const Ue=await Qe.json();if(n.sessionRef.current?.sessionId!==Be)return;Ue.sessionStats&&ee(Ue.sessionStats),Ue.usage&&Y(Ue.usage)}catch{}},[t,n]),Re=w.useMemo(()=>ej({refs:n,onReconcile:c,setError:o,setInterview:A,setHumanGateCards:P,setArtifactCards:S,setStreaming:I,setTurnPhase:Q,setDeferredTurn:j,setDeferredTurns:W,setPendingQuestion:ye,setTodos:V,setStreamingAssistantId:ne,setUnread:O,setOperationCards:x,setUsage:Y,onTelemetryRefresh:()=>{he()},setMessages:h,setToolCalls:p}),[n,c,o,he]),ze=w.useCallback((Be,Qe,Ue)=>{if(Ue?.targetSessionId&&n.sessionRef.current?.sessionId!==Ue.targetSessionId||Ue?.generation!==void 0&&n.sessionGenerationRef.current!==Ue.generation)return null;const st=Be.split(`
397
- `);let me="message",fe="",He=null;for(const ct of st)ct.startsWith("event: ")?me=ct.slice(7).trim():ct.startsWith("data: ")?fe+=ct.slice(6):ct.startsWith("id: ")&&(He=ct.slice(4).trim());if(!fe)return He;let we;try{we=JSON.parse(fe)}catch{return He}const Fe=He??(typeof we.eventId=="string"?we.eventId:null);if(Fe){if(n.seenEventIdsRef.current.has(Fe))return Fe;n.seenEventIdsRef.current.add(Fe)}return Re(me,we,Qe,Ue),He??Fe},[Re,n]),Ke=w.useCallback(async(Be,Qe)=>{const Ue=Qe?.background===!0;Ue||$(!0);try{const st=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Be)}/context`,{credentials:"include"});if(!st.ok)return;const me=await st.json();me.context&&n.sessionRef.current?.sessionId===Be&&X(fe=>xk(fe,me.context)?fe:me.context)}finally{Ue||$(!1)}},[t,n]);w.useEffect(()=>{a&&Ke(a)},[a,Ke]),w.useEffect(()=>{if(!a)return;const Be=window.setTimeout(()=>{Ke(a,{background:!0})},350);return()=>window.clearTimeout(Be)},[a,g,_,U,Ke]);const ft=w.useCallback(Be=>nj({origin:t,identity:Be,currentOwner:()=>({sessionId:n.sessionRef.current?.sessionId,workspaceId:s}),setOperationCards:x}),[t,n,s]),gt=w.useMemo(()=>d.filter(Be=>Be.role!=="system"||ue),[d,ue]);w.useEffect(()=>{const Be=()=>{document.hidden||O(0)};return document.addEventListener("visibilitychange",Be),()=>document.removeEventListener("visibilitychange",Be)},[]);const Rt=w.useMemo(()=>{if(m.length===0)return null;const Be=m.filter(fe=>fe.status==="running"),Qe=m.filter(fe=>fe.status==="error"),Ue=Be[Be.length-1];let st="完成",me="ok";return Qe.length>0?(st=`${Qe.length} 次出错`,me="error"):Be.length>0?(st=Ue?`${Ue.toolName} 运行中`:"运行中",me="running"):st="",{count:m.length,statusLabel:st,statusKind:me}},[m]),Bt=w.useMemo(()=>{const Be=PD({messages:gt,toolCalls:m,streaming:q,activeAssistantId:Z});return GD(Be,T)},[gt,m,q,Z,T]),rt=w.useMemo(()=>{const Be=[];for(const Qe of Bt)Qe.user&&Be.push(Qe.user),Be.push(...Qe.assistants);return Be},[Bt]),Mt=w.useCallback(()=>{h([]),p([]),x([]),P([]),S([]),A(null),X(null),Y(Nm),ee(Am),I(!1),Q("idle"),j(null),W([]),ye(null),V([]),ne(null),O(0),N(50),n.usageResponseKeysRef.current=new Set},[n]),mt=w.useCallback(Be=>{const Qe=Be.turnPhase==="stopping";h(Be.messages),p(Be.toolCalls),x([]),P([]),S([]),X(null),A(null),Y(Be.usage??Nm),ee(Be.sessionStats??Am),n.usageResponseKeysRef.current=new Set,I(Qe?!1:Be.streaming),Q(Qe?"idle":Be.turnPhase??(Be.streaming?"running":"idle")),j(Be.deferredTurn??null),W(Be.deferredTurns??(Be.deferredTurn?[Be.deferredTurn]:[])),ye(Be.pendingQuestion??null),V(Be.todos??[]),ne(null),O(0),N(50)},[n]),qt=w.useCallback(async Be=>{try{const Qe=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Be)}`,{credentials:"include"});if(!Qe.ok)return!1;const Ue=await Qe.json();if(!Ue.session||n.sessionRef.current?.sessionId!==Be)return!1;const st=Ue.session.activeTurnId??null,me=Ue.session.turnPhase==="stopping";n.activeTurnIdRef.current=st,n.streamingRef.current=me?!1:!!st,I(me?!1:!!st),Q(me?"idle":Ue.session.turnPhase??(st?"running":"idle")),j(Ue.session.deferredTurn??null),W(Ue.session.deferredTurns??(Ue.session.deferredTurn?[Ue.session.deferredTurn]:[])),ye(Ue.session.pendingQuestion??null),V(Ue.session.todos??[]),Ue.sessionStats&&ee(Ue.sessionStats),Ue.usage&&Y(Ue.usage),n.lastEventIdRef.current=Ue.lastEventId??null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set;const fe=I1(Ue.session.messages??[]);return h(rj(fe.messages,Ue.compactions)),p(fe.toolCalls),ne(null),!0}catch{return!1}},[t,n,h,p,ne,I,Q,j,ye,V]);return{messages:d,setMessages:h,toolCalls:m,setToolCalls:p,operationCards:g,artifactCards:v,historyLimit:T,setHistoryLimit:N,unread:R,humanGateCards:_,interview:U,setInterview:A,taskContext:z,contextLoading:H,usage:F,sessionStats:oe,streaming:q,setStreaming:I,turnPhase:K,setTurnPhase:Q,deferredTurn:pe,setDeferredTurn:j,deferredTurns:G,setDeferredTurns:W,pendingQuestion:D,setPendingQuestion:ye,todos:se,streamingAssistantId:Z,setStreamingAssistantId:ne,visibleMessages:rt,turnGroups:Bt,processSummary:Rt,applyChatSseEvent:Re,applySseBlock:ze,loadTaskContext:Ke,applyOperationLinkMutation:ft,resetForNewSession:Mt,applyActivatedSession:mt,recoverSession:qt}}const ij={error:6e3,info:4e3};function sj(e){const{toast:t,onDismiss:n}=e,[a,s]=w.useState(!1),o=w.useRef(null),c=w.useRef(null),d=()=>{o.current!==null&&window.clearTimeout(o.current),c.current!==null&&window.clearTimeout(c.current),o.current=null,c.current=null},h=()=>{d(),s(!0),c.current=window.setTimeout(()=>{s(!1),n()},140)};if(w.useEffect(()=>{if(t)return s(!1),o.current=window.setTimeout(h,ij[t.kind]),d},[t?.id]),w.useEffect(()=>d,[]),!t)return null;const m=t.kind==="error";return Zl.createPortal(u.jsxs("div",{className:`oc-toast is-${t.kind}${a?" is-leaving":""}`,role:m?"alert":"status",onMouseEnter:d,onMouseLeave:()=>{a||(o.current=window.setTimeout(h,1600))},children:[u.jsx("span",{className:"oc-toast-icon","aria-hidden":"true",children:m?u.jsx(W9,{size:16}):u.jsx(o5,{size:16})}),u.jsx("span",{className:"oc-toast-message",children:t.message}),u.jsx("button",{type:"button",className:"oc-toast-close","aria-label":"关闭提示",onClick:h,children:u.jsx(Cs,{size:14,"aria-hidden":"true"})})]}),document.body)}function k3(e){if(e.readiness==="ready"||e.readiness==="unknown")return null;const t=e.readiness==="setup-required";return u.jsxs("section",{className:`oc-readiness-notice is-${e.presentation}${t?" is-setup":" is-degraded"}`,role:"status","aria-live":"polite",children:[u.jsx("span",{className:"oc-readiness-notice-icon","aria-hidden":"true",children:t?u.jsx(c5,{size:18}):u.jsx(o5,{size:17})}),u.jsxs("div",{className:"oc-readiness-notice-copy",children:[u.jsx("strong",{children:t?"Pi 尚未配置":"Pi 当前为降级状态"}),u.jsx("span",{children:t?"完成认证并选择模型后即可开始对话":"仍可继续对话,但部分模型或工具能力可能暂不可用"})]}),t&&e.onOpenModels?u.jsx("button",{type:"button",className:"oc-readiness-notice-action",onClick:e.onOpenModels,children:"去配置"}):null]})}function Kl(e){return e==="missing-capability-token"||e==="invalid-capability-token"||e==="missing-confirmation-token"||e==="invalid-confirmation-token"||e==="host-not-loopback"||e==="origin-mismatch"||e==="cross-site-fetch"}function rx(e){return e==="invalid-capability-token"||e==="invalid-confirmation-token"||e==="missing-capability-token"||e==="missing-confirmation-token"}function Yl(e){return rx(e)?"页面凭证已失效(控制台可能已重启),请刷新页面(F5)后重试。":e==="host-not-loopback"?"请求主机校验失败:非回环绑定时要求 Host 头,请刷新页面或检查访问地址。":e==="origin-mismatch"?"请求来源与控制台地址不一致,请通过控制台页面操作。":e==="cross-site-fetch"?"检测到跨站请求,已拒绝。请通过控制台页面操作。":"操作被拒绝,请刷新页面后重试。"}class oj{constructor(t){this.options=t,this.fetchFn=t.fetchFn??fetch,this.backoffMs=t.backoffMs??1e3,this.deadlineMs=t.deadlineMs??3e4}options;eligible=new Set;controllers=new Map;fetchFn;backoffMs;deadlineMs;markEligible(t){this.eligible.add(t)}startIfEligible(t){if(!this.eligible.delete(t)||this.controllers.has(t))return;const n=new AbortController;this.controllers.set(t,n),this.run(t,n)}cancel(t){this.eligible.delete(t),this.controllers.get(t)?.abort(),this.controllers.delete(t)}reconcile(t){const n=new Set(t);for(const a of this.controllers.keys())n.has(a)||this.cancel(a)}dispose(){for(const t of this.controllers.values())t.abort();this.controllers.clear(),this.eligible.clear()}async run(t,n){let a;const s=new Set;let o=!1;const c=window.setTimeout(()=>{o=!0,n.abort()},this.deadlineMs);try{for(;!n.signal.aborted;){try{const d={Accept:"text/event-stream"};a&&(d["Last-Event-ID"]=a);const h=await this.fetchFn(`${this.options.origin}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/events`,{headers:d,credentials:"include",signal:n.signal});if(h.status===404||!h.body)return;if(!h.ok)throw new Error(`HTTP ${h.status}`);const m=h.body.getReader(),p=new TextDecoder;let g="";for(;;){const{done:x,value:v}=await m.read();if(x||n.signal.aborted)break;g+=p.decode(v,{stream:!0});const S=g.split(`
398
-
399
- `);g=S.pop()??"";for(const T of S){const N=T.split(`
400
- `).find(O=>O.startsWith("id: "))?.slice(4);if(N&&(a=N),!N||s.has(N)||!T.includes("event: session_title"))continue;const R=T.split(`
401
- `).find(O=>O.startsWith("data: "))?.slice(6);if(R)try{const O=JSON.parse(R),_=O.data?.title?.trim();if(!_)continue;if(s.add(N),!this.options.hasSession(t)||(this.options.onTitle(t,{title:_,automatic:!!O.data?.automatic}),O.data?.automatic))return}catch{}}}}catch{if(n.signal.aborted)return}n.signal.aborted||await lj(this.backoffMs,n.signal)}}finally{window.clearTimeout(c),this.controllers.get(t)===n&&this.controllers.delete(t),(o||!this.options.hasSession(t))&&this.options.refresh()}}}function lj(e,t){return new Promise(n=>{const a=window.setTimeout(o,e),s=()=>o();function o(){window.clearTimeout(a),t.removeEventListener("abort",s),n()}t.addEventListener("abort",s,{once:!0})})}async function cj(e){if(e.creatingRef?.current)throw new Error("CREATE_SESSION_IN_FLIGHT");e.creatingRef&&(e.creatingRef.current=!0),e.setCreatingSession?.(!0);try{const t=await(e.fetchFn??fetch)(`${e.origin}/api/operator/v1/chat/sessions`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify(e.options??{})});if(!t.ok){const c=await t.json().catch(()=>({}));throw Kl(c.error?.code)?new Error(Yl(c.error.code)):new Error(c.error?.message??`HTTP ${t.status}`)}const n=await t.json();if(!n.session)throw new Error("创建会话响应缺少 durable session");const a=n.session,s={sessionId:a.sessionId,...a.workspaceId||e.options?.workspaceId?{workspaceId:a.workspaceId??e.options?.workspaceId}:{},...R1(a)},o=[a,...e.sessionListRef.current.filter(c=>c.sessionId!==a.sessionId)].slice(0,$1);return e.sessionListRef.current=o,e.setSessionList(o),e.titleWatcher?.markEligible(a.sessionId),e.refreshSessionList(),s}finally{e.creatingRef&&(e.creatingRef.current=!1),e.setCreatingSession?.(!1)}}function S3(e,t){return(t??[]).reduce((n,a)=>Ap(n,a),e)}function uj(e){const{origin:t,refs:n,setSession:a,thread:s,composer:o,browser:c,setError:d,setNotice:h,onCompactionChange:m,setProcessOpen:p,setAutoScroll:g}=e,{applyActivatedSession:x,resetForNewSession:v,setMessages:S}=s,{setInput:T,setPendingImages:N}=o,{setPreviews:R,setActivePreviewPath:O}=c,{workspaceId:_,blocked:P}=e,U=_?`?workspaceId=${encodeURIComponent(_)}`:"",A=w.useCallback(se=>{const V=se?.trim()||n.sessionRef.current?.workspaceId?.trim()||"";return V?`?workspaceId=${encodeURIComponent(V)}`:""},[n]),[z,X]=w.useState([]),H=w.useRef([]);H.current=z;const $=w.useRef(null),[F,Y]=w.useState(!1),oe=w.useRef(!1),ee=w.useRef(!1),q=w.useRef(0),I=w.useCallback(se=>{const V=se?.keepStreams===!0;n.sessionGenerationRef.current+=1,V||n.abortRef.current?.abort(),n.reconnectAbortRef.current?.abort();for(const Z of n.sessionAbortControllersRef.current.values())Z.abort();n.sessionAbortControllersRef.current.clear(),n.reconnectAbortRef.current=null,n.eventsStreamStateRef.current=null,n.streamingRef.current=!1,n.abortRef.current=null,n.assistantIdRef.current=null,n.lastEventIdRef.current=null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.activeTurnIdRef.current=null,v(),T(""),N([]),R([]),O(null),p(!1),g(!0)},[n,v,T,N,R,O,p,g]),K=w.useCallback(async()=>{if(!P)try{const se=await fetch(`${t}/api/operator/v1/chat/sessions${U}`,{credentials:"include"});if(!se.ok)return;const V=(await se.json()).sessions??[],ne=(_?V.filter(ue=>!ue.workspaceId||ue.workspaceId===_):V).slice(0,$1);X(ne)}catch{}},[t,U,_,P]),Q=w.useCallback(async se=>{try{const V=A(H.current.find(ne=>ne.sessionId===se)?.workspaceId??null);if(!(await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(se)}${V}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":qn()}})).ok)return d("删除会话失败"),!1;if($.current?.cancel(se),n.sessionRef.current?.sessionId===se){const ne=n.sessionRef.current.workspaceId??_;q.current+=1,n.sessionRef.current=null,I(),a(null),vu(window.localStorage,ne,se)}return await K(),!0}catch(V){return d(V instanceof Error?V.message:String(V)),!1}},[t,n,a,I,K,d,A,_]),pe=w.useCallback(async(se,V)=>{const Z=++q.current,ne=A(V);try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(se)}${ne}`,{credentials:"include"}),he=await ue.json();if(!ue.ok||!he.session)throw new Error(he.error?.message??"会话不可用");if(Z!==q.current)return;const Re={sessionId:he.session.sessionId,...he.session.workspaceId?{workspaceId:he.session.workspaceId}:{},...R1(he.session)};I({keepStreams:!0}),n.sessionRef.current=Re,n.activeTurnIdRef.current=he.session.activeTurnId??null;const ze=he.session.turnPhase==="stopping";n.streamingRef.current=ze?!1:!!he.session.activeTurnId,n.stoppingTurnIdRef.current=ze?he.session.activeTurnId??null:null,n.stopRequestedRef.current=ze,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.lastEventIdRef.current=null,a(Re),n.assistantIdRef.current=null,n.abortRef.current=n.sessionAbortControllersRef.current.get(se)??null,N([]),R([]),T(he.session.composerDraft??"");const Ke=I1(he.session.messages??[]);Ke.messages=S3(Ke.messages,he.compactions),x({messages:Ke.messages,toolCalls:Ke.toolCalls,sessionStats:he.sessionStats,usage:he.usage,streaming:ze?!1:!!he.session.activeTurnId,turnPhase:he.session.turnPhase??(he.session.activeTurnId?"running":"idle"),deferredTurn:he.session.deferredTurn??null,deferredTurns:he.session.deferredTurns??(he.session.deferredTurn?[he.session.deferredTurn]:[]),pendingQuestion:he.session.pendingQuestion??null,todos:he.session.todos??[]}),Vf(window.localStorage,he.session.workspaceId??V??_,se),O(null)}catch(ue){if(Z!==q.current)return;d(ue instanceof Error?ue.message:String(ue))}},[t,n,a,N,R,T,x,I,O,d,A,_]);w.useEffect(()=>{K()},[K]),$.current||($.current=new oj({origin:t,hasSession:se=>H.current.some(V=>V.sessionId===se),onTitle:(se,V)=>{X(Z=>Z.map(ne=>ne.sessionId!==se||V.automatic&&ne.title?ne:V.automatic?{...ne,title:V.title}:{...ne,displayTitle:V.title}))},refresh:K}));const j=w.useCallback(se=>$.current?.startIfEligible(se),[]);w.useEffect(()=>{$.current?.reconcile(z.filter(se=>se.state!=="archived"&&!se.title).map(se=>se.sessionId))},[z]),w.useEffect(()=>()=>$.current?.dispose(),[]),w.useEffect(()=>{let se=!1;if(P)return;const V=++q.current;I({keepStreams:!0}),n.sessionRef.current=null,a(null);const Z=Uw(window.localStorage,_);if(!Z){vu(window.localStorage,_);return}return(async()=>{try{const ne=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Z)}${U}`,{credentials:"include"});if(!ne.ok){vu(window.localStorage,_,Z);return}const ue=await ne.json();if(se||P||V!==q.current||!ue.session)return;const he={sessionId:ue.session.sessionId,...ue.session.workspaceId?{workspaceId:ue.session.workspaceId}:_?{workspaceId:_}:{},...R1(ue.session)};n.sessionGenerationRef.current+=1,n.sessionRef.current=he,n.activeTurnIdRef.current=ue.session.activeTurnId??null;const Re=ue.session.turnPhase==="stopping";n.streamingRef.current=Re?!1:!!ue.session.activeTurnId,n.stoppingTurnIdRef.current=Re?ue.session.activeTurnId??null:null,n.stopRequestedRef.current=Re,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.lastEventIdRef.current=null,a(he),Vf(window.localStorage,he.workspaceId??_,he.sessionId),T(ue.session.composerDraft??"");const ze=I1(ue.session.messages??[]);ze.messages=S3(ze.messages,ue.compactions),x({messages:ze.messages,toolCalls:ze.toolCalls,sessionStats:ue.sessionStats,usage:ue.usage,streaming:Re?!1:!!ue.session.activeTurnId,turnPhase:ue.session.turnPhase??(ue.session.activeTurnId?"running":"idle"),deferredTurn:ue.session.deferredTurn??null,deferredTurns:ue.session.deferredTurns??(ue.session.deferredTurn?[ue.session.deferredTurn]:[]),pendingQuestion:ue.session.pendingQuestion??null,todos:ue.session.todos??[]})}catch{}})(),()=>{se=!0}},[t,U,n,a,T,x,P,I,_]);const G=w.useCallback(se=>{const V=se?.workspaceId?.trim()??_?.trim();return V?cj({origin:t,sessionListRef:H,setSessionList:X,titleWatcher:$.current,refreshSessionList:K,options:{...se,workspaceId:V},setCreatingSession:Y,creatingRef:oe}):(d("创建会话需要选择一个有效的工作区(不会回退默认工作区)"),Promise.reject(new Error("WORKSPACE_REQUIRED")))},[t,K,_,d]),W=w.useCallback(async se=>{if(oe.current||P)return null;const V=++q.current;d(null);try{const Z=await G(se);return V!==q.current?null:(I({keepStreams:!0}),n.sessionRef.current=Z,Vf(window.localStorage,Z.workspaceId??se?.workspaceId??_,Z.sessionId),a(Z),Z)}catch(Z){if(V!==q.current)return null;const ne=Z instanceof Error?Z.message:String(Z);return ne!=="CREATE_SESSION_IN_FLIGHT"&&d(ne),null}},[n,a,d,I,G,P,_]),D=w.useCallback(async se=>{const V=n.sessionRef.current;if(!V||n.streamingRef.current)return;const Z=typeof se=="string"?se.trim():"";m?.(!0);try{const ne={"x-loop-console-confirmation":qn()};Z&&(ne["content-type"]="application/json");const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V.sessionId)}/compact${A()}`,{method:"POST",credentials:"include",headers:ne,...Z?{body:JSON.stringify({instructions:Z})}:{}}),he=await ue.json().catch(()=>({}));if(!ue.ok){const Ke=he.error?.code;if(Kl(Ke)){d(Yl(Ke)),rx(Ke)&&!ee.current&&(ee.current=!0,window.setTimeout(()=>window.location.reload(),1200));return}d(he.error?.message??"上下文压缩失败");return}d(null);const ze=he.snapshot?.summary?.trim()||"历史上下文已精简,关键决策与当前任务已保留。";await pe(V.sessionId),h({id:Date.now(),message:`已压缩上下文:${ze.slice(0,72)}${ze.length>72?"…":""}`})}catch(ne){d(ne instanceof Error?ne.message:"上下文压缩失败")}finally{m?.(!1)}},[t,n,d,h,m,pe,A]);return{sessionList:z,creatingSession:F,activateSession:pe,refreshSessionList:K,deleteSession:Q,createSession:W,updateSession:async(se,V)=>{if(!(await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(se)}${A(H.current.find(ne=>ne.sessionId===se)?.workspaceId??null)}`,{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify(V)})).ok){d("会话更新失败");return}if(await K(),V.state==="archived"&&$.current?.cancel(se),V.state==="archived"&&n.sessionRef.current?.sessionId===se){const ne=n.sessionRef.current.workspaceId??_,ue=n.sessionRef.current.sessionId;q.current+=1,n.sessionRef.current=null,I(),a(null),vu(window.localStorage,ne,ue)}},watchSessionTitle:j,compactSession:D}}function dj(e){return e.turnPhase==="stopping"?e.blockedByTurnId?{action:"queue-deferred",blockedByTurnId:e.blockedByTurnId}:{action:"hold"}:e.turnPhase==="running"?e.blockedByTurnId?{action:"queue-deferred",blockedByTurnId:e.blockedByTurnId}:{action:"hold"}:{action:"send-now"}}function E3(e){const{clientRequestId:t,blockedByTurnId:n,state:a}=e;if(!a)return{action:"hold"};const s=a.deferredTurns?.find(c=>c.clientRequestId===t)??(a.deferredTurn?.clientRequestId===t?a.deferredTurn:void 0);if(s)return{action:"deferred",deferredTurn:s};if(a.activeTurn?.clientRequestId===t)return{action:"accepted",turn:a.activeTurn};if(a.latestTurn?.clientRequestId===t)return{action:"accepted",turn:a.latestTurn};const o=a.activeTurn?.turnId??a.activeTurnId??null;return a.turnPhase==="stopping"&&o===n?{action:"retry-deferred"}:Wl(a)?{action:"hold"}:{action:"send-now"}}function fj(e){let t;const n=new Promise(a=>{t=a});return{...e,outcomePromise:n,resolveOutcome:t}}function T3(e="network error while creating turn"){return{kind:"ambiguous",message:e}}function hj(e="无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"){return{kind:"ambiguous",message:e}}function C3(e){const{body:t,clientRequestId:n}=e,a=t.error?.code,s=t.error?.message??(e.httpOk?"turn was not accepted":`HTTP ${e.status}`);if(a==="TURN_ACTIVE"&&t.activeTurn?.turnId)return{kind:"adopt-active",activeTurn:t.activeTurn,message:"上一轮仍在运行,已重新连接;当前消息已保留。"};if(t.accepted===!0||e.httpOk&&t.turnId){const o=t.turn?.turnId??t.turnId;return o?{kind:"accepted",turnId:o,idempotent:t.idempotent===!0,turn:t.turn??{turnId:o,clientRequestId:n,state:t.state}}:{kind:"ambiguous",message:s}}return t.accepted===!1||a?{kind:"rejected",code:a,message:s}:{kind:"ambiguous",message:s}}function mj(e){const t=e.clientRequestId,n=e.state?.activeTurn,a=e.state?.latestTurn;return n?.clientRequestId===t&&n.turnId?{kind:"accepted",turnId:n.turnId,idempotent:!0,turn:n}:a?.clientRequestId===t&&a.turnId?{kind:"accepted",turnId:a.turnId,idempotent:!0,turn:a}:n?.turnId?{kind:"adopt-active",activeTurn:n,message:"上一轮仍在运行,已重新连接;当前消息已保留。"}:null}function pj(e){const t=e.clientRequestId,n=e.state?.activeTurn,a=e.state?.latestTurn,s=n?.state??e.state?.activeTurnState??void 0,o=a?.state??e.state?.latestTurnState??void 0;if(n?.clientRequestId===t&&n.turnId)return Ss(s)?{action:"release-terminal",turnId:n.turnId,state:String(s)}:{action:"bind-active",turnId:n.turnId};if(a?.clientRequestId===t&&a.turnId){if(Ss(o))return{action:"release-terminal",turnId:a.turnId,state:String(o)};if(!n?.turnId||n.clientRequestId===t)return{action:"bind-active",turnId:a.turnId}}return!Wl(e.state)&&!(!!n?.turnId&&n?.clientRequestId!==t)?{action:"release-not-accepted"}:{action:"hold"}}function Wl(e){if(e?.activeTurnId||e?.activeTurn?.turnId)return!0;const t=e?.runtime;return t?t.isStreaming===!0||t.isPromptRunning===!0||t.isCompacting===!0||t.isBashRunning===!0:!1}function Ss(e){return e==="settled"||e==="aborted"||e==="failed"}function dd(e){return e.pending.sessionId===e.sessionId&&e.pending.sessionGeneration===e.sessionGeneration&&e.pending.submitGeneration===e.submitGeneration}function gj(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/turns`}function R3(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/state`}function bj(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/events`}function vj(e,t,n){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/turns/${encodeURIComponent(n)}/abort`}function Nl(e){return e.stoppingTurnId||e.stopRequested?"stopping":e.activeTurnId||e.streaming||e.submitInFlight||e.pendingSubmission?"running":"idle"}function ju(e){const t=Nl(e);return t==="stopping"?"idle":t}function Wi(e,t){const n=e.pendingSubmission;t&&n&&n.clientRequestId!==t||(e.submitInFlight=!1,(!t||n?.clientRequestId===t)&&(n?.clientRequestId?e.releasedClientRequestIds.add(n.clientRequestId):t&&e.releasedClientRequestIds.add(t),e.pendingSubmission=null),e.pendingSubmission||(e.stopRequested=!1))}function ax(e){e.stopRequested=!0}function wo(e){e.stopRequested=!1}function yj(e,t){return!(!t||e.abortPostedTurnIds.has(t))}function xj(e,t){t&&e.abortPostedTurnIds.add(t)}function fd(e,t){return!e.stopRequested||!yj(e,t)?null:(xj(e,t),e.stoppingTurnId=t,e.activeTurnId=t,t)}function N3(e,t){const n=e.pendingSubmission;return n&&n.clientRequestId!==t.clientRequestId?!1:(t.turnId&&e.settledTurnIds.add(t.turnId),Wi(e,t.clientRequestId),wo(e),t.markIdle!==!1&&(e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null),!0)}function wj(e,t){return dd({pending:t.pending,sessionId:e.sessionId,sessionGeneration:e.sessionGeneration,submitGeneration:e.submitGeneration})?(t.pending.acceptedTurnId=t.turnId,e.activeTurnId=t.turnId,e.turnAssistantIds.set(t.turnId,t.assistantId),e.streaming=!0,e.submitInFlight=!1,t.pending.resolveOutcome({kind:"accepted",turnId:t.turnId}),t.ui?.setStreaming(!0),t.ui?.setStreamingAssistantId(t.assistantId),t.ui?.setPendingImages([]),t.ui?.watchSessionTitle?.(t.sessionId),!0):(t.pending.resolveOutcome({kind:"stale"}),!1)}function kj(e,t){t.pending.resolveOutcome({kind:"adopt-active",activeTurn:{turnId:t.activeTurnId},message:t.message}),Wi(e,t.pending.clientRequestId),t.current&&(t.ui?.clearEmptyAssistant(t.assistantId),t.ui?.setInput(t.text),t.ui?.setPendingImages(t.images),e.activeTurnId=t.activeTurnId,e.assistantId=null,e.streaming=!0,t.ui?.setStreaming(!0),t.ui?.setStreamingAssistantId(null),t.notice.setError(null),t.notice.showNotice(t.message))}function Sj(e,t){if(t.pending.resolveOutcome({kind:"rejected",message:t.message}),Wi(e,t.pending.clientRequestId),!t.current)return;const n=t.ui?.formatError?t.ui.formatError(t.message):t.message;t.ui?.setError(n),e.streaming=!1,e.assistantId=null,t.ui?.setStreaming(!1),t.ui?.setStreamingAssistantId(null),t.ui?.clearEmptyAssistant(t.assistantId),t.ui?.setInput(t.text),t.ui?.setPendingImages(t.images)}function Ej(e,t,n){const a=dd({pending:n.pending,sessionId:e.sessionId,sessionGeneration:e.sessionGeneration,submitGeneration:e.submitGeneration});if(t.kind==="accepted"){if(wj(e,{turnId:t.turnId,assistantId:n.assistantId,pending:n.pending,sessionId:n.sessionId,ui:n.acceptedUi})){const o=fd(e,t.turnId);o&&n.onAutoAbort?.(o)}return}if(t.kind==="adopt-active"){const s=a?fd(e,t.activeTurn.turnId):null;kj(e,{activeTurnId:t.activeTurn.turnId,message:t.message,assistantId:n.assistantId,text:n.text,images:n.images,pending:n.pending,current:a,notice:n.notice,ui:n.adoptUi}),s&&n.onAutoAbort?.(s);return}if(t.kind==="rejected"){Sj(e,{message:t.message,assistantId:n.assistantId,text:n.text,images:n.images,pending:n.pending,current:a,ui:n.rejectedUi}),wo(e);return}if(t.kind==="stale"){n.pending.resolveOutcome(t),Wi(e,n.pending.clientRequestId),wo(e);return}n.pending.resolveOutcome(t)}function Tj(e,t,n,a){const s=e.pendingSubmission;if(!s)return"held";if(t.action==="bind-active"){const c=!!s.acceptedTurnId;c||(s.acceptedTurnId=t.turnId,e.activeTurnId=t.turnId,e.turnAssistantIds.set(t.turnId,s.assistantId),e.streaming=!0,e.submitInFlight=!1);const d=fd(e,t.turnId);return d&&a?.onAutoAbort?.(d),c?"held":"bound"}if(t.action==="release-terminal"||t.action==="release-not-accepted")return t.action==="release-terminal"&&e.settledTurnIds.add(t.turnId),Wi(e,s.clientRequestId),wo(e),Wl(n)||(e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.()),"released";const o=n?.activeTurn?.turnId??n?.activeTurnId??null;return o&&(e.activeTurnId=o),"held"}const Cj="正在停止…",Rj="正在停止…",Nj="停止请求未完成,正在与服务端对账…",Aj="停止请求失败,正在与服务端对账…";function A3(e){e.showNotice(Cj)}function I3(e){if(e.networkError)return{action:"keep-busy-notice",message:Aj};const t=e.body.turn?.state;return e.body.accepted===!0&&Ss(t)?{action:"terminal-idle",turnId:e.turnId}:e.httpOk&&e.body.accepted===!0?{action:"abort-accepted-background"}:e.body.error?.code==="TURN_ABORT_PENDING"?{action:"abort-pending-notice"}:e.body.error?.code==="CHAT_TURN_OWNER_LOST"||e.body.error?.code==="OWNER_LOST"?{action:"owner-lost-reconcile"}:e.httpOk?{action:"noop"}:{action:"keep-busy-notice",message:Nj}}function Im(e,t,n,a){const s=a?.sessionStillCurrent!==!1;if(t.action==="terminal-idle"){if(!s)return;e.settledTurnIds.add(t.turnId),e.pendingSubmission&&Wi(e,e.pendingSubmission.clientRequestId),wo(e),e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.();return}if(t.action!=="abort-accepted-background"){if(t.action==="abort-pending-notice"){n.showNotice(Rj);return}if(t.action==="owner-lost-reconcile"){if(!s)return;a?.runtimeBusy||(e.stoppingTurnId&&e.settledTurnIds.add(e.stoppingTurnId),e.streaming=!1,e.pendingSubmission&&Wi(e,e.pendingSubmission.clientRequestId),wo(e),e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.());return}if(t.action==="keep-busy-notice"){n.showNotice(t.message);return}}}function _3(e,t){ax(e);const n=e.activeTurnId??e.pendingSubmission?.acceptedTurnId??null;if(n){const a=fd(e,n);return a?(t.notice&&A3(t.notice),t.postAbort(a),{abortedTurnId:a,stopRequested:!0}):{abortedTurnId:null,stopRequested:!0}}return t.notice&&A3(t.notice),{abortedTurnId:null,stopRequested:!0}}function Sa(e){return{submitInFlight:e.submitInFlightRef.current,pendingSubmission:e.pendingSubmissionRef.current,activeTurnId:e.activeTurnIdRef.current,streaming:e.streamingRef.current,assistantId:e.assistantIdRef.current,stoppingTurnId:e.stoppingTurnIdRef.current,settledTurnIds:e.settledTurnIdsRef.current,turnAssistantIds:e.turnAssistantIdsRef.current,sessionId:e.sessionRef.current?.sessionId??null,sessionGeneration:e.sessionGenerationRef.current,submitGeneration:e.submitGenerationRef.current,stopInFlight:e.stopInFlightRef.current,stopRequested:e.stopRequestedRef.current,abortPostedTurnIds:e.abortPostedTurnIdsRef.current,releasedClientRequestIds:e.releasedClientRequestIdsRef.current}}function Ea(e,t){e.submitInFlightRef.current=t.submitInFlight,e.pendingSubmissionRef.current=t.pendingSubmission,e.activeTurnIdRef.current=t.activeTurnId,e.streamingRef.current=t.streaming,e.assistantIdRef.current=t.assistantId,e.stoppingTurnIdRef.current=t.stoppingTurnId,e.submitGenerationRef.current=t.submitGeneration,e.stopInFlightRef.current=t.stopInFlight,e.stopRequestedRef.current=t.stopRequested}function Ij(e){return e.split(`
402
- `).find(t=>t.startsWith("event: "))?.slice(7).trim()??"message"}function _j(){return new Promise(e=>window.setTimeout(e,25))}const M3=[100,250,500,1e3,2e3];function _m(e,t){t&&e(n=>n.filter(a=>!(a.id===t&&a.role==="assistant"&&!a.text.trim())))}function Mj(e){const{origin:t,refs:n,session:a,thread:s,composer:o,setError:c,setAutoScroll:d,setNotice:h,recoveryVersion:m=0,watchSessionTitle:p}=e,{applySseBlock:g,setMessages:x,setStreaming:v,setStreamingAssistantId:S,streaming:T,setTurnPhase:N,setDeferredTurn:R,setDeferredTurns:O}=s,{setInput:_,setPendingImages:P,recordHistory:U}=o,A=w.useCallback(se=>{h&&h({id:Date.now(),message:se})},[h]),z=w.useCallback(se=>{const V=Sa(n);Wi(V,se),Ea(n,V)},[n]),X=w.useCallback((se,V,Z)=>{if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V)return;const ne=n.pendingSubmissionRef.current?.clientRequestId;ne&&z(ne),n.streamingRef.current=!1,n.activeTurnIdRef.current=null,n.assistantIdRef.current=null,n.stoppingTurnIdRef.current=null,n.stopRequestedRef.current=!1,v(!1),N("idle"),S(null),_m(x,Z)},[n,z,v,N,S,x]),H=w.useCallback(async(se,V,Z)=>{for(;!Z.aborted;){const ne=n.eventsStreamStateRef.current;if(!ne||ne.sessionId!==se||ne.generation!==V)return;ne.ready=!1;try{const ue={Accept:"text/event-stream"},he=n.lastEventIdRef.current;he&&(ue["Last-Event-ID"]=he);const Re=await fetch(bj(t,se),{headers:ue,credentials:"include",signal:Z});if(!Re.ok||!Re.body){if(Re.status===404)return;await Qf(2e3,Z);continue}const ze=Re.body.getReader(),Ke=new TextDecoder;let ft="",gt=!0;const Rt=Ui("a");for(;;){const{done:rt,value:Mt}=await ze.read();if(rt)break;ft+=Ke.decode(Mt,{stream:!0});const mt=ft.split(`
403
-
404
- `);ft=mt.pop()??"";for(const qt of mt){if(Ij(qt)==="stream_ready"){const Ue=n.eventsStreamStateRef.current;Ue?.sessionId===se&&Ue.generation===V&&(Ue.ready=!0),gt=!1;continue}const Be=n.assistantIdRef.current??Rt,Qe=g(qt,Be,{replay:gt,targetSessionId:se,generation:V});Qe&&(n.lastEventIdRef.current=Qe)}}const Bt=n.eventsStreamStateRef.current;Bt?.sessionId===se&&Bt.generation===V&&(Bt.ready=!1),await Qf(1e3,Z)}catch{if(Z.aborted)return;await Qf(2e3,Z)}}},[t,n,g]),$=w.useCallback((se,V)=>{const Z=n.eventsStreamStateRef.current;if(Z?.sessionId===se&&Z.generation===V&&n.reconnectAbortRef.current)return;n.reconnectAbortRef.current?.abort();const ne=new AbortController;n.reconnectAbortRef.current=ne,n.eventsStreamStateRef.current={sessionId:se,generation:V,ready:!1},H(se,V,ne.signal)},[n,H]),F=w.useCallback(async(se,V)=>{$(se,V);const Z=Date.now()+5e3;for(;Date.now()<Z;){const ne=n.eventsStreamStateRef.current;if(ne?.sessionId===se&&ne.generation===V&&ne.ready)return;if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V)throw new Error("会话已切换");await _j()}throw new Error("事件连接未就绪,请检查 Console 连接后重试")},[n,$]),Y=w.useCallback(async se=>{try{const V=await fetch(R3(t,se),{credentials:"include"}),Z=await V.json().catch(()=>({}));return V.ok?Z.state??null:null}catch{return null}},[t]),oe=w.useCallback(async se=>{try{const V=await fetch(gj(t,se.sessionId),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:se.clientRequestId,text:se.text.trim()||"请查看附件图片。",images:se.images.map(({type:ne,mimeType:ue,data:he})=>({type:ne,mimeType:ue,data:he}))})}),Z=await V.json().catch(()=>({}));return{httpOk:V.ok,status:V.status,body:Z}}catch{return{httpOk:!1,status:0,body:{},networkError:!0}}},[t]),ee=w.useCallback(()=>({showNotice:A,setError:se=>c(se)}),[A,c]),q=w.useCallback(async(se,V,Z)=>{n.stoppingTurnIdRef.current=Z,n.streamingRef.current=!1,v(!1),N("idle"),S(null);try{const ne=await fetch(vj(t,se,Z),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:"{}"}),ue=await ne.json().catch(()=>({}));if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V||n.stoppingTurnIdRef.current!==Z)return;const he=I3({httpOk:ne.ok,turnId:Z,body:ue}),Re=Sa(n);if(Re.stoppingTurnId=Z,he.action==="owner-lost-reconcile"){const ze=await Y(se);if(!(n.sessionRef.current?.sessionId===se&&n.sessionGenerationRef.current===V)||n.stoppingTurnIdRef.current!==Z)return;Im(Re,he,ee(),{sessionStillCurrent:!0,runtimeBusy:Wl(ze??void 0),markIdle:()=>X(se,V,n.assistantIdRef.current)}),Ea(n,Re),N(ju(Re));return}Im(Re,he,ee(),{sessionStillCurrent:!0,markIdle:()=>X(se,V,n.assistantIdRef.current)}),Ea(n,Re),N(ju(Re))}catch{const ne=Sa(n);Im(ne,I3({httpOk:!1,turnId:Z,body:{},networkError:!0}),ee()),Ea(n,ne),n.streamingRef.current=!1,v(!1),N("idle")}},[t,n,v,N,X,Y,ee]),I=w.useCallback((se,V)=>{const Z=Sa(n);Z.sessionId=n.sessionRef.current?.sessionId??null,Z.sessionGeneration=n.sessionGenerationRef.current,Z.submitGeneration=n.submitGenerationRef.current;const ne=he=>{P(he)};Ej(Z,se,{assistantId:V.assistantId,text:V.text,images:V.images,pending:V.pending,sessionId:V.sessionId,notice:ee(),acceptedUi:{setStreaming:v,setStreamingAssistantId:S,setPendingImages:ne,watchSessionTitle:p},adoptUi:{clearEmptyAssistant:he=>_m(x,he),setInput:_,setPendingImages:ne,setStreaming:v,setStreamingAssistantId:S},rejectedUi:{setError:c,setStreaming:v,setStreamingAssistantId:S,clearEmptyAssistant:he=>_m(x,he),setInput:_,setPendingImages:ne,formatError:ni},onAutoAbort:he=>{q(V.sessionId,V.generation,he)}}),Ea(n,Z);const ue=Nl(Z);N(ju(Z)),ue==="stopping"&&(n.streamingRef.current=!1,v(!1),S(null))},[n,ee,v,N,S,P,p,x,_,c,q]),K=w.useCallback(async se=>{const V=n.sessionRef.current;if(!V||!se.text.trim()&&se.images.length===0)return{action:"handled"};A("正在排队…");const Z=(he,Re)=>{R(Re?.[0]??he),O(Re??[he]),_(""),P([]),c(null),A("已排队,将在当前回合结束后自动发送")},ne=()=>{R(null),O([]),_(""),P([]),c(null),A("消息已进入发送")},ue=async()=>{const he=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V.sessionId)}/deferred-turn`,{method:"PUT",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:se.clientRequestId,blockedByTurnId:se.blockedByTurnId,text:se.text,images:se.images})}),Re=await he.json().catch(()=>({}));return{response:he,body:Re}};try{for(let he=0;he<2;he+=1){const{response:Re,body:ze}=await ue();if(Re.ok&&ze.accepted&&ze.deferredTurn)return Z(ze.deferredTurn,ze.deferredTurns),{action:"handled"};if(ze.deferredTurns&&O(ze.deferredTurns),ze.deferredTurn&&R(ze.deferredTurn),ze.error?.code!=="TURN_NOT_ACTIVE")return c(ze.error?.message??`待发送消息未被服务端接受(HTTP ${Re.status})`),{action:"handled"};const Ke=await Y(V.sessionId),ft=E3({clientRequestId:se.clientRequestId,blockedByTurnId:se.blockedByTurnId,state:Ke??void 0});if(ft.action==="deferred")return Z(ft.deferredTurn,Ke?.deferredTurns),{action:"handled"};if(ft.action==="accepted")return ne(),{action:"handled"};if(!(ft.action==="retry-deferred"&&he===0))return ft.action==="send-now"?(A("上一轮已停止,正在发送当前消息…"),{action:"send-now"}):(c(ze.error?.message??"停止状态已变化,当前消息仍保留在输入框"),{action:"handled"})}return{action:"handled"}}catch(he){const Re=await Y(V.sessionId),ze=E3({clientRequestId:se.clientRequestId,blockedByTurnId:se.blockedByTurnId,state:Re??void 0});return ze.action==="deferred"?(Z(ze.deferredTurn,Re?.deferredTurns),{action:"handled"}):ze.action==="accepted"?(ne(),{action:"handled"}):ze.action==="send-now"?(A("上一轮已停止,正在发送当前消息…"),{action:"send-now"}):(c(he instanceof Error?`无法确认消息是否已排队:${he.message}`:"无法确认消息是否已排队,请刷新后查看服务端状态"),{action:"handled"})}},[t,n,s.deferredTurn,R,O,_,P,c,A,Y]),Q=w.useCallback(async(se,V)=>{const Z=n.sessionRef.current,ne=V?s.deferredTurns.find(ue=>ue.clientRequestId===V.clientRequestId):s.deferredTurns[0]??s.deferredTurn;if(!(!Z||!ne))try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Z.sessionId)}/deferred-turn`,{method:"DELETE",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:ne.clientRequestId,expectedRevision:ne.revision})}),he=await ue.json().catch(()=>({}));if(!ue.ok||!he.cancelled){c(he.error?.message??"待发送消息撤回失败");return}const Re=s.deferredTurns.filter(ze=>ze.clientRequestId!==ne.clientRequestId);O(Re),R(Re[0]??null),se==="restore"?(_(ne.text??he.deferredTurn?.text??""),P(ne.images??he.deferredTurn?.images??[]),A("待发送消息已移回输入框")):A("已删除排队消息"),c(null)}catch(ue){c(ue instanceof Error?ue.message:String(ue))}},[t,n,s.deferredTurn,s.deferredTurns,R,O,_,P,c,A]),pe=w.useCallback(()=>Q("restore"),[Q]),j=w.useCallback(se=>Q("discard",se),[Q]),G=w.useCallback(async(se,V)=>{const Z=n.sessionRef.current;if(!Z)return;const ne=s.deferredTurns.find(ue=>ue.clientRequestId===se.clientRequestId);if(ne)try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Z.sessionId)}/deferred-turn`,{method:"PUT",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:se.clientRequestId,blockedByTurnId:ne.blockedByTurnId,text:V,images:ne.images??[],expectedRevision:se.revision})}),he=await ue.json().catch(()=>({}));if(!ue.ok)throw new Error(he.error?.message??"编辑排队消息失败");he.deferredTurns&&O(he.deferredTurns),he.deferredTurn&&R(he.deferredTurn),c(null)}catch(ue){c(ue instanceof Error?ue.message:"编辑排队消息失败")}},[t,n,s.deferredTurns,R,O,c]),W=w.useCallback(async se=>{const V=n.sessionRef.current;if(V)try{const Z=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V.sessionId)}/deferred-turn/${encodeURIComponent(se.clientRequestId)}/steer`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({expectedRevision:se.revision})}),ne=await Z.json().catch(()=>({}));if(!Z.ok)throw new Error(ne.error?.message??"插话发送失败");const ue=ne.deferredTurns??s.deferredTurns.filter(he=>he.clientRequestId!==se.clientRequestId);O(ue),R(ue[0]??null),c(null)}catch(Z){c(Z instanceof Error?Z.message:"插话发送失败")}},[t,n,s.deferredTurns,R,O,c]),D=w.useCallback(async(se,V)=>{const Z=n.sessionRef.current;if(!Z||!se.trim()&&V.length===0)return;const ne=Sa(n),ue=dj({turnPhase:Nl(ne),blockedByTurnId:ne.stoppingTurnId??ne.activeTurnId}),he=Ui("chat-submit");if(ue.action==="hold"){const Qe=Nl(ne);Qe==="stopping"?A("正在确认上一轮停止状态,当前消息已保留"):Qe==="running"&&A("正在确认当前回合状态,当前消息已保留");return}if(U?.(se),ue.action==="queue-deferred"&&(await K({text:se,images:V,clientRequestId:he,blockedByTurnId:ue.blockedByTurnId})).action!=="send-now")return;const Re=n.sessionRef.current,ze=n.sessionGenerationRef.current;if(!Re||Re.sessionId!==Z.sessionId||!se.trim()&&V.length===0||n.streamingRef.current||n.submitInFlightRef.current||n.pendingSubmissionRef.current)return;n.submitInFlightRef.current=!0;const Ke=++n.submitGenerationRef.current,ft=Ui("u"),gt=Ui("a"),Rt=se.trim(),Bt=V.slice(),rt=fj({clientRequestId:he,submitGeneration:Ke,sessionId:Re.sessionId,sessionGeneration:ze,text:Rt,images:Bt,assistantId:gt,userMessageId:ft});n.pendingSubmissionRef.current=rt;try{await F(Re.sessionId,ze)}catch(Qe){n.sessionRef.current?.sessionId===Re.sessionId&&n.sessionGenerationRef.current===ze&&c(ni(Qe instanceof Error?Qe.message:String(Qe))),z(he);return}if(n.sessionRef.current?.sessionId!==Re.sessionId||n.sessionGenerationRef.current!==ze){z(he);return}const Mt={id:ft,role:"user",text:Rt,createdAt:Date.now()};x(Qe=>[...Qe,Mt,{id:gt,role:"assistant",text:"",createdAt:Date.now()}]),_(""),d(!0),c(null),n.streamingRef.current=!0,N("running"),n.assistantIdRef.current=gt,v(!0),S(gt);const mt={sessionId:Re.sessionId,generation:ze,submitGeneration:Ke,assistantId:gt,text:Rt,images:Bt,pending:rt},qt=await oe({sessionId:Re.sessionId,clientRequestId:he,text:Rt,images:Bt});if(!dd({pending:rt,sessionId:n.sessionRef.current?.sessionId,sessionGeneration:n.sessionGenerationRef.current,submitGeneration:n.submitGenerationRef.current})){rt.resolveOutcome({kind:"stale"}),z(he);return}let Be=qt.networkError?T3():C3({httpOk:qt.httpOk,status:qt.status,body:qt.body,clientRequestId:he});if(Be.kind==="ambiguous"){const Qe=await Y(Re.sessionId),Ue=Qe?mj({clientRequestId:he,state:Qe}):null;if(Ue)Be=Ue;else{const st=await oe({sessionId:Re.sessionId,clientRequestId:he,text:Rt,images:Bt});if(!dd({pending:rt,sessionId:n.sessionRef.current?.sessionId,sessionGeneration:n.sessionGenerationRef.current,submitGeneration:n.submitGenerationRef.current})){rt.resolveOutcome({kind:"stale"}),z(he);return}if(Be=st.networkError?T3("无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"):C3({httpOk:st.httpOk,status:st.status,body:st.body,clientRequestId:he}),Be.kind==="ambiguous"){const me=Be.message||"无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)";Be=hj(me),A(me)}}}I(Be,mt)},[t,n,F,oe,Y,I,z,A,x,_,d,c,v,N,S,K,U]),ye=w.useCallback(async()=>{const se=n.sessionRef.current?.sessionId,V=n.sessionGenerationRef.current;if(!se)return;const Z=Sa(n),ne=_3(Z,{postAbort:()=>{}});if(Ea(n,Z),n.streamingRef.current=!1,v(!1),S(null),N("idle"),ne.abortedTurnId){if(n.stopInFlightRef.current)return;n.stopInFlightRef.current=!0;try{await q(se,V,ne.abortedTurnId)}finally{n.stopInFlightRef.current=!1}return}const ue=n.pendingSubmissionRef.current;if(ue&&!n.stopInFlightRef.current){n.stopInFlightRef.current=!0;try{const he=await ue.outcomePromise;if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V)return;let Re=null;if(he.kind==="accepted")Re=he.turnId;else if(he.kind==="adopt-active")Re=he.activeTurn.turnId;else{if(he.kind==="ambiguous")return;n.stopRequestedRef.current=!1;return}if(!Re)return;const ze=Sa(n);ax(ze);const Ke=_3(ze,{postAbort:()=>{}});Ea(n,ze),Ke.abortedTurnId&&await q(se,V,Ke.abortedTurnId)}finally{n.stopInFlightRef.current=!1}}},[n,q,v,S,N]);return w.useEffect(()=>{const se=!!n.pendingSubmissionRef.current||n.submitInFlightRef.current||n.stopRequestedRef.current||!!n.activeTurnIdRef.current;if(!a||!T&&!se)return;const V=a.sessionId,Z=n.sessionGenerationRef.current;let ne=!1,ue=null;const he=async()=>{try{const rt=await fetch(R3(t,V),{credentials:"include"}),Mt=await rt.json().catch(()=>({}));if(ne||!rt.ok||n.sessionRef.current?.sessionId!==V||n.sessionGenerationRef.current!==Z)return;const mt=Mt.state,qt=n.pendingSubmissionRef.current;if(qt){const fe=pj({clientRequestId:qt.clientRequestId,state:mt}),He=Sa(n),we=Tj(He,fe,mt,{markIdle:()=>X(V,Z,n.assistantIdRef.current),onAutoAbort:ct=>{q(V,Z,ct)}});Ea(n,He);const Fe=Nl(He);if(N(ju(He)),Fe==="stopping"&&(n.streamingRef.current=!1,v(!1),S(null)),mt&&"deferredTurn"in mt&&R(mt.deferredTurn??null),we==="bound"&&Fe!=="stopping"){v(!0);return}if(we==="released"||!qt.acceptedTurnId&&!He.pendingSubmission?.acceptedTurnId)return}const Be=mt?.activeTurn?.turnId??mt?.activeTurnId??null;n.activeTurnIdRef.current=Be;const Qe=Wl(mt),Ue=n.pendingSubmissionRef.current;if(Ue){const fe=mt?.latestTurn?.clientRequestId===Ue.clientRequestId&&Ss(mt?.latestTurn?.state),He=mt?.activeTurn?.clientRequestId===Ue.clientRequestId&&Ss(mt?.activeTurn?.state);if(fe||He){const we=He?mt?.activeTurn?.turnId??null:mt?.latestTurn?.turnId??Ue.acceptedTurnId??null,Fe=Sa(n);N3(Fe,{clientRequestId:Ue.clientRequestId,turnId:we,markIdle:!Qe}),Ea(n,Fe),Qe||X(V,Z,n.assistantIdRef.current);return}}if(Qe)return;const st=n.assistantIdRef.current;if(Be&&!(Ss(mt?.activeTurn?.state)||Ss(mt?.activeTurnState)))return;Be&&n.settledTurnIdsRef.current.add(Be);const me=Ue?.clientRequestId;if(me){const fe=Sa(n);N3(fe,{clientRequestId:me,turnId:Be,markIdle:!0}),Ea(n,fe)}else z();X(V,Z,st)}catch{}},Re=()=>ue||(ue=he().finally(()=>{ue=null}),ue),ze=()=>{document.visibilityState==="visible"&&Re()},Ke=()=>{Re()},ft=window.setInterval(()=>{Re()},15e3);let gt,Rt=0;const Bt=()=>{if(ne||Rt>=M3.length||!n.stopRequestedRef.current&&!n.stoppingTurnIdRef.current)return;const rt=M3[Rt++];gt=window.setTimeout(()=>{Re().finally(Bt)},rt)};return document.addEventListener("visibilitychange",ze),window.addEventListener("online",Ke),Re().finally(Bt),()=>{ne=!0,window.clearInterval(ft),gt!==void 0&&window.clearTimeout(gt),document.removeEventListener("visibilitychange",ze),window.removeEventListener("online",Ke)}},[t,n,a,T,N,X,z,q]),w.useEffect(()=>{if(!a)return;const se=n.sessionGenerationRef.current;return $(a.sessionId,se),()=>{const V=n.eventsStreamStateRef.current;V?.sessionId===a.sessionId&&V.generation===se&&(n.reconnectAbortRef.current?.abort(),n.reconnectAbortRef.current=null,n.eventsStreamStateRef.current=null)}},[a,m,n,$]),{sendPrompt:D,handleStop:ye,cancelDeferredTurn:pe,discardDeferredTurn:j,editDeferredTurn:G,steerDeferredTurn:W,openEventsStream:H}}function Oj(e){const{origin:t,refs:n,thread:a,setError:s}=e,{interview:o,setInterview:c}=a,[d,h]=w.useState(""),m=w.useCallback(async()=>{const x=n.sessionRef.current;if(!x)return;const v=window.prompt("Task ID(例如 2026-07-26-my-task)")?.trim();if(!v)return;const S=await fetch(`${t}/api/operator/v1/chat/sessions/${x.sessionId}/interviews`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({taskId:v})}),T=await S.json();if(!S.ok){s(T.error?.message??`HTTP ${S.status}`);return}c({interviewSessionId:T.interview?.sessionId,taskId:v,state:T.interview?.state,question:T.question,draft:T.draft?.draft,draftSha256:T.draft?.draftSha256,assessment:T.assessment})},[t,n,c,s]),p=w.useCallback(async x=>{const v=n.sessionRef.current;if(!v||!o?.interviewSessionId||!o.question)return;const S=await fetch(`${t}/api/operator/v1/chat/sessions/${v.sessionId}/interviews/${o.interviewSessionId}/answers`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({questionId:o.question.id,response:x,...x==="override"?{text:d}:{}})}),T=await S.json();if(!S.ok){s(T.error?.message??`HTTP ${S.status}`);return}c(N=>({...N??{},state:T.interview?.state,question:T.question,draft:T.draft?.draft,draftSha256:T.draft?.draftSha256,assessment:T.assessment,taskKindRecommendation:T.taskKindRecommendation??N?.taskKindRecommendation})),h("")},[t,n,o,d,c,s]),g=w.useCallback(async()=>{const x=n.sessionRef.current;if(!x||!o?.interviewSessionId||!o.taskKindRecommendation)return;const v=await fetch(`${t}/api/operator/v1/chat/sessions/${x.sessionId}/interviews/${o.interviewSessionId}/task-kind/confirm`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({taskKind:o.taskKindRecommendation})}),S=await v.json();if(!v.ok){s(S.error?.message??`HTTP ${v.status}`);return}c(T=>({...T??{},confirmedTaskKind:T?.taskKindRecommendation,taskKindRecommendation:void 0,draft:S.draft?.draft,draftSha256:S.draft?.draftSha256,assessment:S.assessment}))},[t,n,o,c,s]);return{interviewAnswer:d,setInterviewAnswer:h,startInterview:m,answerInterview:p,confirmTaskKind:g}}function Dj(e){const{origin:t,refs:n,sessionId:a,workspaceId:s,blocked:o,setError:c}=e,[d,h]=w.useState({}),[m,p]=w.useState(new Set),[g,x]=w.useState(null),[v,S]=w.useState([]),[T,N]=w.useState(null),[R,O]=w.useState(!1),_=w.useRef(s??null);_.current=s??null;const P=w.useRef(new Set),U=w.useRef(new Set);U.current=m;const A=s?`&workspaceId=${encodeURIComponent(s)}`:"",z=w.useCallback(async(ee="")=>{if(o)return;const q=s??null;try{x(null);const I=await fetch(`${t}/api/operator/v1/chat/repo/tree?path=${encodeURIComponent(ee)}${A}`,{credentials:"include"}),K=await I.json();if(_.current!==q)return;if(!I.ok)throw new Error(K.error?.message??"无法读取仓库目录");h(Q=>({...Q,[ee]:K.data?.entries??[]}))}catch(I){if(_.current!==q)return;x(I instanceof Error?I.message:String(I))}},[t,A,s,o]);w.useEffect(()=>{z()},[z]);const[X,H]=w.useState(0),$=w.useCallback(()=>{H(ee=>ee+1)},[]);w.useEffect(()=>{const ee=["",...U.current];for(const q of ee)z(q)},[z,X]),w.useEffect(()=>{const ee=()=>{document.hidden||$()};return document.addEventListener("visibilitychange",ee),()=>document.removeEventListener("visibilitychange",ee)},[$]);const F=w.useCallback(async ee=>{if(o)return;const q=s??null;O(!0);try{const I=await fetch(`${t}/api/operator/v1/chat/repo/file?path=${encodeURIComponent(ee)}${A}`,{credentials:"include"}),K=await I.json();if(_.current!==q)return;if(!I.ok||!K.data)throw new Error(K.error?.message??"无法预览文件");S(Q=>{const pe=[...Q.filter(G=>G.path!==K.data.path),K.data],j=n.sessionRef.current?.sessionId;return j&&window.localStorage.setItem(`${ri}.previews.${j}`,JSON.stringify(pe.map(G=>G.path))),pe}),N(K.data.path)}catch(I){if(_.current!==q)return;c(I instanceof Error?I.message:String(I))}finally{_.current===q&&O(!1)}},[t,A,s,n,c,o]);w.useEffect(()=>{h({}),p(new Set),x(null),S([]),N(null),O(!1)},[s]),w.useEffect(()=>{if(o||T||v.length>0)return;const ee=s??"__default__";if(P.current.has(ee))return;const q=(d[""]??[]).filter(K=>K.kind==="file");if(q.length===0)return;const I=q.find(K=>/^readme(?:\.[^.]+)?$/i.test(K.name))??q[0];P.current.add(ee),F(I.path)},[T,o,F,v.length,d,s]),w.useEffect(()=>{if(!a)return;let ee=[];try{const q=JSON.parse(window.localStorage.getItem(`${ri}.previews.${a}`)??"[]");Array.isArray(q)&&(ee=q.filter(I=>typeof I=="string").slice(0,10))}catch{}ee.length&&Promise.all(ee.map(async q=>{const I=await fetch(`${t}/api/operator/v1/chat/repo/file?path=${encodeURIComponent(q)}${A}`,{credentials:"include"});if(I.ok)return(await I.json()).data})).then(q=>{if(n.sessionRef.current?.sessionId!==a)return;const I=q.filter(K=>!!K);S(I),N(I.at(-1)?.path??null)})},[t,A,a,n]);const Y=w.useCallback(ee=>{p(q=>{const I=new Set(q);return I.has(ee)?I.delete(ee):I.add(ee),I}),d[ee]||z(ee)},[d,z]),oe=w.useCallback(ee=>{S(q=>{const I=q.filter(K=>K.path!==ee);return a&&window.localStorage.setItem(`${ri}.previews.${a}`,JSON.stringify(I.map(K=>K.path))),I}),N(q=>q===ee?v.find(I=>I.path!==ee)?.path??null:q)},[v,a]);return{tree:d,expandedDirs:m,treeError:g,previews:v,activePreviewPath:T,setActivePreviewPath:N,previewLoading:R,setPreviews:S,loadTree:z,refreshTree:$,openPreview:F,closePreview:oe,toggleDir:Y}}const Mm={status:"ok"};function Om(e){return e.status!=="ok"}const jj=["operator","web","extension","prompt","skill"];function Lj(e){const t=[];for(const n of jj){const a=[];for(let s=0;s<e.length;s+=1)e[s].source===n&&a.push({entry:e[s],globalIndex:s});a.length!==0&&t.push({source:n,label:uO[n],items:a})}return t}function zj(e,t){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<0?0:e>=t?t-1:e}function Bj(e){return e==="comfortable"?3:e==="compact"?2:1}function O3(e,t,n,a){const s=t.findIndex(g=>g.items.some(x=>x.globalIndex===e));if(s<0)return e;const o=t[s],c=o.items.findIndex(g=>g.globalIndex===e);if(c<0)return e;const d=Math.floor(c/n),h=c%n;if(a==="left"||a==="right"){if(n<=1)return e;const x=c+(a==="left"?-1:1);return x<0||x>=o.items.length||Math.floor(x/n)!==d?e:o.items[x].globalIndex}const m=a==="up"?-1:1,p=c+m*n;if(p>=0&&p<o.items.length)return o.items[p].globalIndex;for(let g=s+m;g>=0&&g<t.length;g+=m){const x=t[g];if(x.items.length===0)continue;const v=Math.floor((x.items.length-1)/n)*n,S=a==="up"?v+h:h;return S>=x.items.length?e:x.items[S].globalIndex}return e}function qj(e,t,n){const a=(e.left+e.right)/2;let s=null;for(const o of t){if(o.globalIndex===e.globalIndex)continue;const c=n==="up"?e.top-o.bottom:o.top-e.bottom;if(c<0)continue;const d=(o.left+o.right)/2,h=Math.abs(d-a);(s===null||c<s.gap||c===s.gap&&h<s.dist||c===s.gap&&h===s.dist&&o.globalIndex<s.index)&&(s={gap:c,dist:h,index:o.globalIndex})}return s?.index??null}function Hj(){return{entries:[],index:-1,draft:""}}function Uj(e,t){return t.trim()?e.entries[e.entries.length-1]===t?e.index===-1?e:{...e,index:-1,draft:""}:{entries:[...e.entries,t].slice(-100),index:-1,draft:""}:e}function Fj(e){return e.index===-1?e:{...e,index:-1}}function $j(e,t,n){const{text:a,caretStart:s,caretEnd:o}=n;if(e.entries.length===0)return{handled:!1};if(t==="up"){if(a.slice(0,s).includes(`
405
- `))return{handled:!1};if(e.index===-1){const h=e.entries.length-1;return{handled:!0,state:{...e,index:h,draft:a},text:e.entries[h]}}if(e.index===0)return{handled:!0,state:e,text:e.entries[0]};const d=e.index-1;return{handled:!0,state:{...e,index:d},text:e.entries[d]}}if(e.index===-1)return{handled:!1};if(a.slice(o).includes(`
406
- `))return{handled:!1};if(e.index>=e.entries.length-1)return{handled:!0,state:{...e,index:-1},text:e.draft};const c=e.index+1;return{handled:!0,state:{...e,index:c},text:e.entries[c]}}function Pj(e){const{origin:t,sessionId:n,refs:a,setError:s}=e,[o,c]=w.useState(""),[d,h]=w.useState([]),[m,p]=w.useState([]),[g,x]=w.useState(!1),v=w.useCallback(V=>{if(typeof V=="function"){c(Z=>{const ne=V(Z);return x(ne.startsWith("/")),ne});return}c(V),x(V.startsWith("/"))},[]),[S,T]=w.useState(0),[N,R]=w.useState([]),[O,_]=w.useState(!1),[P,U]=w.useState(null),[A,z]=w.useState(0),X=w.useRef(null),H=w.useRef(Hj()),$=w.useRef(n),F=w.useRef(0),Y=w.useCallback(V=>{v(V),x(V.startsWith("/")),T(0),H.current=Fj(H.current)},[]),oe=w.useCallback(V=>{const Z=X.current,ne=$j(H.current,V,{text:o,caretStart:Z?.selectionStart??o.length,caretEnd:Z?.selectionEnd??o.length});if(!ne.handled)return!1;H.current=ne.state,v(ne.text);const ue=ne.text.length;return queueMicrotask(()=>{const he=X.current;he&&he.value===ne.text&&he.setSelectionRange(ue,ue)}),!0},[o,v]),ee=w.useCallback(V=>{H.current=Uj(H.current,V)},[]);w.useLayoutEffect(()=>{$.current=n,F.current+=1,R([]),U(null),_(!1)},[n]);const q=w.useCallback(async()=>{if(!n){R([]),U(null),_(!1);return}const V=n,Z=F.current;$.current=V,_(!0),U(null);const ne=()=>$.current===V&&F.current===Z;try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}/commands`,{credentials:"include"});if(!ne())return;if(!ue.ok){U("动态命令加载失败"),R([]);return}const he=await ue.json().catch(()=>null),Re=[];for(const Ke of he?.commands??[]){const ft=Ke.source;if(ft!=="extension"&&ft!=="prompt"&&ft!=="skill")continue;const gt=String(Ke.command??Ke.name??"").trim();gt&&Re.push({command:gt.startsWith("/")?gt:`/${gt}`,label:String(Ke.label??Ke.name??gt),description:String(Ke.description??""),source:ft})}if(!ne())return;R(Re);const ze=typeof he?.warning=="string"?he.warning.trim():"";U(ze?ze.slice(0,160):null)}catch{if(!ne())return;U("动态命令加载失败"),R([])}finally{ne()&&_(!1)}},[t,n]);w.useEffect(()=>{n&&(!g&&A===0||q())},[n,g,A,q]);const I=w.useCallback(()=>{z(V=>V+1),q()},[q]);w.useEffect(()=>{if(!n)return;const V=o.slice(0,X.current?.selectionStart??o.length).match(/(?:^|\s)@([^\s@]*)$/);if(!V){h([]);return}const Z=window.setTimeout(()=>{fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/files?q=${encodeURIComponent(V[1]??"")}`).then(ne=>ne.ok?ne.json():null).then(ne=>h((ne?.files??[]).map(ue=>ue.path)))},150);return()=>window.clearTimeout(Z)},[t,n,o]);const K=w.useCallback(V=>{const Z=X.current?.selectionStart??o.length,ue=o.slice(0,Z).search(/@[^\s@]*$/);ue<0||(v(`${o.slice(0,ue)}@${V} ${o.slice(Z)}`),h([]))},[o]),Q=w.useCallback(V=>{for(const Z of Array.from(V).slice(0,4)){if(!Z.type.startsWith("image/")||Z.size>5*1024*1024){s("图片仅支持 PNG/JPEG/GIF/WebP,单张不超过 5 MiB");continue}const ne=new FileReader;ne.onload=()=>{const ue=String(ne.result??""),he=ue.slice(ue.indexOf(",")+1);p(Re=>[...Re,{name:Z.name,type:"image",mimeType:Z.type,data:he}].slice(0,4))},ne.readAsDataURL(Z)}},[s]),pe=w.useCallback(V=>{p(Z=>Z.filter(ne=>ne!==V))},[]);w.useLayoutEffect(()=>{const V=X.current;V&&(V.style.height="auto",V.style.height=`${Math.min(V.scrollHeight,280)}px`)},[o]),w.useEffect(()=>{if(!n)return;const V=window.setTimeout(()=>{fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/draft`,{method:"PUT",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify({text:o})})},400);return()=>window.clearTimeout(V)},[t,n,o]);const j=w.useMemo(()=>lO(N),[N]),G=w.useMemo(()=>o.startsWith("/")?cO(j,o):[],[o,j]);w.useEffect(()=>{T(V=>zj(V,G.length))},[G.length]);const W=w.useCallback(()=>{a.isComposingRef.current=!0},[a]),D=w.useCallback(()=>{a.isComposingRef.current=!1,a.compositionEndedAtRef.current=Date.now()},[a]),ye=w.useCallback(()=>a.isComposingRef.current,[a]),se=w.useCallback(()=>Date.now()-a.compositionEndedAtRef.current<100,[a]);return w.useEffect(()=>{Ck({origin:t,sessionId:n,refs:a})},[t,n,a]),{input:o,setInput:v,handleInputChange:Y,navigateHistory:oe,recordHistory:ee,fileOptions:d,pendingImages:m,setPendingImages:p,addImagesFromFiles:Q,removeImage:pe,shortcutOpen:g,setShortcutOpen:x,shortcutIndex:S,setShortcutIndex:T,filteredShortcuts:G,dynamicCommandsLoading:O,dynamicCommandsError:P,retryDynamicCommands:I,insertFileReference:K,textareaRef:X,onCompositionStart:W,onCompositionEnd:D,isComposingNow:ye,recentlyComposedNow:se}}const Gj=[{toolId:"read",kind:"explore",description:"Pi 内置读取文件。"},{toolId:"write",kind:"explore",description:"Pi 内置写入文件(软约束:大改优先走 DAG)。"},{toolId:"edit",kind:"explore",description:"Pi 内置编辑文件(软约束:大改优先走 DAG)。"},{toolId:"bash",kind:"explore",description:"Pi 内置 shell 执行(软约束:优先受治路径)。"},{toolId:"grep",kind:"explore",description:"Pi 内置内容搜索。"},{toolId:"find",kind:"explore",description:"按名称查找文件路径。"},{toolId:"ls",kind:"explore",description:"列出目录内容。"},{toolId:"safe-read",kind:"explore",description:"安全读取仓库相对路径文件;拒绝敏感文件并自动脱敏 secret。"},{toolId:"safe-grep",kind:"explore",description:"安全搜索仓库内容;跳过敏感文件并自动脱敏搜索结果。"},{toolId:"git-status",kind:"explore",description:"固定参数执行 git status --porcelain(无 shell)。"},{toolId:"git-diff",kind:"explore",description:"固定参数查看 git diff;敏感路径不可查看且结果自动脱敏。"}];function Vj(e){if(!e)return null;const t=(e.tools??[]).map(a=>({toolId:a.toolId,action:a.action,description:a.description,kind:a.kind??"read",cli:a.cli})),n=[...Gj];return{explore:n,operator:t,total:n.length+t.length}}let Kj=0;function Yj(e){const{origin:t,session:n,setSession:a,refs:s,setError:o}=e,[c,d]=w.useState(null),[h,m]=w.useState([]),[p,g]=w.useState("idle"),[x,v]=w.useState(null),[S,T]=w.useState([]),[N,R]=w.useState(null),[O,_]=w.useState(null),[P,U]=w.useState(!1),[A,z]=w.useState(!1),[X,H]=w.useState(!1),$=w.useRef(null),F=w.useRef(null),Y=w.useRef(0);w.useEffect(()=>{Y.current=-1,U(!1)},[n?.sessionId,U]);const ee=Ql().snapshot,q=w.useCallback(async()=>{try{const V=await fetch(`${t}/api/operator/v1/chat/capabilities`);if(!V.ok)return;const Z=await V.json();d(Z)}catch{}},[t]);w.useEffect(()=>{q()},[q]);const I=w.useCallback(async()=>{if(!n){m([]),g("idle");return}const V=n.sessionId;g("loading"),v(null);try{const Z=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}/models`,{credentials:"include"}),ne=await Z.json().catch(()=>null);if(s.sessionRef.current?.sessionId!==V)return;if(!Z.ok||!ne){g("error"),v(ne?.error?.message??`模型列表读取失败(HTTP ${Z.status})`);return}m(ne.models??[]),T(ne.thinkingLevels??[]),g("ready")}catch(Z){if(s.sessionRef.current?.sessionId!==V)return;g("error"),v(Z instanceof Error?Z.message:String(Z))}},[t,n,s]);w.useEffect(()=>{I()},[I]),w.useEffect(()=>{if(!n){R(null),_(null);return}const V=n.sessionId,Z=`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}`;_(null),fetch(`${Z}/runtime-context`,{credentials:"include"}).then(async ne=>{const ue=await ne.json().catch(()=>null);if(!ue?.context||s.sessionRef.current?.sessionId!==V)return;const he=ue.context,Re=Ak().snapshot;R(ze=>kk(ze,he,Re,V))}).catch(()=>{s.sessionRef.current?.sessionId===V&&_("注入上下文读取失败,请重试")})},[t,n?.sessionId,s]),w.useEffect(()=>{if(!ee||!n||ee.sessionId!==n.sessionId)return;const V=f5(ee);a(Z=>{if(!Z||Z.sessionId!==ee.sessionId||fD(Z,V))return Z;const ne=tx(Z,V);return s.sessionRef.current=ne,ne}),R(Z=>{if(!Z)return Z;const ne={...Z,...V.model?{model:V.model}:{},...V.thinkingLevel?{thinkingLevel:V.thinkingLevel}:{}};return ne.model?.provider===Z.model?.provider&&ne.model?.modelId===Z.model?.modelId&&ne.thinkingLevel===Z.thinkingLevel?Z:ne})},[ee,n?.sessionId,s,a,R]);const K=w.useCallback(async V=>{if(!n)return!1;const Z=n.sessionId,ne=++Kj;Y.current=ne,p5({type:"mutation-start",token:ne}),U(!0);try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n.sessionId)}/model`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify(V)}),he=await ue.json().catch(()=>({}));return Y.current!==ne?!1:ue.ok?!he.session||s.sessionRef.current?.sessionId!==Z?!1:Rk(ne,Z,he.snapshot):(s.sessionRef.current?.sessionId===Z&&(o(he.error?.message??`模型或思考等级切换失败(HTTP ${ue.status})`),Gm()),!1)}catch(ue){return Y.current!==ne||s.sessionRef.current?.sessionId===Z&&o(ue instanceof Error?ue.message:String(ue)),!1}finally{Nk(ne,Z,s)&&Y.current===ne&&U(!1)}},[t,n,s,a,o]);w.useEffect(()=>{if(!A)return;const V=ne=>{const ue=$.current;ue&&ne.target instanceof Node&&!ue.contains(ne.target)&&z(!1)},Z=ne=>{ne.key==="Escape"&&z(!1)};return document.addEventListener("mousedown",V),document.addEventListener("keydown",Z),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("keydown",Z)}},[A]),w.useEffect(()=>{if(!X)return;const V=ne=>{const ue=F.current;ue&&ne.target instanceof Node&&!ue.contains(ne.target)&&H(!1)},Z=ne=>{ne.key==="Escape"&&H(!1)};return document.addEventListener("mousedown",V),document.addEventListener("keydown",Z),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("keydown",Z)}},[X]);const Q=w.useMemo(()=>Vj(c),[c]),pe=ee?(ee.models??[]).map(V=>({provider:V.provider,id:V.id,...V.name?{name:V.name}:{},...V.hasCredentials!==void 0?{hasCredentials:V.hasCredentials}:{}})):h,j=ee?.thinkingLevels?.length?ee.thinkingLevels.map(V=>V.value):S,G=n?.model??N?.model,W=G?Ns(G.provider,G.modelId):"",D=ee?.selection?.thinkingSelection??n?.thinkingLevel??"",ye=ee?.selection?.effectiveThinkingLevel??n?.thinkingLevel??void 0,se=!W||pe.some(V=>Ns(V.provider,V.id)===W);return{capabilities:c,models:pe,modelsStatus:p,modelsError:x,onRetryModels:()=>{I()},thinkingLevels:j,runtimeContext:N,runtimeContextError:O,onRetryRuntimeContext:()=>{_(null),Gm()},toolsOpen:A,setToolsOpen:z,runtimeContextOpen:X,setRuntimeContextOpen:H,toolsMenuRef:$,runtimeContextMenuRef:F,switchRuntime:K,switching:P,toolCatalog:Q,activeModel:G,activeModelRef:W,activeThinkingLevel:D,effectiveThinkingLevel:ye,activeModelListed:se}}const D3={comfortableMin:1200,compactMin:720};function Wj(e){return!Number.isFinite(e)||e<0?"narrow":e>=D3.comfortableMin?"comfortable":e>=D3.compactMin?"compact":"narrow"}const Zj={mode:"comfortable",width:1600,landingDensity:"comfortable",emptyHeight:720};function Xj(e,t){const[n,a]=w.useState(Zj);return w.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const o=()=>{const p=s.getBoundingClientRect().width,g=t?.current??null,x=g?g.getBoundingClientRect().height:720;a({mode:Wj(p),width:p,landingDensity:UO(x),emptyHeight:x})};o();const c=new ResizeObserver(()=>o());c.observe(s);let d=null;const h=()=>{const p=t?.current??null;p&&p!==d&&(d&&c.unobserve(d),c.observe(p),d=p,o())};h();const m=window.setInterval(h,250);return()=>{window.clearInterval(m),c.disconnect()}},[e,t]),n}const _1="loop-console.operator-shell.active-workspace.v1";function Qj(e){try{return e?.getItem(_1)?.trim()||null}catch{return null}}function Lu(e,t){try{e?t?.setItem(_1,e):t?.removeItem(_1)}catch{}}function Jj(e,t){return t?e.some(n=>n.workspaceId===t)?{status:"ok",workspaceId:t}:{status:"ok",workspaceId:e[0]?.workspaceId??null}:{status:"ok",workspaceId:e[0]?.workspaceId??null}}function eL(e,t,n){return e===409||t==="DUPLICATE"?n||"该目录(或等价路径)已存在为 Workspace:请直接选择既有条目,或更换其他真实目录。":e===400||t==="INVALID_PATH"?n||"目录不可用:请确认输入的是存在的真实目录绝对路径。":Kl(t)?Yl(t):n||`添加 Workspace 失败(HTTP ${e})`}function tL(e={}){const t=e.origin??"",n=e.fetchFn??fetch,a=e.storage,s=e.confirmationTokenFn??qn,o=new Set;let c={workspaces:[],loading:!0,error:null,workspaceId:Qj(a),unknownWorkspaceId:null};const d=()=>{for(const S of o)S()},h=S=>{c={...c,...S},d()},m=async()=>{try{const S=await n(`${t}/api/operator/v1/workspaces`,{credentials:"include"});if(!S.ok)return;const N=(await S.json()).workspaces??[],R=Jj(N,c.workspaceId);if(R.status==="unknown-workspace"){h({workspaces:N,unknownWorkspaceId:R.workspaceId});return}const O=R.workspaceId,_=c.workspaceId;h({workspaces:N,unknownWorkspaceId:null,...O!==_?{workspaceId:O}:{}}),O!==_&&Lu(O,a)}catch{}finally{c.loading&&h({loading:!1})}},p=async(S,T)=>{h({error:null});try{const N=await n(`${t}/api/operator/v1/workspaces`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-loop-console-confirmation":s()},body:JSON.stringify({directoryPath:S,...T?{name:T}:{}})}),R=await N.json().catch(()=>({}));if(!N.ok||!R.workspace){const O=eL(N.status,R.error?.code,R.error?.message);return h({error:O}),{ok:!1,error:O}}return await m(),h({workspaceId:R.workspace.workspaceId}),Lu(R.workspace.workspaceId,a),{ok:!0,workspaceId:R.workspace.workspaceId}}catch(N){const O=`添加 Workspace 失败:${N instanceof Error?N.message:String(N)}`;return h({error:O}),{ok:!1,error:O}}},g=async()=>{h({error:null});try{const S=await n(`${t}/api/operator/v1/workspaces/pick`,{method:"POST",credentials:"include",headers:{"x-loop-console-confirmation":s()}}),T=await S.json().catch(()=>({}));if(!S.ok){const N=Kl(T.error?.code)?Yl(T.error?.code??""):T.error?.message??`打开目录选择窗口失败(HTTP ${S.status})`;return h({error:N}),null}return typeof T.directoryPath=="string"&&T.directoryPath.trim()?T.directoryPath:null}catch(S){const T=S instanceof Error?S.message:String(S);return h({error:`打开目录选择窗口失败:${T}`}),null}},x=async S=>{h({error:null});try{const T=await n(`${t}/api/operator/v1/workspaces/${encodeURIComponent(S)}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":s()}}),N=await T.json().catch(()=>({}));if(!T.ok){const R=T.status===404?"Workspace 已不存在(可能已被移除),列表将刷新。":Kl(N.error?.code)?Yl(N.error?.code??""):N.error?.message??`移除 Workspace 失败(HTTP ${T.status})`;return h({error:R}),await m(),{ok:!1,error:R}}if(await m(),c.workspaceId===S){const R=c.workspaces[0]?.workspaceId??null;h({workspaceId:R}),Lu(R,a)}return{ok:!0}}catch(T){const R=`移除 Workspace 失败:${T instanceof Error?T.message:String(T)}`;return h({error:R}),{ok:!1,error:R}}},v=S=>{S===c.workspaceId&&!c.unknownWorkspaceId||(h({workspaceId:S,unknownWorkspaceId:null}),Lu(S,a))};return m(),{get workspaces(){return c.workspaces},get loading(){return c.loading},get error(){return c.error},get workspaceId(){return c.workspaceId},get unknownWorkspaceId(){return c.unknownWorkspaceId},refresh:m,pickWorkspaceDirectory:g,addWorkspace:p,removeWorkspace:x,selectWorkspace:v,subscribe(S){return o.add(S),()=>o.delete(S)}}}function nL(e){const t=w.useRef(null);t.current||(t.current=tL(e));const n=t.current,[a,s]=w.useState(()=>({workspaces:n.workspaces,loading:n.loading,error:n.error,workspaceId:n.workspaceId,unknownWorkspaceId:n.unknownWorkspaceId}));return w.useEffect(()=>n.subscribe(()=>{s({workspaces:n.workspaces,loading:n.loading,error:n.error,workspaceId:n.workspaceId,unknownWorkspaceId:n.unknownWorkspaceId})}),[n]),w.useMemo(()=>({get workspaces(){return a.workspaces},get loading(){return a.loading},get error(){return a.error},get workspaceId(){return a.workspaceId},get unknownWorkspaceId(){return a.unknownWorkspaceId},refresh:n.refresh,pickWorkspaceDirectory:n.pickWorkspaceDirectory,addWorkspace:n.addWorkspace,removeWorkspace:n.removeWorkspace,selectWorkspace:n.selectWorkspace}),[a,n])}function rL(e="none"){return{active:e}}function ho(e,t){return{active:t}}function Rr(e={active:"none"}){return{active:"none"}}function aL(e){return{sidebarDrawerOpen:e.active==="sidebar-drawer",processOpen:e.active==="process",runtimeContextOpen:e.active==="runtime-context",toolsOpen:e.active==="tools",activityOpen:e.active==="activity"}}const iL=160,sL=120,oL=120;function lL(e){return e?e.operationCards.length+e.humanGateCards.length+e.artifactCards.length:0}function cL(e){const t=lL(e),[n,a]=w.useState(()=>t>0?{phase:"visible",snapshot:e}:{phase:"hidden",snapshot:null}),s=w.useRef(n);s.current=n;const o=w.useMemo(()=>`${e?.sessionId??"none"}:${t}`,[e?.sessionId,t]);return w.useEffect(()=>{const c=[],d=s.current.snapshot;if(!e||t===0){if(!d){a({phase:"hidden",snapshot:null});return}a({phase:"leaving",snapshot:d}),c.push(window.setTimeout(()=>{a({phase:"hidden",snapshot:null})},sL))}else d?d.sessionId!==e.sessionId?(a({phase:"switching",snapshot:e}),c.push(window.setTimeout(()=>{a({phase:"visible",snapshot:e})},oL))):a({phase:"visible",snapshot:e}):(a({phase:"entering",snapshot:e}),c.push(window.setTimeout(()=>{a({phase:"visible",snapshot:e})},iL)));return()=>{for(const h of c)window.clearTimeout(h)}},[e,o,t]),n}const uL=264,dL=420,Al=280,ix=360,xs=160,sx=480,fL=240,hL=120,j3="loop-agent:operator-chat:details-width:v1",Dm="loop-agent:operator-chat:details-tree-width:v1";function Ta(e,t,n){return Math.min(n,Math.max(t,Math.round(e)))}function zu(){return typeof window>"u"?ix:Math.max(Al,window.innerWidth)}function El(e){return Math.min(sx,Math.max(xs,Math.round(e-hL)))}function L3(e,t,n,a){if(typeof window>"u")return t;try{const s=Number(window.localStorage.getItem(e));return Number.isFinite(s)&&s>0?Ta(s,n,a):t}catch{return t}}function jm(e,t){try{window.localStorage.setItem(e,String(Math.round(t)))}catch{}}function Bu(e){const t=w.useRef(0),n=w.useRef(0),a=w.useRef(0),s=w.useRef(null),o=w.useRef(!1),c=w.useRef(null),d=w.useRef(e);d.current=e;const h=w.useCallback(()=>{s.current=null;const p=d.current,g=a.current-t.current,x=n.current+(p.side==="sidebar"?g:-g);return p.onResize(x),x},[]),m=w.useCallback((p,g,x)=>{if(!o.current)return;typeof x=="number"&&(a.current=x),o.current=!1,p&&g!==void 0&&p.hasPointerCapture(g)&&p.releasePointerCapture(g),s.current!==null&&(cancelAnimationFrame(s.current),s.current=null);const v=h(),S=p??c.current;S&&delete S.dataset.dragging,d.current.onResizeEnd?.(v),d.current.onDragChange(!1)},[h]);return w.useEffect(()=>{const p=v=>{o.current&&(a.current=v.clientX,s.current??=requestAnimationFrame(h))},g=v=>m(void 0,void 0,v.clientX),x=()=>m();return window.addEventListener("pointermove",p),window.addEventListener("pointerup",g),window.addEventListener("pointercancel",x),()=>{if(window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",x),s.current!==null&&(cancelAnimationFrame(s.current),s.current=null),o.current){o.current=!1;const v=c.current;v&&delete v.dataset.dragging,d.current.onDragChange(!1)}}},[m,h]),u.jsx("div",{ref:c,className:"oc-column-resize-handle","data-side":e.side,role:"separator","aria-orientation":"vertical","aria-label":e.side==="sidebar"?"调整左侧栏宽度":e.side==="details-tree"?"调整文件树宽度":"调整右侧栏宽度",onPointerDown:p=>{p.preventDefault(),p.currentTarget.setPointerCapture(p.pointerId),p.currentTarget.dataset.dragging="true",o.current=!0,t.current=p.clientX,a.current=p.clientX,n.current=d.current.value,d.current.onDragChange(!0)},onPointerMove:p=>{p.currentTarget.hasPointerCapture(p.pointerId)&&(a.current=p.clientX,s.current??=requestAnimationFrame(h))},onPointerUp:p=>m(p.currentTarget,p.pointerId,p.clientX),onPointerCancel:p=>m(p.currentTarget,p.pointerId),onLostPointerCapture:p=>m(p.currentTarget)})}function mL(e){const{origin:t,surface:n="standalone"}=e,a=n==="workspace",s=jD(),[o,c]=w.useState(null),[d,h]=w.useState(!1),[m,p]=w.useState(null),[g,x]=w.useState(!0),[v,S]=w.useState(!1),[T,N]=w.useState("files"),[R,O]=w.useState(!1),[_,P]=w.useState(!1),[U,A]=w.useState(280),[z,X]=w.useState(()=>L3(j3,ix,Al,zu())),[H,$]=w.useState(()=>L3(Dm,fL,xs,sx)),[F,Y]=w.useState(!1);w.useEffect(()=>{let J=null;const Te=()=>{J=null,X(Jt=>Ta(Jt,Al,zu()))},Dt=()=>{J??=window.requestAnimationFrame(Te)};return window.addEventListener("resize",Dt),()=>{window.removeEventListener("resize",Dt),J!==null&&window.cancelAnimationFrame(J)}},[]);const oe=w.useRef(!0),[ee,q]=w.useState(!0),I=w.useCallback(J=>{const Te=typeof J=="function"?J(oe.current):J;oe.current=Te,q(Te)},[]),[K,Q]=w.useState(()=>rL()),[pe,j]=w.useState(null),[G,W]=w.useState(null),[D,ye]=w.useState(0),se=w.useRef(null),V=w.useRef(null),Z=w.useRef(null),ne=w.useRef(null),ue=w.useRef(null),he=w.useRef(null),Re=w.useRef(null),ze=w.useRef(null),Ke=w.useRef(null),ft=w.useRef(()=>{}),gt=w.useRef(null),Rt=w.useRef(!1),Bt=Xj(Z,ue),rt=Bt.mode,Mt=e.workspaceRegistry,[mt,qt]=w.useState(null),Be=aL(K),Qe=Be.processOpen,Ue=Be.runtimeContextOpen,st=Be.activityOpen;w.useEffect(()=>{S(!1),N("files"),O(!1),P(!1),Q(J=>J.active==="process"||J.active==="runtime-context"?Rr(J):J)},[m?.sessionId,e.workspaceId]);const me=w.useCallback(J=>{Q(Te=>{const Dt=Te.active==="process";return(typeof J=="function"?J(Dt):J)?(N("calls"),P(!0),S(!0),ho(Te,"process")):(Dt&&(P(!1),N("files"),S(!1)),Te.active==="process"?Rr(Te):Te)})},[]),fe=Pj({origin:t,sessionId:m?.sessionId,refs:s,setError:c}),He=w.useMemo(()=>Lj(fe.filteredShortcuts),[fe.filteredShortcuts]),we=Dj({origin:t,refs:s,sessionId:m?.sessionId,workspaceId:m?.workspaceId??e.workspaceId,blocked:Om(e.workspaceGate??Mm),setError:c}),Fe=w.useRef(()=>{}),ct=w.useCallback(J=>{Fe.current(J)},[]),Ie=aj({origin:t,refs:s,sessionId:m?.sessionId,workspaceId:e.workspaceId??null,setError:c,onReconcile:ct});Fe.current=J=>{const Te=s.sessionRef.current?.sessionId;Te&&(async()=>await Ie.recoverSession(Te)?(W({id:Date.now(),message:"已自动恢复:会话事件已重新同步,可继续对话。"}),ye(Jt=>Jt+1)):W({id:Date.now(),message:"自动恢复未完成,将在重连时重试。"}))()};const Pt=Ie.operationCards.length+Ie.humanGateCards.length+Ie.artifactCards.length,bt=w.useMemo(()=>{for(const J of Ie.operationCards)if(J.dagRunId)return J.dagRunId;return null},[Ie.operationCards]),_t=w.useMemo(()=>{if(!bt)return null;for(const J of Ie.operationCards){if(J.dagRunId!==bt||!J.runSummary)continue;const Te=J.runSummary,Dt=Te.next&&Te.nodes.every(Jt=>Jt.id!==Te.next?.kind)?Te.nodes.find(Jt=>!["succeeded","completed","passed"].includes(Jt.status))?.id:void 0;return{dagRunId:bt,currentNodeId:Dt,nodes:Te.nodes,status:Te.status}}return{dagRunId:bt,nodes:[]}},[bt,Ie.operationCards]),Et=w.useMemo(()=>Y7(Ie.operationCards).length+Ie.humanGateCards.length+Ie.artifactCards.length,[Ie.operationCards,Ie.humanGateCards.length,Ie.artifactCards.length]),$n=w.useMemo(()=>m?{sessionId:m.sessionId,operationCards:Ie.operationCards,humanGateCards:Ie.humanGateCards,artifactCards:Ie.artifactCards}:null,[m,Ie.operationCards,Ie.humanGateCards,Ie.artifactCards]),en=cL($n),it=w.useMemo(()=>SO({operations:Ie.operationCards,gates:Ie.humanGateCards,artifacts:Ie.artifactCards}),[Ie.operationCards,Ie.humanGateCards,Ie.artifactCards]),We=w.useCallback(J=>it.has(J),[it]),vt=HO(ne,rt,m?.sessionId??"no-session"),ot=vt.presentation==="sidecar";w.useEffect(()=>{const J=rt==="comfortable"&&K.active==="sidebar-drawer",Te=ot&&K.active==="activity";(J||Te)&&Q(Dt=>Dt.active===K.active?Rr(Dt):Dt)},[ot,rt,K.active]),w.useEffect(()=>{j(null)},[m?.sessionId]),w.useEffect(()=>{Pt>0||K.active!=="activity"||Q(J=>J.active==="activity"?Rr(J):J)},[Pt,K.active]);const Yt=w.useCallback(J=>{J&&j(J),ot||Q(Te=>ho(Te,"activity"))},[ot]),ae=w.useCallback(()=>{Q(J=>J.active==="activity"?Rr(J):J)},[]),ke=w.useCallback(J=>{const Te=V.current;if(!Te)return;const Jt=Array.from(Te.querySelectorAll("[data-activity-ref]")).find(fr=>J.includes(fr.dataset.activityRef??""));if(!Jt){W({id:Date.now(),message:"详细运行记录暂时没有对应的对话位置。"});return}Jt.scrollIntoView({block:"center",behavior:"smooth"}),Jt.classList.add("is-located"),window.setTimeout(()=>Jt.classList.remove("is-located"),1400),ot||ae()},[ot,ae]),Ne=uj({origin:t,refs:s,setSession:p,thread:Ie,composer:{setInput:fe.setInput,setPendingImages:fe.setPendingImages},browser:{setPreviews:we.setPreviews,setActivePreviewPath:we.setActivePreviewPath},setError:c,setNotice:W,onCompactionChange:h,setProcessOpen:me,setAutoScroll:I,workspaceId:e.workspaceId??void 0,blocked:Om(e.workspaceGate??Mm)}),Je=w.useRef(null);w.useEffect(()=>{const J=e.requestedSessionId?.trim();if(!J||Om(e.workspaceGate??Mm)||m?.sessionId===J)return;const Te=`${e.workspaceId??""}:${J}`;if(Je.current===Te)return;Je.current=Te;const Dt=Ne.sessionList.find(Jt=>Jt.sessionId===J)?.workspaceId;Ne.activateSession(J,Dt)},[e.requestedSessionId,e.workspaceGate,e.workspaceId,m?.sessionId,Ne.activateSession]);const kt=Mj({origin:t,refs:s,session:m,thread:Ie,composer:{setInput:fe.setInput,setPendingImages:fe.setPendingImages,recordHistory:fe.recordHistory},setError:c,setNotice:W,setAutoScroll:I,recoveryVersion:D,watchSessionTitle:Ne.watchSessionTitle}),Tt=Oj({origin:t,refs:s,thread:Ie,setError:c}),De=Yj({origin:t,session:m,setSession:p,refs:s,setError:c});w.useEffect(()=>{if(Ie.streaming){Ne.refreshSessionList();return}we.refreshTree();const J=window.setTimeout(()=>{Ne.refreshSessionList()},1200);return()=>window.clearTimeout(J)},[Ie.streaming,Ie.turnPhase,Ie.deferredTurn?.revision,Ie.deferredTurn?.state,Ne.refreshSessionList,we.refreshTree]),w.useEffect(()=>{De.runtimeContextOpen&&K.active!=="runtime-context"?Q(J=>ho(J,"runtime-context")):!De.runtimeContextOpen&&K.active==="runtime-context"&&Q(J=>Rr(J))},[De.runtimeContextOpen,K.active]),w.useEffect(()=>{K.active!=="runtime-context"&&De.runtimeContextOpen&&De.setRuntimeContextOpen(!1)},[K.active]),w.useEffect(()=>{Ie.streaming&&K.active==="process"&&Q(Rr)},[Ie.streaming,K.active]);const{sendPrompt:Pe,handleStop:ut,discardDeferredTurn:xn,editDeferredTurn:fn,steerDeferredTurn:oa}=kt,ga=w.useRef(()=>{}),yr=w.useCallback(async J=>{const Te=s3(J);if(Te&&Te.action!=="unknown"&&Te.action!=="pi-prompt"){if(s.streamingRef.current){W({id:Date.now(),message:"当前回合进行中,命令请在回合结束后执行"});return}ga.current(J);return}await Pe(J,fe.pendingImages)},[Pe,fe.pendingImages,s]);ft.current=J=>{yr(J)};const dr=w.useCallback(()=>{fe.textareaRef.current?.focus()},[fe.textareaRef]),Wt=w.useCallback(()=>{Q(J=>J.active==="sidebar-drawer"?Rr(J):J)},[]),Tn=w.useCallback(J=>{if(N(J),S(!0),J==="context"){O(!0),De.setRuntimeContextOpen(!0),Q(Te=>ho(Te,"runtime-context"));return}if(J==="calls"){P(!0),De.setRuntimeContextOpen(!1),Q(Te=>ho(Te,"process"));return}De.setRuntimeContextOpen(!1),Q(Te=>Te.active==="process"||Te.active==="runtime-context"?Rr(Te):Te)},[De.setRuntimeContextOpen]),Kr=w.useCallback(J=>{J==="context"?(O(!1),De.setRuntimeContextOpen(!1),Q(Te=>Te.active==="runtime-context"?Rr(Te):Te)):(P(!1),Q(Te=>Te.active==="process"?Rr(Te):Te)),T===J&&N("files")},[T,De.setRuntimeContextOpen]),ba=w.useCallback(J=>{if(v&&T===J){S(!1),J==="context"&&De.setRuntimeContextOpen(!1),J==="calls"&&Q(Te=>Te.active==="process"?Rr(Te):Te);return}Tn(J)},[Kr,v,T,Tn]),ui=w.useCallback(()=>{De.setRuntimeContextOpen(!1),Q(J=>ho(J,"sidebar-drawer"))},[De.setRuntimeContextOpen]),di=w.useCallback((J,Te)=>{Ne.activateSession(J,Te),e.onNavigateWorkspace?.("chat",{...e.workspaceId?{workspaceId:e.workspaceId}:{},sessionId:J}),Wt(),queueMicrotask(()=>{V.current?.focus?.(),dr()})},[Ne,Wt,dr,e.onNavigateWorkspace,e.workspaceId]),Ms=w.useCallback(J=>{fe.setInput(Te=>`${Te}${Te&&!Te.endsWith(" ")?" ":""}@${J} `),Wt(),queueMicrotask(()=>dr())},[fe,Wt,dr]),Oa=w.useCallback(J=>{N("files"),S(!0),we.openPreview(J),Wt()},[we,Wt]),Da=w.useCallback(J=>{N("files"),S(!0),we.openPreview(J)},[we]),Xn=w.useCallback(()=>{const J=V.current;J&&(I(!0),J.scrollTop=J.scrollHeight)},[I]),la=w.useCallback(()=>{const J=V.current;if(!J)return;const Te=J.scrollHeight-J.scrollTop-J.clientHeight<=25;I(Te)},[I]);w.useLayoutEffect(()=>{if(!oe.current)return;const J=V.current;J&&(J.scrollTop=J.scrollHeight)},[Ie.messages,Ie.streaming]),w.useEffect(()=>{const J=se.current?.parentElement;if(!J||typeof ResizeObserver>"u")return;const Te=new ResizeObserver(()=>{if(!oe.current)return;const Dt=V.current;Dt&&(Dt.scrollTop=Dt.scrollHeight)});return Te.observe(J),()=>Te.disconnect()},[m?.sessionId]),w.useEffect(()=>{if(!G)return;const J=window.setTimeout(()=>W(null),6500);return()=>window.clearTimeout(J)},[G]);const va=o?{id:G?.id??1,kind:"error",message:o}:G?{id:G.id,kind:"info",message:G.message}:null,ca=w.useCallback(J=>{if(J.action==="pi-prompt"||J.command==="/name"||J.command==="/compact"){fe.setInput(`${J.command} `),fe.setShortcutOpen(!1),fe.textareaRef.current?.focus();return}ga.current(J.command)},[fe]),wn=w.useCallback(J=>{const Te=s3(J),Dt=J.trim(),Jt=Dt.split(/\s+/,1)[0]?.toLowerCase()??"";if(fe.setInput(""),fe.setShortcutOpen(!1),!Te)return;if(Te.action==="focus:interview"){if(!m){W({id:Date.now(),message:"请先创建或打开一个会话,再开始 Interview"});return}Tt.startInterview();return}const fr=oO(Te.action);if(fr){e.onNavigateWorkspace?.(fr,{});return}if(Te.action==="compact"){const Wn=Dt.slice(Jt.length).trim();Ne.compactSession(Wn||void 0);return}if(Te.action==="name"){const Wn=Dt.slice(Jt.length).trim(),sr=m?.sessionId;if(!sr){c("当前没有可重命名的会话");return}const gn=Ne.sessionList.find(Jn=>Jn.sessionId===sr),Or=Wn||window.prompt("会话名称",gn?.title??gn?.displayTitle??"")||"";Or.trim()&&Ne.updateSession(sr,{title:Or.trim()});return}if(Te.action==="session"){const Wn=m?.sessionId??"(none)",sr=Ne.sessionList.find(Or=>Or.sessionId===Wn),gn=sr?.title||sr?.displayTitle||"未命名对话";W({id:Date.now(),message:`当前会话:${gn}(${Wn})`});return}if(Te.action==="copy"){const sr=[...Ie.visibleMessages??[]].reverse().find(gn=>gn.role==="assistant");if(!sr?.text){c("没有可复制的助手消息");return}navigator.clipboard?.writeText(sr.text).then(()=>W({id:Date.now(),message:"已复制最后一条助手消息"}),()=>c("复制失败"));return}if(Te.action==="unknown"){Pe(Dt,fe.pendingImages);return}c(`未知 shortcut:${Te.command}`)},[fe.setInput,fe.setShortcutOpen,fe.pendingImages,Tt.startInterview,e.onNavigateWorkspace,Ne,m,Ie.visibleMessages,Pe]);ga.current=wn;const Os=w.useCallback(J=>{const Te=s.isComposingRef.current||J.nativeEvent.isComposing,Dt=Date.now()-s.compositionEndedAtRef.current<100;if(fe.shortcutOpen&&fe.filteredShortcuts.length>0&&!Te&&!Dt){if(J.key==="ArrowLeft"||J.key==="ArrowRight"||J.key==="ArrowUp"||J.key==="ArrowDown"){J.preventDefault();const Jt=Bj(rt);let fr=fe.shortcutIndex;if(J.key==="ArrowLeft"||J.key==="ArrowRight")fr=O3(fe.shortcutIndex,He,Jt,J.key==="ArrowLeft"?"left":"right");else{const Wn=gt.current;let sr=null;if(Wn){const gn=Array.from(Wn.querySelectorAll("[data-shortcut-index]")).map(Jn=>{const ua=Jn.getBoundingClientRect();return{globalIndex:Number(Jn.dataset.shortcutIndex??-1),top:ua.top,bottom:ua.bottom,left:ua.left,right:ua.right}}).filter(Jn=>Number.isFinite(Jn.globalIndex)&&Jn.globalIndex>=0),Or=gn.find(Jn=>Jn.globalIndex===fe.shortcutIndex)??null;Or&&(sr=qj(Or,gn,J.key==="ArrowUp"?"up":"down"))}fr=sr??O3(fe.shortcutIndex,He,Jt,J.key==="ArrowUp"?"up":"down")}fr!==fe.shortcutIndex&&(Rt.current=!0,fe.setShortcutIndex(fr));return}if(J.key==="Escape"){J.preventDefault(),fe.setShortcutOpen(!1);return}if(J.key==="Enter"||J.key==="Tab"){J.preventDefault();const Jt=fe.filteredShortcuts[fe.shortcutIndex]??fe.filteredShortcuts[0];ca(Jt);return}}if(J.key==="Enter"&&!J.shiftKey&&(Te||Dt)){Dt&&J.preventDefault();return}if((J.key==="ArrowUp"||J.key==="ArrowDown")&&!Te&&!Dt&&fe.fileOptions.length===0&&fe.navigateHistory(J.key==="ArrowUp"?"up":"down")){J.preventDefault();return}if(J.key==="Enter"&&!J.shiftKey){J.preventDefault(),yr(fe.input);return}},[fe.input,fe.shortcutOpen,fe.filteredShortcuts,fe.shortcutIndex,fe.setShortcutIndex,fe.setShortcutOpen,fe.fileOptions,fe.navigateHistory,s,yr,ca,rt,He,gt,Rt]),Mr=Ie.visibleMessages.length>0||Ie.operationCards.length>0||Ie.humanGateCards.length>0||Ie.artifactCards.length>0||!!Ie.interview,Yr=e.onNavigateWorkspace?()=>e.onNavigateWorkspace?.("models",{}):void 0,Me=u.jsx(Vk,{origin:t,readiness:e.readiness,workspaces:Mt.workspaces,workspacesLoading:Mt.loading,workspacesError:Mt.error,activeWorkspaceId:e.workspaceId??Mt.workspaceId,removingWorkspaceId:mt,onPickWorkspaceDirectory:Mt.pickWorkspaceDirectory,onAddWorkspace:J=>Mt.addWorkspace(J),onActivateWorkspace:J=>{J!==(e.workspaceId??Mt.workspaceId)&&e.onSwitchWorkspace?.(J)},onRemoveWorkspace:J=>{qt(J),Mt.removeWorkspace(J).finally(()=>{qt(null)})},onDismissWorkspaceError:()=>{Mt.refresh()},open:g,layoutMode:rt,drawerOpen:Be.sidebarDrawerOpen,activeSessionId:m?.sessionId,activeSessionStreaming:Ie.streaming,activeSessionTurnPhase:Ie.turnPhase,sessions:Ne.sessionList,tree:we.tree,expanded:we.expandedDirs,treeError:we.treeError,onToggleOpen:()=>x(J=>!J),onOpenDrawer:ui,onCloseDrawer:Wt,onCreate:()=>{Ne.createSession()},onCreateInWorkspace:J=>{Ne.createSession(J===(e.workspaceId??Mt.workspaceId)?void 0:{workspaceId:J})},creatingSession:Ne.creatingSession,onActivate:J=>{const Te=Ne.sessionList.find(Dt=>Dt.sessionId===J)?.workspaceId;Be.sidebarDrawerOpen?di(J,Te):(Ne.activateSession(J,Te),e.onNavigateWorkspace?.("chat",{...e.workspaceId?{workspaceId:e.workspaceId}:{},sessionId:J}))},onRename:(J,Te)=>{Ne.updateSession(J,{title:Te})},onSetState:(J,Te)=>{Ne.updateSession(J,{state:Te})},onDelete:J=>Ne.deleteSession(J),onRefreshTree:we.refreshTree,onToggleDir:we.toggleDir,onInsert:J=>{Be.sidebarDrawerOpen?Ms(J):fe.setInput(Te=>`${Te}${Te&&!Te.endsWith(" ")?" ":""}@${J} `)},onPreview:J=>{Be.sidebarDrawerOpen?Oa(J):Da(J)},drawerTriggerRef:he}),et=["oc-workspace",F?"is-column-dragging":""].filter(Boolean).join(" "),Nt=rt==="narrow"?0:rt==="compact"?56:g?U:40,Gt=rt==="narrow"||!v?0:z,hn=Ta(H,xs,El(z)),Pn={"--oc-sidebar-width":`${Nt}px`,"--oc-details-width":`${Gt}px`,"--oc-file-tree-width":`${hn}px`,gridTemplateColumns:rt==="narrow"?"minmax(0, 1fr)":`${Nt}px minmax(0, 1fr) ${Gt}px`},ir=u.jsxs(u.Fragment,{children:[rt==="comfortable"&&g?u.jsx(Bu,{side:"sidebar",value:U,onResize:J=>A(Ta(J,uL,dL)),onDragChange:Y}):null,v&&rt!=="narrow"?u.jsx(Bu,{side:"details",value:z,onResize:J=>X(Ta(J,Al,zu())),onResizeEnd:J=>jm(j3,Ta(J,Al,zu())),onDragChange:Y}):null,!v&&rt!=="narrow"?u.jsx("button",{type:"button",className:"oc-details-reopen",onClick:()=>Tn(T),"aria-label":"展开右侧辅助栏",title:"展开辅助栏",children:u.jsx(Vm,{side:"right"})}):null]}),Qn=J=>u.jsx("div",{className:"oc-messages is-empty",ref:ue,"data-landing-density":Bt.landingDensity,children:e.readiness==="setup-required"?u.jsx(k3,{readiness:e.readiness,presentation:"landing",onOpenModels:Yr}):u.jsx(X7,{mode:J,readiness:e.readiness,density:Bt.landingDensity,onSuggest:async Te=>{Ne.creatingSession||(J==="no-session"?await Ne.createSession()&&await yr(Te):await yr(Te))},disabled:Ne.creatingSession,onCreateSession:J==="no-session"?()=>{Ne.createSession()}:void 0})});return u.jsxs("div",{className:"oc-shell",children:[a?null:u.jsxs("div",{className:"oc-banner",children:[u.jsxs("span",{className:"oc-banner-title",children:[u.jsx("span",{className:"oc-banner-dot","aria-hidden":"true"}),"对话"]}),u.jsxs("span",{className:"oc-banner-body",children:["用自然语言编排 loop-agent / agent-worker 的",u.jsx("strong",{children:"全部能力"}),"。这是 ",u.jsx("strong",{children:"Operator"})," 面:默认具备完整 Pi 工具(read/write/edit/bash/grep/find/ls)与 safe-* 探查、以及受策略约束的 operator action(ADR 0011)。",u.jsx("strong",{children:"软约束"}),":大改与高风险变更优先走受治 DAG 的 implement-pi / repair-pi 与 Human Gate,而非把 Chat 当作第二套 DAG kernel。"]})]}),u.jsx(sj,{toast:va,onDismiss:()=>{c(null),W(null)}}),m?u.jsxs("div",{className:et,ref:Z,"data-layout-mode":rt,style:Pn,children:[Me,u.jsxs("div",{ref:ne,className:`oc-main${Mr?"":" is-landing"}`,children:[!ot&&(rt==="narrow"||Pt>0)?u.jsxs("div",{className:"oc-main-topbar",children:[rt==="narrow"?u.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:he,"aria-label":"打开会话与仓库","aria-expanded":Be.sidebarDrawerOpen,onClick:()=>Be.sidebarDrawerOpen?Wt():ui(),children:"会话与仓库"}):null,Pt>0?u.jsxs("button",{type:"button",className:"oc-main-topbar-btn oc-activity-trigger",ref:Ke,"aria-controls":"oc-activity-rail","aria-expanded":st,onClick:()=>st?ae():Yt(),children:["运行活动 ",u.jsx("span",{children:Et})]}):null]}):null,Mr&&e.readiness!=="ready"?u.jsx(k3,{readiness:e.readiness,presentation:"thread",onOpenModels:Yr}):null,Mr?u.jsxs("div",{className:"oc-thread-anchor-wrap",children:[u.jsx(lD,{scrollContainerRef:V,turnGroups:Ie.turnGroups,measureKey:Ie.visibleMessages.length}),u.jsx(aD,{scrollContainerRef:V,messagesEndRef:se,onScroll:la,showScrollToLatest:!ee,onScrollToLatest:Xn,hasThread:Mr,readiness:e.readiness,streaming:Ie.streaming,streamingAssistantId:Ie.streamingAssistantId,messagesCount:Ie.messages.length,visibleCount:Ie.visibleMessages.length,onLoadMore:()=>Ie.setHistoryLimit(J=>J+50),turnGroups:Ie.turnGroups,interview:Ie.interview,interviewAnswer:Tt.interviewAnswer,onInterviewAnswerChange:Tt.setInterviewAnswer,onAnswerInterview:J=>{Tt.answerInterview(J)},onConfirmTaskKind:()=>{Tt.confirmTaskKind()},onActivateActivity:Yt,canActivateActivity:We,onSuggest:J=>{yr(J)}})]}):Qn("empty-session"),Ie.pendingQuestion?u.jsx(AD,{origin:t,pending:Ie.pendingQuestion,workspaceId:m?.workspaceId,onSettled:()=>Ie.setPendingQuestion(null)}):u.jsxs("div",{className:"oc-composer-dock",children:[u.jsx(_D,{todos:Ie.todos}),u.jsx(SD,{composer:fe,streaming:Ie.streaming,turnPhase:Ie.turnPhase,deferredTurn:Ie.deferredTurn,deferredTurns:Ie.deferredTurns,hasThread:Mr,layoutMode:rt,paletteModel:He,shortcutPaletteRef:gt,paletteKeyboardNavRef:Rt,onSend:J=>{yr(J)},onStop:ut,onDiscardDeferred:xn,onEditDeferred:fn,onSteerDeferred:oa,onKeyDown:Os,onRunShortcut:wn,models:De.models,activeModel:De.activeModel,activeModelRef:De.activeModelRef,activeModelListed:De.activeModelListed,activeThinkingLevel:De.activeThinkingLevel,thinkingLevels:De.thinkingLevels,onSwitchRuntime:J=>{De.switchRuntime(J)},usage:Ie.usage,sessionStats:Ie.sessionStats,unread:Ie.unread,onCompact:()=>{Ne.compactSession()},compacting:d,processSummary:Ie.streaming?null:Ie.processSummary,processOpen:Qe,onToggleProcess:()=>ba("calls"),processTriggerRef:Re,runtimeContext:De.runtimeContext,runtimeContextOpen:Ue,onToggleRuntimeContext:()=>ba("context"),runtimeContextTriggerRef:ze})]})]}),u.jsxs(r3,{open:v,onToggleOpen:()=>{S(!1),T==="context"&&De.setRuntimeContextOpen(!1),T==="calls"&&Q(J=>J.active==="process"?Rr(J):J)},activeTab:T,onSelectTab:Tn,dagRunId:bt,dagRun:_t,contextContent:R&&De.runtimeContext?u.jsx(DD,{panelOnly:!0,embedded:!0,open:T==="context"&&v&&!!De.runtimeContext,onToggle:()=>ba("context"),onClose:()=>{S(!1),De.setRuntimeContextOpen(!1),Q(J=>J.active==="runtime-context"?Rr(J):J)},context:De.runtimeContext,triggerRef:ze}):void 0,callsContent:_?u.jsx(MD,{toolCalls:Ie.toolCalls,overlay:!1,embedded:!0,onClose:()=>ba("calls"),triggerRef:Re}):void 0,onCloseTab:Kr,children:[u.jsx(a3,{previews:we.previews,activePath:we.activePreviewPath,loading:we.previewLoading,onActivate:we.setActivePreviewPath,onClose:we.closePreview}),u.jsx(Bu,{side:"details-tree",value:hn,onResize:J=>$(Ta(J,xs,El(z))),onResizeEnd:J=>jm(Dm,Ta(J,xs,El(z))),onDragChange:Y}),u.jsx(Nb,{workspaceName:Mt.workspaces.find(J=>J.workspaceId===e.workspaceId)?.name??"Workspace",tree:we.tree,expanded:we.expandedDirs,treeError:we.treeError,onRefresh:we.refreshTree,onToggle:we.toggleDir,onInsert:J=>fe.setInput(Te=>`${Te}${Te&&!Te.endsWith(" ")?" ":""}@${J} `),onPreview:J=>{Da(J)}})]}),ir,Pt>0&&!ot&&st?u.jsx("button",{type:"button",className:"oc-overlay-backdrop is-activity","aria-label":"关闭运行活动遮罩",onClick:ae}):null,en.snapshot?u.jsx(zO,{origin:t,sessionId:en.snapshot.sessionId,presentation:vt.presentation,sidecarRect:vt.sidecarRect,phase:en.phase,open:st,focusRef:pe,triggerRef:Ke,operationCards:en.snapshot.operationCards,humanGateCards:en.snapshot.humanGateCards,artifactCards:en.snapshot.artifactCards,onClose:ae,onLocateConversation:ke,onNavigateWorkspace:e.onNavigateWorkspace}):null]}):u.jsxs("div",{className:et,ref:Z,"data-layout-mode":rt,style:Pn,children:[Me,u.jsxs("div",{className:"oc-main is-landing",children:[rt==="narrow"?u.jsx("div",{className:"oc-main-topbar",children:u.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:he,"aria-label":"打开会话与仓库","aria-expanded":Be.sidebarDrawerOpen,onClick:()=>Be.sidebarDrawerOpen?Wt():ui(),children:"会话与仓库"})}):null,Qn("no-session")]}),u.jsxs(r3,{open:v,onToggleOpen:()=>S(J=>!J),activeTab:T,onSelectTab:Tn,onCloseTab:Kr,dagRunId:bt,dagRun:_t,children:[u.jsx(a3,{previews:we.previews,activePath:we.activePreviewPath,loading:we.previewLoading,onActivate:we.setActivePreviewPath,onClose:we.closePreview}),u.jsx(Bu,{side:"details-tree",value:hn,onResize:J=>$(Ta(J,xs,El(z))),onResizeEnd:J=>jm(Dm,Ta(J,xs,El(z))),onDragChange:Y}),u.jsx(Nb,{workspaceName:Mt.workspaces.find(J=>J.workspaceId===e.workspaceId)?.name??"Workspace",tree:we.tree,expanded:we.expandedDirs,treeError:we.treeError,onRefresh:we.refreshTree,onToggle:we.toggleDir,onInsert:J=>fe.setInput(Te=>`${Te}${Te&&!Te.endsWith(" ")?" ":""}@${J} `),onPreview:J=>{Da(J)}})]}),ir]})]})}function pL(e){const{active:t}=e;return u.jsxs("section",{id:"workspace-chat",className:"workspace-pane workspace-pane--chat panel panel--chat","aria-labelledby":"chat-title",hidden:!t,"aria-hidden":!t,inert:!t,tabIndex:t?-1:void 0,style:{minWidth:0,height:"100%"},children:[u.jsx("h2",{id:"chat-title",className:"sr-only",children:"对话"}),u.jsx(mL,{origin:"",readiness:e.readiness,surface:"workspace",workspaceRegistry:e.workspaceRegistry,workspaceId:e.workspaceId,requestedSessionId:e.sessionId,workspaceGate:e.workspaceGate,onSwitchWorkspace:e.onSwitchWorkspace,onNavigateWorkspace:e.onNavigateWorkspace})]})}function gL(e){const{board:t,busy:n}=e;return u.jsxs("details",{className:"night-advanced","data-testid":"night-advanced",open:t.advancedOpen,onToggle:a=>t.setAdvancedOpen(a.target.open),children:[u.jsx("summary",{children:"高级 / Inspect"}),u.jsxs("p",{className:"muted",children:["只读深链:"," ",u.jsx("a",{className:"external-link",href:"/#/inspect/night",children:"/#/inspect/night"})]}),u.jsx("div",{className:"cta-row",children:u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-morning-btn",onClick:()=>{t.onMorningReport()},children:"早晨 night 报告"})}),t.morningPreview?u.jsx("pre",{className:"cmd","data-testid":"night-morning-preview",children:t.morningPreview}):null]})}function qu(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function Mn(e,t){const n=e[t];return typeof n=="string"&&n.trim()?n.trim():void 0}function z3(e,t){const n=e[t];if(!Array.isArray(n))return;const a=n.filter(s=>typeof s=="string");return a.length>0?a:void 0}function bL(e){const t=qu(e);if(!t)return null;const n=qu(t.result),a=[qu(t.reviewPacket),n?qu(n.reviewPacket):null,n,t].filter(Boolean);for(const s of a){const o=Mn(s,"scheduleId")??Mn(s,"id"),c=Mn(s,"gateToken")??Mn(s,"approveGate")??Mn(s,"writeSetGateToken");if(!(!o||!c))return{scheduleId:o,gateToken:c,...Mn(s,"featureId")?{featureId:Mn(s,"featureId")}:{},...Mn(s,"taskId")?{taskId:Mn(s,"taskId")}:{},...z3(s,"writeSet")?{writeSet:z3(s,"writeSet")}:{},...Mn(s,"worktreePath")?{worktreePath:Mn(s,"worktreePath")}:{},...Mn(s,"branch")?{branch:Mn(s,"branch")}:{},...Mn(s,"baseBranch")?{baseBranch:Mn(s,"baseBranch")}:{},...Mn(s,"baseCommit")?{baseCommit:Mn(s,"baseCommit")}:{},...Mn(s,"executeAtUtc")?{executeAtUtc:Mn(s,"executeAtUtc")}:{},...Mn(s,"taskCard")?{taskCard:Mn(s,"taskCard")}:{}}}return null}function B3(e){return`docs/features/${e.trim().replace(/^\/+|\/+$/g,"")}`}function vL(e){const t=e.trim(),n=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/.exec(t);return n?`${n[1]} ${n[2]}`:null}function q3(){const e=new Date;e.setHours(20,0,0,0);const t=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}function ox(e){if(!e)return"—";const t=Date.parse(e);if(Number.isNaN(t))return e;try{return new Intl.DateTimeFormat("zh-CN",{dateStyle:"short",timeStyle:"short",timeZone:"Asia/Shanghai"}).format(new Date(t))}catch{return e}}function yL(e){return e.mergeState==="pending-harvest"||/\bscheduler harvest\b/i.test(e.nextAction)}function xL(e){return e.status==="failed"||e.status==="human_required"||e.status==="cancelled"||/\bscheduler discard\b/i.test(e.nextAction)}function hd(e){return e==="failed"||e==="human_required"}function wL(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function lx(e){return{submitted:"已提交",validating:"校验中",validated:"待预约确认",scheduled:"已预约",waiting:"等待触发",dispatching:"派发中",running:"执行中",succeeded:"成功",failed:"失败",human_required:"需人工",cancelled:"已取消",rejected:"已拒绝",cancel_requested:"取消中"}[e]??e}function kL(e){const{target:t,reason:n,onReasonChange:a,force:s,onForceChange:o,busy:c}=e;return u.jsxs("div",{className:"night-discard-card","data-testid":"night-discard-card",children:[u.jsx("h3",{children:"确认 Discard"}),u.jsxs("p",{className:"muted",children:[t.featureId,"/",t.taskId,"(",lx(t.status),")"]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"原因"}),u.jsx("input",{"data-testid":"night-discard-reason",value:n,disabled:c,placeholder:"human discard reason",onChange:d=>a(d.target.value)})]}),hd(t.status)?u.jsxs("label",{className:"field checkbox-field",children:[u.jsx("input",{type:"checkbox","data-testid":"night-discard-force",checked:s,disabled:c,onChange:d=>o(d.target.checked)}),u.jsx("span",{className:"muted",children:"强制 Discard(failed / human_required)"})]}):null,u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:c||hd(t.status)&&!s,"data-testid":"night-discard-confirm",onClick:e.onConfirm,children:"确认 Discard"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:c,onClick:e.onCancel,children:"返回"})]})]})}function SL(e){const{board:t}=e,{doctor:n,list:a,clockHint:s,doctorIssues:o,auxTicker:c}=t;return u.jsxs("div",{className:"night-health","data-testid":"night-health-bar",children:[u.jsxs("div",{className:"night-health-main",children:[u.jsx("span",{className:`night-health-pill${n?.ok===!1?" is-bad":""}`,children:n?.ok===!1?"Scheduler 异常":"Scheduler 健康"}),u.jsxs("span",{className:"muted",children:["计划 ",n?.scheduleCount??a?.summary.total??"—"," · 活动"," ",n?.activeCount??a?.summary.active??"—"]})]}),s?u.jsxs("p",{className:"muted night-health-hint","data-testid":"night-clock-hint",children:["时钟:",s.message,"(安装/启停请用 CLI:",u.jsx("code",{children:"agent-worker scheduler clock status --repo ."}),")"]}):u.jsxs("p",{className:"muted night-health-hint",children:["到点执行依赖本机 clock / tick,不在此面板安装。详见"," ",u.jsx("a",{className:"external-link",href:"/#/inspect/night",children:"/#/inspect/night"})]}),u.jsxs("div",{className:"night-aux-ticker","data-testid":"night-aux-ticker",children:[u.jsxs("p",{className:"night-aux-ticker-label",children:["开着 Console 时辅助 tick(每 ",c?.intervalSec??60,"s)"]}),u.jsx("p",{className:"muted night-health-hint","data-testid":"night-aux-ticker-disclaimer",children:c?.disclaimer??"仅在本 Console 进程开着时有效;过夜无人值守仍需 OS clock。"}),c?.lastOutcome?u.jsxs("p",{className:"muted","data-testid":"night-aux-ticker-last",children:["上次:",c.lastOutcome,c.running?"(进行中)":"",c.lastSummary?` · ${c.lastSummary}`:"",c.lastError?` · ${c.lastError}`:""]}):null]}),o.length>0?u.jsx("ul",{className:"night-doctor-list","data-testid":"night-doctor-findings",children:o.slice(0,4).map(d=>u.jsxs("li",{children:[u.jsx("strong",{children:d.severity})," ",d.message]},`${d.code}-${d.scheduleId??""}-${d.message}`))}):null]})}function EL(e){const{board:t,busy:n,onHarvest:a,onOpenDiscard:s}=e,{list:o}=t;return u.jsxs(u.Fragment,{children:[o?u.jsxs("div",{className:"night-kpi","data-testid":"night-kpi",children:[u.jsxs("span",{children:["合计 ",o.summary.total]}),u.jsxs("span",{children:["活动 ",o.summary.active]}),u.jsxs("span",{children:["待收成 ",o.summary.pendingHarvest]}),u.jsxs("span",{children:["需人工 ",o.summary.humanRequired]}),u.jsxs("span",{children:["失败 ",o.summary.failed]})]}):null,u.jsxs("div",{className:"night-board","data-testid":"night-board",children:[u.jsx("h3",{children:"计划列表"}),!o||o.schedules.length===0?u.jsxs("div",{className:"empty-state","data-testid":"night-board-empty",children:[u.jsx("p",{className:"empty-title",children:"暂无夜间计划"}),u.jsx("p",{className:"muted",children:"用下方向导预约第一个任务。"})]}):u.jsx("ul",{className:"night-schedule-list",children:o.schedules.map(c=>u.jsxs("li",{className:"night-schedule-row","data-testid":"night-schedule-row","data-status":c.status,children:[u.jsxs("div",{className:"night-schedule-head",children:[u.jsxs("strong",{children:[c.featureId,"/",c.taskId]}),u.jsx("span",{className:"night-status-chip",children:lx(c.status)})]}),u.jsxs("p",{className:"muted",children:["执行 ",ox(c.executeAtUtc),c.mergeState?` · merge ${c.mergeState}`:"",c.taskCard?` · ${c.taskCard}`:""]}),c.waitingReason?u.jsxs("p",{className:"muted",children:["等待原因:",c.waitingReason]}):null,u.jsxs("p",{className:"muted night-next-action",children:["下一步:",c.nextAction]}),u.jsxs("div",{className:"cta-row",children:[yL(c)?u.jsx("button",{type:"button",className:"btn btn-primary",disabled:n,"data-testid":"night-row-harvest",onClick:()=>a(c),children:"Harvest"}):null,xL(c)?u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-row-discard",onClick:()=>s(c),children:"Discard"}):null,u.jsx("a",{className:"external-link",href:`/#/inspect/night/${encodeURIComponent(c.scheduleId)}`,children:"Inspect"})]})]},c.scheduleId))})]})]})}function TL(e){const{wizard:t,busy:n}=e;return u.jsxs("div",{className:"night-wizard","data-testid":"night-wizard",children:[u.jsx("h3",{children:"预约夜间任务"}),t.phase==="pick"?u.jsxs(u.Fragment,{children:[t.selectableTasks.length===0?u.jsxs("div",{className:"empty-state","data-testid":"night-task-empty",children:[u.jsx("p",{className:"empty-title",children:"没有可选任务"}),u.jsx("p",{className:"muted",children:"请先在 Feature Packet / Task Pool 中创建任务,再回到此处刷新。"})]}):u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"Feature / Task"}),u.jsxs("select",{"data-testid":"night-task-select",value:t.selectedKey,disabled:n,onChange:a=>t.setSelectedKey(a.target.value),children:[u.jsx("option",{value:"",children:"选择任务…"}),t.selectableTasks.map(a=>{const s=`${a.featureId}::${a.taskId}`;return u.jsxs("option",{value:s,children:[a.featureId,"/",a.taskId,a.status?` · ${a.status}`:""]},s)})]})]}),t.derivedFeatureDir?u.jsxs("p",{className:"muted","data-testid":"night-feature-dir",children:["Feature 目录:",u.jsx("code",{children:t.derivedFeatureDir})]}):null,u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"本地执行时间"}),u.jsx("input",{type:"datetime-local","data-testid":"night-at",value:t.nightAt,disabled:n,onChange:a=>t.setNightAt(a.target.value)})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"任务卡片(可选)"}),u.jsx("input",{"data-testid":"night-task-card",value:t.taskCard,disabled:n,placeholder:"UCP-LOOP#11",onChange:a=>t.setTaskCard(a.target.value)})]}),u.jsx("div",{className:"cta-row",children:u.jsx("button",{type:"button",className:"btn btn-primary",disabled:n||!t.selectedKey||!t.nightAt,"data-testid":"night-prepare-btn",onClick:()=>{t.onPrepare()},children:"准备并审阅"})})]}):u.jsxs("div",{className:"night-review-card","data-testid":"night-review-card",children:[u.jsx("p",{className:"muted",children:"请确认 writeSet 与执行环境后预约。Token 已隐藏。"}),u.jsxs("dl",{className:"kv",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Schedule"}),u.jsx("dd",{children:u.jsx("code",{children:t.review?.scheduleId})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"任务"}),u.jsxs("dd",{children:[t.review?.featureId,"/",t.review?.taskId]})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"执行时间 (UTC)"}),u.jsx("dd",{children:ox(t.review?.executeAtUtc)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Worktree"}),u.jsx("dd",{children:u.jsx("code",{children:t.review?.worktreePath??"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"分支"}),u.jsx("dd",{children:u.jsx("code",{children:t.review?.branch??"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Base"}),u.jsx("dd",{children:u.jsxs("code",{children:[t.review?.baseBranch??"—","@",(t.review?.baseCommit??"").slice(0,12)||"—"]})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"WriteSet"}),u.jsx("dd",{children:t.review?.writeSet&&t.review.writeSet.length>0?u.jsx("ul",{className:"night-writeset",children:t.review.writeSet.map(a=>u.jsx("li",{children:u.jsx("code",{children:a})},a))}):u.jsx("span",{className:"muted",children:"(未返回显式 writeSet)"})})]})]}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:n||!t.review,"data-testid":"night-confirm-add-btn",onClick:()=>{t.onConfirmAdd()},children:"确认预约"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-review-back-btn",onClick:t.onCancelWizard,children:"返回修改"})]})]})]})}function CL(e){const{setOpError:t}=e,[n,a]=w.useState(null),[s,o]=w.useState(null),[c,d]=w.useState([]),[h,m]=w.useState(null),[p,g]=w.useState(!1),[x,v]=w.useState(!1),[S,T]=w.useState(null),[N,R]=w.useState(null),O=w.useCallback(async()=>{g(!0),m(null);try{const[A,z,X,H]=await Promise.all([fetch(Ir("/api/night-jobs"),{credentials:"same-origin"}),fetch(Ir("/api/night-jobs/doctor"),{credentials:"same-origin"}),fetch(Ir("/api/tasks"),{credentials:"same-origin"}),fetch(Ir("/api/operator/v1/night-aux-ticker"),{credentials:"same-origin"})]);if(!A.ok)throw new Error(`加载计划列表失败(HTTP ${A.status})`);const $=await A.json();if(a($),z.ok?o(await z.json()):o(null),X.ok){const F=await X.json();d(Array.isArray(F)?F:[])}else d([]);if(H.ok){const F=await H.json();F.ticker&&R(F.ticker)}}catch(A){m(A instanceof Error?A.message:String(A))}finally{g(!1)}},[]);w.useEffect(()=>{O()},[O]);const _=w.useCallback(async()=>{try{const A=await fetch(Ir("/api/night-jobs/morning"),{credentials:"same-origin"});if(!A.ok){t(`早晨报告加载失败(HTTP ${A.status})`);return}const z=await A.json();T(JSON.stringify(z,null,2).slice(0,4e3)),v(!0)}catch(A){t(A instanceof Error?A.message:String(A))}},[t]),P=(s?.findings??[]).filter(A=>A.severity==="error"||A.severity==="warning"),U=(s?.findings??[]).find(A=>/clock/i.test(A.code)||/clock/i.test(A.message));return{list:n,doctor:s,tasks:c,loadError:h,loadingBoard:p,advancedOpen:x,setAdvancedOpen:v,morningPreview:S,auxTicker:N,refreshBoard:O,onMorningReport:_,doctorIssues:P,clockHint:U}}function RL(e){const{board:t,runAction:n,isActionSuccess:a,setOpError:s}=e,{tasks:o,refreshBoard:c}=t,[d,h]=w.useState("pick"),[m,p]=w.useState(""),[g,x]=w.useState(q3),[v,S]=w.useState(""),[T,N]=w.useState(null),[R,O]=w.useState(""),[_,P]=w.useState(null),[U,A]=w.useState(!1),z=w.useMemo(()=>{const K=o.filter(Q=>typeof Q.featureId=="string"&&Q.featureId.trim()&&Q.taskId);return K.sort((Q,pe)=>{const j=Q.featureId??"",G=pe.featureId??"";return j!==G?j.localeCompare(G):Q.taskId.localeCompare(pe.taskId)}),K},[o]),X=w.useMemo(()=>m?z.find(K=>`${K.featureId}::${K.taskId}`===m)??null:null,[z,m]),H=X?.featureId?B3(X.featureId):"",$=w.useCallback(async(K,Q,pe)=>{const j=await n("prepareMutationGate",{action:K,actionParams:Q});if(!a(j))return;const G=j?.result??j,W=G.receiptId?G:G.result??G;if(!W.receiptId||!W.humanGateToken){s("prepareMutationGate 未返回可消费的 Human Gate receipt");return}return n(K,{...Q,confirmationId:W.receiptId,humanGateToken:W.humanGateToken},{clientRequestId:wL(pe)})},[a,n,s]),F=w.useCallback(async()=>{if(!X?.featureId){s("请先点选 Feature / Task");return}const K=vL(g);if(!K){s("执行时间格式无效,请使用日期时间选择器");return}const Q={featureDir:B3(X.featureId),taskId:X.taskId,at:K,tz:"Asia/Shanghai",...v.trim()?{taskCard:v.trim()}:{}},pe=await $("workerAdmissionPrepare",Q,"night-prepare");if(!a(pe))return;const j=bL(pe?.result??pe);if(!j){s("准备成功但未解析到 scheduleId / gateToken。请刷新后重试,或查看 Inspect。");return}N(j),h("review")},[a,g,$,X,s,v]),Y=w.useCallback(async()=>{if(!T)return;const K=await $("workerSchedulerAdd",{scheduleId:T.scheduleId,approveGate:T.gateToken},"night-add");a(K)&&(N(null),h("pick"),p(""),S(""),x(q3()),await c())},[a,c,T,$]),oe=w.useCallback(()=>{h("pick"),N(null)},[]),ee=w.useCallback(async K=>{const Q=await $("workerSchedulerHarvest",{scheduleId:K.scheduleId},"night-harvest");a(Q)&&await c()},[a,c,$]),q=w.useCallback(async()=>{if(!_)return;const K=R.trim()||"discard from console night workbench",Q=hd(_.status),pe=await $("workerSchedulerDiscard",{scheduleId:_.scheduleId,reason:K,...Q||U?{force:!0}:{}},"night-discard");a(pe)&&(P(null),O(""),A(!1),await c())},[R,_,U,a,c,$]),I=w.useCallback(K=>{P(K),A(hd(K.status)),O("")},[]);return{phase:d,selectedKey:m,setSelectedKey:p,nightAt:g,setNightAt:x,taskCard:v,setTaskCard:S,review:T,discardReason:R,setDiscardReason:O,discardTarget:_,setDiscardTarget:P,forceDiscard:U,setForceDiscard:A,selectableTasks:z,derivedFeatureDir:H,onPrepare:F,onConfirmAdd:Y,onCancelWizard:oe,onHarvest:ee,onDiscard:q,openDiscard:I}}function NL({busy:e,runAction:t,isActionSuccess:n,setOpError:a}){const s=CL({setOpError:a}),o=RL({board:s,runAction:t,isActionSuccess:n,setOpError:a});return u.jsxs("section",{className:"panel night-workbench","aria-labelledby":"night-title","data-testid":"night-jobs-panel",children:[u.jsx("h2",{id:"night-title",children:"夜间任务"}),u.jsx("p",{className:"panel-lead",children:"白天点选任务并预约;列表查看状态;早晨在行内收成或丢弃。写操作仍经 Human Gate,列表复用 Inspect 投影。"}),u.jsx(SL,{board:s,busy:e}),u.jsx("div",{className:"cta-row",children:u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:e||s.loadingBoard,"data-testid":"night-refresh-btn",onClick:()=>{s.refreshBoard()},children:"刷新看板"})}),s.loadError?u.jsx("p",{className:"error","data-testid":"night-load-error",children:s.loadError}):null,u.jsx(EL,{board:s,busy:e,onHarvest:c=>{o.onHarvest(c)},onOpenDiscard:o.openDiscard}),o.discardTarget?u.jsx(kL,{target:o.discardTarget,reason:o.discardReason,onReasonChange:o.setDiscardReason,force:o.forceDiscard,onForceChange:o.setForceDiscard,busy:e,onConfirm:()=>{o.onDiscard()},onCancel:()=>o.setDiscardTarget(null)}):null,u.jsx(TL,{wizard:o,busy:e}),u.jsx(gL,{board:s,busy:e})]})}function AL(){return u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Hu(e){return e.provider?Ns(e.provider,e.id):e.id}function IL(e){const t=e.trim();if(!t)return;const n=t.indexOf("/");return n<=0||n===t.length-1?{provider:"",id:t}:{provider:t.slice(0,n),id:t.slice(n+1)}}function _L(e){const[t,n]=w.useState(!1),[a,s]=w.useState(""),[o,c]=w.useState(0),d=w.useRef(null),h=w.useRef(null),m=w.useRef(null),p=w.useMemo(()=>{const T=[...e.models];if(e.value&&!T.some(N=>Hu(N)===e.value)){const N=IL(e.value);N&&T.push(N)}return T},[e.models,e.value]),g=w.useMemo(()=>ex(p,a),[p,a]),x=w.useMemo(()=>g.flatMap(T=>T.models),[g]);w.useEffect(()=>{t&&(s(""),c(Math.max(0,p.findIndex(T=>Hu(T)===e.value))),window.setTimeout(()=>m.current?.focus(),0))},[t,p,e.value]),w.useEffect(()=>{if(!t)return;const T=R=>{const O=d.current;O&&R.target instanceof Node&&!O.contains(R.target)&&n(!1)},N=R=>{R.key==="Escape"&&(n(!1),h.current?.focus())};return document.addEventListener("mousedown",T),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",N)}},[t]);const v=T=>{if(e.disabled)return;const N=x[T];N&&(n(!1),e.onChange(Hu(N)),h.current?.focus())},S=T=>{if(T.key==="ArrowDown"){T.preventDefault(),c(N=>x.length?(N+1)%x.length:0);return}if(T.key==="ArrowUp"){T.preventDefault(),c(N=>x.length?(N-1+x.length)%x.length:0);return}if(T.key==="Enter"){T.preventDefault(),v(o);return}if(T.key==="Escape"){T.preventDefault(),n(!1),h.current?.focus();return}};return u.jsxs("div",{className:"oc-select-menu models-matrix-select",ref:d,children:[u.jsxs("button",{type:"button",ref:h,id:e.id,className:"oc-select-trigger","aria-haspopup":"listbox","aria-expanded":t,"aria-invalid":e.ariaInvalid,"data-testid":e.dataTestId,disabled:e.disabled,onClick:()=>n(T=>!T),children:[u.jsx("span",{className:"oc-select-trigger-label",children:e.value||"选择模型"}),u.jsx(AL,{})]}),t&&u.jsxs("div",{className:"oc-select-panel oc-model-panel is-below",role:"listbox","aria-label":"选择模型",children:[u.jsx("input",{ref:m,className:"oc-select-search",placeholder:"搜索模型…",value:a,onChange:T=>{s(T.target.value),c(0)},onKeyDown:S}),g.length===0&&u.jsx("div",{className:"oc-select-status",children:"没有可用模型"}),g.map(T=>u.jsxs("div",{className:"oc-model-group",children:[u.jsx("div",{className:"oc-model-group-head",children:T.provider||"其他"}),T.models.map(N=>{const R=Hu(N),O=R===e.value,_=x[o]===N;return u.jsxs("button",{type:"button",role:"option","aria-selected":O,disabled:e.disabled,className:`oc-select-option oc-model-option${_?" is-highlighted":""}${O?" is-active":""}`,onMouseDown:P=>P.preventDefault(),onClick:()=>{e.disabled||(n(!1),e.onChange(R))},children:[u.jsxs("span",{className:"oc-model-option-name",children:[N.name?`${N.name} · `:"",N.id]}),O&&u.jsx("span",{className:"oc-model-option-check",children:"✓"})]},R)})]},T.provider))]})]})}const ML=[{key:"sdkAvailable",detailKey:"sdkMessage",label:"Pi SDK",hint:"Node 侧 Pi SDK 可加载"},{key:"authReady",detailKey:"authMessage",label:"认证凭据",hint:"Pi auth / provider 密钥已配置"},{key:"modelsAvailable",detailKey:"modelsMessage",label:"可用模型",hint:"harness.json executors.pi(LOW/MED/HIGH)可在 Pi 凭据面解析"},{key:"interviewSessionOk",detailKey:"sessionMessage",label:"访谈会话",hint:"Interview 会话预检通过"}];function OL(e){if(!e)return null;const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function DL(e){const t=e.readinessReport?.state??e.readiness,n=e.readinessReport?.probe,a=n?.details??{},s=e.readinessReport?.blockedActions??[],o=OL(e.readinessReport?.generatedAt),c=e.readinessReport??{state:e.readiness,health:e.health},d=n?.piModelMatrix,h=n?.piAvailableModels??[],[m,p]=w.useState(()=>bb(d)),[g,x]=w.useState(!1),[v,S]=w.useState(null),[T,N]=w.useState(null);w.useEffect(()=>{p(bb(d)),S(null)},[d]);const R=_w(m),O=!Mw(R),_=e.busy||g||O;async function P(){if(!_){x(!0),S(null),N(null);try{const U=await e.onSaveMatrix({LOW:m.LOW,MED:m.MED,HIGH:m.HIGH});if(U&&U.ok===!1){S(U.error?.message??"保存模型矩阵失败");return}const A=window.localStorage.getItem(ri)?.trim();if(A)try{const z=await fetch(`/api/operator/v1/chat/sessions/${encodeURIComponent(A)}/reload`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",[O1]:j1()},body:"{}"});z.ok?N("配置已保存,活动会话已重载。"):z.status===409?N("配置已保存;活动会话正忙(PI_SESSION_BUSY),请稍后手动重载。"):N("配置已保存;活动会话重载未完成,请手动重载。")}catch{N("配置已保存;活动会话重载未完成,请手动重载。")}else N("配置已保存,检测结果已刷新。")}catch(U){S(U instanceof Error?U.message:String(U))}finally{x(!1)}}}return u.jsxs("section",{className:"panel models-page","aria-labelledby":"models-title",children:[u.jsxs("div",{className:"models-header",children:[u.jsx("h2",{id:"models-title",children:"模型与认证"}),u.jsx("span",{className:"models-status-pill","data-state":t,"data-testid":"models-readiness-pill",children:K3[t]??t})]}),u.jsxs("p",{className:"panel-lead",children:["复用 Pi ModelRuntime 凭据平面;密钥不会回传到页面。请用"," ",u.jsx("code",{children:"pi"})," 或 Pi 认证存储完成配置,然后刷新就绪探测。"]}),u.jsxs("section",{className:"models-probe-card","aria-labelledby":"models-probe-title","data-testid":"readiness-details",children:[u.jsx("h3",{id:"models-probe-title",className:"models-subtitle",children:"就绪检查"}),u.jsx("ul",{className:"models-probe-list",children:ML.map(U=>{const A=n?.[U.key],z=a[U.detailKey],X=A===void 0;return u.jsxs("li",{className:`models-probe-item${X?" is-pending":A?" is-ok":" is-bad"}`,children:[u.jsx("span",{className:"models-probe-badge","aria-label":X?"未探测":A?"通过":"未通过",children:X?"—":A?"✓":"✕"}),u.jsxs("div",{className:"models-probe-body",children:[u.jsx("strong",{children:U.label}),u.jsx("span",{className:"muted",children:U.hint}),z?u.jsx("p",{className:"models-probe-detail",children:z}):null]})]},U.key)})})]}),u.jsxs("section",{className:"models-matrix-card","aria-labelledby":"models-matrix-title","data-testid":"models-matrix-editor",children:[u.jsx("h3",{id:"models-matrix-title",className:"models-subtitle",children:"Herness模型矩阵(LOW/MED/HIGH)"}),u.jsxs("p",{className:"models-matrix-lead",children:["从 Pi 可用模型中选择 ",u.jsx("code",{children:"provider/model"})," 或裸 model id; 保存后原子写入 ",u.jsx("code",{children:"executors.pi"})," 并自动重测就绪。"]}),u.jsx("div",{className:"models-matrix-list",children:D1.map(U=>u.jsxs("div",{className:"models-matrix-row",children:[u.jsxs("label",{htmlFor:`pi-model-${U}`,children:[U," 档",R[U]?u.jsxs("span",{className:"error","data-testid":`pi-model-error-${U}`,children:[" ","— ",R[U]]}):null]}),u.jsx(_L,{id:`pi-model-${U}`,value:m[U],models:h,onChange:A=>p(z=>({...z,[U]:A})),ariaInvalid:R[U]!==void 0,"data-testid":`pi-model-select-${U}`})]},U))}),v?u.jsx("p",{className:"error","data-testid":"models-matrix-save-error",children:v}):null,T?u.jsx("p",{className:"muted","data-testid":"models-matrix-save-notice",children:T}):null,u.jsxs("div",{className:"models-actions",children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:_,"data-testid":"models-matrix-save",onClick:()=>{P()},children:g||e.busy?"保存中…":"保存模型矩阵"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:e.busy||g,"data-testid":"models-matrix-refresh-models",onClick:e.onRefreshReadiness,children:e.busy?"刷新中…":"刷新模型"})]})]}),t==="setup-required"?u.jsxs("div",{className:"models-setup-card","data-testid":"models-setup-hint",children:[u.jsx("h3",{className:"models-subtitle",children:"如何完成配置"}),u.jsxs("ol",{className:"models-setup-steps",children:[u.jsxs("li",{children:["在终端配置 Pi 认证(例如 ",u.jsx("code",{children:"pi auth login"}),")或写入 provider API key。"]}),u.jsxs("li",{children:["确认 agent 目录下 ",u.jsx("code",{children:"models.json"})," / 认证文件可读。"]}),u.jsx("li",{children:"点击下方「刷新就绪探测」,或运行诊断命令查看详情。"})]}),u.jsx("pre",{className:"cmd",children:V3})]}):null,t==="degraded"?u.jsx("p",{className:"models-degraded-note","data-testid":"models-degraded-note",children:"Pi 暂时降级:仍可恢复草稿与需求访谈;部分写入/运行类操作会被拦截。"}):null,s.length>0?u.jsxs("div",{className:"models-blocked-card",children:[u.jsx("h3",{className:"models-subtitle",children:"当前受限操作"}),u.jsx("ul",{className:"models-blocked-list",children:s.map(U=>u.jsx("li",{children:u.jsx("code",{children:U})},U))})]}):null,u.jsxs("div",{className:"models-actions",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:e.busy,onClick:e.onRefreshReadiness,children:"刷新就绪探测"}),o?u.jsxs("span",{className:"muted models-generated-at",children:["上次探测:",o]}):null]}),u.jsxs("details",{className:"models-raw-details",children:[u.jsx("summary",{children:"查看原始探测数据(调试)"}),u.jsx("pre",{className:"cmd models-raw-json",children:JSON.stringify(c,null,2)})]})]})}const jL=[{value:"requirements-changed",label:"需求已变更"},{value:"suspected-runaway",label:"疑似失控"},{value:"resource-protection",label:"保护资源"},{value:"operator-request",label:"操作者请求"},{value:"other",label:"其他"}];function H3(e){const{lane:t,cta:n,planSummary:a,reason:s,busy:o,confirmRef:c}=e;return!n||n.lane!==t?null:u.jsxs("div",{ref:c,className:"recovery-confirm","data-testid":"recovery-confirm",children:[u.jsxs("h3",{children:["待确认:",n.label]}),u.jsx("p",{className:"muted",children:n.id==="reconcile"?"破坏性对账需经浏览器 Human Gate 确认。请核对运行与原因后再点「确定」。":n.id==="interrupt"?"协作中止需经浏览器 Human Gate。原因已按当前运行预填,可改分类或编辑后再确定。提交只表示请求已登记,当前节点仍会跑完。":"核对上方运行 / 节点与恢复原因后直接执行;服务端会校验资格,不再走 Human Gate。"}),n.id==="interrupt"?u.jsxs("fieldset",{className:"recovery-reason-code","data-testid":"recovery-interrupt-reason-code",disabled:o,children:[u.jsx("legend",{children:"原因分类"}),u.jsx("div",{className:"recovery-reason-code-group",children:jL.map(d=>{const h=(e.reasonCode??"operator-request")===d.value;return u.jsxs("label",{className:h?"recovery-reason-code-option is-active":"recovery-reason-code-option",children:[u.jsx("input",{type:"radio",name:"recovery-interrupt-reason-code",value:d.value,checked:h,onChange:()=>e.onReasonCodeChange?.(d.value)}),d.label]},d.value)})})]}):null,a?u.jsxs("div",{className:"recovery-plan-summary",children:[u.jsxs("p",{className:"muted",children:["计划 eligible=",String(a.eligible??"—")," · 风险=",Y3[a.risk??""]??a.risk??"—"]}),a.effectiveFromNodeId?u.jsxs("p",{className:"muted",children:["有效起点:",a.effectiveFromNodeId]}):null,a.estimatedExecution?u.jsxs("p",{className:"muted",children:["将执行 ",a.estimatedExecution.nodeCount??"?"," 个节点 / ",a.estimatedExecution.piCallCount??"?"," 次 Pi;预计避免"," ",a.estimatedExecution.avoidedNodeCount??"?"," 个节点"]}):null,a.planHash?u.jsxs("p",{className:"muted",children:["planHash: ",u.jsxs("code",{children:[a.planHash.slice(0,16),"…"]})]}):null]}):n.id==="dagRerun"?u.jsx("p",{className:"muted",children:"未加载计划摘要;点「确定」前将再次尝试资格检查。"}):null,u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:o||!s.trim(),"data-testid":"recovery-confirm-submit",onClick:e.onSubmit,children:"确定"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:o,"data-testid":"recovery-confirm-cancel",onClick:e.onCancel,children:"取消"})]})]})}function LL(e){const{shell:t,recovery:n,wizard:a}=e,{busy:s}=t,o=v9({interruptStatus:n.interruptEligibility?.interruptStatus,dagStatus:n.recoveryRunStatus,failureCategory:n.recoveryFailureCategory,targetOperationState:n.interruptEligibility?.targetOperationState}),c={planSummary:n.recoveryPlanSummary,reason:n.recoveryReason,reasonCode:n.interruptReasonCode,onReasonCodeChange:n.setInterruptReasonCode,busy:s,confirmRef:n.recoveryConfirmRef,onSubmit:()=>{n.submitRecoveryConfirm()},onCancel:()=>{n.setRecoveryConfirm(null),n.setRecoveryPlanSummary(null)}};return u.jsxs("section",{className:"panel","aria-labelledby":"recovery-title",children:[u.jsx("h2",{id:"recovery-title",children:"恢复"}),u.jsxs("p",{className:"muted",children:["事实分类:",W3[n.recoveryFact]," · 无 Cancel · 无「直接改代码」"]}),n.frontendRecovery?u.jsxs("div",{className:"muted","data-testid":"frontend-recovery-lineage",style:{marginBottom:"0.75rem"},children:[u.jsxs("div",{children:["前端恢复:outcome=",u.jsx("code",{children:n.frontendRecovery.outcome??"—"})," phase=",u.jsx("code",{children:n.frontendRecovery.phase??"—"})]}),u.jsxs("div",{children:["root ",u.jsx("code",{children:n.frontendRecovery.recoveryRootRunId??"—"}),n.frontendRecovery.parentRunId?` · parent ${n.frontendRecovery.parentRunId}`:"",n.frontendRecovery.childRunId?` · child ${n.frontendRecovery.childRunId}`:"",n.frontendRecovery.attemptIndex!==void 0?` · attempt ${n.frontendRecovery.attemptIndex}`:""]})]}):null,u.jsxs("ol",{className:"muted recovery-steps",children:[u.jsx("li",{children:"上方选 DAG 运行 / 节点,用「DAG 运行恢复」动作"}),u.jsx("li",{children:"Worker 持有的失败 run 用下方「Worker Task 重排队」;独立 DAG run 无法从节点恢复时才用「带反馈重新执行任务」"}),u.jsx("li",{children:"带 * 的动作:核对预填原因后点「确定」。重跑/重试直接执行;对账与中止运行走 Human Gate"})]}),o?u.jsxs("p",{className:"muted","data-testid":"recovery-interrupt-status",children:["中止进度:",o]}):null,n.recoveryFact==="running-active"&&n.interruptEligibility&&!n.interruptEligibility.eligible&&(!n.interruptEligibility.interruptStatus||n.interruptEligibility.interruptStatus==="none")?u.jsx("p",{className:"muted","data-testid":"recovery-interrupt-unavailable",children:n.interruptEligibility.ownerKind==="worker-managed"?"此运行不由当前 Console 持有,暂不支持协作中止。请用 Doctor / 报告查看。":n.interruptEligibility.message??"当前运行不具备协作中止资格。"}):null,u.jsxs("p",{className:"muted",children:[a.taskId.trim()?`按任务 ${a.taskId.trim()} 拉取候选。`:"未填任务 ID 时列出最近 DAG 运行。","Doctor 诊断可选,不是重跑前置。"," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s||n.recoveryRunsLoading,"data-testid":"recovery-refresh-candidates",onClick:()=>{n.loadRecoveryRuns()},children:n.recoveryRunsLoading?"刷新中…":"刷新候选"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"DAG 运行 ID"}),!n.manualRunId&&n.recoveryRuns.length>0?u.jsxs("select",{"data-testid":"recovery-run-select",value:n.dagRunId,disabled:s||n.recoveryRunsLoading,onChange:d=>{n.setManualRunId(!1),n.setManualNodeId(!1),n.setFromNodeId(""),n.setDagRunId(d.target.value),n.recoveryReasonTouched||n.setRecoveryReasonTouched(!1)},children:[n.recoveryRuns.some(d=>d.dagRunId===n.dagRunId)?null:u.jsx("option",{value:n.dagRunId||"",children:n.dagRunId?`${n.dagRunId}(当前)`:"— 请选择 —"}),n.recoveryRuns.map(d=>u.jsx("option",{value:d.dagRunId,children:N9(d)},d.dagRunId))]}):u.jsx("input",{"data-testid":"recovery-run-input",value:n.dagRunId,disabled:s,onChange:d=>{n.setManualRunId(!0),n.setDagRunId(d.target.value.trim())},placeholder:"dag-run-id(节点恢复/完整重新执行)"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-run-manual-toggle",onClick:()=>{if(!n.manualRunId&&n.recoveryRuns.length>0){n.setManualRunId(!0);return}n.setManualRunId(!1),n.loadRecoveryRuns()},children:!n.manualRunId&&n.recoveryRuns.length>0?"手动输入运行 ID":"刷新并改用下拉"})]}),u.jsxs("label",{className:"field",children:[u.jsxs("span",{className:"muted",children:["起始节点 ID(从失败节点恢复)",n.recoveryNodesLoading?" · 加载节点…":""]}),!n.manualNodeId&&n.recoveryNodes.length>0?u.jsxs("select",{"data-testid":"recovery-node-select",value:n.fromNodeId,disabled:s||n.recoveryNodesLoading,onChange:d=>{n.setManualNodeId(!1),n.setFromNodeId(d.target.value)},children:[n.recoveryNodes.some(d=>d.nodeId===n.fromNodeId)?null:u.jsx("option",{value:n.fromNodeId||"",children:n.fromNodeId?`${n.fromNodeId}(当前)`:"— 请选择 —"}),n.recoveryNodes.map(d=>u.jsx("option",{value:d.nodeId,children:A9(d)},d.nodeId))]}):u.jsx("input",{"data-testid":"recovery-node-input",value:n.fromNodeId,disabled:s,onChange:d=>{n.setManualNodeId(!0),n.setFromNodeId(d.target.value.trim())},placeholder:"例如 review-verdict-recovery-pi"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-node-manual-toggle",onClick:()=>{if(!n.manualNodeId&&n.recoveryNodes.length>0){n.setManualNodeId(!0);return}n.setManualNodeId(!1),n.loadRecoveryNodes(n.dagRunId)},children:!n.manualNodeId&&n.recoveryNodes.length>0?"手动输入节点 ID":"刷新并改用下拉"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"恢复原因(已按 run/节点失败事实自动预填,可编辑)"}),u.jsx("textarea",{"data-testid":"recovery-reason",value:n.recoveryReason,disabled:s,rows:4,onChange:d=>{n.setRecoveryReasonTouched(!0),n.setRecoveryReason(d.target.value)},placeholder:"将自动预填 operator-recovery / run / from-node / detail"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-reason-refresh",onClick:()=>{n.setRecoveryReasonTouched(!1),n.setRecoveryReason(n.buildCurrentRecoveryReason(n.recoveryConfirm?.label))},children:"重新预填原因"})]}),u.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-dag",children:[u.jsx("h3",{children:"DAG 运行恢复"}),u.jsx("p",{className:"muted",children:"针对 `.harness/dag-runs` 的 Agent DAG 运行。橙色为当前建议;带 * 需确认原因。"}),u.jsxs("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-dag",children:[n.recoveryLanes.dag.map(d=>{const h=d.id===n.recommendedCtaId;return u.jsxs("button",{type:"button",className:h?"btn btn-primary":"btn btn-secondary",disabled:s,title:d.guide,"aria-pressed":n.recoveryConfirm?.id===d.id?!0:void 0,"data-testid":`recovery-cta-${d.id}`,"data-recommended":h?"true":void 0,onClick:()=>{n.handleRecoveryCta(d)},children:[d.label,d.requiresReason?" *":""]},d.id)}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!n.dagRunId.trim(),"data-testid":"recovery-dag-preview",title:"在本页侧栏预览,可关闭返回",onClick:()=>{if(!n.dagRunId.trim()){t.setOpError("侧栏预览需要先选择 DAG 运行 ID");return}n.setInspectSplitOpen(!0)},children:"侧栏预览"})]}),n.recoveryReport?u.jsxs("div",{className:"recovery-report","data-testid":"recovery-report",children:[u.jsxs("div",{className:"recovery-report-header",children:[u.jsx("h3",{children:"交接报告摘要"}),u.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"recovery-report-close",onClick:()=>n.setRecoveryReport(null),children:"关闭"})]}),u.jsxs("dl",{className:"recovery-report-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"运行"}),u.jsx("dd",{children:u.jsx("code",{children:n.recoveryReport.runId})})]}),n.recoveryReport.title?u.jsxs("div",{children:[u.jsx("dt",{children:"标题"}),u.jsx("dd",{children:n.recoveryReport.title})]}):null,u.jsxs("div",{children:[u.jsx("dt",{children:"状态"}),u.jsx("dd",{children:n.recoveryReport.status??"—"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"失败分类"}),u.jsx("dd",{children:n.recoveryReport.category??"—"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"建议"}),u.jsx("dd",{children:n.recoveryReport.recommendation??"暂无结构化建议"})]})]}),u.jsxs("p",{className:"muted",children:["完整 Markdown 可用 CLI:",u.jsxs("code",{children:["loop-agent dag report --run-id"," ",n.recoveryReport.runId," --markdown"]})]})]}):null,u.jsx(H3,{lane:"dag",cta:n.recoveryConfirm,...c})]}),u.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-worker",children:[u.jsx("h3",{children:"Worker Task 重排队"}),u.jsx("p",{className:"muted",children:"针对 agent-worker Task Pool,不是 DAG run。需要 Task ID;Feature ID 可选。"}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"Task ID(Worker 重排队必填)"}),u.jsx("input",{"data-testid":"recovery-worker-task-id",value:a.taskId,disabled:s,onChange:d=>a.setTaskId(d.target.value.trim()),placeholder:"harness / worker task-id"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"Feature ID(可选)"}),u.jsx("input",{"data-testid":"recovery-feature-id",value:n.featureId,disabled:s,onChange:d=>n.setFeatureId(d.target.value.trim()),placeholder:"feature-id"})]}),u.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-worker",children:n.recoveryLanes.worker.length>0?n.recoveryLanes.worker.map(d=>u.jsxs("button",{type:"button",className:d.id===n.recommendedCtaId?"btn btn-primary":"btn btn-secondary",disabled:s,title:d.guide,"data-testid":`recovery-cta-${d.id}`,"data-recommended":d.id===n.recommendedCtaId?"true":void 0,onClick:()=>{n.handleRecoveryCta(d)},children:[d.label,d.requiresReason?" *":""]},d.id)):u.jsx("p",{className:"muted","data-testid":"recovery-worker-unavailable",children:"当前事实分类下不提供 Worker 重排队。"})}),u.jsx(H3,{lane:"worker",cta:n.recoveryConfirm,...c})]}),u.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row",hidden:!0,children:n.recoveryCtas.map(d=>u.jsx("span",{children:d.id},d.id))}),n.observeLinkMessage?u.jsxs("p",{className:"muted",children:["[",Ow[n.observeLinkStatus],"]"," ",n.observeLinkMessage]}):null,n.observeUrl?u.jsx("p",{className:"muted",children:u.jsx("a",{className:"external-link",href:n.observeUrl,children:n.observeUrl})}):null]})}function zL(e){const{health:t,readiness:n,healthError:a,layers:s,setupBlocked:o,degraded:c}=e;return u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"panel","aria-labelledby":"settings-title",children:[u.jsx("h2",{id:"settings-title",children:"设置"}),u.jsxs("dl",{className:"kv",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"产品"}),u.jsx("dd",{children:t?.productName??"Loop Operator Console"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"仓库根目录"}),u.jsx("dd",{children:u.jsx("code",{children:t?.repoRoot??"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"仓库指纹"}),u.jsx("dd",{children:u.jsx("code",{title:t?.repoFingerprint??void 0,children:t?.repoFingerprint?`${t.repoFingerprint.slice(0,12)}…`:"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Pi 就绪"}),u.jsxs("dd",{children:[u.jsxs("code",{children:[K3[n]??n,"(",n,")"]}),o?u.jsx("p",{className:"muted",children:"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。请前往「模型与认证」。"}):c?u.jsx("p",{className:"muted",children:"Pi 暂时降级:仍可恢复草稿与需求访谈。"}):null]})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Inspect"}),u.jsxs("dd",{children:[u.jsx("code",{children:"/inspect/"}),"(同一 Console 进程)"]})]})]}),a?u.jsx("p",{className:"error",children:a}):null]}),u.jsxs("section",{className:"panel","aria-labelledby":"layers-title",children:[u.jsx("h2",{id:"layers-title",children:"完成语义分层"}),u.jsx("p",{className:"muted",children:"MVP 不执行收尾提交;不显示「任务已关闭/已交付」。"}),u.jsxs("dl",{className:"kv","data-testid":"completion-layers",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"命令"}),u.jsx("dd",{children:bu(s.command)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"DAG 生命周期"}),u.jsx("dd",{children:bu(s.dag)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"最终验证"}),u.jsx("dd",{children:bu(s.verification)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"晋升"}),u.jsx("dd",{children:bu(s.promote)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"任务关闭"}),u.jsx("dd",{children:"不可用(MVP)"})]})]})]})]})}function BL(e){const t=(e??"").trim().toLowerCase();return t?t.includes("running")||t==="in_progress"||t==="active"?"running":t.includes("fail")||t.includes("error")||t==="blocked"?"failed":t.includes("finish")||t.includes("success")||t==="done"||t==="ok"?"finished":t.includes("skip")?"skipped":"pending":"pending"}function qL(e){const t=String(e.nodeId??e.id??"").trim();return{nodeId:t,label:String((e.label??e.name??t)||"未命名节点"),status:String(e.status??""),rank:typeof e.rank=="string"?e.rank:void 0,startedAt:typeof e.startedAt=="string"?e.startedAt:void 0,durationMs:typeof e.durationMs=="number"?e.durationMs:void 0,errorPreview:typeof e.errorPreview=="string"?e.errorPreview:void 0}}function Lm(e,t){if(!e)return null;const n=Date.parse(e);if(Number.isNaN(n))return null;const a=t-n;return a>=0?a:null}function HL(e,t=Date.now()){if(!e)return{total:0,finished:0,running:null,failed:null,terminal:!1,effectiveStatus:null,stalled:!1,currentNodeElapsedMs:null,runElapsedMs:null};const a=(Array.isArray(e.nodes)?e.nodes:[]).map(qL),s=a.map(S=>BL(S.status)),o=s.filter(S=>S==="finished"||S==="skipped").length,c=s.indexOf("running"),d=c>=0?a[c]:null,h=s.indexOf("failed"),m=h>=0?a[h]:null,p=String(e.effectiveStatus??e.status??"").toLowerCase(),g=UL.has(p),x=typeof e.startedAt=="string"?e.startedAt:void 0,v=typeof e.durationMs=="number"?e.durationMs:void 0;return{total:a.length,finished:o,running:d,failed:m,terminal:g,effectiveStatus:p||null,stalled:p==="running-suspected-stall",currentNodeElapsedMs:d?.durationMs??Lm(d?.startedAt,t),runElapsedMs:g?v??Lm(x,t):Lm(x,t)}}const UL=new Set(["finished","failed","partial_failed","superseded","abandoned"]);function U3(e){if(e==null||!Number.isFinite(e)||e<0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60;return n>0?`${n} 时 ${a} 分`:a>0?`${a} 分 ${s} 秒`:`${s} 秒`}const FL=5e3;function $L(e){const[t,n]=w.useState(null);return w.useEffect(()=>{const a=e.trim();if(n(null),!a)return;const s=new AbortController;let o;const c=async()=>{try{const d=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(a)}`),{credentials:"same-origin",signal:s.signal});if(!d.ok)return;const h=await d.json();if(s.signal.aborted)return;n(h),qm(h)&&o!==void 0&&(window.clearInterval(o),o=void 0)}catch{}};return c(),o=window.setInterval(()=>{c()},FL),()=>{s.abort(),o!==void 0&&window.clearInterval(o)}},[e]),w.useMemo(()=>HL(t),[t])}function PL(e){const t=[`fragments=${e.fragmentCount}`,`canonical=${e.canonicalRequirementCount}`,`context-only=${e.contextOnlyCount}`,`duplicate=${e.duplicateCount}`,`unresolved=${e.unresolvedCount}`,`conflict=${e.conflictCount}`];return e.bindingSchemaVersion===2&&(t.push(`binding=v2${e.stale?" · STALE(输入漂移)":""}`),e.ledgerSha256&&t.push(`ledgerSha256=${e.ledgerSha256}`),e.inputDigest&&t.push(`inputDigest=${e.inputDigest}`)),t.join(" ")}function Ip(e){const{ledgerLoading:t=!1,ledgerError:n=null,ledgerSummary:a=null}=e;return u.jsxs("div",{className:"contract-checks","data-testid":"ledger-summary-block","aria-busy":t||void 0,"aria-labelledby":"ledger-summary-heading",children:[u.jsx("h4",{id:"ledger-summary-heading",children:"Source fidelity ledger"}),t?u.jsxs("p",{className:"muted",role:"status",children:[u.jsx("span",{className:"sr-only",children:"ledger 加载中"}),"加载中…"]}):n?u.jsxs("p",{className:"muted",role:"alert",children:["ledger 只读接口失败:",n,"(安全降级,不展示敏感内容)"]}):!a||a.present!==!0?u.jsx("p",{className:"empty",role:"status",children:"无 source fidelity ledger(任务无引用或 ledger 缺失,不伪造计数)"}):u.jsxs(u.Fragment,{children:[u.jsxs("p",{children:[u.jsx("strong",{children:"gate"}),": ",Aw(a.gateStatus),a.bindingSchemaVersion===2?u.jsxs(u.Fragment,{children:[" ",u.jsxs("code",{"data-testid":"ledger-binding-version",children:["binding v2",a.stale?" · STALE":""]})]}):null,a.failureCode?u.jsxs(u.Fragment,{children:[" ",u.jsx("code",{"data-testid":"ledger-failure-code",children:a.failureCode})]}):null]}),u.jsx("pre",{className:"cmd","data-testid":"ledger-summary",children:PL(a)}),a.exclusions.length>0?u.jsx("ul",{"data-testid":"ledger-exclusions",children:a.exclusions.slice(0,10).map(s=>u.jsxs("li",{className:"muted",children:[u.jsx("code",{children:s.fragmentId}),": ",s.reason]},s.fragmentId))}):null]})]})}function GL(e){const{busy:t,taskId:n,confirmationId:a,confirmationDetails:s,ledgerLoading:o=!1,ledgerError:c=null,ledgerSummary:d=null,runAction:h,onConfirmAndRun:m}=e;return u.jsxs("div",{"data-testid":"panel-dag-confirm",children:[u.jsx("h3",{children:"DAG 确认(§5.5)"}),u.jsxs("ul",{className:"checklist",children:[u.jsx("li",{children:"源绑定(source)"}),u.jsx("li",{children:"Writer 写集范围(writer-scope)"}),u.jsx("li",{children:"验证命令(verification)"}),u.jsx("li",{children:"人工门禁(human-gates)"})]}),s?u.jsx("pre",{className:"cmd",children:JSON.stringify(s,null,2).slice(0,4e3)}):null,u.jsx(Ip,{ledgerLoading:o,ledgerError:c,ledgerSummary:d}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:()=>{h("prepareDagConfirmation",{taskId:n,dagHandle:`${n}.dag.json`,profile:"auto"})},children:"生成 DAG 并准备确认"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!a,onClick:m,children:"开始运行"})]}),a?u.jsxs("p",{className:"muted",children:["确认 ID: ",u.jsx("code",{children:a})]}):null]})}function VL(e){const{busy:t,degraded:n,taskId:a,assessmentId:s,contractValidateOk:o,contractValidateSummary:c,contractDiffSummary:d,contractApplied:h,spineOk:m,ledgerLoading:p=!1,ledgerError:g=null,ledgerSummary:x=null,onRerunPreflight:v,onApplyContract:S,onRetrySpine:T}=e;return u.jsxs("div",{"data-testid":"panel-contract",children:[u.jsx("h3",{children:"契约落地"}),u.jsx("p",{className:"muted",children:"进入本步后自动跑确定性校验与差异(非 AI 代判)。写入仓库仍需你人工确认一次;应用成功后会自动跑 Spine 审计。"}),u.jsxs("p",{className:"muted",children:["评估 ID: ",u.jsx("code",{children:s??"—"})]}),u.jsxs("div",{className:"contract-checks",children:[u.jsxs("p",{children:[u.jsx("strong",{children:"校验"}),":"," ",o===null?t?"进行中…":"等待开始":o?"通过":"未通过"]}),c?u.jsx("pre",{className:"cmd","data-testid":"contract-validate-summary",children:c}):null,u.jsxs("p",{children:[u.jsx("strong",{children:"差异"}),d?"":":尚未拉取"]}),d?u.jsx("pre",{className:"cmd","data-testid":"contract-diff-summary",children:d}):null,h?u.jsxs("p",{children:[u.jsx("strong",{children:"Spine"}),":"," ",m===null?"待检查":m?"通过":"未通过"]}):null]}),u.jsx(Ip,{ledgerLoading:p,ledgerError:g,ledgerSummary:x}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:t||!a.trim(),onClick:v,children:"重新校验"}),u.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"contract-apply",disabled:t||n||!s||o!==!0||h,onClick:S,children:"确认并应用契约"}),h&&m===!1?u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:T,children:"重试 Spine"}):null]})]})}function KL(e){const{busy:t,taskKind:n,onTaskKindChange:a,workflowHint:s,prd:o,engineering:c,onEngineeringChange:d,onImport:h}=e,m=t||o.prdFileReading;return u.jsxs("div",{"data-testid":"panel-import-prd",children:[u.jsx("h3",{children:"导入需求"}),u.jsx("p",{className:"muted",children:"粘贴、选择或拖入一份或多份 PRD / 需求 Markdown。多文件会分别归档到 source/references,并合成一份可编辑正文。创建前可继续编辑。 系统会对 PRD 做确定性/语义结构化;工程边界(路径与验证)须人类确认,不会由模型编造。"}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"流程类型"}),u.jsx("select",{"data-testid":"workflow-kind-select",value:n,disabled:t||o.prdFileReading,onChange:p=>a(p.target.value),children:Bm.map(p=>u.jsx("option",{value:p.kind,children:p.label},p.kind))})]}),u.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-hint",children:[s," · taskKind=",u.jsx("code",{children:n})]}),u.jsxs("div",{className:`prd-drop-zone${o.prdDragOver?" is-dragover":""}`,"data-testid":"prd-drop-zone","data-dragover":o.prdDragOver?"true":"false",onDragEnter:p=>o.onDragEnter(p,m),onDragOver:p=>{p.preventDefault(),p.stopPropagation()},onDragLeave:o.onDragLeave,onDrop:p=>o.onDrop(p,m),children:[u.jsxs("div",{className:"prd-upload-toolbar",children:[u.jsxs("label",{className:`btn btn-ghost prd-upload-btn${m?" is-disabled":""}`,children:["选择需求文档",u.jsx("input",{type:"file",accept:t9,multiple:!0,hidden:!0,disabled:m,"data-testid":"prd-file-input",onChange:p=>{const g=p.currentTarget;o.loadPrdFromFiles(g.files).finally(()=>{g.value=""})}})]}),u.jsxs("span",{className:"muted prd-upload-hint",children:["支持多文件 .md / .markdown / .txt,单文件最大"," ",Um(Hm),",最多 ",Wu," 个"]}),o.prdDocuments.length>0?u.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"prd-recompose",disabled:m,onClick:o.recomposeDocuments,children:"按文件重新合成"}):null]}),o.prdDocuments.length>0?u.jsx("ul",{className:"prd-file-list","data-testid":"prd-file-list",children:o.prdDocuments.map((p,g)=>u.jsxs("li",{className:g===o.prdPrimaryIndex?"is-primary":void 0,"data-testid":`prd-file-item-${g}`,children:[u.jsxs("span",{className:"prd-file-item-name",children:[p.fileName,g===o.prdPrimaryIndex?u.jsx("span",{className:"prd-file-primary-tag",children:"主"}):null,u.jsxs("span",{className:"muted",children:[" ","· ",Um(p.sourceBytes)]})]}),u.jsxs("span",{className:"prd-file-item-actions",children:[u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:m||g===o.prdPrimaryIndex,onClick:()=>o.setPrimaryDocument(g),children:"设为主"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:m||g===0,onClick:()=>o.moveDocument(g,-1),children:"上移"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:m||g===o.prdDocuments.length-1,onClick:()=>o.moveDocument(g,1),children:"下移"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:m,onClick:()=>o.removeDocument(g),children:"移除"})]})]},`${p.fileName}-${g}`))}):null,o.prdDocuments.length>0?u.jsxs("div",{className:"prd-file-meta",children:[u.jsxs("span",{children:["分卷=上传原件(将分别归档);正文=本会话采用稿",o.prdComposedDirty?"(已手动编辑)":""]}),u.jsx("button",{type:"button",className:"btn btn-ghost prd-file-clear","data-testid":"prd-file-clear",disabled:m,onClick:o.clearDocuments,children:"清除来源列表"})]}):null,o.prdDragOver?u.jsx("p",{className:"prd-drop-hint","data-testid":"prd-drop-hint",children:"释放以载入"}):null,u.jsxs("label",{className:"field prd-text-field",children:[u.jsx("span",{className:"muted",children:"PRD Markdown"}),u.jsx("textarea",{rows:10,value:o.prdText,disabled:m,"data-testid":"prd-textarea",onChange:p=>o.onPrdTextChange(p.target.value)})]})]}),o.prdFileError?u.jsx("p",{className:"prd-file-error",role:"alert","aria-live":"polite","data-testid":"prd-file-error",children:o.prdFileError}):null,u.jsxs("details",{className:"engineering-boundary","data-testid":"engineering-boundary",children:[u.jsx("summary",{children:"工程边界(可选,人类确认)"}),u.jsxs("p",{className:"muted",children:["逗号或换行分隔。留空则 intake 后进入访谈补齐;不会自动填",u.jsx("code",{children:"src/worker/console/**"})," 模板。"]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"allowedPaths"}),u.jsx("textarea",{rows:2,value:c.allowedPathsText,disabled:m,"data-testid":"prd-allowed-paths",placeholder:"src/**, test/**",onChange:p=>d({allowedPathsText:p.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"forbiddenPaths"}),u.jsx("textarea",{rows:2,value:c.forbiddenPathsText,disabled:m,"data-testid":"prd-forbidden-paths",placeholder:".harness/**, node_modules/**",onChange:p=>d({forbiddenPathsText:p.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"verifyCommands(label:command 或纯命令)"}),u.jsx("textarea",{rows:2,value:c.verifyCommandsText,disabled:m,"data-testid":"prd-verify-commands",placeholder:"typecheck:npm run typecheck",onChange:p=>d({verifyCommandsText:p.target.value})})]})]}),u.jsx("div",{className:"cta-row",children:u.jsxs("button",{type:"button",className:`btn btn-primary${t?" is-loading":""}`,disabled:t||o.prdFileReading||!o.prdText.trim(),"aria-busy":t||void 0,onClick:h,children:[t?u.jsx("span",{className:"spinner","aria-hidden":"true"}):null,t?"导入中…":"导入并创建任务"]})})]})}function YL(e){const{busy:t,taskId:n,taskTitle:a,taskKind:s,sessionId:o,question:c,answerText:d,onAnswerTextChange:h,draftSummary:m,assessmentId:p,runAction:g}=e;return u.jsxs("div",{"data-testid":"panel-interview",children:[u.jsx("h3",{children:"需求访谈(grill-me)"}),u.jsx("p",{className:"muted",children:"一次一问;也可跳过:系统会按推荐补齐草稿并签发评估,随后进入校验。 访谈中不可应用契约 / 运行 DAG / 对账。"}),m?u.jsx("pre",{className:"cmd","data-testid":"draft-summary",children:JSON.stringify(m,null,2)}):null,u.jsxs("div",{className:"cta-row",style:{marginBottom:"0.75rem"},children:[!o||!c?u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!n.trim(),onClick:()=>{g("interviewStart",{taskId:n,title:a,taskKind:s})},children:"开始 / 继续访谈"}):null,u.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"interview-skip",disabled:t||!n.trim(),onClick:()=>{g("interviewSkip",{taskId:n,title:a,taskKind:s})},children:"跳过访谈"})]}),o&&c?u.jsxs("div",{className:"interview-card",children:[u.jsxs("p",{className:"interview-q",children:[u.jsx("strong",{children:c.id})," · 风险=",Y3[c.risk??""]??c.risk??"—"]}),u.jsx("p",{children:c.text}),c.recommendation?u.jsxs("p",{className:"muted",children:["推荐:",c.recommendation]}):null,u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"你的回答(覆盖推荐)"}),u.jsx("textarea",{rows:3,value:d,disabled:t,onChange:x=>h(x.target.value)})]}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:()=>{g("interviewTurn",{sessionId:o,questionId:c.id,response:"accept-recommendation"}).then(()=>h(""))},children:"接受推荐"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!d.trim(),onClick:()=>{g("interviewTurn",{sessionId:o,questionId:c.id,response:"override",text:d}).then(()=>h(""))},children:"提交自定义回答"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:t||c.risk==="high",onClick:()=>{g("interviewTurn",{sessionId:o,questionId:c.id,response:"defer",text:d||c.recommendation}).then(()=>h(""))},children:"暂缓(非高风险)"})]})]}):null,p?u.jsxs("p",{className:"muted",children:["评估 ID: ",u.jsx("code",{children:p})]}):null]})}function WL({progress:e}){const t=e.total>0?Math.round(e.finished/e.total*100):0;return u.jsxs("div",{className:"run-progress","data-testid":"run-progress",children:[u.jsxs("div",{className:"run-progress-head",children:[u.jsxs("b",{children:["节点进度 ",e.finished,"/",e.total||"—",e.total>0?`(${t}%)`:""]}),u.jsx("span",{className:`run-progress-status${e.stalled?" is-stalled":""}`,"data-testid":"run-progress-status",children:e.effectiveStatus??"未知状态"})]}),u.jsx("div",{className:"run-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":e.total,"aria-valuenow":e.finished,"aria-label":"DAG 节点完成进度",children:u.jsx("span",{style:{width:`${t}%`}})}),u.jsx("p",{className:"run-progress-current","data-testid":"run-progress-current",children:e.running?u.jsxs(u.Fragment,{children:["当前节点:",u.jsx("strong",{children:e.running.label}),"(已运行 ",U3(e.currentNodeElapsedMs),")"]}):e.terminal?u.jsxs(u.Fragment,{children:["运行已结束(总时长 ",U3(e.runElapsedMs),")"]}):u.jsx(u.Fragment,{children:"暂无正在运行的节点"})}),e.stalled?u.jsx("p",{className:"run-progress-stall","data-testid":"run-progress-stall",children:"疑似停滞:超过阈值没有实质进展。可打开检视查看节点活动,或到恢复页 使用协作中止 / 诊断入口判断是否继续等待。"}):null,e.failed?u.jsxs("p",{className:"run-progress-failed","data-testid":"run-progress-failed",children:["失败节点:",u.jsx("strong",{children:e.failed.label}),e.failed.errorPreview?` — ${e.failed.errorPreview}`:""]}):null]})}function ZL(e){const{busy:t,confirmationId:n,operationId:a,dagRunId:s,observeBusy:o,ledgerLoading:c=!1,ledgerError:d=null,ledgerSummary:h=null,sseLog:m,progress:p,runAction:g,onStopFollow:x,onShowInspectSplit:v,onOpenInspectSplit:S}=e;return u.jsxs("div",{"data-testid":"panel-run",children:[u.jsx("h3",{children:"运行详情"}),u.jsxs("div",{className:"meta-row",children:[u.jsxs("div",{children:["操作 ID: ",u.jsx("code",{children:a??"—"})]}),u.jsxs("div",{children:["确认 ID: ",u.jsx("code",{children:n??"—"})]})]}),u.jsx(Ip,{ledgerLoading:c,ledgerError:d,ledgerSummary:h}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!n,onClick:()=>{g("runDag",{confirmationId:n},{clientRequestId:Vu("run")})},children:"重新运行"}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:x,children:"停止跟随日志"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!s.trim(),onClick:v,children:"打开检视"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:o||!s.trim(),title:"在本页侧栏预览当前运行的 DAG,可关闭返回",onClick:S,children:"侧栏预览"})]}),p?u.jsx(WL,{progress:p}):null,u.jsxs("details",{className:"run-sse-log",children:[u.jsx("summary",{children:"原始事件日志(最近 80 条)"}),u.jsx("pre",{className:"cmd","data-testid":"sse-log",children:m.join(`
407
- `)||"(尚无事件)"})]})]})}const cx=[2e3,2e3,4e3,4e3,8e3,8e3,15e3,15e3,3e4,3e4];function XL(e,t){if(e===!0)return{kind:"own"};if(e===!1)return{kind:"clear"};const n=cx[t];return n===void 0?{kind:"give-up"}:{kind:"retry",delayMs:n}}cx.reduce((e,t)=>e+t,0);function QL(){return{baseline:null,ownedRunId:"",pendingSelection:""}}function JL(e,t){const n=e.task===void 0,a=!n&&e.task!==t.task,s=!n&&e.dispatch!==t.dispatchId,o={...e,task:t.task,dispatch:t.dispatchId,pendingSelection:""};if(a)return o.baseline=null,o.ownedRunId="",{state:o,observation:{action:"reset-selection"}};if(s&&(o.ownedRunId="",t.selectedRunId))return o.baseline=t.selectedRunId,{state:o,observation:{action:"invalidate-selection"}};const c=t.selectedRunId;return c&&c!==o.ownedRunId?(o.pendingSelection=c,{state:o,observation:{action:"verify-ownership"}}):{state:o,observation:{action:c?"idle":"probe"}}}function F3(e){return{...e,baseline:null}}function ez(e,t){return{...e,baseline:t??""}}function tz(e,t){return!t.ok||!t.dagRunId?{state:e,acceptedRunId:null}:e.baseline===null||t.dagRunId===e.baseline?{state:e,acceptedRunId:null}:{state:{...e,ownedRunId:t.dagRunId},acceptedRunId:t.dagRunId}}function nz(e,t){return t?{state:{...e,ownedRunId:e.pendingSelection,pendingSelection:""},clearSelection:!1}:{state:{...e,ownedRunId:"",pendingSelection:"",baseline:null},clearSelection:!0}}async function $3(e){try{const{status:t,body:n}=await zl("observeLink",{taskId:e});if(t>=400||n.ok===!1)return{ok:!1};const a=n.result??{};return{ok:!0,dagRunId:(typeof a.dagRunId=="string"?a.dagRunId.trim():"")||null}}catch{return{ok:!1}}}async function rz(e,t){try{const n=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(e)}`),{credentials:"same-origin"});if(n.status===404)return!1;if(!n.ok)return null;const a=await n.json(),s=typeof a.taskId=="string"?a.taskId.trim():"";return s?s===t.trim():null}catch{return null}}function az(e){const{shell:t,actions:n,wizard:a,prd:s,recovery:o}=e,{busy:c,step:d,setupBlocked:h,degraded:m}=t,p=w.useRef(QL()),g=w.useRef(0),[x,v]=w.useState(""),S=w.useCallback(R=>{const O=++g.current;p.current=F3(p.current);const _=async P=>{const U=await $3(R);if(g.current===O){if(U.ok){p.current=ez(p.current,U.dagRunId);return}P>0&&window.setTimeout(()=>{_(P-1)},1500)}};_(8)},[]);w.useEffect(()=>{if(d!=="dag-confirm")return;const R=a.taskId.trim();if(!R){g.current+=1,p.current=F3(p.current);return}S(R)},[d,a.taskId,S]),w.useEffect(()=>{if(d!=="run")return;const R=a.taskId.trim();if(!R)return;const O=JL(p.current,{task:R,dispatchId:n.operationId??null,selectedRunId:o.dagRunId.trim()});switch(p.current=O.state,v(O.state.ownedRunId),O.observation.action){case"reset-selection":{o.setManualRunId(!1),o.setDagRunId(""),S(R);return}case"invalidate-selection":{o.setManualRunId(!1),o.setDagRunId("");return}case"verify-ownership":{const _=O.state.pendingSelection;let P=!1,U=0;const A=async z=>{if(P)return;const X=await rz(_,R);if(P)return;const H=XL(X,z);if(H.kind==="own"||H.kind==="clear"){const $=nz(p.current,H.kind==="own");p.current=$.state,v($.state.ownedRunId),$.clearSelection&&(o.setManualRunId(!1),o.setDagRunId(""),S(R));return}H.kind==="retry"&&(U=window.setTimeout(()=>{A(z+1)},H.delayMs))};return A(0),()=>{P=!0,window.clearTimeout(U)}}case"idle":return;case"probe":{p.current.baseline===null&&S(R);let _=!1,P=0,U=0;const A=async()=>{if(_)return;if(p.current.baseline===null){U+=1,U<120&&(P=window.setTimeout(()=>{A()},1e3));return}const z=await $3(R);if(_)return;U+=1;const X=tz(p.current,z);if(p.current=X.state,X.acceptedRunId){v(X.state.ownedRunId),o.setManualRunId(!0),o.setDagRunId(X.acceptedRunId);return}U<120&&(P=window.setTimeout(()=>{A()},2500))};return P=window.setTimeout(()=>{A()},1200),()=>{_=!0,window.clearTimeout(P)}}}},[d,n.operationId,a.taskId,o.dagRunId,o.setManualRunId,o.setDagRunId,S]);const T=o.dagRunId===x?o.dagRunId:"",N=$L(d==="run"?T:"");return u.jsxs("section",{className:"panel task-ops","aria-labelledby":"task-ops-title",children:[u.jsx("h2",{id:"task-ops-title",children:"任务操作"}),u.jsx("p",{className:"panel-lead",children:"按 Happy Path 推进;契约落地一步内自动校验,人工确认写入。"}),u.jsx("ol",{className:"wizard-steps","data-testid":"wizard-steps",children:a.wizardSteps.map((R,O)=>u.jsxs("li",{"data-active":d===R.id,"data-done":O<a.stepIndex,children:[u.jsx("span",{className:"step-index",children:String(O+1).padStart(2,"0")}),u.jsx("span",{className:"step-label",children:R.label})]},R.id))}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"任务 ID"}),u.jsx("input",{"data-testid":"task-id-input",value:a.taskId,disabled:c||h||d==="import-prd",placeholder:d==="import-prd"?"导入需求后自动生成":"task-id",onChange:R=>a.setTaskId(R.target.value.trim())})]}),a.taskTitle?u.jsxs("p",{className:"workflow-hint","data-testid":"task-title-chip",children:["任务名称:",a.taskTitle]}):null,d!=="import-prd"&&!h?u.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-chip",children:["当前流程:",a.workflowMeta.label," ·"," ",u.jsx("code",{children:a.taskKind})]}):null,h||d==="setup"?u.jsxs("div",{className:"empty-state","data-testid":"setup-gate",children:[u.jsx("p",{className:"empty-title",children:"需要先完成设置"}),u.jsx("p",{className:"muted",children:"请先在「模型与认证」完成 Pi 就绪,再导入需求与访谈。"}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:c,onClick:()=>{t.selectNav("models"),n.runAction("refreshReadiness",{}).then(()=>t.loadHealth())},children:"刷新就绪状态"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:c,onClick:()=>{n.runAction("doctor",{})},children:"运行诊断"}),u.jsx("pre",{className:"cmd",children:V3})]})]}):u.jsxs("div",{className:"wizard-body","data-testid":"wizard-body",children:[d==="import-prd"&&u.jsx(KL,{busy:c,taskKind:a.taskKind,onTaskKindChange:a.setTaskKind,workflowHint:a.workflowMeta.hint,prd:s,engineering:a.engineering,onEngineeringChange:a.setEngineering,onImport:()=>{a.importPrdAndCreate()}}),d==="interview"&&u.jsx(YL,{busy:c,taskId:a.taskId,taskTitle:a.taskTitle,taskKind:a.taskKind,sessionId:a.sessionId,question:a.question,answerText:a.answerText,onAnswerTextChange:a.setAnswerText,draftSummary:a.draftSummary,assessmentId:a.assessmentId,runAction:n.runAction}),d==="contract"&&u.jsx(VL,{busy:c,degraded:m,taskId:a.taskId,assessmentId:a.assessmentId,contractValidateOk:a.contractValidateOk,contractValidateSummary:a.contractValidateSummary,contractDiffSummary:a.contractDiffSummary,contractApplied:a.contractApplied,spineOk:a.spineOk,ledgerLoading:a.ledgerLoading,ledgerError:a.ledgerError,ledgerSummary:a.ledgerSummary,onRerunPreflight:()=>{a.runContractPreflight(!0)},onApplyContract:()=>{a.applyContractThenSpine()},onRetrySpine:()=>{a.retrySpineOnly()}}),d==="dag-confirm"&&u.jsx(GL,{busy:c,taskId:a.taskId,confirmationId:n.confirmationId,confirmationDetails:n.confirmationDetails,ledgerLoading:a.ledgerLoading,ledgerError:a.ledgerError,ledgerSummary:a.ledgerSummary,runAction:n.runAction,onConfirmAndRun:()=>{a.confirmAndRunDag()}}),d==="run"&&u.jsx(ZL,{busy:c,confirmationId:n.confirmationId,operationId:n.operationId,dagRunId:T,observeBusy:t.observeBusy,ledgerLoading:a.ledgerLoading,ledgerError:a.ledgerError,ledgerSummary:a.ledgerSummary,sseLog:n.sseLog,progress:N,runAction:n.runAction,onStopFollow:n.stopFollowSse,onShowInspectSplit:()=>{T.trim()&&o.setInspectSplitOpen(!0)},onOpenInspectSplit:()=>{T.trim()&&o.openInspectSplit()}})]})]})}function iz(e,t){if(e.has(t))return e instanceof Set?e:new Set(e);const n=new Set(e);return n.add(t),n}function sz(e,t,n){return n===!1?e instanceof Set?e:new Set(e):iz(e,t)}function Tl(e){return{hidden:!e,inert:!e,"aria-hidden":!e}}function oz(e){const{active:t,operateTab:n,shell:a,actions:s,wizard:o,prd:c,recovery:d}=e,[h,m]=w.useState(()=>new Set),p=sz(h,n,t);return p!==h&&m(p),u.jsxs("section",{id:"workspace-operate",className:"workspace-pane workspace-pane--operate","aria-label":"操作工作区",hidden:!t,"aria-hidden":!t,inert:!t,tabIndex:t?-1:void 0,children:[p.has("tasks")?u.jsx("div",{className:"operate-subpane",...Tl(n==="tasks"),children:u.jsx(az,{shell:a,actions:s,wizard:o,prd:c,recovery:d})}):null,p.has("recovery")?u.jsx("div",{className:"operate-subpane",...Tl(n==="recovery"),children:u.jsx(LL,{shell:a,recovery:d,wizard:o})}):null,p.has("night")?u.jsx("div",{className:"operate-subpane",...Tl(n==="night"),children:u.jsx(NL,{busy:a.busy,runAction:s.runAction,isActionSuccess:s.isActionSuccess,setOpError:a.setOpError})}):null,p.has("models")?u.jsx("div",{className:"operate-subpane",...Tl(n==="models"),children:u.jsx(DL,{busy:a.busy,readiness:a.readiness,readinessReport:a.readinessReport,health:a.health,onRefreshReadiness:()=>{s.runAction("refreshReadiness",{}).then(()=>a.loadHealth())},onSaveMatrix:async g=>{const x=await s.runAction("savePiModelMatrix",{matrix:g});return await a.loadHealth(),x}})}):null,p.has("settings")?u.jsx("div",{className:"operate-subpane",...Tl(n==="settings"),children:u.jsx(zL,{health:a.health,readiness:a.readiness,healthError:a.healthError,layers:a.layers,setupBlocked:a.setupBlocked,degraded:a.degraded})}):null]})}async function lz(){return await import("/inspect/inspect-workspace.js")}function zm(e,t){if(!t.active){e.setActive(!1),e.updateRoute(t.hash);return}e.updateRoute(t.hash),e.setActive(!0)}function cz(e){const{active:t,hash:n,onNavigate:a}=e,s=w.useRef(null),o=w.useRef(null),c=w.useRef(0),d=w.useRef(null),h=w.useRef(a);h.current=a;const m=w.useRef(t),p=w.useRef(n),g=w.useRef(e.workspaceId);m.current=t,p.current=n,g.current=e.workspaceId;const[x,v]=w.useState("idle"),[S,T]=w.useState(!1),N=(_,P,U)=>{_.then(A=>{if(P===c.current){if(!A){v("error");return}o.current=A,zm(A,{active:m.current,hash:p.current}),v("ready")}}).catch(()=>{P===c.current&&v("error")}).finally(()=>{d.current===_&&(d.current=null),U?.()})},R=async()=>{const _=await lz();if(!s.current)return null;typeof _.prepareInspectWorkspace=="function"&&await _.prepareInspectWorkspace(s.current);const P={active:m.current,hash:p.current};return o.current?(zm(o.current,P),o.current):_.mountInspectWorkspace(s.current,{hosted:!0,autoStart:!1,hash:P.hash,active:P.active,workspaceId:g.current??void 0,onNavigate:U=>h.current(U)})};w.useEffect(()=>{window.postMessage({type:"loop-console:workspace-scope",workspaceId:e.workspaceId??null},"*")},[e.workspaceId]),w.useEffect(()=>{if(o.current){zm(o.current,{active:t,hash:n});return}if(d.current||!t||x==="error")return;const _=++c.current;v("loading");const P=R();d.current=P,N(P,_)},[t,n,x]),w.useEffect(()=>()=>{o.current?.destroy(),o.current=null},[]);const O=()=>{if(S||d.current)return;T(!0),v("loading");const _=++c.current,P=R();d.current=P,N(P,_,()=>T(!1))};return u.jsxs("section",{id:"workspace-inspect",className:"workspace-pane workspace-pane--inspect","aria-label":"观测工作区",hidden:!t,"aria-hidden":!t,inert:!t,tabIndex:t?-1:void 0,children:[u.jsx("div",{ref:s,className:"inspect-workspace-root"}),x==="loading"&&!o.current?u.jsx("p",{className:"muted",role:"status",children:"正在加载观测工作区…"}):null,x==="error"?u.jsxs("div",{className:"workspace-inspect-error",role:"alert",children:[u.jsx("p",{children:"观测工作区加载失败。"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:S,onClick:O,children:"重试"})]}):null]})}function uz(e){const t=e==="chat"?"workspace-chat":e==="operate"?"workspace-operate":"workspace-inspect",n=document.getElementById(t);if(!(n instanceof HTMLElement))return;if(e==="chat"){n.focus();return}(n.querySelector('button:not([disabled]), [href], textarea, input, select, [tabindex]:not([tabindex="-1"])')??n).focus()}function dz(){const e=Zw(),t=nL({}),n=w.useRef(()=>{}),a=w.useCallback(q=>n.current(q),[]),[s,o]=w.useState("chat"),[c,d]=w.useState(null),h=c?.workspaceId??t.unknownWorkspaceId,m=h?null:t.workspaceId,p=Jw({shell:e,applyInterviewPayload:a,workspaceId:m}),g=p9(),x=H9({shell:e,actions:p,prd:g}),v=B9({shell:e,actions:p,wizard:x}),[S,T]=w.useState(()=>Kf(window.localStorage)),[N,R]=w.useState(()=>D9(window.localStorage)),[O,_]=w.useState(()=>Xf(window.location,{lastOperateTab:Kf(window.localStorage)})?.sessionId??null);w.useEffect(()=>{n.current=x.applyInterviewPayload}),w.useEffect(()=>{h||t.loading||e.loadHealth(t.workspaceId)},[e.loadHealth,h,t.loading,t.workspaceId]);const P=w.useRef(m);w.useEffect(()=>{P.current!==m&&(P.current=m,p.resetForWorkspaceScope(),x.setTaskId(""),v.setDagRunId(""),v.setFromNodeId(""),v.setFeatureId(""),v.setRecoveryConfirm(null),v.setInspectSplitOpen(!1),v.setInterruptIntent(!1),e.setBusy(!1),e.setOpError(null),e.setOpMessage(null))},[p,v,m,e,x]);const U=w.useCallback((q,I={},K={})=>{if(q==="operate"){const G=I.operateTab??S;T(G),O9(G,window.localStorage),e.selectNav(G)}else q==="chat"?(e.selectNav("chat"),"sessionId"in I&&_(I.sessionId??null)):e.selectNav("recovery");I.taskId&&x.setTaskId(I.taskId),I.dagRunId&&v.setDagRunId(I.dagRunId),I.fromNodeId&&v.setFromNodeId(I.fromNodeId),I.featureId&&v.setFeatureId(I.featureId),v.setInterruptIntent(I.intent==="interrupt"),o(q);const Q=q==="inspect"?Yf(I.inspectHref??N,I.workspaceId??m):Wf({workspace:q,operateTab:I.operateTab??S,...m?{workspaceId:m}:{},...I});q==="inspect"&&(R(Q),j9(Q,window.localStorage));const pe=Q.startsWith("/#")?Q.slice(1):Q.startsWith("#")?Q:`#${Q}`;(window.location.hash.startsWith("#")?window.location.hash:`#${window.location.hash}`)!==pe&&(K.replace&&typeof history.replaceState=="function"?history.replaceState(null,"",pe):window.location.hash=pe),queueMicrotask(()=>uz(q))},[N,S,v.setDagRunId,v.setFeatureId,v.setFromNodeId,v.setInterruptIntent,m,e.selectNav,x.setTaskId]),A=w.useCallback((q,I={})=>{if(q==="chat"){U("chat",I);return}U("operate",{...I,operateTab:q})},[U]),z=w.useCallback(q=>{const I=Pi(q),K=Xf({pathname:"/",hash:I.startsWith("/#")?I.slice(1):I});if(!K){Ts(I);return}U(K.workspace,{...K,operateTab:K.operateTab,inspectHref:K.canonicalHref},{replace:K.replace})},[U]),X=w.useCallback(()=>{const q=Xf(window.location,{lastOperateTab:Kf(window.localStorage)});if(q){const I=M9(q.workspaceId,t.workspaces.map(K=>K.workspaceId));if(I.status==="unknown-workspace"){d({workspaceId:I.workspaceId});return}d(null),q.workspaceId&&q.workspaceId!==m&&t.selectWorkspace(q.workspaceId),U(q.workspace,{...q,operateTab:q.operateTab,inspectHref:q.canonicalHref},{replace:q.replace});return}d(null),U("chat",{})},[U,m,t]),H=w.useCallback(q=>{t.selectWorkspace(q),U("chat",{workspaceId:q,sessionId:void 0},{replace:!0})},[U,t]),$=w.useCallback(q=>{if(d(null),t.selectWorkspace(q),s==="chat"){U("chat",{workspaceId:q,sessionId:void 0},{replace:!0});return}const I=s==="operate"?Xu(S,{workspaceId:q}):Yf(N,q);z(I)},[U,N,z,S,s,t]);w.useEffect(()=>(X(),window.addEventListener("hashchange",X),()=>window.removeEventListener("hashchange",X)),[X]);const F=v.dagRunId.trim()?ma(`/dag/${encodeURIComponent(v.dagRunId.trim())}`,"from=recovery"):Bl,Y=Yf(s==="inspect"?N:F,m),oe=H1(),ee=Xu(S,m?{workspaceId:m}:{});return u.jsx(u.Fragment,{children:u.jsxs("div",{className:`console-app${s==="chat"?" is-chat-focus":""}`,children:[u.jsx($9,{nav:e.nav,primary:s,chatHref:oe,operateHref:ee,readiness:e.readiness,setupBlocked:e.setupBlocked,degraded:e.degraded,inspectHref:Y,workspaces:t.workspaces,workspaceId:m,workspacesLoading:t.loading,onSelectWorkspace:$,onNavigate:z}),u.jsx(P9,{busy:e.busy,runAction:p.runAction}),u.jsxs("div",{className:`console-shell${s==="chat"?" is-chat-focus":""}`,children:[u.jsx(G9,{opError:e.opError,opMessage:e.opMessage}),h?u.jsxs("div",{className:"workspace-route-error",role:"alert","aria-live":"polite",children:[u.jsxs("p",{children:["URL 指向的 Workspace",u.jsx("code",{children:h}),"不存在或已被移除。为避免数据泄漏,不会回退到默认 Workspace。"]}),u.jsx("ul",{className:"workspace-route-error-options",children:t.workspaces.map(q=>u.jsx("li",{children:u.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>{d(null),t.selectWorkspace(q.workspaceId),z(Wf({workspace:"chat",workspaceId:q.workspaceId}))},children:["选择 ",q.name]})},q.workspaceId))}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{d(null);const q=t.workspaces[0]?.workspaceId??null;q&&t.selectWorkspace(q),z(Wf({workspace:"chat"}))},children:"返回对话首页"})]}):null,h?null:u.jsxs("main",{className:`console-main${s==="chat"?" console-main--fill":""}`,children:[u.jsx(pL,{active:s==="chat",readiness:e.readiness,workspaceRegistry:t,workspaceId:m,sessionId:O,workspaceGate:c?{status:"unknown-workspace",workspaceId:c.workspaceId}:void 0,onSwitchWorkspace:H,onNavigateWorkspace:A}),u.jsx(oz,{active:s==="operate",operateTab:S,shell:e,actions:p,wizard:x,prd:g,recovery:v}),u.jsx(cz,{active:s==="inspect",hash:N.startsWith("/#")?N.slice(1):N,workspaceId:m,onNavigate:z})]}),!h&&v.inspectSplitOpen&&v.dagRunId.trim()?u.jsx(qw,{dagRunId:v.dagRunId.trim(),nodeId:v.fromNodeId.trim()||void 0,onClose:()=>v.setInspectSplitOpen(!1),onOpenFull:()=>z(ma(`/dag/${encodeURIComponent(v.dagRunId.trim())}`,"from=recovery"))}):null]})]})})}const ux=document.getElementById("root");if(!ux)throw new Error("Loop Operator Console: #root missing");ww.createRoot(ux).render(u.jsx(w.StrictMode,{children:u.jsx(dz,{})}));export{Wk as _,md as g,fz as k};