pi-outpost 0.35.0 → 0.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract/README.md +3 -1
- package/dist/contract/conformance/README.md +8 -0
- package/dist/contract/validate-structured-exchange.mjs +13 -2
- package/dist/pi-outpost-tools.mjs +12 -1
- package/dist/pi-outpost.mjs +101 -85
- package/dist/pi-outpost.sea.mjs +2 -2
- package/dist/sea-prep.blob +2 -2
- package/dist/web/assets/PdfViewer-CptfuY34.js +2 -0
- package/dist/web/assets/{abnfDiagram-YUKMZFIV-C_v5KfC7.js → abnfDiagram-YUKMZFIV-kB5t-7AM.js} +1 -1
- package/dist/web/assets/architecture-WOLXFQ4H-BuU5EQCD.js +1 -0
- package/dist/web/assets/{architectureDiagram-47P4ROYG-DTpA3_fr.js → architectureDiagram-47P4ROYG-C5hzR07F.js} +1 -1
- package/dist/web/assets/{blockDiagram-E7TT5TSB-JiGNkbrY.js → blockDiagram-E7TT5TSB-DdpYvXs8.js} +1 -1
- package/dist/web/assets/{c4Diagram-CRA5TL53-BqyaF5aA.js → c4Diagram-CRA5TL53-Di3h58ks.js} +1 -1
- package/dist/web/assets/channel-DVH-eaz_.js +1 -0
- package/dist/web/assets/{chunk-2BW5OAIV-SBPwGrjA.js → chunk-2BW5OAIV-BIIX2R6x.js} +1 -1
- package/dist/web/assets/{chunk-3YJQHVM4-MV5Ex8sq.js → chunk-3YJQHVM4-Dt99sj0b.js} +1 -1
- package/dist/web/assets/{chunk-4EA7E6EY-CKvXXyhx.js → chunk-4EA7E6EY-yvJMWemR.js} +1 -1
- package/dist/web/assets/{chunk-7TKQ45FW-D6DuC99K.js → chunk-7TKQ45FW-Dob6DuOQ.js} +1 -1
- package/dist/web/assets/{chunk-AW2ZBBNX-C4rsmcm9.js → chunk-AW2ZBBNX-DB6rxZAL.js} +1 -1
- package/dist/web/assets/{chunk-DBDB3WZW-DYwidElu.js → chunk-DBDB3WZW-BIeIRFel.js} +1 -1
- package/dist/web/assets/{chunk-E2ZNV5FY-CYbRGGQf.js → chunk-E2ZNV5FY-k59zNMXy.js} +1 -1
- package/dist/web/assets/{chunk-EU5HNXII-DxNjjYiq.js → chunk-EU5HNXII-ND0WZFFM.js} +1 -1
- package/dist/web/assets/{chunk-FVRAUYC3-cRWf5LC3.js → chunk-FVRAUYC3-D1LdAmKs.js} +1 -1
- package/dist/web/assets/{chunk-HJ2JQQFS-D9pDNejT.js → chunk-HJ2JQQFS-_yet-jCS.js} +1 -1
- package/dist/web/assets/{chunk-HTAEGDNF-B_PVN4qe.js → chunk-HTAEGDNF-DKo1PJAZ.js} +1 -1
- package/dist/web/assets/{chunk-KQW6MTUR-BvQfG-IU.js → chunk-KQW6MTUR-evHULq4-.js} +1 -1
- package/dist/web/assets/{chunk-NTY3LDVX-C_c1c_yY.js → chunk-NTY3LDVX-C2IFjend.js} +1 -1
- package/dist/web/assets/{chunk-VPRB5NB3-BneD2tFR.js → chunk-VPRB5NB3-CCVn2tFZ.js} +1 -1
- package/dist/web/assets/{chunk-XC4XBNZT-BfvNm2P2.js → chunk-XC4XBNZT-DjwT4Fb8.js} +1 -1
- package/dist/web/assets/{classDiagram-v2-K4WV4PDN-D3Jwj4hF.js → classDiagram-v2-K4WV4PDN-7vBzSF1K.js} +1 -1
- package/dist/web/assets/{conversationExport-B_MfzYyo.js → conversationExport-1pQ1kKRb.js} +2 -2
- package/dist/web/assets/{cynefin-EF2NZ3EQ-D0UE3xaA.js → cynefin-EF2NZ3EQ-EkVSUZoC.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-3GCD6N5R-CCBRrG1y.js → cynefinDiagram-3GCD6N5R-TqsWGFj_.js} +1 -1
- package/dist/web/assets/{dagre-W4DXFKR2-zRL24iZJ.js → dagre-W4DXFKR2-Bs7WDnka.js} +1 -1
- package/dist/web/assets/{diagram-2UJZ2QOL-LHcLpXvO.js → diagram-2UJZ2QOL-BCCQWZ6Q.js} +1 -1
- package/dist/web/assets/{diagram-OVF4WLC6-8BeDZk_g.js → diagram-OVF4WLC6-ClTJAriq.js} +1 -1
- package/dist/web/assets/{diagram-PFPMY2P6-CKBnlJR4.js → diagram-PFPMY2P6-DRS4uv3o.js} +1 -1
- package/dist/web/assets/{diagram-UMYRVEAY-CRVvTnHL.js → diagram-UMYRVEAY-oQDIgSp_.js} +1 -1
- package/dist/web/assets/{diagram-YEKJPTXX-C77BIwU0.js → diagram-YEKJPTXX-DGvp5HHA.js} +1 -1
- package/dist/web/assets/{diagram-ZIFT7M5P-VCN0ewTA.js → diagram-ZIFT7M5P-DTOvOJP9.js} +1 -1
- package/dist/web/assets/{docxExport-Cx1UE4r4.js → docxExport-70RM2cmX.js} +2 -2
- package/dist/web/assets/{ebnfDiagram-VR2GEFS7-DE3BquXX.js → ebnfDiagram-VR2GEFS7-Bt9AsQhf.js} +1 -1
- package/dist/web/assets/{elk-IJKZMXRS-BMBFeeLM.js → elk-IJKZMXRS-43BtmMFC.js} +1 -1
- package/dist/web/assets/{erDiagram-O2IAPWRE-BpvBfZtG.js → erDiagram-O2IAPWRE-Cg5FjWxt.js} +1 -1
- package/dist/web/assets/eventmodeling-K75KTNOO-D-1S3G_r.js +1 -0
- package/dist/web/assets/flowDiagram-OXPTDLAJ-BwBlCFbR.js +1 -0
- package/dist/web/assets/{ganttDiagram-R7TSEDQI-Vx8rdpBL.js → ganttDiagram-R7TSEDQI-Drk9ZBL_.js} +1 -1
- package/dist/web/assets/{gitGraph-VSP46ZUC-CXqfxKB6.js → gitGraph-VSP46ZUC-_W77O0wc.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-XJZIOB7I-CtT_GFza.js → gitGraphDiagram-XJZIOB7I-BFVa-iQn.js} +1 -1
- package/dist/web/assets/index-DXN0nanq.js +350 -0
- package/dist/web/assets/{info-OHQRW6UA-Dzy6-ufv.js → info-OHQRW6UA-Ctq9vAkc.js} +1 -1
- package/dist/web/assets/{infoDiagram-5W2HQ5XZ-CFRmWQIO.js → infoDiagram-5W2HQ5XZ-9s3DGUEP.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-K3B6WC7H-Cibrnarh.js → ishikawaDiagram-K3B6WC7H-Bb66YtFg.js} +1 -1
- package/dist/web/assets/{journeyDiagram-COXZFDF6-DFoq_6Ri.js → journeyDiagram-COXZFDF6-DZ-UCzYx.js} +1 -1
- package/dist/web/assets/{kanban-definition-P3RFRI5V-B_ksgbTL.js → kanban-definition-P3RFRI5V-CXBbbpKw.js} +1 -1
- package/dist/web/assets/{line-DK5MzjMr.js → line-DI6oDPYR.js} +1 -1
- package/dist/web/assets/{loadReferencedImage-BAkXtzog.js → loadReferencedImage-BQpK9GNN.js} +2 -2
- package/dist/web/assets/{mermaid-parser.core-0hMEi6f9.js → mermaid-parser.core-F143UNdq.js} +3 -3
- package/dist/web/assets/{mermaid.core-D2DiwiHi.js → mermaid.core-FqGqI1ho.js} +4 -4
- package/dist/web/assets/{mindmap-definition-LZFPQGKD-DiJiFNch.js → mindmap-definition-LZFPQGKD-B6Q2fkYK.js} +1 -1
- package/dist/web/assets/{packet-JDAUHWVQ-BGr5cgVG.js → packet-JDAUHWVQ-DA9k8-fU.js} +1 -1
- package/dist/web/assets/{pdf-DUYUQwoI.js → pdf-DhwAPtjt.js} +1 -1
- package/dist/web/assets/{pegDiagram-BGZESJAR-BXEDbek_.js → pegDiagram-BGZESJAR-DGymYtc-.js} +1 -1
- package/dist/web/assets/{pie-XZMESJXO-Cf8_kbHC.js → pie-XZMESJXO-BWjAcopM.js} +1 -1
- package/dist/web/assets/{pieDiagram-CAPJLFHJ-Co9YXMsu.js → pieDiagram-CAPJLFHJ-BcDIEPPQ.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-GDMTTRAM-CfS7tD05.js → quadrantDiagram-GDMTTRAM-DJQxy266.js} +1 -1
- package/dist/web/assets/{radar-ABXABTNO-BEGsrsAA.js → radar-ABXABTNO-DhsSZPg3.js} +1 -1
- package/dist/web/assets/{railroad-I3PHUGI6-CFT2jtUv.js → railroad-I3PHUGI6-DJ7oN14G.js} +1 -1
- package/dist/web/assets/railroad-abnf-LNEFI6M7-BZj4c-IW.js +1 -0
- package/dist/web/assets/railroad-ebnf-DWYD2UWJ-BnSjVGRJ.js +1 -0
- package/dist/web/assets/railroad-peg-JR7BVNR7-Cf0UiINZ.js +1 -0
- package/dist/web/assets/{railroadDiagram-SM67HX2B-CbQqJD5P.js → railroadDiagram-SM67HX2B-BaHuLDd3.js} +1 -1
- package/dist/web/assets/{requirementDiagram-X7JNWC4A-BGmGKspK.js → requirementDiagram-X7JNWC4A-Cdx0JkRV.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-UM26HJRW-BrgJVT7k.js → sankeyDiagram-UM26HJRW-Wmb1OXw9.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-ZO4K6R2Y-VgSVGmd4.js → sequenceDiagram-ZO4K6R2Y-B0l0Rf12.js} +1 -1
- package/dist/web/assets/{stateDiagram-v2-TBUQTH76-DyoK2VR4.js → stateDiagram-v2-TBUQTH76-DzgT3ME7.js} +1 -1
- package/dist/web/assets/{swimlanes-N4OXWK64-DFGFtJZB.js → swimlanes-N4OXWK64-CiDMShdL.js} +1 -1
- package/dist/web/assets/swimlanesDiagram-K3J5GTZL-BNLW10Yk.js +8 -0
- package/dist/web/assets/{timeline-definition-YOQAKGHF-Cqgm-mFB.js → timeline-definition-YOQAKGHF-C0vevBVy.js} +1 -1
- package/dist/web/assets/{treeView-D4JQ5SDB-CSP5w1GL.js → treeView-D4JQ5SDB-0qXyE7XG.js} +1 -1
- package/dist/web/assets/{treemap-SAJKECNS-DkHwZurr.js → treemap-SAJKECNS-DzfA771k.js} +1 -1
- package/dist/web/assets/{usecaseDiagram-VIAY4XPW-C4OqICTk.js → usecaseDiagram-VIAY4XPW-tA8gpVwy.js} +1 -1
- package/dist/web/assets/{vennDiagram-BLWOH2XV-C9lYHAeZ.js → vennDiagram-BLWOH2XV-DwCrnY44.js} +1 -1
- package/dist/web/assets/{wardley-7MLQ67FV-CPzWT6B3.js → wardley-7MLQ67FV-BdlgtOCQ.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YMQ3BMBF-DXD2__kE.js → wardleyDiagram-YMQ3BMBF-hSTGOEfh.js} +1 -1
- package/dist/web/assets/{xychartDiagram-TAQBALBS-Dqxktrov.js → xychartDiagram-TAQBALBS-CDqueuac.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +2 -2
- package/dist/web/assets/PdfViewer-GOg5r-bG.js +0 -2
- package/dist/web/assets/architecture-WOLXFQ4H-DqYyXFjD.js +0 -1
- package/dist/web/assets/channel-BQKcNNxJ.js +0 -1
- package/dist/web/assets/eventmodeling-K75KTNOO-DLCfkEm-.js +0 -1
- package/dist/web/assets/flowDiagram-OXPTDLAJ-BqkbyaSw.js +0 -1
- package/dist/web/assets/index-D8PP343M.js +0 -350
- package/dist/web/assets/railroad-abnf-LNEFI6M7-BeOImRGm.js +0 -1
- package/dist/web/assets/railroad-ebnf-DWYD2UWJ-BZhyClCm.js +0 -1
- package/dist/web/assets/railroad-peg-JR7BVNR7-DXhvwuLk.js +0 -1
- package/dist/web/assets/swimlanesDiagram-K3J5GTZL-BmwDNPXX.js +0 -8
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-BrZcom_y.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/mermaid.core-FqGqI1ho.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-oBChb5qS.js","assets/chunk-VPRB5NB3-CCVn2tFZ.js","assets/chunk-3YJQHVM4-Dt99sj0b.js","assets/dist-B_J_HbC0.js","assets/chunk-HJ2JQQFS-_yet-jCS.js","assets/chunk-E2ZNV5FY-k59zNMXy.js","assets/chunk-DUW6YSOI-Dgx8z5s3.js","assets/chunk-4EA7E6EY-yvJMWemR.js","assets/chunk-XC4XBNZT-DjwT4Fb8.js","assets/chunk-J5ZVWO5B-oDCd-gWO.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-DBDB3WZW-BIeIRFel.js","assets/chunk-2BW5OAIV-BIIX2R6x.js","assets/line-DI6oDPYR.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/chunk-NTY3LDVX-C2IFjend.js","assets/docxExport-70RM2cmX.js","assets/loadReferencedImage-BQpK9GNN.js","assets/conversationExport-1pQ1kKRb.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t,t as n}from"./rolldown-runtime-Dd_uD5pT.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return ee(e.type,t,e.props)}function E(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function D(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,D(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),D(o,r,i,``,function(e){return e})):o!=null&&(E(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=D(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=D(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return D(ae(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return D(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function se(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var O=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ce={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ce,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ee(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=E,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:se}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,O)}catch(e){O(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),i=n(((e,t)=>{t.exports=r()})),a=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,E());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function te(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(te)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=te,E=function(){re.postMessage(null)}}else E=function(){_(te,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),c=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=n((e=>{var t=o(),n=i(),r=c();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),ne=Symbol.for(`react.activity`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var D=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===D?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case ne:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k={pending:!1,data:null,method:null,action:null},A=[],le=-1;function ue(e){return{current:e}}function de(e){0>le||(e.current=A[le],A[le]=null,le--)}function j(e,t){le++,A[le]=e.current,e.current=t}var fe=ue(null),pe=ue(null),me=ue(null),he=ue(null);function ge(e,t){switch(j(me,t),j(pe,e),j(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?uf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=uf(t),e=df(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}de(fe),j(fe,e)}function _e(){de(fe),de(pe),de(me)}function ve(e){e.memoizedState!==null&&j(he,e);var t=fe.current,n=df(t,e.type);t!==n&&(j(pe,e),j(fe,n))}function ye(e){pe.current===e&&(de(fe),de(pe)),he.current===e&&(de(he),yp._currentValue=k)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-We(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=ce.p;return e===0?(e=window.event,e===void 0?32:Fp(e.type)):e}function dt(e,t){var n=ce.p;try{return ce.p=e,t()}finally{ce.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft;function xt(e){delete e[pt],delete e[mt],delete e[gt],delete e[_t],delete e[vt]}function St(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Nf(e);e!==null;){if(n=e[pt])return n;e=Nf(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Tt(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Et(e){e[bt]=!0}var Dt=new Set,Ot={};function kt(e,t){At(e,t),At(e+`Capture`,t)}function At(e,t){for(Ot[e]=t,e=0;e<t.length;e++)Dt.add(t[e])}var jt=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]*$`),Mt={},Nt={};function Pt(e){return De.call(Nt,e)?!0:De.call(Mt,e)?!1:jt.test(e)?Nt[e]=!0:(Mt[e]=!0,!1)}function Ft(e,t,n){if(Pt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function It(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Lt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Rt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Bt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vt(e){if(!e._valueTracker){var t=zt(e)?`checked`:`value`;e._valueTracker=Bt(e,t,``+e[t])}}function Ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=zt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Ut(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Wt=/[\n"\\]/g;function Gt(e){return e.replace(Wt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Kt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Rt(t)):e.value!==``+Rt(t)&&(e.value=``+Rt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Jt(e,o,Rt(n)):Jt(e,o,Rt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Rt(s):e.removeAttribute(`name`)}function qt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Vt(e);return}n=n==null?``:``+Rt(n),t=t==null?n:``+Rt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Vt(e)}function Jt(e,t,n){t===`number`&&Ut(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Yt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Rt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Xt(e,t,n){if(t!=null&&(t=``+Rt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Rt(n)}function Zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(se(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Rt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Vt(e)}function Qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $t=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 en(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||$t.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function tn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&en(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&en(e,o,t[o])}function nn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var rn=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`]]),an=/^[\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 on(e){return an.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function sn(){}var cn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var un=null,dn=null;function fn(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Kt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Gt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[mt]||null;if(!i)throw Error(a(90));Kt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ht(r)}break a;case`textarea`:Xt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Yt(e,!!n.multiple,t,!1)}}}var pn=!1;function mn(e,t,n){if(pn)return e(t,n);pn=!0;try{return e(t)}finally{if(pn=!1,(un!==null||dn!==null)&&(zu(),un&&(t=un,e=dn,dn=un=null,fn(t),e)))for(t=0;t<e.length;t++)fn(e[t])}}function hn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var gn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),_n=!1;if(gn)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){_n=!0}}),window.addEventListener(`test`,vn,vn),window.removeEventListener(`test`,vn,vn)}catch{_n=!1}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return xn=i.slice(e,1<r?1-r:void 0)}function Cn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function wn(){return!0}function Tn(){return!1}function En(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?wn:Tn,this.isPropagationStopped=Tn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=En(Dn),kn=h({},Dn,{view:0,detail:0}),An=En(kn),jn,Mn,Nn,Pn=h({},kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Nn&&(Nn&&e.type===`mousemove`?(jn=e.screenX-Nn.screenX,Mn=e.screenY-Nn.screenY):Mn=jn=0,Nn=e),jn)},movementY:function(e){return`movementY`in e?e.movementY:Mn}}),Fn=En(Pn),In=En(h({},Pn,{dataTransfer:0})),Ln=En(h({},kn,{relatedTarget:0})),Rn=En(h({},Dn,{animationName:0,elapsedTime:0,pseudoElement:0})),zn=En(h({},Dn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Bn=En(h({},Dn,{data:0})),Vn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Hn={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`},Un={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Un[e])?!!t[e]:!1}function Gn(){return Wn}var Kn=En(h({},kn,{key:function(e){if(e.key){var t=Vn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Hn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gn,charCode:function(e){return e.type===`keypress`?Cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),qn=En(h({},Pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Jn=En(h({},kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gn})),Yn=En(h({},Dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Xn=En(h({},Pn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Zn=En(h({},Dn,{newState:0,oldState:0})),Qn=[9,13,27,32],$n=gn&&`CompositionEvent`in window,er=null;gn&&`documentMode`in document&&(er=document.documentMode);var tr=gn&&`TextEvent`in window&&!er,nr=gn&&(!$n||er&&8<er&&11>=er),rr=` `,ir=!1;function ar(e,t){switch(e){case`keyup`:return Qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function or(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var sr=!1;function cr(e,t){switch(e){case`compositionend`:return or(t);case`keypress`:return t.which===32?(ir=!0,rr):null;case`textInput`:return e=t.data,e===rr&&ir?null:e;default:return null}}function lr(e,t){if(sr)return e===`compositionend`||!$n&&ar(e,t)?(e=Sn(),xn=bn=yn=null,sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return nr&&t.locale!==`ko`?null:t.data;default:return null}}var ur={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 dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ur[e.type]:t===`textarea`}function fr(e,t,n,r){un?dn?dn.push(r):dn=[r]:un=r,t=qd(t,`onChange`),0<t.length&&(n=new On(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var pr=null,mr=null;function hr(e){zd(e,0)}function gr(e){if(Ht(wt(e)))return e}function _r(e,t){if(e===`change`)return t}var vr=!1;if(gn){var yr;if(gn){var br=`oninput`in document;if(!br){var xr=document.createElement(`div`);xr.setAttribute(`oninput`,`return;`),br=typeof xr.oninput==`function`}yr=br}else yr=!1;vr=yr&&(!document.documentMode||9<document.documentMode)}function Sr(){pr&&(pr.detachEvent(`onpropertychange`,Cr),mr=pr=null)}function Cr(e){if(e.propertyName===`value`&&gr(mr)){var t=[];fr(t,mr,e,ln(e)),mn(hr,t)}}function wr(e,t,n){e===`focusin`?(Sr(),pr=t,mr=n,pr.attachEvent(`onpropertychange`,Cr)):e===`focusout`&&Sr()}function Tr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return gr(mr)}function Er(e,t){if(e===`click`)return gr(t)}function Dr(e,t){if(e===`input`||e===`change`)return gr(t)}function Or(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var kr=typeof Object.is==`function`?Object.is:Or;function Ar(e,t){if(kr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!De.call(t,i)||!kr(e[i],t[i]))return!1}return!0}function jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mr(e,t){var n=jr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ut(e.document)}return t}function Fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ir=gn&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==Ut(r)||(r=Lr,`selectionStart`in r&&Fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&Ar(zr,r)||(zr=r,r=qd(Rr,`onSelect`),0<r.length&&(t=new On(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Lr)))}function Hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ur={animationend:Hr(`Animation`,`AnimationEnd`),animationiteration:Hr(`Animation`,`AnimationIteration`),animationstart:Hr(`Animation`,`AnimationStart`),transitionrun:Hr(`Transition`,`TransitionRun`),transitionstart:Hr(`Transition`,`TransitionStart`),transitioncancel:Hr(`Transition`,`TransitionCancel`),transitionend:Hr(`Transition`,`TransitionEnd`)},Wr={},Gr={};gn&&(Gr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),`TransitionEvent`in window||delete Ur.transitionend.transition);function Kr(e){if(Wr[e])return Wr[e];if(!Ur[e])return e;var t=Ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gr)return Wr[e]=t[n];return e}var qr=Kr(`animationend`),Jr=Kr(`animationiteration`),Yr=Kr(`animationstart`),Xr=Kr(`transitionrun`),Zr=Kr(`transitionstart`),Qr=Kr(`transitioncancel`),$r=Kr(`transitionend`),ei=new Map,ti=`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(` `);ti.push(`scrollEnd`);function ni(e,t){ei.set(e,t),kt(t,[e])}var ri=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ii=[],ai=0,oi=0;function si(){for(var e=ai,t=oi=ai=0;t<e;){var n=ii[t];ii[t++]=null;var r=ii[t];ii[t++]=null;var i=ii[t];ii[t++]=null;var a=ii[t];if(ii[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&di(n,i,a)}}function ci(e,t,n,r){ii[ai++]=e,ii[ai++]=t,ii[ai++]=n,ii[ai++]=r,oi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function li(e,t,n,r){return ci(e,t,n,r),fi(e)}function ui(e,t){return ci(e,null,null,t),fi(e)}function di(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function fi(e){if(50<Au)throw Au=0,ju=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var pi={};function mi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hi(e,t,n,r){return new mi(e,t,n,r)}function gi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _i(e,t){var n=e.alternate;return n===null?(n=hi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function vi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function yi(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)gi(e)&&(s=1);else if(typeof e==`string`)s=up(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ne:return e=hi(31,n,t,i),e.elementType=ne,e.lanes=o,e;case y:return bi(n.children,i,o,t);case b:s=8,i|=24;break;case x:return e=hi(12,n,t,i|2),e.elementType=x,e.lanes=o,e;case T:return e=hi(13,n,t,i),e.elementType=T,e.lanes=o,e;case ee:return e=hi(19,n,t,i),e.elementType=ee,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case te:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=hi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function bi(e,t,n,r){return e=hi(7,e,r,t),e.lanes=n,e}function xi(e,t,n){return e=hi(6,e,null,t),e.lanes=n,e}function Si(e){var t=hi(18,null,null,0);return t.stateNode=e,t}function Ci(e,t,n){return t=hi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var wi=new WeakMap;function Ti(e,t){if(typeof e==`object`&&e){var n=wi.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},wi.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var Ei=[],Di=0,Oi=null,ki=0,Ai=[],ji=0,Mi=null,Ni=1,Pi=``;function Fi(e,t){Ei[Di++]=ki,Ei[Di++]=Oi,Oi=e,ki=t}function Ii(e,t,n){Ai[ji++]=Ni,Ai[ji++]=Pi,Ai[ji++]=Mi,Mi=e;var r=Ni;e=Pi;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ni=1<<32-We(t)+i|n<<i|r,Pi=a+e}else Ni=1<<a|n<<i|r,Pi=e}function Li(e){e.return!==null&&(Fi(e,1),Ii(e,1,0))}function Ri(e){for(;e===Oi;)Oi=Ei[--Di],Ei[Di]=null,ki=Ei[--Di],Ei[Di]=null;for(;e===Mi;)Mi=Ai[--ji],Ai[ji]=null,Pi=Ai[--ji],Ai[ji]=null,Ni=Ai[--ji],Ai[ji]=null}function zi(e,t){Ai[ji++]=Ni,Ai[ji++]=Pi,Ai[ji++]=Mi,Ni=t.id,Pi=t.overflow,Mi=e}var Bi=null,Vi=null,Hi=!1,Ui=null,Wi=!1,Gi=Error(a(519));function Ki(e){throw Qi(Ti(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Gi}function qi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:Bd(`cancel`,t),Bd(`close`,t);break;case`iframe`:case`object`:case`embed`:Bd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Ld.length;n++)Bd(Ld[n],t);break;case`source`:Bd(`error`,t);break;case`img`:case`image`:case`link`:Bd(`error`,t),Bd(`load`,t);break;case`details`:Bd(`toggle`,t);break;case`input`:Bd(`invalid`,t),qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Bd(`invalid`,t);break;case`textarea`:Bd(`invalid`,t),Zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$d(t.textContent,n)?(r.popover!=null&&(Bd(`beforetoggle`,t),Bd(`toggle`,t)),r.onScroll!=null&&Bd(`scroll`,t),r.onScrollEnd!=null&&Bd(`scrollend`,t),r.onClick!=null&&(t.onclick=sn),t=!0):t=!1,t||Ki(e,!0)}function Ji(e){for(Bi=e.return;Bi;)switch(Bi.tag){case 5:case 31:case 13:Wi=!1;return;case 27:case 3:Wi=!0;return;default:Bi=Bi.return}}function Yi(e){if(e!==Bi)return!1;if(!Hi)return Ji(e),Hi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||ff(e.type,e.memoizedProps)),n=!n),n&&Vi&&Ki(e),Ji(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Vi=Mf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Vi=Mf(e)}else t===27?(t=Vi,bf(e.type)?(e=jf,jf=null,Vi=e):Vi=t):Vi=Bi?Af(e.stateNode.nextSibling):null;return!0}function Xi(){Vi=Bi=null,Hi=!1}function Zi(){var e=Ui;return e!==null&&(gu===null?gu=e:gu.push.apply(gu,e),Ui=null),e}function Qi(e){Ui===null?Ui=[e]:Ui.push(e)}var $i=ue(null),ea=null,ta=null;function na(e,t,n){j($i,t._currentValue),t._currentValue=n}function ra(e){e._currentValue=$i.current,de($i)}function ia(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function aa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ia(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ia(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function oa(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;kr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===he.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[yp]:e.push(yp))}i=i.return}e!==null&&aa(t,e,n,r),t.flags|=262144}function sa(e){for(e=e.firstContext;e!==null;){if(!kr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ca(e){ea=e,ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function la(e){return da(ea,e)}function ua(e,t){return ea===null&&ca(e),da(e,t)}function da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ta===null){if(e===null)throw Error(a(308));ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ta=ta.next=t;return n}var fa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},pa=t.unstable_scheduleCallback,ma=t.unstable_NormalPriority,ha={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ga(){return{controller:new fa,data:new Map,refCount:0}}function _a(e){e.refCount--,e.refCount===0&&pa(ma,function(){e.controller.abort()})}var va=null,ya=0,ba=0,xa=null;function Sa(e,t){if(va===null){var n=va=[];ya=0,ba=jd(),xa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ya++,t.then(Ca,Ca),t}function Ca(){if(--ya===0&&va!==null){xa!==null&&(xa.status=`fulfilled`);var e=va;va=null,ba=0,xa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ta=O.S;O.S=function(e,t){yu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&Sa(e,t),Ta!==null&&Ta(e,t)};var Ea=ue(null);function Da(){var e=Ea.current;return e===null?eu.pooledCache:e}function Oa(e,t){t===null?j(Ea,Ea.current):j(Ea,t.pool)}function ka(){var e=Da();return e===null?null:{parent:ha._currentValue,pool:e}}var Aa=Error(a(460)),ja=Error(a(474)),Ma=Error(a(542)),Na={then:function(){}};function Pa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Fa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(sn,sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,za(e),e;default:if(typeof t.status==`string`)t.then(sn,sn);else{if(e=eu,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,za(e),e}throw La=t,Aa}}function Ia(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(La=e,Aa):e}}var La=null;function Ra(){if(La===null)throw Error(a(459));var e=La;return La=null,e}function za(e){if(e===Aa||e===Ma)throw Error(a(483))}var Ba=null,Va=0;function Ha(e){var t=Va;return Va+=1,Ba===null&&(Ba=[]),Fa(Ba,e,t)}function Ua(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Wa(e,t){throw t.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ga(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=_i(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=xi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===E&&Ia(a)===t.type)?(t=i(t,n.props),Ua(t,n),t.return=e,t):(t=yi(n.type,n.key,n.props,null,e.mode,r),Ua(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ci(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=bi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=xi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=yi(t.type,t.key,t.props,null,e.mode,n),Ua(n,t),n.return=e,n;case v:return t=Ci(t,e.mode,n),t.return=e,t;case E:return t=Ia(t),f(e,t,n)}if(se(t)||ae(t))return t=bi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ha(t),n);if(t.$$typeof===C)return f(e,ua(e,t),n);Wa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case E:return n=Ia(n),p(e,t,n,r)}if(se(n)||ae(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ha(n),r);if(n.$$typeof===C)return p(e,t,ua(e,n),r);Wa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Ia(r),m(e,t,n,r,i)}if(se(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ha(r),i);if(r.$$typeof===C)return m(e,t,n,ua(t,r),i);Wa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Hi&&Fi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Hi&&Fi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Hi&&Fi(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Hi&&Fi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Hi&&Fi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),Hi&&Fi(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Ia(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ua(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=bi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=yi(o.type,o.key,o.props,null,e.mode,c),Ua(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ci(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Ia(o),b(e,r,o,c)}if(se(o))return h(e,r,o,c);if(ae(o)){if(l=ae(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ha(o),c);if(o.$$typeof===C)return b(e,r,ua(e,o),c);Wa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=xi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Va=0;var i=b(e,t,n,r);return Ba=null,i}catch(t){if(t===Aa||t===Ma)throw t;var a=hi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ka=Ga(!0),qa=Ga(!1),Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$l&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=fi(e),di(e,null,n),t}return ci(e,r,t,n),fi(e)}function $a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var to=!1;function no(){if(to){var e=xa;if(e!==null)throw e}}function ro(e,t,n,r){to=!1;var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(nu&f)===f:(r&f)===f){f!==0&&f===ba&&(to=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ja=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),uu|=o,e.lanes=o,e.memoizedState=d}}function io(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function ao(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)io(n[e],t)}var oo=ue(null),so=ue(0);function co(e,t){e=cu,j(so,e),j(oo,t),cu=e|t.baseLanes}function lo(){j(so,cu),j(oo,oo.current)}function uo(){cu=so.current,de(oo),de(so)}var fo=ue(null),po=null;function mo(e){var t=e.alternate;j(yo,yo.current&1),j(fo,e),po===null&&(t===null||oo.current!==null||t.memoizedState!==null)&&(po=e)}function ho(e){j(yo,yo.current),j(fo,e),po===null&&(po=e)}function go(e){e.tag===22?(j(yo,yo.current),j(fo,e),po===null&&(po=e)):_o(e)}function _o(){j(yo,yo.current),j(fo,fo.current)}function vo(e){de(fo),po===e&&(po=null),de(yo)}var yo=ue(0);function bo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Df(n)||Of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var xo=0,So=null,Co=null,wo=null,To=!1,Eo=!1,Do=!1,Oo=0,ko=0,Ao=null,jo=0;function Mo(){throw Error(a(321))}function No(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kr(e[n],t[n]))return!1;return!0}function Po(e,t,n,r,i,a){return xo=a,So=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Zs:Qs,Do=!1,a=n(r,i),Do=!1,Eo&&(a=Io(t,n,r,i)),Fo(e),a}function Fo(e){O.H=Xs;var t=Co!==null&&Co.next!==null;if(xo=0,wo=Co=So=null,To=!1,ko=0,Ao=null,t)throw Error(a(300));e===null||hc||(e=e.dependencies,e!==null&&sa(e)&&(hc=!0))}function Io(e,t,n,r){So=e;var i=0;do{if(Eo&&(Ao=null),ko=0,Eo=!1,25<=i)throw Error(a(301));if(i+=1,wo=Co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=$s,o=t(n,r)}while(Eo);return o}function Lo(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?Wo(t):t,e=e.useState()[0],(Co===null?null:Co.memoizedState)!==e&&(So.flags|=1024),t}function Ro(){var e=Oo!==0;return Oo=0,e}function zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Bo(e){if(To){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}To=!1}xo=0,wo=Co=So=null,Eo=!1,ko=Oo=0,Ao=null}function Vo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wo===null?So.memoizedState=wo=e:wo=wo.next=e,wo}function Ho(){if(Co===null){var e=So.alternate;e=e===null?null:e.memoizedState}else e=Co.next;var t=wo===null?So.memoizedState:wo.next;if(t!==null)wo=t,Co=e;else{if(e===null)throw So.alternate===null?Error(a(467)):Error(a(310));Co=e,e={memoizedState:Co.memoizedState,baseState:Co.baseState,baseQueue:Co.baseQueue,queue:Co.queue,next:null},wo===null?So.memoizedState=wo=e:wo=wo.next=e}return wo}function Uo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(e){var t=ko;return ko+=1,Ao===null&&(Ao=[]),e=Fa(Ao,e,t),t=So,(wo===null?t.memoizedState:wo.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Zs:Qs),e}function Go(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Wo(e);if(e.$$typeof===C)return la(e)}throw Error(a(438,String(e)))}function Ko(e){var t=null,n=So.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=So.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Uo(),So.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=re;return t.index++,n}function qo(e,t){return typeof t==`function`?t(e):t}function Jo(e){return Yo(Ho(),Co,e)}function Yo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(xo&f)===f:(nu&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ba&&(d=!0);else if((xo&p)===p){u=u.next,p===ba&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,So.lanes|=p,uu|=p;f=u.action,Do&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,So.lanes|=f,uu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!kr(o,e.memoizedState)&&(hc=!0,d&&(n=xa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Xo(e){var t=Ho(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);kr(o,t.memoizedState)||(hc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Zo(e,t,n){var r=So,i=Ho(),o=Hi;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!kr((Co||i).memoizedState,n);if(s&&(i.memoizedState=n,hc=!0),i=i.queue,Ss(es.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||wo!==null&&wo.memoizedState.tag&1){if(r.flags|=2048,_s(9,{destroy:void 0},$o.bind(null,r,i,n,t),null),eu===null)throw Error(a(349));o||xo&127||Qo(r,t,n)}return n}function Qo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=So.updateQueue,t===null?(t=Uo(),So.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $o(e,t,n,r){t.value=n,t.getSnapshot=r,ts(t)&&ns(e)}function es(e,t,n){return n(function(){ts(t)&&ns(e)})}function ts(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kr(e,n)}catch{return!0}}function ns(e){var t=ui(e,2);t!==null&&Pu(t,e,2)}function rs(e){var t=Vo();if(typeof e==`function`){var n=e;if(e=n(),Do){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:e},t}function is(e,t,n,r){return e.baseState=n,Yo(e,Co,typeof r==`function`?r:qo)}function as(e,t,n,r,i){if(qs(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,os(t,o)):(o.next=n.next,t.pending=n.next=o)}}function os(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),ss(e,t,s)}catch(n){ls(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),ss(e,t,a)}catch(n){ls(e,t,n)}}function ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){cs(e,t,n)},function(n){return ls(e,t,n)}):cs(e,t,n)}function cs(e,t,n){t.status=`fulfilled`,t.value=n,us(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,os(e,n)))}function ls(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,us(t),t=t.next;while(t!==r)}e.action=null}function us(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ds(e,t){return t}function fs(e,t){if(Hi){var n=eu.formState;if(n!==null){a:{var r=So;if(Hi){if(Vi){b:{for(var i=Vi,a=Wi;i.nodeType!==8;){if(!a){i=null;break b}if(i=Af(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Vi=Af(i.nextSibling),r=i.data===`F!`;break a}}Ki(r)}r=!1}r&&(t=n[0])}}return n=Vo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:t},n.queue=r,n=Ws.bind(null,So,r),r.dispatch=n,r=rs(!1),a=Ks.bind(null,So,!1,r.queue),r=Vo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=as.bind(null,So,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ps(e){return ms(Ho(),Co,e)}function ms(e,t,n){if(t=Yo(e,t,ds)[0],e=Jo(qo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Wo(t)}catch(e){throw e===Aa?Ma:e}else r=t;t=Ho();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(So.flags|=2048,_s(9,{destroy:void 0},hs.bind(null,i,n),null)),[r,a,e]}function hs(e,t){e.action=t}function gs(e){var t=Ho(),n=Co;if(n!==null)return ms(t,n,e);Ho(),t=t.memoizedState,n=Ho();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function _s(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=So.updateQueue,t===null&&(t=Uo(),So.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function vs(){return Ho().memoizedState}function ys(e,t,n,r){var i=Vo();So.flags|=e,i.memoizedState=_s(1|t,{destroy:void 0},n,r===void 0?null:r)}function bs(e,t,n,r){var i=Ho();r=r===void 0?null:r;var a=i.memoizedState.inst;Co!==null&&r!==null&&No(r,Co.memoizedState.deps)?i.memoizedState=_s(t,a,n,r):(So.flags|=e,i.memoizedState=_s(1|t,a,n,r))}function xs(e,t){ys(8390656,8,e,t)}function Ss(e,t){bs(2048,8,e,t)}function Cs(e){So.flags|=4;var t=So.updateQueue;if(t===null)t=Uo(),So.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ws(e){var t=Ho().memoizedState;return Cs({ref:t,nextImpl:e}),function(){if($l&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Ts(e,t){return bs(4,2,e,t)}function Es(e,t){return bs(4,4,e,t)}function Ds(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Os(e,t,n){n=n==null?null:n.concat([e]),bs(4,4,Ds.bind(null,t,e),n)}function ks(){}function As(e,t){var n=Ho();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&No(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function js(e,t){var n=Ho();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&No(t,r[1]))return r[0];if(r=e(),Do){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Ms(e,t,n){return n===void 0||xo&1073741824&&!(nu&261930)?e.memoizedState=t:(e.memoizedState=n,e=Nu(),So.lanes|=e,uu|=e,n)}function Ns(e,t,n,r){return kr(n,t)?n:oo.current===null?!(xo&42)||xo&1073741824&&!(nu&261930)?(hc=!0,e.memoizedState=n):(e=Nu(),So.lanes|=e,uu|=e,t):(e=Ms(e,n,r),kr(e,t)||(hc=!0),e)}function Ps(e,t,n,r,i){var a=ce.p;ce.p=a!==0&&8>a?a:8;var o=O.T,s={};O.T=s,Ks(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Gs(e,t,wa(c,r),Mu(e)):Gs(e,t,r,Mu(e))}catch(n){Gs(e,t,{then:function(){},status:`rejected`,reason:n},Mu())}finally{ce.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function Fs(){}function Is(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Ls(e).queue;Ps(e,i,t,k,n===null?Fs:function(){return Rs(e),n(r)})}function Ls(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:k,baseState:k,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:k},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Rs(e){var t=Ls(e);t.next===null&&(t=e.alternate.memoizedState),Gs(e,t.next.queue,{},Mu())}function zs(){return la(yp)}function Bs(){return Ho().memoizedState}function Vs(){return Ho().memoizedState}function Hs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Mu();e=Za(n);var r=Qa(t,e,n);r!==null&&(Pu(r,t,n),$a(r,t,n)),t={cache:ga()},e.payload=t;return}t=t.return}}function Us(e,t,n){var r=Mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},qs(e)?Js(t,n):(n=li(e,t,n,r),n!==null&&(Pu(n,e,r),Ys(n,t,r)))}function Ws(e,t,n){Gs(e,t,n,Mu())}function Gs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(qs(e))Js(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,kr(s,o))return ci(e,t,i,0),eu===null&&si(),!1}catch{}if(n=li(e,t,i,r),n!==null)return Pu(n,e,r),Ys(n,t,r),!0}return!1}function Ks(e,t,n,r){if(r={lane:2,revertLane:jd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},qs(e)){if(t)throw Error(a(479))}else t=li(e,n,r,2),t!==null&&Pu(t,e,2)}function qs(e){var t=e.alternate;return e===So||t!==null&&t===So}function Js(e,t){Eo=To=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ys(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Xs={readContext:la,use:Go,useCallback:Mo,useContext:Mo,useEffect:Mo,useImperativeHandle:Mo,useLayoutEffect:Mo,useInsertionEffect:Mo,useMemo:Mo,useReducer:Mo,useRef:Mo,useState:Mo,useDebugValue:Mo,useDeferredValue:Mo,useTransition:Mo,useSyncExternalStore:Mo,useId:Mo,useHostTransitionStatus:Mo,useFormState:Mo,useActionState:Mo,useOptimistic:Mo,useMemoCache:Mo,useCacheRefresh:Mo};Xs.useEffectEvent=Mo;var Zs={readContext:la,use:Go,useCallback:function(e,t){return Vo().memoizedState=[e,t===void 0?null:t],e},useContext:la,useEffect:xs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ys(4194308,4,Ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ys(4194308,4,e,t)},useInsertionEffect:function(e,t){ys(4,2,e,t)},useMemo:function(e,t){var n=Vo();t=t===void 0?null:t;var r=e();if(Do){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Vo();if(n!==void 0){var i=n(t);if(Do){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Us.bind(null,So,e),[r.memoizedState,e]},useRef:function(e){var t=Vo();return e={current:e},t.memoizedState=e},useState:function(e){e=rs(e);var t=e.queue,n=Ws.bind(null,So,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ks,useDeferredValue:function(e,t){return Ms(Vo(),e,t)},useTransition:function(){var e=rs(!1);return e=Ps.bind(null,So,e.queue,!0,!1),Vo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=So,i=Vo();if(Hi){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),eu===null)throw Error(a(349));nu&127||Qo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,xs(es.bind(null,r,o,e),[e]),r.flags|=2048,_s(9,{destroy:void 0},$o.bind(null,r,o,n,t),null),n},useId:function(){var e=Vo(),t=eu.identifierPrefix;if(Hi){var n=Pi,r=Ni;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Oo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=jo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:zs,useFormState:fs,useActionState:fs,useOptimistic:function(e){var t=Vo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ks.bind(null,So,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ko,useCacheRefresh:function(){return Vo().memoizedState=Hs.bind(null,So)},useEffectEvent:function(e){var t=Vo(),n={impl:e};return t.memoizedState=n,function(){if($l&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Qs={readContext:la,use:Go,useCallback:As,useContext:la,useEffect:Ss,useImperativeHandle:Os,useInsertionEffect:Ts,useLayoutEffect:Es,useMemo:js,useReducer:Jo,useRef:vs,useState:function(){return Jo(qo)},useDebugValue:ks,useDeferredValue:function(e,t){return Ns(Ho(),Co.memoizedState,e,t)},useTransition:function(){var e=Jo(qo)[0],t=Ho().memoizedState;return[typeof e==`boolean`?e:Wo(e),t]},useSyncExternalStore:Zo,useId:Bs,useHostTransitionStatus:zs,useFormState:ps,useActionState:ps,useOptimistic:function(e,t){return is(Ho(),Co,e,t)},useMemoCache:Ko,useCacheRefresh:Vs};Qs.useEffectEvent=ws;var $s={readContext:la,use:Go,useCallback:As,useContext:la,useEffect:Ss,useImperativeHandle:Os,useInsertionEffect:Ts,useLayoutEffect:Es,useMemo:js,useReducer:Xo,useRef:vs,useState:function(){return Xo(qo)},useDebugValue:ks,useDeferredValue:function(e,t){var n=Ho();return Co===null?Ms(n,e,t):Ns(n,Co.memoizedState,e,t)},useTransition:function(){var e=Xo(qo)[0],t=Ho().memoizedState;return[typeof e==`boolean`?e:Wo(e),t]},useSyncExternalStore:Zo,useId:Bs,useHostTransitionStatus:zs,useFormState:gs,useActionState:gs,useOptimistic:function(e,t){var n=Ho();return Co===null?(n.baseState=e,[e,n.queue.dispatch]):is(n,Co,e,t)},useMemoCache:Ko,useCacheRefresh:Vs};$s.useEffectEvent=ws;function ec(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Mu(),i=Za(r);i.payload=t,n!=null&&(i.callback=n),t=Qa(e,i,r),t!==null&&(Pu(t,e,r),$a(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Mu(),i=Za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Qa(e,i,r),t!==null&&(Pu(t,e,r),$a(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Mu(),r=Za(n);r.tag=2,t!=null&&(r.callback=t),t=Qa(e,r,n),t!==null&&(Pu(t,e,n),$a(t,e,n))}};function nc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ar(n,r)||!Ar(i,a):!0}function rc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&tc.enqueueReplaceState(t,t.state,null)}function ic(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function ac(e){ri(e)}function oc(e){console.error(e)}function sc(e){ri(e)}function cc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function lc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function uc(e,t,n){return n=Za(n),n.tag=3,n.payload={element:null},n.callback=function(){cc(e,t)},n}function dc(e){return e=Za(e),e.tag=3,e}function fc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){lc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){lc(t,n,r),typeof i!=`function`&&(Su===null?Su=new Set([this]):Su.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function pc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&oa(t,n,i,!0),n=fo.current,n!==null){switch(n.tag){case 31:case 13:return po===null?Ku():n.alternate===null&&lu===0&&(lu=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Na?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),dd(e,r,i)),!1;case 22:return n.flags|=65536,r===Na?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),dd(e,r,i)),!1}throw Error(a(435,n.tag))}return dd(e,r,i),Ku(),!1}if(Hi)return t=fo.current,t===null?(r!==Gi&&(t=Error(a(423),{cause:r}),Qi(Ti(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Ti(r,n),i=uc(e.stateNode,r,i),eo(e,i),lu!==4&&(lu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Gi&&(e=Error(a(422),{cause:r}),Qi(Ti(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Ti(o,n),hu===null?hu=[o]:hu.push(o),lu!==4&&(lu=2),t===null)return!0;r=Ti(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=uc(n.stateNode,r,e),eo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Su===null||!Su.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=dc(i),fc(i,e,n,r),eo(n,i),!1}n=n.return}while(n!==null);return!1}var mc=Error(a(461)),hc=!1;function gc(e,t,n,r){t.child=e===null?qa(t,null,n,r):Ka(t,e.child,n,r)}function _c(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ca(t),r=Po(e,t,n,o,a,i),s=Ro(),e!==null&&!hc?(zo(e,t,i),Vc(e,t,i)):(Hi&&s&&Li(t),t.flags|=1,gc(e,t,r,i),t.child)}function vc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!gi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,yc(e,t,a,r,i)):(e=yi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Hc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ar:n,n(o,r)&&e.ref===t.ref)return Vc(e,t,i)}return t.flags|=1,e=_i(a,r),e.ref=t.ref,e.return=t,t.child=e}function yc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ar(a,r)&&e.ref===t.ref){if(hc=!1,t.pendingProps=r=a,Hc(e,i))e.flags&131072&&(hc=!0);else return t.lanes=e.lanes,Vc(e,t,i)}}return Dc(e,t,n,r,i)}function bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Oa(t,a===null?null:a.cachePool),a===null?lo():co(t,a),go(t);else return r=t.lanes=536870912,Sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Oa(t,null),lo(),_o(t)):(Oa(t,a.cachePool),co(t,a),_o(t),t.memoizedState=null);return gc(e,t,i,n),t.child}function xc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Sc(e,t,n,r,i){var a=Da();return a=a===null?null:{parent:ha._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Oa(t,null),lo(),go(t),e!==null&&oa(e,t,r,!0),t.childLanes=i,null}function Cc(e,t){return t=Ic({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wc(e,t,n){return Ka(t,e.child,null,n),e=Cc(t,t.pendingProps),e.flags|=2,vo(t),t.memoizedState=null,e}function Tc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(Hi){if(r.mode===`hidden`)return e=Cc(t,r),t.lanes=536870912,xc(null,e);if(ho(t),(e=Vi)?(e=Ef(e,Wi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mi===null?null:{id:Ni,overflow:Pi},retryLane:536870912,hydrationErrors:null},n=Si(e),n.return=t,t.child=n,Bi=t,Vi=null)):e=null,e===null)throw Ki(t);return t.lanes=536870912,null}return Cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ho(t),i){if(t.flags&256)t.flags&=-257,t=wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(hc||oa(e,t,n,!1),i=(n&e.childLanes)!==0,hc||i){if(r=eu,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ui(e,s),Pu(r,e,s),mc;Ku(),t=wc(e,t,n)}else e=o.treeContext,Vi=Af(s.nextSibling),Bi=t,Hi=!0,Ui=null,Wi=!1,e!==null&&zi(t,e),t=Cc(t,r),t.flags|=4096;return t}return e=_i(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ec(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Dc(e,t,n,r,i){return ca(t),n=Po(e,t,n,r,void 0,i),r=Ro(),e!==null&&!hc?(zo(e,t,i),Vc(e,t,i)):(Hi&&r&&Li(t),t.flags|=1,gc(e,t,n,i),t.child)}function Oc(e,t,n,r,i,a){return ca(t),t.updateQueue=null,n=Io(t,r,n,i),Fo(e),r=Ro(),e!==null&&!hc?(zo(e,t,a),Vc(e,t,a)):(Hi&&r&&Li(t),t.flags|=1,gc(e,t,n,a),t.child)}function kc(e,t,n,r,i){if(ca(t),t.stateNode===null){var a=pi,o=n.contextType;typeof o==`object`&&o&&(a=la(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=tc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ya(t),o=n.contextType,a.context=typeof o==`object`&&o?la(o):pi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(ec(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&tc.enqueueReplaceState(a,a.state,null),ro(t,r,a,i),no(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=ic(n,s);a.props=c;var l=a.context,u=n.contextType;o=pi,typeof u==`object`&&u&&(o=la(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&rc(t,a,r,o),Ja=!1;var f=t.memoizedState;a.state=f,ro(t,r,a,i),no(),l=t.memoizedState,s||f!==l||Ja?(typeof d==`function`&&(ec(t,n,d,r),l=t.memoizedState),(c=Ja||nc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Xa(e,t),o=t.memoizedProps,u=ic(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=pi,typeof l==`object`&&l&&(c=la(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&rc(t,a,r,c),Ja=!1,f=t.memoizedState,a.state=f,ro(t,r,a,i),no();var p=t.memoizedState;o!==d||f!==p||Ja||e!==null&&e.dependencies!==null&&sa(e.dependencies)?(typeof s==`function`&&(ec(t,n,s,r),p=t.memoizedState),(u=Ja||nc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&sa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Ec(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ka(t,e.child,null,i),t.child=Ka(t,null,n,i)):gc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Vc(e,t,i),e}function Ac(e,t,n,r){return Xi(),t.flags|=256,gc(e,t,n,r),t.child}var jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mc(e){return{baseLanes:e,cachePool:ka()}}function Nc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pu),e}function Pc(e,t,n){var r=t.pendingProps,i=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(yo.current&2)),s&&(i=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Hi){if(i?mo(t):_o(t),(e=Vi)?(e=Ef(e,Wi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mi===null?null:{id:Ni,overflow:Pi},retryLane:536870912,hydrationErrors:null},n=Si(e),n.return=t,t.child=n,Bi=t,Vi=null)):e=null,e===null)throw Ki(t);return Of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(_o(t),i=t.mode,c=Ic({mode:`hidden`,children:c},i),r=bi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Mc(n),r.childLanes=Nc(e,s,n),t.memoizedState=jc,xc(null,r)):(mo(t),Fc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(mo(t),t.flags&=-257,t=Lc(e,t,n)):t.memoizedState===null?(_o(t),c=r.fallback,i=t.mode,r=Ic({mode:`visible`,children:r.children},i),c=bi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ka(t,e.child,null,n),r=t.child,r.memoizedState=Mc(n),r.childLanes=Nc(e,s,n),t.memoizedState=jc,t=xc(null,r)):(_o(t),t.child=e.child,t.flags|=128,t=null);else if(mo(t),Of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Qi({value:r,source:null,stack:null}),t=Lc(e,t,n)}else if(hc||oa(e,t,n,!1),s=(n&e.childLanes)!==0,hc||s){if(s=eu,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ui(e,r),Pu(s,e,r),mc;Df(c)||Ku(),t=Lc(e,t,n)}else Df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Vi=Af(c.nextSibling),Bi=t,Hi=!0,Ui=null,Wi=!1,e!==null&&zi(t,e),t=Fc(t,r.children),t.flags|=4096);return t}return i?(_o(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=_i(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=bi(c,i,n,null),c.flags|=2):c=_i(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,xc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Mc(n):(i=c.cachePool,i===null?i=ka():(l=ha._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=Nc(e,s,n),t.memoizedState=jc,xc(e.child,r)):(mo(t),n=e.child,e=n.sibling,n=_i(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Fc(e,t){return t=Ic({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ic(e,t){return e=hi(22,e,null,t),e.lanes=0,e}function Lc(e,t,n){return Ka(t,e.child,null,n),e=Fc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ia(e.return,t,n)}function zc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Bc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=yo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,j(yo,o),gc(e,t,r,n),r=Hi?ki:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rc(e,n,t);else if(e.tag===19)Rc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&bo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),zc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&bo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}zc(t,!0,n,null,a,r);break;case`together`:zc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Vc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),uu|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(oa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=_i(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_i(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Hc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&sa(e)))}function Uc(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),na(t,ha,e.memoizedState.cache),Xi();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:na(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ho(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(mo(t),e=Vc(e,t,n),e===null?null:e.sibling):Pc(e,t,n):(mo(t),t.flags|=128,null);mo(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(oa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Bc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),j(yo,yo.current),r)break;return null;case 22:return t.lanes=0,bc(e,t,n,t.pendingProps);case 24:na(t,ha,e.memoizedState.cache)}return Vc(e,t,n)}function Wc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)hc=!0;else{if(!Hc(e,n)&&!(t.flags&128))return hc=!1,Uc(e,t,n);hc=!!(e.flags&131072)}}else hc=!1,Hi&&t.flags&1048576&&Ii(t,ki,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ia(t.elementType),t.type=e,typeof e==`function`)gi(e)?(r=ic(e,r),t.tag=1,t=kc(null,t,e,r,n)):(t.tag=0,t=Dc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=_c(null,t,e,r,n);break a}if(i===te){t.tag=14,t=vc(null,t,e,r,n);break a}}throw t=oe(e)||e,Error(a(306,t,``))}}return t;case 0:return Dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=ic(r,t.pendingProps),kc(e,t,r,i,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Xa(e,t),ro(t,r,null,n);var s=t.memoizedState;if(r=s.cache,na(t,ha,r),r!==o.cache&&aa(t,[ha],n,!0),no(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Ac(e,t,r,n);break a}if(r!==i){i=Ti(Error(a(424)),t),Qi(i),t=Ac(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Vi=Af(e.firstChild),Bi=t,Hi=!0,Ui=null,Wi=!0,n=qa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Xi(),r===i){t=Vc(e,t,n);break a}gc(e,t,r,n)}t=t.child}return t;case 26:return Ec(e,t),e===null?(n=Xf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Hi||(n=t.type,e=t.pendingProps,r=lf(me.current).createElement(n),r[pt]=t,r[mt]=e,nf(r,n,e),Et(r),t.stateNode=r):t.memoizedState=Xf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Hi&&(r=t.stateNode=Pf(t.type,t.pendingProps,me.current),Bi=t,Wi=!0,i=Vi,bf(t.type)?(jf=i,Vi=Af(r.firstChild)):Vi=i),gc(e,t,t.pendingProps.children,n),Ec(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Hi&&((i=r=Vi)&&(r=wf(r,t.type,t.pendingProps,Wi),r===null?i=!1:(t.stateNode=r,Bi=t,Vi=Af(r.firstChild),Wi=!1,i=!0)),i||Ki(t)),ve(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,ff(i,o)?r=null:s!==null&&ff(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Po(e,t,Lo,null,null,n),yp._currentValue=i),Ec(e,t),gc(e,t,r,n),t.child;case 6:return e===null&&Hi&&((e=n=Vi)&&(n=Tf(n,t.pendingProps,Wi),n===null?e=!1:(t.stateNode=n,Bi=t,Vi=null,e=!0)),e||Ki(t)),null;case 13:return Pc(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ka(t,null,r,n):gc(e,t,r,n),t.child;case 11:return _c(e,t,t.type,t.pendingProps,n);case 7:return gc(e,t,t.pendingProps,n),t.child;case 8:return gc(e,t,t.pendingProps.children,n),t.child;case 12:return gc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,na(t,t.type,r.value),gc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,ca(t),i=la(i),r=r(i),t.flags|=1,gc(e,t,r,n),t.child;case 14:return vc(e,t,t.type,t.pendingProps,n);case 15:return yc(e,t,t.type,t.pendingProps,n);case 19:return Bc(e,t,n);case 31:return Tc(e,t,n);case 22:return bc(e,t,n,t.pendingProps);case 24:return ca(t),r=la(ha),e===null?(i=Da(),i===null&&(i=eu,o=ga(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Ya(t),na(t,ha,i)):((e.lanes&n)!==0&&(Xa(e,t),ro(t,null,null,n),no()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,na(t,ha,r),r!==i.cache&&aa(t,[ha],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),na(t,ha,r))),gc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Gc(e){e.flags|=4}function Kc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Uu())e.flags|=8192;else throw La=Na,ja}}else e.flags&=-16777217}function qc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!dp(t)){if(Uu())e.flags|=8192;else throw La=Na,ja}}function Jc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,mu|=t)}function Yc(e,t){if(!Hi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Xc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Zc(e,t,n){var r=t.pendingProps;switch(Ri(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xc(t),null;case 1:return Xc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ra(ha),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Yi(t)?Gc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Zi())),Xc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Gc(t),o===null?(Xc(t),Kc(t,i,null,r,n)):(Xc(t),qc(t,o))):o?o===e.memoizedState?(Xc(t),t.flags&=-16777217):(Gc(t),Xc(t),qc(t,o)):(e=e.memoizedProps,e!==r&&Gc(t),Xc(t),Kc(t,i,e,r,n)),null;case 27:if(ye(t),n=me.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Gc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Xc(t),null}e=fe.current,Yi(t)?qi(t,e):(e=Pf(i,r,n),t.stateNode=e,Gc(t))}return Xc(t),null;case 5:if(ye(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Gc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Xc(t),null}if(o=fe.current,Yi(t))qi(t,o);else{var s=lf(me.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(nf(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Gc(t)}}return Xc(t),Kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Gc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=me.current,Yi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Bi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$d(e.nodeValue,n)),e||Ki(t,!0)}else e=lf(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Xc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Yi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[pt]=t}else Xi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xc(t),e=!1}else n=Zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(vo(t),t):(vo(t),null);if(t.flags&128)throw Error(a(558))}return Xc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Yi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[pt]=t}else Xi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xc(t),i=!1}else i=Zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(vo(t),t):(vo(t),null)}return vo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Jc(t,t.updateQueue),Xc(t),null);case 4:return _e(),e===null&&Ud(t.stateNode.containerInfo),Xc(t),null;case 10:return ra(t.type),Xc(t),null;case 19:if(de(yo),r=t.memoizedState,r===null)return Xc(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)Yc(r,!1);else{if(lu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=bo(e),o!==null){for(t.flags|=128,Yc(r,!1),e=o.updateQueue,t.updateQueue=e,Jc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vi(n,e),n=n.sibling;return j(yo,yo.current&1|2),Hi&&Fi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>bu&&(t.flags|=128,i=!0,Yc(r,!1),t.lanes=4194304)}}else{if(!i){if(e=bo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Jc(t,e),Yc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Hi)return Xc(t),null}else 2*Me()-r.renderingStartTime>bu&&n!==536870912&&(t.flags|=128,i=!0,Yc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Xc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=yo.current,j(yo,i?n&1|2:n&1),Hi&&Fi(t,r.treeForkCount),e);case 22:case 23:return vo(t),uo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Xc(t),t.subtreeFlags&6&&(t.flags|=8192)):Xc(t),n=t.updateQueue,n!==null&&Jc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&de(Ea),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ra(ha),Xc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Qc(e,t){switch(Ri(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ra(ha),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(vo(t),t.alternate===null)throw Error(a(340));Xi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(vo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Xi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(yo),null;case 4:return _e(),null;case 10:return ra(t.type),null;case 22:case 23:return vo(t),uo(),e!==null&&de(Ea),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ra(ha),null;case 25:return null;default:return null}}function $c(e,t){switch(Ri(t),t.tag){case 3:ra(ha),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&vo(t);break;case 13:vo(t);break;case 19:de(yo);break;case 10:ra(t.type);break;case 22:case 23:vo(t),uo(),e!==null&&de(Ea);break;case 24:ra(ha)}}function el(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ud(t,t.return,e)}}function tl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ud(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ud(t,t.return,e)}}function nl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ao(t,n)}catch(t){ud(e,e.return,t)}}}function rl(e,t,n){n.props=ic(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ud(e,t,n)}}function il(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ud(e,t,n)}}function al(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ud(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ud(e,t,n)}else n.current=null}}function ol(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ud(e,e.return,t)}}function sl(e,t,n){try{var r=e.stateNode;rf(r,e.type,n,t),r[mt]=t}catch(t){ud(e,e.return,t)}}function cl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bf(e.type)||e.tag===4}function ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||cl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&bf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ul(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&bf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(ul(e,t,n),e=e.sibling;e!==null;)ul(e,t,n),e=e.sibling}function dl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&bf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(dl(e,t,n),e=e.sibling;e!==null;)dl(e,t,n),e=e.sibling}function fl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);nf(t,r,n),t[pt]=e,t[mt]=n}catch(t){ud(e,e.return,t)}}var pl=!1,ml=!1,hl=!1,gl=typeof WeakSet==`function`?WeakSet:Set,_l=null;function vl(e,t){if(e=e.containerInfo,sf=Op,e=Pr(e),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(cf={focusedElem:e,selectionRange:n},Op=!1,_l=t;_l!==null;)if(t=_l,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,_l=e;else for(;_l!==null;){switch(t=_l,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=ic(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){ud(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Cf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:Cf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,_l=e;break}_l=t.return}}function yl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pl(e,n),r&4&&el(5,n);break;case 1:if(Pl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ud(n,n.return,e)}else{var i=ic(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ud(n,n.return,e)}}}r&64&&nl(n),r&512&&il(n,n.return);break;case 3:if(Pl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{ao(e,t)}catch(e){ud(n,n.return,e)}}break;case 27:t===null&&r&4&&fl(n);case 26:case 5:Pl(e,n),t===null&&r&4&&ol(n),r&512&&il(n,n.return);break;case 12:Pl(e,n);break;case 31:Pl(e,n),r&4&&Tl(e,n);break;case 13:Pl(e,n),r&4&&El(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=md.bind(null,n),kf(e,n))));break;case 22:if(r=n.memoizedState!==null||pl,!r){t=t!==null&&t.memoizedState!==null||ml,i=pl;var a=ml;pl=r,(ml=t)&&!a?Il(e,n,!!(n.subtreeFlags&8772)):Pl(e,n),pl=i,ml=a}break;case 30:break;default:Pl(e,n)}}function bl(e){var t=e.alternate;t!==null&&(e.alternate=null,bl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var xl=null,Sl=!1;function Cl(e,t,n){for(n=n.child;n!==null;)wl(e,t,n),n=n.sibling}function wl(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:ml||al(n,t),Cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ml||al(n,t);var r=xl,i=Sl;bf(n.type)&&(xl=n.stateNode,Sl=!1),Cl(e,t,n),Ff(n.stateNode),xl=r,Sl=i;break;case 5:ml||al(n,t);case 6:if(r=xl,i=Sl,xl=null,Cl(e,t,n),xl=r,Sl=i,xl!==null){if(Sl)try{(xl.nodeType===9?xl.body:xl.nodeName===`HTML`?xl.ownerDocument.body:xl).removeChild(n.stateNode)}catch(e){ud(n,t,e)}else try{xl.removeChild(n.stateNode)}catch(e){ud(n,t,e)}}break;case 18:xl!==null&&(Sl?(e=xl,xf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),em(e)):xf(xl,n.stateNode));break;case 4:r=xl,i=Sl,xl=n.stateNode.containerInfo,Sl=!0,Cl(e,t,n),xl=r,Sl=i;break;case 0:case 11:case 14:case 15:tl(2,n,t),ml||tl(4,n,t),Cl(e,t,n);break;case 1:ml||(al(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&rl(n,t,r)),Cl(e,t,n);break;case 21:Cl(e,t,n);break;case 22:ml=(r=ml)||n.memoizedState!==null,Cl(e,t,n),ml=r;break;default:Cl(e,t,n)}}function Tl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{em(e)}catch(e){ud(t,t.return,e)}}}function El(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{em(e)}catch(e){ud(t,t.return,e)}}function Dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new gl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new gl),t;default:throw Error(a(435,e.tag))}}function Ol(e,t){var n=Dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=hd.bind(null,e,t);t.then(r,r)}})}function kl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(bf(c.type)){xl=c.stateNode,Sl=!1;break a}break;case 5:xl=c.stateNode,Sl=!1;break a;case 3:case 4:xl=c.stateNode.containerInfo,Sl=!0;break a}c=c.return}if(xl===null)throw Error(a(160));wl(o,s,i),xl=null,Sl=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)jl(t,e),t=t.sibling}var Al=null;function jl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:kl(t,e),Ml(e),r&4&&(tl(3,e,e.return),el(3,e),tl(5,e,e.return));break;case 1:kl(t,e),Ml(e),r&512&&(ml||n===null||al(n,n.return)),r&64&&pl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=Al;if(kl(t,e),Ml(e),r&512&&(ml||n===null||al(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[bt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),nf(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=cp(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),nf(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=cp(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),nf(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[pt]=e,Et(o),r=o}e.stateNode=r}else lp(i,e.type,e.stateNode)}else e.stateNode=rp(i,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&sl(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?lp(i,e.type,e.stateNode):rp(i,r,e.memoizedProps))}break;case 27:kl(t,e),Ml(e),r&512&&(ml||n===null||al(n,n.return)),n!==null&&r&4&&sl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(kl(t,e),Ml(e),r&512&&(ml||n===null||al(n,n.return)),e.flags&32){i=e.stateNode;try{Qt(i,``)}catch(t){ud(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,sl(e,i,n===null?i:n.memoizedProps)),r&1024&&(hl=!0);break;case 6:if(kl(t,e),Ml(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){ud(e,e.return,t)}}break;case 3:if(sp=null,i=Al,Al=Rf(t.containerInfo),kl(t,e),Al=i,Ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{em(t.containerInfo)}catch(t){ud(e,e.return,t)}hl&&(hl=!1,Nl(e));break;case 4:r=Al,Al=Rf(e.stateNode.containerInfo),kl(t,e),Ml(e),Al=r;break;case 12:kl(t,e),Ml(e);break;case 31:kl(t,e),Ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 13:kl(t,e),Ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(vu=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=pl,d=ml;if(pl=u||i,ml=d||l,kl(t,e),ml=d,pl=u,Ml(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||pl||ml||Fl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){ud(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){ud(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?Sf(m,!0):Sf(l.stateNode,!1)}catch(e){ud(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Ol(e,n))));break;case 19:kl(t,e),Ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 30:break;case 21:break;default:kl(t,e),Ml(e)}}function Ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(cl(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;dl(e,ll(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Qt(o,``),n.flags&=-33),dl(e,ll(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;ul(e,ll(e),s);break;default:throw Error(a(161))}}catch(t){ud(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Pl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yl(e,t.alternate,t),t=t.sibling}function Fl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:tl(4,t,t.return),Fl(t);break;case 1:al(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&rl(t,t.return,n),Fl(t);break;case 27:Ff(t.stateNode);case 26:case 5:al(t,t.return),Fl(t);break;case 22:t.memoizedState===null&&Fl(t);break;case 30:Fl(t);break;default:Fl(t)}e=e.sibling}}function Il(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Il(i,a,n),el(4,a);break;case 1:if(Il(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ud(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)io(c[i],s)}catch(e){ud(r,r.return,e)}}n&&o&64&&nl(a),il(a,a.return);break;case 27:fl(a);case 26:case 5:Il(i,a,n),n&&r===null&&o&4&&ol(a),il(a,a.return);break;case 12:Il(i,a,n);break;case 31:Il(i,a,n),n&&o&4&&Tl(i,a);break;case 13:Il(i,a,n),n&&o&4&&El(i,a);break;case 22:a.memoizedState===null&&Il(i,a,n),il(a,a.return);break;case 30:break;default:Il(i,a,n)}t=t.sibling}}function Ll(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&_a(n))}function Rl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_a(e))}function zl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Bl(e,t,n,r),t=t.sibling}function Bl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:zl(e,t,n,r),i&2048&&el(9,t);break;case 1:zl(e,t,n,r);break;case 3:zl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_a(e)));break;case 12:if(i&2048){zl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){ud(t,t.return,e)}}else zl(e,t,n,r);break;case 31:zl(e,t,n,r);break;case 13:zl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?zl(e,t,n,r):(a._visibility|=2,Vl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?zl(e,t,n,r):Hl(e,t),i&2048&&Ll(o,t);break;case 24:zl(e,t,n,r),i&2048&&Rl(t.alternate,t);break;default:zl(e,t,n,r)}}function Vl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Vl(a,o,s,c,i),el(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vl(a,o,s,c,i)):u._visibility&2?Vl(a,o,s,c,i):Hl(a,o),i&&l&2048&&Ll(o.alternate,o);break;case 24:Vl(a,o,s,c,i),i&&l&2048&&Rl(o.alternate,o);break;default:Vl(a,o,s,c,i)}t=t.sibling}}function Hl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Hl(n,r),i&2048&&Ll(r.alternate,r);break;case 24:Hl(n,r),i&2048&&Rl(r.alternate,r);break;default:Hl(n,r)}t=t.sibling}}var Ul=8192;function Wl(e,t,n){if(e.subtreeFlags&Ul)for(e=e.child;e!==null;)Gl(e,t,n),e=e.sibling}function Gl(e,t,n){switch(e.tag){case 26:Wl(e,t,n),e.flags&Ul&&e.memoizedState!==null&&fp(n,Al,e.memoizedState,e.memoizedProps);break;case 5:Wl(e,t,n);break;case 3:case 4:var r=Al;Al=Rf(e.stateNode.containerInfo),Wl(e,t,n),Al=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ul,Ul=16777216,Wl(e,t,n),Ul=r):Wl(e,t,n));break;default:Wl(e,t,n)}}function Kl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ql(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];_l=r,Xl(r,e)}Kl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Jl(e),e=e.sibling}function Jl(e){switch(e.tag){case 0:case 11:case 15:ql(e),e.flags&2048&&tl(9,e,e.return);break;case 3:ql(e);break;case 12:ql(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yl(e)):ql(e);break;default:ql(e)}}function Yl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];_l=r,Xl(r,e)}Kl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:tl(8,t,t.return),Yl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yl(t));break;default:Yl(t)}e=e.sibling}}function Xl(e,t){for(;_l!==null;){var n=_l;switch(n.tag){case 0:case 11:case 15:tl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:_a(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,_l=r;else a:for(n=e;_l!==null;){r=_l;var i=r.sibling,a=r.return;if(bl(r),r===n){_l=null;break a}if(i!==null){i.return=a,_l=i;break a}_l=a}}}var Zl={getCacheForType:function(e){var t=la(ha),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return la(ha).controller.signal}},Ql=typeof WeakMap==`function`?WeakMap:Map,$l=0,eu=null,tu=null,nu=0,ru=0,iu=null,au=!1,ou=!1,su=!1,cu=0,lu=0,uu=0,du=0,fu=0,pu=0,mu=0,hu=null,gu=null,_u=!1,vu=0,yu=0,bu=1/0,xu=null,Su=null,Cu=0,wu=null,Tu=null,Eu=0,Du=0,Ou=null,ku=null,Au=0,ju=null;function Mu(){return $l&2&&nu!==0?nu&-nu:O.T===null?ut():jd()}function Nu(){if(pu===0){if(!(nu&536870912)||Hi){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),pu=e}else pu=536870912}return e=fo.current,e!==null&&(e.flags|=32),pu}function Pu(e,t,n){(e===eu&&(ru===2||ru===9)||e.cancelPendingCommit!==null)&&(Vu(e,0),Ru(e,nu,pu,!1)),rt(e,n),(!($l&2)||e!==eu)&&(e===eu&&(!($l&2)&&(du|=n),lu===4&&Ru(e,nu,pu,!1)),Cd(e))}function Fu(e,t,n){if($l&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||$e(e,t),i=r?Yu(e,t):qu(e,t,!0),o=r;do{if(i===0){ou&&!r&&Ru(e,t,0,!1);break}if(n=e.current.alternate,o&&!Lu(n)){i=qu(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=hu;var l=c.current.memoizedState.isDehydrated;if(l&&(Vu(c,s).flags|=256),s=qu(c,s,!1),s!==2){if(su&&!l){c.errorRecoveryDisabledLanes|=o,du|=o,i=4;break a}o=gu,gu=i,o!==null&&(gu===null?gu=o:gu.push.apply(gu,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Vu(e,0),Ru(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:Ru(r,t,pu,!au);break a;case 2:gu=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=vu+300-Me(),10<i)){if(Ru(r,t,pu,!au),Qe(r,0,!0)!==0)break a;Eu=t,r.timeoutHandle=hf(Iu.bind(null,r,n,gu,xu,_u,t,pu,du,mu,au,o,`Throttled`,-0,0),i);break a}Iu(r,n,gu,xu,_u,t,pu,du,mu,au,o,null,-0,0)}break}while(1);Cd(e)}function Iu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sn},Gl(t,a,d);var m=(a&62914560)===a?vu-Me():(a&4194048)===a?yu-Me():0;if(m=mp(d,m),m!==null){Eu=a,e.cancelPendingCommit=m(nd.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Ru(e,a,o,!l);return}}nd(e,t,a,n,r,i,o,s,c)}function Lu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!kr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ru(e,t,n,r){t&=~fu,t&=~du,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function zu(){return $l&6?!0:(wd(0,!1),!1)}function Bu(){if(tu!==null){if(ru===0)var e=tu.return;else e=tu,ta=ea=null,Bo(e),Ba=null,Va=0,e=tu;for(;e!==null;)$c(e.alternate,e),e=e.return;tu=null}}function Vu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,gf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Eu=0,Bu(),eu=e,tu=n=_i(e.current,null),nu=t,ru=0,iu=null,au=!1,ou=$e(e,t),su=!1,mu=pu=fu=du=uu=lu=0,gu=hu=null,_u=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return cu=t,si(),n}function Hu(e,t){So=null,O.H=Xs,t===Aa||t===Ma?(t=Ra(),ru=3):t===ja?(t=Ra(),ru=4):ru=t===mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,iu=t,tu===null&&(lu=1,cc(e,Ti(t,e.current)))}function Uu(){var e=fo.current;return e===null?!0:(nu&4194048)===nu?po===null:(nu&62914560)===nu||nu&536870912?e===po:!1}function Wu(){var e=O.H;return O.H=Xs,e===null?Xs:e}function Gu(){var e=O.A;return O.A=Zl,e}function Ku(){lu=4,au||(nu&4194048)!==nu&&fo.current!==null||(ou=!0),!(uu&134217727)&&!(du&134217727)||eu===null||Ru(eu,nu,pu,!1)}function qu(e,t,n){var r=$l;$l|=2;var i=Wu(),a=Gu();(eu!==e||nu!==t)&&(xu=null,Vu(e,t)),t=!1;var o=lu;a:do try{if(ru!==0&&tu!==null){var s=tu,c=iu;switch(ru){case 8:Bu(),o=6;break a;case 3:case 2:case 9:case 6:fo.current===null&&(t=!0);var l=ru;if(ru=0,iu=null,$u(e,s,c,l),n&&ou){o=0;break a}break;default:l=ru,ru=0,iu=null,$u(e,s,c,l)}}Ju(),o=lu;break}catch(t){Hu(e,t)}while(1);return t&&e.shellSuspendCounter++,ta=ea=null,$l=r,O.H=i,O.A=a,tu===null&&(eu=null,nu=0,si()),o}function Ju(){for(;tu!==null;)Zu(tu)}function Yu(e,t){var n=$l;$l|=2;var r=Wu(),i=Gu();eu!==e||nu!==t?(xu=null,bu=Me()+500,Vu(e,t)):ou=$e(e,t);a:do try{if(ru!==0&&tu!==null){t=tu;var o=iu;b:switch(ru){case 1:ru=0,iu=null,$u(e,t,o,1);break;case 2:case 9:if(Pa(o)){ru=0,iu=null,Qu(t);break}t=function(){ru!==2&&ru!==9||eu!==e||(ru=7),Cd(e)},o.then(t,t);break a;case 3:ru=7;break a;case 4:ru=5;break a;case 7:Pa(o)?(ru=0,iu=null,Qu(t)):(ru=0,iu=null,$u(e,t,o,7));break;case 5:var s=null;switch(tu.tag){case 26:s=tu.memoizedState;case 5:case 27:var c=tu;if(s?dp(s):c.stateNode.complete){ru=0,iu=null;var l=c.sibling;if(l!==null)tu=l;else{var u=c.return;u===null?tu=null:(tu=u,ed(u))}break b}}ru=0,iu=null,$u(e,t,o,5);break;case 6:ru=0,iu=null,$u(e,t,o,6);break;case 8:Bu(),lu=6;break a;default:throw Error(a(462))}}Xu();break}catch(t){Hu(e,t)}while(1);return ta=ea=null,O.H=r,O.A=i,$l=n,tu===null?(eu=null,nu=0,si(),lu):0}function Xu(){for(;tu!==null&&!Ae();)Zu(tu)}function Zu(e){var t=Wc(e.alternate,e,cu);e.memoizedProps=e.pendingProps,t===null?ed(e):tu=t}function Qu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Oc(n,t,t.pendingProps,t.type,void 0,nu);break;case 11:t=Oc(n,t,t.pendingProps,t.type.render,t.ref,nu);break;case 5:Bo(t);default:$c(n,t),t=tu=vi(t,cu),t=Wc(n,t,cu)}e.memoizedProps=e.pendingProps,t===null?ed(e):tu=t}function $u(e,t,n,r){ta=ea=null,Bo(t),Ba=null,Va=0;var i=t.return;try{if(pc(e,i,t,n,nu)){lu=1,cc(e,Ti(n,e.current)),tu=null;return}}catch(t){if(i!==null)throw tu=i,t;lu=1,cc(e,Ti(n,e.current)),tu=null;return}t.flags&32768?(Hi||r===1?e=!0:ou||nu&536870912?e=!1:(au=e=!0,(r===2||r===9||r===3||r===6)&&(r=fo.current,r!==null&&r.tag===13&&(r.flags|=16384))),td(t,e)):ed(t)}function ed(e){var t=e;do{if(t.flags&32768){td(t,au);return}e=t.return;var n=Zc(t.alternate,t,cu);if(n!==null){tu=n;return}if(t=t.sibling,t!==null){tu=t;return}tu=t=e}while(t!==null);lu===0&&(lu=5)}function td(e,t){do{var n=Qc(e.alternate,e);if(n!==null){n.flags&=32767,tu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){tu=e;return}tu=e=n}while(e!==null);lu=6,tu=null}function nd(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do sd();while(Cu!==0);if($l&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=oi,it(e,n,o,s,c,l),e===eu&&(tu=eu=null,nu=0),Tu=t,wu=e,Eu=n,Du=o,Ou=i,ku=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,gd(Ie,function(){return cd(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=O.T,O.T=null,i=ce.p,ce.p=2,s=$l,$l|=4;try{vl(e,t,n)}finally{$l=s,ce.p=i,O.T=r}}Cu=1,rd(),id(),ad()}}function rd(){if(Cu===1){Cu=0;var e=wu,t=Tu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=O.T,O.T=null;var r=ce.p;ce.p=2;var i=$l;$l|=4;try{jl(t,e);var a=cf,o=Pr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Nr(s.ownerDocument.documentElement,s)){if(c!==null&&Fr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Mr(s,h),v=Mr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Op=!!sf,cf=sf=null}finally{$l=i,ce.p=r,O.T=n}}e.current=t,Cu=2}}function id(){if(Cu===2){Cu=0;var e=wu,t=Tu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=ce.p;ce.p=2;var i=$l;$l|=4;try{yl(e,t.alternate,t)}finally{$l=i,ce.p=r,O.T=n}}Cu=3}}function ad(){if(Cu===4||Cu===3){Cu=0,je();var e=wu,t=Tu,n=Eu,r=ku;t.subtreeFlags&10256||t.flags&10256?Cu=5:(Cu=0,Tu=wu=null,od(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Su=null),lt(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=O.T,i=ce.p,ce.p=2,O.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{O.T=t,ce.p=i}}Eu&3&&sd(),Cd(e),i=e.pendingLanes,n&261930&&i&42?e===ju?Au++:(Au=0,ju=e):Au=0,wd(0,!1)}}function od(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_a(t)))}function sd(){return rd(),id(),ad(),cd()}function cd(){if(Cu!==5)return!1;var e=wu,t=Du;Du=0;var n=lt(Eu),r=O.T,i=ce.p;try{ce.p=32>n?32:n,O.T=null,n=Ou,Ou=null;var o=wu,s=Eu;if(Cu=0,Tu=wu=null,Eu=0,$l&6)throw Error(a(331));var c=$l;if($l|=4,Jl(o.current),Bl(o,o.current,s,n),$l=c,wd(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{ce.p=i,O.T=r,od(e,t)}}function ld(e,t,n){t=Ti(n,t),t=uc(e.stateNode,t,2),e=Qa(e,t,2),e!==null&&(rt(e,2),Cd(e))}function ud(e,t,n){if(e.tag===3)ld(e,e,n);else for(;t!==null;){if(t.tag===3){ld(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Su===null||!Su.has(r))){e=Ti(n,e),n=dc(2),r=Qa(t,n,2),r!==null&&(fc(n,r,t,e),rt(r,2),Cd(r));break}}t=t.return}}function dd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ql;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(su=!0,i.add(n),e=fd.bind(null,e,t,n),t.then(e,e))}function fd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,eu===e&&(nu&n)===n&&(lu===4||lu===3&&(nu&62914560)===nu&&300>Me()-vu?!($l&2)&&Vu(e,0):fu|=n,mu===nu&&(mu=0)),Cd(e)}function pd(e,t){t===0&&(t=tt()),e=ui(e,t),e!==null&&(rt(e,t),Cd(e))}function md(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),pd(e,n)}function hd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),pd(e,n)}function gd(e,t){return Oe(e,t)}var _d=null,vd=null,yd=!1,bd=!1,xd=!1,Sd=0;function Cd(e){e!==vd&&e.next===null&&(vd===null?_d=vd=e:vd=vd.next=e),bd=!0,yd||(yd=!0,Ad())}function wd(e,t){if(!xd&&bd){xd=!0;do for(var n=!1,r=_d;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,kd(r,a))}else a=nu,a=Qe(r,r===eu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,kd(r,a))}r=r.next}while(n);xd=!1}}function Td(){Ed()}function Ed(){bd=yd=!1;var e=0;Sd!==0&&mf()&&(e=Sd);for(var t=Me(),n=null,r=_d;r!==null;){var i=r.next,a=Dd(r,t);a===0?(r.next=null,n===null?_d=i:n.next=i,i===null&&(vd=n)):(n=r,(e!==0||a&3)&&(bd=!0)),r=i}Cu!==0&&Cu!==5||wd(e,!1),Sd!==0&&(Sd=0)}function Dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=eu,n=nu,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ru===2||ru===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),lt(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Re;break;default:n=Ie}return r=Od.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function Od(e,t){if(Cu!==0&&Cu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(sd()&&e.callbackNode!==n)return null;var r=nu;return r=Qe(e,e===eu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fu(e,r,t),Dd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?Od.bind(null,e):null)}function kd(e,t){if(sd())return null;Fu(e,t,!0)}function Ad(){vf(function(){$l&6?Oe(Pe,Td):Ed()})}function jd(){if(Sd===0){var e=ba;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),Sd=e}return Sd}function Md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:on(``+e)}function Nd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Md((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?Md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new On(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Sd!==0){var e=o?Nd(i,o):new FormData(i);Is(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Nd(i,o):new FormData(i),Is(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Fd=0;Fd<ti.length;Fd++){var Id=ti[Fd];ni(Id.toLowerCase(),`on`+(Id[0].toUpperCase()+Id.slice(1)))}ni(qr,`onAnimationEnd`),ni(Jr,`onAnimationIteration`),ni(Yr,`onAnimationStart`),ni(`dblclick`,`onDoubleClick`),ni(`focusin`,`onFocus`),ni(`focusout`,`onBlur`),ni(Xr,`onTransitionRun`),ni(Zr,`onTransitionStart`),ni(Qr,`onTransitionCancel`),ni($r,`onTransitionEnd`),At(`onMouseEnter`,[`mouseout`,`mouseover`]),At(`onMouseLeave`,[`mouseout`,`mouseover`]),At(`onPointerEnter`,[`pointerout`,`pointerover`]),At(`onPointerLeave`,[`pointerout`,`pointerover`]),kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Ld=`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(` `),Rd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Ld));function zd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ri(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ri(e)}i.currentTarget=null,a=c}}}}function Bd(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(Wd(t,e,2,!1),n.add(r))}function Vd(e,t,n){var r=0;t&&(r|=4),Wd(n,e,r,t)}var Hd=`_reactListening`+Math.random().toString(36).slice(2);function Ud(e){if(!e[Hd]){e[Hd]=!0,Dt.forEach(function(t){t!==`selectionchange`&&(Rd.has(t)||Vd(t,!1,e),Vd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hd]||(t[Hd]=!0,Vd(`selectionchange`,!1,t))}}function Wd(e,t,n,r){switch(Fp(t)){case 2:var i=kp;break;case 8:i=Ap;break;default:i=jp}n=i.bind(null,t,n,e),i=void 0,!_n||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=St(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}mn(function(){var r=a,i=ln(n),o=[];a:{var s=ei.get(e);if(s!==void 0){var c=On,u=e;switch(e){case`keypress`:if(Cn(n)===0)break a;case`keydown`:case`keyup`:c=Kn;break;case`focusin`:u=`focus`,c=Ln;break;case`focusout`:u=`blur`,c=Ln;break;case`beforeblur`:case`afterblur`:c=Ln;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Fn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=In;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Jn;break;case qr:case Jr:case Yr:c=Rn;break;case $r:c=Yn;break;case`scroll`:case`scrollend`:c=An;break;case`wheel`:c=Xn;break;case`copy`:case`cut`:case`paste`:c=zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=qn;break;case`toggle`:case`beforetoggle`:c=Zn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=hn(m,p),g!=null&&d.push(Kd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==cn&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[ht]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(u=n.relatedTarget||n.toElement,c=r,u=u?St(u):null,u!==null&&(f=l(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(c=null,u=r),c!==u)){if(d=Fn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=qn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?s:wt(c),h=u==null?s:wt(u),s=new d(g,m+`leave`,c,n,i),s.target=f,s.relatedTarget=h,g=null,St(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,c&&u)b:{for(d=Jd,p=c,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;c!==null&&Yd(o,s,c,d,!1),u!==null&&f!==null&&Yd(o,f,u,d,!0)}}a:{if(s=r?wt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var v=_r;else if(dr(s)){if(vr)v=Dr;else{v=Tr;var y=wr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&nn(r.elementType)&&(v=_r):v=Er;if(v&&=v(e,r)){fr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Jt(s,`number`,s.value)}switch(y=r?wt(r):window,e){case`focusin`:(dr(y)||y.contentEditable===`true`)&&(Lr=y,Rr=r,zr=null);break;case`focusout`:zr=Rr=Lr=null;break;case`mousedown`:Br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Br=!1,Vr(o,n,i);break;case`selectionchange`:if(Ir)break;case`keydown`:case`keyup`:Vr(o,n,i)}var b;if($n)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else sr?ar(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(nr&&n.locale!==`ko`&&(sr||x!==`onCompositionStart`?x===`onCompositionEnd`&&sr&&(b=Sn()):(yn=i,bn=`value`in yn?yn.value:yn.textContent,sr=!0)),y=qd(r,x),0<y.length&&(x=new Bn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=or(n),b!==null&&(x.data=b)))),(b=tr?cr(e,n):lr(e,n))&&(x=qd(r,`onBeforeInput`),0<x.length&&(y=new Bn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),Pd(o,e,r,n,i)}zd(o,t)})}function Kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=hn(e,n),i!=null&&r.unshift(Kd(e,i,a)),i=hn(e,t),i!=null&&r.push(Kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=hn(n,a),l!=null&&o.unshift(Kd(n,l,c))):i||(l=hn(n,a),l!=null&&o.push(Kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xd=/\r\n?/g,Zd=/\u0000|\uFFFD/g;function Qd(e){return(typeof e==`string`?e:``+e).replace(Xd,`
|
|
10
|
+
`).replace(Zd,``)}function $d(e,t){return t=Qd(t),Qd(e)===t}function ef(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Qt(e,``+r);break;case`className`:It(e,`class`,r);break;case`tabIndex`:It(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:It(e,n,r);break;case`style`:tn(e,r,o);break;case`data`:if(t!==`object`){It(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ef(e,t,`name`,i.name,i,null),ef(e,t,`formEncType`,i.formEncType,i,null),ef(e,t,`formMethod`,i.formMethod,i,null),ef(e,t,`formTarget`,i.formTarget,i,null)):(ef(e,t,`encType`,i.encType,i,null),ef(e,t,`method`,i.method,i,null),ef(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`onScroll`:r!=null&&Bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Bd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=on(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Bd(`beforetoggle`,e),Bd(`toggle`,e),Ft(e,`popover`,r);break;case`xlinkActuate`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ft(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=rn.get(n)||n,Ft(e,n,r))}}function tf(e,t,n,r,i,o){switch(n){case`style`:tn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Qt(e,``+r);break;case`onScroll`:r!=null&&Bd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Bd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ft(e,n,r)}}}function nf(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Bd(`error`,e),Bd(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ef(e,t,o,s,n,null)}}i&&ef(e,t,`srcSet`,n.srcSet,n,null),r&&ef(e,t,`src`,n.src,n,null);return;case`input`:Bd(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:ef(e,t,r,d,n,null)}}qt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Bd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ef(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Yt(e,!!r,n,!0):Yt(e,!!r,t,!1);return;case`textarea`:for(s in Bd(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:ef(e,t,s,c,n,null)}Zt(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ef(e,t,l,r,n,null)}return;case`dialog`:Bd(`beforetoggle`,e),Bd(`toggle`,e),Bd(`cancel`,e),Bd(`close`,e);break;case`iframe`:case`object`:Bd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Ld.length;r++)Bd(Ld[r],e);break;case`image`:Bd(`error`,e),Bd(`load`,e);break;case`details`:Bd(`toggle`,e);break;case`embed`:case`source`:case`link`:Bd(`error`,e),Bd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ef(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tf(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ef(e,t,c,r,n,null))}function rf(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ef(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&ef(e,t,p,m,r,f)}}Kt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ef(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&ef(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Yt(e,!!n,n?[]:``,!1):Yt(e,!!n,t,!0)):Yt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ef(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&ef(e,t,s,i,r,o)}Xt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ef(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ef(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ef(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:ef(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tf(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tf(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ef(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ef(e,t,f,p,r,m)}function af(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function of(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&af(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&af(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sf=null,cf=null;function lf(e){return e.nodeType===9?e:e.ownerDocument}function uf(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function df(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function ff(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var pf=null;function mf(){var e=window.event;return e&&e.type===`popstate`?e!==pf&&(pf=e,!0):(pf=null,!1)}var hf=typeof setTimeout==`function`?setTimeout:void 0,gf=typeof clearTimeout==`function`?clearTimeout:void 0,_f=typeof Promise==`function`?Promise:void 0,vf=typeof queueMicrotask==`function`?queueMicrotask:_f===void 0?hf:function(e){return _f.resolve(null).then(e).catch(yf)};function yf(e){setTimeout(function(){throw e})}function bf(e){return e===`head`}function xf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),em(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Ff(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Ff(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Ff(e.ownerDocument.body)}n=i}while(n);em(t)}function Sf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Cf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:Cf(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function wf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Af(e.nextSibling),e===null)break}return null}function Tf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Af(e.nextSibling),e===null))return null;return e}function Ef(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Af(e.nextSibling),e===null))return null;return e}function Df(e){return e.data===`$?`||e.data===`$~`}function Of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function kf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function Af(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var jf=null;function Mf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Af(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Nf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Pf(e,t,n){switch(t=lf(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Ff(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var If=new Map,Lf=new Set;function Rf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var zf=ce.d;ce.d={f:Bf,r:Vf,D:Wf,C:Gf,L:M,m:Kf,X:Jf,S:qf,M:Yf};function Bf(){var e=zf.f(),t=zu();return e||t}function Vf(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Rs(t):zf.r(e)}var Hf=typeof document>`u`?null:document;function Uf(e,t,n){var r=Hf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Lf.has(i)||(Lf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),nf(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Wf(e){zf.D(e),Uf(`dns-prefetch`,e,null)}function Gf(e,t){zf.C(e,t),Uf(`preconnect`,e,t)}function M(e,t,n){zf.L(e,t,n);var r=Hf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Zf(e);break;case`script`:a=tp(e)}If.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),If.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Qf(a))||t===`script`&&r.querySelector(np(a))||(t=r.createElement(`link`),nf(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Kf(e,t){zf.m(e,t);var n=Hf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=tp(e)}if(!If.has(a)&&(e=h({rel:`modulepreload`,href:e},t),If.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(np(a)))return}r=n.createElement(`link`),nf(r,`link`,e),Et(r),n.head.appendChild(r)}}}function qf(e,t,n){zf.S(e,t,n);var r=Hf;if(r&&e){var i=Tt(r).hoistableStyles,a=Zf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Qf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=If.get(a))&&ap(e,n);var c=o=r.createElement(`link`);Et(c),nf(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,ip(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Jf(e,t){zf.X(e,t);var n=Hf;if(n&&e){var r=Tt(n).hoistableScripts,i=tp(e),a=r.get(i);a||(a=n.querySelector(np(i)),a||(e=h({src:e,async:!0},t),(t=If.get(i))&&op(e,t),a=n.createElement(`script`),Et(a),nf(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Yf(e,t){zf.M(e,t);var n=Hf;if(n&&e){var r=Tt(n).hoistableScripts,i=tp(e),a=r.get(i);a||(a=n.querySelector(np(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=If.get(i))&&op(e,t),a=n.createElement(`script`),Et(a),nf(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Xf(e,t,n,r){var i=(i=me.current)?Rf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Zf(n.href),n=Tt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Zf(n.href);var o=Tt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Qf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),If.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},If.set(e,n),o||ep(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=tp(n),n=Tt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Zf(e){return`href="`+Gt(e)+`"`}function Qf(e){return`link[rel="stylesheet"][`+e+`]`}function $f(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function ep(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),nf(t,`link`,n),Et(t),e.head.appendChild(t))}function tp(e){return`[src="`+Gt(e)+`"]`}function np(e){return`script[async]`+e}function rp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),nf(r,`style`,i),ip(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Zf(n.href);var o=e.querySelector(Qf(i));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=$f(n),(i=If.get(i))&&ap(r,i),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),nf(o,`link`,r),t.state.loading|=4,ip(o,n.precedence,e),t.instance=o;case`script`:return o=tp(n.src),(i=e.querySelector(np(o)))?(t.instance=i,Et(i),i):(r=n,(i=If.get(o))&&(r=h({},n),op(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Et(i),nf(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,ip(r,n.precedence,e));return t.instance}function ip(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ap(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function op(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var sp=null;function cp(e,t,n){if(sp===null){var r=new Map,i=sp=new Map;i.set(n,r)}else i=sp,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[pt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function lp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function up(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function dp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function fp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Zf(r.href),a=t.querySelector(Qf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=hp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=$f(r),(i=If.get(i))&&ap(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),nf(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=hp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var pp=0;function mp(e,t){return e.stylesheets&&e.count===0&&_p(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&_p(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&pp===0&&(pp=62500*of());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&_p(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>pp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function hp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_p(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var gp=null;function _p(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,gp=new Map,t.forEach(vp,e),gp=null,hp.call(e))}function vp(e,t){if(!(t.state.loading&4)){var n=gp.get(e);if(n)var r=n.get(null);else{n=new Map,gp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=hp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var yp={$$typeof:C,Provider:null,Consumer:null,_currentValue:k,_currentValue2:k,_threadCount:0};function bp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function xp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new bp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=hi(3,null,null,t),e.current=a,a.stateNode=e,t=ga(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ya(a),e}function Sp(e){return e?(e=pi,e):pi}function Cp(e,t,n,r,i,a){i=Sp(i),r.context===null?r.context=i:r.pendingContext=i,r=Za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Qa(e,r,t),n!==null&&(Pu(n,e,t),$a(n,e,t))}function wp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Tp(e,t){wp(e,t),(e=e.alternate)&&wp(e,t)}function Ep(e){if(e.tag===13||e.tag===31){var t=ui(e,67108864);t!==null&&Pu(t,e,67108864),Tp(e,67108864)}}function Dp(e){if(e.tag===13||e.tag===31){var t=Mu();t=ct(t);var n=ui(e,t);n!==null&&Pu(n,e,t),Tp(e,t)}}var Op=!0;function kp(e,t,n,r){var i=O.T;O.T=null;var a=ce.p;try{ce.p=2,jp(e,t,n,r)}finally{ce.p=a,O.T=i}}function Ap(e,t,n,r){var i=O.T;O.T=null;var a=ce.p;try{ce.p=8,jp(e,t,n,r)}finally{ce.p=a,O.T=i}}function jp(e,t,n,r){if(Op){var i=Mp(r);if(i===null)Gd(e,t,r,Np,n),Wp(e,r);else if(Kp(i,e,t,n,r))r.stopPropagation();else if(Wp(e,r),t&4&&-1<Up.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}Cd(a),!($l&6)&&(bu=Me()+500,wd(0,!1))}}break;case 31:case 13:s=ui(a,2),s!==null&&Pu(s,a,2),zu(),Tp(a,2)}if(a=Mp(r),a===null&&Gd(e,t,r,Np,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gd(e,t,r,null,n)}}function Mp(e){return e=ln(e),Pp(e)}var Np=null;function Pp(e){if(Np=null,e=St(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Np=e,null}function Fp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var Ip=!1,Lp=null,Rp=null,zp=null,Bp=new Map,Vp=new Map,Hp=[],Up=`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 Wp(e,t){switch(e){case`focusin`:case`focusout`:Lp=null;break;case`dragenter`:case`dragleave`:Rp=null;break;case`mouseover`:case`mouseout`:zp=null;break;case`pointerover`:case`pointerout`:Bp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Vp.delete(t.pointerId)}}function Gp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ct(t),t!==null&&Ep(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Kp(e,t,n,r,i){switch(t){case`focusin`:return Lp=Gp(Lp,e,t,n,r,i),!0;case`dragenter`:return Rp=Gp(Rp,e,t,n,r,i),!0;case`mouseover`:return zp=Gp(zp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Bp.set(a,Gp(Bp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Vp.set(a,Gp(Vp.get(a)||null,e,t,n,r,i)),!0}return!1}function qp(e){var t=St(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,dt(e.priority,function(){Dp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,dt(e.priority,function(){Dp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Jp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Mp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=Ct(n),t!==null&&Ep(t),e.blockedOn=n,!1;t.shift()}return!0}function Yp(e,t,n){Jp(e)&&n.delete(t)}function Xp(){Ip=!1,Lp!==null&&Jp(Lp)&&(Lp=null),Rp!==null&&Jp(Rp)&&(Rp=null),zp!==null&&Jp(zp)&&(zp=null),Bp.forEach(Yp),Vp.forEach(Yp)}function Zp(e,n){e.blockedOn===n&&(e.blockedOn=null,Ip||(Ip=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Xp)))}var Qp=null;function $p(e){Qp!==e&&(Qp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Qp===e&&(Qp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Pp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Is(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function em(e){function t(t){return Zp(t,e)}Lp!==null&&Zp(Lp,e),Rp!==null&&Zp(Rp,e),zp!==null&&Zp(zp,e),Bp.forEach(t),Vp.forEach(t);for(var n=0;n<Hp.length;n++){var r=Hp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Hp.length&&(n=Hp[0],n.blockedOn===null);)qp(n),n.blockedOn===null&&Hp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||$p(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(Pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),$p(n)}}}function tm(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function nm(e){this._internalRoot=e}rm.prototype.render=nm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;Cp(n,Mu(),e,t,null,null)},rm.prototype.unmount=nm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cp(e.current,2,null,e,null,null),zu(),t[ht]=null}};function rm(e){this._internalRoot=e}rm.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Hp.length&&t!==0&&t<Hp[n].priority;n++);Hp.splice(n,0,e),n===0&&qp(e)}};var im=n.version;if(im!==`19.2.8`)throw Error(a(527,im,`19.2.8`));ce.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var am={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var om=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!om.isDisabled&&om.supportsFiber)try{Ve=om.inject(am),He=om}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=ac,o=oc,c=sc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=xp(e,1,!1,null,null,n,r,null,i,o,c,tm),e[ht]=t.current,Ud(e),new nm(t)}})),u=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=l()})),d=i(),f=u(),p=(0,d.createContext)(`dark`),m=()=>(0,d.useContext)(p),h=`pi-outpost:theme`;function g(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function _(){let e=localStorage.getItem(h);return e===`light`||e===`dark`||e===`system`?e:null}function v(e){localStorage.setItem(h,e)}function y(e,t,n=document.documentElement,r){let i=t?_():null,[a,o]=(0,d.useState)(r??i??e),s=(0,d.useRef)(r!==void 0||i!==null);(0,d.useEffect)(()=>{s.current||o(e)},[e]),(0,d.useEffect)(()=>{function e(e){let t=e.data;t?.type===`pi-outpost:set-theme`&&(t.theme===`light`||t.theme===`dark`||t.theme===`system`)&&(s.current=!0,o(t.theme))}return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[]);let[c,l]=(0,d.useState)(g);(0,d.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>l(e.matches?`dark`:`light`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let u=a===`system`?c:a;(0,d.useLayoutEffect)(()=>{n.dataset.theme=u},[n,u]);let f=(0,d.useCallback)(e=>{s.current=!0,o(e),t&&v(e)},[t]);return{theme:u,toggle:(0,d.useCallback)(()=>f(u===`dark`?`light`:`dark`),[u,f]),setTheme:f}}var b=e=>e.split(/\r?\n/);function x(e,t){return e!==t&&b(e).join(`
|
|
11
|
+
`)===b(t).join(`
|
|
12
|
+
`)}function S(e,t){let n=b(e),r=b(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)a--,o--;let s=n.slice(i,a),c=r.slice(i,o),l=n.slice(0,i).map(e=>({type:`same`,text:e}));if(s.length*c.length>9e4)l.push(...s.map(e=>({type:`del`,text:e}))),l.push(...c.map(e=>({type:`add`,text:e})));else{let e=s.length,t=c.length,n=Array.from({length:e+1},()=>Array(t+1).fill(0));for(let r=e-1;r>=0;r--)for(let e=t-1;e>=0;e--)n[r][e]=s[r]===c[e]?n[r+1][e+1]+1:Math.max(n[r+1][e],n[r][e+1]);let r=0,i=0;for(;r<e&&i<t;)s[r]===c[i]?(l.push({type:`same`,text:s[r]}),r++,i++):n[r+1][i]>=n[r][i+1]?(l.push({type:`del`,text:s[r]}),r++):(l.push({type:`add`,text:c[i]}),i++);for(;r<e;)l.push({type:`del`,text:s[r++]});for(;i<t;)l.push({type:`add`,text:c[i++]})}return l.push(...n.slice(a).map(e=>({type:`same`,text:e}))),l}function C(e){let t=[],n=0;for(;n<e.length;){if(e[n].type===`same`){t.push({left:e[n].text,right:e[n].text,changed:!1}),n++;continue}let r=[],i=[];for(;n<e.length&&e[n].type===`del`;)r.push(e[n++].text);for(;n<e.length&&e[n].type===`add`;)i.push(e[n++].text);for(let e=0;e<Math.max(r.length,i.length);e++)t.push({left:e<r.length?r[e]:null,right:e<i.length?i[e]:null,changed:!0})}return t}function w(e,t=2){let n=Array(e.length).fill(!1);e.forEach((r,i)=>{if(r.changed)for(let r=Math.max(0,i-t);r<=Math.min(e.length-1,i+t);r++)n[r]=!0});let r=[],i=!1;return e.forEach((e,t)=>{n[t]?(r.push(e),i=!1):i||=(r.push(null),!0)}),r}function T(e,t=2){let n=Array(e.length).fill(!1);e.forEach((r,i)=>{if(r.type!==`same`)for(let r=Math.max(0,i-t);r<=Math.min(e.length-1,i+t);r++)n[r]=!0});let r=[],i=!1;return e.forEach((e,t)=>{n[t]?(r.push(e),i=!1):i||=(r.push(null),!0)}),r}function ee(e,t,n,r){let i=e.indexOf(n,t);if(i===-1)return-1;let a=e.slice(t,i);return a.includes(r)||a.includes(`
|
|
13
|
+
|
|
14
|
+
`)?-1:i}function te(e){if(!e.includes(`\\(`)&&!e.includes(`\\[`)&&!e.includes(`\\)`)&&!e.includes(`\\]`))return e;let t=[],n=0;for(;n<e.length;){if(e.startsWith("```",n)){let r=e.indexOf("```",n+3);if(r===-1){t.push(e.slice(n));break}t.push(e.slice(n,r+3)),n=r+3;continue}if(e[n]==="`"){let r=e.indexOf("`",n+1);if(r!==-1&&!e.slice(n+1,r).includes(`
|
|
15
|
+
`)){t.push(e.slice(n,r+1)),n=r+1;continue}}if(e.startsWith(`\\[`,n)){let r=e.indexOf(`\\]`,n+2);if(r!==-1){t.push(`$$`,e.slice(n+2,r),`$$`),n=r+2;continue}let i=ee(e,n+2,`$$`,`\\[`);if(i!==-1){t.push(`$$`,e.slice(n+2,i),`$$`),n=i+2;continue}}if(e.startsWith(`\\(`,n)){let r=e.indexOf(`\\)`,n+2);if(r!==-1){t.push(`$`,e.slice(n+2,r),`$`),n=r+2;continue}let i=ee(e,n+2,`$`,`\\(`);if(i!==-1){t.push(`$`,e.slice(n+2,i),`$`),n=i+1;continue}}if(e.startsWith(`$$`,n)){let r=ee(e,n+2,`\\]`,`\\[`),i=e.indexOf(`$$`,n+2);if(r!==-1&&(i===-1||r<i)){t.push(`$$`,e.slice(n+2,r),`$$`),n=r+2;continue}}if(e[n]===`$`){let r=ee(e,n+1,`\\)`,`\\(`),i=e.indexOf(`$`,n+1);if(r!==-1&&(i===-1||r<i)){t.push(`$`,e.slice(n+1,r),`$`),n=r+2;continue}}t.push(e[n]),n++}return t.join(``)}function E(e){let t=`
|
|
16
|
+
… [truncated,`,n=e.includes(t)?e.split(t)[0]:e;try{return JSON.parse(n)}catch{}let r=0,i=-1,a=-1;for(let e=0;e<n.length;e++)if(n[e]===`{`&&r++,n[e]===`}`&&(r--,a=e,r===0)){i=e;break}if(i>0)try{return JSON.parse(n.slice(0,i+1))}catch{return}if(a>0)try{return JSON.parse(n.slice(0,a+1))}catch{return}}function ne(e){let t=E(e);if(typeof t==`string`)return t;if(typeof t!=`object`||!t)return;let n=t.__pi_render;if(n?.text!==void 0&&n.text!==null)return String(n.text)}function re(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`//`)}function ie(e,t){let n=t.split(/[?#]/)[0],r=n.startsWith(`/`)?n.split(`/`):[...e.split(`/`).slice(0,-1),...n.split(`/`)],i=[];for(let e of r)e!==``&&e!==`.`&&(e===`..`?i.pop():i.push(e));return i.join(`/`)}function ae(e){return/\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function D(e){return/\.pdf$/i.test(e)}function oe(e){return/\.(docx|xlsx|pptx|msg|eml|emlx)$/i.test(e)}function se(e,t,n,r,i){let a=n?`&token=${encodeURIComponent(n)}`:``,o=r===void 0?``:`&v=${encodeURIComponent(String(r))}`,s=i===void 0?``:`&workspace=${encodeURIComponent(i)}`;return`${e}/files/raw?path=${encodeURIComponent(t)}${a}${o}${s}`}function O(e){return e?e.id??e.root:void 0}var ce=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),k=n(((e,t)=>{t.exports=ce()})),A=k();function le({text:e,className:t,iconOnly:n=!1}){let[r,i]=(0,d.useState)(!1);async function a(){try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}}return(0,A.jsx)(`button`,{type:`button`,onClick:a,title:r?`Copied!`:n?`Copy code`:`Copy`,"aria-label":n?r?`Copied`:`Copy code`:void 0,className:t??`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:n?r?`✓`:`⧉`:r?`✓ copied`:`⧉ copy`})}var ue=`modulepreload`,de=function(e){return`/`+e},j={},fe=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=de(t,n),t=s(t),t in j)return;j[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ue,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},pe=null,me={javascript:()=>fe(()=>import(`./javascript-8AmHuH5O.js`),[]),typescript:()=>fe(()=>import(`./typescript-CxkPLmSc.js`),[]),json:()=>fe(()=>import(`./json-PmyKWHmm.js`),[]),xml:()=>fe(()=>import(`./xml-COl5yFSC.js`),[]),css:()=>fe(()=>import(`./css-D8M8GYaw.js`),[]),scss:()=>fe(()=>import(`./scss-gOyOKiXd.js`),[]),bash:()=>fe(()=>import(`./bash-LmRjUKlR.js`),[]),python:()=>fe(()=>import(`./python-gHmu6VPG.js`),[]),go:()=>fe(()=>import(`./go-CYstVVJV.js`),[]),rust:()=>fe(()=>import(`./rust-BIKPVoi6.js`),[]),java:()=>fe(()=>import(`./java-Dde-Wnb4.js`),[]),c:()=>fe(()=>import(`./c-DBVbJFpC.js`),[]),cpp:()=>fe(()=>import(`./cpp-N2d8M7Nc.js`),[]),csharp:()=>fe(()=>import(`./csharp-yYt0Ikks.js`),[]),ruby:()=>fe(()=>import(`./ruby-BGpZ3p4_.js`),[]),php:()=>fe(()=>import(`./php-DuZl5e-L.js`),[]),sql:()=>fe(()=>import(`./sql-DWRKyvJ-.js`),[]),yaml:()=>fe(()=>import(`./yaml-DjOhhVLG.js`),[]),ini:()=>fe(()=>import(`./ini-B1CroMsf.js`),[]),dockerfile:()=>fe(()=>import(`./dockerfile-C0zufGsU.js`),[]),markdown:()=>fe(()=>import(`./markdown-D6FrnlqJ.js`),[]),plaintext:()=>fe(()=>import(`./plaintext-YB8mb-y7.js`),[])};async function he(){return pe||=(async()=>{let{default:e}=await fe(async()=>{let{default:e}=await import(`./core-BrZcom_y.js`);return{default:e}},__vite__mapDeps([0,1]));return await Promise.all(Object.entries(me).map(async([t,n])=>{let r=await n();e.registerLanguage(t,r.default)})),e})(),pe}var ge={ts:`typescript`,tsx:`typescript`,mts:`typescript`,cts:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,html:`xml`,htm:`xml`,xml:`xml`,svg:`xml`,css:`css`,scss:`scss`,sh:`bash`,bash:`bash`,zsh:`bash`,py:`python`,go:`go`,rs:`rust`,java:`java`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,cs:`csharp`,rb:`ruby`,php:`php`,sql:`sql`,yaml:`yaml`,yml:`yaml`,ini:`ini`,toml:`ini`,dockerfile:`dockerfile`,md:`markdown`,markdown:`markdown`};function _e(e){let t=e.split(`/`).pop()??e;if(/^dockerfile$/i.test(t))return`dockerfile`;let n=t.lastIndexOf(`.`);if(!(n<0))return ge[t.slice(n+1).toLowerCase()]}var ve=(0,d.memo)(function({code:e,path:t,onRendered:n}){let[r,i]=(0,d.useState)(null),a=(0,d.useRef)(e);a.current=e;let o=(0,d.useRef)(n);return o.current=n,(0,d.useEffect)(()=>{let e=!1;return i(null),he().then(n=>{if(e)return;let r=_e(t),s=r&&n.getLanguage(r)?n.highlight(a.current,{language:r}):n.highlightAuto(a.current);i(s.value),o.current?.()}),()=>{e=!0}},[e,t]),r===null?(0,A.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs text-zinc-700 dark:text-zinc-300`,children:e}):(0,A.jsx)(`pre`,{className:`hljs whitespace-pre-wrap font-mono text-xs text-zinc-700 dark:text-zinc-300`,dangerouslySetInnerHTML:{__html:r}})}),ye=c();function be(e){if(e==null)return;if(!(e.getRootNode()instanceof ShadowRoot))return globalThis.document.body;let t=e;for(;t.parentElement!==null;)t=t.parentElement;return t}function xe({label:e,open:t,onClose:n,children:r,actions:i,containerRef:a,anchorRef:o,testId:s=`structured-enlarged`}){(0,d.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]);let c=(0,d.useRef)(void 0);return c.current=be(o?.current)??c.current,t?(0,ye.createPortal)((0,A.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`${e}, full size`,"data-testid":s,onClick:n,className:`fixed inset-0 z-[100] flex items-center justify-center overflow-auto bg-black/60 p-6`,children:(0,A.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`max-h-full w-auto max-w-[95vw] overflow-auto rounded-lg bg-white p-4 shadow-xl dark:bg-zinc-900`,children:[(0,A.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-4`,children:[(0,A.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i,(0,A.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded px-2 py-0.5 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:`✕`})]})]}),(0,A.jsx)(`div`,{ref:a,className:`[&_svg]:!max-w-none`,children:r})]})}),c.current??globalThis.document.body):null}var Se=.8;function Ce(e){return e===`landscape`?`portrait`:`landscape`}function we(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=710?`landscape`:t<=e*Se?`portrait`:`landscape`}var Te=[`LR`,`RL`];function Ee(e){return Te.includes(e)?`landscape`:`portrait`}function De(e){switch(e){case`LR`:return`TB`;case`TB`:return`LR`;case`RL`:return`BT`;case`BT`:return`RL`}}function Oe(e){let t=e.toUpperCase();return t===`TD`?`TB`:t===`TB`||t===`BT`||t===`LR`||t===`RL`?t:void 0}function ke(e){let t=0;if(e[0]?.trim()===`---`){let n=e.findIndex((e,t)=>t>0&&e.trim()===`---`);if(n===-1)return-1;t=n+1}for(;t<e.length;t+=1){let n=e[t].trim();if(!(n===``||n.startsWith(`%%`)))return t}return-1}function Ae(e){let t=e.split(`
|
|
17
|
+
`),n=ke(t);if(n===-1)return;let r=t[n],i=/^(\s*)(flowchart|graph)([ \t]+(TD|TB|BT|LR|RL)\b)?(.*)$/i.exec(r);if(i!==null){let[,e,r,,a,o]=i,s=a===void 0?`TB`:Oe(a),c=De(s),l=[...t];return l[n]=`${e}${r} ${c}${o}`,{direction:s,turned:l.join(`
|
|
18
|
+
`)}}let a=/^(\s*)stateDiagram(-v2)?\s*$/i.exec(r);if(a!==null)return je(t,n,a[1])}function je(e,t,n){let r=0;for(let n=t+1;n<e.length;n+=1){let t=e[n],i=r===0?/^\s*direction\s+(TD|TB|BT|LR|RL)\s*$/i.exec(t):null;if(i!==null){let r=Oe(i[1]),a=[...e];return a[n]=t.replace(/(direction\s+)(TD|TB|BT|LR|RL)/i,`$1${De(r)}`),{direction:r,turned:a.join(`
|
|
19
|
+
`)}}r+=(t.match(/\{/g)?.length??0)-(t.match(/\}/g)?.length??0),r<0&&(r=0)}let i=[...e];return i.splice(t+1,0,`${n} direction LR`),{direction:`TB`,turned:i.join(`
|
|
20
|
+
`)}}var Me=Promise.resolve();function Ne(e){let t=Me.then(e,e);return Me=t.then(()=>void 0,()=>void 0),t}var Pe=null;async function Fe(e){let t=await(Pe??=fe(()=>import(`./mermaid.core-FqGqI1ho.js`).then(e=>e.t),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])));return t.default.initialize({startOnLoad:!1,theme:e,look:`classic`,securityLevel:`strict`,suppressErrorRendering:!0}),t}function Ie(e){let t=/viewBox="\s*[\d.-]+[\s,]+[\d.-]+[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e),n=t?Number(t[1]):NaN;return Number.isFinite(n)&&n>0?n:void 0}function Le(e,t){if(typeof e!=`object`||!e||!(`props`in e))return null;let n=e.props;if(t!==void 0&&!RegExp(`\\blanguage-${t}\\b`).test(n.className??``))return null;let r=n.children;return typeof r==`string`?r:Array.isArray(r)&&r.every(e=>typeof e==`string`)?r.join(``):null}function Re(e){let t=Le(e,`mermaid`);return t===null?null:t.trim()}function ze(e){let{children:t,...n}=e,r=Re(t);if(r!==null)return(0,A.jsx)(Be,{code:r});let i=Le(t);return i===null?(0,A.jsx)(`pre`,{...n,children:t}):(0,A.jsxs)(`div`,{className:`code-block relative`,"data-testid":`code-block`,children:[(0,A.jsx)(`pre`,{...n,children:t}),(0,A.jsx)(le,{iconOnly:!0,text:i.replace(/\n$/,``),className:`absolute right-1.5 top-1.5 rounded border border-zinc-300 bg-white/80 px-1.5 py-0.5 text-xs text-zinc-500 hover:text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900/80 dark:text-zinc-400 dark:hover:text-zinc-100`})]})}function Be({code:e}){let t=(0,d.useId)().replace(/[^a-zA-Z0-9]/g,``),n=m()===`light`?`default`:`dark`,[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1),f=(0,d.useMemo)(()=>Ae(e),[e]),p=f===void 0?`landscape`:Ee(f.direction),[h,g]=(0,d.useState)(void 0),_=r?.svg??null,v=r!==null&&r.orientation!==p,y=(0,d.useRef)(null),b=(0,d.useRef)(e);return b.current=e,(0,d.useEffect)(()=>{let e=!1,r=setTimeout(()=>void Ne(async()=>{try{let r=(await Fe(n)).default,a=b.current,s=Ae(a),c=s===void 0?`landscape`:Ee(s.direction);if(h!==void 0&&s!==void 0){let n=h===c?a:s.turned,{svg:l}=await r.render(`mermaid-${t}`,n);e||(i({svg:l,orientation:h}),o(null));return}let l=await r.render(`mermaid-${t}`,a),u={svg:l.svg,orientation:c},d=Ie(l.svg);if(s!==void 0&&d!==void 0&&d>710){let e=await r.render(`mermaid-${t}-turned`,s.turned),n=Ie(e.svg);if(n!==void 0){let t=c===`landscape`?we(d,n):we(n,d);t!==c&&(u={svg:e.svg,orientation:t})}}e||(i(u),o(null))}catch(t){e||o(t instanceof Error?t.message:String(t))}}),300);return()=>{e=!0,clearTimeout(r)}},[e,t,n,h]),_?(0,A.jsxs)(`div`,{ref:y,className:`group relative my-2 rounded-lg border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-800 dark:bg-zinc-900`,children:[(0,A.jsx)(`div`,{className:`absolute left-2 top-2 z-10 opacity-0 transition-opacity group-hover:opacity-100`,children:(0,A.jsx)(`button`,{type:`button`,onClick:()=>c(!s),title:s?`Show diagram`:`Show code`,className:`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:s?`⚏ diagram`:`⌗ code`})}),(0,A.jsxs)(`div`,{className:`absolute right-2 top-2 z-10 flex items-center gap-2 opacity-0 transition-opacity group-hover:opacity-100`,children:[!s&&f!==void 0&&r!==null&&(0,A.jsx)(`button`,{type:`button`,"data-testid":`mermaid-orientation`,onClick:()=>g(e=>Ce(e??r.orientation)),title:r.orientation===`portrait`?`Turn it across the page — it is drawn down`:`Turn it down the page — it is drawn across`,"aria-label":`Turn the diagram ${Ce(r.orientation)}`,className:`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:r.orientation===`portrait`?`↔ landscape`:`↕ portrait`}),!s&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>u(!0),"aria-label":`Show diagram at full size`,className:`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:`⤢ enlarge`}),(0,A.jsx)(le,{text:e})]}),s?(0,A.jsx)(`pre`,{className:`overflow-x-auto font-mono text-xs text-zinc-500 dark:text-zinc-400`,children:e}):(0,A.jsx)(`div`,{className:`flex justify-center overflow-x-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:_}}),v&&!s&&(0,A.jsxs)(`div`,{className:`mt-1 text-center text-xs text-zinc-400 dark:text-zinc-600`,"data-testid":`mermaid-turned`,children:[`drawn `,r?.orientation,` to fit — the source asks for `,p]}),(0,A.jsx)(xe,{label:`diagram`,testId:`mermaid-enlarged`,open:l,onClose:()=>u(!1),anchorRef:y,children:(0,A.jsx)(`div`,{style:{width:Ie(_)},className:`[&_svg]:!h-auto [&_svg]:!max-w-none [&_svg]:!w-full`,dangerouslySetInnerHTML:{__html:_}})})]}):(0,A.jsxs)(`pre`,{className:`my-2 overflow-x-auto rounded-lg border border-zinc-200 bg-zinc-50 p-3 font-mono text-xs text-zinc-500 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-400`,children:[e,a&&(0,A.jsx)(`div`,{className:`mt-2 text-red-600 dark:text-red-400`,children:a})]})}function Ve({html:e,className:t=``,as:n=`div`}){return(0,A.jsx)(n,{className:`rendered-ansi overflow-x-auto font-mono text-xs leading-relaxed [&_span]:whitespace-pre-wrap ${t}`,dangerouslySetInnerHTML:{__html:e}})}function He({lines:e,fill:t=!1}){return(0,A.jsx)(`div`,{className:`overflow-auto rounded border border-zinc-200 font-mono text-xs leading-relaxed dark:border-zinc-800 ${t?`max-h-full`:`max-h-72`}`,children:w(C(e)).map((e,t)=>e===null?(0,A.jsx)(`div`,{className:`bg-zinc-100 px-2 text-center text-zinc-400 dark:bg-zinc-800/60 dark:text-zinc-600`,children:`⋯`},t):(0,A.jsxs)(`div`,{className:`grid grid-cols-2`,children:[(0,A.jsx)(`div`,{className:`whitespace-pre-wrap break-words border-r border-zinc-200 px-2 dark:border-zinc-800 ${e.changed?e.left===null?`bg-zinc-50 dark:bg-zinc-900/40`:`bg-red-50 text-red-700 dark:bg-red-950/40 dark:text-red-300`:`text-zinc-500 dark:text-zinc-500`}`,children:e.left??` `}),(0,A.jsx)(`div`,{className:`whitespace-pre-wrap break-words px-2 ${e.changed?e.right===null?`bg-zinc-50 dark:bg-zinc-900/40`:`bg-emerald-50 text-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300`:`text-zinc-500 dark:text-zinc-500`}`,children:e.right??` `})]},t))})}function Ue({lines:e}){return(0,A.jsx)(`pre`,{className:`max-h-72 overflow-auto rounded border border-zinc-200 font-mono text-xs leading-relaxed dark:border-zinc-800`,children:T(e).map((e,t)=>e===null?(0,A.jsx)(`div`,{className:`bg-zinc-100 px-2 text-center text-zinc-400 dark:bg-zinc-800/60 dark:text-zinc-600`,children:`⋯`},t):(0,A.jsxs)(`div`,{className:e.type===`add`?`bg-emerald-50 px-2 text-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300`:e.type===`del`?`bg-red-50 px-2 text-red-700 dark:bg-red-950/40 dark:text-red-300`:`px-2 text-zinc-500 dark:text-zinc-500`,children:[e.type===`add`?`+ `:e.type===`del`?`− `:` `,e.text]},t))})}function We({item:e,canEdit:t,onEdit:n}){let[r,i]=(0,d.useState)(null),a=(0,d.useRef)(null),o=t&&e.entryId!==void 0,s=r!==null;(0,d.useEffect)(()=>{s&&a.current?.focus()},[s]),(0,d.useEffect)(()=>{i(null)},[e.entryId,e.text]);function c(){let a=r?.trim();if(!(!t||!e.entryId||!a)){if(a===e.text){i(null);return}n(e.entryId,a,e.images),i(null)}}return(0,A.jsxs)(`div`,{className:`group ml-auto flex max-w-[85%] items-start gap-1.5`,children:[o&&!s&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>i(e.text),title:`edit this prompt and ask again (branches the conversation)`,"aria-label":`Edit this prompt`,className:`mt-1.5 shrink-0 rounded px-1 py-0.5 text-xs text-zinc-400 opacity-0 hover:bg-zinc-200 hover:text-zinc-700 focus-visible:opacity-100 group-hover:opacity-100 dark:text-zinc-500 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`,children:`✎`}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1 rounded-xl bg-blue-100 px-4 py-2 text-[15px] text-blue-950 dark:bg-blue-950/60 dark:text-zinc-100`,children:[e.images&&e.images.length>0&&(0,A.jsx)(`div`,{className:`mb-1.5 flex flex-wrap gap-1.5`,children:e.images.map((e,t)=>(0,A.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.data}`,alt:``,className:`max-h-48 max-w-full rounded-lg object-contain`},t))}),s?(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`textarea`,{ref:a,value:r,"aria-label":`Edit prompt`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),c()),e.key===`Escape`&&i(null)},rows:Math.min(10,Math.max(2,r.split(`
|
|
21
|
+
`).length)),className:`w-full resize-none rounded-md bg-white/70 px-2 py-1 text-[15px] outline-none ring-1 ring-blue-300 dark:bg-zinc-900/60 dark:ring-blue-900`}),(0,A.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-end gap-2 text-xs`,children:[(0,A.jsx)(`span`,{className:`mr-auto text-blue-900/70 dark:text-zinc-400`,children:t?`asks again from here — the current answer moves to its own branch`:`waiting: the agent is running (or the connection dropped)`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>i(null),className:`rounded border border-blue-300 px-2 py-0.5 hover:bg-white/60 dark:border-zinc-700 dark:hover:bg-zinc-800`,children:`cancel`}),(0,A.jsx)(`button`,{type:`button`,onClick:c,disabled:!t||!r.trim()||r.trim()===e.text,className:`rounded border border-blue-400 bg-white/70 px-2 py-0.5 font-medium disabled:opacity-50 dark:border-blue-800 dark:bg-zinc-900/60`,children:`send`})]})]}):(0,A.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e.text})]})]})}var Ge=`urn:structured-exchange:1`,Ke=[`graph`,`sequence`];function qe(e){return Je(e)?[`graph`,`sequence`,`table`]:Ke}function Je(e){return e===`urn:structured-exchange:2`||e===`urn:structured-exchange:3`}function Ye(e){if(Array.isArray(e))return{cells:e};let t=e.heading;return typeof t==`string`?{cells:[],role:e.role,heading:t}:{cells:e.cells,role:e.role}}var Xe={nodes:500,edges:2e3,participants:100,messages:1e3,columns:50,rows:5e3,removals:500,ref:200,localId:200,label:500,kind:100,kindsPerVocabulary:64,columnName:200,cell:1e3},Ze=`urn:structured-exchange:2`,Qe={profile:200,attributesPerItem:50,removeAttributesPerItem:50,attributeName:200,attributeString:1e3,attributeListItems:50,revision:200,locationsPerItem:10,uri:2e3,position:1e6,artifactsPerItem:20,artifactsPerDocument:50,artifactRel:100,artifactMediaType:100,artifactLabel:500,artifactDigest:71,relations:2e3,heading:500,headingDepth:6,viewpoints:20,viewpointConcern:500},$e=8e6,et=`urn:structured-exchange:3`,tt=[Ge,Ze,et];function nt(e){return tt.find(t=>t===e)}var rt=4e6,it=Math.max(rt,$e);function at(e){return Je(e)?$e:rt}var ot=e=>new TextEncoder().encode(e).length;function st(e){return e===`bytes`?it:e===`relations`?Qe.relations:Xe[e]}function ct(e,t){let n=st(e),r=t?.[e];return r===void 0||r>=n?{limit:n,level:`ceiling`}:{limit:r,level:`deployment`}}function lt(e,t,n){let r=ot(e),i=ct(`bytes`,t),a=n===void 0?1/0:at(n),o=Math.min(i.limit,a),s=o===a&&a<i.limit?`ceiling`:i.level;if(!(r<=o))return{rule:`document-too-large`,path:``,message:`document is ${r} bytes, past the ${o}-byte ${s===`ceiling`?`contract ceiling`:`limit this deployment applies`}`,limit:o,observed:r,level:s}}var ut={graph:[`nodes`,`edges`],sequence:[`participants`,`messages`],table:[`columns`,`rows`,`relations`]};function dt(e,t){if(t===void 0)return[];let n=[];for(let r of ut[e.kind]??[]){let i=e.data[r];if(!Array.isArray(i))continue;let{limit:a,level:o}=ct(r,t);o===`deployment`&&i.length>a&&n.push({rule:`collection-past-deployment-limit`,path:`/data/${r}`,message:`${r} has ${i.length} entries, past the ${a} this deployment allows`,limit:a,observed:i.length,level:o})}return n}function ft(e,t){let n={};for(let t of ut[e.kind]??[]){let r=e.data[t];Array.isArray(r)&&(n[t]=r.length)}return{kind:e.kind,bytes:ot(t),counts:n}}var pt=6.6,mt=5.4;function ht(e,t,n){let r=e.flatMap(e=>e.split(/\r?\n/)).reduce((e,t)=>Math.max(e,t.length),0);return Math.min(Math.max(r*pt+22,t),n)}function gt(e,t,n,r){let i=t.map(e=>bt(e).length).reduce((e,t)=>Math.max(e,t),0);return Math.max(ht(e,n,r),Math.min(i*mt+22,r))}function _t(e,t,n=pt){let r=Math.max(Math.floor((t-22)/n+1e-6),4),i=[],a=e.split(/\r?\n/);if(a.length>1)return a.flatMap(e=>_t(e,t,n)).slice(0,3);let o=``;for(let t of e.split(/\s+/)){let e=o===``?t:`${o} ${t}`;if(e.length<=r){o=e;continue}for(o!==``&&i.push(o),o=t;o.length>r&&i.length<3;)i.push(o.slice(0,r)),o=o.slice(r)}if(o!==``&&i.push(o),i.length===0)return[``];if(i.length<=3)return i;let s=i.slice(0,3);return s[2]=`${s[2].slice(0,Math.max(r-1,1))}…`,s}function vt(e,t){return e*15+t*15+14}function yt(e,t){return e.flatMap(e=>_t(bt(e),t,mt))}function bt(e){return`${e.field}: ${e.from===void 0?``:`${e.from} → `}${e.to}`}function xt(e,t){return`${e}: ${St(t)}`}function St(e){return Array.isArray(e)?e.map(e=>St(e)).join(`, `):e===null?`null`:typeof e==`object`&&e&&typeof e.ref==`string`?`<${e.ref}>`:String(e)}function Ct(e){let t=e.range===void 0?``:` lines ${e.range.startLine}–${e.range.endLine}`,n=e.revision===void 0?``:` at ${e.revision}`;return`${e.uri}${t}${n}`}function wt(e){let t=e.label===void 0?e.uri:`${e.label} (${e.uri})`,n=e.mediaType===void 0?``:`, ${e.mediaType}`;return`${e.rel}: ${t}${n} — ${e.sha256.slice(0,14)}…`}var Tt=864e5,Et=/^(\d{4})-(\d{2})-(\d{2})$/;function Dt(e){let t=Et.exec(e);if(t===null)return;let[n,r,i]=[Number(t[1]),Number(t[2]),Number(t[3])],a=new Date(Date.UTC(n,r-1,i));if(a.setUTCFullYear(n,r-1,i),a.getUTCFullYear()===n&&a.getUTCMonth()===r-1&&a.getUTCDate()===i)return Math.round(a.getTime()/Tt)}function Ot(e){let t=new Date(e*Tt);return`${String(t.getUTCFullYear()).padStart(4,`0`)}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`}function kt(e=new Date){return Math.round(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())/Tt)}function At(e){let t=Dt(e.type===`activity`?e.start:e.date),n=Dt(e.type===`activity`?e.end:e.date);return t===void 0||n===void 0?void 0:{start:t,end:n}}function jt(e){let t=new Map;return e.rows.forEach((e,n)=>{e.type===`task`&&(t.has(e.id)||t.set(e.id,{id:e.id,type:`task`,row:n,days:Mt(e)}),e.items.forEach((e,r)=>{e.id===void 0||t.has(e.id)||t.set(e.id,{id:e.id,type:e.type,row:n,item:r,days:At(e)})}))}),t}function Mt(e){let t;for(let n of e.items){let e=At(n);e!==void 0&&(t=t===void 0?{...e}:{start:Math.min(t.start,e.start),end:Math.max(t.end,e.end)})}return t}function Nt(e){return e.type??`finish-to-start`}function Pt(e){return{from:e.startsWith(`finish`)?`end`:`start`,to:e.endsWith(`finish`)?`end`:`start`}}function Ft(e,t){let n=t.get(e.from)?.days,r=t.get(e.to)?.days;if(n===void 0||r===void 0)return;let i=Pt(Nt(e));return r[i.to]>=n[i.from]}function It(e){if(`date`in e){let t=Dt(e.date)??0;return{start:t,end:t}}return{start:Dt(e.start)??0,end:Dt(e.end)??0}}function Lt(e){if(e.previous===void 0)return;let t=It(e.type===`activity`?{start:e.start,end:e.end}:{date:e.date}),n=It(e.previous);return{start:t.start-n.start,end:t.end-n.end}}function Rt(e){if(e===0)return``;let t=e>0?`+`:`−`,n=Math.abs(e);return n<14?`${t}${n}d`:n<70?`${t}${Math.round(n/7)}w`:`${t}${Math.round(n/30.44)}mo`}function zt(e){let t=Lt(e);return t===void 0?``:t.start===t.end?Rt(t.start):t.start===0?`end${Rt(t.end)}`:t.end===0?`start${Rt(t.start)}`:`${Rt(t.start)}, end${Rt(t.end)}`}function Bt(e,t){if(e.role!==void 0||t?.role!==void 0)return!0;let n=Lt(e);return n!==void 0&&(n.start!==0||n.end!==0)}function Vt(e){return e.role!==void 0||e.items.some(t=>Bt(t,e))}var Ht={week:12,month:4,quarter:.75};function Ut(e,t){let n=e>=8?`week`:e>=1?`month`:`quarter`;if(t===void 0)return n;let r=[`week`,`month`,`quarter`];return r[Math.max(r.indexOf(n),r.indexOf(t))]}var Wt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Gt(e){return e.width>=24?e.label:e.width>=9?e.label.charAt(0):``}function Kt(e,t){return t===`month`?Gt(e):e.width>=e.label.length*6+4?e.label:``}function qt(e){return((e+3)%7+7)%7}function Jt(e){let t=e-qt(e)+3,n=new Date(t*Tt).getUTCFullYear();return Math.floor((t-Qt(n,0))/7)+1}function Yt(e){if(e.label!==void 0&&e.label!==``)return e.label;if(e.type===`milestone`&&e.kind!==void 0&&e.kind!==``)return e.kind}function Xt(e){return e.length*pt}function Zt(e,t){let n=new Date(e*Tt),r=n.getUTCFullYear(),i=n.getUTCMonth(),a=[];for(;;){i+=1,i===12&&(i=0,r+=1);let e=Qt(r,i);if(e>t)return a;a.push({day:e,year:r,month:i})}}function Qt(e,t){let n=new Date(0);return n.setUTCFullYear(e,t,1),Math.round(n.getTime()/Tt)}function $t(e,t){let n=e=>e===`bar`||e===`ghost`;return n(e)&&t===`star`||e===`star`&&n(t)}function en(e,t){return e.x0<t.x1&&t.x0<e.x1}function tn(e,t){if(t<=0||e.width<=t)return;let n=e.items.filter(e=>e.change!==void 0);if(n.length>0){let e=Math.min(...n.flatMap(e=>e.ghost===void 0?[e.glyph.x]:[e.glyph.x,e.ghost.x]));return e<t*.9?void 0:Math.max(0,e-t/6)}if(`x`in e.today&&e.today.x>t*.8)return Math.max(0,e.today.x-t/3)}function nn(e,t,n={}){let r=Dt(e.time.start)??0,i=Dt(e.time.end)??r,a=n.pxPerDay??Ht[e.time.scale]??4,o=(i-r+1)*a,s=e=>(e-r)*a,c=Zt(r,i),l=new Date(r*Tt),u=[{day:r,year:l.getUTCFullYear(),month:l.getUTCMonth()},...c],d=u.map((e,t)=>{let n=t+1<u.length?u[t+1].day:i+1;return{label:Wt[e.month],x:s(e.day),width:(n-e.day)*a,year:e.year,month:e.month}}),f=[];u.forEach((e,t)=>{let n=d[t],r=f[f.length-1];r!==void 0&&r.label===String(e.year)?r.width+=n.width:f.push({label:String(e.year),x:n.x,width:n.width})});let p=Ut(a,n.unit),m=(e,t)=>e.map((n,r)=>{let o=r+1<e.length?e[r+1]:i+1;return{label:t(n),x:s(n),width:(o-n)*a}}),h=f,g;if(p===`week`){let e=[];for(let t=r-qt(r)+7;t<=i;t+=7)e.push(t);g=m([r,...e],e=>`W${Jt(e)}`),h=d.map(e=>({label:`${e.label} ${e.year}`,x:e.x,width:e.width}))}else if(p===`quarter`){let e=u.filter((e,t)=>t===0||e.month%3==0);g=e.map((t,n)=>{let r=n+1<e.length?e[n+1].day:i+1;return{label:`Q${Math.floor(t.month/3)+1}`,x:s(t.day),width:(r-t.day)*a}})}else g=d;let _=g.slice(1).map(e=>e.x),v=[],y=[],b=0,x=e.comparedTo!==void 0,S=(e,t)=>{if(!x)return;if(e.role===`added`||t.role===`added`)return`(new)`;let n=zt(e);return n===``?void 0:`(${n})`},C=(e,t,n)=>{let r=S(e,t);return r===void 0?n:n===void 0?r:`${n} ${r}`},w=(e,t)=>{if(x)return e.role===`removed`||t.role===`removed`?`removed`:e.role===`added`||t.role===`added`?`added`:zt(e)===``?void 0:`moved`},T=(e,t)=>{let n=[],r=[],i=[],c=e.map(e=>({...e,days:At(e.item)})).filter(e=>e.days!==void 0).sort((e,t)=>Number(e.item.type===`milestone`)-Number(t.item.type===`milestone`)||e.days.start-t.days.start||e.row-t.row||e.index-t.index);for(let{item:e,index:t,row:l,days:u,text:d,note:f,change:p}of c){let c=[],m;if(p===`moved`&&e.previous!==void 0){let t=It(e.previous);if(e.type===`activity`)m={x0:s(t.start),x1:s(t.end+1)};else{let e=s(t.start)+a/2;m={x0:e-7,x1:e+7,cx:e}}c.push({kind:`ghost`,x0:m.x0,x1:m.x1})}let h,g,_,v;if(e.type===`activity`){if(g=s(u.start),_=s(u.end+1),c.push({kind:`bar`,x0:g,x1:_}),d!==void 0){let e=Xt(d);h=e+12<=_-g?{text:d,inside:!0,x:g+6,width:e}:rn(d,g,_,o),f!==void 0&&(h.note=f),c.push({kind:`label`,x0:h.x,x1:h.x+h.width})}}else v=s(u.start)+a/2,g=v-7,_=v+7,c.push({kind:`star`,x0:g,x1:_}),d!==void 0&&(h=rn(d,g,_,o),f!==void 0&&(h.note=f),c.push({kind:`label`,x0:h.x,x1:h.x+h.width}));let y=n.findIndex(e=>c.every(t=>e.every(e=>$t(t.kind,e.kind)||!en(t,e))));y===-1&&(y=n.length,n.push([])),n[y].push(...c),r.push({row:l,item:t,type:e.type,lane:y,days:u,...e.kind?{kind:e.kind}:{},...p===void 0?{}:{change:p}}),i.push({label:h===void 0?void 0:{...h,...p===`removed`?{struck:!0}:{}},x0:g,x1:_,cx:v,ghost:m})}return r.forEach((e,n)=>{let r=i[n],a=t+4+e.lane*24+12,o=e.type===`activity`?{x:r.x0,y:a-6,width:r.x1-r.x0,height:12}:{x:r.x0,y:a-7,width:14,height:14},s=r.ghost;y.push({...e,glyph:o,...r.cx===void 0?{}:{center:{x:r.cx,y:a}},...r.label===void 0?{}:{label:{...r.label,y:a-8,height:16}},...s===void 0?{}:e.type===`activity`?{ghost:{x:s.x0,y:a-6,width:s.x1-s.x0,height:12}}:{ghost:{x:s.x0,y:a-7,width:14,height:14},ghostCenter:{x:s.cx,y:a}}})}),Math.max(1,n.length)},ee=e=>e*24+8,te=(e,t)=>{let n=T(e.items.map((n,r)=>({row:t,index:r,item:n,text:C(n,e,Yt(n)),note:S(n,e),change:w(n,e)})),b),r=ee(n);v.push({type:`task`,row:t,y:b,height:r,lanes:n,label:e.label,id:e.id}),b+=r},E,ne=()=>{if(E!==void 0){if(E.tasks.length===0){let e=E.label?26:10;v.push({type:`separator`,row:E.row,y:b,height:e,...E.label?{label:E.label}:{}}),b+=e}else{let e=T(E.tasks.flatMap(({task:e,row:t})=>e.items.map((n,r)=>({row:t,index:r,item:n,text:C(n,e,Yt(n)??(n.type===`activity`?e.label:void 0)),note:S(n,e),change:w(n,e)}))),b),t=ee(e);v.push({type:`section`,row:E.row,y:b,height:t,lanes:e,...E.label?{label:E.label}:{},tasks:E.tasks.map(({task:e})=>e.id)}),b+=t}E=void 0}},re=(()=>{let t=new Set;if(!(n.onlyChanged&&x))return;let r;return e.rows.forEach((e,n)=>{e.type===`separator`?r=n:Vt(e)&&(t.add(n),r!==void 0&&t.add(r))}),t})(),ie=re===void 0?0:e.rows.filter((e,t)=>e.type===`task`&&!re.has(t)).length;e.rows.forEach((e,t)=>{if(!(re!==void 0&&!re.has(t))){if(e.type===`separator`){if(n.compact){ne(),E={row:t,...e.label?{label:e.label}:{},tasks:[]};return}let r=e.label?26:10;v.push({type:`separator`,row:t,y:b,height:r,...e.label?{label:e.label}:{}}),b+=r;return}E===void 0?te(e,t):E.tasks.push({task:e,row:t})}}),ne();let ae=[];for(let t of e.rows)if(t.type===`task`)for(let e of t.items)e.kind&&!ae.includes(e.kind)&&ae.push(e.kind);for(let t of[...e.periods??[],...e.references??[]])t.kind&&!ae.includes(t.kind)&&ae.push(t.kind);let D=[];(e.periods??[]).forEach((e,t)=>{let n=Math.max(Dt(e.start)??r,r),o=Math.min(Dt(e.end)??i,i);n>o||D.push({index:t,x:s(n),width:(o-n+1)*a,start:e.start,end:e.end,...e.label?{label:e.label}:{},...e.kind?{kind:e.kind}:{}})});let oe=(e.references??[]).flatMap((e,t)=>{let n=Dt(e.date);return n===void 0||n<r||n>i?[]:[{index:t,x:s(n)+a/2,label:e.label,date:e.date,...e.kind?{kind:e.kind}:{}}]}),se=[];if(t>=r&&t<=i){let e=s(t)+a/2;se.push({x0:e-26,x1:e+26})}let O=[],ce=[...D.filter(e=>e.label).map(e=>({of:`period`,index:e.index,text:e.label,x:e.x+3,room:e.width-6})),...oe.map(e=>{let t=Xt(e.label)*(10/11);return{of:`reference`,index:e.index,text:e.label,x:Math.min(Math.max(2,e.x-t/2),o-t-2),room:o-4}})].sort((e,t)=>e.x-t.x);for(let e of ce){let t=Xt(e.text)*(10/11);if(t>e.room)continue;let n={x0:e.x-2,x1:e.x+t+2};se.some(e=>n.x0<e.x1&&e.x0<n.x1)||(se.push(n),O.push({of:e.of,index:e.index,text:e.text,x:e.x,width:t}))}return{width:o,height:b,start:r,end:i,years:f,months:d,monthLines:c.map(e=>s(e.day)),unit:p,upper:h,lower:g,unitLines:_,rows:v,items:y,dependencies:an(e,v,y,s),today:t<r?{outside:`before`,day:t}:t>i?{outside:`after`,day:t}:{x:s(t)+a/2,day:t},kinds:ae,hiddenTasks:ie,periods:D,references:oe,headerLabels:O}}function rn(e,t,n,r){let i=Xt(e),a=n+4;if(a+i<=r)return{text:e,inside:!1,x:a,width:i};let o=t-4-i;return o>=0?{text:e,inside:!1,x:o,width:i}:{text:e,inside:!1,x:Math.max(0,r-i),width:i}}function an(e,t,n,r){let i=jt(e),a=new Map(n.map(e=>[`${e.row}:${e.item}`,e])),o=new Map(t.map(e=>[e.row,e])),s=(e,t)=>{let s=i.get(e);if(s?.days===void 0)return;if(s.item!==void 0){let e=a.get(`${s.row}:${s.item}`);if(e===void 0)return;let n=e.glyph.y+e.glyph.height/2;return e.center===void 0?{x:t===`start`?e.glyph.x:e.glyph.x+e.glyph.width,y:n}:{x:e.center.x+(t===`start`?-7:7),y:n}}let c=r(t===`start`?s.days.start:s.days.end+1),l=o.get(s.row);if(l!==void 0&&l.type===`task`)return{x:c,y:l.y+4+12};let u=n.filter(e=>e.row===s.row).sort((e,n)=>t===`start`?e.glyph.x-n.glyph.x:n.glyph.x+n.glyph.width-(e.glyph.x+e.glyph.width));if(u.length!==0)return{x:c,y:u[0].glyph.y+u[0].glyph.height/2}},c=[];return(e.dependencies??[]).forEach((e,t)=>{let n=Nt(e),r=Pt(n),a=s(e.from,r.from),o=s(e.to,r.to),l=Ft(e,i);if(a===void 0||o===void 0||l===void 0)return;let u={x:a.x+(r.from===`end`?8:-8),y:a.y},d={x:o.x+(r.to===`start`?-8:8),y:o.y};if(a.y===o.y&&r.from===`end`&&r.to===`start`&&o.x>=a.x-14){c.push({index:t,from:e.from,to:e.to,type:n,satisfied:l,points:[a,o]});return}let f=o.y>a.y?o.y-12:(o.y,a.y,o.y+12);c.push({index:t,from:e.from,to:e.to,type:n,satisfied:l,points:[a,u,{x:u.x,y:f},{x:d.x,y:f},d,o]})}),c}function on(e){let t=e.rows.reduce((e,t)=>Math.max(e,(t.label??``).length),0);return Math.min(Math.max(t*pt+24,120),280)}function sn(e,t){for(let n of e.rows){if(n.type!==`task`)continue;if(n.id===t)return`"${n.label}" (${t})`;let e=n.items.find(e=>e.id===t);if(e!==void 0){let n=Yt(e);return n===void 0?t:`"${n}" (${t})`}}return t}function cn(e,t,n){let r=n===!1?` — not satisfied by the dates`:``;return`${sn(e,t.to)} waits on ${sn(e,t.from)} (${Nt(t)})${r}`}function ln(e){let t=[];e.title!==void 0&&e.title!==``&&t.push(e.title),e.comparedTo!==void 0&&t.push(`Compared with ${e.comparedTo.label}${e.comparedTo.date===void 0?``:` (${e.comparedTo.date})`}`),t.push(`From ${e.time.start} to ${e.time.end}, by ${e.time.scale}`);for(let n of e.rows){if(t.push(``),n.type===`separator`){t.push(n.label?`— ${n.label} —`:`———`);continue}let e=n.role===void 0?``:n.role===`added`?` — new`:` — removed`;t.push(`${n.label} [${n.id}]${n.items.length===0?` — no items`:``}${e}`);for(let e of n.items){let n=e.type===`activity`?`${e.start} to ${e.end}`:e.date,r=e.label===void 0?``:`: ${e.label}`,i=e.kind===void 0?``:` [${e.kind}]`,a=e.id===void 0?``:` (${e.id})`,o=(()=>{if(e.role===`added`)return` — new`;if(e.role===`removed`)return` — removed`;let t=zt(e);return t===``||e.previous===void 0?``:` — moved ${t}, was ${`date`in e.previous?e.previous.date:`${e.previous.start} to ${e.previous.end}`}`})();t.push(` ${e.type} ${n}${r}${i}${a}${o}`)}}let n=[...(e.periods??[]).map(e=>` period ${e.start} to ${e.end}${e.label?`: ${e.label}`:``}${e.kind?` [${e.kind}]`:``}`),...(e.references??[]).map(e=>` reference ${e.date}: ${e.label}${e.kind?` [${e.kind}]`:``}`)];n.length>0&&t.push(``,`Calendar`,...n);let r=e.dependencies??[];if(r.length>0){let n=jt(e);t.push(``,`Dependencies`);for(let i of r)t.push(` ${cn(e,i,Ft(i,n))}`)}return t}function un(e){let t=[],n=(e,n)=>{let r=Dt(e);return r===void 0&&t.push({rule:`invalid-date`,path:n,message:`"${e}" is not a day of the calendar`}),r},r=n(e.time.start,`/data/time/start`),i=n(e.time.end,`/data/time/end`),a=r!==void 0&&i!==void 0&&r<=i?{start:r,end:i}:void 0;r!==void 0&&i!==void 0&&r>i&&t.push({rule:`inverted-range`,path:`/data/time`,message:`the timeline starts on ${e.time.start}, after it ends on ${e.time.end}`});let o=`${e.time.start} to ${e.time.end}`,s=new Map,c=(e,n)=>{if(e===void 0)return;let r=s.get(e);r===void 0?s.set(e,n):t.push({rule:`duplicate-identifier`,path:`${n}/id`,message:`identifier "${e}" is already declared at ${r}`})},l=e.comparedTo!==void 0;e.comparedTo?.date!==void 0&&n(e.comparedTo.date,`/data/comparedTo/date`);let u=e=>t.push({rule:`comparison-without-reference`,path:e,message:"previous dates and change roles describe a comparison; declare `comparedTo` naming the plan they compare with"}),d=new Set;return e.rows.forEach((e,r)=>{if(e.type!==`task`)return;let i=`/data/rows/${r}`;c(e.id,i),e.role!==void 0&&!l&&u(`${i}/role`),e.items.forEach((r,s)=>{let f=`${i}/items/${s}`;if(c(r.id,f),r.kind!==void 0&&d.add(r.kind),r.role!==void 0&&!l&&u(`${f}/role`),r.previous!==void 0){l||u(`${f}/previous`),(r.role!==void 0||e.role!==void 0)&&t.push({rule:`contradictory-change`,path:`${f}/previous`,message:`an item that is ${r.role??`in a task that is ${e.role}`} has no previous dates; it is new or dropped, not moved`});let i=r.previous,s=r.type===`activity`?{first:n(i.start,`${f}/previous/start`),last:n(i.end,`${f}/previous/end`)}:(()=>{let e=n(i.date,`${f}/previous/date`);return{first:e,last:e}})();s.first!==void 0&&s.last!==void 0&&(s.first>s.last?t.push({rule:`inverted-range`,path:`${f}/previous`,message:`the previous dates start on ${i.start}, after they end on ${i.end}`}):a!==void 0&&(s.first<a.start||s.last>a.end)&&t.push({rule:`item-outside-range`,path:`${f}/previous`,message:`the previous dates fall outside the timeline's range ${o}; the range covers both plans, so widen \`time\``}))}r.role!==void 0&&e.role!==void 0&&r.role!==e.role&&t.push({rule:`contradictory-change`,path:`${f}/role`,message:`an item ${r.role} in a task that is ${e.role}`});let p,m;if(r.type===`activity`){if(p=n(r.start,`${f}/start`),m=n(r.end,`${f}/end`),p!==void 0&&m!==void 0&&p>m){t.push({rule:`inverted-range`,path:f,message:`the activity starts on ${r.start}, after it ends on ${r.end}`});return}}else p=m=n(r.date,`${f}/date`);a!==void 0&&p!==void 0&&m!==void 0&&(p<a.start||m>a.end)&&t.push({rule:`item-outside-range`,path:f,message:r.type===`activity`?`the activity runs ${r.start} to ${r.end}, outside the timeline's range ${o}; widen \`time\` or move the activity`:`the milestone falls on ${r.date}, outside the timeline's range ${o}; widen \`time\` or move the milestone`})})}),(e.periods??[]).forEach((e,r)=>{let i=`/data/periods/${r}`;e.kind!==void 0&&d.add(e.kind);let s=n(e.start,`${i}/start`),c=n(e.end,`${i}/end`);s!==void 0&&c!==void 0&&(s>c?t.push({rule:`inverted-range`,path:i,message:`the period starts on ${e.start}, after it ends on ${e.end}`}):a!==void 0&&(c<a.start||s>a.end)&&t.push({rule:`period-outside-range`,path:i,message:`the period ${e.start} to ${e.end} lies wholly outside the timeline's range ${o}, so nothing of it could be drawn`}))}),(e.references??[]).forEach((e,r)=>{let i=`/data/references/${r}`;e.kind!==void 0&&d.add(e.kind);let s=n(e.date,`${i}/date`);s!==void 0&&a!==void 0&&(s<a.start||s>a.end)&&t.push({rule:`item-outside-range`,path:i,message:`the reference date ${e.date} is outside the timeline's range ${o}; widen \`time\` or move it`})}),d.size>Xe.kindsPerVocabulary&&t.push({rule:`too-many-kinds`,path:`/data/rows`,message:`${d.size} distinct item types, and no more than ${Xe.kindsPerVocabulary} can be told apart in a rendering`,observed:d.size,limit:Xe.kindsPerVocabulary}),t.push(...fn(e,jt(e))),t.push(...dn(e)),t}function dn(e){let t=new Set;for(let n of e.rows)if(n.type===`task`){n.role===`removed`&&t.add(n.id);for(let e of n.items)e.id!==void 0&&(e.role===`removed`||n.role===`removed`)&&t.add(e.id)}let n=[];return(e.dependencies??[]).forEach((e,r)=>{for(let i of[`from`,`to`])t.has(e[i])&&n.push({rule:`dependency-on-removed`,path:`/data/dependencies/${r}/${i}`,message:`"${e[i]}" was dropped from the plan, so nothing can depend on it any more; remove the dependency`})}),n}function fn(e,t){let n=[],r=e.dependencies??[],i=[],a=new Map;r.forEach((r,o)=>{let s=`/data/dependencies/${o}`,c=!0;for(let i of[`from`,`to`]){let a=r[i],o=t.get(a);if(o===void 0)c=!1,n.push({rule:`unresolved-endpoint`,path:`${s}/${i}`,message:`"${a}" is not the identifier of any task or item this timeline declares`});else if(o.type===`task`&&o.days===void 0){c=!1;let t=e.rows[o.row];if(t.type===`task`&&t.items.length>0)continue;n.push({rule:`empty-task-endpoint`,path:`${s}/${i}`,message:`task "${a}" holds no item, so it has no start or finish for a dependency to link`})}}if(!c)return;let l=t.get(r.from),u=t.get(r.to),d=(e,t)=>e.type===`task`&&t.type!==`task`&&t.row===e.row;if(l.id===u.id||d(l,u)||d(u,l)){n.push({rule:`self-dependency`,path:s,message:l.id===u.id?`"${l.id}" cannot depend on itself`:`a task and one of its own items cannot depend on each other: the task's span is made of its items`});return}let f=JSON.stringify([r.from,r.to,Nt(r)]),p=a.get(f);if(p!==void 0){n.push({rule:`duplicate-dependency`,path:s,message:`the same dependency is already declared at /data/dependencies/${p}`});return}a.set(f,o),i.push({from:r.from,to:r.to,index:o})});let o=pn(i);return o!==void 0&&n.push({rule:`dependency-cycle`,path:`/data/dependencies/${o.index}`,message:`dependencies form a cycle, which no dates can honour: ${o.ids.join(` → `)}`}),n}function pn(e){let t=new Map;for(let n of e){let e=t.get(n.from)??[];e.push({to:n.to,index:n.index}),t.set(n.from,e)}let n=new Map,r=[];for(let e of t.keys()){if(n.has(e))continue;let i=[{id:e,next:0}];for(n.set(e,`open`),r.push({id:e,index:-1});i.length>0;){let e=i[i.length-1],a=t.get(e.id)??[];if(e.next>=a.length){n.set(e.id,`done`),i.pop(),r.pop();continue}let o=a[e.next++],s=n.get(o.to);if(s===`open`){let e=r.findIndex(e=>e.id===o.to);return{ids:[...r.slice(e).map(e=>e.id),o.to],index:o.index}}s===void 0&&(n.set(o.to,`open`),i.push({id:o.to,next:0}),r.push({id:o.to,index:o.index}))}}}function mn(e){let t=e.data;return e.kind===`graph`?Array.isArray(t.nodes)&&Array.isArray(t.edges):e.kind===`sequence`?Array.isArray(t.participants)&&Array.isArray(t.messages):e.kind===`timeline`?typeof t.time==`object`&&t.time!==null&&Array.isArray(t.rows):Array.isArray(t.columns)&&Array.isArray(t.rows)}function hn(e){return e.kind===`graph`?e.data.nodes:e.kind===`sequence`?e.data.participants:[]}function gn(e){return e.kind===`graph`?e.data.edges:e.kind===`sequence`?e.data.messages:[]}function _n(e){return e.kind===`graph`||e.kind===`sequence`?e.data.containers??[]:[]}function vn(e){return e.kind===`graph`?`/data/nodes`:`/data/participants`}function yn(e){return e.kind===`graph`?`/data/edges`:`/data/messages`}function bn(e){if(e.kind===`timeline`)return[];let t=e.data,n=[];for(let e of[`nodes`,`edges`,`participants`,`messages`,`rows`,`relations`]){let r=t[e];Array.isArray(r)&&r.forEach((t,r)=>{if(typeof t!=`object`||!t||Array.isArray(t))return;let i=t;n.push({at:`/data/${e}/${r}`,ref:typeof i.ref==`string`?i.ref:void 0,set:i.set,expect:i.expect,locations:i.locations})})}return n}function xn(e){if(e.kind!==`table`)return[];let t=e.data.rows,n=[];return t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e;(r.ref!==void 0||r.set!==void 0)&&n.push({at:`/data/rows/${t}`,...typeof r.ref==`string`?{ref:r.ref}:{},...r.set===void 0?{}:{set:r.set}})}),n}function Sn(e){if(e.kind!==`table`)return[];let t=e.data.rows,n=[];return t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e.id;typeof r==`string`&&n.push({id:r,at:`/data/rows/${t}`})}),n}function Cn(e){if(e.kind!==`table`)return[];let t=e.data.relations;return Array.isArray(t)?t:[]}function wn(e,t){return e===`timeline`?`a timeline is maintained by presenting the revised timeline again, not proposed as a change, ${t}`:`a ${e} is a projection and cannot be proposed, ${t}`}function Tn(e){let t=[];if(!mn(e))return t.push({rule:`kind-data-mismatch`,path:`/data`,message:`data does not carry what kind "${e.kind}" declares`}),t;let n=qe(e.schema).includes(e.kind);e.target!==void 0&&!n&&t.push({rule:`kind-not-proposable`,path:`/target`,message:wn(e.kind,`so it carries no target`)}),e.removals!==void 0&&(n?e.target===void 0&&t.push({rule:`removal-without-target`,path:`/removals`,message:`removals need a target: an artifact that does not exist yet has nothing to remove`}):t.push({rule:`kind-not-proposable`,path:`/removals`,message:wn(e.kind,`so it declares no removals`)}));let r=hn(e),i=vn(e),a=new Map;r.forEach((e,n)=>{let r=a.get(e.id);r===void 0?a.set(e.id,n):t.push({rule:`duplicate-identifier`,path:`${i}/${n}/id`,message:`identifier "${e.id}" is already declared at ${i}/${r}`})});let o=new Map;_n(e).forEach((e,n)=>{let r=o.get(e.id);r===void 0?o.set(e.id,n):t.push({rule:`duplicate-container-identifier`,path:`/data/containers/${n}/id`,message:`container "${e.id}" is already declared at /data/containers/${r}`})}),r.forEach((e,n)=>{for(let[r,a]of[[`container`,e.container],[`set/container`,e.set?.container]])a!==void 0&&!o.has(a)&&t.push({rule:`unresolved-container`,path:`${i}/${n}/${r}`,message:`"${a}" is not a container declared in /data/containers`})});let s=yn(e);gn(e).forEach((e,n)=>{for(let r of[`from`,`to`]){let o=e[r];a.has(o)||t.push({rule:`unresolved-endpoint`,path:`${s}/${n}/${r}`,message:`"${o}" is not an identifier declared in ${i}`})}});let c=new Map,l=(e,n,r)=>{if(n===void 0)return;let i=`${e}:${n}`,a=c.get(i);a===void 0?c.set(i,r):t.push({rule:`duplicate-reference`,path:r,message:`${e} "${n}" is already addressed at ${a}; a proposal states one intention per thing`})};r.forEach((e,t)=>l(`element`,e.ref,`${i}/${t}`)),gn(e).forEach((e,t)=>l(`relationship`,e.ref,`${s}/${t}`)),xn(e).forEach(e=>l(`row`,e.ref,e.at)),(e.removals??[]).forEach((e,t)=>l(e.type,e.ref,`/removals/${t}`));let u=[...r.map((e,t)=>({at:`${i}/${t}`,ref:e.ref,set:e.set})),...gn(e).map((t,n)=>({at:`${yn(e)}/${n}`,ref:t.ref,set:t.set})),...xn(e)];for(let r of u)r.set!==void 0&&(r.ref===void 0?t.push({rule:`change-without-reference`,path:`${r.at}/set`,message:`a change names a reference to change; without one this is a new thing, and its fields are its values`}):n?e.target===void 0&&t.push({rule:`change-without-target`,path:`${r.at}/set`,message:`a change needs a target: naming what is being changed is what makes this a proposal rather than a new artifact`}):t.push({rule:`kind-not-proposable`,path:`${r.at}/set`,message:wn(e.kind,`so nothing in it declares a change`)}));let d=e=>{let t=new Set;for(let n of e)n.kind!==void 0&&n.kind!==``&&t.add(n.kind);return t},f=[[e.kind===`sequence`?`participant`:`element`,i,d(r)],[e.kind===`sequence`?`message`:`relationship`,yn(e),d(gn(e))]];for(let[e,n,r]of f)r.size>Xe.kindsPerVocabulary&&t.push({rule:`too-many-kinds`,path:n,message:`${r.size} distinct ${e} types, and no more than ${Xe.kindsPerVocabulary} can be told apart in a rendering`,observed:r.size,limit:Xe.kindsPerVocabulary});let p=e.viewpoints;if(Array.isArray(p)){if(e.kind!==`graph`)t.push({rule:`viewpoints-without-graph`,path:`/viewpoints`,message:`only a graph declares viewpoints; a ${e.kind} has no element and relationship kinds for one to retain`});else{let n=new Set(r.map(e=>e.kind).filter(e=>!!e)),i=new Set(gn(e).map(e=>e.kind).filter(e=>!!e)),a=new Map;p.forEach((e,r)=>{let o=`/viewpoints/${r}`,{id:s,elementKinds:c,relationshipKinds:l}=e,u=a.get(s);u===void 0?a.set(s,r):t.push({rule:`duplicate-viewpoint-identifier`,path:`${o}/id`,message:`viewpoint "${s}" is already declared at /viewpoints/${u}`}),c===void 0&&l===void 0&&t.push({rule:`empty-viewpoint`,path:o,message:`viewpoint "${s}" retains no kind, so it would show nothing it was not already showing; name elementKinds, relationshipKinds, or both`});let d=[[c,n,i,`elementKinds`,`element`,`relationship`],[l,i,n,`relationshipKinds`,`relationship`,`element`]];for(let[e,n,r,i,a,c]of d)e?.forEach((e,l)=>{n.has(e)||t.push({rule:`unresolved-viewpoint-kind`,path:`${o}/${i}/${l}`,message:`viewpoint "${s}" retains ${a} kind "${e}", and no ${a} of this document has it`+(r.has(e)?` (it is a ${c} kind here, which is a different vocabulary)`:``)})})})}}if(e.kind===`table`){let{columns:n,rows:r}=e.data;r.forEach((e,r)=>{let{cells:i,heading:a}=Ye(e);a===void 0&&i.length!==n.length&&t.push({rule:`row-column-mismatch`,path:`/data/rows/${r}`,message:`row has ${i.length} values but ${n.length} columns are declared`,observed:i.length,limit:n.length})})}e.kind===`timeline`&&t.push(...un(e.data));for(let n of bn(e)){n.expect!==void 0&&(e.target===void 0?t.push({rule:`expectation-without-target`,path:`${n.at}/expect`,message:`an expectation is checked by the authority a proposal targets; a document that targets nothing has nobody to check it`}):n.ref===void 0&&t.push({rule:`expectation-without-reference`,path:`${n.at}/expect`,message:`an expectation describes something that already exists, and this item carries no reference to one`}));let r=n.set?.removeAttributes;if(Array.isArray(r)){let e=n.set?.attributes??{},i=new Map;r.forEach((r,a)=>{if(typeof r!=`string`)return;let o=i.get(r);o===void 0?i.set(r,a):t.push({rule:`duplicate-attribute-removal`,path:`${n.at}/set/removeAttributes/${a}`,message:`"${r}" is already removed at ${n.at}/set/removeAttributes/${o}`}),Object.prototype.hasOwnProperty.call(e,r)&&t.push({rule:`attribute-set-and-removed`,path:`${n.at}/set/removeAttributes/${a}`,message:`"${r}" is both assigned and removed; a proposal states one intention per property`})})}Array.isArray(n.locations)&&n.locations.forEach((e,r)=>{if(typeof e!=`object`||!e)return;let i=e.range;i!==void 0&&(i.endLine<i.startLine||i.endLine===i.startLine&&i.endCharacter!==void 0&&i.startCharacter!==void 0&&i.endCharacter<i.startCharacter)&&t.push({rule:`location-range-reversed`,path:`${n.at}/locations/${r}/range`,message:`a range ends before it begins, so it selects nothing a reader could be taken to`})})}e.kind===`table`&&e.data.rows.forEach((e,n)=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e;r.role!==void 0&&r.set!==void 0&&t.push({rule:`role-with-change`,path:`/data/rows/${n}/role`,message:`a row states what it observed or what it asks for, not both: a declared role beside a change is a report and an instruction at once`})});let m=new Map;for(let n of Sn(e)){let e=m.get(n.id);e===void 0?m.set(n.id,n.at):t.push({rule:`duplicate-identifier`,path:`${n.at}/id`,message:`identifier "${n.id}" is already declared at ${e}`})}return Cn(e).forEach((e,n)=>{for(let r of[`from`,`to`]){let i=e[r];if(typeof i!=`object`||!i)continue;let a=i.id;typeof a==`string`&&(m.has(a)||t.push({rule:`unresolved-endpoint`,path:`/data/relations/${n}/${r}`,message:`"${a}" is not the identifier of any row this document declares`}))}}),t}function En(e,t){let n=t(e);if(n.length>0)return{valid:!1,issues:n};let r=e,i=Tn(r);return i.length>0?{valid:!1,issues:i}:{valid:!0,envelope:r,issues:[]}}function Dn(e,t,n){let r=lt(e,n);if(r!==void 0)return{valid:!1,issues:[r]};let i;try{i=JSON.parse(e)}catch{return{valid:!1,issues:[{rule:`not-json`,path:``,message:`document is not parseable JSON`}]}}let a=En(i,t);if(!a.valid)return a;let o=lt(e,n,a.envelope.schema);if(o!==void 0)return{valid:!1,issues:[o]};let s=dt(a.envelope,n);return s.length>0?{valid:!1,issues:s}:{valid:!0,envelope:a.envelope,measurement:ft(a.envelope,e),issues:[]}}function On(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e.schema;if(!(typeof t!=`string`||!t.startsWith(`urn:structured-exchange:`)))return t}function kn(e,t,n){let r=lt(e,n);if(r!==void 0)return{status:`too-large`,issue:r};let i;try{i=JSON.parse(e)}catch{return{status:`not-a-document`,why:`unparseable`}}let a=On(i);if(a===void 0)return{status:`not-a-document`,why:`undeclared`};if(nt(a)===void 0)return{status:`unsupported-version`,schema:a};let o=En(i,t);if(!o.valid)return{status:`invalid`,issues:o.issues};let s=lt(e,n,o.envelope.schema);return s===void 0?{status:`valid`,envelope:o.envelope}:{status:`too-large`,issue:s}}function An(e){let t=e.replace(/\r\n/g,`
|
|
22
|
+
`).replace(/\s+$/,``),n=2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return`sx-${(n>>>0).toString(16).padStart(8,`0`)}-${t.length.toString(36)}`}async function jn(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.cssText=`position:fixed;top:0;left:0;opacity:0;pointer-events:none`,document.body.append(t);try{return t.select(),document.execCommand(`copy`)}catch{return!1}finally{t.remove()}}}function Mn(e,t,n){return e>=t&&e<=n}function Nn(e){return e===8205}function Pn(e){return Mn(e,55296,56319)}function Fn(e){return Mn(e,127462,127487)}function In(e){return Mn(e,65024,65039)}function Ln(e){return Mn(e,768,879)||Mn(e,6832,6911)||Mn(e,7616,7679)||Mn(e,65056,65071)}function Rn(e){return e>65535?2:1}function zn(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(Ln(n)||In(n))t+=Rn(n);else break}return t}function Bn(e,t){let n=e.codePointAt(t),r=t+Rn(n);for(r=zn(e,r);r<e.length-1&&Nn(e.codePointAt(r));){let t=e.codePointAt(r+1);r+=1+Rn(t),r=zn(e,r)}return Fn(n)&&r<e.length&&Fn(e.codePointAt(r))&&(r+=Rn(e.codePointAt(r))),r}function Vn(e){return Pn(e)||Ln(e)||In(e)||Nn(e)}function Hn(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=Bn(e,r),n++,n>=t)return!0;return!1}function Un(e,t){let n=0,r=0;for(;r<e.length;)if(r=Bn(e,r),n++,n>t)return!1;return!0}function Wn(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Vn(e.charCodeAt(n)))return Hn(e,t);if(n++,n>=t)return!0}return!1}function Gn(e,t){let n=0;for(;n<e.length;){if(Vn(e.charCodeAt(n)))return Un(e,t);if(n++,n>t)return!1}return!0}function Kn(e){return Array.isArray(e)}function qn(e){return nr(typeof e,`bigint`)}function Jn(e){return nr(typeof e,`boolean`)}function Yn(e){if(tr(e)||!Xn(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Xn(e){return nr(typeof e,`function`)}function Zn(e){return nr(e,null)}function Qn(e){return nr(typeof e,`object`)&&!Zn(e)}function $n(e){return nr(typeof e,`string`)}function er(e){return nr(typeof e,`symbol`)}function tr(e){return nr(e,void 0)}function nr(e,t){return e===t}function rr(e,t){return Gn(e,t)}function ir(e,t){return Wn(e,t)}function ar(e){return e instanceof Boolean}function or(e){return e instanceof Number}function sr(e){return e instanceof String}function cr(e){return globalThis.ArrayBuffer.isView(e)}function lr(e){return e instanceof globalThis.RegExp}function ur(e){return e instanceof globalThis.Date}var dr=[];function fr(e){dr=e.variables}var pr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`schema`in e&&`kind`in e&&`data`in e&&Object.getOwnPropertyNames(e).every((e,t)=>dr[0].test(e)||!1)&&e.schema===`urn:structured-exchange:1`&&(e.kind===`graph`||e.kind===`sequence`||e.kind===`table`)&&(e.target===void 0||!(`target`in e)||mr(e.target))&&(e.removals===void 0||!(`removals`in e)||Array.isArray(e.removals)&&e.removals.every((e,t)=>hr(e))&&e.removals.length<=500)&&[typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`nodes`in e.data&&`edges`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>dr[2].test(e)||!1)&&Array.isArray(e.data.nodes)&&e.data.nodes.every((e,t)=>yr(e))&&e.data.nodes.length<=500&&e.data.nodes.length>=1&&Array.isArray(e.data.edges)&&e.data.edges.every((e,t)=>xr(e))&&e.data.edges.length<=2e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>Cr(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`participants`in e.data&&`messages`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>dr[8].test(e)||!1)&&Array.isArray(e.data.participants)&&e.data.participants.every((e,t)=>yr(e))&&e.data.participants.length<=100&&e.data.participants.length>=1&&Array.isArray(e.data.messages)&&e.data.messages.every((e,t)=>wr(e))&&e.data.messages.length<=1e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>Cr(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`columns`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).length===2&&Array.isArray(e.data.columns)&&e.data.columns.every((e,t)=>typeof e==`string`&&rr(e,200)&&ir(e,1))&&e.data.columns.length<=50&&e.data.columns.length>=1&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>[Er(e),typeof e==`object`&&!!e&&!Array.isArray(e)&&`cells`in e&&Object.getOwnPropertyNames(e).every((e,t)=>dr[11].test(e)||!1)&&Er(e.cells)&&(e.role===void 0||!(`role`in e)||e.role===`added`||e.role===`changed`||e.role===`context`||e.role===`removed`)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.data.rows.length<=5e3].reduce((e,t,n)=>t===!0?++e:e,0)===1),mr=(e=>typeof e==`string`&&rr(e,200)&&ir(e,1)),hr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`ref`in e&&Object.getOwnPropertyNames(e).every((e,t)=>dr[1].test(e)||!1)&&(e.type===`element`||e.type===`relationship`)&&mr(e.ref)&&(e.label===void 0||!(`label`in e)||gr(e.label))&&(e.kind===void 0||!(`kind`in e)||_r(e.kind))&&(e.from===void 0||!(`from`in e)||vr(e.from))&&(e.to===void 0||!(`to`in e)||vr(e.to))),gr=(e=>typeof e==`string`&&rr(e,500)),_r=(e=>typeof e==`string`&&rr(e,100)&&ir(e,1)),vr=(e=>typeof e==`string`&&rr(e,200)&&ir(e,1)),yr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&Object.getOwnPropertyNames(e).every((e,t)=>dr[3].test(e)||!1)&&vr(e.id)&&(e.ref===void 0||!(`ref`in e)||mr(e.ref))&&(e.label===void 0||!(`label`in e)||gr(e.label))&&(e.kind===void 0||!(`kind`in e)||_r(e.kind))&&(e.set===void 0||!(`set`in e)||br(e.set))&&(e.container===void 0||!(`container`in e)||vr(e.container))&&(!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e||!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),br=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>dr[4].test(e)||!1)&&(e.label===void 0||!(`label`in e)||gr(e.label))&&(e.kind===void 0||!(`kind`in e)||_r(e.kind))&&(e.container===void 0||!(`container`in e)||vr(e.container))&&Object.getOwnPropertyNames(e).length>=1),xr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>dr[5].test(e)||!1)&&vr(e.from)&&vr(e.to)&&(e.kind===void 0||!(`kind`in e)||_r(e.kind))&&(e.ref===void 0||!(`ref`in e)||mr(e.ref))&&(e.label===void 0||!(`label`in e)||gr(e.label))&&(e.set===void 0||!(`set`in e)||Sr(e.set))&&(!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e||!(typeof e==`object`&&e&&!Array.isArray(e))||`kind`in e)),Sr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>dr[6].test(e)||!1)&&(e.kind===void 0||!(`kind`in e)||_r(e.kind))&&(e.label===void 0||!(`label`in e)||gr(e.label))&&Object.getOwnPropertyNames(e).length>=1),Cr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>dr[7].test(e)||!1)&&vr(e.id)&&gr(e.label)&&(e.kind===void 0||!(`kind`in e)||_r(e.kind))),wr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>dr[9].test(e)||!1)&&vr(e.from)&&vr(e.to)&&(e.ref===void 0||!(`ref`in e)||mr(e.ref))&&(e.label===void 0||!(`label`in e)||gr(e.label))&&(e.set===void 0||!(`set`in e)||Tr(e.set))&&(!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e||!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),Tr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>dr[10].test(e)||!1)&&(e.label===void 0||!(`label`in e)||gr(e.label))&&Object.getOwnPropertyNames(e).length>=1),Er=(e=>Array.isArray(e)&&e.every((e,t)=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||rr(e,1e3)))&&e.length<=50);function Dr(e){return pr(e)}fr({variables:[RegExp(`(^schema$|^kind$|^target$|^removals$|^data$)`,`u`),RegExp(`(^type$|^ref$|^label$|^kind$|^from$|^to$)`,`u`),RegExp(`(^nodes$|^edges$|^containers$)`,`u`),RegExp(`(^id$|^ref$|^label$|^kind$|^set$|^container$)`,`u`),RegExp(`(^label$|^kind$|^container$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^set$)`,`u`),RegExp(`(^kind$|^label$)`,`u`),RegExp(`(^id$|^label$|^kind$)`,`u`),RegExp(`(^participants$|^messages$|^containers$)`,`u`),RegExp(`(^from$|^to$|^ref$|^label$|^set$)`,`u`),RegExp(`(^label$)`,`u`),RegExp(`(^cells$|^role$)`,`u`)]});function Or(){throw Error(`Unreachable`)}function kr(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function Ar(e){return typeof e==`number`}var jr;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(jr||={});var Mr=BigInt(`14695981039346656037`),[Nr,Pr]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],Fr=Array.from({length:256}).map((e,t)=>BigInt(t)),Ir=new Float64Array(1),Lr=new DataView(Ir.buffer),Rr=new Uint8Array(Ir.buffer);function zr(e){Mr^=Fr[e],Mr=Mr*Nr%Pr}function Br(e){zr(jr.Array);for(let t of e)ti(t)}function Vr(e){zr(jr.BigInt),Lr.setBigInt64(0,e);for(let e of Rr)zr(e)}function Hr(e){zr(jr.Boolean),zr(+!!e)}function Ur(e){zr(jr.Constructor),ti(e.toString())}function Wr(e){zr(jr.Date),ti(e.getTime())}function Gr(e){zr(jr.Function),ti(e.toString())}function Kr(e){zr(jr.Null)}function qr(e){zr(jr.Number),Lr.setFloat64(0,e,!0);for(let e of Rr)zr(e)}function Jr(e){zr(jr.Object);for(let t of kr(e).sort())ti(t),ti(e[t])}function Yr(e){zr(jr.RegExp),Zr(e.toString())}var Xr=new TextEncoder;function Zr(e){zr(jr.String);for(let t of Xr.encode(e))zr(t)}function Qr(e){zr(jr.Symbol),ti(e.toString())}function $r(e){zr(jr.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)zr(t[e])}function ei(e){return zr(jr.Undefined)}function ti(e){return cr(e)?$r(e):ur(e)?Wr(e):lr(e)?Yr(e):ar(e)?Hr(e.valueOf()):sr(e)?Zr(e.valueOf()):or(e)?qr(e.valueOf()):Ar(e)?qr(e):Kn(e)?Br(e):Jn(e)?Hr(e):qn(e)?Vr(e):Yn(e)?Ur(e):Zn(e)?Kr(e):Qn(e)?Jr(e):$n(e)?Zr(e):er(e)?Qr(e):tr(e)?ei(e):Xn(e)?Gr(e):Or()}function ni(e){return Mr=BigInt(`14695981039346656037`),ti(e),Mr}function ri(e){return ni(e).toString(16).padStart(16,`0`)}var ii=[];function ai(e){ii=e.variables}var oi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`schema`in e&&`kind`in e&&`data`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[0].test(e)||!1)&&e.schema===`urn:structured-exchange:2`&&(e.kind===`graph`||e.kind===`sequence`||e.kind===`table`)&&(e.profile===void 0||!(`profile`in e)||typeof e.profile==`string`&&rr(e.profile,200)&&ir(e.profile,1))&&(e.target===void 0||!(`target`in e)||typeof e.target==`object`&&e.target!==null&&!Array.isArray(e.target)&&`ref`in e.target&&Object.getOwnPropertyNames(e.target).every((e,t)=>ii[1].test(e)||!1)&&si(e.target.ref)&&(e.target.revision===void 0||!(`revision`in e.target)||ci(e.target.revision)))&&(e.removals===void 0||!(`removals`in e)||Array.isArray(e.removals)&&e.removals.every((e,t)=>li(e))&&e.removals.length<=500)&&(e.artifacts===void 0||!(`artifacts`in e)||Array.isArray(e.artifacts)&&e.artifacts.every((e,t)=>pi(e))&&e.artifacts.length<=50)&&(e.viewpoints===void 0||!(`viewpoints`in e)||Array.isArray(e.viewpoints)&&e.viewpoints.every((e,t)=>mi(e))&&e.viewpoints.length<=20)&&[typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`nodes`in e.data&&`edges`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>ii[6].test(e)||!1)&&Array.isArray(e.data.nodes)&&e.data.nodes.every((e,t)=>hi(e))&&e.data.nodes.length<=500&&e.data.nodes.length>=1&&Array.isArray(e.data.edges)&&e.data.edges.every((e,t)=>Di(e))&&e.data.edges.length<=2e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>ki(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`participants`in e.data&&`messages`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>ii[16].test(e)||!1)&&Array.isArray(e.data.participants)&&e.data.participants.every((e,t)=>hi(e))&&e.data.participants.length<=100&&e.data.participants.length>=1&&Array.isArray(e.data.messages)&&e.data.messages.every((e,t)=>Ai(e))&&e.data.messages.length<=1e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>ki(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`columns`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>ii[19].test(e)||!1)&&Array.isArray(e.data.columns)&&e.data.columns.every((e,t)=>typeof e==`string`&&rr(e,200)&&ir(e,1))&&e.data.columns.length<=50&&e.data.columns.length>=1&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>[Mi(e),Ni(e),Ii(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.data.rows.length<=5e3&&(e.data.relations===void 0||!(`relations`in e.data)||Array.isArray(e.data.relations)&&e.data.relations.every((e,t)=>Li(e))&&e.data.relations.length<=2e3)].reduce((e,t,n)=>t===!0?++e:e,0)===1),si=(e=>typeof e==`string`&&rr(e,200)&&ir(e,1)),ci=(e=>typeof e==`string`&&rr(e,200)&&ir(e,1)),li=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`ref`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[2].test(e)||!1)&&(e.type===`element`||e.type===`relationship`||e.type===`row`)&&si(e.ref)&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.kind===void 0||!(`kind`in e)||di(e.kind))&&(e.from===void 0||!(`from`in e)||fi(e.from))&&(e.to===void 0||!(`to`in e)||fi(e.to))),ui=(e=>typeof e==`string`&&rr(e,500)),di=(e=>typeof e==`string`&&rr(e,100)&&ir(e,1)),fi=(e=>typeof e==`string`&&rr(e,200)&&ir(e,1)),pi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`rel`in e&&`uri`in e&&`sha256`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[3].test(e)||!1)&&typeof e.rel==`string`&&rr(e.rel,100)&&ir(e.rel,1)&&typeof e.uri==`string`&&rr(e.uri,2e3)&&ir(e.uri,1)&&typeof e.sha256==`string`&&ii[4].test(e.sha256)&&(e.mediaType===void 0||!(`mediaType`in e)||typeof e.mediaType==`string`&&rr(e.mediaType,100)&&ir(e.mediaType,1))&&(e.label===void 0||!(`label`in e)||ui(e.label))),mi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&`concern`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[5].test(e)||!1)&&fi(e.id)&&typeof e.label==`string`&&rr(e.label,500)&&ir(e.label,1)&&typeof e.concern==`string`&&rr(e.concern,500)&&ir(e.concern,1)&&(e.elementKinds===void 0||!(`elementKinds`in e)||Array.isArray(e.elementKinds)&&e.elementKinds.every((e,t)=>di(e))&&e.elementKinds.length<=64&&e.elementKinds.length>=1&&new Set(e.elementKinds.map(ri)).size===e.elementKinds.length)&&(e.relationshipKinds===void 0||!(`relationshipKinds`in e)||Array.isArray(e.relationshipKinds)&&e.relationshipKinds.every((e,t)=>di(e))&&e.relationshipKinds.length<=64&&e.relationshipKinds.length>=1&&new Set(e.relationshipKinds.map(ri)).size===e.relationshipKinds.length)),hi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[7].test(e)||!1)&&fi(e.id)&&(e.ref===void 0||!(`ref`in e)||si(e.ref))&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.kind===void 0||!(`kind`in e)||di(e.kind))&&(e.set===void 0||!(`set`in e)||gi(e.set))&&(e.container===void 0||!(`container`in e)||fi(e.container))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Si(e.expect))&&(e.locations===void 0||!(`locations`in e)||Ci(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||Ei(e.artifacts))&&(!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e||!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),gi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>ii[8].test(e)||!1)&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.kind===void 0||!(`kind`in e)||di(e.kind))&&(e.container===void 0||!(`container`in e)||fi(e.container))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||xi(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),_i=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((t,n)=>ii[9].test(t)||vi(e[t]))&&Object.getOwnPropertyNames(e).every((e,t)=>typeof e!=`string`||rr(e,200)&&ir(e,1))&&Object.getOwnPropertyNames(e).length<=50),vi=(e=>[yi(e),bi(e),Array.isArray(e)&&e.every((e,t)=>[yi(e),bi(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.length<=50].reduce((e,t,n)=>t===!0?++e:e,0)===1),yi=(e=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||rr(e,1e3))),bi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`ref`in e&&Object.getOwnPropertyNames(e).length===1&&si(e.ref)),xi=(e=>Array.isArray(e)&&e.every((e,t)=>fi(e))&&e.length<=50),Si=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>ii[10].test(e)||!1)&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.kind===void 0||!(`kind`in e)||di(e.kind))&&(e.container===void 0||!(`container`in e)||fi(e.container))&&(e.revision===void 0||!(`revision`in e)||ci(e.revision))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))&&Object.getOwnPropertyNames(e).length>=1),Ci=(e=>Array.isArray(e)&&e.every((e,t)=>wi(e))&&e.length<=10),wi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`uri`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[11].test(e)||!1)&&typeof e.uri==`string`&&rr(e.uri,2e3)&&ir(e.uri,1)&&(e.revision===void 0||!(`revision`in e)||ci(e.revision))&&(e.range===void 0||!(`range`in e)||typeof e.range==`object`&&e.range!==null&&!Array.isArray(e.range)&&`startLine`in e.range&&`endLine`in e.range&&Object.getOwnPropertyNames(e.range).every((e,t)=>ii[12].test(e)||!1)&&Ti(e.range.startLine)&&(e.range.startCharacter===void 0||!(`startCharacter`in e.range)||Ti(e.range.startCharacter))&&Ti(e.range.endLine)&&(e.range.endCharacter===void 0||!(`endCharacter`in e.range)||Ti(e.range.endCharacter)))),Ti=(e=>Number.isInteger(e)&&(!(Number.isFinite(e)||typeof e==`bigint`)||e<=1e6&&e>=0)),Ei=(e=>Array.isArray(e)&&e.every((e,t)=>pi(e))&&e.length<=20),Di=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[13].test(e)||!1)&&fi(e.from)&&fi(e.to)&&(e.kind===void 0||!(`kind`in e)||di(e.kind))&&(e.ref===void 0||!(`ref`in e)||si(e.ref))&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.set===void 0||!(`set`in e)||Oi(e.set))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Si(e.expect))&&(e.locations===void 0||!(`locations`in e)||Ci(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||Ei(e.artifacts))&&(!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e||!(typeof e==`object`&&e&&!Array.isArray(e))||`kind`in e)),Oi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>ii[14].test(e)||!1)&&(e.kind===void 0||!(`kind`in e)||di(e.kind))&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||xi(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),ki=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[15].test(e)||!1)&&fi(e.id)&&ui(e.label)&&(e.kind===void 0||!(`kind`in e)||di(e.kind))),Ai=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[17].test(e)||!1)&&fi(e.from)&&fi(e.to)&&(e.ref===void 0||!(`ref`in e)||si(e.ref))&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.set===void 0||!(`set`in e)||ji(e.set))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Si(e.expect))&&(e.locations===void 0||!(`locations`in e)||Ci(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||Ei(e.artifacts))&&(!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e||!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),ji=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>ii[18].test(e)||!1)&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||xi(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Mi=(e=>Array.isArray(e)&&e.every((e,t)=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||rr(e,1e3)))&&e.length<=50),Ni=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`cells`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[20].test(e)||!1)&&Mi(e.cells)&&(e.role===void 0||!(`role`in e)||Pi(e.role))&&(e.id===void 0||!(`id`in e)||fi(e.id))&&(e.ref===void 0||!(`ref`in e)||si(e.ref))&&(e.kind===void 0||!(`kind`in e)||di(e.kind))&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.set===void 0||!(`set`in e)||Fi(e.set))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Si(e.expect))&&(e.locations===void 0||!(`locations`in e)||Ci(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||Ei(e.artifacts))),Pi=(e=>e===`added`||e===`changed`||e===`context`||e===`removed`),Fi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>ii[21].test(e)||!1)&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.kind===void 0||!(`kind`in e)||di(e.kind))&&(e.cells===void 0||!(`cells`in e)||Mi(e.cells))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||xi(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Ii=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`heading`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[22].test(e)||!1)&&typeof e.heading==`string`&&rr(e.heading,500)&&ir(e.heading,1)&&(e.depth===void 0||!(`depth`in e)||Number.isInteger(e.depth)&&(!(Number.isFinite(e.depth)||typeof e.depth==`bigint`)||e.depth<=6&&e.depth>=1))&&(e.role===void 0||!(`role`in e)||Pi(e.role))&&(e.id===void 0||!(`id`in e)||fi(e.id))&&(e.ref===void 0||!(`ref`in e)||si(e.ref))),Li=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&`kind`in e&&Object.getOwnPropertyNames(e).every((e,t)=>ii[23].test(e)||!1)&&Ri(e.from)&&Ri(e.to)&&di(e.kind)&&(e.ref===void 0||!(`ref`in e)||si(e.ref))&&(e.label===void 0||!(`label`in e)||ui(e.label))&&(e.attributes===void 0||!(`attributes`in e)||_i(e.attributes))),Ri=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>ii[24].test(e)||!1)&&(e.id===void 0||!(`id`in e)||fi(e.id))&&(e.ref===void 0||!(`ref`in e)||si(e.ref))&&Object.getOwnPropertyNames(e).length>=1&&Object.getOwnPropertyNames(e).length<=1&&[!(typeof e==`object`&&e&&!Array.isArray(e))||`id`in e,!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e].reduce((e,t,n)=>t===!0?++e:e,0)===1);function zi(e){return oi(e)}ai({variables:[RegExp(`(^schema$|^kind$|^profile$|^target$|^removals$|^artifacts$|^viewpoints$|^data$)`,`u`),RegExp(`(^ref$|^revision$)`,`u`),RegExp(`(^type$|^ref$|^label$|^kind$|^from$|^to$)`,`u`),RegExp(`(^rel$|^uri$|^sha256$|^mediaType$|^label$)`,`u`),RegExp(`^sha256:[0-9a-f]{64}$`,`u`),RegExp(`(^id$|^label$|^concern$|^elementKinds$|^relationshipKinds$)`,`u`),RegExp(`(^nodes$|^edges$|^containers$)`,`u`),RegExp(`(^id$|^ref$|^label$|^kind$|^set$|^container$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^container$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(?!)`,`u`),RegExp(`(^label$|^kind$|^container$|^revision$|^attributes$)`,`u`),RegExp(`(^uri$|^revision$|^range$)`,`u`),RegExp(`(^startLine$|^startCharacter$|^endLine$|^endCharacter$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^kind$|^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^id$|^label$|^kind$)`,`u`),RegExp(`(^participants$|^messages$|^containers$)`,`u`),RegExp(`(^from$|^to$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^columns$|^rows$|^relations$)`,`u`),RegExp(`(^cells$|^role$|^id$|^ref$|^kind$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^cells$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^heading$|^depth$|^role$|^id$|^ref$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^attributes$)`,`u`),RegExp(`(^id$|^ref$)`,`u`)]});var Bi=[];function Vi(e){Bi=e.variables}var Hi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`schema`in e&&`kind`in e&&`data`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[0].test(e)||!1)&&e.schema===`urn:structured-exchange:3`&&(e.kind===`graph`||e.kind===`sequence`||e.kind===`table`||e.kind===`timeline`)&&(e.profile===void 0||!(`profile`in e)||typeof e.profile==`string`&&rr(e.profile,200)&&ir(e.profile,1))&&(e.target===void 0||!(`target`in e)||typeof e.target==`object`&&e.target!==null&&!Array.isArray(e.target)&&`ref`in e.target&&Object.getOwnPropertyNames(e.target).every((e,t)=>Bi[1].test(e)||!1)&&Ui(e.target.ref)&&(e.target.revision===void 0||!(`revision`in e.target)||Wi(e.target.revision)))&&(e.removals===void 0||!(`removals`in e)||Array.isArray(e.removals)&&e.removals.every((e,t)=>Gi(e))&&e.removals.length<=500)&&(e.artifacts===void 0||!(`artifacts`in e)||Array.isArray(e.artifacts)&&e.artifacts.every((e,t)=>Yi(e))&&e.artifacts.length<=50)&&(e.viewpoints===void 0||!(`viewpoints`in e)||Array.isArray(e.viewpoints)&&e.viewpoints.every((e,t)=>Xi(e))&&e.viewpoints.length<=20)&&[typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`nodes`in e.data&&`edges`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>Bi[6].test(e)||!1)&&Array.isArray(e.data.nodes)&&e.data.nodes.every((e,t)=>Zi(e))&&e.data.nodes.length<=500&&e.data.nodes.length>=1&&Array.isArray(e.data.edges)&&e.data.edges.every((e,t)=>la(e))&&e.data.edges.length<=2e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>da(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`participants`in e.data&&`messages`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>Bi[16].test(e)||!1)&&Array.isArray(e.data.participants)&&e.data.participants.every((e,t)=>Zi(e))&&e.data.participants.length<=100&&e.data.participants.length>=1&&Array.isArray(e.data.messages)&&e.data.messages.every((e,t)=>fa(e))&&e.data.messages.length<=1e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>da(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`columns`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>Bi[19].test(e)||!1)&&Array.isArray(e.data.columns)&&e.data.columns.every((e,t)=>typeof e==`string`&&rr(e,200)&&ir(e,1))&&e.data.columns.length<=50&&e.data.columns.length>=1&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>[ma(e),ha(e),va(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.data.rows.length<=5e3&&(e.data.relations===void 0||!(`relations`in e.data)||Array.isArray(e.data.relations)&&e.data.relations.every((e,t)=>ya(e))&&e.data.relations.length<=2e3),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`time`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>Bi[25].test(e)||!1)&&(e.data.title===void 0||!(`title`in e.data)||Ki(e.data.title))&&typeof e.data.time==`object`&&e.data.time!==null&&!Array.isArray(e.data.time)&&`start`in e.data.time&&`end`in e.data.time&&`scale`in e.data.time&&Object.getOwnPropertyNames(e.data.time).length===3&&xa(e.data.time.start)&&xa(e.data.time.end)&&(e.data.time.scale===`week`||e.data.time.scale===`month`||e.data.time.scale===`quarter`)&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>Sa(e))&&e.data.rows.length<=500&&(e.data.dependencies===void 0||!(`dependencies`in e.data)||Array.isArray(e.data.dependencies)&&e.data.dependencies.every((e,t)=>ka(e))&&e.data.dependencies.length<=2e3)&&(e.data.comparedTo===void 0||!(`comparedTo`in e.data)||typeof e.data.comparedTo==`object`&&e.data.comparedTo!==null&&!Array.isArray(e.data.comparedTo)&&`label`in e.data.comparedTo&&Object.getOwnPropertyNames(e.data.comparedTo).every((e,t)=>Bi[32].test(e)||!1)&&typeof e.data.comparedTo.label==`string`&&rr(e.data.comparedTo.label,500)&&ir(e.data.comparedTo.label,1)&&(e.data.comparedTo.date===void 0||!(`date`in e.data.comparedTo)||xa(e.data.comparedTo.date)))&&(e.data.periods===void 0||!(`periods`in e.data)||Array.isArray(e.data.periods)&&e.data.periods.every((e,t)=>Aa(e))&&e.data.periods.length<=100)&&(e.data.references===void 0||!(`references`in e.data)||Array.isArray(e.data.references)&&e.data.references.every((e,t)=>ja(e))&&e.data.references.length<=50)].reduce((e,t,n)=>t===!0?++e:e,0)===1),Ui=(e=>typeof e==`string`&&rr(e,200)&&ir(e,1)),Wi=(e=>typeof e==`string`&&rr(e,200)&&ir(e,1)),Gi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`ref`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[2].test(e)||!1)&&(e.type===`element`||e.type===`relationship`||e.type===`row`)&&Ui(e.ref)&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.from===void 0||!(`from`in e)||Ji(e.from))&&(e.to===void 0||!(`to`in e)||Ji(e.to))),Ki=(e=>typeof e==`string`&&rr(e,500)),qi=(e=>typeof e==`string`&&rr(e,100)&&ir(e,1)),Ji=(e=>typeof e==`string`&&rr(e,200)&&ir(e,1)),Yi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`rel`in e&&`uri`in e&&`sha256`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[3].test(e)||!1)&&typeof e.rel==`string`&&rr(e.rel,100)&&ir(e.rel,1)&&typeof e.uri==`string`&&rr(e.uri,2e3)&&ir(e.uri,1)&&typeof e.sha256==`string`&&Bi[4].test(e.sha256)&&(e.mediaType===void 0||!(`mediaType`in e)||typeof e.mediaType==`string`&&rr(e.mediaType,100)&&ir(e.mediaType,1))&&(e.label===void 0||!(`label`in e)||Ki(e.label))),Xi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&`concern`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[5].test(e)||!1)&&Ji(e.id)&&typeof e.label==`string`&&rr(e.label,500)&&ir(e.label,1)&&typeof e.concern==`string`&&rr(e.concern,500)&&ir(e.concern,1)&&(e.elementKinds===void 0||!(`elementKinds`in e)||Array.isArray(e.elementKinds)&&e.elementKinds.every((e,t)=>qi(e))&&e.elementKinds.length<=64&&e.elementKinds.length>=1&&new Set(e.elementKinds.map(ri)).size===e.elementKinds.length)&&(e.relationshipKinds===void 0||!(`relationshipKinds`in e)||Array.isArray(e.relationshipKinds)&&e.relationshipKinds.every((e,t)=>qi(e))&&e.relationshipKinds.length<=64&&e.relationshipKinds.length>=1&&new Set(e.relationshipKinds.map(ri)).size===e.relationshipKinds.length)),Zi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[7].test(e)||!1)&&Ji(e.id)&&(e.ref===void 0||!(`ref`in e)||Ui(e.ref))&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.set===void 0||!(`set`in e)||Qi(e.set))&&(e.container===void 0||!(`container`in e)||Ji(e.container))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))&&(e.expect===void 0||!(`expect`in e)||ia(e.expect))&&(e.locations===void 0||!(`locations`in e)||aa(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||ca(e.artifacts))&&(!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e||!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),Qi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[8].test(e)||!1)&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.container===void 0||!(`container`in e)||Ji(e.container))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ra(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),$i=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((t,n)=>Bi[9].test(t)||ea(e[t]))&&Object.getOwnPropertyNames(e).every((e,t)=>typeof e!=`string`||rr(e,200)&&ir(e,1))&&Object.getOwnPropertyNames(e).length<=50),ea=(e=>[ta(e),na(e),Array.isArray(e)&&e.every((e,t)=>[ta(e),na(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.length<=50].reduce((e,t,n)=>t===!0?++e:e,0)===1),ta=(e=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||rr(e,1e3))),na=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`ref`in e&&Object.getOwnPropertyNames(e).length===1&&Ui(e.ref)),ra=(e=>Array.isArray(e)&&e.every((e,t)=>Ji(e))&&e.length<=50),ia=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[10].test(e)||!1)&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.container===void 0||!(`container`in e)||Ji(e.container))&&(e.revision===void 0||!(`revision`in e)||Wi(e.revision))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))&&Object.getOwnPropertyNames(e).length>=1),aa=(e=>Array.isArray(e)&&e.every((e,t)=>oa(e))&&e.length<=10),oa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`uri`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[11].test(e)||!1)&&typeof e.uri==`string`&&rr(e.uri,2e3)&&ir(e.uri,1)&&(e.revision===void 0||!(`revision`in e)||Wi(e.revision))&&(e.range===void 0||!(`range`in e)||typeof e.range==`object`&&e.range!==null&&!Array.isArray(e.range)&&`startLine`in e.range&&`endLine`in e.range&&Object.getOwnPropertyNames(e.range).every((e,t)=>Bi[12].test(e)||!1)&&sa(e.range.startLine)&&(e.range.startCharacter===void 0||!(`startCharacter`in e.range)||sa(e.range.startCharacter))&&sa(e.range.endLine)&&(e.range.endCharacter===void 0||!(`endCharacter`in e.range)||sa(e.range.endCharacter)))),sa=(e=>Number.isInteger(e)&&(!(Number.isFinite(e)||typeof e==`bigint`)||e<=1e6&&e>=0)),ca=(e=>Array.isArray(e)&&e.every((e,t)=>Yi(e))&&e.length<=20),la=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[13].test(e)||!1)&&Ji(e.from)&&Ji(e.to)&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.ref===void 0||!(`ref`in e)||Ui(e.ref))&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.set===void 0||!(`set`in e)||ua(e.set))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))&&(e.expect===void 0||!(`expect`in e)||ia(e.expect))&&(e.locations===void 0||!(`locations`in e)||aa(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||ca(e.artifacts))&&(!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e||!(typeof e==`object`&&e&&!Array.isArray(e))||`kind`in e)),ua=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[14].test(e)||!1)&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ra(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),da=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[15].test(e)||!1)&&Ji(e.id)&&Ki(e.label)&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))),fa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[17].test(e)||!1)&&Ji(e.from)&&Ji(e.to)&&(e.ref===void 0||!(`ref`in e)||Ui(e.ref))&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.set===void 0||!(`set`in e)||pa(e.set))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))&&(e.expect===void 0||!(`expect`in e)||ia(e.expect))&&(e.locations===void 0||!(`locations`in e)||aa(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||ca(e.artifacts))&&(!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e||!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),pa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[18].test(e)||!1)&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ra(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),ma=(e=>Array.isArray(e)&&e.every((e,t)=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||rr(e,1e3)))&&e.length<=50),ha=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`cells`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[20].test(e)||!1)&&ma(e.cells)&&(e.role===void 0||!(`role`in e)||ga(e.role))&&(e.id===void 0||!(`id`in e)||Ji(e.id))&&(e.ref===void 0||!(`ref`in e)||Ui(e.ref))&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.set===void 0||!(`set`in e)||_a(e.set))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))&&(e.expect===void 0||!(`expect`in e)||ia(e.expect))&&(e.locations===void 0||!(`locations`in e)||aa(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||ca(e.artifacts))),ga=(e=>e===`added`||e===`changed`||e===`context`||e===`removed`),_a=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[21].test(e)||!1)&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.cells===void 0||!(`cells`in e)||ma(e.cells))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ra(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),va=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`heading`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[22].test(e)||!1)&&typeof e.heading==`string`&&rr(e.heading,500)&&ir(e.heading,1)&&(e.depth===void 0||!(`depth`in e)||Number.isInteger(e.depth)&&(!(Number.isFinite(e.depth)||typeof e.depth==`bigint`)||e.depth<=6&&e.depth>=1))&&(e.role===void 0||!(`role`in e)||ga(e.role))&&(e.id===void 0||!(`id`in e)||Ji(e.id))&&(e.ref===void 0||!(`ref`in e)||Ui(e.ref))),ya=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&`kind`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[23].test(e)||!1)&&ba(e.from)&&ba(e.to)&&qi(e.kind)&&(e.ref===void 0||!(`ref`in e)||Ui(e.ref))&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.attributes===void 0||!(`attributes`in e)||$i(e.attributes))),ba=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[24].test(e)||!1)&&(e.id===void 0||!(`id`in e)||Ji(e.id))&&(e.ref===void 0||!(`ref`in e)||Ui(e.ref))&&Object.getOwnPropertyNames(e).length>=1&&Object.getOwnPropertyNames(e).length<=1&&[!(typeof e==`object`&&e&&!Array.isArray(e))||`id`in e,!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e].reduce((e,t,n)=>t===!0?++e:e,0)===1),xa=(e=>typeof e==`string`&&Bi[26].test(e)),Sa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&(e.type===`task`||e.type===`separator`)&&(!(typeof e==`object`&&e&&!Array.isArray(e))||e.type===void 0||!(`type`in e)||e.type===`task`?Ca(e):!0)&&(!(typeof e==`object`&&e&&!Array.isArray(e))||e.type===void 0||!(`type`in e)||e.type===`separator`?Oa(e):!0)),Ca=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`id`in e&&`label`in e&&`items`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[27].test(e)||!1)&&e.type===`task`&&Ji(e.id)&&Ki(e.label)&&Array.isArray(e.items)&&e.items.every((e,t)=>wa(e))&&e.items.length<=100&&(e.role===void 0||!(`role`in e)||Ea(e.role))),wa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&(e.type===`activity`||e.type===`milestone`)&&(!(typeof e==`object`&&e&&!Array.isArray(e))||e.type===void 0||!(`type`in e)||e.type===`activity`?Ta(e):!0)&&(!(typeof e==`object`&&e&&!Array.isArray(e))||e.type===void 0||!(`type`in e)||e.type===`milestone`?Da(e):!0)),Ta=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`start`in e&&`end`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[28].test(e)||!1)&&e.type===`activity`&&xa(e.start)&&xa(e.end)&&(e.id===void 0||!(`id`in e)||Ji(e.id))&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.previous===void 0||!(`previous`in e)||typeof e.previous==`object`&&e.previous!==null&&!Array.isArray(e.previous)&&`start`in e.previous&&`end`in e.previous&&Object.getOwnPropertyNames(e.previous).length===2&&xa(e.previous.start)&&xa(e.previous.end))&&(e.role===void 0||!(`role`in e)||Ea(e.role))),Ea=(e=>e===`added`||e===`removed`),Da=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`date`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[29].test(e)||!1)&&e.type===`milestone`&&xa(e.date)&&(e.id===void 0||!(`id`in e)||Ji(e.id))&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))&&(e.previous===void 0||!(`previous`in e)||typeof e.previous==`object`&&e.previous!==null&&!Array.isArray(e.previous)&&`date`in e.previous&&Object.getOwnPropertyNames(e.previous).length===1&&xa(e.previous.date))&&(e.role===void 0||!(`role`in e)||Ea(e.role))),Oa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[30].test(e)||!1)&&e.type===`separator`&&(e.label===void 0||!(`label`in e)||Ki(e.label))),ka=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[31].test(e)||!1)&&Ji(e.from)&&Ji(e.to)&&(e.type===void 0||!(`type`in e)||e.type===`finish-to-start`||e.type===`start-to-start`||e.type===`finish-to-finish`||e.type===`start-to-finish`)),Aa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`start`in e&&`end`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[33].test(e)||!1)&&xa(e.start)&&xa(e.end)&&(e.label===void 0||!(`label`in e)||Ki(e.label))&&(e.kind===void 0||!(`kind`in e)||qi(e.kind))),ja=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`date`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Bi[34].test(e)||!1)&&xa(e.date)&&typeof e.label==`string`&&rr(e.label,500)&&ir(e.label,1)&&(e.kind===void 0||!(`kind`in e)||qi(e.kind)));function Ma(e){return Hi(e)}Vi({variables:[RegExp(`(^schema$|^kind$|^profile$|^target$|^removals$|^artifacts$|^viewpoints$|^data$)`,`u`),RegExp(`(^ref$|^revision$)`,`u`),RegExp(`(^type$|^ref$|^label$|^kind$|^from$|^to$)`,`u`),RegExp(`(^rel$|^uri$|^sha256$|^mediaType$|^label$)`,`u`),RegExp(`^sha256:[0-9a-f]{64}$`,`u`),RegExp(`(^id$|^label$|^concern$|^elementKinds$|^relationshipKinds$)`,`u`),RegExp(`(^nodes$|^edges$|^containers$)`,`u`),RegExp(`(^id$|^ref$|^label$|^kind$|^set$|^container$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^container$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(?!)`,`u`),RegExp(`(^label$|^kind$|^container$|^revision$|^attributes$)`,`u`),RegExp(`(^uri$|^revision$|^range$)`,`u`),RegExp(`(^startLine$|^startCharacter$|^endLine$|^endCharacter$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^kind$|^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^id$|^label$|^kind$)`,`u`),RegExp(`(^participants$|^messages$|^containers$)`,`u`),RegExp(`(^from$|^to$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^columns$|^rows$|^relations$)`,`u`),RegExp(`(^cells$|^role$|^id$|^ref$|^kind$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^cells$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^heading$|^depth$|^role$|^id$|^ref$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^attributes$)`,`u`),RegExp(`(^id$|^ref$)`,`u`),RegExp(`(^title$|^time$|^rows$|^dependencies$|^comparedTo$|^periods$|^references$)`,`u`),RegExp(`^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$`,`u`),RegExp(`(^type$|^id$|^label$|^items$|^role$)`,`u`),RegExp(`(^type$|^start$|^end$|^id$|^label$|^kind$|^previous$|^role$)`,`u`),RegExp(`(^type$|^date$|^id$|^label$|^kind$|^previous$|^role$)`,`u`),RegExp(`(^type$|^label$)`,`u`),RegExp(`(^from$|^to$|^type$)`,`u`),RegExp(`(^label$|^date$)`,`u`),RegExp(`(^start$|^end$|^label$|^kind$)`,`u`),RegExp(`(^date$|^label$|^kind$)`,`u`)]});var Na={[Ge]:Dr,[Ze]:zi,[et]:Ma},Pa=e=>{let t=On(e),n=nt(t);return n===void 0&&t!==void 0?[{rule:`unsupported-version`,path:`/schema`,message:`this build validates ${tt.join(` and `)}`}]:Na[n??`urn:structured-exchange:1`](e)?[]:[{rule:`schema/invalid`,path:``,message:`does not conform to the published structured-exchange schema`}]},Fa=Object.defineProperty,Ia=(e,t,n)=>t in e?Fa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,La=(e,t)=>{for(var n in t)Fa(e,n,{get:t[n],enumerable:!0})},Ra=(e,t,n)=>Ia(e,typeof t==`symbol`?t:t+``,n),za={};La(za,{Graph:()=>To,alg:()=>Qa});var Ba=Object.defineProperty,Va=(e,t)=>{for(var n in t)Ba(e,n,{get:t[n],enumerable:!0})},Ha=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=Ga(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=Ka(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,Ua(this._preds[a],i),Ua(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?qa(this._isDirected,e):Ga(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?qa(this._isDirected,e):Ga(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?qa(this._isDirected,e):Ga(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],Wa(this._preds[t],e),Wa(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function Ua(e,t){e[t]?e[t]++:e[t]=1}function Wa(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Ga(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function Ka(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function qa(e,t){return Ga(e,t.v,t.w,t.name)}Va({},{read:()=>Za,write:()=>Ja});function Ja(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Ya(e),edges:Xa(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Ya(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function Xa(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function Za(e){let t=new Ha(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var Qa={};Va(Qa,{CycleException:()=>mo,bellmanFord:()=>eo,components:()=>no,dijkstra:()=>ao,dijkstraAll:()=>so,findCycles:()=>lo,floydWarshall:()=>fo,isAcyclic:()=>go,postorder:()=>bo,preorder:()=>xo,prim:()=>So,shortestPaths:()=>Co,tarjan:()=>co,topsort:()=>ho});var $a=()=>1;function eo(e,t,n,r){return to(e,String(t),n||$a,r||function(t){return e.outEdges(t)??[]})}function to(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function no(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var ro=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},io=()=>1;function ao(e,t,n,r){return oo(e,String(t),n||io,r||function(t){return e.outEdges(t)??[]})}function oo(e,t,n,r){let i={},a=new ro,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function so(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=ao(e,i,t,n),r},{})}function co(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function lo(e){return co(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var uo=()=>1;function fo(e,t,n){return po(e,t||uo,n||function(t){return e.outEdges(t)??[]})}function po(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var mo=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function ho(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new mo;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new mo;return r}function go(e){try{ho(e)}catch(e){if(e instanceof mo)return!1;throw e}return!0}function _o(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=vo(e,t,n===`post`,o,a,r,i)}),i}function vo(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=vo(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function yo(e,t,n){return _o(e,t,n,function(e,t){return e.push(t),e},[])}function bo(e,t){return yo(e,t,`post`)}function xo(e,t){return yo(e,t,`pre`)}function So(e,t){var n;let r=new Ha,i={},a=new ro,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function Co(e,t,n,r){return wo(e,t,n,r??(t=>e.outEdges(t)??[]))}function wo(e,t,n,r){if(n===void 0)return ao(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return eo(e,t,n,r)}return ao(e,t,n,r)}var To=Ha;function Eo(e,t,n,r){let i=r;for(;e.hasNode(i);)i=Ho(r);return n.dummy=t,e.setNode(i,n),i}function Do(e){let t=new To().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function Oo(e){let t=new To({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function ko(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Ao(e){let t=Uo(Lo(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function jo(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=Io(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Mo(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=Io(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function No(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Eo(e,`border`,i,t)}function Po(e,t=Fo){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var Fo=65535;function Io(e,t){return t.length>Fo?e(...Po(t).map(t=>e(...t))):e(...t)}function Lo(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return Io(Math.max,t)}function Ro(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function zo(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function Bo(e,t){return t()}var Vo=0;function Ho(e){return e+(``+ ++Vo)}function Uo(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function Wo(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function Go(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Ko(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var qo=`\0`;function Jo(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var Yo=`3.1.1`,Xo=class{constructor(){Ra(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Zo(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Zo(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Qo)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Zo(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Qo(e,t){if(e!==`_next`&&e!==`_prev`)return t}var $o=Xo,es=()=>1;function ts(e,t){if(e.nodeCount()<=1)return[];let n=is(e,t||es);return ns(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function ns(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)rs(e,t,n,o);for(;o=i.dequeue();)rs(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(rs(e,t,n,o,!0)||[]);break}}}return r}function rs(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,as(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,as(t,n,o)}),e.removeNode(r.v),o}function is(e,t){let n=new To,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=os(i+r+3).map(()=>new $o),o=r+1;return n.nodes().forEach(e=>{as(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function as(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function os(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function ss(e,t){(e.graph().acyclicer===`greedy`?ts(e,n(e)):cs(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Ho(`rev`))});function n(e){return t=>e.edge(t).weight}}function cs(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&us(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function ls(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function us(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function ds(e){e.graph().dummyChains=[],e.edges().forEach(t=>fs(e,t))}function fs(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=Eo(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ps(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function ms(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=Io(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function hs(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var gs=_s;function _s(e){let t=new To({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;vs(t,e)<i&&(a=ys(t,e),a);)o=t.hasNode(a.v)?hs(e,a):-hs(e,a),bs(t,e,o);return t}function vs(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!hs(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function ys(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=hs(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function bs(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:xs,postorder:Ss}=Qa,Cs=ws;ws.initLowLimValues=Os,ws.initCutValues=Ts,ws.calcCutValue=Ds,ws.leaveEdge=As,ws.enterEdge=js,ws.exchangeEdges=Ms;function ws(e){e=Do(e),ms(e);let t=gs(e);Os(t),Ts(t,e);let n,r;for(;n=As(t);)r=js(t,e,n),Ms(t,e,n,r)}function Ts(e,t){let n=Ss(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>Es(e,t,n))}function Es(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=Ds(e,t,n)}function Ds(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,Ps(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function Os(e,t){arguments.length<2&&(t=e.nodes()[0]),ks(e,{},1,t)}function ks(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=ks(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function As(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function js(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===Fs(e,e.node(t.v),s)&&c!==Fs(e,e.node(t.w),s)).reduce((e,n)=>hs(t,n)<hs(t,e)?n:e)}function Ms(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Os(e),Ts(e,t),Ns(e,t)}function Ns(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=xs(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Ps(e,t,n){return e.hasEdge(t,n)}function Fs(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Is=Ls;function Ls(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:Bs(e);break;case`tight-tree`:zs(e);break;case`longest-path`:Rs(e);break;case`none`:break;default:Bs(e)}}var Rs=ms;function zs(e){ms(e),gs(e)}function Bs(e){Cs(e)}var Vs=Hs;function Hs(e){let t=Ws(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Us(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function Us(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function Ws(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(qo).forEach(r),t}function Gs(e){let t=Eo(e,`root`,{},`_root`),n=qs(e),r=Object.values(n),i=Io(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=Js(e)+1;e.children(qo).forEach(r=>{Ks(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function Ks(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=No(e,`_bt`),l=No(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Ks(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function qs(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(qo).forEach(e=>n(e,1)),t}function Js(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Ys(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var Xs=Zs;function Zs(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)Qs(e,`borderLeft`,`_bl`,n,i,t),Qs(e,`borderRight`,`_br`,n,i,t)}}e.children(qo).forEach(t)}function Qs(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Eo(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function $s(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&tc(e)}function ec(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&rc(e),(t===`lr`||t===`rl`)&&(ac(e),tc(e))}function tc(e){e.nodes().forEach(t=>nc(e.node(t))),e.edges().forEach(t=>nc(e.edge(t)))}function nc(e){let t=e.width;e.width=e.height,e.height=t}function rc(e){e.nodes().forEach(t=>ic(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(ic),Object.hasOwn(r,`y`)&&ic(r)})}function ic(e){e.y=-e.y}function ac(e){e.nodes().forEach(t=>oc(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(oc),Object.hasOwn(r,`x`)&&oc(r)})}function oc(e){let t=e.x;e.x=e.y,e.y=t}function sc(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=Uo(Io(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return Jo(t,e.node(n),e.node(r))}return a}function cc(e,t){let n=0;for(let r=1;r<t.length;++r)n+=lc(e,t[r-1],t[r]);return n}function lc(e,t,n){let r=Ko(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function uc(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function dc(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),fc(Object.values(n).filter(e=>!e.indegree))}function fc(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&pc(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>Wo(e,[`vs`,`i`,`barycenter`,`weight`]))}function pc(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function mc(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=Ro(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(gc(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=hc(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=hc(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function hc(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function gc(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=Jo(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function _c(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=uc(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=_c(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&yc(t,r)}});let h=dc(m,n);vc(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(!(!h[t]||!h[n]||!((a=h[t])!=null&&a.barycenter)||!((o=h[n])!=null&&o.barycenter))&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=mc(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function vc(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function yc(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function bc(e,t,n,r){r||=e.nodes();let i=xc(e),a=new To({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function xc(e){let t;for(;e.hasNode(t=Ho(`_root`)););return t}function Sc(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Cc(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,Cc);return}let r=Lo(e),i=wc(e,Uo(1,r+1),`inEdges`),a=wc(e,Uo(r-1,-1,-1),`outEdges`),o=sc(e,n);if(Ec(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){Tc(t%2?i:a,t%4>=2,l,n),o=Ao(e);let u=cc(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}Ec(e,c)}function wc(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return bc(e,t,n,r.get(t)||[])})}function Tc(e,t,n,r){let i=!0,a=new To;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=_c(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),Sc(e,a,s.vs)})}function Ec(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function Dc(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=kc(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Ac(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function Oc(e,t){let n={};function r(t,r,i,a,o){Uo(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Ac(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function kc(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Ac(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function jc(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function Mc(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||Vc(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>Vc(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!jc(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function Nc(e,t,n,r,i=!1){let a={},o=Pc(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function Pc(e,t,n,r){let i=new To,a=e.graph(),o=zc(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function Fc(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=Bc(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function Ic(e,t){let n=Object.values(t),r=Io(Math.min,n),i=Io(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-Io(Math.min,c);a!==`l`&&(l=i-Io(Math.max,c)),l&&(e[o]=Go(s,e=>e+l))})})}function Lc(e,t=void 0){let n=e.ul;return n?Go(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function Rc(e,t){let n=Ao(e),r=Object.assign(Dc(e,n),Oc(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=Mc(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=Nc(e,a,s.root,s.align,n===`r`);n===`r`&&(c=Go(c,e=>-e)),i[o+n]=c})}),Ic(i,Fc(e,i)),Lc(i,e.graph().align)}function zc(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),c}}function Bc(e,t){return e.node(t).width}function Vc(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function Hc(e,t){e=Oo(e),Uc(e),Object.entries(Rc(e,t)).forEach(([t,n])=>e.node(t).x=n)}function Uc(e){let t=Ao(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var Wc=new WeakMap;function Gc(e,t={}){return qc(e,Bo,t),e}function Kc(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function qc(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new To({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=Kc(e,t.v,r),i=Kc(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),qc(o,t,n);let l=il(o);Jc(l,t,n,null),Yc(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=il(e),g=Jc(h,t,n,Wc.get(e)??null);Wc.set(e,g),Yc(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function Jc(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>al(e)),t(` removeSelfEdges`,()=>ml(e)),t(` acyclic`,()=>ss(e,s)),t(` nestingGraph.run`,()=>Gs(e)),t(` rank`,()=>Is(Oo(e))),t(` injectEdgeLabelProxies`,()=>ol(e)),t(` removeEmptyRanks`,()=>Mo(e)),t(` nestingGraph.cleanup`,()=>Ys(e)),t(` normalizeRanks`,()=>jo(e)),t(` assignRankMinMax`,()=>sl(e)),t(` removeEdgeLabelProxies`,()=>cl(e)),t(` normalize.run`,()=>ds(e)),t(` parentDummyChains`,()=>Vs(e)),t(` addBorderSegments`,()=>Xs(e)),t(` order`,()=>Cc(e,n,c)),t(` insertSelfEdges`,()=>hl(e)),t(` adjustCoordinateSystem`,()=>$s(e)),t(` position`,()=>Hc(e,n.corePath)),t(` positionSelfEdges`,()=>gl(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>pl(e)),t(` normalize.undo`,()=>ps(e)),t(` fixupEdgeLabelCoords`,()=>dl(e)),t(` undoCoordinateSystem`,()=>ec(e)),t(` translateGraph`,()=>ll(e)),t(` assignNodeIntersects`,()=>ul(e)),t(` reversePoints`,()=>fl(e)),t(` acyclic.undo`,()=>ls(e)),{graph:e,rawNodes:l}}function Yc(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Xc=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Zc={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},Qc=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],$c=[`width`,`height`,`rank`],el={width:0,height:0},tl=[`minlen`,`weight`,`width`,`height`,`labeloffset`],nl={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},rl=[`labelpos`];function il(e){let t=new To({multigraph:!0,compound:!0}),n=vl(e.graph());return t.setGraph(Object.assign({},Zc,_l(n,Xc),Wo(n,Qc))),e.nodes().forEach(n=>{let r=_l(vl(e.node(n)),$c);Object.keys(el).forEach(e=>{r[e]===void 0&&(r[e]=el[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=vl(e.edge(n));t.setEdge(n,Object.assign({},nl,_l(r,tl),Wo(r,rl)))}),t}function al(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function ol(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);Eo(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function sl(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function cl(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function ll(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function ul(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(ko(r,a)),n.points.push(ko(i,o))})}function dl(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function fl(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function pl(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function ml(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function hl(e){Ao(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{Eo(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function gl(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function _l(e,t){return Go(Wo(e,t),Number)}function vl(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function yl(e){let t=Ao(e),n=new To({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var bl={graphlib:za,version:Yo,layout:Gc,debug:yl,util:{time:zo,notime:Bo}};function xl(e,t){return t?e.ref===void 0?`added`:e.set===void 0?`context`:`changed`:`unchanged`}function Sl(e,t){if(t&&e.heading===void 0)return e.ref===void 0?`added`:e.set===void 0?`context`:`changed`}function Cl(e,t){return t?e.ref===void 0?`added`:e.set===void 0?`context`:`changed`:`unchanged`}function wl(e){let t=e.set;if(t===void 0)return[];let n=e;return Object.entries(t).filter(([e])=>e!==`attributes`&&e!==`removeAttributes`).map(([e,t])=>{let r=n[e];return{field:e,...typeof r==`string`?{from:r}:{},to:String(t)}})}var Tl={added:`added`,changed:`changed`,context:`existing`,unchanged:``},El={added:`added`,changed:`changed`,context:`existing`,removed:`removed`},Dl=[`added`,`changed`,`context`,`removed`];function Ol(e){return e.rows.some(e=>Ye(e).role!==void 0)}function kl(e,t){if(t)return Ye(e).role??`context`}function Al(e){if(e.length===0)return;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t-Pl,y:n-Pl-Fl,width:r-t+Pl*2,height:i-n+Pl*2+Fl}}var jl=64,Ml=24,Nl=12,Pl=10,Fl=16,Il=16,Ll=160,Rl=52;function zl(e,t,n=`landscape`){let r=new bl.graphlib.Graph({compound:!0,multigraph:!0});r.setGraph({rankdir:n===`portrait`?`TB`:`LR`,ranksep:jl,nodesep:Ml,marginx:Nl,marginy:Nl}),r.setDefaultEdgeLabel(()=>({}));for(let n of e.nodes)r.setNode(n.id,t(n));let i=e.containers??[],a=new Map;for(let t of e.nodes)t.container!==void 0&&i.some(e=>e.id===t.container)&&(r.setNode(t.container,{label:t.container}),r.setParent(t.id,t.container),a.set(t.container,[...a.get(t.container)??[],t.id]));e.edges.forEach((e,t)=>{e.from!==e.to&&r.hasNode(e.from)&&r.hasNode(e.to)&&r.setEdge(e.from,e.to,{},String(t))}),bl.layout(r);let o=e.nodes.map(e=>{let n=r.node(e.id),{width:i,height:a}=t(e);return{id:e.id,x:(n?.x??Nl+i/2)-i/2,y:(n?.y??Nl+a/2)-a/2,width:i,height:a}}),s=[];e.edges.forEach((e,t)=>{if(e.from===e.to)return;let n=r.edge(e.from,e.to,String(t));n?.points!==void 0&&n.points.length>0&&s.push({index:t,points:n.points.map(e=>({x:e.x,y:e.y}))})});let c=[],l=o.reduce((e,t)=>Math.max(e,t.y+t.height),Nl)+Il,u=new Map(o.map(e=>[e.id,e]));for(let e of i){let t=Al((a.get(e.id)??[]).flatMap(e=>{let t=u.get(e);return t===void 0?[]:[t]}));t===void 0?(c.push({id:e.id,label:e.label,x:Nl,y:l,width:Ll,height:Rl}),l+=68):c.push({id:e.id,label:e.label,...t})}let d=[...o.map(e=>({x:e.x,y:e.y,width:e.width,height:e.height})),...c],f=Math.min(0,...d.map(e=>e.x))-Nl,p=Math.min(0,...d.map(e=>e.y))-Nl;if(f<0||p<0){for(let e of o)e.x-=f,e.y-=p;for(let e of c)e.x-=f,e.y-=p;for(let e of s)for(let t of e.points)t.x-=f,t.y-=p}let m=[...o.map(e=>({x:e.x,y:e.y,width:e.width,height:e.height})),...c].reduce((e,t)=>({width:Math.max(e.width,t.x+t.width),height:Math.max(e.height,t.y+t.height)}),{width:0,height:0});return{nodes:o,edges:s,containers:c,width:m.width+Nl,height:m.height+Nl}}var Bl={attributes:[],expectations:[],assignments:[],removedAttributes:[],locations:[],artifacts:[]};function Vl(e){if(typeof e!=`object`||!e)return Bl;let t=e,n=e=>typeof e==`object`&&e&&!Array.isArray(e)?Object.entries(e):[],r=t.set,i=r?.removeAttributes;return{attributes:n(t.attributes),expectations:n(t.expect?.attributes),assignments:n(r?.attributes),removedAttributes:Array.isArray(i)?i.filter(e=>typeof e==`string`):[],locations:Array.isArray(t.locations)?t.locations:[],artifacts:Array.isArray(t.artifacts)?t.artifacts:[]}}function Hl(e){let t=e.target;if(typeof t==`string`)return{ref:t};if(typeof t!=`object`||!t)return;let n=t;if(typeof n.ref==`string`)return{ref:n.ref,...typeof n.revision==`string`?{revision:n.revision}:{}}}function Ul(e,t){let n=(e.removals??[]).map(e=>({type:e.type,ref:e.ref})),r=e.profile,i=e.artifacts,a={...typeof r==`string`?{profile:r}:{},...(()=>{let t=Hl(e);return t===void 0?{}:{target:t}})(),artifacts:Array.isArray(i)?i:[]};if(e.kind===`table`){let r=e.data,i=Ol(r),o=r.rows.map(e=>{let n=Array.isArray(e)?{}:e,r=(Array.isArray(e)?void 0:e.role)??Sl({ref:typeof n.ref==`string`?n.ref:void 0,set:n.set,heading:typeof n.heading==`string`?n.heading:void 0},t)??kl(e,i),{cells:a,heading:o}=Ye(e),s=Array.isArray(e)?{}:e;return{cells:a,...r===void 0?{}:{role:r},...o===void 0?{}:{heading:o},...typeof s.depth==`number`?{depth:s.depth}:{},...typeof s.id==`string`?{id:s.id}:{},...typeof s.ref==`string`?{ref:s.ref}:{},...typeof s.kind==`string`?{kind:s.kind}:{},changes:wl(s),...Vl(e)}}),s=new Map;for(let e of o){if(e.id===void 0)continue;let t=e.cells.find(e=>typeof e==`string`&&e!==``);s.set(e.id,(typeof t==`string`?t:void 0)??e.ref??e.id)}let c=r.relations,l=(Array.isArray(c)?c:[]).map(e=>{let t=e,n=e=>{let t=typeof e?.id==`string`?e.id:void 0,n=typeof e?.ref==`string`?e.ref:void 0;return{id:t,ref:n,label:(t===void 0?void 0:s.get(t))??n??t??``}},r=n(t.from),i=n(t.to);return{kind:t.kind??``,...typeof t.label==`string`?{label:t.label}:{},...r.id===void 0?{}:{fromRow:r.id},...i.id===void 0?{}:{toRow:i.id},...r.ref===void 0?{}:{fromRef:r.ref},...i.ref===void 0?{}:{toRef:i.ref},fromLabel:r.label,toLabel:i.label}});return{thingNoun:`column`,linkNoun:`row`,things:[],links:[],columns:r.columns,rows:o,containers:[],removals:n,traces:l,...a}}if(e.kind===`timeline`)return{thingNoun:`task`,linkNoun:`dependency`,things:[],links:[],containers:[],removals:n,traces:[],...a};let o=e.kind===`graph`,s=o?e.data.nodes:e.data.participants,c=o?e.data.edges:e.data.messages,l=new Map(s.map(e=>[e.id,Wl(e)]));return{thingNoun:o?`element`:`participant`,linkNoun:o?`relationship`:`message`,things:s.map(e=>({id:e.id,label:Wl(e),kind:e.kind,role:xl(e,t),changes:wl(e),container:e.container,...Vl(e)})),links:c.map(e=>({from:e.from,to:e.to,fromLabel:l.get(e.from)??e.from,toLabel:l.get(e.to)??e.to,label:e.label,kind:`kind`in e?e.kind:void 0,role:Cl(e,t),changes:wl(e),isLoop:e.from===e.to,...Vl(e)})),containers:e.data.containers??[],removals:n,traces:[],...a}}function Wl(e){return e.label??e.ref??e.id}function Gl(e){if(e.kind===`graph`){let t=e.data,n=[`flowchart TD`],r=t.containers??[],i=new Set(r.map(e=>e.id)),a=e=>t.nodes.filter(t=>t.container===e);for(let e of r){n.push(` subgraph ${Kl(e.id)}["${Jl(e.label)}"]`);for(let t of a(e.id))n.push(` ${Kl(t.id)}["${Jl(Wl(t))}"]`);n.push(` end`)}for(let e of t.nodes)e.container!==void 0&&i.has(e.container)||n.push(` ${Kl(e.id)}["${Jl(Wl(e))}"]`);for(let e of t.edges){let t=e.label??e.kind,r=t===void 0?`-->`:`-- "${Jl(t)}" -->`;n.push(` ${Kl(e.from)} ${r} ${Kl(e.to)}`)}return n.join(`
|
|
23
|
+
`)}if(e.kind===`sequence`){let t=e.data,n=[`sequenceDiagram`],r=t.containers??[],i=new Set(r.map(e=>e.id)),a=(e,t)=>`${t}participant ${Kl(e.id)} as "${Jl(Wl(e))}"`;for(let e of r){n.push(` box ${Jl(e.label)}`);for(let r of t.participants.filter(t=>t.container===e.id))n.push(a(r,` `));n.push(` end`)}for(let e of t.participants)e.container!==void 0&&i.has(e.container)||n.push(a(e,` `));for(let e of t.messages)n.push(` ${Kl(e.from)}->>${Kl(e.to)}: ${Jl(e.label??``)}`);return n.join(`
|
|
24
|
+
`)}}function Kl(e){return`n${[...e].map(e=>e.charCodeAt(0).toString(36)).join(``)}`}var ql={"#":`#35;`,'"':`#quot;`,";":`#59;`,"<":`#60;`,">":`#62;`};function Jl(e){return e.replace(/[#";<>]/g,e=>ql[e]).replace(/[\r\n\t\f\v\u0000-\u001f\u2028\u2029]+/g,` `)}function Yl(e,t){return`${e}:${t}`}var Xl=new Set;function Zl(e,t,n){return n===void 0||n===``?!1:e.has(Yl(t,n))}function Ql(e){let t=e?.viewpoints;return Array.isArray(t)?t:[]}function $l(e,t){let n=new Set,r=(e,t,r)=>{if(t===void 0)return;let i=new Set(t);for(let t of e)t.kind!==void 0&&t.kind!==``&&!i.has(t.kind)&&n.add(Yl(r,t.kind))};return r(e.nodes,t.elementKinds,`element`),r(e.edges,t.relationshipKinds,`relationship`),n}function eu(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var tu=40,nu=22;function ru(e){let t=e.containers??[],n;if(t.length===0)n=e.participants;else{let r=new Set(t.map(e=>e.id)),i=new Set;n=[];for(let t of e.participants){if(i.has(t.id))continue;let a=t.container;if(a===void 0||!r.has(a)){n.push(t),i.add(t.id);continue}for(let t of e.participants)t.container!==a||i.has(t.id)||(n.push(t),i.add(t.id))}}let r=[];n.forEach((e,n)=>{let i=t.find(t=>t.id===e.container);if(i===void 0)return;let a=r.at(-1);a!==void 0&&a.container.id===i.id&&a.to===n-1?a.to=n:r.push({container:i,from:n,to:n})});let i=t.length>0?nu:0,a=new Map(n.map((e,t)=>[e.id,t])),o=Math.max(...e.participants.map(e=>gt([Wl(e)],wl(e),110,240)),ht(e.messages.map(e=>e.label??``),110,240)*.8),s=o-14,c=e.participants.reduce((e,t)=>Math.max(e,vt(_t(Wl(t),s).length,yt(wl(t),s).length)),vt(1,0))+8;return{columns:n,bands:r,bandHeight:i,lifelineX:o,boxW:s,headerHeight:c,messageGap:tu,width:Math.max(e.participants.length*o,240),height:i+c+(e.messages.length+1)*tu,xOf:e=>(a.get(e)??0)*o+o/2}}function iu(e,t){let n=[Wl(e)];t!==`unchanged`&&n.push(`(${Tl[t]})`),e.ref!==void 0&&n.push(`[${e.ref}]`);for(let t of wl(e))n.push(bt(t));return n.join(` `)}function au(e,t){let n=t.cx-e.cx,r=t.cy-e.cy;if(n===0&&r===0)return{x:e.cx,y:e.cy};let i=Math.min(n===0?1/0:e.w/2/Math.abs(n),r===0?1/0:e.h/2/Math.abs(r));return{x:e.cx+n*i,y:e.cy+r*i}}function ou(e,t){if(e.length<3)return e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `);let n=[`M ${e[0].x} ${e[0].y}`];for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1],s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.hypot(o.x-a.x,o.y-a.y);if(s===0||c===0)continue;let l=((a.x-i.x)*(o.y-a.y)-(a.y-i.y)*(o.x-a.x))/(s*c);if(Math.abs(l)<.02)continue;let u=Math.min(t,s/2,c/2),d={x:a.x-(a.x-i.x)/s*u,y:a.y-(a.y-i.y)/s*u},f={x:a.x+(o.x-a.x)/c*u,y:a.y+(o.y-a.y)/c*u};n.push(`L ${d.x} ${d.y}`,`Q ${a.x} ${a.y} ${f.x} ${f.y}`)}let r=e[e.length-1];return n.push(`L ${r.x} ${r.y}`),n.join(` `)}function su(e,t,n,r,i){if(e===t){let t=26+r*12,n=e.cx-e.w/4,i=e.cx+e.w/4,a=e.y;return{d:`M ${n} ${a} C ${n} ${a-t}, ${i} ${a-t}, ${i} ${a}`,labelAt:{x:e.cx,y:a-t*.75},span:t*2}}let a=au(e,t),o=au(t,e),s=Math.hypot(o.x-a.x,o.y-a.y),c=(n??[]).slice(1,-1),l=i===void 0?c:c.map((e,t)=>{let n=c.length===1?.5:t/(c.length-1);return{x:e.x+i.from.dx*(1-n)+i.to.dx*n,y:e.y+i.from.dy*(1-n)+i.to.dy*n}});if(l.length>0&&r===0){let e=l[Math.floor((l.length-1)/2)];return{d:ou([a,...l,o],12),labelAt:e,span:s}}let u=r===0?0:Math.ceil(r/2)*22*(r%2==1?1:-1),d=(a.x+o.x)/2,f=(a.y+o.y)/2;if(u===0)return{d:`M ${a.x} ${a.y} L ${o.x} ${o.y}`,labelAt:{x:d,y:f},span:s};let p=s===0?0:-(o.y-a.y)/s,m=s===0?0:(o.x-a.x)/s,h=d+p*u*2,g=f+m*u*2;return{d:`M ${a.x} ${a.y} Q ${h} ${g} ${o.x} ${o.y}`,labelAt:{x:d+p*u,y:f+m*u},span:s}}function cu(e){let t=(e.match(/-?\d+(?:\.\d+)?/g)??[]).map(Number);if(t.length<2)return;let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let e=0;e+1<t.length;e+=2)n=Math.min(n,t[e]),i=Math.max(i,t[e]),r=Math.min(r,t[e+1]),a=Math.max(a,t[e+1]);return{minX:n,minY:r,maxX:i,maxY:a}}function lu(e,t,n,r){let i=t=>{let n=e.participants.find(e=>e.id===t);return n===void 0?t:Wl(n)},a=t.label===void 0||t.label===``?``:`: ${t.label}`;return[`${n+1}.`,`${i(t.from)} → ${i(t.to)}${a}`,t.from===t.to?`(to itself)`:``,r===`unchanged`?``:`[${Tl[r]}]`,wl(t).map(bt).join(`, `)].filter(e=>e!==``).join(` `)}function uu(e,t,n){let r=t=>{let n=e.nodes.find(e=>e.id===t);return n===void 0?t:Wl(n)},i=t.label??t.kind;return[`${r(t.from)} → ${r(t.to)}`,i===void 0?``:`(${i})`,n===`unchanged`?``:`[${Tl[n]}]`,wl(t).map(bt).join(`, `)].filter(e=>e!==``).join(` `)}function du(e){if(e===void 0||e===``)return;let t=Dn(e,Pa);return t.valid?{valid:!0,envelope:t.envelope,issues:[]}:t}function fu(e){let t=du(e);return t?.valid===!0?t.envelope:void 0}function pu(e){return kn(e,Pa)}var mu=`#ffffff`,hu=`#27272a`,gu=`#71717a`,_u={added:{fill:`#ecfdf5`,stroke:`#059669`,text:`#065f46`},changed:{fill:`#fffbeb`,stroke:`#d97706`,text:`#92400e`},context:{fill:`#fafafa`,stroke:`#d4d4d8`,text:`#71717a`},unchanged:{fill:`#ffffff`,stroke:`#a1a1aa`,text:hu}},vu={added:`#059669`,changed:`#d97706`,context:`#d4d4d8`,unchanged:`#a1a1aa`},yu=[`added`,`changed`,`context`,`unchanged`],bu=[{fill:`#eff6ff`,stroke:`#2563eb`},{fill:`#f5f3ff`,stroke:`#7c3aed`},{fill:`#ecfeff`,stroke:`#0891b2`},{fill:`#fff1f2`,stroke:`#e11d48`},{fill:`#f7fee7`,stroke:`#65a30d`},{fill:`#fff7ed`,stroke:`#ea580c`},{fill:`#f0fdfa`,stroke:`#0d9488`},{fill:`#fdf4ff`,stroke:`#c026d3`},{fill:`#fefce8`,stroke:`#ca8a04`},{fill:`#f8fafc`,stroke:`#475569`},{fill:`#eef2ff`,stroke:`#4f46e5`},{fill:`#fef2f2`,stroke:`#b91c1c`},{fill:`#f0fdf4`,stroke:`#16a34a`},{fill:`#fdf2f8`,stroke:`#db2777`},{fill:`#f5f5f4`,stroke:`#78716c`},{fill:`#f0f9ff`,stroke:`#0369a1`}],xu=[void 0,`7 3`,`2 3`,`9 3 2 3`],Su=bu.length*xu.length;function Cu(e,t=.88){let n=n=>{let r=Number.parseInt(e.slice(1+n*2,3+n*2),16);return Math.round(r+(255-r)*t).toString(16).padStart(2,`0`)};return`#${n(0)}${n(1)}${n(2)}`}function wu(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t}bu.length;function Tu(e,t,n={}){let r=n.dashes===!1,i=Su,a=new Map,o=new Set,s=e=>t!==void 0&&Object.hasOwn(t,e)?t[e].color:void 0,c=new Set;for(let t of e){let e=s(t);e!==void 0&&(a.set(t,{fill:Cu(e),stroke:e,declared:!0}),c.add(e.toLowerCase()))}for(let e=0;e<i;e++)c.has(bu[e%bu.length].stroke.toLowerCase())&&o.add(e);for(let t of e){if(a.has(t))continue;let e;if(r){e=-1;let n=wu(t)%bu.length;for(let t=0;t<bu.length&&e===-1;t++){let r=(n+t)%bu.length;o.has(r)||(e=r)}for(let t=bu.length;t<Su&&e===-1;t++){let r=bu.length+(n+t)%(Su-bu.length);o.has(r)||(e=r)}e===-1&&(e=n)}else{e=wu(t)%i;for(let t=0;t<i&&o.has(e);t++)e=(e+1)%i}o.add(e);let n=bu[e%bu.length],s=Math.floor(e/bu.length)%xu.length;if(r)a.set(t,{...n,...s===0?{}:{hatch:s}});else{let e=xu[s];a.set(t,{...n,...e===void 0?{}:{dash:e}})}}return a}function Eu(e,t){let n=new Map;for(let r of e){let e=t.get(r);if(e?.declared!==!0)continue;let i=e.stroke.toLowerCase();n.set(i,[...n.get(i)??[],r])}let r=new Map;for(let e of n.values())if(!(e.length<2))for(let t of e)r.set(t,e.filter(e=>e!==t));return r}function Du(e){let t=[];for(let n of e)n.kind!==void 0&&n.kind!==``&&!t.includes(n.kind)&&t.push(n.kind);return t}var Ou=`system-ui, sans-serif`;function ku(e){let t=_u[e.role],n={fill:e.tint?.fill??t.fill,stroke:e.role===`unchanged`?e.tint?.stroke??t.stroke:t.stroke,text:t.text===`#71717a`?gu:hu},r=e.role===`added`||e.role===`changed`?2:1.2,i=e.role===`context`?.62:1,a=e.anchor??`start`,o=_t(e.label,e.width),s=yt(e.changes,e.width),c=o.length+s.length,l=e.y+e.height/2-(c-1)*15/2+4,u=a===`middle`?e.x+e.width/2:e.x+8,d=[{shape:`rect`,x:e.x,y:e.y,width:e.width,height:e.height,rx:5,fill:n.fill,stroke:n.stroke,strokeWidth:r,...e.tint?.dash===void 0?{}:{strokeDasharray:e.tint.dash},opacity:i}];return o.forEach((e,t)=>{d.push({shape:`text`,x:u,y:l+t*15,text:e,fontSize:11,fill:n.text,fontFamily:Ou,textAnchor:a,opacity:i})}),s.forEach((e,t)=>{d.push({shape:`text`,x:u,y:l+(o.length+t)*15,text:e,fontSize:9,fontWeight:600,fill:n.text,fontFamily:Ou,textAnchor:a,opacity:i,testId:`field-changes`})}),d}function Au(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function ju(e){return Au(e).replace(/"/g,`"`)}function Mu(e){return e.filter(([,e])=>e!==void 0).map(([e,t])=>` ${e}="${ju(String(t))}"`).join(``)}function Nu(e){let t=Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]);switch(e.shape){case`rect`:return`<rect${Mu([[`x`,e.x],[`y`,e.y],[`width`,e.width],[`height`,e.height],[`rx`,e.rx],[`fill`,e.fill],[`fill-opacity`,e.fillOpacity],[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth],[`stroke-dasharray`,e.strokeDasharray],[`opacity`,e.opacity],...t])} />`;case`text`:{let n=`${Au(e.text)}${e.note===void 0?``:` <tspan font-style="italic">${Au(e.note)}</tspan>`}`,r=[[`x`,e.x],[`y`,e.y],[`font-size`,e.fontSize],[`font-family`,e.fontFamily],[`font-weight`,e.fontWeight],[`font-style`,e.fontStyle],[`text-anchor`,e.textAnchor]],i=`<text${Mu([...r,[`fill`,e.fill],...e.paintOrder===`stroke`?[]:[[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth]],[`text-decoration`,e.textDecoration],[`opacity`,e.opacity],[`data-testid`,e.testId],...t])}>${n}</text>`;return e.paintOrder===`stroke`?`<text${Mu([...r,[`fill`,e.stroke],[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth],[`opacity`,e.opacity],[`aria-hidden`,`true`]])}>${n}</text>${i}`:i}case`line`:return`<line${Mu([[`x1`,e.x1],[`y1`,e.y1],[`x2`,e.x2],[`y2`,e.y2],[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth],[`stroke-dasharray`,e.strokeDasharray],[`opacity`,e.opacity],[`marker-end`,e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`],...t])} />`;case`path`:return`<path${Mu([[`d`,e.d],[`stroke`,e.stroke],[`fill`,e.fill??`none`],[`stroke-width`,e.strokeWidth],[`stroke-dasharray`,e.strokeDasharray],[`stroke-linecap`,e.strokeLinecap],[`opacity`,e.opacity],[`marker-end`,e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`],...t])} />`}}function Pu(e){return`<marker id="${ju(e.id)}" markerWidth="7" markerHeight="7" refX="9" refY="5" viewBox="0 0 10 10" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="${ju(e.paint)}" /></marker>`}function Fu(e){let t=e=>{let n=Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]),r=e.title===void 0?``:`<title>${Au(e.title)}</title>`,i=[[`opacity`,e.opacity],[`data-testid`,e.testId]];return`<g${Mu([...n,...i])}>${r}`+e.primitives.map(Nu).join(``)+(e.groups??[]).map(t).join(``)+`</g>`},n=e.groups.map(t).join(``),r=e.markers.length===0?``:`<defs>${e.markers.map(Pu).join(``)}</defs>`;return`<svg xmlns="http://www.w3.org/2000/svg" role="img"`+Mu([[`aria-label`,e.ariaLabel],[`viewBox`,e.viewBox],[`width`,e.width],[`height`,e.height]])+`><rect${Mu([[`x`,e.viewBox.split(` `)[0]],[`y`,e.viewBox.split(` `)[1]],[`width`,e.width],[`height`,e.height],[`fill`,e.background]])} />`+r+n+`</svg>`}var Iu=17,Lu=18,Ru=92,zu=860;function Bu(e){return Math.min(e,zu)}function Vu(e){return 21+(e.length+9)*5.6+Lu}function Hu(e,t){let n=Bu(t),r=1,i=0;for(let t of e.entries){let e=Vu(t.label);i>0&&Ru+i+e>n-20&&(r+=1,i=0),i+=e}return r}function Uu(e){let t=e.flatMap(e=>e.entries).reduce((e,t)=>Math.max(e,Vu(t.label)),0);return t===0?0:Math.min(Ru+t+32,zu)}function Wu(e,t){let n=e.filter(e=>e.entries.length>0);return n.length===0?0:n.reduce((e,n)=>e+Hu(n,t),0)*Iu+12}function Gu(e,t,n,r){let i=e.filter(e=>e.entries.length>0);if(i.length===0)return[];let a=Bu(r),o=[],s=0;for(let e of i){let r=s,i=0,c=[];for(let r of e.entries){let o=Vu(r.label);i>0&&Ru+i+o>a-20&&(s+=1,i=0);let l=t+Ru+i,u=n+s*Iu;i+=o;let d=e.sample===`line`?{shape:`line`,x1:l,y1:u+5,x2:l+16,y2:u+5,stroke:r.stroke,strokeWidth:1.6,...r.dashed===void 0?{}:{strokeDasharray:r.dashed}}:{shape:`rect`,x:l,y:u,width:16,height:10,rx:2,fill:r.fill,stroke:r.stroke,strokeWidth:1.2,...r.dashed===void 0?{}:{strokeDasharray:r.dashed}};c.push({id:`legend-${r.key??r.label}`,...r.projectColour===!0?{title:`${r.label} — project colour`}:{},data:{"legend-entry":r.key??r.label,...r.projectColour===!0?{"colour-source":`project`}:{},...r.toggles===!0&&r.key!==void 0?{toggles:`true`}:{},...r.faded===!0?{faded:`true`}:{},...r.hidden===!0?{hidden:`true`}:{}},opacity:r.hidden===!0?.45:r.faded===!0?.62:1,primitives:[d,{shape:`text`,x:l+21,y:u+9,text:r.hidden===!0?`${r.label} (hidden)`:r.label,fontSize:9,fill:gu,fontFamily:Ou}]})}o.push({id:`legend-title-${e.title}`,primitives:[{shape:`text`,x:t,y:n+r*Iu+9,text:e.title,fontSize:9,fontWeight:600,fill:gu,fontFamily:Ou,testId:`legend-group`}]}),o.push(...c),s+=1}return[{id:`diagram-legend`,testId:`diagram-legend`,primitives:[],groups:o}]}var Ku=12,qu=5.2;function Ju(e,t){let n=Math.max(Math.floor((t-24)/qu),20),r=[],i=``;for(let t of e.split(/\s+/).filter(e=>e!==``))for(i===``?i=t:i.length+1+t.length<=n?i=`${i} ${t}`:(r.push(i),i=t);i.length>n;)r.push(i.slice(0,n)),i=i.slice(n);return i!==``&&r.push(i),r}function Yu(e){let t=e.length;for(;t>0&&(e[t-1]===`.`||/\s/.test(e[t-1]));)--t;return e.slice(0,t)}function Xu(e,t,n,r,i){let a=`${t.nodes.length} of ${e.nodes.length} elements and ${t.edges.length} of ${e.edges.length} relationships shown.`+(r?` Hidden types are still part of the proposal.`:``);if(i===void 0)return n.size===0?void 0:`Filtered view: ${a}`;let o=!eu(n,$l(e,i));return`Viewpoint: ${i.label} — ${Yu(i.concern)}`+(o?` (adjusted).`:`.`)+(n.size===0?``:` ${a}`)}function Zu(e,t){return`${e}-${t.replace(`#`,``)}`}function Qu(e){let t=gt([Wl(e)],wl(e),120,260);return{width:t,height:vt(_t(Wl(e),t).length,yt(wl(e),t).length)}}function $u(e,t){let n=e.nodes.filter(e=>!Zl(t,`element`,e.kind)),r=new Set(n.map(e=>e.id));return{nodes:n,edges:e.edges.filter(e=>!Zl(t,`relationship`,e.kind)&&r.has(e.from)&&r.has(e.to)),containers:e.containers}}function ed(e,t,n){return{label:n===void 0?e:`${e} (same colour as ${n.join(`, `)})`,fill:t.fill,stroke:t.stroke,...t.dash===void 0?{}:{dashed:t.dash},...t.declared===!0?{projectColour:!0}:{}}}function td(e,t){if(t!==void 0)return{layout:zl(e,Qu,t),orientation:t};let n=zl(e,Qu,`landscape`);if(n.width<=710)return{layout:n,orientation:`landscape`};let r=zl(e,Qu,`portrait`);return we(n.width,r.width)===`portrait`?{layout:r,orientation:`portrait`}:{layout:n,orientation:`landscape`}}function nd(e,t=Xl){return td($u(e,t),void 0).orientation}function rd(e,t){let n=t.hidden??Xl,r=t.nudges??new Map,i=t.isProposal,a=$u(e,n),{layout:o,orientation:s}=td(a,t.orientation),c=new Map(o.nodes.map(e=>[e.id,e])),l=e=>{let t=c.get(e);if(t===void 0)return;let n=r.get(e),i=t.x+(n?.dx??0),a=t.y+(n?.dy??0);return{x:i,y:a,cx:i+t.width/2,cy:a+t.height/2,w:t.width,h:t.height}},u=o.containers.map(e=>{let t=Al(a.nodes.filter(t=>t.container===e.id).flatMap(e=>{let t=l(e.id);return t===void 0?[]:[{x:t.x,y:t.y,width:t.w,height:t.h}]}));return t===void 0?e:{...e,...t}}),d=Tu(Du(e.nodes),t.appearance?.kinds),f=Tu(Du(e.edges),t.appearance?.relationshipKinds),p=Eu(Du(e.nodes),d),m=Eu(Du(e.edges),f),h=e=>t=>({...ed(t,(e===`element`?d:f).get(t),(e===`element`?p:m).get(t)),toggles:!0,key:Yl(e,t),hidden:n.has(Yl(e,t))}),g=[{title:`elements`,sample:`box`,entries:Du(e.nodes).map(h(`element`))},{title:`relationships`,sample:`line`,entries:Du(e.edges).map(h(`relationship`))}];if(i){let e=new Set([...a.nodes.map(e=>xl(e,!0)),...a.edges.map(e=>Cl(e,!0))]);g.push({title:`changes`,sample:`box`,entries:yu.filter(t=>t!==`unchanged`&&e.has(t)).map(e=>({label:Tl[e],fill:mu,stroke:_u[e].stroke,faded:e===`context`}))})}let _=new Map,v=new Map;for(let e of a.edges){let t=JSON.stringify([e.from,e.to]),n=v.get(t)??0;_.set(e,n),v.set(t,n+1)}let y=new Map(o.edges.map(e=>[e.index,e.points])),b=new Map;a.edges.forEach((e,t)=>{let n=y.get(t);n!==void 0&&b.set(e,n)});let x={dx:0,dy:0},S=a.edges.map(e=>{let t=l(e.from),n=l(e.to);if(t===void 0||n===void 0)return;let i=r.has(e.from)||r.has(e.to);return su(t,e.from===e.to?t:n,b.get(e),_.get(e)??0,i?{from:r.get(e.from)??x,to:r.get(e.to)??x}:void 0)}),C=o.nodes.map(e=>l(e.id)),w=S.flatMap(e=>{let t=e===void 0?void 0:cu(e.d);return t===void 0?[]:[t]}),T=Math.min(0,...C.map(e=>e.x-12),...w.map(e=>e.minX-12)),ee=Math.min(0,...C.map(e=>e.y-12),...w.map(e=>e.minY-14)),te=Math.max(o.width,...C.map(e=>e.x+e.w+12),...w.map(e=>e.maxX+12)),E=Math.max(o.height,...C.map(e=>e.y+e.h+12),...w.map(e=>e.maxY+12)),ne=e=>{let t=Cl(e,i),n=e.kind===void 0?void 0:f.get(e.kind);return{role:t,stroke:n?.stroke??vu.unchanged,dash:n?.dash,halo:t===`added`||t===`changed`?vu[t]:void 0,width:t===`context`?1:t===`unchanged`?1.5:1.8,opacity:t===`context`?.6:1}},re=[...new Set(a.edges.map(e=>ne(e).stroke))],ie=E+4,ae=Math.max(te-T,Uu(g)),D=Xu(e,a,n,i,t.viewpoint),oe=t.viewpoint===void 0||D===void 0?0:Ju(D,ae).length*Ku+4,se=E-ee+Wu(g,ae)+oe,O=[];for(let e of u)O.push({id:`container-${e.id}`,data:{container:e.id},primitives:[{shape:`rect`,x:e.x,y:e.y,width:e.width,height:e.height,rx:8,fill:`none`,stroke:gu,strokeDasharray:`5 3`,opacity:.55},{shape:`text`,x:e.x+8,y:e.y+12,text:e.label,fontSize:10,fill:gu}]});a.edges.forEach((t,n)=>{let r=l(t.from),i=l(t.to),a=S[n];if(r===void 0||i===void 0||a===void 0)return;let o=ne(t),s=o.stroke,c=wl(t),u=t.label??t.kind,d=e=>e.length*5.2+8<=a.span,f=[];o.halo!==void 0&&f.push({shape:`path`,data:{edge:`role`},d:a.d,fill:`none`,stroke:o.halo,strokeWidth:o.width+4,strokeLinecap:`round`,opacity:.3}),f.push({shape:`path`,data:{edge:`line`},d:a.d,fill:`none`,stroke:s,strokeWidth:o.width,...o.dash===void 0?{}:{strokeDasharray:o.dash},opacity:o.opacity,markerEnd:Zu(`se-arrow`,s)}),u!==void 0&&d(u)&&f.push({shape:`text`,x:a.labelAt.x,y:a.labelAt.y-5,text:u,textAnchor:`middle`,fontSize:9,fill:s,fontFamily:Ou,stroke:mu,strokeWidth:3,paintOrder:`stroke`});let p=c.map(bt).join(`, `);c.length>0&&d(p)&&f.push({shape:`text`,x:a.labelAt.x,y:a.labelAt.y+10,text:p,textAnchor:`middle`,fontSize:9,fontWeight:600,fill:s,fontFamily:Ou,stroke:mu,strokeWidth:3,paintOrder:`stroke`,testId:`relationship-change`}),O.push({id:`edge-${n}`,data:{"relationship-role":o.role,"relationship-shape":t.from===t.to?`loop`:`open`},title:uu(e,t,o.role),primitives:f})});for(let e of a.nodes){let t=l(e.id);if(t===void 0)continue;let n=xl(e,i);O.push({id:e.id,data:{"element-role":n,"element-id":e.id,draggable:`node`},title:iu(e,n),primitives:ku({x:t.x,y:t.y,width:t.w,height:t.h,role:n,label:Wl(e),...e.kind===void 0?{}:{tint:d.get(e.kind)},changes:wl(e)})})}let ce=t.viewpoint,k=D;if(k!==void 0&&ce!==void 0){let e=Ju(k,ae);O.push({id:`filter-note`,testId:`diagram-filter-note`,data:{viewpoint:ce.id},primitives:e.map((t,n)=>({shape:`text`,x:T+12,y:ie+Wu(g,ae)+Ku*n+Ku-4,text:n<e.length-1?`${t} `:t,fontSize:9,fontWeight:600,fill:`#92400e`,fontFamily:Ou}))})}else k!==void 0&&O.push({id:`filter-note`,primitives:[{shape:`text`,x:T+12,y:ie+Wu(g,ae)-4,text:k,fontSize:9,fontWeight:600,fill:`#92400e`,fontFamily:Ou,testId:`diagram-filter-note`}]});return O.push(...Gu(g,T+12,ie,ae)),{width:ae,height:se,viewBox:`${T} ${ee} ${ae} ${se}`,ariaLabel:a.nodes.length===e.nodes.length&&a.edges.length===e.edges.length?`Graph of ${e.nodes.length} elements and ${e.edges.length} relationships`:`Graph of ${e.nodes.length} elements and ${e.edges.length} relationships, filtered to ${a.nodes.length} elements and ${a.edges.length} relationships`,background:mu,markers:re.map(e=>({id:Zu(`se-arrow`,e),paint:e})),groups:O,...k===void 0?{}:{narrowing:k},orientation:s}}function id(e,t){let n=t.isProposal,r=ru(e),{columns:i,bands:a,bandHeight:o,lifelineX:s,boxW:c,headerHeight:l,messageGap:u}=r,d=o,f=r.xOf,p=Tu(Du(e.participants),t.appearance?.kinds),m=Eu(Du(e.participants),p),h=[{title:`participants`,sample:`box`,entries:Du(e.participants).map(e=>({...ed(e,p.get(e),m.get(e)),key:Yl(`element`,e)}))}];if(n){let t=new Set([...e.participants.map(e=>xl(e,!0)),...e.messages.map(e=>Cl(e,!0))]);h.push({title:`changes`,sample:`box`,entries:yu.filter(e=>e!==`unchanged`&&t.has(e)).map(e=>({label:Tl[e],fill:mu,stroke:_u[e].stroke,faded:e===`context`}))})}let g=r.height+4,_=Math.max(r.width,Uu(h)),v=r.height+Wu(h,_),y=[];for(let e of a){let t=e.from*s+(s-c)/2,n=e.to*s+(s+c)/2;y.push({id:`band-${e.container.id}-${e.from}`,data:{container:e.container.id},primitives:[{shape:`rect`,x:t,y:2,width:n-t,height:d-6,rx:5,fill:`none`,stroke:gu,strokeDasharray:`5 3`,opacity:.55},{shape:`text`,x:(t+n)/2,y:d-9,text:e.container.label,fontSize:10,textAnchor:`middle`,fill:gu}]})}for(let e of i)y.push({id:`life-${e.id}`,primitives:[{shape:`line`,x1:f(e.id),y1:o+l,x2:f(e.id),y2:r.height-6,stroke:`#d4d4d8`,strokeDasharray:`3 3`,strokeWidth:1}]});for(let e of i){let t=xl(e,n);y.push({id:e.id,data:{"element-role":t,"element-id":e.id},title:iu(e,t),primitives:ku({x:f(e.id)-c/2,y:o+4,width:c,height:l-8,role:t,label:Wl(e),...e.kind===void 0?{}:{tint:p.get(e.kind)},changes:wl(e),anchor:`middle`})})}return e.messages.forEach((t,r)=>{let i=Cl(t,n),a=vu[i],s=o+l+(r+1)*u,c=f(t.from),d=f(t.to),p=t.from===t.to,m=wl(t),h=p?c+26+6:(c+d)/2,g=p?`start`:`middle`,_=[];p?_.push({shape:`path`,d:`M ${c} ${s} h 26 v ${u/2} h -26`,fill:`none`,stroke:a,strokeWidth:1.4,markerEnd:Zu(`se-msg`,a)}):_.push({shape:`line`,x1:c,y1:s,x2:d,y2:s,stroke:a,strokeWidth:1.4,markerEnd:Zu(`se-msg`,a)}),t.label!==void 0&&_.push({shape:`text`,x:h,y:s-5,text:t.label,textAnchor:g,fontSize:10,fill:hu,fontFamily:Ou,stroke:mu,strokeWidth:3,paintOrder:`stroke`}),m.length>0&&_.push({shape:`text`,x:h,y:s+11,text:m.map(bt).join(`, `),textAnchor:g,fontSize:9,fontWeight:600,fill:a,fontFamily:Ou,stroke:mu,strokeWidth:3,paintOrder:`stroke`,testId:`relationship-change`}),_.push({shape:`text`,x:4,y:s+3,text:String(r+1),fontSize:9,fill:gu,fontFamily:Ou}),y.push({id:`message-${r}`,data:{"relationship-role":i,"message-index":String(r),"message-from":t.from,"message-to":t.to},title:lu(e,t,r,i),primitives:_})}),y.push(...Gu(h,12,g,_)),{width:_,height:v,viewBox:`0 0 ${_} ${v}`,ariaLabel:`Sequence of ${e.participants.length} participants and ${e.messages.length} messages`,background:mu,markers:yu.map(e=>({id:Zu(`se-msg`,vu[e]),paint:vu[e]})),groups:y}}var ad=`change`,od=`section`,sd=`level`;function cd(e,t,n){let r=Ol(e),i=(e,t)=>n?.[t]?.role??kl(e,r),a=e.rows.some((e,t)=>i(e,t)!==void 0),o=e.rows.map((e,t)=>({row:e,role:i(e,t)})).filter(({role:e})=>e===void 0||!t.has(Yl(`role`,e)));return{shown:o,anyRole:a,withheld:e.rows.length-o.length}}function ld(e,t,n){let{shown:r,anyRole:i,withheld:a}=cd(e,t,n),o=e.rows.some(e=>Ye(e).heading!==void 0);return{columns:[...o?[od,sd]:[],...e.columns,...i?[ad]:[]],rows:r.map(({row:t,role:n})=>{let{cells:r,heading:a}=Ye(t),s=Array.isArray(t)?void 0:t.depth,c=o?a===void 0?[null,null]:[a,s??1]:[],l=a===void 0?r:e.columns.map(()=>null);return[...c,...l,...i?[n===void 0?null:El[n]]:[]]}),withheld:a}}function ud(e){if(e===null)return``;let t=String(e);return/[",\n\r]/.test(t)?`"${t.replaceAll(`"`,`""`)}"`:t}function dd(e){return[e.columns,...e.rows].map(e=>e.map(ud).join(`,`)).join(`\r
|
|
25
|
+
`)}function fd(e){return e===null?``:String(e).replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`).replace(/\r\n|\r|\n/g,`<br>`)}function pd(e){return e.replaceAll(`\\`,`\\\\`).replace(/\r\n|\r|\n/g,` `)}function md(e,t=new Set,n){let{shown:r,anyRole:i}=cd(e,t,n),a=[...e.columns,...i?[ad]:[]],o=`| ${a.map(e=>fd(e)).join(` | `)} |`,s=`| ${a.map(()=>`---`).join(` | `)} |`,c=[],l=[],u=!1,d=()=>{l.length!==0&&(c.push([o,s,...l].join(`
|
|
26
|
+
`)),l=[],u=!0)};for(let{row:e,role:t}of r){let{cells:n,heading:r}=Ye(e);if(r!==void 0){d();let t=Array.isArray(e)?1:e.depth??1;c.push(`${`#`.repeat(Math.min(t+1,6))} ${pd(r)}`);continue}let a=[...n,...i?[t===void 0?null:El[t]]:[]];l.push(`| ${a.map(fd).join(` | `)} |`)}return d(),!u&&c.length===0&&c.push([o,s].join(`
|
|
27
|
+
`)),`${c.join(`
|
|
28
|
+
|
|
29
|
+
`)}\n`}function hd(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}function gd(e,t){hd(new Blob([``,dd(e)],{type:`text/csv;charset=utf-8`}),t)}async function _d(e,t){let{default:n}=await fe(async()=>{let{default:e}=await import(`./browser-CB9WaMml.js`);return{default:e}},[]);hd(await n([e.columns.map(e=>({value:e,fontWeight:`bold`})),...e.rows.map(e=>e.map(e=>e===null?{value:void 0}:typeof e==`number`?{value:e,type:Number}:typeof e==`boolean`?{value:e,type:Boolean}:{value:e,type:String}))]).toBlob(),t)}function vd(e,t,n,r){hd(new Blob([md(e,t,n)],{type:`text/markdown;charset=utf-8`}),r)}var yd=e=>JSON.parse(JSON.stringify(e));function bd(e){let t=yd(e);return delete t.comparedTo,t.rows=t.rows.filter(e=>e.type!==`task`||e.role!==`removed`).map(e=>e.type===`task`?(delete e.role,e.items=e.items.filter(e=>e.role!==`removed`).map(e=>(delete e.role,delete e.previous,e)),e):e),t}var xd=`#e4e4e7`,Sd=`#ea580c`,Cd=`#dc2626`,wd=`#2563eb`,Td={fill:`#e4e4e7`,stroke:`#52525b`},Ed=.35,Dd=.25,Od=8,kd=24,Ad=18,jd=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Md(e,t,n){let r=[];for(let i=0;i<10;i++){let a=i%2==0?n:n*.45,o=-Math.PI/2+i*Math.PI/5;r.push(`${(e+a*Math.cos(o)).toFixed(2)},${(t+a*Math.sin(o)).toFixed(2)}`)}return`M${r.join(`L`)}Z`}function Nd(e,t,n,r,i=1,a=`#a1a1aa`,o=6,s=.5){let c=[],l=i=>{for(let l=o;l<n+r;l+=o){let o=Math.min(l,n),u=Math.max(0,l-n),d=Math.max(0,l-r),f=Math.min(l,r);c.push({shape:`line`,x1:e+(i?n-o:o),y1:t+u,x2:e+(i?n-d:d),y2:t+f,stroke:a,strokeWidth:.6,opacity:s})}};return(i===1||i===3)&&l(!1),(i===2||i===3)&&l(!0),c}function Pd(e){let[t,n,r]=Ot(e).split(`-`);return`${Number(r)} ${jd[Number(n)-1]} ${t}`}function Fd(e,t){let n=Math.floor(t/pt);return e.length<=n?e:`${e.slice(0,Math.max(1,n-1))}…`}function Id(e,t,n){let r=e.rows[n.row];if(r?.type!==`task`)return``;let i=r.items[n.item],a=i.type===`activity`?`${i.start} to ${i.end}`:i.date,o=i.id===void 0?[]:t.dependencies.filter(e=>e.from===i.id||e.to===i.id),s=o.filter(e=>!e.satisfied).length;return[`${i.type} ${a}`,i.label,i.kind===void 0?void 0:`kind ${i.kind}`,`task "${r.label}" (${r.id})`,o.length===0?void 0:`${o.length} ${o.length===1?`dependency`:`dependencies`}${s>0?`, ${s} not satisfied`:``}`].filter(e=>e!==void 0).join(`, `)}function Ld(e,t){let n=t.comparison===`new`?bd(e):e,r=on(n),i=(()=>{let e=nn(n,t.today,{compact:t.compact,pxPerDay:1,onlyChanged:t.onlyChanged});return e.end-e.start+1})(),a=Ht[t.scale??n.time.scale]??Ht.month,o=!1;if(t.pxPerDay!==void 0)a=t.pxPerDay;else if(t.width!==void 0){let e=(t.width-r-16)/i;a=Math.max(Dd,e),o=e<Dd}let s=t.unit??(t.pxPerDay!==void 0||t.width!==void 0?t.scale:t.scale??n.time.scale),c=nn(n,t.today,{compact:t.compact,pxPerDay:a,onlyChanged:t.onlyChanged,...s===void 0?{}:{unit:s}}),l=Tu(c.kinds,t.appearance?.kinds,{dashes:!1}),u=e=>e===void 0?Td:l.get(e)??Td,d=t.referenceLine??`today`,f=t.showDependencies??!0,p=[gu,Cd,wd].map(e=>({id:Zu(`tl`,e),paint:e})),m=[{id:`header-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:58,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:38,y2:58,stroke:xd})),{shape:`line`,x1:0,x2:c.width,y1:57.5,y2:57.5,stroke:gu}]},...c.upper.map(e=>({id:`upper-${e.x}`,testId:`timeline-upper`,primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:18,y2:58,stroke:gu},{shape:`text`,x:e.x+4,y:32,text:e.label,fontSize:11,fontWeight:600,fill:hu,fontFamily:Ou,testId:`timeline-upper`}]})),{id:`year-repeats`,primitives:(c.unit===`month`?c.months:[]).filter((e,t)=>t>0&&e.month%3==0&&e.month!==0).map(e=>({shape:`text`,x:e.x+4,y:32,text:String(e.year),fontSize:11,fill:gu,fontFamily:Ou,testId:`timeline-year-repeat`}))},{id:`units`,primitives:c.lower.map(e=>({shape:`text`,x:e.x+e.width/2,y:52,text:Kt(e,c.unit),fontSize:10,textAnchor:`middle`,fill:gu,fontFamily:Ou,testId:`timeline-unit`}))}];c.periods.length>0&&m.push({id:`calendar-bands`,primitives:c.periods.map(e=>({shape:`rect`,x:e.x,y:18,width:e.width,height:40,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}))}),c.headerLabels.length>0&&m.push({id:`calendar-names`,primitives:c.headerLabels.map(e=>{let t=e.of===`period`?c.periods.find(t=>t.index===e.index)?.kind:c.references.find(t=>t.index===e.index)?.kind;return{shape:`text`,...e.of===`reference`?{x:e.x+e.width/2,textAnchor:`middle`}:{x:e.x},y:12,text:e.text,fontSize:10,fill:t===void 0?gu:u(t).stroke,fontFamily:Ou,testId:`timeline-${e.of}-name`}})});let h=d===`dated`?Pd(t.today):`Today`;if(d!==`none`&&`x`in c.today){let e=c.today.x,t=Math.max(44,h.length*6+10);m.push({id:`today-tag`,testId:`timeline-today-tag`,primitives:[{shape:`rect`,x:e-t/2,y:1,width:t,height:15,rx:3,fill:Sd},{shape:`text`,x:e,y:12,text:h,fontSize:10,fontWeight:600,textAnchor:`middle`,fill:`#ffffff`,fontFamily:Ou},{shape:`line`,x1:e,x2:e,y1:16,y2:58,stroke:Sd,strokeWidth:2}]})}if(d!==`none`&&`outside`in c.today){let e=c.today.outside===`before`,t=d===`dated`?Pd(c.today.day):`Today (${Ot(c.today.day)})`;m.push({id:`today-outside`,primitives:[{shape:`text`,x:e?4:c.width-4,y:12,text:e?`◂ ${t} is before this range`:`${t} is after this range ▸`,fontSize:10,fontWeight:600,textAnchor:e?`start`:`end`,fill:Sd,fontFamily:Ou,testId:`timeline-today-outside`,data:{side:c.today.outside}}]})}let g=(()=>{if(t.selection===void 0)return;let e=n.rows[t.selection.row];if(e?.type===`task`)return t.selection.item===void 0?e.id:e.items[t.selection.item]?.id})(),_=e=>g!==void 0&&(e.from===g||e.to===g),v=[{id:`rows-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:c.height,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:0,y2:c.height,stroke:xd}))]},...c.rows.map(e=>e.type===`separator`?{id:`separator-${e.row}`,testId:`timeline-separator`,primitives:[{shape:`rect`,x:0,y:e.y,width:c.width,height:e.height,fill:`#f4f4f5`},{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:e.type===`section`?{id:`section-${e.row}`,testId:`timeline-section`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:{id:`row-${e.row}`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#f4f4f5`}]})];for(let e of c.periods){let t=n.periods[e.index],r=`${t.label??`Period`}: ${Pd(Dt(t.start))} – ${Pd(Dt(t.end))}`,i=[{shape:`rect`,x:e.x,y:0,width:e.width,height:c.height,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}];e.kind===void 0&&i.push(...Nd(e.x,0,e.width,c.height)),v.push({id:`period-${e.index}`,testId:`timeline-period`,title:r,data:{...e.kind?{kind:e.kind}:{}},primitives:i})}for(let e of c.references){let t=e.kind===void 0?`#3f3f46`:u(e.kind).stroke;v.push({id:`reference-${e.index}`,testId:`timeline-reference`,title:`${e.label}: ${Pd(Dt(e.date))}`,data:{...e.kind?{kind:e.kind}:{}},primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:0,y2:c.height,stroke:t,strokeWidth:1.5,strokeDasharray:`6 3`}]})}if(f)for(let e of c.dependencies){let t=_(e),r=t?wd:e.satisfied?gu:Cd,i=n.dependencies[e.index];v.push({id:`dependency-${e.index}`,testId:`timeline-dependency`,title:cn(n,i,e.satisfied),data:{from:e.from,to:e.to,type:e.type,satisfied:String(e.satisfied),emphasised:String(t)},primitives:[{shape:`path`,d:`M${e.points.map(e=>`${e.x},${e.y}`).join(` L`)}`,stroke:r,strokeWidth:t?2.25:1.25,...e.satisfied?{}:{strokeDasharray:`4 3`},markerEnd:Zu(`tl`,r)}]})}for(let e of c.items){let r=u(e.kind),i=t.selection?.row===e.row&&t.selection.item===e.item,a=[],o=e.change===`removed`;if(e.ghost!==void 0&&(e.type===`activity`?a.push({shape:`rect`,x:e.ghost.x,y:e.ghost.y,width:e.ghost.width,height:e.ghost.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`,data:{previous:`true`}}):e.ghostCenter!==void 0&&(e.ghostCenter.y===e.center.y&&a.push({shape:`line`,x1:e.ghostCenter.x,x2:e.center.x,y1:e.center.y,y2:e.center.y,stroke:gu,strokeWidth:1,strokeDasharray:`2 2`}),a.push({shape:`path`,d:Md(e.ghostCenter.x,e.ghostCenter.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`,data:{previous:`true`}}))),o)a.push(e.type===`activity`?{shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`}:{shape:`path`,d:Md(e.center.x,e.center.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`});else if(e.type===`activity`){let t=e.kind!==void 0;a.push({shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:t?r.stroke:r.fill,...t?{fillOpacity:Ed}:{},stroke:i?wd:r.stroke,strokeWidth:i?2.5:1.25}),r.hatch!==void 0&&a.push(...Nd(e.glyph.x,e.glyph.y,e.glyph.width,e.glyph.height,r.hatch,r.stroke,4,.8))}else a.push({shape:`path`,d:Md(e.center.x,e.center.y,7),fill:r.stroke,stroke:i?wd:`#ffffff`,strokeWidth:i?2:.75});e.label!==void 0&&a.push({shape:`text`,x:e.label.x,y:e.label.y+12,...e.label.note!==void 0&&e.label.text.endsWith(e.label.note)?{text:e.label.text.slice(0,-e.label.note.length).trimEnd(),note:e.label.note}:{text:e.label.text},fontSize:11,fill:hu,fontFamily:Ou,testId:`timeline-annotation`,...e.label.struck?{textDecoration:`line-through`}:{},...e.label.inside?{}:{stroke:`#ffffff`,strokeWidth:3,paintOrder:`stroke`}}),v.push({id:`item-${e.row}-${e.item}`,testId:`timeline-${e.type}`,title:Id(n,c,e),data:{row:String(e.row),item:String(e.item),...e.kind===void 0?{}:{kind:e.kind},...e.change===void 0?{}:{change:e.change},selected:String(i)},primitives:a})}d!==`none`&&`x`in c.today&&v.push({id:`today`,testId:`timeline-today`,primitives:[{shape:`line`,x1:c.today.x,x2:c.today.x,y1:0,y2:c.height,stroke:Sd,strokeWidth:2,opacity:.85}]});let y=c.rows.map(e=>{let t=58+e.y,n=e.type===`section`?`${e.label??``} (${e.tasks.length})`.trim():e.type===`separator`?e.label??``:e.label,i=e.type!==`task`;return{id:`label-${e.row}`,primitives:[...i?[{shape:`line`,x1:0,x2:r,y1:t+.5,y2:t+.5,stroke:`#a1a1aa`,strokeWidth:1}]:[],{shape:`text`,x:8,y:e.type===`separator`?t+e.height-6:t+e.height/2+4,text:Fd(n,r-12),fontSize:11,...i?{fontWeight:600}:{},fill:i?gu:hu,fontFamily:Ou}]}}),b=new Map;for(let e of n.rows)if(e.type===`task`)for(let t of e.items){if(t.kind===void 0)continue;let e=b.get(t.kind)??{activity:!1,milestone:!1};e[t.type]=!0,b.set(t.kind,e)}let x=Eu(c.kinds,l),S=[],C=0,w=0,T=r+c.width;for(let e of c.kinds){let t=u(e),n=b.get(e);if(n===void 0)continue;let r=x.has(e)?`${e} (same colour as ${x.get(e).join(`, `)})`:e,i=(n.activity?22:0)+(n.milestone?16:0)+r.length*pt+18;C>0&&C+i>T&&(C=0,w+=1);let a=w*Ad,o=[],s=C;n.activity&&(o.push({shape:`rect`,x:s,y:a+4,width:16,height:8,rx:2,fill:t.stroke,stroke:t.stroke,fillOpacity:Ed}),t.hatch!==void 0&&o.push(...Nd(s,a+4,16,8,t.hatch,t.stroke,4,.8)),s+=22),n.milestone&&(o.push({shape:`path`,d:Md(s+6,a+8,6),fill:t.stroke}),s+=16),o.push({shape:`text`,x:s,y:a+12,text:r,fontSize:10,fill:gu,fontFamily:Ou}),S.push({id:`legend-${e}`,...t.declared===!0?{title:`${e} — project colour`,data:{kind:e,"colour-source":`project`}}:{data:{kind:e}},primitives:o}),C+=i}let ee=[...c.periods.map(e=>({kind:e.kind,line:!1,text:n.periods[e.index].label??`Period`})),...c.references.map(e=>({kind:e.kind,line:!0,text:e.label}))];if(ee.length>0&&(C>0&&(C=0,w+=1),ee.forEach((e,t)=>{let n=22+e.text.length*pt+18;C>0&&C+n>T&&(C=0,w+=1);let r=w*Ad,i=e.kind===void 0?e.line?`#3f3f46`:`#a1a1aa`:u(e.kind).stroke;S.push({id:`legend-calendar-${t}`,testId:`timeline-calendar-legend`,primitives:[e.line?{shape:`line`,x1:C+8,x2:C+8,y1:r+2,y2:r+14,stroke:i,strokeWidth:1.5,strokeDasharray:`3 2`}:{shape:`rect`,x:C,y:r+3,width:16,height:10,fill:i,fillOpacity:.25},{shape:`text`,x:C+22,y:r+12,text:e.text,fontSize:10,fill:gu,fontFamily:Ou}]}),C+=n})),n.comparedTo!==void 0){C>0&&(C=0,w+=1);let e=w*Ad,t=[{shape:`rect`,x:0,y:e+4,width:16,height:8,rx:2,fill:`none`,stroke:gu,strokeDasharray:`4 3`},{shape:`text`,x:22,y:e+12,text:`previous dates (${n.comparedTo.label})`,fontSize:10,fill:gu,fontFamily:Ou}],r=22+(`previous dates (${n.comparedTo.label})`.length+3)*pt;t.push({shape:`text`,x:r,y:e+12,text:`(new)`,fontStyle:`italic`,fontSize:10,fill:gu,fontFamily:Ou},{shape:`text`,x:r+5*pt,y:e+12,text:`: added since`,fontSize:10,fill:gu,fontFamily:Ou},{shape:`text`,x:r+20*pt,y:e+12,text:`removed`,fontSize:10,fill:gu,fontFamily:Ou,textDecoration:`line-through`},{shape:`text`,x:r+28*pt,y:e+12,text:`: dropped since`,fontSize:10,fill:gu,fontFamily:Ou}),S.push({id:`legend-comparison`,testId:`timeline-comparison-legend`,primitives:t})}let te=S.length===0?0:(w+1)*Ad+6;return{layout:c,pxPerDay:a,overWidth:o,labelWidth:r,tints:l,markers:p,header:m,rows:v,labels:y,legend:{groups:S,height:te}}}function Rd(e,t,n){let r=e=>{switch(e.shape){case`rect`:case`text`:return{...e,x:e.x+t,y:e.y+n};case`line`:return{...e,x1:e.x1+t,x2:e.x2+t,y1:e.y1+n,y2:e.y2+n};case`path`:return{...e,d:zd(e.d,t,n)}}};return{...e,primitives:e.primitives.map(r),...e.groups?{groups:e.groups.map(e=>Rd(e,t,n))}:{}}}function zd(e,t,n){return e.replace(/(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/g,(e,r,i)=>`${+(Number(r)+t).toFixed(2)},${+(Number(i)+n).toFixed(2)}`)}function Bd(e,t){let n=Ld(e,{...t,selection:void 0}),r=t.comparison===`new`?void 0:e.comparedTo,i=Od+(e.title?kd:0)+(r?18:0),a=Od,o=a+n.labelWidth,s=[];if(e.title&&s.push({id:`title`,primitives:[{shape:`text`,x:a,y:23,text:e.title,fontSize:13,fontWeight:600,fill:hu,fontFamily:Ou}]}),r){let t=Od+(e.title?kd:0)+12;s.push({id:`compared-to`,testId:`timeline-compared-to`,primitives:[{shape:`text`,x:a,y:t,text:`Compared with ${r.label}${r.date?` (${Pd(Dt(r.date)??0)})`:``}`,fontSize:11,fill:gu,fontFamily:Ou}]})}s.push(...n.header.map(e=>Rd(e,o,i))),s.push(...n.rows.map(e=>Rd(e,o,i+58))),s.push(...n.labels.map(e=>Rd(e,a,i)));let c=i+58+n.layout.height+10;s.push(...n.legend.groups.map(e=>Rd(e,a,c)));let l=Math.ceil(o+n.layout.width+Od),u=Math.ceil(c+n.legend.height+Od);return{width:l,height:u,viewBox:`0 0 ${l} ${u}`,ariaLabel:`Timeline${e.title?` "${e.title}"`:``} from ${e.time.start} to ${e.time.end}`,background:`#ffffff`,markers:n.markers,groups:s,overWidth:n.overWidth}}function Vd({primitive:e}){let t=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]));switch(e.shape){case`rect`:return(0,A.jsx)(`rect`,{...t,x:e.x,y:e.y,width:e.width,height:e.height,rx:e.rx,fill:e.fill,fillOpacity:e.fillOpacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity});case`text`:{let n={x:e.x,y:e.y,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,textAnchor:e.textAnchor},r=(0,A.jsxs)(A.Fragment,{children:[e.text,e.note!==void 0&&(0,A.jsxs)(A.Fragment,{children:[` `,(0,A.jsx)(`tspan`,{fontStyle:`italic`,children:e.note})]})]}),i=e.paintOrder===`stroke`,a=(0,A.jsx)(`text`,{...t,"data-testid":e.testId,...n,fill:e.fill,stroke:i?void 0:e.stroke,strokeWidth:i?void 0:e.strokeWidth,textDecoration:e.textDecoration,opacity:e.opacity,children:r});return i?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`text`,{...n,fill:e.stroke,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,"aria-hidden":`true`,children:r}),a]}):a}case`line`:return(0,A.jsx)(`line`,{...t,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`});case`path`:return(0,A.jsx)(`path`,{...t,d:e.d,fill:e.fill??`none`,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`,pointerEvents:`none`})}}function Hd({group:e,interaction:t}){let n=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t])),{extra:r,before:i}=t?.(e)??{};return(0,A.jsxs)(`g`,{...n,"data-testid":e.testId,opacity:e.opacity,...r,children:[e.title===void 0?null:(0,A.jsx)(`title`,{children:e.title}),i,e.primitives.map((e,t)=>(0,A.jsx)(Vd,{primitive:e},t)),(e.groups??[]).map(e=>(0,A.jsx)(Hd,{group:e,interaction:t},e.id))]})}function Ud({markers:e}){return(0,A.jsx)(`defs`,{children:e.map(e=>(0,A.jsx)(`marker`,{id:e.id,markerWidth:`7`,markerHeight:`7`,refX:`9`,refY:`5`,viewBox:`0 0 10 10`,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,A.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:e.paint})},e.id))})}var Wd=`#2563eb`,Gd={fill:`#e4e4e7`,stroke:`#52525b`};function Kd(e){let t=e.replace(/[^\p{L}\p{N}._-]+/gu,`-`),n=0,r=t.length;for(;n<r&&t[n]===`-`;)n+=1;for(;r>n&&t[r-1]===`-`;)--r;return t.slice(n,r)}var qd=[`week`,`month`,`quarter`,`fit`];function Jd(e){return{scale:e.time.scale,compact:!1,showDependencies:!0,comparison:`compare`,onlyChanged:!1}}function Yd(e){return e.type===`activity`?`${e.start} to ${e.end}`:e.date}function Xd({data:e,today:t,appearance:n,display:r,onDisplayChange:i,onSelect:a,saveFigure:o}){let s=t??kt(),[c,l]=(0,d.useState)(()=>Jd(e)),u=r??c,f=i??l,p=e=>t=>f(n=>({...n,[e]:typeof t==`function`?t(n[e]):t})),m=e.comparedTo!==void 0,{comparison:h,onlyChanged:g,compact:_,showDependencies:v,scale:y}=u,b=p(`comparison`),x=p(`onlyChanged`),S=(0,d.useMemo)(()=>m&&h===`new`?bd(e):e,[e,m,h]),C=m&&h===`compare`&&g,w=p(`compact`),T=p(`showDependencies`),[ee,te]=(0,d.useState)(void 0),E=p(`scale`),ne=(0,d.useRef)(null),[re,ie]=(0,d.useState)(0);(0,d.useEffect)(()=>{let e=ne.current;if(e===null||(ie(e.clientWidth),typeof ResizeObserver>`u`))return;let t=0,n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>ie(e.clientWidth))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]);let ae=(Dt(S.time.end)??0)-(Dt(S.time.start)??0)+1,D=re>0?re/ae:0,oe=y===`fit`?{pxPerDay:Math.max(Dd,D)}:{pxPerDay:Math.max(Ht[y],D),unit:y},[se,O]=(0,d.useState)(void 0),ce=(0,d.useMemo)(()=>Ld(S,{today:s,compact:_,showDependencies:v,appearance:n??null,referenceLine:`today`,onlyChanged:C,...oe,...ee===void 0?{}:{selection:ee.type===`item`?{row:ee.row,item:ee.item}:{row:ee.row}}}),[S,s,_,v,n,ee,C,y,re]),k=ce.layout,le=ce.tints,ue=(0,d.useMemo)(()=>{let e=!1;for(let t of S.rows)if(t.type===`separator`)e=!0;else if(e)return!0;return!1},[S]),de=(0,d.useMemo)(()=>Eu(k.kinds,le),[k.kinds,le]),j=(0,d.useMemo)(()=>on(S),[S]),fe=(0,d.useMemo)(()=>{let e=new Map;for(let t of S.rows)if(t.type===`task`)for(let n of t.items){if(n.kind===void 0)continue;let t=e.get(n.kind)??{activity:!1,milestone:!1};t[n.type]=!0,e.set(n.kind,t)}return e},[S]),pe=e=>e===void 0?Gd:le.get(e)??Gd,me=(e,t)=>e!==void 0&&e.type===t.type&&e.row===t.row&&(e.type===`task`||t.type===`item`&&e.item===t.item),he=e=>{let t=me(ee,e);if(te(t=>me(t,e)?void 0:e),!a)return;let n=S.rows[e.row];if(t||n?.type!==`task`)return a(void 0);a(e.type===`item`?{task:n,item:n.items[e.item]}:{task:n})},ge=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),he(t))},_e=e=>{let t=e.data?.row,n=e.data?.item;if(e.testId!==`timeline-activity`&&e.testId!==`timeline-milestone`||t===void 0||n===void 0)return{};let r={type:`item`,row:Number(t),item:Number(n)},i=`${t}:${n}`,a=k.items.find(e=>e.row===r.row&&e.item===r.item);return{extra:{role:`button`,tabIndex:0,"aria-label":e.title,"aria-pressed":e.data?.selected===`true`,style:{cursor:`pointer`,outline:`none`},onClick:()=>he(r),onKeyDown:e=>ge(e,r),onFocus:()=>O(i),onBlur:()=>O(e=>e===i?void 0:e)},before:a===void 0?void 0:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`rect`,{"data-testid":`timeline-hit`,x:a.glyph.x,y:a.glyph.y,width:a.glyph.width,height:a.glyph.height,fill:`transparent`}),se===i&&(0,A.jsx)(`rect`,{"data-testid":`timeline-focus-ring`,x:a.glyph.x-3,y:a.glyph.y-3,width:a.glyph.width+6,height:a.glyph.height+6,rx:4,fill:`none`,stroke:Wd,strokeWidth:1.5,strokeDasharray:`3 2`})]})}},[ve,ye]=(0,d.useState)(null),be=()=>Fu(Bd(S,{today:s,compact:_,showDependencies:v,onlyChanged:C,appearance:n??null,referenceLine:`dated`,...oe})),xe=`timeline-${Kd(S.title??`plan`)||`plan`}.svg`,Se=async()=>{if(o){let e=await o(xe,be()).catch(()=>!1);ye(e===!1?`could not save`:e)}else{let e=URL.createObjectURL(new Blob([be()],{type:`image/svg+xml`})),t=document.createElement(`a`);t.href=e,t.download=xe,t.click(),URL.revokeObjectURL(e),ye(`SVG downloaded`)}window.setTimeout(()=>ye(null),2500)},Ce=async()=>{ye(await jn(be())?`SVG markup copied`:`could not copy`),window.setTimeout(()=>ye(null),2500)};(0,d.useEffect)(()=>{let e=ne.current;if(e===null)return;let t=tn(k,e.clientWidth);t!==void 0&&(e.scrollLeft=t)},[]);let we=(0,d.useRef)(void 0),Te=e=>{let t=ne.current;t!==null&&(we.current=k.start+(t.scrollLeft+t.clientWidth/2)/ce.pxPerDay),E(e)};return(0,d.useLayoutEffect)(()=>{let e=ne.current,t=we.current;we.current=void 0,e!==null&&t!==void 0&&(e.scrollLeft=Math.max(0,(t-k.start)*ce.pxPerDay-e.clientWidth/2))},[ce.pxPerDay,k.start]),(0,A.jsxs)(`div`,{"data-testid":`timeline`,className:`w-full min-w-0 rounded border border-zinc-200 bg-white text-zinc-800 dark:border-zinc-700`,onKeyDown:e=>{e.key===`Escape`&&te(void 0)},children:[S.title!==void 0&&S.title!==``&&(0,A.jsx)(`p`,{className:`border-b border-zinc-200 px-2 py-1 text-sm font-medium`,"data-testid":`timeline-title`,children:S.title}),m&&h===`compare`&&(0,A.jsxs)(`p`,{className:`border-b border-zinc-200 px-2 py-0.5 text-xs text-zinc-500`,"data-testid":`timeline-compared-to`,children:[`Compared with `,(0,A.jsx)(`span`,{className:`font-medium text-zinc-700`,children:e.comparedTo.label}),e.comparedTo.date===void 0?``:` (${e.comparedTo.date})`]}),(0,A.jsxs)(`div`,{className:`flex`,children:[(0,A.jsxs)(`div`,{className:`shrink-0 border-r border-zinc-200 text-xs`,style:{width:j},"data-testid":`timeline-labels`,children:[(0,A.jsx)(`div`,{style:{height:58}}),k.rows.map(e=>e.type===`section`?(0,A.jsxs)(`div`,{"data-testid":`timeline-section-label`,className:`flex items-center border-t border-zinc-400 px-2 font-semibold text-zinc-600`,style:{height:e.height},title:`${e.label??`Untitled section`}: ${e.tasks.length} ${e.tasks.length===1?`task`:`tasks`}`,children:[(0,A.jsx)(`span`,{className:`truncate`,children:e.label??``}),(0,A.jsxs)(`span`,{className:`ml-1 shrink-0 font-normal text-zinc-400`,children:[`(`,e.tasks.length,`)`]})]},e.row):e.type===`separator`?(0,A.jsx)(`div`,{"data-testid":`timeline-separator-label`,className:`flex items-end border-t border-zinc-400 px-2 font-semibold text-zinc-600`,style:{height:e.height},children:e.label??``},e.row):(0,A.jsx)(`button`,{type:`button`,"data-testid":`timeline-task-label`,"aria-pressed":ee?.type===`task`&&ee.row===e.row,className:`block w-full truncate border-t border-zinc-100 px-2 text-left hover:bg-zinc-50 `+(ee?.type===`task`&&ee.row===e.row?`bg-blue-50 font-medium`:``),style:{height:e.height},title:`${e.label} (${e.id})`,onClick:()=>he({type:`task`,row:e.row}),children:e.label},e.row))]}),(0,A.jsxs)(`div`,{ref:ne,className:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`timeline-scroller`,children:[(0,A.jsx)(`svg`,{width:k.width,height:58,role:`img`,"aria-label":`Calendar from ${S.time.start} to ${S.time.end}`,"data-testid":`timeline-header`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:ce.header.map(e=>(0,A.jsx)(Hd,{group:e},e.id))}),(0,A.jsxs)(`svg`,{width:k.width,height:k.height,role:`group`,"aria-label":`Tasks and items${S.title?` of ${S.title}`:``}`,"data-testid":`timeline-body`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:[(0,A.jsx)(Ud,{markers:ce.markers}),ce.rows.map(e=>(0,A.jsx)(Hd,{group:e,interaction:_e},e.id))]})]})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-zinc-200 px-2 py-1 text-xs`,children:[(0,A.jsx)(`span`,{className:`flex items-center gap-1 text-zinc-500`,role:`group`,"aria-label":`Scale`,"data-testid":`timeline-scale`,children:qd.map((e,t)=>(0,A.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsx)(`button`,{type:`button`,"data-scale":e,"aria-pressed":y===e,className:y===e?`font-semibold text-zinc-800`:`text-zinc-600 underline`,onClick:()=>Te(e),children:e})]},e))}),m&&(0,A.jsx)(`button`,{type:`button`,"data-testid":`timeline-comparison-toggle`,"aria-pressed":h===`new`,className:`text-zinc-600 underline`,onClick:()=>{te(void 0),b(e=>e===`compare`?`new`:`compare`)},children:h===`compare`?`new version only`:`show the comparison`}),m&&h===`compare`&&(0,A.jsx)(`button`,{type:`button`,"data-testid":`timeline-only-changed-toggle`,"aria-pressed":g,className:`text-zinc-600 underline`,onClick:()=>{te(void 0),x(e=>!e)},children:g?`show every task`:`only what moved`}),C&&k.hiddenTasks>0&&(0,A.jsxs)(`span`,{className:`text-amber-700`,"data-testid":`timeline-unchanged-hidden`,children:[k.hiddenTasks,` unchanged `,k.hiddenTasks===1?`task`:`tasks`,` hidden`]}),ue&&(0,A.jsx)(`button`,{type:`button`,"data-testid":`timeline-compact-toggle`,"aria-pressed":_,className:`text-zinc-600 underline`,onClick:()=>{te(e=>e?.type===`task`?void 0:e),w(e=>!e)},children:_?`one row per task`:`one row per section`}),(S.dependencies??[]).length>0&&(0,A.jsx)(`button`,{type:`button`,"data-testid":`timeline-dependencies-toggle`,"aria-pressed":!v,className:`text-zinc-600 underline`,onClick:()=>T(e=>!e),children:v?`hide dependencies`:`show dependencies`}),!v&&(0,A.jsxs)(`span`,{className:`text-amber-700`,"data-testid":`timeline-dependencies-hidden`,children:[k.dependencies.length,` `,k.dependencies.length===1?`dependency`:`dependencies`,` hidden`,k.dependencies.some(e=>!e.satisfied)?`, some not satisfied by the dates`:``]}),(0,A.jsx)(`button`,{type:`button`,"data-testid":`timeline-download-svg`,className:`text-zinc-600 underline`,onClick:()=>void Se(),children:`⤓ download SVG`}),(0,A.jsx)(`button`,{type:`button`,"data-testid":`timeline-copy-svg`,className:`text-zinc-600 underline`,onClick:()=>void Ce(),children:`copy markup`}),ve!==null&&(0,A.jsx)(`span`,{role:`status`,className:`text-emerald-700`,children:ve})]}),m&&h===`compare`&&(0,A.jsxs)(`p`,{className:`flex flex-wrap items-center gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-500`,"data-testid":`timeline-comparison-key`,children:[(0,A.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,A.jsx)(`svg`,{width:18,height:12,"aria-hidden":`true`,children:(0,A.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:`none`,stroke:`#71717a`,strokeDasharray:`4 3`})}),`previous dates`]}),(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`i`,{children:`(new)`}),`: added since`]}),(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`span`,{className:`line-through`,children:`removed`}),`: dropped since`]})]}),(k.periods.length>0||k.references.length>0)&&(0,A.jsxs)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-600`,"data-testid":`timeline-calendar-legend`,children:[k.periods.map(e=>{let t=S.periods[e.index];return(0,A.jsxs)(`li`,{className:`flex items-center gap-1`,"data-period":e.index,title:`${t.label??`Period`}: ${t.start} – ${t.end}`,children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-2.5 w-4 rounded-sm`,style:{background:e.kind===void 0?`#a1a1aa`:pe(e.kind).stroke,opacity:.35}}),t.label??`Period`]},`p${e.index}`)}),k.references.map(e=>(0,A.jsxs)(`li`,{className:`flex items-center gap-1`,"data-reference":e.index,title:`${e.label}: ${S.references[e.index].date}`,children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-3 border-l-2 border-dashed`,style:{borderColor:e.kind===void 0?`#3f3f46`:pe(e.kind).stroke}}),e.label]},`r${e.index}`))]}),k.kinds.some(e=>fe.has(e))&&(0,A.jsx)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs`,"data-testid":`timeline-legend`,children:k.kinds.filter(e=>fe.has(e)).map(e=>{let t=pe(e);return(0,A.jsxs)(`li`,{className:`flex items-center gap-1`,"data-kind":e,...t.declared===!0?{"data-colour-source":`project`,title:`${e} — project colour`}:{},children:[fe.get(e)?.activity&&(0,A.jsxs)(`svg`,{width:18,height:12,"aria-hidden":`true`,"data-testid":`timeline-legend-bar`,children:[(0,A.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:t.stroke,fillOpacity:.35,stroke:t.stroke}),t.hatch!==void 0&&Nd(1,2,16,8,t.hatch,t.stroke,4,.8).map((e,t)=>e.shape===`line`?(0,A.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity},t):null)]}),fe.get(e)?.milestone&&(0,A.jsx)(`svg`,{width:14,height:14,"aria-hidden":`true`,"data-testid":`timeline-legend-star`,children:(0,A.jsx)(`path`,{d:Md(7,7,6),fill:t.stroke})}),(0,A.jsx)(`span`,{className:`font-mono`,children:e}),t.declared===!0&&(0,A.jsx)(`span`,{className:`sr-only`,children:` (project colour)`}),de.has(e)&&(0,A.jsxs)(`span`,{className:`text-zinc-500`,"data-testid":`timeline-legend-shared`,children:[`(same colour as `,de.get(e).join(`, `),`)`]})]},e)})}),ee!==void 0&&(0,A.jsx)(Zd,{data:S,selection:ee,dependencies:k.dependencies})]})}function Zd({data:e,selection:t,dependencies:n}){let r=e.rows[t.row];if(r?.type!==`task`)return null;let i=t.type===`item`?r.items[t.item]:void 0,a=t.type===`task`?r.id:i?.id,o=a===void 0?[]:n.filter(e=>e.to===a),s=a===void 0?[]:n.filter(e=>e.from===a),c=(t,n)=>(0,A.jsxs)(`li`,{"data-satisfied":String(t.satisfied),className:t.satisfied?``:`text-red-700`,children:[sn(e,n),` — `,t.type,t.satisfied?``:` — not satisfied by the dates`]},t.index);return(0,A.jsx)(`div`,{className:`border-t border-zinc-200 px-2 py-1 text-xs`,"data-testid":`timeline-details`,role:`status`,children:(0,A.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:[(0,A.jsx)(`dt`,{className:`text-zinc-500`,children:`Task`}),(0,A.jsxs)(`dd`,{children:[r.label,` `,(0,A.jsxs)(`span`,{className:`font-mono text-zinc-500`,children:[`(`,r.id,`)`]})]}),i!==void 0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{className:`text-zinc-500`,children:`Type`}),(0,A.jsx)(`dd`,{children:i.type}),(0,A.jsx)(`dt`,{className:`text-zinc-500`,children:i.type===`activity`?`Dates`:`Date`}),(0,A.jsx)(`dd`,{className:`font-mono`,children:Yd(i)}),i.label!==void 0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{className:`text-zinc-500`,children:`Label`}),(0,A.jsx)(`dd`,{children:i.label})]}),i.kind!==void 0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{className:`text-zinc-500`,children:`Kind`}),(0,A.jsx)(`dd`,{className:`font-mono`,children:i.kind})]}),i.id!==void 0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{className:`text-zinc-500`,children:`Identifier`}),(0,A.jsx)(`dd`,{className:`font-mono`,children:i.id})]})]}),o.length>0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{className:`text-zinc-500`,children:`Waits on`}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(`ul`,{"data-testid":`timeline-predecessors`,children:o.map(e=>c(e,e.from))})})]}),s.length>0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`dt`,{className:`text-zinc-500`,children:`Needed by`}),(0,A.jsx)(`dd`,{children:(0,A.jsx)(`ul`,{"data-testid":`timeline-successors`,children:s.map(e=>c(e,e.to))})})]})]})})}var Qd=(0,d.createContext)(null);function $d(e){let t=e.startsWith(`workspace:`)?e.slice(10):/^[a-z][a-z0-9+.-]*:/i.test(e)?null:e;if(t===null||t===``||/^(?:[\\/]|[a-z]:[\\/])/i.test(t))return null;let n=t.replaceAll(`\\`,`/`);return n.split(`/`).includes(`..`)?null:n}function ef(e){let t=$d(e);if(t!==null)return{kind:`workspace-file`,path:t};if(/^https?:\/\//i.test(e))return{kind:`external-url`,url:e}}function tf(){let[e,t]=(0,d.useState)(void 0);return{hover:e=>({onPointerEnter:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerMove:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerLeave:()=>t(void 0)}),Tooltip:()=>e===void 0?null:(0,A.jsx)(`div`,{"data-testid":`diagram-tooltip`,role:`tooltip`,style:{position:`fixed`,left:e.x+14,top:e.y+14,zIndex:120},className:`pointer-events-none max-w-sm rounded bg-zinc-900 px-2 py-1 text-xs text-white shadow-lg dark:bg-zinc-100 dark:text-zinc-900`,children:e.text})}}function nf({data:e,isProposal:t,nudges:n,setNudges:r,hidden:i,setHidden:a,orientation:o,viewpoint:s}){let c=(0,d.useRef)(null),[l,u]=(0,d.useState)(void 0),[f,p]=(0,d.useState)(!1),{hover:m,Tooltip:h}=tf(),g=(0,d.useRef)(void 0);(0,d.useEffect)(()=>()=>g.current?.(),[]);let _=(0,d.useContext)(Qd),v=(0,d.useMemo)(()=>rd(e,{isProposal:t,hidden:i,nudges:n,orientation:o,...s===void 0?{}:{viewpoint:s},..._===null?{}:{appearance:_}}),[e,t,i,n,o,s,_]),y=e=>{if(e.button!==0)return;let t=e.target;if(t.closest(`[data-draggable="node"]`)!==null||t.closest(`[data-legend-entry]`)!==null)return;let n=c.current?.parentElement??null;for(;n!==null&&n.scrollWidth<=n.clientWidth&&n.scrollHeight<=n.clientHeight;)n=n.parentElement;if(n===null)return;e.preventDefault();let r=e.clientX,i=e.clientY,a=n.scrollLeft,o=n.scrollTop,s=e.currentTarget;s.setPointerCapture?.(e.pointerId),p(!0);let l=e=>{n.scrollLeft=a-(e.clientX-r),n.scrollTop=o-(e.clientY-i)},u=()=>{g.current=void 0,s.releasePointerCapture?.(e.pointerId),s.removeEventListener(`pointermove`,l),s.removeEventListener(`pointerup`,u),s.removeEventListener(`pointercancel`,u),p(!1)};g.current?.(),g.current=u,s.addEventListener(`pointermove`,l),s.addEventListener(`pointerup`,u),s.addEventListener(`pointercancel`,u)},b=e=>t=>{if(t.button!==0)return;t.preventDefault();let i=c.current,a=i===null?1:(i.getBoundingClientRect().width||v.width)/v.width,o=t.clientX,s=t.clientY,l=n.get(e)??{dx:0,dy:0},d=t.currentTarget;d.setPointerCapture?.(t.pointerId),u(e);let f=t=>{let i=new Map(n);i.set(e,{dx:l.dx+(t.clientX-o)/a,dy:l.dy+(t.clientY-s)/a}),r(i)},p=()=>{g.current=void 0,d.releasePointerCapture?.(t.pointerId),d.removeEventListener(`pointermove`,f),d.removeEventListener(`pointerup`,p),d.removeEventListener(`pointercancel`,p),u(void 0)};g.current?.(),g.current=p,d.addEventListener(`pointermove`,f),d.addEventListener(`pointerup`,p),d.addEventListener(`pointercancel`,p)},x=e=>{let t=new Set(i);t.delete(e)||t.add(e),a(t)},S=e=>{let t=e.data?.[`element-id`];if(e.data?.draggable===`node`&&t!==void 0)return{extra:{onPointerDown:b(t),style:{cursor:l===t?`grabbing`:`grab`},...e.title===void 0?{}:m(e.title)}};if(e.data?.[`relationship-role`]!==void 0){let t=e.primitives.find(e=>e.shape===`path`&&e.data?.edge===`line`);return{extra:e.title===void 0?{}:m(e.title),before:t===void 0||t.shape!==`path`?null:(0,A.jsx)(`path`,{"data-edge":`hit`,"data-hit":`edge`,d:t.d,fill:`none`,stroke:`transparent`,strokeWidth:14,pointerEvents:`stroke`})}}let n=e.data?.[`legend-entry`];if(n!==void 0&&e.data?.toggles===`true`){let t=e.primitives[0],r=t.shape===`rect`?t.x:t.shape===`line`?t.x1:0,i=t.shape===`rect`?t.y:t.shape===`line`?t.y1-5:0,a=e.primitives.find(e=>e.shape===`text`),o=a?.shape===`text`?Vu(a.text.replace(` (hidden)`,``))-8:0;return{extra:{onClick:()=>x(n),style:{cursor:`pointer`}},before:(0,A.jsx)(`rect`,{"data-hit":`legend`,x:r-3,y:i-3,width:o,height:16,fill:`transparent`})}}return{}};return(0,A.jsxs)(A.Fragment,{children:[n.size>0&&(0,A.jsx)(`button`,{type:`button`,className:`mb-1 text-xs underline text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200`,onClick:()=>r(new Map),children:`reset layout`}),(0,A.jsx)(h,{}),(0,A.jsxs)(`svg`,{ref:c,role:`img`,"aria-label":v.ariaLabel,viewBox:v.viewBox,width:v.width,height:v.height,xmlns:`http://www.w3.org/2000/svg`,onPointerDown:y,style:{cursor:f?`grabbing`:`grab`,touchAction:`none`},children:[(0,A.jsx)(`rect`,{x:Number(v.viewBox.split(` `)[0]),y:Number(v.viewBox.split(` `)[1]),width:v.width,height:v.height,fill:v.background}),(0,A.jsx)(Ud,{markers:v.markers}),v.groups.map(e=>(0,A.jsx)(Hd,{group:e,interaction:S},e.id))]})]})}function rf({data:e,isProposal:t}){let{hover:n,Tooltip:r}=tf(),i=(0,d.useContext)(Qd),a=(0,d.useMemo)(()=>id(e,{isProposal:t,...i===null?{}:{appearance:i}}),[e,t,i]);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`svg`,{role:`img`,"aria-label":a.ariaLabel,viewBox:a.viewBox,width:a.width,height:a.height,xmlns:`http://www.w3.org/2000/svg`,children:[(0,A.jsx)(`rect`,{x:0,y:0,width:a.width,height:a.height,fill:a.background}),(0,A.jsx)(Ud,{markers:a.markers}),a.groups.map(e=>(0,A.jsx)(Hd,{group:e,interaction:e=>e.title===void 0?{}:{extra:n(e.title)}},e.id))]}),(0,A.jsx)(r,{})]})}var af={added:`bg-emerald-50 dark:bg-emerald-950/40`,changed:`bg-amber-50 dark:bg-amber-950/40`,context:`bg-zinc-50 text-zinc-500 dark:bg-zinc-900/60 dark:text-zinc-400`,removed:`bg-red-50 text-red-800 dark:bg-red-950/40 dark:text-red-200`},of=48,sf=16,cf={attribute:{label:`is`,className:`text-zinc-600 dark:text-zinc-300`},expects:{label:`expects`,className:`text-amber-700 dark:text-amber-400`},assigns:{label:`asks to set`,className:`text-blue-700 dark:text-blue-400`},removes:{label:`asks to unset`,className:`text-rose-700 line-through dark:text-rose-400`}};function lf({uri:e,text:t,dispatch:n,sha256:r}){let i=ef(e);return i===void 0||n===void 0?(0,A.jsx)(`span`,{"data-followable":`no`,children:t}):i.kind===`workspace-file`?(0,A.jsx)(`button`,{type:`button`,"data-followable":`workspace-file`,className:`text-left underline decoration-dotted underline-offset-2 hover:decoration-solid`,onClick:()=>n({kind:`openFile`,path:i.path,...r===void 0?{}:{sha256:r}}),children:t}):(0,A.jsx)(`a`,{"data-followable":`external-url`,className:`underline decoration-dotted underline-offset-2 hover:decoration-solid`,href:i.url,target:`_blank`,rel:`noreferrer`,children:t})}function uf({item:e,traces:t,dispatch:n}){let r=[...e.attributes.map(([e,t])=>[`attribute`,e,St(t)]),...e.expectations.map(([e,t])=>[`expects`,e,St(t)]),...e.assignments.map(([e,t])=>[`assigns`,e,St(t)]),...e.removedAttributes.map(e=>[`removes`,e,``])],i=t??[];if(r.length===0&&e.locations.length===0&&e.artifacts.length===0&&i.length===0)return null;let a=[r.length>0?`${r.length} attribute${r.length===1?``:`s`}`:``,i.length>0?`${i.length} relation${i.length===1?``:`s`}`:``,e.locations.length>0?`${e.locations.length} location${e.locations.length===1?``:`s`}`:``,e.artifacts.length>0?`${e.artifacts.length} artifact${e.artifacts.length===1?``:`s`}`:``].filter(Boolean);return(0,A.jsxs)(`details`,{className:`mt-1 text-[11px]`,"data-testid":`structured-enrichment`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer text-zinc-500 dark:text-zinc-400`,children:a.join(`, `)}),(0,A.jsxs)(`dl`,{className:`mt-1 grid grid-cols-[auto_auto_1fr] gap-x-2 gap-y-0.5`,children:[r.map(([e,t,n],r)=>(0,A.jsxs)(d.Fragment,{children:[(0,A.jsx)(`dt`,{className:`font-medium ${cf[e].className}`,"data-claim":e,children:cf[e].label}),(0,A.jsx)(`dd`,{className:`font-mono text-zinc-700 dark:text-zinc-200`,children:t}),(0,A.jsx)(`dd`,{className:`break-words text-zinc-600 dark:text-zinc-300`,children:n})]},`${e}-${t}-${r}`)),i.map((e,t)=>(0,A.jsxs)(d.Fragment,{children:[(0,A.jsx)(`dt`,{className:`font-medium text-violet-700 dark:text-violet-400`,"data-claim":`relates`,children:e.kind}),(0,A.jsxs)(`dd`,{className:`col-span-2 break-words text-zinc-600 dark:text-zinc-300`,children:[e.fromLabel,` → `,e.toLabel,e.toRow===void 0&&e.toRef!==void 0?` (outside this document)`:``]})]},`trace-${t}`)),e.locations.map((e,t)=>(0,A.jsxs)(d.Fragment,{children:[(0,A.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`location`,children:`at`}),(0,A.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,A.jsx)(lf,{uri:e.uri,text:Ct(e),dispatch:n})})]},`location-${t}`)),e.artifacts.map((e,t)=>(0,A.jsxs)(d.Fragment,{children:[(0,A.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`artifact`,children:e.rel}),(0,A.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,A.jsx)(lf,{uri:e.uri,text:wt(e),dispatch:n,sha256:e.sha256})})]},`artifact-${t}`))]})]})}function df({data:e,hidden:t,setHidden:n,rows:r,traces:i=[],dispatch:a}){let[o,s]=(0,d.useState)(null),c=(0,d.useRef)(null),l=(0,d.useCallback)(()=>[...c.current?.querySelectorAll(`th`)??[]].map(e=>Math.max(of,Math.round(e.getBoundingClientRect().width))),[]),u=(0,d.useCallback)((e,t)=>s(n=>{let r=n??l(),i=[...r];return i[e]=Math.max(of,Math.round(t(r[e]??of))),i}),[l]);function f(e,t){e.preventDefault();let n=e.clientX,r=o??l();s(r);let i=e=>{let i=r[t]??of;u(t,()=>i+(e.clientX-n))},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)}let p=o?.reduce((e,t)=>e+t,0),m=(e,t,n)=>(0,A.jsx)(`div`,{role:n?`separator`:`presentation`,"aria-orientation":n?`vertical`:void 0,"aria-label":n?`Resize column ${t}`:void 0,"aria-hidden":!n||void 0,tabIndex:n?0:void 0,onPointerDown:t=>f(t,e),onKeyDown:t=>{if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault();let n=t.key===`ArrowRight`?sf:-16;u(e,e=>e+n)},className:`absolute -right-px top-0 h-full w-1.5 cursor-col-resize touch-none hover:bg-zinc-400 focus:bg-zinc-400 focus:outline-none dark:hover:bg-zinc-500 dark:focus:bg-zinc-500`}),h=Ol(e),g=(e,t)=>r?.[t]?.role??kl(e,h),_=[...new Set(e.rows.map(g).filter(e=>e!==void 0))].sort((e,t)=>Dl.indexOf(e)-Dl.indexOf(t)),v=e.rows.map((e,t)=>({row:e,index:t})).filter(({row:e,index:n})=>{let r=g(e,n);return r===void 0||!t.has(Yl(`role`,r))}),y=new Map;for(let e of i)for(let t of[e.fromRow,e.toRow]){if(t===void 0)continue;let n=y.get(t);n===void 0?y.set(t,[e]):n.includes(e)||n.push(e)}let b=e=>{let r=new Set(t),i=Yl(`role`,e);r.has(i)?r.delete(i):r.add(i),n(r)};return(0,A.jsxs)(`div`,{className:`overflow-x-auto`,children:[_.length>0&&(0,A.jsx)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2 text-[11px]`,"data-testid":`table-role-key`,children:_.map(e=>{let n=t.has(Yl(`role`,e));return(0,A.jsxs)(`button`,{type:`button`,onClick:()=>b(e),"aria-pressed":!n,className:`flex items-center gap-1 rounded border border-zinc-300 px-1.5 py-0.5 dark:border-zinc-700 ${n?`opacity-50`:``}`,children:[(0,A.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 rounded-sm ${af[e].split(` `)[0]}`}),(0,A.jsxs)(`span`,{children:[El[e],n?` (hidden)`:``]})]},e)})}),(0,A.jsxs)(`table`,{className:`border-collapse text-xs ${o?``:`w-full`}`,style:p===void 0?void 0:{tableLayout:`fixed`,width:p},children:[(0,A.jsx)(`colgroup`,{children:e.columns.map((e,t)=>(0,A.jsx)(`col`,{style:o?{width:o[t]}:void 0},t))}),(0,A.jsx)(`thead`,{children:(0,A.jsx)(`tr`,{ref:c,children:e.columns.map((e,t)=>(0,A.jsxs)(`th`,{className:`relative border border-zinc-300 px-2 py-1 text-left font-medium dark:border-zinc-700`,children:[(0,A.jsx)(`span`,{className:`block truncate`,children:e}),m(t,e,!0)]},t))})}),(0,A.jsx)(`tbody`,{children:v.map(({row:t,index:n},i)=>{let{cells:o,heading:s}=Ye(t),c=r?.[n],l=c?.role??kl(t,h),u=c?.id===void 0?[]:y.get(c.id)??[];if(s!==void 0){let t=Math.min(Math.max(c?.depth??1,1),6);return(0,A.jsx)(`tr`,{"data-row-heading":t,className:l===void 0?void 0:af[l],children:(0,A.jsx)(`th`,{scope:`colgroup`,colSpan:e.columns.length,style:{paddingLeft:`${.5+(t-1)*.75}rem`},className:`border border-zinc-200 bg-zinc-50 py-1 text-left font-semibold dark:border-zinc-800 dark:bg-zinc-900 ${t===1?`text-xs`:`text-[11px] font-medium`} ${l===`removed`?`line-through`:``}`,children:s})},i)}return(0,A.jsx)(`tr`,{className:l===void 0?void 0:af[l],"data-row-role":l,"data-row-kind":c?.kind,"data-row-ref":c?.ref,children:o.map((t,n)=>(0,A.jsxs)(`td`,{className:`relative border border-zinc-200 px-2 py-1 align-top break-words dark:border-zinc-800 ${l===`removed`?`line-through`:``}`,children:[t===null?(0,A.jsx)(`span`,{className:`opacity-40`,children:`—`}):String(t),n===0&&c!==void 0?(0,A.jsx)(uf,{item:c,traces:u,dispatch:a}):null,m(n,e.columns[n]??``,!1)]},n))},i)})})]})]})}function ff(e,t){if(e===void 0)return JSON.stringify(t,null,2);try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function pf(e,t=` `){let n=[],r=(e,r)=>{for(let i of r)n.push(`${t}${e}: ${i}`)};return r(`attribute`,e.attributes.map(([e,t])=>xt(e,t))),r(`expects`,e.expectations.map(([e,t])=>xt(e,t))),r(`asks to set`,e.assignments.map(([e,t])=>xt(e,t))),r(`asks to unset`,e.removedAttributes),r(`at`,e.locations.map(e=>Ct(e))),r(`artifact`,e.artifacts.map(e=>wt(e))),n}function mf(e){let t=e.profile===void 0?``:` "${e.profile}"`;if(e.state===`unchecked`)return`Could not be checked against this project's profile${t}: the project's profile registry cannot be used right now.`;if(e.state===`strays`)return`Does not conform to this project's profile${t} as it stands now.`;let n=e.openValues,r=e.findings??0,i=[n===0?void 0:`${n} value${n===1?``:`s`} outside its open enumerations`,r===0?void 0:`${r} finding${r===1?``:`s`} to check`].filter(e=>e!==void 0);return`Conforms to this project's profile${t}${i.length===0?``:`, with ${i.join(` and `)}`}.`}function hf(e,t,n=Xl,r){let i=Ul(e,t),a=[];if(i.profile!==void 0&&a.push(`Profile: ${i.profile}`),r!==void 0&&a.push(`Conformance: ${mf(r)}`),i.target!==void 0){let e=i.target.revision===void 0?``:`, prepared against ${i.target.revision}`;a.push(`Proposes changes to ${i.target.ref}${e}`),a.push(`Expectations below are the producer's; the receiving authority checks them before applying.`)}for(let e of i.artifacts)a.push(`Artifact — ${wt(e)}`);if(a.length>0&&a.push(``),e.kind===`timeline`)return a.push(...ln(e.data)),a.join(`
|
|
30
|
+
`);if(i.columns!==void 0&&i.rows!==void 0){let e=e=>e!==void 0&&n.has(Yl(`role`,e)),t=i.rows.filter(t=>e(t.role));t.length>0&&(a.push(`Filtered view — ${t.length} of ${i.rows.length} rows hidden (${[...new Set(t.map(e=>El[e.role]))].join(`, `)}).`),a.push(``)),a.push(i.columns.join(` | `));for(let t of i.rows){if(e(t.role))continue;if(t.heading!==void 0){a.push(``),a.push(`${`#`.repeat(t.depth??1)} ${t.heading}${t.role===void 0?``:` (${El[t.role]})`}`);continue}let n=t.cells.map(e=>e===null?``:String(e)).join(` | `),r=t.kind===void 0?``:` [${t.kind}]`;a.push(`${n}${r}${t.role===void 0?``:` (${El[t.role]})`}`);for(let e of t.changes)a.push(` ${bt(e)}`);a.push(...pf(t))}if(i.traces.length>0){a.push(``);for(let e of i.traces){let t=e.label===void 0?``:`: ${e.label}`;a.push(`${e.fromLabel} —${e.kind}${t}→ ${e.toLabel}`)}}}else{if(a.push([`${i.things.length} ${i.thingNoun}s`,`${i.links.length} ${i.linkNoun}s`,...i.containers.length>0?[`${i.containers.length} containers`]:[]].join(`, `)),a.push(``),i.containers.length>0){for(let e of i.containers){let t=i.things.filter(t=>t.container===e.id);a.push(`${e.label}: ${t.length===0?`no members`:t.map(e=>e.label).join(`, `)}`)}a.push(``)}let e=new Map(i.containers.map(e=>[e.id,e.label]));for(let t of i.things){let n=t.container===void 0?void 0:e.get(t.container);a.push([t.label,t.kind===void 0?``:` [${t.kind}]`,n===void 0?``:` in ${n}`,t.role===`unchanged`?``:` (${Tl[t.role]})`,t.changes.length===0?``:` — ${t.changes.map(bt).join(`, `)}`].join(``)),a.push(...pf(t))}i.links.length>0&&a.push(``),i.links.forEach((e,t)=>{let n=[e.kind,e.label].filter(e=>e!==void 0&&e!==``),r=n.length===0?`→`:`—${n.join(`: `)}→`;a.push([i.linkNoun===`message`?`${t+1}. `:``,`${e.fromLabel} ${r} ${e.toLabel}`,e.isLoop?` (to itself)`:``,e.role===`unchanged`?``:` (${Tl[e.role]})`,e.changes.length===0?``:` — ${e.changes.map(bt).join(`, `)}`].join(``)),a.push(...pf(e))})}if(i.removals.length>0){a.push(``);for(let e of i.removals)a.push(`removed ${e.type}: ${e.ref}`)}return a.join(`
|
|
31
|
+
`)}function gf(e,t){let n=e=>{if(e===void 0)return;let n=t.data,r=[...n.nodes??[],...n.participants??[]].find(t=>t.id===e||t.ref===e);return r===void 0?e:Wl(r)},r=t.data,i=[...r.nodes??[],...r.participants??[],...r.edges??[],...r.messages??[]].find(t=>`ref`in t&&t.ref===e.ref),a=e.from!==void 0||e.to!==void 0?`${n(e.from)??`?`} → ${n(e.to)??`?`}`:i!==void 0&&`from`in i?`${n(i.from)} → ${n(i.to)}`:void 0,o=e.label??(i===void 0?void 0:i.label),s=e.kind??(i===void 0?void 0:i.kind),c=[o,s===void 0?void 0:`[${s}]`,a].filter(e=>e!==void 0&&e!==``);return c.length===0?e.ref:`${c.join(` `)} (${e.ref})`}var _f=`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200`;function vf(e){let t=e.target;if(typeof t!=`object`||!t)return;let n=t.revision;return typeof n==`string`?n:void 0}function yf(e){let t=e.target;if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.ref==`string`)return t.ref}function bf({envelope:e,source:t,rawOutput:n,dispatch:r,conformance:i}){let a=(0,d.useContext)(Qd),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(!1),[h,g]=(0,d.useState)(!1),[_,v]=(0,d.useState)(null),y=(0,d.useRef)(null),b=(0,d.useRef)(null),[x,S]=(0,d.useState)(new Map),[C,w]=(0,d.useState)(Xl),[T,ee]=(0,d.useState)(void 0),[te,E]=(0,d.useState)(void 0),[ne,re]=(0,d.useState)(void 0),ie=(0,d.useMemo)(()=>Gl(e),[e]),ae=e.target!==void 0,D=e.removals??[],oe=(0,d.useMemo)(()=>Ul(e,ae),[e,ae]),se=(0,d.useMemo)(()=>e.kind===`graph`?nd(e.data,C):`landscape`,[e,C]),O=T??se,ce=(0,d.useMemo)(()=>e.kind===`graph`?Ql(e):[],[e]),k=ce.find(e=>e.id===te),le=k!==void 0&&!eu(C,$l(e.data,k)),ue=t=>{let n=ce.find(e=>e.id===t);E(n?.id),w(n===void 0?Xl:$l(e.data,n))},de=()=>{ee(e=>Ce(e??se)),S(new Map)},j=e.kind===`graph`?(0,A.jsx)(nf,{data:e.data,isProposal:ae,nudges:x,setNudges:S,hidden:C,setHidden:w,orientation:O,viewpoint:k}):e.kind===`sequence`?(0,A.jsx)(rf,{data:e.data,isProposal:ae}):e.kind===`timeline`?(0,A.jsx)(Xd,{data:e.data,appearance:a,display:ne??Jd(e.data),onDisplayChange:t=>re(n=>t(n??Jd(e.data)))}):(0,A.jsx)(df,{data:e.data,hidden:C,setHidden:w,rows:oe.rows,traces:oe.traces,dispatch:r}),fe=`${e.kind}-${yf(e)??`diagram`}.svg`.replace(/[^\w.-]+/g,`-`),pe=`${e.kind}-${yf(e)??`data`}`.replace(/[^\w.-]+/g,`-`),me=()=>ld(e.data,C,oe.rows),he=e.kind===`table`?me().withheld:0;function ge(e){let t=e.cloneNode(!0);for(let e of t.querySelectorAll(`[data-hit]`))e.remove();for(let e of[t,...t.querySelectorAll(`[style]`)])e.style.removeProperty(`cursor`),e.style.removeProperty(`touch-action`),e.getAttribute(`style`)===``&&e.removeAttribute(`style`);return t}function _e(){let e=(b.current??y.current)?.querySelector(`svg`);return e?new XMLSerializer().serializeToString(ge(e)):void 0}function ve(){let e=_e();if(e===void 0)return;let t=URL.createObjectURL(new Blob([e],{type:`image/svg+xml`})),n=document.createElement(`a`);n.href=t,n.download=fe,n.click(),URL.revokeObjectURL(t),v(`SVG downloaded`),window.setTimeout(()=>v(null),2500)}async function ye(){let e=_e();e!==void 0&&(v(await jn(e)?`SVG markup copied`:`could not copy`),window.setTimeout(()=>v(null),2500))}return(0,A.jsxs)(`div`,{className:`space-y-3 text-sm`,"data-testid":`structured-document`,children:[ae&&(0,A.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-proposal-note`,children:[`Proposed changes to `,(0,A.jsx)(`span`,{className:`font-mono`,children:yf(e)}),vf(e)===void 0?null:(0,A.jsxs)(A.Fragment,{children:[`, prepared against `,(0,A.jsx)(`span`,{className:`font-mono`,children:vf(e)})]}),`. Anything not mentioned is left as it is; anything shown without a change is here for context.`]}),oe.profile===void 0?null:(0,A.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-profile`,children:[`Vocabulary: `,(0,A.jsx)(`span`,{className:`font-mono`,children:oe.profile}),(0,A.jsx)(`span`,{className:`ml-1 text-zinc-400`,children:`— names what the kinds and attributes mean; not resolved here`})]}),i===void 0?null:(0,A.jsx)(`p`,{className:i.state===`conforms`?`text-xs text-emerald-700 dark:text-emerald-400`:`text-xs text-amber-700 dark:text-amber-400`,"data-testid":`structured-conformance`,"data-state":i.state,children:mf(i)}),oe.artifacts.length>0&&(0,A.jsx)(`ul`,{className:`text-xs text-zinc-500`,"data-testid":`structured-document-artifacts`,children:oe.artifacts.map((e,t)=>(0,A.jsx)(`li`,{className:`break-all font-mono`,children:wt(e)},t))}),oe.traces.length>0&&(0,A.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-relation-key`,children:[`Relations:`,` `,[...new Set(oe.traces.map(e=>e.kind))].map((e,t)=>(0,A.jsxs)(`span`,{className:`font-mono`,children:[t>0?`, `:``,e]},e)),(0,A.jsx)(`span`,{className:`ml-1 text-zinc-400`,children:`— declared by the producer; nothing is inferred about what is missing`})]}),(C.size>0||k!==void 0)&&(0,A.jsxs)(`p`,{"data-testid":`structured-filtered`,className:`flex flex-wrap items-center gap-2 rounded border border-amber-300 bg-amber-50 px-2 py-1 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[k!==void 0&&(0,A.jsxs)(`span`,{"data-testid":`structured-viewpoint`,children:[`Viewpoint: `,(0,A.jsx)(`strong`,{children:k.label}),` — `,k.concern,le?` Adjusted with the key.`:``]}),C.size>0&&(0,A.jsxs)(`span`,{children:[`Filtered view — `,[...C].map(e=>e.replace(/^(element|relationship|role):/,``)).join(`, `),` hidden.`,` `,ae?`The full proposal still applies.`:``]}),(0,A.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>ue(``),children:`show everything`})]}),(0,A.jsx)(`div`,{ref:y,className:`overflow-x-auto`,children:j}),(0,A.jsx)(xe,{label:`${e.kind} view`,open:o,onClose:()=>s(!1),containerRef:b,anchorRef:y,actions:(e.kind===`graph`||e.kind===`sequence`)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,onClick:ve,className:_f,children:`⤓ download SVG`}),(0,A.jsx)(`button`,{type:`button`,onClick:ye,className:_f,children:`copy markup`}),_!==null&&(0,A.jsx)(`span`,{className:`text-xs text-zinc-500`,children:_})]}),children:j}),D.length>0&&(0,A.jsx)(`ul`,{className:`space-y-1`,"data-testid":`structured-removals`,children:D.map((t,n)=>(0,A.jsxs)(`li`,{"data-relationship-role":`removed`,className:`rounded border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-800 dark:border-red-800 dark:bg-red-950/40 dark:text-red-200`,children:[(0,A.jsx)(`span`,{className:`line-through`,children:gf(t,e)}),gf(t,e)===t.ref&&(0,A.jsx)(`span`,{className:`ml-2 not-italic opacity-70`,"data-testid":`removal-undescribed`,children:`— the proposal does not say what this is`}),(0,A.jsx)(`span`,{className:`ml-2 font-mono opacity-60`,children:t.type})]},n))}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs`,children:[ce.length>0&&(0,A.jsxs)(`label`,{className:`flex items-center gap-1 text-zinc-500`,children:[`viewpoint`,(0,A.jsxs)(`select`,{"data-testid":`viewpoint-select`,className:`rounded border border-zinc-300 bg-white px-1 py-0.5 text-xs text-zinc-700 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300`,value:k?.id??``,onChange:e=>ue(e.target.value),children:[(0,A.jsx)(`option`,{value:``,children:`Whole document`}),ce.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}),(0,A.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,"aria-label":`Show ${e.kind} view at full size`,onClick:()=>s(!0),children:`⤢ enlarge`}),e.kind===`graph`&&(0,A.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,"data-testid":`diagram-orientation`,title:O===`portrait`?`Turn it across the page — it is drawn down`:`Turn it down the page — it is drawn across`,"aria-label":`Turn the diagram ${Ce(O)}`,onClick:de,children:O===`portrait`?`↔ landscape`:`↕ portrait`}),e.kind===`table`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:he===0?`Save as .csv — opens in any spreadsheet`:`Save as .csv — ${he} hidden rows are left out`,onClick:()=>gd(me(),`${pe}.csv`),children:`⤓ download CSV`}),(0,A.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:he===0?`Save as .xlsx — one sheet, values typed as they are declared`:`Save as .xlsx — ${he} hidden rows are left out`,onClick:()=>void _d(me(),`${pe}.xlsx`),children:`⤓ download XLSX`}),(0,A.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:he===0?`Save as .md — each chapter a heading, its rows a table`:`Save as .md — ${he} hidden rows are left out`,onClick:()=>vd(e.data,C,oe.rows,`${pe}.md`),children:`⤓ download Markdown`}),he>0&&(0,A.jsxs)(`span`,{className:`text-xs text-amber-700 dark:text-amber-300`,"data-testid":`table-export-narrowed`,children:[`exports `,he,` rows fewer than the table declares`]})]}):e.kind===`timeline`?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:`Save as .svg — insert it as a picture in a document`,onClick:ve,children:`⤓ download SVG`}),(0,A.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:`Copy the SVG markup, for somewhere that takes it directly`,onClick:()=>void ye(),children:`copy markup`})]}),(0,A.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>l(e=>!e),children:[c?`hide`:`show`,` text equivalent`]}),ie!==void 0&&(0,A.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>f(e=>!e),children:[u?`hide`:`show`,` derived diagram syntax`]}),(0,A.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>g(e=>!e),children:[h?`hide`:`show`,` envelope`]}),n!==void 0&&(0,A.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>m(e=>!e),children:[p?`hide`:`show`,` original output`]}),_!==null&&(0,A.jsx)(`span`,{role:`status`,className:`text-emerald-600 dark:text-emerald-400`,children:_})]}),c&&(0,A.jsx)(`pre`,{"data-testid":`structured-text-equivalent`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:hf(e,ae,C,i)}),u&&ie!==void 0&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`mb-1 text-[11px] text-zinc-500`,children:`Derived from the structured data above. It is an export, not the source.`}),(0,A.jsx)(`pre`,{"data-testid":`structured-derived-export`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:ie})]}),h&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`mb-1 text-[11px] text-zinc-500`,children:`The validated document this view is drawn from. It is not sent to the model.`}),(0,A.jsx)(`pre`,{"data-testid":`structured-envelope`,className:`max-h-80 overflow-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:t})]}),p&&n!==void 0&&(0,A.jsx)(`pre`,{"data-testid":`structured-raw-output`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:n})]})}function xf({item:e,dispatch:t}){let n=fu(e.structured);return n===void 0?null:(0,A.jsx)(bf,{envelope:n,source:ff(e.structured,n),rawOutput:e.output,dispatch:t,...e.structuredConformance===void 0?{}:{conformance:e.structuredConformance}})}var Sf={id:`structured-exchange`,match:e=>fu(e.structured)!==void 0,stable:!1,showsRawReveal:!0,startsExpanded:!0,Expanded:xf},Cf=class extends d.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){console.error(`[pi-outpost] viewer crashed:`,e,t.componentStack)}render(){return this.state.failed?(0,A.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,A.jsxs)(`p`,{className:`max-w-md text-center text-sm text-zinc-600 dark:text-zinc-400`,children:[this.props.label??`This file`,` could not be displayed. Close and reopen it to try again.`]})}):this.props.children}},wf=(0,d.createContext)({});function Tf(e){let t=Le(e.children,`json`);return t===null?(0,A.jsx)(ze,{...e}):(0,A.jsx)(Ef,{code:t,pre:e})}function Ef({code:e,pre:t}){let n=(0,d.useContext)(wf),r=(0,d.useMemo)(()=>pu(e),[e]);if(r.status===`not-a-document`)return(0,A.jsx)(ze,{...t});if(r.status===`valid`){let t=n[An(e)];return(0,A.jsx)(Cf,{label:`This diagram`,children:(0,A.jsx)(`div`,{className:`my-2`,"data-testid":`reply-structured-exchange`,children:(0,A.jsx)(bf,{envelope:r.envelope,source:e,...t?{conformance:t}:{}})})})}return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`p`,{"data-testid":`reply-structured-exchange-refused`,className:`mb-1 text-xs text-amber-700 dark:text-amber-400`,children:[`This structured-exchange document could not be drawn: `,Df(r)]}),(0,A.jsx)(ze,{...t})]})}function Df(e){if(e.status===`unsupported-version`)return`${e.schema} is not a version this application implements.`;let t=e.status===`invalid`?e.issues[0]:e.issue;return t===void 0?`it does not satisfy the schema it declares.`:`${t.message} (${t.rule}${t.path?` at ${t.path}`:``})`}function Of(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function kf(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Af=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jf=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mf={};function Nf(e,t){return((t||Mf).jsx?jf:Af).test(e)}var Pf=/[ \t\n\f\r]/g;function Ff(e){return typeof e==`object`?e.type===`text`&&If(e.value):If(e)}function If(e){return e.replace(Pf,``)===``}var Lf=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Lf.prototype.normal={},Lf.prototype.property={},Lf.prototype.space=void 0;function Rf(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Lf(n,r,t)}function zf(e){return e.toLowerCase()}var Bf=class{constructor(e,t){this.attribute=t,this.property=e}};Bf.prototype.attribute=``,Bf.prototype.booleanish=!1,Bf.prototype.boolean=!1,Bf.prototype.commaOrSpaceSeparated=!1,Bf.prototype.commaSeparated=!1,Bf.prototype.defined=!1,Bf.prototype.mustUseProperty=!1,Bf.prototype.number=!1,Bf.prototype.overloadedBoolean=!1,Bf.prototype.property=``,Bf.prototype.spaceSeparated=!1,Bf.prototype.space=void 0;var Vf=t({boolean:()=>Uf,booleanish:()=>Wf,commaOrSpaceSeparated:()=>Jf,commaSeparated:()=>qf,number:()=>M,overloadedBoolean:()=>Gf,spaceSeparated:()=>Kf}),Hf=0,Uf=Yf(),Wf=Yf(),Gf=Yf(),M=Yf(),Kf=Yf(),qf=Yf(),Jf=Yf();function Yf(){return 2**++Hf}var Xf=Object.keys(Vf),Zf=class extends Bf{constructor(e,t,n,r){let i=-1;if(super(e,t),Qf(this,`space`,r),typeof n==`number`)for(;++i<Xf.length;){let e=Xf[i];Qf(this,Xf[i],(n&Vf[e])===Vf[e])}}};Zf.prototype.defined=!0;function Qf(e,t,n){n&&(e[t]=n)}function $f(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Zf(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[zf(r)]=r,n[zf(a.attribute)]=r}return new Lf(t,n,e.space)}var ep=$f({properties:{ariaActiveDescendant:null,ariaAtomic:Wf,ariaAutoComplete:null,ariaBusy:Wf,ariaChecked:Wf,ariaColCount:M,ariaColIndex:M,ariaColSpan:M,ariaControls:Kf,ariaCurrent:null,ariaDescribedBy:Kf,ariaDetails:null,ariaDisabled:Wf,ariaDropEffect:Kf,ariaErrorMessage:null,ariaExpanded:Wf,ariaFlowTo:Kf,ariaGrabbed:Wf,ariaHasPopup:null,ariaHidden:Wf,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Kf,ariaLevel:M,ariaLive:null,ariaModal:Wf,ariaMultiLine:Wf,ariaMultiSelectable:Wf,ariaOrientation:null,ariaOwns:Kf,ariaPlaceholder:null,ariaPosInSet:M,ariaPressed:Wf,ariaReadOnly:Wf,ariaRelevant:null,ariaRequired:Wf,ariaRoleDescription:Kf,ariaRowCount:M,ariaRowIndex:M,ariaRowSpan:M,ariaSelected:Wf,ariaSetSize:M,ariaSort:null,ariaValueMax:M,ariaValueMin:M,ariaValueNow:M,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function tp(e,t){return t in e?e[t]:t}function np(e,t){return tp(e,t.toLowerCase())}var rp=$f({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:qf,acceptCharset:Kf,accessKey:Kf,action:null,allow:null,allowFullScreen:Uf,allowPaymentRequest:Uf,allowUserMedia:Uf,alpha:Uf,alt:null,as:null,async:Uf,autoCapitalize:null,autoComplete:Kf,autoFocus:Uf,autoPlay:Uf,blocking:Kf,capture:null,charSet:null,checked:Uf,cite:null,className:Kf,closedBy:null,colorSpace:null,cols:M,colSpan:M,command:null,commandFor:null,content:null,contentEditable:Wf,controls:Uf,controlsList:Kf,coords:M|qf,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Uf,defer:Uf,dir:null,dirName:null,disabled:Uf,download:Gf,draggable:Wf,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Uf,formTarget:null,headers:Kf,height:M,hidden:Gf,high:M,href:null,hrefLang:null,htmlFor:Kf,httpEquiv:Kf,id:null,imageSizes:null,imageSrcSet:null,inert:Uf,inputMode:null,integrity:null,is:null,isMap:Uf,itemId:null,itemProp:Kf,itemRef:Kf,itemScope:Uf,itemType:Kf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Uf,low:M,manifest:null,max:null,maxLength:M,media:null,method:null,min:null,minLength:M,multiple:Uf,muted:Uf,name:null,nonce:null,noModule:Uf,noValidate:Uf,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:Uf,optimum:M,pattern:null,ping:Kf,placeholder:null,playsInline:Uf,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Uf,referrerPolicy:null,rel:Kf,required:Uf,reversed:Uf,rows:M,rowSpan:M,sandbox:Kf,scope:null,scoped:Uf,seamless:Uf,selected:Uf,shadowRootClonable:Uf,shadowRootCustomElementRegistry:Uf,shadowRootDelegatesFocus:Uf,shadowRootMode:null,shadowRootSerializable:Uf,shape:null,size:M,sizes:null,slot:null,span:M,spellCheck:Wf,src:null,srcDoc:null,srcLang:null,srcSet:null,start:M,step:null,style:null,tabIndex:M,target:null,title:null,translate:null,type:null,typeMustMatch:Uf,useMap:null,value:Wf,width:M,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Kf,axis:null,background:null,bgColor:null,border:M,borderColor:null,bottomMargin:M,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Uf,declare:Uf,event:null,face:null,frame:null,frameBorder:null,hSpace:M,leftMargin:M,link:null,longDesc:null,lowSrc:null,marginHeight:M,marginWidth:M,noResize:Uf,noHref:Uf,noShade:Uf,noWrap:Uf,object:null,profile:null,prompt:null,rev:null,rightMargin:M,rules:null,scheme:null,scrolling:Wf,standby:null,summary:null,text:null,topMargin:M,valueType:null,version:null,vAlign:null,vLink:null,vSpace:M,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Uf,disablePictureInPicture:Uf,disableRemotePlayback:Uf,exportParts:qf,part:Kf,prefix:null,property:null,results:M,security:null,unselectable:null},space:`html`,transform:np}),ip=$f({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:Jf,accentHeight:M,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:M,amplitude:M,arabicForm:null,ascent:M,attributeName:null,attributeType:null,azimuth:M,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:M,by:null,calcMode:null,capHeight:M,className:Kf,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:M,diffuseConstant:M,direction:null,display:null,dur:null,divisor:M,dominantBaseline:null,download:Uf,dx:null,dy:null,edgeMode:null,editable:null,elevation:M,enableBackground:null,end:null,event:null,exponent:M,externalResourcesRequired:null,fill:null,fillOpacity:M,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:qf,g2:qf,glyphName:qf,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:M,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:M,horizOriginX:M,horizOriginY:M,id:null,ideographic:M,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:M,k:M,k1:M,k2:M,k3:M,k4:M,kernelMatrix:Jf,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:M,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:M,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:M,overlineThickness:M,paintOrder:null,panose1:null,path:null,pathLength:M,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Kf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:M,pointsAtY:M,pointsAtZ:M,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jf,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jf,rev:Jf,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jf,requiredFeatures:Jf,requiredFonts:Jf,requiredFormats:Jf,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:M,specularExponent:M,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:M,strikethroughThickness:M,string:null,stroke:null,strokeDashArray:Jf,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:M,strokeOpacity:M,strokeWidth:null,style:null,surfaceScale:M,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jf,tabIndex:M,tableValues:null,target:null,targetX:M,targetY:M,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jf,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:M,underlineThickness:M,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:M,values:null,vAlphabetic:M,vMathematical:M,vectorEffect:null,vHanging:M,vIdeographic:M,version:null,vertAdvY:M,vertOriginX:M,vertOriginY:M,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:M,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:tp}),ap=$f({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()}}),op=$f({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:np}),sp=$f({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),cp={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`},lp=/[A-Z]/g,up=/-[a-z]/g,dp=/^data[-\w.:]+$/i;function fp(e,t){let n=zf(t),r=t,i=Bf;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&dp.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(up,mp);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!up.test(e)){let n=e.replace(lp,pp);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Zf}return new i(r,t)}function pp(e){return`-`+e.toLowerCase()}function mp(e){return e.charAt(1).toUpperCase()}var hp=Rf([ep,rp,ap,op,sp],`html`),gp=Rf([ep,ip,ap,op,sp],`svg`);function _p(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function vp(e){return e.join(` `).trim()}var yp=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
32
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),bp=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(yp());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),xp=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Sp=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(bp()),r=xp();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Cp=Tp(`end`),wp=Tp(`start`);function Tp(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Ep(e){let t=wp(e),n=Cp(e);if(t&&n)return{start:t,end:n}}function Dp(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?kp(e.position):`start`in e||`end`in e?kp(e):`line`in e||`column`in e?Op(e):``}function Op(e){return Ap(e&&e.line)+`:`+Ap(e&&e.column)}function kp(e){return Op(e&&e.start)+`-`+Op(e&&e.end)}function Ap(e){return e&&typeof e==`number`?e:1}var jp=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Dp(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};jp.prototype.file=``,jp.prototype.name=``,jp.prototype.reason=``,jp.prototype.message=``,jp.prototype.stack=``,jp.prototype.column=void 0,jp.prototype.line=void 0,jp.prototype.ancestors=void 0,jp.prototype.cause=void 0,jp.prototype.fatal=void 0,jp.prototype.place=void 0,jp.prototype.ruleId=void 0,jp.prototype.source=void 0;var Mp=e(Sp(),1),Np={}.hasOwnProperty,Pp=new Map,Fp=/[A-Z]/g,Ip=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Lp=new Set([`td`,`th`]),Rp=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function zp(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Xp(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Yp(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,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`?gp:hp,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Bp(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Bp(e,t,n){if(t.type===`element`)return Vp(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Hp(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Wp(e,t,n);if(t.type===`mdxjsEsm`)return Up(e,t);if(t.type===`root`)return Gp(e,t,n);if(t.type===`text`)return Kp(e,t)}function Vp(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=gp,e.schema=i),e.ancestors.push(t);let a=nm(e,t.tagName,!1),o=Zp(e,t),s=$p(e,t);return Ip.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Ff(e)})),qp(e,o,a,t),Jp(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Hp(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}rm(e,t.position)}function Up(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);rm(e,t.position)}function Wp(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=gp,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:nm(e,t.name,!0),o=Qp(e,t),s=$p(e,t);return qp(e,o,a,t),Jp(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Gp(e,t,n){let r={};return Jp(r,$p(e,t)),e.create(t,e.Fragment,r,n)}function Kp(e,t){return t.value}function qp(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Jp(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Yp(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Xp(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=wp(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Zp(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Np.call(t.properties,i)){let a=em(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Lp.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Qp(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else rm(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else rm(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function $p(e,t){let n=[],r=-1,i=e.passKeys?new Map:Pp;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Bp(e,a,o);s!==void 0&&n.push(s)}return n}function em(e,t,n){let r=fp(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kf(n):vp(n)),r.property===`style`){let t=typeof n==`object`?n:tm(e,String(n));return e.stylePropertyNameCase===`css`&&(t=im(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?cp[r.property]||r.property:r.attribute,n]}}function tm(e,t){try{return(0,Mp.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new jp("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Rp+`#cannot-parse-style-attribute`,r}}function nm(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Nf(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Nf(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Np.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);rm(e)}function rm(e,t){let n=new jp("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=Rp+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function im(e){let t={},n;for(n in e)Np.call(e,n)&&(t[am(n)]=e[n]);return t}function am(e){let t=e.replace(Fp,om);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function om(e){return`-`+e.toLowerCase()}var sm={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`]},cm={};function lm(e,t){let n=t||cm;return um(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function um(e,t,n){if(fm(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 dm(e.children,t,n)}return Array.isArray(e)?dm(e,t,n):``}function dm(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=um(e[i],t,n);return r.join(``)}function fm(e){return!!(e&&typeof e==`object`)}var pm=document.createElement(`i`);function mm(e){let t=`&`+e+`;`;pm.innerHTML=t;let n=pm.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function hm(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function gm(e,t){return e.length>0?(hm(e,e.length,0,t),e):t}var _m={}.hasOwnProperty;function vm(e){let t={},n=-1;for(;++n<e.length;)ym(t,e[n]);return t}function ym(e,t){let n;for(n in t){let r=(_m.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){_m.call(r,a)||(r[a]=[]);let e=i[a];bm(r[a],Array.isArray(e)?e:e?[e]:[])}}}function bm(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);hm(e,0,0,r)}function xm(e,t){let 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 Sm(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Cm=Fm(/[A-Za-z]/),wm=Fm(/[\dA-Za-z]/),Tm=Fm(/[#-'*+\--9=?A-Z^-~]/);function Em(e){return e!==null&&(e<32||e===127)}var Dm=Fm(/\d/),Om=Fm(/[\dA-Fa-f]/),km=Fm(/[!-/:-@[-`{-~]/);function Am(e){return e!==null&&e<-2}function jm(e){return e!==null&&(e<0||e===32)}function Mm(e){return e===-2||e===-1||e===32}var Nm=Fm(/\p{P}|\p{S}/u),Pm=Fm(/\s/);function Fm(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Im(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&wm(e.charCodeAt(n+1))&&wm(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Lm(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Mm(r)?(e.enter(n),s(r)):t(r)}function s(r){return Mm(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Rm={tokenize:zm};function zm(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Lm(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Am(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Bm={tokenize:Hm},Vm={tokenize:Um};function Hm(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return hm(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Vm,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Vm,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Am(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;hm(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Um(e,t,n){return Lm(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Wm(e){if(e===null||jm(e)||Pm(e))return 1;if(Nm(e))return 2}function Gm(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Km={name:`attention`,resolveAll:qm,tokenize:Jm};function qm(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ym(d,-c),Ym(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=gm(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=gm(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=gm(l,Gm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=gm(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=gm(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,hm(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Jm(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Wm(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Wm(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Ym(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Xm={name:`autolink`,tokenize:Zm};function Zm(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Cm(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||wm(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||wm(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Em(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Tm(t)?(e.consume(t),l):n(t)}function u(e){return wm(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||wm(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Qm={partial:!0,tokenize:$m};function $m(e,t,n){return r;function r(t){return Mm(t)?Lm(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Am(e)?t(e):n(e)}}var eh={continuation:{tokenize:nh},exit:rh,name:`blockQuote`,tokenize:th};function th(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Mm(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function nh(e,t,n){let r=this;return i;function i(t){return Mm(t)?Lm(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(eh,t,n)(r)}}function rh(e){e.exit(`blockQuote`)}var ih={name:`characterEscape`,tokenize:ah};function ah(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return km(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var oh={name:`characterReference`,tokenize:sh};function sh(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=wm,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Om,u):(e.enter(`characterReferenceValue`),a=7,o=Dm,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===wm&&!mm(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var ch={partial:!0,tokenize:dh},lh={concrete:!0,name:`codeFenced`,tokenize:uh};function uh(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Mm(t)?Lm(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Am(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ch,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Am(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Mm(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Lm(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Am(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Am(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Mm(t)?Lm(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Am(t)?e.check(ch,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Am(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Mm(t)?Lm(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Mm(t)?Lm(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Am(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function dh(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var fh={name:`codeIndented`,tokenize:mh},ph={partial:!0,tokenize:hh};function mh(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Lm(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Am(t)?e.attempt(ph,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Am(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function hh(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Am(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Lm(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Am(e)?i(e):n(e)}}var gh={name:`codeText`,previous:vh,resolve:_h,tokenize:yh};function _h(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function vh(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function yh(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Am(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Am(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var bh=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&xh(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),xh(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),xh(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);xh(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);xh(this.left,t.reverse())}}}};function xh(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 Sh(e){let t={},n=-1,r,i,a,o,s,c,l,u=new bh(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ch(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return hm(e,0,1/0,u.slice(0)),!l}function Ch(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var wh={resolve:Eh,tokenize:Dh},Th={partial:!0,tokenize:Oh};function Eh(e){return Sh(e),e}function Dh(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Am(t)?e.check(Th,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Oh(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Lm(e,a,`linePrefix`)}function a(i){if(i===null||Am(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function kh(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Em(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Am(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||jm(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Em(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Ah(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Am(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Am(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Mm(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function jh(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Am(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Lm(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Am(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Mh(e,t){let n;return r;function r(i){return Am(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Mm(i)?Lm(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Nh={name:`definition`,tokenize:Fh},Ph={partial:!0,tokenize:Ih};function Fh(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ah.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Sm(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return jm(t)?Mh(e,l)(t):l(t)}function l(t){return kh(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ph,d,d)(t)}function d(t){return Mm(t)?Lm(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Am(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ih(e,t,n){return r;function r(t){return jm(t)?Mh(e,i)(t):n(t)}function i(t){return jh(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Mm(t)?Lm(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Am(e)?t(e):n(e)}}var Lh={name:`hardBreakEscape`,tokenize:Rh};function Rh(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Am(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var zh={name:`headingAtx`,resolve:Bh,tokenize:Vh};function Bh(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},hm(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Vh(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||jm(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Am(n)?(e.exit(`atxHeading`),t(n)):Mm(n)?Lm(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||jm(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Hh=`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`.split(`.`),Uh=[`pre`,`script`,`style`,`textarea`],Wh={concrete:!0,name:`htmlFlow`,resolveTo:qh,tokenize:Jh},Gh={partial:!0,tokenize:Xh},Kh={partial:!0,tokenize:Yh};function qh(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 Jh(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:O):Cm(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Cm(a)?(e.consume(a),i=4,r.interrupt?t:O):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:O):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:E:m):n(i)}function h(t){return Cm(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||jm(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Uh.includes(l)?(i=1,r.interrupt?t(s):E(s)):Hh.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):E(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||wm(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:E):n(i)}function v(t){return Mm(t)?(e.consume(t),v):ee(t)}function y(t){return t===47?(e.consume(t),ee):t===58||t===95||Cm(t)?(e.consume(t),b):Mm(t)?(e.consume(t),y):ee(t)}function b(t){return t===45||t===46||t===58||t===95||wm(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Mm(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Mm(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Am(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||jm(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Mm(e)?y(e):n(e)}function ee(t){return t===62?(e.consume(t),te):n(t)}function te(t){return t===null||Am(t)?E(t):Mm(t)?(e.consume(t),te):n(t)}function E(t){return t===45&&i===2?(e.consume(t),ae):t===60&&i===1?(e.consume(t),D):t===62&&i===4?(e.consume(t),ce):t===63&&i===3?(e.consume(t),O):t===93&&i===5?(e.consume(t),se):Am(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Gh,k,ne)(t)):t===null||Am(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),E)}function ne(t){return e.check(Kh,re,k)(t)}function re(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return t===null||Am(t)?ne(t):(e.enter(`htmlFlowData`),E(t))}function ae(t){return t===45?(e.consume(t),O):E(t)}function D(t){return t===47?(e.consume(t),o=``,oe):E(t)}function oe(t){if(t===62){let n=o.toLowerCase();return Uh.includes(n)?(e.consume(t),ce):E(t)}return Cm(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),oe):E(t)}function se(t){return t===93?(e.consume(t),O):E(t)}function O(t){return t===62?(e.consume(t),ce):t===45&&i===2?(e.consume(t),O):E(t)}function ce(t){return t===null||Am(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),ce)}function k(n){return e.exit(`htmlFlow`),t(n)}}function Yh(e,t,n){let r=this;return i;function i(t){return Am(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Xh(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Qm,t,n)}}var Zh={name:`htmlText`,tokenize:Qh};function Qh(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Cm(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Cm(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Am(t)?(o=d,D(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ae(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Am(t)?(o=h,D(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ae(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ae(t):Am(t)?(o=v,D(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Am(t)?(o=y,D(t)):(e.consume(t),y)}function b(e){return e===62?ae(e):y(e)}function x(t){return Cm(t)?(e.consume(t),S):n(t)}function S(t){return t===45||wm(t)?(e.consume(t),S):C(t)}function C(t){return Am(t)?(o=C,D(t)):Mm(t)?(e.consume(t),C):ae(t)}function w(t){return t===45||wm(t)?(e.consume(t),w):t===47||t===62||jm(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ae):t===58||t===95||Cm(t)?(e.consume(t),ee):Am(t)?(o=T,D(t)):Mm(t)?(e.consume(t),T):ae(t)}function ee(t){return t===45||t===46||t===58||t===95||wm(t)?(e.consume(t),ee):te(t)}function te(t){return t===61?(e.consume(t),E):Am(t)?(o=te,D(t)):Mm(t)?(e.consume(t),te):T(t)}function E(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ne):Am(t)?(o=E,D(t)):Mm(t)?(e.consume(t),E):(e.consume(t),re)}function ne(t){return t===i?(e.consume(t),i=void 0,ie):t===null?n(t):Am(t)?(o=ne,D(t)):(e.consume(t),ne)}function re(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||jm(t)?T(t):(e.consume(t),re)}function ie(e){return e===47||e===62||jm(e)?T(e):n(e)}function ae(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function D(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),oe}function oe(t){return Mm(t)?Lm(e,se,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):se(t)}function se(t){return e.enter(`htmlTextData`),o(t)}}var $h={name:`labelEnd`,resolveAll:rg,resolveTo:ig,tokenize:ag},eg={tokenize:og},tg={tokenize:sg},ng={tokenize:cg};function rg(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&hm(e,0,e.length,n),e}function ig(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=gm(s,e.slice(a+1,a+r+3)),s=gm(s,[[`enter`,u,t]]),s=gm(s,Gm(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=gm(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=gm(s,e.slice(o+1)),s=gm(s,[[`exit`,c,t]]),hm(e,a,e.length,s),e}function ag(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Sm(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(eg,u,o?u:d)(t):t===91?e.attempt(tg,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ng,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function og(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return jm(t)?Mh(e,a)(t):a(t)}function a(t){return t===41?u(t):kh(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return jm(t)?Mh(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?jh(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return jm(t)?Mh(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function sg(e,t,n){let r=this;return i;function i(t){return Ah.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Sm(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function cg(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var lg={name:`labelStartImage`,resolveAll:$h.resolveAll,tokenize:ug};function ug(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var dg={name:`labelStartLink`,resolveAll:$h.resolveAll,tokenize:fg};function fg(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var pg={name:`lineEnding`,tokenize:mg};function mg(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Lm(e,t,`linePrefix`)}}var hg={name:`thematicBreak`,tokenize:gg};function gg(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Am(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Mm(t)?Lm(e,s,`whitespace`)(t):s(t))}}var _g={continuation:{tokenize:xg},exit:Cg,name:`list`,tokenize:bg},vg={partial:!0,tokenize:wg},yg={partial:!0,tokenize:Sg};function bg(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Dm(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(hg,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Dm(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Qm,r.interrupt?n:u,e.attempt(vg,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Mm(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function xg(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Qm,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Lm(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Mm(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yg,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Lm(e,e.attempt(_g,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Sg(e,t,n){let r=this;return Lm(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Cg(e){e.exit(this.containerState.type)}function wg(e,t,n){let r=this;return Lm(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Mm(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Tg={name:`setextUnderline`,resolveTo:Eg,tokenize:Dg};function Eg(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Dg(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Mm(t)?Lm(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Am(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Og={tokenize:kg};function kg(e){let t=this,n=e.attempt(Qm,r,e.attempt(this.parser.constructs.flowInitial,i,Lm(e,e.attempt(this.parser.constructs.flow,i,e.attempt(wh,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Ag={resolveAll:Pg()},jg=Ng(`string`),Mg=Ng(`text`);function Ng(e){return{resolveAll:Pg(e===`text`?Fg:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Pg(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Fg(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Ig=t({attentionMarkers:()=>Wg,contentInitial:()=>Rg,disable:()=>Gg,document:()=>Lg,flow:()=>Bg,flowInitial:()=>zg,insideSpan:()=>Ug,string:()=>Vg,text:()=>Hg}),Lg={42:_g,43:_g,45:_g,48:_g,49:_g,50:_g,51:_g,52:_g,53:_g,54:_g,55:_g,56:_g,57:_g,62:eh},Rg={91:Nh},zg={[-2]:fh,[-1]:fh,32:fh},Bg={35:zh,42:hg,45:[Tg,hg],60:Wh,61:Tg,95:hg,96:lh,126:lh},Vg={38:oh,92:ih},Hg={[-5]:pg,[-4]:pg,[-3]:pg,33:lg,38:oh,42:Km,60:[Xm,Zh],91:dg,92:[Lh,ih],93:$h,95:Km,96:gh},Ug={null:[Km,Ag]},Wg={null:[42,95]},Gg={null:[]};function Kg(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=gm(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Gm(a,l.events,l),l.events):[]}function f(e,t){return Jg(p(e),t)}function p(e){return qg(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,ee()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Am(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,ee()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&hm(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,ee()}}function ee(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function qg(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Jg(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
33
|
+
`;break;case-3:o=`\r
|
|
34
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Yg(e){let t={constructs:vm([Ig,...(e||{}).extensions||[]]),content:n(Rm),defined:[],document:n(Bm),flow:n(Og),lazy:{},string:n(jg),text:n(Mg)};return t;function n(e){return n;function n(n){return Kg(t,e,n)}}}function Xg(e){for(;!Sh(e););return e}var Zg=/[\0\t\n\r]/g;function Qg(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Zg.lastIndex=u,c=Zg.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var $g=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function e_(e){return e.replace($g,t_)}function t_(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return xm(n.slice(t?2:1),t?16:10)}return mm(n)||e}var n_={}.hasOwnProperty;function r_(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),i_(n)(Xg(Yg(n).document().write(Qg()(e,t,!0))))}function i_(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(me),characterEscape:T,characterReference:T,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ve),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:A,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:ee,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:de,characterReference:j,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:ee,codeIndented:c(_),codeText:c(ie),codeTextData:ee,data:ee,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(E),hardBreakTrailing:c(E),htmlFlow:c(ne),htmlFlowData:ee,htmlText:c(re),htmlTextData:ee,image:c(D),label:se,labelText:oe,lineEnding:te,link:c(ae),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:le,resourceDestinationString:O,resourceTitleString:ce,resource:k,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};o_(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];n_.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||c_).call(a,void 0,e[0])}for(r.position={start:a_(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:a_(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:a_(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||c_).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Dp({start:e.start,end:e.end})+`): it’s not open`);n.position.end=a_(e.end)}function u(){return lm(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Sm(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Oe(),n.position={start:a_(e.start),end:void 0},t.push(n)),this.stack.push(n)}function ee(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=a_(e.end)}function te(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=a_(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),ee.call(this,e))}function E(){this.data.atHardBreak=!0}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ae(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function D(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function oe(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=e_(t),n.identifier=Sm(t).toLowerCase()}function se(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function k(){this.data.inReference=void 0}function A(){this.data.referenceType=`collapsed`}function le(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Sm(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ue(e){this.data.characterReferenceType=e.type}function de(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=xm(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=mm(t);let i=this.stack[this.stack.length-1];i.value+=r}function j(e){let t=this.stack.pop();t.position.end=a_(e.end)}function fe(e){ee.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){ee.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[]}}function he(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function _e(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ve(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function a_(e){return{line:e.line,column:e.column,offset:e.offset}}function o_(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?o_(e,r):s_(e,r)}}function s_(e,t){let n;for(n in t)if(n_.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function c_(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Dp({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Dp({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Dp({start:t.start,end:t.end})+`) is still open`)}function l_(e){let t=this;t.parser=n;function n(n){return r_(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function u_(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function d_(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
35
|
+
`}]}function f_(e,t){let n=t.value?t.value+`
|
|
36
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function p_(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function m_(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function h_(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Im(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function g_(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function __(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function v_(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function y_(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return v_(e,t);let i={src:Im(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function b_(e,t){let n={src:Im(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function x_(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function S_(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return v_(e,t);let i={href:Im(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function C_(e,t){let n={href:Im(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function w_(e,t,n){let r=e.all(t),i=n?T_(n):E_(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
37
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
38
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function T_(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=E_(n[r])}return t}function E_(e){return e.spread??e.children.length>1}function D_(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function O_(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k_(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function A_(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j_(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=wp(t.children[1]),o=Cp(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function M_(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function N_(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var P_=9,F_=32;function I_(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(L_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(L_(t.slice(i),i>0,!1)),a.join(``)}function L_(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===P_||t===F_;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===P_||t===F_;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function R_(e,t){let n={type:`text`,value:I_(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function z_(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var B_={blockquote:u_,break:d_,code:f_,delete:p_,emphasis:m_,footnoteReference:h_,heading:g_,html:__,imageReference:y_,image:b_,inlineCode:x_,linkReference:S_,link:C_,listItem:w_,list:D_,paragraph:O_,root:k_,strong:A_,table:j_,tableCell:N_,tableRow:M_,text:R_,thematicBreak:z_,toml:V_,yaml:V_,definition:V_,footnoteDefinition:V_};function V_(){}var H_=typeof self==`object`?self:globalThis,U_=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new H_[e](t)},W_=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof H_[e]==`function`?U_(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(U_(a,o),i)};return r},G_=e=>W_(new Map,e)(0),K_=``,{toString:q_}={},{keys:J_}=Object,Y_=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=q_.call(e).slice(8,-1);switch(n){case`Array`:return[1,K_];case`Object`:return[2,K_];case`Date`:return[3,K_];case`RegExp`:return[4,K_];case`Map`:return[5,K_];case`Set`:return[6,K_];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},X_=([e,t])=>e===0&&(t===`function`||t===`symbol`),Z_=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Y_(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of J_(r))(e||!X_(Y_(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?K_:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(X_(Y_(n))||X_(Y_(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!X_(Y_(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Q_=(e,{json:t,lossy:n}={})=>{let r=[];return Z_(!(t||n),!!t,new Map,r)(e),r},$_=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?G_(Q_(e,t)):structuredClone(e):(e,t)=>G_(Q_(e,t));function ev(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function tv(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function nv(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||ev,r=e.options.footnoteBackLabel||tv,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Im(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...$_(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
39
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
40
|
+
`}]}}var rv=(function(e){if(e==null)return cv;if(typeof e==`function`)return sv(e);if(typeof e==`object`)return Array.isArray(e)?iv(e):av(e);if(typeof e==`string`)return ov(e);throw Error(`Expected function, string, or object as test`)});function iv(e){let t=[],n=-1;for(;++n<e.length;)t[n]=rv(e[n]);return sv(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function av(e){let t=e;return sv(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ov(e){return sv(t);function t(t){return t&&t.type===e}}function sv(e){return t;function t(t,n,r){return!!(lv(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function cv(){return!0}function lv(e){return typeof e==`object`&&!!e&&`type`in e}function uv(e){return e}var dv=[],fv=`skip`;function pv(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=rv(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+uv(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=dv,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=mv(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function mv(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?dv:[e]}function hv(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),pv(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var gv={}.hasOwnProperty,_v={};function vv(e,t){let n=t||_v,r=new Map,i=new Map,a={all:s,applyData:bv,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...B_,...n.handlers},one:o,options:n,patch:yv,wrap:Sv};return hv(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(gv.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=$_(n);return r.children=a.all(e),r}return $_(e)}return(a.options.unknownHandler||xv)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Cv(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Cv(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function yv(e,t){e.position&&(t.position=Ep(e))}function bv(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,$_(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function xv(e,t){let n=t.data||{},r=`value`in t&&!(gv.call(n,`hProperties`)||gv.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Sv(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
41
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
42
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
43
|
+
`}),n}function Cv(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function wv(e,t){let n=vv(e,t),r=n.one(e,void 0),i=nv(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
44
|
+
`},i)),a}function Tv(e,t){return e&&`run`in e?async function(n,r){let i=wv(n,{file:r,...t});await e.run(i,r)}:function(n,r){return wv(n,{file:r,...e||t})}}function Ev(e){if(e)throw e}var Dv=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Ov(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function kv(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Av(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Av(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var jv={basename:Mv,dirname:Nv,extname:Pv,join:Fv,sep:`/`};function Mv(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Rv(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Nv(e){if(Rv(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Pv(e){Rv(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Fv(...e){let t=-1,n;for(;++t<e.length;)Rv(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Iv(n)}function Iv(e){Rv(e);let t=e.codePointAt(0)===47,n=Lv(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Lv(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Rv(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var zv={cwd:Bv};function Bv(){return`/`}function Vv(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Hv(e){if(typeof e==`string`)e=new URL(e);else if(!Vv(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Uv(e)}function Uv(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Wv=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Gv=class{constructor(e){let t;t=e?Vv(e)?{path:e}:typeof e==`string`||Yv(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:zv.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Wv.length;){let e=Wv[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Wv.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?jv.basename(this.path):void 0}set basename(e){qv(e,`basename`),Kv(e,`basename`),this.path=jv.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?jv.dirname(this.path):void 0}set dirname(e){Jv(this.basename,`dirname`),this.path=jv.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?jv.extname(this.path):void 0}set extname(e){if(Kv(e,`extname`),Jv(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=jv.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Vv(e)&&(e=Hv(e)),qv(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?jv.basename(this.path,this.extname):void 0}set stem(e){qv(e,`stem`),Kv(e,`stem`),this.path=jv.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new jp(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Kv(e,t){if(e&&e.includes(jv.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+jv.sep+"`")}function qv(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Jv(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Yv(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Xv=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Zv=e(Dv(),1),Qv={}.hasOwnProperty,$v=new class e extends Xv{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=kv()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Zv.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(ny(`data`,this.frozen),this.namespace[e]=t,this):Qv.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ny(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=ay(e),n=this.parser||this.Parser;return ey(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ey(`process`,this.parser||this.Parser),ty(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ay(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);sy(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),ey(`processSync`,this.parser||this.Parser),ty(`processSync`,this.compiler||this.Compiler),this.process(e,r),iy(`processSync`,`process`,t),n;function r(e,r){t=!0,Ev(e),n=r}}run(e,t,n){ry(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=ay(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),iy(`runSync`,`run`,n),r;function i(e,t){Ev(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ay(t),r=this.compiler||this.Compiler;return ty(`stringify`,r),ry(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(ny(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,Zv.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Ov(o)&&Ov(r)&&(r=(0,Zv.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ey(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function ty(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function ny(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ry(e){if(!Ov(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function iy(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ay(e){return oy(e)?e:new Gv(e)}function oy(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function sy(e){return typeof e==`string`||cy(e)}function cy(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ly=[],uy={allowDangerousHtml:!0},dy=/^(https?|ircs?|mailto|xmpp)$/i,fy=[{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 py(e){let t=my(e),n=hy(e);return gy(t.runSync(t.parse(n),n),e)}function my(e){let t=e.rehypePlugins||ly,n=e.remarkPlugins||ly,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...uy}:uy;return $v().use(l_).use(n).use(Tv,r).use(t)}function hy(e){let t=e.children||``,n=new Gv;return typeof t==`string`?n.value=t:``+t,n}function gy(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||_y;for(let e of fy)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return hv(e,l),zp(e,{Fragment:A.Fragment,components:i,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in sm)if(Object.hasOwn(sm,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=sm[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function _y(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||dy.test(e.slice(0,t))?e:``}var vy=/[#.]/g;function yy(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){vy.lastIndex=i;let e=vy.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function by(e,t,n){let r=n?Ey(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=yy(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,xy(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Sy(e,o.properties,t,n)}for(let e of a)Cy(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function xy(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Sy(e,t,n,r){let i=fp(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?_p(r):i.commaSeparated?Of(r):i.commaOrSpaceSeparated?_p(Of(r).join(` `)):wy(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Ty(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(wy(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Cy(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(let n of t)Cy(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?Cy(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function wy(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||zf(n)===zf(t)))return!0}return n}function Ty(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Ey(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var Dy=`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`.split(`.`),Oy=by(hp,`div`),ky=by(gp,`g`,Dy),Ay={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function jy(e,t){return My(e,t||{})||{type:`root`,children:[]}}function My(e,t){let n=Ny(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function Ny(e,t){switch(e.nodeType){case 1:return Ry(e,t);case 3:return Iy(e);case 8:return Ly(e);case 9:return Py(e,t);case 10:return Fy();case 11:return Py(e,t);default:return}}function Py(e,t){return{type:`root`,children:zy(e,t)}}function Fy(){return{type:`doctype`}}function Iy(e){return{type:`text`,value:e.nodeValue||``}}function Ly(e){return{type:`comment`,value:e.nodeValue||``}}function Ry(e,t){let n=e.namespaceURI,r=n===Ay.svg?ky:Oy,i=n===Ay.html?e.tagName.toLowerCase():e.tagName,a=n===Ay.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,zy(a,t))}function zy(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=My(n[i],t);e!==void 0&&r.push(e)}return r}var By=new DOMParser;function Vy(e,t){return jy(t?.fragment?Hy(e):By.parseFromString(e,`text/html`))}function Hy(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var Uy=(function(e,t,n){let r=rv(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Wy=(function(e){if(e==null)return Jy;if(typeof e==`string`)return Ky(e);if(typeof e==`object`)return Gy(e);if(typeof e==`function`)return qy(e);throw Error("Expected function, string, or array as `test`")});function Gy(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Wy(e[n]);return qy(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Ky(e){return qy(t);function t(t){return t.tagName===e}}function qy(e){return t;function t(t,n,r){return!!(Yy(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Jy(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function Yy(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var Xy=/\n/g,Zy=/[\t ]+/g,Qy=Wy(`br`),$y=Wy(fb),eb=Wy(`p`),tb=Wy(`tr`),nb=Wy([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,db,pb]),rb=Wy(`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`.split(`.`));function ib(e,t){let n=t||{},r=`children`in e?e.children:[],i=rb(e),a=ub(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...sb(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...ab(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?Qy(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
|
|
45
|
+
`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function ab(e,t,n){return e.type===`element`?ob(e,t,n):e.type===`text`?n.whitespace===`normal`?sb(e,n):cb(e):[]}function ob(e,t,n){let r=ub(e,n),i=e.children||[],a=-1,o=[];if(nb(e))return o;let s,c;for(Qy(e)||tb(e)&&Uy(t,e,tb)?c=`
|
|
46
|
+
`:eb(e)?(s=2,c=2):rb(e)&&(s=1,c=1);++a<i.length;)o=o.concat(ab(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?Qy(i[a+1]):c}));return $y(e)&&Uy(t,e,$y)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function sb(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){Xy.lastIndex=a;let e=Xy.exec(n),i=e&&`index`in e?e.index:n.length;r.push(lb(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a!==0||t.breakBefore,i!==n.length||t.breakAfter)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function cb(e){return[String(e.value)]}function lb(e,t,n){let r=[],i=0,a;for(;i<e.length;){Zy.lastIndex=i;let n=Zy.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function ub(e,t){if(e.type===`element`){let 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 db(e){return!!(e.properties||{}).hidden}function fb(e){return e.tagName===`td`||e.tagName===`th`}function pb(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var N=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},mb=/([A-Z])/g,hb=e=>e.replace(mb,`-$1`).toLowerCase(),gb={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},_b=/[&><"']/g,vb=e=>String(e).replace(_b,e=>gb[e]),yb=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?yb(e.body[0]):e:e.type===`font`?yb(e.body):e,bb=new Set([`mathord`,`textord`,`atom`]),xb=e=>bb.has(yb(e).type),Sb=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},Cb={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 wb(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 Error(`Unexpected schema type; settings must declare an explicit default.`)}}function Tb(e){return e.default===void 0?wb(Array.isArray(e.type)?e.type[0]:e.type):e.default}function Eb(e,t,n,r){var i=n[t];e[t]=i===void 0?Tb(r):r.processor?r.processor(i):i}var Db=class{constructor(e){e===void 0&&(e={}),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,e||={};for(var t of Object.keys(Cb)){var n=Cb[t];n&&Eb(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new N(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=Sb(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},Ob=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Lb[Rb[this.id]]}sub(){return Lb[zb[this.id]]}fracNum(){return Lb[Bb[this.id]]}fracDen(){return Lb[Vb[this.id]]}cramp(){return Lb[Hb[this.id]]}text(){return Lb[Ub[this.id]]}isTight(){return this.size>=2}},kb=0,Ab=1,jb=2,Mb=3,Nb=4,Pb=5,Fb=6,Ib=7,Lb=[new Ob(kb,0,!1),new Ob(Ab,0,!0),new Ob(jb,1,!1),new Ob(Mb,1,!0),new Ob(Nb,2,!1),new Ob(Pb,2,!0),new Ob(Fb,3,!1),new Ob(Ib,3,!0)],Rb=[Nb,Pb,Nb,Pb,Fb,Ib,Fb,Ib],zb=[Pb,Pb,Pb,Pb,Ib,Ib,Ib,Ib],Bb=[jb,Mb,Nb,Pb,Fb,Ib,Fb,Ib],Vb=[Mb,Mb,Pb,Pb,Ib,Ib,Ib,Ib],Hb=[Ab,Ab,Mb,Mb,Pb,Pb,Ib,Ib],Ub=[kb,Ab,jb,Mb,jb,Mb,jb,Mb],Wb={DISPLAY:Lb[kb],TEXT:Lb[jb],SCRIPT:Lb[Nb],SCRIPTSCRIPT:Lb[Fb]},Gb=[{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 Kb(e){for(var t=0;t<Gb.length;t++)for(var n=Gb[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var qb=[];Gb.forEach(e=>e.blocks.forEach(e=>qb.push(...e)));function Jb(e){for(var t=0;t<qb.length;t+=2)if(e>=qb[t]&&e<=qb[t+1])return!0;return!1}var Yb=e=>e+` `+e,Xb=80,Zb=function(e,t){return`M95,`+(622+e+t)+`
|
|
47
|
+
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
48
|
+
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
49
|
+
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
|
|
50
|
+
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
51
|
+
c69,-144,104.5,-217.7,106.5,-221
|
|
52
|
+
l`+e/2.075+` -`+e+`
|
|
53
|
+
c5.3,-9.3,12,-14,20,-14
|
|
54
|
+
H400000v`+(40+e)+`H845.2724
|
|
55
|
+
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
56
|
+
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
57
|
+
M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Qb=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
|
|
58
|
+
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
59
|
+
c340,-704.7,510.7,-1060.3,512,-1067
|
|
60
|
+
l`+e/2.084+` -`+e+`
|
|
61
|
+
c4.7,-7.3,11,-11,19,-11
|
|
62
|
+
H40000v`+(40+e)+`H1012.3
|
|
63
|
+
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
64
|
+
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
|
|
65
|
+
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
66
|
+
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
67
|
+
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},$b=function(e,t){return`M983 `+(10+e+t)+`
|
|
68
|
+
l`+e/3.13+` -`+e+`
|
|
69
|
+
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|
70
|
+
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
|
|
71
|
+
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
|
|
72
|
+
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
73
|
+
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
74
|
+
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
75
|
+
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
76
|
+
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},ex=function(e,t){return`M424,`+(2398+e+t)+`
|
|
77
|
+
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
78
|
+
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
|
|
79
|
+
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
80
|
+
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
81
|
+
l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
|
|
82
|
+
v`+(40+e)+`H1014.6
|
|
83
|
+
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
84
|
+
c-2,6,-10,9,-24,9
|
|
85
|
+
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
|
|
86
|
+
h400000v`+(40+e)+`h-400000z`},tx=function(e,t){return`M473,`+(2713+e+t)+`
|
|
87
|
+
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
|
|
88
|
+
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|
89
|
+
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
90
|
+
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
|
|
91
|
+
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
|
|
92
|
+
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
93
|
+
606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},nx=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},rx=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
|
|
94
|
+
H742v`+r+`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
|
|
95
|
+
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
96
|
+
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
97
|
+
219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},ix=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=Zb(t,Xb);break;case`sqrtSize1`:r=Qb(t,Xb);break;case`sqrtSize2`:r=$b(t,Xb);break;case`sqrtSize3`:r=ex(t,Xb);break;case`sqrtSize4`:r=tx(t,Xb);break;case`sqrtTall`:r=rx(t,Xb,n)}return r},ax=function(e,t){switch(e){case`⎜`:return Yb(`M291 0 H417 V`+t+` H291z`);case`∣`:return Yb(`M145 0 H188 V`+t+` H145z`);case`∥`:return Yb(`M145 0 H188 V`+t+` H145z`)+Yb(`M367 0 H410 V`+t+` H367z`);case`⎟`:return Yb(`M457 0 H583 V`+t+` H457z`);case`⎢`:return Yb(`M319 0 H403 V`+t+` H319z`);case`⎥`:return Yb(`M263 0 H347 V`+t+` H263z`);case`⎪`:return Yb(`M384 0 H504 V`+t+` H384z`);case`⏐`:return Yb(`M312 0 H355 V`+t+` H312z`);case`‖`:return Yb(`M257 0 H300 V`+t+` H257z`)+Yb(`M478 0 H521 V`+t+` H478z`);default:return``}},ox={doubleleftarrow:`M262 157
|
|
98
|
+
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
|
|
99
|
+
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
|
|
100
|
+
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
|
|
101
|
+
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
|
|
102
|
+
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
|
|
103
|
+
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
104
|
+
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
105
|
+
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
106
|
+
-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
|
|
107
|
+
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
|
|
108
|
+
-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
|
|
109
|
+
-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
|
|
110
|
+
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
111
|
+
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
|
|
112
|
+
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
113
|
+
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
|
|
114
|
+
-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
|
|
115
|
+
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
|
|
116
|
+
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
|
|
117
|
+
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
|
|
118
|
+
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
119
|
+
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
120
|
+
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
|
|
121
|
+
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
|
|
122
|
+
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
123
|
+
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
124
|
+
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
|
|
125
|
+
435 0h399565z`,leftgroupunder:`M400000 262
|
|
126
|
+
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
|
|
127
|
+
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
128
|
+
-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
|
|
129
|
+
-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
|
|
130
|
+
-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
|
|
131
|
+
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
|
|
132
|
+
-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
|
|
133
|
+
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
134
|
+
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
135
|
+
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
136
|
+
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
|
|
137
|
+
-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
|
|
138
|
+
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
|
|
139
|
+
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
140
|
+
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
|
|
141
|
+
-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
|
|
142
|
+
-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
|
|
143
|
+
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Yb(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:Yb(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:Yb(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:Yb(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
144
|
+
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
145
|
+
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
|
|
146
|
+
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Yb(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
|
|
147
|
+
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
|
|
148
|
+
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
149
|
+
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
|
|
150
|
+
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
151
|
+
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
|
|
152
|
+
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
153
|
+
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
|
|
154
|
+
-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
|
|
155
|
+
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
156
|
+
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
|
|
157
|
+
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
|
|
158
|
+
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
159
|
+
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
160
|
+
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
|
|
161
|
+
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
162
|
+
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
|
|
163
|
+
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
|
|
164
|
+
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
165
|
+
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
166
|
+
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
|
|
167
|
+
-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
|
|
168
|
+
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
|
|
169
|
+
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
|
|
170
|
+
-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
|
|
171
|
+
-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
|
|
172
|
+
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
173
|
+
-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
|
|
174
|
+
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
|
|
175
|
+
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
|
|
176
|
+
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
177
|
+
-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
|
|
178
|
+
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
|
|
179
|
+
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
|
|
180
|
+
-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
|
|
181
|
+
-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
|
|
182
|
+
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
|
|
183
|
+
-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
|
|
184
|
+
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
|
|
185
|
+
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
|
|
186
|
+
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
|
|
187
|
+
-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
|
|
188
|
+
-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
|
|
189
|
+
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
|
|
190
|
+
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
|
|
191
|
+
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
192
|
+
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
|
|
193
|
+
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
|
|
194
|
+
-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
|
|
195
|
+
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Yb(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:Yb(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:Yb(`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
|
|
196
|
+
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
197
|
+
-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
|
|
198
|
+
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
199
|
+
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
|
|
200
|
+
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
201
|
+
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
202
|
+
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
203
|
+
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
|
|
204
|
+
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
|
|
205
|
+
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
|
|
206
|
+
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
207
|
+
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
208
|
+
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
|
|
209
|
+
-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
|
|
210
|
+
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
|
|
211
|
+
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
212
|
+
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
213
|
+
-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
|
|
214
|
+
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
215
|
+
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
|
|
216
|
+
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
|
|
217
|
+
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
218
|
+
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
219
|
+
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
220
|
+
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
221
|
+
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
222
|
+
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
223
|
+
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
224
|
+
-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
|
|
225
|
+
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
226
|
+
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
|
|
227
|
+
-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
|
|
228
|
+
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
229
|
+
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
230
|
+
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
|
|
231
|
+
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
|
|
232
|
+
-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
|
|
233
|
+
-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
|
|
234
|
+
-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,
|
|
235
|
+
-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,
|
|
236
|
+
-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,
|
|
237
|
+
-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,
|
|
238
|
+
-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
|
|
239
|
+
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
240
|
+
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
|
|
241
|
+
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
|
|
242
|
+
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
|
|
243
|
+
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
|
|
244
|
+
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
245
|
+
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
246
|
+
-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
|
|
247
|
+
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
|
|
248
|
+
-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
|
|
249
|
+
-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
|
|
250
|
+
-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
|
|
251
|
+
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
252
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
253
|
+
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
|
|
254
|
+
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
255
|
+
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
256
|
+
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
257
|
+
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,
|
|
258
|
+
-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
|
|
259
|
+
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
|
|
260
|
+
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
|
|
261
|
+
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,
|
|
262
|
+
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,
|
|
263
|
+
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
264
|
+
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
|
|
265
|
+
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,
|
|
266
|
+
-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
|
|
267
|
+
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
|
|
268
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},sx=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
|
|
269
|
+
H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
|
|
270
|
+
M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
271
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
272
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
273
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
274
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
|
|
275
|
+
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
276
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
277
|
+
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
|
|
278
|
+
MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
|
|
279
|
+
MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
|
|
280
|
+
M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
|
|
281
|
+
M347 1759 V0 h-84 V1759 v`+t+` 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
|
|
282
|
+
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,
|
|
283
|
+
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
284
|
+
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
|
|
285
|
+
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,
|
|
286
|
+
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
287
|
+
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
288
|
+
-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,
|
|
289
|
+
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
290
|
+
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
|
|
291
|
+
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
|
|
292
|
+
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
|
|
293
|
+
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
|
|
294
|
+
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
295
|
+
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
296
|
+
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function cx(e){return`toText`in e}var lx=class{constructor(e){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=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(cx(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},ux={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},dx={ex:!0,em:!0,mu:!0},fx=function(e){return typeof e!=`string`&&(e=e.unit),e in ux||e in dx||e===`ex`},px=function(e,t){var n;if(e.unit in ux)n=ux[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new N(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},P=function(e){return+e.toFixed(4)+`em`},mx=function(e){return e.filter(e=>e).join(` `)},hx=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=hb(n)+`:`+r+`;`)}return t},gx=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},_x=function(e){var t=document.createElement(e);t.className=mx(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},vx=/[\s"'>/=\x00-\x1f]/,yx=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+vb(mx(this.classes))+`"`);var n=hx(this.style);n&&(t+=` style="`+vb(n)+`"`);for(var r of Object.keys(this.attributes)){if(vx.test(r))throw new N(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+vb(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},bx=class{constructor(e,t,n,r){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,gx.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return _x.call(this,`span`)}toMarkup(){return yx.call(this,`span`)}},xx=class{constructor(e,t,n,r){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,gx.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return _x.call(this,`a`)}toMarkup(){return yx.call(this,`a`)}},Sx=class{constructor(e,t,n){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=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+vb(this.src)+`"`+(` alt="`+vb(this.alt)+`"`),t=hx(this.style);return t&&(e+=` style="`+vb(t)+`"`),e+=`'/>`,e}},Cx={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},wx=class{constructor(e,t,n,r,i,a,o,s){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=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=Kb(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=Cx[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=P(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=mx(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=vb(mx(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+P(this.italic)+`;`),n+=hx(this.style),n&&(e=!0,t+=` style="`+vb(n)+`"`);var r=vb(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},Tx=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+vb(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},Ex=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,ox[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+vb(this.alternate)+`"/>`:`<path d="`+vb(ox[this.pathName])+`"/>`}},Dx=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+vb(this.attributes[t])+`"`;return e+=`/>`,e}};function Ox(e){if(e instanceof wx)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function kx(e){if(e instanceof bx)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var Ax=e=>e instanceof bx||e instanceof xx||e instanceof lx,jx={"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]}},Mx={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]},Nx={Å:`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 Px(e,t){jx[e]=t}function Fx(e,t,n){if(!jx[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=jx[t][r];if(!i&&e[0]in Nx&&(r=Nx[e[0]].charCodeAt(0),i=jx[t][r]),!i&&n===`text`&&Jb(r)&&(i=jx[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Ix={};function Lx(e){var t=e>=5?0:e>=3?1:2;if(!Ix[t]){var n=Ix[t]={cssEmPerMu:Mx.quad[t]/18};for(var r in Mx)Mx.hasOwnProperty(r)&&(n[r]=Mx[r][t])}return Ix[t]}var Rx={math:{},text:{}};function F(e,t,n,r,i,a){Rx[e][i]={font:t,group:n,replace:r},a&&r&&(Rx[e][r]=Rx[e][i])}var I=`math`,L=`text`,R=`main`,z=`ams`,zx=`accent-token`,Bx=`bin`,Vx=`close`,Hx=`inner`,Ux=`mathord`,Wx=`op-token`,Gx=`open`,Kx=`punct`,B=`rel`,qx=`spacing`,V=`textord`;F(I,R,B,`≡`,`\\equiv`,!0),F(I,R,B,`≺`,`\\prec`,!0),F(I,R,B,`≻`,`\\succ`,!0),F(I,R,B,`∼`,`\\sim`,!0),F(I,R,B,`⊥`,`\\perp`),F(I,R,B,`⪯`,`\\preceq`,!0),F(I,R,B,`⪰`,`\\succeq`,!0),F(I,R,B,`≃`,`\\simeq`,!0),F(I,R,B,`∣`,`\\mid`,!0),F(I,R,B,`≪`,`\\ll`,!0),F(I,R,B,`≫`,`\\gg`,!0),F(I,R,B,`≍`,`\\asymp`,!0),F(I,R,B,`∥`,`\\parallel`),F(I,R,B,`⋈`,`\\bowtie`,!0),F(I,R,B,`⌣`,`\\smile`,!0),F(I,R,B,`⊑`,`\\sqsubseteq`,!0),F(I,R,B,`⊒`,`\\sqsupseteq`,!0),F(I,R,B,`≐`,`\\doteq`,!0),F(I,R,B,`⌢`,`\\frown`,!0),F(I,R,B,`∋`,`\\ni`,!0),F(I,R,B,`∝`,`\\propto`,!0),F(I,R,B,`⊢`,`\\vdash`,!0),F(I,R,B,`⊣`,`\\dashv`,!0),F(I,R,B,`∋`,`\\owns`),F(I,R,Kx,`.`,`\\ldotp`),F(I,R,Kx,`⋅`,`\\cdotp`),F(I,R,Kx,`⋅`,`·`),F(L,R,V,`⋅`,`·`),F(I,R,V,`#`,`\\#`),F(L,R,V,`#`,`\\#`),F(I,R,V,`&`,`\\&`),F(L,R,V,`&`,`\\&`),F(I,R,V,`ℵ`,`\\aleph`,!0),F(I,R,V,`∀`,`\\forall`,!0),F(I,R,V,`ℏ`,`\\hbar`,!0),F(I,R,V,`∃`,`\\exists`,!0),F(I,R,V,`∇`,`\\nabla`,!0),F(I,R,V,`♭`,`\\flat`,!0),F(I,R,V,`ℓ`,`\\ell`,!0),F(I,R,V,`♮`,`\\natural`,!0),F(I,R,V,`♣`,`\\clubsuit`,!0),F(I,R,V,`℘`,`\\wp`,!0),F(I,R,V,`♯`,`\\sharp`,!0),F(I,R,V,`♢`,`\\diamondsuit`,!0),F(I,R,V,`ℜ`,`\\Re`,!0),F(I,R,V,`♡`,`\\heartsuit`,!0),F(I,R,V,`ℑ`,`\\Im`,!0),F(I,R,V,`♠`,`\\spadesuit`,!0),F(I,R,V,`§`,`\\S`,!0),F(L,R,V,`§`,`\\S`),F(I,R,V,`¶`,`\\P`,!0),F(L,R,V,`¶`,`\\P`),F(I,R,V,`†`,`\\dag`),F(L,R,V,`†`,`\\dag`),F(L,R,V,`†`,`\\textdagger`),F(I,R,V,`‡`,`\\ddag`),F(L,R,V,`‡`,`\\ddag`),F(L,R,V,`‡`,`\\textdaggerdbl`),F(I,R,Vx,`⎱`,`\\rmoustache`,!0),F(I,R,Gx,`⎰`,`\\lmoustache`,!0),F(I,R,Vx,`⟯`,`\\rgroup`,!0),F(I,R,Gx,`⟮`,`\\lgroup`,!0),F(I,R,Bx,`∓`,`\\mp`,!0),F(I,R,Bx,`⊖`,`\\ominus`,!0),F(I,R,Bx,`⊎`,`\\uplus`,!0),F(I,R,Bx,`⊓`,`\\sqcap`,!0),F(I,R,Bx,`∗`,`\\ast`),F(I,R,Bx,`⊔`,`\\sqcup`,!0),F(I,R,Bx,`◯`,`\\bigcirc`,!0),F(I,R,Bx,`∙`,`\\bullet`,!0),F(I,R,Bx,`‡`,`\\ddagger`),F(I,R,Bx,`≀`,`\\wr`,!0),F(I,R,Bx,`⨿`,`\\amalg`),F(I,R,Bx,`&`,`\\And`),F(I,R,B,`⟵`,`\\longleftarrow`,!0),F(I,R,B,`⇐`,`\\Leftarrow`,!0),F(I,R,B,`⟸`,`\\Longleftarrow`,!0),F(I,R,B,`⟶`,`\\longrightarrow`,!0),F(I,R,B,`⇒`,`\\Rightarrow`,!0),F(I,R,B,`⟹`,`\\Longrightarrow`,!0),F(I,R,B,`↔`,`\\leftrightarrow`,!0),F(I,R,B,`⟷`,`\\longleftrightarrow`,!0),F(I,R,B,`⇔`,`\\Leftrightarrow`,!0),F(I,R,B,`⟺`,`\\Longleftrightarrow`,!0),F(I,R,B,`↦`,`\\mapsto`,!0),F(I,R,B,`⟼`,`\\longmapsto`,!0),F(I,R,B,`↗`,`\\nearrow`,!0),F(I,R,B,`↩`,`\\hookleftarrow`,!0),F(I,R,B,`↪`,`\\hookrightarrow`,!0),F(I,R,B,`↘`,`\\searrow`,!0),F(I,R,B,`↼`,`\\leftharpoonup`,!0),F(I,R,B,`⇀`,`\\rightharpoonup`,!0),F(I,R,B,`↙`,`\\swarrow`,!0),F(I,R,B,`↽`,`\\leftharpoondown`,!0),F(I,R,B,`⇁`,`\\rightharpoondown`,!0),F(I,R,B,`↖`,`\\nwarrow`,!0),F(I,R,B,`⇌`,`\\rightleftharpoons`,!0),F(I,z,B,`≮`,`\\nless`,!0),F(I,z,B,``,`\\@nleqslant`),F(I,z,B,``,`\\@nleqq`),F(I,z,B,`⪇`,`\\lneq`,!0),F(I,z,B,`≨`,`\\lneqq`,!0),F(I,z,B,``,`\\@lvertneqq`),F(I,z,B,`⋦`,`\\lnsim`,!0),F(I,z,B,`⪉`,`\\lnapprox`,!0),F(I,z,B,`⊀`,`\\nprec`,!0),F(I,z,B,`⋠`,`\\npreceq`,!0),F(I,z,B,`⋨`,`\\precnsim`,!0),F(I,z,B,`⪹`,`\\precnapprox`,!0),F(I,z,B,`≁`,`\\nsim`,!0),F(I,z,B,``,`\\@nshortmid`),F(I,z,B,`∤`,`\\nmid`,!0),F(I,z,B,`⊬`,`\\nvdash`,!0),F(I,z,B,`⊭`,`\\nvDash`,!0),F(I,z,B,`⋪`,`\\ntriangleleft`),F(I,z,B,`⋬`,`\\ntrianglelefteq`,!0),F(I,z,B,`⊊`,`\\subsetneq`,!0),F(I,z,B,``,`\\@varsubsetneq`),F(I,z,B,`⫋`,`\\subsetneqq`,!0),F(I,z,B,``,`\\@varsubsetneqq`),F(I,z,B,`≯`,`\\ngtr`,!0),F(I,z,B,``,`\\@ngeqslant`),F(I,z,B,``,`\\@ngeqq`),F(I,z,B,`⪈`,`\\gneq`,!0),F(I,z,B,`≩`,`\\gneqq`,!0),F(I,z,B,``,`\\@gvertneqq`),F(I,z,B,`⋧`,`\\gnsim`,!0),F(I,z,B,`⪊`,`\\gnapprox`,!0),F(I,z,B,`⊁`,`\\nsucc`,!0),F(I,z,B,`⋡`,`\\nsucceq`,!0),F(I,z,B,`⋩`,`\\succnsim`,!0),F(I,z,B,`⪺`,`\\succnapprox`,!0),F(I,z,B,`≆`,`\\ncong`,!0),F(I,z,B,``,`\\@nshortparallel`),F(I,z,B,`∦`,`\\nparallel`,!0),F(I,z,B,`⊯`,`\\nVDash`,!0),F(I,z,B,`⋫`,`\\ntriangleright`),F(I,z,B,`⋭`,`\\ntrianglerighteq`,!0),F(I,z,B,``,`\\@nsupseteqq`),F(I,z,B,`⊋`,`\\supsetneq`,!0),F(I,z,B,``,`\\@varsupsetneq`),F(I,z,B,`⫌`,`\\supsetneqq`,!0),F(I,z,B,``,`\\@varsupsetneqq`),F(I,z,B,`⊮`,`\\nVdash`,!0),F(I,z,B,`⪵`,`\\precneqq`,!0),F(I,z,B,`⪶`,`\\succneqq`,!0),F(I,z,B,``,`\\@nsubseteqq`),F(I,z,Bx,`⊴`,`\\unlhd`),F(I,z,Bx,`⊵`,`\\unrhd`),F(I,z,B,`↚`,`\\nleftarrow`,!0),F(I,z,B,`↛`,`\\nrightarrow`,!0),F(I,z,B,`⇍`,`\\nLeftarrow`,!0),F(I,z,B,`⇏`,`\\nRightarrow`,!0),F(I,z,B,`↮`,`\\nleftrightarrow`,!0),F(I,z,B,`⇎`,`\\nLeftrightarrow`,!0),F(I,z,B,`△`,`\\vartriangle`),F(I,z,V,`ℏ`,`\\hslash`),F(I,z,V,`▽`,`\\triangledown`),F(I,z,V,`◊`,`\\lozenge`),F(I,z,V,`Ⓢ`,`\\circledS`),F(I,z,V,`®`,`\\circledR`),F(L,z,V,`®`,`\\circledR`),F(I,z,V,`∡`,`\\measuredangle`,!0),F(I,z,V,`∄`,`\\nexists`),F(I,z,V,`℧`,`\\mho`),F(I,z,V,`Ⅎ`,`\\Finv`,!0),F(I,z,V,`⅁`,`\\Game`,!0),F(I,z,V,`‵`,`\\backprime`),F(I,z,V,`▲`,`\\blacktriangle`),F(I,z,V,`▼`,`\\blacktriangledown`),F(I,z,V,`■`,`\\blacksquare`),F(I,z,V,`⧫`,`\\blacklozenge`),F(I,z,V,`★`,`\\bigstar`),F(I,z,V,`∢`,`\\sphericalangle`,!0),F(I,z,V,`∁`,`\\complement`,!0),F(I,z,V,`ð`,`\\eth`,!0),F(L,R,V,`ð`,`ð`),F(I,z,V,`╱`,`\\diagup`),F(I,z,V,`╲`,`\\diagdown`),F(I,z,V,`□`,`\\square`),F(I,z,V,`□`,`\\Box`),F(I,z,V,`◊`,`\\Diamond`),F(I,z,V,`¥`,`\\yen`,!0),F(L,z,V,`¥`,`\\yen`,!0),F(I,z,V,`✓`,`\\checkmark`,!0),F(L,z,V,`✓`,`\\checkmark`),F(I,z,V,`ℶ`,`\\beth`,!0),F(I,z,V,`ℸ`,`\\daleth`,!0),F(I,z,V,`ℷ`,`\\gimel`,!0),F(I,z,V,`ϝ`,`\\digamma`,!0),F(I,z,V,`ϰ`,`\\varkappa`),F(I,z,Gx,`┌`,`\\@ulcorner`,!0),F(I,z,Vx,`┐`,`\\@urcorner`,!0),F(I,z,Gx,`└`,`\\@llcorner`,!0),F(I,z,Vx,`┘`,`\\@lrcorner`,!0),F(I,z,B,`≦`,`\\leqq`,!0),F(I,z,B,`⩽`,`\\leqslant`,!0),F(I,z,B,`⪕`,`\\eqslantless`,!0),F(I,z,B,`≲`,`\\lesssim`,!0),F(I,z,B,`⪅`,`\\lessapprox`,!0),F(I,z,B,`≊`,`\\approxeq`,!0),F(I,z,Bx,`⋖`,`\\lessdot`),F(I,z,B,`⋘`,`\\lll`,!0),F(I,z,B,`≶`,`\\lessgtr`,!0),F(I,z,B,`⋚`,`\\lesseqgtr`,!0),F(I,z,B,`⪋`,`\\lesseqqgtr`,!0),F(I,z,B,`≑`,`\\doteqdot`),F(I,z,B,`≓`,`\\risingdotseq`,!0),F(I,z,B,`≒`,`\\fallingdotseq`,!0),F(I,z,B,`∽`,`\\backsim`,!0),F(I,z,B,`⋍`,`\\backsimeq`,!0),F(I,z,B,`⫅`,`\\subseteqq`,!0),F(I,z,B,`⋐`,`\\Subset`,!0),F(I,z,B,`⊏`,`\\sqsubset`,!0),F(I,z,B,`≼`,`\\preccurlyeq`,!0),F(I,z,B,`⋞`,`\\curlyeqprec`,!0),F(I,z,B,`≾`,`\\precsim`,!0),F(I,z,B,`⪷`,`\\precapprox`,!0),F(I,z,B,`⊲`,`\\vartriangleleft`),F(I,z,B,`⊴`,`\\trianglelefteq`),F(I,z,B,`⊨`,`\\vDash`,!0),F(I,z,B,`⊪`,`\\Vvdash`,!0),F(I,z,B,`⌣`,`\\smallsmile`),F(I,z,B,`⌢`,`\\smallfrown`),F(I,z,B,`≏`,`\\bumpeq`,!0),F(I,z,B,`≎`,`\\Bumpeq`,!0),F(I,z,B,`≧`,`\\geqq`,!0),F(I,z,B,`⩾`,`\\geqslant`,!0),F(I,z,B,`⪖`,`\\eqslantgtr`,!0),F(I,z,B,`≳`,`\\gtrsim`,!0),F(I,z,B,`⪆`,`\\gtrapprox`,!0),F(I,z,Bx,`⋗`,`\\gtrdot`),F(I,z,B,`⋙`,`\\ggg`,!0),F(I,z,B,`≷`,`\\gtrless`,!0),F(I,z,B,`⋛`,`\\gtreqless`,!0),F(I,z,B,`⪌`,`\\gtreqqless`,!0),F(I,z,B,`≖`,`\\eqcirc`,!0),F(I,z,B,`≗`,`\\circeq`,!0),F(I,z,B,`≜`,`\\triangleq`,!0),F(I,z,B,`∼`,`\\thicksim`),F(I,z,B,`≈`,`\\thickapprox`),F(I,z,B,`⫆`,`\\supseteqq`,!0),F(I,z,B,`⋑`,`\\Supset`,!0),F(I,z,B,`⊐`,`\\sqsupset`,!0),F(I,z,B,`≽`,`\\succcurlyeq`,!0),F(I,z,B,`⋟`,`\\curlyeqsucc`,!0),F(I,z,B,`≿`,`\\succsim`,!0),F(I,z,B,`⪸`,`\\succapprox`,!0),F(I,z,B,`⊳`,`\\vartriangleright`),F(I,z,B,`⊵`,`\\trianglerighteq`),F(I,z,B,`⊩`,`\\Vdash`,!0),F(I,z,B,`∣`,`\\shortmid`),F(I,z,B,`∥`,`\\shortparallel`),F(I,z,B,`≬`,`\\between`,!0),F(I,z,B,`⋔`,`\\pitchfork`,!0),F(I,z,B,`∝`,`\\varpropto`),F(I,z,B,`◀`,`\\blacktriangleleft`),F(I,z,B,`∴`,`\\therefore`,!0),F(I,z,B,`∍`,`\\backepsilon`),F(I,z,B,`▶`,`\\blacktriangleright`),F(I,z,B,`∵`,`\\because`,!0),F(I,z,B,`⋘`,`\\llless`),F(I,z,B,`⋙`,`\\gggtr`),F(I,z,Bx,`⊲`,`\\lhd`),F(I,z,Bx,`⊳`,`\\rhd`),F(I,z,B,`≂`,`\\eqsim`,!0),F(I,R,B,`⋈`,`\\Join`),F(I,z,B,`≑`,`\\Doteq`,!0),F(I,z,Bx,`∔`,`\\dotplus`,!0),F(I,z,Bx,`∖`,`\\smallsetminus`),F(I,z,Bx,`⋒`,`\\Cap`,!0),F(I,z,Bx,`⋓`,`\\Cup`,!0),F(I,z,Bx,`⩞`,`\\doublebarwedge`,!0),F(I,z,Bx,`⊟`,`\\boxminus`,!0),F(I,z,Bx,`⊞`,`\\boxplus`,!0),F(I,z,Bx,`⋇`,`\\divideontimes`,!0),F(I,z,Bx,`⋉`,`\\ltimes`,!0),F(I,z,Bx,`⋊`,`\\rtimes`,!0),F(I,z,Bx,`⋋`,`\\leftthreetimes`,!0),F(I,z,Bx,`⋌`,`\\rightthreetimes`,!0),F(I,z,Bx,`⋏`,`\\curlywedge`,!0),F(I,z,Bx,`⋎`,`\\curlyvee`,!0),F(I,z,Bx,`⊝`,`\\circleddash`,!0),F(I,z,Bx,`⊛`,`\\circledast`,!0),F(I,z,Bx,`⋅`,`\\centerdot`),F(I,z,Bx,`⊺`,`\\intercal`,!0),F(I,z,Bx,`⋒`,`\\doublecap`),F(I,z,Bx,`⋓`,`\\doublecup`),F(I,z,Bx,`⊠`,`\\boxtimes`,!0),F(I,z,B,`⇢`,`\\dashrightarrow`,!0),F(I,z,B,`⇠`,`\\dashleftarrow`,!0),F(I,z,B,`⇇`,`\\leftleftarrows`,!0),F(I,z,B,`⇆`,`\\leftrightarrows`,!0),F(I,z,B,`⇚`,`\\Lleftarrow`,!0),F(I,z,B,`↞`,`\\twoheadleftarrow`,!0),F(I,z,B,`↢`,`\\leftarrowtail`,!0),F(I,z,B,`↫`,`\\looparrowleft`,!0),F(I,z,B,`⇋`,`\\leftrightharpoons`,!0),F(I,z,B,`↶`,`\\curvearrowleft`,!0),F(I,z,B,`↺`,`\\circlearrowleft`,!0),F(I,z,B,`↰`,`\\Lsh`,!0),F(I,z,B,`⇈`,`\\upuparrows`,!0),F(I,z,B,`↿`,`\\upharpoonleft`,!0),F(I,z,B,`⇃`,`\\downharpoonleft`,!0),F(I,R,B,`⊶`,`\\origof`,!0),F(I,R,B,`⊷`,`\\imageof`,!0),F(I,z,B,`⊸`,`\\multimap`,!0),F(I,z,B,`↭`,`\\leftrightsquigarrow`,!0),F(I,z,B,`⇉`,`\\rightrightarrows`,!0),F(I,z,B,`⇄`,`\\rightleftarrows`,!0),F(I,z,B,`↠`,`\\twoheadrightarrow`,!0),F(I,z,B,`↣`,`\\rightarrowtail`,!0),F(I,z,B,`↬`,`\\looparrowright`,!0),F(I,z,B,`↷`,`\\curvearrowright`,!0),F(I,z,B,`↻`,`\\circlearrowright`,!0),F(I,z,B,`↱`,`\\Rsh`,!0),F(I,z,B,`⇊`,`\\downdownarrows`,!0),F(I,z,B,`↾`,`\\upharpoonright`,!0),F(I,z,B,`⇂`,`\\downharpoonright`,!0),F(I,z,B,`⇝`,`\\rightsquigarrow`,!0),F(I,z,B,`⇝`,`\\leadsto`),F(I,z,B,`⇛`,`\\Rrightarrow`,!0),F(I,z,B,`↾`,`\\restriction`),F(I,R,V,`‘`,"`"),F(I,R,V,`$`,`\\$`),F(L,R,V,`$`,`\\$`),F(L,R,V,`$`,`\\textdollar`),F(I,R,V,`%`,`\\%`),F(L,R,V,`%`,`\\%`),F(I,R,V,`_`,`\\_`),F(L,R,V,`_`,`\\_`),F(L,R,V,`_`,`\\textunderscore`),F(I,R,V,`∠`,`\\angle`,!0),F(I,R,V,`∞`,`\\infty`,!0),F(I,R,V,`′`,`\\prime`),F(I,R,V,`△`,`\\triangle`),F(I,R,V,`Γ`,`\\Gamma`,!0),F(I,R,V,`Δ`,`\\Delta`,!0),F(I,R,V,`Θ`,`\\Theta`,!0),F(I,R,V,`Λ`,`\\Lambda`,!0),F(I,R,V,`Ξ`,`\\Xi`,!0),F(I,R,V,`Π`,`\\Pi`,!0),F(I,R,V,`Σ`,`\\Sigma`,!0),F(I,R,V,`Υ`,`\\Upsilon`,!0),F(I,R,V,`Φ`,`\\Phi`,!0),F(I,R,V,`Ψ`,`\\Psi`,!0),F(I,R,V,`Ω`,`\\Omega`,!0),F(I,R,V,`A`,`Α`),F(I,R,V,`B`,`Β`),F(I,R,V,`E`,`Ε`),F(I,R,V,`Z`,`Ζ`),F(I,R,V,`H`,`Η`),F(I,R,V,`I`,`Ι`),F(I,R,V,`K`,`Κ`),F(I,R,V,`M`,`Μ`),F(I,R,V,`N`,`Ν`),F(I,R,V,`O`,`Ο`),F(I,R,V,`P`,`Ρ`),F(I,R,V,`T`,`Τ`),F(I,R,V,`X`,`Χ`),F(I,R,V,`¬`,`\\neg`,!0),F(I,R,V,`¬`,`\\lnot`),F(I,R,V,`⊤`,`\\top`),F(I,R,V,`⊥`,`\\bot`),F(I,R,V,`∅`,`\\emptyset`),F(I,z,V,`∅`,`\\varnothing`),F(I,R,Ux,`α`,`\\alpha`,!0),F(I,R,Ux,`β`,`\\beta`,!0),F(I,R,Ux,`γ`,`\\gamma`,!0),F(I,R,Ux,`δ`,`\\delta`,!0),F(I,R,Ux,`ϵ`,`\\epsilon`,!0),F(I,R,Ux,`ζ`,`\\zeta`,!0),F(I,R,Ux,`η`,`\\eta`,!0),F(I,R,Ux,`θ`,`\\theta`,!0),F(I,R,Ux,`ι`,`\\iota`,!0),F(I,R,Ux,`κ`,`\\kappa`,!0),F(I,R,Ux,`λ`,`\\lambda`,!0),F(I,R,Ux,`μ`,`\\mu`,!0),F(I,R,Ux,`ν`,`\\nu`,!0),F(I,R,Ux,`ξ`,`\\xi`,!0),F(I,R,Ux,`ο`,`\\omicron`,!0),F(I,R,Ux,`π`,`\\pi`,!0),F(I,R,Ux,`ρ`,`\\rho`,!0),F(I,R,Ux,`σ`,`\\sigma`,!0),F(I,R,Ux,`τ`,`\\tau`,!0),F(I,R,Ux,`υ`,`\\upsilon`,!0),F(I,R,Ux,`ϕ`,`\\phi`,!0),F(I,R,Ux,`χ`,`\\chi`,!0),F(I,R,Ux,`ψ`,`\\psi`,!0),F(I,R,Ux,`ω`,`\\omega`,!0),F(I,R,Ux,`ε`,`\\varepsilon`,!0),F(I,R,Ux,`ϑ`,`\\vartheta`,!0),F(I,R,Ux,`ϖ`,`\\varpi`,!0),F(I,R,Ux,`ϱ`,`\\varrho`,!0),F(I,R,Ux,`ς`,`\\varsigma`,!0),F(I,R,Ux,`φ`,`\\varphi`,!0),F(I,R,Bx,`∗`,`*`,!0),F(I,R,Bx,`+`,`+`),F(I,R,Bx,`−`,`-`,!0),F(I,R,Bx,`⋅`,`\\cdot`,!0),F(I,R,Bx,`∘`,`\\circ`,!0),F(I,R,Bx,`÷`,`\\div`,!0),F(I,R,Bx,`±`,`\\pm`,!0),F(I,R,Bx,`×`,`\\times`,!0),F(I,R,Bx,`∩`,`\\cap`,!0),F(I,R,Bx,`∪`,`\\cup`,!0),F(I,R,Bx,`∖`,`\\setminus`,!0),F(I,R,Bx,`∧`,`\\land`),F(I,R,Bx,`∨`,`\\lor`),F(I,R,Bx,`∧`,`\\wedge`,!0),F(I,R,Bx,`∨`,`\\vee`,!0),F(I,R,V,`√`,`\\surd`),F(I,R,Gx,`⟨`,`\\langle`,!0),F(I,R,Gx,`∣`,`\\lvert`),F(I,R,Gx,`∥`,`\\lVert`),F(I,R,Vx,`?`,`?`),F(I,R,Vx,`!`,`!`),F(I,R,Vx,`⟩`,`\\rangle`,!0),F(I,R,Vx,`∣`,`\\rvert`),F(I,R,Vx,`∥`,`\\rVert`),F(I,R,B,`=`,`=`),F(I,R,B,`:`,`:`),F(I,R,B,`≈`,`\\approx`,!0),F(I,R,B,`≅`,`\\cong`,!0),F(I,R,B,`≥`,`\\ge`),F(I,R,B,`≥`,`\\geq`,!0),F(I,R,B,`←`,`\\gets`),F(I,R,B,`>`,`\\gt`,!0),F(I,R,B,`∈`,`\\in`,!0),F(I,R,B,``,`\\@not`),F(I,R,B,`⊂`,`\\subset`,!0),F(I,R,B,`⊃`,`\\supset`,!0),F(I,R,B,`⊆`,`\\subseteq`,!0),F(I,R,B,`⊇`,`\\supseteq`,!0),F(I,z,B,`⊈`,`\\nsubseteq`,!0),F(I,z,B,`⊉`,`\\nsupseteq`,!0),F(I,R,B,`⊨`,`\\models`),F(I,R,B,`←`,`\\leftarrow`,!0),F(I,R,B,`≤`,`\\le`),F(I,R,B,`≤`,`\\leq`,!0),F(I,R,B,`<`,`\\lt`,!0),F(I,R,B,`→`,`\\rightarrow`,!0),F(I,R,B,`→`,`\\to`),F(I,z,B,`≱`,`\\ngeq`,!0),F(I,z,B,`≰`,`\\nleq`,!0),F(I,R,qx,`\xA0`,`\\ `),F(I,R,qx,`\xA0`,`\\space`),F(I,R,qx,`\xA0`,`\\nobreakspace`),F(L,R,qx,`\xA0`,`\\ `),F(L,R,qx,`\xA0`,` `),F(L,R,qx,`\xA0`,`\\space`),F(L,R,qx,`\xA0`,`\\nobreakspace`),F(I,R,qx,``,`\\nobreak`),F(I,R,qx,``,`\\allowbreak`),F(I,R,Kx,`,`,`,`),F(I,R,Kx,`;`,`;`),F(I,z,Bx,`⊼`,`\\barwedge`,!0),F(I,z,Bx,`⊻`,`\\veebar`,!0),F(I,R,Bx,`⊙`,`\\odot`,!0),F(I,R,Bx,`⊕`,`\\oplus`,!0),F(I,R,Bx,`⊗`,`\\otimes`,!0),F(I,R,V,`∂`,`\\partial`,!0),F(I,R,Bx,`⊘`,`\\oslash`,!0),F(I,z,Bx,`⊚`,`\\circledcirc`,!0),F(I,z,Bx,`⊡`,`\\boxdot`,!0),F(I,R,Bx,`△`,`\\bigtriangleup`),F(I,R,Bx,`▽`,`\\bigtriangledown`),F(I,R,Bx,`†`,`\\dagger`),F(I,R,Bx,`⋄`,`\\diamond`),F(I,R,Bx,`⋆`,`\\star`),F(I,R,Bx,`◃`,`\\triangleleft`),F(I,R,Bx,`▹`,`\\triangleright`),F(I,R,Gx,`{`,`\\{`),F(L,R,V,`{`,`\\{`),F(L,R,V,`{`,`\\textbraceleft`),F(I,R,Vx,`}`,`\\}`),F(L,R,V,`}`,`\\}`),F(L,R,V,`}`,`\\textbraceright`),F(I,R,Gx,`{`,`\\lbrace`),F(I,R,Vx,`}`,`\\rbrace`),F(I,R,Gx,`[`,`\\lbrack`,!0),F(L,R,V,`[`,`\\lbrack`,!0),F(I,R,Vx,`]`,`\\rbrack`,!0),F(L,R,V,`]`,`\\rbrack`,!0),F(I,R,Gx,`(`,`\\lparen`,!0),F(I,R,Vx,`)`,`\\rparen`,!0),F(L,R,V,`<`,`\\textless`,!0),F(L,R,V,`>`,`\\textgreater`,!0),F(I,R,Gx,`⌊`,`\\lfloor`,!0),F(I,R,Vx,`⌋`,`\\rfloor`,!0),F(I,R,Gx,`⌈`,`\\lceil`,!0),F(I,R,Vx,`⌉`,`\\rceil`,!0),F(I,R,V,`\\`,`\\backslash`),F(I,R,V,`∣`,`|`),F(I,R,V,`∣`,`\\vert`),F(L,R,V,`|`,`\\textbar`,!0),F(I,R,V,`∥`,`\\|`),F(I,R,V,`∥`,`\\Vert`),F(L,R,V,`∥`,`\\textbardbl`),F(L,R,V,`~`,`\\textasciitilde`),F(L,R,V,`\\`,`\\textbackslash`),F(L,R,V,`^`,`\\textasciicircum`),F(I,R,B,`↑`,`\\uparrow`,!0),F(I,R,B,`⇑`,`\\Uparrow`,!0),F(I,R,B,`↓`,`\\downarrow`,!0),F(I,R,B,`⇓`,`\\Downarrow`,!0),F(I,R,B,`↕`,`\\updownarrow`,!0),F(I,R,B,`⇕`,`\\Updownarrow`,!0),F(I,R,Wx,`∐`,`\\coprod`),F(I,R,Wx,`⋁`,`\\bigvee`),F(I,R,Wx,`⋀`,`\\bigwedge`),F(I,R,Wx,`⨄`,`\\biguplus`),F(I,R,Wx,`⋂`,`\\bigcap`),F(I,R,Wx,`⋃`,`\\bigcup`),F(I,R,Wx,`∫`,`\\int`),F(I,R,Wx,`∫`,`\\intop`),F(I,R,Wx,`∬`,`\\iint`),F(I,R,Wx,`∭`,`\\iiint`),F(I,R,Wx,`∏`,`\\prod`),F(I,R,Wx,`∑`,`\\sum`),F(I,R,Wx,`⨂`,`\\bigotimes`),F(I,R,Wx,`⨁`,`\\bigoplus`),F(I,R,Wx,`⨀`,`\\bigodot`),F(I,R,Wx,`∮`,`\\oint`),F(I,R,Wx,`∯`,`\\oiint`),F(I,R,Wx,`∰`,`\\oiiint`),F(I,R,Wx,`⨆`,`\\bigsqcup`),F(I,R,Wx,`∫`,`\\smallint`),F(L,R,Hx,`…`,`\\textellipsis`),F(I,R,Hx,`…`,`\\mathellipsis`),F(L,R,Hx,`…`,`\\ldots`,!0),F(I,R,Hx,`…`,`\\ldots`,!0),F(I,R,Hx,`⋯`,`\\@cdots`,!0),F(I,R,Hx,`⋱`,`\\ddots`,!0),F(I,R,V,`⋮`,`\\varvdots`),F(L,R,V,`⋮`,`\\varvdots`),F(I,R,zx,`ˊ`,`\\acute`),F(I,R,zx,`ˋ`,`\\grave`),F(I,R,zx,`¨`,`\\ddot`),F(I,R,zx,`~`,`\\tilde`),F(I,R,zx,`ˉ`,`\\bar`),F(I,R,zx,`˘`,`\\breve`),F(I,R,zx,`ˇ`,`\\check`),F(I,R,zx,`^`,`\\hat`),F(I,R,zx,`⃗`,`\\vec`),F(I,R,zx,`˙`,`\\dot`),F(I,R,zx,`˚`,`\\mathring`),F(I,R,Ux,``,`\\@imath`),F(I,R,Ux,``,`\\@jmath`),F(I,R,V,`ı`,`ı`),F(I,R,V,`ȷ`,`ȷ`),F(L,R,V,`ı`,`\\i`,!0),F(L,R,V,`ȷ`,`\\j`,!0),F(L,R,V,`ß`,`\\ss`,!0),F(L,R,V,`æ`,`\\ae`,!0),F(L,R,V,`œ`,`\\oe`,!0),F(L,R,V,`ø`,`\\o`,!0),F(L,R,V,`Æ`,`\\AE`,!0),F(L,R,V,`Œ`,`\\OE`,!0),F(L,R,V,`Ø`,`\\O`,!0),F(L,R,zx,`ˊ`,`\\'`),F(L,R,zx,`ˋ`,"\\`"),F(L,R,zx,`ˆ`,`\\^`),F(L,R,zx,`˜`,`\\~`),F(L,R,zx,`ˉ`,`\\=`),F(L,R,zx,`˘`,`\\u`),F(L,R,zx,`˙`,`\\.`),F(L,R,zx,`¸`,`\\c`),F(L,R,zx,`˚`,`\\r`),F(L,R,zx,`ˇ`,`\\v`),F(L,R,zx,`¨`,`\\"`),F(L,R,zx,`˝`,`\\H`),F(L,R,zx,`◯`,`\\textcircled`);var Jx={"--":!0,"---":!0,"``":!0,"''":!0};F(L,R,V,`–`,`--`,!0),F(L,R,V,`–`,`\\textendash`),F(L,R,V,`—`,`---`,!0),F(L,R,V,`—`,`\\textemdash`),F(L,R,V,`‘`,"`",!0),F(L,R,V,`‘`,`\\textquoteleft`),F(L,R,V,`’`,`'`,!0),F(L,R,V,`’`,`\\textquoteright`),F(L,R,V,`“`,"``",!0),F(L,R,V,`“`,`\\textquotedblleft`),F(L,R,V,`”`,`''`,!0),F(L,R,V,`”`,`\\textquotedblright`),F(I,R,V,`°`,`\\degree`,!0),F(L,R,V,`°`,`\\degree`),F(L,R,V,`°`,`\\textdegree`,!0),F(I,R,V,`£`,`\\pounds`),F(I,R,V,`£`,`\\mathsterling`,!0),F(L,R,V,`£`,`\\pounds`),F(L,R,V,`£`,`\\textsterling`,!0),F(I,z,V,`✠`,`\\maltese`),F(L,z,V,`✠`,`\\maltese`);for(var Yx=`0123456789/@."`,Xx=0;Xx<Yx.length;Xx++){var Zx=Yx.charAt(Xx);F(I,R,V,Zx,Zx)}for(var Qx=`0123456789!@*()-=+";:?/.,`,$x=0;$x<Qx.length;$x++){var eS=Qx.charAt($x);F(L,R,V,eS,eS)}for(var tS=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,nS=0;nS<tS.length;nS++){var rS=tS.charAt(nS);F(I,R,Ux,rS,rS),F(L,R,V,rS,rS)}F(I,z,V,`C`,`ℂ`),F(L,z,V,`C`,`ℂ`),F(I,z,V,`H`,`ℍ`),F(L,z,V,`H`,`ℍ`),F(I,z,V,`N`,`ℕ`),F(L,z,V,`N`,`ℕ`),F(I,z,V,`P`,`ℙ`),F(L,z,V,`P`,`ℙ`),F(I,z,V,`Q`,`ℚ`),F(L,z,V,`Q`,`ℚ`),F(I,z,V,`R`,`ℝ`),F(L,z,V,`R`,`ℝ`),F(I,z,V,`Z`,`ℤ`),F(L,z,V,`Z`,`ℤ`),F(I,R,Ux,`h`,`ℎ`),F(L,R,Ux,`h`,`ℎ`);for(var iS,aS=0;aS<tS.length;aS++){var oS=tS.charAt(aS);iS=String.fromCharCode(55349,56320+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),iS=String.fromCharCode(55349,56372+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),iS=String.fromCharCode(55349,56424+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),iS=String.fromCharCode(55349,56580+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),iS=String.fromCharCode(55349,56684+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),iS=String.fromCharCode(55349,56736+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),iS=String.fromCharCode(55349,56788+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),iS=String.fromCharCode(55349,56840+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),iS=String.fromCharCode(55349,56944+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),aS<26&&(iS=String.fromCharCode(55349,56632+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS),iS=String.fromCharCode(55349,56476+aS),F(I,R,Ux,oS,iS),F(L,R,V,oS,iS))}iS=String.fromCharCode(55349,56668),F(I,R,Ux,`k`,iS),F(L,R,V,`k`,iS);for(var sS=0;sS<10;sS++){var cS=sS.toString();iS=String.fromCharCode(55349,57294+sS),F(I,R,Ux,cS,iS),F(L,R,V,cS,iS),iS=String.fromCharCode(55349,57314+sS),F(I,R,Ux,cS,iS),F(L,R,V,cS,iS),iS=String.fromCharCode(55349,57324+sS),F(I,R,Ux,cS,iS),F(L,R,V,cS,iS),iS=String.fromCharCode(55349,57334+sS),F(I,R,Ux,cS,iS),F(L,R,V,cS,iS)}for(var lS=`ÐÞþ`,uS=0;uS<lS.length;uS++){var dS=lS.charAt(uS);F(I,R,Ux,dS,dS),F(L,R,V,dS,dS)}var fS={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},pS={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},mS={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},hS={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},gS={mathClass:``,textClass:``,font:``},_S={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},vS={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},yS={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},bS={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},xS={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},SS={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},CS={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},wS=[fS,fS,pS,pS,mS,mS,hS,gS,gS,gS,_S,_S,vS,vS,yS,yS,bS,bS,xS,xS,SS,SS,gS,gS,CS,CS],TS=[fS,gS,bS,xS,CS],ES=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return wS[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return TS[Math.floor((r-120782)/10)];if(r===120485||r===120486)return wS[0];if(120486<r&&r<120782)return gS;throw new N(`Unsupported character: `+e)},DS=function(e,t,n){if(Rx[n][e]){var r=Rx[n][e].replace;r&&(e=r)}return{value:e,metrics:Fx(e,t,n)}},OS=function(e,t,n,r,i){var a=DS(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new wx(e,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new wx(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();l&&(s.style.color=l)}return s},kS=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&DS(e,`Main-Bold`,t).metrics?OS(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||Rx[t][e].font===`main`?OS(e,`Main-Regular`,t,n,r):OS(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},AS=function(e,t,n){return n!==`textord`&&DS(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},jS=function(e,t,n){var r=e.mode,i=e.text,a=[`mord`],{font:o,fontFamily:s,fontWeight:c,fontShape:l}=t,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=ES(i);f=m.font,p=m[r+`Class`]}if(f)return OS(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=AS(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=WS[o].fontName,g=[o]):(h=US(s,c,l),g=[s,c,l]);if(DS(i,h,r).metrics)return OS(i,h,r,t,a.concat(g));if(Jx.hasOwnProperty(i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(OS(i[y],h,r,t,a.concat(g)));return RS(v)}}if(n===`mathord`)return OS(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=Rx[r][i]&&Rx[r][i].font;if(b===`ams`)return OS(i,US(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return OS(i,US(`textrm`,c,l),r,t,a.concat(c,l));var x=US(b,c,l);return OS(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},MS=(e,t)=>{if(mx(e.classes)!==mx(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 r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},NS=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof wx&&r instanceof wx&&MS(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},PS=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},H=function(e,t,n,r){var i=new bx(e,t,n,r);return PS(i),i},FS=(e,t,n,r)=>new bx(e,t,n,r),IS=function(e,t,n){var r=H([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=P(r.height),r.maxFontSize=1,r},LS=function(e,t,n,r){var i=new xx(e,t,n,r);return PS(i),i},RS=function(e){var t=new lx(e);return PS(t),t},zS=function(e,t){return e instanceof lx?H([],[e],t):e},BS=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},VS=function(e,t){for(var{children:n,depth:r}=BS(e),i=0,a=0;a<n.length;a++){var o=n[a];if(o.type===`elem`){var s=o.elem;i=Math.max(i,s.maxFontSize,s.height)}}i+=2;var c=H([`pstrut`],[]);c.style.height=P(i);for(var l=[],u=r,d=r,f=r,p=0;p<n.length;p++){var m=n[p];if(m.type===`kern`)f+=m.size;else{var h=m.elem,g=m.wrapperClasses||[],_=m.wrapperStyle||{},v=H(g,[c,h],void 0,_);v.style.top=P(-i-f-h.depth),m.marginLeft&&(v.style.marginLeft=m.marginLeft),m.marginRight&&(v.style.marginRight=m.marginRight),l.push(v),f+=h.height+h.depth}u=Math.min(u,f),d=Math.max(d,f)}var y=H([`vlist`],l);y.style.height=P(d);var b;if(u<0){var x=H([`vlist`],[H([],[])]);x.style.height=P(-u),b=[H([`vlist-r`],[y,H([`vlist-s`],[new wx(``)])]),H([`vlist-r`],[x])]}else b=[H([`vlist-r`],[y])];var S=H([`vlist-t`],b);return b.length===2&&S.classes.push(`vlist-t2`),S.height=d,S.depth=-u,S},HS=(e,t)=>{var n=H([`mspace`],[],t),r=px(e,t);return n.style.marginRight=P(r),n},US=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},WS={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`}},GS={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},KS=function(e,t){var[n,r,i]=GS[e],a=FS([`overlay`],[new Tx([new Ex(n)],{width:P(r),height:P(i),style:`width:`+P(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return a.height=i,a.style.height=P(i),a.style.width=P(r),a},qS={number:3,unit:`mu`},JS={number:4,unit:`mu`},YS={number:5,unit:`mu`},XS={mord:{mop:qS,mbin:JS,mrel:YS,minner:qS},mop:{mord:qS,mop:qS,mrel:YS,minner:qS},mbin:{mord:JS,mop:JS,mopen:JS,minner:JS},mrel:{mord:YS,mop:YS,mopen:YS,minner:YS},mopen:{},mclose:{mop:qS,mbin:JS,mrel:YS,minner:qS},mpunct:{mord:qS,mop:qS,mrel:YS,mopen:qS,mclose:qS,mpunct:qS,minner:qS},minner:{mord:qS,mop:qS,mbin:JS,mrel:YS,mopen:qS,mpunct:qS,minner:qS}},ZS={mord:{mop:qS},mop:{mord:qS,mop:qS},mbin:{},mrel:{},mopen:{},mclose:{mop:qS},mpunct:{},minner:{mop:qS}},QS={},$S={},eC={};function tC(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},c=0;c<n.length;++c)QS[n[c]]=s;t&&(a&&($S[t]=a),o&&(eC[t]=o))}function nC(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;tC({type:t,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},htmlBuilder:n,mathmlBuilder:r})}var rC=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},iC=function(e){return e.type===`ordgroup`?e.body:[e]},aC=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),oC=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),sC={display:Wb.DISPLAY,text:Wb.TEXT,script:Wb.SCRIPT,scriptscript:Wb.SCRIPTSCRIPT},cC={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},lC=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=hC(e[a],t);if(o instanceof lx){var s=o.children;i.push(...s)}else i.push(o)}if(NS(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(sC[l.style]))}var u=H([r[0]||`leftmost`],[],t),d=H([r[1]||`rightmost`],[],t),f=n===`root`;return uC(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&oC.has(r)?t.classes[0]=`mord`:r===`mbin`&&aC.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),uC(i,(e,t)=>{var n=pC(t),r=pC(e),i=n&&r?e.hasClass(`mtight`)?ZS[n]?.[r]:XS[n]?.[r]:null;if(i)return HS(i,c)},{node:u},d,f),i},uC=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=dC(o);if(s){uC(s.children,t,n,null,i);continue}var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`newline`)&&(n.node=H([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},dC=function(e){return e instanceof lx||e instanceof xx||e instanceof bx&&e.hasClass(`enclosing`)?e:null},fC=function(e,t){var n=dC(e);if(n){var r=n.children;if(r.length){if(t===`right`)return fC(r[r.length-1],`right`);if(t===`left`)return fC(r[0],`left`)}}return e},pC=function(e,t){return e?(t&&(e=fC(e,t)),cC[e.classes[0]]||null):null},mC=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return H(t.concat(n))},hC=function(e,t,n){if(!e)return H();if($S[e.type]){var r=$S[e.type](e,t);if(n&&t.size!==n.size){r=H(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new N(`Got group of unknown type: '`+e.type+`'`)};function gC(e,t){var n=H([`base`],e,t),r=H([`strut`]);return r.style.height=P(n.height+n.depth),n.depth&&(r.style.verticalAlign=P(-n.depth)),n.children.unshift(r),n}function _C(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=lC(e,t,`root`),i;r.length===2&&r[1].hasClass(`tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(gC(o,t)),o=[])}else r[s].hasClass(`newline`)&&(o.pop(),o.length>0&&(a.push(gC(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(gC(o,t));var l;n?(l=gC(lC(n,t,!0),t),l.classes=[`tag`],a.push(l)):i&&a.push(i);var u=H([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=P(u.height+u.depth),u.depth&&(d.style.verticalAlign=P(-u.depth))}return u}function vC(e){return new lx(e)}var U=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=mx(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof yC&&this.children[n+1]instanceof yC){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof yC;)r+=this.children[++n].toText();e.appendChild(new yC(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=vb(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class ="`+vb(mx(this.classes))+`"`),e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},yC=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return vb(this.toText())}toText(){return this.text}},bC=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?` `:e>=-.05556&&e<=-.05555?` `:e>=-.1667&&e<=-.1666?` `:e>=-.2223&&e<=-.2222?` `:e>=-.2778&&e<=-.2777?` `:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,P(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+P(this.width)+`"/>`}toText(){return this.character?this.character:` `}},xC=new Set([`\\imath`,`\\jmath`]),SC=new Set([`mrow`,`mtable`]),CC=function(e,t,n){return Rx[t][e]&&Rx[t][e].replace&&e.charCodeAt(0)!==55349&&!(Jx.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=Rx[t][e].replace),new yC(e)},wC=function(e){return e.length===1?e[0]:new U(`mrow`,e)},TC={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`},EC=(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 r=e.mode,i=TC[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(xC.has(a))return null;if(Rx[r][a]){var o=Rx[r][a].replace;o&&(a=o)}var s=WS[n].fontName;return Fx(a,s,r)?WS[n].variant:null};function DC(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof yC&&t.text===`.`}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 yC&&n.text===`,`}return!1}var OC=function(e,t,n){if(e.length===1){var r=AC(e[0],t);return n&&r instanceof U&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=AC(e[o],t);if(s instanceof U&&a instanceof U){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}if(DC(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&DC(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||DC(a))){var c=s.children[0];c instanceof U&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof yC&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof yC&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},kC=function(e,t,n){return wC(OC(e,t,n))},AC=function(e,t){if(!e)return new U(`mrow`);if(eC[e.type])return eC[e.type](e,t);throw new N(`Got group of unknown type: '`+e.type+`'`)};function jC(e,t,n,r,i){var a=OC(e,n),o=a.length===1&&a[0]instanceof U&&SC.has(a[0].type)?a[0]:new U(`mrow`,a),s=new U(`annotation`,[new yC(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new U(`math`,[new U(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),H([i?`katex`:`katex-mathml`],[c])}var MC=[[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]],NC=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],PC=function(e,t){return t.size<2?e:MC[e-1][t.size-1]},FC=class e{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||e.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=NC[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 e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:PC(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:NC[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=PC(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=Lx(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};FC.BASESIZE=6;var IC=function(e){return new FC({style:e.displayMode?Wb.DISPLAY:Wb.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},LC=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=H(n,[e])}return e},RC=function(e,t,n){var r=IC(n),i;return n.output===`mathml`?jC(e,t,r,n.displayMode,!0):(i=n.output===`html`?H([`katex`],[_C(e,r)]):H([`katex`],[jC(e,t,r,n.displayMode,!1),_C(e,r)]),LC(i,n))},zC=function(e,t,n){return LC(H([`katex`],[_C(e,IC(n))]),n)},BC={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":`=`},VC=function(e){var t=new U(`mo`,[new yC(BC[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},HC={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]},UC=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),WC=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(UC.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:FS([],[new Tx([new Ex(o)],{width:`100%`,height:P(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=HC[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var[d,f,p]=u,m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
|
|
297
|
+
`+h+` children.`);for(var v=0;v<h;v++){var y=new Tx([new Ex(d[v])],{width:`400em`,height:P(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=FS([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=P(m),l.push(b)}return{span:H([`stretchy`],l,t),minWidth:f,height:m}}var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=P(a),i>0&&(r.style.minWidth=P(i)),r},GC=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=H([`stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new Dx({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new Dx({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=FS([],[new Tx(c,{width:`100%`,height:P(o)})],i)}return a.height=o,a.style.height=P(o),a},KC={bin:1,close:1,inner:1,open:1,punct:1,rel:1},qC={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function JC(e){return e in KC}function YC(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function XC(e){var t=ZC(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function ZC(e){return e&&(e.type===`atom`||qC.hasOwnProperty(e.type))?e:null}var QC=e=>{if(e instanceof wx)return e;if(Ax(e)&&e.children.length===1)return QC(e.children[0])},$C=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=YC(e.base,`accent`),n=r.base,e.base=n,i=kx(hC(e,t)),e.base=r):(r=YC(e,`accent`),n=r.base);var a=hC(n,t.havingCrampedStyle()),o=r.isShifty&&xb(n),s=0;o&&(s=QC(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=WC(r,t),u=VS({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+P(2*s)+`)`,marginLeft:P(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=KS(`vec`,t),f=GS.vec[1]):(d=jS({type:`textord`,mode:r.mode,text:r.label},t,`textord`),d=Ox(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=H([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=P(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=VS({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=H([`mord`,`accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},ew=(e,t)=>{var n=e.isStretchy?VC(e.label):new U(`mo`,[CC(e.label,e.mode)]),r=new U(`mover`,[AC(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},tw=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));tC({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=rC(t[0]),r=!tw.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:$C,mathmlBuilder:ew}),tC({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],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:$C,mathmlBuilder:ew}),tC({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=hC(e.base,t),r=WC(e,t),i=e.label===`\\utilde`?.12:0;return H([`mord`,`accentunder`],[VS({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=VC(e.label),r=new U(`munder`,[AC(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var nw=e=>{var t=new U(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};tC({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:r,funcName:i}=e;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=zS(hC(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=zS(hC(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=WC(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=VS({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=VS({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return H([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=VC(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=nw(AC(e.body,t));r=e.below?new U(`munderover`,[n,nw(AC(e.below,t)),i]):new U(`mover`,[n,i])}else e.below?r=new U(`munder`,[n,nw(AC(e.below,t))]):(r=nw(),r=new U(`mover`,[n,r]));return r}});function rw(e,t){var n=lC(e.body,t,!0);return H([e.mclass],n,t)}function iw(e,t){var n,r=OC(e.body,t);return e.mclass===`minner`?n=new U(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new U(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new U(`mo`,r),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}tC({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:iC(i),isCharacterBox:xb(i)}},htmlBuilder:rw,mathmlBuilder:iw});var aw=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`};tC({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:aw(t[0]),body:iC(t[1]),isCharacterBox:xb(t[1])}}}),tC({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:aw(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:iC(i)},c={type:`supsub`,mode:a.mode,base:s,sup:r===`\\underset`?null:a,sub:r===`\\underset`?a:null};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:xb(c)}},htmlBuilder:rw,mathmlBuilder:iw}),tC({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:aw(t[0]),body:iC(t[0])}},htmlBuilder(e,t){var n=lC(e.body,t,!0),r=H([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new U(`mstyle`,OC(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var ow={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},sw=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),cw=e=>e.type===`textord`&&e.text===`@`,lw=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function uw(e,t,n){var r=ow[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function dw(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 N(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=sw(),c=0;c<o.length;c++)if(!cw(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=XC(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l)){if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(lw(o[p],l)){f=!1,c=p;break}if(cw(o[p]))throw new N(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new N(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new N(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[uw(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=sw()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}tC({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=zS(hC(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=P(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new U(`mrow`,[AC(e.label,t)]);return n=new U(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new U(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),tC({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=zS(hC(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new U(`mrow`,[AC(e.fragment,t)])}}),tC({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=YC(t[0],`ordgroup`).body,i=``,a=0;a<r.length;a++){var o=YC(r[a],`textord`);i+=o.text}var s=parseInt(i),c;if(isNaN(s))throw new N(`\\@char has non-numeric argument `+i);if(s<0||s>=1114111)throw new N(`\\@char with invalid code point `+i);return s<=65535?c=String.fromCharCode(s):(s-=65536,c=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:c}}});var fw=(e,t)=>RS(lC(e.body,t.withColor(e.color),!1)),pw=(e,t)=>{var n=new U(`mstyle`,OC(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n};tC({type:`color`,names:[`\\textcolor`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`original`]},handler(e,t){var{parser:n}=e,r=YC(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:iC(i)}},htmlBuilder:fw,mathmlBuilder:pw}),tC({type:`color`,names:[`\\color`],props:{numArgs:1,allowedInText:!0,argTypes:[`color`]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=YC(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}},htmlBuilder:fw,mathmlBuilder:pw}),tC({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&YC(i,`size`).value}},htmlBuilder(e,t){var n=H([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=P(px(e.size,t)))),n},mathmlBuilder(e,t){var n=new U(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,P(px(e.size,t)))),n}});var mw={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},hw=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new N(`Expected a control sequence`,e);return t},gw=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},_w=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};tC({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(mw[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=mw[r.text]),YC(t.parseFunction(),`internal`);throw new N(`Invalid token after macro prefix`,r)}}),tC({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new N(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new N(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new N(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new N(`Expected a macro definition`);else s[a].push(r.text);var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===mw[n]),{type:`internal`,mode:t.mode}}}),tC({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=hw(t.gullet.popToken());return t.gullet.consumeSpaces(),_w(t,r,gw(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),tC({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=hw(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return _w(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var vw=function(e,t,n){var r=Fx(Rx.math[e]&&Rx.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},yw=function(e,t,n,r){var i=n.havingBaseStyle(t),a=H(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},bw=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=P(i),e.height-=i,e.depth+=i},xw=function(e,t,n,r,i,a){var o=yw(OS(e,`Main-Regular`,i,r),t,r,a);return n&&bw(o,r,t),o},Sw=function(e,t,n,r){return OS(e,`Size`+t+`-Regular`,n,r)},Cw=function(e,t,n,r,i,a){var o=Sw(e,t,i,r),s=yw(H([`delimsizing`,`size`+t],[o],r),Wb.TEXT,r,a);return n&&bw(s,r,Wb.TEXT),s},ww=function(e,t,n){return{type:`elem`,elem:H([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[H([],[OS(e,t,n)])])}},Tw=function(e,t,n){var r=jx[`Size4-Regular`][e.charCodeAt(0)]?jx[`Size4-Regular`][e.charCodeAt(0)][4]:jx[`Size1-Regular`][e.charCodeAt(0)][4],i=FS([],[new Tx([new Ex(`inner`,ax(e,Math.round(1e3*t)))],{width:P(r),height:P(t),style:`width:`+P(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=P(t),i.style.width=P(r),{type:`elem`,elem:i}},Ew=.008,Dw={type:`kern`,size:-1*Ew},Ow=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),kw=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),Aw=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):Ow.has(e)?(c=`∣`,u=`vert`,d=333):kw.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=vw(o,f,i),m=p.height+p.depth,h=vw(c,f,i),g=h.height+h.depth,_=vw(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=vw(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,ee=[];if(u.length>0){var te=C-m-v,E=Math.round(C*1e3),ne=sx(u,Math.round(te*1e3)),re=new Ex(u,ne),ie=P(d/1e3),ae=P(E/1e3),D=FS([],[new Tx([re],{width:ie,height:ae,viewBox:`0 0 `+d+` `+E})],r);D.height=E/1e3,D.style.width=ie,D.style.height=ae,ee.push({type:`elem`,elem:D})}else{if(ee.push(ww(l,f,i)),ee.push(Dw),s===null){var oe=C-m-v+2*Ew;ee.push(Tw(c,oe,r))}else{var se=(C-m-v-y)/2+2*Ew;ee.push(Tw(c,se,r)),ee.push(Dw),ee.push(ww(s,f,i)),ee.push(Dw),ee.push(Tw(c,se,r))}ee.push(Dw),ee.push(ww(o,f,i))}var O=r.havingBaseStyle(Wb.TEXT);return yw(H([`delimsizing`,`mult`],[VS({positionType:`bottom`,positionData:T,children:ee})],O),Wb.TEXT,r,a)},jw=80,Mw=.08,Nw=function(e,t,n,r,i){return FS([`hide-tail`],[new Tx([new Ex(e,ix(e,r,n))],{width:`400em`,height:P(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},Pw=function(e,t){var n=t.havingBaseSizing(),r=Ww(`\\surd`,e*n.sizeMultiplier,Hw,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+jw,e<1?i=1:e<1.4&&(i=.7),s=(1+a+Mw)/i,c=(1+a)/i,o=Nw(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+jw)*Rw[r.size],c=(Rw[r.size]+a)/i,s=(Rw[r.size]+a+Mw)/i,o=Nw(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+Mw,c=e+a,l=Math.floor(1e3*e+a)+jw,o=Nw(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=P(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},Fw=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),Iw=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),Lw=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),Rw=[0,1.2,1.8,2.4,3],zw=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),Fw.has(e)||Lw.has(e))return Cw(e,t,!1,n,r,i);if(Iw.has(e))return Aw(e,Rw[t],!1,n,r,i);throw new N(`Illegal delimiter: '`+e+`'`)},Bw=[{type:`small`,style:Wb.SCRIPTSCRIPT},{type:`small`,style:Wb.SCRIPT},{type:`small`,style:Wb.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],Vw=[{type:`small`,style:Wb.SCRIPTSCRIPT},{type:`small`,style:Wb.SCRIPT},{type:`small`,style:Wb.TEXT},{type:`stack`}],Hw=[{type:`small`,style:Wb.SCRIPTSCRIPT},{type:`small`,style:Wb.SCRIPT},{type:`small`,style:Wb.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],Uw=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},Ww=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=vw(e,Uw(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},Gw=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=Lw.has(e)?Bw:Fw.has(e)?Hw:Vw,s=Ww(e,t,o,r);return s.type===`small`?xw(e,s.style,n,r,i,a):s.type===`large`?Cw(e,s.size,n,r,i,a):Aw(e,t,n,r,i,a)},Kw=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return Gw(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},qw={"\\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}},Jw=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,.`.split(`,`));function Yw(e){return`isMiddle`in e}function Xw(e,t){var n=ZC(e);if(n&&Jw.has(n.text))return n;throw n?new N(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new N(`Invalid delimiter type '`+e.type+`'`,e)}tC({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=Xw(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:qw[e.funcName].size,mclass:qw[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?H([e.mclass]):zw(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(CC(e.delim,e.mode));var n=new U(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=P(Rw[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function Zw(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}tC({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 N(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:Xw(t[0],e).text,color:n}}}),tC({type:`leftright`,names:[`\\left`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Xw(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=YC(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{Zw(e);for(var n=lC(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];Yw(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?mC(t,[`mopen`]):Kw(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(Yw(u)){var d=u.isMiddle;n[l]=Kw(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=mC(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=Kw(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),H([`minner`],n,t)},mathmlBuilder:(e,t)=>{Zw(e);var n=OC(e.body,t);if(e.left!==`.`){var r=new U(`mo`,[CC(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new U(`mo`,[CC(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return wC(n)}}),tC({type:`middle`,names:[`\\middle`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Xw(t[0],e);if(!e.parser.leftrightDepth)throw new N(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=mC(t,[]):(n=zw(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new U(`mo`,[e.delim===`\\vert`||e.delim===`|`?CC(`|`,`text`):CC(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}});var Qw=(e,t)=>{var n=zS(hC(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=xb(e.body);if(r===`sout`)a=H([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=px({number:.6,unit:`pt`},t),l=px({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=P(d/2+c);var f=Math.floor(1e3*d*i);a=FS([`hide-tail`],[new Tx([new Ex(`phase`,nx(f))],{width:`400em`,height:P(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=P(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=GC(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=P(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=P(h),a.style.borderRightWidth=P(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=VS({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=VS({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?H([`mord`,`cancel-lap`],[g],t):H([`mord`],[g],t)},$w=(e,t)=>{var n,r=new U(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[AC(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+P(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r};tC({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=YC(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:Qw,mathmlBuilder:$w}),tC({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=YC(t[0],`color-token`).color,o=YC(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:Qw,mathmlBuilder:$w}),tC({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]}}}),tC({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:Qw,mathmlBuilder:$w}),tC({type:`enclose`,names:[`\\sout`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:Qw,mathmlBuilder:$w}),tC({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 eT={};function tT(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)eT[n[c]]=s;a&&($S[t]=a),o&&(eC[t]=o)}var nT={};function W(e,t){nT[e]=t}var rT=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},iT=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,rT.range(this,t))}};function aT(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 oT=e=>{if(!e.parser.settings.displayMode)throw new N(`{`+e.envName+`} can be used only in display mode.`)},sT=new Set([`gather`,`gather*`]);function cT(e){if(!e.includes(`ed`))return!e.includes(`*`)}function lT(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:c,singleRow:l,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new N(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new iT(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(aT(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new N(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(aT(e)),m=[],h.push(m),y()}else throw new N(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function uT(e){return e.slice(0,1)===`d`?`display`:`text`}var dT=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(Wb.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?px({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=hC(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=px(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var ee=_/2+t.fontMetrics().axisHeight,te=e.cols||[],E=[],ne,re,ie=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var ae=s[n],D=ae.pos-ee,oe=e.tags[n],se=void 0;se=oe===!0?H([`eqn-num`],[],t):oe===!1?H([],[],t):H([],lC(oe,t,!0),t),se.depth=ae.depth,se.height=ae.height,ie.push({type:`elem`,elem:se,shift:D})}for(r=0,re=0;r<o||re<te.length;++r,++re){for(var O=te[re],ce=!0;(k=O)?.type===`separator`;){var k;if(ce||(ne=H([`arraycolsep`],[]),ne.style.width=P(t.fontMetrics().doubleRuleSep),E.push(ne)),O.separator===`|`||O.separator===`:`){var A=O.separator===`|`?`solid`:`dashed`,le=H([`vertical-separator`],[],t);le.style.height=P(_),le.style.borderRightWidth=P(l),le.style.borderRightStyle=A,le.style.margin=`0 `+P(-l/2);var ue=_-ee;ue&&(le.style.verticalAlign=P(-ue)),E.push(le)}else throw new N(`Invalid separator type: `+O.separator);re++,O=te[re],ce=!1}if(!(r>=o)){var de=void 0;(r>0||e.hskipBeforeAndAfter)&&(de=O?.pregap??d,de!==0&&(ne=H([`arraycolsep`],[]),ne.style.width=P(de),E.push(ne)));var j=[];for(n=0;n<i;++n){var fe=s[n],pe=fe.cells[r];if(pe){var me=fe.pos-ee;pe.depth=fe.depth,pe.height=fe.height,j.push({type:`elem`,elem:pe,shift:me})}}var he=VS({positionType:`individualShift`,children:j}),ge=H([`col-align-`+(O?.align||`c`)],[he]);E.push(ge),(r<o-1||e.hskipBeforeAndAfter)&&(de=O?.postgap??d,de!==0&&(ne=H([`arraycolsep`],[]),ne.style.width=P(de),E.push(ne)))}}var _e=H([`mtable`],E);if(c.length>0){for(var ve=IS(`hline`,t,l),ye=IS(`hdashline`,t,l),be=[{type:`elem`,elem:_e,shift:0}];c.length>0;){var xe=c.pop(),Se=xe.pos-ee;xe.isDashed?be.push({type:`elem`,elem:ye,shift:Se}):be.push({type:`elem`,elem:ve,shift:Se})}_e=VS({positionType:`individualShift`,children:be})}if(ie.length===0)return H([`mord`],[_e],t);var Ce=H([`tag`],[VS({positionType:`individualShift`,children:ie})],t);return RS([_e,Ce])},fT={c:`center `,l:`left `,r:`right `},pT=function(e,t){for(var n=[],r=new U(`mtd`,[],[`mtr-glue`]),i=new U(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new U(`mtd`,[AC(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new U(`mtr`,s))}var l=new U(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,P(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=fT[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new U(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new U(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},mT=function(e,t){e.envName.includes(`ed`)||oT(e);var n=[],r=e.envName.includes(`at`)?`alignat`:`align`,i=e.envName===`split`,a=lT(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:cT(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},`display`),o=0,s=0,c={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var l=``,u=0;u<t[0].body.length;u++){var d=YC(t[0].body[u],`textord`);l+=d.text}o=Number(l),s=o*2}var f=!s;a.body.forEach(function(e){for(var t=1;t<e.length;t+=2)YC(YC(e[t],`styling`).body[0],`ordgroup`).body.unshift(c);if(f)s<e.length&&(s=e.length);else{var n=e.length/2;if(o<n)throw new N(`Too many math in a row: `+(`expected `+o+`, but got `+n),e[0])}});for(var p=0;p<s;++p){var m=`r`,h=0;p%2==1?m=`l`:p>0&&f&&(h=1),n[p]={type:`align`,align:m,pregap:h,postgap:0}}return a.colSeparationType=f?`align`:`alignat`,a};tT({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(ZC(t[0])?[t[0]]:YC(t[0],`ordgroup`).body).map(function(e){var t=XC(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new N(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return lT(e.parser,r,uT(e.envName))},htmlBuilder:dT,mathmlBuilder:pT}),tT({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`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new N(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=lT(e.parser,r,uT(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:dT,mathmlBuilder:pT}),tT({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=lT(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:dT,mathmlBuilder:pT}),tT({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(ZC(t[0])?[t[0]]:YC(t[0],`ordgroup`).body).map(function(e){var t=XC(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new N(`Unknown column alignment: `+t,e)});if(n.length>1)throw new N(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=lT(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new N(`{subarray} can contain only one column`);return i},htmlBuilder:dT,mathmlBuilder:pT}),tT({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=lT(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},uT(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:dT,mathmlBuilder:pT}),tT({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:mT,htmlBuilder:dT,mathmlBuilder:pT}),tT({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){sT.has(e.envName)&&oT(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:cT(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return lT(e.parser,t,`display`)},htmlBuilder:dT,mathmlBuilder:pT}),tT({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:mT,htmlBuilder:dT,mathmlBuilder:pT}),tT({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){oT(e);var t={autoTag:cT(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return lT(e.parser,t,`display`)},htmlBuilder:dT,mathmlBuilder:pT}),tT({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return oT(e),dw(e.parser)},htmlBuilder:dT,mathmlBuilder:pT}),W(`\\nonumber`,`\\gdef\\@eqnsw{0}`),W(`\\notag`,`\\nonumber`),tC({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new N(e.funcName+` valid only within array environment`)}});var hT=eT;tC({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new N(`Invalid environment name`,i);for(var a=``,o=0;o<i.body.length;++o)a+=YC(i.body[o],`textord`).text;if(r===`\\begin`){if(!hT.hasOwnProperty(a))throw new N(`No such environment: `+a,i);var s=hT[a],{args:c,optArgs:l}=n.parseArguments(`\\begin{`+a+`}`,s),u={mode:n.mode,envName:a,parser:n},d=s.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=YC(n.parseFunction(),`environment`);if(p.name!==a)throw new N(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var gT=(e,t)=>{var n=e.font,r=t.withFont(n);return hC(e.body,r)},_T=(e,t)=>{var n=e.font,r=t.withFont(n);return AC(e.body,r)},vT={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};tC({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:r}=e,i=rC(t[0]),a=r;return a in vT&&(a=vT[a]),{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:gT,mathmlBuilder:_T}),tC({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`mclass`,mode:n.mode,mclass:aw(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:xb(r)}}}),tC({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}},htmlBuilder:gT,mathmlBuilder:_T});var yT=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=hC(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=hC(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=px(e.barSize,t),u=IS(`frac-line`,t,d)):u=IS(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===Wb.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=VS({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=VS({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===Wb.DISPLAY.size?t.fontMetrics().delim1:n.size===Wb.SCRIPTSCRIPT.size?t.havingStyle(Wb.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?mC(t,[`mopen`]):Gw(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?H([]):e.rightDelim==null?mC(t,[`mclose`]):Gw(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return H([`mord`].concat(a.sizingClasses(t)),[x,H([`mfrac`],[g]),S],t)},bT=(e,t)=>{var n=new U(`mfrac`,[AC(e.numer,t),AC(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=px(e.barSize,t);n.setAttribute(`linethickness`,P(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new U(`mo`,[new yC(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new U(`mo`,[new yC(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return wC(i)}return n},xT=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;tC({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:r}=e,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),xT({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:yT,mathmlBuilder:bT}),tC({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var ST=[`display`,`text`,`script`,`scriptscript`],CT=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};tC({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=rC(t[0]),o=a.type===`atom`&&a.family===`open`?CT(a.text):null,s=rC(t[1]),c=s.type===`atom`&&s.family===`close`?CT(s.text):null,l=YC(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=YC(p.body[0],`textord`);f=ST[Number(m.text)]}}else p=YC(p,`textord`),f=ST[Number(p.text)];return xT({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),tC({type:`infix`,names:[`\\above`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:YC(t[0],`size`).value,token:i}}}),tC({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=YC(t[1],`infix`).size;if(!a)throw Error(`\\\\abovefrac expected size, but got `+String(a));var o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});var wT=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?hC(e.sup,t.havingStyle(n.sup()),t):hC(e.sub,t.havingStyle(n.sub()),t),i=YC(e.base,`horizBrace`)):i=YC(e,`horizBrace`);var a=hC(i.base,t.havingBaseStyle(Wb.DISPLAY)),o=WC(i,t),s=i.isOver?VS({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):VS({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=H([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?VS({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):VS({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return H([`minner`,i.isOver?`mover`:`munder`],[s],t)};tC({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:wT,mathmlBuilder:(e,t)=>{var n=VC(e.label);return new U(e.isOver?`mover`:`munder`,[AC(e.base,t),n])}}),tC({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=YC(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:iC(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=lC(e.body,t,!1);return LS(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=kC(e.body,t);return n instanceof U||(n=new U(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),tC({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=YC(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:iC(s)}}}),tC({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:iC(t[0])}},htmlBuilder(e,t){return RS(lC(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new U(`mrow`,OC(e.body,t.withFont(``)))}}),tC({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],props:{numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=YC(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,c={};switch(r){case`\\htmlClass`:c.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:c.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:c.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var l=a.split(`,`),u=0;u<l.length;u++){var d=l[u],f=d.indexOf(`=`);if(f<0)throw new N(`\\htmlData key/value '`+d+`' missing equals sign`);var p=d.slice(0,f),m=d.slice(f+1);c[`data-`+p.trim()]=m}s={command:`\\htmlData`,attributes:c};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(s)?{type:`html`,mode:n.mode,attributes:c,body:iC(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=lC(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=H(r,n,t);for(var a in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>kC(e.body,t)}),tC({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:iC(t[0]),mathml:iC(t[1])}},htmlBuilder:(e,t)=>RS(lC(e.html,t,!1)),mathmlBuilder:(e,t)=>kC(e.mathml,t)});var TT=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new N(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!fx(n))throw new N(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};tC({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=YC(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=TT(d);break;case`height`:a=TT(d);break;case`totalheight`:o=TT(d);break;default:throw new N(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=YC(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=px(e.height,t),r=0;e.totalheight.number>0&&(r=px(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=px(e.width,t));var a={height:P(n+r)};i>0&&(a.width=P(i)),r>0&&(a.verticalAlign=P(-r));var o=new Sx(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new U(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=px(e.height,t),i=0;if(e.totalheight.number>0&&(i=px(e.totalheight,t)-r,n.setAttribute(`valign`,P(-i))),n.setAttribute(`height`,P(r+i)),e.width.number>0){var a=px(e.width,t);n.setAttribute(`width`,P(a))}return n.setAttribute(`src`,e.src),n}}),tC({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=YC(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return HS(e.dimension,t)},mathmlBuilder(e,t){return new bC(px(e.dimension,t))}}),tC({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=H([],[hC(e.body,t)]),n=H([`inner`],[n],t)):n=H([`inner`],[hC(e.body,t)]);var r=H([`fix`],[]),i=H([e.alignment],[n,r],t),a=H([`strut`]);return a.style.height=P(i.height+i.depth),i.depth&&(a.style.verticalAlign=P(-i.depth)),i.children.unshift(a),i=H([`thinbox`],[i],t),H([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new U(`mpadded`,[AC(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),tC({type:`styling`,names:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),tC({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new N(`Mismatched `+e.funcName)}});var ET=(e,t)=>{switch(t.style.size){case Wb.DISPLAY.size:return e.display;case Wb.TEXT.size:return e.text;case Wb.SCRIPT.size:return e.script;case Wb.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};tC({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:iC(t[0]),text:iC(t[1]),script:iC(t[2]),scriptscript:iC(t[3])}},htmlBuilder:(e,t)=>RS(lC(ET(e,t),t,!1)),mathmlBuilder:(e,t)=>kC(ET(e,t),t)});var DT=(e,t,n,r,i,a,o)=>{e=H([],[e]);var s=n&&xb(n),c,l;if(t){var u=hC(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=hC(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=VS({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:P(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:P(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=VS({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:P(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=VS({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:P(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=H([`mspace`],[],r);m.style.marginRight=P(a),p.unshift(m)}return H([`mop`,`op-limits`],p,r)},OT=new Set([`\\smallint`]),kT=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=YC(e.base,`op`),i=!0):a=YC(e,`op`);var o=t.style,s=!1;o.size===Wb.DISPLAY.size&&a.symbol&&!OT.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=OS(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=KS(d+`Size`+(s?`2`:`1`),t);c=VS({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=lC(a.body,t,!0);p.length===1&&p[0]instanceof wx?(c=p[0],c.classes[0]=`mop`):c=H([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(kS(a.name[h],a.mode,t));c=H([`mop`],m,t)}var g=0,_=0;return(c instanceof wx||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?DT(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=P(g)),c)},AT=(e,t)=>{var n;if(e.symbol)n=new U(`mo`,[CC(e.name,e.mode)]),OT.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new U(`mo`,OC(e.body,t));else{n=new U(`mi`,[new yC(e.name.slice(1))]);var r=new U(`mo`,[CC(``,`text`)]);n=e.parentIsSupSub?new U(`mrow`,[n,r]):vC([n,r])}return n},jT={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};tC({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=jT[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:kT,mathmlBuilder:AT}),tC({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:iC(r)}},htmlBuilder:kT,mathmlBuilder:AT});var MT={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};tC({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`.split(`.`),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:kT,mathmlBuilder:AT}),tC({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:kT,mathmlBuilder:AT}),tC({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=MT[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:kT,mathmlBuilder:AT});var NT=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=YC(e.base,`operatorname`),i=!0):a=YC(e,`operatorname`);var o;if(a.body.length>0){for(var s=lC(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof wx&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=H([`mop`],s,t)}else o=H([`mop`],[],t);return i?DT(o,n,r,t,t.style,0,0):o};tC({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:iC(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:NT,mathmlBuilder:(e,t)=>{for(var n=OC(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof bC)){if(a instanceof U)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof yC?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new yC(n.map(e=>e.toText()).join(``))]);var s=new U(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new U(`mo`,[CC(``,`text`)]);return e.parentIsSupSub?new U(`mrow`,[s,c]):vC([s,c])}}),W(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),nC({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?RS(lC(e.body,t,!1)):H([`mord`],lC(e.body,t,!0),t)},mathmlBuilder(e,t){return kC(e.body,t,!0)}}),tC({type:`overline`,names:[`\\overline`],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=hC(e.body,t.havingCrampedStyle()),r=IS(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return H([`mord`,`overline`],[VS({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new U(`mo`,[new yC(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new U(`mover`,[AC(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),tC({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:iC(r)}},htmlBuilder:(e,t)=>RS(lC(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new U(`mphantom`,OC(e.body,t))}),W(`\\hphantom`,`\\smash{\\phantom{#1}}`),tC({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>H([`mord`,`rlap`],[H([`inner`],[hC(e.body,t.withPhantom())]),H([`fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new U(`mpadded`,[new U(`mphantom`,OC(iC(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),tC({type:`raisebox`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e,r=YC(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=hC(e.body,t);return VS({positionType:`shift`,positionData:-px(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new U(`mpadded`,[AC(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),tC({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),tC({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler(e,t,n){var{parser:r}=e,i=n[0],a=YC(t[0],`size`),o=YC(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&YC(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=H([`mord`,`rule`],[],t),r=px(e.width,t),i=px(e.height,t),a=e.shift?px(e.shift,t):0;return n.style.borderRightWidth=P(r),n.style.borderTopWidth=P(i),n.style.bottom=P(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=px(e.width,t),r=px(e.height,t),i=e.shift?px(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new U(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,P(n)),o.setAttribute(`height`,P(r));var s=new U(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,P(i)):(s.setAttribute(`height`,P(i)),s.setAttribute(`depth`,P(-i))),s.setAttribute(`voffset`,P(i)),s}});function PT(e,t,n){for(var r=lC(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return RS(r)}var FT=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];tC({type:`sizing`,names:FT,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:FT.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return PT(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new U(`mstyle`,OC(e.body,n));return r.setAttribute(`mathsize`,P(n.sizeMultiplier)),r}}),tC({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&YC(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=XC(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=H([],[hC(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 H([`mord`,`smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return H([`mord`],[VS({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new U(`mpadded`,[AC(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),tC({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=hC(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=zS(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Wb.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,{span:o,ruleWidth:s,advanceWidth:c}=Pw(n.height+n.depth+a+r,t),l=o.height-s;l>n.height+n.depth+a&&(a=(a+l-n.height-n.depth)/2);var u=o.height-n.height-a-s;n.style.paddingLeft=P(c);var d=VS({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+u)},{type:`elem`,elem:o},{type:`kern`,size:s}]});if(e.index){var f=t.havingStyle(Wb.SCRIPTSCRIPT),p=hC(e.index,f,t);return H([`mord`,`sqrt`],[H([`root`],[VS({positionType:`shift`,positionData:-(.6*(d.height-d.depth)),children:[{type:`elem`,elem:p}]})]),d],t)}return H([`mord`,`sqrt`],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new U(`mroot`,[AC(n,t),AC(r,t)]):new U(`msqrt`,[AC(n,t)])}});var IT={display:Wb.DISPLAY,text:Wb.TEXT,script:Wb.SCRIPT,scriptscript:Wb.SCRIPTSCRIPT};function LT(e){return e in IT}tC({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!LT(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=IT[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),PT(e.body,r,t)},mathmlBuilder(e,t){var n=IT[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new U(`mstyle`,OC(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var RT=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===Wb.DISPLAY.size||n.alwaysHandleSupSub)?kT:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===Wb.DISPLAY.size||n.limits)?NT:null:n.type===`accent`?xb(n.base)?$C:null:n.type===`horizBrace`&&!e.sub===n.isOver?wT:null:null};nC({type:`supsub`,htmlBuilder(e,t){var n=RT(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=hC(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&xb(r);if(i){var p=t.havingStyle(t.style.sup());s=hC(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=hC(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===Wb.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=P(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof wx||y)&&(v=P(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=VS({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=VS({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=VS({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return H([pC(o,`right`)||`mord`],[o,H([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[AC(e.base,t)];e.sub&&a.push(AC(e.sub,t)),e.sup&&a.push(AC(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===Wb.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===Wb.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===Wb.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===Wb.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===Wb.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===Wb.DISPLAY)?`munder`:`msub`}return new U(o,a)}}),nC({type:`atom`,htmlBuilder(e,t){return kS(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new U(`mo`,[CC(e.text,e.mode)]);if(e.family===`bin`){var r=EC(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var zT={mi:`italic`,mn:`normal`,mtext:`normal`};nC({type:`mathord`,htmlBuilder(e,t){return jS(e,t,`mathord`)},mathmlBuilder(e,t){var n=new U(`mi`,[CC(e.text,e.mode,t)]),r=EC(e,t)||`italic`;return r!==zT[n.type]&&n.setAttribute(`mathvariant`,r),n}}),nC({type:`textord`,htmlBuilder(e,t){return jS(e,t,`textord`)},mathmlBuilder(e,t){var n=CC(e.text,e.mode,t),r=EC(e,t)||`normal`,i=e.mode===`text`?new U(`mtext`,[n]):/[0-9]/.test(e.text)?new U(`mn`,[n]):e.text===`\\prime`?new U(`mo`,[n]):new U(`mi`,[n]);return r!==zT[i.type]&&i.setAttribute(`mathvariant`,r),i}});var BT={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},VT={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};nC({type:`spacing`,htmlBuilder(e,t){if(VT.hasOwnProperty(e.text)){var n=VT[e.text].className||``;if(e.mode===`text`){var r=jS(e,t,`textord`);return r.classes.push(n),r}return H([`mspace`,n],[kS(e.text,e.mode,t)],t)}if(BT.hasOwnProperty(e.text))return H([`mspace`,BT[e.text]],[],t);throw new N(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(VT.hasOwnProperty(e.text))n=new U(`mtext`,[new yC(`\xA0`)]);else if(BT.hasOwnProperty(e.text))return new U(`mspace`);else throw new N(`Unknown type of space "`+e.text+`"`);return n}});var HT=()=>{var e=new U(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};nC({type:`tag`,mathmlBuilder(e,t){var n=new U(`mtable`,[new U(`mtr`,[HT(),new U(`mtd`,[kC(e.body,t)]),HT(),new U(`mtd`,[kC(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var UT={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},WT={"\\textbf":`textbf`,"\\textmd":`textmd`},GT={"\\textit":`textit`,"\\textup":`textup`},KT=(e,t)=>{var n=e.font;return n?UT[n]?t.withTextFontFamily(UT[n]):WT[n]?t.withTextFontWeight(WT[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(GT[n]):t};tC({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:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:iC(i),font:r}},htmlBuilder(e,t){var n=KT(e,t);return H([`mord`,`text`],lC(e.body,n,!0),n)},mathmlBuilder(e,t){var n=KT(e,t);return kC(e.body,n)}}),tC({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=hC(e.body,t),r=IS(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return H([`mord`,`underline`],[VS({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new U(`mo`,[new yC(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new U(`munder`,[AC(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),tC({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=hC(e.body,t),r=t.fontMetrics().axisHeight;return VS({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new U(`mrow`,[new U(`mpadded`,[AC(e.body,t)],[`vcenter`])])}}),tC({type:`verb`,names:[`\\verb`],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new N(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=qT(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(OS(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return H([`mord`,`text`].concat(i.sizingClasses(t)),NS(r),i)},mathmlBuilder(e,t){var n=new U(`mtext`,[new yC(qT(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var qT=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),JT=QS,YT=`[ \r
|
|
298
|
+
]`,XT=`\\\\[a-zA-Z@]+`,ZT=`\\\\[^\ud800-\udfff]`,QT=`(`+XT+`)`+YT+`*`,$T=`\\\\(
|
|
299
|
+
|[ \r ]+
|
|
300
|
+
?)[ \r ]*`,eE=`[̀-ͯ]`,tE=RegExp(eE+`+$`),nE=`(`+YT+`+)|`+($T+`|`)+`([!-\\[\\]-‧-豈-]`+(eE+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(eE+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+QT)+(`|`+ZT+`)`),rE=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(nE,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new iT(`EOF`,new rT(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new N(`Unexpected character: '`+e[t]+`'`,new iT(e[t],new rT(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
|
|
301
|
+
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.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=i+1,this.lex()}return new iT(r,new rT(this,t,this.tokenRegex.lastIndex))}},iE=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new N(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},aE=nT;W(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),W(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),W(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),W(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),W(`\\@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}}),W(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),W(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var oE={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};W(`\\char`,function(e){var t=e.popToken(),n,r=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]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new N("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=oE[t.text],r==null||r>=n)throw new N(`Invalid base-`+n+` digit `+t.text);for(var i;(i=oE[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var sE=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new N(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new N(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new N(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new N(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};W(`\\newcommand`,e=>sE(e,!1,!0,!1)),W(`\\renewcommand`,e=>sE(e,!0,!1,!1)),W(`\\providecommand`,e=>sE(e,!0,!0,!0)),W(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),W(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),W(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),JT[n],Rx.math[n],Rx.text[n]),``}),W(`\\bgroup`,`{`),W(`\\egroup`,`}`),W(`~`,`\\nobreakspace`),W(`\\lq`,"`"),W(`\\rq`,`'`),W(`\\aa`,`\\r a`),W(`\\AA`,`\\r A`),W(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),W(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),W(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),W(`ℬ`,`\\mathscr{B}`),W(`ℰ`,`\\mathscr{E}`),W(`ℱ`,`\\mathscr{F}`),W(`ℋ`,`\\mathscr{H}`),W(`ℐ`,`\\mathscr{I}`),W(`ℒ`,`\\mathscr{L}`),W(`ℳ`,`\\mathscr{M}`),W(`ℛ`,`\\mathscr{R}`),W(`ℭ`,`\\mathfrak{C}`),W(`ℌ`,`\\mathfrak{H}`),W(`ℨ`,`\\mathfrak{Z}`),W(`\\Bbbk`,`\\Bbb{k}`),W(`\\llap`,`\\mathllap{\\textrm{#1}}`),W(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),W(`\\clap`,`\\mathclap{\\textrm{#1}}`),W(`\\mathstrut`,`\\vphantom{(}`),W(`\\underbar`,`\\underline{\\text{#1}}`),W(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),W(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),W(`\\ne`,`\\neq`),W(`≠`,`\\neq`),W(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),W(`∉`,`\\notin`),W(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),W(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),W(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),W(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),W(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),W(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),W(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),W(`⟂`,`\\perp`),W(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),W(`∌`,`\\notni`),W(`⌜`,`\\ulcorner`),W(`⌝`,`\\urcorner`),W(`⌞`,`\\llcorner`),W(`⌟`,`\\lrcorner`),W(`©`,`\\copyright`),W(`®`,`\\textregistered`),W(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),W(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),W(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),W(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),W(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),W(`⋮`,`\\vdots`),W(`\\varGamma`,`\\mathit{\\Gamma}`),W(`\\varDelta`,`\\mathit{\\Delta}`),W(`\\varTheta`,`\\mathit{\\Theta}`),W(`\\varLambda`,`\\mathit{\\Lambda}`),W(`\\varXi`,`\\mathit{\\Xi}`),W(`\\varPi`,`\\mathit{\\Pi}`),W(`\\varSigma`,`\\mathit{\\Sigma}`),W(`\\varUpsilon`,`\\mathit{\\Upsilon}`),W(`\\varPhi`,`\\mathit{\\Phi}`),W(`\\varPsi`,`\\mathit{\\Psi}`),W(`\\varOmega`,`\\mathit{\\Omega}`),W(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),W(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),W(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),W(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),W(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),W(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),W(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),W(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var cE={",":`\\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`},lE=new Set([`bin`,`rel`]);W(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in cE?t=cE[n]:(n.slice(0,4)===`\\not`||n in Rx.math&&lE.has(Rx.math[n].group))&&(t=`\\dotsb`),t});var uE={")":!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};W(`\\dotso`,function(e){return e.future().text in uE?`\\ldots\\,`:`\\ldots`}),W(`\\dotsc`,function(e){var t=e.future().text;return t in uE&&t!==`,`?`\\ldots\\,`:`\\ldots`}),W(`\\cdots`,function(e){return e.future().text in uE?`\\@cdots\\,`:`\\@cdots`}),W(`\\dotsb`,`\\cdots`),W(`\\dotsm`,`\\cdots`),W(`\\dotsi`,`\\!\\cdots`),W(`\\dotsx`,`\\ldots\\,`),W(`\\DOTSI`,`\\relax`),W(`\\DOTSB`,`\\relax`),W(`\\DOTSX`,`\\relax`),W(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),W(`\\,`,`\\tmspace+{3mu}{.1667em}`),W(`\\thinspace`,`\\,`),W(`\\>`,`\\mskip{4mu}`),W(`\\:`,`\\tmspace+{4mu}{.2222em}`),W(`\\medspace`,`\\:`),W(`\\;`,`\\tmspace+{5mu}{.2777em}`),W(`\\thickspace`,`\\;`),W(`\\!`,`\\tmspace-{3mu}{.1667em}`),W(`\\negthinspace`,`\\!`),W(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),W(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),W(`\\enspace`,`\\kern.5em `),W(`\\enskip`,`\\hskip.5em\\relax`),W(`\\quad`,`\\hskip1em\\relax`),W(`\\qquad`,`\\hskip2em\\relax`),W(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),W(`\\tag@paren`,`\\tag@literal{({#1})}`),W(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new N(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),W(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),W(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),W(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),W(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),W(`\\newline`,`\\\\\\relax`),W(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var dE=P(jx[`Main-Regular`][84][1]-.7*jx[`Main-Regular`][65][1]);W(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+dE+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),W(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+dE+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),W(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),W(`\\@hspace`,`\\hskip #1\\relax`),W(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),W(`\\ordinarycolon`,`:`),W(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),W(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),W(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),W(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),W(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),W(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),W(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),W(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),W(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),W(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),W(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),W(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),W(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),W(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),W(`∷`,`\\dblcolon`),W(`∹`,`\\eqcolon`),W(`≔`,`\\coloneqq`),W(`≕`,`\\eqqcolon`),W(`⩴`,`\\Coloneqq`),W(`\\ratio`,`\\vcentcolon`),W(`\\coloncolon`,`\\dblcolon`),W(`\\colonequals`,`\\coloneqq`),W(`\\coloncolonequals`,`\\Coloneqq`),W(`\\equalscolon`,`\\eqqcolon`),W(`\\equalscoloncolon`,`\\Eqqcolon`),W(`\\colonminus`,`\\coloneq`),W(`\\coloncolonminus`,`\\Coloneq`),W(`\\minuscolon`,`\\eqcolon`),W(`\\minuscoloncolon`,`\\Eqcolon`),W(`\\coloncolonapprox`,`\\Colonapprox`),W(`\\coloncolonsim`,`\\Colonsim`),W(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),W(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),W(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),W(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),W(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),W(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),W(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),W(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),W(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),W(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),W(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),W(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),W(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),W(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),W(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),W(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),W(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),W(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),W(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),W(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),W(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),W(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),W(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),W(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),W(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),W(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),W(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),W(`\\imath`,`\\html@mathml{\\@imath}{ı}`),W(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),W(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),W(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),W(`⟦`,`\\llbracket`),W(`⟧`,`\\rrbracket`),W(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),W(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),W(`⦃`,`\\lBrace`),W(`⦄`,`\\rBrace`),W(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),W(`⦵`,`\\minuso`),W(`\\darr`,`\\downarrow`),W(`\\dArr`,`\\Downarrow`),W(`\\Darr`,`\\Downarrow`),W(`\\lang`,`\\langle`),W(`\\rang`,`\\rangle`),W(`\\uarr`,`\\uparrow`),W(`\\uArr`,`\\Uparrow`),W(`\\Uarr`,`\\Uparrow`),W(`\\N`,`\\mathbb{N}`),W(`\\R`,`\\mathbb{R}`),W(`\\Z`,`\\mathbb{Z}`),W(`\\alef`,`\\aleph`),W(`\\alefsym`,`\\aleph`),W(`\\Alpha`,`\\mathrm{A}`),W(`\\Beta`,`\\mathrm{B}`),W(`\\bull`,`\\bullet`),W(`\\Chi`,`\\mathrm{X}`),W(`\\clubs`,`\\clubsuit`),W(`\\cnums`,`\\mathbb{C}`),W(`\\Complex`,`\\mathbb{C}`),W(`\\Dagger`,`\\ddagger`),W(`\\diamonds`,`\\diamondsuit`),W(`\\empty`,`\\emptyset`),W(`\\Epsilon`,`\\mathrm{E}`),W(`\\Eta`,`\\mathrm{H}`),W(`\\exist`,`\\exists`),W(`\\harr`,`\\leftrightarrow`),W(`\\hArr`,`\\Leftrightarrow`),W(`\\Harr`,`\\Leftrightarrow`),W(`\\hearts`,`\\heartsuit`),W(`\\image`,`\\Im`),W(`\\infin`,`\\infty`),W(`\\Iota`,`\\mathrm{I}`),W(`\\isin`,`\\in`),W(`\\Kappa`,`\\mathrm{K}`),W(`\\larr`,`\\leftarrow`),W(`\\lArr`,`\\Leftarrow`),W(`\\Larr`,`\\Leftarrow`),W(`\\lrarr`,`\\leftrightarrow`),W(`\\lrArr`,`\\Leftrightarrow`),W(`\\Lrarr`,`\\Leftrightarrow`),W(`\\Mu`,`\\mathrm{M}`),W(`\\natnums`,`\\mathbb{N}`),W(`\\Nu`,`\\mathrm{N}`),W(`\\Omicron`,`\\mathrm{O}`),W(`\\plusmn`,`\\pm`),W(`\\rarr`,`\\rightarrow`),W(`\\rArr`,`\\Rightarrow`),W(`\\Rarr`,`\\Rightarrow`),W(`\\real`,`\\Re`),W(`\\reals`,`\\mathbb{R}`),W(`\\Reals`,`\\mathbb{R}`),W(`\\Rho`,`\\mathrm{P}`),W(`\\sdot`,`\\cdot`),W(`\\sect`,`\\S`),W(`\\spades`,`\\spadesuit`),W(`\\sub`,`\\subset`),W(`\\sube`,`\\subseteq`),W(`\\supe`,`\\supseteq`),W(`\\Tau`,`\\mathrm{T}`),W(`\\thetasym`,`\\vartheta`),W(`\\weierp`,`\\wp`),W(`\\Zeta`,`\\mathrm{Z}`),W(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),W(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),W(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),W(`\\bra`,`\\mathinner{\\langle{#1}|}`),W(`\\ket`,`\\mathinner{|{#1}\\rangle}`),W(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),W(`\\Bra`,`\\left\\langle#1\\right|`),W(`\\Ket`,`\\left|#1\\right\\rangle`);var fE=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};W(`\\bra@ket`,fE(!1)),W(`\\bra@set`,fE(!0)),W(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),W(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),W(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),W(`\\angln`,`{\\angl n}`),W(`\\blue`,`\\textcolor{##6495ed}{#1}`),W(`\\orange`,`\\textcolor{##ffa500}{#1}`),W(`\\pink`,`\\textcolor{##ff00af}{#1}`),W(`\\red`,`\\textcolor{##df0030}{#1}`),W(`\\green`,`\\textcolor{##28ae7b}{#1}`),W(`\\gray`,`\\textcolor{gray}{#1}`),W(`\\purple`,`\\textcolor{##9d38bd}{#1}`),W(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),W(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),W(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),W(`\\blueD`,`\\textcolor{##11accd}{#1}`),W(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),W(`\\tealA`,`\\textcolor{##94fff5}{#1}`),W(`\\tealB`,`\\textcolor{##26edd5}{#1}`),W(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),W(`\\tealD`,`\\textcolor{##01a995}{#1}`),W(`\\tealE`,`\\textcolor{##208170}{#1}`),W(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),W(`\\greenB`,`\\textcolor{##8af281}{#1}`),W(`\\greenC`,`\\textcolor{##74cf70}{#1}`),W(`\\greenD`,`\\textcolor{##1fab54}{#1}`),W(`\\greenE`,`\\textcolor{##0d923f}{#1}`),W(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),W(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),W(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),W(`\\goldD`,`\\textcolor{##e07d10}{#1}`),W(`\\goldE`,`\\textcolor{##a75a05}{#1}`),W(`\\redA`,`\\textcolor{##fca9a9}{#1}`),W(`\\redB`,`\\textcolor{##ff8482}{#1}`),W(`\\redC`,`\\textcolor{##f9685d}{#1}`),W(`\\redD`,`\\textcolor{##e84d39}{#1}`),W(`\\redE`,`\\textcolor{##bc2612}{#1}`),W(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),W(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),W(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),W(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),W(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),W(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),W(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),W(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),W(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),W(`\\purpleE`,`\\textcolor{##543b78}{#1}`),W(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),W(`\\mintB`,`\\textcolor{##edf2df}{#1}`),W(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),W(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),W(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),W(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),W(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),W(`\\grayE`,`\\textcolor{##babec2}{#1}`),W(`\\grayF`,`\\textcolor{##888d93}{#1}`),W(`\\grayG`,`\\textcolor{##626569}{#1}`),W(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),W(`\\grayI`,`\\textcolor{##21242c}{#1}`),W(`\\kaBlue`,`\\textcolor{##314453}{#1}`),W(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var pE={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},mE=class{constructor(e,t,n){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=t,this.expansionCount=0,this.feed(e),this.macros=new iE(aE,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new rE(e,this.settings)}switchMode(e){this.mode=e}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(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new iT(`EOF`,n.loc)),this.pushTokens(r),new iT(``,rT.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new N(`Extra }`,i)}else if(i.text===`EOF`)throw new N(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new N(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new N(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new N(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new N(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new N(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new N(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new iT(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new rE(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||JT.hasOwnProperty(e)||Rx.math.hasOwnProperty(e)||Rx.text.hasOwnProperty(e)||pE.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?JT.hasOwnProperty(e)&&!JT[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},hE=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,gE=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`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),_E={"́":{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`}},vE={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},yE=class e{constructor(e,t){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 mE(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new N(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new iT(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&JT[i.text]&&JT[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new N(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new N(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new N(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new N(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new N(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new N(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(gE[i.text]){var s=hE.test(i.text),c=[];for(c.push(new iT(gE[i.text])),this.consume();;){var l=this.fetch().text;if(!gE[l]||hE.test(l)!==s)break;c.unshift(new iT(gE[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n||r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=JT[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new N(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new N(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new N(`Can't use function '`+r+`' in math mode`,n);var{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=JT[e];if(o&&o.handler)return o.handler(a,t,n);throw new N(`No function handler for `+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var o=t.argTypes&&t.argTypes[a],s=a<t.numOptionalArgs;(`primitive`in t&&t.primitive&&o==null||t.type===`sqrt`&&a===1&&i[0]==null)&&(o=`primitive`);var c=this.parseGroupOfType(`argument to '`+e+`'`,o,s);if(s)i.push(c);else if(c!=null)r.push(c);else throw new N(`Null argument, please report this as a bug`)}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(`raw`,n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new N(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new N(`Expected group as `+e,this.fetch());return a;case`original`:case null:case void 0:return this.parseArgumentGroup(n);default:throw new N(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r=``,i;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new N(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(`color`,e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new N(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(`size`,e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new N(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!fx(i))throw new N(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(`url`,e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:rT.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!pE.hasOwnProperty(r)){if(this.settings.throwOnError)throw new N(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(!(!a||a.type!==`textord`)){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:rT.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:rT.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:rT.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new N(`\\verb assertion failed --
|
|
302
|
+
please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}vE.hasOwnProperty(t[0])&&!Rx[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=vE[t[0]]+t.slice(1));var i=tE.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(Rx[this.mode][t]){this.settings.strict&&this.mode===`math`&&lS.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=Rx[this.mode][t].group,s=rT.range(e);a=JC(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Jb(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:rT.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!_E[l])throw new N(`Unknown accent ' `+l+`'`,e);var u=_E[l][this.mode]||_E[l].text;if(!u)throw new N(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:rT.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};yE.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var bE=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new yE(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new N(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new iT(`\\df@tag`)])}]}return r},xE=function(e,t,n){t.textContent=``;var r=TE(e,n).toNode();t.appendChild(r)};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.`),xE=function(){throw new N(`KaTeX doesn't work in quirks mode.`)});var SE=function(e,t){return TE(e,t).toMarkup()},CE=function(e,t){return bE(e,new Db(t))},wE=function(e,t,n){if(n.throwOnError||!(e instanceof N))throw e;var r=H([`katex-error`],[new wx(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},TE=function(e,t){var n=new Db(t);try{return RC(bE(e,n),e,n)}catch(t){return wE(t,e,n)}},EE={version:`0.16.47`,render:xE,renderToString:SE,ParseError:N,SETTINGS_SCHEMA:Cb,__parse:CE,__renderToDomTree:TE,__renderToHTMLTree:function(e,t){var n=new Db(t);try{return zC(bE(e,n),e,n)}catch(t){return wE(t,e,n)}},__setFontMetrics:Px,__defineSymbol:F,__defineFunction:tC,__defineMacro:W,__domTree:{Span:bx,Anchor:xx,SymbolNode:wx,SvgNode:Tx,PathNode:Ex,LineNode:Dx}},DE={},OE=[];function kE(e){let t=e||DE;return function(e,n){pv(e,`element`,function(e,r){let i=Array.isArray(e.properties.className)?e.properties.className:OE,a=i.includes(`language-math`),o=i.includes(`math-display`),s=i.includes(`math-inline`),c=o;if(!a&&!o&&!s)return;let l=r[r.length-1],u=e;if(e.tagName===`code`&&a&&l&&l.type===`element`&&l.tagName===`pre`&&(u=l,l=r[r.length-2],c=!0),!l)return;let d=ib(u,{whitespace:`pre`}),f;try{f=EE.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(i){let a=i,o=a.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:`rehype-katex`});try{f=EE.renderToString(d,{...t,displayMode:c,strict:`ignore`,throwOnError:!1})}catch{f=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(i)},children:[{type:`text`,value:d}]}]}}typeof f==`string`&&(f=Vy(f,{fragment:!0}).children);let p=l.children.indexOf(u);return l.children.splice(p,1,...f),fv})}}function AE(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=jE(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=jE(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function jE(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
303
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var ME={}.hasOwnProperty,NE=Object.prototype;function PE(e,t){let n=t||{};return FE({file:n.file||void 0,location:!1,schema:n.space===`svg`?gp:hp,verbose:n.verbose||!1},e)}function FE(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},RE(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:IE(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=AE(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},RE(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},RE(e,r,n),n}default:return n=LE(e,t),n}}function IE(e,t){let n=-1,r=[];for(;++n<t.length;){let i=FE(e,t[n]);r.push(i)}return r}function LE(e,t){let n=e.schema;e.schema=t.namespaceURI===Ay.svg?gp:hp;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;ME.call(NE,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?ky:Oy)(t.tagName,i,IE(e,t.childNodes));if(RE(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&BE(r.startTag),o=r&&r.endTag&&BE(r.endTag),s=FE(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function RE(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=zE(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function zE(e,t,n){let r=BE(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)ME.call(n.attrs,i)&&(r[fp(e.schema,i).property]=BE(n.attrs[i]));n.startTag;let a=BE(n.startTag),o=n.endTag?BE(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function BE(e){let t=VE({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=VE({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function VE(e){return e.line&&e.column?e:void 0}var HE={}.hasOwnProperty;function UE(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&HE.call(t,e)){let n=String(t[e]);i=HE.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var WE={},GE={}.hasOwnProperty,KE=UE(`type`,{handlers:{root:JE,element:$E,text:ZE,comment:QE,doctype:XE}});function qE(e,t){let n=(t||WE).space;return KE(e,n===`svg`?gp:hp)}function JE(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=tD(e.children,n,t),nD(e,n),n}function YE(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=tD(e.children,n,t),nD(e,n),n}function XE(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return nD(e,t),t}function ZE(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return nD(e,t),t}function QE(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return nD(e,t),t}function $E(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=gp);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&GE.call(e.properties,a)){let t=eD(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Ay[o],childNodes:[],parentNode:null};return s.childNodes=tD(e.children,s,r),nD(e,s),e.tagName===`template`&&e.content&&(s.content=YE(e.content,r)),s}function eD(e,t,n){let r=fp(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?kf(n):vp(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=Ay[r.space]}return i}function tD(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=KE(e[r],n);a.parentNode=t,i.push(a)}return i}function nD(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var rD=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],iD=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),G;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(G||={});var aD={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function oD(e){return e>=55296&&e<=57343}function sD(e){return e>=56320&&e<=57343}function cD(e,t){return(e-55296)*1024+9216+t}function lD(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function uD(e){return e>=64976&&e<=65007||iD.has(e)}var K;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(K||={});var dD=65536,fD=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=dD,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(sD(t))return this.pos++,this._addGap(),cD(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,G.EOF;return this._err(K.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let n=this.html.charCodeAt(t);return n===G.CARRIAGE_RETURN?G.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let e=this.html.charCodeAt(this.pos);return e===G.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,G.LINE_FEED):e===G.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,oD(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===G.LINE_FEED||e===G.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){lD(e)?this._err(K.controlCharacterInInputStream):uD(e)&&this._err(K.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},pD;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(pD||={});function mD(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var hD=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),gD=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function _D(e){return e>=55296&&e<=57343||e>1114111?65533:gD.get(e)??e}var vD;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(vD||={});var yD=32,bD;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(bD||={});function xD(e){return e>=vD.ZERO&&e<=vD.NINE}function SD(e){return e>=vD.UPPER_A&&e<=vD.UPPER_F||e>=vD.LOWER_A&&e<=vD.LOWER_F}function CD(e){return e>=vD.UPPER_A&&e<=vD.UPPER_Z||e>=vD.LOWER_A&&e<=vD.LOWER_Z||xD(e)}function wD(e){return e===vD.EQUALS||CD(e)}var TD;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(TD||={});var ED;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(ED||={});var DD=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=TD.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ED.Strict}startEntity(e){this.decodeMode=e,this.state=TD.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case TD.EntityStart:return e.charCodeAt(t)===vD.NUM?(this.state=TD.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=TD.NamedEntity,this.stateNamedEntity(e,t));case TD.NumericStart:return this.stateNumericStart(e,t);case TD.NumericDecimal:return this.stateNumericDecimal(e,t);case TD.NumericHex:return this.stateNumericHex(e,t);case TD.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|yD)===vD.LOWER_X?(this.state=TD.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=TD.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(xD(r)||SD(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(xD(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===vD.SEMI)this.consumed+=1;else if(this.decodeMode===ED.Strict)return 0;return this.emitCodePoint(_D(this.result),this.consumed),this.errors&&(e!==vD.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&bD.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=OD(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===ED.Attribute&&(i===0||wD(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&bD.VALUE_LENGTH)>>14,i!==0){if(a===vD.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ED.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&bD.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~bD.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case TD.NamedEntity:return this.result!==0&&(this.decodeMode!==ED.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case TD.NumericDecimal:return this.emitNumericEntity(0,2);case TD.NumericHex:return this.emitNumericEntity(0,3);case TD.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case TD.EntityStart:return 0}}};function OD(e,t,n,r){let i=(t&bD.BRANCH_LENGTH)>>7,a=t&bD.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var q;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(q||={});var kD;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(kD||={});var AD;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(AD||={});var J;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(J||={});var Y;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(Y||={});var jD=new Map([[J.A,Y.A],[J.ADDRESS,Y.ADDRESS],[J.ANNOTATION_XML,Y.ANNOTATION_XML],[J.APPLET,Y.APPLET],[J.AREA,Y.AREA],[J.ARTICLE,Y.ARTICLE],[J.ASIDE,Y.ASIDE],[J.B,Y.B],[J.BASE,Y.BASE],[J.BASEFONT,Y.BASEFONT],[J.BGSOUND,Y.BGSOUND],[J.BIG,Y.BIG],[J.BLOCKQUOTE,Y.BLOCKQUOTE],[J.BODY,Y.BODY],[J.BR,Y.BR],[J.BUTTON,Y.BUTTON],[J.CAPTION,Y.CAPTION],[J.CENTER,Y.CENTER],[J.CODE,Y.CODE],[J.COL,Y.COL],[J.COLGROUP,Y.COLGROUP],[J.DD,Y.DD],[J.DESC,Y.DESC],[J.DETAILS,Y.DETAILS],[J.DIALOG,Y.DIALOG],[J.DIR,Y.DIR],[J.DIV,Y.DIV],[J.DL,Y.DL],[J.DT,Y.DT],[J.EM,Y.EM],[J.EMBED,Y.EMBED],[J.FIELDSET,Y.FIELDSET],[J.FIGCAPTION,Y.FIGCAPTION],[J.FIGURE,Y.FIGURE],[J.FONT,Y.FONT],[J.FOOTER,Y.FOOTER],[J.FOREIGN_OBJECT,Y.FOREIGN_OBJECT],[J.FORM,Y.FORM],[J.FRAME,Y.FRAME],[J.FRAMESET,Y.FRAMESET],[J.H1,Y.H1],[J.H2,Y.H2],[J.H3,Y.H3],[J.H4,Y.H4],[J.H5,Y.H5],[J.H6,Y.H6],[J.HEAD,Y.HEAD],[J.HEADER,Y.HEADER],[J.HGROUP,Y.HGROUP],[J.HR,Y.HR],[J.HTML,Y.HTML],[J.I,Y.I],[J.IMG,Y.IMG],[J.IMAGE,Y.IMAGE],[J.INPUT,Y.INPUT],[J.IFRAME,Y.IFRAME],[J.KEYGEN,Y.KEYGEN],[J.LABEL,Y.LABEL],[J.LI,Y.LI],[J.LINK,Y.LINK],[J.LISTING,Y.LISTING],[J.MAIN,Y.MAIN],[J.MALIGNMARK,Y.MALIGNMARK],[J.MARQUEE,Y.MARQUEE],[J.MATH,Y.MATH],[J.MENU,Y.MENU],[J.META,Y.META],[J.MGLYPH,Y.MGLYPH],[J.MI,Y.MI],[J.MO,Y.MO],[J.MN,Y.MN],[J.MS,Y.MS],[J.MTEXT,Y.MTEXT],[J.NAV,Y.NAV],[J.NOBR,Y.NOBR],[J.NOFRAMES,Y.NOFRAMES],[J.NOEMBED,Y.NOEMBED],[J.NOSCRIPT,Y.NOSCRIPT],[J.OBJECT,Y.OBJECT],[J.OL,Y.OL],[J.OPTGROUP,Y.OPTGROUP],[J.OPTION,Y.OPTION],[J.P,Y.P],[J.PARAM,Y.PARAM],[J.PLAINTEXT,Y.PLAINTEXT],[J.PRE,Y.PRE],[J.RB,Y.RB],[J.RP,Y.RP],[J.RT,Y.RT],[J.RTC,Y.RTC],[J.RUBY,Y.RUBY],[J.S,Y.S],[J.SCRIPT,Y.SCRIPT],[J.SEARCH,Y.SEARCH],[J.SECTION,Y.SECTION],[J.SELECT,Y.SELECT],[J.SOURCE,Y.SOURCE],[J.SMALL,Y.SMALL],[J.SPAN,Y.SPAN],[J.STRIKE,Y.STRIKE],[J.STRONG,Y.STRONG],[J.STYLE,Y.STYLE],[J.SUB,Y.SUB],[J.SUMMARY,Y.SUMMARY],[J.SUP,Y.SUP],[J.TABLE,Y.TABLE],[J.TBODY,Y.TBODY],[J.TEMPLATE,Y.TEMPLATE],[J.TEXTAREA,Y.TEXTAREA],[J.TFOOT,Y.TFOOT],[J.TD,Y.TD],[J.TH,Y.TH],[J.THEAD,Y.THEAD],[J.TITLE,Y.TITLE],[J.TR,Y.TR],[J.TRACK,Y.TRACK],[J.TT,Y.TT],[J.U,Y.U],[J.UL,Y.UL],[J.SVG,Y.SVG],[J.VAR,Y.VAR],[J.WBR,Y.WBR],[J.XMP,Y.XMP]]);function MD(e){return jD.get(e)??Y.UNKNOWN}var X=Y,ND={[q.HTML]:new Set([X.ADDRESS,X.APPLET,X.AREA,X.ARTICLE,X.ASIDE,X.BASE,X.BASEFONT,X.BGSOUND,X.BLOCKQUOTE,X.BODY,X.BR,X.BUTTON,X.CAPTION,X.CENTER,X.COL,X.COLGROUP,X.DD,X.DETAILS,X.DIR,X.DIV,X.DL,X.DT,X.EMBED,X.FIELDSET,X.FIGCAPTION,X.FIGURE,X.FOOTER,X.FORM,X.FRAME,X.FRAMESET,X.H1,X.H2,X.H3,X.H4,X.H5,X.H6,X.HEAD,X.HEADER,X.HGROUP,X.HR,X.HTML,X.IFRAME,X.IMG,X.INPUT,X.LI,X.LINK,X.LISTING,X.MAIN,X.MARQUEE,X.MENU,X.META,X.NAV,X.NOEMBED,X.NOFRAMES,X.NOSCRIPT,X.OBJECT,X.OL,X.P,X.PARAM,X.PLAINTEXT,X.PRE,X.SCRIPT,X.SECTION,X.SELECT,X.SOURCE,X.STYLE,X.SUMMARY,X.TABLE,X.TBODY,X.TD,X.TEMPLATE,X.TEXTAREA,X.TFOOT,X.TH,X.THEAD,X.TITLE,X.TR,X.TRACK,X.UL,X.WBR,X.XMP]),[q.MATHML]:new Set([X.MI,X.MO,X.MN,X.MS,X.MTEXT,X.ANNOTATION_XML]),[q.SVG]:new Set([X.TITLE,X.FOREIGN_OBJECT,X.DESC]),[q.XLINK]:new Set,[q.XML]:new Set,[q.XMLNS]:new Set},PD=new Set([X.H1,X.H2,X.H3,X.H4,X.H5,X.H6]);J.STYLE,J.SCRIPT,J.XMP,J.IFRAME,J.NOEMBED,J.NOFRAMES,J.PLAINTEXT;var Z;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(Z||={});var FD={DATA:Z.DATA,RCDATA:Z.RCDATA,RAWTEXT:Z.RAWTEXT,SCRIPT_DATA:Z.SCRIPT_DATA,PLAINTEXT:Z.PLAINTEXT,CDATA_SECTION:Z.CDATA_SECTION};function ID(e){return e>=G.DIGIT_0&&e<=G.DIGIT_9}function LD(e){return e>=G.LATIN_CAPITAL_A&&e<=G.LATIN_CAPITAL_Z}function RD(e){return e>=G.LATIN_SMALL_A&&e<=G.LATIN_SMALL_Z}function zD(e){return RD(e)||LD(e)}function BD(e){return zD(e)||ID(e)}function VD(e){return e+32}function HD(e){return e===G.SPACE||e===G.LINE_FEED||e===G.TABULATION||e===G.FORM_FEED}function UD(e){return HD(e)||e===G.SOLIDUS||e===G.GREATER_THAN_SIGN}function WD(e){return e===G.NULL?K.nullCharacterReference:e>1114111?K.characterReferenceOutsideUnicodeRange:oD(e)?K.surrogateCharacterReference:uD(e)?K.noncharacterCharacterReference:lD(e)||e===G.CARRIAGE_RETURN?K.controlCharacterReference:null}var GD=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=Z.DATA,this.returnState=Z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new fD(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new DD(hD,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(K.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(K.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=WD(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:pD.START_TAG,tagName:``,tagID:Y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:pD.END_TAG,tagName:``,tagID:Y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:pD.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:pD.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(mD(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(K.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=MD(e.tagName),e.type===pD.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(K.endTagWithAttributes),e.selfClosing&&this._err(K.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case pD.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case pD.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case pD.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:pD.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=HD(e)?pD.WHITESPACE_CHARACTER:e===G.NULL?pD.NULL_CHARACTER:pD.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(pD.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ED.Attribute:ED.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Z.DATA:this._stateData(e);break;case Z.RCDATA:this._stateRcdata(e);break;case Z.RAWTEXT:this._stateRawtext(e);break;case Z.SCRIPT_DATA:this._stateScriptData(e);break;case Z.PLAINTEXT:this._statePlaintext(e);break;case Z.TAG_OPEN:this._stateTagOpen(e);break;case Z.END_TAG_OPEN:this._stateEndTagOpen(e);break;case Z.TAG_NAME:this._stateTagName(e);break;case Z.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case Z.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case Z.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case Z.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case Z.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case Z.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case Z.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case Z.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case Z.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case Z.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case Z.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case Z.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case Z.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case Z.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case Z.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case Z.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case Z.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case Z.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case Z.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case Z.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case Z.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case Z.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case Z.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case Z.BOGUS_COMMENT:this._stateBogusComment(e);break;case Z.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case Z.COMMENT_START:this._stateCommentStart(e);break;case Z.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case Z.COMMENT:this._stateComment(e);break;case Z.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case Z.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case Z.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case Z.COMMENT_END:this._stateCommentEnd(e);break;case Z.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case Z.DOCTYPE:this._stateDoctype(e);break;case Z.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case Z.DOCTYPE_NAME:this._stateDoctypeName(e);break;case Z.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case Z.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case Z.CDATA_SECTION:this._stateCdataSection(e);break;case Z.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case Z.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case Z.CHARACTER_REFERENCE:this._stateCharacterReference();break;case Z.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case G.LESS_THAN_SIGN:this.state=Z.TAG_OPEN;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitCodePoint(e);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case G.AMPERSAND:this._startCharacterReference();break;case G.LESS_THAN_SIGN:this.state=Z.RCDATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case G.LESS_THAN_SIGN:this.state=Z.RAWTEXT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(zD(e))this._createStartTagToken(),this.state=Z.TAG_NAME,this._stateTagName(e);else switch(e){case G.EXCLAMATION_MARK:this.state=Z.MARKUP_DECLARATION_OPEN;break;case G.SOLIDUS:this.state=Z.END_TAG_OPEN;break;case G.QUESTION_MARK:this._err(K.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(e);break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=Z.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(zD(e))this._createEndTagToken(),this.state=Z.TAG_NAME,this._stateTagName(e);else switch(e){case G.GREATER_THAN_SIGN:this._err(K.missingEndTagName),this.state=Z.DATA;break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this.state=Z.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.tagName+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(LD(e)?VD(e):e)}}_stateRcdataLessThanSign(e){e===G.SOLIDUS?this.state=Z.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=Z.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){zD(e)?(this.state=Z.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=Z.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Z.BEFORE_ATTRIBUTE_NAME,!1;case G.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Z.SELF_CLOSING_START_TAG,!1;case G.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Z.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Z.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===G.SOLIDUS?this.state=Z.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=Z.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){zD(e)?(this.state=Z.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=Z.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Z.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case G.SOLIDUS:this.state=Z.SCRIPT_DATA_END_TAG_OPEN;break;case G.EXCLAMATION_MARK:this.state=Z.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=Z.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){zD(e)?(this.state=Z.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=Z.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Z.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===G.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=Z.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===G.HYPHEN_MINUS?(this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=Z.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.GREATER_THAN_SIGN:this.state=Z.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===G.SOLIDUS?this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:zD(e)?(this._emitChars(`<`),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){zD(e)?(this.state=Z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(aD.SCRIPT,!1)&&UD(this.preprocessor.peek(aD.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<aD.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.GREATER_THAN_SIGN:this.state=Z.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===G.SOLIDUS?(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(aD.SCRIPT,!1)&&UD(this.preprocessor.peek(aD.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<aD.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Z.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this.state=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._err(K.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=Z.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=Z.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this._leaveAttrName(),this.state=Z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._leaveAttrName(),this.state=Z.BEFORE_ATTRIBUTE_VALUE;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:this._err(K.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(LD(e)?VD(e):e)}}_stateAfterAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:this.state=Z.SELF_CLOSING_START_TAG;break;case G.EQUALS_SIGN:this.state=Z.BEFORE_ATTRIBUTE_VALUE;break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=Z.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:this.state=Z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case G.APOSTROPHE:this.state=Z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingAttributeValue),this.state=Z.DATA,this.emitCurrentTagToken();break;default:this.state=Z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case G.QUOTATION_MARK:this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case G.APOSTROPHE:this.state=Z.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=Z.BEFORE_ATTRIBUTE_NAME;break;case G.AMPERSAND:this._startCharacterReference();break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:case G.EQUALS_SIGN:case G.GRAVE_ACCENT:this._err(K.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=Z.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this._leaveAttrValue(),this.state=Z.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Z.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.missingWhitespaceBetweenAttributes),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case G.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=Z.DATA,this.emitCurrentTagToken();break}case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.unexpectedSolidusInTag),this.state=Z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentComment(t);break;case G.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(aD.DASH_DASH,!0)?(this._createCommentToken(aD.DASH_DASH.length+1),this.state=Z.COMMENT_START):this._consumeSequenceIfMatch(aD.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(aD.DOCTYPE.length+1),this.state=Z.DOCTYPE):this._consumeSequenceIfMatch(aD.CDATA_START,!0)?this.inForeignNode?this.state=Z.CDATA_SECTION:(this._err(K.cdataInHtmlContent),this._createCommentToken(aD.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=Z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(K.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Z.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case G.HYPHEN_MINUS:this.state=Z.COMMENT_START_DASH;break;case G.GREATER_THAN_SIGN:{this._err(K.abruptClosingOfEmptyComment),this.state=Z.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=Z.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Z.COMMENT_END;break;case G.GREATER_THAN_SIGN:this._err(K.abruptClosingOfEmptyComment),this.state=Z.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Z.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Z.COMMENT_END_DASH;break;case G.LESS_THAN_SIGN:t.data+=`<`,this.state=Z.COMMENT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case G.EXCLAMATION_MARK:t.data+=`!`,this.state=Z.COMMENT_LESS_THAN_SIGN_BANG;break;case G.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=Z.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===G.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Z.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===G.HYPHEN_MINUS?this.state=Z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Z.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==G.GREATER_THAN_SIGN&&e!==G.EOF&&this._err(K.nestedComment),this.state=Z.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Z.COMMENT_END;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Z.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentComment(t);break;case G.EXCLAMATION_MARK:this.state=Z.COMMENT_END_BANG;break;case G.HYPHEN_MINUS:t.data+=`-`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=Z.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:t.data+=`--!`,this.state=Z.COMMENT_END_DASH;break;case G.GREATER_THAN_SIGN:this._err(K.incorrectlyClosedComment),this.state=Z.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=Z.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BEFORE_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(K.missingWhitespaceBeforeDoctypeName),this.state=Z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(LD(e))this._createDoctypeToken(String.fromCharCode(VD(e))),this.state=Z.DOCTYPE_NAME;else switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.NULL:this._err(K.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=Z.DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:{this._err(K.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Z.DATA;break}case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Z.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.AFTER_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.NULL:this._err(K.unexpectedNullCharacter),t.name+=`�`;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(LD(e)?VD(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(aD.PUBLIC,!1)?this.state=Z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(aD.SYSTEM,!1)?this.state=Z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(K.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.publicId=``,this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.publicId=``,this.state=Z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=Z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case G.GREATER_THAN_SIGN:this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.QUOTATION_MARK:t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=Z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=Z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Z.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Z.DATA;break;case G.NULL:this._err(K.unexpectedNullCharacter);break;case G.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case G.RIGHT_SQUARE_BRACKET:this.state=Z.CDATA_SECTION_BRACKET;break;case G.EOF:this._err(K.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===G.RIGHT_SQUARE_BRACKET?this.state=Z.CDATA_SECTION_END:(this._emitChars(`]`),this.state=Z.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case G.GREATER_THAN_SIGN:this.state=Z.DATA;break;case G.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=Z.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(G.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&BD(this.preprocessor.peek(1))?Z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){BD(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===G.SEMICOLON&&this._err(K.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},KD=new Set([Y.DD,Y.DT,Y.LI,Y.OPTGROUP,Y.OPTION,Y.P,Y.RB,Y.RP,Y.RT,Y.RTC]),qD=new Set([...KD,Y.CAPTION,Y.COLGROUP,Y.TBODY,Y.TD,Y.TFOOT,Y.TH,Y.THEAD,Y.TR]),JD=new Set([Y.APPLET,Y.CAPTION,Y.HTML,Y.MARQUEE,Y.OBJECT,Y.TABLE,Y.TD,Y.TEMPLATE,Y.TH]),YD=new Set([...JD,Y.OL,Y.UL]),XD=new Set([...JD,Y.BUTTON]),ZD=new Set([Y.ANNOTATION_XML,Y.MI,Y.MN,Y.MO,Y.MS,Y.MTEXT]),QD=new Set([Y.DESC,Y.FOREIGN_OBJECT,Y.TITLE]),$D=new Set([Y.TR,Y.TEMPLATE,Y.HTML]),eO=new Set([Y.TBODY,Y.TFOOT,Y.THEAD,Y.TEMPLATE,Y.HTML]),tO=new Set([Y.TABLE,Y.TEMPLATE,Y.HTML]),nO=new Set([Y.TD,Y.TH]),rO=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=Y.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===Y.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===q.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==q.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(PD,q.HTML)}popUntilTableCellPopped(){this.popUntilPopped(nO,q.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(tO,q.HTML)}clearBackToTableBodyContext(){this.clearBackTo(eO,q.HTML)}clearBackToTableRowContext(){this.clearBackTo($D,q.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===Y.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===Y.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case q.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case q.SVG:if(QD.has(r))return!1;break;case q.MATHML:if(ZD.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,JD)}hasInListItemScope(e){return this.hasInDynamicScope(e,YD)}hasInButtonScope(e){return this.hasInDynamicScope(e,XD)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case q.HTML:if(PD.has(t))return!0;if(JD.has(t))return!1;break;case q.SVG:if(QD.has(t))return!1;break;case q.MATHML:if(ZD.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===q.HTML)switch(this.tagIDs[t]){case e:return!0;case Y.TABLE:case Y.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===q.HTML)switch(this.tagIDs[e]){case Y.TBODY:case Y.THEAD:case Y.TFOOT:return!0;case Y.TABLE:case Y.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===q.HTML)switch(this.tagIDs[t]){case e:return!0;case Y.OPTION:case Y.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&KD.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&qD.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&qD.has(this.currentTagId);)this.pop()}},iO=3,aO;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(aO||={});var oO={type:aO.Marker},sO=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===aO.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<iO)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<iO)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=iO&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(oO)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:aO.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:aO.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(oO);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===aO.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===aO.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===aO.Element&&t.element===e)}},cO={createDocument(){return{nodeName:`#document`,mode:AD.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};cO.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(cO.isTextNode(n)){n.value+=t;return}}cO.appendChild(e,cO.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&cO.isTextNode(r)?r.value+=t:cO.insertBefore(e,cO.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},lO=`html`,uO=`about:legacy-compat`,dO=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,fO=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),pO=[...fO,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],mO=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),hO=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],gO=[...hO,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function _O(e,t){return t.some(t=>e.startsWith(t))}function vO(e){return e.name===lO&&e.publicId===null&&(e.systemId===null||e.systemId===uO)}function yO(e){if(e.name!==lO)return AD.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===dO)return AD.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),mO.has(n))return AD.QUIRKS;let e=t===null?pO:fO;if(_O(n,e))return AD.QUIRKS;if(e=t===null?hO:gO,_O(n,e))return AD.LIMITED_QUIRKS}return AD.NO_QUIRKS}var bO={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},xO=`definitionurl`,SO=`definitionURL`,CO=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),wO=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:q.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:q.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:q.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:q.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:q.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:q.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:q.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:q.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:q.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:q.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:q.XMLNS}]]),TO=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),EO=new Set([Y.B,Y.BIG,Y.BLOCKQUOTE,Y.BODY,Y.BR,Y.CENTER,Y.CODE,Y.DD,Y.DIV,Y.DL,Y.DT,Y.EM,Y.EMBED,Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6,Y.HEAD,Y.HR,Y.I,Y.IMG,Y.LI,Y.LISTING,Y.MENU,Y.META,Y.NOBR,Y.OL,Y.P,Y.PRE,Y.RUBY,Y.S,Y.SMALL,Y.SPAN,Y.STRONG,Y.STRIKE,Y.SUB,Y.SUP,Y.TABLE,Y.TT,Y.U,Y.UL,Y.VAR]);function DO(e){let t=e.tagID;return t===Y.FONT&&e.attrs.some(({name:e})=>e===kD.COLOR||e===kD.SIZE||e===kD.FACE)||EO.has(t)}function OO(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===xO){e.attrs[t].name=SO;break}}function kO(e){for(let t=0;t<e.attrs.length;t++){let n=CO.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function AO(e){for(let t=0;t<e.attrs.length;t++){let n=wO.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function jO(e){let t=TO.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=MD(e.tagName))}function MO(e,t){return t===q.MATHML&&(e===Y.MI||e===Y.MO||e===Y.MN||e===Y.MS||e===Y.MTEXT)}function NO(e,t,n){if(t===q.MATHML&&e===Y.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===kD.ENCODING){let t=n[e].value.toLowerCase();return t===bO.TEXT_HTML||t===bO.APPLICATION_XML}}return t===q.SVG&&(e===Y.FOREIGN_OBJECT||e===Y.DESC||e===Y.TITLE)}function PO(e,t,n,r){return(!r||r===q.HTML)&&NO(e,t,n)||(!r||r===q.MATHML)&&MO(e,t)}var FO=`hidden`,IO=8,LO=3,Q;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(Q||={});var RO={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},zO=new Set([Y.TABLE,Y.TBODY,Y.TFOOT,Y.THEAD,Y.TR]),BO={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:cO,onParseError:null},VO=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=Q.INITIAL,this.originalInsertionMode=Q.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...BO,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new GD(this.options,this),this.activeFormattingElements=new sO(this.treeAdapter),this.fragmentContextID=n?MD(this.treeAdapter.getTagName(n)):Y.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new rO(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...BO,...t};e??=n.treeAdapter.createElement(J.TEMPLATE,q.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,q.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===Y.TEMPLATE&&i.tmplInsertionModeStack.unshift(Q.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??RO,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===q.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,q.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Q.TEXT}switchToPlaintextParsing(){this.insertionMode=Q.TEXT,this.originalInsertionMode=Q.IN_BODY,this.tokenizer.state=FD.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===J.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==q.HTML))switch(this.fragmentContextID){case Y.TITLE:case Y.TEXTAREA:this.tokenizer.state=FD.RCDATA;break;case Y.STYLE:case Y.XMP:case Y.IFRAME:case Y.NOEMBED:case Y.NOFRAMES:case Y.NOSCRIPT:this.tokenizer.state=FD.RAWTEXT;break;case Y.SCRIPT:this.tokenizer.state=FD.SCRIPT_DATA;break;case Y.PLAINTEXT:this.tokenizer.state=FD.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,q.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,q.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(J.HTML,q.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,Y.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===pD.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===Y.SVG&&this.treeAdapter.getTagName(t)===J.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===q.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===Y.MGLYPH||e.tagID===Y.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,q.HTML)}_processToken(e){switch(e.type){case pD.CHARACTER:this.onCharacter(e);break;case pD.NULL_CHARACTER:this.onNullCharacter(e);break;case pD.COMMENT:this.onComment(e);break;case pD.DOCTYPE:this.onDoctype(e);break;case pD.START_TAG:this._processStartTag(e);break;case pD.END_TAG:this.onEndTag(e);break;case pD.EOF:this.onEof(e);break;case pD.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return PO(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===aO.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Q.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(Y.P),this.openElements.popUntilTagNamePopped(Y.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case Y.TR:this.insertionMode=Q.IN_ROW;return;case Y.TBODY:case Y.THEAD:case Y.TFOOT:this.insertionMode=Q.IN_TABLE_BODY;return;case Y.CAPTION:this.insertionMode=Q.IN_CAPTION;return;case Y.COLGROUP:this.insertionMode=Q.IN_COLUMN_GROUP;return;case Y.TABLE:this.insertionMode=Q.IN_TABLE;return;case Y.BODY:this.insertionMode=Q.IN_BODY;return;case Y.FRAMESET:this.insertionMode=Q.IN_FRAMESET;return;case Y.SELECT:this._resetInsertionModeForSelect(e);return;case Y.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case Y.HTML:this.insertionMode=this.headElement?Q.AFTER_HEAD:Q.BEFORE_HEAD;return;case Y.TD:case Y.TH:if(e>0){this.insertionMode=Q.IN_CELL;return}break;case Y.HEAD:if(e>0){this.insertionMode=Q.IN_HEAD;return}}this.insertionMode=Q.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===Y.TEMPLATE)break;if(e===Y.TABLE){this.insertionMode=Q.IN_SELECT_IN_TABLE;return}}this.insertionMode=Q.IN_SELECT}_isElementCausesFosterParenting(e){return zO.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case Y.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===q.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case Y.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return ND[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){aj(this,e);return}switch(this.insertionMode){case Q.INITIAL:ek(this,e);break;case Q.BEFORE_HTML:rk(this,e);break;case Q.BEFORE_HEAD:ok(this,e);break;case Q.IN_HEAD:uk(this,e);break;case Q.IN_HEAD_NO_SCRIPT:pk(this,e);break;case Q.AFTER_HEAD:gk(this,e);break;case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:yk(this,e);break;case Q.TEXT:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:mA(this,e);break;case Q.IN_TABLE_TEXT:DA(this,e);break;case Q.IN_COLUMN_GROUP:PA(this,e);break;case Q.AFTER_BODY:XA(this,e);break;case Q.AFTER_AFTER_BODY:nj(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){ij(this,e);return}switch(this.insertionMode){case Q.INITIAL:ek(this,e);break;case Q.BEFORE_HTML:rk(this,e);break;case Q.BEFORE_HEAD:ok(this,e);break;case Q.IN_HEAD:uk(this,e);break;case Q.IN_HEAD_NO_SCRIPT:pk(this,e);break;case Q.AFTER_HEAD:gk(this,e);break;case Q.TEXT:this._insertCharacters(e);break;case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:mA(this,e);break;case Q.IN_COLUMN_GROUP:PA(this,e);break;case Q.AFTER_BODY:XA(this,e);break;case Q.AFTER_AFTER_BODY:nj(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){YO(this,e);return}switch(this.insertionMode){case Q.INITIAL:case Q.BEFORE_HTML:case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_TEMPLATE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:YO(this,e);break;case Q.IN_TABLE_TEXT:OA(this,e);break;case Q.AFTER_BODY:XO(this,e);break;case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:ZO(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Q.INITIAL:$O(this,e);break;case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:this._err(e,K.misplacedDoctype);break;case Q.IN_TABLE_TEXT:OA(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,K.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?sj(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Q.INITIAL:ek(this,e);break;case Q.BEFORE_HTML:tk(this,e);break;case Q.BEFORE_HEAD:ik(this,e);break;case Q.IN_HEAD:sk(this,e);break;case Q.IN_HEAD_NO_SCRIPT:dk(this,e);break;case Q.AFTER_HEAD:mk(this,e);break;case Q.IN_BODY:Qk(this,e);break;case Q.IN_TABLE:CA(this,e);break;case Q.IN_TABLE_TEXT:OA(this,e);break;case Q.IN_CAPTION:AA(this,e);break;case Q.IN_COLUMN_GROUP:MA(this,e);break;case Q.IN_TABLE_BODY:FA(this,e);break;case Q.IN_ROW:LA(this,e);break;case Q.IN_CELL:zA(this,e);break;case Q.IN_SELECT:VA(this,e);break;case Q.IN_SELECT_IN_TABLE:UA(this,e);break;case Q.IN_TEMPLATE:GA(this,e);break;case Q.AFTER_BODY:JA(this,e);break;case Q.IN_FRAMESET:ZA(this,e);break;case Q.AFTER_FRAMESET:$A(this,e);break;case Q.AFTER_AFTER_BODY:tj(this,e);break;case Q.AFTER_AFTER_FRAMESET:rj(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?cj(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Q.INITIAL:ek(this,e);break;case Q.BEFORE_HTML:nk(this,e);break;case Q.BEFORE_HEAD:ak(this,e);break;case Q.IN_HEAD:ck(this,e);break;case Q.IN_HEAD_NO_SCRIPT:fk(this,e);break;case Q.AFTER_HEAD:hk(this,e);break;case Q.IN_BODY:uA(this,e);break;case Q.TEXT:fA(this,e);break;case Q.IN_TABLE:wA(this,e);break;case Q.IN_TABLE_TEXT:OA(this,e);break;case Q.IN_CAPTION:jA(this,e);break;case Q.IN_COLUMN_GROUP:NA(this,e);break;case Q.IN_TABLE_BODY:IA(this,e);break;case Q.IN_ROW:RA(this,e);break;case Q.IN_CELL:BA(this,e);break;case Q.IN_SELECT:HA(this,e);break;case Q.IN_SELECT_IN_TABLE:WA(this,e);break;case Q.IN_TEMPLATE:KA(this,e);break;case Q.AFTER_BODY:YA(this,e);break;case Q.IN_FRAMESET:QA(this,e);break;case Q.AFTER_FRAMESET:ej(this,e);break;case Q.AFTER_AFTER_BODY:nj(this,e)}}onEof(e){switch(this.insertionMode){case Q.INITIAL:ek(this,e);break;case Q.BEFORE_HTML:rk(this,e);break;case Q.BEFORE_HEAD:ok(this,e);break;case Q.IN_HEAD:uk(this,e);break;case Q.IN_HEAD_NO_SCRIPT:pk(this,e);break;case Q.AFTER_HEAD:gk(this,e);break;case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:dA(this,e);break;case Q.TEXT:pA(this,e);break;case Q.IN_TABLE_TEXT:OA(this,e);break;case Q.IN_TEMPLATE:qA(this,e);break;case Q.AFTER_BODY:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:QO(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===G.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.TEXT:case Q.IN_COLUMN_GROUP:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:this._insertCharacters(e);break;case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:case Q.AFTER_BODY:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:vk(this,e);break;case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:mA(this,e);break;case Q.IN_TABLE_TEXT:EA(this,e)}}};function HO(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):lA(e,t),n}function UO(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function WO(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=LO;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=GO(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function GO(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function KO(e,t,n){let r=MD(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===Y.TEMPLATE&&i===q.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function qO(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function JO(e,t){for(let n=0;n<IO;n++){let n=HO(e,t);if(!n)break;let r=UO(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=WO(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&KO(e,a,i),qO(e,r,n)}}function YO(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function XO(e,t){e._appendCommentNode(t,e.openElements.items[0])}function ZO(e,t){e._appendCommentNode(t,e.document)}function QO(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function $O(e,t){e._setDocumentType(t);let n=t.forceQuirks?AD.QUIRKS:yO(t);vO(t)||e._err(t,K.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Q.BEFORE_HTML}function ek(e,t){e._err(t,K.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,AD.QUIRKS),e.insertionMode=Q.BEFORE_HTML,e._processToken(t)}function tk(e,t){t.tagID===Y.HTML?(e._insertElement(t,q.HTML),e.insertionMode=Q.BEFORE_HEAD):rk(e,t)}function nk(e,t){let n=t.tagID;(n===Y.HTML||n===Y.HEAD||n===Y.BODY||n===Y.BR)&&rk(e,t)}function rk(e,t){e._insertFakeRootElement(),e.insertionMode=Q.BEFORE_HEAD,e._processToken(t)}function ik(e,t){switch(t.tagID){case Y.HTML:Qk(e,t);break;case Y.HEAD:e._insertElement(t,q.HTML),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD;break;default:ok(e,t)}}function ak(e,t){let n=t.tagID;n===Y.HEAD||n===Y.BODY||n===Y.HTML||n===Y.BR?ok(e,t):e._err(t,K.endTagWithoutMatchingOpenElement)}function ok(e,t){e._insertFakeElement(J.HEAD,Y.HEAD),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD,e._processToken(t)}function sk(e,t){switch(t.tagID){case Y.HTML:Qk(e,t);break;case Y.BASE:case Y.BASEFONT:case Y.BGSOUND:case Y.LINK:case Y.META:e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.TITLE:e._switchToTextParsing(t,FD.RCDATA);break;case Y.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,FD.RAWTEXT):(e._insertElement(t,q.HTML),e.insertionMode=Q.IN_HEAD_NO_SCRIPT);break;case Y.NOFRAMES:case Y.STYLE:e._switchToTextParsing(t,FD.RAWTEXT);break;case Y.SCRIPT:e._switchToTextParsing(t,FD.SCRIPT_DATA);break;case Y.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Q.IN_TEMPLATE);break;case Y.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:uk(e,t)}}function ck(e,t){switch(t.tagID){case Y.HEAD:e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD;break;case Y.BODY:case Y.BR:case Y.HTML:uk(e,t);break;case Y.TEMPLATE:lk(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function lk(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==Y.TEMPLATE&&e._err(t,K.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(Y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,K.endTagWithoutMatchingOpenElement)}function uk(e,t){e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD,e._processToken(t)}function dk(e,t){switch(t.tagID){case Y.HTML:Qk(e,t);break;case Y.BASEFONT:case Y.BGSOUND:case Y.HEAD:case Y.LINK:case Y.META:case Y.NOFRAMES:case Y.STYLE:sk(e,t);break;case Y.NOSCRIPT:e._err(t,K.nestedNoscriptInHead);break;default:pk(e,t)}}function fk(e,t){switch(t.tagID){case Y.NOSCRIPT:e.openElements.pop(),e.insertionMode=Q.IN_HEAD;break;case Y.BR:pk(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function pk(e,t){let n=t.type===pD.EOF?K.openElementsLeftAfterEof:K.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Q.IN_HEAD,e._processToken(t)}function mk(e,t){switch(t.tagID){case Y.HTML:Qk(e,t);break;case Y.BODY:e._insertElement(t,q.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_BODY;break;case Y.FRAMESET:e._insertElement(t,q.HTML),e.insertionMode=Q.IN_FRAMESET;break;case Y.BASE:case Y.BASEFONT:case Y.BGSOUND:case Y.LINK:case Y.META:case Y.NOFRAMES:case Y.SCRIPT:case Y.STYLE:case Y.TEMPLATE:case Y.TITLE:e._err(t,K.abandonedHeadElementChild),e.openElements.push(e.headElement,Y.HEAD),sk(e,t),e.openElements.remove(e.headElement);break;case Y.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:gk(e,t)}}function hk(e,t){switch(t.tagID){case Y.BODY:case Y.HTML:case Y.BR:gk(e,t);break;case Y.TEMPLATE:lk(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function gk(e,t){e._insertFakeElement(J.BODY,Y.BODY),e.insertionMode=Q.IN_BODY,_k(e,t)}function _k(e,t){switch(t.type){case pD.CHARACTER:yk(e,t);break;case pD.WHITESPACE_CHARACTER:vk(e,t);break;case pD.COMMENT:YO(e,t);break;case pD.START_TAG:Qk(e,t);break;case pD.END_TAG:uA(e,t);break;case pD.EOF:dA(e,t)}}function vk(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function yk(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function bk(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function xk(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Sk(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_FRAMESET)}function Ck(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML)}function wk(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&PD.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,q.HTML)}function Tk(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Ek(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),n||(e.formElement=e.openElements.current))}function Dk(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===Y.LI&&r===Y.LI||(n===Y.DD||n===Y.DT)&&(r===Y.DD||r===Y.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==Y.ADDRESS&&r!==Y.DIV&&r!==Y.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML)}function Ok(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),e.tokenizer.state=FD.PLAINTEXT}function kk(e,t){e.openElements.hasInScope(Y.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.framesetOk=!1}function Ak(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(J.A);n&&(JO(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function jk(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Mk(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(Y.NOBR)&&(JO(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,q.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Nk(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Pk(e,t){e.treeAdapter.getDocumentMode(e.document)!==AD.QUIRKS&&e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._insertElement(t,q.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_TABLE}function Fk(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,q.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ik(e){let t=mD(e,kD.TYPE);return t!=null&&t.toLowerCase()===FO}function Lk(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,q.HTML),Ik(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Rk(e,t){e._appendElement(t,q.HTML),t.ackSelfClosing=!0}function zk(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._appendElement(t,q.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Bk(e,t){t.tagName=J.IMG,t.tagID=Y.IMG,Fk(e,t)}function Vk(e,t){e._insertElement(t,q.HTML),e.skipNextNewLine=!0,e.tokenizer.state=FD.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Q.TEXT}function Hk(e,t){e.openElements.hasInButtonScope(Y.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,FD.RAWTEXT)}function Uk(e,t){e.framesetOk=!1,e._switchToTextParsing(t,FD.RAWTEXT)}function Wk(e,t){e._switchToTextParsing(t,FD.RAWTEXT)}function Gk(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Q.IN_TABLE||e.insertionMode===Q.IN_CAPTION||e.insertionMode===Q.IN_TABLE_BODY||e.insertionMode===Q.IN_ROW||e.insertionMode===Q.IN_CELL?Q.IN_SELECT_IN_TABLE:Q.IN_SELECT}function Kk(e,t){e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML)}function qk(e,t){e.openElements.hasInScope(Y.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,q.HTML)}function Jk(e,t){e.openElements.hasInScope(Y.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(Y.RTC),e._insertElement(t,q.HTML)}function Yk(e,t){e._reconstructActiveFormattingElements(),OO(t),AO(t),t.selfClosing?e._appendElement(t,q.MATHML):e._insertElement(t,q.MATHML),t.ackSelfClosing=!0}function Xk(e,t){e._reconstructActiveFormattingElements(),kO(t),AO(t),t.selfClosing?e._appendElement(t,q.SVG):e._insertElement(t,q.SVG),t.ackSelfClosing=!0}function Zk(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,q.HTML)}function Qk(e,t){switch(t.tagID){case Y.I:case Y.S:case Y.B:case Y.U:case Y.EM:case Y.TT:case Y.BIG:case Y.CODE:case Y.FONT:case Y.SMALL:case Y.STRIKE:case Y.STRONG:jk(e,t);break;case Y.A:Ak(e,t);break;case Y.H1:case Y.H2:case Y.H3:case Y.H4:case Y.H5:case Y.H6:wk(e,t);break;case Y.P:case Y.DL:case Y.OL:case Y.UL:case Y.DIV:case Y.DIR:case Y.NAV:case Y.MAIN:case Y.MENU:case Y.ASIDE:case Y.CENTER:case Y.FIGURE:case Y.FOOTER:case Y.HEADER:case Y.HGROUP:case Y.DIALOG:case Y.DETAILS:case Y.ADDRESS:case Y.ARTICLE:case Y.SEARCH:case Y.SECTION:case Y.SUMMARY:case Y.FIELDSET:case Y.BLOCKQUOTE:case Y.FIGCAPTION:Ck(e,t);break;case Y.LI:case Y.DD:case Y.DT:Dk(e,t);break;case Y.BR:case Y.IMG:case Y.WBR:case Y.AREA:case Y.EMBED:case Y.KEYGEN:Fk(e,t);break;case Y.HR:zk(e,t);break;case Y.RB:case Y.RTC:qk(e,t);break;case Y.RT:case Y.RP:Jk(e,t);break;case Y.PRE:case Y.LISTING:Tk(e,t);break;case Y.XMP:Hk(e,t);break;case Y.SVG:Xk(e,t);break;case Y.HTML:bk(e,t);break;case Y.BASE:case Y.LINK:case Y.META:case Y.STYLE:case Y.TITLE:case Y.SCRIPT:case Y.BGSOUND:case Y.BASEFONT:case Y.TEMPLATE:sk(e,t);break;case Y.BODY:xk(e,t);break;case Y.FORM:Ek(e,t);break;case Y.NOBR:Mk(e,t);break;case Y.MATH:Yk(e,t);break;case Y.TABLE:Pk(e,t);break;case Y.INPUT:Lk(e,t);break;case Y.PARAM:case Y.TRACK:case Y.SOURCE:Rk(e,t);break;case Y.IMAGE:Bk(e,t);break;case Y.BUTTON:kk(e,t);break;case Y.APPLET:case Y.OBJECT:case Y.MARQUEE:Nk(e,t);break;case Y.IFRAME:Uk(e,t);break;case Y.SELECT:Gk(e,t);break;case Y.OPTION:case Y.OPTGROUP:Kk(e,t);break;case Y.NOEMBED:case Y.NOFRAMES:Wk(e,t);break;case Y.FRAMESET:Sk(e,t);break;case Y.TEXTAREA:Vk(e,t);break;case Y.NOSCRIPT:e.options.scriptingEnabled?Wk(e,t):Zk(e,t);break;case Y.PLAINTEXT:Ok(e,t);break;case Y.COL:case Y.TH:case Y.TD:case Y.TR:case Y.HEAD:case Y.FRAME:case Y.TBODY:case Y.TFOOT:case Y.THEAD:case Y.CAPTION:case Y.COLGROUP:break;default:Zk(e,t)}}function $k(e,t){if(e.openElements.hasInScope(Y.BODY)&&(e.insertionMode=Q.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function eA(e,t){e.openElements.hasInScope(Y.BODY)&&(e.insertionMode=Q.AFTER_BODY,YA(e,t))}function tA(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function nA(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(Y.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(Y.FORM):n&&e.openElements.remove(n))}function rA(e){e.openElements.hasInButtonScope(Y.P)||e._insertFakeElement(J.P,Y.P),e._closePElement()}function iA(e){e.openElements.hasInListItemScope(Y.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(Y.LI),e.openElements.popUntilTagNamePopped(Y.LI))}function aA(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function oA(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function sA(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function cA(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(J.BR,Y.BR),e.openElements.pop(),e.framesetOk=!1}function lA(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==Y.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function uA(e,t){switch(t.tagID){case Y.A:case Y.B:case Y.I:case Y.S:case Y.U:case Y.EM:case Y.TT:case Y.BIG:case Y.CODE:case Y.FONT:case Y.NOBR:case Y.SMALL:case Y.STRIKE:case Y.STRONG:JO(e,t);break;case Y.P:rA(e);break;case Y.DL:case Y.UL:case Y.OL:case Y.DIR:case Y.DIV:case Y.NAV:case Y.PRE:case Y.MAIN:case Y.MENU:case Y.ASIDE:case Y.BUTTON:case Y.CENTER:case Y.FIGURE:case Y.FOOTER:case Y.HEADER:case Y.HGROUP:case Y.DIALOG:case Y.ADDRESS:case Y.ARTICLE:case Y.DETAILS:case Y.SEARCH:case Y.SECTION:case Y.SUMMARY:case Y.LISTING:case Y.FIELDSET:case Y.BLOCKQUOTE:case Y.FIGCAPTION:tA(e,t);break;case Y.LI:iA(e);break;case Y.DD:case Y.DT:aA(e,t);break;case Y.H1:case Y.H2:case Y.H3:case Y.H4:case Y.H5:case Y.H6:oA(e);break;case Y.BR:cA(e);break;case Y.BODY:$k(e,t);break;case Y.HTML:eA(e,t);break;case Y.FORM:nA(e);break;case Y.APPLET:case Y.OBJECT:case Y.MARQUEE:sA(e,t);break;case Y.TEMPLATE:lk(e,t);break;default:lA(e,t)}}function dA(e,t){e.tmplInsertionModeStack.length>0?qA(e,t):QO(e,t)}function fA(e,t){var n;t.tagID===Y.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function pA(e,t){e._err(t,K.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function mA(e,t){if(e.openElements.currentTagId!==void 0&&zO.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Q.IN_TABLE_TEXT,t.type){case pD.CHARACTER:DA(e,t);break;case pD.WHITESPACE_CHARACTER:EA(e,t)}else TA(e,t)}function hA(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_CAPTION}function gA(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_COLUMN_GROUP}function _A(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.COLGROUP,Y.COLGROUP),e.insertionMode=Q.IN_COLUMN_GROUP,MA(e,t)}function vA(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_TABLE_BODY}function yA(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.TBODY,Y.TBODY),e.insertionMode=Q.IN_TABLE_BODY,FA(e,t)}function bA(e,t){e.openElements.hasInTableScope(Y.TABLE)&&(e.openElements.popUntilTagNamePopped(Y.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function xA(e,t){Ik(t)?e._appendElement(t,q.HTML):TA(e,t),t.ackSelfClosing=!0}function SA(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,q.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function CA(e,t){switch(t.tagID){case Y.TD:case Y.TH:case Y.TR:yA(e,t);break;case Y.STYLE:case Y.SCRIPT:case Y.TEMPLATE:sk(e,t);break;case Y.COL:_A(e,t);break;case Y.FORM:SA(e,t);break;case Y.TABLE:bA(e,t);break;case Y.TBODY:case Y.TFOOT:case Y.THEAD:vA(e,t);break;case Y.INPUT:xA(e,t);break;case Y.CAPTION:hA(e,t);break;case Y.COLGROUP:gA(e,t);break;default:TA(e,t)}}function wA(e,t){switch(t.tagID){case Y.TABLE:e.openElements.hasInTableScope(Y.TABLE)&&(e.openElements.popUntilTagNamePopped(Y.TABLE),e._resetInsertionMode());break;case Y.TEMPLATE:lk(e,t);break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TBODY:case Y.TD:case Y.TFOOT:case Y.TH:case Y.THEAD:case Y.TR:break;default:TA(e,t)}}function TA(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,_k(e,t),e.fosterParentingEnabled=n}function EA(e,t){e.pendingCharacterTokens.push(t)}function DA(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function OA(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)TA(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var kA=new Set([Y.CAPTION,Y.COL,Y.COLGROUP,Y.TBODY,Y.TD,Y.TFOOT,Y.TH,Y.THEAD,Y.TR]);function AA(e,t){let n=t.tagID;kA.has(n)?e.openElements.hasInTableScope(Y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Q.IN_TABLE,CA(e,t)):Qk(e,t)}function jA(e,t){let n=t.tagID;switch(n){case Y.CAPTION:case Y.TABLE:e.openElements.hasInTableScope(Y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Q.IN_TABLE,n===Y.TABLE&&wA(e,t));break;case Y.BODY:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TBODY:case Y.TD:case Y.TFOOT:case Y.TH:case Y.THEAD:case Y.TR:break;default:uA(e,t)}}function MA(e,t){switch(t.tagID){case Y.HTML:Qk(e,t);break;case Y.COL:e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.TEMPLATE:sk(e,t);break;default:PA(e,t)}}function NA(e,t){switch(t.tagID){case Y.COLGROUP:e.openElements.currentTagId===Y.COLGROUP&&(e.openElements.pop(),e.insertionMode=Q.IN_TABLE);break;case Y.TEMPLATE:lk(e,t);break;case Y.COL:break;default:PA(e,t)}}function PA(e,t){e.openElements.currentTagId===Y.COLGROUP&&(e.openElements.pop(),e.insertionMode=Q.IN_TABLE,e._processToken(t))}function FA(e,t){switch(t.tagID){case Y.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_ROW;break;case Y.TH:case Y.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(J.TR,Y.TR),e.insertionMode=Q.IN_ROW,LA(e,t);break;case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.TBODY:case Y.TFOOT:case Y.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE,CA(e,t));break;default:CA(e,t)}}function IA(e,t){let n=t.tagID;switch(t.tagID){case Y.TBODY:case Y.TFOOT:case Y.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE);break;case Y.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE,wA(e,t));break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TD:case Y.TH:case Y.TR:break;default:wA(e,t)}}function LA(e,t){switch(t.tagID){case Y.TH:case Y.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,q.HTML),e.insertionMode=Q.IN_CELL,e.activeFormattingElements.insertMarker();break;case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.TBODY:case Y.TFOOT:case Y.THEAD:case Y.TR:e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY,FA(e,t));break;default:CA(e,t)}}function RA(e,t){switch(t.tagID){case Y.TR:e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY);break;case Y.TABLE:e.openElements.hasInTableScope(Y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY,IA(e,t));break;case Y.TBODY:case Y.TFOOT:case Y.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(Y.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Q.IN_TABLE_BODY,IA(e,t));break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:case Y.TD:case Y.TH:break;default:wA(e,t)}}function zA(e,t){let n=t.tagID;kA.has(n)?(e.openElements.hasInTableScope(Y.TD)||e.openElements.hasInTableScope(Y.TH))&&(e._closeTableCell(),LA(e,t)):Qk(e,t)}function BA(e,t){let n=t.tagID;switch(n){case Y.TD:case Y.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Q.IN_ROW);break;case Y.TABLE:case Y.TBODY:case Y.TFOOT:case Y.THEAD:case Y.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),RA(e,t));break;case Y.BODY:case Y.CAPTION:case Y.COL:case Y.COLGROUP:case Y.HTML:break;default:uA(e,t)}}function VA(e,t){switch(t.tagID){case Y.HTML:Qk(e,t);break;case Y.OPTION:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e._insertElement(t,q.HTML);break;case Y.OPTGROUP:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Y.OPTGROUP&&e.openElements.pop(),e._insertElement(t,q.HTML);break;case Y.HR:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Y.OPTGROUP&&e.openElements.pop(),e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.INPUT:case Y.KEYGEN:case Y.TEXTAREA:case Y.SELECT:e.openElements.hasInSelectScope(Y.SELECT)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),t.tagID!==Y.SELECT&&e._processStartTag(t));break;case Y.SCRIPT:case Y.TEMPLATE:sk(e,t)}}function HA(e,t){switch(t.tagID){case Y.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===Y.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===Y.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===Y.OPTGROUP&&e.openElements.pop();break;case Y.OPTION:e.openElements.currentTagId===Y.OPTION&&e.openElements.pop();break;case Y.SELECT:e.openElements.hasInSelectScope(Y.SELECT)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode());break;case Y.TEMPLATE:lk(e,t)}}function UA(e,t){let n=t.tagID;n===Y.CAPTION||n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR||n===Y.TD||n===Y.TH?(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),e._processStartTag(t)):VA(e,t)}function WA(e,t){let n=t.tagID;n===Y.CAPTION||n===Y.TABLE||n===Y.TBODY||n===Y.TFOOT||n===Y.THEAD||n===Y.TR||n===Y.TD||n===Y.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(Y.SELECT),e._resetInsertionMode(),e.onEndTag(t)):HA(e,t)}function GA(e,t){switch(t.tagID){case Y.BASE:case Y.BASEFONT:case Y.BGSOUND:case Y.LINK:case Y.META:case Y.NOFRAMES:case Y.SCRIPT:case Y.STYLE:case Y.TEMPLATE:case Y.TITLE:sk(e,t);break;case Y.CAPTION:case Y.COLGROUP:case Y.TBODY:case Y.TFOOT:case Y.THEAD:e.tmplInsertionModeStack[0]=Q.IN_TABLE,e.insertionMode=Q.IN_TABLE,CA(e,t);break;case Y.COL:e.tmplInsertionModeStack[0]=Q.IN_COLUMN_GROUP,e.insertionMode=Q.IN_COLUMN_GROUP,MA(e,t);break;case Y.TR:e.tmplInsertionModeStack[0]=Q.IN_TABLE_BODY,e.insertionMode=Q.IN_TABLE_BODY,FA(e,t);break;case Y.TD:case Y.TH:e.tmplInsertionModeStack[0]=Q.IN_ROW,e.insertionMode=Q.IN_ROW,LA(e,t);break;default:e.tmplInsertionModeStack[0]=Q.IN_BODY,e.insertionMode=Q.IN_BODY,Qk(e,t)}}function KA(e,t){t.tagID===Y.TEMPLATE&&lk(e,t)}function qA(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(Y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):QO(e,t)}function JA(e,t){t.tagID===Y.HTML?Qk(e,t):XA(e,t)}function YA(e,t){if(t.tagID===Y.HTML){if(e.fragmentContext||(e.insertionMode=Q.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===Y.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else XA(e,t)}function XA(e,t){e.insertionMode=Q.IN_BODY,_k(e,t)}function ZA(e,t){switch(t.tagID){case Y.HTML:Qk(e,t);break;case Y.FRAMESET:e._insertElement(t,q.HTML);break;case Y.FRAME:e._appendElement(t,q.HTML),t.ackSelfClosing=!0;break;case Y.NOFRAMES:sk(e,t)}}function QA(e,t){t.tagID===Y.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==Y.FRAMESET&&(e.insertionMode=Q.AFTER_FRAMESET))}function $A(e,t){switch(t.tagID){case Y.HTML:Qk(e,t);break;case Y.NOFRAMES:sk(e,t)}}function ej(e,t){t.tagID===Y.HTML&&(e.insertionMode=Q.AFTER_AFTER_FRAMESET)}function tj(e,t){t.tagID===Y.HTML?Qk(e,t):nj(e,t)}function nj(e,t){e.insertionMode=Q.IN_BODY,_k(e,t)}function rj(e,t){switch(t.tagID){case Y.HTML:Qk(e,t);break;case Y.NOFRAMES:sk(e,t)}}function ij(e,t){t.chars=`�`,e._insertCharacters(t)}function aj(e,t){e._insertCharacters(t),e.framesetOk=!1}function oj(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==q.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function sj(e,t){if(DO(t))oj(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===q.MATHML?OO(t):r===q.SVG&&(jO(t),kO(t)),AO(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function cj(e,t){if(t.tagID===Y.P||t.tagID===Y.BR){oj(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===q.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}J.AREA,J.BASE,J.BASEFONT,J.BGSOUND,J.BR,J.COL,J.EMBED,J.FRAME,J.HR,J.IMG,J.INPUT,J.KEYGEN,J.LINK,J.META,J.PARAM,J.SOURCE,J.TRACK,J.WBR;var lj=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,uj=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),dj={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function fj(e,t){let n=Ej(e),r=UE(`type`,{handlers:{root:mj,element:hj,text:gj,comment:yj,doctype:_j,raw:bj},unknown:xj}),i={parser:n?new VO(dj):VO.getFragmentParser(void 0,dj),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),Sj(i,wp());let a=PE(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&hv(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function pj(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function mj(e,t){pj(e.children,t)}function hj(e,t){wj(e,t),pj(e.children,t),Tj(e,t)}function gj(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:pD.CHARACTER,chars:e.value,location:Dj(e)};Sj(t,wp(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function _j(e,t){let n={type:pD.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:Dj(e)};Sj(t,wp(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function vj(e,t){t.stitches=!0;let n=Oj(e);`children`in e&&`children`in n&&(n.children=fj({type:`root`,children:e.children},t.options).children),yj({type:`comment`,value:{stitch:n}},t)}function yj(e,t){let n=e.value,r={type:pD.COMMENT,data:n,location:Dj(e)};Sj(t,wp(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function bj(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Cj(t,wp(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(lj,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function xj(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))vj(n,t);else{let e=``;throw uj.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function Sj(e,t){Cj(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=FD.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function Cj(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function wj(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===FD.PLAINTEXT)return;Sj(t,wp(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:Ay.html;i===Ay.html&&n===`svg`&&(i=Ay.svg);let a=qE({...e,children:[]},{space:i===Ay.svg?`svg`:`html`}),o={type:pD.START_TAG,tagName:n,tagID:MD(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:Dj(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Tj(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&rD.includes(n)||t.parser.tokenizer.state===FD.PLAINTEXT)return;Sj(t,Cp(e));let r={type:pD.END_TAG,tagName:n,tagID:MD(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Dj(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===FD.RCDATA||t.parser.tokenizer.state===FD.RAWTEXT||t.parser.tokenizer.state===FD.SCRIPT_DATA)&&(t.parser.tokenizer.state=FD.DATA)}function Ej(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function Dj(e){let t=wp(e)||{line:void 0,column:void 0,offset:void 0},n=Cp(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Oj(e){return`children`in e?$_({...e,children:[]}):$_(e)}function kj(e){return function(t,n){return fj(t,{...e,file:n})}}var Aj=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],jj={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...Aj,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...Aj],h2:[[`className`,`sr-only`]],img:[...Aj,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...Aj,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...Aj],table:[...Aj],ul:[...Aj,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},Mj={}.hasOwnProperty;function Nj(e,t){let n={type:`root`,children:[]},r=Pj({schema:t?{...jj,...t}:jj,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Pj(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Fj(e,n);case`doctype`:return Ij(e,n);case`element`:return Lj(e,n);case`root`:return Rj(e,n);case`text`:return zj(e,n)}}}function Fj(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return Kj(r,t),r}}function Ij(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return Kj(e,t),e}}function Lj(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=Bj(e,t.children),i=Vj(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Mj.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return Kj(o,t),o}function Rj(e,t){let n={type:`root`,children:Bj(e,t.children)};return Kj(n,t),n}function zj(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return Kj(n,t),n}function Bj(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=Pj(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Vj(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&Mj.call(r,n)?r[n]:void 0,o=r&&Mj.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(Mj.call(s,l)){let t=s[l],n=Hj(e,qj(a,l),l,t);n??=Hj(e,qj(o,l),l,t),n!=null&&(c[l]=n)}if(i&&Mj.call(i,n)){let e=i[n];for(l in e)Mj.call(e,l)&&!Mj.call(c,l)&&(c[l]=e[l])}return c}function Hj(e,t,n,r){return t?Array.isArray(r)?Uj(e,t,n,r):Wj(e,t,n,r):void 0}function Uj(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=Wj(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function Wj(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&Gj(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Gj(e,t,n){let r=e.schema.protocols&&Mj.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function Kj(e,t){let n=Ep(t);t.data&&(e.data=$_(t.data)),n&&(e.position=n)}function qj(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function Jj(e){return function(t){return Nj(t,e)}}function Yj(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Xj(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Zj(e,t,n){let r=rv((n||{}).ignore||[]),i=Qj(t),a=-1;for(;++a<i.length;)pv(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Qj(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([$j(e[0]),eM(e[1])])}return t}function $j(e){return typeof e==`string`?new RegExp(Xj(e),`g`):e}function eM(e){return typeof e==`function`?e:function(){return e}}var tM=`phrasing`,nM=[`autolink`,`link`,`image`,`label`];function rM(){return{transforms:[dM],enter:{literalAutolink:aM,literalAutolinkEmail:oM,literalAutolinkHttp:oM,literalAutolinkWww:oM},exit:{literalAutolink:uM,literalAutolinkEmail:lM,literalAutolinkHttp:sM,literalAutolinkWww:cM}}}function iM(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:tM,notInConstruct:nM},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:tM,notInConstruct:nM},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:tM,notInConstruct:nM}]}}function aM(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function oM(e){this.config.enter.autolinkProtocol.call(this,e)}function sM(e){this.config.exit.autolinkProtocol.call(this,e)}function cM(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function lM(e){this.config.exit.autolinkEmail.call(this,e)}function uM(e){this.exit(e)}function dM(e){Zj(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fM],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,pM]],{ignore:[`link`,`linkReference`]})}function fM(e,t,n,r,i){let a=``;if(!gM(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!mM(n)))return!1;let o=hM(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function pM(e,t,n,r){return!gM(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function mM(e){let 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 hM(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Yj(e,`(`),a=Yj(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function gM(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Pm(n)||Nm(n))&&(!t||n!==47)}EM.peek=TM;function _M(){this.buffer()}function vM(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function yM(){this.buffer()}function bM(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function xM(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sm(this.sliceSerialize(e)).toLowerCase(),n.label=t}function SM(e){this.exit(e)}function CM(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Sm(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wM(e){this.exit(e)}function TM(){return`[`}function EM(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function DM(){return{enter:{gfmFootnoteCallString:_M,gfmFootnoteCall:vM,gfmFootnoteDefinitionLabelString:yM,gfmFootnoteDefinition:bM},exit:{gfmFootnoteCallString:xM,gfmFootnoteCall:SM,gfmFootnoteDefinitionLabelString:CM,gfmFootnoteDefinition:wM}}}function OM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:EM},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
304
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?AM:kM))),s(),o}}function kM(e,t,n){return t===0?e:AM(e,t,n)}function AM(e,t,n){return(n?``:` `)+e}var jM=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];IM.peek=LM;function MM(){return{canContainEols:[`delete`],enter:{strikethrough:PM},exit:{strikethrough:FM}}}function NM(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:jM}],handlers:{delete:IM}}}function PM(e){this.enter({type:`delete`,children:[]},e)}function FM(e){this.exit(e)}function IM(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function LM(){return`~`}function RM(e){return e.length}function zM(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||RM,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=BM(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=VM(r[d]);else{let e=VM(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
305
|
+
`)}function BM(e){return e==null?``:String(e)}function VM(e){let 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 HM(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),UM);return i(),o}function UM(e,t,n){return`>`+(n?``:` `)+e}function WM(e,t){return GM(e,t.inConstruct,!0)&&!GM(e,t.notInConstruct,!1)}function GM(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function KM(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
306
|
+
`&&WM(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
307
|
+
`}function qM(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function JM(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 YM(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function XM(e,t,n,r){let i=YM(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(JM(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,ZM);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(qM(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
308
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
309
|
+
`),a&&(u+=s.move(a+`
|
|
310
|
+
`)),u+=s.move(c),l(),u}function ZM(e,t,n){return(n?``:` `)+e}function QM(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function $M(e,t,n,r){let i=QM(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
311
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function eN(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function tN(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function nN(e,t,n){let r=Wm(e),i=Wm(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}rN.peek=iN;function rN(e,t,n,r){let i=eN(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=nN(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=tN(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=nN(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+tN(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function iN(e,t,n){return n.options.emphasis||`*`}function aN(e,t){let n=!1;return hv(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&lm(e)&&(t.options.setext||n))}function oN(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(aN(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
312
|
+
`,after:`
|
|
313
|
+
`});return r(),t(),o+`
|
|
314
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
315
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
316
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=tN(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}sN.peek=cN;function sN(e){return e.value||``}function cN(){return`<`}lN.peek=uN;function lN(e,t,n,r){let i=QM(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function uN(){return`!`}dN.peek=fN;function dN(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function fN(){return`!`}pN.peek=mN;function pN(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function mN(){return"`"}function hN(e,t){let n=lm(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))}gN.peek=_N;function gN(e,t,n,r){let i=QM(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(hN(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function _N(e,t,n){return hN(e,n)?`<`:`[`}vN.peek=yN;function vN(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function yN(){return`[`}function bN(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function xN(e){let t=bN(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function SN(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function CN(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function wN(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?SN(n):bN(n),s=e.ordered?o===`.`?`)`:`.`:xN(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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&&(c=!0),CN(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function TN(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function EN(e,t,n,r){let i=TN(n),a=n.bulletCurrent||bN(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function DN(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var ON=rv([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function kN(e,t,n,r){return(e.children.some(function(e){return ON(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function AN(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}jN.peek=MN;function jN(e,t,n,r){let i=AN(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=nN(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=tN(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=nN(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+tN(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function MN(e,t,n){return n.options.strong||`*`}function NN(e,t,n,r){return n.safe(e.value,r)}function PN(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function FN(e,t,n){let r=(CN(n)+(n.options.ruleSpaces?` `:``)).repeat(PN(n));return n.options.ruleSpaces?r.slice(0,-1):r}var IN={blockquote:HM,break:KM,code:XM,definition:$M,emphasis:rN,hardBreak:KM,heading:oN,html:sN,image:lN,imageReference:dN,inlineCode:pN,link:gN,linkReference:vN,list:wN,listItem:EN,paragraph:DN,root:kN,strong:jN,text:NN,thematicBreak:FN};function LN(){return{enter:{table:RN,tableData:HN,tableHeader:HN,tableRow:BN},exit:{codeText:UN,table:zN,tableData:VN,tableHeader:VN,tableRow:VN}}}function RN(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function zN(e){this.exit(e),this.data.inTable=void 0}function BN(e){this.enter({type:`tableRow`,children:[]},e)}function VN(e){this.exit(e)}function HN(e){this.enter({type:`tableCell`,children:[]},e)}function UN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,WN));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function WN(e,t){return t===`|`?t:e}function GN(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
317
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
318
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return zM(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=IN.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function KN(){return{exit:{taskListCheckValueChecked:JN,taskListCheckValueUnchecked:JN,paragraph:YN}}}function qN(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:XN}}}function JN(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function YN(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function XN(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=IN.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function ZN(){return[rM(),DM(),MM(),LN(),KN()]}function QN(e){return{extensions:[iM(),OM(e),NM(),GN(e),qN()]}}var $N={tokenize:pP,partial:!0},eP={tokenize:mP,partial:!0},tP={tokenize:hP,partial:!0},nP={tokenize:gP,partial:!0},rP={tokenize:_P,partial:!0},iP={name:`wwwAutolink`,tokenize:dP,previous:vP},aP={name:`protocolAutolink`,tokenize:fP,previous:yP},oP={name:`emailAutolink`,tokenize:uP,previous:bP},sP={};function cP(){return{text:sP}}for(var lP=48;lP<123;)sP[lP]=oP,lP++,lP===58?lP=65:lP===91&&(lP=97);sP[43]=oP,sP[45]=oP,sP[46]=oP,sP[95]=oP,sP[72]=[oP,aP],sP[104]=[oP,aP],sP[87]=[oP,iP],sP[119]=[oP,iP];function uP(e,t,n){let r=this,i,a;return o;function o(t){return!xP(t)||!bP.call(r,r.previous)||SP(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return xP(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(rP,u,l)(t):t===45||t===95||wm(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Cm(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function dP(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!vP.call(r,r.previous)||SP(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check($N,e.attempt(eP,e.attempt(tP,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function fP(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&yP.call(r,r.previous)&&!SP(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Cm(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Em(t)||jm(t)||Pm(t)||Nm(t)?n(t):e.attempt(eP,e.attempt(tP,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function pP(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function mP(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(nP,c,s)(t):t===null||jm(t)||Pm(t)||t!==45&&Nm(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function hP(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(nP,t,a)(o):o===null||jm(o)||Pm(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function gP(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||jm(o)||Pm(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||jm(e)||Pm(e)?t(e):r(e)}function a(e){return Cm(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Cm(t)?(e.consume(t),o):n(t)}}function _P(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return wm(e)?n(e):t(e)}}function vP(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jm(e)}function yP(e){return!Cm(e)}function bP(e){return!(e===47||xP(e))}function xP(e){return e===43||e===45||e===46||e===95||wm(e)}function SP(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var CP={tokenize:jP,partial:!0};function wP(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:OP,continuation:{tokenize:kP},exit:AP}},text:{91:{name:`gfmFootnoteCall`,tokenize:DP},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:TP,resolveTo:EP}}}}function TP(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Sm(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function EP(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`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function DP(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||jm(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Sm(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return jm(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function OP(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||jm(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Sm(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return jm(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Lm(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function kP(e,t,n){return e.check(Qm,t,e.attempt(CP,t,n))}function AP(e){e.exit(`gfmFootnoteDefinition`)}function jP(e,t,n){let r=this;return Lm(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function MP(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&hm(o,o.length,0,Gm(s,e.slice(r+1,n),t)),hm(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),hm(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Wm(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Wm(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var NP=class{constructor(){this.map=[]}add(e,t,n){PP(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function PP(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function FP(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function IP(){return{flow:{null:{name:`table`,tokenize:LP,resolveAll:RP}}}}function LP(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Am(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Mm(t)?Lm(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||jm(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Mm(t)?Lm(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Mm(t)?Lm(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Am(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Mm(t)?Lm(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Am(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Am(n)?(e.exit(`tableRow`),t(n)):Mm(n)?Lm(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||jm(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function RP(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new NP;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(BP(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=zP(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=zP(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=zP(f,t,o,i,n,d)):(o[0]=o[1],d=zP(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&BP(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=FP(t.events,n))}return e}function zP(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},VP(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=VP(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=VP(t.events,n[2]),a=VP(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},VP(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function BP(e,t,n,r,i){let a=[],o=VP(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function VP(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var HP={name:`tasklistCheck`,tokenize:WP};function UP(){return{text:{91:HP}}}function WP(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return jm(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Am(r)?t(r):Mm(r)?e.check({tokenize:GP},t,n)(r):n(r)}}function GP(e,t,n){return Lm(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function KP(e){return vm([cP(),wP(),MP(e),IP(),UP()])}var qP={};function JP(e){let t=this,n=e||qP,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(KP(n)),a.push(ZN()),o.push(QN(n))}function YP(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function XP(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
|
|
319
|
+
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(qM(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
|
|
320
|
+
`,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
|
|
321
|
+
`),i&&(c+=a.move(i+`
|
|
322
|
+
`)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var ZP={tokenize:$P,concrete:!0,name:`mathFlow`},QP={tokenize:eF,partial:!0};function $P(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Lm(e,l,`whitespace`)(t))}function l(t){return t===null||Am(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||Am(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(QP,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Lm(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):Am(t)?e.attempt(QP,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||Am(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Lm(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Lm(e,c,`whitespace`)(t))}function c(r){return r===null||Am(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function eF(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function tF(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:nF,previous:rF,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):Am(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||Am(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function nF(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function rF(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function iF(e){return{flow:{36:ZP},text:{36:tF(e)}}}var aF={};function oF(e){let t=this,n=e||aF,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(iF(n)),a.push(YP()),o.push(XP(n))}function sF(e){return e===`className`||Array.isArray(e)&&e[0]===`className`}function cF(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r.filter(e=>!sF(e));return t[`*`]=[...t[`*`]??[],`className`],t}var lF={...jj,tagNames:[...new Set([...jj.tagNames??[],`details`,`summary`])],attributes:cF(jj.attributes??{})},uF=[kj,[Jj,lF],kE],dF=[JP,oF];function fF({text:e}){let[t,n]=(0,d.useState)(!1);return(0,A.jsxs)(`div`,{className:`my-1 rounded-lg border border-zinc-200 bg-zinc-50 text-sm dark:border-zinc-800/80 dark:bg-zinc-900/40`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-zinc-500`,children:[(0,A.jsx)(`span`,{className:`italic`,children:`thinking`}),(0,A.jsx)(`span`,{className:`ml-auto`,children:t?`▾`:`▸`})]}),t&&(0,A.jsx)(`div`,{className:`whitespace-pre-wrap border-t border-zinc-200 px-3 py-2 text-xs italic text-zinc-500 dark:border-zinc-800/80`,children:e})]})}function pF({item:e,serverUrl:t=``,token:n=null,workspace:r,onOpenFile:i,hideReasoning:a=!1}){let o=a?e.blocks.filter(e=>e.type!==`thinking`):e.blocks,s=e.blocks.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
323
|
+
|
|
324
|
+
`).trim(),c=(0,d.useRef)(i);c.current=i;let l=(0,d.useMemo)(()=>{function e({src:e,alt:i,...a}){let o=typeof e==`string`&&e!==``&&!re(e)?se(t,ie(``,e),n,void 0,r):e;return(0,A.jsx)(`img`,{...a,src:o,alt:i??``,loading:`lazy`,className:`max-h-96 max-w-full rounded-lg object-contain`})}function i({href:e,children:t,...n}){if(typeof e==`string`&&e!==``&&!re(e)&&c.current){let r=ie(``,e);return(0,A.jsx)(`a`,{...n,href:e,onClick:e=>{e.preventDefault(),c.current?.(r)},children:t})}return(0,A.jsx)(`a`,{...n,href:e,target:`_blank`,rel:`noreferrer`,children:t})}return{pre:Tf,img:e,a:i}},[t,n,r]);return o.length===0&&!e.errorMessage?null:(0,A.jsxs)(`div`,{className:`group max-w-none`,children:[s&&!e.streaming&&(0,A.jsx)(`div`,{className:`flex justify-end opacity-0 transition-opacity group-hover:opacity-100`,children:(0,A.jsx)(le,{text:s})}),o.map((e,t)=>e.type===`thinking`?(0,A.jsx)(fF,{text:e.text},e.contentIndex??t):(0,A.jsx)(`div`,{className:`prose-chat`,children:(0,A.jsx)(py,{remarkPlugins:dF,rehypePlugins:uF,components:l,children:te(e.text)})},e.contentIndex??t)),e.errorMessage&&(0,A.jsx)(`div`,{className:`mt-2 rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.errorMessage})]})}var mF=new Set([`openFile`,`openFileHistory`,`openWorktreeDiff`,`searchWorkspace`]);function hF(e){return mF.has(e.kind)}function gF(e){return t=>{if(hF(t))switch(t.kind){case`openFile`:e.readFile(t.path,t.sha256);return;case`openFileHistory`:e.fetchGitFileHistory(t.path);return;case`openWorktreeDiff`:e.fetchGitDiff(t.path);return;case`searchWorkspace`:e.searchFiles(t.query);return}}}var _F=()=>{},vF=5;function yF(e){if(typeof e==`object`&&e&&e.name){let t=e;return`- ${String(t.name)} (${String(t.filePath??t.file??`unknown`)})`}return`- ${String(e)}`}function bF(e,t,n,r){if(!(!Array.isArray(n)||n.length===0)){e.push(`\n${t}`);for(let t of n.slice(0,vF))e.push(r(t))}}function xF(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e,n=[];t.task&&n.push(`**${String(t.task)}**`),t.searchMode&&n.push(`Mode: ${String(t.searchMode)}`),t.title&&n.push(`**${String(t.title)}**`),t.summary&&n.push(String(t.summary)),bF(n,`Relevant files:`,t.relevantFiles,e=>`- ${String(e)}`),bF(n,`Relevant functions:`,t.relevantFunctions,yF),bF(n,`Next steps:`,t.nextSteps,e=>`- ${String(e)}`),bF(n,`Next steps:`,t.nextStepsText,e=>`- ${String(e)}`);let r=n.join(`
|
|
325
|
+
`).trim();return r===``?void 0:r}function SF({text:e}){let t=(0,d.useMemo)(()=>[JP,oF],[]),n=(0,d.useMemo)(()=>[kE],[]);return(0,A.jsx)(`div`,{className:`prose-chat max-h-96 overflow-auto text-zinc-700 dark:text-zinc-300`,children:(0,A.jsx)(py,{remarkPlugins:t,rehypePlugins:n,children:te(e)})})}function CF({item:e}){return(0,A.jsx)(`pre`,{className:`max-h-96 overflow-auto whitespace-pre-wrap font-mono text-xs text-zinc-700 dark:text-zinc-300`,children:e.output?e.output:e.running?`running…`:`(no output)`})}var wF={id:`raw`,match:()=>!0,stable:!1,Expanded:CF},TF={id:`extension-html`,match:e=>!!e.outputHtml,stable:!1,extensionOwned:!0,showsRawReveal:!0,hasCollapsed:e=>!!e.outputHtmlCollapsed,Collapsed:({item:e})=>(0,A.jsx)(Ve,{html:e.outputHtmlCollapsed??``,className:`max-h-96 text-zinc-700 dark:text-zinc-300`}),Expanded:({item:e})=>(0,A.jsx)(Ve,{html:e.outputHtml??``,className:`max-h-96 text-zinc-700 dark:text-zinc-300`})};function EF(e){if(e.toolName!==`edit`||e.args===null||typeof e.args!=`object`)return null;let t=e.args.edits;if(!Array.isArray(t))return null;let n=t.filter(e=>typeof e==`object`&&!!e&&typeof e.oldText==`string`&&typeof e.newText==`string`);return n.length>0?n:null}var DF={id:`file-edit`,match:e=>EF(e)!==null,stable:!0,startsExpanded:!0,showsRawReveal:!0,Expanded:({item:e})=>(0,A.jsx)(`div`,{className:`flex flex-col gap-2`,children:(EF(e)??[]).map((e,t)=>(0,A.jsx)(He,{lines:S(e.oldText,e.newText)},t))})};function OF(e){if(e.toolName!==`write`||e.args===null||typeof e.args!=`object`)return null;let t=e.args.content;return typeof t==`string`?t:null}var kF={id:`file-write`,match:e=>OF(e)!==null,stable:!0,startsExpanded:!0,showsRawReveal:!0,Expanded:({item:e})=>(0,A.jsx)(Ue,{lines:(OF(e)??``).split(`
|
|
326
|
+
`).map(e=>({type:`add`,text:e}))})},AF={id:`pi-render`,match:e=>e.output?ne(e.output)!==void 0:!1,stable:!1,Collapsed:({item:e})=>(0,A.jsx)(SF,{text:ne(e.output??``)??``}),Expanded:CF},jF={id:`orient-summary`,match:e=>e.output?xF(E(e.output))!==void 0:!1,stable:!1,Collapsed:({item:e})=>(0,A.jsx)(SF,{text:xF(E(e.output??``))??``}),Expanded:CF};function MF(e){let t=e.trim();return t===`/dev/null`||t===``?null:t.replace(/^[ab]\//,``)}function NF(e){let t=[],n=null,r=null,i=!1,a=()=>{n&&n.lines.length>0&&t.push(n),n=null};for(let t of e.split(`
|
|
327
|
+
`)){if(t.startsWith(`diff --git `)){a(),i=!1,r=null;let e=/^diff --git (.+?) (.+)$/.exec(t),o=e?MF(e[2])??MF(e[1]):null;n=o===null?null:{path:o,lines:[],added:0,removed:0};continue}if(t.startsWith(`--- `)){i=!1,r=MF(t.slice(4));continue}if(t.startsWith(`+++ `)){i=!1;let e=MF(t.slice(4))??r;e!==null&&(n===null||n.lines.length>0)?(a(),n={path:e,lines:[],added:0,removed:0}):e!==null&&n!==null&&(n.path=e);continue}if(t.startsWith(`@@`)){i=n!==null;continue}if(!(!i||n===null)){if(t.startsWith(`+`))n.lines.push({type:`add`,text:t.slice(1)}),n.added++;else if(t.startsWith(`-`))n.lines.push({type:`del`,text:t.slice(1)}),n.removed++;else if(t.startsWith(` `))n.lines.push({type:`same`,text:t.slice(1)});else if(t.startsWith(`\\`))continue;else i=!1}}return a(),t}var PF=/^\s*git\s+(diff|show)\b/;function FF(e){if(e.toolName!==`bash`||e.args===null||typeof e.args!=`object`)return null;let t=e.args.command;return typeof t!=`string`||!PF.test(t)?null:t}var IF=6;function LF({onClick:e,children:t}){return(0,A.jsx)(`button`,{type:`button`,onClick:e,className:`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:t})}function RF({item:e,dispatch:t}){let n=NF(e.output??``),[r,i]=(0,d.useState)(!1);if(n.length===0)return(0,A.jsx)(CF,{item:e});let a=r?n:n.slice(0,IF);return(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a.map(e=>(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`truncate font-mono text-xs text-zinc-600 dark:text-zinc-400`,children:e.path}),(0,A.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[(0,A.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:[`+`,e.added]}),` `,(0,A.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,e.removed]})]}),(0,A.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center`,children:[(0,A.jsx)(LF,{onClick:()=>t({kind:`openFile`,path:e.path}),children:`open`}),(0,A.jsx)(LF,{onClick:()=>t({kind:`openFileHistory`,path:e.path}),children:`history`})]})]}),(0,A.jsx)(Ue,{lines:e.lines})]},e.path)),!r&&n.length>IF&&(0,A.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`self-start text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300`,children:[`show `,n.length-IF,` more file`,n.length-IF===1?``:`s`]})]})}var zF={id:`git-diff`,match:e=>FF(e)!==null,stable:!0,showsRawReveal:!0,Expanded:RF},BF=/^(.*?):(\d+):(.*)$/;function VF(e){let t=[],n=new Map;for(let r of e.split(`
|
|
328
|
+
`)){let e=BF.exec(r);if(e===null)continue;let[,i,a,o]=e;if(i===``)continue;let s=n.get(i);s===void 0&&(s={path:i,hits:[]},n.set(i,s),t.push(s)),s.hits.push({line:Number(a),text:o})}return t}function HF(e){return e.reduce((e,t)=>e+t.hits.length,0)}var UF=8,WF=5;function GF({item:e,dispatch:t}){let n=VF(e.output??``),[r,i]=(0,d.useState)(!1);if(n.length===0)return(0,A.jsx)(CF,{item:e});let a=r?n:n.slice(0,UF);return(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,A.jsxs)(`div`,{className:`text-xs text-zinc-500`,children:[HF(n),` match`,HF(n)===1?``:`es`,` in `,n.length,` file`,n.length===1?``:`s`]}),a.map(e=>(0,A.jsxs)(`div`,{className:`flex flex-col`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>t({kind:`openFile`,path:e.path}),className:`flex items-center gap-2 truncate text-left font-mono text-xs text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100`,children:[(0,A.jsx)(`span`,{className:`truncate`,children:e.path}),(0,A.jsx)(`span`,{className:`shrink-0 text-zinc-400 dark:text-zinc-600`,children:e.hits.length})]}),(0,A.jsxs)(`div`,{className:`overflow-x-auto rounded border border-zinc-200 font-mono text-xs dark:border-zinc-800`,children:[e.hits.slice(0,WF).map((e,t)=>(0,A.jsxs)(`div`,{className:`flex gap-2 px-2`,children:[(0,A.jsx)(`span`,{className:`shrink-0 select-none text-zinc-400 dark:text-zinc-600`,children:e.line}),(0,A.jsx)(`span`,{className:`whitespace-pre text-zinc-700 dark:text-zinc-300`,children:e.text})]},t)),e.hits.length>WF&&(0,A.jsxs)(`div`,{className:`px-2 text-zinc-400 dark:text-zinc-600`,children:[`+`,e.hits.length-WF,` more in this file`]})]})]},e.path)),!r&&n.length>UF&&(0,A.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`self-start text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300`,children:[`show `,n.length-UF,` more file`,n.length-UF===1?``:`s`]})]})}var KF=[TF,Sf,DF,kF,zF,{id:`code-search`,match:e=>e.toolName===`grep`,stable:!0,showsRawReveal:!0,Expanded:GF},AF,jF,wF];function qF(e){for(let t of KF){let n=!1;try{n=t.match(e)}catch{n=!1}if(n)return t}return wF}function JF(e,t){let n=qF(e);if(t===void 0||t===n.id)return n;let r=KF.find(e=>e.id===t);if(r===void 0||r.id===wF.id||n.extensionOwned===!0)return n;let i=!1;try{i=r.match(e)}catch{i=!1}return i?r:n}function YF(e){if(typeof e!=`object`||!e)return``;let t=e,n=[`command`,`path`,`file_path`,`pattern`,`query`].find(e=>typeof t[e]==`string`);if(n)return t[n];let r=JSON.stringify(t);return r===`{}`?``:r}function XF({item:e,dispatch:t=_F}){let n=(0,d.useRef)(void 0),r=JF(e,n.current);n.current=r.id;let i=r.startsExpanded===!0,[a,o]=(0,d.useState)(i);(0,d.useEffect)(()=>{o(i)},[i]);let[s,c]=(0,d.useState)(!1),l=(0,d.useRef)(null),u=YF(e.args),f=r.Collapsed,p=!a&&f!==void 0&&(r.hasCollapsed?.(e)??!0);return(0,A.jsxs)(`div`,{className:`rounded-lg border text-sm ${e.isError?`border-red-300 bg-red-50 dark:border-red-900/60 dark:bg-red-950/20`:`border-zinc-200 bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900/60`}`,children:[(0,A.jsxs)(`div`,{onMouseDown:e=>{l.current={x:e.clientX,y:e.clientY}},onClick:e=>{let t=l.current;l.current=null,!(e.detail>0&&t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>4)&&o(!a)},className:`flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-left`,children:[(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-label":e.callHtml?e.toolName:void 0,className:`flex shrink-0 items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${e.running?`animate-pulse motion-reduce:animate-none bg-amber-400`:e.isError?`bg-red-500`:`bg-emerald-500`}`}),!e.callHtml&&(0,A.jsx)(`span`,{className:`font-mono font-medium text-zinc-700 dark:text-zinc-300`,children:e.toolName})]}),e.callHtml?(0,A.jsx)(Ve,{as:`span`,html:e.callHtml,className:`min-w-0 flex-1 text-zinc-700 dark:text-zinc-300`}):u&&(0,A.jsx)(`span`,{className:`min-w-0 overflow-x-auto whitespace-nowrap font-mono text-xs text-zinc-500 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:u}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-zinc-400 dark:text-zinc-600`,children:a?`▾`:`▸`})]}),e.running&&e.progress!=null&&(0,A.jsx)(`div`,{className:`border-t border-zinc-200 px-3 py-1.5 dark:border-zinc-800`,children:(0,A.jsx)(`progress`,{value:e.progress,max:1,"aria-label":`${e.toolName} progress`,className:`h-1.5 w-full appearance-none overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-800 [&::-moz-progress-bar]:bg-emerald-500 [&::-webkit-progress-bar]:bg-transparent [&::-webkit-progress-value]:rounded-full [&::-webkit-progress-value]:bg-emerald-500`})}),p&&f!==void 0&&(0,A.jsx)(`div`,{className:`border-t border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:(0,A.jsx)(f,{item:e,dispatch:t})}),a&&(0,A.jsxs)(`div`,{className:`border-t border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,A.jsx)(r.Expanded,{item:e,dispatch:t}),r.showsRawReveal===!0&&(0,A.jsxs)(`div`,{className:`mt-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>c(!s),className:`text-xs text-zinc-400 hover:text-zinc-600 dark:text-zinc-600 dark:hover:text-zinc-400`,children:s?`hide raw output`:`raw output`}),s&&(0,A.jsx)(`div`,{className:`mt-1`,children:(0,A.jsx)(CF,{item:e})})]})]})]})}function ZF({item:e}){let[t,n]=(0,d.useState)(!1),r=e.details!==void 0,i=!!e.contentHtml,a=e.contentHtmlCollapsed??e.contentHtml,o=r||i&&!!e.contentHtmlCollapsed;return(0,A.jsxs)(`div`,{className:`rounded-lg border border-violet-200 bg-violet-50 px-3 py-2 text-sm dark:border-violet-900/60 dark:bg-violet-950/30`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsxs)(`span`,{className:`font-mono text-xs font-bold text-violet-700 dark:text-violet-300`,children:[`[`,e.customType,`]`]}),o&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>n(!t),title:`Show details`,className:`ml-auto text-xs text-violet-500 hover:text-violet-700 dark:text-violet-500 dark:hover:text-violet-300`,children:t?`▾`:`▸`})]}),i&&a?(0,A.jsx)(Ve,{html:t||!e.contentHtmlCollapsed?e.contentHtml??a:a,className:`mt-1 text-violet-950 dark:text-violet-100`}):(0,A.jsx)(`div`,{className:`prose-chat mt-1 text-violet-950 dark:text-violet-100`,children:(0,A.jsx)(py,{remarkPlugins:[JP,oF],rehypePlugins:[kE],children:te(e.text)})}),t&&r&&(0,A.jsx)(`pre`,{className:`mt-2 max-h-96 overflow-auto border-t border-violet-200 pt-2 font-mono text-xs text-violet-600 dark:border-violet-900/60 dark:text-violet-400`,children:JSON.stringify(e.details,null,2)})]})}var QF=`pi-outpost:update-notice-dismissed`;function $F(){try{return window.localStorage.getItem(QF)}catch{return null}}function eI({notice:e}){let[t,n]=(0,d.useState)(()=>$F());return t===e.latest?null:(0,A.jsxs)(`div`,{role:`status`,"data-testid":`update-notice`,className:`flex items-center gap-2 border-b border-sky-200 bg-sky-50 px-4 py-1.5 text-xs text-sky-900 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-200`,children:[(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`pi-outpost `,e.latest,` is available (you have `,e.running,`). `,e.instruction]}),(0,A.jsx)(`code`,{className:`shrink-0 rounded bg-white/70 px-1.5 py-0.5 font-mono dark:bg-sky-900/40`,children:e.copy}),(0,A.jsx)(le,{text:e.copy}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`Dismiss the update notice`,onClick:()=>{try{window.localStorage.setItem(QF,e.latest)}catch{}n(e.latest)},className:`shrink-0 rounded px-1.5 text-sky-700 hover:bg-sky-100 dark:text-sky-300 dark:hover:bg-sky-900/50`,children:`×`})]})}function tI(e){return e.id??e.root}function nI(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function rI({item:e}){let[t,n]=(0,d.useState)(!1),r=e.tokensBefore?`Conversation compacted here — ${nI(e.tokensBefore)} tokens summarised`:`Conversation compacted here`;return(0,A.jsxs)(`div`,{className:`my-1`,"data-compaction-boundary":!0,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`h-px flex-1 bg-amber-300 dark:bg-amber-900`}),(0,A.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),"aria-expanded":t,className:`rounded-full border border-amber-300 bg-amber-50 px-2 py-0.5 text-xs text-amber-800 hover:bg-amber-100 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300 dark:hover:bg-amber-950/70`,children:[r,` `,t?`▾`:`▸`]}),(0,A.jsx)(`span`,{className:`h-px flex-1 bg-amber-300 dark:bg-amber-900`})]}),t&&(0,A.jsxs)(`div`,{className:`mt-2 whitespace-pre-wrap rounded-lg border border-amber-200 bg-amber-50/60 px-3 py-2 text-sm text-zinc-700 dark:border-amber-900/60 dark:bg-amber-950/20 dark:text-zinc-300`,children:[(0,A.jsx)(`p`,{className:`mb-1 text-xs font-medium text-amber-800 dark:text-amber-300`,children:`What the agent kept of everything above:`}),e.summary||`(the runtime recorded no summary)`]})]})}function iI({older:e,onLoad:t}){if(e.remaining<=0&&!e.error)return null;let n=e.remaining,r=e.loading?`Loading earlier messages…`:`Load ${n} earlier message${n===1?``:`s`}`;return(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-1 pb-2`,"data-older-messages":!0,children:[(0,A.jsx)(`button`,{type:`button`,onClick:t,disabled:e.loading,"aria-busy":e.loading,"aria-label":e.loading?`Loading earlier messages`:`Load ${n} earlier messages`,className:`rounded-full border border-zinc-300 bg-white px-3 py-1 text-xs text-zinc-600 hover:bg-zinc-50 disabled:cursor-progress disabled:opacity-60 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-800`,children:r}),e.error&&(0,A.jsxs)(`p`,{role:`status`,className:`text-xs text-red-600 dark:text-red-400`,children:[e.error,` — try again`]})]})}var aI={cost:0,unpriced:0,turns:0,input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0};function oI(e){let t={...aI};for(let n of e){if(n.kind!==`assistant`||!n.usage)continue;let e=n.usage;t.turns+=1,t.input+=e.input,t.output+=e.output,t.cacheRead+=e.cacheRead,t.cacheWrite+=e.cacheWrite,t.totalTokens+=e.totalTokens,e.cost===void 0?t.unpriced+=1:t.cost+=e.cost}return t}function sI(e){let t=e>0&&e<.01?4:2;return`$${e.toFixed(t)}`}function cI(e){return e<1e3?String(e):e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}var lI=80,uI=new WeakMap;function dI(e){let t=typeof e==`object`&&!!e;if(t){let t=uI.get(e);if(t!==void 0)return t}let n=0;try{n=JSON.stringify(e)?.length??0}catch{n=0}return t&&uI.set(e,n),n}function fI(e){let t=e.replace(/\s+/g,` `).trim();return t.length>lI?`${t.slice(0,79)}…`:t}function pI(e,t){return{index:e,title:t,turns:0,toolCalls:0,failedToolCalls:0,input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,unpriced:0}}function mI(e,t){e.turns+=1,e.input+=t.input,e.output+=t.output,e.cacheRead+=t.cacheRead,e.cacheWrite+=t.cacheWrite,e.totalTokens+=t.totalTokens,t.cost===void 0?e.unpriced+=1:e.cost=(e.cost??0)+t.cost}function hI(e){if(e.length===0)return 0;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==1?t[n]:(t[n-1]+t[n])/2}function gI(e){let t=[],n=[],r=[],i=new Map,a=pI(-1,``),o=a;e.forEach((e,a)=>{if(e.kind===`user`){o=pI(a,fI(e.text)),r.push(o);return}if(e.kind===`assistant`){if(!e.usage)return;t.push({index:a,number:t.length+1,requestIndex:o.index,usage:e.usage}),mI(o,e.usage);return}if(e.kind!==`tool`)return;let s={index:a,toolCallId:e.toolCallId,name:e.toolName,inputSize:dI(e.args),outputSize:e.output.length,isError:e.isError===!0,running:e.running===!0,requestIndex:o.index};n.push(s),o.toolCalls+=1,s.isError&&(o.failedToolCalls+=1);let c=i.get(s.name)??{name:s.name,calls:0,failures:0,inputSize:0,outputSize:0};c.calls+=1,s.isError&&(c.failures+=1),c.inputSize+=s.inputSize,c.outputSize+=s.outputSize,i.set(s.name,c)}),(a.turns>0||a.toolCalls>0)&&r.unshift(a);let s=oI(e),c=t.map(e=>e.usage.cost).filter(e=>e!==void 0),l=n.filter(e=>e.isError).length;return{turns:t,requests:r,toolCalls:n,tools:[...i.values()],totals:s,pricedTurns:c.length,averageTurnCost:c.length===0?0:s.cost/c.length,medianTurnCost:hI(c),totalToolCalls:n.length,failedToolCalls:l,toolCallsPerTurn:t.length===0?0:n.length/t.length}}function _I(e,t){let n=[...e];return t===`input`?n.sort((e,t)=>t.inputSize-e.inputSize):t===`failure`?n.sort((e,t)=>Number(t.isError)-Number(e.isError)||t.outputSize-e.outputSize):n.sort((e,t)=>t.outputSize-e.outputSize)}function vI(e){return e.filter(e=>e.index>=0).sort((e,t)=>t.totalTokens-e.totalTokens||(t.cost??0)-(e.cost??0))}function yI(e){return e<1e3?`${e} B`:e<1e6?`${Math.round(e/1e3)} kB`:`${(e/1e6).toFixed(1)} MB`}var bI=768,xI=26,SI=132,CI=12,wI=96,TI=124,EI=[{key:`input`,label:`input`,className:`text-emerald-500`,value:e=>e.usage.input},{key:`output`,label:`output`,className:`text-blue-500`,value:e=>e.usage.output},{key:`cacheRead`,label:`cache read`,className:`text-violet-500`,value:e=>e.usage.cacheRead},{key:`cacheWrite`,label:`cache write`,className:`text-amber-500`,value:e=>e.usage.cacheWrite}],DI=[{key:`cost`,label:`cost`,className:`text-rose-500`,value:e=>e.usage.cost??0}];function OI({title:e,children:t}){return(0,A.jsxs)(`section`,{className:`border-t border-zinc-200 px-4 py-3 dark:border-zinc-800`,children:[(0,A.jsx)(`h3`,{className:`mb-2 font-mono text-[11px] uppercase tracking-wide text-zinc-400 dark:text-zinc-500`,children:e}),t]})}function kI({children:e}){return(0,A.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:e})}function AI({label:e,value:t,hint:n}){return(0,A.jsxs)(`div`,{className:`rounded-md border border-zinc-200 px-2 py-1.5 dark:border-zinc-800`,children:[(0,A.jsx)(`div`,{"aria-label":`${e}: ${t}`,className:`font-mono text-sm text-zinc-700 dark:text-zinc-200`,children:t}),(0,A.jsx)(`div`,{className:`text-[11px] text-zinc-500 dark:text-zinc-400`,children:e}),n&&(0,A.jsx)(`div`,{className:`text-[10px] text-zinc-400 dark:text-zinc-500`,children:n})]})}function jI({turns:e,series:t,format:n,onJump:r,describe:i}){let a=Math.max(1,...e.flatMap(e=>t.map(t=>t.value(e)))),o=Math.max(e.length*xI,xI),s=e=>xI/2+e*xI,c=e=>CI+wI*(1-e/a);return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`mb-1 flex flex-wrap gap-x-3 gap-y-1`,children:t.map(e=>(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-zinc-500 dark:text-zinc-400`,children:[(0,A.jsx)(`span`,{className:`inline-block h-0.5 w-3 bg-current ${e.className}`}),e.label]},e.key))}),(0,A.jsxs)(`div`,{className:`flex`,children:[(0,A.jsxs)(`div`,{"aria-hidden":!0,className:`flex w-12 shrink-0 flex-col justify-between py-2 pr-1 text-right font-mono text-[9px] text-zinc-400 dark:text-zinc-600`,style:{height:SI},children:[(0,A.jsx)(`span`,{children:n(a)}),(0,A.jsx)(`span`,{children:`0`})]}),(0,A.jsx)(`div`,{className:`min-w-0 flex-1 overflow-x-auto`,children:(0,A.jsxs)(`svg`,{width:o,height:SI,role:`group`,"aria-label":`Per-turn chart`,children:[(0,A.jsx)(`line`,{x1:0,x2:o,y1:108,y2:108,stroke:`currentColor`,className:`text-zinc-200 dark:text-zinc-800`}),t.map(t=>(0,A.jsx)(`polyline`,{fill:`none`,stroke:`currentColor`,strokeWidth:1.5,className:t.className,points:e.map((e,n)=>`${s(n)},${c(t.value(e))}`).join(` `)},t.key)),e.map((n,a)=>(0,A.jsxs)(`g`,{children:[t.map(e=>(0,A.jsx)(`circle`,{cx:s(a),cy:c(e.value(n)),r:2,fill:`currentColor`,className:e.className},e.key)),(0,A.jsx)(`rect`,{x:s(a)-xI/2,y:0,width:xI,height:SI,fill:`transparent`,role:`button`,tabIndex:0,"aria-label":`Turn ${n.number}: ${i(n)} — jump to it`,className:`cursor-pointer outline-none focus-visible:fill-zinc-500/10`,onClick:()=>r(n.index),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r(n.index))},children:(0,A.jsx)(`title`,{children:`turn ${n.number} · ${i(n)}`})}),(e.length<=12||n.number%5==0)&&(0,A.jsx)(`text`,{x:s(a),y:TI,textAnchor:`middle`,className:`fill-zinc-400 text-[9px] dark:fill-zinc-600`,children:n.number})]},n.index))]})})]})]})}function MI({onJump:e,label:t,children:n}){return(0,A.jsx)(`button`,{type:`button`,onClick:e,"aria-label":t,className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1 text-left text-xs hover:bg-zinc-100 dark:hover:bg-zinc-900`,children:n})}function NI({analysis:e,onJump:t,onClose:n}){let[r,i]=(0,d.useState)(`output`),{totals:a}=e;function o(e){t(e),window.innerWidth<bI&&n()}let s=e.turns.length===0&&e.toolCalls.length===0,c=_I(e.toolCalls,r),l=vI(e.requests);return(0,A.jsxs)(`aside`,{"aria-label":`Session analysis`,className:`absolute inset-y-0 right-0 z-10 w-full overflow-y-auto border-l border-zinc-200 bg-white shadow-xl md:w-[26rem] dark:border-zinc-800 dark:bg-zinc-950`,children:[(0,A.jsxs)(`header`,{className:`sticky top-0 flex items-center gap-2 border-b border-zinc-200 bg-white px-4 py-2 dark:border-zinc-800 dark:bg-zinc-950`,children:[(0,A.jsx)(`h2`,{className:`font-mono text-xs text-zinc-600 dark:text-zinc-300`,children:`session analysis`}),(0,A.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close session analysis`,className:`ml-auto rounded-md px-2 py-1 text-sm text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-900`,children:`×`})]}),s?(0,A.jsx)(`div`,{className:`px-4 py-6`,children:(0,A.jsx)(kI,{children:`Nothing to analyse yet — no turn has reported figures and no tool has been called.`})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(OI,{title:`tokens`,children:(0,A.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,A.jsx)(AI,{label:`total`,value:cI(a.totalTokens)}),(0,A.jsx)(AI,{label:`fresh input`,value:cI(a.input)}),(0,A.jsx)(AI,{label:`output`,value:cI(a.output)}),(0,A.jsx)(AI,{label:`cache read`,value:cI(a.cacheRead)}),(0,A.jsx)(AI,{label:`cache write`,value:cI(a.cacheWrite)}),(0,A.jsx)(AI,{label:`turns`,value:String(e.turns.length)})]})}),(0,A.jsx)(OI,{title:`cost`,children:e.pricedTurns===0?(0,A.jsx)(kI,{children:`No turn was priced — this provider reports tokens only.`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,A.jsx)(AI,{label:`total`,value:sI(a.cost)}),(0,A.jsx)(AI,{label:`average turn`,value:sI(e.averageTurnCost)}),(0,A.jsx)(AI,{label:`median turn`,value:sI(e.medianTurnCost)})]}),(0,A.jsxs)(`p`,{className:`mt-1 text-[11px] text-zinc-400 dark:text-zinc-500`,children:[`over `,e.pricedTurns,` priced turn`,e.pricedTurns===1?``:`s`,a.unpriced>0&&`, ${a.unpriced} unpriced`]})]})}),(0,A.jsx)(OI,{title:`tool calls`,children:e.totalToolCalls===0?(0,A.jsx)(kI,{children:`No tool call recorded in this session.`}):(0,A.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,A.jsx)(AI,{label:`calls`,value:String(e.totalToolCalls)}),(0,A.jsx)(AI,{label:`per turn`,value:e.toolCallsPerTurn.toFixed(1)}),(0,A.jsx)(AI,{label:`failed`,value:String(e.failedToolCalls)})]})}),(0,A.jsx)(OI,{title:`tokens per turn`,children:e.turns.length===0?(0,A.jsx)(kI,{children:`No turn has reported figures yet.`}):(0,A.jsx)(jI,{turns:e.turns,series:EI,format:cI,onJump:o,describe:e=>`${cI(e.usage.totalTokens)} tokens (input ${e.usage.input}, output ${e.usage.output}, cache read ${e.usage.cacheRead}, cache write ${e.usage.cacheWrite})`})}),(0,A.jsx)(OI,{title:`cost per turn`,children:e.pricedTurns===0?(0,A.jsx)(kI,{children:`No turn was priced, so there is no cost to plot.`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(jI,{turns:e.turns.filter(e=>e.usage.cost!==void 0),series:DI,format:sI,onJump:o,describe:e=>sI(e.usage.cost??0)}),a.unpriced>0&&(0,A.jsxs)(`p`,{className:`mt-1 text-[10px] text-zinc-400 dark:text-zinc-500`,children:[a.unpriced,` unpriced turn`,a.unpriced===1?``:`s`,` left out — they carry no price to plot`]})]})}),(0,A.jsx)(OI,{title:`costliest tool calls`,children:c.length===0?(0,A.jsx)(kI,{children:`No tool call recorded in this session.`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,A.jsx)(`label`,{htmlFor:`tool-ranking`,className:`text-[11px] text-zinc-500 dark:text-zinc-400`,children:`rank by`}),(0,A.jsxs)(`select`,{id:`tool-ranking`,value:r,onChange:e=>i(e.target.value),className:`rounded-md border border-zinc-300 bg-white px-1.5 py-0.5 font-mono text-[11px] text-zinc-600 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-300`,children:[(0,A.jsx)(`option`,{value:`output`,children:`output size`}),(0,A.jsx)(`option`,{value:`input`,children:`input size`}),(0,A.jsx)(`option`,{value:`failure`,children:`failure`})]})]}),(0,A.jsx)(`p`,{className:`mb-1 text-[10px] text-zinc-400 dark:text-zinc-500`,children:`measured content size, not tokens — a tool call carries no price`}),c.slice(0,10).map(e=>(0,A.jsxs)(MI,{onJump:()=>o(e.index),label:`Jump to the ${e.name} call, output ${yI(e.outputSize)}`,children:[(0,A.jsx)(`span`,{className:`font-mono text-zinc-600 dark:text-zinc-300`,children:e.name}),e.isError&&(0,A.jsx)(`span`,{className:`text-red-500`,children:`failed`}),e.running&&(0,A.jsx)(`span`,{className:`text-zinc-400`,children:`running`}),(0,A.jsxs)(`span`,{className:`ml-auto font-mono text-zinc-500 dark:text-zinc-400`,children:[`in `,yI(e.inputSize),` · out `,yI(e.outputSize)]})]},e.toolCallId||`${e.index}`))]})}),(0,A.jsx)(OI,{title:`tools`,children:e.tools.length===0?(0,A.jsx)(kI,{children:`No tool has been called yet.`}):(0,A.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,A.jsx)(`thead`,{children:(0,A.jsxs)(`tr`,{className:`text-left text-[10px] uppercase text-zinc-400 dark:text-zinc-500`,children:[(0,A.jsx)(`th`,{className:`font-normal`,children:`tool`}),(0,A.jsx)(`th`,{className:`font-normal`,children:`calls`}),(0,A.jsx)(`th`,{className:`font-normal`,children:`failed`}),(0,A.jsx)(`th`,{className:`text-right font-normal`,children:`in / out`})]})}),(0,A.jsx)(`tbody`,{className:`font-mono text-zinc-600 dark:text-zinc-300`,children:[...e.tools].sort((e,t)=>t.outputSize-e.outputSize).map(e=>(0,A.jsxs)(`tr`,{children:[(0,A.jsx)(`td`,{children:e.name}),(0,A.jsx)(`td`,{children:e.calls}),(0,A.jsx)(`td`,{className:e.failures>0?`text-red-500`:``,children:e.failures}),(0,A.jsxs)(`td`,{className:`text-right`,children:[yI(e.inputSize),` / `,yI(e.outputSize)]})]},e.name))})]})}),(0,A.jsx)(OI,{title:`costliest requests`,children:l.length===0?(0,A.jsx)(kI,{children:`No request has consumed anything yet.`}):l.slice(0,10).map(e=>(0,A.jsxs)(MI,{onJump:()=>o(e.index),label:`Jump to the request "${e.title}"`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-zinc-600 dark:text-zinc-300`,children:e.title}),(0,A.jsxs)(`span`,{className:`shrink-0 font-mono text-zinc-500 dark:text-zinc-400`,children:[cI(e.totalTokens),` tok`,e.cost!==void 0&&` · ${sI(e.cost)}`]}),(0,A.jsxs)(`span`,{className:`shrink-0 text-[10px] text-zinc-400 dark:text-zinc-500`,children:[e.turns,`t / `,e.toolCalls,`c`,e.failedToolCalls>0&&` · ${e.failedToolCalls}✗`]})]},e.index))})]})]})}var PI=2e3;function FI({items:e,scrollerRef:t,hideTools:n,onShowTools:r,onJump:i}){let[a,o]=(0,d.useState)(null),s=(0,d.useRef)(null),[c,l]=(0,d.useState)(0),u=(0,d.useRef)(null);(0,d.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]);let f=(0,d.useCallback)(t=>{let i=e[t];i&&(i.kind===`tool`&&n&&r(),s.current=t,l(e=>e+1))},[e,n,r]);return(0,d.useEffect)(()=>{let e=s.current;if(e===null)return;s.current=null;let n=t.current?.querySelector(`[data-item-index="${e}"]`);n&&(i(n),n.scrollIntoView?.({behavior:`smooth`,block:`center`}),o(e),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>o(null),PI))},[c,n,t,i]),{jumpToItem:f,highlightIndex:a}}var II={tools:`pi-outpost:hide-tools`,reasoning:`pi-outpost:hide-reasoning`},LI=[`tools`,`reasoning`],RI={tools:`Tool calls`,reasoning:`Reasoning`};function zI(e){try{return localStorage.getItem(II[e])===`1`}catch{return!1}}function BI(){return{tools:!zI(`tools`),reasoning:!zI(`reasoning`)}}function VI(e,t){try{localStorage.setItem(II[e],t?`0`:`1`)}catch{}}function HI(e){return LI.filter(t=>!e[t]).length}function UI(e,t){let n=null;for(let r of e)(r.repo===``||t===r.repo||t.startsWith(`${r.repo}/`))&&(n===null||r.repo.length>n.repo.length)&&(n=r);return n}var WI=/(?:^|\s)@([^\s@]+)/g,GI=new Set([`,`,`.`,`;`,`:`,`!`,`?`,`)`,`]`]);function KI(e){let t=e.length;for(;t>0&&GI.has(e[t-1]);)t--;return e.slice(0,t)}function qI(e){return[...e.matchAll(WI)].map(([,e])=>KI(e??``)).filter(e=>e.length>0)}var JI=`uploads`,YI=class extends Error{reason;constructor(e,t){super(e),this.name=`UploadError`,this.reason=t}};function XI(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result.split(`,`,2)[1]??``),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}function ZI(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function QI(e){return e.type.startsWith(`image/`)?`image`:e.type===`application/pdf`||D(e.name)||oe(e.name)?`extraction-tool`:e.size<=524288?`inline-text`:tL(e)&&e.size<=26214400?`extraction-tool`:`unsupported`}function $I(e){let t=QI(e);return t===`extraction-tool`||t===`image`&&e.size>7340032}var eL=new Set([`application/json`,`application/xml`,`application/javascript`,`application/x-yaml`,`application/yaml`,`application/sql`]);function tL(e){return e.type.startsWith(`text/`)||eL.has(e.type)}function nL(e){return tL(e)?`${e.name}: file too large to upload (max 25 MB)`:`${e.name}: unsupported file type${e.type?` (${e.type})`:``}`}function rL(e,t){return t instanceof YI?t.reason===`denied`?`${e.name}: cannot upload — the workspace is read-only`:t.reason===`too-large`?`${e.name}: file too large to upload (max 25 MB)`:t.reason===`invalid`?`${e.name}: ${t.message}`:`${e.name}: upload failed — ${t.message}`:`${e.name}: upload failed`}async function iL(e){let t;try{t=await e.text()}catch{return{attachments:[],errors:[`${e.name}: could not be read`]}}return t.includes(`\0`)?{attachments:[],errors:[`${e.name}: unsupported binary file`]}:{attachments:[{name:e.name,kind:`text`,data:t,mimeType:e.type||`text/plain`,source:`manual`}],errors:[]}}async function aL(e){try{let t=await XI(e);return{attachments:[{name:e.name,kind:`image`,data:t,mimeType:e.type,source:`manual`}],errors:[]}}catch{return{attachments:[],errors:[`${e.name}: could not be read`]}}}async function oL(e,t){if(e.size>26214400)return{attachments:[],errors:[`${e.name}: file too large to upload (max 25 MB)`]};let n;try{n=await XI(e)}catch{return{attachments:[],errors:[`${e.name}: could not be read`]}}try{return{attachments:[mL(await t(e.name,n))],errors:[]}}catch(t){return{attachments:[],errors:[rL(e,t)]}}}async function sL(e,t){let n=await Promise.all([...e].map(e=>{let n=QI(e);return n===`unsupported`?Promise.resolve({attachments:[],errors:[nL(e)]}):n===`inline-text`?iL(e):n===`image`&&e.size<=7340032?aL(e):oL(e,t)}));return{attachments:n.flatMap(e=>e.attachments),errors:n.flatMap(e=>e.errors)}}function cL(e){return{...mL(e),source:`preview`,previewPath:e}}function lL(e){return cL(e)}function uL(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|\\s)@${n}[,.;:!?)\\]]*(\\s|$)`).test(e)}var dL=qI;function fL(e,t){let n=e.trim(),r=e=>{n+=`${n?`
|
|
329
|
+
|
|
330
|
+
`:``}${e}`};for(let e of t)e.kind===`path`?uL(n,e.data)||r(`@${e.data}`):e.kind===`text`&&r(`\`\`\`${e.name}\n${e.data}\n\`\`\``);return n}async function pL(e,t){try{let n=await fetch(t);if(!n.ok)return`${e}: unable to read preview image for attachment`;let r=n.headers.get(`Content-Type`)?.split(`;`,1)[0]??``;if(!r.startsWith(`image/`))return`${e}: preview is not a supported image attachment`;let i=new Uint8Array(await n.arrayBuffer());return i.byteLength>7340032?`${e}: image too large (max 7 MB)`:{name:e,kind:`image`,data:ZI(i),mimeType:r,source:`preview`,previewPath:e}}catch{return`${e}: unable to read preview image for attachment`}}function mL(e){return{name:e,kind:`path`,data:e,mimeType:`text/plain`,source:`manual`}}function hL(e,t){return e.some(e=>e.kind===`path`&&e.data===t)?e:[...e,mL(t)]}function gL(e,t){return[...e.filter(e=>e.source!==`preview`),t]}function _L(e,t){return e.filter((e,n)=>n!==t)}function vL(e,t){if(!t)return!1;let n=e.composedPath();if(n.length>0)return n.includes(t);let r=e.target;return r!==null&&t.contains(r)}function yL(e){let t=(0,d.useRef)(null);return(0,d.useEffect)(()=>{function n(n){t.current&&!vL(n,t.current)&&e()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e]),t}var bL=100,xL=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0}),SL={extension:`ext`,prompt:`prompt`,skill:`skill`};function CL(e){return e===`directory`||e===`symlink-directory`}function wL(e,t){let n=e.slice(0,t),r=/(?:^|\s)@([^\s@]*)$/.exec(n);return r?{start:t-r[1].length-1,query:r[1]}:null}function TL({isStreaming:e,connected:t,commands:n,fileSearch:r,prefill:i,attachments:a,pendingUploads:o=[],onAttach:s,onMentionPaths:c,onRemoveAttachment:l,onSend:u,onAbort:f,onSearchFiles:p,onClearFileSearch:m,initialDraft:h,onDraftChange:g}){let[_,v]=(0,d.useState)(h??``);(0,d.useEffect)(()=>{g?.(_)},[_,g]);let[y,b]=(0,d.useState)(0),[x,S]=(0,d.useState)(0),[C,w]=(0,d.useState)(!1),T=(0,d.useRef)(null),ee=(0,d.useRef)(null),te=(0,d.useRef)(null),E=(0,d.useRef)(null),ne=(0,d.useRef)(null);(0,d.useEffect)(()=>{i&&v(i.text)},[i?.nonce]),(0,d.useEffect)(()=>{ne.current!==null&&(te.current?.focus(),te.current?.setSelectionRange(ne.current,ne.current),ne.current=null)},[_]),(0,d.useLayoutEffect)(()=>{let e=te.current;if(!e)return;let t=-1,n=()=>{t=e.offsetWidth,e.style.overflowY=`hidden`,e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`,e.scrollHeight>e.clientHeight&&(e.style.overflowY=`auto`)};n();let r=typeof ResizeObserver>`u`?void 0:new ResizeObserver(()=>{e.offsetWidth!==t&&n()});return r?.observe(e,{box:`border-box`}),()=>r?.disconnect()},[_]);let re=(0,d.useMemo)(()=>dL(_),[_]);(0,d.useEffect)(()=>{c(re)},[re.join(`
|
|
331
|
+
`)]);let ie=(0,d.useMemo)(()=>{let e=/^\/(\S*)$/.exec(_);return e?e[1].toLowerCase():null},[_]),ae=(0,d.useMemo)(()=>ie===null?[]:n.filter(e=>e.name.toLowerCase().includes(ie)).sort((e,t)=>{let n=e.name.toLowerCase().startsWith(ie);return n===t.name.toLowerCase().startsWith(ie)?xL.compare(e.name,t.name):n?-1:1}).slice(0,bL),[ie,n]),D=ie===null?wL(_,y):null;(0,d.useEffect)(()=>{if(!D||D.query.length===0){m();return}let e=window.setTimeout(()=>p(D.query),150);return()=>clearTimeout(e)},[D?.query]);let oe=(0,d.useMemo)(()=>{if(ae.length>0)return{kind:`command`,items:ae};let e=D&&r?.query===D.query?r.results:[];return e.length>0?{kind:`file`,items:e}:null},[ae,D,r]),se=oe!==null&&!C,O=ie===null?D?`file:${D.query}`:null:`cmd:${ie}`;(0,d.useEffect)(()=>{S(0)},[O]),(0,d.useEffect)(()=>{w(!1)},[ie===null?D?`file`:null:`command`]),(0,d.useEffect)(()=>{if(!se)return;let e=e=>{vL(e,T.current)||w(!0)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[se]),(0,d.useEffect)(()=>{ee.current?.querySelector(`[data-selected="true"]`)?.scrollIntoView({block:`nearest`})},[x]);let ce=o.length>0,[k,le]=(0,d.useState)(!1);(0,d.useEffect)(()=>{ce||le(!1)},[ce]);function ue(){if(ce){le(!0);return}let e=fL(_,a),t=a.filter(e=>e.kind===`image`).map(e=>({data:e.data,mimeType:e.mimeType})),n=a.every(e=>e.kind===`path`);!_.trim()&&(n||!e)&&t.length===0||(u(e,t.length>0?t:void 0),v(``),m())}function de(e){let t=`/${e.name} `;v(t),ne.current=t.length,b(t.length)}function j(e){if(!D)return;let t=_.slice(0,D.start),n=_.slice(y),r=`@${e.path}${CL(e.type)?`/`:` `}`,i=`${t}${r}${n}`;v(i),m();let a=t.length+r.length;ne.current=a,b(a)}function fe(){if(oe){if(oe.kind===`command`){let e=oe.items[x];e&&de(e)}else{let e=oe.items[x];e&&j(e)}}}function pe(e){if(se&&oe){if(e.key===`ArrowDown`){e.preventDefault(),S(e=>(e+1)%oe.items.length);return}if(e.key===`ArrowUp`){e.preventDefault(),S(e=>(e-1+oe.items.length)%oe.items.length);return}if(e.key===`Tab`||e.key===`Enter`){e.preventDefault(),fe();return}if(e.key===`Escape`){e.preventDefault(),w(!0);return}}e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),ue())}function me(e){b(e.currentTarget.selectionStart??0)}function he(e){let t=Array.from(e.clipboardData.files);t.length>0&&(e.preventDefault(),s(t))}return(0,A.jsxs)(`div`,{ref:T,className:`relative`,children:[(a.length>0||ce)&&(0,A.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:[o.map(e=>(0,A.jsxs)(`span`,{"data-pending-upload":e.name,title:`${e.name} — copying into the workspace`,className:`flex items-center gap-1.5 rounded-md border border-dashed border-zinc-300 bg-zinc-50 py-1 pl-1.5 pr-2 text-xs text-zinc-500 dark:border-zinc-600 dark:bg-zinc-800/40 dark:text-zinc-400`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`animate-pulse`,children:`⏳`}),(0,A.jsx)(`span`,{className:`max-w-40 truncate`,children:e.name}),(0,A.jsx)(`span`,{className:`sr-only`,children:`uploading`})]},e.id)),k&&(0,A.jsx)(`span`,{role:`status`,className:`flex items-center py-1 text-xs text-amber-600 dark:text-amber-400`,children:`waiting for the attachment to finish uploading…`}),a.map((e,t)=>(0,A.jsxs)(`span`,{title:e.kind===`path`?`${e.name} — sent as a reference; the agent reads the file itself`:e.name,className:`flex items-center gap-1.5 rounded-md border border-zinc-200 bg-zinc-50 py-1 pl-1.5 pr-1 text-xs text-zinc-600 dark:border-zinc-700 dark:bg-zinc-800/60 dark:text-zinc-300`,children:[e.kind===`image`?(0,A.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.data}`,alt:e.name,className:`h-8 w-8 rounded object-cover`}):(0,A.jsx)(`span`,{"aria-hidden":!0,className:e.kind===`path`?`font-mono font-bold text-blue-600 dark:text-blue-400`:``,children:e.kind===`path`?`@`:`📄`}),(0,A.jsx)(`span`,{className:`max-w-40 truncate`,children:e.name}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>l(t),title:`remove attachment`,className:`rounded px-1 text-zinc-400 hover:bg-zinc-200 hover:text-zinc-700 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`,children:`✕`})]},`${e.name}:${t}`))]}),se&&oe&&(0,A.jsx)(`div`,{ref:ee,className:`absolute bottom-full left-0 z-20 mb-2 max-h-72 w-full max-w-xl overflow-y-auto rounded-lg border border-zinc-200 bg-white py-1 shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:oe.kind===`command`?oe.items.map((e,t)=>(0,A.jsxs)(`button`,{type:`button`,"data-selected":t===x,onMouseEnter:()=>S(t),onClick:()=>de(e),className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm ${t===x?`bg-zinc-100 dark:bg-zinc-800`:``}`,children:[(0,A.jsxs)(`span`,{className:`font-mono text-zinc-800 dark:text-zinc-200`,children:[`/`,e.name]}),e.argumentHint&&(0,A.jsx)(`span`,{className:`font-mono text-xs text-zinc-500`,children:e.argumentHint}),e.description&&(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-zinc-500`,children:e.description}),(0,A.jsx)(`span`,{className:`ml-auto shrink-0 rounded bg-zinc-200 px-1 text-[10px] uppercase text-zinc-500 dark:bg-zinc-800`,children:SL[e.source]})]},e.name)):oe.items.map((e,t)=>(0,A.jsx)(`button`,{type:`button`,"data-selected":t===x,onMouseEnter:()=>S(t),onClick:()=>j(e),className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm ${t===x?`bg-zinc-100 dark:bg-zinc-800`:``}`,children:(0,A.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-zinc-800 dark:text-zinc-200`,children:[e.path,CL(e.type)?`/`:``]})},e.path))}),(0,A.jsxs)(`div`,{className:`flex items-end gap-2 rounded-xl border border-zinc-200 bg-zinc-50 p-2 focus-within:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-900 dark:focus-within:border-zinc-600`,children:[(0,A.jsx)(`textarea`,{ref:te,value:_,onChange:e=>{v(e.target.value),b(e.target.selectionStart??e.target.value.length)},onKeyDown:pe,onClick:me,onKeyUp:me,onPaste:he,placeholder:t?e?`steer the agent… (Enter to send)`:`message pi… (/ for commands, @ for files, Enter to send, Shift+Enter for newline)`:`connecting…`,disabled:!t,rows:1,className:`max-h-[min(40vh,20rem)] flex-1 resize-none overflow-y-hidden bg-transparent px-2 py-1.5 text-[15px] outline-none placeholder:text-zinc-400 disabled:opacity-50 dark:placeholder:text-zinc-600`}),e&&(0,A.jsx)(`button`,{type:`button`,onClick:f,title:`stop`,"aria-label":`Stop the agent`,className:`rounded-lg bg-red-100 p-2 text-red-700 hover:bg-red-200 dark:bg-red-900/60 dark:text-red-200 dark:hover:bg-red-900`,children:(0,A.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":!0,className:`h-4 w-4`,children:(0,A.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`})})}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>E.current?.click(),disabled:!t,title:`attach files`,"aria-label":`Attach files`,className:`rounded-lg p-2 text-zinc-500 hover:bg-zinc-200 hover:text-zinc-700 disabled:opacity-30 dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-200`,children:(0,A.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,"aria-hidden":!0,className:`h-4 w-4`,children:(0,A.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`})})}),(0,A.jsx)(`input`,{ref:E,type:`file`,multiple:!0,hidden:!0,onChange:e=>{e.target.files?.length&&s(Array.from(e.target.files)),e.target.value=``}}),(0,A.jsx)(`button`,{type:`button`,onClick:ue,disabled:!t||ce||!_.trim()&&a.length===0,title:ce?`waiting for an attachment to finish uploading`:e?`steer`:`send`,"aria-label":e?`Steer the agent`:`Send message`,className:`rounded-lg bg-zinc-900 p-2 text-zinc-100 hover:bg-zinc-800 disabled:opacity-30 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white`,children:e?(0,A.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,"aria-hidden":!0,className:`h-4 w-4`,children:[(0,A.jsx)(`circle`,{cx:`6`,cy:`19`,r:`3`}),(0,A.jsx)(`path`,{strokeLinecap:`round`,d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`}),(0,A.jsx)(`circle`,{cx:`18`,cy:`5`,r:`3`})]}):(0,A.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,"aria-hidden":!0,className:`h-4 w-4`,children:(0,A.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 12 3.27 3.13c6.6 1.9 12.83 4.9 18.43 8.87-5.6 3.97-11.83 6.97-18.43 8.87L6 12Zm0 0h7.5`})})})]})]})}var EL=`rounded-md border px-3 py-1.5 text-sm border-zinc-200 hover:bg-zinc-100 dark:border-zinc-800 dark:hover:bg-zinc-800`,DL=`rounded-md bg-zinc-900 px-3 py-1.5 text-sm text-zinc-100 hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white`,OL=`w-full rounded-md border border-zinc-300 bg-white px-2 py-1.5 text-sm outline-none focus:border-zinc-500 dark:border-zinc-700 dark:bg-zinc-950 dark:focus:border-zinc-500`,kL=`mb-4 ${OL}`,AL=`1,3`,jL=` — `;function ML(e){let t=e.indexOf(`
|
|
332
|
+
`);return t===-1?{heading:e,body:``}:{heading:e.slice(0,t),body:e.slice(t+1).trim()}}function NL(e){let t=/^(\d+)\.\s+(\S[\s\S]*)$/.exec(e.trim());if(!t)return null;let n=t[2],r=n.indexOf(jL);return{index:Number(t[1]),label:r===-1?n:n.slice(0,r),description:r===-1?``:n.slice(r+3)}}function PL(e){if(e.method!==`input`||e.placeholder!==AL)return null;let{heading:t,body:n}=ML(e.title),r=[];for(let e of n.split(`
|
|
333
|
+
`)){let t=NL(e);t&&r.push(t)}return r.length<2||r.some((e,t)=>e.index!==t+1)?null:{heading:t,options:r}}function FL({request:e,onRespond:t}){let[n,r]=(0,d.useState)(e.method===`editor`?e.prefill??``:``),[i,a]=(0,d.useState)([]),[o,s]=(0,d.useState)(!1),c=(e.method===`select`||e.method===`confirm`||e.method===`input`)&&e.timeout,[l,u]=(0,d.useState)(c?Math.ceil(c/1e3):null),f=PL(e),{heading:p,body:m}=ML(e.title);function h(){t({id:e.id,cancelled:!0})}function g(e){a(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e].sort((e,t)=>e-t))}function _(){let r=n.trim();t({id:e.id,value:r.length>0?r:i.join(`,`)})}return(0,d.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>s(!1),400);return()=>clearTimeout(e)},[o]),(0,d.useEffect)(()=>{if(l===null)return;if(l<=0){t({id:e.id,cancelled:!0});return}let n=setTimeout(()=>u(e=>e===null?null:e-1),1e3);return()=>clearTimeout(n)},[l,e.id,t]),(0,A.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4`,onClick:()=>s(!0),children:(0,A.jsxs)(`div`,{className:`w-full ${m?`max-w-2xl`:`max-w-md`} rounded-xl border bg-white p-4 shadow-2xl transition-shadow dark:bg-zinc-900 ${o?`border-zinc-400 ring-2 ring-zinc-400/60 dark:border-zinc-500 dark:ring-zinc-500/60`:`border-zinc-200 dark:border-zinc-700`}`,onClick:e=>e.stopPropagation(),children:[(0,A.jsxs)(`div`,{className:`mb-3 flex items-start gap-3`,children:[(0,A.jsx)(`h2`,{className:`flex-1 text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:p}),(0,A.jsx)(`button`,{type:`button`,onClick:h,"aria-label":`Refuse to answer`,title:`Refuse to answer`,className:`-mr-1 -mt-1 rounded-md px-1.5 py-0.5 text-sm leading-none text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-200`,children:`✕`})]}),m&&!f&&(0,A.jsx)(`pre`,{className:`mb-3 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-zinc-50 p-2 font-mono text-xs text-zinc-600 dark:bg-zinc-950 dark:text-zinc-400`,children:m}),e.method===`select`&&(0,A.jsx)(`div`,{className:`mb-1 flex flex-col gap-1`,children:e.options.map(n=>{let r=NL(n);return(0,A.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,value:n}),className:`text-left ${EL}`,children:r?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`font-medium text-zinc-900 dark:text-zinc-100`,children:r.label}),r.description&&(0,A.jsx)(`span`,{className:`mt-0.5 block text-xs text-zinc-500 dark:text-zinc-400`,children:r.description})]}):n},n)})}),e.method===`confirm`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`mb-4 text-sm text-zinc-600 dark:text-zinc-400`,children:e.message}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,confirmed:!1}),className:EL,children:`No`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,confirmed:!0}),className:DL,children:`Yes`})]})]}),f&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`mb-3 flex flex-col gap-1`,children:f.options.map(e=>(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:i.includes(e.index),onChange:()=>g(e.index),className:`mt-0.5`}),(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`span`,{className:`font-medium text-zinc-900 dark:text-zinc-100`,children:e.label}),e.description&&(0,A.jsx)(`span`,{className:`mt-0.5 block text-xs text-zinc-500 dark:text-zinc-400`,children:e.description})]})]},e.index))}),(0,A.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`…or type your own answer`,onKeyDown:e=>{e.key===`Enter`&&_(),e.key===`Escape`&&h()},className:`mb-1 ${OL}`}),(0,A.jsx)(`p`,{className:`mb-4 text-xs text-zinc-400 dark:text-zinc-600`,children:`A typed answer replaces the selection above.`}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:h,className:EL,children:`Cancel`}),(0,A.jsx)(`button`,{type:`button`,onClick:_,className:DL,children:`OK`})]})]}),e.method===`input`&&!f&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`input`,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),placeholder:e.placeholder,onKeyDown:r=>{r.key===`Enter`&&t({id:e.id,value:n}),r.key===`Escape`&&h()},className:kL}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:h,className:EL,children:`Cancel`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,value:n}),className:DL,children:`OK`})]})]}),e.method===`editor`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`textarea`,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),rows:8,onKeyDown:e=>{e.key===`Escape`&&h()},className:`resize-none font-mono ${kL}`}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:h,className:EL,children:`Cancel`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,value:n}),className:DL,children:`OK`})]})]}),l!==null&&(0,A.jsxs)(`p`,{className:`mt-3 text-right text-xs text-zinc-400 dark:text-zinc-600`,children:[`auto-dismiss in `,l,`s`]})]})})}var IL={info:`border-blue-300 bg-blue-50 text-blue-800 dark:border-blue-900 dark:bg-blue-950/60 dark:text-blue-200`,warning:`border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-900 dark:bg-amber-950/60 dark:text-amber-200`,error:`border-red-300 bg-red-50 text-red-800 dark:border-red-900 dark:bg-red-950/60 dark:text-red-200`},LL=6e3;function RL({notification:e,onDismiss:t}){let n=(0,d.useRef)(t);return(0,d.useEffect)(()=>{n.current=t}),(0,d.useEffect)(()=>{let e=setTimeout(()=>n.current(),LL);return()=>clearTimeout(e)},[e.id]),(0,A.jsxs)(`div`,{role:`status`,className:`flex items-start gap-2 rounded-lg border px-3 py-2 text-sm shadow-lg ${IL[e.notifyType??`info`]}`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.message}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`Dismiss notification`,onClick:()=>n.current(),className:`-mr-1 shrink-0 rounded px-1 leading-5 opacity-60 transition-opacity hover:opacity-100 focus-visible:opacity-100`,children:`×`})]})}function zL({notifications:e,onDismiss:t}){return e.length===0?null:(0,A.jsx)(`div`,{className:`fixed right-4 top-16 z-40 flex w-80 flex-col gap-2`,children:e.map(e=>(0,A.jsx)(RL,{notification:e,onDismiss:()=>t(e.id)},e.id))})}var BL={30:`#3f3f46`,31:`#dc2626`,32:`#16a34a`,33:`#ca8a04`,34:`#2563eb`,35:`#9333ea`,36:`#0891b2`,37:`#71717a`,90:`#a1a1aa`,91:`#ef4444`,92:`#22c55e`,93:`#eab308`,94:`#3b82f6`,95:`#a855f7`,96:`#06b6d4`,97:`#d4d4d8`},VL=/\u001B\[[0-9;:]*[A-Za-z]|\u001B[()][A-Za-z0-9]|\u001B[A-Za-z]/g;function HL(e,t){let n={...e};for(let e=0;e<t.length;e++){let r=t[e];if(r===0)for(let e of Object.keys(n))delete n[e];else if(r===1)n.bold=!0;else if(r===2)n.dim=!0;else if(r===3)n.italic=!0;else if(r===4)n.underline=!0;else if(r===22)delete n.bold,delete n.dim;else if(r===23)delete n.italic;else if(r===24)delete n.underline;else if(r===39)delete n.color;else if(BL[r]!==void 0)n.color=BL[r];else if(r===38){if(t[e+1]===2){let[r,i,a]=[t[e+2],t[e+3],t[e+4]];[r,i,a].every(e=>Number.isFinite(e))&&(n.color=`rgb(${r} ${i} ${a})`),e+=4}else t[e+1]===5&&(e+=2)}}return n}function UL(e){let t=[],n={},r=0;VL.lastIndex=0;for(let i=VL.exec(e);i!==null;i=VL.exec(e)){i.index>r&&t.push({text:e.slice(r,i.index),...n}),r=i.index+i[0].length;let a=i[0];if(a.endsWith(`m`)){let e=a.slice(2,-1),t=e===``?[0]:e.split(/[;:]/).map(e=>e===``?0:Number(e));n=HL(n,t)}}return r<e.length&&t.push({text:e.slice(r),...n}),t}function WL(e){return e.replace(VL,``)}function GL({line:e}){let t=UL(e);return(0,A.jsx)(A.Fragment,{children:t.map((e,t)=>(0,A.jsx)(`span`,{style:{...e.color?{color:e.color}:{},...e.bold?{fontWeight:600}:{},...e.dim?{opacity:.7}:{},...e.italic?{fontStyle:`italic`}:{},...e.underline?{textDecoration:`underline`}:{}},children:e.text},t))})}function KL({widgets:e,placement:t}){let n=Object.entries(e).filter(([,e])=>e.placement===t);return n.length===0?null:(0,A.jsx)(`div`,{className:`mb-2 flex flex-col gap-1`,children:n.map(([e,t])=>(0,A.jsx)(`div`,{className:`whitespace-pre-wrap rounded-md border border-zinc-200 bg-zinc-50 px-3 py-1.5 font-mono text-xs text-zinc-600 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-400`,children:t.lines.map((e,t)=>(0,A.jsx)(`div`,{children:(0,A.jsx)(GL,{line:e})},t))},e))})}function qL({text:e,path:t,serverUrl:n,token:r,workspace:i,template:a}){let[o,s]=(0,d.useState)(`idle`),[c,l]=(0,d.useState)(`plain`),[u,f]=(0,d.useState)(null),p=(0,d.useRef)(!1),m=(0,d.useRef)({plain:0,template:0});async function h(a){if(!(p.current||Date.now()-m.current[a]<750)){p.current=!0,m.current[a]=Date.now(),l(a),s(`working`),f(null);try{let{downloadDocx:o,downloadDocxInTemplate:c}=await fe(async()=>{let{downloadDocx:e,downloadDocxInTemplate:t}=await import(`./docxExport-70RM2cmX.js`);return{downloadDocx:e,downloadDocxInTemplate:t}},__vite__mapDeps([21,1,22]));await(a===`template`?c:o)(e,t,{serverUrl:n,token:r,workspace:i}),s(`idle`)}catch(e){s(`failed`),f(e instanceof Error?e.message:String(e))}finally{p.current=!1}}}let g=`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 disabled:opacity-50 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,_=(e,t)=>o===`working`&&c===e?`… exporting`:o===`failed`&&c===e?`⚠ export failed`:t,v=(e,t)=>o===`failed`&&c===e?`Could not export: ${u??`unknown reason`}`:t;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>void h(`plain`),disabled:o===`working`,title:v(`plain`,`Download as a Word document`),"aria-label":`Download as a Word document`,className:g,children:_(`plain`,`⤓ word`)}),a!==void 0&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>void h(`template`),disabled:o===`working`,title:v(`template`,`Download as a Word document in the template ${a}`),"aria-label":`Download as a Word document in the template ${a}`,className:g,children:_(`template`,`⤓ word · template`)})]})}function JL({query:e,onQueryChange:t,matchCount:n,truncated:r=!1,currentIndex:i,searching:a=!1,onNext:o,onPrev:s,onClose:c,inputRef:l}){let u=(0,d.useRef)(null),f=l??u;(0,d.useEffect)(()=>{f.current?.focus(),f.current?.select()},[]);let p=n===0?a?`searching…`:`0/0`:`${i+1}/${n}${r?`+`:``}`;return(0,A.jsxs)(`div`,{role:`search`,"aria-label":`Find in file`,className:`flex items-center gap-2 border-b border-zinc-200 bg-zinc-50 px-3 py-1.5 text-xs dark:border-zinc-800 dark:bg-zinc-900`,children:[(0,A.jsx)(`input`,{ref:f,type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),e.shiftKey?s():o()):e.key===`Escape`&&(e.stopPropagation(),c())},placeholder:`Find in file`,"aria-label":`Find`,className:`min-w-0 flex-1 rounded border border-zinc-300 bg-white px-2 py-1 text-xs text-zinc-700 outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-200`}),(0,A.jsx)(`span`,{className:`shrink-0 tabular-nums text-zinc-500 dark:text-zinc-400`,children:p}),(0,A.jsx)(`button`,{type:`button`,onClick:s,disabled:n===0,"aria-label":`Previous match`,title:`Previous match (Shift+Enter)`,className:`shrink-0 rounded px-1.5 py-0.5 text-zinc-500 hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-400 dark:hover:bg-zinc-800`,children:`‹`}),(0,A.jsx)(`button`,{type:`button`,onClick:o,disabled:n===0,"aria-label":`Next match`,title:`Next match (Enter)`,className:`shrink-0 rounded px-1.5 py-0.5 text-zinc-500 hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-400 dark:hover:bg-zinc-800`,children:`›`}),(0,A.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Close find bar`,title:`Close (Esc)`,className:`shrink-0 rounded px-1.5 py-0.5 text-zinc-500 hover:bg-zinc-200 dark:text-zinc-400 dark:hover:bg-zinc-800`,children:`✕`})]})}var YL=3e3;function XL(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ZL(e,t,n=1/0){if(t===``)return[];let r=new RegExp(XL(t),`gi`),i=[],a;for(;(a=r.exec(e))!==null&&(i.push({start:a.index,end:a.index+a[0].length}),!(i.length>=n)););return i}function QL(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[],r=``;for(let e=t.nextNode();e!==null;e=t.nextNode()){let t=e.data.length;t!==0&&(n.push({node:e,start:r.length,end:r.length+t}),r+=e.data)}return{nodes:n,text:r}}function $L(e,t,n=YL){let r={matches:[],truncated:!1,clear:()=>{}};if(t===``)return r;let{nodes:i,text:a}=QL(e);if(a===``)return r;let o=ZL(a,t,n+1),s=o.length>n,c=s?o.slice(0,n):o;if(c.length===0)return{matches:[],truncated:s,clear:()=>{}};let l=Array(c.length);for(let e=c.length-1;e>=0;e--){let{start:t,end:n}=c[e],r=[];for(let e of i){if(e.end<=t||e.start>=n)continue;let i=Math.max(0,t-e.start),a=Math.min(e.node.data.length,n-e.start);if(i>=a)continue;let o=e.node;a<o.data.length&&o.splitText(a);let s=i>0?o.splitText(i):o,c=document.createElement(`mark`);c.className=`find-match`,s.replaceWith(c),c.appendChild(s),r.push(c)}l[e]={marks:r}}return{matches:l,truncated:s,clear:()=>{for(let{marks:e}of l)for(let t of e)t.replaceWith(document.createTextNode(t.textContent??``));e.normalize()}}}var eR=(0,d.lazy)(()=>fe(()=>import(`./PdfViewer-CptfuY34.js`),[])),tR=250,nR=`(min-width: 768px)`;function rR(){let[e,t]=(0,d.useState)(()=>window.matchMedia?.(nR).matches??!0);return(0,d.useEffect)(()=>{let e=window.matchMedia?.(nR);if(e===void 0)return;let n=()=>t(e.matches);return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),e}function iR(e,t){let[n,r]=(0,d.useState)(e);return(0,d.useEffect)(()=>{let n=window.setTimeout(()=>r(e),t);return()=>window.clearTimeout(n)},[e,t]),n}function aR(e){let t=pu(e);return t.status===`valid`?t.envelope:void 0}function oR(e){return/\.(md|markdown)$/i.test(e)}function sR(e,t){return t===void 0?!0:t===null?!1:t===``||e===t||e.startsWith(`${t}/`)}function cR({file:e,writableRoot:t,isStreaming:n,onDirtyChange:r,gitState:i,initialShowGitDiff:a=!1,gitDiff:o,onFetchGitDiff:s,onClearGitDiff:c,inRepository:l,onOpenGitHistory:u,onClose:f,onReload:p,onSave:m,serverUrl:h=``,token:g=null,workspace:_,docxTemplate:v,onImageLoad:y,onPdfLoad:b,rawRevision:x=0}){let[C,w]=(0,d.useState)(`rendered`),[T,ee]=(0,d.useState)(a),[E,ne]=(0,d.useState)(e.status===`loaded`&&e.justCreated?{draft:e.content,baseContent:e.content,baseMtimeMs:e.mtimeMs}:null),[re,oe]=(0,d.useState)(`idle`),O=(0,d.useRef)(null),ce=(0,d.useRef)(null),k=e.status===`loaded`?e:null,ue=k!==null&&oR(e.path),de=ae(e.path),j=D(e.path),fe=(0,d.useMemo)(()=>k===null?void 0:pu(k.content),[k?.content]),pe=fe?.status===`valid`,me=fe?.status===`valid`||fe?.status===`invalid`,he=me||ue,ge=C===`source`,_e=rR(),ye=sR(e.path,t)&&!j,be=E!==null&&E.draft!==E.baseContent,xe=k?.pendingSave!==void 0,Se=E!==null&&k!==null&&k.mtimeMs!==E.baseMtimeMs,Ce=k?.saveError?.conflict===!0||Se,we=E?.draft??k?.content??``,Te=iR(we,tR),Ee=(0,d.useMemo)(()=>k===null?void 0:pu(Te),[Te,k===null]),[De,Oe]=(0,d.useState)(()=>e.status===`loaded`?aR(e.content):void 0);(0,d.useEffect)(()=>{Ee?.status===`valid`&&Oe(Ee.envelope)},[Ee]);let ke=Ee!==void 0&&Ee.status!==`valid`&&De!==void 0,Ae=Ee?.status===`invalid`?Te===k?.content&&k.documentIssues!==void 0?k.documentIssues:Ee.issues:void 0,je=Ee?.status===`not-a-document`?Ee.why===`unparseable`?`This is not parseable JSON yet.`:"This no longer declares a structured-exchange `schema`.":Ee?.status===`unsupported-version`?`This declares ${Ee.schema}, which this version does not render.`:void 0,Me=C===`split`&&he&&!T&&k!==null&&_e,Ne=T||Me?`none`:j?`pdf`:E===null?k!==null&&!de?`dom`:`none`:`edit`,[Pe,Fe]=(0,d.useState)(!1),[Ie,Le]=(0,d.useState)(``),[Re,Be]=(0,d.useState)(0),Ve=(0,d.useRef)(null),Ue=(0,d.useRef)(null),We=(0,d.useRef)(null),[Ge,Ke]=(0,d.useState)({matchCount:0,currentIndex:-1,searching:!1}),[qe,Je]=(0,d.useState)([]),[Ye,Xe]=(0,d.useState)(!1),Ze=(0,d.useRef)(null),Qe=(0,d.useRef)([]),$e=(0,d.useRef)(0),et=(0,d.useRef)(``);function tt(e){$e.current=e;for(let[t,n]of Qe.current.entries())for(let r of n.marks)r.isConnected&&r.classList.toggle(`find-match-current`,t===e);let t=Qe.current[e]?.marks;t?.[0]?.isConnected&&t[0].scrollIntoView({block:`center`})}let nt=Pe?Ie:``,rt=(0,d.useMemo)(()=>Ne===`edit`?ZL(we,nt):[],[Ne,we,nt]);(0,d.useEffect)(()=>{Pe&&Ne===`none`&&Fe(!1)},[Pe,Ne]);let[it,at]=(0,d.useState)(0),ot=(0,d.useCallback)(()=>at(e=>e+1),[]);(0,d.useEffect)(()=>{function e(){Ze.current?.clear(),Ze.current=null,Qe.current=[],Je([]),Xe(!1)}let t=Ue.current;if(Ne!==`dom`||nt===``||t===null){e();return}Ze.current?.clear();let n=$L(t,nt);Ze.current=n,Qe.current=n.matches,Je(n.matches),Xe(n.truncated);let r=nt!==et.current;et.current=nt;let i=r?0:Math.min($e.current,Math.max(n.matches.length-1,0));return Be(i),tt(i),e},[Ne,nt,C,ge,it]);function st(e,t){let n=e[t],r=O.current;n!==void 0&&r!==null&&(r.focus(),r.setSelectionRange(n.start,n.end),Ve.current?.focus())}(0,d.useEffect)(()=>{if(Ne!==`edit`||!Pe)return;let e=ZL(we,nt);Be(0),e.length>0&&st(e,0)},[nt,Ne,Pe]);function ct(){Fe(!0)}function lt(){Fe(!1)}function ut(){if(Ne===`pdf`)We.current?.findNext();else if(Ne===`edit`){if(rt.length===0)return;let e=(Re+1)%rt.length;Be(e),st(rt,e)}else{let e=Qe.current.length;if(e===0)return;let t=($e.current+1)%e;Be(t),tt(t)}}function dt(){if(Ne===`pdf`)We.current?.findPrevious();else if(Ne===`edit`){if(rt.length===0)return;let e=(Re-1+rt.length)%rt.length;Be(e),st(rt,e)}else{let e=Qe.current.length;if(e===0)return;let t=($e.current-1+e)%e;Be(t),tt(t)}}let ft=Ne===`pdf`?{matchCount:Ge.matchCount,currentIndex:Ge.currentIndex,truncated:!1,searching:Ge.searching}:Ne===`edit`?{matchCount:rt.length,currentIndex:rt.length>0?Math.min(Re,rt.length-1):-1,truncated:!1,searching:!1}:{matchCount:qe.length,currentIndex:qe.length>0?Math.min(Re,qe.length-1):-1,truncated:Ye,searching:!1},pt=E===null?null:(0,A.jsx)(`textarea`,{ref:O,value:E.draft,onChange:e=>ne({...E,draft:e.target.value}),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),be&&!xe&&!Ce&&vt())},spellCheck:!1,className:`h-full w-full resize-none bg-transparent p-4 font-mono text-[13px] leading-relaxed text-zinc-800 outline-none ring-inset focus-visible:ring-1 focus-visible:ring-zinc-300 dark:text-zinc-200 dark:focus-visible:ring-zinc-700`});function mt(t){return(0,A.jsx)(`div`,{className:`prose-chat mx-auto max-w-3xl p-4 text-zinc-700 dark:text-zinc-300`,children:(0,A.jsx)(py,{remarkPlugins:[JP,oF],rehypePlugins:[kE],components:{pre:ze,a:({href:t,children:n,...r})=>!t||/^[a-z][a-z0-9+.-]*:/i.test(t)?(0,A.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,...r,children:n}):t.startsWith(`#`)?(0,A.jsx)(`a`,{href:t,...r,children:n}):(0,A.jsx)(`a`,{href:t,onClick:n=>{n.preventDefault(),p(ie(e.path,t))},...r,children:n}),img:({src:t,alt:n,...r})=>{let i=typeof t==`string`&&t!==``&&!/^[a-z][a-z0-9+.-]*:/i.test(t)&&!t.startsWith(`//`)?se(h,ie(e.path,t),g,void 0,_):t;return(0,A.jsx)(`img`,{...r,src:i,alt:n??``,loading:`lazy`,className:`max-w-full rounded-lg`})}},children:te(t)})})}function ht(e){C===`split`&&e!==`split`&&be&&!window.confirm(`Discard unsaved changes?`)||(C===`split`&&e!==`split`&&ne(null),w(e))}function gt(){be&&!window.confirm(`Discard unsaved changes?`)||f()}function _t(){k&&ne({draft:k.content,baseContent:k.content,baseMtimeMs:k.mtimeMs})}function vt(t=!1){!k||E===null||xe||(ce.current=E.draft,m(e.path,E.draft,E.baseMtimeMs,t))}function yt(){ne(null),p(e.path)}function bt(){let t=!T;ee(t),t?s(e.path):c()}return(0,d.useEffect)(()=>{if(E!==null&&k!==null&&ce.current!==null&&k.content===ce.current&&k.mtimeMs!==E.baseMtimeMs){let e=ce.current;ce.current=null,E.draft===e?ne(null):ne({...E,baseContent:k.content,baseMtimeMs:k.mtimeMs})}},[k?.mtimeMs]),(0,d.useEffect)(()=>{function e(e){if(e.key===`Escape`){Pe?lt():gt();return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`f`){if(Ne===`none`)return;e.preventDefault(),ct()}}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,d.useEffect)(()=>{Me&&ye&&E===null&&k!==null&&ne({draft:k.content,baseContent:k.content,baseMtimeMs:k.mtimeMs})},[Me,ye,k?.mtimeMs]),(0,d.useEffect)(()=>{oe(n?`streaming`:e=>e===`streaming`?`done`:e)},[n]),(0,d.useEffect)(()=>(r(be),()=>r(!1)),[be]),(0,d.useEffect)(()=>(a&&s(e.path),()=>c()),[]),(0,A.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col bg-white dark:bg-zinc-950`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[he&&!T&&(0,A.jsx)(`div`,{className:`flex shrink-0 items-center gap-0.5`,role:`group`,"aria-label":`How to show this document`,children:[[`rendered`,`⚏ rendered`,`Show the rendering`],[`split`,`⇹ split`,`Edit the file beside its rendering`],[`source`,`⌗ source`,`Show the file as written`]].map(([e,t,n])=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>ht(e),"aria-pressed":C===e,title:n,className:`rounded px-1.5 py-0.5 text-xs ${C===e?`bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-200`:`text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`}`,children:t},e))}),i!==void 0&&E===null&&(0,A.jsx)(`button`,{type:`button`,onClick:bt,"aria-pressed":T,title:T?`Show file content`:`Show uncommitted changes (vs HEAD)`,className:`shrink-0 rounded px-1.5 py-0.5 text-xs ${T?`bg-amber-100 text-amber-800 dark:bg-amber-950/60 dark:text-amber-300`:`text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`}`,children:`± diff`}),l&&E===null&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>u(e.path),title:`Show this file's history`,className:`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:`⎇ history`}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-zinc-500 dark:text-zinc-400`,title:e.path,children:[e.path,be&&(0,A.jsx)(`span`,{className:`ml-1 text-amber-500`,children:`●`})]}),k&&!de&&!j&&!T&&(0,A.jsx)(qL,{text:we,path:e.path,serverUrl:h,token:g,workspace:_,template:v}),k&&E===null&&(0,A.jsx)(le,{text:k.content}),k&&E===null&&!T&&ye&&(0,A.jsx)(`button`,{type:`button`,onClick:_t,className:`shrink-0 rounded border border-zinc-300 px-2 py-0.5 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-700 dark:text-zinc-400 dark:hover:border-zinc-500 dark:hover:text-zinc-200`,children:`✎ edit`}),k&&E===null&&!ye&&(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-zinc-400 dark:text-zinc-600`,title:`Outside the writable zone`,children:`🔒 read-only`}),E!==null&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>vt(),disabled:!be||xe||Ce,className:`shrink-0 rounded border border-emerald-300 px-2 py-0.5 text-xs text-emerald-700 hover:border-emerald-500 disabled:opacity-50 dark:border-emerald-900 dark:text-emerald-400 dark:hover:border-emerald-600`,children:xe?`saving…`:`save`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{be&&!window.confirm(`Discard unsaved changes?`)||ne(Me&&k!==null?{draft:k.content,baseContent:k.content,baseMtimeMs:k.mtimeMs}:null)},className:`shrink-0 rounded border border-zinc-300 px-2 py-0.5 text-xs text-zinc-500 hover:border-zinc-400 dark:border-zinc-700 dark:text-zinc-400 dark:hover:border-zinc-500`,children:`cancel`})]}),(0,A.jsx)(`button`,{type:`button`,onClick:gt,title:`Close (Esc)`,"aria-label":`Close file viewer`,className:`shrink-0 px-1 text-sm text-zinc-400 hover:text-zinc-600 dark:text-zinc-600 dark:hover:text-zinc-300`,children:`✕`})]}),Pe&&Ne!==`none`&&(0,A.jsx)(JL,{inputRef:Ve,query:Ie,onQueryChange:Le,matchCount:ft.matchCount,currentIndex:ft.currentIndex,truncated:ft.truncated,searching:ft.searching,onNext:ut,onPrev:dt,onClose:lt}),Ce&&E!==null&&(0,A.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1`,children:`File changed on disk since you started editing.`}),(0,A.jsx)(`button`,{type:`button`,onClick:yt,className:`shrink-0 rounded border border-amber-400 px-2 py-0.5 text-xs hover:bg-amber-100 dark:border-amber-800 dark:hover:bg-amber-950/60`,children:`reload (discard my edits)`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>vt(!0),disabled:xe,className:`shrink-0 rounded border border-amber-400 px-2 py-0.5 text-xs hover:bg-amber-100 disabled:opacity-50 dark:border-amber-800 dark:hover:bg-amber-950/60`,children:`overwrite with my version`})]}),E!==null&&k?.saveError&&!k.saveError.conflict&&(0,A.jsx)(`div`,{className:`border-b border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:k.saveError.message}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[T&&E===null&&(0,A.jsxs)(`div`,{className:`p-4`,children:[o?.path===e.path&&`error`in o&&(0,A.jsx)(`div`,{className:`rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:o.error}),o?.path===e.path&&`before`in o&&(0,A.jsx)(He,{fill:!0,lines:S(o.before,o.after)}),o?.path!==e.path&&(0,A.jsx)(`div`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`loading diff…`})]}),j&&E===null&&!T&&(0,A.jsx)(Cf,{label:`This PDF`,children:(0,A.jsx)(d.Suspense,{fallback:(0,A.jsx)(`div`,{className:`p-4 text-sm text-zinc-400 dark:text-zinc-600`,children:`loading…`}),children:(0,A.jsx)(eR,{ref:We,path:e.path,serverUrl:h,token:g,workspace:_,revision:x,findQuery:Ne===`pdf`?nt:``,onFindStateChange:Ke,...b?{onLoaded:b}:{}})})}),de&&E===null&&!T&&(0,A.jsx)(`div`,{className:`flex h-full items-center justify-center p-4`,children:(0,A.jsx)(`img`,{src:se(h,e.path,g,x,_),alt:e.path,onLoad:()=>y(e.path),className:`max-h-full max-w-full rounded object-contain`})}),e.status===`loading`&&E===null&&!T&&!de&&!j&&(0,A.jsx)(`div`,{className:`p-4 text-sm text-zinc-400 dark:text-zinc-600`,children:`loading…`}),e.status===`error`&&!de&&!j&&(0,A.jsx)(`div`,{className:`p-4 text-sm text-red-600 dark:text-red-400`,children:e.message}),E!==null&&!Me&&pt,k&&E===null&&!Me&&!T&&ue&&!ge&&(0,A.jsx)(`div`,{ref:Ue,children:mt(k.content)}),Me&&(0,A.jsxs)(`div`,{className:`flex h-full min-h-0`,"data-testid":`file-split`,children:[(0,A.jsx)(`div`,{className:`min-w-0 flex-1 overflow-auto border-r border-zinc-200 dark:border-zinc-800`,children:pt??(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(ve,{code:k.content,path:e.path})})}),(0,A.jsx)(`div`,{className:`min-w-0 flex-1 overflow-auto`,"data-testid":`file-split-rendering`,children:ue&&!me?(0,A.jsx)(`div`,{className:`prose-chat p-4 text-zinc-700 dark:text-zinc-300`,children:mt(Te)}):(0,A.jsxs)(A.Fragment,{children:[ke&&(0,A.jsx)(`p`,{"data-testid":`file-split-stale`,className:`flex flex-wrap items-center gap-2 border-b border-amber-300 bg-amber-50 px-3 py-1.5 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:(0,A.jsxs)(`span`,{children:[`Showing the document as it last stood.`,` `,je??`The text beside it does not satisfy the schema it declares.`]})}),Ae!==void 0&&(0,A.jsxs)(`ul`,{"data-testid":`file-split-issues`,className:`space-y-0.5 border-b border-zinc-200 px-3 py-1.5 text-xs text-zinc-500 dark:border-zinc-800 dark:text-zinc-400`,children:[Ae.slice(0,6).map((e,t)=>(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`span`,{className:`font-mono opacity-70`,children:e.path===``?`(document)`:e.path}),` `,e.message]},t)),Ae.length>6&&(0,A.jsxs)(`li`,{className:`opacity-70`,children:[`…and `,Ae.length-6,` more`]})]}),De===void 0?(0,A.jsxs)(`p`,{className:`p-4 text-sm text-zinc-400 dark:text-zinc-600`,"data-testid":`file-split-nothing`,children:[`Nothing to draw yet. `,je??`This document does not satisfy the schema it declares.`]}):(0,A.jsx)(Cf,{label:`This diagram`,children:(0,A.jsx)(`div`,{className:`p-4`,"data-testid":`file-structured-exchange`,children:(0,A.jsx)(bf,{envelope:De,source:we})})})]})})]}),k&&E===null&&!Me&&!T&&pe&&!ge&&fe?.status===`valid`&&(0,A.jsx)(Cf,{label:`This diagram`,children:(0,A.jsx)(`div`,{className:`mx-auto max-w-5xl p-4`,"data-testid":`file-structured-exchange`,children:(0,A.jsx)(bf,{envelope:fe.envelope,source:k.content})})}),k&&E===null&&!Me&&!T&&fe?.status===`invalid`&&(0,A.jsxs)(`div`,{"data-testid":`file-structured-exchange-invalid`,className:`mx-4 mt-4 rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-200`,children:[(0,A.jsx)(`p`,{className:`font-medium`,children:`This declares a structured-exchange document and does not satisfy the schema.`}),(0,A.jsxs)(`ul`,{className:`mt-1 space-y-0.5 text-xs`,children:[(k.documentIssues??fe.issues).slice(0,8).map((e,t)=>(0,A.jsxs)(`li`,{children:[(0,A.jsx)(`span`,{className:`font-mono opacity-70`,children:e.path===``?`(document)`:e.path}),` `,e.message]},t)),(k.documentIssues??fe.issues).length>8&&(0,A.jsxs)(`li`,{className:`opacity-70`,children:[`…and `,(k.documentIssues??fe.issues).length-8,` more`]})]})]}),k&&E===null&&!Me&&!T&&fe?.status===`unsupported-version`&&(0,A.jsxs)(`div`,{"data-testid":`file-structured-exchange-unsupported`,className:`mx-4 mt-4 rounded-lg border border-zinc-300 bg-zinc-50 px-3 py-2 text-sm text-zinc-600 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-400`,children:[`This document declares `,(0,A.jsx)(`span`,{className:`font-mono`,children:fe.schema}),`, which this version does not render. Shown as text.`]}),k&&E===null&&!Me&&!T&&(!ue||ge)&&(!pe||ge)&&(0,A.jsx)(`div`,{ref:Ue,className:`p-4`,children:(0,A.jsx)(ve,{code:k.content,path:e.path,onRendered:ot})})]}),re!==`idle`&&(0,A.jsxs)(`button`,{type:`button`,onClick:gt,"aria-live":`polite`,className:`flex items-center gap-2 border-t border-zinc-200 px-3 py-2 text-left text-sm hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-900`,children:[re===`streaming`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 animate-pulse motion-reduce:animate-none rounded-full bg-amber-500`}),(0,A.jsx)(`span`,{className:`text-amber-700 dark:text-amber-400`,children:`π is replying…`})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 rounded-full bg-emerald-500`}),(0,A.jsx)(`span`,{className:`text-emerald-700 dark:text-emerald-400`,children:`π replied`})]}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-zinc-400 dark:text-zinc-500`,children:`show conversation →`})]})]})}function lR(e){return e.split(`
|
|
334
|
+
`).map(e=>e.startsWith(`diff --git `)?{kind:`file`,text:e.slice(11)}:e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)||e.startsWith(`index `)?{kind:`hunk`,text:e}:e.startsWith(`+`)?{kind:`add`,text:e.slice(1)}:e.startsWith(`-`)?{kind:`del`,text:e.slice(1)}:{kind:`context`,text:e.startsWith(` `)?e.slice(1):e})}function uR({show:e,onClose:t}){return(0,d.useEffect)(()=>{function e(e){e.key===`Escape`&&(e.stopImmediatePropagation(),t())}return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[t]),(0,A.jsxs)(`div`,{className:`absolute inset-0 z-30 flex flex-col bg-white dark:bg-zinc-950`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,A.jsx)(`span`,{className:`font-mono text-xs text-amber-600 dark:text-amber-500`,children:e.sha.slice(0,12)}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-zinc-500 dark:text-zinc-400`,children:`commit diff`}),(0,A.jsx)(`button`,{type:`button`,onClick:t,title:`Close (Esc)`,"aria-label":`Close commit diff`,className:`shrink-0 px-1 text-sm text-zinc-400 hover:text-zinc-600 dark:text-zinc-600 dark:hover:text-zinc-300`,children:`✕`})]}),e.truncated&&(0,A.jsx)(`div`,{className:`border-b border-amber-300 bg-amber-50 px-3 py-1.5 text-xs text-amber-800 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:`Patch truncated — showing the first 256 KiB.`}),(0,A.jsx)(`pre`,{className:`min-h-0 flex-1 overflow-auto p-3 font-mono text-xs leading-relaxed`,children:lR(e.patch).map((e,t)=>(0,A.jsxs)(`div`,{className:e.kind===`file`?`mt-3 border-t border-zinc-200 pt-2 font-bold text-zinc-700 first:mt-0 first:border-t-0 first:pt-0 dark:border-zinc-800 dark:text-zinc-200`:e.kind===`hunk`?`text-sky-600 dark:text-sky-400`:e.kind===`add`?`bg-emerald-50 text-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300`:e.kind===`del`?`bg-red-50 text-red-700 dark:bg-red-950/40 dark:text-red-300`:`text-zinc-500 dark:text-zinc-500`,children:[e.kind===`add`?`+ `:e.kind===`del`?`− `:``,e.text||` `]},t))})]})}var dR=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],fR=`worktree`,pR={defaultWidth:288,minWidth:224,maxWidth:640,keyboardStep:16,storageKey:`pi-outpost.files-sidebar-width.v1`},mR={defaultWidth:416,minWidth:224,maxWidth:640,keyboardStep:16,storageKey:`pi-outpost.history-list-width.v1`};function hR(e,t){return Number.isFinite(e)?Math.min(t.maxWidth,Math.max(t.minWidth,Math.round(e))):t.defaultWidth}function gR(e,t){return e===null||e.trim()===``?t.defaultWidth:hR(Number(e),t)}function _R(e,t){try{return gR((t??window.localStorage).getItem(e.storageKey),e)}catch{return e.defaultWidth}}function vR(e,t,n){try{(n??window.localStorage).setItem(t.storageKey,String(hR(e,t)))}catch{}}function yR(e){let[t,n]=(0,d.useState)(()=>_R(e)),r=(0,d.useRef)(t),i=(0,d.useRef)(null),a=(0,d.useCallback)(t=>{let i=hR(t,e);return r.current=i,n(i),i},[e]),o=(0,d.useCallback)(()=>{i.current!==null&&(i.current=null,vR(r.current,e))},[e]);return{width:t,separatorProps:{onPointerDown:e=>{e.isPrimary!==!1&&(e.button??0)===0&&(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),i.current={pointerId:e.pointerId,startX:e.clientX,startWidth:r.current})},onPointerMove:e=>{let t=i.current;t!==null&&t.pointerId===e.pointerId&&a(t.startWidth+e.clientX-t.startX)},onPointerUp:e=>{i.current?.pointerId===e.pointerId&&o()},onPointerCancel:e=>{let t=i.current;t!==null&&t.pointerId===e.pointerId&&(i.current=null,a(t.startWidth))},onLostPointerCapture:o,onKeyDown:t=>{let n=null;t.key===`ArrowLeft`?n=r.current-e.keyboardStep:t.key===`ArrowRight`?n=r.current+e.keyboardStep:t.key===`Home`&&(n=e.defaultWidth),n!==null&&(t.preventDefault(),vR(a(n),e))}}}}function bR({label:e,width:t,config:n,separatorProps:r,className:i=``}){return(0,A.jsx)(`div`,{...r,role:`separator`,"aria-label":e,"aria-orientation":`vertical`,"aria-valuemin":n.minWidth,"aria-valuemax":n.maxWidth,"aria-valuenow":t,tabIndex:0,title:e,className:`group absolute inset-y-0 -right-1 z-20 w-2 cursor-col-resize touch-none outline-none ${i}`,children:(0,A.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-transparent transition-colors group-hover:bg-blue-400 group-focus-visible:bg-blue-500 group-active:bg-blue-500 dark:group-hover:bg-blue-500`})})}var xR=`#10b981`,SR=[`#8b5cf6`,`#f59e0b`,`#0ea5e9`,`#f43f5e`,`#14b8a6`,`#d946ef`];function CR(e){return e===0?xR:SR[(e-1)%SR.length]}function wR(e){return SR[e%SR.length]}function TR(e){return e*14+7+1}function ER(e){return e*14+2}function DR({row:e,laneCount:t,colorOf:n=CR}){let r=ER(t),i=TR(e.lane),a=e.highlight?xR:n(e.lane),o=e.dashed?`3 3`:void 0;return(0,A.jsxs)(`svg`,{width:r,height:36,viewBox:`0 0 ${r} 36`,"aria-hidden":!0,className:`shrink-0`,children:[e.through.map(e=>(0,A.jsx)(`line`,{x1:TR(e),y1:0,x2:TR(e),y2:36,stroke:n(e),strokeWidth:2,opacity:.55},e)),e.lineAbove&&(0,A.jsx)(`line`,{x1:i,y1:0,x2:i,y2:18,stroke:a,strokeWidth:2,strokeDasharray:o}),e.lineBelow&&(0,A.jsx)(`line`,{x1:i,y1:18,x2:i,y2:36,stroke:a,strokeWidth:2,strokeDasharray:o}),e.forkTo.map(e=>(0,A.jsx)(`path`,{d:`M ${i} 18 C ${i} 36, ${TR(e)} 18, ${TR(e)} 36`,fill:`none`,stroke:n(e),strokeWidth:2,opacity:.75},`fork-${e}`)),(e.mergeFrom??[]).map(e=>(0,A.jsx)(`path`,{d:`M ${i} 18 C ${i} 0, ${TR(e)} 18, ${TR(e)} 0`,fill:`none`,stroke:n(e),strokeWidth:2,opacity:.75},`merge-${e}`)),e.emphasis===`current`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`circle`,{cx:i,cy:18,r:6,fill:`none`,stroke:a,strokeWidth:2}),(0,A.jsx)(`circle`,{cx:i,cy:18,r:2.5,fill:a})]}):(0,A.jsx)(`circle`,{cx:i,cy:18,r:4,fill:e.emphasis===`filled`?a:`var(--tree-off, #d4d4d8)`,stroke:a,strokeWidth:e.emphasis===`filled`?0:1.5})]})}function OR(e,t={}){let n=[],r=[],i=0,a=()=>{let e=r.indexOf(null);return e===-1?(r.push(null),i=Math.max(i,r.length),r.length-1):e};for(let t of e){let e=r.reduce((e,n,r)=>n===t.sha?[...e,r]:e,[]),o=e[0]??a(),s=e.slice(1);for(let e of s)r[e]=null;i=Math.max(i,o+1);let[c,...l]=t.parents;r[o]=c??null;let u=l.map(e=>{let t=a();return r[t]=e,t});n.push({rev:t.sha,path:t.path,entry:t,lane:o,through:r.reduce((e,t,n)=>t!==null&&n!==o&&!u.includes(n)?[...e,n]:e,[]),forkTo:u,mergeFrom:s,lineAbove:!0,lineBelow:t.parents.length>0,emphasis:`filled`})}let o=n[0];return n.unshift({rev:fR,path:o?.path??``,lane:o?.lane??0,through:o?.through??[],forkTo:[],mergeFrom:[],lineAbove:!1,lineBelow:n.length>0,emphasis:`current`,dashed:!t.dirty}),n[1]&&(n[1].lineAbove=!0),{rows:n,laneCount:Math.max(i,1)}}var kR=20;function AR(e){let t=(Date.now()-new Date(e).getTime())/1e3;return t<90?`now`:t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:`${Math.round(t/86400)}d ago`}function jR(e){return e.rev===`worktree`?`working tree`:e.rev.slice(0,7)}function MR(e,t){return e!==null&&t!==null&&e.rev===t.rev&&e.path===t.path}function NR(e){return{rev:e.rev,path:e.path}}function PR({history:e,diff:t,dirty:n,onFetchDiff:r,onClearDiff:i,onClose:a}){let[o,s]=(0,d.useState)({base:null,target:null}),{base:c,target:l}=o,[u,f]=(0,d.useState)(0),p=(0,d.useRef)([]),m=yR(mR),{rows:h,laneCount:g}=(0,d.useMemo)(()=>OR(e.entries,{dirty:n}),[e.entries,n]),_=(0,d.useRef)({onFetchDiff:r,onClose:a});_.current={onFetchDiff:r,onClose:a},(0,d.useEffect)(()=>{function e(e){e.key===`Escape`&&(e.stopImmediatePropagation(),_.current.onClose())}return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[]),(0,d.useEffect)(()=>{c===null||l===null||MR(c,l)||_.current.onFetchDiff(c,l)},[c,l]);let v=(0,d.useCallback)((e,t)=>{let n=NR(e);s(r=>{if(t===`base`)return{base:n,target:MR(n,r.target)?r.base:r.target};if(t===`target`)return{base:MR(n,r.base)?r.target:r.base,target:n};if(r.base===null&&r.target===null){let t=e.entry?.parents[0],r=t===void 0?void 0:h.find(e=>e.rev===t);return{base:r?NR(r):null,target:n}}return{base:MR(n,r.base)?r.target:r.base,target:n}})},[h]),y=(0,d.useCallback)(()=>{s({base:null,target:null}),i()},[i]),b=(0,d.useCallback)(()=>s(e=>({base:e.target,target:e.base})),[]),x=(0,d.useCallback)(e=>{f(t=>{let n=Math.max(0,Math.min(h.length-1,t+e));return p.current[n]?.focus(),n})},[h.length]),S=e=>{let t=NR(e);return MR(t,c)?`base`:MR(t,l)?`target`:null},C=h.findIndex(e=>MR(NR(e),c)),w=h.findIndex(e=>MR(NR(e),l)),T=C>=0&&w>=0?{top:Math.min(C,w)*36+18,height:Math.abs(w-C)*36}:null;return(0,A.jsxs)(`div`,{className:`absolute inset-0 z-30 flex flex-col bg-white dark:bg-zinc-950`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-zinc-500 dark:text-zinc-400`,title:e.path,children:e.path}),c!==null&&l!==null&&(0,A.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-zinc-500 dark:text-zinc-400`,"aria-label":`Comparing ${jR(c)} to ${jR(l)}`,children:[(0,A.jsx)(`span`,{className:`text-amber-600 dark:text-amber-500`,children:jR(c)}),` → `,(0,A.jsx)(`span`,{className:`text-amber-600 dark:text-amber-500`,children:jR(l)})]}),c!==null&&l!==null&&(0,A.jsx)(`button`,{type:`button`,onClick:b,title:`Compare the other way round`,className:`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-200`,children:`⇄ swap`}),(c!==null||l!==null)&&(0,A.jsx)(`button`,{type:`button`,onClick:y,className:`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-200`,children:`clear`}),(0,A.jsx)(`button`,{type:`button`,onClick:a,title:`Close (Esc)`,"aria-label":`Close file history`,className:`shrink-0 px-1 text-sm text-zinc-400 hover:text-zinc-600 dark:text-zinc-600 dark:hover:text-zinc-300`,children:`✕`})]}),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col md:flex-row`,children:[(0,A.jsxs)(`div`,{role:`region`,"aria-label":`Commit history`,style:{"--history-list-width":`${m.width}px`},className:`relative flex max-h-[40%] w-full shrink-0 flex-col border-b border-zinc-200 md:max-h-none md:w-[var(--history-list-width)] md:border-b-0 md:border-r dark:border-zinc-800`,children:[(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),x(1)):e.key===`ArrowUp`&&(e.preventDefault(),x(-1))},children:[e.status===`loading`&&(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`Reading history…`}),e.status===`error`&&(0,A.jsx)(`div`,{className:`m-3 rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.error}),e.status===`loaded`&&e.entries.length===0&&(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`No commits touch this file yet.`}),e.status===`loaded`&&e.entries.length>0&&(0,A.jsxs)(`div`,{className:`relative`,role:`group`,"aria-label":`Commits`,children:[T&&(0,A.jsx)(FR,{top:T.top,height:T.height,baseFirst:C<w}),h.map((e,t)=>(0,A.jsx)(RR,{ref:e=>{p.current[t]=e},row:e,laneCount:g,role:S(e),isFocused:t===u,onSelect:t=>v(e,t),onFocus:()=>f(t)},e.rev))]})]}),(0,A.jsx)(bR,{label:`Resize History commit list`,width:m.width,config:mR,separatorProps:m.separatorProps,className:`hidden md:block`})]}),(0,A.jsx)(`div`,{role:`region`,"aria-label":`History diff`,className:`min-h-0 min-w-0 flex-1 overflow-auto p-3`,children:(0,A.jsx)(zR,{diff:t,base:c,target:l})})]})]})}function FR({top:e,height:t,baseFirst:n}){return(0,A.jsxs)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute left-0 z-10 motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-out`,style:{top:e,height:t,width:kR},children:[(0,A.jsx)(`div`,{className:`absolute inset-y-0 left-2 w-px bg-zinc-400 dark:bg-zinc-500`}),(0,A.jsx)(IR,{label:n?`base`:`target`,className:`top-0`}),(0,A.jsx)(IR,{label:n?`target`:`base`,className:`bottom-0`})]})}function IR({label:e,className:t}){return(0,A.jsx)(`div`,{className:`absolute left-2 flex h-px w-2.5 items-center bg-zinc-400 dark:bg-zinc-500 ${t}`,children:(0,A.jsx)(`span`,{className:`absolute -left-1 -top-1.5 rotate-180 text-[9px] leading-none text-zinc-500 [writing-mode:vertical-rl] dark:text-zinc-400`,children:e})})}var LR=`shrink-0 rounded px-1 py-0.5 text-[10px] text-zinc-400 opacity-0 hover:bg-zinc-200 hover:text-zinc-700 focus-visible:opacity-100 group-hover:opacity-100 aria-disabled:cursor-default aria-disabled:opacity-30 dark:text-zinc-500 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`;function RR({row:e,laneCount:t,role:n,isFocused:r,onSelect:i,onFocus:a,ref:o}){let s=e.entry,c=s?`${s.sha.slice(0,7)} ${s.subject}`:`Working tree`;return(0,A.jsxs)(`div`,{ref:o,role:`button`,tabIndex:r?0:-1,"aria-label":c,"aria-current":n===null?void 0:`true`,onFocus:a,onClick:()=>i(),onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `?(e.preventDefault(),i()):e.key===`b`?i(`base`):e.key===`t`&&i(`target`))},style:{height:36,paddingLeft:kR},className:`group flex cursor-pointer items-center gap-2 pr-2 focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800/70 ${n===null?``:`bg-zinc-100 dark:bg-zinc-800/60`}`,children:[(0,A.jsx)(DR,{row:e,laneCount:t}),s?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-amber-600 dark:text-amber-500`,children:s.sha.slice(0,7)}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-zinc-700 dark:text-zinc-300`,title:s.subject,children:s.subject}),(0,A.jsxs)(`span`,{className:`shrink-0 text-[10px] text-zinc-400 dark:text-zinc-600`,children:[s.author,` · `,AR(s.date)]}),(0,A.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] tabular-nums`,"aria-label":`${s.added} lines added, ${s.deleted} removed`,children:[(0,A.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,s.added]}),` `,(0,A.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,s.deleted]})]})]}):(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-zinc-500 dark:text-zinc-400`,children:`working tree`}),(0,A.jsxs)(`span`,{className:`flex shrink-0 gap-0.5`,children:[(0,A.jsx)(`button`,{type:`button`,title:n===`target`?`Make this the base (swaps the two)`:`Compare from this version`,onClick:e=>{e.stopPropagation(),i(`base`)},className:LR,children:`base`}),(0,A.jsx)(`button`,{type:`button`,title:n===`base`?`Make this the target (swaps the two)`:`Compare to this version`,onClick:e=>{e.stopPropagation(),i(`target`)},className:LR,children:`target`})]})]})}function zR({diff:e,base:t,target:n}){return t===null&&n===null?(0,A.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`Pick a commit to see what changed.`}):t===null||n===null?(0,A.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`Now pick the version to compare it against.`}):e?.status===`error`?(0,A.jsx)(`div`,{className:`rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.error}):e===null?(0,A.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`Loading…`}):e.status===`loaded`&&e.beforeText===e.afterText?(0,A.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`These two versions are identical.`}):e.status===`loaded`&&x(e.beforeText,e.afterText)?(0,A.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`These two versions differ only in their line endings.`}):(0,A.jsx)(`div`,{className:e.status===`loading`?`opacity-40`:void 0,children:(0,A.jsx)(He,{fill:!0,lines:S(e.beforeText,e.afterText)})})}function BR(e){let t=e.filter(e=>!e.sideOf).flatMap(t=>[t,...e.filter(e=>e.sideOf===t.root)]);return[...t,...e.filter(e=>!t.includes(e))]}var VR={stopped:`stopped`,starting:`starting…`,idle:`idle`,working:`working`,waiting:`waiting for you`,"ready-for-review":`ready for review`};function HR({activity:e}){switch(e){case`stopped`:return(0,A.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full border border-dashed border-zinc-400 dark:border-zinc-600`});case`starting`:return(0,A.jsx)(`svg`,{className:`h-2.5 w-2.5 shrink-0 animate-spin text-zinc-500 dark:text-zinc-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3.5`,strokeLinecap:`round`,children:(0,A.jsx)(`path`,{d:`M12 3a9 9 0 0 1 9 9`})});case`working`:return(0,A.jsxs)(`span`,{className:`relative flex h-2 w-2 shrink-0 items-center justify-center`,children:[(0,A.jsx)(`span`,{className:`absolute h-2 w-2 animate-ping rounded-full bg-blue-700 opacity-60 dark:bg-blue-400`}),(0,A.jsx)(`span`,{className:`relative h-2 w-2 rounded-full bg-blue-700 dark:bg-blue-400`})]});case`waiting`:return(0,A.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-amber-500`});case`ready-for-review`:return(0,A.jsx)(`span`,{className:`h-2 w-2 shrink-0 rotate-45 rounded-[1px] border-2 border-violet-600 bg-violet-100 dark:border-violet-400 dark:bg-violet-950`});default:return(0,A.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-zinc-400 dark:bg-zinc-600`})}}function UR({className:e}){return(0,A.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,A.jsx)(`path`,{d:`M12 6v7`}),(0,A.jsx)(`path`,{d:`M12 18h.01`})]})}function WR({className:e}){return(0,A.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,A.jsx)(`path`,{d:`M7 3h10v18H7z`}),(0,A.jsx)(`path`,{d:`m9.5 12 1.7 1.7 3.5-3.7`})]})}function GR(e){let{workspace:t,workspaces:n,locked:r}=e,[i,a]=(0,d.useState)(!1),o=(0,d.useRef)(null);if((0,d.useEffect)(()=>{if(!i)return;let e=e=>{vL(e,o.current)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]),r||!t)return null;let s=n.filter(e=>tI(e)!==tI(t)),c=n.filter(e=>!e.sideOf).length,l=n.filter(e=>e.needsAttention);return(0,A.jsxs)(`div`,{ref:o,className:`relative`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),"aria-expanded":i,"aria-haspopup":`menu`,title:`Project: ${t.name} (${VR[t.activity]})`,className:`flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs ${l.length>0?`border-amber-500 bg-amber-50 text-zinc-700 dark:bg-amber-950/40 dark:text-zinc-200`:`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`}`,children:[(0,A.jsx)(HR,{activity:t.activity}),(0,A.jsx)(`span`,{className:`font-medium`,children:t.name}),l.length>0?(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-amber-600 dark:text-amber-500`,children:[(0,A.jsx)(UR,{className:`h-3 w-3`}),(0,A.jsx)(`span`,{className:`font-semibold`,children:l.length})]}):s.some(e=>e.activity===`working`)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`h-3 w-px bg-zinc-300 dark:bg-zinc-600`}),(0,A.jsx)(`span`,{className:`flex items-center gap-1`,children:s.map(e=>e.activity===`working`?(0,A.jsxs)(`span`,{className:`relative flex h-1.5 w-1.5 items-center justify-center`,children:[(0,A.jsx)(`span`,{className:`absolute h-1.5 w-1.5 animate-ping rounded-full bg-blue-700 opacity-60 dark:bg-blue-400`}),(0,A.jsx)(`span`,{className:`relative h-1.5 w-1.5 rounded-full bg-blue-700 dark:bg-blue-400`})]},tI(e)):(0,A.jsx)(`span`,{className:`h-1 w-1 rounded-full bg-zinc-300 dark:bg-zinc-600`},tI(e)))})]}),(0,A.jsx)(`svg`,{className:`h-3 w-3 text-zinc-500`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,A.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]}),i&&(0,A.jsxs)(`div`,{role:`menu`,className:`absolute left-0 top-full z-40 mt-1 w-87 rounded-md border border-zinc-300 bg-white p-1 shadow-lg dark:border-zinc-700 dark:bg-zinc-900`,children:[BR(n).map(n=>{let r=tI(n),i=r===tI(t),o=n.sideOf!==void 0;return(0,A.jsxs)(`div`,{"data-testid":o?`side-session-row`:`project-row`,className:`group flex items-center gap-2.5 rounded-md py-2 pr-2.5 ${o?`pl-7`:`pl-2.5`} ${i?`bg-zinc-100 dark:bg-zinc-800`:`hover:bg-zinc-50 dark:hover:bg-zinc-800/50`}`,children:[(0,A.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{a(!1),o?e.onSwitch(n.root,n.id):e.onSwitch(n.root)},className:`flex min-w-0 flex-1 items-center gap-2.5 text-left`,children:[(0,A.jsx)(HR,{activity:n.activity}),(0,A.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,A.jsx)(`span`,{className:`truncate text-[13px] ${i?`font-semibold text-zinc-900 dark:text-zinc-100`:`font-medium text-zinc-900 dark:text-zinc-100`}`,children:o?n.label??n.name:n.name}),!o&&(0,A.jsx)(`span`,{className:`truncate font-mono text-[11px] text-zinc-400 dark:text-zinc-500`,children:n.root})]})]}),(0,A.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[n.needsAttention?(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[11px] font-medium ${n.activity===`ready-for-review`?`text-violet-700 dark:text-violet-400`:`text-amber-600 dark:text-amber-500`}`,children:[n.activity===`ready-for-review`?(0,A.jsx)(WR,{className:`h-3 w-3`}):(0,A.jsx)(UR,{className:`h-3 w-3`}),VR[n.activity]]}):(0,A.jsx)(`span`,{className:`text-[11px] ${n.activity===`working`?`text-blue-700 dark:text-blue-400`:`text-zinc-400 dark:text-zinc-500`}`,children:VR[n.activity]}),!o&&e.onOpenSide&&(0,A.jsx)(`button`,{type:`button`,title:`New side session on ${n.name}`,"aria-label":`New side session on ${n.name}`,onClick:t=>{t.stopPropagation(),a(!1),e.onOpenSide?.(n.root)},className:`flex h-5 w-5 items-center justify-center rounded border border-zinc-300 text-zinc-500 hover:border-zinc-400 hover:text-zinc-800 dark:border-zinc-600 dark:text-zinc-400 dark:hover:border-zinc-500 dark:hover:text-zinc-100`,children:(0,A.jsxs)(`svg`,{className:`h-2.5 w-2.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,children:[(0,A.jsx)(`path`,{d:`M12 5v14`}),(0,A.jsx)(`path`,{d:`M5 12h14`})]})}),(o||c>1)&&(0,A.jsx)(`button`,{type:`button`,title:`Close ${o?n.label??n.name:n.name}`,"aria-label":`Close ${o?n.label??n.name:n.name}`,onClick:t=>{t.stopPropagation(),o?e.onClose(n.root,n.id):e.onClose(n.root)},className:`flex h-5 w-5 items-center justify-center rounded border border-transparent text-zinc-400 opacity-0 group-hover:border-zinc-300 group-hover:opacity-100 hover:text-zinc-700 dark:group-hover:border-zinc-600 dark:hover:text-zinc-200`,children:(0,A.jsxs)(`svg`,{className:`h-2.5 w-2.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,A.jsx)(`path`,{d:`M18 6 6 18`}),(0,A.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]},r)}),(0,A.jsx)(`div`,{className:`my-1 h-px bg-zinc-200 dark:bg-zinc-700`}),(0,A.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{a(!1),e.onOpen()},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-[13px] text-zinc-700 hover:bg-zinc-50 dark:text-zinc-300 dark:hover:bg-zinc-800/50`,children:[(0,A.jsxs)(`svg`,{className:`h-3.5 w-3.5 text-zinc-500`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,A.jsx)(`path`,{d:`M12 5v14`}),(0,A.jsx)(`path`,{d:`M5 12h14`})]}),`Open a project…`]})]})]})}function KR({label:e,browse:t,onBrowse:n,onSelect:r,onCancel:i}){let a=t?.path??`/`,o=t?.entries??[],s=t?.status===`loading`,[c,l]=(0,d.useState)(a);return(0,d.useEffect)(()=>{l(a)},[a]),(0,A.jsxs)(`div`,{className:`rounded-md border border-zinc-300 p-2 dark:border-zinc-700`,"data-testid":`server-path-picker`,children:[(0,A.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,A.jsx)(`span`,{className:`text-xs font-semibold text-zinc-600 dark:text-zinc-300`,children:e}),(0,A.jsx)(`button`,{type:`button`,onClick:i,className:`text-xs text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200`,children:`Cancel`})]}),(0,A.jsxs)(`form`,{className:`mb-2 flex gap-1`,onSubmit:e=>{e.preventDefault();let t=c.trim();t&&n(t)},children:[(0,A.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),l(a))},spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-label":`Current directory`,"data-testid":`picker-path`,className:`min-w-0 flex-1 rounded border border-zinc-300 px-2 py-1 font-mono text-xs text-zinc-700 focus:border-zinc-500 focus:outline-none dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-200`}),(0,A.jsx)(`button`,{type:`submit`,disabled:c.trim()===``||c===a,className:`rounded border border-zinc-300 px-2 py-1 text-xs text-zinc-600 hover:border-zinc-400 disabled:cursor-not-allowed disabled:opacity-40 dark:border-zinc-700 dark:text-zinc-300`,children:`Go`})]}),t?.status===`error`&&(0,A.jsx)(`p`,{role:`alert`,className:`mb-2 text-xs text-red-600 dark:text-red-400`,children:t.error}),(0,A.jsxs)(`div`,{className:`mb-2 flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:!t?.parent,onClick:()=>t?.parent&&n(t.parent),className:`rounded border border-zinc-300 px-2 py-1 text-xs text-zinc-600 hover:border-zinc-400 disabled:cursor-not-allowed disabled:opacity-40 dark:border-zinc-700 dark:text-zinc-300`,children:`Up`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>r(a),className:`rounded bg-zinc-800 px-2 py-1 text-xs font-medium text-white hover:bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-900`,children:`Use this directory`})]}),(0,A.jsxs)(`ul`,{className:`max-h-40 overflow-y-auto`,children:[s&&o.length===0&&(0,A.jsx)(`li`,{className:`px-2 py-1 text-xs text-zinc-400`,children:`Loading…`}),!s&&o.length===0&&t?.status!==`error`&&(0,A.jsx)(`li`,{className:`px-2 py-1 text-xs text-zinc-400 dark:text-zinc-500`,children:`No subdirectories`}),o.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsxs)(`button`,{type:`button`,onClick:()=>n(e.path),className:`w-full truncate rounded px-2 py-1 text-left font-mono text-xs text-zinc-600 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800`,title:e.path,children:[e.name,e.name.endsWith(`:`)?`\\`:`/`]})},e.path))]})]})}function qR(e){return e.split(/[\\/]/).filter(Boolean).at(-1)??e}function JR(e){let{sandbox:t,applyState:n,blocked:r=!1,onCloseBrowser:i}=e,[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(!1);if((0,d.useEffect)(()=>{r&&a&&(s.current=!1,o(!1))},[r,a]),(0,d.useEffect)(()=>{if(s.current&&n?.status!==`applying`){if(n?.status===`error`){s.current=!1;return}s.current=!1,o(!1),i()}},[n,i]),!t)return(0,A.jsx)(`span`,{className:`rounded-md border border-dashed border-zinc-300 px-2 py-1 text-xs text-zinc-400 dark:border-zinc-700 dark:text-zinc-500`,title:`This server runs without a sandbox, so there is no root to move`,children:`No sandbox`});let c=t.locks?.root===!0,l=qR(t.root);return(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsxs)(`button`,{type:`button`,disabled:c,"aria-label":c?`Sandbox root: ${t.root} (locked)`:`Sandbox root: ${t.root}`,title:c?`${t.root} — locked by the server's configuration`:t.root,onClick:()=>{e.onOpened(),o(!0),e.onBrowse(t.root)},className:`flex max-w-[14rem] items-center gap-1.5 rounded-md border px-2 py-1 text-xs ${c?`cursor-not-allowed border-zinc-200 text-zinc-400 dark:border-zinc-800 dark:text-zinc-500`:`border-zinc-300 text-zinc-600 hover:border-zinc-400 hover:text-zinc-800 dark:border-zinc-700 dark:text-zinc-300 dark:hover:border-zinc-500 dark:hover:text-zinc-100`}`,children:[(0,A.jsx)(`span`,{className:`truncate font-mono`,children:l}),c?(0,A.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`▾`})]}),a&&!r&&(0,A.jsxs)(`div`,{className:`absolute left-0 top-full z-20 mt-1 w-[380px] rounded-lg border border-zinc-200 bg-white p-2 shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[n?.status===`error`&&(0,A.jsx)(`p`,{role:`alert`,className:`mb-2 text-xs text-red-600 dark:text-red-400`,children:n.message}),(0,A.jsx)(KR,{label:`Choose the sandbox root`,browse:e.browse,onBrowse:e.onBrowse,onSelect:t=>{s.current=!0,e.onSelect(t)},onCancel:()=>{s.current=!1,o(!1),i()}})]})]})}function YR(e){let t=(Date.now()-new Date(e).getTime())/1e3;return t<90?`now`:t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:`${Math.round(t/86400)}d ago`}function XR(e){return e.slice(e.lastIndexOf(`/`)+1)}function ZR({status:e,selected:t,log:n,onFetchLog:r,onShowCommit:i}){let[a,o]=(0,d.useState)(!1),s=yL(()=>o(!1)),c=e?.repos??[],l=(t===null?null:UI(c,t))??(t===null&&c.length===1?c[0]:null),u=l&&(l.ahead>0||l.behind>0)?` ${l.ahead>0?`↑${l.ahead}`:``}${l.behind>0?`↓${l.behind}`:``}`:``,f=c.length>1&&l!==null&&l.repo!==``?`${XR(l.repo)} `:``,p=e===null?`…`:l?.branch??`—`,m=l!==null&&n?.repo===l.repo?n.entries:null;return(0,d.useEffect)(()=>{a&&l!==null&&n?.repo!==l.repo&&r(l.repo)},[a,l?.repo,r]),(0,A.jsxs)(`div`,{className:`relative`,ref:s,children:[(0,A.jsxs)(`button`,{type:`button`,disabled:l===null,onClick:()=>{l!==null&&(o(!a),a||r(l.repo))},title:l===null?`no repository selected`:`git history — ${l.repo===``?`this project`:l.repo}`,className:`rounded-md border border-zinc-300 px-2 py-1 font-mono text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 disabled:cursor-default disabled:hover:border-zinc-300 disabled:hover:text-zinc-500 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200 dark:disabled:hover:border-zinc-800 dark:disabled:hover:text-zinc-400`,children:[f,`⎇ `,p,u]}),a&&l!==null&&(0,A.jsxs)(`div`,{className:`absolute left-0 top-full z-20 mt-1 max-h-96 w-[26rem] max-w-[80vw] overflow-y-auto rounded-lg border border-zinc-200 bg-white py-1 shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[m===null&&(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`loading…`}),m?.length===0&&(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`no commits`}),m?.map(e=>(0,A.jsxs)(`button`,{type:`button`,onClick:()=>{i(l.repo,e.sha),o(!1)},className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:[(0,A.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-amber-600 dark:text-amber-500`,children:e.sha.slice(0,7)}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-zinc-700 dark:text-zinc-300`,title:e.subject,children:e.subject}),(0,A.jsxs)(`span`,{className:`shrink-0 text-xs text-zinc-400 dark:text-zinc-600`,children:[e.author,` · `,YR(e.date)]})]},e.sha))]})]})}function QR(e){if(e.installed===void 0)return`not installed`;if(e.restartNeeded)return`${e.installed} installed — restart to use it`;if(e.pinned!==void 0)return`${e.installed}, pinned`;let t=e.check;if(!t)return e.installed;switch(t.state){case`checking`:return`${e.installed}, checking…`;case`newer`:return`${e.installed} — ${t.latest} available`;case`current`:return`${e.installed}, up to date`;case`failed`:return`${e.installed}, not checked: ${t.reason}`;case`off`:return`${e.installed}, not checked: ${t.reason}`}}function $R({packages:e,update:t,locked:n,onCheck:r,onUpdate:i}){let[a,o]=(0,d.useState)(null);if(e===null||e.length===0)return null;let s=t?.status===`pending`?t.source:null;return(0,A.jsxs)(`div`,{className:`mt-3`,"data-testid":`pi-packages`,children:[(0,A.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,A.jsx)(`span`,{className:`text-xs font-medium text-zinc-600 dark:text-zinc-400`,children:`Packages`}),(0,A.jsx)(`button`,{type:`button`,onClick:r,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200`,children:`check for updates`})]}),(0,A.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>{let r=e.check?.state===`newer`&&!e.restartNeeded?e.check.latest:void 0;return(0,A.jsxs)(`li`,{"data-testid":`pi-package`,className:`rounded bg-zinc-50 px-2 py-1 text-xs dark:bg-zinc-800`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,A.jsx)(`span`,{className:`min-w-0 truncate font-mono text-zinc-700 dark:text-zinc-300`,title:e.source,children:e.name}),r&&!n&&a!==e.source&&(0,A.jsx)(`button`,{type:`button`,disabled:s!==null,onClick:()=>o(e.source),className:`shrink-0 rounded border border-zinc-300 px-1.5 py-0.5 text-zinc-700 hover:bg-zinc-100 disabled:opacity-50 dark:border-zinc-600 dark:text-zinc-200 dark:hover:bg-zinc-700`,children:s===e.source?`updating…`:`Update`})]}),(0,A.jsx)(`div`,{className:`line-clamp-2 text-zinc-500 dark:text-zinc-400`,"data-testid":`pi-package-status`,title:QR(e),children:QR(e)}),r&&a===e.source&&(0,A.jsxs)(`div`,{className:`mt-1 rounded border border-amber-300 bg-amber-50 p-2 text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,"data-testid":`pi-package-confirm`,children:[(0,A.jsxs)(`p`,{children:[`This replaces code that runs with the agent's privileges: `,e.name,` `,e.installed,` → `,r,`. It takes effect when pi-outpost restarts.`]}),(0,A.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>{o(null),i(e.source)},className:`rounded bg-amber-600 px-2 py-0.5 text-white hover:bg-amber-700`,children:[`Install `,r]}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(null),className:`rounded px-2 py-0.5 hover:bg-amber-100 dark:hover:bg-amber-900/40`,children:`Cancel`})]})]}),t&&t.status!==`pending`&&t.source===e.source&&(0,A.jsx)(`p`,{"data-testid":`pi-package-result`,className:`mt-1 ${t.status===`installed`?`text-emerald-700 dark:text-emerald-400`:`text-amber-700 dark:text-amber-400`}`,children:t.message})]},e.source)})})]})}function ez({reasons:e,canRestart:t,restarting:n,onRestart:r}){let[i,a]=(0,d.useState)(!1);return e.length===0?null:(0,A.jsxs)(`div`,{className:`mt-3 rounded border border-sky-200 bg-sky-50 p-2 text-xs text-sky-900 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-200`,"data-testid":`restart-needed`,children:[(0,A.jsxs)(`p`,{children:[`Installed and waiting on a restart to run: `,e.join(`, `),`.`]}),t?n?(0,A.jsx)(`p`,{className:`mt-1`,children:`Restarting pi-outpost…`}):i?(0,A.jsxs)(`div`,{className:`mt-1`,children:[(0,A.jsx)(`p`,{children:`pi-outpost stops and starts again in the same terminal. Every open window reconnects by itself, and conversations are kept.`}),(0,A.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>{a(!1),r()},className:`rounded bg-sky-700 px-2 py-0.5 text-white hover:bg-sky-800`,children:`Restart now`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>a(!1),className:`rounded px-2 py-0.5 hover:bg-sky-100 dark:hover:bg-sky-900/50`,children:`Cancel`})]})]}):(0,A.jsx)(`button`,{type:`button`,onClick:()=>a(!0),className:`mt-1 rounded border border-sky-300 px-2 py-0.5 hover:bg-sky-100 dark:border-sky-700 dark:hover:bg-sky-900/50`,children:`Restart pi-outpost`}):null]})}var tz=30,nz={display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`};function rz({skills:e,groups:t,enabled:n,onChange:r,disabled:i=!1,bound:a}){let[o,s]=(0,d.useState)(()=>e.length>40?new Set(e.filter(e=>n.has(e.relativePath)).map(e=>e.group)):new Set(t.map(e=>e.path))),[c,l]=(0,d.useState)(``),[u,f]=(0,d.useState)(!1),p=c.trim().toLocaleLowerCase(),m=p!==``||u,h=e=>(!u||n.has(e.relativePath))&&(!p||`${e.name} ${e.relativePath} ${e.description??``}`.toLocaleLowerCase().includes(p)),g=new Map;for(let t of e)g.set(t.group,[...g.get(t.group)??[],t]);let _=e.filter(e=>n.has(e.relativePath)).length,v=m?e.filter(h).length:e.length,y=(e,t)=>{let i=new Set(n);for(let n of e)t?i.add(n.relativePath):i.delete(n.relativePath);r(i)},b=e=>{let t=new Set(n);t.has(e)?t.delete(e):t.add(e),r(t)},x=e=>s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,A.jsxs)(`section`,{className:`rounded-xl border border-zinc-200 p-4 dark:border-zinc-800`,"aria-label":`Collection skills`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsxs)(`h3`,{className:`text-sm font-semibold text-zinc-800 dark:text-zinc-200`,children:[`Skills `,(0,A.jsxs)(`span`,{className:`font-normal text-zinc-500`,children:[`· `,_,` of `,e.length,` on`]})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:i||_===e.length,onClick:()=>y(e,!0),className:`rounded-md border px-2.5 py-1 text-xs disabled:opacity-50`,children:`All on`}),(0,A.jsx)(`button`,{type:`button`,disabled:i||_===0,onClick:()=>y(e,!1),className:`rounded-md border px-2.5 py-1 text-xs disabled:opacity-50`,children:`All off`})]})]}),a?(0,A.jsx)(`p`,{className:`mt-2 rounded border border-amber-200 bg-amber-50 p-2 text-xs text-amber-800`,children:a.kind===`count`?`This repository holds more skills than the ${a.limit} listed here.`:`Folders deeper than ${a.limit} levels were not searched for skills.`}):null,e.length>0?(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`input`,{type:`search`,"aria-label":`Search skills`,placeholder:`Search skills by name or folder`,value:c,onChange:e=>l(e.target.value),className:`min-w-0 flex-1 rounded-md border bg-transparent px-2.5 py-1 text-xs`}),(0,A.jsxs)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>f(e=>!e),className:`rounded-md px-2.5 py-1 text-xs ${u?`bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900`:`border`}`,children:[`Only on (`,_,`)`]})]}):null,!m&&_>0&&_<=tz?(0,A.jsxs)(`div`,{role:`region`,"aria-label":`Skills that are on`,className:`mt-3 rounded-lg border border-emerald-200 bg-emerald-50/60 p-2 dark:border-emerald-900 dark:bg-emerald-950/30`,children:[(0,A.jsx)(`p`,{className:`px-1 text-[11px] font-medium text-emerald-800 dark:text-emerald-300`,children:`Turned on`}),(0,A.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.filter(e=>n.has(e.relativePath)).map(e=>(0,A.jsxs)(`li`,{className:`flex items-start justify-between gap-2 px-1`,children:[(0,A.jsxs)(`span`,{className:`min-w-0 text-xs`,children:[(0,A.jsx)(`span`,{className:`font-medium text-zinc-800 dark:text-zinc-100`,children:e.name}),` `,(0,A.jsx)(`span`,{className:`font-mono text-[11px] text-zinc-500`,children:e.group||`(repository root)`}),(0,A.jsx)(iz,{skill:e,checked:!0})]}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`Turn off ${e.name} (${e.relativePath})`,disabled:i,onClick:()=>b(e.relativePath),className:`shrink-0 rounded border bg-white px-2 py-0.5 text-[11px] disabled:opacity-50 dark:bg-zinc-900`,children:`Turn off`})]},e.relativePath))})]}):null,e.length===0?(0,A.jsx)(`p`,{className:`mt-4 text-xs text-zinc-400`,children:`This repository holds no skills.`}):null,m&&v===0?(0,A.jsx)(`p`,{className:`mt-4 text-xs text-zinc-400`,children:u&&!p?`No skill is on.`:`No skill matches.`}):null,(0,A.jsx)(`ul`,{className:`mt-3 space-y-2`,children:t.map(e=>{let t=g.get(e.path)??[],r=m?t.filter(h):t;if(m&&r.length===0)return null;let a=r.filter(e=>n.has(e.relativePath)).length,s=m||o.has(e.path);return(0,A.jsxs)(`li`,{className:`rounded-lg border border-zinc-100 dark:border-zinc-800`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2`,children:[(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":s,onClick:()=>x(e.path),className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`text-xs text-zinc-400`,children:s?`▾`:`▸`}),(0,A.jsx)(`span`,{className:`truncate font-mono text-xs font-medium text-zinc-700 dark:text-zinc-200`,children:e.label}),(0,A.jsxs)(`span`,{className:`shrink-0 text-[11px] text-zinc-500`,children:[a,`/`,r.length,` on`]})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":`All on in ${e.label}`,disabled:i||a===r.length,onClick:()=>y(r,!0),className:`rounded border px-2 py-0.5 text-[11px] disabled:opacity-50`,children:`All on`}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`All off in ${e.label}`,disabled:i||a===0,onClick:()=>y(r,!1),className:`rounded border px-2 py-0.5 text-[11px] disabled:opacity-50`,children:`All off`})]})]}),s?(0,A.jsx)(`ul`,{className:`space-y-1 border-t border-zinc-100 px-3 py-2 dark:border-zinc-800`,children:r.map(e=>{let t=n.has(e.relativePath);return(0,A.jsx)(`li`,{children:(0,A.jsxs)(`label`,{className:`flex items-start gap-2 rounded px-1 py-1 ${i?`opacity-60`:`cursor-pointer hover:bg-zinc-50 dark:hover:bg-zinc-800/60`}`,children:[(0,A.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":t,"aria-label":`${e.name} (${e.relativePath})`,checked:t,disabled:i,onChange:()=>b(e.relativePath),className:`mt-0.5`}),(0,A.jsxs)(`span`,{className:`min-w-0`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm text-zinc-800 dark:text-zinc-100`,children:e.name}),e.description?(0,A.jsx)(`span`,{title:e.description,style:nz,className:`text-[11px] text-zinc-500`,children:e.description}):null,(0,A.jsx)(iz,{skill:e,checked:t})]})]})},e.relativePath)})}):null]},e.path)})})]})}function iz({skill:e,checked:t}){return t===(e.state!==`off`)?e.state===`on-loaded`?(0,A.jsx)(`span`,{className:`block text-[11px] text-emerald-700 dark:text-emerald-400`,children:`Loaded`}):e.state===`on-not-loaded`?(0,A.jsxs)(`span`,{className:`block text-[11px] text-amber-700 dark:text-amber-400`,children:[`Not loaded — `,e.reason]}):e.state===`on-missing`?(0,A.jsxs)(`span`,{className:`block text-[11px] text-rose-700 dark:text-rose-400`,children:[`Missing — `,e.reason]}):null:(0,A.jsx)(`span`,{className:`block text-[11px] font-medium text-sky-700 dark:text-sky-300`,children:t?`Pending: on`:`Pending: off`})}function az(e,t){return[...new Set(e.map(e=>e.group))].sort().map(e=>({path:e,label:e||t}))}function oz(e){return e.skills.filter(e=>e.state!==`off`).map(e=>e.relativePath)}function sz(e,t){let n=new Set(e),r=new Set(t);return n.size===r.size&&[...n].every(e=>r.has(e))}function cz(e,t){if(t.status===`loading`)return`Removing ${e}…`;if(t.status===`error`)return t.message??`Could not remove ${e}`;let n=t.result;return n?n.status===`removed`?`Removed ${e} and deleted ${n.path}.`:n.status===`removed-files-kept`?`Removed ${e}. ${n.reason??`Its files were kept`} (${n.path}).`:`Removed ${e}, but not every file could be deleted${n.reason?` — ${n.reason}`:``}. What remains is at ${n.path}.`:`Removed ${e}.`}var lz={unchecked:`Not checked`,checking:`Checking…`,current:`Up to date`,updateable:`Update available`,dirty:`Local changes`,detached:`Detached HEAD`,ahead:`Local branch ahead`,diverged:`Histories diverged`,"no-upstream":`No upstream`,locked:`Locked`,busy:`Workspace busy`,unavailable:`Unavailable`,failed:`Check failed`};function uz(e){if(!e)return[];let t=new Map(e.resources.map(e=>[e.id,e])),n=new Set(e.repositories.flatMap(e=>e.resourceIds)),r=e.repositories.map(e=>({id:e.id,name:e.name,path:e.path,repository:e,resources:e.resourceIds.flatMap(e=>t.get(e)?[t.get(e)]:[])})),i=e.resources.filter(e=>!n.has(e.id)),a=i.filter(e=>e.unavailableReason),o=i.filter(e=>!e.unavailableReason);return o.length&&r.push({id:`local`,name:`Local and built in`,reason:`Not backed by an updateable Git repository`,resources:o}),a.length&&r.push({id:`unavailable`,name:`Provenance unavailable`,reason:`The active runtime did not report enough filesystem provenance`,resources:a}),r}function dz(e){let t=e.length;for(;t>0&&(e[t-1]===`/`||e[t-1]===`\\`);)--t;return t===e.length?e:e.slice(0,t)}function fz(e){let t=dz(e),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<=0?`/`:t.slice(0,n)}function pz(e,t){let n=dz(t),r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`)),i=r>=0?n.slice(r+1):n;return`${dz(e)}/${i||`agent-resources`}`}function mz({kind:e,resources:t,removalLocked:n=!1,onRemove:r}){return(0,A.jsxs)(`section`,{className:`rounded-xl border border-zinc-200 p-4 dark:border-zinc-800`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center justify-between text-sm font-semibold capitalize text-zinc-800 dark:text-zinc-200`,children:[(0,A.jsxs)(`span`,{children:[e,`s`]}),(0,A.jsx)(`span`,{className:`text-xs font-normal text-zinc-400`,children:t.length})]}),t.length===0?(0,A.jsx)(`p`,{className:`mt-4 text-xs text-zinc-400`,children:`None in this group`}):(0,A.jsx)(`ul`,{className:`mt-3 space-y-2`,children:t.map(e=>(0,A.jsxs)(`li`,{className:`rounded-lg bg-zinc-50 px-3 py-2 dark:bg-zinc-800/70`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,A.jsx)(`p`,{className:`truncate text-sm font-medium text-zinc-700 dark:text-zinc-200`,children:e.name}),e.userRoot&&!n?(0,A.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.userRoot}`,onClick:()=>r(e),className:`text-xs text-zinc-500 hover:text-red-600`,children:`Remove`}):null]}),(0,A.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[11px] text-zinc-400`,title:e.path,children:e.path??e.unavailableReason??`Path unavailable`})]},e.id))})]})}function hz({preview:e,busy:t,error:n,onApply:r,onCancel:i}){let[a,o]=(0,d.useState)(()=>new Set(e.roots.filter(e=>!e.locked).map(e=>`${e.kind}:${e.path}`))),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(()=>new Set),f=e.mode===`collection`,p=(0,d.useMemo)(()=>e.skills.map(e=>({...e,state:`off`})),[e.skills]),m=(0,d.useMemo)(()=>az(e.skills,e.repositoryName),[e.skills,e.repositoryName]),h=e.roots.filter(e=>e.kind===`extension`&&a.has(`extension:${e.path}`)),g=h.length>0&&!s,_=t||!f&&a.size===0||g,v=()=>{let t=h.map(e=>e.path);f?r([],t,[...l]):r(e.roots.filter(e=>e.kind===`skill`&&a.has(`skill:${e.path}`)).map(e=>e.path),t)},y=e=>{c(!1),o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,A.jsxs)(`div`,{className:`space-y-3`,"data-testid":`resource-preview`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h3`,{className:`truncate text-xl font-semibold text-zinc-900 dark:text-zinc-100`,children:e.repositoryName}),(0,A.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[11px] text-zinc-500`,title:e.repositoryPath,children:e.repositoryPath})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:i,className:`rounded-md border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,A.jsx)(`button`,{type:`button`,disabled:_,onClick:v,className:`rounded-md bg-zinc-900 px-3 py-1.5 text-xs font-medium text-white disabled:opacity-50 dark:bg-zinc-100 dark:text-zinc-900`,children:t?`Saving…`:`Save`})]})]}),g?(0,A.jsx)(`p`,{className:`text-xs text-amber-700`,children:`Confirm the extension warning below to save.`}):null,n?(0,A.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:n}):null,f?(0,A.jsx)(rz,{skills:p,groups:m,enabled:l,onChange:u,disabled:t,...e.bound?{bound:e.bound}:{}}):null,e.roots.map(e=>{let t=`${e.kind}:${e.path}`;return(0,A.jsxs)(`label`,{className:`flex items-start gap-2 rounded border p-2 ${e.locked?`opacity-50`:`cursor-pointer`}`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:a.has(t),disabled:e.locked,onChange:()=>y(t)}),(0,A.jsxs)(`span`,{children:[(0,A.jsxs)(`span`,{className:`block text-sm`,children:[e.name,` · `,e.kind]}),(0,A.jsx)(`span`,{className:`font-mono text-[11px] text-zinc-500`,children:e.path}),e.locked?(0,A.jsx)(`span`,{className:`block text-xs text-amber-700`,children:`Extension paths are locked`}):null]})]},t)}),h.length>0?(0,A.jsxs)(`label`,{className:`flex gap-2 rounded-md border border-amber-300 bg-amber-50 p-3 text-xs text-amber-900`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),(0,A.jsx)(`span`,{children:`Extensions execute code with the agent's privileges. I trust the selected extension roots in this repository.`})]}):null]})}function gz(e){let t=(0,d.useRef)(null),n=(0,d.useRef)(e.onClose),r=(0,d.useRef)(!1),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(``),[c,l]=(0,d.useState)(`all`),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(null),[h,g]=(0,d.useState)(null),[_,v]=(0,d.useState)(`skill`),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(``),[T,ee]=(0,d.useState)(``),[te,E]=(0,d.useState)(!1),[ne,re]=(0,d.useState)(``),[ie,ae]=(0,d.useState)(null),[D,oe]=(0,d.useState)({}),[se,O]=(0,d.useState)(null),[ce,k]=(0,d.useState)(null),le=(0,d.useMemo)(()=>uz(e.inventory),[e.inventory]),ue=(0,d.useMemo)(()=>{let e=o.trim().toLocaleLowerCase();return le.flatMap(t=>{let n=`repository`in t?t.repository.collection:void 0,r=n?t.resources.filter(e=>e.kind!==`skill`):t.resources,i=c===`all`?r:r.filter(e=>e.kind===c),a=n&&c!==`extension`?n.skills:[],o=i.length+a.length;if(o===0&&!(n&&c===`all`)||u&&(!(`repository`in t)||![`updateable`,`dirty`,`failed`,`unavailable`,`busy`].includes(t.repository.assessment.status)))return[];let s=`${t.name} ${`path`in t?t.path??``:``} ${i.map(e=>`${e.name} ${e.path??``}`).join(` `)} ${a.map(e=>`${e.name} ${e.relativePath}`).join(` `)}`.toLocaleLowerCase(),l=n?n.skills.filter(e=>e.state!==`off`).length:void 0;return!e||s.includes(e)?[{...t,resources:i,count:o,...l===void 0?{}:{onCount:l}}]:[]})},[le,u,c,o]),de=ue.find(e=>e.id===i)??ue[0]??null;if((0,d.useEffect)(()=>{n.current=e.onClose},[e.onClose]),(0,d.useEffect)(()=>{oe(t=>{let n={},r=!1;for(let[i,a]of Object.entries(t)){let t=e.inventory?.repositories.find(e=>e.id===i)?.collection;!t||sz(a,oz(t))?r=!0:n[i]=a}return r?n:t})},[e.inventory]),(0,d.useEffect)(()=>{e.open&&t.current?.focus()},[e.open]),(0,d.useEffect)(()=>{if(!e.open)return;let t=e=>{e.key===`Escape`&&n.current()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.open]),(0,d.useEffect)(()=>{let t=e.operations.clonePath;t?.status===`ready`&&t.path&&!te&&ee(t.path)},[te,e.operations.clonePath]),(0,d.useEffect)(()=>{e.operations.enrollment?.status===`ready`&&m(null)},[e.operations.enrollment]),(0,d.useEffect)(()=>{if(e.applyState?.status===`applying`){r.current=!0;return}r.current&&e.applyState===null&&(r.current=!1,m(null),g(null),S(!1))},[e.applyState]),!e.open)return null;let j=de&&`repository`in de?de.repository:null,fe=j?e.operations.updates[j.id]:void 0,pe=j?.assessment,me=pe?.status===`updateable`&&pe.token&&pe.localRevision&&pe.upstreamRevision,he=()=>{let t=y.trim();t&&(_===`skill`?e.onUpdateConfig({userSkillPaths:[...new Set([...e.userSkillPaths,t])]}):e.onUpdateConfig({userExtensionPaths:[...new Set([...e.userExtensionPaths,t])]}))},ge=t=>{t.userRoot&&(t.kind===`skill`?e.onUpdateConfig({userSkillPaths:e.userSkillPaths.filter(e=>e!==t.userRoot)}):e.onUpdateConfig({userExtensionPaths:e.userExtensionPaths.filter(e=>e!==t.userRoot)}))},_e=(t,n=!1)=>{let r=t.assessment;!r.token||!r.localRevision||!r.upstreamRevision||e.onUpdate(t.id,r.token,r.localRevision,r.upstreamRevision,n)},ve=j?.collection,ye=ve?oz(ve):[],be=new Set(j&&D[j.id]?D[j.id]:ye),xe=ve?[...new Set([...be,...ye])].filter(e=>be.has(e)!==ye.includes(e)).length:0,Se=j?e.operations.skills?.[j.id]:void 0,Ce=e=>{if(!j)return;let t=j.id;oe(n=>{let r={...n};return sz(e,ye)?delete r[t]:r[t]=[...e],r})},we=()=>{if(!j)return;let e=j.id;oe(t=>{let n={...t};return delete n[e],n})},Te=()=>{if(!j||!ve)return;let t=new Set(ve.skills.filter(e=>e.state!==`on-missing`).map(e=>e.relativePath));e.onSetSkills(j.id,[...be].filter(e=>t.has(e)))},Ee=ce?e.operations.removals?.[ce.id]:void 0,De=Ee?.status===`error`||Ee?.result?.status===`removed-delete-failed`;return(0,A.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/45 p-4`,role:`presentation`,onMouseDown:t=>{t.currentTarget===t.target&&e.onClose()},children:[(0,A.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`agent-resources-title`,className:`flex h-[min(760px,92vh)] w-[min(1120px,96vw)] flex-col overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,A.jsxs)(`header`,{className:`flex items-center justify-between border-b border-zinc-200 px-5 py-4 dark:border-zinc-800`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{id:`agent-resources-title`,className:`text-lg font-semibold text-zinc-900 dark:text-zinc-100`,children:`Agent resources`}),(0,A.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Skills and extensions, grouped by repository`})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:e.operations.refresh?.status===`loading`,onClick:()=>e.onRefresh(),className:`rounded-md border px-3 py-1.5 text-xs disabled:opacity-50`,children:`Refresh all`}),(0,A.jsx)(`button`,{ref:t,type:`button`,"aria-label":`Close agent resources`,onClick:e.onClose,className:`rounded-md border px-2 py-1 text-sm`,children:`✕`})]})]}),(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[300px_1fr]`,children:[(0,A.jsxs)(`aside`,{className:`flex min-h-0 flex-col border-r border-zinc-200 bg-zinc-50/80 p-3 dark:border-zinc-800 dark:bg-zinc-950/40`,children:[(0,A.jsx)(`input`,{"aria-label":`Search resources`,value:o,onChange:e=>s(e.target.value),placeholder:`Search repositories or resources`,className:`rounded-md border bg-white px-3 py-2 text-xs dark:bg-zinc-900`}),(0,A.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[[`all`,`skill`,`extension`].map(e=>(0,A.jsx)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l(e),className:`rounded px-2 py-1 text-[11px] ${c===e?`bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900`:`border`}`,children:e===`all`?`All`:`${e}s`},e)),(0,A.jsx)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>f(e=>!e),className:`rounded px-2 py-1 text-[11px] ${u?`bg-amber-600 text-white`:`border`}`,children:`Needs attention`})]}),(0,A.jsxs)(`div`,{className:`mt-3 min-h-0 flex-1 space-y-1 overflow-y-auto`,children:[ue.map(e=>(0,A.jsxs)(`button`,{type:`button`,onClick:()=>a(e.id),className:`w-full rounded-lg px-3 py-2.5 text-left ${de?.id===e.id?`bg-white shadow-sm ring-1 ring-zinc-200 dark:bg-zinc-800 dark:ring-zinc-700`:`hover:bg-white/70 dark:hover:bg-zinc-900`}`,children:[(0,A.jsxs)(`span`,{className:`flex items-center justify-between gap-2 text-sm font-medium`,children:[(0,A.jsx)(`span`,{className:`truncate`,children:e.name}),(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-zinc-400`,children:e.onCount===void 0?e.count??e.resources.length:`${e.onCount} on · ${e.count}`})]}),(0,A.jsx)(`span`,{className:`mt-1 block text-xs text-zinc-500`,children:`repository`in e?lz[e.repository.assessment.status]:e.reason})]},e.id)),ue.length===0?(0,A.jsx)(`p`,{className:`px-2 py-4 text-xs text-zinc-500`,children:`No matching resources`}):null]}),(0,A.jsxs)(`div`,{className:`mt-3 grid gap-2 border-t pt-3`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>{S(!1),m(`local`),g(`local`),e.onBrowseServerPath(y||`/`)},className:`rounded-md border bg-white px-3 py-2 text-xs font-medium dark:bg-zinc-900`,children:`Add local folder…`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>m(`git`),className:`rounded-md bg-zinc-900 px-3 py-2 text-xs font-medium text-white dark:bg-zinc-100 dark:text-zinc-900`,children:`Add Git repository…`})]})]}),(0,A.jsxs)(`main`,{className:`min-w-0 overflow-y-auto p-6`,children:[ce&&Ee?(0,A.jsxs)(`div`,{role:De?`alert`:`status`,className:`mb-4 flex items-start justify-between gap-3 rounded-lg border p-3 text-sm ${De?`border-rose-200 bg-rose-50 text-rose-800`:`border-zinc-200 bg-zinc-50 text-zinc-700`}`,children:[(0,A.jsx)(`p`,{className:`min-w-0 break-words`,children:cz(ce.name,Ee)}),Ee.status===`loading`?null:(0,A.jsx)(`button`,{type:`button`,onClick:()=>k(null),className:`shrink-0 text-xs underline`,children:`Dismiss`})]}):null,p===`local`?(0,A.jsxs)(`div`,{className:`max-w-xl space-y-4`,"data-testid":`add-local-folder`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-lg font-semibold`,children:`Add local folder`}),(0,A.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Choose an existing folder on the server and how the agent should load it.`})]}),(0,A.jsx)(`div`,{className:`flex gap-2`,children:[`skill`,`extension`].map(t=>(0,A.jsx)(`button`,{type:`button`,"aria-pressed":_===t,disabled:t===`extension`&&e.extensionLock,onClick:()=>{v(t),S(!1)},className:`rounded-md px-3 py-1.5 text-xs ${_===t?`bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900`:`border`}`,children:t===`skill`?`Skill folder`:`Extension folder`},t))}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{"aria-label":`Local resource folder`,value:y,onChange:e=>{S(!1),b(e.target.value)},className:`min-w-0 flex-1 rounded-md border bg-transparent px-3 py-2 text-sm`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{g(`local`),e.onBrowseServerPath(y||`/`)},className:`rounded-md border px-3 text-xs`,children:`Browse…`})]}),h===`local`?(0,A.jsx)(KR,{label:`Choose a local resource folder`,browse:e.serverBrowse,onBrowse:e.onBrowseServerPath,onSelect:t=>{S(!1),b(t),g(null),e.onCloseServerBrowser()},onCancel:()=>{g(null),e.onCloseServerBrowser()}}):null,_===`extension`?(0,A.jsxs)(`label`,{className:`flex gap-2 rounded-md border border-amber-300 bg-amber-50 p-3 text-xs text-amber-900`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>S(e.target.checked)}),(0,A.jsx)(`span`,{children:`Extensions execute code with the agent's privileges. I trust every extension in this folder.`})]}):null,e.extensionLock?(0,A.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Extension paths are locked by this deployment.`}):null,e.applyState?.status===`error`?(0,A.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:e.applyState.message}):null,(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>{S(!1),m(null),g(null),e.onCloseServerBrowser()},className:`rounded-md border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,A.jsx)(`button`,{type:`button`,disabled:!y.trim()||e.applyState?.status===`applying`||_===`extension`&&(!x||e.extensionLock),onClick:he,className:`rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50`,children:e.applyState?.status===`applying`?`Applying…`:`Add folder`})]})]}):p===`git`?(0,A.jsx)(`div`,{className:`max-w-2xl space-y-4`,"data-testid":`add-git-repository`,children:e.operations.preview?.status===`ready`&&e.operations.preview.preview?(0,A.jsx)(hz,{onCancel:()=>{m(null),g(null),e.onCloseServerBrowser()},preview:e.operations.preview.preview,busy:e.operations.enrollment?.status===`loading`,error:e.operations.enrollment?.status===`error`?e.operations.enrollment.message:void 0,onApply:(t,n,r)=>r?e.onEnrollRepository(e.operations.preview.preview.token,t,n,r):e.onEnrollRepository(e.operations.preview.preview.token,t,n)}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-lg font-semibold`,children:`Add Git repository`}),(0,A.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Clone it to a local folder, then choose what to turn on.`})]}),(0,A.jsxs)(`label`,{className:`block`,children:[(0,A.jsx)(`span`,{className:`text-xs font-medium`,children:`Repository address`}),(0,A.jsx)(`input`,{"aria-label":`Repository address`,value:C,onChange:e=>w(e.target.value),onBlur:()=>{let t=C.trim();t&&(E(!1),re(t),e.onSuggestClonePath(C))},placeholder:`https://github.com/team/resources.git`,className:`mt-1 w-full rounded-md border bg-transparent px-3 py-2 text-sm`})]}),(0,A.jsxs)(`label`,{className:`block`,children:[(0,A.jsx)(`span`,{className:`text-xs font-medium`,children:`Local folder`}),(0,A.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,A.jsx)(`input`,{"aria-label":`Local clone folder`,value:T,onChange:e=>{E(!0),ee(e.target.value)},placeholder:`/path/to/resource-repositories/team-resources-ab12cd`,className:`min-w-0 flex-1 rounded-md border bg-transparent px-3 py-2 text-sm`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{g(`clone-parent`),e.onBrowseServerPath(fz(T))},className:`rounded-md border px-3 text-xs`,children:`Choose parent…`})]})]}),e.operations.clonePath?.status===`loading`?(0,A.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Suggesting a managed folder…`}):null,e.operations.clonePath?.status===`error`&&C.trim()===ne?(0,A.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:e.operations.clonePath.message}):null,h===`clone-parent`?(0,A.jsx)(KR,{label:`Choose the clone's parent folder`,browse:e.serverBrowse,onBrowse:e.onBrowseServerPath,onSelect:t=>{ee(pz(t,T)),g(null),e.onCloseServerBrowser()},onCancel:()=>{g(null),e.onCloseServerBrowser()}}):null,e.operations.preview?.status===`error`?(0,A.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:e.operations.preview.message}):null,(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>{m(null),g(null),e.onCloseServerBrowser()},className:`rounded-md border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,A.jsx)(`button`,{type:`button`,disabled:!C.trim()||!T.trim()||e.operations.preview?.status===`loading`,onClick:()=>e.onCloneRepository(C,T),className:`rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50`,children:e.operations.preview?.status===`loading`?`Cloning…`:`Clone and inspect`})]})]})}):de?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-xl font-semibold`,children:de.name}),j?(0,A.jsx)(`span`,{className:`rounded-full border px-2 py-0.5 text-[11px]`,children:lz[j.assessment.status]}):null]}),(0,A.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-zinc-500`,children:`repository`in de?de.path:de.reason}),pe?.branch?(0,A.jsxs)(`p`,{className:`mt-1 text-xs text-zinc-400`,children:[pe.branch,pe.upstream?` → ${pe.upstream}`:``]}):null,j?.removal&&!j.removal.allowed?(0,A.jsx)(`p`,{className:`mt-1 text-xs text-zinc-500`,children:j.removal.reason}):null]}),j?(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[j.removal?.allowed?(0,A.jsx)(`button`,{type:`button`,disabled:e.operations.removals?.[j.id]?.status===`loading`,onClick:()=>O(j),className:`rounded-md border border-red-200 px-3 py-1.5 text-xs text-red-700 disabled:opacity-50 dark:border-red-900 dark:text-red-400`,children:`Remove repository`}):null,(0,A.jsx)(`button`,{type:`button`,disabled:e.operations.refresh?.status===`loading`,onClick:()=>e.onRefresh(j.id),className:`rounded-md border px-3 py-1.5 text-xs`,children:`Check`}),me||fe?.status===`loading`?(0,A.jsx)(`button`,{type:`button`,disabled:fe?.status===`loading`,onClick:()=>j.containsExtensions?ae(j):_e(j),className:`rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50`,children:fe?.status===`loading`?`Updating…`:`Update repository`}):null]}):null]}),pe?.reason?(0,A.jsxs)(`div`,{className:`mt-5 rounded-lg border p-3 text-sm ${pe.status===`dirty`?`border-rose-200 bg-rose-50 text-rose-800`:`border-zinc-200 bg-zinc-50 text-zinc-700`}`,children:[pe.reason,pe.status===`dirty`?(0,A.jsx)(`p`,{className:`mt-1 text-xs`,children:`Review and resolve these local changes in an external terminal, then check again. This updater never commits, stashes, discards, rebases, or merges them.`}):null]}):null,pe?.hasSubmodules?(0,A.jsx)(`p`,{className:`mt-3 rounded border border-amber-200 bg-amber-50 p-2 text-xs text-amber-800`,children:`This repository declares submodules. Their working trees will not be initialized or updated.`}):null,fe?.status===`ready`?(0,A.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-zinc-600`,children:fe.result?.status===`updated`&&fe.result.reloads.some(e=>e.status===`restart-required`)?`Repository updated. Its skills are reloaded; its extension code runs after pi-outpost restarts — restart it from Settings.`:fe.result?.status===`updated`?`Repository updated and runtimes reloaded.`:fe.result?.status===`updated-reload-failed`?`Repository updated on disk, but at least one runtime failed to reload.`:fe.result?.reason}):null,fe?.status===`error`?(0,A.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-red-600`,children:fe.message}):null,ve&&j&&c!==`extension`?(0,A.jsxs)(`div`,{className:`mt-6 space-y-4`,children:[xe>0||Se?.status===`loading`?(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-sky-200 bg-sky-50 px-3 py-2 text-xs text-sky-900 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-200`,children:[(0,A.jsx)(`span`,{children:Se?.status===`loading`?`Applying…`:`${xe} pending change${xe===1?``:`s`} — applying replaces the session`}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:Se?.status===`loading`,onClick:we,className:`rounded border bg-white px-2.5 py-1 disabled:opacity-50 dark:bg-zinc-900`,children:`Discard`}),(0,A.jsx)(`button`,{type:`button`,disabled:Se?.status===`loading`||xe===0,onClick:Te,className:`rounded bg-zinc-900 px-2.5 py-1 font-medium text-white disabled:opacity-50 dark:bg-zinc-100 dark:text-zinc-900`,children:`Apply`})]})]}):null,Se?.status===`error`?(0,A.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:Se.message}):null,(0,A.jsx)(rz,{skills:ve.skills,groups:ve.groups,enabled:be,onChange:Ce,disabled:Se?.status===`loading`,...ve.bound?{bound:ve.bound}:{}},j.id),de.resources.some(e=>e.kind===`extension`)?(0,A.jsx)(mz,{kind:`extension`,resources:de.resources.filter(e=>e.kind===`extension`),removalLocked:e.extensionLock,onRemove:ge}):null]}):(0,A.jsxs)(`div`,{className:`mt-6 grid grid-cols-2 gap-4`,children:[(0,A.jsx)(mz,{kind:`skill`,resources:de.resources.filter(e=>e.kind===`skill`),onRemove:ge}),(0,A.jsx)(mz,{kind:`extension`,resources:de.resources.filter(e=>e.kind===`extension`),removalLocked:e.extensionLock,onRemove:ge})]})]}):(0,A.jsx)(`p`,{className:`text-sm text-zinc-500`,children:`No resources are reported by this runtime.`})]})]})]}),ie?(0,A.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/55 p-4`,children:(0,A.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`extension-update-title`,className:`w-full max-w-md rounded-xl bg-white p-5 shadow-2xl dark:bg-zinc-900`,children:[(0,A.jsx)(`h3`,{id:`extension-update-title`,className:`font-semibold`,children:`Update executable extensions?`}),(0,A.jsxs)(`p`,{className:`mt-2 text-sm text-zinc-600 dark:text-zinc-300`,children:[ie.name,` contains extensions that run with the agent's privileges. Confirm updating `,ie.assessment.localRevision?.slice(0,8),` to `,ie.assessment.upstreamRevision?.slice(0,8),`.`]}),(0,A.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>ae(null),className:`rounded border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{_e(ie,!0),ae(null)},className:`rounded bg-amber-600 px-3 py-1.5 text-xs font-medium text-white`,children:`Confirm executable update`})]})]})}):null,se?(0,A.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/55 p-4`,children:(0,A.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`remove-repository-title`,"aria-describedby":`remove-repository-detail`,className:`w-full max-w-md rounded-xl bg-white p-5 shadow-2xl dark:bg-zinc-900`,children:[(0,A.jsxs)(`h3`,{id:`remove-repository-title`,className:`font-semibold`,children:[`Remove `,se.name,`?`]}),(0,A.jsx)(`p`,{id:`remove-repository-detail`,className:`mt-2 break-words text-sm text-zinc-600 dark:text-zinc-300`,children:se.removal?.deletesFiles?(0,A.jsxs)(A.Fragment,{children:[`This stops loading everything from `,se.name,` and deletes `,(0,A.jsx)(`span`,{className:`font-mono`,children:se.removal.path}),` from disk, with any local changes in it. This cannot be undone.`]}):(0,A.jsxs)(A.Fragment,{children:[`This stops loading everything from `,se.name,`. pi-outpost does not manage `,(0,A.jsx)(`span`,{className:`font-mono`,children:se.removal?.path??se.path}),`, so its files will be kept.`]})}),(0,A.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>O(null),className:`rounded border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{e.onRemoveRepository(se.id),k({id:se.id,name:se.name}),O(null)},className:`rounded bg-red-600 px-3 py-1.5 text-xs font-medium text-white`,children:se.removal?.deletesFiles?`Delete and remove`:`Remove repository`})]})]})}):null]})}function _z(e){return[...e].sort((e,t)=>e.localeCompare(t))}function vz({extensionPaths:e,configuredExtensionPaths:t,userExtensionPaths:n,extensionLock:r,piPackages:i=null,piPackageUpdate:a=null,canRestartServer:o=!1,serverRestarting:s=!1,onCheckPiPackages:c,onUpdatePiPackage:l,onRestartServer:u,restartNeeded:f=[],tools:p,commands:m,sandbox:h,showRoots:g=!0,gitUnavailable:_,userSkillPaths:v,serverBrowse:y,pickerBlocked:b=!1,onPickerOpened:x,applyState:S,agentResources:C=null,agentResourceOperations:w={clonePath:null,preview:null,enrollment:null,refresh:null,updates:{},skills:{},removals:{}},versions:T,onBrowseServerPath:ee,onCloseServerBrowser:te,onUpdateConfig:E,onSuggestAgentResourceClonePath:ne=()=>{},onCloneAgentResourceRepository:re=()=>{},onEnrollAgentResourceRepository:ie=()=>{},onSetAgentResourceSkills:ae=()=>{},onRemoveAgentResourceRepository:D=()=>{},onRefreshAgentResourceRepositories:oe=()=>{},onUpdateAgentResourceRepository:se=()=>{}}){let[O,ce]=(0,d.useState)(!1),[k,le]=(0,d.useState)(!1),ue=(0,d.useRef)(null),[de,j]=(0,d.useState)(``),[fe,pe]=(0,d.useState)(``),[me,he]=(0,d.useState)(!1),[ge,_e]=(0,d.useState)(!1),[ve,ye]=(0,d.useState)(null);(0,d.useEffect)(()=>{b&&ve!==null&&ye(null)},[b,ve]);let be=yL(()=>{(O||ve!==null)&&Oe()}),xe=p.filter(e=>e.active),Se=p.filter(e=>!e.active),Ce=m.filter(e=>e.source===`skill`),we=[...p].sort((e,t)=>e.name.localeCompare(t.name)||Number(t.active)-Number(e.active)),Te=S?.status===`applying`,Ee=S?.status===`error`?S.message:null;(0,d.useEffect)(()=>{h&&(j(h.root),pe(h.writableRoot??``),he(h.allowWrite),_e(h.allowBash))},[h]);let De=(0,d.useRef)(!1);(0,d.useEffect)(()=>{De.current&&S===null&&Oe(),De.current=Te},[S,Te]);function Oe(){ce(!1),ye(null),te()}function ke(e,t){x?.(),ye(e),ee(t.trim()||`/`)}function Ae(e){ve===`root`?j(e):ve===`writableRoot`&&pe(e),ye(null),te()}let je=h!==null&&(de!==h.root||(fe.trim()||void 0)!==(h.writableRoot||void 0)||me!==h.allowWrite||ge!==h.allowBash);function Me(){!h||!je||E({sandbox:{root:de,allowWrite:me,allowBash:ge,writableRoot:fe.trim()||void 0}})}let Ne=g&&h?.rootEditable!==!1,Pe=ve!==null&&!b&&(0,A.jsx)(KR,{label:ve===`root`?`Choose the sandbox root`:`Choose the writable root`,browse:y,onBrowse:ee,onSelect:Ae,onCancel:()=>{ye(null),te()}});return(0,A.jsxs)(`div`,{className:`relative`,ref:be,children:[(0,A.jsx)(`button`,{ref:ue,type:`button`,onClick:()=>ce(!O),title:`Settings`,"aria-label":`Settings`,className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:`⚙`}),O&&(0,A.jsxs)(`div`,{className:`absolute right-0 top-full z-20 mt-1 flex max-h-[80vh] w-[380px] flex-col rounded-lg border border-zinc-200 bg-white shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,A.jsx)(`div`,{className:`border-b border-zinc-200 px-4 py-3 dark:border-zinc-800`,children:(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-zinc-800 dark:text-zinc-200`,children:`Settings`})}),(0,A.jsxs)(`div`,{className:`min-h-0 overflow-y-auto p-4`,children:[_&&(0,A.jsxs)(`section`,{className:`mb-4`,"data-testid":`git-unavailable`,children:[(0,A.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:`Version control`}),_.reason===`no-repository`?(0,A.jsx)(`p`,{className:`text-xs text-zinc-500 dark:text-zinc-400`,children:`This project is not in a git repository.`}):(0,A.jsxs)(`div`,{className:`rounded border border-amber-300 bg-amber-50 px-2 py-1.5 dark:border-amber-900 dark:bg-amber-950/40`,children:[(0,A.jsx)(`p`,{className:`text-xs text-amber-800 dark:text-amber-300`,children:_.reason===`no-executable`?`Git is unavailable: its executable could not be run.`:`Git is unavailable: it refused this repository.`}),(0,A.jsx)(`p`,{className:`mt-1 break-all font-mono text-[11px] text-amber-700 dark:text-amber-400`,children:_.message}),_.reason===`no-executable`&&(0,A.jsxs)(`p`,{className:`mt-1 text-xs text-amber-700 dark:text-amber-400`,children:[`Install git, add it to PATH, or name it with `,(0,A.jsx)(`span`,{className:`font-mono`,children:`gitPath`}),` in the configuration.`]})]})]}),(0,A.jsxs)(`section`,{className:`mb-4`,children:[(0,A.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:`Agent resources`}),p.length===0?(0,A.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:`Tool inventory unavailable for this runtime`}):(0,A.jsxs)(`details`,{"data-testid":`tools-loaded`,children:[(0,A.jsxs)(`summary`,{className:`cursor-pointer text-xs text-zinc-600 dark:text-zinc-400`,children:[xe.length,` tools active`,Se.length?` · ${Se.length} inactive`:``]}),(0,A.jsx)(`ul`,{className:`mt-2 space-y-1`,children:we.map(e=>(0,A.jsxs)(`li`,{className:`flex justify-between rounded bg-zinc-50 px-2 py-1 font-mono text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400`,children:[(0,A.jsx)(`span`,{children:e.name}),(0,A.jsx)(`span`,{children:e.active?`active`:`inactive`})]},e.name))})]}),Ce.length===0?(0,A.jsx)(`p`,{className:`mt-2 text-xs text-zinc-400 dark:text-zinc-500`,children:`No skills loaded`}):(0,A.jsxs)(`details`,{className:`mt-2`,"data-testid":`skills-loaded`,children:[(0,A.jsxs)(`summary`,{className:`cursor-pointer text-xs text-zinc-600 dark:text-zinc-400`,children:[Ce.length,` skills loaded`]}),(0,A.jsx)(`ul`,{className:`mt-2 space-y-1`,children:_z(Ce.map(e=>e.name)).map(e=>(0,A.jsx)(`li`,{className:`rounded bg-zinc-50 px-2 py-1 font-mono text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400`,children:e},e))})]}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`Manage agent resources`,onClick:()=>{ce(!1),le(!0)},className:`mt-3 w-full rounded-md border border-zinc-300 px-3 py-2 text-xs font-medium text-zinc-700 hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-800`,children:`Manage resources…`})]}),(0,A.jsxs)(`section`,{className:`mb-4`,children:[(0,A.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:`Extensions`}),e===null?(0,A.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,"data-testid":`extensions-unknown`,children:`Not reported by this runtime`}):e.length===0?(0,A.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:`No extensions loaded`}):(0,A.jsxs)(`details`,{"data-testid":`extensions-loaded`,children:[(0,A.jsxs)(`summary`,{className:`cursor-pointer text-xs text-zinc-600 dark:text-zinc-400`,children:[e.length,` `,e.length===1?`extension`:`extensions`,` loaded`]}),(0,A.jsx)(`ul`,{className:`mt-2 space-y-1`,children:_z(e).map(e=>(0,A.jsx)(`li`,{className:`truncate rounded bg-zinc-50 px-2 py-1 font-mono text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400`,title:e,children:e},e))})]}),t.length>0&&(0,A.jsxs)(`details`,{className:`mt-2`,"data-testid":`extensions-configured`,children:[(0,A.jsxs)(`summary`,{className:`cursor-pointer text-xs text-zinc-600 dark:text-zinc-400`,children:[t.length,` configured by this deployment`]}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-zinc-400 dark:text-zinc-500`,children:`Declared in the configuration file. They load either way, and nothing here can remove them.`}),(0,A.jsx)(`ul`,{className:`mt-1 space-y-1`,children:_z(t).map(e=>(0,A.jsx)(`li`,{className:`truncate rounded bg-zinc-50 px-2 py-1 font-mono text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400`,title:e,children:e},e))})]}),r?(0,A.jsx)(`p`,{className:`mt-2 text-xs text-zinc-400 dark:text-zinc-500`,"data-testid":`extensions-locked`,children:`Extension paths and repository updates that contain extensions are locked by this deployment.`}):null,(0,A.jsx)($R,{packages:i,update:a,locked:r,onCheck:()=>c?.(),onUpdate:e=>l?.(e)}),(0,A.jsx)(ez,{reasons:f,canRestart:o,restarting:s,onRestart:()=>u?.()})]}),h&&(0,A.jsxs)(`section`,{children:[(0,A.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:Ne?`Sandbox`:`Agent permissions`}),(0,A.jsxs)(`div`,{className:`space-y-3`,children:[!Ne&&(0,A.jsxs)(`p`,{"data-testid":`sandbox-project-root`,className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`This project is confined to its own folder,`,` `,(0,A.jsx)(`span`,{className:`break-all font-mono text-zinc-800 dark:text-zinc-200`,children:h.projectRoot??h.root}),`. Each open project is confined to its own. A change here applies to this project now, and to projects opened after.`]}),Ne&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`label`,{className:`block`,children:[(0,A.jsxs)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Root `,h.locks?.root?(0,A.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):null]}),(0,A.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,A.jsx)(`input`,{type:`text`,value:de,onChange:e=>j(e.target.value),disabled:h.locks?.root,className:`w-full rounded-md border border-zinc-300 bg-transparent px-2 py-1 text-sm outline-none focus:border-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:focus:border-zinc-500`}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`Browse for sandbox root`,disabled:h.locks?.root,onClick:()=>ke(`root`,de),className:`shrink-0 rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-600 hover:border-zinc-400 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:text-zinc-300`,children:`Browse…`})]})]}),ve===`root`&&Pe,(0,A.jsxs)(`label`,{className:`block`,children:[(0,A.jsxs)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Writable root (optional) `,h.locks?.writableRoot?(0,A.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):null]}),(0,A.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,A.jsx)(`input`,{type:`text`,value:fe,onChange:e=>pe(e.target.value),disabled:h.locks?.writableRoot,placeholder:`Same as root`,className:`w-full rounded-md border border-zinc-300 bg-transparent px-2 py-1 text-sm outline-none placeholder:text-zinc-400 focus:border-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:placeholder:text-zinc-600 dark:focus:border-zinc-500`}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`Browse for writable root`,disabled:h.locks?.writableRoot,onClick:()=>ke(`writableRoot`,fe||de),className:`shrink-0 rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-600 hover:border-zinc-400 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:text-zinc-300`,children:`Browse…`})]})]}),ve===`writableRoot`&&Pe]}),(0,A.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:me,onChange:e=>he(e.target.checked),disabled:h.locks?.allowWrite,className:`rounded border-zinc-300 text-zinc-700 focus:ring-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300`}),(0,A.jsxs)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Allow write `,h.locks?.allowWrite?(0,A.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):null]})]}),(0,A.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:ge,onChange:e=>_e(e.target.checked),disabled:h.locks?.allowBash,className:`rounded border-zinc-300 text-zinc-700 focus:ring-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300`}),(0,A.jsxs)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Allow bash `,h.locks?.allowBash?(0,A.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):null]})]})]})]}),!h&&(0,A.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:`No sandbox configured`}),h&&(0,A.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[Ee&&(0,A.jsx)(`p`,{role:`alert`,className:`rounded-md border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:Ee}),(0,A.jsx)(`button`,{type:`button`,disabled:Te||!je||h!==null&&!de.trim(),onClick:Me,className:`w-full rounded-md bg-zinc-800 px-3 py-1.5 text-xs font-medium text-white hover:bg-zinc-700 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-zinc-200 dark:text-zinc-900 dark:hover:bg-zinc-300`,children:Te?`Applying…`:`Apply & restart session`}),(0,A.jsx)(`p`,{className:`text-[11px] text-zinc-400 dark:text-zinc-500`,children:`Saved to the server's configuration file, then the session is rebuilt — the change survives a restart.`})]}),T&&(0,A.jsxs)(`section`,{className:`mt-4`,children:[(0,A.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:`Versions`}),(0,A.jsxs)(`div`,{className:`space-y-1 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,A.jsxs)(`p`,{children:[`pi-outpost: `,(0,A.jsx)(`span`,{className:`font-mono text-zinc-800 dark:text-zinc-200`,children:T.piOutpost})]}),T.piSdk&&(0,A.jsxs)(`p`,{children:[`pi SDK: `,(0,A.jsx)(`span`,{className:`font-mono text-zinc-800 dark:text-zinc-200`,children:T.piSdk})]}),T.agent&&(0,A.jsxs)(`p`,{children:[`agent: `,(0,A.jsx)(`span`,{className:`font-mono text-zinc-800 dark:text-zinc-200`,children:T.agent})]})]})]})]})]}),(0,A.jsx)(gz,{open:k,inventory:C,operations:w,extensionLock:r,userSkillPaths:v,userExtensionPaths:n,serverBrowse:y,applyState:S,onClose:()=>{le(!1),te(),ue.current?.focus()},onBrowseServerPath:e=>{x?.(),ee(e)},onCloseServerBrowser:te,onUpdateConfig:E,onSuggestClonePath:ne,onCloneRepository:re,onEnrollRepository:ie,onSetSkills:ae,onRemoveRepository:D,onRefresh:oe,onUpdate:se})]})}function yz(e){let t=[],n=new Set,r=0,i=0;function a(e,o,s,c){let l=e.children,u=l.slice(1).map(e=>[e,r++]);u.length>0&&i++;let d=e.onPath&&!l.some(e=>e.onPath);if(t.push({node:e,lane:o,through:[...n].filter(e=>e!==o),forkTo:u.map(([,e])=>e),lineAbove:s,lineBelow:l.length>0,branchIndex:c,isCurrent:d,emphasis:d?`current`:e.onPath?`filled`:`hollow`,highlight:e.onPath}),l.length===0){n.delete(o);return}for(let[,e]of u)n.add(e);a(l[0],o,!0,u.length>0?1:void 0),u.forEach(([e,t],n)=>a(e,t,!0,n+2))}return e.length>1&&i++,e.forEach((t,i)=>{let o=r++;n.add(o),a(t,o,!1,e.length>1?i+1:void 0)}),{rows:t,laneCount:r,branchPoints:i}}function bz(e){return e.flatMap(e=>[e,...bz(e.children)])}function xz({children:e,tone:t}){let n={current:`border-emerald-300 bg-emerald-50 text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/50 dark:text-emerald-300`,branch:`border-zinc-300 text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,label:`border-violet-300 bg-violet-50 text-violet-700 dark:border-violet-900 dark:bg-violet-950/50 dark:text-violet-300`}[t];return(0,A.jsx)(`span`,{className:`shrink-0 rounded-full border px-1.5 py-px text-[10px] leading-4 ${n}`,children:e})}var Sz=`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 opacity-0 hover:bg-zinc-200 hover:text-zinc-700 focus-visible:opacity-100 group-hover:opacity-100 dark:text-zinc-500 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`;function Cz({row:e,laneCount:t,isStreaming:n,onNavigate:r,onFork:i,onClose:a}){let{node:o}=e,s=o.tipId??o.entryId;return(0,A.jsxs)(`div`,{className:`group flex items-center gap-1 pr-2 hover:bg-zinc-100 dark:hover:bg-zinc-800/70 ${e.isCurrent?`bg-emerald-50/60 dark:bg-emerald-950/20`:``}`,style:{height:36},children:[(0,A.jsxs)(`button`,{type:`button`,disabled:n,onClick:()=>{r(s),a()},title:n?`unavailable while the agent is running`:o.tipId?`restore the conversation at this point (reply included)`:`go back to this point`,className:`flex h-full min-w-0 flex-1 items-center gap-2 pl-2 text-left text-sm disabled:opacity-50`,children:[(0,A.jsx)(DR,{row:e,laneCount:t,colorOf:wR}),(0,A.jsx)(`span`,{className:`min-w-0 truncate ${o.onPath?`text-zinc-800 dark:text-zinc-200`:`text-zinc-600 dark:text-zinc-400`}`,children:o.text||`(empty)`}),e.forkTo.length>0&&(0,A.jsxs)(xz,{tone:`branch`,children:[e.forkTo.length+1,` branches`]}),e.branchIndex!==void 0&&(0,A.jsxs)(xz,{tone:`branch`,children:[`branch `,e.branchIndex,o.onPath&&!e.isCurrent?` · current`:``]}),e.isCurrent&&(0,A.jsx)(xz,{tone:`current`,children:`current`}),o.label&&(0,A.jsx)(xz,{tone:`label`,children:o.label})]}),(0,A.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>{r(o.entryId),a()},title:`rewind to just before this message (its text comes back in the composer)`,"aria-label":`Rewind to before this message`,className:Sz,children:`↺ redo`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{i(o.entryId),a()},title:`fork a new session from this point`,className:Sz,children:`⑂ fork`})]})}function wz({tree:e,isStreaming:t,onListTree:n,onNavigate:r,onFork:i}){let[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(``),l=yL(()=>o(!1));(0,d.useEffect)(()=>{a&&e===null&&n()},[a,e]);let u=(0,d.useMemo)(()=>e&&e.length>0?yz(e):null,[e]),f=(0,d.useMemo)(()=>{if(!e||!s.trim())return null;let t=s.trim().toLowerCase();return bz(e).filter(e=>e.text.toLowerCase().includes(t)||e.label?.toLowerCase().includes(t))},[e,s]);return(0,A.jsxs)(`div`,{className:`relative`,ref:l,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>{o(!a),a||(c(``),n())},title:`conversation tree: go back to an earlier point or fork`,className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:`tree`}),a&&(0,A.jsxs)(`div`,{className:`absolute right-0 top-full z-20 mt-1 flex max-h-[70vh] w-[32rem] max-w-[90vw] flex-col rounded-lg border border-zinc-200 bg-white shadow-xl [--tree-off:#e4e4e7] dark:border-zinc-700 dark:bg-zinc-900 dark:[--tree-off:#3f3f46]`,children:[e===null&&(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`loading…`}),e?.length===0&&(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`no messages yet`}),e&&e.length>0&&u&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,A.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-zinc-800 dark:text-zinc-200`,children:`Conversation tree`}),(0,A.jsxs)(`span`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:[u.rows.length,` turn`,u.rows.length===1?``:`s`,` · `,u.branchPoints,` branch point`,u.branchPoints===1?``:`s`]})]}),(0,A.jsx)(`input`,{type:`search`,value:s,onChange:e=>c(e.target.value),placeholder:`Search tree`,"aria-label":`Search conversation tree`,className:`mt-2 w-full rounded-md border border-zinc-300 bg-transparent px-2 py-1 text-sm outline-none placeholder:text-zinc-400 focus:border-zinc-500 dark:border-zinc-700 dark:placeholder:text-zinc-600 dark:focus:border-zinc-500`}),(0,A.jsx)(`p`,{className:`mt-1.5 text-[11px] text-zinc-400 dark:text-zinc-500`,children:`Follow the colored lines — the current branch is highlighted. Click a turn to restore the conversation there · ↺ to send it again · ⑂ to fork a session`})]}),(0,A.jsx)(`div`,{className:`min-h-0 overflow-y-auto py-1`,children:f===null?u.rows.map(e=>(0,A.jsx)(Cz,{row:e,laneCount:u.laneCount,isStreaming:t,onNavigate:r,onFork:i,onClose:()=>o(!1)},e.node.entryId)):f.length===0?(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`no matches`}):f.map(e=>(0,A.jsxs)(`div`,{className:`group flex items-center gap-1 pr-2 hover:bg-zinc-100 dark:hover:bg-zinc-800/70`,children:[(0,A.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>{r(e.tipId??e.entryId),o(!1)},title:e.tipId?`restore the conversation at this point (reply included)`:`go back to this point`,className:`flex min-w-0 flex-1 items-center gap-2 px-3 py-1.5 text-left text-sm disabled:opacity-50`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:e.onPath?`text-emerald-500`:`text-zinc-300 dark:text-zinc-600`,children:`●`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate text-zinc-700 dark:text-zinc-300`,children:e.text||`(empty)`}),e.onPath&&(0,A.jsx)(xz,{tone:`current`,children:`on current branch`}),e.label&&(0,A.jsx)(xz,{tone:`label`,children:e.label})]}),(0,A.jsx)(`button`,{type:`button`,disabled:t,onClick:()=>{r(e.entryId),o(!1)},title:`rewind to just before this message (its text comes back in the composer)`,"aria-label":`Rewind to before this message`,className:Sz,children:`↺ redo`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{i(e.entryId),o(!1)},title:`fork a new session from this point`,className:Sz,children:`⑂ fork`})]},e.entryId))})]})]})]})}var Tz=200;function Ez({initial:e,onCommit:t,onCancel:n}){let[r,i]=(0,d.useState)(e);return(0,A.jsx)(`input`,{autoFocus:!0,value:r,onChange:e=>i(e.target.value),onBlur:n,onKeyDown:e=>{e.key===`Enter`?t(r):e.key===`Escape`&&n()},placeholder:`Session name (empty to clear)`,"aria-label":`Session name`,className:`w-full rounded-md border border-zinc-400 bg-transparent px-2 py-1 text-sm outline-none placeholder:text-zinc-400 dark:border-zinc-600 dark:placeholder:text-zinc-600`})}function Dz({session:e,isCurrent:t,renaming:n,onSwitch:r,onDelete:i,onStartRename:a,onRename:o,onCancelRename:s}){return n?(0,A.jsx)(`div`,{className:`px-3 py-2`,children:(0,A.jsx)(Ez,{initial:e.name??``,onCommit:o,onCancel:s})}):(0,A.jsxs)(`div`,{className:`group flex items-start gap-1 hover:bg-zinc-100 dark:hover:bg-zinc-800 ${t?`bg-zinc-100 dark:bg-zinc-800/60`:``}`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:r,className:`min-w-0 flex-1 px-3 py-2 text-left text-sm`,children:[(0,A.jsx)(`div`,{className:`truncate text-zinc-700 dark:text-zinc-300`,children:e.name||e.firstMessage||`(empty)`}),e.snippet&&(0,A.jsx)(`div`,{className:`mt-0.5 truncate text-xs text-zinc-500 dark:text-zinc-500`,children:e.snippet}),(0,A.jsxs)(`div`,{className:`mt-0.5 text-xs text-zinc-400 dark:text-zinc-600`,children:[new Date(e.modified).toLocaleString(),` · `,e.messageCount,` messages`,t?` · current`:``,!t&&e.liveIn?(0,A.jsxs)(`span`,{"data-testid":`session-live-in`,children:[` · open in `,e.liveIn]}):null]})]}),(0,A.jsx)(`button`,{type:`button`,onClick:a,title:`rename session`,"aria-label":`Rename session`,className:`mt-2 rounded px-1.5 py-0.5 text-xs text-zinc-400 opacity-0 hover:bg-zinc-200 hover:text-zinc-700 focus-visible:opacity-100 group-hover:opacity-100 dark:text-zinc-600 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`,children:`✎`}),!t&&!e.liveIn&&(0,A.jsx)(`button`,{type:`button`,onClick:i,title:`delete session`,"aria-label":`Delete session`,className:`mr-2 mt-2 rounded px-1.5 py-0.5 text-xs text-zinc-400 opacity-0 hover:bg-red-100 hover:text-red-600 focus-visible:opacity-100 group-hover:opacity-100 dark:text-zinc-600 dark:hover:bg-red-950/60 dark:hover:text-red-400`,children:`✕`})]})}function Oz({sessions:e,sessionSearch:t,sessionId:n,onSwitchSession:r,onDeleteSession:i,onListSessions:a,onRenameSession:o,onSearchSessions:s,onClearSessionSearch:c}){let[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)(null),g=yL(()=>u(!1)),_=f.trim(),v=_.length>=2;(0,d.useEffect)(()=>{if(!l)return;if(!v){c();return}let e=setTimeout(()=>s(_),Tz);return()=>clearTimeout(e)},[l,_,v]);function y(){u(!1),h(null)}let b=v&&(t?.status!==`loaded`||t.query!==_),x=v?b?null:t?.results??null:e;return(0,A.jsxs)(`div`,{className:`relative`,ref:g,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>{if(l){y();return}u(!0),p(``),h(null),c(),a()},className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:`sessions`}),l&&(0,A.jsxs)(`div`,{className:`absolute right-0 top-full z-20 mt-1 flex max-h-96 w-96 flex-col rounded-lg border border-zinc-200 bg-white shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,A.jsxs)(`div`,{className:`border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,A.jsx)(`input`,{type:`search`,value:f,onChange:e=>p(e.target.value),placeholder:`Search sessions`,"aria-label":`Search sessions`,className:`w-full rounded-md border border-zinc-300 bg-transparent px-2 py-1 text-sm outline-none placeholder:text-zinc-400 focus:border-zinc-500 dark:border-zinc-700 dark:placeholder:text-zinc-600 dark:focus:border-zinc-500`}),(0,A.jsx)(`p`,{className:`mt-1.5 text-[11px] text-zinc-400 dark:text-zinc-500`,children:`Searches names and everything said in a session · ✎ to rename`})]}),(0,A.jsxs)(`div`,{className:`min-h-0 overflow-y-auto`,children:[x===null&&(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`loading…`}),x?.length===0&&(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:v?`no matches`:`no saved sessions`}),x?.map(e=>(0,A.jsx)(Dz,{session:e,isCurrent:e.id===n,renaming:m===e.path,onSwitch:()=>{r(e.path),y()},onDelete:()=>{window.confirm(`Delete this session?`)&&i(e.path)},onStartRename:()=>h(e.path),onRename:t=>{o(e.path,t),h(null),v&&s(f.trim())},onCancelRename:()=>h(null)},e.path))]})]})]})}function kz({filters:e,onFilterChange:t}){let[n,r]=(0,d.useState)(!1),i=yL(()=>r(!1)),a=HI(e),o=a>0?`Filter · ${a} hidden`:`Filter`;return(0,A.jsxs)(`div`,{className:`relative`,ref:i,onKeyDown:e=>{e.key===`Escape`&&n&&(e.stopPropagation(),r(!1))},children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-haspopup":`menu`,"aria-expanded":n,title:`Choose what the conversation shows`,className:`rounded-md border px-2 py-1 text-xs ${a>0?`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`}`,children:o}),n&&(0,A.jsx)(`div`,{role:`menu`,className:`absolute right-0 z-30 mt-1 w-48 rounded-md border border-zinc-200 bg-white py-1 shadow-lg dark:border-zinc-700 dark:bg-zinc-900`,children:LI.map(n=>(0,A.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":e[n],onClick:()=>t(n,!e[n]),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-zinc-600 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`w-3`,children:e[n]?`✓`:``}),(0,A.jsx)(`span`,{children:RI[n]})]},n))})]})}function Az({theme:e,onToggle:t}){return(0,A.jsx)(`button`,{type:`button`,onClick:t,title:e===`dark`?`Switch to light theme`:`Switch to dark theme`,"aria-label":e===`dark`?`Switch to light theme`:`Switch to dark theme`,className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:e===`dark`?`☀`:`☾`})}function jz(e){let{isStreaming:t,connected:n}=e;return(0,A.jsxs)(`header`,{className:`relative z-30 flex items-center gap-3 border-b border-zinc-200 px-4 py-2.5 dark:border-zinc-800`,children:[e.workspaceControl===`projects`&&(0,A.jsx)(GR,{workspace:e.workspace,workspaces:e.workspaces,locked:e.workspaceLocked,onSwitch:e.onSwitchWorkspace,onOpen:e.onOpenProject,onClose:e.onCloseProject,onOpenSide:e.onOpenSideSession}),e.workspaceControl===`root`&&e.rootControl&&(0,A.jsx)(JR,{sandbox:e.rootControl.sandbox,browse:e.rootControl.browse,applyState:e.rootControl.applyState,blocked:e.rootControl.blocked,onBrowse:e.rootControl.onBrowse,onCloseBrowser:e.rootControl.onCloseBrowser,onOpened:e.rootControl.onOpened,onSelect:e.rootControl.onSelect}),(0,A.jsxs)(`button`,{type:`button`,onClick:e.onToggleSidebar,title:e.sidebarOpen?`Hide files (panel opens on the left)`:`Show files`,"aria-pressed":e.sidebarOpen,className:`rounded-md border px-2 py-1 text-xs ${e.sidebarOpen?`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`}`,children:[e.sidebarOpen?`◧`:`◨`,` files`]}),(0,A.jsxs)(`button`,{type:`button`,onClick:e.onToggleOutcome,"aria-pressed":e.outcomeOpen,title:`Review structured workspace Outcome`,className:`rounded-md border px-2 py-1 text-xs ${e.outcomeOpen?`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`:e.workspace?.activity===`ready-for-review`?`border-amber-400 text-amber-700 dark:text-amber-300`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 dark:border-zinc-800 dark:text-zinc-400`}`,children:[`Outcome`,e.workspace?.activity===`ready-for-review`?` •`:``]}),e.gitAvailable&&(0,A.jsx)(ZR,{status:e.gitStatus,selected:e.gitSelectedPath,log:e.gitLog,onFetchLog:e.onFetchGitLog,onShowCommit:e.onShowCommit}),(0,A.jsx)(`span`,{className:`text-lg font-semibold tracking-tight`,style:{color:`var(--accent, inherit)`},children:e.title??`π`}),Object.entries(e.statuses).map(([e,t])=>(0,A.jsx)(`span`,{className:`rounded-md border border-zinc-200 px-2 py-1 text-xs text-zinc-500 dark:border-zinc-800 dark:text-zinc-400`,children:WL(t)},e)),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,A.jsx)(kz,{filters:e.filters,onFilterChange:e.onFilterChange}),e.onExportConversation&&(0,A.jsx)(`button`,{type:`button`,onClick:e.onExportConversation,disabled:!!e.exportProgress,"aria-busy":!!e.exportProgress,title:`Save the whole conversation as one HTML file`,"aria-label":`Export the conversation as HTML`,className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 disabled:cursor-progress disabled:opacity-60 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:e.exportProgress??`↓ html`}),e.onToggleTerminal&&(0,A.jsx)(`button`,{type:`button`,onClick:e.onToggleTerminal,title:e.terminalOpen?"Close Terminal (Ctrl+`)":"Open Terminal (Ctrl+`)","aria-pressed":e.terminalOpen,className:`rounded-md border px-2 py-1 text-xs ${e.terminalOpen?`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`}`,children:`>_ terminal`}),e.showThemeToggle&&(0,A.jsx)(Az,{theme:e.theme,onToggle:e.onToggleTheme}),(0,A.jsx)(`button`,{type:`button`,onClick:e.onNewSession,title:`new session`,className:`rounded-md border border-emerald-300 px-2 py-1 text-xs text-emerald-700 hover:border-emerald-500 hover:text-emerald-600 dark:border-emerald-900 dark:text-emerald-400 dark:hover:border-emerald-600 dark:hover:text-emerald-300`,children:`+ new`}),(0,A.jsx)(wz,{tree:e.tree,isStreaming:t,onListTree:e.onListTree,onNavigate:e.onNavigateTree,onFork:e.onForkSession}),(0,A.jsx)(Oz,{sessions:e.sessions,sessionSearch:e.sessionSearch,sessionId:e.sessionId,onSwitchSession:e.onSwitchSession,onDeleteSession:e.onDeleteSession,onListSessions:e.onListSessions,onRenameSession:e.onRenameSession,onSearchSessions:e.onSearchSessions,onClearSessionSearch:e.onClearSessionSearch}),(0,A.jsx)(vz,{extensionPaths:e.extensionPaths,configuredExtensionPaths:e.configuredExtensionPaths,userExtensionPaths:e.userExtensionPaths,extensionLock:e.extensionLock,piPackages:e.piPackages??null,piPackageUpdate:e.piPackageUpdate??null,canRestartServer:e.canRestartServer??!1,serverRestarting:e.serverRestarting??!1,...e.onCheckPiPackages?{onCheckPiPackages:e.onCheckPiPackages}:{},...e.onUpdatePiPackage?{onUpdatePiPackage:e.onUpdatePiPackage}:{},...e.onRestartServer?{onRestartServer:e.onRestartServer}:{},restartNeeded:e.restartNeeded??[],tools:e.tools??[],commands:e.commands??[],sandbox:e.sandbox,showRoots:!(e.workspaceControl===`projects`&&e.workspaces.filter(e=>!e.sideOf).length>1),gitUnavailable:e.gitUnavailable,userSkillPaths:e.userSkillPaths,serverBrowse:e.serverBrowse,applyState:e.settingsApply,agentResources:e.agentResources,agentResourceOperations:e.agentResourceOperations,versions:e.versions,onBrowseServerPath:e.onBrowseServerPath,onCloseServerBrowser:e.onCloseServerBrowser,pickerBlocked:e.settingsPickerBlocked,onPickerOpened:e.onSettingsPickerOpened,onUpdateConfig:e.onUpdateConfig,onSuggestAgentResourceClonePath:e.onSuggestAgentResourceClonePath,onCloneAgentResourceRepository:e.onCloneAgentResourceRepository,onEnrollAgentResourceRepository:e.onEnrollAgentResourceRepository,onSetAgentResourceSkills:e.onSetAgentResourceSkills,onRemoveAgentResourceRepository:e.onRemoveAgentResourceRepository,onRefreshAgentResourceRepositories:e.onRefreshAgentResourceRepositories,onUpdateAgentResourceRepository:e.onUpdateAgentResourceRepository}),(0,A.jsx)(`span`,{className:`h-2 w-2 rounded-full ${n?`bg-emerald-500`:`bg-red-500`}`,title:n?`connected`:`disconnected`})]})]})}function Mz(e,t){let n=(0,d.useRef)(new Map);(0,d.useEffect)(()=>{if(typeof Notification>`u`)return;let r=e.filter(e=>e.needsAttention),i=r.filter(e=>tI(e)!==t);for(let e of[...n.current.keys()])r.some(t=>tI(t)===e)||n.current.delete(e);if(Notification.permission===`granted`&&!(typeof document<`u`&&document.visibilityState===`visible`)){for(let e of i)if(n.current.get(tI(e))!==e.activity){n.current.set(tI(e),e.activity);try{let t=e.activity===`ready-for-review`;new Notification(t?`${e.name} is ready for review`:`${e.name} needs you`,{body:t?`Background work is ready for review.`:`The agent needs an answer to continue.`,tag:`pi-outpost:${tI(e)}`})}catch{}}}},[e,t])}function Nz(e){return!e||e.percent===null?`text-zinc-400 dark:text-zinc-600`:e.percent>=85?`text-red-500`:e.percent>=60?`text-amber-500 dark:text-amber-400`:`text-emerald-500`}function Pz({usage:e,analysisOpen:t,onToggleAnalysis:n}){if(e.turns===0)return null;let r=e.turns-e.unpriced,i=[`${e.turns} turn${e.turns===1?``:`s`}`,`input ${e.input.toLocaleString()}`,`output ${e.output.toLocaleString()}`,`cache read ${e.cacheRead.toLocaleString()}`,`cache write ${e.cacheWrite.toLocaleString()}`,...e.unpriced>0&&r>0?[`${e.unpriced} unpriced`]:[]].join(` · `),a=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`span`,{children:[cI(e.totalTokens),` tok`]}),r>0&&(0,A.jsxs)(`span`,{className:`text-zinc-400 dark:text-zinc-500`,children:[sI(e.cost),e.unpriced>0&&`*`]})]}),o=`flex items-center gap-1.5 rounded-md border px-2 py-1 font-mono text-xs text-zinc-500 dark:text-zinc-400`;return n?(0,A.jsx)(`button`,{type:`button`,onClick:n,title:`${i} — click for the session analysis`,"aria-haspopup":`dialog`,"aria-expanded":t??!1,className:`${o} ${t?`border-zinc-400 dark:border-zinc-600`:`border-zinc-300 hover:border-zinc-400 dark:border-zinc-800 dark:hover:border-zinc-600`}`,children:a}):(0,A.jsx)(`span`,{title:i,className:`${o} border-zinc-300 dark:border-zinc-800`,children:a})}function Fz({usage:e}){let t=15.9155,n=2*Math.PI*t,r=e?.percent??0,i=Math.min(100,Math.max(0,r))/100*n;return(0,A.jsxs)(`svg`,{width:18,height:18,viewBox:`0 0 36 36`,className:`-rotate-90 shrink-0`,children:[(0,A.jsx)(`circle`,{cx:`18`,cy:`18`,r:t,fill:`none`,stroke:`currentColor`,strokeWidth:`4`,className:`text-zinc-200 dark:text-zinc-800`}),e&&e.percent!==null&&(0,A.jsx)(`circle`,{cx:`18`,cy:`18`,r:t,fill:`none`,stroke:`currentColor`,strokeWidth:`4`,strokeLinecap:`round`,strokeDasharray:`${i} ${n-i}`,className:Nz(e)})]})}function Iz({thinkingLevel:e,thinkingLevels:t,isStreaming:n,onSetThinking:r}){let[i,a]=(0,d.useState)(!1),o=(0,d.useRef)(null),s=e!==`off`,c=t&&t.length>0?t:dR,l=c.indexOf(e),u=c.length>1;return(0,d.useEffect)(()=>{if(!i)return;function e(e){o.current&&!vL(e,o.current)&&a(!1)}function t(e){e.key===`Escape`&&a(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]),(0,A.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>a(!i),disabled:n,title:`thinking level`,"aria-haspopup":`true`,"aria-expanded":i,className:`flex items-center gap-1.5 rounded-md border px-2 py-1 font-mono text-xs disabled:opacity-50 ${s?`border-amber-300 text-amber-700 hover:border-amber-400 dark:border-amber-900 dark:text-amber-400 dark:hover:border-amber-700`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600`}`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`text-sm leading-none ${s?``:`opacity-40 grayscale`}`,children:`🧠`}),e]}),i&&(0,A.jsxs)(`div`,{className:`absolute bottom-full left-0 z-20 mb-1 w-48 rounded-lg border border-zinc-200 bg-white p-3 shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,A.jsxs)(`div`,{className:`mb-1 flex items-baseline justify-between text-xs`,children:[(0,A.jsx)(`span`,{className:`text-zinc-500 dark:text-zinc-400`,children:`thinking`}),(0,A.jsx)(`span`,{className:`font-mono text-zinc-700 dark:text-zinc-200`,children:e})]}),u?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`input`,{type:`range`,min:0,max:c.length-1,step:1,value:l===-1?0:l,onChange:e=>r(c[Number(e.target.value)]),"aria-label":`Thinking level`,"aria-valuetext":e,className:`w-full accent-amber-500`}),(0,A.jsxs)(`div`,{className:`mt-0.5 flex justify-between font-mono text-[9px] text-zinc-400 dark:text-zinc-600`,children:[(0,A.jsx)(`span`,{children:c[0]}),(0,A.jsx)(`span`,{children:c[c.length-1]})]})]}):(0,A.jsxs)(`p`,{className:`text-[11px] text-zinc-500 dark:text-zinc-400`,children:[`this model accepts `,(0,A.jsx)(`span`,{className:`font-mono`,children:c[0]}),` only`]})]})]})}function Lz(e){let{model:t,models:n,thinkingLevel:r,modelSupportsReasoning:i,isStreaming:a,contextUsage:o,sessionUsage:s,isCompacting:c}=e;return(0,A.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,A.jsxs)(`select`,{value:t,onChange:t=>{let r=n.find(e=>`${e.provider}/${e.id}`===t.target.value);r&&e.onSetModel(r.provider,r.id)},disabled:a,className:`max-w-64 rounded-md border border-zinc-300 bg-white px-2 py-1 font-mono text-xs text-zinc-700 outline-none hover:border-zinc-400 disabled:opacity-50 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:border-zinc-600`,children:[!n.some(e=>`${e.provider}/${e.id}`===t)&&(0,A.jsx)(`option`,{value:t,children:t}),n.map(e=>(0,A.jsxs)(`option`,{value:`${e.provider}/${e.id}`,children:[e.provider,`/`,e.id]},`${e.provider}/${e.id}`))]}),i&&(0,A.jsx)(Iz,{thinkingLevel:r,thinkingLevels:e.thinkingLevels,isStreaming:a,onSetThinking:e.onSetThinking}),(0,A.jsxs)(`button`,{type:`button`,onClick:e.onCompact,disabled:a||c,title:o?.tokens==null?`Click to compact the conversation context`:`${o.tokens.toLocaleString()} / ${o.contextWindow.toLocaleString()} tokens — click to compact`,className:`ml-auto flex items-center gap-1.5 rounded-md border border-zinc-300 px-2 py-1 font-mono text-xs text-zinc-500 hover:border-zinc-400 disabled:opacity-50 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600`,children:[(0,A.jsx)(Fz,{usage:o}),c?`compacting…`:o?.percent==null?`context`:`${Math.round(o.percent)}%`]}),(0,A.jsx)(Pz,{usage:s,analysisOpen:e.analysisOpen,onToggleAnalysis:e.onToggleAnalysis})]})}var Rz=`w-full rounded-md border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-800 placeholder:text-zinc-400 focus:border-zinc-400 focus:outline-none dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100 dark:placeholder:text-zinc-600`,zz=`mb-1 block text-xs font-medium text-zinc-600 dark:text-zinc-400`;function Bz({title:e,credentials:t,onSetCredential:n,onDeclareProvider:r,errors:i}){let a=t.providers,[o,s]=(0,d.useState)(a.length>0?`known`:`custom`),[c,l]=(0,d.useState)(a[0]?.id??``),[u,f]=(0,d.useState)(``),[p,m]=(0,d.useState)(``),[h,g]=(0,d.useState)(``),[_,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(!0),[x,S]=(0,d.useState)(!0),C=a.some(e=>e.configured)&&!t.usableModel;function w(e){if(e.preventDefault(),!C){if(o===`known`){c&&u.trim()&&n(c,u.trim());return}!p.trim()||!h.trim()||!u.trim()||!_.trim()||r({provider:p.trim(),baseUrl:h.trim(),apiKey:u.trim(),models:[_.trim()],compat:{supportsDeveloperRole:y,supportsReasoningEffort:x}})}}return(0,A.jsx)(`div`,{className:`flex h-full items-center justify-center overflow-auto p-6`,children:(0,A.jsxs)(`form`,{onSubmit:w,className:`w-full max-w-md rounded-xl border border-zinc-200 p-6 shadow-sm dark:border-zinc-800`,children:[(0,A.jsx)(`div`,{className:`mb-1 text-center text-3xl`,children:e??`π`}),C?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`h1`,{className:`mb-3 text-center text-sm text-zinc-500 dark:text-zinc-400`,children:`No model is available.`}),(0,A.jsxs)(`p`,{className:`text-sm text-zinc-600 dark:text-zinc-400`,children:[`Credentials are configured, so this is not a missing key: `,(0,A.jsx)(`code`,{children:`allowedModels`}),` in your configuration leaves nothing to choose from. Widen it, or remove it, then restart.`]})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`h1`,{className:`mb-4 text-center text-sm text-zinc-500 dark:text-zinc-400`,children:`No model provider is set up yet. Add one to start chatting.`}),(0,A.jsx)(`div`,{className:`mb-4 flex gap-1 rounded-lg bg-zinc-100 p-1 text-xs dark:bg-zinc-800`,children:[`known`,`custom`].map(e=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`flex-1 rounded-md px-2 py-1.5 ${o===e?`bg-white font-medium text-zinc-800 shadow-sm dark:bg-zinc-900 dark:text-zinc-100`:`text-zinc-500 dark:text-zinc-400`}`,children:e===`known`?`Provider API key`:`OpenAI-compatible endpoint`},e))}),o===`known`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`label`,{htmlFor:`onboarding-provider`,className:zz,children:`Provider`}),(0,A.jsx)(`select`,{id:`onboarding-provider`,value:c,onChange:e=>l(e.target.value),className:`${Rz} mb-3`,children:a.map(e=>(0,A.jsxs)(`option`,{value:e.id,children:[e.name,e.configured?` (already configured)`:``]},e.id))})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`label`,{htmlFor:`onboarding-name`,className:zz,children:`Name`}),(0,A.jsx)(`input`,{id:`onboarding-name`,value:p,onChange:e=>m(e.target.value),placeholder:`corp`,className:`${Rz} mb-3`}),(0,A.jsx)(`label`,{htmlFor:`onboarding-url`,className:zz,children:`Base URL`}),(0,A.jsx)(`input`,{id:`onboarding-url`,value:h,onChange:e=>g(e.target.value),placeholder:`https://llm.corp.example/v1`,className:`${Rz} mb-3`}),(0,A.jsx)(`label`,{htmlFor:`onboarding-model`,className:zz,children:`Model id`}),(0,A.jsx)(`input`,{id:`onboarding-model`,value:_,onChange:e=>v(e.target.value),placeholder:`gpt-oss-120b`,className:`${Rz} mb-3`})]}),(0,A.jsx)(`label`,{htmlFor:`onboarding-key`,className:zz,children:`API key`}),(0,A.jsx)(`input`,{id:`onboarding-key`,type:`password`,autoComplete:`off`,value:u,onChange:e=>f(e.target.value),placeholder:`sk-…`,className:Rz}),o===`custom`&&(0,A.jsxs)(`fieldset`,{className:`mt-4 rounded-lg border border-zinc-200 p-3 dark:border-zinc-800`,children:[(0,A.jsx)(`legend`,{className:`px-1 text-xs text-zinc-500 dark:text-zinc-400`,children:`Compatibility`}),(0,A.jsxs)(`label`,{className:`flex items-start gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>b(e.target.checked),className:`mt-0.5`}),(0,A.jsxs)(`span`,{children:[`Server understands the `,(0,A.jsx)(`code`,{children:`developer`}),` role. Uncheck for vLLM, SGLang and most corporate gateways — the system prompt is then sent as a `,(0,A.jsx)(`code`,{children:`system`}),` message.`]})]}),(0,A.jsxs)(`label`,{className:`mt-2 flex items-start gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>S(e.target.checked),className:`mt-0.5`}),(0,A.jsxs)(`span`,{children:[`Server accepts `,(0,A.jsx)(`code`,{children:`reasoning_effort`}),`. Uncheck if it rejects unknown fields.`]})]})]}),(0,A.jsx)(`button`,{type:`submit`,className:`mt-4 w-full rounded-md bg-zinc-800 px-3 py-2 text-sm font-medium text-white hover:bg-zinc-700 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white`,children:`Save and start`})]}),i.map((e,t)=>(0,A.jsx)(`p`,{className:`mt-3 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:e},t)),(0,A.jsxs)(`p`,{className:`mt-4 text-center text-xs text-zinc-400 dark:text-zinc-600`,children:[t.agentDir?`Stored in ${t.agentDir}. `:``,`Provider environment variables work too, as does `,(0,A.jsx)(`code`,{children:`pi-outpost login`}),`.`]})]})})}var Vz=`application/x-pi-outpost-file`,Hz=`application/x-pi-outpost-read-only-file`,Uz=`mr-1 shrink-0 rounded px-1 text-xs text-zinc-400 hover:bg-zinc-200 group-hover:opacity-100 focus-visible:opacity-100 dark:text-zinc-600 dark:hover:bg-zinc-700 [@media(hover:hover)]:opacity-0`,Wz={modified:{label:`M`,className:`text-amber-600 dark:text-amber-400`},added:{label:`A`,className:`text-emerald-600 dark:text-emerald-400`},untracked:{label:`U`,className:`text-emerald-600 dark:text-emerald-400`},deleted:{label:`D`,className:`text-red-600 dark:text-red-400`},conflicted:{label:`C`,className:`text-purple-600 dark:text-purple-400`}};function Gz(e,t){return t?Object.keys(t).filter(t=>t.startsWith(`${e}/`)).length:0}function Kz(e){return e===`directory`||e===`symlink-directory`}function qz(e,t){return t===void 0?!1:t===null||t!==``&&e!==t&&!e.startsWith(`${t}/`)}function Jz({dir:e,depth:t,creation:n}){let[r,i]=(0,d.useState)(``),a=(0,d.useRef)(null),o=n.localError??n.serverError;return(0,d.useEffect)(()=>{a.current?.focus()},[]),(0,A.jsxs)(`div`,{style:{paddingLeft:t*12+4},className:`py-0.5`,children:[(0,A.jsx)(`input`,{ref:a,value:r,onChange:e=>i(e.target.value),onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),n.submit(e,r)):t.key===`Escape`&&(t.preventDefault(),n.cancel())},onBlur:()=>{o===null&&n.cancel()},placeholder:`name, or name/ for a folder`,"aria-label":`New file or folder in ${e===``?`the workspace root`:e}`,spellCheck:!1,className:`w-full rounded border border-zinc-300 bg-white px-1 py-0.5 text-xs text-zinc-800 outline-none focus:border-zinc-400 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-200`}),o!==null&&(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-xs text-red-600 dark:text-red-400`,children:o})]})}function Yz({path:e,name:t,depth:n,rename:r}){let[i,a]=(0,d.useState)(t),o=(0,d.useRef)(null),s=r.localError??r.serverError;return(0,d.useEffect)(()=>{o.current?.focus(),o.current?.select()},[]),(0,A.jsxs)(`div`,{style:{paddingLeft:n*12+16},className:`py-0.5`,children:[(0,A.jsx)(`input`,{ref:o,value:i,disabled:r.pending,onChange:e=>a(e.target.value),onKeyDown:t=>{t.key===`Enter`&&!r.pending?(t.preventDefault(),r.submit(e,i)):t.key===`Escape`&&(t.preventDefault(),r.cancel())},onBlur:()=>{s===null&&r.cancel()},"aria-label":`Rename ${t}`,spellCheck:!1,className:`w-full rounded border border-zinc-300 bg-white px-1 py-0.5 text-xs text-zinc-800 outline-none focus:border-zinc-400 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-200`}),s!==null&&(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-xs text-red-600 dark:text-red-400`,children:s})]})}function Xz({path:e,depth:t,...n}){let r=n.tree[e],i=n.creation?.openIn===e?(0,A.jsx)(Jz,{dir:e,depth:t,creation:n.creation}):null;return r===void 0?i:r===`loading`?(0,A.jsxs)(A.Fragment,{children:[i,(0,A.jsx)(`div`,{style:{paddingLeft:t*12+4},className:`py-0.5 text-xs text-zinc-400 dark:text-zinc-600`,children:`loading…`})]}):`error`in r?(0,A.jsxs)(A.Fragment,{children:[i,(0,A.jsx)(`div`,{style:{paddingLeft:t*12+4},className:`py-0.5 text-xs text-red-600 dark:text-red-400`,children:r.error})]}):r.length===0?(0,A.jsxs)(A.Fragment,{children:[i,i===null&&(0,A.jsx)(`div`,{style:{paddingLeft:t*12+4},className:`py-0.5 text-xs text-zinc-400 dark:text-zinc-600`,children:`empty`})]}):(0,A.jsxs)(A.Fragment,{children:[i,r.map(r=>(0,A.jsx)(Zz,{parentPath:e,entry:r,depth:t,...n},r.name))]})}function Zz({parentPath:e,entry:t,depth:n,...r}){let[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(!1),c=e?`${e}/${t.name}`:t.name,l=qz(c,r.writableRoot),u=r.fileOperation?.status===`pending`;if(Kz(t.type)){let e=!l&&!u,d=e=>e.includes(Hz)?r.onCopyFile===void 0?null:`copy`:r.onMoveFile===void 0?null:`move`;return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`group flex w-full items-center rounded hover:bg-zinc-100 dark:hover:bg-zinc-800 ${o?`bg-blue-50 ring-1 ring-blue-400 dark:bg-blue-950/40`:``}`,onDragOver:t=>{if(!e||!Array.from(t.dataTransfer.types).includes(Vz))return;let n=d(Array.from(t.dataTransfer.types));n!==null&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=n,s(!0))},onDragLeave:()=>s(!1),onDrop:t=>{if(!e)return;let n=t.dataTransfer.getData(Vz),i=n?d(Array.from(t.dataTransfer.types)):null;i!==null&&(t.preventDefault(),t.stopPropagation(),s(!1),i===`copy`?r.onCopyFile?.(n,c):r.onMoveFile?.(n,c))},children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>{let e=!i;a(e),e&&r.tree[c]===void 0&&r.onExpand(c),r.onSelectDirectory?.(c)},style:{paddingLeft:n*12},className:`flex min-w-0 flex-1 items-center gap-1 rounded py-0.5 text-left`,children:[(0,A.jsx)(`span`,{className:`w-3 shrink-0 text-xs text-zinc-400 dark:text-zinc-600`,children:i?`▾`:`▸`}),(0,A.jsx)(`span`,{title:t.name,className:`truncate ${l?`text-zinc-400 dark:text-zinc-600`:`text-zinc-700 dark:text-zinc-300`}`,children:t.name}),!i&&Gz(c,r.gitFiles)>0&&(0,A.jsx)(`span`,{className:`ml-1 shrink-0 rounded bg-amber-100 px-1 font-mono text-[10px] font-bold text-amber-700 dark:bg-amber-950/60 dark:text-amber-400`,title:`${Gz(c,r.gitFiles)} changed file(s) inside`,children:Gz(c,r.gitFiles)})]}),r.onRevealNative&&(0,A.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>r.onRevealNative?.(c),title:`Show in the file manager`,"aria-label":`Show ${t.name} in the file manager`,className:Uz,children:`⌂`}),r.creation&&!l&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>{a(!0),r.tree[c]===void 0&&r.onExpand(c),r.creation?.start(c)},title:`New file or folder here`,"aria-label":`New file or folder in ${t.name}`,className:`mr-1 shrink-0 rounded px-1 font-mono text-xs text-zinc-400 hover:bg-zinc-200 group-hover:opacity-100 focus-visible:opacity-100 dark:text-zinc-600 dark:hover:bg-zinc-700 [@media(hover:hover)]:opacity-0`,children:`+`})]}),i&&(0,A.jsx)(Xz,{path:c,depth:n+1,...r})]})}let f=c===r.openFilePath,p=r.gitFiles?.[c],m=r.attachedPaths?.includes(c)??!1,h=t.type===`file`,g=h||t.type===`symlink-file`,_=h&&!l,v=h&&(l?r.onCopyFile!==void 0:r.onMoveFile!==void 0);return r.rename?.path===c?(0,A.jsx)(Yz,{path:c,name:t.name,depth:n,rename:r.rename}):(0,A.jsxs)(`div`,{className:`group flex w-full items-center rounded hover:bg-zinc-100 dark:hover:bg-zinc-800 ${f?`bg-zinc-100 dark:bg-zinc-800`:``}`,children:[(0,A.jsx)(`button`,{type:`button`,draggable:v&&!u,onDragStart:e=>{!v||u||(e.dataTransfer.effectAllowed=l?`copy`:`move`,e.dataTransfer.setData(Vz,c),l&&e.dataTransfer.setData(Hz,`copy`))},onClick:()=>r.onSelectFile(c),style:{paddingLeft:n*12+16},className:`flex min-w-0 flex-1 items-center py-0.5 text-left`,children:(0,A.jsx)(`span`,{title:t.name,className:`truncate ${l?`text-zinc-400 dark:text-zinc-600`:`text-zinc-600 dark:text-zinc-400`}`,children:t.name})}),g&&r.onOpenNative&&(0,A.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>r.onOpenNative?.(c),title:`Open with the associated application`,"aria-label":`Open ${t.name} with the associated application`,className:Uz,children:`↗`}),r.onRevealNative&&(0,A.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>r.onRevealNative?.(c),title:`Show in the file manager`,"aria-label":`Show ${t.name} in the file manager`,className:Uz,children:`⌂`}),_&&r.onRenameFile&&(0,A.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>r.rename?.start(c),title:`Rename file`,"aria-label":`Rename ${t.name}`,className:Uz,children:`✎`}),_&&r.onDeleteFile&&(0,A.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>{window.confirm(`Delete "${t.name}" permanently?`)&&r.onDeleteFile?.(c)},title:`Delete file`,"aria-label":`Delete ${t.name}`,className:`${Uz} hover:text-red-600 dark:hover:text-red-400`,children:`×`}),r.onToggleAttachPath&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>r.onToggleAttachPath?.(c),title:m?`Remove this file from the prompt`:`Reference this file in the prompt`,"aria-label":`${m?`Remove`:`Reference`} ${t.name} in the prompt`,"aria-pressed":m,className:`mr-1 shrink-0 rounded px-1 font-mono text-xs hover:bg-zinc-200 group-hover:opacity-100 focus-visible:opacity-100 dark:hover:bg-zinc-700 ${m?`font-bold text-blue-600 dark:text-blue-400`:`text-zinc-400 dark:text-zinc-600 [@media(hover:hover)]:opacity-0`}`,children:`@`}),p&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>(r.onSelectDiff??r.onSelectFile)(c),title:`Show uncommitted diff`,"aria-label":`Show diff of ${t.name}`,className:`mr-1 shrink-0 rounded px-1 font-mono text-xs font-bold hover:bg-zinc-200 dark:hover:bg-zinc-700 ${Wz[p].className}`,children:Wz[p].label})]})}function Qz(e){let t=e.trim();if(t===``)return{error:`A name is required`};let n=t.endsWith(`/`),r=n?t.slice(0,-1).trim():t;return r===``?{error:`A name is required`}:r.includes(`/`)||r.includes(`\\`)?{error:`That is a path, not a name`}:r===`.`||r===`..`?{error:`"${r}" is not a name`}:{kind:n?`directory`:`file`,name:r}}function $z(e){let t=Qz(e);return`error`in t?t:t.kind===`directory`?{error:`That is a folder name`}:{name:t.name}}function eB(e){let[t,n]=(0,d.useState)(null),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(null),m=e.onCreateFile!==void 0||e.onCreateDirectory!==void 0,h=e.createError&&a&&e.createError.path===tB(a.dir,a.name)?e.createError.message:null,g=e.created??null;(0,d.useEffect)(()=>{a!==null&&g!==null&&g===tB(a.dir,a.name)&&(n(null),o(null),i(null))},[a,g]);let _=e.fileOperation?.status===`error`&&e.fileOperation.operation===`rename_file`&&f===e.fileOperation.path?e.fileOperation.message:null;(0,d.useEffect)(()=>{let t=e.fileOperation;t?.status===`succeeded`&&t.operation===`rename_file`&&f===t.path&&(c(null),p(null),u(null))},[f,e.fileOperation]);let v=m?{openIn:t,localError:r,serverError:h,start:e=>{n(e),i(null),o(null)},cancel:()=>{n(null),i(null),o(null)},submit:(t,n)=>{let r=Qz(n);if(`error`in r){i(r.error);return}i(null),o({dir:t,name:r.name});let a=tB(t,r.name);r.kind===`directory`?e.onCreateDirectory?.(a):e.onCreateFile?.(a)}}:void 0,y=e.onRenameFile?{path:s,pending:f!==null&&e.fileOperation?.status===`pending`&&e.fileOperation.operation===`rename_file`&&e.fileOperation.path===f,localError:l,serverError:_,start:e=>{c(e),p(null),u(null)},cancel:()=>{c(null),p(null),u(null)},submit:(t,n)=>{if(n.trim()===``){c(null),p(null),u(null);return}let r=$z(n);if(`error`in r){u(r.error);return}u(null),p(t),e.onRenameFile?.(t,r.name)}}:void 0,b=!qz(``,e.writableRoot);return(0,A.jsxs)(`div`,{className:`text-sm`,children:[e.fileOperation?.status===`error`&&e.fileOperation.operation!==`rename_file`&&(0,A.jsx)(`p`,{role:`alert`,className:`mb-1 rounded bg-red-50 px-2 py-1 text-xs text-red-700 dark:bg-red-950/40 dark:text-red-300`,children:e.fileOperation.message}),(v&&b||e.onRefresh)&&(0,A.jsxs)(`div`,{className:`mb-1 flex items-center`,children:[v&&b&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>v.start(``),"aria-label":`New file or folder in the workspace root`,className:`rounded px-1 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-600 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-400`,children:`+ new`}),e.onRefresh&&(0,A.jsx)(`button`,{type:`button`,onClick:e.onRefresh,title:`Refresh the file tree`,"aria-label":`Refresh the file tree`,className:`ml-auto rounded px-1 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-600 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-400`,children:`↻`})]}),(0,A.jsx)(Xz,{path:``,depth:0,...e,...v?{creation:v}:{},...y?{rename:y}:{}})]})}function tB(e,t){return e===``?t:`${e}/${t}`}function nB({tree:e,openFile:t,writableRoot:n,gitFiles:r,attachedPaths:i,onExpand:a,onSelectDirectory:o,onRefresh:s,onSelectFile:c,onSelectDiff:l,onToggleAttachPath:u,onCreateFile:f,onCreateDirectory:p,onOpenNative:m,onRevealNative:h,onRenameFile:g,onDeleteFile:_,onMoveFile:v,onCopyFile:y,fileOperation:b,createError:x,created:S}){let C=yR(pR);return(0,d.useEffect)(()=>{e[``]===void 0&&a(``)},[]),(0,A.jsxs)(`aside`,{"aria-label":`Files`,style:{width:C.width},className:`relative flex shrink-0 flex-col border-r border-zinc-200 dark:border-zinc-800`,children:[(0,A.jsx)(`div`,{className:`border-b border-zinc-200 px-3 py-2 text-xs font-semibold uppercase text-zinc-400 dark:border-zinc-800 dark:text-zinc-600`,children:`Files`}),(0,A.jsx)(`div`,{className:`flex-1 overflow-auto p-2`,children:(0,A.jsx)(eB,{tree:e,openFilePath:t?.path,writableRoot:n,gitFiles:r,attachedPaths:i,onExpand:a,onSelectDirectory:o,onRefresh:s,onSelectFile:c,onSelectDiff:l,onToggleAttachPath:u,onCreateFile:f,onCreateDirectory:p,onOpenNative:m,onRevealNative:h,onRenameFile:g,onDeleteFile:_,onMoveFile:v,onCopyFile:y,fileOperation:b,createError:x,created:S})}),(0,A.jsx)(bR,{label:`Resize Files sidebar`,width:C.width,config:pR,separatorProps:C.separatorProps})]})}function rB({title:e,onSubmit:t}){let[n,r]=(0,d.useState)(``);return(0,A.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,A.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),n.trim()&&t(n.trim())},className:`w-full max-w-sm rounded-xl border border-zinc-200 p-6 shadow-sm dark:border-zinc-800`,children:[(0,A.jsx)(`div`,{className:`mb-1 text-center text-3xl`,children:e??`π`}),(0,A.jsx)(`h1`,{className:`mb-4 text-center text-sm text-zinc-500 dark:text-zinc-400`,children:`This server requires an access token.`}),(0,A.jsx)(`label`,{htmlFor:`pi-outpost-token`,className:`mb-1 block text-xs font-medium text-zinc-600 dark:text-zinc-400`,children:`Access token`}),(0,A.jsx)(`input`,{id:`pi-outpost-token`,name:`token`,type:`password`,autoComplete:`off`,spellCheck:!1,value:n,onChange:e=>r(e.target.value),placeholder:`paste the token…`,className:`mb-3 w-full rounded-md border border-zinc-300 bg-white px-2 py-1.5 font-mono text-sm outline-none focus:border-zinc-500 dark:border-zinc-700 dark:bg-zinc-950 dark:focus:border-zinc-500`}),(0,A.jsx)(`button`,{type:`submit`,disabled:!n.trim(),className:`w-full rounded-md border border-emerald-300 px-2 py-1.5 text-sm text-emerald-700 hover:border-emerald-500 disabled:opacity-50 dark:border-emerald-900 dark:text-emerald-400 dark:hover:border-emerald-600`,children:`Connect`}),(0,A.jsxs)(`p`,{className:`mt-3 text-center text-xs text-zinc-400 dark:text-zinc-600`,children:[`Ask the operator for the token, or open the link containing `,(0,A.jsx)(`code`,{children:`?token=…`})]})]})})}var iB={todo:{icon:`○`,label:`To do`,className:`text-zinc-500`},in_progress:{icon:`●`,label:`In progress`,className:`text-blue-600 dark:text-blue-400`},done:{icon:`✓`,label:`Done`,className:`text-emerald-600 dark:text-emerald-400`},blocked:{icon:`!`,label:`Blocked`,className:`text-red-600 dark:text-red-400`},needs_review:{icon:`?`,label:`Needs review`,className:`text-amber-600 dark:text-amber-400`}},aB=8;function oB(e){let t=e.uri.startsWith(`workspace:`)?e.uri.slice(10):/^[a-z][a-z0-9+.-]*:/i.test(e.uri)?null:e.uri;return t===null||t===``||/^(?:[\\/]|[a-z]:[\\/])/i.test(t)||t.replaceAll(`\\`,`/`).split(`/`).includes(`..`)?null:t}function sB({plan:e,open:t,onToggle:n,onOpenWorkspace:r,requestedTaskId:i,onTaskRequestHandled:a}){let o=(0,d.useId)(),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(null);(0,d.useEffect)(()=>{i&&(e.tasks.some(e=>e.id===i)?(u(i),p(null)):(u(null),p(i)),a?.())},[e.tasks,i,a]),(0,d.useEffect)(()=>{l!==null&&!e.tasks.some(e=>e.id===l)&&u(null)},[e,l]),(0,d.useEffect)(()=>{if(!s)return;let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]);let m=(0,d.useMemo)(()=>{let t=new Map;for(let n of e.tasks)t.set(n.parentId,[...t.get(n.parentId)??[],n]);return t},[e.tasks]),h=(0,d.useMemo)(()=>new Map(e.tasks.map(e=>[e.id,e])),[e.tasks]),g=(0,d.useMemo)(()=>{let e=[],t=(n,r)=>{for(let i of m.get(n)??[])e.push({task:i,depth:r}),t(i.id,r+1)};return t(void 0,0),e.slice(0,aB)},[m]),_=l?h.get(l):void 0,v=e.tasks.filter(e=>e.status===`done`).length,y=(e,t=0)=>(m.get(e)??[]).flatMap(e=>{let n=iB[e.status];return[(0,A.jsxs)(`button`,{type:`button`,role:`treeitem`,"aria-level":t+1,"aria-selected":l===e.id,onClick:()=>u(e.id),"aria-current":e.status===`in_progress`?`step`:void 0,className:`flex w-full items-start gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-zinc-100 dark:hover:bg-zinc-800 ${l===e.id?`bg-zinc-100 dark:bg-zinc-800`:``}`,style:{paddingLeft:`${.5+t*.85}rem`},children:[(0,A.jsx)(`span`,{className:`mt-px w-4 shrink-0 text-center font-semibold ${n.className}`,"aria-label":n.label,children:n.icon}),(0,A.jsx)(`span`,{className:e.status===`done`?`text-zinc-500 line-through`:`text-zinc-800 dark:text-zinc-200`,children:e.title})]},e.id),...y(e.id,t+1)]});return t?(0,A.jsxs)(`aside`,{"aria-label":`Work Plan`,className:`absolute inset-y-0 right-0 z-10 flex w-full flex-col border-l border-zinc-200 bg-white/95 shadow-lg backdrop-blur md:w-[23rem] dark:border-zinc-800 dark:bg-zinc-950/95`,children:[(0,A.jsxs)(`header`,{className:`border-b border-zinc-200 px-3 py-3 dark:border-zinc-800`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-zinc-500`,children:`Work Plan`}),(0,A.jsx)(`h2`,{className:`truncate text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:e.title})]}),(0,A.jsx)(`button`,{type:`button`,onClick:n,className:`rounded px-2 py-1 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,"aria-label":`Close Work Plan`,children:`×`})]}),(0,A.jsxs)(`div`,{className:`mt-2 text-xs text-zinc-500`,children:[`Progress: `,v,` / `,e.tasks.length]}),(0,A.jsx)(`div`,{className:`mt-1 h-1.5 overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-800`,"aria-hidden":!0,children:(0,A.jsx)(`div`,{className:`h-full bg-emerald-500`,style:{width:`${e.tasks.length===0?0:v/e.tasks.length*100}%`}})})]}),(0,A.jsx)(`div`,{role:`tree`,"aria-label":`Work Plan tasks`,className:`min-h-0 flex-1 overflow-y-auto p-2`,children:y(void 0)}),f&&(0,A.jsx)(`div`,{role:`status`,className:`border-t border-amber-200 bg-amber-50 p-3 text-xs text-amber-800 dark:border-amber-900 dark:bg-amber-950/30 dark:text-amber-300`,children:`That Outcome task no longer exists in the current Work Plan.`}),_&&(0,A.jsxs)(`section`,{"aria-label":`Task details`,className:`max-h-[45%] overflow-y-auto border-t border-zinc-200 p-3 text-xs dark:border-zinc-800`,children:[(0,A.jsx)(`div`,{className:`font-semibold ${iB[_.status].className}`,children:iB[_.status].label}),(0,A.jsx)(`h3`,{className:`mt-1 text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:_.title}),_.description&&(0,A.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-zinc-600 dark:text-zinc-300`,children:_.description}),_.statusReason&&(0,A.jsx)(`p`,{className:`mt-2 rounded bg-zinc-100 p-2 text-zinc-700 dark:bg-zinc-900 dark:text-zinc-300`,children:_.statusReason}),_.dependsOn.length>0&&(0,A.jsxs)(`div`,{className:`mt-3`,children:[(0,A.jsx)(`span`,{className:`font-semibold`,children:`Depends on:`}),` `,_.dependsOn.map(e=>h.get(e)?.title??e).join(`, `)]}),_.resources.length>0&&(0,A.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[(0,A.jsx)(`div`,{className:`font-semibold`,children:`Resources`}),_.resources.map(e=>{let t=oB(e),n=e.label??e.uri;return t===null?/^https?:/i.test(e.uri)?(0,A.jsx)(`a`,{href:e.uri,target:`_blank`,rel:`noreferrer`,className:`block truncate text-blue-600 hover:underline dark:text-blue-400`,children:n},e.uri):(0,A.jsx)(`span`,{className:`block truncate text-zinc-500`,title:`No navigator is available for this resource`,children:n},e.uri):(0,A.jsx)(`button`,{type:`button`,className:`block max-w-full truncate text-left text-blue-600 hover:underline dark:text-blue-400`,onClick:()=>r(t),children:n},e.uri)})]})]})]}):(0,A.jsxs)(`div`,{className:`absolute right-3 top-3 z-20`,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocusCapture:()=>c(!0),onBlurCapture:()=>c(!1),children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>{c(!1),n()},className:`rounded-md border border-zinc-300 bg-white px-2 py-1 text-xs shadow-sm dark:border-zinc-700 dark:bg-zinc-900`,"aria-label":`Open Work Plan`,"aria-describedby":o,children:[`Plan `,v,`/`,e.tasks.length]}),(0,A.jsx)(`div`,{id:o,role:`tooltip`,className:`absolute right-0 top-full w-72 pt-2 ${s?`block`:`hidden`}`,children:(0,A.jsxs)(`div`,{className:`rounded-md border border-zinc-200 bg-white p-2 shadow-lg dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,A.jsx)(`ul`,{className:`space-y-1`,children:g.map(({task:e,depth:t})=>(0,A.jsxs)(`li`,{className:`flex min-w-0 items-start gap-1.5 text-xs`,style:{paddingLeft:`${t*.75}rem`},children:[(0,A.jsx)(`span`,{"aria-label":iB[e.status].label,className:`shrink-0 font-semibold ${iB[e.status].className}`,children:e.status===`done`?`☑`:`☐`}),(0,A.jsx)(`span`,{className:`truncate ${e.status===`done`?`text-zinc-500 line-through`:`text-zinc-800 dark:text-zinc-200`}`,children:e.title})]},e.id))}),e.tasks.length>g.length&&(0,A.jsxs)(`div`,{className:`mt-1 text-[11px] text-zinc-500`,children:[`+`,e.tasks.length-g.length,` more`]})]})})]})}var cB=Object.defineProperty,lB=Object.getOwnPropertyDescriptor,uB=(e,t)=>{for(var n in t)cB(e,n,{get:t[n],enumerable:!0})},dB=(e,t,n,r)=>{for(var i=r>1?void 0:r?lB(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&cB(t,n,i),i},fB=(e,t)=>(n,r)=>t(n,r,e),pB=`Terminal input`,mB={get:()=>pB,set:e=>pB=e},hB=`Too much output to announce, navigate to rows manually to read`,gB={get:()=>hB,set:e=>hB=e};function _B(e){return e.replace(/\r?\n/g,`\r`)}function vB(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function yB(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function bB(e,t,n,r){e.stopPropagation(),e.clipboardData&&xB(e.clipboardData.getData(`text/plain`),t,n,r)}function xB(e,t,n,r){e=_B(e),e=vB(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function SB(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function CB(e,t,n,r,i){SB(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function wB(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function TB(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var EB=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},DB=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},OB=``,kB=` `,AB=class e{constructor(){this.fg=0,this.bg=0,this.extended=new jB}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},jB=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},MB=class e extends AB{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new jB,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?wB(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},NB=`di$target`,PB=`di$dependencies`,FB=new Map;function IB(e){return e[PB]||[]}function LB(e){if(FB.has(e))return FB.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);RB(t,e,r)};return t._id=e,FB.set(e,t),t}function RB(e,t,n){t[NB]===t?t[PB].push({id:e,index:n}):(t[PB]=[{id:e,index:n}],t[NB]=t)}var zB=LB(`BufferService`),BB=LB(`CoreMouseService`),VB=LB(`CoreService`),HB=LB(`CharsetService`),UB=LB(`InstantiationService`),WB=LB(`LogService`),GB=LB(`OptionsService`),KB=LB(`OscLinkService`),qB=LB(`UnicodeService`),JB=LB(`DecorationService`),YB=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new MB,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):XB(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};YB=dB([fB(0,zB),fB(1,GB),fB(2,KB)],YB);function XB(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
335
|
+
|
|
336
|
+
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var ZB=LB(`CharSizeService`),QB=LB(`CoreBrowserService`),$B=LB(`MouseService`),eV=LB(`RenderService`),tV=LB(`SelectionService`),nV=LB(`CharacterJoinerService`),rV=LB(`ThemeService`),iV=LB(`LinkProviderService`),aV=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?dV.isErrorNoTelemetry(e)?new dV(e.message+`
|
|
337
|
+
|
|
338
|
+
`+e.stack):Error(e.message+`
|
|
339
|
+
|
|
340
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function oV(e){cV(e)||aV.onUnexpectedError(e)}var sV=`Canceled`;function cV(e){return e instanceof lV||e instanceof Error&&e.name===sV&&e.message===sV}var lV=class extends Error{constructor(){super(sV),this.name=this.message}};function uV(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var dV=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},fV=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function pV(e,t=0){return e[e.length-(1+t)]}var mV;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(mV||={});var hV=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||mV.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};hV.empty=new hV(e=>{});function gV(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var _V;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(_V||={});var vV=null;function yV(e){return vV?.trackDisposable(e),e}function bV(e){vV?.markAsDisposed(e)}function xV(e,t){vV?.setParent(e,t)}function SV(e){return vV?.markAsSingleton(e),e}function CV(e){if(_V.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function wV(...e){return TV(()=>CV(e))}function TV(e){let t=yV({dispose:gV(()=>{bV(t),e()})});return t}var EV=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,yV(this)}dispose(){this._isDisposed||(bV(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{CV(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return xV(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),xV(e,null))}};EV.DISABLE_DISPOSED_WARNING=!1;var DV=EV,OV=class{constructor(){this._store=new DV,yV(this),xV(this._store,this)}dispose(){bV(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};OV.None=Object.freeze({dispose(){}});var kV=class{constructor(){this._isDisposed=!1,yV(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&xV(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,bV(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&xV(e,null),e}},AV=typeof window==`object`?window:globalThis,jV=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};jV.Undefined=new jV(void 0);var MV=jV,NV=class{constructor(){this._first=MV.Undefined,this._last=MV.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===MV.Undefined}clear(){let e=this._first;for(;e!==MV.Undefined;){let t=e.next;e.prev=MV.Undefined,e.next=MV.Undefined,e=t}this._first=MV.Undefined,this._last=MV.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new MV(e);if(this._first===MV.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==MV.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==MV.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==MV.Undefined&&e.next!==MV.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===MV.Undefined&&e.next===MV.Undefined?(this._first=MV.Undefined,this._last=MV.Undefined):e.next===MV.Undefined?(this._last=this._last.prev,this._last.next=MV.Undefined):e.prev===MV.Undefined&&(this._first=this._first.next,this._first.prev=MV.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==MV.Undefined;)yield e.element,e=e.next}},PV=globalThis.performance&&typeof globalThis.performance.now==`function`,FV=class e{static create(t){return new e(t)}constructor(e){this._now=PV&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},IV;(e=>{e.None=()=>OV.None;function t(e,t){return d(e,()=>{},0,void 0,!0,void 0,t)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(e,t,n){return l((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=r;function i(e,t,n){return l((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=i;function a(e,t,n){return l((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=a;function o(e){return e}e.signal=o;function s(...e){return(t,n=null,r)=>u(wV(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=s;function c(e,t,n,i){let a=n;return r(e,e=>(a=t(a,e),a),i)}e.reduce=c;function l(e,t){let n,r=new JV({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function u(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function d(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new JV({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=0,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=d;function f(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=f;function p(e,t=(e,t)=>e===t,n){let r=!0,i;return a(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=p;function m(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=m;function h(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new JV({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=h;function g(e,t){return(n,r,i)=>{let a=t(new v);return e(function(e){let t=a.evaluate(e);t!==_&&n.call(r,t)},void 0,i)}}e.chain=g;let _=Symbol(`HaltChainable`);class v{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:_),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:_}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===_)break;return e}}function y(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new JV({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=y;function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new JV({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=b;function x(e){return new Promise(t=>n(e)(t))}e.toPromise=x;function S(e){let t=new JV;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=S;function C(e,t){return e(e=>t.fire(e))}e.forward=C;function w(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=w;class T{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;let n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new JV(n),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ee(e,t){return new T(e,t).emitter.event}e.fromObservable=ee;function te(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof DV?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=te})(IV||={});var LV=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new FV,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};LV.all=new Set,LV._idPool=0;var RV=LV,zV=-1,BV=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(i),console.warn(e);let a=new UV(i,e);this._errorHandler(a)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}};BV._idPool=1;var VV=BV,HV=class e{constructor(e){this.value=e}static create(){return new e(Error().stack??``)}print(){console.warn(this.value.split(`
|
|
341
|
+
`).slice(2).join(`
|
|
342
|
+
`))}},UV=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},WV=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},GV=0,KV=class{constructor(e){this.value=e,this.id=GV++}},qV=2,JV=class{constructor(e){this._size=0,this._options=e,this._leakageMon=zV>0||this._options?.leakWarningThreshold?new VV(e?.onListenerError??oV,this._options?.leakWarningThreshold??zV):void 0,this._perfMon=this._options?._profName?new RV(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new WV(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||oV)(n),OV.None}if(this._disposed)return OV.None;t&&(e=e.bind(t));let r=new KV(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=HV.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof KV?(this._deliveryQueue??=new YV,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=TV(()=>{i?.(),this._removeListener(r)});return n instanceof DV?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*qV<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||oV;if(!n){e.value(t);return}try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof KV)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},YV=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},XV=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new JV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new JV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};XV.INSTANCE=new XV;var ZV=XV;function QV(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}ZV.INSTANCE.onDidChangeZoomLevel;function $V(e){return ZV.INSTANCE.getZoomFactor(e)}ZV.INSTANCE.onDidChangeFullscreen;var eH=typeof navigator==`object`?navigator.userAgent:``,tH=eH.indexOf(`Firefox`)>=0,nH=eH.indexOf(`AppleWebKit`)>=0,rH=eH.indexOf(`Chrome`)>=0,iH=!rH&&eH.indexOf(`Safari`)>=0;eH.indexOf(`Electron/`),eH.indexOf(`Android`);var aH=!1;if(typeof AV.matchMedia==`function`){let e=AV.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=AV.matchMedia(`(display-mode: fullscreen)`);aH=e.matches,QV(AV,e,({matches:e})=>{aH&&t.matches||(aH=e)})}function oH(){return aH}var sH=`en`,cH=!1,lH=!1,uH=!1,dH=!1,fH=!1,pH=sH,mH,hH=globalThis,gH;typeof hH.vscode<`u`&&typeof hH.vscode.process<`u`?gH=hH.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(gH=process);var _H=typeof gH?.versions?.electron==`string`&&gH?.type===`renderer`;if(typeof gH==`object`){cH=gH.platform===`win32`,lH=gH.platform===`darwin`,uH=gH.platform===`linux`,uH&&gH.env.SNAP&&gH.env.SNAP_REVISION,gH.env.CI||gH.env.BUILD_ARTIFACTSTAGINGDIRECTORY,pH=sH;let e=gH.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,pH=t.resolvedLanguage||sH,t.languagePack?.translationsConfigFile}catch{}dH=!0}else typeof navigator==`object`&&!_H?(mH=navigator.userAgent,cH=mH.indexOf(`Windows`)>=0,lH=mH.indexOf(`Macintosh`)>=0,(mH.indexOf(`Macintosh`)>=0||mH.indexOf(`iPad`)>=0||mH.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,uH=mH.indexOf(`Linux`)>=0,mH?.indexOf(`Mobi`),fH=!0,pH=globalThis._VSCODE_NLS_LANGUAGE||sH,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var vH=cH,yH=lH,bH=uH,xH=dH;fH&&typeof hH.importScripts==`function`&&hH.origin;var SH=mH,CH=pH,wH;(e=>{function t(){return CH}e.value=t;function n(){return CH.length===2?CH===`en`:CH.length>=3&&CH[0]===`e`&&CH[1]===`n`&&CH[2]===`-`}e.isDefaultVariant=n;function r(){return CH===`en`}e.isDefault=r})(wH||={});var TH=typeof hH.postMessage==`function`&&!hH.importScripts;(()=>{if(TH){let e=[];hH.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),hH.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var EH=!!(SH&&SH.indexOf(`Chrome`)>=0);SH&&SH.indexOf(`Firefox`),!EH&&SH&&SH.indexOf(`Safari`),SH&&SH.indexOf(`Edg/`),SH&&SH.indexOf(`Android`);var DH=typeof navigator==`object`?navigator:{};xH||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||DH&&DH.clipboard&&DH.clipboard.writeText,xH||DH&&DH.clipboard&&DH.clipboard.readText,xH||oH()||DH.keyboard,`ontouchstart`in AV||DH.maxTouchPoints,AV.PointerEvent&&(`ontouchstart`in AV||navigator.maxTouchPoints);var OH=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},kH=new OH,AH=new OH,jH=new OH,MH=Array(230),NH;(e=>{function t(e){return kH.keyCodeToStr(e)}e.toString=t;function n(e){return kH.strToKeyCode(e)}e.fromString=n;function r(e){return AH.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return jH.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return AH.strToKeyCode(e)||jH.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return kH.keyCodeToStr(e)}e.toElectronAccelerator=o})(NH||={});var PH=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new FH([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},FH=class{constructor(e){if(e.length===0)throw uV(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=`;`),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function IH(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return NH.fromString(t)}let t=e.keyCode;if(t===3)return 7;if(tH)switch(t){case 59:return 85;case 60:if(bH)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(yH)return 57;break}else if(nH&&(yH&&t===93||!yH&&t===92))return 57;return MH[t]||0}var LH=yH?256:2048,RH=512,zH=1024,BH=yH?2048:256,VH=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.(`AltGraph`),this.keyCode=IH(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=LH),this.altKey&&(t|=RH),this.shiftKey&&(t|=zH),this.metaKey&&(t|=BH),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new PH(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},HH=new WeakMap;function UH(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!==`null`&&n.origin!==`null`&&t.origin!==n.origin)return null}catch{return null}return e.parent}var WH=class{static getSameOriginWindowChain(e){let t=HH.get(e);if(!t){t=[],HH.set(e,t);let n=e,r;do r=UH(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(e);for(let e of i){let i=e.window.deref();if(n+=i?.scrollY??0,r+=i?.scrollX??0,i===t||!e.iframeElement)break;let a=e.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},GH=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type===`dblclick`&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX==`number`?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=WH.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},KH=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(rH){let e=navigator.userAgent.match(/Chrome\/(\d+)/);r=(e?parseInt(e[1]):123)<=122}if(e){let t=e,n=e,i=e.view?.devicePixelRatio||1;if(typeof t.wheelDeltaY<`u`)this.deltaY=r?t.wheelDeltaY/(120*i):t.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<`u`&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type===`wheel`){let t=e;this.deltaY=t.deltaMode===t.DOM_DELTA_LINE?tH&&!yH?-e.deltaY/3:-e.deltaY:-e.deltaY/40}if(typeof t.wheelDeltaX<`u`)this.deltaX=iH&&vH?-(t.wheelDeltaX/120):r?t.wheelDeltaX/(120*i):t.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<`u`&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type===`wheel`){let t=e;this.deltaX=t.deltaMode===t.DOM_DELTA_LINE?tH&&!yH?-e.deltaX/3:-e.deltaX:-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=r?e.wheelDelta/(120*i):e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},qH=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),JH;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof YH?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:IV.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:qH})})(JH||={});var YH=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?qH:(this._emitter||=new JV,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},XH=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new fV(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new fV(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},ZH=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new fV(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=TV(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var QH;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(QH||={});var $H=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new JV,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await IV.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};$H.EMPTY=$H.fromArray([]);function eU(e){return tU(e,0)}function tU(e,t){switch(typeof e){case`object`:return e===null?nU(349,t):Array.isArray(e)?aU(e,t):oU(e,t);case`string`:return iU(e,t);case`boolean`:return rU(e,t);case`number`:return nU(e,t);case`undefined`:return nU(937,t);default:return nU(617,t)}}function nU(e,t){return(t<<5)-t+e|0}function rU(e,t){return nU(e?433:863,t)}function iU(e,t){t=nU(149417,t);for(let n=0,r=e.length;n<r;n++)t=nU(e.charCodeAt(n),t);return t}function aU(e,t){return t=nU(104579,t),e.reduce((e,t)=>tU(t,e),t)}function oU(e,t){return t=nU(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=iU(n,t),tU(e[n],t)),t)}var{registerWindow:sU,getWindow:cU,getDocument:lU,getWindows:uU,getWindowsCount:dU,getWindowId:fU,getWindowById:pU,hasWindow:mU,onDidRegisterWindow:hU,onWillUnregisterWindow:gU,onDidUnregisterWindow:_U}=function(){let e=new Map,t={window:AV,disposables:new DV};e.set(AV.vscodeWindowId,t);let n=new JV,r=new JV,i=new JV;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return OV.None;let a=new DV,o={window:t,disposables:a.add(new DV)};return e.set(t.vscodeWindowId,o),a.add(TV(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(yU(t,OU.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:AV},getDocument(e){return cU(e).document}}}(),vU=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function yU(e,t,n,r){return new vU(e,t,n,r)}function bU(e,t){return function(n){return t(new GH(e,n))}}function xU(e){return function(t){return e(new VH(t))}}var SU=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=bU(cU(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=xU(n)),yU(e,t,i,r)},CU,wU=class extends ZH{constructor(e){super(),this.defaultTarget=e&&cU(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},TU=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){oV(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(TU.sort),a.shift().execute();r.set(i,!1)};CU=(t,r,a=0)=>{let o=fU(t),s=new TU(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s}})();var EU=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};EU.None=new EU(0,0);function DU(e){let t=e.getBoundingClientRect(),n=cU(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=eU(n),a=r.get(i);if(a)a.users+=1;else{let o=new JV,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(TV(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var OU={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:nH?`webkitAnimationStart`:`animationstart`,ANIMATION_END:nH?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:nH?`webkitAnimationIteration`:`animationiteration`},kU=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingTop=``,this._paddingLeft=``,this._paddingBottom=``,this._paddingRight=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=AU(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=AU(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=AU(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=AU(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=AU(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=AU(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=AU(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=AU(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=AU(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=AU(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=AU(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=AU(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=AU(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=AU(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function AU(e){return typeof e==`number`?`${e}px`:e}function jU(e){return new kU(e)}var MU=class{constructor(){this._hooks=new DV,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(TV(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=cU(e)}this._hooks.add(yU(a,OU.POINTER_MOVE,e=>{if(e.buttons!==n){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(yU(a,OU.POINTER_UP,e=>this.stopMonitoring(!0)))}};function NU(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var PU;(e=>(e.Tap=`-xterm-gesturetap`,e.Change=`-xterm-gesturechange`,e.Start=`-xterm-gesturestart`,e.End=`-xterm-gesturesend`,e.Contextmenu=`-xterm-gesturecontextmenu`))(PU||={});var FU=class e extends OV{constructor(){super(),this.dispatched=!1,this.targets=new NV,this.ignoreTargets=new NV,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(IV.runAndSubscribe(hU,({window:e,disposables:t})=>{t.add(yU(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(yU(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(yU(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:AV,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=SV(new e),TV(e.INSTANCE.targets.push(t))):OV.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=SV(new e),TV(e.INSTANCE.ignoreTargets.push(t))):OV.None}static isTouchDevice(){return`ontouchstart`in AV||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this.newGestureEvent(PU.Start,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this.dispatchEvent(i)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this.activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e.HOLD_DELAY&&Math.abs(s.initialPageX-pV(s.rollingPageX))<30&&Math.abs(s.initialPageY-pV(s.rollingPageY))<30){let e=this.newGestureEvent(PU.Tap,s.initialTarget);e.pageX=pV(s.rollingPageX),e.pageY=pV(s.rollingPageY),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&Math.abs(s.initialPageX-pV(s.rollingPageX))<30&&Math.abs(s.initialPageY-pV(s.rollingPageY))<30){let e=this.newGestureEvent(PU.Contextmenu,s.initialTarget);e.pageX=pV(s.rollingPageX),e.pageY=pV(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=pV(s.rollingPageX),n=pV(s.rollingPageY),i=pV(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(PU.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===PU.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===PU.Change||t.type===PU.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=CU(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(PU.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this.activeTouches[r.identifier],a=this.newGestureEvent(PU.Change,i.initialTarget);a.translationX=r.pageX-pV(i.rollingPageX),a.translationY=r.pageY-pV(i.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};FU.SCROLL_FRICTION=-.005,FU.HOLD_DELAY=700,FU.CLEAR_TAP_COUNT_TIME=400,dB([NU],FU,`isTouchDevice`,1);var IU=FU,LU=class extends OV{onclick(e,t){this._register(yU(e,OU.CLICK,n=>t(new GH(cU(e),n))))}onmousedown(e,t){this._register(yU(e,OU.MOUSE_DOWN,n=>t(new GH(cU(e),n))))}onmouseover(e,t){this._register(yU(e,OU.MOUSE_OVER,n=>t(new GH(cU(e),n))))}onmouseleave(e,t){this._register(yU(e,OU.MOUSE_LEAVE,n=>t(new GH(cU(e),n))))}onkeydown(e,t){this._register(yU(e,OU.KEY_DOWN,e=>t(new VH(e))))}onkeyup(e,t){this._register(yU(e,OU.KEY_UP,e=>t(new VH(e))))}oninput(e,t){this._register(yU(e,OU.INPUT,t))}onblur(e,t){this._register(yU(e,OU.BLUR,t))}onfocus(e,t){this._register(yU(e,OU.FOCUS,t))}onchange(e,t){this._register(yU(e,OU.CHANGE,t))}ignoreGesture(e){return IU.ignoreTarget(e)}},RU=11,zU=class extends LU{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`,this.domNode.style.width=RU+`px`,this.domNode.style.height=RU+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new MU),this._register(SU(this.bgDomNode,OU.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(SU(this.domNode,OU.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new wU),this._pointerdownScheduleRepeatTimer=this._register(new XH)}_arrowPointerDown(e){!e.target||!(e.target instanceof Element)||(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,cU(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},BU=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},VU=class extends OV{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new JV),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new BU(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new GU(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=GU.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},HU=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function UU(e,t){let n=t-e;return function(t){return e+n*qU(t)}}function WU(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var GU=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),WU(UU(e,r),UU(i,t),.33)}return UU(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new HU(this.scrollLeft(t),this.scrollTop(t),!1):new HU(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return e.start(t,n,r)}static start(t,n,r){r+=10;let i=Date.now()-10;return new e(t,n,i,r)}};function KU(e){return e**3}function qU(e){return 1-KU(1-e)}var JU=class extends OV{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new XH)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3||this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},YU=140,XU=class extends LU{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new JU(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new MU),this._shouldRender=!0,this.domNode=jU(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(yU(this.domNode.domNode,OU.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new zU(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=jU(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(yU(this.slider.domNode,OU.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=DU(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(vH&&a>YU){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},ZU=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},QU=class extends XU{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ZU(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},$U=class extends XU{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ZU(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`vertical`,scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},eW=500,tW=50,nW=!0,rW=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},iW=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;do{let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(rH){let t=$V(cU(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new rW(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};iW.INSTANCE=new iW;var aW=iW,oW=class extends LU{constructor(e,t,n){super(),this._onScroll=this._register(new JV),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new JV),this.onWillScroll=this._onWillScroll.event,this._options=cW(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new $U(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new QU(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=jU(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=jU(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=jU(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new XH),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=CV(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,yH&&(this._options.className+=` mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new KH(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=CV(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(yU(this._listenOnDomNode,OU.MOUSE_WHEEL,e=>{this._onMouseWheel(new KH(e))},{passive:!1}))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=aW.INSTANCE;nW&&t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!yH&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=tW*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=tW*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(nW&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),eW)}},sW=class extends oW{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function cW(e){let t={lazyRender:typeof e.lazyRender<`u`&&e.lazyRender,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`&&e.alwaysConsumeMouseWheel,scrollYToX:typeof e.scrollYToX<`u`&&e.scrollYToX,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<`u`?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`&&e.horizontalHasArrows,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`&&e.verticalHasArrows,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`&&e.scrollByPage};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,yH&&(t.className+=` mac`),t}var lW=class extends OV{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new JV),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new VU({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>CU(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new sW(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`overviewRuler`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(IV.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(TV(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(TV(()=>this._styleElement.remove())),this._register(IV.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .scrollbar > .slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider.active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(`
|
|
343
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};lW=dB([fB(2,zB),fB(3,QB),fB(4,BB),fB(5,rV),fB(6,GB),fB(7,eV)],lW);var uW=class extends OV{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(TV(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:``:t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};uW=dB([fB(1,zB),fB(2,QB),fB(3,JB),fB(4,eV)],uW);var dW=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},fW={full:0,left:0,center:0,right:0},pW={full:0,left:0,center:0,right:0},mW={full:0,left:0,center:0,right:0},hW=class extends OV{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new dW,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(TV(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`overviewRuler`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);pW.full=this._canvas.width,pW.left=e,pW.center=t,pW.right=e,this._refreshDrawHeightConstants(),mW.full=1,mW.left=1,mW.center=1+pW.left,mW.right=1+pW.left+pW.center}_refreshDrawHeightConstants(){fW.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);fW.left=t,fW.center=t,fW.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*fW.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*fW.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*fW.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*fW.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(mW[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-fW[e.position||`full`]/2),pW[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+fW[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};hW=dB([fB(2,zB),fB(3,JB),fB(4,eV),fB(5,GB),fB(6,rV),fB(7,QB)],hW);var $;(e=>(e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
|
|
344
|
+
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))($||={});var gW;(e=>(e.PAD=``,e.HOP=``,e.BPH=``,e.NBH=``,e.IND=``,e.NEL=`
`,e.SSA=``,e.ESA=``,e.HTS=``,e.HTJ=``,e.VTS=``,e.PLD=``,e.PLU=``,e.RI=``,e.SS2=``,e.SS3=``,e.DCS=``,e.PU1=``,e.PU2=``,e.STS=``,e.CCH=``,e.MW=``,e.SPA=``,e.EPA=``,e.SOS=``,e.SGCI=``,e.SCI=``,e.CSI=``,e.ST=``,e.OSC=``,e.PM=``,e.APC=``))(gW||={});var _W;(e=>e.ST=`${$.ESC}\\`)(_W||={});var vW=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${$.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};vW=dB([fB(2,zB),fB(3,GB),fB(4,VB),fB(5,eV)],vW);var yW=0,bW=0,xW=0,SW=0,CW={css:`#00000000`,rgba:0},wW;(e=>{function t(e,t,n,r){return r===void 0?`#${kW(e)}${kW(t)}${kW(n)}`:`#${kW(e)}${kW(t)}${kW(n)}${kW(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(wW||={});var TW;(e=>{function t(e,t){if(SW=(t.rgba&255)/255,SW===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return yW=a+Math.round((n-a)*SW),bW=o+Math.round((r-o)*SW),xW=s+Math.round((i-s)*SW),{css:wW.toCss(yW,bW,xW),rgba:wW.toRgba(yW,bW,xW)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=OW.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return wW.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[yW,bW,xW]=OW.toChannels(t),{css:wW.toCss(yW,bW,xW),rgba:t}}e.opaque=i;function a(e,t){return SW=Math.round(t*255),[yW,bW,xW]=OW.toChannels(e.rgba),{css:wW.toCss(yW,bW,xW,SW),rgba:wW.toRgba(yW,bW,xW,SW)}}e.opacity=a;function o(e,t){return SW=e.rgba&255,a(e,SW*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(TW||={});var EW;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return yW=parseInt(e.slice(1,2).repeat(2),16),bW=parseInt(e.slice(2,3).repeat(2),16),xW=parseInt(e.slice(3,4).repeat(2),16),wW.toColor(yW,bW,xW);case 5:return yW=parseInt(e.slice(1,2).repeat(2),16),bW=parseInt(e.slice(2,3).repeat(2),16),xW=parseInt(e.slice(3,4).repeat(2),16),SW=parseInt(e.slice(4,5).repeat(2),16),wW.toColor(yW,bW,xW,SW);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return yW=parseInt(r[1]),bW=parseInt(r[2]),xW=parseInt(r[3]),SW=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),wW.toColor(yW,bW,xW,SW);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[yW,bW,xW,SW]=t.getImageData(0,0,1,1).data,SW!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:wW.toRgba(yW,bW,xW,SW),css:e}}e.toColor=r})(EW||={});var DW;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(DW||={});var OW;(e=>{function t(e,t){if(SW=(t&255)/255,SW===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return yW=a+Math.round((n-a)*SW),bW=o+Math.round((r-o)*SW),xW=s+Math.round((i-s)*SW),wW.toRgba(yW,bW,xW)}e.blend=t;function n(e,t,n){let a=DW.relativeLuminance(e>>8),o=DW.relativeLuminance(t>>8);if(AW(a,o)<n){if(o<a){let o=r(e,t,n),s=AW(a,DW.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>AW(a,DW.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=AW(a,DW.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>AW(a,DW.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=AW(DW.relativeLuminance2(o,s,c),DW.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=AW(DW.relativeLuminance2(o,s,c),DW.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=AW(DW.relativeLuminance2(o,s,c),DW.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=AW(DW.relativeLuminance2(o,s,c),DW.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(OW||={});function kW(e){let t=e.toString(16);return t.length<2?`0`+t:t}function AW(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var jW=class extends AB{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},MW=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new MB}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,o=0,s=t.getFg(0),c=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==s||this._workCell.bg!==c){if(e-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,o=a,s=this._workCell.fg,c=this._workCell.bg}a+=this._workCell.getChars().length||kB.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(e,t,n,r,i){let a=e.substring(t,n),o=[];try{o=this._characterJoiners[0].handler(a)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(a);for(let e=0;e<t.length;e++)MW._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,o=e[r];if(o){for(let s=n;s<this._bufferService.cols;s++){let n=t.getWidth(s),c=t.getString(s).length||kB.length;if(n!==0){if(!i&&o[0]<=a&&(o[0]=s,i=!0),o[1]<=a){if(o[1]=s,o=e[++r],!o)break;o[0]<=a?(o[0]=s,i=!0):i=!1}a+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};MW=dB([fB(0,zB)],MW);function NW(e){return 57508<=e&&e<=57558}function PW(e){return 9472<=e&&e<=9631}function FW(e){return NW(e)||PW(e)}function IW(){return{css:{canvas:LW(),cell:LW()},device:{canvas:LW(),cell:LW(),char:{width:0,height:0,left:0,top:0}}}}function LW(){return{width:0,height:0}}var RW=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new MB,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,a,o,s,c,l,u){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();n&&m<a+1&&(m=a+1);let h,g=0,_=``,v=0,y=0,b=0,x=0,S=!1,C=0,w=!1,T=0,ee=0,te=[],E=l!==-1&&u!==-1;for(let ne=0;ne<m;ne++){e.loadCell(ne,this._workCell);let m=this._workCell.getWidth();if(m===0)continue;let re=!1,ie=ne>=ee,ae=ne,D=this._workCell;if(f.length>0&&ne===f[0][0]&&ie){let r=f.shift(),i=this._isCellInSelection(r[0],t);for(v=r[0]+1;v<r[1];v++)ie&&=i===this._isCellInSelection(v,t);ie&&=!n||a<r[0]||a>=r[1],ie?(re=!0,D=new jW(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),ae=r[1]-1,m=D.getWidth()):ee=r[1]}let oe=this._isCellInSelection(ne,t),se=n&&ne===a,O=E&&ne>=l&&ne<=u,ce=!1;this._decorationService.forEachDecorationAtCell(ne,t,void 0,e=>{ce=!0});let k=D.getChars()||kB;if(k===` `&&(D.isUnderline()||D.isOverline())&&(k=`\xA0`),T=m*s-c.get(k,D.isBold(),D.isItalic()),!h)h=this._document.createElement(`span`);else if(g&&(oe&&w||!oe&&!w&&D.bg===y)&&(oe&&w&&p.selectionForeground||D.fg===b)&&D.extended.ext===x&&O===S&&T===C&&!se&&!re&&!ce&&ie){D.isInvisible()?_+=kB:_+=k,g++;continue}else g&&(h.textContent=_),h=this._document.createElement(`span`),g=0,_=``;if(y=D.bg,b=D.fg,x=D.extended.ext,S=O,C=T,w=oe,re&&a>=ne&&a<=ae&&(a=ne),!this._coreService.isCursorHidden&&se&&this._coreService.isCursorInitialized){if(te.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&te.push(`xterm-cursor-blink`),te.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:te.push(`xterm-cursor-outline`);break;case`block`:te.push(`xterm-cursor-block`);break;case`bar`:te.push(`xterm-cursor-bar`);break;case`underline`:te.push(`xterm-cursor-underline`);break;default:break}}if(D.isBold()&&te.push(`xterm-bold`),D.isItalic()&&te.push(`xterm-italic`),D.isDim()&&te.push(`xterm-dim`),_=D.isInvisible()?kB:D.getChars()||kB,D.isUnderline()&&(te.push(`xterm-underline-${D.extended.underlineStyle}`),_===` `&&(_=`\xA0`),!D.isUnderlineColorDefault())){if(D.isUnderlineColorRGB())h.style.textDecorationColor=`rgb(${AB.toColorRGB(D.getUnderlineColor()).join(`,`)})`;else{let e=D.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&D.isBold()&&e<8&&(e+=8),h.style.textDecorationColor=p.ansi[e].css}}D.isOverline()&&(te.push(`xterm-overline`),_===` `&&(_=`\xA0`)),D.isStrikethrough()&&te.push(`xterm-strikethrough`),O&&(h.style.textDecoration=`underline`);let A=D.getFgColor(),le=D.getFgColorMode(),ue=D.getBgColor(),de=D.getBgColorMode(),j=!!D.isInverse();if(j){let e=A;A=ue,ue=e;let t=le;le=de,de=t}let fe,pe,me=!1;this._decorationService.forEachDecorationAtCell(ne,t,void 0,e=>{e.options.layer!==`top`&&me||(e.backgroundColorRGB&&(de=50331648,ue=e.backgroundColorRGB.rgba>>8&16777215,fe=e.backgroundColorRGB),e.foregroundColorRGB&&(le=50331648,A=e.foregroundColorRGB.rgba>>8&16777215,pe=e.foregroundColorRGB),me=e.options.layer===`top`)}),!me&&oe&&(fe=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,ue=fe.rgba>>8&16777215,de=50331648,me=!0,p.selectionForeground&&(le=50331648,A=p.selectionForeground.rgba>>8&16777215,pe=p.selectionForeground)),me&&te.push(`xterm-decoration-top`);let he;switch(de){case 16777216:case 33554432:he=p.ansi[ue],te.push(`xterm-bg-${ue}`);break;case 50331648:he=wW.toColor(ue>>16,ue>>8&255,ue&255),this._addStyle(h,`background-color:#${zW((ue>>>0).toString(16),`0`,6)}`);break;default:j?(he=p.foreground,te.push(`xterm-bg-257`)):he=p.background}switch(fe||D.isDim()&&(fe=TW.multiplyOpacity(he,.5)),le){case 16777216:case 33554432:D.isBold()&&A<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(A+=8),this._applyMinimumContrast(h,he,p.ansi[A],D,fe,void 0)||te.push(`xterm-fg-${A}`);break;case 50331648:let e=wW.toColor(A>>16&255,A>>8&255,A&255);this._applyMinimumContrast(h,he,e,D,fe,pe)||this._addStyle(h,`color:#${zW(A.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(h,he,p.foreground,D,fe,pe)||j&&te.push(`xterm-fg-257`)}te.length&&=(h.className=te.join(` `),0),!se&&!re&&!ce&&ie?g++:h.textContent=_,T!==this.defaultSpacing&&(h.style.letterSpacing=`${T}px`),d.push(h),ne=ae}return h&&g&&(h.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||FW(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(!i&&!a&&(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=TW.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return s?(this._addStyle(e,`color:${s.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};RW=dB([fB(1,nV),fB(2,GB),fB(3,QB),fB(4,VB),fB(5,JB),fB(6,rV)],RW);function zW(e,t,n){for(;e.length<n;)e=t+e;return e}var BW=class{constructor(e,t){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.classList.add(`xterm-width-cache-measure-container`),this._container.setAttribute(`aria-hidden`,`true`),this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},VW=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);if(s>=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function HW(){return new VW}var UW=`xterm-dom-renderer-owner-`,WW=`xterm-rows`,GW=`xterm-fg-`,KW=`xterm-bg-`,qW=`xterm-focus`,JW=`xterm-selection`,YW=1,XW=class extends OV{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=YW++,this._rowElements=[],this._selectionRenderModel=HW(),this.onRequestRedraw=this._register(new JV).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(WW),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(JW),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=IW(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=s.createInstance(RW,document),this._element.classList.add(UW+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._register(TV(()=>{this._element.classList.remove(UW+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new BW(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${WW} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${WW} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${WW} .xterm-dim { color: ${TW.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${WW}.${qW} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${WW}.${qW} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${WW}.${qW} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${WW} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${WW} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${WW} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${WW} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${WW} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${JW} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${JW} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${JW} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${GW}${n} { color: ${r.css}; }${this._terminalSelector} .${GW}${n}.xterm-dim { color: ${TW.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${KW}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${GW}257 { color: ${TW.opaque(e.background).css}; }${this._terminalSelector} .${GW}257.xterm-dim { color: ${TW.multiplyOpacity(TW.opaque(e.background),.5).css}; }${this._terminalSelector} .${KW}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(qW),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(qW),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${UW}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};XW=dB([fB(7,UB),fB(8,ZB),fB(9,GB),fB(10,zB),fB(11,VB),fB(12,QB),fB(13,rV)],XW);var ZW=class extends OV{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new JV),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new eG(this._optionsService))}catch{this._measureStrategy=this._register(new $W(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};ZW=dB([fB(2,GB)],ZW);var QW=class extends OV{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},$W=class extends QW{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},eG=class extends QW{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},tG=class extends OV{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new nG(this._window)),this._onDprChange=this._register(new JV),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new JV),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(IV.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(yU(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(yU(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},nG=class extends OV{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new kV),this._onDprChange=this._register(new JV),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(TV(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=yU(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},rG=class extends OV{constructor(){super(),this.linkProviders=[],this._register(TV(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function iG(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}function aG(e,t,n,r,i,a,o,s,c){if(!a)return;let l=iG(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+ +!!c),l[1]=Math.min(Math.max(l[1],1),i),l}var oG=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return aG(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=iG(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};oG=dB([fB(0,eV),fB(1,ZB)],oG);var sG=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},cG={};uB(cG,{getSafariVersion:()=>hG,isChromeOS:()=>xG,isFirefox:()=>fG,isIpad:()=>_G,isIphone:()=>vG,isLegacyEdge:()=>pG,isLinux:()=>bG,isMac:()=>gG,isNode:()=>lG,isSafari:()=>mG,isWindows:()=>yG});var lG=typeof process<`u`&&`title`in process,uG=lG?`node`:navigator.userAgent,dG=lG?`node`:navigator.platform,fG=uG.includes(`Firefox`),pG=uG.includes(`Edge`),mG=/^((?!chrome|android).)*safari/i.test(uG);function hG(){if(!mG)return 0;let e=uG.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var gG=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(dG),_G=dG===`iPad`,vG=dG===`iPhone`,yG=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(dG),bG=dG.indexOf(`Linux`)>=0,xG=/\bCrOS\b/.test(uG),SG=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},CG=class extends SG{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},wG=class extends SG{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},TG=!lG&&`requestIdleCallback`in window?wG:CG,EG=class{constructor(){this._queue=new TG}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},DG=class extends OV{constructor(e,t,n,r,i,a,o,s,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=s,this._renderer=this._register(new kV),this._pausedResizeTask=new EG,this._observerDisposable=this._register(new kV),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new JV),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new JV),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new JV),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new JV),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new sG((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new OG(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(TV(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=TV(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};DG=dB([fB(2,GB),fB(3,ZB),fB(4,VB),fB(5,JB),fB(6,zB),fB(7,QB),fB(8,rV)],DG);var OG=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function kG(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return MG(i,a,e,t,n,r)+NG(a,t,n,r)+PG(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,VG(Math.abs(i-e),BG(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return VG(jG(a>t?e:i,n)+(s-1)*n.cols+1+AG(a>t?i:e,n),BG(o,r))}function AG(e,t){return e-1}function jG(e,t){return t.cols-e}function MG(e,t,n,r,i,a){return NG(t,r,i,a).length===0?``:VG(zG(e,t,e,t-IG(t,i),!1,i).length,BG(`D`,a))}function NG(e,t,n,r){let i=e-IG(e,n),a=t-IG(t,n);return VG(Math.abs(i-a)-FG(e,t,n),BG(RG(e,t),r))}function PG(e,t,n,r,i,a){let o;o=NG(t,r,i,a).length>0?r-IG(r,i):t;let s=r,c=LG(e,t,n,r,i,a);return VG(zG(e,o,n,s,c===`C`,i).length,BG(c,a))}function FG(e,t,n){let r=0,i=e-IG(e,n),a=t-IG(t,n);for(let o=0;o<Math.abs(i-a);o++){let a=RG(e,t)===`A`?-1:1;n.buffer.lines.get(i+a*o)?.isWrapped&&r++}return r}function IG(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function LG(e,t,n,r,i,a){let o;return o=NG(n,r,i,a).length>0?r-IG(r,i):t,e<n&&o<=r||e>=n&&o<r?`C`:`D`}function RG(e,t){return e>t?`A`:`B`}function zG(e,t,n,r,i,a){let o=e,s=t,c=``;for(;(o!==n||s!==r)&&s>=0&&s<a.buffer.lines.length;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function BG(e,t){let n=t?`O`:`[`;return $.ESC+n+e}function VG(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}var HG=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function UG(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var WG=50,GG=15,KG=50,qG=500,JG=RegExp(`\xA0`,`g`),YG=class extends OV{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new MB,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new JV),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new JV),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new JV),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new JV),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new HG(this._bufferService),this._activeSelectionMode=0,this._register(TV(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map(e=>e.replace(JG,` `)).join(yG?`\r
|
|
345
|
+
`:`
|
|
346
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),bG&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=UG(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=iG(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-WG),WG),t/=WG,t/Math.abs(t)+Math.round(t*(GG-1)))}shouldForceSelection(e){return gG?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),KG)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(gG&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<qG&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=kG(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(!(!t&&o.slice(s,c).trim()===``)){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=UG(n,this._bufferService.cols)}};YG=dB([fB(3,zB),fB(4,VB),fB(5,$B),fB(6,GB),fB(7,eV),fB(8,QB)],YG);var XG=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},ZG=class{constructor(){this._color=new XG,this._css=new XG}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},QG=Object.freeze((()=>{let e=[EW.toColor(`#2e3436`),EW.toColor(`#cc0000`),EW.toColor(`#4e9a06`),EW.toColor(`#c4a000`),EW.toColor(`#3465a4`),EW.toColor(`#75507b`),EW.toColor(`#06989a`),EW.toColor(`#d3d7cf`),EW.toColor(`#555753`),EW.toColor(`#ef2929`),EW.toColor(`#8ae234`),EW.toColor(`#fce94f`),EW.toColor(`#729fcf`),EW.toColor(`#ad7fa8`),EW.toColor(`#34e2e2`),EW.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:wW.toCss(r,i,a),rgba:wW.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:wW.toCss(n,n,n),rgba:wW.toRgba(n,n,n)})}return e})()),$G=EW.toColor(`#ffffff`),eK=EW.toColor(`#000000`),tK=EW.toColor(`#ffffff`),nK=eK,rK={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117},iK=$G,aK=class extends OV{constructor(e){super(),this._optionsService=e,this._contrastCache=new ZG,this._halfContrastCache=new ZG,this._onChangeColors=this._register(new JV),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:$G,background:eK,cursor:tK,cursorAccent:nK,selectionForeground:void 0,selectionBackgroundTransparent:rK,selectionBackgroundOpaque:TW.blend(eK,rK),selectionInactiveBackgroundTransparent:rK,selectionInactiveBackgroundOpaque:TW.blend(eK,rK),scrollbarSliderBackground:TW.opacity($G,.2),scrollbarSliderHoverBackground:TW.opacity($G,.4),scrollbarSliderActiveBackground:TW.opacity($G,.5),overviewRulerBorder:$G,ansi:QG.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange(`theme`,()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=oK(e.foreground,$G),t.background=oK(e.background,eK),t.cursor=TW.blend(t.background,oK(e.cursor,tK)),t.cursorAccent=TW.blend(t.background,oK(e.cursorAccent,nK)),t.selectionBackgroundTransparent=oK(e.selectionBackground,rK),t.selectionBackgroundOpaque=TW.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=oK(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=TW.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?oK(e.selectionForeground,CW):void 0,t.selectionForeground===CW&&(t.selectionForeground=void 0),TW.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=TW.opacity(t.selectionBackgroundTransparent,.3)),TW.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=TW.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=oK(e.scrollbarSliderBackground,TW.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=oK(e.scrollbarSliderHoverBackground,TW.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=oK(e.scrollbarSliderActiveBackground,TW.opacity(t.foreground,.5)),t.overviewRulerBorder=oK(e.overviewRulerBorder,iK),t.ansi=QG.slice(),t.ansi[0]=oK(e.black,QG[0]),t.ansi[1]=oK(e.red,QG[1]),t.ansi[2]=oK(e.green,QG[2]),t.ansi[3]=oK(e.yellow,QG[3]),t.ansi[4]=oK(e.blue,QG[4]),t.ansi[5]=oK(e.magenta,QG[5]),t.ansi[6]=oK(e.cyan,QG[6]),t.ansi[7]=oK(e.white,QG[7]),t.ansi[8]=oK(e.brightBlack,QG[8]),t.ansi[9]=oK(e.brightRed,QG[9]),t.ansi[10]=oK(e.brightGreen,QG[10]),t.ansi[11]=oK(e.brightYellow,QG[11]),t.ansi[12]=oK(e.brightBlue,QG[12]),t.ansi[13]=oK(e.brightMagenta,QG[13]),t.ansi[14]=oK(e.brightCyan,QG[14]),t.ansi[15]=oK(e.brightWhite,QG[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=oK(e.extendedAnsi[r],QG[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};aK=dB([fB(0,GB)],aK);function oK(e,t){if(e!==void 0)try{return EW.toColor(e)}catch{}return t}var sK=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},cK=class{constructor(){this._services=new sK,this._services.set(UB,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=IB(e).sort((e,t)=>e.index-t.index),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id._id}.`);r.push(n)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},lK={trace:0,debug:1,info:2,warn:3,error:4,off:5},uK=`xterm.js: `,dK=class extends OV{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),fK=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=lK[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:uK)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};dK=dB([fB(0,GB)],dK);var fK,pK=class extends OV{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new JV),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new JV),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new JV),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error(`Can only recycle when the buffer is full`);return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},mK=3,hK=Object.freeze(new AB),gK=0,_K=2,vK=class e{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*mK);let r=t||MB.fromCharData([0,OB,1,0]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[e*mK+0],n=t&2097151;return[this._data[e*mK+1],t&2097152?this._combined[e]:n?wB(n):``,t>>22,t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[e*mK+1]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*mK+0]=e|2097152|t[2]<<22):this._data[e*mK+0]=t[1].charCodeAt(0)|t[2]<<22}getWidth(e){return this._data[e*mK+0]>>22}hasWidth(e){return this._data[e*mK+0]&12582912}getFg(e){return this._data[e*mK+1]}getBg(e){return this._data[e*mK+2]}hasContent(e){return this._data[e*mK+0]&4194303}getCodePoint(e){let t=this._data[e*mK+0];return t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):t&2097151}isCombined(e){return this._data[e*mK+0]&2097152}getString(e){let t=this._data[e*mK+0];return t&2097152?this._combined[e]:t&2097151?wB(t&2097151):``}isProtected(e){return this._data[e*mK+2]&536870912}loadCell(e,t){return gK=e*mK,t.content=this._data[gK+0],t.fg=this._data[gK+1],t.bg=this._data[gK+2],t.content&2097152&&(t.combinedData=this._combined[e]),t.bg&268435456&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){t.content&2097152&&(this._combined[e]=t.combinedData),t.bg&268435456&&(this._extendedAttrs[e]=t.extended),this._data[e*mK+0]=t.content,this._data[e*mK+1]=t.fg,this._data[e*mK+2]=t.bg}setCellFromCodepoint(e,t,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*mK+0]=t|n<<22,this._data[e*mK+1]=r.fg,this._data[e*mK+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[e*mK+0];r&2097152?this._combined[e]+=wB(t):r&2097151?(this._combined[e]=wB(r&2097151)+wB(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*mK+0]=r}insertCells(e,t,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length-e){let r=new MB;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,t,n){if(e%=this.length,t<this.length-e){let r=new MB;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,t,n,r=!1){if(r){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return this._data.length*4*_K<this._data.buffer.byteLength;let n=e*mK;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,n*4*_K<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*_K<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t){for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);return}this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let t=new e(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let e in this._combined)t._combined[e]=this._combined[e];for(let e in this._extendedAttrs)t._extendedAttrs[e]=this._extendedAttrs[e];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*mK+0]&4194303)return e+(this._data[e*mK+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*mK+0]&4194303||this._data[e*mK+2]&50331648)return e+(this._data[e*mK+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<mK;e++)this._data[(n+i)*mK+e]=a[(t+i)*mK+e];a[(t+i)*mK+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<mK;e++)this._data[(n+i)*mK+e]=a[(t+i)*mK+e];a[(t+i)*mK+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t<n;){let e=this._data[t*mK+0],n=e&2097151,a=e&2097152?this._combined[t]:n?wB(n):kB;if(i+=a,r)for(let e=0;e<a.length;++e)r.push(t);t+=e>>22||1}return r&&r.push(t),i}};function yK(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(!a&&r>=s&&r<c){s+=u.length-1;continue}let d=0,f=CK(u,d,t),p=1,m=0;for(;p<u.length;){let e=CK(u,p,t),r=e-m,a=n-f,o=Math.min(r,a);u[d].copyCellsFrom(u[p],m,f,o,!1),f+=o,f===n&&(d++,f=0),m+=o,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(n-1)===2&&(u[d].copyCellsFrom(u[d-1],n-1,f++,1,!1),u[d-1].setCell(n-1,i))}u[d].replaceCells(f,n,i);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o}function bK(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}}function xK(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length}function SK(e,t,n){let r=[],i=e.map((n,r)=>CK(e,r,t)).reduce((e,t)=>e+t),a=0,o=0,s=0;for(;s<i;){if(i-s<n){r.push(i-s);break}a+=n;let c=CK(e,o,t);a>c&&(a-=c,o++);let l=e[o].getWidth(a-1)===2;l&&a--;let u=l?n-1:n;r.push(u),s+=u}return r}function CK(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var wK=class e{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new JV),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),CV(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};wK._nextId=1;var TK=wK,EK={},DK=EK.B;EK[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:``,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},EK.A={"#":`£`},EK.B=void 0,EK[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},EK.C=EK[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},EK.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},EK.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},EK.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},EK.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},EK.E=EK[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},EK.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},EK.H=EK[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},EK[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`};var OK=4294967295,kK=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=hK.clone(),this.savedCharset=DK,this.markers=[],this._nullCell=MB.fromCharData([0,OB,1,0]),this._whitespaceCell=MB.fromCharData([0,kB,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new TG,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new pK(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new jB),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new jB),this._whitespaceCell}getBlankLine(e,t){return new vK(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>OK?OK:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=hK);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new pK(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(hK),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new vK(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new vK(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=yK(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(hK),n);if(r.length>0){let n=bK(this.lines,r);xK(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(hK),i=n;for(;i-->0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new vK(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(hK),i=[],a=0;for(let o=this.lines.length-1;o>=0;o--){let s=this.lines.get(o);if(!s||!s.isWrapped&&s.getTrimmedLength()<=e)continue;let c=[s];for(;s.isWrapped&&o>0;)s=this.lines.get(--o),c.unshift(s);if(!n){let e=this.ybase+this.y;if(e>=o&&e<o+c.length)continue}let l=c[c.length-1].getTrimmedLength(),u=SK(c,this._cols,e),d=u.length-c.length,f;f=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(hK,!0);p.push(e)}p.length>0&&(i.push({start:o+c.length+a,newLines:p}),a+=p.length),c.push(...p);let m=u.length-1,h=u[m];h===0&&(m--,h=u[m]);let g=c.length-d-1,_=l;for(;g>=0;){let e=Math.min(_,h);if(c[m]===void 0)break;c[m].copyCellsFrom(c[g],_-e,h-e,e,!0),h-=e,h===0&&(m--,h=u[m]),_-=e,_===0&&(g--,_=CK(c,Math.max(g,0),this._cols))}for(let t=0;t<c.length;t++)u[t]<e&&c[t].setCell(u[t],r);let v=d-f;for(;v-->0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,r=n-1,o=0,s=i[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+a-1);l>=0;l--)if(s&&s.start>r+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:r+1,amount:s.newLines.length}),c+=s.newLines.length,s=i[++o]}else this.lines.set(l,t[r--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+a-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new TK(e);return this.markers.push(t),t.register(this.lines.onTrim(e=>{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},AK=class extends OV{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new JV),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange(`scrollback`,()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,()=>this.setupTabStops()))}reset(){this._normal=new kK(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new kK(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},jK=2,MK=1,NK=class extends OV{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new JV),this.onResize=this._onResize.event,this._onScroll=this._register(new JV),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,jK),this.rows=Math.max(e.rawOptions.rows||0,MK),this.buffers=this._register(new AK(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};NK=dB([fB(0,GB)],NK);var PK={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:gG,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRuler:{}},FK=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],IK=class extends OV{constructor(e){super(),this._onOptionChange=this._register(new JV),this.onOptionChange=this._onOptionChange.event;let t={...PK};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(TV(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=e=>{if(!(e in PK))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},t=(e,t)=>{if(!(e in PK))throw Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case`cursorStyle`:if(t||=PK[e],!LK(t))throw Error(`"${t}" is not a valid value for ${e}`);break;case`wordSeparator`:t||=PK[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof t==`number`&&1<=t&&t<=1e3)break;t=FK.includes(t)?t:PK[e];break;case`cursorWidth`:t=Math.floor(t);case`lineHeight`:case`tabStopWidth`:if(t<1)throw Error(`${e} cannot be less than 1, value: ${t}`);break;case`minimumContrastRatio`:t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case`scrollback`:if(t=Math.min(t,4294967295),t<0)throw Error(`${e} cannot be less than 0, value: ${t}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(t<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case`rows`:case`cols`:if(!t&&t!==0)throw Error(`${e} must be numeric, value: ${t}`);break;case`windowsPty`:t??={}}return t}};function LK(e){return e===`block`||e===`underline`||e===`bar`}function RK(e,t=5){if(typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&RK(e[r],t-1);return n}var zK=Object.freeze({insertMode:!1}),BK=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),VK=class extends OV{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new JV),this.onData=this._onData.event,this._onUserInput=this._register(new JV),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new JV),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new JV),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=RK(zK),this.decPrivateModes=RK(BK)}reset(){this.modes=RK(zK),this.decPrivateModes=RK(BK)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace(`sending data (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace(`sending binary (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};VK=dB([fB(0,zB),fB(1,WB),fB(2,GB)],VK);var HK={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function UK(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var WK=String.fromCharCode,GK={DEFAULT:e=>{let t=[UK(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`\x1B[M${WK(t[0])}${WK(t[1])}${WK(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${UK(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${UK(e,!0)};${e.x};${e.y}${t}`}},KK=class extends OV{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new JV),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(HK))this.addProtocol(e,HK[e]);for(let e of Object.keys(GK))this.addEncoding(e,GK[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};KK=dB([fB(0,zB),fB(1,VB),fB(2,GB)],KK);var qK=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],JK=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],YK;function XK(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var ZK=class{constructor(){if(this.version=`6`,!YK){YK=new Uint8Array(65536),YK.fill(1),YK[0]=0,YK.fill(0,1,32),YK.fill(0,127,160),YK.fill(2,4352,4448),YK[9001]=2,YK[9002]=2,YK.fill(2,11904,42192),YK[12351]=1,YK.fill(2,44032,55204),YK.fill(2,63744,64256),YK.fill(2,65040,65050),YK.fill(2,65072,65136),YK.fill(2,65280,65377),YK.fill(2,65504,65511);for(let e=0;e<qK.length;++e)YK.fill(0,qK[e][0],qK[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?YK[e]:XK(e,JK)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=QK.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return QK.createPropertyValue(0,n,r)}},QK=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new JV,this.onChange=this._onChange.event;let e=new ZK;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return!!(e&1)}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|!!n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let a=0;a<i;++a){let o=t.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},$K=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function eq(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var tq=2147483647,nq=256,rq=class e{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>nq)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new e;if(!t.length)return n;for(let e=+!!Array.isArray(t[0]);e<t.length;++e){let r=t[e];if(Array.isArray(r))for(let e=0;e<r.length;++e)n.addSubParam(r[e]);else n.addParam(r)}return n}clone(){let t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>tq?tq:e}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>tq?tq:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[t-1];n[t-1]=~r?Math.min(r*10+e,tq):e}},iq=[],aq=class{constructor(){this._state=0,this._active=iq,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=iq}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=iq,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||iq,!this._active.length)this._handlerFb(this._id,`START`);else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,`PUT`,TB(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3){if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,`END`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}}this._active=iq,this._id=-1,this._state=0}}},oq=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=TB(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(e=>(this._data=``,this._hitLimit=!1,e));return this._data=``,this._hitLimit=!1,t}},sq=[],cq=class{constructor(){this._handlers=Object.create(null),this._active=sq,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=sq}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=sq,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||sq,!this._active.length)this._handlerFb(this._ident,`HOOK`,t);else for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,`PUT`,TB(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,`UNHOOK`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=sq,this._ident=0}},lq=new rq;lq.addParam(0);var uq=class{constructor(e){this._handler=e,this._data=``,this._params=lq,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():lq,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=TB(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(e=>(this._params=lq,this._data=``,this._hitLimit=!1,e));return this._params=lq,this._data=``,this._hitLimit=!1,t}},dq=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}},fq=160,pq=function(){let e=new dq(4095),t=Array.apply(null,Array(256)).map((e,t)=>t),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(fq,0,2,0),e.add(fq,8,5,8),e.add(fq,6,0,6),e.add(fq,11,0,11),e.add(fq,13,13,13),e}(),mq=class extends OV{constructor(e=pq){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new rq,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(TV(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new aq),this._dcsParser=this._register(new cq),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=0,a=0,o;if(this._parseStack.state){if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,i=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](this._params),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}}for(let n=a;n<t;++n){switch(r=e[n],i=this._transitions.table[this.currentState<<8|(r<160?r:fq)],i>>4){case 2:for(let i=n+1;;++i){if(i>=t||(r=e[i])<32||r>126&&r<fq){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<fq){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<fq){this._printHandler(e,n,i),n=i-1;break}if(++i>=t||(r=e[i])<32||r>126&&r<fq){this._printHandler(e,n,i),n=i-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let a=this._csiHandlers[this._collect<<8|r],s=a?a.length-1:-1;for(;s>=0&&(o=a[s](this._params),o!==!0);s--)if(o instanceof Promise)return this._preserveStack(3,a,s,i,n),o;s<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++n<t&&(r=e[n])>47&&r<60);n--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(4,c,l,i,n),o;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let i=n+1;;++i)if(i>=t||(r=e[i])===24||r===26||r===27||r>127&&r<fq){this._dcsParser.put(e,n,i),n=i-1;break}break;case 14:if(o=this._dcsParser.unhook(r!==24&&r!==26),o)return this._preserveStack(6,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let i=n+1;;i++)if(i>=t||(r=e[i])<32||r>127&&r<fq){this._oscParser.put(e,n,i),n=i-1;break}break;case 6:if(o=this._oscParser.end(r!==24&&r!==26),o)return this._preserveStack(5,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=i&15}}},hq=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,gq=/^[\da-f]+$/;function _q(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=hq.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),gq.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}}function vq(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function yq(e,t=16){let[n,r,i]=e;return`rgb:${vq(n,t)}/${vq(r,t)}/${vq(i,t)}`}var bq={"(":0,")":1,"*":2,"+":3,"-":1,".":2},xq=131072,Sq=10;function Cq(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var wq=5e3,Tq=0,Eq=class extends OV{constructor(e,t,n,r,i,a,o,s,c=new mq){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=a,this._coreMouseService=o,this._unicodeService=s,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new EB,this._utf8Decoder=new DB,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=hK.clone(),this._eraseAttrDataInternal=hK.clone(),this._onRequestBell=this._register(new JV),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new JV),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new JV),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new JV),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new JV),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new JV),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new JV),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new JV),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new JV),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new JV),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new JV),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new JV),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new JV),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Dq(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})}),this._parser.setOscHandlerFallback((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})}),this._parser.setDcsHandlerFallback((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})}),this._parser.setPrintHandler((e,t,n)=>this.print(e,t,n)),this._parser.registerCsiHandler({final:`@`},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:` `,final:`@`},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:`A`},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:` `,final:`A`},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:`B`},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:`C`},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:`D`},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:`E`},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:`F`},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:`G`},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:`H`},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:`I`},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:`J`},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`J`},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:`K`},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`K`},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:`L`},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:`M`},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:`P`},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:`S`},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:`T`},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:`X`},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:`Z`},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:`a`},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:`b`},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:`c`},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:`>`,final:`c`},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:`d`},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:`e`},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:`f`},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:`g`},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:`h`},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`h`},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:`l`},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`l`},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:`m`},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:`n`},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:`?`,final:`n`},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:` `,final:`q`},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:`r`},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:`s`},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:`t`},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:`u`},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler($.BEL,()=>this.bell()),this._parser.setExecuteHandler($.LF,()=>this.lineFeed()),this._parser.setExecuteHandler($.VT,()=>this.lineFeed()),this._parser.setExecuteHandler($.FF,()=>this.lineFeed()),this._parser.setExecuteHandler($.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler($.BS,()=>this.backspace()),this._parser.setExecuteHandler($.HT,()=>this.tab()),this._parser.setExecuteHandler($.SO,()=>this.shiftOut()),this._parser.setExecuteHandler($.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(gW.IND,()=>this.index()),this._parser.setExecuteHandler(gW.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(gW.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new oq(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new oq(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new oq(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new oq(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new oq(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new oq(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new oq(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new oq(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new oq(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new oq(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new oq(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new oq(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:`7`},()=>this.saveCursor()),this._parser.registerEscHandler({final:`8`},()=>this.restoreCursor()),this._parser.registerEscHandler({final:`D`},()=>this.index()),this._parser.registerEscHandler({final:`E`},()=>this.nextLine()),this._parser.registerEscHandler({final:`H`},()=>this.tabSet()),this._parser.registerEscHandler({final:`M`},()=>this.reverseIndex()),this._parser.registerEscHandler({final:`=`},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:`>`},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:`c`},()=>this.fullReset()),this._parser.registerEscHandler({final:`n`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`o`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`|`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`}`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`~`},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:`%`,final:`@`},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:`%`,final:`G`},()=>this.selectDefaultCharset());for(let e in EK)this._parser.registerEscHandler({intermediates:`(`,final:e},()=>this.selectCharset(`(`+e)),this._parser.registerEscHandler({intermediates:`)`,final:e},()=>this.selectCharset(`)`+e)),this._parser.registerEscHandler({intermediates:`*`,final:e},()=>this.selectCharset(`*`+e)),this._parser.registerEscHandler({intermediates:`+`,final:e},()=>this.selectCharset(`+`+e)),this._parser.registerEscHandler({intermediates:`-`,final:e},()=>this.selectCharset(`-`+e)),this._parser.registerEscHandler({intermediates:`.`,final:e},()=>this.selectCharset(`.`+e)),this._parser.registerEscHandler({intermediates:`/`,final:e},()=>this.selectCharset(`/`+e));this._parser.registerEscHandler({intermediates:`#`,final:`8`},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error(`Parsing error: `,e),e)),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new uq((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t(`#SLOW_TIMEOUT`),wq))]).catch(e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than ${wq} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>xq&&(a=this._parseStack.position+xq)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join(``)}"`}`),this._logService.logLevel===0&&this._logService.trace(`parsing data (codes)`,typeof e==`string`?e.split(``).map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<xq&&(this._parseBuffer=new Uint32Array(Math.min(e.length,xq))),o||this._dirtyRowTracker.clearRange(),e.length>xq)for(let t=a;t<e.length;t+=xq){let a=t+xq<e.length?t+xq:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let s=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(s,this._bufferService.rows-1)})}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,l=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;p<n;++p){if(r=e[p],r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}let t=this._unicodeService.charProperties(r,f);i=QK.extractWidth(t);let n=QK.extractShouldJoin(t),m=n?QK.extractWidth(f):0;if(f=t,o&&this._onA11yChar.fire(wB(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-m>s){if(c){let e=d,t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&d instanceof vK&&d.copyCellsFrom(e,t,0,m,!1);t<s;)e.setCellFromCodepoint(t++,0,1,u)}else if(this._activeBuffer.x=s-1,i===2)continue}if(n&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,r,i);for(let e=i-m;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(l&&(d.insertCells(this._activeBuffer.x,i-m,this._activeBuffer.getNullCell(u)),d.getWidth(s-1)===2&&d.setCellFromCodepoint(s-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<s&&n-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final===`t`&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,e=>!Cq(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new uq(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new oq(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(hK));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=QK.extractWidth(t),i=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(a.length*n),s=0;for(let e=0;e<a.length;){let t=a.codePointAt(e)||0;o[s++]=t,e+=t>65535?2:1}let c=s;for(let e=1;e<n;++e)o.copyWithin(c,0,s),c+=s;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent($.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent($.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent($.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent($.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent($.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,DK),this._charsetService.setgCharset(1,DK),this._charsetService.setgCharset(2,DK),this._charsetService.setgCharset(3,DK);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol=`X10`;break;case 1e3:this._coreMouseService.activeProtocol=`VT200`;break;case 1002:this._coreMouseService.activeProtocol=`DRAG`;break;case 1003:this._coreMouseService.activeProtocol=`ANY`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug(`DECSET 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`SGR`;break;case 1015:this._logService.debug(`DECSET 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`SGR_PIXELS`;break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol=`NONE`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug(`DECRST 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let n;(e=>(e[e.NOT_RECOGNIZED=0]=`NOT_RECOGNIZED`,e[e.SET=1]=`SET`,e[e.RESET=2]=`RESET`,e[e.PERMANENTLY_SET=3]=`PERMANENTLY_SET`,e[e.PERMANENTLY_RESET=4]=`PERMANENTLY_RESET`))(n||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:a}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=(e,n)=>(o.triggerDataEvent(`${$.ESC}[${t?``:`?`}${e};${n}$y`),!0),p=e=>e?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:+(c===132):0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i===`X10`)):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i===`VT200`)):m===1002?f(m,p(i===`DRAG`)):m===1003?f(m,p(i===`ANY`)):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(a===`SGR`)):m===1015?f(m,4):m===1016?f(m,p(a===`SGR_PIXELS`)):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=AB.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=hK.fg,e.bg=hK.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=n-90|16777224):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=n-100|16777224):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=hK.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=hK.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=hK.fg&16777215,r.bg&=-67108864,r.bg|=hK.bg&16777215):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${$.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${$.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${$.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=hK.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle=`block`;break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle=`underline`;break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle=`bar`}let e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Cq(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${$.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Sq&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Sq&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(Oq(n)){if(r===`?`)t.push({type:0,index:n});else{let e=_q(r);e&&t.push({type:1,index:n,color:e})}}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(`;`);if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):!n.trim()&&this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex(e=>e.startsWith(`id=`));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=_q(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);Oq(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,DK),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(bq[e[0]],EK[e[1]]||DK),!0):(this.selectDefaultCharset(),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=hK.clone(),this._eraseAttrDataInternal=hK.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new MB;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=e=>(this._coreService.triggerDataEvent(`${$.ESC}${e}${$.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-+!!i.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Dq=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Tq=e,e=t,t=Tq),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Dq=dB([fB(0,zB)],Dq);function Oq(e){return 0<=e&&e<256}var kq=5e7,Aq=12,jq=50,Mq=class extends OV{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new JV),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>kq)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e=>performance.now()-n>=Aq?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-n>=Aq)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>jq&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},Nq=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(r,n)),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(n,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Nq=dB([fB(0,zB)],Nq);var Pq=!1,Fq=class extends OV{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new kV),this._onBinary=this._register(new JV),this.onBinary=this._onBinary.event,this._onData=this._register(new JV),this.onData=this._onData.event,this._onLineFeed=this._register(new JV),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new JV),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new JV),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new JV),this._instantiationService=new cK,this.optionsService=this._register(new IK(e)),this._instantiationService.setService(GB,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(NK)),this._instantiationService.setService(zB,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(dK)),this._instantiationService.setService(WB,this._logService),this.coreService=this._register(this._instantiationService.createInstance(VK)),this._instantiationService.setService(VB,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(KK)),this._instantiationService.setService(BB,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(QK)),this._instantiationService.setService(qB,this.unicodeService),this._charsetService=this._instantiationService.createInstance($K),this._instantiationService.setService(HB,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Nq),this._instantiationService.setService(KB,this._oscLinkService),this._inputHandler=this._register(new Eq(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(IV.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(IV.forward(this._bufferService.onResize,this._onResize)),this._register(IV.forward(this.coreService.onData,this._onData)),this._register(IV.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new Mq((e,t)=>this._inputHandler.parse(e,t))),this._register(IV.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new JV),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Pq&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),Pq=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,jK),t=Math.max(t,MK),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(eq.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},()=>(eq(this._bufferService),!1))),this._windowsWrappingHeuristics.value=TV(()=>{for(let t of e)t.dispose()})}}},Iq={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};function Lq(e,t,n,r){let i={type:0,cancel:!1,key:void 0},a=!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?i.key=t?$.ESC+`OA`:$.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?i.key=t?$.ESC+`OD`:$.ESC+`[D`:e.key===`UIKeyInputRightArrow`?i.key=t?$.ESC+`OC`:$.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(i.key=t?$.ESC+`OB`:$.ESC+`[B`);break;case 8:i.key=e.ctrlKey?`\b`:$.DEL,e.altKey&&(i.key=$.ESC+i.key);break;case 9:if(e.shiftKey){i.key=$.ESC+`[Z`;break}i.key=$.HT,i.cancel=!0;break;case 13:i.key=e.altKey?$.ESC+$.CR:$.CR,i.cancel=!0;break;case 27:i.key=$.ESC,e.altKey&&(i.key=$.ESC+$.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`D`:t?$.ESC+`OD`:$.ESC+`[D`;break;case 39:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`C`:t?$.ESC+`OC`:$.ESC+`[C`;break;case 38:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`A`:t?$.ESC+`OA`:$.ESC+`[A`;break;case 40:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`B`:t?$.ESC+`OB`:$.ESC+`[B`;break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=$.ESC+`[2~`);break;case 46:i.key=a?$.ESC+`[3;`+(a+1)+`~`:$.ESC+`[3~`;break;case 36:i.key=a?$.ESC+`[1;`+(a+1)+`H`:t?$.ESC+`OH`:$.ESC+`[H`;break;case 35:i.key=a?$.ESC+`[1;`+(a+1)+`F`:t?$.ESC+`OF`:$.ESC+`[F`;break;case 33:e.shiftKey?i.type=2:i.key=e.ctrlKey?$.ESC+`[5;`+(a+1)+`~`:$.ESC+`[5~`;break;case 34:e.shiftKey?i.type=3:i.key=e.ctrlKey?$.ESC+`[6;`+(a+1)+`~`:$.ESC+`[6~`;break;case 112:i.key=a?$.ESC+`[1;`+(a+1)+`P`:$.ESC+`OP`;break;case 113:i.key=a?$.ESC+`[1;`+(a+1)+`Q`:$.ESC+`OQ`;break;case 114:i.key=a?$.ESC+`[1;`+(a+1)+`R`:$.ESC+`OR`;break;case 115:i.key=a?$.ESC+`[1;`+(a+1)+`S`:$.ESC+`OS`;break;case 116:i.key=a?$.ESC+`[15;`+(a+1)+`~`:$.ESC+`[15~`;break;case 117:i.key=a?$.ESC+`[17;`+(a+1)+`~`:$.ESC+`[17~`;break;case 118:i.key=a?$.ESC+`[18;`+(a+1)+`~`:$.ESC+`[18~`;break;case 119:i.key=a?$.ESC+`[19;`+(a+1)+`~`:$.ESC+`[19~`;break;case 120:i.key=a?$.ESC+`[20;`+(a+1)+`~`:$.ESC+`[20~`;break;case 121:i.key=a?$.ESC+`[21;`+(a+1)+`~`:$.ESC+`[21~`;break;case 122:i.key=a?$.ESC+`[23;`+(a+1)+`~`:$.ESC+`[23~`;break;case 123:i.key=a?$.ESC+`[24;`+(a+1)+`~`:$.ESC+`[24~`;break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=$.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=$.DEL:e.keyCode===219?i.key=$.ESC:e.keyCode===220?i.key=$.FS:e.keyCode===221&&(i.key=$.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let t=Iq[e.keyCode]?.[+!!e.shiftKey];if(t)i.key=$.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),i.key=$.ESC+n}else if(e.keyCode===32)i.key=$.ESC+(e.ctrlKey?$.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),i.key=$.ESC+t,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(i.key=$.US),e.key===`@`&&(i.key=$.NUL))}return i}var Rq=0,zq=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new TG,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new TG,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,t)=>this._getKey(e)-this._getKey(t)),t=0,n=0,r=Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Rq=this._search(t),Rq===-1)||this._getKey(this._array[Rq])!==t)return!1;do if(this._array[Rq]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Rq),!0;while(++Rq<this._array.length&&this._getKey(this._array[Rq])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,t)=>e-t),t=0,n=Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:n[r++]=this._array[i];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Rq=this._search(e),!(Rq<0||Rq>=this._array.length)&&this._getKey(this._array[Rq])===e))do yield this._array[Rq];while(++Rq<this._array.length&&this._getKey(this._array[Rq])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Rq=this._search(e),!(Rq<0||Rq>=this._array.length)&&this._getKey(this._array[Rq])===e))do t(this._array[Rq]);while(++Rq<this._array.length&&this._getKey(this._array[Rq])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},Bq=0,Vq=0,Hq=class extends OV{constructor(){super(),this._decorations=new zq(e=>e?.marker.line),this._onDecorationRegistered=this._register(new JV),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new JV),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(TV(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new Uq(e);if(t){let e=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,t=>{Bq=t.options.x??0,Vq=Bq+(t.options.width??1),e>=Bq&&e<Vq&&(!n||(t.options.layer??`bottom`)===n)&&r(t)})}},Uq=class extends DV{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new JV),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new JV),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}get backgroundColorRGB(){return this._cachedBg===null&&(this._cachedBg=this.options.backgroundColor?EW.toColor(this.options.backgroundColor):void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this._cachedFg=this.options.foregroundColor?EW.toColor(this.options.foregroundColor):void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Wq=1e3,Gq=class{constructor(e,t=Wq){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Kq=20,qq=class extends OV{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``;let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=i.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new Gq(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
347
|
+
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(yU(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(TV(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<Kq+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
348
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Kq+1&&(this._liveRegion.textContent+=gB.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(!(!a||!o)){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};qq=dB([fB(1,UB),fB(2,QB),fB(3,eV)],qq);var Jq=class extends OV{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new JV),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new JV),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(TV(()=>{CV(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(yU(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(yU(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(yU(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(yU(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)(!this._activeProviderReplies.has(t)||this._activeProviderReplies.get(t))&&(i=!0);if(!i&&r){let e=r.find(e=>this._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&Yq(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,CV(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};Jq=dB([fB(1,$B),fB(2,eV),fB(3,zB),fB(4,iV)],Jq);function Yq(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var Xq=class extends Fq{constructor(e={}){super(e),this._linkifier=this._register(new kV),this.browser=cG,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new kV),this._onCursorMove=this._register(new JV),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new JV),this.onKey=this._onKey.event,this._onRender=this._register(new JV),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new JV),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new JV),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new JV),this.onBell=this._onBell.event,this._onFocus=this._register(new JV),this._onBlur=this._register(new JV),this._onA11yCharEmitter=this._register(new JV),this._onA11yTabEmitter=this._register(new JV),this._onWillOpen=this._register(new JV),this._setup(),this._decorationService=this._instantiationService.createInstance(Hq),this._instantiationService.setService(JB,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(rG),this._instantiationService.setService(iV,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(YB)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(IV.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(IV.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(IV.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(IV.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(TV(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=TW.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${$.ESC}]${n};${yq(r)}${_W.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=wW.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=wW.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(qq,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(yU(this.element,`copy`,e=>{this.hasSelection()&&yB(e,this._selectionService)}));let e=e=>bB(e,this.textarea,this.coreService,this.optionsService);this._register(yU(this.textarea,`paste`,e)),this._register(yU(this.element,`paste`,e)),fG?this._register(yU(this.element,`mousedown`,e=>{e.button===2&&CB(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(yU(this.element,`contextmenu`,e=>{CB(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),bG&&this._register(yU(this.element,`auxclick`,e=>{e.button===1&&SB(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(yU(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(yU(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(yU(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(yU(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(yU(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(yU(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(yU(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(yU(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,mB.get()),xG||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(tG,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(QB,this._coreBrowserService),this._register(yU(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(yU(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(ZW,this._document,this._helperContainer),this._instantiationService.setService(ZB,this._charSizeService),this._themeService=this._instantiationService.createInstance(aK),this._instantiationService.setService(rV,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(MW),this._instantiationService.setService(nV,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(DG,this.rows,this.screenElement)),this._instantiationService.setService(eV,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(vW,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(oG),this._instantiationService.setService($B,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Jq,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(lW,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(YG,this.element,this.screenElement,r)),this._instantiationService.setService(tV,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(IV.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(uW,this.screenElement)),this._register(yU(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(qq,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(hW,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(hW,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(XW,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(yU(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(e)))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(yU(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=$.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){xB(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key===`Dead`||e.key===`AltGraph`)&&(this._unprocessedDeadKey=!0);let n=Lq(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===$.ETX||n.key===$.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Zq(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(hK));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent($.ESC+`[I`):this.coreService.triggerDataEvent($.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.ESC}[4;${t};${e}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.ESC}[6;${r};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function Zq(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var Qq=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},$q=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new MB)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},eJ=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new $q(t)}getNullCell(){return new MB}},tJ=class extends OV{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new JV),this.onBufferChange=this._onBufferChange.event,this._normal=new eJ(this._core.buffers.normal,`normal`),this._alternate=new eJ(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},nJ=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},rJ=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},iJ=[`cols`,`rows`],aJ=0,oJ=class extends OV{constructor(e){super(),this._core=this._register(new Xq(e)),this._addonManager=this._register(new Qq),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(iJ.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new nJ(this._core),this._parser}get unicode(){return this._checkProposedApi(),new rJ(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this._register(new tJ(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
349
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return mB.get()},set promptLabel(e){mB.set(e)},get tooMuchOutput(){return gB.get()},set tooMuchOutput(e){gB.set(e)}}}_verifyIntegers(...e){for(aJ of e)if(aJ===1/0||isNaN(aJ)||aJ%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(aJ of e)if(aJ&&(aJ===1/0||isNaN(aJ)||aJ%1!=0||aJ<0))throw Error(`This API only accepts positive integers`)}},sJ=2,cJ=1,lJ=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(sJ,Math.floor(u/e.css.cell.width)),rows:Math.max(cJ,Math.floor(l/e.css.cell.height))}}},uJ=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=fJ.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function dJ(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var fJ=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!dJ(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},pJ=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function mJ(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var hJ=class{constructor(e=mJ,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||pJ;this._linkProvider=this._terminal.registerLinkProvider(new uJ(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},gJ={background:`#09090b`,foreground:`#f4f4f5`,cursor:`#38bdf8`,cursorAccent:`#09090b`,selectionBackground:`rgba(56, 189, 248, 0.3)`,black:`#27272a`,red:`#f87171`,green:`#4ade80`,yellow:`#facc15`,blue:`#60a5fa`,magenta:`#c084fc`,cyan:`#38bdf8`,white:`#f4f4f5`,brightBlack:`#52525b`,brightRed:`#ef4444`,brightGreen:`#22c55e`,brightYellow:`#eab308`,brightBlue:`#3b82f6`,brightMagenta:`#a855f7`,brightCyan:`#06b6d4`,brightWhite:`#ffffff`},_J={background:`#ffffff`,foreground:`#18181b`,cursor:`#0284c7`,cursorAccent:`#ffffff`,selectionBackground:`rgba(2, 132, 199, 0.2)`,black:`#18181b`,red:`#dc2626`,green:`#16a34a`,yellow:`#ca8a04`,blue:`#2563eb`,magenta:`#9333ea`,cyan:`#0891b2`,white:`#e4e4e7`,brightBlack:`#71717a`,brightRed:`#b91c1c`,brightGreen:`#15803d`,brightYellow:`#a16207`,brightBlue:`#1d4ed8`,brightMagenta:`#7e22ce`,brightCyan:`#0e7490`,brightWhite:`#27272a`};function vJ(e){if(!e)return``;let t=e.split(/[\\/]/).filter(Boolean);return t.length<=3?e:`…/`+t.slice(-3).join(`/`)}function yJ({id:e,cwd:t,isActive:n,isPanelOpen:r,renaming:i,openTerminal:a,sendTerminalInput:o,getTerminalCwd:s,resizeTerminal:c,closeTerminal:l,subscribeTerminal:u,onCwdUpdate:f,registerClear:m}){let h=(0,d.useRef)(null),g=(0,d.useRef)(null),_=(0,d.useRef)(null),v=(0,d.useContext)(p)===`dark`,y=(0,d.useRef)({cwd:t,openTerminal:a,sendTerminalInput:o,getTerminalCwd:s,resizeTerminal:c,closeTerminal:l,subscribeTerminal:u,onCwdUpdate:f,registerClear:m});return y.current={cwd:t,openTerminal:a,sendTerminalInput:o,getTerminalCwd:s,resizeTerminal:c,closeTerminal:l,subscribeTerminal:u,onCwdUpdate:f,registerClear:m},(0,d.useEffect)(()=>{g.current&&(g.current.options.theme=v?gJ:_J)},[v]),(0,d.useEffect)(()=>{if(!h.current)return;let t=new oJ({cursorBlink:!0,cursorStyle:`block`,fontSize:13,fontFamily:`'JetBrains Mono', 'Fira Code', ui-monospace, Menlo, Monaco, 'Courier New', monospace`,lineHeight:1.2,theme:v?gJ:_J}),n=new lJ;t.loadAddon(n),t.loadAddon(new hJ),t.open(h.current),n.fit(),g.current=t,_.current=n,y.current.registerClear(e,()=>{t.clear()}),y.current.openTerminal?.(e,y.current.cwd,t.cols,t.rows);let r=null,i=0,a=()=>{let t=Date.now();if(t-i<1e3){r||=setTimeout(()=>{r=null,i=Date.now(),y.current.getTerminalCwd?.(e)},1e3-(t-i));return}i=t,y.current.getTerminalCwd?.(e)},o=t.onData(t=>{y.current.sendTerminalInput?.(e,t),(t.includes(`\r`)||t.includes(`
|
|
350
|
+
`))&&a()}),s=y.current.subscribeTerminal?.(e,{onData:n=>{t.write(n);let r=n.match(/\x1b\]7;file:\/\/[^/]*([^\x07\x1b]+)(?:\x07|\x1b\\)/);if(r&&r[1])try{let t=decodeURIComponent(r[1]);y.current.onCwdUpdate(e,t)}catch{}},onCwd:t=>{y.current.onCwdUpdate(e,t)},onExit:e=>{t.writeln(`\r\n\x1b[90m[Process completed (exit code ${e??0})]\x1b[0m`)},onError:e=>{t.writeln(`\r\n\x1b[31m[Terminal error: ${e}]\x1b[0m`)}})??(()=>{}),c=new ResizeObserver(()=>{if(h.current&&h.current.clientWidth>0&&h.current.clientHeight>0)try{n.fit(),t.cols>0&&t.rows>0&&y.current.resizeTerminal?.(e,t.cols,t.rows)}catch{}});return c.observe(h.current),()=>{o.dispose(),s(),c.disconnect(),t.dispose(),y.current.closeTerminal?.(e)}},[e]),(0,d.useEffect)(()=>{if(!i&&r&&n&&_.current&&g.current&&h.current){y.current.getTerminalCwd?.(e);let t=setTimeout(()=>{try{_.current?.fit(),g.current?.focus()}catch{}},50);return()=>clearTimeout(t)}},[r,n,e,i]),(0,A.jsx)(`div`,{ref:h,className:`h-full w-full p-2 bg-white dark:bg-zinc-950 overflow-hidden ${n?`block`:`hidden`}`})}function bJ({open:e,onClose:t,cwd:n,onSetWorkspaceRoot:r,openTerminal:i,sendTerminalInput:a,getTerminalCwd:o,resizeTerminal:s,closeTerminal:c,subscribeTerminal:l}){let[u,f]=(0,d.useState)(e);(0,d.useEffect)(()=>{e&&f(!0)},[e]);let[p,m]=(0,d.useState)([{id:`term-1`,title:`terminal 1`}]),[h,g]=(0,d.useState)(`term-1`),[_,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)({}),[C,w]=(0,d.useState)(!1),[T,ee]=(0,d.useState)(!1),te=(0,d.useRef)(new Map),E=(0,d.useCallback)((e,t)=>{te.current.set(e,t)},[]),ne=(0,d.useCallback)((e,t)=>{S(n=>({...n,[e]:t}))},[]),re=(0,d.useCallback)(()=>{let e=p.length+1,t=`term-${Date.now()}-${e}`,n={id:t,title:`terminal ${e}`};m(e=>[...e,n]),g(t)},[p.length]),ie=(0,d.useCallback)((e,n)=>{if(n.stopPropagation(),p.length<=1){t();return}m(t=>{let n=t.filter(t=>t.id!==e);if(h===e){let r=t.findIndex(t=>t.id===e),i=n[Math.max(0,r-1)]?.id??n[0]?.id;g(i)}return n}),te.current.delete(e),S(t=>{let n={...t};return delete n[e],n})},[p.length,h,t]),ae=(e,t)=>{t.stopPropagation(),v(e.id),b(e.title)},D=()=>{if(_){let e=y.trim();e&&m(t=>t.map(t=>t.id===_?{...t,title:e}:t)),v(null)}},oe=e=>{e.key===`Enter`?D():e.key===`Escape`&&v(null)},se=(0,d.useCallback)(()=>{let e=te.current.get(h);e&&e()},[h]),O=x[h]||n||``;return u?(0,A.jsxs)(`div`,{className:`flex-col border-t border-zinc-200 dark:border-zinc-800 bg-zinc-100 dark:bg-zinc-900 transition-all duration-150 ${e?`flex`:`hidden`} ${C?`h-[85vh]`:`h-72`} relative z-20`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 border-b border-zinc-200 dark:border-zinc-800 select-none bg-zinc-50 dark:bg-zinc-950 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex items-center space-x-1 overflow-x-auto min-w-0`,children:[(0,A.jsx)(`div`,{className:`flex items-center space-x-1`,children:p.map(e=>{let t=e.id===h,n=e.id===_;return(0,A.jsxs)(`div`,{onClick:()=>g(e.id),onDoubleClick:t=>ae(e,t),title:`Double-click to rename tab`,className:`flex items-center space-x-1 px-2.5 py-1 rounded text-xs cursor-pointer transition-colors ${t?`bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 font-medium shadow-sm`:`text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50`}`,children:[n?(0,A.jsx)(`input`,{type:`text`,"data-testid":`terminal-tab-rename-input`,value:y,autoFocus:!0,onChange:e=>b(e.target.value),onBlur:D,onKeyDown:oe,className:`bg-transparent border border-sky-500 rounded px-1 py-0 text-xs font-mono outline-none text-zinc-900 dark:text-zinc-100 w-24`}):(0,A.jsx)(`span`,{children:e.title}),p.length>1&&(0,A.jsx)(`span`,{onClick:t=>ie(e.id,t),role:`button`,tabIndex:0,"aria-label":`Close terminal tab`,className:`ml-1 hover:text-red-500 rounded p-0.5 hover:bg-zinc-200 dark:hover:bg-zinc-700`,children:(0,A.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,A.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]},e.id)})}),(0,A.jsx)(`button`,{onClick:re,type:`button`,title:`New Terminal Tab`,className:`p-1 rounded text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60`,children:(0,A.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,A.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 4v16m8-8H4`})})})]}),O&&(0,A.jsx)(`div`,{className:`hidden md:flex items-center space-x-1.5 px-2 text-xs font-mono text-zinc-500 dark:text-zinc-400`,children:r&&(0,A.jsx)(`button`,{onClick:()=>{if(O&&r){if((O===`/`||O===`\\`||/^[A-Za-z]:[\\/]?$/.test(O))&&!window.confirm(`Open root filesystem "${O}" as the workspace project?`))return;r(O),ee(!0),setTimeout(()=>ee(!1),2e3)}},type:`button`,title:`Open "${O}" as the workspace project and reposition the LLM agent`,className:`flex items-center space-x-1 px-1.5 py-0.5 rounded text-[11px] font-sans transition-colors ${T?`bg-emerald-500 text-white font-medium`:`bg-zinc-200/80 hover:bg-sky-500 hover:text-white dark:bg-zinc-800 dark:hover:bg-sky-600 dark:hover:text-white text-zinc-700 dark:text-zinc-300`}`,children:(0,A.jsx)(`span`,{children:T?`✓ Project opened`:`📁 ${vJ(O)} → open as project`})})}),(0,A.jsxs)(`div`,{className:`flex items-center space-x-1 text-zinc-500 dark:text-zinc-400`,children:[(0,A.jsx)(`button`,{onClick:se,type:`button`,title:`Clear Terminal Output`,className:`p-1 rounded hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60`,children:(0,A.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,A.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})})}),(0,A.jsx)(`button`,{onClick:()=>w(e=>!e),type:`button`,title:C?`Restore Terminal Panel`:`Maximize Terminal Panel`,className:`p-1 rounded hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60`,children:C?(0,A.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,A.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})}):(0,A.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,A.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 15l7-7 7 7`})})}),(0,A.jsx)(`button`,{onClick:t,type:`button`,title:"Minimize Terminal Panel (Ctrl+`)",className:`p-1 rounded hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60`,children:(0,A.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,A.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})]}),(0,A.jsx)(`div`,{className:`flex-1 min-h-0 relative`,children:p.map(t=>(0,A.jsx)(yJ,{id:t.id,cwd:n,isActive:t.id===h,isPanelOpen:e,renaming:_!==null,openTerminal:i,sendTerminalInput:a,getTerminalCwd:o,resizeTerminal:s,closeTerminal:c,subscribeTerminal:l,onCwdUpdate:ne,registerClear:E},t.id))})]}):null}var xJ={todo:{label:`To do`,className:`text-zinc-500`},in_progress:{label:`In progress`,className:`text-blue-600 dark:text-blue-400`},done:{label:`Done`,className:`text-emerald-600 dark:text-emerald-400`},blocked:{label:`Blocked`,className:`text-red-600 dark:text-red-400`},needs_review:{label:`Needs review`,className:`text-amber-600 dark:text-amber-400`},passed:{label:`Passed`,className:`text-emerald-600 dark:text-emerald-400`},failed:{label:`Failed`,className:`text-red-600 dark:text-red-400`},inconclusive:{label:`Inconclusive`,className:`text-amber-600 dark:text-amber-400`},informational:{label:`Informational`,className:`text-zinc-500`},modified:{label:`Modified`,className:`text-blue-600 dark:text-blue-400`},added:{label:`Added`,className:`text-emerald-600 dark:text-emerald-400`},deleted:{label:`Deleted`,className:`text-red-600 dark:text-red-400`},untracked:{label:`Untracked`,className:`text-zinc-600 dark:text-zinc-300`},conflicted:{label:`Conflicted`,className:`text-red-600 dark:text-red-400`},unavailable:{label:`Unavailable`,className:`text-red-600 dark:text-red-400`},"not-recorded":{label:`Not recorded`,className:`text-zinc-500`}};function SJ(e){return xJ[e]??{label:e,className:`text-zinc-500`}}function CJ({entry:e,onTarget:t}){let n=SJ(e.status),r=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsx)(`span`,{className:`min-w-0 break-words text-sm font-medium text-zinc-900 dark:text-zinc-100`,children:e.title}),(0,A.jsx)(`span`,{className:`shrink-0 text-[11px] font-semibold uppercase tracking-wide ${n.className}`,children:n.label})]}),e.group&&(0,A.jsx)(`div`,{className:`mt-0.5 text-[11px] text-zinc-500`,children:e.group}),e.detail&&(0,A.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-xs text-zinc-600 dark:text-zinc-300`,children:e.detail}),e.reference&&(0,A.jsx)(`div`,{className:`mt-1 truncate text-xs text-zinc-500`,children:e.reference}),(0,A.jsx)(`div`,{className:`mt-1 text-[10px] uppercase tracking-wide text-zinc-400`,children:e.source})]}),i=`block w-full rounded-md border border-zinc-200 p-2 text-left hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-900`;return e.target?.kind===`external-url`?(0,A.jsx)(`a`,{href:e.target.url,target:`_blank`,rel:`noreferrer`,className:i,children:r}):e.target?(0,A.jsx)(`button`,{type:`button`,onClick:()=>t(e.target),className:i,children:r}):(0,A.jsx)(`div`,{className:`rounded-md border border-zinc-200 p-2 dark:border-zinc-800`,children:r})}function wJ({state:e,onClose:t,onRefresh:n,onTarget:r}){return(0,A.jsxs)(`aside`,{"aria-label":`Workspace Outcome`,className:`absolute inset-y-0 right-0 z-10 flex w-full flex-col border-l border-zinc-200 bg-white/95 shadow-lg backdrop-blur md:w-[26rem] dark:border-zinc-800 dark:bg-zinc-950/95`,children:[(0,A.jsxs)(`header`,{className:`flex items-start justify-between gap-2 border-b border-zinc-200 px-3 py-3 dark:border-zinc-800`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-zinc-500`,children:`Workspace review`}),(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:`Outcome`})]}),(0,A.jsxs)(`div`,{className:`flex gap-1`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:n,className:`rounded px-2 py-1 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:`Refresh`}),(0,A.jsx)(`button`,{type:`button`,onClick:t,className:`rounded px-2 py-1 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,"aria-label":`Close Outcome`,children:`×`})]})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:e===null||e.status===`loading`?(0,A.jsx)(`div`,{role:`status`,className:`text-sm text-zinc-500`,children:`Loading Outcome…`}):e.status===`error`?(0,A.jsx)(`div`,{role:`alert`,className:`rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/30 dark:text-red-300`,children:e.message}):(0,A.jsx)(`div`,{className:`space-y-4`,children:e.outcome.sections.map(e=>(0,A.jsxs)(`section`,{"aria-labelledby":`outcome-${e.id}`,className:`rounded-lg border border-zinc-200 p-3 dark:border-zinc-800`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,A.jsx)(`h3`,{id:`outcome-${e.id}`,className:`text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:e.title}),e.availability===`partial`||e.availability===`unavailable`?(0,A.jsx)(`span`,{className:`text-[11px] font-semibold uppercase text-red-600 dark:text-red-400`,children:e.availability}):null]}),e.summary&&(0,A.jsx)(`p`,{className:`mt-1 text-xs text-zinc-600 dark:text-zinc-300`,children:e.summary}),e.entries.length>0&&(0,A.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.entries.map(e=>(0,A.jsx)(CJ,{entry:e,onTarget:r},e.id))})]},e.id))})})]})}var TJ=`pi-outpost:token`;function EJ(){let e=null;try{let t=new URL(window.location.href);return e=t.searchParams.get(`token`),e&&(localStorage.setItem(TJ,e),t.searchParams.delete(`token`),window.history.replaceState(null,``,`${t.pathname}${t.search}${t.hash}`)),localStorage.getItem(TJ)}catch{return e}}function DJ(){try{return localStorage.getItem(TJ)}catch{return null}}function OJ(e){try{localStorage.setItem(TJ,e)}catch{}}var kJ=class extends Error{kind;constructor(e,t){super(e),this.name=`HistoryError`,this.kind=t}};async function AJ(e,t){let n=[];for(;;){let r=await e(n.length,50);if(r.items.length===0||(n.unshift(...r.items),t?.(n.length),r.remaining===0))return n}}function jJ(e){let t=e.lastIndexOf(`/`);return t<0?``:e.slice(0,t)}function MJ(e,t){return e.base.rev===t.base.rev&&e.base.path===t.base.path&&e.target.rev===t.target.rev&&e.target.path===t.target.path}function NJ(){return{clonePath:null,preview:null,enrollment:null,refresh:null,updates:{},skills:{},removals:{}}}var PJ={connected:!1,workspace:null,workspaces:[],workspaceLocked:!1,embedWorkspaceControls:`settings`,switching:!1,agentStarting:!1,authRequired:!1,brandingReady:!1,branding:{},sessionId:``,sessionName:null,model:``,thinkingLevel:`off`,modelSupportsReasoning:!1,models:[],commands:[],sessions:null,sessionSearch:null,tree:null,isStreaming:!1,items:[],olderHistory:null,pendingPrompt:null,workPlan:null,replyConformance:{},structuredAppearance:null,outpostUpdate:null,piPackages:null,piPackageUpdate:null,serverRestarting:!1,restartNeeded:[],outcome:null,queue:{steering:[],followUp:[]},errors:[],contextUsage:null,isCompacting:!1,dialogQueue:[],notifications:[],statuses:{},widgets:{},editorPrefill:null,fileTree:{},directoryRequests:{},openFile:null,previewRevision:0,fileSearch:null,createError:null,created:null,fileOperation:null,extensionPaths:null,configuredExtensionPaths:[],userExtensionPaths:[],extensionLock:!1,tools:[],sandbox:null,terminal:null,userSkillPaths:[],serverBrowse:null,settingsApply:null,agentResources:null,agentResourceOperations:NJ(),versions:null,gitAvailable:!1,gitUnavailable:null,credentials:null,gitStatus:null,gitDiff:null,gitLog:null,gitShow:null,gitFileHistory:null,gitFileDiff:null};function FJ(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.kind===`assistant`&&r.streaming){let i=[...e];return i[n]=t(r),i}}return[...e,t({kind:`assistant`,blocks:[],streaming:!0})]}function IJ(e,t,n,r){for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.kind===`tool`&&i.toolCallId===t){let t=[...e];return t[n]={...i,...r},t}}return[...e,{kind:`tool`,toolCallId:t,toolName:n,args:{},output:``,running:!0,...r}]}function LJ(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.kind===`tool`&&i.toolCallId===t){let t=[...e];return t[r]={...i,...n},t}}return e}function RJ(e,t){if(t.type!==`hello`&&t.type!==`session_replaced`&&t.type!==`update_config_ack`&&t.type!==`workspace_switched`&&t.type!==`workspace_starting`)return e;let n=t.models.find(e=>`${e.provider}/${e.id}`===t.model);return{...e,replyConformance:{},structuredAppearance:t.type===`workspace_switched`||t.type===`workspace_starting`?null:e.structuredAppearance,agentStarting:t.agentStarting===!0,outpostUpdate:t.outpostUpdate??e.outpostUpdate,piPackages:t.piPackages??e.piPackages,serverRestarting:!1,restartNeeded:t.restartNeeded??[],connected:!0,brandingReady:!0,workspace:t.workspace??null,workspaces:t.workspaces??[],workspaceLocked:t.workspaceLocked===!0,embedWorkspaceControls:t.embedWorkspaceControls??`settings`,switching:!1,branding:t.branding,sessionId:t.sessionId,sessionName:t.sessionName??null,model:t.model,thinkingLevel:t.thinkingLevel,thinkingLevels:t.thinkingLevels,modelSupportsReasoning:n?.reasoning??!1,models:t.models,commands:t.commands,isStreaming:t.isStreaming,items:t.items,olderHistory:t.olderItems?{remaining:t.olderItems,have:0,loading:!1,error:null}:null,pendingPrompt:null,workPlan:t.workPlan??null,outcome:null,queue:{steering:[],followUp:[]},errors:[],contextUsage:t.contextUsage??null,isCompacting:!1,dialogQueue:[],notifications:[],statuses:{},widgets:{},extensionTitle:void 0,editorPrefill:null,tree:null,fileTree:{},directoryRequests:{},fileOperation:null,writableRoot:t.writableRoot,docxTemplate:t.docxTemplate,gitAvailable:t.gitAvailable===!0,gitUnavailable:t.gitUnavailable??null,credentials:t.credentials??null,extensionPaths:t.extensionPaths??null,configuredExtensionPaths:t.configuredExtensionPaths??[],userExtensionPaths:t.userExtensionPaths??[],extensionLock:t.extensionLock===!0,tools:t.tools??[],sandbox:t.sandbox??null,terminal:t.terminal??null,userSkillPaths:t.userSkillPaths??[],serverBrowse:null,settingsApply:null,versions:t.versions??null,agentResources:t.agentResources??null,agentResourceOperations:t.type===`hello`||t.type===`workspace_switched`||t.type===`workspace_starting`?NJ():e.agentResourceOperations}}function zJ(e,t){if(t.type===`connected`)return{...e,connected:!0,authRequired:!1};if(t.type===`workspace_switching`)return{...e,switching:!0};if(t.type===`pi_package_update_started`)return{...e,piPackageUpdate:{requestId:t.requestId,source:t.source,status:`pending`}};if(t.type===`auth_required`)return{...e,connected:!1,authRequired:!0};if(t.type===`auth_retrying`)return{...e,authRequired:!1};if(t.type===`disconnected`){let t=e.openFile,n=t?.status===`loaded`&&t.pendingSave!==void 0?{...t,pendingSave:void 0,saveError:{message:`Connection lost while saving — try again`,conflict:!1}}:e.openFile,r=e.outcome?.status===`loading`?{...e.outcome,status:`error`,message:`Connection lost while loading Outcome.`}:e.outcome;return{...e,connected:!1,openFile:n,outcome:r}}if(t.type===`branding_settled`)return{...e,brandingReady:!0};if(t.type===`branding_loaded`)return{...e,brandingReady:!0,branding:t.branding};if(t.type===`prompt_sent`)return{...e,pendingPrompt:{text:t.text,...t.images?.length?{images:t.images}:{}}};if(t.type===`dismiss_notification`)return{...e,notifications:e.notifications.filter(e=>e.id!==t.id)};if(t.type===`dialog_answered`)return{...e,dialogQueue:e.dialogQueue.slice(1)};if(t.type===`dir_list_started`){let n=e.fileTree[t.path];return{...e,fileTree:{...e.fileTree,[t.path]:t.preserveEntries&&Array.isArray(n)?n:`loading`},directoryRequests:{...e.directoryRequests,[t.path]:t.requestId}}}if(t.type===`raw_preview_changed`)return e.openFile?.path===t.path?{...e,previewRevision:e.previewRevision+1}:e;if(t.type===`file_read_started`){let n=e.openFile;return t.preserveContent&&n?.status===`loaded`&&n.path===t.path?{...e,openFile:{...n,refreshRequestId:t.requestId}}:{...e,openFile:{status:`loading`,path:t.path,requestId:t.requestId}}}if(t.type===`file_save_started`){let n=e.openFile;return!e.connected||n?.status!==`loaded`||n.path!==t.path?e:{...e,openFile:{...n,pendingSave:{requestId:t.requestId,content:t.content},saveError:void 0}}}if(t.type===`close_file_preview`)return{...e,openFile:null};if(t.type===`file_search_started`)return{...e,fileSearch:{status:`loading`,query:t.query,requestId:t.requestId,results:[]}};if(t.type===`file_search_cleared`)return{...e,fileSearch:null};if(t.type===`file_create_started`)return{...e,createError:null,created:null};if(t.type===`file_operation_started`)return{...e,fileOperation:{status:`pending`,operation:t.operation,path:t.path,requestId:t.requestId}};if(t.type===`session_search_started`)return{...e,sessionSearch:{status:`loading`,query:t.query,requestId:t.requestId,results:[]}};if(t.type===`session_search_cleared`)return{...e,sessionSearch:null};if(t.type===`history_load_started`)return e.olderHistory?{...e,olderHistory:{...e.olderHistory,loading:!0,error:null}}:e;if(t.type===`history_loaded`)return e.olderHistory?{...e,items:[...t.items,...e.items],olderHistory:{remaining:t.remaining,have:e.olderHistory.have+t.items.length,loading:!1,error:null}}:e;if(t.type===`history_load_failed`)return e.olderHistory?{...e,olderHistory:{...e.olderHistory,loading:!1,error:t.message}}:e;if(t.type===`git_diff_started`||t.type===`git_diff_cleared`)return{...e,gitDiff:null};if(t.type===`git_show_cleared`)return{...e,gitShow:null,gitLog:e.gitLog};if(t.type===`git_file_history_started`)return{...e,gitFileHistory:{path:t.path,status:`loading`,entries:[],requestId:t.requestId},gitFileDiff:null};if(t.type===`git_file_history_closed`)return{...e,gitFileHistory:null,gitFileDiff:null};if(t.type===`git_file_diff_started`)return{...e,gitFileDiff:{base:t.base,target:t.target,status:`loading`,beforeText:e.gitFileDiff?.beforeText??``,afterText:e.gitFileDiff?.afterText??``,requestId:t.requestId}};if(t.type===`git_file_diff_cleared`)return{...e,gitFileDiff:null};if(t.type===`server_browse_started`)return{...e,serverBrowse:{status:`loading`,path:e.serverBrowse?.path??t.path,parent:e.serverBrowse?.parent??null,entries:e.serverBrowse?.entries??[],requestId:t.requestId}};if(t.type===`server_browse_closed`)return{...e,serverBrowse:null};if(t.type===`settings_apply_started`)return{...e,settingsApply:{status:`applying`}};if(t.type===`resource_clone_path_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,clonePath:{requestId:t.requestId,status:`loading`}}};if(t.type===`resource_preview_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,preview:{requestId:t.requestId,status:`loading`}}};if(t.type===`resource_enrollment_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,enrollment:{requestId:t.requestId,status:`loading`}}};if(t.type===`resource_refresh_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,refresh:{requestId:t.requestId,status:`loading`,...t.repositoryId?{repositoryId:t.repositoryId}:{}}}};if(t.type===`resource_update_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,updates:{...e.agentResourceOperations.updates,[t.repositoryId]:{requestId:t.requestId,status:`loading`}}}};if(t.type===`resource_skills_started`){let n=e.agentResourceOperations;return{...e,agentResourceOperations:{...n,skills:{...n.skills,[t.repositoryId]:{requestId:t.requestId,status:`loading`}}}}}if(t.type===`resource_removal_started`){let n=e.agentResourceOperations;return{...e,agentResourceOperations:{...n,removals:{...n.removals,[t.repositoryId]:{requestId:t.requestId,status:`loading`}}}}}if(t.type===`outcome_started`)return{...e,outcome:{status:`loading`,requestId:t.requestId,workspaceRoot:t.workspaceRoot,sessionId:t.sessionId}};if(t.type===`outcome_failed`){let n=e.outcome;return n===null||n.status!==`loading`||n.requestId!==t.requestId?e:{...e,outcome:{...n,status:`error`,message:t.message}}}let n=t.message;if(n.type===`workspace_switched`&&e.agentStarting&&e.workspace&&n.workspace&&tI(n.workspace)===tI(e.workspace))return{...RJ(e,n),openFile:e.openFile,gitDiff:e.gitDiff,fileTree:e.fileTree,directoryRequests:e.directoryRequests};switch(n.type){case`workspace_switched`:case`hello`:case`session_replaced`:case`update_config_ack`:case`workspace_starting`:return{...RJ(e,n),openFile:null,gitDiff:null,fileTree:{},directoryRequests:{}};case`workspace_activity`:return{...e,workspaces:n.workspaces,workspace:(e.workspace&&n.workspaces.find(t=>tI(t)===tI(e.workspace)))??e.workspace};case`agent_resource_clone_path`:{let t=e.agentResourceOperations.clonePath;return t?.requestId===n.requestId?{...e,agentResourceOperations:{...e.agentResourceOperations,clonePath:{...t,status:`ready`,path:n.path}}}:e}case`agent_resource_preview`:{let t=e.agentResourceOperations.preview;return t?.requestId===n.requestId?{...e,agentResourceOperations:{...e.agentResourceOperations,preview:{...t,status:`ready`,preview:n.preview}}}:e}case`agent_resource_enrolled`:{let t=e.agentResourceOperations.enrollment;return t?.requestId===n.requestId?{...e,agentResources:n.inventory,agentResourceOperations:{...e.agentResourceOperations,preview:null,enrollment:{...t,status:`ready`}}}:e}case`agent_resource_assessments`:{let t=e.agentResourceOperations.refresh;if(t?.requestId!==n.requestId||!e.agentResources)return e;let r=new Map(n.assessments.map(e=>[e.repositoryId,e]));return{...e,agentResources:{...e.agentResources,repositories:e.agentResources.repositories.map(e=>({...e,assessment:r.get(e.id)??e.assessment}))},agentResourceOperations:{...e.agentResourceOperations,refresh:{...t,status:`ready`}}}}case`agent_resource_inventory`:return{...e,agentResources:n.inventory};case`agent_resource_update_result`:{let t=n.result.repositoryId;if(!t)return e;let r=e.agentResourceOperations.updates[t];return r?.requestId===n.requestId?{...e,agentResources:n.inventory,agentResourceOperations:{...e.agentResourceOperations,updates:{...e.agentResourceOperations.updates,[t]:{...r,status:`ready`,result:n.result}}}}:e}case`agent_resource_skills_applied`:{let t=e.agentResourceOperations,r=t.skills[n.repositoryId];return r?.requestId===n.requestId?{...e,agentResources:n.inventory,agentResourceOperations:{...t,skills:{...t.skills,[n.repositoryId]:{...r,status:`ready`}}}}:e}case`agent_resource_removed`:{let t=e.agentResourceOperations,r=t.removals[n.repositoryId];return r?.requestId===n.requestId?{...e,agentResources:n.inventory,agentResourceOperations:{...t,removals:{...t.removals,[n.repositoryId]:{...r,status:`ready`,result:n.result}}}}:e}case`agent_resource_error`:{let t=e=>e?.requestId===n.requestId?{...e,status:`error`,message:n.message}:null,r=t(e.agentResourceOperations.clonePath),i=t(e.agentResourceOperations.preview),a=t(e.agentResourceOperations.enrollment),o=t(e.agentResourceOperations.refresh),s=e=>{let t=Object.entries(e).find(([,e])=>e.requestId===n.requestId);return t?{...e,[t[0]]:{...t[1],status:`error`,message:n.message}}:null},c=s(e.agentResourceOperations.updates),l=s(e.agentResourceOperations.skills),u=s(e.agentResourceOperations.removals);return!r&&!i&&!a&&!o&&!c&&!l&&!u?e:{...e,agentResourceOperations:{...e.agentResourceOperations,...r?{clonePath:r}:{},...i?{preview:i}:{},...a?{enrollment:a}:{},...o?{refresh:o}:{},...c?{updates:c}:{},...l?{skills:l}:{},...u?{removals:u}:{}}}}case`workspace_error`:return{...e,switching:!1,errors:[...e.errors,n.message]};case`sessions`:return{...e,sessions:n.sessions};case`session_search_results`:return e.sessionSearch?.requestId===n.requestId?{...e,sessionSearch:{...e.sessionSearch,status:`loaded`,results:n.sessions}}:e;case`tree`:return{...e,tree:n.roots};case`editor_prefill`:return{...e,editorPrefill:{text:n.text,nonce:e.editorPrefill?e.editorPrefill.nonce+1:1}};case`model_changed`:return{...e,model:n.model,modelSupportsReasoning:n.reasoning,thinkingLevels:n.thinkingLevels};case`credentials_changed`:{let t=n.models.find(e=>`${e.provider}/${e.id}`===n.model);return{...e,models:n.models,model:n.model,modelSupportsReasoning:t?.reasoning??!1,thinkingLevels:void 0,credentials:n.credentials}}case`extensions_bound`:return{...e,commands:n.commands,tools:n.tools??e.tools};case`thinking_changed`:return{...e,thinkingLevel:n.level};case`work_plan_changed`:return{...e,workPlan:n.workPlan};case`workspace_outcome`:{let t=e.outcome;return t===null||t.requestId!==n.requestId||t.sessionId!==e.sessionId||n.outcome.sessionId!==e.sessionId||t.workspaceRoot!==null&&n.outcome.workspaceRoot!==t.workspaceRoot?e:{...e,outcome:{...t,status:`loaded`,outcome:n.outcome}}}case`workspace_outcome_error`:{let t=e.outcome;return t===null||t.status!==`loading`||t.requestId!==n.requestId?e:{...e,outcome:{...t,status:`error`,message:n.message}}}case`user`:return{...e,pendingPrompt:null,items:[...e.items,{kind:`user`,text:n.text,...n.images?{images:n.images}:{}}]};case`user_entries`:{let{entries:t}=n,r=e.items.flatMap((e,t)=>e.kind===`user`?[t]:[]),i=new Map;for(let n=r.length-1,a=t.length-1;n>=0&&a>=0;n--,a--){let o=e.items[r[n]];if(o.kind!==`user`||o.text!==t[a].text)break;i.set(r[n],t[a].entryId)}return{...e,items:e.items.map((e,t)=>{if(e.kind!==`user`)return e;let n=i.get(t);if(n===e.entryId)return e;if(n===void 0){let{entryId:t,...n}=e;return n}return{...e,entryId:n}})}}case`agent_start`:return{...e,isStreaming:!0,errors:[]};case`agent_end`:return{...e,isStreaming:!1,queue:{steering:[],followUp:[]},items:e.items.map(e=>e.kind===`tool`&&e.running?{...e,running:!1}:e.kind===`assistant`&&e.streaming?{...e,streaming:!1}:e)};case`assistant_start`:return{...e,items:[...e.items,{kind:`assistant`,blocks:[],streaming:!0}]};case`block_delta`:return{...e,items:FJ(e.items,e=>{let t=[...e.blocks],r=t.findIndex(e=>e.contentIndex===n.contentIndex);return r>=0?t[r]={...t[r],text:t[r].text+n.delta}:t.push({type:n.block,text:n.delta,contentIndex:n.contentIndex}),{...e,blocks:t,streaming:!0}})};case`assistant_end`:return{...e,items:FJ(e.items,()=>n.item)};case`custom_message`:return{...e,items:[...e.items,n.item]};case`tool_start`:return{...e,items:IJ(e.items,n.toolCallId,n.toolName,{toolName:n.toolName,args:n.args,running:!0,callHtml:n.callHtml})};case`tool_update`:return{...e,items:IJ(e.items,n.toolCallId,`tool`,{output:n.text,...typeof n.progress==`number`?{progress:n.progress}:{}})};case`tool_end`:return{...e,items:IJ(e.items,n.toolCallId,`tool`,{output:n.text,isError:n.isError,running:!1,outputHtml:n.outputHtml,outputHtmlCollapsed:n.outputHtmlCollapsed,structured:n.structured})};case`structured_conformance`:return{...e,items:LJ(e.items,n.toolCallId,{structuredConformance:n.conformance})};case`structured_appearance`:return{...e,structuredAppearance:n.appearance};case`outpost_update`:return{...e,outpostUpdate:n.notice};case`pi_packages`:return{...e,piPackages:n.packages};case`pi_package_update_result`:{let t=e.piPackageUpdate;return t?.requestId===n.requestId?{...e,piPackageUpdate:{requestId:n.requestId,source:t.source,status:n.outcome,message:n.message}}:e}case`restart_needed`:return{...e,restartNeeded:n.reasons};case`server_restarting`:return{...e,serverRestarting:!0,piPackageUpdate:null};case`reply_structured_conformance`:return{...e,replyConformance:{...e.replyConformance,[n.key]:n.conformance}};case`queue`:return{...e,queue:{steering:n.steering,followUp:n.followUp}};case`context_usage`:return{...e,contextUsage:n.usage};case`compaction_start`:return{...e,isCompacting:!0};case`compaction_end`:return{...e,isCompacting:!1,errors:n.errorMessage?[...e.errors,n.errorMessage]:e.errors};case`error`:return{...e,errors:[...e.errors,n.message],pendingPrompt:null,settingsApply:e.settingsApply?.status===`applying`?{status:`error`,message:n.message}:e.settingsApply};case`server_directory`:return e.serverBrowse?.requestId===n.requestId?{...e,serverBrowse:{status:`loaded`,path:n.path,parent:n.parent,entries:n.entries,requestId:n.requestId}}:e;case`server_directory_error`:return e.serverBrowse?.requestId===n.requestId?{...e,serverBrowse:{...e.serverBrowse,status:`error`,error:n.message}}:e;case`directory_listing`:return n.requestId.startsWith(`dir:`)&&e.directoryRequests[n.path]!==n.requestId?e:{...e,fileTree:{...e.fileTree,[n.path]:n.entries},...n.requestId.startsWith(`create:`)?{created:n.path,createError:null}:{}};case`file_content`:{let t=e.openFile,r=t?.status===`loading`&&t.requestId===n.requestId,i=t?.status===`loaded`&&t.refreshRequestId===n.requestId;return!r&&!i?e:{...e,openFile:{status:`loaded`,path:n.path,content:n.content,size:n.size,mtimeMs:n.mtimeMs,...n.documentIssues===void 0?{}:{documentIssues:n.documentIssues}}}}case`file_written`:{if(n.requestId.startsWith(`create:`))return{...e,createError:null,created:n.path,openFile:{status:`loaded`,path:n.path,content:``,size:n.size,mtimeMs:n.mtimeMs,justCreated:!0}};let t=e.openFile;return t?.status!==`loaded`||t.pendingSave?.requestId!==n.requestId?e:{...e,openFile:{status:`loaded`,path:t.path,content:t.pendingSave.content,size:n.size,mtimeMs:n.mtimeMs}}}case`file_operation_result`:{if(e.fileOperation?.status!==`pending`||e.fileOperation.requestId!==n.requestId)return e;let t=n.previousPath??n.path,r=n.operation===`delete_file`&&e.openFile?.path===n.path?null:e.openFile?.path===t?{...e.openFile,path:n.path}:e.openFile,i=e.gitFileHistory?.path===t||e.gitFileHistory?.path===n.path,a=e.gitDiff?.path===t||e.gitDiff?.path===n.path;return{...e,openFile:r,gitFileHistory:i?null:e.gitFileHistory,gitFileDiff:i?null:e.gitFileDiff,gitDiff:a?null:e.gitDiff,fileOperation:{status:`succeeded`,operation:n.operation,path:e.fileOperation.path,resultPath:n.path,requestId:n.requestId}}}case`file_browser_error`:if(n.requestId.startsWith(`dir:`))return e.directoryRequests[n.path]===n.requestId?{...e,fileTree:{...e.fileTree,[n.path]:{error:n.message}}}:e;if(n.requestId.startsWith(`create:`))return{...e,createError:{path:n.path,message:n.message}};if(n.requestId.startsWith(`write:`)){let t=e.openFile;return t?.status!==`loaded`||t.pendingSave?.requestId!==n.requestId?e:{...e,openFile:{...t,pendingSave:void 0,saveError:{message:n.message,conflict:n.reason===`conflict`}}}}return n.requestId.startsWith(`fileop:`)?e.fileOperation?.status!==`pending`||e.fileOperation.requestId!==n.requestId?e:{...e,fileOperation:{status:`error`,operation:e.fileOperation.operation,path:e.fileOperation.path,message:n.message,requestId:n.requestId}}:e.openFile?.status===`loading`&&e.openFile.requestId===n.requestId?{...e,openFile:{status:`error`,path:n.path,message:n.message}}:e.openFile?.status===`loaded`&&e.openFile.refreshRequestId===n.requestId?{...e,openFile:{...e.openFile,refreshRequestId:void 0}}:e;case`file_search_results`:return e.fileSearch?.requestId===n.requestId?{...e,fileSearch:{...e.fileSearch,status:`loaded`,results:n.results}}:e;case`git_status`:{let t={};for(let e of n.files)t[e.path]=e.status;let r=e.gitStatus;if(n.repo===void 0||r===null)return{...e,gitStatus:{repos:n.repos,files:t}};let i={};for(let[e,t]of Object.entries(r.files))UI(r.repos,e)?.repo!==n.repo&&(i[e]=t);let a=r.repos.map(e=>n.repos.find(t=>t.repo===e.repo)??e);return{...e,gitStatus:{repos:a,files:{...i,...t}}}}case`git_repositories_changed`:return{...e,gitAvailable:n.available,gitUnavailable:n.available?null:n.unavailable??null,gitStatus:n.available?e.gitStatus:null};case`git_diff`:return{...e,gitDiff:{path:n.path,before:n.before,after:n.after}};case`git_log`:return{...e,gitLog:{repo:n.repo,entries:n.entries}};case`git_show`:return{...e,gitShow:{sha:n.sha,patch:n.patch,truncated:n.truncated}};case`git_file_log`:return e.gitFileHistory?.requestId===n.requestId?{...e,gitFileHistory:{...e.gitFileHistory,status:`loaded`,entries:n.entries}}:e;case`git_file_diff`:return e.gitFileDiff===null||!MJ(e.gitFileDiff,n)?e:{...e,gitFileDiff:{...e.gitFileDiff,status:`loaded`,beforeText:n.beforeText,afterText:n.afterText}};case`git_error`:return n.requestId.startsWith(`gitdiff:`)?{...e,gitDiff:e.openFile?{path:e.openFile.path,error:n.message}:null}:n.requestId===e.gitFileHistory?.requestId?{...e,gitFileHistory:{...e.gitFileHistory,status:`error`,error:n.message}}:n.requestId===e.gitFileDiff?.requestId?{...e,gitFileDiff:{...e.gitFileDiff,status:`error`,error:n.message}}:{...e,errors:[...e.errors,`git: ${n.message}`]};case`extension_ui_request`:switch(n.method){case`select`:case`confirm`:case`input`:case`editor`:return{...e,dialogQueue:[...e.dialogQueue,n]};case`notify`:return{...e,notifications:[...e.notifications,{id:n.id,message:n.message,notifyType:n.notifyType}]};case`setStatus`:{let t={...e.statuses};return n.statusText===void 0?delete t[n.statusKey]:t[n.statusKey]=n.statusText,{...e,statuses:t}}case`setWidget`:{let t={...e.widgets};return n.widgetLines===void 0?delete t[n.widgetKey]:t[n.widgetKey]={lines:n.widgetLines,placement:n.widgetPlacement??`aboveEditor`},{...e,widgets:t}}case`setTitle`:return{...e,extensionTitle:n.title};case`set_editor_text`:return{...e,editorPrefill:{text:n.text,nonce:e.editorPrefill?e.editorPrefill.nonce+1:1}};default:return e}default:return e}}function BJ(e,t,n){let r=e?`${e.replace(/^http/,`ws`)}/ws`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/ws`,i=new URLSearchParams;t&&i.set(`token`,t),n&&i.set(`workspace`,n);let a=i.toString();return a?`${r}?${a}`:r}var VJ=12e4,HJ=2e4,UJ=45e3,WJ=4401,GJ=1e3;function KJ(e=``,t,n=!1,r){let[i,a]=(0,d.useReducer)(zJ,PJ),o=(0,d.useRef)(null),[s,c]=(0,d.useState)(0),l=(0,d.useRef)(null),u=(0,d.useRef)(null);s===0&&l.current===null&&(l.current=t??(n?DJ():EJ()));let f=(0,d.useRef)(i.fileTree),p=(0,d.useRef)(i.openFile);(0,d.useEffect)(()=>{f.current=i.fileTree},[i.fileTree]),(0,d.useEffect)(()=>{p.current=i.openFile},[i.openFile]);let m=(0,d.useRef)(null);(0,d.useEffect)(()=>{m.current=i.gitDiff?.path??null},[i.gitDiff]);let h=(0,d.useRef)(new Map),g=(0,d.useRef)(new Map),_=(0,d.useRef)(i.sessionId);(0,d.useEffect)(()=>{_.current=i.sessionId},[i.sessionId]);let v=(0,d.useRef)(!1),y=(0,d.useRef)(i.olderHistory);(0,d.useEffect)(()=>{y.current=i.olderHistory},[i.olderHistory]);let b=(0,d.useRef)(i.writableRoot);(0,d.useEffect)(()=>{b.current=i.writableRoot},[i.writableRoot]);let x=(0,d.useRef)(!1),S=(0,d.useRef)(new Map),C=i.workspace?tI(i.workspace):null,w=(0,d.useRef)({workspaceRoot:C,sessionId:i.sessionId});(0,d.useEffect)(()=>{w.current={workspaceRoot:C,sessionId:i.sessionId}},[C,i.sessionId]);let T=(0,d.useCallback)(e=>{let t=o.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify(e))},[]),ee=(0,d.useRef)(!1),te=(0,d.useRef)(null),E=(0,d.useRef)(!1),ne=(0,d.useRef)(null),re=(0,d.useRef)(()=>{}),ie=(0,d.useCallback)(()=>{te.current=null,ne.current!==null&&(clearTimeout(ne.current),ne.current=null)},[]),oe=(0,d.useCallback)(()=>{let e=o.current;if(!e||e.readyState!==WebSocket.OPEN)return;if(te.current!==null){E.current=!0;return}let t=`outcome:${crypto.randomUUID()}`;te.current=t;let n=w.current;a({type:`outcome_started`,requestId:t,...n}),T({type:`get_outcome`,requestId:t}),ne.current=setTimeout(()=>{te.current===t&&(ie(),E.current=!1,a({type:`outcome_failed`,requestId:t,message:`The Outcome took too long to answer — try again.`}))},UJ)},[T,ie]);re.current=oe;let se=(0,d.useCallback)(()=>{ee.current&&re.current()},[]),O=(0,d.useCallback)(e=>{ee.current=e,e?oe():E.current=!1},[oe]),ce=(0,d.useCallback)((e,t=!1)=>{e===``&&(x.current=!0);let n=`dir:${crypto.randomUUID()}`;a({type:`dir_list_started`,path:e,requestId:n,preserveEntries:t}),T({type:`list_directory`,path:e,requestId:n})},[T]),k=(0,d.useRef)(!1),A=(0,d.useRef)([]);(0,d.useEffect)(()=>{A.current=i.gitStatus?.repos??[]},[i.gitStatus]);let le=(0,d.useRef)(new Set),ue=(0,d.useRef)(new Set),de=(0,d.useRef)(new Map),j=(0,d.useCallback)(e=>{if(!k.current)return;let t=e??``;if(le.current.has(t)){ue.current.add(t);return}le.current.add(t);let n=`git:${crypto.randomUUID()}`;de.current.set(n,t),T({type:`git_status`,...e===void 0?{}:{repo:e},requestId:n})},[T]),fe=(0,d.useCallback)(e=>{let t=de.current.get(e)??``;de.current.delete(e),le.current.delete(t),ue.current.delete(t)&&j(t===``?void 0:t)},[j]),pe=(0,d.useCallback)(e=>{f.current[e]!==void 0&&ce(e,!0)},[ce]),me=(0,d.useCallback)(()=>{ce(``,!0);for(let e of Object.keys(f.current))e!==``&&pe(e)},[pe,ce]);(0,d.useEffect)(()=>{!i.connected||!x.current||f.current[``]===void 0&&ce(``)},[i.connected,i.fileTree,ce]),(0,d.useEffect)(()=>{!i.connected||!ee.current||te.current===null&&re.current()},[i.connected]),(0,d.useEffect)(()=>{let t=!1;return fetch(`${e}/branding`,{headers:l.current?{Authorization:`Bearer ${l.current}`}:{}}).then(e=>e.ok?e.json():null).then(e=>{t||a(e?{type:`branding_loaded`,branding:e}:{type:`branding_settled`})}).catch(()=>{t||a({type:`branding_settled`})}),()=>{t=!0}},[e,s]),(0,d.useEffect)(()=>{let t,n=!1;function i(){let s=new WebSocket(BJ(e,l.current,r));o.current=s,s.onopen=()=>{o.current===s&&a({type:`connected`})},s.onmessage=e=>{if(o.current!==s)return;let t;try{t=JSON.parse(e.data)}catch{return}if(t.type===`terminal_data`){let e=S.current.get(t.terminalId);if(e)for(let n of e.onData)n(t.data);return}if(t.type===`terminal_cwd`){let e=S.current.get(t.terminalId);if(e)for(let n of e.onCwd)n(t.cwd);return}if(t.type===`terminal_exit`){let e=S.current.get(t.terminalId);if(e)for(let n of e.onExit)n(t.exitCode);return}if(t.type===`terminal_error`){let e=S.current.get(t.terminalId);if(e)for(let n of e.onError)n(t.message);return}if(t.type===`history_items`){let e=g.current.get(t.requestId);e&&(g.current.delete(t.requestId),e.resolve({items:t.items,remaining:t.remaining}));return}if(t.type===`history_unavailable`){let e=g.current.get(t.requestId);e&&(g.current.delete(t.requestId),e.reject(new kJ(t.reason,t.kind)));return}if(t.type===`file_uploaded`){let e=h.current.get(t.requestId);e&&(h.current.delete(t.requestId),e.resolve(t.path));return}if(t.type===`file_browser_error`&&h.current.has(t.requestId)){let e=h.current.get(t.requestId);h.current.delete(t.requestId),e.reject(new YI(t.message,t.reason));return}if(t.type===`file_changed`){se(),pe(jJ(t.path));let e=p.current;if(e?.status===`loaded`&&e.path===t.path){let e=`file:${crypto.randomUUID()}`;a({type:`file_read_started`,path:t.path,requestId:e,preserveContent:!0}),T({type:`read_file`,path:t.path,requestId:e})}m.current===t.path&&T({type:`git_diff`,path:t.path,requestId:`gitdiff:${crypto.randomUUID()}`}),j(UI(A.current,t.path)?.repo);return}if(t.type===`directory_changed`){se(),pe(t.path);let e=p.current;if(e!==null&&jJ(e.path)===t.path){if(ae(e.path)||D(e.path))a({type:`raw_preview_changed`,path:e.path});else if(e.status===`loaded`){let t=`file:${crypto.randomUUID()}`;a({type:`file_read_started`,path:e.path,requestId:t,preserveContent:!0}),T({type:`read_file`,path:e.path,requestId:t})}}let n=m.current;n!==null&&jJ(n)===t.path&&T({type:`git_diff`,path:n,requestId:`gitdiff:${crypto.randomUUID()}`}),j();return}if((t.type===`hello`||t.type===`session_replaced`||t.type===`workspace_switched`||t.type===`workspace_starting`)&&(k.current=t.gitAvailable===!0,t.type!==`session_replaced`&&j()),t.type===`agent_end`&&(j(),se()),t.type===`git_repositories_changed`&&(se(),k.current=t.available,t.available&&j()),(t.type===`git_status`||t.type===`git_error`&&t.requestId.startsWith(`git:`))&&fe(t.requestId),t.type===`work_plan_changed`&&se(),(t.type===`workspace_outcome`||t.type===`workspace_outcome_error`)&&te.current===t.requestId&&(ie(),E.current&&(E.current=!1,queueMicrotask(()=>re.current()))),t.type===`hello`||t.type===`session_replaced`||t.type===`workspace_switched`||t.type===`workspace_starting`||t.type===`update_config_ack`){ie(),E.current=!1;let e=w.current,n=t.sessionId===e.sessionId,r=(t.workspace?tI(t.workspace):null)===e.workspaceRoot;ee.current&&n&&r&&queueMicrotask(()=>re.current())}if(t.type===`file_operation_result`){let e=t.previousPath??t.path,n=p.current;t.operation===`delete_file`&&n?.path===t.path?p.current=null:n?.path===e&&(p.current={...n,path:t.path})}a({type:`server`,message:t}),t.type===`session_replaced`&&ce(``)},s.onclose=e=>{if(o.current===s){le.current.clear(),ue.current.clear(),de.current.clear(),ie(),E.current=!1;for(let e of h.current.values())e.reject(new YI(`The connection dropped before the upload finished`));h.current.clear();for(let e of g.current.values())e.reject(new kJ(`the connection dropped before the older messages arrived`,`failed`));if(g.current.clear(),e.code===WJ){a({type:`auth_required`});return}a({type:`disconnected`}),n||(t=window.setTimeout(i,1500))}}}return i(),()=>{n=!0,t!==void 0&&clearTimeout(t);let e=o.current;o.current=null,e?.close()}},[T,e,j,fe,pe,ce,se,ie,s,r]);let he=(0,d.useCallback)((e,t)=>{let n=o.current;if(!n||n.readyState!==WebSocket.OPEN)return Promise.reject(new kJ(`not connected to the server`,`failed`));let r=`history:${crypto.randomUUID()}`;return new Promise((n,i)=>{let a=window.setTimeout(()=>{g.current.delete(r)&&i(new kJ(`the older messages did not arrive`,`failed`))},HJ),o=e=>t=>{clearTimeout(a),e(t)};g.current.set(r,{resolve:o(n),reject:o(i)}),T({type:`history_before`,sessionId:_.current,have:e,count:t,requestId:r})})},[T]),ge=(0,d.useCallback)(async()=>{let e=y.current;if(!(!e||e.loading||v.current||e.remaining<=0)){v.current=!0,a({type:`history_load_started`});try{let t=await he(e.have,50);a({type:`history_loaded`,items:t.items,remaining:t.remaining})}catch(e){if(e instanceof kJ&&e.kind===`stale`){a({type:`history_load_failed`,message:``});return}a({type:`history_load_failed`,message:e instanceof Error?e.message:`the older messages could not be loaded`})}finally{v.current=!1}}},[he]);return{state:i,setOutcomeActive:O,refreshOutcome:oe,authToken:l.current,switchWorkspace:(e,t)=>{(t??e)===C&&!i.switching||(a({type:`workspace_switching`}),T({type:`switch_workspace`,root:e,...t!==void 0&&t!==e?{id:t}:{}}))},openProject:e=>{a({type:`workspace_switching`}),T({type:`open_project`,root:e})},closeProject:(e,t)=>T({type:`close_project`,root:e,...t!==void 0&&t!==e?{id:t}:{}}),checkPiPackages:()=>T({type:`check_pi_packages`}),updatePiPackage:e=>{let t=`pkg:${crypto.randomUUID()}`;a({type:`pi_package_update_started`,requestId:t,source:e}),T({type:`update_pi_package`,source:e,requestId:t})},restartServer:()=>T({type:`restart_server`}),openSideSession:e=>{a({type:`workspace_switching`}),T({type:`open_side_session`,root:e})},submitToken:e=>{OJ(e),l.current=e,a({type:`auth_retrying`}),c(e=>e+1)},prompt:(e,t)=>{a({type:`prompt_sent`,text:e,...t?.length?{images:t}:{}}),T({type:`prompt`,text:e,...t?.length?{images:t}:{}})},abort:()=>T({type:`abort`}),setModel:(e,t)=>T({type:`set_model`,provider:e,id:t}),setThinking:e=>T({type:`set_thinking`,level:e}),newSession:()=>T({type:`new_session`}),switchSession:e=>T({type:`switch_session`,path:e}),deleteSession:e=>T({type:`delete_session`,path:e}),listSessions:()=>T({type:`list_sessions`}),renameSession:(e,t)=>T({type:`rename_session`,path:e,name:t}),searchSessions:e=>{let t=`sessions:${crypto.randomUUID()}`;a({type:`session_search_started`,query:e,requestId:t}),T({type:`search_sessions`,query:e,requestId:t})},clearSessionSearch:()=>a({type:`session_search_cleared`}),listTree:()=>T({type:`list_tree`}),navigateTree:e=>T({type:`navigate_tree`,entryId:e}),forkSession:e=>T({type:`fork_session`,entryId:e}),editPrompt:(e,t,n)=>T({type:`edit_prompt`,entryId:e,text:t,...n?.length?{images:n}:{}}),compact:()=>T({type:`compact`}),fetchOlderItems:he,loadOlderItems:ge,respondToDialog:e=>{T({type:`extension_ui_response`,...e}),a({type:`dialog_answered`})},dismissNotification:e=>a({type:`dismiss_notification`,id:e}),listDirectory:e=>ce(e),refreshFileTree:me,readFile:(e,t)=>{let n=`file:${crypto.randomUUID()}`;a({type:`file_read_started`,path:e,requestId:n}),T({type:`read_file`,path:e,requestId:n,...t===void 0?{}:{sha256:t}})},closeFilePreview:()=>a({type:`close_file_preview`}),writeFile:(e,t,n,r=!1)=>{let i=`write:${crypto.randomUUID()}`;a({type:`file_save_started`,path:e,requestId:i,content:t}),T({type:`write_file`,path:e,content:t,expectedMtimeMs:n,...r?{force:r}:{},requestId:i})},createFile:e=>{a({type:`file_create_started`}),T({type:`create_file`,path:e,requestId:`create:${crypto.randomUUID()}`})},uploadFile:(e,t)=>{let n=b.current;if(n===null)return Promise.reject(new YI(`the workspace is read-only`,`denied`));let r=o.current;if(!r||r.readyState!==WebSocket.OPEN)return Promise.reject(new YI(`not connected to the server`));let i=n?`${n}/${JI}`:JI,a=`upload:${crypto.randomUUID()}`;return new Promise((n,r)=>{let o=window.setTimeout(()=>{h.current.delete(a)&&r(new YI(`the upload timed out`))},VJ),s=e=>t=>{clearTimeout(o),e(t)};h.current.set(a,{resolve:s(n),reject:s(r)}),T({type:`upload_file`,destinationDirectory:i,name:e,contentBase64:t,requestId:a})})},createDirectory:e=>{a({type:`file_create_started`}),T({type:`create_directory`,path:e,requestId:`create:${crypto.randomUUID()}`})},openNative:e=>{let t=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`open_native`,path:e,requestId:t}),T({type:`open_native`,path:e,requestId:t})},revealNative:e=>{let t=Date.now();if(u.current?.path===e&&t-u.current.at<GJ)return;u.current={path:e,at:t};let n=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`reveal_native`,path:e,requestId:n}),T({type:`reveal_native`,path:e,requestId:n})},renameFile:(e,t)=>{let n=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`rename_file`,path:e,requestId:n}),T({type:`rename_file`,path:e,name:t,requestId:n})},deleteFile:e=>{let t=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`delete_file`,path:e,requestId:t}),T({type:`delete_file`,path:e,requestId:t})},moveFile:(e,t)=>{let n=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`move_file`,path:e,requestId:n}),T({type:`move_file`,path:e,destinationDirectory:t,requestId:n})},copyFile:(e,t)=>{let n=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`copy_file`,path:e,requestId:n}),T({type:`copy_file`,path:e,destinationDirectory:t,requestId:n})},searchFiles:e=>{let t=`search:${crypto.randomUUID()}`;a({type:`file_search_started`,query:e,requestId:t}),T({type:`search_files`,query:e,requestId:t})},clearFileSearch:()=>a({type:`file_search_cleared`}),fetchGitStatus:()=>j(),fetchGitDiff:e=>{let t=`gitdiff:${crypto.randomUUID()}`;a({type:`git_diff_started`,path:e,requestId:t}),T({type:`git_diff`,path:e,requestId:t})},clearGitDiff:()=>a({type:`git_diff_cleared`}),fetchGitLog:(e,t)=>T({type:`git_log`,repo:e,...t?{limit:t}:{},requestId:`gitlog:${crypto.randomUUID()}`}),fetchGitShow:(e,t)=>T({type:`git_show`,repo:e,sha:t,requestId:`gitshow:${crypto.randomUUID()}`}),clearGitShow:()=>a({type:`git_show_cleared`}),fetchGitFileHistory:(e,t)=>{let n=`gitfilelog:${crypto.randomUUID()}`;a({type:`git_file_history_started`,path:e,requestId:n}),T({type:`git_file_log`,path:e,...t?{limit:t}:{},requestId:n})},closeGitFileHistory:()=>a({type:`git_file_history_closed`}),fetchGitFileDiff:(e,t)=>{let n=`gitfilediff:${crypto.randomUUID()}`;a({type:`git_file_diff_started`,base:e,target:t,requestId:n}),T({type:`git_file_diff`,base:e,target:t,requestId:n})},clearGitFileDiff:()=>a({type:`git_file_diff_cleared`}),setCredential:(e,t)=>T({type:`set_credential`,provider:e,apiKey:t}),declareProvider:e=>T({type:`declare_provider`,...e}),browseServerDirectory:e=>{let t=`serverdir:${crypto.randomUUID()}`;a({type:`server_browse_started`,path:e,requestId:t}),T({type:`browse_server_directory`,path:e,requestId:t})},closeServerBrowser:()=>a({type:`server_browse_closed`}),suggestAgentResourceClonePath:e=>{let t=`resource-clone-path:${crypto.randomUUID()}`;a({type:`resource_clone_path_started`,requestId:t}),T({type:`suggest_agent_resource_clone_path`,repositoryUrl:e,requestId:t})},cloneAgentResourceRepository:(e,t)=>{let n=`resource-preview:${crypto.randomUUID()}`;a({type:`resource_preview_started`,requestId:n}),T({type:`clone_agent_resource_repository`,repositoryUrl:e,destinationPath:t,requestId:n})},enrollAgentResourceRepository:(e,t,n,r)=>{let i=`resource-enroll:${crypto.randomUUID()}`;a({type:`resource_enrollment_started`,requestId:i}),T({type:`enroll_agent_resource_repository`,previewToken:e,skillRoots:t,extensionRoots:n,...r?{enabledSkills:r}:{},requestId:i})},setAgentResourceSkills:(e,t)=>{let n=`resource-skills:${crypto.randomUUID()}`;a({type:`resource_skills_started`,requestId:n,repositoryId:e}),T({type:`set_agent_resource_skills`,repositoryId:e,enabledSkills:t,requestId:n})},removeAgentResourceRepository:e=>{let t=`resource-remove:${crypto.randomUUID()}`;a({type:`resource_removal_started`,requestId:t,repositoryId:e}),T({type:`remove_agent_resource_repository`,repositoryId:e,requestId:t})},refreshAgentResourceRepositories:e=>{let t=`resource-refresh:${crypto.randomUUID()}`;a({type:`resource_refresh_started`,requestId:t,...e?{repositoryId:e}:{}}),T({type:`refresh_agent_resource_repositories`,...e?{repositoryId:e}:{},requestId:t})},updateAgentResourceRepository:(e,t,n,r,i=!1)=>{let o=`resource-update:${crypto.randomUUID()}`;a({type:`resource_update_started`,requestId:o,repositoryId:e}),T({type:`update_agent_resource_repository`,repositoryId:e,assessmentToken:t,localRevision:n,upstreamRevision:r,...i?{allowExecutableChanges:!0}:{},requestId:o})},updateConfig:e=>{a({type:`settings_apply_started`}),T({type:`update_config`,...e})},openTerminal:(e,t,n,r)=>T({type:`terminal_open`,terminalId:e,cwd:t,cols:n,rows:r}),sendTerminalInput:(e,t)=>T({type:`terminal_input`,terminalId:e,data:t}),getTerminalCwd:e=>T({type:`terminal_get_cwd`,terminalId:e}),resizeTerminal:(e,t,n)=>T({type:`terminal_resize`,terminalId:e,cols:t,rows:n}),closeTerminal:e=>{T({type:`terminal_close`,terminalId:e}),S.current.delete(e)},subscribeTerminal:(e,t)=>{let n=S.current.get(e);return n||(n={onData:new Set,onCwd:new Set,onExit:new Set,onError:new Set},S.current.set(e,n)),t.onData&&n.onData.add(t.onData),t.onCwd&&n.onCwd.add(t.onCwd),t.onExit&&n.onExit.add(t.onExit),t.onError&&n.onError.add(t.onError),()=>{t.onData&&n?.onData.delete(t.onData),t.onCwd&&n?.onCwd.delete(t.onCwd),t.onExit&&n?.onExit.delete(t.onExit),t.onError&&n?.onError.delete(t.onError)}}}}var qJ=120;function JJ({label:e}){return(0,A.jsx)(`div`,{className:`flex justify-end px-4`,role:`status`,"aria-live":`polite`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2 py-1`,children:[(0,A.jsx)(`span`,{className:`inline-block h-4 w-4 animate-spin rounded-full border-[3px] border-zinc-300 border-t-blue-500 dark:border-zinc-600 dark:border-t-blue-400 motion-reduce:animate-pulse`}),(0,A.jsx)(`span`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:e})]})})}var YJ=(0,d.forwardRef)(function({serverUrl:e=``,rootElement:t,initialTheme:n,token:r,workspace:i},a){let o=t!==void 0,s=t??document.documentElement,{state:c,authToken:l,submitToken:u,prompt:f,abort:m,setModel:h,setThinking:g,newSession:_,switchSession:v,deleteSession:b,listSessions:x,renameSession:S,searchSessions:C,clearSessionSearch:w,listTree:T,navigateTree:ee,forkSession:te,editPrompt:E,compact:ne,loadOlderItems:re,fetchOlderItems:ie,respondToDialog:ce,dismissNotification:k,listDirectory:le,refreshFileTree:ue,readFile:de,writeFile:j,createFile:pe,createDirectory:me,uploadFile:he,openNative:ge,revealNative:_e,renameFile:ve,deleteFile:ye,moveFile:be,copyFile:xe,closeFilePreview:Se,searchFiles:Ce,clearFileSearch:we,fetchGitDiff:Te,clearGitDiff:Ee,fetchGitLog:De,fetchGitShow:Oe,clearGitShow:ke,fetchGitFileHistory:Ae,closeGitFileHistory:je,fetchGitFileDiff:Me,clearGitFileDiff:Ne,setCredential:Pe,declareProvider:Fe,updateConfig:Ie,suggestAgentResourceClonePath:Le,cloneAgentResourceRepository:Re,enrollAgentResourceRepository:ze,setAgentResourceSkills:Be,removeAgentResourceRepository:Ve,refreshAgentResourceRepositories:He,updateAgentResourceRepository:Ue,browseServerDirectory:Ge,closeServerBrowser:Ke,switchWorkspace:qe,openProject:Je,closeProject:Ye,openSideSession:Xe,checkPiPackages:Ze,updatePiPackage:Qe,restartServer:$e,openTerminal:et,sendTerminalInput:tt,getTerminalCwd:nt,resizeTerminal:rt,closeTerminal:it,subscribeTerminal:at,setOutcomeActive:ot,refreshOutcome:st}=KJ(e,r,o,i),ct=O(c.workspace);Mz(c.workspaces,c.workspace?tI(c.workspace):null);let lt=c.workspace?tI(c.workspace):null;(0,d.useEffect)(()=>{pt([]),an([]),bn.current&&(bn.current.scrollTop=0)},[lt]);let[ut,dt]=(0,d.useState)(!1),[ft,pt]=(0,d.useState)([]),[mt,ht]=(0,d.useState)([]),[gt,_t]=(0,d.useState)(null),[vt,yt]=(0,d.useState)(null),[bt,xt]=(0,d.useState)(null),[St,Ct]=(0,d.useState)(!1),[wt,Tt]=(0,d.useState)(null),[Et,Dt]=(0,d.useState)(null),Ot=wt===`project`,kt=e=>Tt(e?`project`:null),At=c.embedWorkspaceControls===`projects`?`projects`:c.embedWorkspaceControls===`root`?`root`:`none`,jt=(0,d.useRef)({}),Mt=(0,d.useRef)([]),Nt=(0,d.useRef)(null),Pt=(0,d.useRef)(null),[Ft,It]=(0,d.useState)(!1),[Lt,Rt]=(0,d.useState)(BI),zt=(0,d.useCallback)((e,t)=>{VI(e,t),Rt(n=>({...n,[e]:t}))},[]),[Bt,Vt]=(0,d.useState)(!1),[Ht,Ut]=(0,d.useState)(!0),[Wt,Gt]=(0,d.useState)(!1),Kt=c.terminal?.enabled??!1;(0,d.useEffect)(()=>{let e=e=>{Kt&&(e.ctrlKey||e.metaKey)&&e.key==="`"&&(e.preventDefault(),Gt(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Kt]);let[qt,Jt]=(0,d.useState)(!1),[Yt,Xt]=(0,d.useState)(null),Zt=(0,d.useCallback)(()=>Xt(null),[]);function Qt(){let e=!Bt;Vt(e),e&&(Ut(!1),Jt(!1))}function $t(){let e=!Ht;Ut(e),e&&(Vt(!1),Jt(!1))}function en(){let e=!qt;Jt(e),e&&(Vt(!1),Ut(!1))}(0,d.useEffect)(()=>(ot(qt),()=>ot(!1)),[qt,ot,c.sessionId,lt]),(0,d.useEffect)(()=>{Jt(!1),Xt(null)},[lt]);let[tn,nn]=(0,d.useState)([]),[rn,an]=(0,d.useState)([]),on=(0,d.useRef)(0),sn=(0,d.useRef)(0),[cn,ln]=(0,d.useState)(0);async function un(e){let t=[...e],n=t.filter($I).map(e=>({id:`${on.current++}`,name:e.name}));n.length>0&&an(e=>[...e,...n]),sn.current===0&&nn([]),sn.current++;try{let{attachments:e,errors:n}=await sL(t,he);e.length>0&&pt(t=>[...t,...e]),n.length>0&&nn(e=>[...e,...n])}finally{if(sn.current--,n.length>0){let e=new Set(n.map(e=>e.id));an(t=>t.filter(t=>!e.has(t.id)))}}}(0,d.useEffect)(()=>{Mt.current=ft},[ft]),(0,d.useEffect)(()=>{let t=c.openFile;if(!t)return;let n=t.path,r=t.status===`loaded`,i=t.status===`error`&&t.message===`Binary file — preview not supported`&&oe(n);if(Nt.current!==n&&(Nt.current=n,Pt.current=null,pt(e=>e.filter(e=>e.source!==`preview`)),_t(null),yt(null),xt(null)),Pt.current===n)return;(ae(n)||D(n))&&pt(e=>e.filter(e=>e.source!==`preview`));let a=!1;async function o(){let t=ae(n)?vt===n?await pL(n,se(e,n,l,c.previewRevision,ct)):null:D(n)?bt?.path===n&&bt.revision===c.previewRevision?lL(n):null:i||r?cL(n):null;if(!(a||t===null||Nt.current!==n||Pt.current===n)){if(typeof t==`string`){_t(t);return}_t(null),pt(e=>gL(e,t))}}return o(),()=>{a=!0}},[c.openFile,c.previewRevision,e,l,ct,vt,bt]);function dn(){Nt.current=null,Pt.current=null,Se()}let fn=(0,d.useMemo)(()=>[...ft.filter(e=>e.kind===`path`).map(e=>e.data),...mt],[ft,mt]);function pn(e){let t=Mt.current.findIndex(t=>t.kind===`path`&&t.data===e);t>=0?mn(t):mt.includes(e)||pt(t=>hL(t,e))}function mn(e){let t=Mt.current[e];t?.source===`preview`&&(Pt.current=t.previewPath??Nt.current,_t(null)),pt(t=>_L(t,e))}function hn(e,t){f(e,t),pt([]),nn([]),_t(null),St||dn()}function gn(e){e.preventDefault(),ln(0),e.dataTransfer.files.length>0&&un(Array.from(e.dataTransfer.files))}let{theme:_n,toggle:vn,setTheme:yn}=y(c.branding.defaultTheme??`system`,c.branding.allowThemeToggle!==!1,s,n);(0,d.useImperativeHandle)(a,()=>({setTheme:yn}),[yn]);let bn=(0,d.useRef)(null),[xn,Sn]=(0,d.useState)(null),Cn=(0,d.useCallback)(e=>{bn.current=e,Sn(e)},[]),wn=(0,d.useRef)(null),Tn=(0,d.useRef)(!0),[En,Dn]=(0,d.useState)(!0),On=(0,d.useCallback)(e=>{e!==Tn.current&&Dn(e),Tn.current=e},[]),kn=(0,d.useCallback)(()=>{let e=bn.current;e&&On(e.scrollHeight-e.scrollTop-e.clientHeight<qJ)},[On]),An=(0,d.useRef)(null),jn=(0,d.useCallback)(()=>{let e=bn.current;e&&(e.scrollHeight-e.scrollTop-e.clientHeight<qJ||(An.current=e.scrollTop))},[]),Mn=(0,d.useCallback)(()=>{let e=bn.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<qJ,n=An.current;if(n!==null){if(e.scrollTop<n)An.current=null;else if(An.current=t?null:e.scrollTop,!t)return}On(t)},[On]);function Nn(){An.current=null}(0,d.useEffect)(()=>{let e=xn;if(!e)return;let t=()=>{An.current=null,Mn()};e.addEventListener(`scrollend`,t);let n;return typeof ResizeObserver<`u`&&(n=new ResizeObserver(()=>{if(Tn.current){jn(),wn.current?.scrollIntoView({behavior:`auto`});return}Mn()}),n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild)),()=>{e.removeEventListener(`scrollend`,t),n?.disconnect()}},[xn,Mn,jn]);let Pn=(0,d.useCallback)(()=>{On(!0),jn();let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;wn.current?.scrollIntoView({behavior:e?`auto`:`smooth`})},[On,jn]);(0,d.useEffect)(()=>{if(Tn.current){jn(),wn.current?.scrollIntoView({behavior:`smooth`});return}kn()},[c.items,kn,jn]);let Fn=(0,d.useMemo)(()=>oI(c.items),[c.items]),In=(0,d.useMemo)(()=>Bt?gI(c.items):null,[Bt,c.items]),Ln=(0,d.useMemo)(()=>gF({readFile:(e,t)=>{It(!1),de(e,t)},fetchGitFileHistory:e=>Ae(e),fetchGitDiff:e=>{It(!0),de(e)},searchFiles:e=>Ce(e)}),[de,Ae,Ce]),Rn=(0,d.useCallback)(()=>zt(`tools`,!0),[zt]),zn=(0,d.useCallback)(e=>{let t=bn.current;if(t){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.top>=n.top&&r.bottom<=n.bottom,a=t.scrollHeight-t.scrollTop-t.clientHeight<qJ;if(i&&a)return}On(!1)},[On]),[Bn,Vn]=(0,d.useState)(null),[Hn,Un]=(0,d.useState)(null),Wn=(0,d.useMemo)(()=>{let e=c.sessions?.find(e=>e.id===c.sessionId);return c.sessionName?.trim()||e?.name?.trim()||e?.firstMessage?.trim()||c.sessionId},[c.sessionName,c.sessions,c.sessionId]),Gn=(0,d.useCallback)(async()=>{Un(null),Vn(`preparing…`);try{let{exportConversation:t}=await fe(async()=>{let{exportConversation:e}=await import(`./conversationExport-1pQ1kKRb.js`);return{exportConversation:e}},__vite__mapDeps([23,22]));await t({items:c.items,olderItems:c.olderHistory?.remaining??0,...c.olderHistory?{fetchOlderItems:ie}:{},connection:{serverUrl:e,token:l,workspace:ct},meta:{...c.workspace?{project:c.workspace.name}:{},session:Wn,model:c.model,exportedAt:new Date},onProgress:(e,t,n)=>Vn(e===`collecting`?`reading ${t}/${n}…`:`writing ${t}/${n}…`)})}catch(e){Un(e instanceof Error?e.message:`the conversation could not be exported`)}finally{Vn(null)}},[c.items,c.olderHistory,c.workspace,c.model,Wn,ie,e,l,ct]),{jumpToItem:Kn,highlightIndex:qn}=FI({items:c.items,scrollerRef:bn,hideTools:!Lt.tools,onShowTools:Rn,onJump:zn}),Jn=(0,d.useRef)(null),Yn=(0,d.useRef)(c.olderHistory?.have??0),Xn=(0,d.useCallback)(()=>{let e=bn.current;e&&(Jn.current={height:e.scrollHeight,top:e.scrollTop}),re()},[re]);return(0,d.useLayoutEffect)(()=>{let e=c.olderHistory?.have??0,t=Yn.current;Yn.current=e;let n=Jn.current;if(Jn.current=null,!n||e<=t)return;let r=bn.current;r&&(r.scrollTop=n.top+(r.scrollHeight-n.height))},[c.olderHistory?.have]),(0,d.useEffect)(()=>{if(!o){let e=c.extensionTitle??c.branding.title??`pi`;document.title=c.workspace?`${c.workspace.name} — ${e}`:e}c.branding.accentColor&&s.style.setProperty(`--accent`,c.branding.accentColor)},[c.branding,c.extensionTitle,c.workspace?.name,o,s]),o&&!c.brandingReady?null:c.authRequired?(0,A.jsx)(p.Provider,{value:_n,children:(0,A.jsx)(rB,{title:c.branding.title,onSubmit:u})}):c.credentials&&!c.credentials.usableModel?(0,A.jsx)(p.Provider,{value:_n,children:(0,A.jsx)(Bz,{title:c.branding.title,credentials:c.credentials,onSetCredential:Pe,onDeclareProvider:Fe,errors:c.errors})}):(0,A.jsx)(p.Provider,{value:_n,children:(0,A.jsx)(wf.Provider,{value:c.replyConformance,children:(0,A.jsxs)(Qd.Provider,{value:c.structuredAppearance,children:[(0,A.jsxs)(`div`,{className:`relative flex h-full`,onDragEnter:e=>{e.dataTransfer.types.includes(`Files`)&&ln(e=>e+1)},onDragLeave:()=>ln(e=>Math.max(0,e-1)),onDragOver:e=>e.preventDefault(),onDrop:gn,children:[cn>0&&(0,A.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-40 flex items-center justify-center border-2 border-dashed bg-white/70 backdrop-blur-sm dark:bg-zinc-950/70`,style:{borderColor:`var(--accent, #3b82f6)`},children:(0,A.jsx)(`p`,{className:`text-lg font-medium text-zinc-700 dark:text-zinc-200`,children:`Drop files to attach (images, documents & text)`})}),ut&&(0,A.jsx)(nB,{tree:c.fileTree,openFile:c.openFile,writableRoot:c.writableRoot,gitFiles:c.gitStatus?.files,attachedPaths:fn,onExpand:le,onSelectDirectory:Dt,onRefresh:ue,onSelectFile:e=>{It(!1),Dt(e),de(e)},onSelectDiff:e=>{It(!0),Dt(e),de(e)},onToggleAttachPath:pn,onCreateFile:e=>{It(!1),pe(e)},onCreateDirectory:me,onOpenNative:ge,onRevealNative:_e,onRenameFile:ve,onDeleteFile:ye,onMoveFile:be,onCopyFile:xe,fileOperation:c.fileOperation,createError:c.createError,created:c.created}),(0,A.jsxs)(`div`,{className:`flex h-full min-w-0 flex-1 flex-col`,children:[Ot&&(0,A.jsx)(KR,{label:`Choose a project directory`,browse:c.serverBrowse,onBrowse:Ge,onSelect:e=>{kt(!1),Ke(),Je(e)},onCancel:()=>{kt(!1),Ke()}}),!o&&c.outpostUpdate&&(0,A.jsx)(eI,{notice:c.outpostUpdate}),(0,A.jsx)(jz,{workspace:c.workspace,workspaces:c.workspaces,workspaceLocked:c.workspaceLocked,workspaceControl:o?At:`projects`,rootControl:{sandbox:c.sandbox,browse:c.serverBrowse,applyState:c.settingsApply,blocked:wt!==null&&wt!==`root`,onBrowse:Ge,onCloseBrowser:()=>{Tt(null),Ke()},onOpened:()=>Tt(`root`),onSelect:e=>Ie({sandbox:{root:e,allowWrite:c.sandbox?.allowWrite??!1,allowBash:c.sandbox?.allowBash??!1,...c.sandbox?.writableRoot?{writableRoot:c.sandbox.writableRoot}:{}}})},onSwitchWorkspace:qe,onOpenProject:()=>{kt(!0),Ge(``)},onCloseProject:Ye,onOpenSideSession:Xe,piPackages:c.piPackages,piPackageUpdate:c.piPackageUpdate,canRestartServer:!o,serverRestarting:c.serverRestarting,onCheckPiPackages:Ze,onUpdatePiPackage:Qe,onRestartServer:$e,restartNeeded:c.restartNeeded,title:c.branding.title,sessions:c.sessions,sessionSearch:c.sessionSearch,sessionId:c.sessionId,tree:c.tree,isStreaming:c.isStreaming,connected:c.connected,theme:_n,showThemeToggle:c.branding.allowThemeToggle!==!1,statuses:c.statuses,sidebarOpen:ut,outcomeOpen:qt,filters:Lt,onToggleSidebar:()=>dt(!ut),onToggleOutcome:en,onFilterChange:zt,...c.items.length>0?{onExportConversation:()=>void Gn()}:{},exportProgress:Bn,onToggleTheme:vn,onNewSession:_,onSwitchSession:v,onDeleteSession:b,onListSessions:x,onRenameSession:S,onSearchSessions:C,onClearSessionSearch:w,onListTree:T,onNavigateTree:ee,onForkSession:te,gitAvailable:c.gitAvailable,gitStatus:c.gitStatus,gitSelectedPath:Et,gitLog:c.gitLog,extensionPaths:c.extensionPaths,configuredExtensionPaths:c.configuredExtensionPaths,userExtensionPaths:c.userExtensionPaths,extensionLock:c.extensionLock,tools:c.tools,commands:c.commands,sandbox:c.sandbox,gitUnavailable:c.gitUnavailable,userSkillPaths:c.userSkillPaths,serverBrowse:c.serverBrowse,settingsApply:c.settingsApply,agentResources:c.agentResources,agentResourceOperations:c.agentResourceOperations,versions:c.versions,onBrowseServerPath:Ge,onCloseServerBrowser:Ke,settingsPickerBlocked:wt!==null&&wt!==`settings`,onSettingsPickerOpened:()=>Tt(`settings`),onUpdateConfig:Ie,onSuggestAgentResourceClonePath:Le,onCloneAgentResourceRepository:Re,onEnrollAgentResourceRepository:ze,onSetAgentResourceSkills:Be,onRemoveAgentResourceRepository:Ve,onRefreshAgentResourceRepositories:He,onUpdateAgentResourceRepository:Ue,onFetchGitLog:De,onShowCommit:Oe,terminalOpen:Wt,onToggleTerminal:Kt?()=>Gt(e=>!e):void 0}),(0,A.jsxs)(`div`,{className:`relative z-0 flex min-h-0 flex-1 flex-col`,children:[c.workPlan&&(0,A.jsx)(sB,{plan:c.workPlan,open:Ht,onToggle:$t,onOpenWorkspace:e=>{It(!1),de(e)},requestedTaskId:Yt,onTaskRequestHandled:Zt}),qt&&(0,A.jsx)(wJ,{state:c.outcome,onClose:()=>Jt(!1),onRefresh:st,onTarget:e=>{e.kind===`work-plan-task`?(Xt(e.taskId),Jt(!1),Vt(!1),Ut(!0)):e.kind===`workspace-file`?(It(!1),de(e.path)):e.kind===`workspace-diff`&&(It(!0),de(e.path))}}),c.openFile&&(0,A.jsx)(cR,{file:c.openFile,writableRoot:c.writableRoot,docxTemplate:c.docxTemplate,isStreaming:c.isStreaming,onDirtyChange:Ct,gitState:c.gitStatus?.files[c.openFile.path],initialShowGitDiff:Ft,gitDiff:c.gitDiff,onFetchGitDiff:Te,onClearGitDiff:Ee,inRepository:UI(c.gitStatus?.repos??[],c.openFile.path)!==null,onOpenGitHistory:Ae,onClose:dn,onReload:de,onSave:j,serverUrl:e,token:l,workspace:ct,onImageLoad:yt,onPdfLoad:e=>xt({path:e,revision:c.previewRevision}),rawRevision:c.previewRevision},c.openFile.path),c.gitFileHistory&&(0,A.jsx)(PR,{history:c.gitFileHistory,diff:c.gitFileDiff,dirty:c.gitStatus?.files[c.gitFileHistory.path]!==void 0,onFetchDiff:Me,onClearDiff:Ne,onClose:je}),c.gitShow&&(0,A.jsx)(uR,{show:c.gitShow,onClose:ke}),In&&(0,A.jsx)(NI,{analysis:In,onJump:Kn,onClose:()=>Vt(!1)}),(0,A.jsx)(`main`,{ref:Cn,onScroll:Mn,onWheel:Nn,onTouchStart:Nn,onKeyDown:Nn,className:`flex-1 overflow-y-auto transition-opacity duration-150 ${c.switching?`opacity-40`:`opacity-100`} ${Bt?`md:pr-[26rem]`:c.workPlan&&Ht?`md:pr-[23rem]`:``}`,children:(0,A.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col gap-3 px-4 py-6`,children:[c.items.length===0&&(0,A.jsxs)(`div`,{className:`mt-24 text-center text-zinc-500 dark:text-zinc-600`,children:[(0,A.jsx)(`div`,{className:`mb-2 text-4xl`,children:c.branding.title??`π`}),c.agentStarting?(0,A.jsx)(`p`,{className:`text-sm`,role:`status`,"data-testid":`agent-starting`,children:`Starting the agent… The project's files are ready.`}):(0,A.jsx)(`p`,{className:`text-sm`,children:c.branding.welcome??`Send a message to start the agent.`})]}),c.olderHistory&&(0,A.jsx)(iI,{older:c.olderHistory,onLoad:Xn}),c.items.map((t,n)=>{let r=`${c.sessionId}:${n}`,i=(e,t=r)=>(0,A.jsx)(`div`,{"data-item-index":n,className:`flex flex-col gap-3 rounded-lg transition-shadow ${qn===n?`ring-2 ring-blue-400 dark:ring-blue-500`:``}`,children:e},t);return t.kind===`user`?i((0,A.jsx)(We,{item:t,canEdit:!t.readOnly&&!c.isStreaming&&c.connected,onEdit:E})):t.kind===`compaction`?i((0,A.jsx)(rI,{item:t})):t.kind===`tool`?Lt.tools?i((0,A.jsx)(XF,{item:t,dispatch:Ln}),t.toolCallId?`${c.sessionId}:${t.toolCallId}`:r):null:t.kind===`custom`?i((0,A.jsx)(ZF,{item:t})):(Lt.reasoning?t.blocks:t.blocks.filter(e=>e.type!==`thinking`)).length===0&&!t.errorMessage?(0,A.jsx)(`div`,{"data-item-index":n,className:`sr-only`,"aria-hidden":!0},r):i((0,A.jsx)(pF,{item:t,hideReasoning:!Lt.reasoning,serverUrl:e,token:l,workspace:ct,onOpenFile:e=>{It(!1),de(e)}}))}),c.pendingPrompt&&(0,A.jsxs)(`div`,{className:`flex flex-col gap-3 opacity-60`,"data-pending-prompt":!0,children:[(0,A.jsx)(We,{item:{kind:`user`,...c.pendingPrompt},canEdit:!1,onEdit:()=>{}}),(0,A.jsx)(JJ,{label:`sending…`})]}),c.isStreaming&&!c.pendingPrompt&&(0,A.jsx)(JJ,{label:`working…`}),(c.queue.steering.length>0||c.queue.followUp.length>0)&&(0,A.jsxs)(`div`,{className:`rounded-lg border border-dashed border-zinc-300 px-3 py-2 text-xs text-zinc-500 dark:border-zinc-700`,children:[c.queue.steering.map((e,t)=>(0,A.jsxs)(`div`,{children:[`⏩ steering: `,e]},`s${t}`)),c.queue.followUp.map((e,t)=>(0,A.jsxs)(`div`,{children:[`⏭ follow-up: `,e]},`f${t}`))]}),tn.map((e,t)=>(0,A.jsx)(`div`,{className:`rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:e},`att${t}`)),gt&&(0,A.jsx)(`div`,{className:`rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:gt}),Hn&&(0,A.jsx)(`div`,{className:`rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:Hn}),c.errors.map((e,t)=>(0,A.jsx)(`div`,{className:`rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e},t)),(0,A.jsx)(`div`,{ref:wn})]})}),(0,A.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-4 z-0 flex justify-center ${Bt||qt?`md:pr-[26rem]`:c.workPlan&&Ht?`md:pr-[23rem]`:``}`,children:!En&&(0,A.jsxs)(`button`,{type:`button`,onClick:Pn,"aria-label":`Scroll to the latest message`,className:`pointer-events-auto flex items-center gap-1.5 rounded-full border border-zinc-300 bg-white/95 px-3 py-1.5 text-xs text-zinc-600 shadow-lg backdrop-blur transition-colors hover:bg-zinc-50 motion-reduce:transition-none dark:border-zinc-700 dark:bg-zinc-900/95 dark:text-zinc-300 dark:hover:bg-zinc-800`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,children:`↓`}),`Latest`]})})]}),Kt&&(0,A.jsx)(bJ,{open:Wt,onClose:()=>Gt(!1),cwd:c.workspace?.root,onSetWorkspaceRoot:e=>{Je&&!o?Je(e):c.sandbox?Ie({sandbox:{root:e,allowWrite:c.sandbox.allowWrite,allowBash:c.sandbox.allowBash,...c.sandbox.writableRoot?{writableRoot:c.sandbox.writableRoot}:{}}}):Ie({sandbox:{root:e,allowWrite:!0,allowBash:!0}})},openTerminal:et,sendTerminalInput:tt,getTerminalCwd:nt,resizeTerminal:rt,closeTerminal:it,subscribeTerminal:at}),(0,A.jsx)(`footer`,{className:`border-t border-zinc-200 px-4 py-3 dark:border-zinc-800`,children:(0,A.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[(0,A.jsx)(KL,{widgets:c.widgets,placement:`aboveEditor`}),(0,A.jsx)(TL,{initialDraft:jt.current[lt??``]??``,onDraftChange:e=>{jt.current[lt??``]=e},isStreaming:c.isStreaming,connected:c.connected,commands:c.commands,fileSearch:c.fileSearch,prefill:c.editorPrefill,attachments:ft,pendingUploads:rn,onAttach:e=>void un(e),onMentionPaths:ht,onRemoveAttachment:mn,onSend:hn,onAbort:m,onSearchFiles:Ce,onClearFileSearch:we},lt??``),(0,A.jsx)(KL,{widgets:c.widgets,placement:`belowEditor`}),(0,A.jsx)(Lz,{model:c.model,models:c.models,thinkingLevel:c.thinkingLevel,thinkingLevels:c.thinkingLevels,modelSupportsReasoning:c.modelSupportsReasoning,isStreaming:c.isStreaming,contextUsage:c.contextUsage,sessionUsage:Fn,analysisOpen:Bt,onToggleAnalysis:Qt,isCompacting:c.isCompacting,onSetModel:h,onSetThinking:g,onCompact:ne})]})})]})]}),c.dialogQueue[0]&&(0,A.jsx)(FL,{request:c.dialogQueue[0],onRespond:ce}),(0,A.jsx)(zL,{notifications:c.notifications,onDismiss:k})]})})})});(0,f.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(d.StrictMode,{children:(0,A.jsx)(YJ,{})}));export{i as A,Ne as C,se as D,re as E,ie as O,hd as S,k as T,hp as _,oF as a,Ff as b,Jj as c,UE as d,kE as f,vp as g,l_ as h,lF as i,te as k,kj as l,Tv as m,ZL as n,JP as o,$v as p,$L as r,Yj as s,AJ as t,rD as u,gp as v,fe as w,kf as x,fp as y};
|