qingnian108's follow-up to #747 and #758, on top of 1.3.2.
- A permission request still open when its turn ends is cancelled by the
daemon (manager and ACP session both), and an ACP request the Agent
withdraws ($/cancel_request, through the handler's AbortSignal) closes
as cancelled. The page waits only on cards that still show buttons, so
a finished turn no longer leaves 等待授权 with nothing to click. The
等待授权 pill scrolls to the waiting card.
- 添加到对话 uses a speech-bubble icon.
- Sidebar dot: blinks while running, green after a completed turn, red
on failure, amber while waiting.
- Wrapper: every disconnect / invalid-link end state offers Reconnect;
the last safe back URL is kept in sessionStorage (safeBack re-checked
on read). Coming back to the page (visible / focus) probes the child
for 4 s instead of waiting out timers pushed back while hidden.
Review (head 0c8ee32b): every changed source line read. 1.3.2's Codex
model_catalog_json change is kept (codex/provider.ts untouched, rebuilt
dist still carries it). No new network in tests, page text set through
textContent/React, no new timers in the page or daemon; the wrapper's
sessionStorage back passes the same loopback check (tested with an evil
stored value).
Run (mote, macOS), standalone copy of packages/agent-console:
- npm ci; npm run check OK.
- vitest: 65 files, 489 passed / 17 skipped.
- npm run build, then verify:build: committed app/ and daemon/dist
identical to the rebuild.
On the PR merged onto main 5026f636: root `bun test
packages/agent-console` 6/6, `bun scripts/check.mjs` exit 0.
Not tried: scripts/e2e-v1.mjs (Playwright, scenario 28), the page with a
live Cursor/Claude/Codex, Windows/Linux.
228 lines
1.0 MiB
Plaintext
228 lines
1.0 MiB
Plaintext
(()=>{var M2=Object.create;var xd=Object.defineProperty;var O2=Object.getOwnPropertyDescriptor;var R2=Object.getOwnPropertyNames;var D2=Object.getPrototypeOf,L2=Object.prototype.hasOwnProperty;var ky=e=>{throw TypeError(e)};var I2=(e,t,i)=>t in e?xd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var se=(e,t,i)=>()=>{if(i)throw i[0];try{return e&&(t=e(e=0)),t}catch(n){throw i=[n],n}};var ye=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}},z2=(e,t)=>{for(var i in t)xd(e,i,{get:t[i],enumerable:!0})},B2=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of R2(t))!L2.call(e,r)&&r!==i&&xd(e,r,{get:()=>t[r],enumerable:!(n=O2(t,r))||n.enumerable});return e};var te=(e,t,i)=>(i=e!=null?M2(D2(e)):{},B2(t||!e||!e.__esModule?xd(i,"default",{value:e,enumerable:!0}):i,e));var fe=(e,t,i)=>I2(e,typeof t!="symbol"?t+"":t,i),P2=(e,t,i)=>t.has(e)||ky("Cannot "+i);var Cy=(e,t,i)=>t.has(e)?ky("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i);var cm=(e,t,i)=>(P2(e,t,"access private method"),i);var Ty,Ny,um=se(()=>{Ty=e=>{let t,i=new Set,n=(c,u)=>{let d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){let h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),i.forEach(f=>f(t,h))}},r=()=>t,o={setState:n,getState:r,getInitialState:()=>l,subscribe:c=>(i.add(c),()=>i.delete(c))},l=t=e(n,r,o);return o},Ny=(e=>e?Ty(e):Ty)});var qy=ye(Ce=>{"use strict";var fm=Symbol.for("react.transitional.element"),H2=Symbol.for("react.portal"),U2=Symbol.for("react.fragment"),q2=Symbol.for("react.strict_mode"),F2=Symbol.for("react.profiler"),$2=Symbol.for("react.consumer"),W2=Symbol.for("react.context"),K2=Symbol.for("react.forward_ref"),G2=Symbol.for("react.suspense"),j2=Symbol.for("react.memo"),Dy=Symbol.for("react.lazy"),Y2=Symbol.for("react.activity"),V2=Symbol.for("react.view_transition"),Ay=Symbol.iterator;function X2(e){return e===null||typeof e!="object"?null:(e=Ay&&e[Ay]||e["@@iterator"],typeof e=="function"?e:null)}var Ly={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Iy=Object.assign,zy={};function Uo(e,t,i){this.props=e,this.context=t,this.refs=zy,this.updater=i||Ly}Uo.prototype.isReactComponent={};Uo.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")};Uo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function By(){}By.prototype=Uo.prototype;function pm(e,t,i){this.props=e,this.context=t,this.refs=zy,this.updater=i||Ly}var mm=pm.prototype=new By;mm.constructor=pm;Iy(mm,Uo.prototype);mm.isPureReactComponent=!0;var My=Array.isArray;function hm(){}var pt={H:null,A:null,T:null,S:null},Py=Object.prototype.hasOwnProperty;function gm(e,t,i){var n=i.ref;return{$$typeof:fm,type:e,key:t,ref:n!==void 0?n:null,props:i}}function Z2(e,t){return gm(e.type,t,e.props)}function _m(e){return typeof e=="object"&&e!==null&&e.$$typeof===fm}function Q2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(i){return t[i]})}var Oy=/\/+/g;function dm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Q2(""+e.key):t.toString(36)}function J2(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(hm,hm):(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 Ho(e,t,i,n,r){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case fm:case H2:a=!0;break;case Dy:return a=e._init,Ho(a(e._payload),t,i,n,r)}}if(a)return r=r(e),a=n===""?"."+dm(e,0):n,My(r)?(i="",a!=null&&(i=a.replace(Oy,"$&/")+"/"),Ho(r,t,i,"",function(c){return c})):r!=null&&(_m(r)&&(r=Z2(r,i+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Oy,"$&/")+"/")+a)),t.push(r)),1;a=0;var o=n===""?".":n+":";if(My(e))for(var l=0;l<e.length;l++)n=e[l],s=o+dm(n,l),a+=Ho(n,t,i,s,r);else if(l=X2(e),typeof l=="function")for(e=l.call(e),l=0;!(n=e.next()).done;)n=n.value,s=o+dm(n,l++),a+=Ho(n,t,i,s,r);else if(s==="object"){if(typeof e.then=="function")return Ho(J2(e),t,i,n,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function Ed(e,t,i){if(e==null)return e;var n=[],r=0;return Ho(e,n,"","",function(s){return t.call(i,s,r++)}),n}function eD(e){if(e._status===-1){var t=e._result,i=t();i.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n,i.status===void 0&&(i.status="fulfilled",i.value=n))},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n,i.status===void 0&&(i.status="rejected",i.reason=n))}),e._status===-1&&(e._status=0,e._result=i)}if(e._status===1)return e._result.default;throw e._result}var Ry=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Hy(e){var t=pt.T,i={};i.types=t!==null?t.types:null,pt.T=i;try{var n=e(),r=pt.S;r!==null&&r(i,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(hm,Ry)}catch(s){Ry(s)}finally{t!==null&&i.types!==null&&(t.types=i.types),pt.T=t}}function Uy(e){var t=pt.T;if(t!==null){var i=t.types;i===null?t.types=[e]:i.indexOf(e)===-1&&i.push(e)}else Hy(Uy.bind(null,e))}var tD={map:Ed,forEach:function(e,t,i){Ed(e,function(){t.apply(this,arguments)},i)},count:function(e){var t=0;return Ed(e,function(){t++}),t},toArray:function(e){return Ed(e,function(t){return t})||[]},only:function(e){if(!_m(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ce.Activity=Y2;Ce.Children=tD;Ce.Component=Uo;Ce.Fragment=U2;Ce.Profiler=F2;Ce.PureComponent=pm;Ce.StrictMode=q2;Ce.Suspense=G2;Ce.ViewTransition=V2;Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=pt;Ce.__COMPILER_RUNTIME={__proto__:null,c:function(e){return pt.H.useMemoCache(e)}};Ce.addTransitionType=Uy;Ce.cache=function(e){return function(){return e.apply(null,arguments)}};Ce.cacheSignal=function(){return null};Ce.cloneElement=function(e,t,i){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=Iy({},e.props),r=e.key;if(t!=null)for(s in t.key!==void 0&&(r=""+t.key),t)!Py.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(n[s]=t[s]);var s=arguments.length-2;if(s===1)n.children=i;else if(1<s){for(var a=Array(s),o=0;o<s;o++)a[o]=arguments[o+2];n.children=a}return gm(e.type,r,n)};Ce.createContext=function(e){return e={$$typeof:W2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:$2,_context:e},e};Ce.createElement=function(e,t,i){var n,r={},s=null;if(t!=null)for(n in t.key!==void 0&&(s=""+t.key),t)Py.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(r[n]=t[n]);var a=arguments.length-2;if(a===1)r.children=i;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];r.children=o}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)r[n]===void 0&&(r[n]=a[n]);return gm(e,s,r)};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(e){return{$$typeof:K2,render:e}};Ce.isValidElement=_m;Ce.lazy=function(e){return{$$typeof:Dy,_payload:{_status:-1,_result:e},_init:eD}};Ce.memo=function(e,t){return{$$typeof:j2,type:e,compare:t===void 0?null:t}};Ce.startTransition=Hy;Ce.unstable_useCacheRefresh=function(){return pt.H.useCacheRefresh()};Ce.use=function(e){return pt.H.use(e)};Ce.useActionState=function(e,t,i){return pt.H.useActionState(e,t,i)};Ce.useCallback=function(e,t){return pt.H.useCallback(e,t)};Ce.useContext=function(e){return pt.H.useContext(e)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(e,t){return pt.H.useDeferredValue(e,t)};Ce.useEffect=function(e,t){return pt.H.useEffect(e,t)};Ce.useEffectEvent=function(e){return pt.H.useEffectEvent(e)};Ce.useId=function(){return pt.H.useId()};Ce.useImperativeHandle=function(e,t,i){return pt.H.useImperativeHandle(e,t,i)};Ce.useInsertionEffect=function(e,t){return pt.H.useInsertionEffect(e,t)};Ce.useLayoutEffect=function(e,t){return pt.H.useLayoutEffect(e,t)};Ce.useMemo=function(e,t){return pt.H.useMemo(e,t)};Ce.useOptimistic=function(e,t){return pt.H.useOptimistic(e,t)};Ce.useReducer=function(e,t,i){return pt.H.useReducer(e,t,i)};Ce.useRef=function(e){return pt.H.useRef(e)};Ce.useState=function(e){return pt.H.useState(e)};Ce.useSyncExternalStore=function(e,t,i){return pt.H.useSyncExternalStore(e,t,i)};Ce.useTransition=function(){return pt.H.useTransition()};Ce.version="19.3.1"});var mt=ye((U8,Fy)=>{"use strict";Fy.exports=qy()});function nD(e,t=iD){let i=kd.default.useSyncExternalStore(e.subscribe,kd.default.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return kd.default.useDebugValue(i),i}var kd,iD,$y,Pn,Wy=se(()=>{kd=te(mt(),1);um();iD=e=>e;$y=e=>{let t=Ny(e),i=n=>nD(t,n);return Object.assign(i,t),i},Pn=(e=>e?$y(e):$y)});var Da=se(()=>{um();Wy()});function rD(e){let t=e.toLowerCase().replace(/^\[|\]$/g,"");if(t==="localhost"||t.endsWith(".localhost"))return/^[a-z0-9.-]+$/.test(t)&&!t.includes("..");if(t==="0.0.0.0"||t==="::1"||t==="::")return!0;let i=/^127\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);return!!i&&i.slice(1).every(n=>Number(n)<=255)}function sD(e){return e==="localhost"||e.endsWith(".localhost")?["127.0.0.1","::1"]:e==="0.0.0.0"?["127.0.0.1"]:e==="::1"?["::1"]:e==="::"?["::1","127.0.0.1"]:[e]}function aD(e){let t=e.trim();return/^\d{1,5}$/.test(t)?`http://localhost:${t}/`:/^:\d{1,5}(?:[/?#].*)?$/.test(t)?`http://localhost${t}`:/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||/^[a-z][a-z0-9+.-]*:(?!\d)/i.test(t)?t:`http://${t}`}function ns(e){if(typeof e!="string"||!e.trim())return{ok:!1,reason:"empty"};if(e.length>2048)return{ok:!1,reason:"too_long"};let t;try{t=new URL(aD(e))}catch{return{ok:!1,reason:"bad_url"}}if(t.protocol!=="http:"&&t.protocol!=="https:")return{ok:!1,reason:"scheme"};if(t.username||t.password)return{ok:!1,reason:"userinfo"};let i=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!rD(i))return{ok:!1,reason:"not_local"};let n=t.protocol==="https:",r=t.port?Number(t.port):n?443:80;if(!Number.isInteger(r)||r<1||r>65535)return{ok:!1,reason:"port"};let s=t.href;if(s.length>2048)return{ok:!1,reason:"too_long"};let a=i.includes(":")?`[${i}]`:i;return{ok:!0,target:{href:s,origin:`${t.protocol}//${a}:${r}`,path:`${t.pathname}${t.search}${t.hash}`,secure:n,hostname:i,port:r,connect:sD(i),hostHeader:`${a}:${r}`}}}function Ky(e,t,i){return e.startsWith(t)?vm(i)+e.slice(t.length):e}function vm(e){return e.replace(/^http:\/\/(.+):80$/,"http://$1").replace(/^https:\/\/(.+):443$/,"https://$1")}function bm(e){if(typeof e!="string"||!e||e.length>2048)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="http:"&&t.protocol!=="https:"||!t.hostname)return null;let i=t.href;return/[\s"'<>`\\^{|}]/.test(i)||i.length>2048?null:i}var Cd=se(()=>{});var ym,Gy=se(()=>{ym={zh:{app:{title:"Agent \u63A7\u5236\u53F0",subtitle:"\u5148\u5728\u5DE6\u4FA7\u65B0\u5EFA\u6216\u9009\u62E9\u4E00\u4E2A\u9879\u76EE"},common:{cancel:"\u53D6\u6D88",ok:"\u786E\u5B9A",save:"\u4FDD\u5B58",add:"\u6DFB\u52A0",browse:"\u6D4F\u89C8\u2026",more:"\u66F4\u591A",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",copyPath:"\u590D\u5236\u8DEF\u5F84",copiedPath:"\u5DF2\u590D\u5236\u8DEF\u5F84",search:"\u641C\u7D22",settings:"\u8BBE\u7F6E",remove:"\u79FB\u9664",close:"\u5173\u95ED",retry:"\u91CD\u8BD5",details:"\u8BE6\u60C5 \u203A",submit:"\u63D0\u4EA4",other:"\u5176\u4ED6\u2026",default:"\u9ED8\u8BA4",done:"\u5B8C\u6210",loading:"\u52A0\u8F7D\u4E2D\u2026",send:"\u53D1\u9001",stop:"\u505C\u6B62",refresh:"\u5237\u65B0",rename:"\u91CD\u547D\u540D",delete:"\u5220\u9664",discard:"\u653E\u5F03",notInstalled:"\uFF08\u672A\u5B89\u88C5\uFF09",notDetected:"\uFF08\u672A\u68C0\u6D4B\u5230\uFF09",current:"\uFF08\u5F53\u524D\uFF09",messages:"\u6761",imported:" \xB7 \u5DF2\u5BFC\u5165",justNow:"\u521A\u521A",minutesAgo:"{n} \u5206\u949F\u524D",hoursAgo:"{n} \u5C0F\u65F6\u524D",daysAgo:"{n} \u5929\u524D"},boot:{connecting:"\u6B63\u5728\u8FDE\u63A5\u2026",serviceDown:"\u672C\u5730\u670D\u52A1\u672A\u542F\u52A8",retry:"\u91CD\u8BD5",reconnecting:"\u8FDE\u63A5\u4E2D\u65AD\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5\u2026",starting:"\u6B63\u5728\u542F\u52A8\u672C\u5730\u670D\u52A1\u2026",reopening:"\u672C\u5730\u670D\u52A1\u5DF2\u91CD\u542F\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5\u2026"},topbar:{pickThread:"\u9009\u62E9\u4E00\u4E2A\u5BF9\u8BDD",sidebar:"\u4FA7\u680F\uFF08Ctrl+B\uFF09",clickRename:"\u70B9\u51FB\u6539\u540D",waitAuth:"\u7B49\u5F85\u6388\u6743",showRequest:"\u67E5\u770B\u6388\u6743\u8BF7\u6C42",running:"\u8FD0\u884C\u4E2D {s}s",error:"\u51FA\u9519",closedResume:"\u5DF2\u5173\u95ED \xB7 \u53D1\u9001\u6D88\u606F\u5C06\u7EED\u63A5",threadInfo:"\u5BF9\u8BDD\u4FE1\u606F",panelChanges:"\u6539\u52A8\uFF08Ctrl+J\uFF09",panelFiles:"\u6587\u4EF6",panelTerminal:"\u7EC8\u7AEF"},sidebar:{newProject:"\u65B0\u5EFA\u9879\u76EE",collapse:"\u6536\u8D77\u4FA7\u680F",expand:"\u5C55\u5F00\u4FA7\u680F",filterPlaceholder:"\u8FC7\u6EE4\u5BF9\u8BDD\u6807\u9898",searchTitle:"\u641C\u7D22\uFF08Ctrl+K\uFF09",noProjectsTitle:"\u8FD8\u6CA1\u6709\u9879\u76EE",noProjectsSub:"\u9879\u76EE\u5BF9\u5E94\u4E00\u4E2A\u672C\u673A\u76EE\u5F55\uFF0C\u5BF9\u8BDD\u90FD\u5728\u76EE\u5F55\u91CC\u5E72\u6D3B\u3002",newThread:"\u65B0\u5EFA\u5BF9\u8BDD",projectMenu:"\u9879\u76EE\u83DC\u5355",showAll:"\u663E\u793A\u5168\u90E8 {n} \u6761",noThreads:"\u8FD8\u6CA1\u6709\u5BF9\u8BDD",rename:"\u91CD\u547D\u540D",pin:"\u7F6E\u9876",unpin:"\u53D6\u6D88\u7F6E\u9876",archive:"\u5F52\u6863",unarchive:"\u53D6\u6D88\u5F52\u6863",exportMd:"\u5BFC\u51FA Markdown",deleteThread:"\u5220\u9664\u5BF9\u8BDD",deleteThreadBody:"\u300C{title}\u300D\u5C06\u88AB\u79FB\u5230\u56DE\u6536\u76EE\u5F55\uFF0C\u786E\u5B9A\u5417\uFF1F",importHist:"\u5BFC\u5165\u5DF2\u6709\u5BF9\u8BDD\u2026",openExplorer:"\u5728\u8D44\u6E90\u7BA1\u7406\u5668\u6253\u5F00",showArchived:"\u663E\u793A\u5DF2\u5F52\u6863",hideArchived:"\u9690\u85CF\u5DF2\u5F52\u6863",archivedN:"\u5DF2\u5F52\u6863 {n} \u6761",archivedHint:"\u5DF2\u5F52\u6863\uFF0C\u53EF\u5728\u9879\u76EE\u5217\u8868\u5E95\u90E8\u67E5\u770B",unarchived:"\u5DF2\u53D6\u6D88\u5F52\u6863",exportSaved:"\u5DF2\u5BFC\u51FA\u5230 {path}",removeProject:"\u79FB\u9664\u9879\u76EE",removeProjectBody:"\u300C{name}\u300D\u5C06\u4ECE\u5217\u8868\u79FB\u9664\uFF0C\u5176\u5BF9\u8BDD\u79FB\u5230\u56DE\u6536\u76EE\u5F55\uFF08\u6587\u4EF6\u4E0D\u4F1A\u88AB\u5220\u9664\uFF09\u3002",renameProject:"\u91CD\u547D\u540D\u9879\u76EE",projectName:"\u9879\u76EE\u540D",newProjectDlg:"\u65B0\u5EFA\u9879\u76EE",dirLabel:"\u9879\u76EE\u76EE\u5F55\uFF08\u5FC5\u987B\u662F\u5DF2\u5B58\u5728\u7684\u6587\u4EF6\u5939\uFF09",dirMissing:"\u76EE\u5F55\u4E0D\u5B58\u5728",notDir:"\u8FD9\u662F\u4E00\u4E2A\u6587\u4EF6\uFF0C\u4E0D\u662F\u76EE\u5F55",dirOk:"\u2713 \u76EE\u5F55\u53EF\u7528\uFF0C\u9879\u76EE\u540D\u53D6\u76EE\u5F55\u540D",recent:"\u6700\u8FD1\u4F7F\u7528",pickFolderUnsupported:"\u5F53\u524D\u7CFB\u7EDF\u4E0D\u652F\u6301\u5F39\u7A97\u9009\u76EE\u5F55\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165",pickFolderFailed:"\u6253\u5F00\u6587\u4EF6\u5939\u9009\u62E9\u6846\u5931\u8D25",importTitle:"\u5BFC\u5165\u5DF2\u6709\u5BF9\u8BDD \u2014 {name}",scanning:"\u6B63\u5728\u626B\u63CF\u672C\u673A\u5386\u53F2\u4F1A\u8BDD\u2026",importEmpty:"\u6CA1\u6709\u627E\u5230\u5BF9\u5E94\u8FD9\u4E2A\u9879\u76EE\u76EE\u5F55\u7684\u5386\u53F2\u4F1A\u8BDD\u3002",importing:"\u5BFC\u5165\u4E2D\u2026",importN:"\u5BFC\u5165 {n} \u4E2A\u5BF9\u8BDD",importedN:"\u5DF2\u5BFC\u5165 {n} \u4E2A\u5BF9\u8BDD",failNewThread:"\u65B0\u5EFA\u5BF9\u8BDD\u5931\u8D25\uFF1A",failRename:"\u91CD\u547D\u540D\u5931\u8D25\uFF1A",failAddProject:"\u6DFB\u52A0\u9879\u76EE\u5931\u8D25\uFF1A",failImportList:"\u8BFB\u53D6\u5386\u53F2\u5931\u8D25\uFF1A",failImport:"\u5BFC\u5165\u5931\u8D25\uFF1A",failExport:"\u5BFC\u51FA\u5931\u8D25\uFF1A"},chat:{newInProject:"\u5728 {name} \u4E2D\u65B0\u5EFA\u5BF9\u8BDD",emptyHint:"\u5BF9\u8BDD\u8FD8\u6CA1\u6709\u6D88\u606F\uFF0C\u4E0B\u9762\u8F93\u5165\u5F00\u59CB\u3002",jumpBottom:"\u56DE\u5230\u5E95\u90E8",emptyPlaceholder:"\u8F93\u5165\u4EFB\u52A1\uFF0CEnter \u53D1\u9001",autoNewThread:"\u5C06\u81EA\u52A8\u65B0\u5EFA\u5BF9\u8BDD",pickProjectTitle:"\u9009\u62E9\u4E00\u4E2A\u9879\u76EE",pickProjectSub:"\u5728\u5DE6\u4FA7\u9009\u4E00\u4E2A\u9879\u76EE\uFF0C\u6216\u65B0\u5EFA\u4E00\u4E2A\uFF0C\u7136\u540E\u5F00\u59CB\u5BF9\u8BDD\u3002",failSend:"\u53D1\u9001\u5931\u8D25\uFF1A"},composer:{waitPerm:"\u7B49\u5F85\u4F60\u786E\u8BA4\u4E0A\u9762\u7684\u6388\u6743\u8BF7\u6C42",queuePlaceholder:"\u8F93\u5165\u6392\u961F\u6D88\u606F\uFF08Ctrl+Enter \u63D2\u8BDD\uFF09",queuePlaceholderNoSteer:"\u7EE7\u7EED\u8865\u5145\u8981\u6C42\uFF0C\u56DE\u8F66\u6392\u961F\u53D1\u9001\u2026",steerUnsupported:"{agent} \u4E0D\u652F\u6301\u63D2\u8BDD\uFF1A\u8FD0\u884C\u4E2D\u53D1\u7684\u6D88\u606F\u4F1A\u6392\u961F\uFF0C\u672C\u56DE\u5408\u7ED3\u675F\u540E\u518D\u53D1\u9001\u3002",queuedToast:"\u5DF2\u6392\u961F\uFF1A\u672C\u56DE\u5408\u7ED3\u675F\u540E\u53D1\u9001",steeredToast:"\u5DF2\u63D2\u8BDD",inputPlaceholder:"\u8F93\u5165\u6D88\u606F\uFF0C/ \u4F7F\u7528\u547D\u4EE4\u2026",autoWarn:"\u5168\u90E8\u81EA\u52A8\u540C\u610F\u4F1A\u8BA9 Agent \u4E0D\u7ECF\u8BE2\u95EE\u76F4\u63A5\u8FD0\u884C\u547D\u4EE4\u3001\u4FEE\u6539\u6587\u4EF6\uFF1ACodex \u5173\u95ED\u6C99\u7BB1\uFF08danger-full-access\uFF09\uFF0CClaude Code \u8DF3\u8FC7\u6240\u6709\u6743\u9650\u68C0\u67E5\uFF0C\u5176\u4ED6 Agent \u7684\u6388\u6743\u8BF7\u6C42\u7531\u63A7\u5236\u53F0\u81EA\u52A8\u300C\u5141\u8BB8\u4E00\u6B21\u300D\u3002\u8BF7\u8C28\u614E\u4F7F\u7528\u3002",autoOn:{title:"\u5168\u90E8\u81EA\u52A8\u540C\u610F\u5DF2\u5F00\u542F",back:"\u6539\u56DE\u6BCF\u6B21\u8BE2\u95EE",keeps:"\u8BA1\u5212\u786E\u8BA4\u548C\u63D0\u95EE\u4ECD\u4F1A\u95EE\u4F60\uFF1B\u6BCF\u6B21\u53EA\u540C\u610F\u5F53\u524D\u8FD9\u4E00\u4E2A\u8BF7\u6C42\uFF0C\u4E0D\u4F1A\u5199\u5165\u6C38\u4E45\u89C4\u5219\u3002"},autoDesc:{claude:"Claude Code \u4EE5 bypassPermissions \u8FD0\u884C\uFF1A\u8DF3\u8FC7\u6240\u6709\u6743\u9650\u68C0\u67E5\uFF0C\u547D\u4EE4\u548C\u6539\u6587\u4EF6\u90FD\u4E0D\u518D\u8BE2\u95EE\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09",codex:"Codex \u6C99\u7BB1\u5173\u95ED\uFF08danger-full-access\uFF09\u4E14\u4ECE\u4E0D\u8BE2\u95EE\uFF1A\u547D\u4EE4\u53EF\u8BFB\u5199\u6574\u53F0\u7535\u8111\u3001\u53EF\u8054\u7F51\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09",copilot:"Copilot Allow All\uFF1A\u6240\u6709\u5DE5\u5177\u8C03\u7528\u90FD\u4E0D\u518D\u786E\u8BA4\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09",devin:"Devin Bypass Permissions\uFF1A\u8DF3\u8FC7\u6240\u6709\u6743\u9650\u68C0\u67E5\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09",cursor:"Agent \u6A21\u5F0F\uFF0C\u6BCF\u4E2A\u6388\u6743\u8BF7\u6C42\u90FD\u7531\u63A7\u5236\u53F0\u81EA\u52A8\u300C\u5141\u8BB8\u4E00\u6B21\u300D\uFF1A\u547D\u4EE4\u548C\u6539\u6587\u4EF6\u76F4\u63A5\u6267\u884C\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09",opencode:"Build \u6A21\u5F0F\uFF0C\u6BCF\u4E2A\u6388\u6743\u8BF7\u6C42\u90FD\u7531\u63A7\u5236\u53F0\u81EA\u52A8\u300C\u5141\u8BB8\u4E00\u6B21\u300D\uFF1A\u547D\u4EE4\u548C\u6539\u6587\u4EF6\u76F4\u63A5\u6267\u884C\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09",generic:"\u6BCF\u4E2A\u6388\u6743\u8BF7\u6C42\u90FD\u7531\u63A7\u5236\u53F0\u81EA\u52A8\u300C\u5141\u8BB8\u4E00\u6B21\u300D\uFF1A\u547D\u4EE4\u548C\u6539\u6587\u4EF6\u76F4\u63A5\u6267\u884C\uFF0C\u4E0D\u518D\u8BE2\u95EE\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09",pi:"Pi \u672C\u8EAB\u4ECE\u4E0D\u8BE2\u95EE\uFF1A\u547D\u4EE4\u548C\u6539\u6587\u4EF6\u76F4\u63A5\u6267\u884C\uFF08\u6269\u5C55\u53D1\u8D77\u7684\u786E\u8BA4\u4ECD\u4F1A\u95EE\u4F60\uFF09"},imagesByPath:"{agent} \u4E0D\u80FD\u76F4\u63A5\u770B\u56FE\u7247\uFF1A\u4F1A\u628A\u56FE\u7247\u7684\u6587\u4EF6\u8DEF\u5F84\u53D1\u7ED9\u5B83\uFF08\u5B83\u80FD\u7528\u6587\u4EF6\u5DE5\u5177\u6253\u5F00\uFF09\u3002",agentModel:"Agent & model",agentLocked:"Agent (locked)",agent:"Agent",model:"Model",searchModel:"Search",searchAllModels:"Search models\u2026",providers:"Agent",agentLockedHint:"\u5DF2\u5F00\u59CB\u7684\u5BF9\u8BDD\u4E0D\u80FD\u66F4\u6362 Agent\uFF1B\u8981\u7528\u522B\u7684 Agent \u8BF7\u65B0\u5EFA\u5BF9\u8BDD\u3002",providersLoading:"\u6B63\u5728\u68C0\u6D4B Agent\u2026",moreModels:"\u8FD8\u6709 {n} \u4E2A\u6A21\u578B\uFF0C\u8BF7\u7528\u4E0A\u65B9\u641C\u7D22",pickModel:"\u9009\u62E9\u6A21\u578B",noModelMatch:"\u6CA1\u6709\u5339\u914D\u7684\u6A21\u578B",defaultModel:"\u9ED8\u8BA4",defaultEffort:"\u9ED8\u8BA4",defaultEffortNamed:"\u9ED8\u8BA4\uFF08{level}\uFF09",effortTitle:"\u601D\u8003\u5F3A\u5EA6",modeTitle:"\u6743\u9650\u6A21\u5F0F",attachTitle:"\u9644\u4EF6\uFF08\u56FE\u7247/\u6587\u672C\uFF09",failSwitchAgent:"\u5207\u6362 Agent \u5931\u8D25\uFF1A",failSend:"\u53D1\u9001\u5931\u8D25\uFF1A",failUpload:"\u9644\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF1A",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",steerTag:"\u63D2\u8BDD",cursorAutoReview:"\u81EA\u52A8\u63A5\u53D7\u6743\u9650\u63D0\u793A\uFF08Auto-review\uFF09",cursorFastOff:"\u6807\u51C6\u901F\u5EA6",cursorFastOn:"Fast",slashGroupCommand:"\u547D\u4EE4",slashGroupSkill:"Skill",slashNoCommands:"\u8BE5 Agent \u672A\u63D0\u4F9B\u547D\u4EE4",slashLoading:"\u6B63\u5728\u83B7\u53D6\u547D\u4EE4\u2026",mode:{plan:{label:"\u89C4\u5212",desc:"\u53EA\u5206\u6790\u4EE3\u7801\u5E93\uFF0C\u4E0D\u6267\u884C\u5DE5\u5177\u6216\u4FEE\u6539"},default:{label:"\u6BCF\u6B21\u8BE2\u95EE",desc:"\u9996\u6B21\u4F7F\u7528\u5DE5\u5177\u65F6\u4F1A\u8BF7\u6C42\u6388\u6743"},acceptEdits:{label:"\u63A5\u53D7\u7F16\u8F91",desc:"\u81EA\u52A8\u6279\u51C6\u7F16\u8F91\u7C7B\u5DE5\u5177\uFF0C\u4E0D\u518D\u9010\u9879\u8BE2\u95EE"},bypass:{label:"\u5168\u90E8\u81EA\u52A8\u540C\u610F",desc:"\u4E0D\u518D\u8BE2\u95EE\uFF1ACodex \u5173\u95ED\u6C99\u7BB1\uFF0CClaude Code \u8DF3\u8FC7\u6240\u6709\u6743\u9650\u68C0\u67E5\uFF0C\u5176\u4ED6 Agent \u7684\u8BF7\u6C42\u81EA\u52A8\u300C\u5141\u8BB8\u4E00\u6B21\u300D\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09"},cursorBypass:{label:"\u5168\u90E8\u81EA\u52A8\u540C\u610F",desc:"Agent \u6A21\u5F0F\uFF0C\u6BCF\u4E2A\u6388\u6743\u8BF7\u6C42\u90FD\u7531\u63A7\u5236\u53F0\u81EA\u52A8\u300C\u5141\u8BB8\u4E00\u6B21\u300D\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09"},cursorAgent:{label:"Agent",desc:"\u5B8C\u6574 Agent\uFF1A\u53EF\u8BFB\u5199\u3001\u6267\u884C\u5DE5\u5177"},cursorPlan:{label:"\u89C4\u5212",desc:"\u53EA\u8BFB\u89C4\u5212\uFF1A\u5206\u6790\u5E76\u63D0\u51FA\u65B9\u6848\uFF0C\u4E0D\u6539\u6587\u4EF6"},cursorAsk:{label:"\u95EE\u7B54",desc:"\u95EE\u7B54\u6A21\u5F0F\uFF1A\u89E3\u91CA\u4E0E\u8BA8\u8BBA\uFF0C\u53EA\u8BFB"},pi:{label:"Pi \u672C\u8EAB\u4ECE\u4E0D\u8BE2\u95EE",desc:"Pi \u672C\u8EAB\u4ECE\u4E0D\u8BE2\u95EE\uFF1A\u547D\u4EE4\u548C\u6539\u6587\u4EF6\u76F4\u63A5\u6267\u884C\uFF08\u6269\u5C55\u53D1\u8D77\u7684\u786E\u8BA4\u4ECD\u4F1A\u95EE\u4F60\uFF09"}},agentMode:{Plan:"\u89C4\u5212",Build:"\u6784\u5EFA",Ask:"\u8BE2\u95EE",Code:"\u7F16\u7801",Agent:"Agent","Allow All":"\u5168\u90E8\u5141\u8BB8","Bypass Permissions":"\u8DF3\u8FC7\u6388\u6743","Read Only":"\u53EA\u8BFB",Auto:"\u81EA\u52A8","Full Access":"\u5B8C\u5168\u8BBF\u95EE"},effort:{low:"\u4F4E",medium:"\u4E2D",high:"\u9AD8",xhigh:"\u8D85\u9AD8",max:"\u6700\u9AD8",minimal:"\u6700\u4F4E",none:"\u5173\u95ED"}},settings:{contentWidth:"\u5185\u5BB9\u5BBD\u5EA6",widthNarrow:"\u7A84\uFF08640\uFF09",widthDefault:"\u9ED8\u8BA4\uFF08720\uFF09",widthWide:"\u5BBD\uFF08880\uFF09",widthFull:"\u94FA\u6EE1",bashPath:"Bash \u8DEF\u5F84\uFF08Windows\uFF09",bashCheck:"\u68C0\u6D4B",bashOk:"\u53EF\u7528\uFF1A{path}",bashUsing:"\u5F53\u524D\u4F7F\u7528\uFF1A{path}\uFF08{src}\uFF09",bashNone:"\u6CA1\u6709\u627E\u5230 Git Bash\u3002",bashManualBad:"\u624B\u52A8\u8DEF\u5F84\u4E0D\u53EF\u7528\uFF08{why}\uFF09\uFF0C\u5DF2\u6539\u7528\u81EA\u52A8\u68C0\u6D4B",bashHint:"Claude Code\u3001Pi\u3001dsh \u5728 Windows \u4E0A\u7528 Git Bash \u6267\u884C\u547D\u4EE4\u3002\u7559\u7A7A\u5C31\u81EA\u52A8\u68C0\u6D4B\uFF08git.exe \u65C1\u8FB9\u3001Program Files\u3001\u5404\u76D8\u7684 \\Git\uFF09\uFF1B\u88C5\u5728\u522B\u5904\u65F6\u586B bash.exe \u7684\u5B8C\u6574\u8DEF\u5F84\u3002",bashNotWindows:"\u53EA\u5728 Windows \u4E0A\u9700\u8981\u3002macOS \u548C Linux \u76F4\u63A5\u7528\u7CFB\u7EDF\u81EA\u5E26\u7684 bash\u3002",bashSrc:{manual:"\u624B\u52A8\u8BBE\u7F6E",env:"\u73AF\u5883\u53D8\u91CF",git:"git.exe \u65C1\u8FB9",known:"\u9ED8\u8BA4\u5B89\u88C5\u4F4D\u7F6E",drive:"\u5176\u4ED6\u76D8",path:"PATH"},bashBad:{empty:"\u8DEF\u5F84\u4E3A\u7A7A",relative:"\u8981\u586B\u5B8C\u6574\u8DEF\u5F84\uFF0C\u6BD4\u5982 E:\\Git\\bin\\bash.exe",notBash:"\u8981\u6307\u5411 bash.exe\uFF08\u6216 sh.exe\uFF09",wsl:"\u8FD9\u662F WSL \u7684 bash\uFF0C\u4E0D\u80FD\u7528",missing:"\u6587\u4EF6\u4E0D\u5B58\u5728"},chatFont:"\u804A\u5929\u5B57\u53F7",chatFontDefault:"\uFF08\u9ED8\u8BA4\uFF09",chatFontHint:"\u5BF9\u8BDD\u6B63\u6587\u3001\u8F93\u5165\u6846\u3001\u5DE5\u5177\u8F93\u51FA\u548C\u4EE3\u7801\u4E00\u8D77\u7F29\u653E\uFF08\u4EE3\u7801\u5C0F 1px\uFF09",title:"\u8BBE\u7F6E",defaultAgent:"\u9ED8\u8BA4 Agent",defaultMode:"\u9ED8\u8BA4\u6743\u9650\u6A21\u5F0F",theme:"\u4E3B\u9898",themeAuto:"\u8DDF\u968F\u7CFB\u7EDF",themeMagpie:"\u8DDF\u968F Magpie",themeLight:"\u6D45\u8272",themeDark:"\u6DF1\u8272",sendKey:"\u53D1\u9001\u952E",sendEnter:"Enter \u53D1\u9001 / Shift+Enter \u6362\u884C",sendCtrl:"Ctrl+Enter \u53D1\u9001 / Enter \u6362\u884C",runningSend:"\u8FD0\u884C\u4E2D\u518D\u53D1\u9001",queue:"\u6392\u961F\uFF08\u53D1\u5B8C\u81EA\u52A8\u7EE7\u7EED\uFF09",steer:"\u63D2\u8BDD\uFF08\u7ACB\u5373\u6253\u65AD\u5F53\u524D\u601D\u8DEF\uFF09",steerHint:"\u63D2\u8BDD\u53EA\u5BF9\u652F\u6301\u7684 Agent \u751F\u6548\uFF08\u76EE\u524D\u662F Codex\uFF09\uFF1B\u5176\u4ED6 Agent \u4ECD\u4F1A\u6392\u961F\uFF0C\u8F93\u5165\u6846\u4E0B\u65B9\u4F1A\u63D0\u793A\u3002",defaultModeHint:"\u65B0\u5BF9\u8BDD\u4F7F\u7528\uFF1B\u6BCF\u4E2A Agent \u4F1A\u6362\u6210\u81EA\u5DF1\u6700\u63A5\u8FD1\u7684\u6A21\u5F0F\uFF08\u4F8B\u5982 OpenCode \u53EA\u6709 Plan / Build\uFF0CBuild \u4F1A\u76F4\u63A5\u6539\u6587\u4EF6\uFF09\u3002\u9009\u300C\u5168\u90E8\u81EA\u52A8\u540C\u610F\u300D\u540E\uFF0C\u6240\u6709 Agent \u90FD\u4E0D\u518D\u5F39\u6388\u6743\u3002",thinking:"\u601D\u8003\u8FC7\u7A0B",showThinking:"\u663E\u793A Agent \u7684\u601D\u8003/\u63A8\u7406\u5185\u5BB9",idleClose:"\u7A7A\u95F2\u56DE\u6536",idleMinutes:"\u5206\u949F\u540E\u81EA\u52A8\u5173\u95ED\u7A7A\u95F2\u4F1A\u8BDD\uFF085\u2013240\uFF1B\u6700\u591A\u4FDD\u7559 3 \u4E2A\u7A7A\u95F2 Agent \u8FDB\u7A0B\uFF09",idleInvalid:"\u8BF7\u8F93\u5165 5 \u5230 240 \u4E4B\u95F4\u7684\u6574\u6570",versionLine:"\u7248\u672C v{ver} \xB7 PID {pid}",dataDir:"\u6570\u636E\u76EE\u5F55\uFF1A",failSave:"\u4FDD\u5B58\u5931\u8D25\uFF1A",providers:"Agent",providerOn:"\u53EF\u7528",providerOff:"\u5DF2\u7981\u7528",providerPending:"\u5C1A\u672A\u63A5\u5165",providerVerified:"\u5DF2\u9A8C\u8BC1",providerExperimental:"\u5B9E\u9A8C\u6027",providerPlanned:"\u672A\u63A5\u5165",providerModels:"{n} \u4E2A Model",providerRedetect:"\u91CD\u65B0\u68C0\u6D4B",providerCopyHint:"\u590D\u5236\u5B89\u88C5\u63D0\u793A",providerLaunchCmd:"\u81EA\u5B9A\u4E49\u542F\u52A8\uFF08\u9AD8\u7EA7\uFF09",providerLaunchExe:"\u53EF\u6267\u884C\u6587\u4EF6\u8DEF\u5F84\uFF08\u7559\u7A7A = \u81EA\u52A8\u67E5\u627E\uFF09",providerLaunchArgs:"\u9644\u52A0\u53C2\u6570\uFF08JSON \u6570\u7EC4\uFF09",providerLaunchArgsHint:'\u8FFD\u52A0\u5728\u5185\u7F6E\u53C2\u6570\u4E4B\u540E\uFF0C\u4F8B\u5982 ["--foo"]\uFF1B\u56DE\u8F66\u6216\u79BB\u5F00\u8F93\u5165\u6846\u65F6\u4FDD\u5B58\u3002\u65B0\u5BF9\u8BDD\u751F\u6548\u3002',providerArgsInvalid:'\u9700\u8981 JSON \u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u4F8B\u5982 ["--foo"]',providerToggleFailed:"\u5207\u6362\u5931\u8D25\uFF0C\u5DF2\u6062\u590D\uFF1A"},palette:{aria:"\u547D\u4EE4\u9762\u677F",placeholder:"\u641C\u7D22\u5BF9\u8BDD\u3001\u9879\u76EE\u6216\u52A8\u4F5C\u2026",noMatch:"\u6CA1\u6709\u5339\u914D\u9879",hintAction:"\u52A8\u4F5C",hintThread:"\u5BF9\u8BDD",hintProject:"\u9879\u76EE",actNewThread:"\u65B0\u5EFA\u5BF9\u8BDD",actSettings:"\u6253\u5F00\u8BBE\u7F6E",actTheme:"\u5207\u6362\u4E3B\u9898",actChanges:"\u6253\u5F00\u6539\u52A8\u9762\u677F",actFiles:"\u6253\u5F00\u6587\u4EF6\u9762\u677F",actTerminal:"\u6253\u5F00\u7EC8\u7AEF\u9762\u677F",actImport:"\u5BFC\u5165\u5DF2\u6709\u5BF9\u8BDD\u2026",failNew:"\u65B0\u5EFA\u5931\u8D25\uFF1A"},panel:{changes:"\u6539\u52A8",files:"\u6587\u4EF6",terminal:"\u7EC8\u7AEF",closeTitle:"\u5173\u95ED\uFF08Ctrl+J\uFF09",pickProject:"\u5148\u9009\u4E00\u4E2A\u9879\u76EE",notGit:"\u8FD9\u4E2A\u9879\u76EE\u4E0D\u662F git \u4ED3\u5E93",clean:"\u5DE5\u4F5C\u533A\u5E72\u51C0",branch:"\u5F53\u524D\u5206\u652F",loadingDiff:"\u52A0\u8F7D diff\u2026",diffTooLarge:"diff \u8D85\u8FC7 1MB\uFF0C\u4E0D\u663E\u793A",discardTitle:"\u653E\u5F03\u6539\u52A8",discardUntracked:`\u653E\u5F03 {path} \u7684\u6539\u52A8\uFF1F
|
|
\u672A\u8DDF\u8E2A\u6587\u4EF6\u4F1A\u88AB\u79FB\u5230\u56DE\u6536\u76EE\u5F55\uFF08trash/discarded\uFF09\uFF0C\u4E0D\u4F1A\u76F4\u63A5\u5220\u9664\u3002`,discardTracked:"\u653E\u5F03 {path} \u7684\u6539\u52A8\uFF1F\u8BE5\u6587\u4EF6\u4F1A\u6062\u590D\u5230 git \u91CC\u7684\u7248\u672C\u3002",discardBtn:"\u653E\u5F03\u6539\u52A8",failDiscard:"\u653E\u5F03\u5931\u8D25\uFF1A",closePreview:"\u5173\u95ED\u9884\u89C8",reading:"\u8BFB\u53D6\u4E2D\u2026",binary:"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u4E0D\u9884\u89C8",tooLarge:"\u8D85\u8FC7 1MB\uFF0C\u4E0D\u9884\u89C8",gitKind:{modified:"\u6539",added:"\u589E",deleted:"\u5220",untracked:"\u65B0",renamed:"\u79FB"}},terminal:{new:"\u65B0\u5EFA\u7EC8\u7AEF",noTerm:"\u8FD8\u6CA1\u6709\u7EC8\u7AEF",closeTitle:"\u5173\u95ED\u7EC8\u7AEF",closeBody:"\u5173\u95ED\u300C{title}\u300D\uFF1F\u91CC\u9762\u8FD0\u884C\u7684\u8FDB\u7A0B\u4F1A\u88AB\u7ED3\u675F\u3002",closeOk:"\u5173\u95ED",simpleNote:"\u7B80\u5316\u7EC8\u7AEF\uFF08\u65E0\u4EA4\u4E92\u7A0B\u5E8F\u652F\u6301\uFF09",ended:"\uFF08\u7EC8\u7AEF\u5DF2\u7ED3\u675F\uFF09",failNew:"\u65B0\u5EFA\u7EC8\u7AEF\u5931\u8D25\uFF1A",failKill:"\u5173\u95ED\u5931\u8D25\uFF1A"},thread:{new:"\u65B0\u5BF9\u8BDD",info:"\u5BF9\u8BDD\u4FE1\u606F",agent:"Agent",model:"\u6A21\u578B",mode:"\u6A21\u5F0F",effort:"\u601D\u8003\u5F3A\u5EA6",sessionId:"\u4F1A\u8BDD ID",tokens:"\u7D2F\u8BA1 token",cost:"\u7D2F\u8BA1\u8D39\u7528",created:"\u521B\u5EFA\u4E8E",workdir:"\u5DE5\u4F5C\u76EE\u5F55",importedFrom:"\u5BFC\u5165\u81EA",sessionNone:"\uFF08\u672A\u5EFA\u7ACB\uFF09",tokensFmt:"{in} \u5165 / {out} \u51FA / {cache} \u7F13\u5B58"},timeline:{thinking:"\u601D\u8003 {s}s",todo:"\u5F85\u529E {done}/{total}",steer:"\u63D2\u8BDD",tasks:"\u4EFB\u52A1",tasksPill:"{done}/{total} \u4E2A\u4EFB\u52A1",tasksPillTitle:"\u67E5\u770B\u4EFB\u52A1\u6E05\u5355",codeWrap:"\u81EA\u52A8\u6362\u884C",permAllowSession:"\u672C\u5BF9\u8BDD\u90FD\u5141\u8BB8",permDenied:"\u5DF2\u62D2\u7EDD",permAllowed:"\u5DF2\u5141\u8BB8",permAutoAllowed:"\u5DF2\u81EA\u52A8\u540C\u610F\uFF08\u5168\u90E8\u81EA\u52A8\u540C\u610F\uFF09",permCancelled:"\u5DF2\u53D6\u6D88",autoUpgrade:{title:"1.3 \u65B0\u589E\uFF1A\u5168\u90E8\u81EA\u52A8\u540C\u610F",body:"\u73B0\u5728\u300C\u5168\u90E8\u81EA\u52A8\u540C\u610F\u300D\u5BF9 Cursor\u3001OpenCode\u3001dsh \u4E5F\u4F1A\u771F\u6B63\u751F\u6548\uFF1A\u6388\u6743\u8BF7\u6C42\u7531\u63A7\u5236\u53F0\u81EA\u52A8\u300C\u5141\u8BB8\u4E00\u6B21\u300D\uFF0C\u547D\u4EE4\u548C\u6539\u6587\u4EF6\u76F4\u63A5\u6267\u884C\u30021.2 \u7684\u300C\u5168\u90E8\u653E\u884C\u300D\u5BF9\u5B83\u4EEC\u4E0D\u751F\u6548\uFF08\u4ECD\u4F1A\u8BE2\u95EE\uFF09\u3002\u4F60\u4E4B\u524D\u628A\u9ED8\u8BA4\u6743\u9650\u6A21\u5F0F\u8BBE\u6210\u4E86\u5B83\uFF0C\u4E3A\u5B89\u5168\u8D77\u89C1\uFF0C\u8FD9\u4E2A\u5BF9\u8BDD\u4ECD\u4ECE\u300C\u6BCF\u6B21\u8BE2\u95EE\u300D\u5F00\u59CB\u3002\u5728\u8BBE\u7F6E\u91CC\u91CD\u65B0\u9009\u62E9\u4E00\u6B21\u9ED8\u8BA4\u6743\u9650\u6A21\u5F0F\u540E\uFF0C\u65B0\u5BF9\u8BDD\u5C31\u6309\u4F60\u7684\u9009\u62E9\u6765\u3002",migrated:"\u8FD9\u4E2A\u5BF9\u8BDD\u5728 1.2 \u91CC\u8BBE\u6210\u4E86\u300C\u5168\u90E8\u653E\u884C\u300D\uFF0C\u5F53\u65F6\u8FD9\u4E2A Agent \u5B9E\u9645\u4ECD\u4F1A\u8BE2\u95EE\u30021.3 \u8D77\u300C\u5168\u90E8\u81EA\u52A8\u540C\u610F\u300D\u4F1A\u771F\u6B63\u81EA\u52A8\u540C\u610F\uFF08\u547D\u4EE4\u548C\u6539\u6587\u4EF6\u76F4\u63A5\u6267\u884C\uFF09\uFF0C\u6240\u4EE5\u5DF2\u6539\u56DE\u300C\u6BCF\u6B21\u8BE2\u95EE\u300D\u3002",turnOn:"\u5728\u6B64\u5BF9\u8BDD\u5F00\u542F\u5168\u90E8\u81EA\u52A8\u540C\u610F",settings:"\u6253\u5F00\u8BBE\u7F6E"},autoApproved:{count:"\u5DF2\u81EA\u52A8\u540C\u610F {n} \u9879",title:"\u5168\u90E8\u81EA\u52A8\u540C\u610F\u66FF\u4F60\u540C\u610F\u4E86\u8FD9\u4E9B\u8BF7\u6C42\uFF08\u70B9\u5F00\u67E5\u770B\uFF09",answer:"{opt} \xB7 \u5168\u90E8\u81EA\u52A8\u540C\u610F",pending:"\u6B63\u5728\u81EA\u52A8\u540C\u610F\u2026"},submitted:"\u5DF2\u63D0\u4EA4\uFF1A{ans}",turnError:"\u51FA\u9519\uFF1A{err}",unknownError:"\u672A\u77E5\u9519\u8BEF",interrupted:"\u5DF2\u6253\u65AD",filesChanged:"\u6539\u52A8 {n} \u4E2A\u6587\u4EF6 \u203A",editMsg:"\u7F16\u8F91\uFF08\u586B\u56DE\u8F93\u5165\u6846\uFF0C\u4E0D\u4F1A\u9A6C\u4E0A\u53D1\u9001\uFF09",sendFailed:"\u53D1\u9001\u5931\u8D25",sendRetry:"\u91CD\u65B0\u53D1\u9001",sendDismiss:"\u79FB\u9664\u8FD9\u6761\u6CA1\u53D1\u51FA\u7684\u6D88\u606F",resend:"\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F",retryHint:"\u91CD\u8BD5\uFF1A\u91CD\u65B0\u53D1\u9001\u4E0A\u4E00\u6761\u6D88\u606F",msgActions:"\u6D88\u606F\u64CD\u4F5C",editBusy:"\u8F93\u5165\u6846\u91CC\u8FD8\u6709\u6CA1\u53D1\u9001\u7684\u5185\u5BB9\uFF1A\u5148\u53D1\u9001\u6216\u6E05\u7A7A\uFF0C\u518D\u70B9\u7F16\u8F91",tool:{read:"\u8BFB\u53D6",edit:"\u4FEE\u6539",write:"\u5199\u5165",bash:"\u8FD0\u884C",search:"\u641C\u7D22",glob:"\u641C\u7D22",web:"\u8054\u7F51",task:"\u5B50\u4EFB\u52A1",mcp:"\u5DE5\u5177",todo:"\u5F85\u529E",other:"\u5DE5\u5177",processing:"\u5904\u7406"},cat:{edit:"\u6539\u52A8 {n}",run:"\u8FD0\u884C {n}",read:"\u8BFB\u53D6 {n}",search:"\u641C\u7D22 {n}",other:"\u5176\u4ED6 {n}"},failedCount:"{n} \u5931\u8D25",noErrorOutput:"\u6CA1\u6709\u9519\u8BEF\u8F93\u51FA",nowThinking:"\u6B63\u5728\u601D\u8003\u2026",now:{edit:"\u6B63\u5728\u6539\u52A8\uFF1A{x}\u2026",run:"\u6B63\u5728\u8FD0\u884C\uFF1A{x}\u2026",read:"\u6B63\u5728\u8BFB\u53D6\uFF1A{x}\u2026",search:"\u6B63\u5728\u641C\u7D22\uFF1A{x}\u2026",other:"\u6B63\u5728\u6267\u884C\uFF1A{x}\u2026"},bashMissing:"\u6CA1\u6709\u627E\u5230 Git Bash\u3002Claude Code\u3001Pi \u7B49 Agent \u5728 Windows \u4E0A\u8981\u7528\u5B83\u6267\u884C\u547D\u4EE4\u3002\uFF08C:\\Windows\\System32\\bash.exe \u662F WSL \u542F\u52A8\u5668\uFF0C\u4E0D\u80FD\u7528\u3002\uFF09\u88C5\u597D Git for Windows \u540E\u91CD\u65B0\u53D1\u9001\uFF1B\u88C5\u5728\u522B\u5904\u53EF\u4EE5\u5728\u300C\u8BBE\u7F6E \u2192 Bash \u8DEF\u5F84\u300D\u91CC\u6307\u5B9A bash.exe\u3002",bashDownload:"\u4E0B\u8F7D Git for Windows",bashSetting:"\u6253\u5F00\u8BBE\u7F6E",showAllLines:"\u663E\u793A\u5168\u90E8 {n} \u884C",diffClip:"\uFF08\u53EA\u663E\u793A\u524D {n} \u884C\uFF09"},api:{requestFailed:"\u8BF7\u6C42\u5931\u8D25",bad_params:"\u53C2\u6570\u4E0D\u6B63\u786E",not_found:"\u672A\u627E\u5230",busy:"\u6B63\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",bad_path:"\u8DEF\u5F84\u65E0\u6548",connClosed:"\u8FDE\u63A5\u4E2D\u65AD",notConnected:"\u8FDE\u63A5\u672A\u5EFA\u7ACB",timeout:"\u8BF7\u6C42\u8D85\u65F6"},preview:{tab:"\u9884\u89C8",address:"\u9884\u89C8\u5730\u5740",placeholder:"localhost:5173",back:"\u540E\u9000",forward:"\u524D\u8FDB",reload:"\u5237\u65B0",openExternal:"\u7528\u7CFB\u7EDF\u6D4F\u89C8\u5668\u6253\u5F00",widen:"\u52A0\u5BBD\u9762\u677F",onlyLocal:"\u9884\u89C8\u53EA\u652F\u6301\u672C\u673A\u5730\u5740\uFF08localhost\u3001127.0.0.1 \u7B49\uFF09",failed:"\u6253\u4E0D\u5F00\u9884\u89C8\uFF1A",empty:"\u8FD8\u6CA1\u6709\u9884\u89C8\u5730\u5740\u3002\u5728\u5BF9\u8BDD\u91CC\u70B9 localhost \u94FE\u63A5\uFF0C\u6216\u5728\u4E0A\u65B9\u8F93\u5165\uFF0C\u4F8B\u5982 localhost:5173",limits:"\u9884\u89C8\u5728\u6C99\u7BB1\u91CC\u8FD0\u884C\uFF1A\u5F39\u7A97\u3001alert \u548C\u539F\u751F\u8868\u5355\u63D0\u4EA4\u4E0D\u53EF\u7528\uFF1BlocalStorage \u548C\u767B\u5F55 cookie \u5237\u65B0\u540E\u4F1A\u4E22\u5931\uFF0C\u9700\u8981\u65F6\u8BF7\u7528\u7CFB\u7EDF\u6D4F\u89C8\u5668\u6253\u5F00\u3002",noLocalhost:"\u8FD9\u53F0\u7535\u8111\u7684\u7F51\u9875\u5185\u6838\u6253\u4E0D\u5F00 *.localhost \u5730\u5740\uFF08macOS 26 \u4EE5\u524D\u7684\u7CFB\u7EDF\u4F1A\u8FD9\u6837\uFF09\u3002\u9884\u89C8\u9760\u8FD9\u4E2A\u5730\u5740\u6321\u4F4F\u522B\u7684\u7F51\u9875\u8BFB\u53D6\u4F60\u7684 dev server\uFF0C\u6240\u4EE5\u8FD9\u91CC\u4E0D\u80FD\u9884\u89C8\uFF0C\u8BF7\u7528\u7CFB\u7EDF\u6D4F\u89C8\u5668\u6253\u5F00\u3002"},links:{openPreviewTitle:"\u5728\u9884\u89C8\u4E2D\u6253\u5F00\uFF08Ctrl/\u2318+\u70B9\u51FB\u7528\u6D4F\u89C8\u5668\u6253\u5F00\uFF09",externalFailed:"\u6253\u4E0D\u5F00\u7CFB\u7EDF\u6D4F\u89C8\u5668\uFF0C\u5DF2\u590D\u5236\u94FE\u63A5"},quote:{add:"\u6DFB\u52A0\u5230\u5BF9\u8BDD",addHint:"\u628A\u9009\u4E2D\u7684\u6587\u5B57\u4F5C\u4E3A\u5F15\u7528\u653E\u8FDB\u8F93\u5165\u6846\uFF08\u4E0D\u4F1A\u9A6C\u4E0A\u53D1\u9001\uFF09",chipTitle:"\u5F15\u7528\u7684\u6587\u5B57\uFF08\u53D1\u9001\u65F6\u4EE5\u5F15\u7528\u7684\u5F62\u5F0F\u653E\u5728\u4F60\u7684\u6D88\u606F\u524D\u9762\uFF09",remove:"\u79FB\u9664\u5F15\u7528",full:"\u6700\u591A {n} \u6761\u5F15\u7528",lines:"{n} \u884C"},mention:{drop:"\u677E\u5F00\u4EE5\u63D2\u5165\u5230\u804A\u5929",add:"\u63D2\u5165\u5230\u804A\u5929",copyRel:"\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84",remove:"\u79FB\u9664",otherProject:"\u53EA\u80FD\u63D2\u5165\u5F53\u524D\u5BF9\u8BDD\u6240\u5728\u9879\u76EE\u91CC\u7684\u6587\u4EF6"}},en:{app:{title:"Agent Console",subtitle:"Create or select a project in the sidebar"},common:{cancel:"Cancel",ok:"OK",save:"Save",add:"Add",browse:"Browse\u2026",more:"More",copy:"Copy",copied:"Copied",copyPath:"Copy path",copiedPath:"Path copied",search:"Search",settings:"Settings",remove:"Remove",close:"Close",retry:"Retry",details:"Details \u203A",submit:"Submit",other:"Other\u2026",default:"Default",done:"Done",loading:"Loading\u2026",send:"Send",stop:"Stop",refresh:"Refresh",rename:"Rename",delete:"Delete",discard:"Discard",notInstalled:" (not installed)",notDetected:" (not detected)",current:" (current)",messages:" msgs",imported:" \xB7 imported",justNow:"Just now",minutesAgo:"{n}m ago",hoursAgo:"{n}h ago",daysAgo:"{n}d ago"},boot:{connecting:"Connecting\u2026",serviceDown:"Local service is not running",retry:"Retry",reconnecting:"Connection lost. Reconnecting\u2026",starting:"Starting local service\u2026",reopening:"The local service restarted. Reconnecting\u2026"},topbar:{pickThread:"Select a conversation",sidebar:"Sidebar (Ctrl+B)",clickRename:"Click to rename",waitAuth:"Waiting for approval",showRequest:"Show the request",running:"Running {s}s",error:"Error",closedResume:"Closed \xB7 send a message to resume",threadInfo:"Conversation info",panelChanges:"Changes (Ctrl+J)",panelFiles:"Files",panelTerminal:"Terminal"},sidebar:{newProject:"New project",collapse:"Collapse sidebar",expand:"Expand sidebar",filterPlaceholder:"Filter conversations",searchTitle:"Search (Ctrl+K)",noProjectsTitle:"No projects yet",noProjectsSub:"A project maps to a folder on this machine.",newThread:"New conversation",projectMenu:"Project menu",showAll:"Show all {n}",noThreads:"No conversations yet",rename:"Rename",pin:"Pin",unpin:"Unpin",archive:"Archive",unarchive:"Unarchive",exportMd:"Export Markdown",deleteThread:"Delete conversation",deleteThreadBody:"Move \u201C{title}\u201D to trash?",importHist:"Import existing conversations\u2026",openExplorer:"Open in Explorer",showArchived:"Show archived",hideArchived:"Hide archived",archivedN:"{n} archived",archivedHint:"Archived \u2014 see the bottom of the project list",unarchived:"Unarchived",exportSaved:"Exported to {path}",removeProject:"Remove project",removeProjectBody:"Remove \u201C{name}\u201D from the list? Conversations move to trash (files stay on disk).",renameProject:"Rename project",projectName:"Project name",newProjectDlg:"New project",dirLabel:"Project folder (must already exist)",dirMissing:"Folder does not exist",notDir:"This path is a file, not a folder",dirOk:"\u2713 Folder OK \u2014 name comes from the folder",recent:"Recent",pickFolderUnsupported:"Folder picker is not available \u2014 type the path",pickFolderFailed:"Could not open folder picker",importTitle:"Import conversations \u2014 {name}",scanning:"Scanning local history\u2026",importEmpty:"No history found for this project folder.",importing:"Importing\u2026",importN:"Import {n} conversation(s)",importedN:"Imported {n} conversation(s)",failNewThread:"Could not create conversation: ",failRename:"Rename failed: ",failAddProject:"Could not add project: ",failImportList:"Could not read history: ",failImport:"Import failed: ",failExport:"Export failed: "},chat:{newInProject:"New conversation in {name}",emptyHint:"No messages yet \u2014 type below to start.",jumpBottom:"Jump to bottom",emptyPlaceholder:"Describe a task \u2014 Enter to send",autoNewThread:"A new conversation will be created",failSend:"Send failed: ",pickProjectTitle:"Pick a project",pickProjectSub:"Choose a project in the sidebar, or create one, to start a conversation."},composer:{waitPerm:"Waiting for your approval above",queuePlaceholder:"Queue a message (Ctrl+Enter to steer)",queuePlaceholderNoSteer:"Add to the task \u2014 Enter queues it\u2026",steerUnsupported:"{agent} can't steer: messages sent while it runs are queued and sent after this turn.",queuedToast:"Queued \u2014 sends after this turn",steeredToast:"Steered",inputPlaceholder:"Message the agent, / for commands\u2026",autoWarn:`Auto-approve all lets the agent run commands and edit files without asking: Codex turns its sandbox off (danger-full-access), Claude Code skips all permission checks, and every other agent's approval requests are answered "allow once" by the console. Use with care.`,autoOn:{title:"Auto-approve all is on",back:"Back to Always Ask",keeps:"Plan approvals and questions still ask you; each approval covers only that one request and never saves a lasting rule."},autoDesc:{claude:"Claude Code runs with bypassPermissions: skips all permission checks, commands and edits never ask (use with care)",codex:"Codex sandbox off (danger-full-access) and never asks: commands can read and write your whole machine and use the network (use with care)",copilot:"Copilot Allow All: no tool call asks for confirmation (use with care)",devin:"Devin Bypass Permissions: skips all permission checks (use with care)",cursor:'Agent mode, every approval request answered "allow once" by the console: commands and edits run without asking (use with care)',opencode:'Build mode, every approval request answered "allow once" by the console: commands and edits run without asking (use with care)',generic:'Every approval request is answered "allow once" by the console: commands and edits run without asking (use with care)',pi:"Pi itself never asks: commands and edits run directly (dialogs from Pi extensions still ask you)"},imagesByPath:"{agent} can't see images directly: it gets the image's file path instead (it can open it with its file tools).",agentModel:"Agent & model",agentLocked:"Agent (locked after first message)",agent:"Agent",model:"Model",searchModel:"Search",searchAllModels:"Search all models\u2026",providers:"Providers",agentLockedHint:"The agent can't change after the conversation starts. Start a new conversation to use another agent.",providersLoading:"Detecting agents\u2026",moreModels:"{n} more models \u2014 use search above",pickModel:"Choose model",noModelMatch:"No matching models",defaultModel:"Default",defaultEffort:"Default",defaultEffortNamed:"Default ({level})",effortTitle:"Reasoning effort",modeTitle:"Permission mode",attachTitle:"Attachments (images / text)",failSwitchAgent:"Could not switch agent: ",failSend:"Send failed: ",failUpload:"Upload failed: ",uploadFailed:"Upload failed",steerTag:"Steer",cursorAutoReview:"Auto accept permission prompts",cursorFastOff:"Off",cursorFastOn:"Fast",slashGroupCommand:"Commands",slashGroupSkill:"Skills",slashNoCommands:"This agent has no slash commands",slashLoading:"Loading commands\u2026",mode:{plan:{label:"Plan Mode",desc:"Analyze the codebase without running tools or edits"},default:{label:"Always Ask",desc:"Ask permission the first time a tool is used"},acceptEdits:{label:"Accept File Edits",desc:"Auto-approve edit tools without prompting"},bypass:{label:"Auto-approve all",desc:`Never asks: Codex turns its sandbox off, Claude Code skips all permission checks, other agents' requests are answered "allow once" (use with care)`},cursorBypass:{label:"Auto-approve all",desc:'Agent mode, every approval request answered "allow once" by the console (use with care)'},cursorAgent:{label:"Agent",desc:"Full agent: tools and edits"},cursorPlan:{label:"Plan",desc:"Read-only planning and analysis"},cursorAsk:{label:"Ask",desc:"Q&A style explanations (read-only)"},pi:{label:"Pi never asks",desc:"Pi itself never asks: commands and edits run directly (dialogs from Pi extensions still ask you)"}},agentMode:{},effort:{low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Max",minimal:"Minimal",none:"Off"}},settings:{contentWidth:"Content width",widthNarrow:"Narrow (640)",widthDefault:"Default (720)",widthWide:"Wide (880)",widthFull:"Full",bashPath:"Bash path (Windows)",bashCheck:"Check",bashOk:"Works: {path}",bashUsing:"In use: {path} ({src})",bashNone:"Git Bash was not found.",bashManualBad:"The manual path can't be used ({why}); using auto-detection",bashHint:"Claude Code, Pi and dsh run commands with Git Bash on Windows. Leave empty to auto-detect (next to git.exe, Program Files, \\Git on each drive); fill in the full bash.exe path if it lives elsewhere.",bashNotWindows:"Only needed on Windows. macOS and Linux use the system bash.",bashSrc:{manual:"set manually",env:"environment variable",git:"next to git.exe",known:"default install folder",drive:"another drive",path:"PATH"},bashBad:{empty:"The path is empty",relative:"Use a full path, e.g. E:\\Git\\bin\\bash.exe",notBash:"It must point to bash.exe (or sh.exe)",wsl:"That is the WSL bash, which won't work",missing:"File not found"},chatFont:"Chat font size",chatFontDefault:" (default)",chatFontHint:"Scales the conversation, the input, tool output and code (code 1px smaller)",title:"Settings",defaultAgent:"Default agent",defaultMode:"Default permission mode",theme:"Theme",themeAuto:"System",themeMagpie:"Follow Magpie",themeLight:"Light",themeDark:"Dark",sendKey:"Send shortcut",sendEnter:"Enter sends / Shift+Enter newline",sendCtrl:"Ctrl+Enter sends / Enter newline",runningSend:"While running",queue:"Queue (run after current turn)",steer:"Steer (interrupt now)",steerHint:"Steer only works for agents that support it (Codex today); other agents still queue, and the composer says so.",defaultModeHint:"For new conversations. Each agent maps it to its own nearest mode (OpenCode only has Plan / Build, and Build edits without asking). With Auto-approve all, no agent asks for approval.",thinking:"Reasoning",showThinking:"Show agent reasoning/thinking",idleClose:"Idle cleanup",idleMinutes:"minutes before closing idle sessions (5\u2013240; at most 3 idle agent processes are kept)",idleInvalid:"Enter a whole number from 5 to 240",versionLine:"Version v{ver} \xB7 PID {pid}",dataDir:"Data: ",failSave:"Could not save: ",providers:"Providers",providerOn:"Available",providerOff:"Disabled",providerPending:"Not wired yet",providerVerified:"Verified",providerExperimental:"Experimental",providerPlanned:"Planned",providerModels:"{n} models",providerRedetect:"Re-detect",providerCopyHint:"Copy install hint",providerLaunchCmd:"Custom launch (advanced)",providerLaunchExe:"Executable path (empty = find it automatically)",providerLaunchArgs:"Extra args (JSON array)",providerLaunchArgsHint:'Added after the built-in arguments, e.g. ["--foo"]. Saved on Enter or when you leave the field. Applies to new sessions.',providerArgsInvalid:'Needs a JSON array of strings, e.g. ["--foo"]',providerToggleFailed:"Could not switch it; reverted: "},palette:{aria:"Command palette",placeholder:"Search conversations, projects, actions\u2026",noMatch:"No matches",hintAction:"Action",hintThread:"Conversation",hintProject:"Project",actNewThread:"New conversation",actSettings:"Open settings",actTheme:"Toggle theme",actChanges:"Open changes panel",actFiles:"Open files panel",actTerminal:"Open terminal panel",actImport:"Import existing conversations\u2026",failNew:"Could not create: "},panel:{changes:"Changes",files:"Files",terminal:"Terminal",closeTitle:"Close (Ctrl+J)",pickProject:"Select a project first",notGit:"This folder is not a git repository",clean:"Working tree clean",branch:"Current branch",loadingDiff:"Loading diff\u2026",diffTooLarge:"Diff is over 1MB \u2014 not shown",discardTitle:"Discard changes",discardUntracked:`Discard changes to {path}?
|
|
Untracked files move to trash/discarded.`,discardTracked:"Discard changes to {path}? The file reverts to the git version.",discardBtn:"Discard",failDiscard:"Discard failed: ",closePreview:"Close preview",reading:"Reading\u2026",binary:"Binary file \u2014 no preview",tooLarge:"Over 1MB \u2014 no preview",gitKind:{modified:"M",added:"A",deleted:"D",untracked:"?",renamed:"R"}},terminal:{new:"New terminal",noTerm:"No terminals yet",closeTitle:"Close terminal",closeBody:"Close \u201C{title}\u201D? Running processes will be killed.",closeOk:"Close",simpleNote:"Simple terminal (no full TTY programs)",ended:"(Terminal ended)",failNew:"Could not create terminal: ",failKill:"Could not close: "},thread:{new:"New chat",info:"Conversation info",agent:"Agent",model:"Model",mode:"Mode",effort:"Effort",sessionId:"Session ID",tokens:"Total tokens",cost:"Total cost",created:"Created",workdir:"Working directory",importedFrom:"Imported from",sessionNone:"(none)",tokensFmt:"{in} in / {out} out / {cache} cache"},timeline:{thinking:"Thinking {s}s",todo:"Todos {done}/{total}",steer:"Steer",tasks:"tasks",tasksPill:"{done}/{total} tasks",tasksPillTitle:"Show the task list",codeWrap:"Wrap lines",permAllowSession:"Allowed for this chat",permDenied:"Denied",permAllowed:"Allowed",permAutoAllowed:"Auto-approved (Auto-approve all)",permCancelled:"Cancelled",autoUpgrade:{title:"New in 1.3: Auto-approve all",body:`Auto-approve all now really works for Cursor, OpenCode and dsh: the console answers their approval requests "allow once", so commands and edits run without asking. 1.2's bypass mode did nothing for them (they still asked). Your default permission mode was set to it, so to be safe this conversation starts in Always Ask. Pick the default permission mode again in Settings and new conversations follow your choice.`,migrated:"This conversation was set to bypass permissions in 1.2, where this agent still asked anyway. From 1.3 Auto-approve all really auto-approves (commands and edits run without asking), so it was put back to Always Ask.",turnOn:"Turn on Auto-approve all here",settings:"Open Settings"},autoApproved:{count:"Auto-approved {n}",title:"Requests Auto-approve all approved for you (click to see them)",answer:"{opt} \xB7 Auto-approve all",pending:"Auto-approving\u2026"},submitted:"Submitted: {ans}",turnError:"Error: {err}",unknownError:"Unknown error",interrupted:"Interrupted",filesChanged:"{n} file(s) changed \u203A",editMsg:"Edit (puts it back in the input; nothing is sent yet)",sendFailed:"Not sent",sendRetry:"Send again",sendDismiss:"Remove this unsent message",resend:"Send this message again",retryHint:"Retry: send the last message again",msgActions:"Message actions",editBusy:"The input still has unsent text: send or clear it first, then click Edit",tool:{read:"Read",edit:"Edit",write:"Write",bash:"Run",search:"Search",glob:"Search",web:"Web",task:"Subtask",mcp:"Tool",todo:"Todo",other:"Tool",processing:"Working"},cat:{edit:"Edited {n}",run:"Ran {n}",read:"Read {n}",search:"Searched {n}",other:"Other {n}"},failedCount:"{n} failed",noErrorOutput:"No error output",nowThinking:"Thinking\u2026",now:{edit:"Editing: {x}\u2026",run:"Running: {x}\u2026",read:"Reading: {x}\u2026",search:"Searching: {x}\u2026",other:"Working: {x}\u2026"},bashMissing:"Git Bash was not found. Claude Code, Pi and similar agents need it to run commands on Windows. (C:\\Windows\\System32\\bash.exe is the WSL launcher and won't work.) Install Git for Windows and send again; if it is installed elsewhere, set bash.exe under Settings \u2192 Bash path.",bashDownload:"Download Git for Windows",bashSetting:"Open Settings",showAllLines:"Show all {n} lines",diffClip:"(first {n} lines only)"},api:{requestFailed:"Request failed",bad_params:"Invalid parameters",not_found:"Not found",busy:"Busy \u2014 try again later",bad_path:"Invalid path",connClosed:"Connection lost",notConnected:"Not connected",timeout:"Request timed out"},preview:{tab:"Preview",address:"Preview address",placeholder:"localhost:5173",back:"Back",forward:"Forward",reload:"Reload",openExternal:"Open in browser",widen:"Widen panel",onlyLocal:"Preview only supports local addresses (localhost, 127.0.0.1, \u2026)",failed:"Can't open the preview: ",empty:"Nothing to preview yet. Click a localhost link in the chat, or type an address above, e.g. localhost:5173",limits:"The preview runs sandboxed: popups, alert and native form posts don't work; localStorage and login cookies are lost on reload. Open it in your browser when you need them.",noLocalhost:"This system's web view can't open *.localhost addresses (macOS before 26 can't). The preview needs one to keep other web pages out of your dev server, so it can't run here: open it in your browser instead."},links:{openPreviewTitle:"Open in Preview (Ctrl/\u2318+click opens the browser)",externalFailed:"Couldn't open the browser; the link was copied"},quote:{add:"Add to chat",addHint:"Quote the selected text in the input (nothing is sent yet)",chipTitle:"Quoted text (sent in front of your message as a quote)",remove:"Remove quote",full:"{n} quotes at most",lines:"{n} lines"},mention:{drop:"Drop to add to the chat",add:"Add to chat",copyRel:"Copy relative path",remove:"Remove",otherProject:"Only files of this conversation's project can be added"}}}});function Sm(e){let t=String(e??"").trim().toLowerCase();return t?t==="zh"||t.startsWith("zh-")?"zh":"en":oD()}function oD(){let e=typeof navigator<"u"?navigator.language:"";return Sm(e||"zh")}function Yy(e){let t=new URLSearchParams(e).get("lang");Tr=Sm(t);let i=Tr==="zh"?"zh-CN":"en";return typeof document<"u"&&(document.documentElement.lang=i),Tr}function Vy(e){let t=Sm(e);return t===Tr?!1:(Tr=t,typeof document<"u"&&(document.documentElement.lang=Tr==="zh"?"zh-CN":"en"),!0)}function La(){return Tr}function Td(){return Tr==="zh"?"zh-CN":"en-US"}function jy(e,t){let i=t.split("."),n=e;for(let r of i){if(typeof n!="object"||n==null||!(r in n))return;n=n[r]}return typeof n=="string"?n:void 0}function g(e){return jy(ym[Tr],e)??jy(ym.en,e)??e}function pe(e,t){let i=g(e);for(let[n,r]of Object.entries(t))i=i.replaceAll(`{${n}}`,String(r));return i}function Xe(e){let t=e,i=t?.code;if(i){let r=g(`api.${i}`);if(r!==`api.${i}`)return r}let n=String(t?.message??e);return Nr(n)}function Nr(e){if(Tr==="zh")return e;if(e==="\u540E\u53F0\u5DF2\u91CD\u542F\uFF0C\u672C\u8F6E\u5DF2\u4E2D\u65AD")return"Daemon restarted \u2014 this turn was interrupted";if(e.startsWith("\u4F1A\u8BDD\u542F\u52A8\u5931\u8D25\uFF1A"))return"Session start failed: "+e.slice(7);if(e.startsWith("\u53D1\u9001\u5931\u8D25\uFF1A"))return"Send failed: "+e.slice(5);if(e==="Agent \u8FDB\u7A0B\u610F\u5916\u9000\u51FA")return"Agent process exited unexpectedly";let t=e.match(/^附件不存在或已失效((.+)),请重新上传$/);if(t)return`Attachment missing or expired (${t[1]}) \u2014 upload again`;let i=e.match(/^(.+) 不能直接看图片(它的 ACP 初始化未声明支持图片输入),已改为发送图片的文件路径:(.+)$/s);return i?`${i[1]} can't see images directly (its ACP initialize doesn't advertise image input); sent the image file path instead: ${i[2]}`:e.startsWith("\u9644\u4EF6\u95EE\u9898\uFF1A")?"Attachment issue: "+e.slice(5):e}function Nd(e,t){return t&&(e==="\u65B0\u5BF9\u8BDD"||e==="New chat")?g("thread.new"):e}var Tr,kt=se(()=>{Gy();Tr="zh"});function uD(e=typeof navigator<"u"?navigator.userAgent:""){return/AppleWebKit\//i.test(e)&&/Macintosh|iPhone|iPad|iPod/i.test(e)&&!/Chrome\//i.test(e)&&!/Chromium\//i.test(e)&&!/Edg(?:e|A|iOS)?\//i.test(e)&&!/OPR\//i.test(e)&&!/CriOS\//i.test(e)&&!/FxiOS\//i.test(e)}function dD(e,t=typeof navigator<"u"?navigator.userAgent:""){if(!uD(t))return!1;if(!e||typeof e.platform!="string"||!e.platform)return!0;if(e.platform!=="darwin")return!1;let i=e.darwinMajor;return typeof i!="number"||!Number.isInteger(i)?!0:i<cD}async function Zy(e,t,i=5e3){if(!t)return!1;let n=new AbortController,r=setTimeout(()=>n.abort(),i);try{let s=await fetch(e+lD,{cache:"no-store",credentials:"omit",referrerPolicy:"no-referrer",signal:n.signal});return s.ok?await s.text()===t:!1}catch{return!1}finally{clearTimeout(r)}}async function hD(e,t=5e3){return await Zy(e.canaryOrigin,e.canaryNonce,t)?Zy(e.proxyOrigin,e.nonce,t):!1}function Ad(e){let t=ns(e);return t.ok?vm(t.target.origin)+t.target.path:e}var Xy,fc,wm,lD,cD,yi,Md=se(()=>{Da();Cd();kt();Xy=()=>g("preview.noLocalhost"),fc=e=>e??"_",wm=new Map,lD="/__agent_console__/ping",cD=25;yi=Pn((e,t)=>({byThread:{},navigate:async(i,n,r,s,a)=>{let o=ns(s);if(!o.ok)return!1;let l=o.target,c=t().byThread[n],u=c&&c.origin===l.origin&&c.proxyOrigin,d=c?.stack??[],h=c?.idx??-1;if(a?.push!==!1?d[h]!==l.href&&(d=[...d.slice(0,h+1),l.href].slice(-50),h=d.length-1):d.length||(d=[l.href],h=0),u)return e(_=>({byThread:{..._.byThread,[n]:{...c,url:l.href,proxyHref:c.proxyOrigin+l.path,error:null,nonce:c.nonce+1,stack:d,idx:h}}})),r&&i("threads.update",{id:r,previewUrl:l.href}).catch(()=>{}),!0;e(_=>({byThread:{..._.byThread,[n]:{url:l.href,origin:l.origin,proxyOrigin:null,proxyHref:null,title:c?.origin===l.origin?c.title:"",loading:!0,error:null,nonce:(c?.nonce??0)+1,bridged:!1,stack:d,idx:h}}}));let f=`${n}
|
|
${l.href}`,p=wm.get(f);return p||(p=(async()=>{try{let _=await i("preview.open",{url:l.href,...r?{threadId:r}:{}});if(dD(_?.host))throw i("preview.release",{url:l.origin}).catch(()=>{}),new Error(Xy());if(!await hD(_))throw i("preview.release",{url:l.origin}).catch(()=>{}),new Error(Xy());return e(y=>{let m=y.byThread[n];return!m||m.url!==l.href?y:{byThread:{...y.byThread,[n]:{...m,proxyOrigin:_.proxyOrigin,proxyHref:_.proxyHref,loading:!1,error:null}}}}),!0}catch(_){let y=String(_?.message??_);return e(m=>{let v=m.byThread[n];return!v||v.url!==l.href?m:{byThread:{...m.byThread,[n]:{...v,loading:!1,error:y}}}}),!1}finally{wm.delete(f)}})(),wm.set(f,p)),p},reported:(i,n,r)=>{e(s=>{let a=s.byThread[i];if(!a)return s;let{stack:o,idx:l}=a;return o[l]!==n&&(o[l-1]===n?l-=1:o[l+1]===n?l+=1:(o=[...o.slice(0,l+1),n].slice(-50),l=o.length-1)),{byThread:{...s.byThread,[i]:{...a,url:n,title:r,bridged:!0,stack:o,idx:l}}}})},detach:i=>{e(n=>{let r=n.byThread[i];return r?{byThread:{...n.byThread,[i]:{...r,proxyOrigin:null,proxyHref:null,bridged:!1}}}:n})},reload:i=>{e(n=>{let r=n.byThread[i];return r?{byThread:{...n.byThread,[i]:{...r,nonce:r.nonce+1,error:null}}}:n})},step:(i,n)=>{let r=t().byThread[i];if(!r)return null;let s=r.idx+n;return s<0||s>=r.stack.length?null:(e(a=>({byThread:{...a.byThread,[i]:{...r,idx:s}}})),r.stack[s])}}))});var Qy=se(()=>{});var Jy=se(()=>{});var eS=se(()=>{});var tS=se(()=>{});var iS=se(()=>{});var hS=ye(Ct=>{"use strict";function Cm(e,t){var i=e.length;e.push(t);e:for(;0<i;){var n=i-1>>>1,r=e[n];if(0<Od(r,t))e[n]=t,e[i]=r,i=n;else break e}}function Ar(e){return e.length===0?null:e[0]}function Dd(e){if(e.length===0)return null;var t=e[0],i=e.pop();if(i!==t){e[0]=i;e:for(var n=0,r=e.length,s=r>>>1;n<s;){var a=2*(n+1)-1,o=e[a],l=a+1,c=e[l];if(0>Od(o,i))l<r&&0>Od(c,o)?(e[n]=c,e[l]=i,n=l):(e[n]=o,e[a]=i,n=a);else if(l<r&&0>Od(c,i))e[n]=c,e[l]=i,n=l;else break e}}return t}function Od(e,t){var i=e.sortIndex-t.sortIndex;return i!==0?i:e.id-t.id}Ct.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(nS=performance,Ct.unstable_now=function(){return nS.now()}):(xm=Date,rS=xm.now(),Ct.unstable_now=function(){return xm.now()-rS});var nS,xm,rS,rs=[],Hs=[],fD=1,Hn=null,Ii=3,Tm=!1,pc=!1,mc=!1,Nm=!1,oS=typeof setTimeout=="function"?setTimeout:null,lS=typeof clearTimeout=="function"?clearTimeout:null,sS=typeof setImmediate<"u"?setImmediate:null;function Rd(e){for(var t=Ar(Hs);t!==null;){if(t.callback===null)Dd(Hs);else if(t.startTime<=e)Dd(Hs),t.sortIndex=t.expirationTime,Cm(rs,t);else break;t=Ar(Hs)}}function Am(e){if(mc=!1,Rd(e),!pc)if(Ar(rs)!==null)pc=!0,Fo||(Fo=!0,qo());else{var t=Ar(Hs);t!==null&&Mm(Am,t.startTime-e)}}var Fo=!1,gc=-1,cS=5,uS=-1;function dS(){return Nm?!0:!(Ct.unstable_now()-uS<cS)}function Em(){if(Nm=!1,Fo){var e=Ct.unstable_now();uS=e;var t=!0;try{e:{pc=!1,mc&&(mc=!1,lS(gc),gc=-1),Tm=!0;var i=Ii;try{t:{for(Rd(e),Hn=Ar(rs);Hn!==null&&!(Hn.expirationTime>e&&dS());){var n=Hn.callback;if(typeof n=="function"){Hn.callback=null,Ii=Hn.priorityLevel;var r=n(Hn.expirationTime<=e);if(e=Ct.unstable_now(),typeof r=="function"){Hn.callback=r,Rd(e),t=!0;break t}Hn===Ar(rs)&&Dd(rs),Rd(e)}else Dd(rs);Hn=Ar(rs)}if(Hn!==null)t=!0;else{var s=Ar(Hs);s!==null&&Mm(Am,s.startTime-e),t=!1}}break e}finally{Hn=null,Ii=i,Tm=!1}t=void 0}}finally{t?qo():Fo=!1}}}var qo;typeof sS=="function"?qo=function(){sS(Em)}:typeof MessageChannel<"u"?(km=new MessageChannel,aS=km.port2,km.port1.onmessage=Em,qo=function(){aS.postMessage(null)}):qo=function(){oS(Em,0)};var km,aS;function Mm(e,t){gc=oS(function(){e(Ct.unstable_now())},t)}Ct.unstable_IdlePriority=5;Ct.unstable_ImmediatePriority=1;Ct.unstable_LowPriority=4;Ct.unstable_NormalPriority=3;Ct.unstable_Profiling=null;Ct.unstable_UserBlockingPriority=2;Ct.unstable_cancelCallback=function(e){e.callback=null};Ct.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"):cS=0<e?Math.floor(1e3/e):5};Ct.unstable_getCurrentPriorityLevel=function(){return Ii};Ct.unstable_next=function(e){switch(Ii){case 1:case 2:case 3:var t=3;break;default:t=Ii}var i=Ii;Ii=t;try{return e()}finally{Ii=i}};Ct.unstable_requestPaint=function(){Nm=!0};Ct.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var i=Ii;Ii=e;try{return t()}finally{Ii=i}};Ct.unstable_scheduleCallback=function(e,t,i){var n=Ct.unstable_now();switch(typeof i=="object"&&i!==null?(i=i.delay,i=typeof i=="number"&&0<i?n+i:n):i=n,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=i+r,e={id:fD++,callback:t,priorityLevel:e,startTime:i,expirationTime:r,sortIndex:-1},i>n?(e.sortIndex=i,Cm(Hs,e),Ar(rs)===null&&e===Ar(Hs)&&(mc?(lS(gc),gc=-1):mc=!0,Mm(Am,i-n))):(e.sortIndex=r,Cm(rs,e),pc||Tm||(pc=!0,Fo||(Fo=!0,qo()))),e};Ct.unstable_shouldYield=dS;Ct.unstable_wrapCallback=function(e){var t=Ii;return function(){var i=Ii;Ii=t;try{return e.apply(this,arguments)}finally{Ii=i}}}});var pS=ye((d9,fS)=>{"use strict";fS.exports=hS()});var _S=ye(zi=>{"use strict";var pD=mt();function gS(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 Us(){}var ji={d:{f:Us,r:function(){throw Error(gS(522))},D:Us,C:Us,L:Us,m:Us,X:Us,S:Us,M:Us},p:0,findDOMNode:null},mD=Symbol.for("react.portal"),gD=Symbol.for("react.recoverable"),mS=Symbol.for("react.optimistic_key");function _D(e,t,i){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:mD,key:n==null?null:n===mS?mS:""+n,children:e,containerInfo:t,implementation:i}}var _c=pD.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Ld(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}zi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ji;zi.browser=function(e){return{$$typeof:gD,_reason:e}};zi.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(gS(299));return _D(e,t,null,i)};zi.flushSync=function(e){var t=_c.T,i=ji.p;try{if(_c.T=null,ji.p=2,e)return e()}finally{_c.T=t,ji.p=i,ji.d.f()}};zi.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,ji.d.C(e,t))};zi.prefetchDNS=function(e){typeof e=="string"&&ji.d.D(e)};zi.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var i=t.as,n=Ld(i,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,s=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;i==="style"?ji.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:r,fetchPriority:s}):i==="script"&&ji.d.X(e,{crossOrigin:n,integrity:r,fetchPriority:s,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};zi.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var i=Ld(t.as,t.crossOrigin);ji.d.M(e,{crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&ji.d.M(e)};zi.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var i=t.as,n=Ld(i,t.crossOrigin);ji.d.L(e,i,{crossOrigin:n,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})}};zi.preloadModule=function(e,t){if(typeof e=="string")if(t){var i=Ld(t.as,t.crossOrigin);ji.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else ji.d.m(e)};zi.requestFormReset=function(e){ji.d.r(e)};zi.unstable_batchedUpdates=function(e,t){return e(t)};zi.useFormState=function(e,t,i){return _c.H.useFormState(e,t,i)};zi.useFormStatus=function(){return _c.H.useHostTransitionStatus()};zi.version="19.3.1"});var qs=ye((f9,bS)=>{"use strict";function vS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vS)}catch(e){console.error(e)}}vS(),bS.exports=_S()});var sk=ye(gf=>{"use strict";var Jt=pS(),r1=mt(),vD=qs();function F(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 s1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ru(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function a1(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 o1(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 yS(e){if(ru(e)!==e)throw Error(F(188))}function bD(e){var t=e.alternate;if(!t){if(t=ru(e),t===null)throw Error(F(188));return t!==e?null:e}for(var i=e,n=t;;){var r=i.return;if(r===null)break;var s=r.alternate;if(s===null){if(n=r.return,n!==null){i=n;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===i)return yS(r),e;if(s===n)return yS(r),t;s=s.sibling}throw Error(F(188))}if(i.return!==n.return)i=r,n=s;else{for(var a=!1,o=r.child;o;){if(o===i){a=!0,i=r,n=s;break}if(o===n){a=!0,n=r,i=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===i){a=!0,i=s,n=r;break}if(o===n){a=!0,n=s,i=r;break}o=o.sibling}if(!a)throw Error(F(189))}}if(i.alternate!==n)throw Error(F(190))}if(i.tag!==3)throw Error(F(188));return i.stateNode.current===i?e:t}function l1(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=l1(e),t!==null)return t;e=e.sibling}return null}function un(e,t,i,n,r,s){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,n,r,s)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&un(e.child,t,i,n,r,s))return!0;e=e.sibling}return!1}function to(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function SS(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function c1(e){var t=[null,null],i=to(e);return i===null||u1(t,e,i.child,{foundSelf:!1}),t}function u1(e,t,i,n){for(;i!==null;){if(i===t)n.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(n.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&u1(e,t,i.child,n))return!0;i=i.sibling}return!1}function Qt(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(F(559))}}var Vo=null,lg=null;function yD(e,t,i){return e===i?!0:e===t?(Vo=e,!0):!1}function SD(e,t,i){return e===i?(lg=e,!1):e===t?(lg!==null&&(Vo=e),!0):!1}function wS(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function cg(e,t,i){for(var n=0,r=e;r;r=i(r))n++;r=0;for(var s=t;s;s=i(s))r++;for(;0<n-r;)e=i(e),n--;for(;0<r-n;)t=i(t),r--;for(;n--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var ut=Object.assign,wD=Symbol.for("react.element"),Id=Symbol.for("react.transitional.element"),Ec=Symbol.for("react.portal"),Xo=Symbol.for("react.fragment"),d1=Symbol.for("react.strict_mode"),ug=Symbol.for("react.profiler"),h1=Symbol.for("react.consumer"),Ir=Symbol.for("react.context"),b_=Symbol.for("react.forward_ref"),dg=Symbol.for("react.suspense"),hg=Symbol.for("react.suspense_list"),y_=Symbol.for("react.memo"),Ks=Symbol.for("react.lazy"),fg=Symbol.for("react.activity"),xD=Symbol.for("react.legacy_hidden"),ED=Symbol.for("react.memo_cache_sentinel"),pg=Symbol.for("react.view_transition"),kD=Symbol.for("react.recoverable"),xS=Symbol.iterator;function vc(e){return e===null||typeof e!="object"?null:(e=xS&&e[xS]||e["@@iterator"],typeof e=="function"?e:null)}var CD=Symbol.for("react.client.reference");function mg(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===CD?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Xo:return"Fragment";case ug:return"Profiler";case d1:return"StrictMode";case dg:return"Suspense";case hg:return"SuspenseList";case fg:return"Activity";case pg:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Ec:return"Portal";case Ir:return e.displayName||"Context";case h1:return(e._context.displayName||"Context")+".Consumer";case b_:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case y_:return t=e.displayName||null,t!==null?t:mg(e.type)||"Memo";case Ks:t=e._payload,e=e._init;try{return mg(e(t))}catch{}}return null}var kc=Array.isArray,Se=r1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ye=vD.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Fa={pending:!1,data:null,method:null,action:null},gg=[],Zo=-1;function Fr(e){return{current:e}}function Ei(e){0>Zo||(e.current=gg[Zo],gg[Zo]=null,Zo--)}function vt(e,t){Zo++,gg[Zo]=e.current,e.current=t}var Hr=Fr(null),Fc=Fr(null),ea=Fr(null),Sh=Fr(null);function wh(e,t){switch(vt(ea,t),vt(Fc,e),vt(Hr,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bw(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bw(t),e=LE(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ei(Hr),vt(Hr,e)}function _l(){Ei(Hr),Ei(Fc),Ei(ea)}function _g(e){var t=e.memoizedState;t!==null&&(Tl._currentValue=t.memoizedState,vt(Sh,e)),t=Hr.current;var i=LE(t,e.type);t!==i&&(vt(Fc,e),vt(Hr,i))}function xh(e){Fc.current===e&&(Ei(Hr),Ei(Fc)),Sh.current===e&&(Ei(Sh),Tl._currentValue=Fa)}var Om,ES;function $s(e){if(Om===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Om=t&&t[1]||"",ES=-1<i.stack.indexOf(`
|
|
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
`+Om+e+ES}var Rm=!1;function Dm(e,t){if(!e||Rm)return"";Rm=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(p){var h=p}Reflect.construct(e,[],d)}else{try{d.call()}catch(p){h=p}d=!1;try{var f=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),d=!0,new e}finally{d&&(f!==void 0?Object.defineProperty(e.prototype,"props",f):delete e.prototype.props)}}}else{try{throw Error()}catch(p){h=p}(d=e())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(p){if(p&&h&&typeof p.stack=="string")return[p.stack,h.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=n.DetermineComponentFrameRoot(),a=s[0],o=s[1];if(a&&o){var l=a.split(`
|
|
`),c=o.split(`
|
|
`);for(r=n=0;n<l.length&&!l[n].includes("DetermineComponentFrameRoot");)n++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(n===l.length||r===c.length)for(n=l.length-1,r=c.length-1;1<=n&&0<=r&&l[n]!==c[r];)r--;for(;1<=n&&0<=r;n--,r--)if(l[n]!==c[r]){if(n!==1||r!==1)do if(n--,r--,0>r||l[n]!==c[r]){var u=`
|
|
`+l[n].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=n&&0<=r);break}}}finally{Rm=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?$s(i):""}function TD(e,t){switch(e.tag){case 26:case 27:case 5:return $s(e.type);case 16:return $s("Lazy");case 13:return e.child!==t&&t!==null?$s("Suspense Fallback"):$s("Suspense");case 19:return $s("SuspenseList");case 0:case 15:return Dm(e.type,!1);case 11:return Dm(e.type.render,!1);case 1:return Dm(e.type,!0);case 31:return $s("Activity");case 30:return $s("ViewTransition");default:return""}}function kS(e){try{var t="",i=null;do t+=TD(e,i),i=e,e=e.return;while(e);return t}catch(n){return`
|
|
Error generating stack: `+n.message+`
|
|
`+n.stack}}var vg=Object.prototype.hasOwnProperty,S_=Jt.unstable_scheduleCallback,Lm=Jt.unstable_cancelCallback,ND=Jt.unstable_shouldYield,AD=Jt.unstable_requestPaint,wn=Jt.unstable_now,MD=Jt.unstable_getCurrentPriorityLevel,f1=Jt.unstable_ImmediatePriority,p1=Jt.unstable_UserBlockingPriority,Eh=Jt.unstable_NormalPriority,OD=Jt.unstable_LowPriority,m1=Jt.unstable_IdlePriority,RD=Jt.log,DD=Jt.unstable_setDisableYieldValue,su=null,xn=null;function Ys(e){if(typeof RD=="function"&&DD(e),xn&&typeof xn.setStrictMode=="function")try{xn.setStrictMode(su,e)}catch{}}var En=Math.clz32?Math.clz32:zD,LD=Math.log,ID=Math.LN2;function zD(e){return e>>>=0,e===0?32:31-(LD(e)/ID|0)|0}var zd=256,Bd=262144,Pd=4194304;function Ba(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&-e;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 Xh(e,t,i){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var o=n&134217727;return o!==0?(n=o&~s,n!==0?r=Ba(n):(a&=o,a!==0?r=Ba(a):i||(i=o&~e,i!==0&&(r=Ba(i))))):(o=n&~s,o!==0?r=Ba(o):a!==0?r=Ba(a):i||(i=n&~e,i!==0&&(r=Ba(i)))),r===0?0:t!==0&&t!==r&&(t&s)===0&&(s=r&-r,i=t&-t,s>=i||s===32&&(i&4194048)!==0)?t:r}function au(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function g1(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var n=31-En(i),r=1<<n;t|=e[n],i&=~r}return t}function BD(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 _1(){var e=Pd;return Pd<<=1,(Pd&62914560)===0&&(Pd=4194304),e}function Im(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ou(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function PD(e,t,i,n,r,s){var a=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(i=a&~i;0<i;){var u=31-En(i),d=1<<u;o[u]=0,l[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var f=h[u];f!==null&&(f.lane&=-536870913)}i&=~d}n!==0&&v1(e,n,0),s!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=s&~(a&~t))}function v1(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-En(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|i&261930}function b1(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var n=31-En(i),r=1<<n;r&t|e[n]&t&&(e[n]|=t),i&=~r}}function y1(e,t){var i=t&-t;return i=(i&42)!==0?1:w_(i),(i&(e.suspendedLanes|t))!==0?0:i}function w_(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 x_(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function S1(){var e=Ye.p;return e!==0?e:(e=window.event,e===void 0?32:ik(e.type))}function CS(e,t){var i=Ye.p;try{return Ye.p=e,t()}finally{Ye.p=i}}var _s=Math.random().toString(36).slice(2),wi="__reactFiber$"+_s,dn="__reactProps$"+_s,Ml="__reactContainer$"+_s,TS="__reactEvents$"+_s,HD="__reactListeners$"+_s,UD="__reactHandles$"+_s,NS="__reactResources$"+_s,lu="__reactMarker$"+_s,kh="__reactLoad$"+_s;function Zh(e){delete e[wi],delete e[dn],delete e[HD],delete e[UD]}function Ua(e){var t;if(t=e[wi])return t;for(var i=e.parentNode;i;){if(t=i[Ml]||i[wi]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Kw(e);e!==null;){if(i=e[wi])return i;e=Kw(e)}return t}e=i,i=e.parentNode}return null}function Ol(e){if(e=e[wi]||e[Ml]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Cc(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(F(33))}function ol(e){var t=e[NS];return t||(t=e[NS]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function oi(e){e[lu]=!0}function w1(e){e[kh]=void 0}var x1=new Set,E1={};function io(e,t){vl(e,t),vl(e+"Capture",t)}function vl(e,t){for(E1[e]=t,e=0;e<t.length;e++)x1.add(t[e])}var qD=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]*$"),AS={},MS={};function FD(e){return vg.call(MS,e)?!0:vg.call(AS,e)?!1:qD.test(e)?MS[e]=!0:(AS[e]=!0,!1)}var Ke=!1;function OS(){var e=Ke;return Ke=!1,e}function ih(e,t,i){if(FD(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function Hd(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function ss(e,t,i,n){if(n===null)e.removeAttribute(i);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,n)}}function vn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function k1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $D(e,t,i){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(a){i=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(a){i=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bg(e){if(!e._valueTracker){var t=k1(e)?"checked":"value";e._valueTracker=$D(e,t,""+e[t])}}function C1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),n="";return e&&(n=k1(e)?e.checked?"true":"false":e.value),e=n,e!==i?(t.setValue(e),!0):!1}var WD=/[\n"\\]/g;function Wn(e){return e.replace(WD,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function yg(e,t,i,n,r,s,a,o){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+vn(t)):e.value!==""+vn(t)&&(e.value=""+vn(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?a==="number"&&e.value==t?zm(e,vn(e.value)):zm(e,vn(t)):i!=null?zm(e,vn(i)):n!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+vn(o):e.removeAttribute("name")}function T1(e,t,i,n,r,s,a,o){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||i!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){bg(e);return}i=i!=null?""+vn(i):"",t=t!=null?""+vn(t):i,o||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=o?e.checked:!!n,e.defaultChecked=!!n,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),bg(e)}function zm(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function ll(e,t,i,n){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&n&&(e[i].defaultSelected=!0)}else{for(i=""+vn(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function N1(e,t,i){if(t!=null&&(t=""+vn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+vn(i):""}function A1(e,t,i,n){if(t==null){if(n!=null){if(i!=null)throw Error(F(92));if(kc(n)){if(1<n.length)throw Error(F(93));n=n[0]}i=n}i==null&&(i=""),t=i}i=vn(t),e.defaultValue=i,n=e.textContent,n===i&&n!==""&&n!==null&&(e.value=n),bg(e)}function bl(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var KD=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 RS(e,t,i){var n=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,i):typeof i!="number"||i===0||KD.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function M1(e,t,i){if(t!=null&&typeof t!="object")throw Error(F(62));if(e=e.style,i!=null){for(var n in i)!i.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="",Ke=!0);for(var r in t)n=t[r],t.hasOwnProperty(r)&&i[r]!==n&&(RS(e,r,n),Ke=!0)}else for(var s in t)t.hasOwnProperty(s)&&RS(e,s,t[s])}function E_(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 GD=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),jD=/^[\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 nh(e){return jD.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function zr(){}var Sg=null;function k_(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qo=null,cl=null;function DS(e){var t=Ol(e);if(t&&(e=t.stateNode)){var i=e[dn]||null;e:switch(e=t.stateNode,t.type){case"input":if(yg(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Wn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var n=i[t];if(n!==e&&n.form===e.form){var r=n[dn]||null;if(!r)throw Error(F(90));yg(n,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)n=i[t],n.form===e.form&&C1(n)}break e;case"textarea":N1(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&ll(e,!!i.multiple,t,!1)}}}var Bm=!1;function O1(e,t,i){if(Bm)return e(t,i);Bm=!0;try{var n=e(t);return n}finally{if(Bm=!1,(Qo!==null||cl!==null)&&(hf(),Qo&&(t=Qo,e=cl,cl=Qo=null,DS(t),e)))for(t=0;t<e.length;t++)DS(e[t])}}function $c(e,t){var i=e.stateNode;if(i===null)return null;var n=i[dn]||null;if(n===null)return null;i=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(F(231,t,typeof i));return i}var ds=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wg=!1;if(ds)try{$o={},Object.defineProperty($o,"passive",{get:function(){wg=!0}}),window.addEventListener("test",$o,$o),window.removeEventListener("test",$o,$o)}catch{wg=!1}var $o,Vs=null,C_=null,rh=null;function R1(){if(rh)return rh;var e,t=C_,i=t.length,n,r="value"in Vs?Vs.value:Vs.textContent,s=r.length;for(e=0;e<i&&t[e]===r[e];e++);var a=i-e;for(n=1;n<=a&&t[i-n]===r[s-n];n++);return rh=r.slice(e,1<n?1-n:void 0)}function sh(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 Ud(){return!0}function LS(){return!1}function Zi(e){function t(i,n,r,s,a){this._reactName=i,this._targetInst=r,this.type=n,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(i=e[o],this[o]=i?i(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Ud:LS,this.isPropagationStopped=LS,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ud)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ud)},persist:function(){},isPersistent:Ud}),t}var ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qh=Zi(ma),cu=ut({},ma,{view:0,detail:0}),YD=Zi(cu),Pm,Hm,bc,Jh=ut({},cu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:T_,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!==bc&&(bc&&e.type==="mousemove"?(Pm=e.screenX-bc.screenX,Hm=e.screenY-bc.screenY):Hm=Pm=0,bc=e),Pm)},movementY:function(e){return"movementY"in e?e.movementY:Hm}}),IS=Zi(Jh),VD=ut({},Jh,{dataTransfer:0}),XD=Zi(VD),ZD=ut({},cu,{relatedTarget:0}),Um=Zi(ZD),QD=ut({},ma,{animationName:0,elapsedTime:0,pseudoElement:0}),JD=Zi(QD),eL=ut({},ma,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tL=Zi(eL),iL=ut({},ma,{data:0}),zS=Zi(iL),nL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rL={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"},sL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function aL(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sL[e])?!!t[e]:!1}function T_(){return aL}var oL=ut({},cu,{key:function(e){if(e.key){var t=nL[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rL[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:T_,charCode:function(e){return e.type==="keypress"?sh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lL=Zi(oL),cL=ut({},Jh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),BS=Zi(cL),uL=ut({},ma,{submitter:0}),dL=Zi(uL),hL=ut({},cu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:T_}),fL=Zi(hL),pL=ut({},ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),mL=Zi(pL),gL=ut({},Jh,{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}),_L=Zi(gL),vL=ut({},ma,{newState:0,oldState:0,source:0}),bL=Zi(vL),yL=[9,13,27,32],N_=ds&&"CompositionEvent"in window,Ac=null;ds&&"documentMode"in document&&(Ac=document.documentMode);var SL=ds&&"TextEvent"in window&&!Ac,D1=ds&&(!N_||Ac&&8<Ac&&11>=Ac),PS=" ",HS=!1;function L1(e,t){switch(e){case"keyup":return yL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function I1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jo=!1;function wL(e,t){switch(e){case"compositionend":return I1(t);case"keypress":return t.which!==32?null:(HS=!0,PS);case"textInput":return e=t.data,e===PS&&HS?null:e;default:return null}}function xL(e,t){if(Jo)return e==="compositionend"||!N_&&L1(e,t)?(e=R1(),rh=C_=Vs=null,Jo=!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 D1&&t.locale!=="ko"?null:t.data;default:return null}}var EL={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 US(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!EL[e.type]:t==="textarea"}function z1(e,t,i,n){Qo?cl?cl.push(n):cl=[n]:Qo=n,t=jh(t,"onChange"),0<t.length&&(i=new Qh("onChange","change",null,i,n),e.push({event:i,listeners:t}))}var Mc=null,Wc=null;function kL(e){OE(e,0)}function ef(e){var t=Cc(e);if(C1(t))return e}function qS(e,t){if(e==="change")return t}var B1=!1;ds&&(ds?(Fd="oninput"in document,Fd||(qm=document.createElement("div"),qm.setAttribute("oninput","return;"),Fd=typeof qm.oninput=="function"),qd=Fd):qd=!1,B1=qd&&(!document.documentMode||9<document.documentMode));var qd,Fd,qm;function FS(){Mc&&(Mc.detachEvent("onpropertychange",P1),Wc=Mc=null)}function P1(e){if(e.propertyName==="value"&&ef(Wc)){var t=[];z1(t,Wc,e,k_(e)),O1(kL,t)}}function CL(e,t,i){e==="focusin"?(FS(),Mc=t,Wc=i,Mc.attachEvent("onpropertychange",P1)):e==="focusout"&&FS()}function TL(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ef(Wc)}function NL(e,t){if(e==="click")return ef(t)}function AL(e,t){if(e==="input"||e==="change")return ef(t)}function ML(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Cn=typeof Object.is=="function"?Object.is:ML;function Kc(e,t){if(Cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(n=0;n<i.length;n++){var r=i[n];if(!vg.call(t,r)||!Cn(e[r],t[r]))return!1}return!0}function xg(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $S(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function WS(e,t){var i=$S(e);e=0;for(var n;i;){if(i.nodeType===3){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=$S(i)}}function H1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?H1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function U1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xg(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=xg(e.document)}return t}function A_(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 OL=ds&&"documentMode"in document&&11>=document.documentMode,el=null,Eg=null,Oc=null,kg=!1;function KS(e,t,i){var n=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;kg||el==null||el!==xg(n)||(n=el,"selectionStart"in n&&A_(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Oc&&Kc(Oc,n)||(Oc=n,n=jh(Eg,"onSelect"),0<n.length&&(t=new Qh("onSelect","select",null,t,i),e.push({event:t,listeners:n}),t.target=el)))}function Ia(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var tl={animationend:Ia("Animation","AnimationEnd"),animationiteration:Ia("Animation","AnimationIteration"),animationstart:Ia("Animation","AnimationStart"),transitionrun:Ia("Transition","TransitionRun"),transitionstart:Ia("Transition","TransitionStart"),transitioncancel:Ia("Transition","TransitionCancel"),transitionend:Ia("Transition","TransitionEnd")},Fm={},q1={};ds&&(q1=document.createElement("div").style,"AnimationEvent"in window||(delete tl.animationend.animation,delete tl.animationiteration.animation,delete tl.animationstart.animation),"TransitionEvent"in window||delete tl.transitionend.transition);function no(e){if(Fm[e])return Fm[e];if(!tl[e])return e;var t=tl[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in q1)return Fm[e]=t[i];return e}var F1=no("animationend"),$1=no("animationiteration"),W1=no("animationstart"),RL=no("transitionrun"),DL=no("transitionstart"),LL=no("transitioncancel"),K1=no("transitionend"),G1=new Map,Cg="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Cg.push("scrollEnd");function hr(e,t){G1.set(e,t),io(t,[e])}var IL=0;function hs(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=dr.identifierPrefix;var i=IL++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function GS(e){if(e==null||typeof e=="string")return e;var t=null,i=gl;if(i!==null)for(var n=0;n<i.length;n++){var r=e[i[n]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function vs(e,t){return e=GS(e),t=GS(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Ch=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qn=[],il=0,M_=0;function tf(){for(var e=il,t=M_=il=0;t<e;){var i=qn[t];qn[t++]=null;var n=qn[t];qn[t++]=null;var r=qn[t];qn[t++]=null;var s=qn[t];if(qn[t++]=null,n!==null&&r!==null){var a=n.pending;a===null?r.next=r:(r.next=a.next,a.next=r),n.pending=r}s!==0&&j1(i,r,s)}}function nf(e,t,i,n){qn[il++]=e,qn[il++]=t,qn[il++]=i,qn[il++]=n,M_|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function O_(e,t,i,n){return nf(e,t,i,n),Th(e)}function ro(e,t){return nf(e,null,null,t),Th(e)}function j1(e,t,i){e.lanes|=i;var n=e.alternate;n!==null&&(n.lanes|=i);for(var r=!1,s=e.return;s!==null;)s.childLanes|=i,n=s.alternate,n!==null&&(n.childLanes|=i),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(r=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,r&&t!==null&&(r=31-En(i),e=s.hiddenUpdates,n=e[r],n===null?e[r]=[t]:n.push(t),t.lane=i|536870912),s):null}function Th(e){if(50<qc)throw qc=0,mh=null,Error(F(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var nl={};function zL(e,t,i,n){this.tag=e,this.key=i,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ln(e,t,i,n){return new zL(e,t,i,n)}function R_(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cs(e,t){var i=e.alternate;return i===null?(i=ln(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Y1(e,t){e.flags&=1206910978;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ah(e,t,i,n,r,s){var a=0;if(n=e,typeof n=="function")R_(n)&&(a=1);else if(typeof n=="string")a=lI(e,i,Hr.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(n){case fg:return e=ln(31,i,t,r),e.elementType=fg,e.lanes=s,e;case Xo:return $a(i.children,r,s,t);case d1:a=8,r|=24;break;case ug:return e=ln(12,i,t,r|2),e.elementType=ug,e.lanes=s,e;case dg:return e=ln(13,i,t,r),e.elementType=dg,e.lanes=s,e;case hg:return e=ln(19,i,t,r),e.elementType=hg,e.lanes=s,e;case xD:case pg:return e=r|32,e=ln(30,i,t,e),e.elementType=pg,e.lanes=s,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Ir:a=10;break e;case h1:a=9;break e;case b_:a=11;break e;case y_:a=14;break e;case Ks:a=16,n=null;break e}a=29,i=Error(F(130,e===null?"null":typeof e,"")),n=null}return t=ln(a,i,t,r),t.elementType=e,t.type=n,t.lanes=s,t}function $a(e,t,i,n){return e=ln(7,e,n,t),e.lanes=i,e}function $m(e,t,i){return e=ln(6,e,null,t),e.lanes=i,e}function V1(e){var t=ln(18,null,null,0);return t.stateNode=e,t}function Wm(e,t,i){return t=ln(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var jS=new WeakMap;function Kn(e,t){if(typeof e=="object"&&e!==null){var i=jS.get(e);return i!==void 0?i:(t={value:e,source:t,stack:kS(t)},jS.set(e,t),t)}return{value:e,source:t,stack:kS(t)}}var rl=[],sl=0,Nh=null,Gc=0,Fn=[],$n=0,ua=null,Br=1,Pr="";function os(e,t){rl[sl++]=Gc,rl[sl++]=Nh,Nh=e,Gc=t}function X1(e,t,i){Fn[$n++]=Br,Fn[$n++]=Pr,Fn[$n++]=ua,ua=e;var n=Br;e=Pr;var r=32-En(n)-1;n&=~(1<<r),i+=1;var s=32-En(t)+r;if(30<s){var a=r-r%5;s=(n&(1<<a)-1).toString(32),n>>=a,r-=a,Br=1<<32-En(t)+r|i<<r|n,Pr=s+e}else Br=1<<s|i<<r|n,Pr=e}function rf(e){e.return!==null&&(os(e,1),X1(e,1,0))}function D_(e){for(;e===Nh;)Nh=rl[--sl],rl[sl]=null,Gc=rl[--sl],rl[sl]=null;for(;e===ua;)ua=Fn[--$n],Fn[$n]=null,Pr=Fn[--$n],Fn[$n]=null,Br=Fn[--$n],Fn[$n]=null}function Z1(e,t){Fn[$n++]=Br,Fn[$n++]=Pr,Fn[$n++]=ua,Br=t.id,Pr=t.overflow,ua=e}var li=null,_t=null,Le=!1,ta=null,Gn=!1,Tg=Error(F(519));function da(e){var t=Error(F(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jc(Kn(t,e)),Tg}function YS(e){var t=e.stateNode,i=e.type,n=e.memoizedProps;switch(t[wi]=e,t[dn]=n,i){case"dialog":Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":case"embed":Pe("load",t);break;case"video":case"audio":for(i=0;i<Zc.length;i++)Pe(Zc[i],t);break;case"source":Pe("error",t);break;case"img":case"image":case"link":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"input":Pe("invalid",t),T1(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Pe("invalid",t);break;case"textarea":Pe("invalid",t),A1(t,n.value,n.defaultValue,n.children)}i=n.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||n.suppressHydrationWarning===!0||DE(t.textContent,i)?(n.popover!=null&&(Pe("beforetoggle",t),Pe("toggle",t)),n.onScroll!=null&&Pe("scroll",t),n.onScrollEnd!=null&&Pe("scrollend",t),n.onClick!=null&&(t.onclick=zr),t=!0):t=!1,t||da(e,!0)}function Ah(e){for(li=e.return;li;)switch(li.tag){case 5:case 31:case 13:Gn=!1;return;case 27:case 3:Gn=!0;return;default:li=li.return}}function Wo(e){if(e!==li)return!1;if(!Le)return Ah(e),Le=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||d_(e.type,e.memoizedProps)),i=!i),i&&_t&&da(e),Ah(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));_t=Ww(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));_t=Ww(e)}else t===27?(t=_t,ga(e.type)?(e=m_,m_=null,_t=e):_t=t):_t=li?jn(e.stateNode.nextSibling):null;return!0}function ja(){_t=li=null,Le=!1}function Km(){var e=ta;return e!==null&&(an===null?an=e:an.push.apply(an,e),ta=null),e}function jc(e){ta===null?ta=[e]:ta.push(e)}var Ng=Fr(null),so=null,ls=null;function Xs(e,t,i){vt(Ng,t._currentValue),t._currentValue=i}function us(e){e._currentValue=Ng.current,Ei(Ng)}function oh(e,t,i){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===i)break;e=e.return}}function Ag(e,t,i,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var s=r.dependencies;if(s!==null){var a=r.child;s=s.firstContext;e:for(;s!==null;){var o=s;s=r;for(var l=0;l<t.length;l++)if(o.context===t[l]){s.lanes|=i,o=s.alternate,o!==null&&(o.lanes|=i),oh(s.return,i,e),n||(a=null);break e}s=o.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(F(341));a.lanes|=i,s=a.alternate,s!==null&&(s.lanes|=i),oh(a,i,e),a=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=i,a=r.alternate,a!==null&&(a.lanes|=i),oh(r.return,i,e),a=r.child,a=a!==null?a.sibling:null):a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===e){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function Ya(e,t,i,n){e=null;for(var r=t,s=!1;r!==null;){if(!s){if((r.flags&524288)!==0)s=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(F(387));if(a=a.memoizedProps,a!==null){var o=r.type;Cn(r.pendingProps.value,a.value)||(e!==null?e.push(o):e=[o])}}else if(r===Sh.current){if(a=r.alternate,a===null)throw Error(F(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Tl):e=[Tl])}r=r.return}return e!==null&&Ag(t,e,i,n),t.flags|=262144,e!==null}function Mh(e){for(e=e.firstContext;e!==null;){if(!Cn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Va(e){so=e,ls=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xi(e){return Q1(so,e)}function $d(e,t){return so===null&&Va(e),Q1(e,t)}function Q1(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ls===null){if(e===null)throw Error(F(308));ls=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ls=ls.next=t;return i}var BL=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},PL=Jt.unstable_scheduleCallback,HL=Jt.unstable_NormalPriority,Wt={$$typeof:Ir,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function L_(){return{controller:new BL,data:new Map,refCount:0}}function uu(e){e.refCount--,e.refCount===0&&PL(HL,function(){e.controller.abort()})}function VS(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var n=t[e];i.indexOf(n)===-1&&i.push(n)}}}var Tc=null;function UL(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Rc=null,Mg=0,Xa=0,ul=null;function qL(e,t){if(Rc===null){var i=Rc=[];Mg=0,Xa=lv(),ul={status:"pending",value:void 0,then:function(n){i.push(n)}}}return Mg++,t.then(XS,XS),t}function XS(){if(--Mg===0&&(Tc=null,Rc!==null)){ul!==null&&(ul.status="fulfilled");var e=Rc;Rc=null,Xa=0,ul=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function FL(e,t){var i=[],n={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(n.status="rejected",n.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),n}var ZS=Se.S;Se.S=function(e,t){if(gE=wn(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&qL(e,t),Tc!==null)for(var i=El;i!==null;)VS(i,Tc),i=i.next;if(i=e.types,i!==null){for(var n=El;n!==null;)VS(n,i),n=n.next;if(Xa!==0){n=Tc,n===null&&(n=Tc=[]);for(var r=0;r<i.length;r++){var s=i[r];n.indexOf(s)===-1&&n.push(s)}}}ZS!==null&&ZS(e,t)};var Wa=Fr(null);function I_(){var e=Wa.current;return e!==null?e:ct.pooledCache}function lh(e,t){t===null?vt(Wa,Wa.current):vt(Wa,t.pool)}function J1(){var e=I_();return e===null?null:{parent:Wt._currentValue,pool:e}}var Rl=Error(F(460)),z_=Error(F(474)),sf=Error(F(542)),Oh={then:function(){}};function QS(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ex(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(zr,zr),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ew(e),e===void 0&&!("reason"in t)?Error(F(600)):e;default:if(typeof t.status=="string")t.then(zr,zr);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(F(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=n}},function(n){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ew(e),e}throw Ka=t,Rl}}function Pa(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ka=i,Rl):i}}var Ka=null;function JS(){if(Ka===null)throw Error(F(459));var e=Ka;return Ka=null,e}function ew(e){if(e===Rl||e===sf)throw Error(F(483))}var dl=null,Yc=0;function Wd(e){var t=Yc;return Yc+=1,dl===null&&(dl=[]),ex(dl,e,t)}function Fs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Kd(e,t){throw t.$$typeof===wD?Error(F(525)):(e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function tx(e){function t(m,v){if(e){var b=m.deletions;b===null?(m.deletions=[v],m.flags|=16):b.push(v)}}function i(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function n(m){for(var v=new Map;m!==null;)m.key===null?v.set(m.index,m):v.set(m.key,m),m=m.sibling;return v}function r(m,v){return m=cs(m,v),m.index=0,m.sibling=null,m}function s(m,v,b){return m.index=b,e?(b=m.alternate,b!==null?(b=b.index,b<v?(m.flags|=2,v):b):(m.flags|=134217730,v)):(m.flags|=1048576,v)}function a(m){return e&&m.alternate===null&&(m.flags|=134217730),m}function o(m,v,b,w){return v===null||v.tag!==6?(v=$m(b,m.mode,w),v.return=m,v):(v=r(v,b),v.return=m,v)}function l(m,v,b,w){var k=b.type;return k===Xo?(m=u(m,v,b.props.children,w,b.key),Fs(m,b),m):v!==null&&(v.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ks&&Pa(k)===v.type)?(v=r(v,b.props),Fs(v,b),v.return=m,v):(v=ah(b.type,b.key,b.props,null,m.mode,w),Fs(v,b),v.return=m,v)}function c(m,v,b,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=Wm(b,m.mode,w),v.return=m,v):(v=r(v,b.children||[]),v.return=m,v)}function u(m,v,b,w,k){return v===null||v.tag!==7?(v=$a(b,m.mode,w,k),v.return=m,v):(v=r(v,b),v.return=m,v)}function d(m,v,b){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=$m(""+v,m.mode,b),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Id:return b=ah(v.type,v.key,v.props,null,m.mode,b),Fs(b,v),b.return=m,b;case Ec:return v=Wm(v,m.mode,b),v.return=m,v;case Ks:return v=Pa(v),d(m,v,b)}if(kc(v)||vc(v))return v=$a(v,m.mode,b,null),v.return=m,v;if(typeof v.then=="function")return d(m,Wd(v),b);if(v.$$typeof===Ir)return d(m,$d(m,v),b);Kd(m,v)}return null}function h(m,v,b,w){var k=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return k!==null?null:o(m,v,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Id:return b.key===k?l(m,v,b,w):null;case Ec:return b.key===k?c(m,v,b,w):null;case Ks:return b=Pa(b),h(m,v,b,w)}if(kc(b)||vc(b))return k!==null?null:u(m,v,b,w,null);if(typeof b.then=="function")return h(m,v,Wd(b),w);if(b.$$typeof===Ir)return h(m,v,$d(m,b),w);Kd(m,b)}return null}function f(m,v,b,w,k){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return m=m.get(b)||null,o(v,m,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Id:return m=m.get(w.key===null?b:w.key)||null,l(v,m,w,k);case Ec:return m=m.get(w.key===null?b:w.key)||null,c(v,m,w,k);case Ks:return w=Pa(w),f(m,v,b,w,k)}if(kc(w)||vc(w))return m=m.get(b)||null,u(v,m,w,k,null);if(typeof w.then=="function")return f(m,v,b,Wd(w),k);if(w.$$typeof===Ir)return f(m,v,b,$d(v,w),k);Kd(v,w)}return null}function p(m,v,b,w){for(var k=null,O=null,N=v,C=v=0,M=null;N!==null&&C<b.length;C++){N.index>C?(M=N,N=null):M=N.sibling;var z=h(m,N,b[C],w);if(z===null){N===null&&(N=M);break}e&&N&&z.alternate===null&&t(m,N),v=s(z,v,C),O===null?k=z:O.sibling=z,O=z,N=M}if(C===b.length)return i(m,N),Le&&os(m,C),k;if(N===null){for(;C<b.length;C++)N=d(m,b[C],w),N!==null&&(v=s(N,v,C),O===null?k=N:O.sibling=N,O=N);return Le&&os(m,C),k}for(N=n(N);C<b.length;C++)M=f(N,m,C,b[C],w),M!==null&&(e&&(z=M.alternate,z!==null&&N.delete(z.key===null?C:z.key)),v=s(M,v,C),O===null?k=M:O.sibling=M,O=M);return e&&N.forEach(function(q){return t(m,q)}),Le&&os(m,C),k}function _(m,v,b,w){if(b==null)throw Error(F(151));for(var k=null,O=null,N=v,C=v=0,M=null,z=b.next();N!==null&&!z.done;C++,z=b.next()){N.index>C?(M=N,N=null):M=N.sibling;var q=h(m,N,z.value,w);if(q===null){N===null&&(N=M);break}e&&N&&q.alternate===null&&t(m,N),v=s(q,v,C),O===null?k=q:O.sibling=q,O=q,N=M}if(z.done)return i(m,N),Le&&os(m,C),k;if(N===null){for(;!z.done;C++,z=b.next())z=d(m,z.value,w),z!==null&&(v=s(z,v,C),O===null?k=z:O.sibling=z,O=z);return Le&&os(m,C),k}for(N=n(N);!z.done;C++,z=b.next())z=f(N,m,C,z.value,w),z!==null&&(e&&(M=z.alternate,M!==null&&N.delete(M.key===null?C:M.key)),v=s(z,v,C),O===null?k=z:O.sibling=z,O=z);return e&&N.forEach(function(B){return t(m,B)}),Le&&os(m,C),k}function y(m,v,b,w){if(typeof b=="object"&&b!==null&&b.type===Xo&&b.key===null&&b.props.ref===void 0&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Id:e:{for(var k=b.key;v!==null;){if(v.key===k){if(k=b.type,k===Xo){if(v.tag===7){i(m,v.sibling),w=r(v,b.props.children),Fs(w,b),w.return=m,m=w;break e}}else if(v.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ks&&Pa(k)===v.type){i(m,v.sibling),w=r(v,b.props),Fs(w,b),w.return=m,m=w;break e}i(m,v);break}else t(m,v);v=v.sibling}b.type===Xo?(w=$a(b.props.children,m.mode,w,b.key),Fs(w,b),w.return=m,m=w):(w=ah(b.type,b.key,b.props,null,m.mode,w),Fs(w,b),w.return=m,m=w)}return a(m);case Ec:e:{for(k=b.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){i(m,v.sibling),w=r(v,b.children||[]),w.return=m,m=w;break e}else{i(m,v);break}else t(m,v);v=v.sibling}w=Wm(b,m.mode,w),w.return=m,m=w}return a(m);case Ks:return b=Pa(b),y(m,v,b,w)}if(kc(b))return p(m,v,b,w);if(vc(b)){if(k=vc(b),typeof k!="function")throw Error(F(150));return b=k.call(b),_(m,v,b,w)}if(typeof b.then=="function")return y(m,v,Wd(b),w);if(b.$$typeof===Ir)return y(m,v,$d(m,b),w);Kd(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,v!==null&&v.tag===6?(i(m,v.sibling),w=r(v,b),w.return=m,m=w):(i(m,v),w=$m(b,m.mode,w),w.return=m,m=w),a(m)):i(m,v)}return function(m,v,b,w){try{Yc=0;var k=y(m,v,b,w);return dl=null,k}catch(N){if(N===Rl||N===sf)throw N;var O=ln(29,N,null,m.mode);return O.lanes=w,O.return=m,O}}}var Za=tx(!0),ix=tx(!1),Gs=!1;function B_(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Og(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 ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function na(e,t,i){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(je&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=Th(e),j1(e,null,i),t}return nf(e,n,t,i),Th(e)}function Dc(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,i|=n,t.lanes=i,b1(e,i)}}function Gm(e,t){var i=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,i===n)){var r=null,s=null;if(i=i.firstBaseUpdate,i!==null){do{var a={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};s===null?r=s=a:s=s.next=a,i=i.next}while(i!==null);s===null?r=s=t:s=s.next=t}else r=s=t;i={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:n.shared,callbacks:n.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Rg=!1;function Lc(){if(Rg){var e=ul;if(e!==null)throw e}}function Ic(e,t,i,n){Rg=!1;var r=e.updateQueue;Gs=!1;var s=r.firstBaseUpdate,a=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var u=e.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==a&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(s!==null){var d=r.baseState;a=0,u=c=l=null,o=s;do{var h=o.lane&-536870913,f=h!==o.lane;if(f?(Ue&h)===h:(n&h)===h){h!==0&&h===Xa&&(Rg=!0),u!==null&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var p=e,_=o;h=t;var y=i;switch(_.tag){case 1:if(p=_.payload,typeof p=="function"){d=p.call(y,d,h);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=_.payload,h=typeof p=="function"?p.call(y,d,h):p,h==null)break e;d=ut({},d,h);break e;case 2:Gs=!0}}h=o.callback,h!==null&&(e.flags|=64,f&&(e.flags|=8192),f=r.callbacks,f===null?r.callbacks=[h]:f.push(h))}else f={lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=f,l=d):u=u.next=f,a|=h;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;f=o,o=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);u===null&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,s===null&&(r.shared.lanes=0),pa|=a,e.lanes=a,e.memoizedState=d}}function nx(e,t){if(typeof e!="function")throw Error(F(191,e));e.call(t)}function rx(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)nx(i[e],t)}var ha=Fr(null),Rh=Fr(0);function tw(e,t){e=gs,vt(Rh,e),vt(ha,t),gs=e|t.baseLanes}function Dg(){vt(Rh,gs),vt(ha,ha.current)}function P_(){gs=Rh.current,Ei(ha),Ei(Rh)}var Ti=Fr(null),Bi=null;function ra(e){var t=e.alternate;vt(ki,ki.current&1),vt(Ti,e),Bi===null&&(t===null||ha.current!==null||t.memoizedState!==null)&&(Bi=e)}function Lg(e){vt(ki,ki.current),vt(Ti,e),Bi===null&&(Bi=e)}function sx(e){e.tag===22?(vt(ki,ki.current),vt(Ti,e),Bi===null&&(Bi=e)):sa()}function sa(){vt(ki,ki.current),vt(Ti,Ti.current)}function bn(e){Ei(Ti),Bi===e&&(Bi=null),Ei(ki)}var ki=Fr(0);function Vc(e,t){vt(Ti,Ti.current),vt(ki,t)}function H_(e){Ei(ki),Ei(Ti),Bi===e&&(Bi=null)}function Dh(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||p_(i)||hv(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fs=0,Ae=null,nt=null,$t=null,Lh=!1,hl=!1,Qa=!1,Ih=0,Xc=0,fl=null,$L=0;function Dt(){throw Error(F(321))}function U_(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Cn(e[i],t[i]))return!1;return!0}function q_(e,t,i,n,r,s){return fs=s,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Se.H=e===null||e.memoizedState===null?zx:Bx,Qa=!1,s=i(n,r),Qa=!1,hl&&(s=ox(t,i,n,r)),ax(e),s}function ax(e){Se.H=zh;var t=nt!==null&&nt.next!==null;if(fs=0,$t=nt=Ae=null,Lh=!1,Xc=0,fl=null,t)throw Error(F(300));e===null||Kt||(e=e.dependencies,e!==null&&Mh(e)&&(Kt=!0))}function ox(e,t,i,n){Ae=e;var r=0;do{if(hl&&(fl=null),Xc=0,hl=!1,25<=r)throw Error(F(301));if(r+=1,$t=nt=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}Se.H=ZL,s=t(i,n)}while(hl);return s}function WL(){var e=Se.H,t=e.useState()[0];return t=typeof t.then=="function"?du(t):t,e=e.useState()[0],(nt!==null?nt.memoizedState:null)!==e&&(Ae.flags|=1024),t}function F_(){var e=Ih!==0;return Ih=0,e}function $_(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function W_(e){if(Lh){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lh=!1}fs=0,$t=nt=Ae=null,hl=!1,Xc=Ih=0,fl=null}function Xi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Ae.memoizedState=$t=e:$t=$t.next=e,$t}function Ut(){if(nt===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=nt.next;var t=$t===null?Ae.memoizedState:$t.next;if(t!==null)$t=t,nt=e;else{if(e===null)throw Ae.alternate===null?Error(F(467)):Error(F(310));nt=e,e={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},$t===null?Ae.memoizedState=$t=e:$t=$t.next=e}return $t}function af(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function du(e){var t=Xc;return Xc+=1,fl===null&&(fl=[]),e=ex(fl,e,t),t=Ae,($t===null?t.memoizedState:$t.next)===null&&(t=t.alternate,Se.H=t===null||t.memoizedState===null?zx:Bx),e}function of(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return du(e);if(e.$$typeof===kD)return;if(e.$$typeof===Ir)return xi(e)}throw Error(F(438,String(e)))}function K_(e){var t=null,i=Ae.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var n=Ae.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=af(),Ae.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),n=0;n<e;n++)i[n]=ED;return t.index++,i}function ps(e,t){return typeof t=="function"?t(e):t}function ch(e){var t=Ut();return G_(t,nt,e)}function G_(e,t,i){var n=e.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=i;var r=e.baseQueue,s=n.pending;if(s!==null){if(r!==null){var a=r.next;r.next=s.next,s.next=a}t.baseQueue=r=s,n.pending=null}if(s=e.baseState,r===null)e.memoizedState=s;else{t=r.next;var o=a=null,l=null,c=t,u=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(Ue&d)===d:(fs&d)===d){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===Xa&&(u=!0);else if((fs&h)===h){c=c.next,h===Xa&&(u=!0);continue}else d={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=d,a=s):l=l.next=d,Ae.lanes|=h,pa|=h;d=c.action,Qa&&i(s,d),s=c.hasEagerState?c.eagerState:i(s,d)}else h={lane:d,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=h,a=s):l=l.next=h,Ae.lanes|=d,pa|=d;c=c.next}while(c!==null&&c!==t);if(l===null?a=s:l.next=o,!Cn(s,e.memoizedState)&&(Kt=!0,u&&(i=ul,i!==null)))throw i;e.memoizedState=s,e.baseState=a,e.baseQueue=l,n.lastRenderedState=s}return r===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function jm(e){var t=Ut(),i=t.queue;if(i===null)throw Error(F(311));i.lastRenderedReducer=e;var n=i.dispatch,r=i.pending,s=t.memoizedState;if(r!==null){i.pending=null;var a=r=r.next;do s=e(s,a.action),a=a.next;while(a!==r);Cn(s,t.memoizedState)||(Kt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),i.lastRenderedState=s}return[s,n]}function lx(e,t,i){var n=Ae,r=Ut(),s=Le;if(s){if(i===void 0)throw Error(F(407));i=i()}else i=t();var a=!Cn((nt||r).memoizedState,i);if(a&&(r.memoizedState=i,Kt=!0),r=r.queue,j_(dx.bind(null,n,r,e),[e]),e=r.getSnapshot!==t||a||$t!==null&&($t.memoizedState.tag&1)!==0,yl(e?9:8,{destroy:void 0},ux.bind(null,n,r,i,t),null),e){if(n.flags|=2048,ct===null)throw Error(F(349));s||(fs&127)!==0||cx(n,t,i)}return i}function cx(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ae.updateQueue,t===null?(t=af(),Ae.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function ux(e,t,i,n){t.value=i,t.getSnapshot=n,hx(t)&&fx(e)}function dx(e,t,i){return i(function(){hx(t)&&fx(e)})}function hx(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Cn(e,i)}catch{return!0}}function fx(e){var t=ro(e,2);t!==null&&cn(t,e,2)}function Ig(e){var t=Xi();if(typeof e=="function"){var i=e;if(e=i(),Qa){Ys(!0);try{i()}finally{Ys(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function px(e,t,i,n){return e.baseState=i,G_(e,nt,typeof n=="function"?n:ps)}function KL(e,t,i,n,r){if(cf(e))throw Error(F(485));if(e=t.action,e!==null){var s={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){s.listeners.push(a)}};Se.T!==null?i(!0):s.isTransition=!1,n(s),i=t.pending,i===null?(s.next=t.pending=s,mx(t,s)):(s.next=i.next,t.pending=i.next=s)}}function mx(e,t){var i=t.action,n=t.payload,r=e.state;if(t.isTransition){var s=Se.T,a={};a.types=s!==null?s.types:null,Se.T=a;try{var o=i(r,n),l=Se.S;l!==null&&l(a,o),iw(e,t,o)}catch(c){zg(e,t,c)}finally{s!==null&&a.types!==null&&(s.types=a.types),Se.T=s}}else try{s=i(r,n),iw(e,t,s)}catch(c){zg(e,t,c)}}function iw(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(n){nw(e,t,n)},function(n){return zg(e,t,n)}):nw(e,t,i)}function nw(e,t,i){t.status="fulfilled",t.value=i,gx(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,mx(e,i)))}function zg(e,t,i){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=i,gx(t),t=t.next;while(t!==n)}e.action=null}function gx(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _x(e,t){return t}function rw(e,t){if(Le){var i=ct.formState;if(i!==null){e:{var n=Ae;if(Le){if(_t){t:{for(var r=_t,s=Gn;r.nodeType!==8;){if(!s){r=null;break t}if(r=jn(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){_t=jn(r.nextSibling),n=r.data==="F!";break e}}da(n)}n=!1}n&&(t=i[0])}}return i=Xi(),i.memoizedState=i.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_x,lastRenderedState:t},i.queue=n,i=Dx.bind(null,Ae,n),n.dispatch=i,n=Ig(!1),s=Z_.bind(null,Ae,!1,n.queue),n=Xi(),r={state:t,dispatch:null,action:e,pending:null},n.queue=r,i=KL.bind(null,Ae,r,s,i),r.dispatch=i,n.memoizedState=e,[t,i,!1]}function sw(e){var t=Ut();return vx(t,nt,e)}function vx(e,t,i){if(t=G_(e,t,_x)[0],e=ch(ps)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=du(t)}catch(a){throw a===Rl?sf:a}else n=t;t=Ut();var r=t.queue,s=r.dispatch;return i!==t.memoizedState&&(Ae.flags|=2048,yl(9,{destroy:void 0},GL.bind(null,r,i),null)),[n,s,e]}function GL(e,t){e.action=t}function aw(e){var t=Ut(),i=nt;if(i!==null)return vx(t,i,e);Ut(),t=t.memoizedState,i=Ut();var n=i.queue.dispatch;return i.memoizedState=e,[t,n,!1]}function yl(e,t,i,n){return e={tag:e,create:i,deps:n,inst:t,next:null},t=Ae.updateQueue,t===null&&(t=af(),Ae.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(n=i.next,i.next=e,e.next=n,t.lastEffect=e),e}function bx(){return Ut().memoizedState}function uh(e,t,i,n){var r=Xi();Ae.flags|=e,r.memoizedState=yl(1|t,{destroy:void 0},i,n===void 0?null:n)}function lf(e,t,i,n){var r=Ut();n=n===void 0?null:n;var s=r.memoizedState.inst;nt!==null&&n!==null&&U_(n,nt.memoizedState.deps)?r.memoizedState=yl(t,s,i,n):(Ae.flags|=e,r.memoizedState=yl(1|t,s,i,n))}function ow(e,t){uh(8390656,8,e,t)}function j_(e,t){lf(2048,8,e,t)}function jL(e){Ae.flags|=4;var t=Ae.updateQueue;if(t===null)t=af(),Ae.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function yx(e){var t=Ut().memoizedState;return jL({ref:t,nextImpl:e}),function(){if((je&2)!==0)throw Error(F(440));return t.impl.apply(void 0,arguments)}}function Sx(e,t){return lf(4,2,e,t)}function wx(e,t){return lf(4,4,e,t)}function xx(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ex(e,t,i){i=i!=null?i.concat([e]):null,lf(4,4,xx.bind(null,t,e),i)}function Y_(){}function kx(e,t){var i=Ut();t=t===void 0?null:t;var n=i.memoizedState;return t!==null&&U_(t,n[1])?n[0]:(i.memoizedState=[e,t],e)}function Cx(e,t){var i=Ut();t=t===void 0?null:t;var n=i.memoizedState;if(t!==null&&U_(t,n[1]))return n[0];if(n=e(),Qa){Ys(!0);try{e()}finally{Ys(!1)}}return i.memoizedState=[n,t],n}function V_(e,t,i){return i===void 0||(fs&1073741824)!==0&&(Ue&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=vE(),Ae.lanes|=e,pa|=e,i)}function Tx(e,t,i,n){return Cn(i,t)?i:ha.current!==null?(e=V_(e,i,n),Cn(e,t)||(Kt=!0),e):(fs&106)===0||(fs&1073741824)!==0&&(Ue&261930)===0?(Kt=!0,e.memoizedState=i):(e=vE(),Ae.lanes|=e,pa|=e,t)}function Nx(e,t,i,n,r){var s=Ye.p;Ye.p=s!==0&&8>s?s:8;var a=Se.T,o={};o.types=a!==null?a.types:null,Se.T=o,Z_(e,!1,t,i);try{var l=r(),c=Se.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=FL(l,n);zc(e,t,u,kn(e))}else zc(e,t,n,kn(e))}catch(d){zc(e,t,{then:function(){},status:"rejected",reason:d},kn())}finally{Ye.p=s,a!==null&&o.types!==null&&(a.types=o.types),Se.T=a}}function YL(){}function Bg(e,t,i,n){if(e.tag!==5)throw Error(F(476));var r=Ax(e).queue;Nx(e,r,t,Fa,i===null?YL:function(){return Mx(e),i(n)})}function Ax(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Fa,baseState:Fa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:Fa},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Mx(e){var t=Ax(e);t.next===null&&(t=e.alternate.memoizedState),zc(e,t.next.queue,{},kn())}function X_(){return xi(Tl)}function Ox(){return Ut().memoizedState}function Rx(){return Ut().memoizedState}function VL(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=kn();e=ia(i);var n=na(t,e,i);n!==null&&(cn(n,t,i),Dc(n,t,i)),t={cache:L_()},e.payload=t;return}t=t.return}}function XL(e,t,i){var n=kn();i={lane:n,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cf(e)?Lx(t,i):(i=O_(e,t,i,n),i!==null&&(cn(i,e,n),Ix(i,t,n)))}function Dx(e,t,i){var n=kn();zc(e,t,i,n)}function zc(e,t,i,n){var r={lane:n,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(cf(e))Lx(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,i);if(r.hasEagerState=!0,r.eagerState=o,Cn(o,a))return nf(e,t,r,0),ct===null&&tf(),!1}catch{}if(i=O_(e,t,r,n),i!==null)return cn(i,e,n),Ix(i,t,n),!0}return!1}function Z_(e,t,i,n){if(n={lane:2,revertLane:lv(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cf(e)){if(t)throw Error(F(479))}else t=O_(e,i,n,2),t!==null&&cn(t,e,2)}function cf(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function Lx(e,t){hl=Lh=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ix(e,t,i){if((i&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,i|=n,t.lanes=i,b1(e,i)}}var zh={readContext:xi,use:of,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt,useHostTransitionStatus:Dt,useFormState:Dt,useActionState:Dt,useOptimistic:Dt,useMemoCache:Dt,useCacheRefresh:Dt,useEffectEvent:Dt},zx={readContext:xi,use:of,useCallback:function(e,t){return Xi().memoizedState=[e,t===void 0?null:t],e},useContext:xi,useEffect:ow,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,uh(4194308,4,xx.bind(null,t,e),i)},useLayoutEffect:function(e,t){return uh(4194308,4,e,t)},useInsertionEffect:function(e,t){uh(4,2,e,t)},useMemo:function(e,t){var i=Xi();t=t===void 0?null:t;var n=e();if(Qa){Ys(!0);try{e()}finally{Ys(!1)}}return i.memoizedState=[n,t],n},useReducer:function(e,t,i){var n=Xi();if(i!==void 0){var r=i(t);if(Qa){Ys(!0);try{i(t)}finally{Ys(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=XL.bind(null,Ae,e),[n.memoizedState,e]},useRef:function(e){var t=Xi();return e={current:e},t.memoizedState=e},useState:function(e){e=Ig(e);var t=e.queue,i=Dx.bind(null,Ae,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Y_,useDeferredValue:function(e,t){var i=Xi();return V_(i,e,t)},useTransition:function(){var e=Ig(!1);return e=Nx.bind(null,Ae,e.queue,!0,!1),Xi().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var n=Ae,r=Xi();if(Le){if(i===void 0)throw Error(F(407));i=i()}else{if(i=t(),ct===null)throw Error(F(349));(Ue&127)!==0||cx(n,t,i)}r.memoizedState=i;var s={value:i,getSnapshot:t};return r.queue=s,ow(dx.bind(null,n,s,e),[e]),n.flags|=2048,yl(9,{destroy:void 0},ux.bind(null,n,s,i,t),null),i},useId:function(){var e=Xi(),t=ct.identifierPrefix;if(Le){var i=Pr,n=Br;i=(n&~(1<<32-En(n)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Ih++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=$L++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:X_,useFormState:rw,useActionState:rw,useOptimistic:function(e){var t=Xi();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Z_.bind(null,Ae,!0,i),i.dispatch=t,[e,t]},useMemoCache:K_,useCacheRefresh:function(){return Xi().memoizedState=VL.bind(null,Ae)},useEffectEvent:function(e){var t=Xi(),i={impl:e};return t.memoizedState=i,function(){if((je&2)!==0)throw Error(F(440));return i.impl.apply(void 0,arguments)}}},Bx={readContext:xi,use:of,useCallback:kx,useContext:xi,useEffect:j_,useImperativeHandle:Ex,useInsertionEffect:Sx,useLayoutEffect:wx,useMemo:Cx,useReducer:ch,useRef:bx,useState:function(){return ch(ps)},useDebugValue:Y_,useDeferredValue:function(e,t){var i=Ut();return Tx(i,nt.memoizedState,e,t)},useTransition:function(){var e=ch(ps)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:du(e),t]},useSyncExternalStore:lx,useId:Ox,useHostTransitionStatus:X_,useFormState:sw,useActionState:sw,useOptimistic:function(e,t){var i=Ut();return px(i,nt,e,t)},useMemoCache:K_,useCacheRefresh:Rx,useEffectEvent:yx},ZL={readContext:xi,use:of,useCallback:kx,useContext:xi,useEffect:j_,useImperativeHandle:Ex,useInsertionEffect:Sx,useLayoutEffect:wx,useMemo:Cx,useReducer:jm,useRef:bx,useState:function(){return jm(ps)},useDebugValue:Y_,useDeferredValue:function(e,t){var i=Ut();return nt===null?V_(i,e,t):Tx(i,nt.memoizedState,e,t)},useTransition:function(){var e=jm(ps)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:du(e),t]},useSyncExternalStore:lx,useId:Ox,useHostTransitionStatus:X_,useFormState:aw,useActionState:aw,useOptimistic:function(e,t){var i=Ut();return nt!==null?px(i,nt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:K_,useCacheRefresh:Rx,useEffectEvent:yx};function Ym(e,t,i,n){t=e.memoizedState,i=i(n,t),i=i==null?t:ut({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Pg={enqueueSetState:function(e,t,i){e=e._reactInternals;var n=kn(),r=ia(n);r.payload=t,i!=null&&(r.callback=i),t=na(e,r,n),t!==null&&(cn(t,e,n),Dc(t,e,n))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var n=kn(),r=ia(n);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=na(e,r,n),t!==null&&(cn(t,e,n),Dc(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=kn(),n=ia(i);n.tag=2,t!=null&&(n.callback=t),t=na(e,n,i),t!==null&&(cn(t,e,i),Dc(t,e,i))}};function lw(e,t,i,n,r,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,a):t.prototype&&t.prototype.isPureReactComponent?!Kc(i,n)||!Kc(r,s):!0}function cw(e,t,i,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,n),t.state!==e&&Pg.enqueueReplaceState(t,t.state,null)}function Ja(e,t){var i=t;if("ref"in t){i={};for(var n in t)n!=="ref"&&(i[n]=t[n])}if(e=e.defaultProps){i===t&&(i=ut({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function Px(e){Ch(e)}function Hx(e){console.error(e)}function Ux(e){Ch(e)}function Bh(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function uw(e,t,i){try{var n=e.onCaughtError;n(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Hg(e,t,i){return i=ia(i),i.tag=3,i.payload={element:null},i.callback=function(){Bh(e,t)},i}function qx(e){return e=ia(e),e.tag=3,e}function Fx(e,t,i,n){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var s=n.value;e.payload=function(){return r(s)},e.callback=function(){uw(t,i,n)}}var a=i.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){uw(t,i,n),typeof r!="function"&&(aa===null?aa=new Set([this]):aa.add(this));var o=n.stack;this.componentDidCatch(n.value,{componentStack:o!==null?o:""})})}function QL(e,t,i,n,r){if(i.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=i.alternate,t!==null&&Ya(t,i,r,!0),i=Ti.current,i!==null){switch(i.tag){case 31:case 13:case 19:return Bi===null?Kh():i.alternate===null&&Lt===0&&(Lt=3),i.flags&=-257,i.flags|=65536,i.lanes=r,n===Oh?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([n]):t.add(n),tg(e,n,r)),!1;case 22:return i.flags|=65536,n===Oh?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([n]):i.add(n)),tg(e,n,r)),!1}throw Error(F(435,i.tag))}return tg(e,n,r),Kh(),!1}if(Le)return t=Ti.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==Tg&&(e=Error(F(422),{cause:n}),jc(Kn(e,i)))):(n!==Tg&&(t=Error(F(423),{cause:n}),jc(Kn(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=Kn(n,i),r=Hg(e.stateNode,n,r),Gm(e,r),Lt!==4&&(Lt=2)),!1;var s=Error(F(520),{cause:n});if(s=Kn(s,i),Uc===null?Uc=[s]:Uc.push(s),Lt!==4&&(Lt=2),t===null)return!0;n=Kn(n,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=Hg(i.stateNode,n,e),Gm(i,e),!1;case 1:if(t=i.type,s=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(aa===null||!aa.has(s))))return i.flags|=65536,r&=-r,i.lanes|=r,r=qx(r),Fx(r,e,i,n),Gm(i,r),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var Q_=Error(F(461)),Kt=!1;function Zt(e,t,i,n){t.child=e===null?ix(t,null,i,n):Za(t,e.child,i,n)}function dw(e,t,i,n,r){i=i.render;var s=t.ref;if("ref"in n){var a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}else a=n;return Va(t),n=q_(e,t,i,a,s,r),o=F_(),e!==null&&!Kt?($_(e,t,r),ms(e,t,r)):(Le&&o&&rf(t),t.flags|=1,Zt(e,t,n,r),t.child)}function hw(e,t,i,n,r){if(e===null){var s=i.type;return typeof s=="function"&&!R_(s)&&s.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=s,$x(e,t,s,n,r)):(e=ah(i.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!ev(e,r)){var a=s.memoizedProps;if(i=i.compare,i=i!==null?i:Kc,i(a,n)&&e.ref===t.ref)return ms(e,t,r)}return t.flags|=1,e=cs(s,n),e.ref=t.ref,e.return=t,t.child=e}function $x(e,t,i,n,r){if(e!==null){var s=e.memoizedProps;if(Kc(s,n)&&e.ref===t.ref)if(Kt=!1,t.pendingProps=n=s,ev(e,r))(e.flags&131072)!==0&&(Kt=!0);else return t.lanes=e.lanes,ms(e,t,r)}return Ug(e,t,i,n,r)}function Wx(e,t,i,n){var r=n.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(s=s!==null?s.baseLanes|i:i,e!==null){for(n=t.child=e.child,r=0;n!==null;)r=r|n.lanes|n.childLanes,n=n.sibling;n=r&~s}else n=0,t.child=null;return fw(e,t,s,i,n)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&lh(t,s!==null?s.cachePool:null),s!==null?tw(t,s):Dg(),sx(t);else return n=t.lanes=536870912,fw(e,t,s!==null?s.baseLanes|i:i,i,n)}else s!==null?(lh(t,s.cachePool),tw(t,s),sa(),t.memoizedState=null):(e!==null&&lh(t,null),Dg(),sa());return Zt(e,t,r,i),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fw(e,t,i,n,r){var s=I_();return s=s===null?null:{parent:Wt._currentValue,pool:s},t.memoizedState={baseLanes:i,cachePool:s},e!==null&&lh(t,null),Dg(),sx(t),e!==null&&Ya(e,t,n,!0),t.childLanes=r,null}function dh(e,t){return t=uf({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pw(e,t,i){return Za(t,e.child,null,i),e=dh(t,t.pendingProps),e.flags|=2,bn(t),t.memoizedState=null,e}function JL(e,t,i){var n=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(n.mode==="hidden")return e=dh(t,n),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(Lg(t),(e=_t)?(e=WE(e,Gn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ua!==null?{id:Br,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},i=V1(e),i.return=t,t.child=i,li=t,_t=null)):e=null,e===null)throw da(t);return t.lanes=536870912,null}return dh(t,n)}var s=e.memoizedState;if(s!==null){var a=s.dehydrated;if(Lg(t),r)if(t.flags&256)t.flags&=-257,t=pw(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(F(558));else if(Kt||Ya(e,t,i,!1),r=(i&e.childLanes)!==0,Kt||r){if(ha.current===null){if(n=ct,n!==null&&(a=y1(n,i),a!==0&&a!==s.retryLane))throw s.retryLane=a,ro(e,a),cn(n,e,a),Q_;Kh()}t=pw(e,t,i)}else e=s.treeContext,_t=jn(a.nextSibling),li=t,Le=!0,ta=null,Gn=!1,e!==null&&Z1(t,e),t=dh(t,n),t.flags|=134221824;return t}return e=cs(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Go(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(F(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Ug(e,t,i,n,r){return Va(t),i=q_(e,t,i,n,void 0,r),n=F_(),e!==null&&!Kt?($_(e,t,r),ms(e,t,r)):(Le&&n&&rf(t),t.flags|=1,Zt(e,t,i,r),t.child)}function mw(e,t,i,n,r,s){return Va(t),t.updateQueue=null,i=ox(t,n,i,r),ax(e),n=F_(),e!==null&&!Kt?($_(e,t,s),ms(e,t,s)):(Le&&n&&rf(t),t.flags|=1,Zt(e,t,i,s),t.child)}function gw(e,t,i,n,r){if(Va(t),t.stateNode===null){var s=nl,a=i.contextType;typeof a=="object"&&a!==null&&(s=xi(a)),s=new i(n,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Pg,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=n,s.state=t.memoizedState,s.refs={},B_(t),a=i.contextType,s.context=typeof a=="object"&&a!==null?xi(a):nl,s.state=t.memoizedState,a=i.getDerivedStateFromProps,typeof a=="function"&&(Ym(t,i,a,n),s.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(a=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),a!==s.state&&Pg.enqueueReplaceState(s,s.state,null),Ic(t,n,s,r),Lc(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){s=t.stateNode;var o=t.memoizedProps,l=Ja(i,o);s.props=l;var c=s.context,u=i.contextType;a=nl,typeof u=="object"&&u!==null&&(a=xi(u));var d=i.getDerivedStateFromProps;u=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o||c!==a)&&cw(t,s,n,a),Gs=!1;var h=t.memoizedState;s.state=h,Ic(t,n,s,r),Lc(),c=t.memoizedState,o||h!==c||Gs?(typeof d=="function"&&(Ym(t,i,d,n),c=t.memoizedState),(l=Gs||lw(t,i,l,n,h,c,a))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),s.props=n,s.state=c,s.context=a,n=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,Og(e,t),a=t.memoizedProps,u=Ja(i,a),s.props=u,d=t.pendingProps,h=s.context,c=i.contextType,l=nl,typeof c=="object"&&c!==null&&(l=xi(c)),o=i.getDerivedStateFromProps,(c=typeof o=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||h!==l)&&cw(t,s,n,l),Gs=!1,h=t.memoizedState,s.state=h,Ic(t,n,s,r),Lc();var f=t.memoizedState;a!==d||h!==f||Gs||e!==null&&e.dependencies!==null&&Mh(e.dependencies)?(typeof o=="function"&&(Ym(t,i,o,n),f=t.memoizedState),(u=Gs||lw(t,i,u,n,h,f,l)||e!==null&&e.dependencies!==null&&Mh(e.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,f,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,f,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=f),s.props=n,s.state=f,s.context=l,n=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return s=n,Go(e,t),n=(t.flags&128)!==0,s||n?(s=t.stateNode,i=n&&typeof i.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&n?(t.child=Za(t,e.child,null,r),t.child=Za(t,null,i,r)):Zt(e,t,i,r),t.memoizedState=s.state,e=t.child):e=ms(e,t,r),e}function _w(e,t,i,n){return ja(),t.flags|=256,Zt(e,t,i,n),t.child}var qg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fg(e){return{baseLanes:e,cachePool:J1()}}function $g(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Sn),e}function Kx(e,t,i){var n=t.pendingProps,r=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(ki.current&2)!==0),a&&(r=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(r?ra(t):sa(),(e=_t)?(e=WE(e,Gn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ua!==null?{id:Br,overflow:Pr}:null,retryLane:536870912,hydrationErrors:null},i=V1(e),i.return=t,t.child=i,li=t,_t=null)):e=null,e===null)throw da(t);return hv(e)?t.lanes=32:t.lanes=536870912,null}return s=n.children,n=n.fallback,r?(sa(),r=t.mode,s=uf({mode:"hidden",children:s},r),n=$a(n,r,i,null),s.return=t,n.return=t,s.sibling=n,t.child=s,n=t.child,n.memoizedState=Fg(i),n.childLanes=$g(e,a,i),t.memoizedState=qg,Bc(null,n)):(ra(t),J_(t,s))}var o=e.memoizedState;if(o!==null){var l=o.dehydrated;if(l!==null)return e3(e,t,s,a,n,l,o,i)}return r?(sa(),r=n.fallback,s=t.mode,o=e.child,l=o.sibling,n=cs(o,{mode:"hidden",children:n.children}),n.subtreeFlags=o.subtreeFlags&1206910976,l!==null?r=cs(l,r):(r=$a(r,s,i,null),r.flags|=2),r.return=t,n.return=t,n.sibling=r,t.child=n,Bc(null,n),n=t.child,r=e.child.memoizedState,r===null?r=Fg(i):(s=r.cachePool,s!==null?(o=Wt._currentValue,s=s.parent!==o?{parent:o,pool:o}:s):s=J1(),r={baseLanes:r.baseLanes|i,cachePool:s}),n.memoizedState=r,n.childLanes=$g(e,a,i),t.memoizedState=qg,Bc(e.child,n)):(ra(t),i=e.child,e=i.sibling,i=cs(i,{mode:"visible",children:n.children}),i.return=t,i.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=i,t.memoizedState=null,i)}function J_(e,t){return t=uf({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function uf(e,t){return e=ln(22,e,null,t),e.lanes=0,e}function Gd(e,t,i){return Za(t,e.child,null,i),e=J_(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function e3(e,t,i,n,r,s,a,o){if(i)return t.flags&256?(ra(t),t.flags&=-257,Gd(e,t,o)):t.memoizedState!==null?(sa(),t.child=e.child,t.flags|=128,null):(sa(),s=r.fallback,a=t.mode,r=uf({mode:"visible",children:r.children},a),s=$a(s,a,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,Za(t,e.child,null,o),r=t.child,r.memoizedState=Fg(o),r.childLanes=$g(e,n,o),t.memoizedState=qg,Bc(null,r));if(ra(t),hv(s)){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,n!==""&&(r=Error(F(419)),r.stack="",r.digest=n,jc({value:r,source:null,stack:null})),Gd(e,t,o)}if(Kt||Ya(e,t,o,!1),n=(o&e.childLanes)!==0,Kt||n){if(ha.current!==null)return Gd(e,t,o);if(n=ct,n!==null&&(r=y1(n,o),r!==0&&r!==a.retryLane))throw a.retryLane=r,ro(e,r),cn(n,e,r),Q_;return p_(s)||Kh(),Gd(e,t,o)}return p_(s)?(t.flags|=192,t.child=e.child,null):(e=a.treeContext,_t=jn(s.nextSibling),li=t,Le=!0,ta=null,Gn=!1,e!==null&&Z1(t,e),t=J_(t,r.children),t.flags|=134221824,t)}function vw(e,t,i){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),oh(e.return,t,i)}function bw(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&Dh(i)===null&&(t=e),e=e.sibling}return t}function jd(e,t,i,n,r,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:i,tailMode:r,treeForkCount:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=i,a.tailMode=r,a.treeForkCount=s)}function Vm(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function Wg(e,t,i){var n=t.pendingProps,r=n.revealOrder,s=n.tail;n=n.children;var a=ki.current;if(t.flags&128)return Vc(t,a),null;var o=(a&2)!==0;if(o?(a=a&1|2,t.flags|=128):a&=1,Vc(t,a),r==="backwards"&&e!==null?(Vm(e),Zt(e,t,n,i),Vm(e)):Zt(e,t,n,i),n=Le?Gc:0,!o&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vw(e,i,t);else if(e.tag===19)vw(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"backwards":i=bw(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null,Vm(t)),jd(t,!0,r,null,s,n);break;case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Dh(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}jd(t,!0,i,null,s,n);break;case"together":jd(t,!1,null,null,void 0,n);break;case"independent":t.memoizedState=null;break;default:i=bw(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),jd(t,!1,r,i,s,n)}return t.child}function yw(e,t,i){var n=t.pendingProps;return Xs(t,t.type,n.value),Zt(e,t,n.children,i),t.child}function ms(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),pa|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Ya(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,i=cs(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=cs(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function ev(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Mh(e)))}function t3(e,t,i){switch(t.tag){case 3:wh(t,t.stateNode.containerInfo),Xs(t,Wt,e.memoizedState.cache),ja();break;case 27:case 5:_g(t);break;case 4:wh(t,t.stateNode.containerInfo);break;case 10:Xs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lg(t),null;break;case 13:var n=t.memoizedState;if(n!==null){if(n.dehydrated!==null)return ra(t),t.flags|=128,null;n=Ya(e,t,i,!1);var r=t.child.childLanes;return n||(i&r)!==0?Kx(e,t,i):(ra(t),e=ms(e,t,i),e!==null?e.sibling:null)}ra(t);break;case 19:if(t.flags&128)return Wg(e,t,i);if(r=(e.flags&128)!==0,n=(i&t.childLanes)!==0,n||(Ya(e,t,i,!1),n=(i&t.childLanes)!==0),r){if(n)return Wg(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Vc(t,ki.current),n)break;return null;case 22:return t.lanes=0,Wx(e,t,i,t.pendingProps);case 24:Xs(t,Wt,e.memoizedState.cache)}return ms(e,t,i)}function Gx(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Kt=!0;else{if(!ev(e,i)&&(t.flags&128)===0)return Kt=!1,t3(e,t,i);Kt=(e.flags&131072)!==0}else Kt=!1,Le&&(t.flags&1048576)!==0&&X1(t,Gc,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Pa(t.elementType),t.type=e,typeof e=="function")R_(e)?(n=Ja(e,n),t.tag=1,t=gw(null,t,e,n,i)):(t.tag=0,t=Ug(null,t,e,n,i));else{if(e!=null){var r=e.$$typeof;if(r===b_){t.tag=11,t=dw(null,t,e,n,i);break e}else if(r===y_){t.tag=14,t=hw(null,t,e,n,i);break e}else if(r===Ir){t.tag=10,t.type=e,t=yw(null,t,i);break e}}throw t=mg(e)||e,Error(F(306,t,""))}}return t;case 0:return Ug(e,t,t.type,t.pendingProps,i);case 1:return n=t.type,r=Ja(n,t.pendingProps),gw(e,t,n,r,i);case 3:e:{if(wh(t,t.stateNode.containerInfo),e===null)throw Error(F(387));n=t.pendingProps;var s=t.memoizedState;r=s.element,Og(e,t),Ic(t,n,null,i);var a=t.memoizedState;if(n=a.cache,Xs(t,Wt,n),n!==s.cache&&Ag(t,[Wt],i,!0),Lc(),n=a.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=_w(e,t,n,i);break e}else if(n!==r){r=Kn(Error(F(424)),t),jc(r),t=_w(e,t,n,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,_t=jn(e.firstChild),li=t,Le=!0,ta=null,Gn=!0,i=ix(t,null,n,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(ja(),n===r){t=ms(e,t,i);break e}Zt(e,t,n,i)}t=t.child}return t;case 26:return Go(e,t),e===null?(i=jw(t.type,null,t.pendingProps,null))?t.memoizedState=i:Le||(t.stateNode=IE(t.type,t.pendingProps,ea.current,t)):t.memoizedState=jw(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _g(t),e===null&&Le&&(n=t.stateNode=KE(t.type,t.pendingProps,ea.current),li=t,Gn=!0,r=_t,ga(t.type)?(m_=r,_t=jn(n.firstChild)):_t=r),Zt(e,t,t.pendingProps.children,i),Go(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((r=n=_t)&&(n=j3(n,t.type,t.pendingProps,Gn),n!==null?(t.stateNode=n,li=t,_t=jn(n.firstChild),Gn=!1,r=!0):r=!1),r||da(t)),_g(t),r=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,n=s.children,d_(r,s)?n=null:a!==null&&d_(r,a)&&(t.flags|=32),t.memoizedState!==null&&(r=q_(e,t,WL,null,null,i),Tl._currentValue=r),Go(e,t),Zt(e,t,n,i),t.child;case 6:return e===null&&Le&&((e=i=_t)&&(i=Y3(i,t.pendingProps,Gn),i!==null?(t.stateNode=i,li=t,_t=null,e=!0):e=!1),e||da(t)),null;case 13:return Kx(e,t,i);case 4:return wh(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Za(t,null,n,i):Zt(e,t,n,i),t.child;case 11:return dw(e,t,t.type,t.pendingProps,i);case 7:return n=t.pendingProps,Go(e,t),Zt(e,t,n,i),t.child;case 8:return Zt(e,t,t.pendingProps.children,i),t.child;case 12:return Zt(e,t,t.pendingProps.children,i),t.child;case 10:return yw(e,t,i);case 9:return r=t.type._context,n=t.pendingProps.children,Va(t),r=xi(r),n=n(r),t.flags|=1,Zt(e,t,n,i),t.child;case 14:return hw(e,t,t.type,t.pendingProps,i);case 15:return $x(e,t,t.type,t.pendingProps,i);case 19:return Wg(e,t,i);case 31:return JL(e,t,i);case 22:return Wx(e,t,i,t.pendingProps);case 24:return Va(t),n=xi(Wt),e===null?(r=I_(),r===null&&(r=ct,s=L_(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=i),r=s),t.memoizedState={parent:n,cache:r},B_(t),Xs(t,Wt,r)):((e.lanes&i)!==0&&(Og(e,t),Ic(t,null,null,i),Lc()),r=e.memoizedState,s=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Xs(t,Wt,n)):(n=s.cache,Xs(t,Wt,n),n!==r.cache&&Ag(t,[Wt],i,!0))),Zt(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),n=t.pendingProps,n.name!=null&&n.name!=="auto"?t.flags|=e===null?18882560:18874368:Le&&rf(t),e!==null&&e.memoizedProps.name!==n.name?t.flags|=4194816:Go(e,t),Zt(e,t,n.children,i),t.child;case 29:throw t.pendingProps}throw Error(F(156,t.tag))}function as(e){e.flags|=4}function Xm(e,t,i,n,r){var s;if((s=(e.mode&32)!==0)&&(s=i===null?Xw(t,n):Xw(t,n)&&(n.src!==i.src||n.srcSet!==i.srcSet)),s){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(SE())e.flags|=8192;else throw Ka=Oh,z_}else e.flags&=-16777217}function Sw(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!VE(t))if(SE())e.flags|=8192;else throw Ka=Oh,z_}function Yd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_1():536870912,e.lanes|=t,Sl|=t)}function yc(e,t){if(!Le)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,n=null;i!==null;)i.alternate!==null&&(n=i),i=i.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,n=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,n|=r.subtreeFlags&1206910976,n|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=i,t}function i3(e,t,i){var n=t.pendingProps;switch(D_(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return i=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),us(Wt),_l(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Wo(t)?as(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Km())),gt(t),null;case 26:var r=t.type,s=t.memoizedState;return e===null?(as(t),s!==null?(gt(t),Sw(t,s)):(gt(t),Xm(t,r,null,n,i))):s?s!==e.memoizedState?(as(t),gt(t),Sw(t,s)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&as(t),gt(t),Xm(t,r,e,n,i)),null;case 27:if(xh(t),i=ea.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&as(t);else{if(!n){if(t.stateNode===null)throw Error(F(166));return gt(t),t.subtreeFlags&=-33554433,null}e=Hr.current,Wo(t)?YS(t,e):(e=KE(r,n,i),t.stateNode=e,as(t))}return gt(t),t.subtreeFlags&=-33554433,null;case 5:if(xh(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&as(t);else{if(!n){if(t.stateNode===null)throw Error(F(166));return gt(t),t.subtreeFlags&=-33554433,null}if(s=Hr.current,Wo(t))YS(t,s);else{var a=Jc(ea.current);switch(s){case 1:s=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:s=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":s=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":s=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":s=a.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof n.is=="string"?a.createElement("select",{is:n.is}):a.createElement("select"),n.multiple?s.multiple=!0:n.size&&(s.size=n.size);break;default:s=typeof n.is=="string"?a.createElement(r,{is:n.is}):a.createElement(r)}}s[wi]=t,s[dn]=n;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)s.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=s;e:switch(Ci(s,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&as(t)}}return gt(t),t.subtreeFlags&=-33554433,Xm(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&as(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(F(166));if(e=ea.current,Wo(t)){if(e=t.stateNode,i=t.memoizedProps,n=null,r=li,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[wi]=t,e=!!(e.nodeValue===i||n!==null&&n.suppressHydrationWarning===!0||DE(e.nodeValue,i)),e||da(t,!0)}else e=Jc(e).createTextNode(n),e[wi]=t,t.stateNode=e}return gt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(n=Wo(t),i!==null){if(e===null){if(!n)throw Error(F(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(557));e[wi]=t}else ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else i=Km(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(bn(t),t):(bn(t),null);if((t.flags&128)!==0)throw Error(F(558))}return gt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Wo(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(F(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(F(317));r[wi]=t}else ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),r=!1}else r=Km(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(bn(t),t):(bn(t),null)}return bn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=n!==null,e=e!==null&&e.memoizedState!==null,i&&(n=t.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==r&&(n.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Yd(t,t.updateQueue),gt(t),null);case 4:return _l(),e===null&&cv(t.stateNode.containerInfo),t.flags|=67108864,gt(t),null;case 10:return us(t.type),gt(t),null;case 19:if(H_(t),n=t.memoizedState,n===null)return gt(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)yc(n,!1);else{if(Lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Dh(e),s!==null){for(t.flags|=128,yc(n,!1),e=s.updateQueue,t.updateQueue=e,Yd(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Y1(i,e),i=i.sibling;return Vc(t,ki.current&1|2),Le&&os(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&wn()>$h&&(t.flags|=128,r=!0,yc(n,!1),t.lanes=4194304)}else{if(!r)if(e=Dh(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Yd(t,e),yc(n,!0),n.tail===null&&n.tailMode!=="collapsed"&&n.tailMode!=="visible"&&!s.alternate&&!Le)return gt(t),null}else 2*wn()-n.renderingStartTime>$h&&i!==536870912&&(t.flags|=128,r=!0,yc(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(e=n.last,e!==null?e.sibling=s:t.child=s,n.last=s)}if(n.tail!==null){e=n.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return n.rendering=e,n.tail=e.sibling,n.renderingStartTime=wn(),e.sibling=null,s=ki.current,s=r?s&1|2:s&1,n.tailMode==="visible"||n.tailMode==="collapsed"||!i||Le?Vc(t,s):(i=s,vt(Ti,t),vt(ki,i),Bi===null&&(Bi=t)),Le&&os(t,n.treeForkCount),e}return gt(t),null;case 22:case 23:return bn(t),P_(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(i&536870912)!==0&&(t.flags&128)===0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),i=t.updateQueue,i!==null&&Yd(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==i&&(t.flags|=2048),e!==null&&Ei(Wa),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),us(Wt),gt(t),null;case 25:return null;case 30:return t.flags|=33554432,gt(t),null}throw Error(F(156,t.tag))}function n3(e,t){switch(D_(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return us(Wt),_l(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xh(t),null;case 31:if(t.memoizedState!==null){if(bn(t),t.alternate===null)throw Error(F(340));ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(bn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H_(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return _l(),null;case 10:return us(t.type),null;case 22:case 23:return bn(t),P_(),e!==null&&Ei(Wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return us(Wt),null;case 25:return null;default:return null}}function jx(e,t){switch(D_(t),t.tag){case 3:us(Wt),_l();break;case 26:case 27:case 5:xh(t);break;case 4:_l();break;case 31:t.memoizedState!==null&&bn(t);break;case 13:bn(t);break;case 19:H_(t);break;case 10:us(t.type);break;case 22:case 23:bn(t),P_(),e!==null&&Ei(Wa);break;case 24:us(Wt)}}function hu(e,t){try{var i=t.updateQueue,n=i!==null?i.lastEffect:null;if(n!==null){var r=n.next;i=r;do{if((i.tag&e)===e){n=void 0;var s=i.create,a=i.inst;n=s(),a.destroy=n}i=i.next}while(i!==r)}}catch(o){it(t,t.return,o)}}function fa(e,t,i){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var s=r.next;n=s;do{if((n.tag&e)===e){var a=n.inst,o=a.destroy;if(o!==void 0){a.destroy=void 0,r=t;var l=i,c=o;try{c()}catch(u){it(r,l,u)}}}n=n.next}while(n!==s)}}catch(u){it(t,t.return,u)}}function Yx(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{rx(t,i)}catch(n){it(e,e.return,n)}}}function Vx(e,t,i){i.props=Ja(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(n){it(e,t,n)}}function Dr(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:var r=e.stateNode,s=hs(e.memoizedProps,r);(r.ref===null||r.ref.name!==s)&&(r.ref=HE(s)),n=r.ref;break;case 7:if(e.stateNode===null){var a=new Tn(e);un(e.child,!1,K3,a,void 0,void 0),e.stateNode=a}n=e.stateNode;break;default:n=e.stateNode}typeof i=="function"?e.refCleanup=i(n):i.current=n}}catch(o){it(e,t,o)}}function Si(e,t){var i=e.ref,n=e.refCleanup;if(i!==null)if(typeof n=="function")try{n()}catch(r){it(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){it(e,t,r)}else i.current=null}function Ph(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)$E(e.stateNode,t[i])}function ww(e){for(var t=e.return;t!==null&&(iv(t)&&$E(e.stateNode,t.stateNode),!tv(t));)t=t.return}function Pc(e){for(var t=e.return;t!==null&&(iv(t)&&G3(e.stateNode,t.stateNode),!tv(t));)t=t.return}function tv(e){return e.tag===5||e.tag===3||e.tag===27}function iv(e){return e&&e.tag===7&&e.stateNode!==null}function Kg(e){var t=e.type,i=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&n.focus();break e;case"img":i.src?n.src=i.src:i.srcSet&&(n.srcset=i.srcSet)}}catch(r){it(e,e.return,r)}}function Zm(e,t,i){try{var n=e.stateNode;T3(n,e.type,i,t),n[dn]=t}catch(r){it(e,e.return,r)}}function Xx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ga(e.type)||e.tag===4}function Qm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xx(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&&ga(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gg(e,t,i,n){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(r,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(r),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=zr)),Ph(e,n),Ke=!0;else if(r!==4&&(r===27&&(Ph(e,n),n=null,ga(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(Gg(e,t,i,n),e=e.sibling;e!==null;)Gg(e,t,i,n),e=e.sibling}function Hh(e,t,i,n){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?i.insertBefore(r,t):i.appendChild(r),Ph(e,n),Ke=!0;else if(r!==4&&(r===27&&(Ph(e,n),n=null,ga(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(Hh(e,t,i,n),e=e.sibling;e!==null;)Hh(e,t,i,n),e=e.sibling}function Zx(e){var t=e.stateNode,i=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Ci(t,n,i),t[wi]=e,t[dn]=i}catch(s){it(e,e.return,s)}}var Uh=!1,yn=null;function xw(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Uh=!0)}var Lr=null;function Ew(){var e=Lr;return Lr=null,e}var on=0;function Dl(e,t,i,n,r){return on=0,Qx(e.child,t,i,n,r)}function Qx(e,t,i,n,r){for(var s=!1;e!==null;){if(e.tag===5){var a=e.stateNode;if(n!==null){var o=h_(a);n.push(o),o.view&&(s=!0)}else s||h_(a).view&&(s=!0);Uh=!0,zE(a,on===0?t:t+"_"+on,i),on++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||Qx(e.child,t,i,n,r)&&(s=!0));e=e.sibling}return s}function qr(e,t){for(;e!==null;)e.tag===5?BE(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||qr(e.child,t)),e=e.sibling}function hh(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(hh(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(F(544));var i=t.name;t=vs(t.default,t.share),t!=="none"&&(Dl(e,i,t,null,!1)||qr(e.child,!1))}e=e.sibling}}function jg(e,t){if(e.tag===30){var i=e.stateNode,n=e.memoizedProps,r=hs(n,i),s=vs(n.default,i.paired?n.share:n.enter);s!=="none"?Dl(e,r,s,null,!1)?(hh(e),i.paired||t||wl(e,n.onEnter)):qr(e.child,!1):hh(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)jg(e,t),e=e.sibling;else hh(e)}function Yg(e){if(yn!==null&&yn.size!==0){var t=yn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,n=i.name;if(n!=null&&n!=="auto"){var r=t.get(n);if(r!==void 0){var s=vs(i.default,i.share);if(s!=="none"&&(Dl(e,n,s,null,!1)?(s=e.stateNode,r.paired=s,s.paired=r,wl(e,i.onShare)):qr(e.child,!1)),t.delete(n),t.size===0)break}}}Yg(e)}e=e.sibling}}}function Vg(e){if(e.tag===30){var t=e.memoizedProps,i=hs(t,e.stateNode),n=yn!==null?yn.get(i):void 0,r=vs(t.default,n!==void 0?t.share:t.exit);r!=="none"&&(Dl(e,i,r,null,!1)?n!==void 0?(r=e.stateNode,n.paired=r,r.paired=n,yn.delete(i),wl(e,t.onShare)):wl(e,t.onExit):qr(e.child,!1)),yn!==null&&Yg(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Vg(e),e=e.sibling;else yn!==null&&Yg(e)}function Jx(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=hs(t,e.stateNode);t=vs(t.default,t.update),e.flags&=-5,t!=="none"&&Dl(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Jx(e);e=e.sibling}}function Xg(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,qr(e.child,!1))}Xg(e)}e=e.sibling}}function fh(e){if(e.tag===30)e.stateNode.paired=null,qr(e.child,!1),Xg(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)fh(e),e=e.sibling;else Xg(e)}function eE(e){for(e=e.child;e!==null;)e.tag===30?qr(e.child,!1):(e.subtreeFlags&33554432)!==0&&eE(e),e=e.sibling}function nv(e,t,i,n,r,s,a){for(var o=!1;t!==null;){if(t.tag===5){var l=t.stateNode;if(s!==null&&on<s.length){var c=s[on],u=h_(l);(c.view||u.view)&&(o=!0);var d;if(d=(e.flags&4)===0)if(u.clip)d=!0;else{d=c.rect;var h=u.rect;d=d.y!==h.y||d.x!==h.x||d.height!==h.height||d.width!==h.width}d&&(e.flags|=4),u.abs?u=!c.abs:(c=c.rect,u=u.rect,u=c.height!==u.height||c.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&zE(l,on===0?i:i+"_"+on,r),o&&(e.flags&4)!==0||(Lr===null&&(Lr=[]),Lr.push(l,on===0?n:n+"_"+on,t.memoizedProps)),on++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&a?e.flags|=t.flags&32:nv(e,t.child,i,n,r,s,a)&&(o=!0));t=t.sibling}return o}function tE(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,n=e.stateNode,r=hs(i,n),s=vs(i.default,i.update);if(t){n=n.clones;var a=n===null?null:n.map(D3)}else a=e.memoizedState,e.memoizedState=null;n=e;var o=e.child;on=0,r=nv(n,o,r,r,s,a,!1),(e.flags&4)!==0&&r&&(t||wl(e,i.onUpdate))}else(e.subtreeFlags&33554432)!==0&&tE(e,t);e=e.sibling}}var si=!1,Ze=!1,Mr=!1,Jm=!1,kw=typeof WeakSet=="function"?WeakSet:Set,ai=null,Or=!1,Nc=!1,qh=!1,Zg=!1;function r3(e,t,i){if(e=e.containerInfo,c_=Nl,e=U1(e),A_(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=e,f=null;t:for(;;){for(var p;h!==n||s!==0&&h.nodeType!==3||(l=o+s),h!==a||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++u===s&&(l=o),f===a&&++d===r&&(c=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(u_={focusedElem:e,selectionRange:n},Nl=!1,i=(i&335544064)===i,ai=t,t=i?9270:1024;ai!==null;){if(e=ai,i&&(n=e.deletions,n!==null))for(s=0;s<n.length;s++)i&&Vg(n[s]);if(e.alternate===null&&(e.flags&2)!==0)i&&xw(e),Vd(i);else{if(e.tag===22){if(n=e.alternate,e.memoizedState!==null){n!==null&&n.memoizedState===null&&i&&Vg(n),Vd(i);continue}else if(n!==null&&n.memoizedState!==null){i&&xw(e),Vd(i);continue}}n=e.child,(e.subtreeFlags&t)!==0&&n!==null?(n.return=e,ai=n):(i&&Jx(e),Vd(i))}}yn=null}function Vd(e){for(;ai!==null;){var t=ai,i=e,n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&n!==null){i=void 0,r=n.memoizedProps,n=n.memoizedState;var s=t.stateNode;try{var a=Ja(t.type,r);i=s.getSnapshotBeforeUpdate(a,n),s.__reactInternalSnapshotBeforeUpdate=i}catch(o){it(t,t.return,o)}}break;case 3:if((r&1024)!==0){if(n=t.stateNode.containerInfo,i=n.nodeType,i===9)f_(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":f_(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&n!==null&&(i=hs(n.memoizedProps,n.stateNode),r=t.memoizedProps,r=vs(r.default,r.update),r!=="none"&&Dl(n,i,r,n.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(F(163))}if(n=t.sibling,n!==null){n.return=t.return,ai=n;break}ai=t.return}}function iE(e,t,i){var n=i.flags;switch(i.tag){case 0:case 11:case 15:Rr(e,i),n&4&&hu(5,i);break;case 1:if(Rr(e,i),n&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(a){it(i,i.return,a)}else{var r=Ja(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){it(i,i.return,a)}}n&64&&Yx(i),n&512&&Dr(i,i.return);break;case 3:if(Rr(e,i),n&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{rx(e,t)}catch(a){it(i,i.return,a)}}break;case 27:t===null&&n&4&&Zx(i);case 26:case 5:Rr(e,i),t===null&&n&4&&Kg(i),n&512&&Dr(i,i.return);break;case 12:Rr(e,i);break;case 31:Rr(e,i),n&4&&aE(e,i);break;case 13:Rr(e,i),n&4&&oE(e,i),n&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=g3.bind(null,i),V3(e,i))));break;case 22:if(n=i.memoizedState!==null||si,!n){var s=t!==null&&t.memoizedState!==null||Ze;t=si,r=Ze,si=n,(Ze=s)&&!r?(n=2,(i.subtreeFlags&8772)!==0&&(n|=1),lr(e,i,n)):Rr(e,i),si=t,Ze=r}break;case 30:Rr(e,i),n&512&&Dr(i,i.return);break;case 7:n&512&&Dr(i,i.return);default:Rr(e,i)}}function Qg(e,t){for(e=e.child;e!==null;)nE(e,t),e=e.sibling}function nE(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var n=i.style;typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"}else{var r=e.stateNode,s=e.memoizedProps.style,a=s!=null&&s.hasOwnProperty("display")?s.display:null;r.style.display=a==null||typeof a=="boolean"?"":(""+a).trim()}}catch(l){it(e,e.return,l)}Jg(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Ke=!0}catch(l){it(e,e.return,l)}break;case 18:try{var o=e.stateNode;t?qw(o,!0):qw(e.stateNode,!1)}catch(l){it(e,e.return,l)}break;case 22:case 23:e.memoizedState===null&&Qg(e,t);break;default:Qg(e,t)}}function Jg(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,n=t;switch(i.tag){case 4:nE(i,n);break e;case 22:i.memoizedState===null&&Jg(i,n);break e;default:Jg(i,n)}}e=e.sibling}}function rE(e){var t=e.alternate;t!==null&&(e.alternate=null,rE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Zh(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 Tt=null,sn=!1;function or(e,t,i){for(i=i.child;i!==null;)sE(e,t,i),i=i.sibling}function sE(e,t,i){if(xn&&typeof xn.onCommitFiberUnmount=="function")try{xn.onCommitFiberUnmount(su,i)}catch{}switch(i.tag){case 26:Ze||Si(i,t),or(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!Ze&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Ze||Si(i,t),Pc(i);var n=Tt,r=sn;ga(i.type)&&(Tt=i.stateNode,sn=!1),or(e,t,i),GE(i.stateNode,i.type,i.memoizedProps),Tt=n,sn=r;break;case 5:Ze||Si(i,t),Pc(i);case 6:if(i.tag===6&&Pc(i),n=Tt,r=sn,Tt=null,or(e,t,i),Tt=n,sn=r,Tt!==null)if(sn)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(i.stateNode),Ke=!0}catch(s){it(i,t,s)}else try{Tt.removeChild(i.stateNode),Ke=!0}catch(s){it(i,t,s)}break;case 18:Tt!==null&&(sn?(e=Tt,Uw(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Al(e)):Uw(Tt,i.stateNode));break;case 4:n=Tt,r=sn,Tt=i.stateNode.containerInfo,sn=!0,or(e,t,i),Tt=n,sn=r;break;case 0:case 11:case 14:case 15:fa(2,i,t),Ze||fa(4,i,t),or(e,t,i);break;case 1:Ze||(Si(i,t),n=i.stateNode,typeof n.componentWillUnmount=="function"&&Vx(i,t,n)),or(e,t,i);break;case 21:or(e,t,i);break;case 22:Ze=(n=Ze)||i.memoizedState!==null,or(e,t,i),Ze=n;break;case 30:Si(i,t),or(e,t,i);break;case 7:Ze||Si(i,t),or(e,t,i);break;default:or(e,t,i)}}function aE(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Al(e)}catch(i){it(t,t.return,i)}}}function oE(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Al(e)}catch(i){it(t,t.return,i)}}function s3(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new kw),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new kw),t;default:throw Error(F(435,e.tag))}}function Xd(e,t){var i=s3(e);t.forEach(function(n){if(!i.has(n)){i.add(n);var r=_3.bind(null,e,n);n.then(r,r)}})}function Yi(e,t,i){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r],a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(ga(l.type)){Tt=l.stateNode,sn=!1;break e}break;case 5:Tt=l.stateNode,sn=!1;break e;case 3:case 4:Tt=l.stateNode.containerInfo,sn=!0;break e}l=l.return}if(Tt===null)throw Error(F(160));sE(a,o,s),Tt=null,sn=!1,a=s.alternate,a!==null&&(a.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)lE(t,e,i),t=t.sibling}var cr=null;function lE(e,t,i){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(n=e.updateQueue,n=n!==null?n.events:null,n!==null))for(var s=0;s<n.length;s++){var a=n[s];a.ref.impl=a.nextImpl}Yi(t,e,i),Vi(e),r&4&&(fa(3,e,e.return),hu(3,e),fa(5,e,e.return));break;case 1:Yi(t,e,i),Vi(e),r&512&&(Ze||n===null||Si(n,n.return)),r&64&&si&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(s=cr,Yi(t,e,i),Vi(e),r&512&&(Ze||n===null||Si(n,n.return)),r&4)if(r=n!==null?n.memoizedState:null,i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null)if(si)e.stateNode=IE(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,r=s.ownerDocument||s;t:switch(t){case"title":n=r.getElementsByTagName("title")[0],(!n||n[lu]||n[wi]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=r.createElement(t),r.head.insertBefore(n,r.querySelector("head > title"))),Ci(n,t,i),n[wi]=e,oi(n),t=n;break e;case"link":if(s=Vw("link","href",r).get(t+(i.href||""))){for(a=0;a<s.length;a++)if(n=s[a],n.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&n.getAttribute("rel")===(i.rel==null?null:i.rel)&&n.getAttribute("title")===(i.title==null?null:i.title)&&n.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){s.splice(a,1);break t}}n=r.createElement(t),Ci(n,t,i),r.head.appendChild(n);break;case"meta":if(s=Vw("meta","content",r).get(t+(i.content||""))){for(a=0;a<s.length;a++)if(n=s[a],n.getAttribute("content")===(i.content==null?null:""+i.content)&&n.getAttribute("name")===(i.name==null?null:i.name)&&n.getAttribute("property")===(i.property==null?null:i.property)&&n.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&n.getAttribute("charset")===(i.charSet==null?null:i.charSet)){s.splice(a,1);break t}}n=r.createElement(t),Ci(n,t,i),r.head.appendChild(n);break;default:throw Error(F(468,t))}n[wi]=e,oi(n),t=n}e.stateNode=t}else si||g_(s,e.type,e.stateNode);else e.stateNode=Yw(s,i,e.memoizedProps);else r!==i?(r===null?(t=n.stateNode,t===null||Ze||t.parentNode.removeChild(t)):r.count--,i===null?si||g_(s,e.type,e.stateNode):Yw(s,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Zm(e,e.memoizedProps,n.memoizedProps);break;case 27:Yi(t,e,i),Vi(e),r&512&&(Ze||n===null||Si(n,n.return)),n!==null&&r&4&&Zm(e,e.memoizedProps,n.memoizedProps);break;case 5:if(s=Mr,Mr=!1,Yi(t,e,i),Mr=s,Vi(e),r&512&&(Ze||n===null||Si(n,n.return)),e.flags&32){t=e.stateNode;try{bl(t,""),Ke=!0}catch(u){it(e,e.return,u)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,Zm(e,t,n!==null?n.memoizedProps:t)),r&1024&&(Jm=!0);break;case 6:if(Yi(t,e,i),Vi(e),r&4){if(e.stateNode===null)throw Error(F(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,Ke=!0}catch(u){it(e,e.return,u)}}break;case 3:if(Ke=!1,_h=null,s=cr,cr=eu(t.containerInfo),Yi(t,e,i),cr=s,Vi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Al(t.containerInfo)}catch(u){it(e,e.return,u)}Jm&&(Jm=!1,cE(e)),Ke=!1;break;case 4:r=Mr,Mr=si,n=OS(),s=cr,cr=eu(e.stateNode.containerInfo),Yi(t,e,i),Vi(e),cr=s,Ke&&Nc&&(qh=!0),Ke=n,Mr=r;break;case 12:Yi(t,e,i),Vi(e);break;case 31:Yi(t,e,i),Vi(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Xd(e,t)));break;case 13:Yi(t,e,i),Vi(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(df=wn()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Xd(e,t)));break;case 22:s=e.memoizedState!==null,a=n!==null&&n.memoizedState!==null;var o=si,l=Ze,c=Mr;si=o||s,Mr=c||s,Ze=l||a,Yi(t,e,i),Ze=l,Mr=c,si=o,Vi(e),r&8192&&(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,!s||n===null||a||si||Ze||(t=a||Ze,i=si,n=Ze,si=s||si,Ze=t,Ws(e,2),si=i,Ze=n),!s&&Mr||Qg(e,s)),r&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,Xd(e,i))));break;case 19:Yi(t,e,i),Vi(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Xd(e,t)));break;case 30:r&512&&(Ze||n===null||Si(n,n.return)),r=OS(),s=Nc,a=(i&335544064)===i,o=e.memoizedProps,Nc=a&&vs(o.default,o.update)!=="none",Yi(t,e,i),Vi(e),a&&n!==null&&Ke&&(e.flags|=4),Nc=s,Ke=r;break;case 21:break;case 7:r&512&&(Ze||n===null||Si(n,n.return)),n&&n.stateNode!==null&&(n.stateNode._fragmentFiber=e);default:Yi(t,e,i),Vi(e)}}function Vi(e){var t=e.flags;if(t&2){try{for(var i,n=e.return;n!==null;){if(Xx(n)){i=n;break}n=n.return}n=null;for(var r=e.return;r!==null;){if(iv(r)){var s=r.stateNode;n===null?n=[s]:n.push(s)}if(tv(r))break;r=r.return}var a=n;if(i==null)throw Error(F(160));switch(i.tag){case 27:var o=i.stateNode,l=Qm(e);Hh(e,l,o,a);break;case 5:var c=i.stateNode;i.flags&32&&(bl(c,""),i.flags&=-33);var u=Qm(e);Hh(e,u,c,a);break;case 3:case 4:var d=i.stateNode.containerInfo,h=Qm(e);Gg(e,h,d,a);break;default:throw Error(F(161))}}catch(f){it(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function cE(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;cE(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Nl=!0,t.reset(),Nl=!1),e=e.sibling}}function Ko(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)uE(t,e),t=t.sibling;else tE(t,!1)}function uE(e,t){var i=e.alternate;if(i===null)jg(e,!1);else switch(e.tag){case 3:if(Zg=Or=!1,Ew(),Ko(t,e),!Or&&!qh){if(e=Lr,e!==null)for(var n=0;n<e.length;n+=3){i=e[n];var r=e[n+1];BE(i,e[n+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Zg=!0}Lr=null;break;case 5:Ko(t,e);break;case 4:n=Or,Or=!1,Ko(t,e),Or&&(qh=!0),Or=n;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?jg(e,!1):Ko(t,e));break;case 30:n=Or,r=Ew(),Or=!1,Ko(t,e),Or&&(e.flags|=4);var s=e.memoizedProps,a=e.stateNode;t=hs(s,a),a=hs(i.memoizedProps,a);var o=vs(s.default,s.update);o==="none"?t=!1:(s=i.memoizedState,i.memoizedState=null,i=e.child,on=0,t=nv(e,i,t,a,o,s,!0),on!==(s===null?0:s.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(wl(e,e.memoizedProps.onUpdate),Lr=r):r!==null&&(r.push.apply(r,Lr),Lr=r),Or=(e.flags&32)!==0?!0:n;break;default:Ko(t,e)}}function Rr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)iE(e,t.alternate,t),t=t.sibling}function Ws(e,t){for(e=e.child;e!==null;){var i=e,n=t;switch(i.tag){case 0:case 11:case 14:case 15:fa(4,i,i.return),Ws(i,n);break;case 1:Si(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&Vx(i,i.return,r),Ws(i,n);break;case 27:(n&2)!==0&&GE(i.stateNode,i.type,i.memoizedProps);case 5:Si(i,i.return),i.tag!==5&&i.tag!==27||Pc(i),Ws(i,n);break;case 6:Pc(i);break;case 26:Si(i,i.return),r=i.stateNode,i.memoizedState!==null||r===null||Ze||r.parentNode.removeChild(r),Ws(i,n);break;case 22:i.memoizedState===null&&Ws(i,n);break;case 30:Si(i,i.return),Ws(i,n);break;case 7:Si(i,i.return);default:Ws(i,n)}e=e.sibling}}function lr(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var n=t.alternate,r=e,s=t,a=s.flags,o=(i&1)!==0;switch(s.tag){case 0:case 11:case 15:lr(r,s,i),hu(4,s);break;case 1:if(lr(r,s,i),n=s,r=n.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){it(n,n.return,u)}if(n=s,r=n.updateQueue,r!==null){var l=n.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)nx(c[r],l)}catch(u){it(n,n.return,u)}}o&&a&64&&Yx(s),Dr(s,s.return);break;case 27:(i&2)!==0&&Zx(s);case 5:s.tag!==5&&s.tag!==27||ww(s),lr(r,s,i),o&&n===null&&a&4&&Kg(s),Dr(s,s.return);break;case 6:ww(s);break;case 26:l=s.stateNode,s.memoizedState!==null||l===null||si||g_(eu(l.ownerDocument),s.type,l),lr(r,s,i),o&&n===null&&a&4&&Kg(s),Dr(s,s.return);break;case 12:lr(r,s,i);break;case 31:lr(r,s,i),o&&a&4&&aE(r,s);break;case 13:lr(r,s,i),o&&a&4&&oE(r,s);break;case 22:s.memoizedState===null&&lr(r,s,i),Dr(s,s.return);break;case 30:lr(r,s,i),Dr(s,s.return);break;case 7:Dr(s,s.return);default:lr(r,s,i)}t=t.sibling}}function rv(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&uu(i))}function sv(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&uu(e))}function Un(e,t,i,n){var r=(i&335544064)===i;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)dE(e,t,i,n),t=t.sibling;else r&&eE(t)}function dE(e,t,i,n){var r=(i&335544064)===i;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&fh(t);var s=t.flags;switch(t.tag){case 0:case 11:case 15:Un(e,t,i,n),s&2048&&hu(9,t);break;case 1:Un(e,t,i,n);break;case 3:Un(e,t,i,n),r&&Zg&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),s&2048&&(s=null,t.alternate!==null&&(s=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==s&&(t.refCount++,s!=null&&uu(s)));break;case 12:if(s&2048){Un(e,t,i,n),s=t.stateNode;try{var a=t.memoizedProps,o=a.id,l=a.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(c){it(t,t.return,c)}}else Un(e,t,i,n);break;case 31:Un(e,t,i,n);break;case 13:Un(e,t,i,n);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState!==null?(r&&o!==null&&o.memoizedState===null&&fh(o),a._visibility&2?Un(e,t,i,n):Hc(e,t)):(r&&o!==null&&o.memoizedState!==null&&fh(t),a._visibility&2?Un(e,t,i,n):(a._visibility|=2,jo(e,t,i,n,(t.subtreeFlags&10256)!==0||!1))),s&2048&&rv(o,t);break;case 24:Un(e,t,i,n),s&2048&&sv(t.alternate,t);break;case 30:r&&(s=t.alternate,s!==null&&(qr(s.child,!0),qr(t.child,!0))),Un(e,t,i,n);break;default:Un(e,t,i,n)}}function jo(e,t,i,n,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,a=t,o=i,l=n,c=a.flags;switch(a.tag){case 0:case 11:case 15:jo(s,a,o,l,r),hu(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?jo(s,a,o,l,r):Hc(s,a):(u._visibility|=2,jo(s,a,o,l,r)),r&&c&2048&&rv(a.alternate,a);break;case 24:jo(s,a,o,l,r),r&&c&2048&&sv(a.alternate,a);break;default:jo(s,a,o,l,r)}t=t.sibling}}function Hc(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,n=t,r=n.flags;switch(n.tag){case 22:Hc(i,n),r&2048&&rv(n.alternate,n);break;case 24:Hc(i,n),r&2048&&sv(n.alternate,n);break;default:Hc(i,n)}t=t.sibling}}var Ha=8192;function za(e,t,i){if(e.subtreeFlags&Ha)for(e=e.child;e!==null;)hE(e,t,i),e=e.sibling}function hE(e,t,i){switch(e.tag){case 26:za(e,t,i),e.flags&Ha&&(e.memoizedState!==null?cI(i,cr,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Zw(i,e)));break;case 5:za(e,t,i),e.flags&Ha&&(e=e.stateNode,(t&335544128)===t&&Zw(i,e));break;case 3:case 4:var n=cr;cr=eu(e.stateNode.containerInfo),za(e,t,i),cr=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Ha,Ha=16777216,za(e,t,i),Ha=n):za(e,t,i));break;case 30:if((e.flags&Ha)!==0&&(n=e.memoizedProps.name,n!=null&&n!=="auto")){var r=e.stateNode;r.paired=null,yn===null&&(yn=new Map),yn.set(n,r)}za(e,t,i);break;default:za(e,t,i)}}function fE(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 Sc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var n=t[i];ai=n,mE(n,e)}fE(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)pE(e),e=e.sibling}function pE(e){switch(e.tag){case 0:case 11:case 15:Sc(e),e.flags&2048&&fa(9,e,e.return);break;case 3:Sc(e);break;case 12:Sc(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ph(e)):Sc(e);break;default:Sc(e)}}function ph(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var n=t[i];ai=n,mE(n,e)}fE(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:fa(8,t,t.return),ph(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,ph(t));break;default:ph(t)}e=e.sibling}}function mE(e,t){for(;ai!==null;){var i=ai;switch(i.tag){case 0:case 11:case 15:fa(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var n=i.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:uu(i.memoizedState.cache)}if(n=i.child,n!==null)n.return=i,ai=n;else e:for(i=e;ai!==null;){n=ai;var r=n.sibling,s=n.return;if(rE(n),n===i){ai=null;break e}if(r!==null){r.return=s,ai=r;break e}ai=s}}}var a3={getCacheForType:function(e){var t=xi(Wt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return xi(Wt).controller.signal}},o3=typeof WeakMap=="function"?WeakMap:Map,je=0,ct=null,He=null,Ue=0,et=0,_n=null,Zs=!1,Ll=!1,av=!1,gs=0,Lt=0,pa=0,Ga=0,Fh=0,Sn=0,Sl=0,Uc=null,an=null,e_=!1,df=0,gE=0,$h=1/0,Wh=null,aa=null,Mt=0,dr=null,eo=null,Ur=0,t_=0,i_=null,_E=null,pl=null,ml=null,gl=null,qc=0,mh=null;function kn(){return(je&2)!==0&&Ue!==0?Ue&-Ue:Se.T!==null?lv():S1()}function vE(){if(Sn===0)if((Ue&536870912)===0||Le){var e=Bd;Bd<<=1,(Bd&3932160)===0&&(Bd=262144),Sn=e}else Sn=536870912;return e=Ti.current,e!==null&&(e.flags|=32),Sn}function wl(e,t){if(t!=null){var i=e.stateNode,n=i.ref;n===null&&(n=i.ref=HE(hs(e.memoizedProps,i))),ml===null&&(ml=[]),ml.push(t.bind(null,n))}}function cn(e,t,i){(e===ct&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(xl(e,0),Qs(e,Ue,Sn,!1)),ou(e,i),((je&2)===0||e!==ct)&&(e===ct&&((je&2)===0&&(Ga|=i),Lt===4&&Qs(e,Ue,Sn,!1)),$r(e))}function bE(e,t,i){if((je&6)!==0)throw Error(F(327));var n=!i&&(t&127)===0&&(t&e.expiredLanes)===0||au(e,t),r=n?u3(e,t):eg(e,t,!0),s=n;do{if(r===0){Ll&&!n&&Qs(e,t,0,!1);break}else{if(i=e.current.alternate,s&&!l3(i)){r=eg(e,t,!1),s=!1;continue}if(r===2){if(s=t,e.errorRecoveryDisabledLanes&s)var a=0;else a=e.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){t=a;e:{var o=e;r=Uc;var l=o.current.memoizedState.isDehydrated;if(l&&(xl(o,a).flags|=256),a=eg(o,a,!1),a!==2&&a!==6){if(av&&!l){o.errorRecoveryDisabledLanes|=s,Ga|=s,r=4;break e}s=an,an=r,s!==null&&(an===null?an=s:an.push.apply(an,s))}r=a}if(s=!1,r!==2)continue}}if(r===1){xl(e,0),Qs(e,t,0,!0);break}e:{switch(n=e,s=r,s){case 0:case 1:throw Error(F(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Qs(n,t,Sn,!Zs);break e;case 2:an=null;break;case 3:case 5:break;default:throw Error(F(329))}if((t&62914560)===t&&(r=df+300-wn(),10<r)){if(Qs(n,t,Sn,!Zs),Xh(n,0,!0)!==0)break e;Ur=t,n.timeoutHandle=uv(Cw.bind(null,n,i,an,Wh,e_,t,Sn,Ga,Sl,Zs,s,"Throttled",-0,0),r);break e}Cw(n,i,an,Wh,e_,t,Sn,Ga,Sl,Zs,s,null,-0,0)}}break}while(!0);$r(e)}function Cw(e,t,i,n,r,s,a,o,l,c,u,d,h,f){e.timeoutHandle=-1;var p=t.subtreeFlags,_=(s&335544064)===s;if(d=null,(_||p&8192||(p&16785408)===16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zr},yn=null,hE(t,s,d),_&&(p=d,_=e.containerInfo,_=(_.nodeType===9?_:_.ownerDocument).__reactViewTransition,_!=null&&(p.count++,p.waitingForViewTransition=!0,p=tu.bind(p),_.finished.then(p,p))),p=(s&62914560)===s?df-wn():(s&4194048)===s?gE-wn():0,p=uI(d,p),p!==null)){Ur=s,e.cancelPendingCommit=p(Nw.bind(null,e,t,s,i,n,r,a,o,l,c,u,d,null,h,f)),Qs(e,s,a,!c);return}Nw(e,t,s,i,n,r,a,o,l,c,u,d)}function l3(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var n=0;n<i.length;n++){var r=i[n],s=r.getSnapshot;r=r.value;try{if(!Cn(s(),r))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 Qs(e,t,i,n){t=g1(e,t),t&=~Fh,t&=~Ga,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var r=t;0<r;){var s=31-En(r),a=1<<s;n[s]=-1,r&=~a}i!==0&&v1(e,i,t)}function hf(){return(je&6)===0?(fu(0,!1),!1):!0}function ov(){if(He!==null){if(et===0)var e=He.return;else e=He,ls=so=null,W_(e),dl=null,Yc=0,e=He;for(;e!==null;)jx(e.alternate,e),e=e.return;He=null}}function xl(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,M3(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Ur=0,ov(),ct=e,He=i=cs(e.current,null),Ue=t,et=0,_n=null,Zs=!1,Ll=au(e,t),av=!1,Sl=Sn=Fh=Ga=pa=Lt=0,an=Uc=null,e_=!1,gs=g1(e,t),tf(),i}function yE(e,t){Ae=null,Se.H=zh,t===Rl||t===sf?(t=JS(),et=3):t===z_?(t=JS(),et=4):et=t===Q_?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,_n=t,He===null&&(Lt=1,Bh(e,Kn(t,e.current)))}function SE(){var e=Ti.current;return e===null?!0:(Ue&4194048)===Ue?Bi===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?e===Bi:!1}function wE(){var e=Se.H;return Se.H=zh,e===null?zh:e}function xE(){var e=Se.A;return Se.A=a3,e}function Kh(){Lt=4,Zs||(Ue&4194048)!==Ue&&Ti.current!==null||(Ll=!0),(pa&134217727)===0&&(Ga&134217727)===0||ct===null||Qs(ct,Ue,Sn,!1)}function eg(e,t,i){var n=je;je|=2;var r=wE(),s=xE();(ct!==e||Ue!==t)&&(Wh=null,xl(e,t)),t=!1;var a=Lt;e:do try{if(et!==0&&He!==null){var o=He,l=_n;switch(et){case 8:ov(),a=6;break e;case 3:case 2:case 9:case 6:Ti.current===null&&(t=!0);var c=et;if(et=0,_n=null,al(e,o,l,c),i&&Ll){a=0;break e}break;default:c=et,et=0,_n=null,al(e,o,l,c)}}c3(),a=Lt;break}catch(u){yE(e,u)}while(!0);return t&&e.shellSuspendCounter++,ls=so=null,je=n,Se.H=r,Se.A=s,He===null&&(ct=null,Ue=0,tf()),a}function c3(){for(;He!==null;)EE(He)}function u3(e,t){var i=je;je|=2;var n=wE(),r=xE();ct!==e||Ue!==t?(Wh=null,$h=wn()+500,xl(e,t)):Ll=au(e,t);e:do try{if(et!==0&&He!==null){t=He;var s=_n;t:switch(et){case 1:et=0,_n=null,al(e,t,s,1);break;case 2:case 9:if(QS(s)){et=0,_n=null,Tw(t);break}t=function(){et!==2&&et!==9||ct!==e||(et=7),$r(e)},s.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:QS(s)?(et=0,_n=null,Tw(t)):(et=0,_n=null,al(e,t,s,7));break;case 5:var a=null;switch(He.tag){case 26:a=He.memoizedState;case 5:case 27:var o=He;if(a?VE(a):o.stateNode.complete){et=0,_n=null;var l=o.sibling;if(l!==null)He=l;else{var c=o.return;c!==null?(He=c,ff(c)):He=null}break t}}et=0,_n=null,al(e,t,s,5);break;case 6:et=0,_n=null,al(e,t,s,6);break;case 8:ov(),Lt=6;break e;default:throw Error(F(462))}}d3();break}catch(u){yE(e,u)}while(!0);return ls=so=null,Se.H=n,Se.A=r,je=i,He!==null?0:(ct=null,Ue=0,tf(),Lt)}function d3(){for(;He!==null&&!ND();)EE(He)}function EE(e){var t=Gx(e.alternate,e,gs);e.memoizedProps=e.pendingProps,t===null?ff(e):He=t}function Tw(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=mw(i,t,t.pendingProps,t.type,void 0,Ue);break;case 11:t=mw(i,t,t.pendingProps,t.type.render,t.ref,Ue);break;case 5:W_(t);var n=t;n===li&&(Le?(Ah(n),n.tag===5&&n.stateNode!=null&&(_t=n.stateNode)):(Ah(n),Le=!0));default:jx(i,t),t=He=Y1(t,gs),t=Gx(i,t,gs)}e.memoizedProps=e.pendingProps,t===null?ff(e):He=t}function al(e,t,i,n){ls=so=null,W_(t),dl=null,Yc=0;var r=t.return;try{if(QL(e,r,t,i,Ue)){Lt=1,Bh(e,Kn(i,e.current)),He=null;return}}catch(s){if(r!==null)throw He=r,s;Lt=1,Bh(e,Kn(i,e.current)),He=null;return}t.flags&32768?(Le||n===1?e=!0:Ll||(Ue&536870912)!==0?e=!1:(Zs=e=!0,(n===2||n===9||n===3||n===6)&&(n=Ti.current,n!==null&&n.tag===13&&(n.flags|=16384))),kE(t,e)):ff(t)}function ff(e){var t=e;do{if((t.flags&32768)!==0){kE(t,Zs);return}e=t.return;var i=i3(t.alternate,t,gs);if(i!==null){He=i;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);Lt===0&&(Lt=5)}function kE(e,t){do{var i=n3(e.alternate,e);if(i!==null){i.flags&=32767,He=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){He=e;return}He=e=i}while(e!==null);Lt=6,He=null}function Nw(e,t,i,n,r,s,a,o,l,c,u,d){e.cancelPendingCommit=null;do pf();while(Mt!==0);if((je&6)!==0)throw Error(F(327));if(t!==null){if(t===e.current)throw Error(F(177));e===ct&&(He=ct=null,Ue=0),eo=t,dr=e,Ur=i,i_=r,_E=n,h3(e,t,i,a,o,l,d)}}function h3(e,t,i,n,r,s,a){var o=t.lanes|t.childLanes;if(t_=o,o|=M_,PD(e,i,o,n,r,s),ml=null,(i&335544064)===i?(gl=UL(e),n=10262):(gl=null,n=10256),(t.subtreeFlags&n)!==0||(t.flags&n)!==0?(e.callbackNode=null,e.callbackPriority=0,v3(Eh,function(){return a_(),null})):(e.callbackNode=null,e.callbackPriority=0),Uh=!1,n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=Se.T,Se.T=null,r=Ye.p,Ye.p=2,s=je,je|=4;try{r3(e,t,i)}finally{je=s,Ye.p=r,Se.T=n}}Mt=1,Uh?pl=z3(a,e.containerInfo,gl,n_,r_,p3,s_,a_,f3,null,null):(n_(),r_(),s_())}function f3(e){if(Mt!==0){var t=dr.onRecoverableError;t(e,{componentStack:null})}}function p3(){Mt===3&&(Mt=0,uE(eo,dr),Mt=4)}function n_(){if(Mt===1){Mt=0;var e=dr,t=eo,i=Ur,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=Se.T,Se.T=null;var r=Ye.p;Ye.p=2;var s=je;je|=4;try{Nc=qh=!1,lE(t,e,i),i=u_;var a=U1(e.containerInfo),o=i.focusedElem,l=i.selectionRange;if(a!==o&&o&&o.ownerDocument&&H1(o.ownerDocument.documentElement,o)){if(l!==null&&A_(o)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var d=o.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var f=h.getSelection(),p=o.textContent.length,_=Math.min(l.start,p),y=l.end===void 0?_:Math.min(l.end,p);!f.extend&&_>y&&(a=y,y=_,_=a);var m=WS(o,_),v=WS(o,y);if(m&&v&&(f.rangeCount!==1||f.anchorNode!==m.node||f.anchorOffset!==m.offset||f.focusNode!==v.node||f.focusOffset!==v.offset)){var b=d.createRange();b.setStart(m.node,m.offset),f.removeAllRanges(),_>y?(f.addRange(b),f.extend(v.node,v.offset)):(b.setEnd(v.node,v.offset),f.addRange(b))}}}}for(d=[],f=o;f=f.parentNode;)f.nodeType===1&&d.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<d.length;o++){var w=d[o];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Nl=!!c_,u_=c_=null}finally{je=s,Ye.p=r,Se.T=n}}e.current=t,Mt=2}}function r_(){if(Mt===2){Mt=0;var e=dr,t=eo,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=Se.T,Se.T=null;var n=Ye.p;Ye.p=2;var r=je;je|=4;try{iE(e,t.alternate,t)}finally{je=r,Ye.p=n,Se.T=i}}Mt=3}}function s_(){if(Mt===4||Mt===3){Mt=0;var e=pl;pl=null,AD();var t=dr,i=eo,n=Ur,r=_E,s=(n&335544064)===n?10262:10256;if((i.subtreeFlags&s)!==0||(i.flags&s)!==0?Mt=5:(Mt=0,eo=dr=null,CE(t,t.pendingLanes)),s=t.pendingLanes,s===0&&(aa=null),x_(n),i=i.stateNode,xn&&typeof xn.onCommitFiberRoot=="function")try{xn.onCommitFiberRoot(su,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=Se.T,s=Ye.p,Ye.p=2,Se.T=null;try{for(var a=t.onRecoverableError,o=0;o<r.length;o++){var l=r[o];a(l.value,{componentStack:l.stack})}}finally{Se.T=i,Ye.p=s}}if(r=ml,a=gl,gl=null,r!==null&&(ml=null,a===null&&(a=[]),e!==null))for(l=0;l<r.length;l++)i=(0,r[l])(a),i!==void 0&&e.finished.finally(i);(Ur&3)!==0&&pf(),$r(t),s=t.pendingLanes,(n&261930)!==0&&(s&42)!==0?t===mh?qc++:(qc=0,mh=t):(qc=0,mh=null),fu(0,!1)}}function CE(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,uu(t)))}function pf(){return pl!==null&&(pl.skipTransition(),pl=null),n_(),r_(),s_(),a_()}function a_(){if(Mt!==5)return!1;var e=dr,t=t_;t_=0;var i=x_(Ur),n=Se.T,r=Ye.p;try{Ye.p=32>i?32:i,Se.T=null,i=i_,i_=null;var s=dr,a=Ur;if(Mt=0,eo=dr=null,Ur=0,(je&6)!==0)throw Error(F(331));var o=je;if(je|=4,pE(s.current),dE(s,s.current,a,i),je=o,fu(0,!1),xn&&typeof xn.onPostCommitFiberRoot=="function")try{xn.onPostCommitFiberRoot(su,s)}catch{}return!0}finally{Ye.p=r,Se.T=n,CE(e,t)}}function Aw(e,t,i){t=Kn(i,t),t=Hg(e.stateNode,t,2),e=na(e,t,2),e!==null&&(ou(e,2),$r(e))}function it(e,t,i){if(e.tag===3)Aw(e,e,i);else for(;t!==null;){if(t.tag===3){Aw(t,e,i);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(aa===null||!aa.has(n))){e=Kn(i,e),i=qx(2),n=na(t,i,2),n!==null&&(Fx(i,n,t,e),ou(n,2),$r(n));break}}t=t.return}}function tg(e,t,i){var n=e.pingCache;if(n===null){n=e.pingCache=new o3;var r=new Set;n.set(t,r)}else r=n.get(t),r===void 0&&(r=new Set,n.set(t,r));r.has(i)||(av=!0,r.add(i),e=m3.bind(null,e,t,i),t.then(e,e))}function m3(e,t,i){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ct===e&&(Ue&i)===i&&((Lt===4||Lt===3&&(Ue&62914560)===Ue&&300>wn()-df)&&(je&2)===0?xl(e,0):Fh|=i,Sl===Ue&&(Sl=0)),$r(e)}function TE(e,t){t===0&&(t=_1()),e=ro(e,t),e!==null&&(ou(e,t),$r(e))}function g3(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),TE(e,i)}function _3(e,t){var i=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(F(314))}n!==null&&n.delete(t),TE(e,i)}function v3(e,t){return S_(e,t)}var El=null,Yo=null,o_=!1,Gh=!1,ig=!1,Js=0;function $r(e){e!==Yo&&e.next===null&&(Yo===null?El=Yo=e:Yo=Yo.next=e),Gh=!0,o_||(o_=!0,y3())}function fu(e,t){if(!ig&&Gh){ig=!0;do for(var i=!1,n=El;n!==null;){if(!t)if(e!==0){var r=n.pendingLanes;if(r===0)var s=0;else{var a=n.suspendedLanes,o=n.pingedLanes;s=(1<<31-En(42|e)+1)-1,s&=r&~(a&~o),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(i=!0,Mw(n,s))}else s=Ue,s=Xh(n,n===ct?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(s&3)===0||au(n,s)||(i=!0,Mw(n,s));n=n.next}while(i);ig=!1}}function b3(){NE()}function NE(){Gh=o_=!1;var e=0;Js!==0&&A3()&&(e=Js);for(var t=wn(),i=null,n=El;n!==null;){var r=n.next,s=AE(n,t);s===0?(n.next=null,i===null?El=r:i.next=r,r===null&&(Yo=i)):(i=n,(e!==0||(s&3)!==0)&&(Gh=!0)),n=r}Mt!==0&&Mt!==5||fu(e,!1),Js!==0&&(Js=0)}function AE(e,t){for(var i=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var a=31-En(s),o=1<<a,l=r[a];l===-1?((o&i)===0||(o&n)!==0)&&(r[a]=BD(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}if(t=ct,i=Ue,i=Xh(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,i===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Lm(n),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||au(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(n!==null&&Lm(n),x_(i)){case 2:case 8:i=p1;break;case 32:i=Eh;break;case 268435456:i=m1;break;default:i=Eh}return n=ME.bind(null,e),i=S_(i,n),e.callbackPriority=t,e.callbackNode=i,t}return n!==null&&n!==null&&Lm(n),e.callbackPriority=2,e.callbackNode=null,2}function ME(e,t){if(Mt!==0&&Mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(pf()&&e.callbackNode!==i)return null;var n=Ue;return n=Xh(e,e===ct?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(bE(e,n,t),AE(e,wn()),e.callbackNode!=null&&e.callbackNode===i?ME.bind(null,e):null)}function Mw(e,t){if(pf())return null;bE(e,t,!0)}function y3(){O3(function(){(je&6)!==0?S_(f1,b3):NE()})}function lv(){if(Js===0){var e=Xa;e===0&&(e=zd,zd<<=1,(zd&261888)===0&&(zd=256)),Js=e}return Js}function Ow(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:nh(e)}function S3(e,t,i,n,r){if(t==="submit"&&i&&i.stateNode===r){var s=Ow((r[dn]||null).action),a=n.submitter;a&&(t=(t=a[dn]||null)?Ow(t.formAction):a.getAttribute("formAction"),t!==null&&(s=t,a=null));var o=new Qh("action","action",null,n,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Js!==0){var l=new FormData(r,a);Bg(i,{pending:!0,data:l,method:r.method,action:s},null,l)}}else typeof s=="function"&&(o.preventDefault(),l=new FormData(r,a),Bg(i,{pending:!0,data:l,method:r.method,action:s},s,l))},currentTarget:r}]})}}for(Zd=0;Zd<Cg.length;Zd++)Qd=Cg[Zd],Rw=Qd.toLowerCase(),Dw=Qd[0].toUpperCase()+Qd.slice(1),hr(Rw,"on"+Dw);var Qd,Rw,Dw,Zd;hr(F1,"onAnimationEnd");hr($1,"onAnimationIteration");hr(W1,"onAnimationStart");hr("dblclick","onDoubleClick");hr("focusin","onFocus");hr("focusout","onBlur");hr(RL,"onTransitionRun");hr(DL,"onTransitionStart");hr(LL,"onTransitionCancel");hr(K1,"onTransitionEnd");vl("onMouseEnter",["mouseout","mouseover"]);vl("onMouseLeave",["mouseout","mouseover"]);vl("onPointerEnter",["pointerout","pointerover"]);vl("onPointerLeave",["pointerout","pointerover"]);io("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));io("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));io("onBeforeInput",["compositionend","keypress","textInput","paste"]);io("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));io("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));io("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zc="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(" "),w3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zc));function OE(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var n=e[i],r=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var a=n.length-1;0<=a;a--){var o=n[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&r.isPropagationStopped())break e;s=o,r.currentTarget=c;try{s(r)}catch(u){Ch(u)}r.currentTarget=null,s=l}else for(a=0;a<n.length;a++){if(o=n[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==s&&r.isPropagationStopped())break e;s=o,r.currentTarget=c;try{s(r)}catch(u){Ch(u)}r.currentTarget=null,s=l}}}}function Pe(e,t){var i=t[TS];i===void 0&&(i=t[TS]=new Set);var n=e+"__bubble";i.has(n)||(RE(t,e,2,!1),i.add(n))}function ng(e,t,i){var n=0;t&&(n|=4),RE(i,e,n,t)}var Jd="_reactListening"+Math.random().toString(36).slice(2);function cv(e){if(!e[Jd]){e[Jd]=!0,x1.forEach(function(i){i!=="selectionchange"&&(w3.has(i)||ng(i,!1,e),ng(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jd]||(t[Jd]=!0,ng("selectionchange",!1,t))}}function RE(e,t,i,n){switch(ik(t)){case 2:var r=pI;break;case 8:r=mI;break;default:r=gv}i=r.bind(null,t,i,e),r=void 0,!wg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),n?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function rg(e,t,i,n,r){var s=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var o=n.stateNode.containerInfo;if(o===r)break;if(a===4)for(a=n.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;o!==null;){if(a=Ua(o),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){n=s=a;continue e}o=o.parentNode}}n=n.return}O1(function(){var c=s,u=k_(i),d=[];e:{var h=G1.get(e);if(h!==void 0){var f=Qh,p=e;switch(e){case"keypress":if(sh(i)===0)break e;case"keydown":case"keyup":f=lL;break;case"focusin":p="focus",f=Um;break;case"focusout":p="blur",f=Um;break;case"beforeblur":case"afterblur":f=Um;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=IS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=XD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=fL;break;case F1:case $1:case W1:f=JD;break;case K1:f=mL;break;case"scroll":case"scrollend":f=YD;break;case"wheel":f=_L;break;case"copy":case"cut":case"paste":f=tL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=BS;break;case"submit":f=dL;break;case"toggle":case"beforetoggle":f=bL}var _=(t&4)!==0,y=!_&&(e==="scroll"||e==="scrollend"),m=_?h!==null?h+"Capture":null:h;_=[];for(var v=c,b;v!==null;){var w=v;if(b=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||b===null||m===null||(w=$c(v,m),w!=null&&_.push(Qc(v,w,b))),y)break;v=v.return}0<_.length&&(h=new f(h,p,null,i,u),d.push({event:h,listeners:_}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&i!==Sg&&(p=i.relatedTarget||i.fromElement)&&(Ua(p)||p[Ml]))break e;(h||f)&&(p=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,h?(f=i.relatedTarget||i.toElement,h=c,f=f?Ua(f):null,f!==null&&(y=ru(f),_=f.tag,f!==y||_!==5&&_!==27&&_!==6)&&(f=null)):(h=null,f=c),h!==f&&(_=IS,w="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(_=BS,w="onPointerLeave",m="onPointerEnter",v="pointer"),y=h==null?p:Cc(h),b=f==null?p:Cc(f),p=new _(w,v+"leave",h,i,u),p.target=y,p.relatedTarget=b,w=null,Ua(u)===c&&(_=new _(m,v+"enter",f,i,u),_.target=b,_.relatedTarget=y,w=_),y=w,_=h&&f?cg(h,f,x3):null,h!==null&&Lw(d,p,h,_,!1),f!==null&&y!==null&&Lw(d,y,f,_,!0)))}e:{if(h=c?Cc(c):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var k=qS;else if(US(h))if(B1)k=AL;else{k=TL;var O=CL}else f=h.nodeName,!f||f.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&E_(c.elementType)&&(k=qS):k=NL;if(k&&(k=k(e,c))){z1(d,k,i,u);break e}O&&O(e,h,c)}switch(O=c?Cc(c):window,e){case"focusin":(US(O)||O.contentEditable==="true")&&(el=O,Eg=c,Oc=null);break;case"focusout":Oc=Eg=el=null;break;case"mousedown":kg=!0;break;case"contextmenu":case"mouseup":case"dragend":kg=!1,KS(d,i,u);break;case"selectionchange":if(OL)break;case"keydown":case"keyup":KS(d,i,u)}var N;if(N_)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Jo?L1(e,i)&&(C="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(C="onCompositionStart");C&&(D1&&i.locale!=="ko"&&(Jo||C!=="onCompositionStart"?C==="onCompositionEnd"&&Jo&&(N=R1()):(Vs=u,C_="value"in Vs?Vs.value:Vs.textContent,Jo=!0)),O=jh(c,C),0<O.length&&(C=new zS(C,e,null,i,u),d.push({event:C,listeners:O}),N?C.data=N:(N=I1(i),N!==null&&(C.data=N)))),(N=SL?wL(e,i):xL(e,i))&&(C=jh(c,"onBeforeInput"),0<C.length&&(O=new zS("onBeforeInput","beforeinput",null,i,u),d.push({event:O,listeners:C}),O.data=N)),S3(d,e,c,i,u)}OE(d,t)})}function Qc(e,t,i){return{instance:e,listener:t,currentTarget:i}}function jh(e,t){for(var i=t+"Capture",n=[];e!==null;){var r=e,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=$c(e,i),r!=null&&n.unshift(Qc(e,r,s)),r=$c(e,t),r!=null&&n.push(Qc(e,r,s))),e.tag===3)return n;e=e.return}return[]}function x3(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Lw(e,t,i,n,r){for(var s=t._reactName,a=[];i!==null&&i!==n;){var o=i,l=o.alternate,c=o.stateNode;if(o=o.tag,l!==null&&l===n)break;o!==5&&o!==26&&o!==27||c===null||(l=c,r?(c=$c(i,s),c!=null&&a.unshift(Qc(i,c,l))):r||(c=$c(i,s),c!=null&&a.push(Qc(i,c,l)))),i=i.return}a.length!==0&&e.push({event:t,listeners:a})}var E3=/\r\n?/g,k3=/\u0000|\uFFFD/g;function Iw(e){return(typeof e=="string"?e:""+e).replace(E3,`
|
|
`).replace(k3,"")}function DE(e,t){return t=Iw(t),Iw(e)===t}function tt(e,t,i,n,r,s){switch(i){case"children":if(typeof n=="string")t==="body"||t==="textarea"&&n===""||bl(e,n);else if(typeof n=="number"||typeof n=="bigint")t!=="body"&&bl(e,""+n);else return;break;case"className":Hd(e,"class",n);break;case"tabIndex":Hd(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Hd(e,i,n);break;case"style":M1(e,n,s);return;case"data":if(t!=="object"){Hd(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(i);break}n=nh(n),e.setAttribute(i,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(i==="formAction"?(t!=="input"&&tt(e,t,"name",r.name,r,null),tt(e,t,"formEncType",r.formEncType,r,null),tt(e,t,"formMethod",r.formMethod,r,null),tt(e,t,"formTarget",r.formTarget,r,null)):(tt(e,t,"encType",r.encType,r,null),tt(e,t,"method",r.method,r,null),tt(e,t,"target",r.target,r,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(i);break}n=nh(n),e.setAttribute(i,n);break;case"onClick":n!=null&&(e.onclick=zr);return;case"onScroll":n!=null&&Pe("scroll",e);return;case"onScrollEnd":n!=null&&Pe("scrollend",e);return;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(F(61));if(i=n.__html,i!=null){if(r.children!=null)throw Error(F(60));s?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}i=nh(n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(i,n):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":n===!0?e.setAttribute(i,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(i,n):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(i,n):e.removeAttribute(i);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(i):e.setAttribute(i,n);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),ih(e,"popover",n);break;case"xlinkActuate":ss(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ss(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ss(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ss(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ss(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ss(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ss(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ss(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ss(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":ih(e,"is",n);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=GD.get(i)||i,ih(e,i,n);else return}Ke=!0}function l_(e,t,i,n,r,s){switch(i){case"style":M1(e,n,s);return;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(F(61));if(i=n.__html,i!=null){if(r.children!=null)throw Error(F(60));s?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof n=="string")bl(e,n);else if(typeof n=="number"||typeof n=="bigint")bl(e,""+n);else return;break;case"onScroll":n!=null&&Pe("scroll",e);return;case"onScrollEnd":n!=null&&Pe("scrollend",e);return;case"onClick":n!=null&&(e.onclick=zr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!E1.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),s=i.slice(2,r?i.length-7:void 0),t=e[dn]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(s,t,r),typeof n=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(s,n,r);break e}Ke=!0,i in e?e[i]=n:n===!0?e.setAttribute(i,""):ih(e,i,n)}return}Ke=!0}function Ci(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var n=!1,r=!1,s;for(s in i)if(i.hasOwnProperty(s)){var a=i[s];if(a!=null)switch(s){case"src":n=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(F(137,t));default:tt(e,t,s,a,i,null)}}r&&tt(e,t,"srcSet",i.srcSet,i,null),n&&tt(e,t,"src",i.src,i,null);return;case"input":Pe("invalid",e);var o=s=a=r=null,l=null,c=null;for(n in i)if(i.hasOwnProperty(n)){var u=i[n];if(u!=null)switch(n){case"name":r=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":s=u;break;case"defaultValue":o=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(F(137,t));break;default:tt(e,t,n,u,i,null)}}T1(e,s,o,l,c,a,r,!1);return;case"select":Pe("invalid",e),n=a=s=null;for(r in i)if(i.hasOwnProperty(r)&&(o=i[r],o!=null))switch(r){case"value":s=o;break;case"defaultValue":a=o;break;case"multiple":n=o;default:tt(e,t,r,o,i,null)}t=s,i=a,e.multiple=!!n,t!=null?ll(e,!!n,t,!1):i!=null&&ll(e,!!n,i,!0);return;case"textarea":Pe("invalid",e),s=r=n=null;for(a in i)if(i.hasOwnProperty(a)&&(o=i[a],o!=null))switch(a){case"value":n=o;break;case"defaultValue":r=o;break;case"children":s=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(F(91));break;default:tt(e,t,a,o,i,null)}A1(e,n,r,s);return;case"option":for(l in i)i.hasOwnProperty(l)&&(n=i[l],n!=null)&&(l==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":tt(e,t,l,n,i,null));return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(n=0;n<Zc.length;n++)Pe(Zc[n],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("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(c in i)if(i.hasOwnProperty(c)&&(n=i[c],n!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(F(137,t));default:tt(e,t,c,n,i,null)}return;default:if(E_(t)){for(u in i)i.hasOwnProperty(u)&&(n=i[u],n!==void 0&&l_(e,t,u,n,i,void 0));return}}for(o in i)i.hasOwnProperty(o)&&(n=i[o],n!=null&&tt(e,t,o,n,i,null))}var C3={};function T3(e,t,i,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,a=null,o=null,l=null,c=null,u=null;for(f in i){var d=i[f];if(i.hasOwnProperty(f)&&d!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":l=d;default:n.hasOwnProperty(f)||tt(e,t,f,null,n,d)}}for(var h in n){var f=n[h];if(d=i[h],n.hasOwnProperty(h)&&(f!=null||d!=null))switch(h){case"type":f!==d&&(Ke=!0),s=f;break;case"name":f!==d&&(Ke=!0),r=f;break;case"checked":f!==d&&(Ke=!0),c=f;break;case"defaultChecked":f!==d&&(Ke=!0),u=f;break;case"value":f!==d&&(Ke=!0),a=f;break;case"defaultValue":f!==d&&(Ke=!0),o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(F(137,t));break;default:f!==d&&tt(e,t,h,f,n,d)}}yg(e,a,o,l,c,u,s,r);return;case"select":f=a=o=h=null;for(s in i)if(l=i[s],i.hasOwnProperty(s)&&l!=null)switch(s){case"value":break;case"multiple":f=l;default:n.hasOwnProperty(s)||tt(e,t,s,null,n,l)}for(r in n)if(s=n[r],l=i[r],n.hasOwnProperty(r)&&(s!=null||l!=null))switch(r){case"value":s!==l&&(Ke=!0),h=s;break;case"defaultValue":s!==l&&(Ke=!0),o=s;break;case"multiple":s!==l&&(Ke=!0),a=s;default:s!==l&&tt(e,t,r,s,n,l)}t=o,i=a,n=f,h!=null?ll(e,!!i,h,!1):!!n!=!!i&&(t!=null?ll(e,!!i,t,!0):ll(e,!!i,i?[]:"",!1));return;case"textarea":f=h=null;for(o in i)if(r=i[o],i.hasOwnProperty(o)&&r!=null&&!n.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:tt(e,t,o,null,n,r)}for(a in n)if(r=n[a],s=i[a],n.hasOwnProperty(a)&&(r!=null||s!=null))switch(a){case"value":r!==s&&(Ke=!0),h=r;break;case"defaultValue":r!==s&&(Ke=!0),f=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(F(91));break;default:r!==s&&tt(e,t,a,r,n,s)}N1(e,h,f);return;case"option":for(var p in i)h=i[p],i.hasOwnProperty(p)&&h!=null&&!n.hasOwnProperty(p)&&(p==="selected"?e.selected=!1:tt(e,t,p,null,n,h));for(l in n)h=n[l],f=i[l],n.hasOwnProperty(l)&&h!==f&&(h!=null||f!=null)&&(l==="selected"?(h!==f&&(Ke=!0),e.selected=h&&typeof h!="function"&&typeof h!="symbol"):tt(e,t,l,h,n,f));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 _ in i)h=i[_],i.hasOwnProperty(_)&&h!=null&&!n.hasOwnProperty(_)&&tt(e,t,_,null,n,h);for(c in n)if(h=n[c],f=i[c],n.hasOwnProperty(c)&&h!==f&&(h!=null||f!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(F(137,t));break;default:tt(e,t,c,h,n,f)}return;default:if(E_(t)){for(var y in i)h=i[y],i.hasOwnProperty(y)&&h!==void 0&&!n.hasOwnProperty(y)&&l_(e,t,y,void 0,n,h);for(u in n)h=n[u],f=i[u],!n.hasOwnProperty(u)||h===f||h===void 0&&f===void 0||l_(e,t,u,h,n,f);return}}for(var m in i)h=i[m],i.hasOwnProperty(m)&&h!=null&&!n.hasOwnProperty(m)&&tt(e,t,m,null,n,h);for(d in n)h=n[d],f=i[d],!n.hasOwnProperty(d)||h===f||h==null&&f==null||tt(e,t,d,h,n,f)}function zw(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function N3(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),n=0;n<i.length;n++){var r=i[n],s=r.transferSize,a=r.initiatorType,o=r.duration;if(s&&o&&zw(a)){for(a=0,o=r.responseEnd,n+=1;n<i.length;n++){var l=i[n],c=l.startTime;if(c>o)break;var u=l.transferSize,d=l.initiatorType;u&&zw(d)&&(l=l.responseEnd,a+=u*(l<o?1:(o-c)/(l-c)))}if(--n,t+=8*(s+a)/(r.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 c_=null,u_=null;function Jc(e){return e.nodeType===9?e:e.ownerDocument}function Bw(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 LE(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 IE(e,t,i,n){return i=Jc(i).createElement(e),i[wi]=n,i[dn]=t,Ci(i,e,t),oi(i),i}function d_(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 sg=null;function A3(){var e=window.event;return e&&e.type==="popstate"?e===sg?!1:(sg=e,!0):(sg=null,!1)}var uv=typeof setTimeout=="function"?setTimeout:void 0,M3=typeof clearTimeout=="function"?clearTimeout:void 0,Pw=typeof Promise=="function"?Promise:void 0,Hw=typeof requestAnimationFrame=="function"?requestAnimationFrame:uv,O3=typeof queueMicrotask=="function"?queueMicrotask:typeof Pw<"u"?function(e){return Pw.resolve(null).then(e).catch(R3)}:uv;function R3(e){setTimeout(function(){throw e})}function ga(e){return e==="head"}function Uw(e,t){var i=t,n=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(n===0){e.removeChild(r),Al(t);return}n--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")n++;else if(i==="html")og(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,og(i);for(var s=i.firstChild;s;){var a=s.nextSibling,o=s.nodeName;s[lu]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&s.rel.toLowerCase()==="stylesheet"||i.removeChild(s),s=a}}else i==="body"&&og(e.ownerDocument.body);i=r}while(i);Al(t)}function qw(e,t){var i=e;e=0;do{var n=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),n&&n.nodeType===8)if(i=n.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=n}while(i)}function zE(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var n=1;else for(var r=n=0;r<t.length;r++){var s=t[r];0<s.width&&0<s.height&&n++}n===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function BE(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function PE(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function h_(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return PE(t,i,e)}function D3(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var i=getComputedStyle(e);return PE(t,i,e)}function L3(e){return e.documentElement.clientHeight}function I3(e){this.addEventListener("load",e),this.addEventListener("error",e)}function z3(e,t,i,n,r,s,a,o,l){var c=t.nodeType===9?t:t.ownerDocument;try{var u=c.startViewTransition({update:function(){var h=c.defaultView,f=h.navigation&&h.navigation.transition,p=c.fonts.status;n();var _=[];if(p==="loaded"&&(L3(c),c.fonts.status==="loading"&&_.push(c.fonts.ready)),p=_.length,e!==null)for(var y=e.suspenseyImages,m=0,v=0;v<y.length;v++){var b=y[v];if(!b.complete){var w=b.getBoundingClientRect();if(0<w.bottom&&0<w.right&&w.top<h.innerHeight&&w.left<h.innerWidth){if(m+=XE(b),m>vh){_.length=p;break}b=new Promise(I3.bind(b)),_.push(b)}}}if(0<_.length)return h=Promise.race([Promise.all(_),new Promise(function(k){return setTimeout(k,500)})]).then(r,r),(f?Promise.allSettled([f.finished,h]):h).then(s,s);if(r(),f)return f.finished.then(s,s);s()},types:i});c.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var h=c.documentElement.getAnimations({subtree:!0}),f=0;f<h.length;f++){var p=h[f],_=p.effect,y=_.pseudoElement;if(y!=null&&y.startsWith("::view-transition")){d.push(p),p=_.getKeyframes();for(var m=y=void 0,v=!0,b=0;b<p.length;b++){var w=p[b],k=w.width;if(y===void 0)y=k;else if(y!==k){v=!1;break}if(k=w.height,m===void 0)m=k;else if(m!==k){v=!1;break}delete w.width,delete w.height,w.transform==="none"&&delete w.transform}v&&y!==void 0&&m!==void 0&&(_.setKeyframes(p),v=getComputedStyle(_.target,_.pseudoElement),v.width!==y||v.height!==m)&&(v=p[0],v.width=y,v.height=m,v=p[p.length-1],v.width=y,v.height=m,_.setKeyframes(p))}}a()},function(h){c.__reactViewTransition===u&&(c.__reactViewTransition=null);try{typeof h=="object"&&h!==null&&h.name==="InvalidStateError"&&(h.message==="View transition was skipped because document visibility state is hidden."||h.message==="Skipping view transition because document visibility state has become hidden."||h.message==="Skipping view transition because viewport size changed."||h.message==="Transition was aborted because of invalid state")&&(h=null),h!==null&&l(h)}finally{n(),r(),a()}}),u.finished.finally(function(){for(var h=0;h<d.length;h++)d[h].cancel();c.__reactViewTransition===u&&(c.__reactViewTransition=null),o()}),u}catch{return n(),r(),a(),null}}function qa(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}qa.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:ut({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};qa.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),n=[],r=0;r<i.length;r++){var s=i[r].effect;s!==null&&s.target===e&&s.pseudoElement===t&&n.push(i[r])}return n};qa.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function HE(e){return{name:e,group:new qa("group",e),imagePair:new qa("image-pair",e),old:new qa("old",e),new:new qa("new",e)}}function Tn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Tn.prototype.addEventListener=function(e,t,i){var n=null,r=null;if(!(i!=null&&typeof i!="boolean"&&(n=i.signal||null,n!==null&&n.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var s=this._eventListeners;if(UE(s,e,t,i)===-1){var a=this,o=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(o=function(l){a.removeEventListener(e,t,i),typeof t=="function"?t.call(this,l):t.handleEvent(l)}),n!==null&&(r=a.removeEventListener.bind(a,e,t,i),n.addEventListener("abort",r,{once:!0}),r=n.removeEventListener.bind(n,"abort",r)),n=kl(i),s.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:o,cleanup:r}),un(this._fragmentFiber.child,!1,B3,e,o,n)}this._eventListeners=s}};function B3(e,t,i,n){return Qt(e).addEventListener(t,i,n),!1}Tn.prototype.removeEventListener=function(e,t,i){var n=this._eventListeners;if(n!==null&&(t=UE(n,e,t,i),t!==-1)){var r=n[t];i=r.attachedListener;var s=r.cleanup;r=kl(r.optionsOrUseCapture),un(this._fragmentFiber.child,!1,P3,e,i,r),n.splice(t,1),s!==null&&s()}};function P3(e,t,i,n){return Qt(e).removeEventListener(t,i,n),!1}function kl(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Fw(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function UE(e,t,i,n){if(e.length===0)return-1;n=Fw(n);for(var r=0;r<e.length;r++){var s=e[r];if(s.type===t&&s.listener===i&&Fw(s.optionsOrUseCapture)===n)return r}return-1}Tn.prototype.dispatchEvent=function(e){var t=to(this._fragmentFiber);if(t===null)return!0;t=Qt(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var n=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var r=0;r<i.length;r++){var s=i[r];n.addEventListener(s.type,s.attachedListener,kl(s.optionsOrUseCapture))}if(t.appendChild(n),e=n.dispatchEvent(e),i)for(r=0;r<i.length;r++)s=i[r],n.removeEventListener(s.type,s.attachedListener,kl(s.optionsOrUseCapture));return t.removeChild(n),e}return t.dispatchEvent(e)};Tn.prototype.focus=function(e){un(this._fragmentFiber.child,!0,qE,e,void 0,void 0)};function qE(e,t){return e.tag===6?!1:(e=Qt(e),X3(e,t))}Tn.prototype.focusLast=function(e){var t=[];un(this._fragmentFiber.child,!0,dv,t,void 0,void 0);for(var i=t.length-1;0<=i&&!qE(t[i],e);i--);};function dv(e,t){return t.push(e),!1}Tn.prototype.blur=function(){var e=to(this._fragmentFiber);e!==null&&(e=Qt(e),e=Jc(e).activeElement,e!==null&&un(this._fragmentFiber.child,!1,H3,e,void 0,void 0))};function H3(e,t){return e.tag===6?!1:(e=Qt(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Tn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),un(this._fragmentFiber.child,!1,U3,e,void 0,void 0)};function U3(e,t){return e.tag===6||(e=Qt(e),t.observe(e)),!1}Tn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),un(this._fragmentFiber.child,!1,q3,e,void 0,void 0);for(var i=t=0;i<ur.length;i++){var n=ur[i];n.fragmentInstance===this&&n.observer===e?e.unobserve(n.instance):ur[t++]=n}ur.length=t}};function q3(e,t){return e.tag===6||(e=Qt(e),t.unobserve(e)),!1}var ur=[],ag=!1;function F3(e,t,i){ur.push({fragmentInstance:e,observer:t,instance:i}),ag||(ag=!0,Z3(function(){ag=!1;var n=ur;ur=[];for(var r=0;r<n.length;r++){var s=n[r];s.observer.unobserve(s.instance)}}))}Tn.prototype.getClientRects=function(){var e=[];return un(this._fragmentFiber.child,!1,$3,e,void 0,void 0),e};function $3(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=Qt(e),t.push.apply(t,e.getClientRects());return!1}Tn.prototype.getRootNode=function(e){var t=to(this._fragmentFiber);return t===null?this:Qt(t).getRootNode(e)};Tn.prototype.compareDocumentPosition=function(e){var t=to(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];un(this._fragmentFiber.child,!1,dv,i,void 0,void 0);var n=Qt(t);if(i.length===0){if(i=n,SS(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var r=n=i.compareDocumentPosition(e);return i===e?r=Node.DOCUMENT_POSITION_CONTAINS:n&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=c1(t)[1],i===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=Qt(i).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=Qt(i[0]),r=Qt(i[i.length-1]);var s=SS(this._fragmentFiber)?t.parentElement:n;if(s==null)return Node.DOCUMENT_POSITION_DISCONNECTED;n=s.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,s=s.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var a=t.compareDocumentPosition(e),o=r.compareDocumentPosition(e),l=a&Node.DOCUMENT_POSITION_CONTAINED_BY||o&Node.DOCUMENT_POSITION_CONTAINED_BY;return o=n&&s&&a&Node.DOCUMENT_POSITION_FOLLOWING&&o&Node.DOCUMENT_POSITION_PRECEDING,t=n&&t===e||s&&r===e||l||o?Node.DOCUMENT_POSITION_CONTAINED_BY:!n&&t===e||!s&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:a,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||W3(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function W3(e,t,i,n,r){var s=Ua(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!s)e:{for(;s!==null;){if(s.tag===7&&(s===t||s.alternate===t)){i=!0;break e}s=s.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(s===null)return s=r.ownerDocument,r===s||r===s.documentElement||r===s.body;e:{for(s=t,t=to(t);s!==null;){if(!(s.tag!==5&&s.tag!==3&&s.tag!==27||s!==t&&s.alternate!==t)){s=!0;break e}s=s.return}s=!1}return s}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!s)&&!(t=s===i)&&(t=cg(i,s,wS),t===null?t=!1:(un(t,!0,yD,s,i),s=Vo,Vo=null,t=s!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!s)&&!(t=s===n)&&(t=cg(n,s,wS),t===null?t=!1:(un(t,!0,SD,s,n),s=Vo,lg=Vo=null,t=s!==null)),t):!1}function $w(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Tn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(F(566));var t=[];un(this._fragmentFiber.child,!1,dv,t,void 0,void 0);var i=e!==!1;if(t.length===0){var n=c1(this._fragmentFiber);if(n=i?n[1]||n[0]||to(this._fragmentFiber):n[0]||n[1],n===null)return;if(n.tag===6){e=Qt(n),$w(e,i);return}if(n=Qt(n),n.nodeType!==9){if(n.nodeType===11){i="host"in n?n.host:null,i!==null&&i.scrollIntoView(e);return}n.scrollIntoView(e)}}for(n=i?t.length-1:0;n!==(i?-1:t.length);){var r=t[n];r.tag===6?(r=Qt(r),$w(r,i)):Qt(r).scrollIntoView(e),n+=i?-1:1}};function K3(e,t){return e=Qt(e),FE(e,t),!1}function FE(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function $E(e,t){var i=t._eventListeners;if(i!==null)for(var n=0;n<i.length;n++){var r=i[n];e.addEventListener(r.type,r.attachedListener,kl(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(s){for(var a=0,o=0;o<ur.length;o++){var l=ur[o];(l.fragmentInstance!==t||l.observer!==s||l.instance!==e)&&(ur[a++]=l)}ur.length=a,s.observe(e)}),FE(e,t))}function G3(e,t){var i=t._eventListeners;if(i!==null)for(var n=0;n<i.length;n++){var r=i[n];e.removeEventListener(r.type,r.attachedListener,kl(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(s){typeof s.rootMargin=="string"?F3(t,s,e):s.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function f_(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":f_(i),Zh(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function j3(e,t,i,n){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[lu])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=jn(e.nextSibling),e===null)break}return null}function Y3(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=jn(e.nextSibling),e===null))return null;return e}function WE(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=jn(e.nextSibling),e===null))return null;return e}function p_(e){return e.data==="$?"||e.data==="$~"}function hv(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function V3(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var n=function(){t(),i.removeEventListener("DOMContentLoaded",n)};i.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function jn(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 m_=null;function Ww(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return jn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function Kw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function X3(e,t){function i(){n=!0}if(e.ownerDocument.activeElement===e)return!0;var n=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return n}function Z3(e){Hw(function(){Hw(function(t){return e(t)})})}function KE(e,t,i){switch(t=Jc(i),e){case"html":if(e=t.documentElement,!e)throw Error(F(452));return e;case"head":if(e=t.head,!e)throw Error(F(453));return e;case"body":if(e=t.body,!e)throw Error(F(454));return e;default:throw Error(F(451))}}function GE(e,t,i){for(var n in i){var r=i[n];i.hasOwnProperty(n)&&r!=null&&tt(e,t,n,null,C3,r)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===zr&&(e.onclick=null),Zh(e)}function og(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Zh(e)}var Yn=new Map,Gw=new Set;function eu(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var bs=Ye.d;Ye.d={f:Q3,r:J3,D:eI,C:tI,L:iI,m:nI,X:sI,S:rI,M:aI};function Q3(){var e=bs.f(),t=hf();return e||t}function J3(e){var t=Ol(e);t!==null&&t.tag===5&&t.type==="form"?Mx(t):bs.r(e)}var Il=typeof document>"u"?null:document;function jE(e,t,i){var n=Il;if(n&&typeof t=="string"&&t){var r=Wn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),Gw.has(r)||(Gw.add(r),e={rel:e,crossOrigin:i,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),Ci(t,"link",e),oi(t),n.head.appendChild(t)))}}function eI(e){bs.D(e),jE("dns-prefetch",e,null)}function tI(e,t){bs.C(e,t),jE("preconnect",e,t)}function iI(e,t,i){bs.L(e,t,i);var n=Il;if(n&&e&&t){var r='link[rel="preload"][as="'+Wn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Wn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Wn(i.imageSizes)+'"]')):r+='[href="'+Wn(e)+'"]';var s=r;switch(t){case"style":s=Cl(e);break;case"script":s=zl(e)}if(!(Yn.has(s)||(e=ut({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Yn.set(s,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(pu(s))||t==="script"&&n.querySelector(mu(s))))){var a=n.createElement("link");Ci(a,"link",e),t==="style"&&(a[kh]=!0,a.onload=a.onerror=function(){w1(a)}),oi(a),n.head.appendChild(a)}}}function nI(e,t){bs.m(e,t);var i=Il;if(i&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Wn(n)+'"][href="'+Wn(e)+'"]',s=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=zl(e)}if(!Yn.has(s)&&(e=ut({rel:"modulepreload",href:e},t),Yn.set(s,e),i.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(mu(s)))return}n=i.createElement("link"),Ci(n,"link",e),oi(n),i.head.appendChild(n)}}}function rI(e,t,i){bs.S(e,t,i);var n=Il;if(n&&e){var r=ol(n).hoistableStyles,s=Cl(e);t=t||"default";var a=r.get(s);if(!a){var o={loading:0,preload:null};if(a=n.querySelector(pu(s)))o.loading=5;else{e=ut({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Yn.get(s))&&fv(e,i);var l=a=n.createElement("link");oi(l),Ci(l,"link",e),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,gh(a,t,n)}a={type:"stylesheet",instance:a,count:1,state:o},r.set(s,a)}}}function sI(e,t){bs.X(e,t);var i=Il;if(i&&e){var n=ol(i).hoistableScripts,r=zl(e),s=n.get(r);s||(s=i.querySelector(mu(r)),s||(e=ut({src:e,async:!0},t),(t=Yn.get(r))&&pv(e,t),s=i.createElement("script"),oi(s),Ci(s,"link",e),i.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(r,s))}}function aI(e,t){bs.M(e,t);var i=Il;if(i&&e){var n=ol(i).hoistableScripts,r=zl(e),s=n.get(r);s||(s=i.querySelector(mu(r)),s||(e=ut({src:e,async:!0,type:"module"},t),(t=Yn.get(r))&&pv(e,t),s=i.createElement("script"),oi(s),Ci(s,"link",e),i.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(r,s))}}function jw(e,t,i,n){var r=(r=ea.current)?eu(r):null;if(!r)throw Error(F(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=Cl(i.href),t=ol(r).hoistableStyles,n=t.get(i),n||(n={type:"style",instance:null,count:0,state:null},t.set(i,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Cl(i.href);var s=ol(r).hoistableStyles,a=s.get(e);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,a),(s=r.querySelector(pu(e)))?s._p||(a.instance=s,a.state.loading=5):(s=Yn.get(e),s||(s={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Yn.set(e,s)),oI(r,e,s,a.state))),t&&n===null)throw Error(F(528,""));return a}if(t&&n!==null)throw Error(F(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=zl(i),t=ol(r).hoistableScripts,n=t.get(i),n||(n={type:"script",instance:null,count:0,state:null},t.set(i,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(F(444,e))}}function Cl(e){return'href="'+Wn(e)+'"'}function pu(e){return'link[rel="stylesheet"]['+e+"]"}function YE(e){return ut({},e,{"data-precedence":e.precedence,precedence:null})}function oI(e,t,i,n){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[kh]!==!0){n.loading=1;return}}else t=e.createElement("link"),t[kh]=!0,t.onload=t.onerror=w1.bind(null,t),Ci(t,"link",i),oi(t),e.head.appendChild(t);n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2})}function zl(e){return'[src="'+Wn(e)+'"]'}function mu(e){return"script[async]"+e}function Yw(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Wn(i.href)+'"]');if(n)return t.instance=n,oi(n),n;var r=ut({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),oi(n),Ci(n,"style",r),gh(n,i.precedence,e),t.instance=n;case"stylesheet":r=Cl(i.href);var s=e.querySelector(pu(r));if(s)return t.state.loading|=4,t.instance=s,oi(s),s;n=YE(i),(r=Yn.get(r))&&fv(n,r),s=(e.ownerDocument||e).createElement("link"),oi(s);var a=s;return a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),Ci(s,"link",n),t.state.loading|=4,gh(s,i.precedence,e),t.instance=s;case"script":return s=zl(i.src),(r=e.querySelector(mu(s)))?(t.instance=r,oi(r),r):(n=i,(r=Yn.get(s))&&(n=ut({},i),pv(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),oi(r),Ci(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(F(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,gh(n,i.precedence,e));return t.instance}function gh(e,t,i){for(var n=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,s=r,a=0;a<n.length;a++){var o=n[a];if(o.dataset.precedence===t)s=o;else if(s!==r)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function fv(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function pv(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var _h=null;function Vw(e,t,i){if(_h===null){var n=new Map,r=_h=new Map;r.set(i,n)}else r=_h,n=r.get(i),n||(n=new Map,r.set(i,n));if(n.has(e))return n;for(n.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var s=i[r];if(!(s[lu]||s[wi]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var a=s.getAttribute(t)||"";a=e+a;var o=n.get(a);o?o.push(s):n.set(a,[s])}}return n}function g_(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function lI(e,t,i){if(i===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 Xw(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function VE(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function XE(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Zw(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=XE(t),e.suspenseyImages.push(t)),e=dI.bind(e),t.decode().then(e,e))}function cI(e,t,i,n){if(i.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var r=Cl(n.href),s=t.querySelector(pu(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=tu.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=s,oi(s);return}s=t.ownerDocument||t,n=YE(n),(r=Yn.get(r))&&fv(n,r),s=s.createElement("link"),oi(s);var a=s;a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),Ci(s,"link",n),i.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=tu.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var vh=0;function uI(e,t){return e.stylesheets&&e.count===0&&bh(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var n=setTimeout(function(){if(e.stylesheets&&bh(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&vh===0&&(vh=62500*N3());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bh(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>vh?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function ZE(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)bh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function tu(){this.count--,ZE(this)}function dI(){this.imgCount--,ZE(this)}var Yh=null;function bh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yh=new Map,t.forEach(hI,e),Yh=null,tu.call(e))}function hI(e,t){if(!(t.state.loading&4)){var i=Yh.get(e);if(i)var n=i.get(null);else{i=new Map,Yh.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var a=r[s];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(i.set(a.dataset.precedence,a),n=a)}n&&i.set(null,n)}r=t.instance,a=r.getAttribute("data-precedence"),s=i.get(a)||n,s===n&&i.set(null,r),i.set(a,r),this.count++,n=tu.bind(this),r.addEventListener("load",n),r.addEventListener("error",n),s?s.parentNode.insertBefore(r,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Tl={$$typeof:Ir,Provider:null,Consumer:null,_currentValue:Fa,_currentValue2:Fa,_threadCount:0};function fI(e,t,i,n,r,s,a,o,l){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=Im(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Im(0),this.hiddenUpdates=Im(null),this.identifierPrefix=n,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.transitionTypes=null,this.incompleteTransitions=new Map}function QE(e,t,i,n,r,s,a,o,l,c,u,d){return e=new fI(e,t,i,a,l,c,u,d,o),t=1,s===!0&&(t|=24),s=ln(3,null,null,t),e.current=s,s.stateNode=e,t=L_(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:n,isDehydrated:i,cache:t},B_(s),e}function JE(e){return e?(e=nl,e):nl}function ek(e,t,i,n,r,s){r=JE(r),n.context===null?n.context=r:n.pendingContext=r,n=ia(t),n.payload={element:i},s=s===void 0?null:s,s!==null&&(n.callback=s),i=na(e,n,t),i!==null&&(cn(i,e,t),Dc(i,e,t))}function Qw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function mv(e,t){Qw(e,t),(e=e.alternate)&&Qw(e,t)}function tk(e){if(e.tag===13||e.tag===31){var t=ro(e,67108864);t!==null&&cn(t,e,67108864),mv(e,67108864)}}function Jw(e){if(e.tag===13||e.tag===31){var t=kn();t=w_(t);var i=ro(e,t);i!==null&&cn(i,e,t),mv(e,t)}}var Nl=!0;function pI(e,t,i,n){var r=Se.T;Se.T=null;var s=Ye.p;try{Ye.p=2,gv(e,t,i,n)}finally{Ye.p=s,Se.T=r}}function mI(e,t,i,n){var r=Se.T;Se.T=null;var s=Ye.p;try{Ye.p=8,gv(e,t,i,n)}finally{Ye.p=s,Se.T=r}}function gv(e,t,i,n){if(Nl){var r=__(n);if(r===null)rg(e,t,n,Vh,i),e1(e,n);else if(_I(r,e,t,i,n))n.stopPropagation();else if(e1(e,n),t&4&&-1<gI.indexOf(e)){for(;r!==null;){var s=Ol(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var a=Ba(s.pendingLanes);if(a!==0){var o=s;for(o.pendingLanes|=2,o.entangledLanes|=2;a;){var l=1<<31-En(a);o.entanglements[1]|=l,a&=~l}$r(s),(je&6)===0&&($h=wn()+500,fu(0,!1))}}break;case 31:case 13:o=ro(s,2),o!==null&&cn(o,s,2),hf(),mv(s,2)}if(s=__(n),s===null&&rg(e,t,n,Vh,i),s===r)break;r=s}r!==null&&n.stopPropagation()}else rg(e,t,n,null,i)}}function __(e){return e=k_(e),_v(e)}var Vh=null;function _v(e){if(Vh=null,e=Ua(e),e!==null){var t=ru(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=a1(t),e!==null)return e;e=null}else if(i===31){if(e=o1(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Vh=e,null}function ik(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"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(MD()){case f1:return 2;case p1:return 8;case Eh:case OD:return 32;case m1:return 268435456;default:return 32}default:return 32}}var v_=!1,oa=null,la=null,ca=null,iu=new Map,nu=new Map,js=[],gI="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 e1(e,t){switch(e){case"focusin":case"focusout":oa=null;break;case"dragenter":case"dragleave":la=null;break;case"mouseover":case"mouseout":ca=null;break;case"pointerover":case"pointerout":iu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":nu.delete(t.pointerId)}}function wc(e,t,i,n,r,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:i,eventSystemFlags:n,nativeEvent:s,targetContainers:[r]},t!==null&&(t=Ol(t),t!==null&&tk(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function _I(e,t,i,n,r){switch(t){case"focusin":return oa=wc(oa,e,t,i,n,r),!0;case"dragenter":return la=wc(la,e,t,i,n,r),!0;case"mouseover":return ca=wc(ca,e,t,i,n,r),!0;case"pointerover":var s=r.pointerId;return iu.set(s,wc(iu.get(s)||null,e,t,i,n,r)),!0;case"gotpointercapture":return s=r.pointerId,nu.set(s,wc(nu.get(s)||null,e,t,i,n,r)),!0}return!1}function nk(e){var t=Ua(e.target);if(t!==null){var i=ru(t);if(i!==null){if(t=i.tag,t===13){if(t=a1(i),t!==null){e.blockedOn=t,CS(e.priority,function(){Jw(i)});return}}else if(t===31){if(t=o1(i),t!==null){e.blockedOn=t,CS(e.priority,function(){Jw(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function yh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=__(e.nativeEvent);if(i===null){i=e.nativeEvent;var n=new i.constructor(i.type,i);Sg=n,i.target.dispatchEvent(n),Sg=null}else return t=Ol(i),t!==null&&tk(t),e.blockedOn=i,!1;t.shift()}return!0}function t1(e,t,i){yh(e)&&i.delete(t)}function vI(){v_=!1,oa!==null&&yh(oa)&&(oa=null),la!==null&&yh(la)&&(la=null),ca!==null&&yh(ca)&&(ca=null),iu.forEach(t1),nu.forEach(t1)}function eh(e,t){e.blockedOn===t&&(e.blockedOn=null,v_||(v_=!0,Jt.unstable_scheduleCallback(Jt.unstable_NormalPriority,vI)))}var th=null;function i1(e){th!==e&&(th=e,Jt.unstable_scheduleCallback(Jt.unstable_NormalPriority,function(){th===e&&(th=null);for(var t=0;t<e.length;t+=3){var i=e[t],n=e[t+1],r=e[t+2];if(typeof n!="function"){if(_v(n||i)===null)continue;break}var s=Ol(i);s!==null&&(e.splice(t,3),t-=3,Bg(s,{pending:!0,data:r,method:i.method,action:n},n,r))}}))}function Al(e){function t(l){return eh(l,e)}oa!==null&&eh(oa,e),la!==null&&eh(la,e),ca!==null&&eh(ca,e),iu.forEach(t),nu.forEach(t);for(var i=0;i<js.length;i++){var n=js[i];n.blockedOn===e&&(n.blockedOn=null)}for(;0<js.length&&(i=js[0],i.blockedOn===null);)nk(i),i.blockedOn===null&&js.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(n=0;n<i.length;n+=3){var r=i[n],s=i[n+1],a=r[dn]||null;if(typeof s=="function")a||i1(i);else if(a){var o=null;if(s&&s.hasAttribute("formAction")){if(r=s,a=s[dn]||null)o=a.formAction;else if(_v(r)!==null)continue}else o=a.action;typeof o=="function"?i[n+1]=o:(i.splice(n,3),n-=3),i1(i)}}}function rk(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),n||setTimeout(i,20)}function i(){if(!n&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function vv(e){this._internalRoot=e}mf.prototype.render=vv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));var i=t.current,n=kn();ek(i,n,e,t,null,null)};mf.prototype.unmount=vv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ek(e.current,2,null,e,null,null),hf(),t[Ml]=null}};function mf(e){this._internalRoot=e}mf.prototype.unstable_scheduleHydration=function(e){if(e){var t=S1();e={blockedOn:null,target:e,priority:t};for(var i=0;i<js.length&&t!==0&&t<js[i].priority;i++);js.splice(i,0,e),i===0&&nk(e)}};var n1=r1.version;if(n1!=="19.3.1")throw Error(F(527,n1,"19.3.1"));Ye.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=bD(t),e=e!==null?l1(e):null,e=e===null?null:e.stateNode,e};var bI={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:Se,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(xc=__REACT_DEVTOOLS_GLOBAL_HOOK__,!xc.isDisabled&&xc.supportsFiber))try{su=xc.inject(bI),xn=xc}catch{}var xc;gf.createRoot=function(e,t){if(!s1(e))throw Error(F(299));var i=!1,n="",r=Px,s=Hx,a=Ux;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=QE(e,1,!1,null,null,i,n,null,r,s,a,rk),e[Ml]=t.current,cv(e),new vv(t)};gf.hydrateRoot=function(e,t,i){if(!s1(e))throw Error(F(299));var n=!1,r="",s=Px,a=Hx,o=Ux,l=null;return i!=null&&(i.unstable_strictMode===!0&&(n=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(s=i.onUncaughtError),i.onCaughtError!==void 0&&(a=i.onCaughtError),i.onRecoverableError!==void 0&&(o=i.onRecoverableError),i.formState!==void 0&&(l=i.formState)),t=QE(e,1,!0,t,i??null,n,r,l,s,a,o,rk),t.context=JE(null),i=t.current,n=kn(),n=w_(n),r=ia(n),r.callback=null,na(i,r,n),i=n,t.current.lanes=i,ou(t,i),$r(t),e[Ml]=t.current,cv(e),new mf(t)};gf.version="19.3.1"});var lk=ye((m9,ok)=>{"use strict";function ak(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ak)}catch(e){console.error(e)}}ak(),ok.exports=sk()});function yI(e){return/^accent(-|$)/i.test(e.replace(/^--/,"").replace(/^magpie-/i,""))}function ck(e){let t=new URLSearchParams(e).get("tokens");if(!t)return;let i;try{i=JSON.parse(decodeURIComponent(escape(atob(t))))}catch{return}bv(i)}function SI(e){let t={};if(!e||typeof e!="object")return t;for(let[i,n]of Object.entries(e)){if(typeof n!="string"&&typeof n!="number")continue;let r=String(n).trim();if(!r||r.length>300||/[;{}<>]/.test(r)||yI(i))continue;let s=i.replace(/^--/,"").replace(/^magpie-/i,"");/^[a-zA-Z0-9-]{1,48}$/.test(s)&&(t[`--magpie-${s}`]=r)}return t}function bv(e){let t=document.documentElement;for(let[i,n]of Object.entries(SI(e)))t.style.setProperty(i,n)}var yv=se(()=>{});function wI(){return typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Sv(e){return e==="light"||e==="dark"?e:"auto"}function xI(e,t,i){let n=e==="light"||e==="dark"?e:t??i;return{theme:n,hostColors:t!==null&&n===t}}function dk(e){let t=new URLSearchParams(e).get("theme");vf=t==="light"||t==="dark"?t:null,Wr("auto"),typeof window<"u"&&window.matchMedia&&(uk=window.matchMedia("(prefers-color-scheme: dark)"),uk.addEventListener?.("change",()=>Wr(_f)))}function hk(){return vf!==null}function fk(e){vf=e,Wr(_f)}function Wr(e){_f=Sv(e);let{theme:t,hostColors:i}=xI(_f,vf,wI()),n=document.documentElement;n.dataset.theme=t,i?n.dataset.hostColors="1":delete n.dataset.hostColors}function pk(){return document.documentElement.dataset.theme==="dark"?"dark":"light"}var vf,_f,uk,gu=se(()=>{vf=null,_f="auto",uk=null});function mk(e){if(!e||typeof e!="object")return null;let t=e;if(typeof t.dark!="boolean")return null;let i=t.tokens&&typeof t.tokens=="object"&&!Array.isArray(t.tokens)?t.tokens:{},n={dark:t.dark,tokens:i};return typeof t.lang=="string"&&t.lang.length<=32&&(n.lang=t.lang),n}function EI(e,t){if(!e||typeof e!="object")return null;let i=e;return i.magpie!==1?null:i.event==="theme"?mk(i.data):i.id===t&&i.result?mk(i.result):null}function _k(e){if(gk||typeof window>"u")return;let t=window.parent;if(!t||t===window)return;gk=!0;let i=1e6+Math.floor(Math.random()*1e6);window.addEventListener("message",n=>{if(n.source!==t)return;let r=EI(n.data,i);r&&(bv(r.tokens),fk(r.dark?"dark":"light"),e?.(r))});try{t.postMessage({magpie:1,id:i,method:"hello"},"*")}catch{}}var gk,vk=se(()=>{yv();gu();gk=!1});function yf(e){return e==="narrow"||e==="wide"||e==="full"?e:"default"}function CI(e){let t=yf(e);return t==="full"?"100%":`${kI[t]}px`}function Ev(e){let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?Math.min(wv,Math.max(bf,Math.round(t))):xv}function _u(e){let t=document.documentElement;t.style.setProperty("--col",CI(e.contentWidth)),t.style.setProperty("--chat-fs",`${Ev(e.chatFontSize)}px`),t.dataset.contentWidth=yf(e.contentWidth)}var kI,bf,wv,xv,kv=se(()=>{kI={narrow:640,default:720,wide:880},bf=12,wv=18,xv=13});function TI(e){if(typeof e!="string"||!e||e.length>2048)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="http:"&&t.protocol!=="https:"||t.username||t.password)return null;let i=t.hostname.toLowerCase();return i!=="127.0.0.1"&&i!=="localhost"&&i!=="[::1]"||!/^\/_magpie\/plugin\/[A-Za-z0-9_-]{1,128}\/(?:page\/)?index\.html$/.test(t.pathname)?null:`${t.protocol}//${t.host}${t.pathname}${t.search}`}function NI(e){let t=e.startsWith("#")?e.slice(1):e;return TI(new URLSearchParams(t).get("b"))}function AI(e,t){let i=NI(e);if(!i)return null;let n=new URL(i);return t>0&&n.searchParams.set("ac_lost",String(Math.floor(t))),n.toString()}function Sf(){let e=AI(location.hash,vu);return e?(location.replace(e),!0):!1}function bk(e,t,i=5e3){let n=null,r=e.onState(s=>{s==="reconnecting"||s==="down"?(vu||(vu=Date.now()),n||(n=setTimeout(()=>{n=null,e.getState()!=="open"&&t()},i))):s==="open"&&(vu=0,n&&(clearTimeout(n),n=null))});return()=>{r(),n&&clearTimeout(n)}}function wf(e=location.hash){let t=e.startsWith("#")?e.slice(1):e;return new URLSearchParams(t).get("w")==="1"&&typeof window<"u"&&window.parent!==window}function yk(e,t=2e3){let i=()=>{if(e.getState()==="open")try{window.parent.postMessage({ac_console:"alive"},"*")}catch{}};i();let n=setInterval(i,t);return()=>clearInterval(n)}function xf(){try{window.parent.postMessage({ac_console:"lost",at:vu||Date.now()},"*")}catch{}}var vu,Cv=se(()=>{vu=0});var Ef,Sk=se(()=>{kt();Ef=class{constructor(t,i="zh"){fe(this,"token",t);fe(this,"lang",i);fe(this,"ws",null);fe(this,"seq",0);fe(this,"pending",new Map);fe(this,"subs",new Map);fe(this,"binHandlers",[]);fe(this,"stateListeners",new Set);fe(this,"state","connecting");fe(this,"retry",0);fe(this,"closed",!1);fe(this,"helloOk",null);fe(this,"helloWaiters",[])}setLang(t){this.lang=t}onState(t){return this.stateListeners.add(t),t(this.state),()=>this.stateListeners.delete(t)}getState(){return this.state}setState(t){this.state=t;for(let i of this.stateListeners)i(t)}connect(){if(this.closed)return;this.setState(this.retry===0?"connecting":"reconnecting");let t=new WebSocket(`ws://${location.host}/ws`);t.binaryType="arraybuffer",this.ws=t,t.onopen=()=>{t.send(JSON.stringify({t:"hello",token:this.token,v:1,lang:this.lang}))},t.onmessage=i=>{if(typeof i.data!="string"){this.onBinary(new Uint8Array(i.data));return}let n;try{n=JSON.parse(i.data)}catch{return}if(n.t==="hello.ok"){this.retry=0,this.helloOk=n,this.setState("open");let r=this.helloWaiters.splice(0);for(let s of r)s(n);for(let[s,a]of this.subs)this.call("sub.add",{ch:s,afterSeq:a.afterSeq?.()}).catch(()=>{});return}if(n.t==="res"){let r=n.id,s=this.pending.get(r);if(s)if(this.pending.delete(r),clearTimeout(s.timer),n.ok)s.res(n.r);else{let a=n.e,o=new Error(a?.message??g("api.requestFailed"));o.code=a?.code,s.rej(o)}return}if(n.t==="evt"){this.subs.get(n.ch)?.handler(n.ch,n.d);return}},t.onclose=()=>{this.ws=null;for(let[n,r]of this.pending)clearTimeout(r.timer),r.rej(new Error(g("api.connClosed"))),this.pending.delete(n);if(this.closed)return;this.retry++;let i=Math.min(1e3*Math.pow(2,this.retry-1),1e4);this.setState(this.retry>20?"down":"reconnecting"),setTimeout(()=>this.connect(),i)},t.onerror=()=>{}}waitHello(){return this.helloOk?Promise.resolve(this.helloOk):new Promise(t=>this.helloWaiters.push(t))}call(t,i,n=6e4){return new Promise((r,s)=>{let a=this.ws;if(!a||a.readyState!==WebSocket.OPEN){s(new Error(g("api.notConnected")));return}let o=++this.seq,l=setTimeout(()=>{this.pending.delete(o),s(new Error(g("api.timeout")))},n);this.pending.set(o,{res:r,rej:s,timer:l}),a.send(JSON.stringify({t:"req",id:o,m:t,p:i??{}}))})}subscribe(t,i,n){return this.subs.set(t,{handler:i,afterSeq:n}),this.state==="open"&&this.call("sub.add",{ch:t,afterSeq:n?.()}).catch(()=>{}),()=>{this.subs.delete(t),this.state==="open"&&this.call("sub.remove",{ch:t}).catch(()=>{})}}onBinaryFrame(t){return this.binHandlers.push(t),()=>{this.binHandlers=this.binHandlers.filter(i=>i!==t)}}onBinary(t){if(t.length<3)return;let i=t[0],n=t[1]<<8|t[2];for(let r of this.binHandlers)r(i,n,t.subarray(3))}sendBinary(t,i,n){let r=this.ws;if(!r||r.readyState!==WebSocket.OPEN)return;let s=new Uint8Array(3+n.length);s[0]=t,s[1]=i>>8&255,s[2]=i&255,s.set(n,3),r.send(s)}ping(){try{this.ws?.send(JSON.stringify({t:"ping"}))}catch{}}close(){this.closed=!0,this.ws?.close()}}});var Kr,bu=se(()=>{Da();Kr=Pn(e=>({state:"connecting",version:null,set:t=>e(t)}))});function ys(e,t=window.innerWidth){if(t<900)return yu;let i=e.sbHidden?0:e.sidebarWidth;return Bl(t-i-xk-wk,_a,yu)}function Pl(e,t=window.innerWidth){if(t<760)return Tv;let i=e.panelOpen?e.panelWidth:0;return Bl(t-i-xk-wk,ao,Tv)}function kf(e,t=window.innerWidth){let i=Bl(e.sidebarWidth,ao,Pl(e,t)),n=Bl(e.panelWidth,_a,ys({...e,sidebarWidth:i},t));return i=Bl(i,ao,Pl({...e,sidebarWidth:i,panelWidth:n},t)),n=Bl(n,_a,ys({...e,sidebarWidth:i,panelWidth:n},t)),{sidebarWidth:i,panelWidth:n}}var wk,xk,Bl,Cf=se(()=>{Qi();wk=300,xk=10,Bl=(e,t,i)=>Math.max(t,Math.min(i,e))});function va(e,t){let i=e().ws;i&&i.call("settings.set",{patch:t}).catch(()=>{})}var MI,ao,Tv,_a,yu,Nv,ue,Qi=se(()=>{Da();Cf();MI=["changes","files","terminal","preview"],ao=200,Tv=360,_a=320,yu=900,Nv=(e,t,i)=>Math.max(t,Math.min(i,e));ue=Pn((e,t)=>({ws:null,sidebarWidth:248,sbHidden:!1,sbOpen:!1,panelOpen:!1,panelTab:"changes",panelWidth:440,collapsed:{},currentProjectId:null,currentThreadId:null,bind:i=>e({ws:i}),hydrate:i=>{let n={};for(let a of i.collapsedProjects??[])n[a]=!0;let r={sidebarWidth:i.sidebarWidth??248,panelWidth:i.panel?.width??440,panelOpen:i.panel?.open??!1,sbHidden:i.sidebarHidden===!0},s=kf(r);e({sidebarWidth:s.sidebarWidth,sbHidden:r.sbHidden,panelOpen:r.panelOpen,panelTab:MI.includes(i.panel?.tab)?i.panel.tab:"changes",panelWidth:s.panelWidth,collapsed:n,currentProjectId:i.lastProjectId??null,currentThreadId:i.lastThreadId??null})},setSidebarWidth:i=>{let n=t(),r=Pl(n);i=Nv(Math.round(i),ao,r),e({sidebarWidth:i}),va(t,{sidebarWidth:i})},setPanelWidth:i=>{let n=t(),r=ys(n);i=Nv(Math.round(i),_a,r),e({panelWidth:i}),va(t,{panel:{open:t().panelOpen,tab:t().panelTab,width:i}})},openPanel:i=>{let n=i??t().panelTab,r=t(),s=Nv(r.panelWidth,_a,ys({...r,panelOpen:!0}));e({panelOpen:!0,panelTab:n,panelWidth:s}),va(t,{panel:{open:!0,tab:n,width:s}})},closePanel:()=>{e({panelOpen:!1}),va(t,{panel:{open:!1,tab:t().panelTab,width:t().panelWidth}})},setPanelTab:i=>{e({panelTab:i}),va(t,{panel:{open:t().panelOpen,tab:i,width:t().panelWidth}})},toggleSidebarHidden:()=>{let i=!t().sbHidden;e({sbHidden:i}),va(t,{sidebarHidden:i})},toggleSidebar:()=>{typeof window<"u"&&window.matchMedia?.("(max-width: 759px)").matches?t().setSbOpen(!t().sbOpen):t().toggleSidebarHidden()},setSbOpen:i=>e({sbOpen:i}),toggleCollapsed:i=>{let n={...t().collapsed};n[i]?delete n[i]:n[i]=!0,e({collapsed:n}),va(t,{collapsedProjects:Object.keys(n)})},select:(i,n)=>{e({currentProjectId:i,currentThreadId:n,sbOpen:!1}),va(t,{lastProjectId:i,lastThreadId:n})},reconcileSelection:(i,n)=>{let{currentProjectId:r,currentThreadId:s}=t();if(i.length===0){(r||s)&&t().select(null,null);return}let a=r;(!a||!i.some(l=>l.id===a))&&(a=null);let o=s;if(o){let l=n.find(c=>c.id===o);!l||!i.some(c=>c.id===l.projectId)||a&&l.projectId!==a?o=null:a||(a=l.projectId)}(a!==r||o!==s)&&t().select(a,o)}}))});async function Hl(){let e="claude";try{e=(await Ge.getState().ws.call("settings.get")).defaultProvider??"claude"}catch{}let t=Ge.getState().providers;return t.length?t.find(i=>i.id===e&&Ek(i))?.id??t.find(i=>Ek(i))?.id??e:e}function Ek(e){return e.enabled===!1||!e.available||e.status==="planned"?!1:e.status==="verified"||e.status==="experimental"?!0:e.ready!==!1}var Ge,Nn=se(()=>{Da();Qi();Ge=Pn((e,t)=>({ws:null,loaded:!1,projects:[],threads:[],providers:[],bind:async i=>{if(t().ws===i&&t().loaded)return;e({ws:i}),i.subscribe("sidebar",(l,c)=>{let u=c;!u||typeof u!="object"||(u.type==="project.upsert"?t().upsertProject(u.project):u.type==="project.remove"?(e({projects:t().projects.filter(d=>d.id!==u.id)}),ue.getState().reconcileSelection(t().projects,t().threads)):u.type==="thread.upsert"?t().upsertThread(u.thread):u.type==="thread.remove"&&(e({threads:t().threads.filter(d=>d.id!==u.id)}),ue.getState().reconcileSelection(t().projects,t().threads)))}),i.call("providers.list").then(l=>e({providers:l})).catch(()=>{});let[n,r]=await Promise.all([i.call("projects.list"),i.call("threads.list")]),s=t(),a=new Map(n.map(l=>[l.id,l]));for(let l of s.projects)a.set(l.id,l);let o=new Map(r.map(l=>[l.id,l]));for(let l of s.threads)o.set(l.id,l);e({projects:[...a.values()].sort((l,c)=>l.createdAt-c.createdAt),threads:[...o.values()],loaded:!0}),ue.getState().reconcileSelection(t().projects,t().threads)},upsertProject:i=>{let n=t().projects.filter(r=>r.id!==i.id);e({projects:[...n,i].sort((r,s)=>r.createdAt-s.createdAt)})},upsertThread:i=>{let n=t().threads.filter(r=>r.id!==i.id);e({threads:[...n,i]})}}))});var Ck=ye(Tf=>{"use strict";var OI=Symbol.for("react.transitional.element"),RI=Symbol.for("react.fragment");function kk(e,t,i){var n=null;if(i!==void 0&&(n=""+i),t.key!==void 0&&(n=""+t.key),"key"in t){i={};for(var r in t)r!=="key"&&(i[r]=t[r])}else i=t;return t=i.ref,{$$typeof:OI,type:e,key:n,ref:t!==void 0?t:null,props:i}}Tf.Fragment=RI;Tf.jsx=kk;Tf.jsxs=kk});var _e=ye((B9,Tk)=>{"use strict";Tk.exports=Ck()});function Ak(e){let[t,i]=(0,It.useState)(()=>window.matchMedia?.(e).matches??!1);return(0,It.useEffect)(()=>{let n=window.matchMedia?.(e);if(!n)return;let r=()=>i(n.matches);return n.addEventListener?.("change",r),r(),()=>n.removeEventListener?.("change",r)},[e]),t}function Mk(e,t,i){let n=(0,It.useRef)(0),r=(0,It.useRef)(0),[s,a]=(0,It.useState)(!1),o=(0,It.useCallback)(l=>{l.preventDefault(),n.current=l.clientX,r.current=e(),a(!0),document.body.classList.add("col-drag");let c=d=>t(r.current,d.clientX-n.current),u=()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",u),document.body.classList.remove("col-drag"),a(!1),i()};window.addEventListener("pointermove",c),window.addEventListener("pointerup",u)},[e,t,i]);return{drag:s,down:o}}function Ok({sidebar:e,topbar:t,children:i,panel:n}){let r=ue(),s=Ak("(max-width: 759px)"),a=Ak("(max-width: 899px)"),o=(0,It.useRef)(!1),l=(0,It.useRef)(!1),c=Mk((0,It.useCallback)(()=>ue.getState().sidebarWidth,[]),(0,It.useCallback)((h,f)=>{o.current=!0;let p=ue.getState(),_=Pl(p);ue.setState({sidebarWidth:Nk(Math.round(h+f),ao,_)})},[]),(0,It.useCallback)(()=>{o.current&&(o.current=!1,ue.getState().setSidebarWidth(ue.getState().sidebarWidth))},[])),u=Mk((0,It.useCallback)(()=>ue.getState().panelWidth,[]),(0,It.useCallback)((h,f)=>{l.current=!0;let p=ue.getState(),_=ys(p);ue.setState({panelWidth:Nk(Math.round(h-f),_a,_)})},[]),(0,It.useCallback)(()=>{l.current&&(l.current=!1,ue.getState().setPanelWidth(ue.getState().panelWidth))},[]));(0,It.useEffect)(()=>{let h=f=>{if(!(f.ctrlKey||f.metaKey))return;let p=f.key.toLowerCase();if(p==="b")f.preventDefault(),ue.getState().toggleSidebar();else if(p==="j"){f.preventDefault();let _=ue.getState();_.panelOpen?_.closePanel():_.openPanel()}};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[]),(0,It.useEffect)(()=>{document.documentElement.style.setProperty("--sb-w",`${r.sidebarWidth}px`)},[r.sidebarWidth]),(0,It.useEffect)(()=>{document.documentElement.style.setProperty("--pn-w",`${r.panelWidth}px`)},[r.panelWidth]),(0,It.useEffect)(()=>{let h=()=>{let f=ue.getState(),p=kf(f);p.sidebarWidth!==f.sidebarWidth&&ue.getState().setSidebarWidth(p.sidebarWidth),p.panelWidth!==f.panelWidth&&ue.getState().setPanelWidth(p.panelWidth)};return window.addEventListener("resize",h),h(),()=>window.removeEventListener("resize",h)},[]);let d=r.sbOpen||r.panelOpen&&a;return(0,Ss.jsxs)("div",{className:"app",children:[(0,Ss.jsx)("aside",{className:`sidebar${r.sbHidden&&!s?" w-hide":""}${r.sbOpen?" open":""}`,children:e}),(0,Ss.jsx)("div",{className:`rs rs-l${c.drag?" drag":""}`,onPointerDown:c.down}),(0,Ss.jsxs)("main",{className:"main",children:[t,i]}),(0,Ss.jsx)("div",{className:`rs rs-r${u.drag?" drag":""}`,onPointerDown:u.down}),(0,Ss.jsx)("section",{className:`panel${r.panelOpen?" open":" w-hide"}`,"aria-hidden":!r.panelOpen,children:n}),(0,Ss.jsx)("div",{className:`scrim${d?" show":""}`,onClick:()=>{ue.getState().setSbOpen(!1),ue.getState().panelOpen&&a&&ue.getState().closePanel()}})]})}var It,Ss,Nk,Rk=se(()=>{It=te(mt(),1);Qi();Cf();Ss=te(_e(),1),Nk=(e,t,i)=>Math.max(t,Math.min(i,e))});function Vn(e){return!!e.isComposing||e.keyCode===229}var Ul=se(()=>{});function Av(e,t=Date.now()){let i=Math.max(0,t-e),n=Math.floor(i/6e4);if(n<1)return g("common.justNow");if(n<60)return pe("common.minutesAgo",{n});let r=Math.floor(n/60);if(r<24)return pe("common.hoursAgo",{n:r});let s=Math.floor(r/24);if(s<7)return pe("common.daysAgo",{n:s});let a=new Date(e),o=Td();return La()==="zh"?`${a.getMonth()+1}/${a.getDate()}`:a.toLocaleDateString(o,{month:"short",day:"numeric"})}function ql(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Nf(e){return`$${e.toFixed(2)}`}function Mv(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m${t%60?` ${t%60}s`:""}`}var Af=se(()=>{kt()});function Dk(e,t){return t.has(e.id)?"dot wait":e.status==="running"||e.status==="initializing"?"dot run":e.status==="error"||e.lastTurnStatus==="failed"?"dot err":e.lastTurnStatus==="completed"?"dot ok":"dot"}var Lk=se(()=>{});function oo({x:e,y:t,items:i,onClose:n}){let r=(0,ws.useRef)(null),[s,a]=(0,ws.useState)({left:e,top:t});return(0,ws.useLayoutEffect)(()=>{let o=r.current;if(!o)return;let l=o.getBoundingClientRect(),{left:c,top:u}=s;c+l.width>window.innerWidth-8&&(c=Math.max(8,window.innerWidth-l.width-8)),u+l.height>window.innerHeight-8&&(u=Math.max(8,window.innerHeight-l.height-8)),(c!==s.left||u!==s.top)&&a({left:c,top:u})},[e,t]),(0,ws.useEffect)(()=>{let o=c=>{r.current&&!r.current.contains(c.target)&&n()},l=c=>{c.key==="Escape"&&(c.stopPropagation(),n())};return window.addEventListener("pointerdown",o,!0),window.addEventListener("keydown",l,!0),()=>{window.removeEventListener("pointerdown",o,!0),window.removeEventListener("keydown",l,!0)}},[n]),(0,Ik.createPortal)((0,ba.jsx)("div",{ref:r,className:"menu",style:s,role:"menu",children:i.map((o,l)=>o.kind==="sep"?(0,ba.jsx)("div",{className:"msep"},l):o.kind==="label"?(0,ba.jsx)("div",{className:"mlabel",children:o.text},l):(0,ba.jsxs)("button",{className:`mi${o.danger?" danger":""}`,disabled:o.disabled,role:"menuitem",onClick:()=>{n(),o.onClick()},children:[(0,ba.jsx)("span",{children:o.label}),o.checked&&(0,ba.jsx)("span",{className:"mi-check",children:"\u2713"})]},l))}),document.body)}function Su(){let[e,t]=(0,ws.useState)(null);return[e,n=>{n.preventDefault(),n.stopPropagation(),t({x:n.clientX,y:n.clientY})},()=>t(null)]}var ws,Ik,ba,Mf=se(()=>{ws=te(mt(),1),Ik=te(qs(),1),ba=te(_e(),1)});function Gr({title:e,children:t,footer:i,onClose:n,wide:r}){return(0,zk.useEffect)(()=>{let s=a=>{a.key==="Escape"&&!document.querySelector("[data-select-menu]")&&(a.stopPropagation(),n())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[n]),(0,Bk.createPortal)((0,hn.jsx)("div",{className:"dlg-scrim",onPointerDown:s=>{s.target===s.currentTarget&&n()},children:(0,hn.jsxs)("div",{className:"dlg",style:r?{width:560}:void 0,role:"dialog","aria-label":e,children:[(0,hn.jsx)("div",{className:"dlg-title",children:e}),(0,hn.jsx)("div",{className:"dlg-body",children:t}),i&&(0,hn.jsx)("div",{className:"dlg-foot",children:i})]})}),document.body)}function Fl({title:e,body:t,okLabel:i,danger:n,onOk:r,onClose:s}){let a=i??g("common.ok");return(0,hn.jsx)(Gr,{title:e,onClose:s,footer:(0,hn.jsxs)(hn.Fragment,{children:[(0,hn.jsx)("button",{className:"btn ghost",onClick:s,children:g("common.cancel")}),(0,hn.jsx)("button",{className:`btn${n?" danger":" primary"}`,onClick:()=>{s(),r()},children:a})]}),children:(0,hn.jsx)("div",{className:"dlg-hint",style:{fontSize:"var(--fs-m)",color:"var(--fg)"},children:t})})}var zk,Bk,hn,$l=se(()=>{zk=te(mt(),1),Bk=te(qs(),1);kt();hn=te(_e(),1)});function ie({name:e,size:t=16}){let i=DI[e];return i?(0,Ov.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:LI.has(e)?"currentColor":"none",stroke:"currentColor",strokeWidth:II.has(e)?"2.2":"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,Ov.jsx)("path",{d:i})}):null}var Ov,DI,LI,II,An=se(()=>{Ov=te(_e(),1),DI={plus:"M12 5v14M5 12h14",file:"M6 3h8l4 4v14H6zM14 3v4h4",arrowLeft:"M19 12H5m6-6-6 6 6 6",arrowRight:"M5 12h14m-6-6 6 6-6 6",external:"M14 4h6v6M20 4l-9 9M18 14v6H4V6h6",globe:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-9 9h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3Z",panelLeft:"M4 5h16v14H4zM9.5 5v14",widen:"M4 12h16M8 8l-4 4 4 4M16 8l4 4-4 4",search:"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14Zm10 17-4.5-4.5",caret:"M9 6l6 6-6 6",dots:"M5 12h.01M12 12h.01M19 12h.01",pin:"M9 4h6l1 7 3 3v2H5v-2l3-3 1-7Zm3 12v4",send:"M4 12 20 4l-4 8 4 8-16-8Zm0 0h8",stop:"M7 7h10v10H7z",attach:"M8 12l6-6a3.5 3.5 0 0 1 5 5l-7 7a5 5 0 0 1-7-7l6-6",menu:"M4 6h16M4 12h16M4 18h16",changes:"M7 4v13m0 0a3 3 0 1 0 .01 0M7 17a3 3 0 1 1-.01 0M17 7v13m0-13a3 3 0 1 0 .01 0M17 7a3 3 0 1 1-.01 0",files:"M4 4h6l2 3h8v13H4V4Z",term:"M4 5h16v14H4zM7 9l3 3-3 3m5 0h5",x:"M6 6l12 12M18 6 6 18",refresh:"M20 11a8 8 0 1 0-2.3 6.3M20 5v6h-6",copy:"M8 8h11v12H8zM5 16V4h11",check:"M5 13l4 4L19 7",gauge:"M5.6 18.4a9 9 0 1 1 12.8 0M12 13l3.5-3.5M12 13h.01",arrowUp:"M12 19V5m-6 6 6-6 6 6",stopFill:"M8 8h8v8H8z",shield:"M12 3l8 3v6c0 5-3.5 9-8 11-4.5-2-8-6-8-11V6l8-3z",quote:"M5 7h5v5H7c0 2 1 3 3 4M14 7h5v5h-3c0 2 1 3 3 4",chat:"M5 5h14v10H9l-4 4V5zM9 10h.01M12 10h.01M15 10h.01",pencil:"M4 20h4L19 9a2.1 2.1 0 0 0-3-3L5 17v3zM14 7l3 3",shieldCheck:"M12 3l8 3v6c0 5-3.5 9-8 11-4.5-2-8-6-8-11V6l8-3zM8.5 12.2l2.4 2.4 4.6-4.8",zap:"M13 2L4 14h7l-1 8 9-12h-7l1-8z",prompt:"M5 7l5 5-5 5M12 17h7",fileText:"M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 16h6",layers:"M12 3l9 5-9 5-9-5 9-5zM3 13l9 5 9-5",wrench:"M14.7 6.3a4 4 0 0 0-5.4 5.4L4 17l3 3 5.3-5.3a4 4 0 0 0 5.4-5.4l-2.5 2.5-2.4-.6-.6-2.4z",spark:"M12 4v4M12 16v4M4 12h4M16 12h4M6.6 6.6l2.2 2.2M15.2 15.2l2.2 2.2M6.6 17.4l2.2-2.2M15.2 8.8l2.2-2.2",clock:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 7v5l3 2",hourglass:"M7 3h10M7 21h10M8 3c0 4.5 8 4.5 8 9s-8 4.5-8 9M16 3c0 4.5-8 4.5-8 9s8 4.5 8 9",cpu:"M6 6h12v12H6zM10 10h4v4h-4zM9 3v3M15 3v3M9 18v3M15 18v3M3 9h3M3 15h3M18 9h3M18 15h3",wrap:"M4 6h16M4 12h13a3 3 0 0 1 0 6h-4m2-2-2 2 2 2M4 18h5",listChecks:"M4 7l2 2 3-3M4 15l2 2 3-3M12 8h8M12 16h8",circle:"M12 4.5a7.5 7.5 0 1 0 0 15 7.5 7.5 0 0 0 0-15z",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"},LI=new Set(["stopFill"]),II=new Set(["arrowUp"])});function Hk(){let e=Pk(t=>t.list);return e.length===0?null:(0,Rv.jsx)("div",{className:"toasts",children:e.map(t=>(0,Rv.jsx)("div",{className:`toast${t.err?" err":""}`,children:t.text},t.id))})}var Rv,zI,Pk,we,fr=se(()=>{Da();Rv=te(_e(),1),zI=0,Pk=Pn(e=>({list:[],push:(t,i)=>{let n=++zI;e(r=>({list:[...r.list,{id:n,text:t,err:i}]})),setTimeout(()=>e(r=>({list:r.list.filter(s=>s.id!==n)})),3500)}})),we=(e,t=!1)=>Pk.getState().push(e,t)});function qk({pendingByThread:e}){let{projects:t,threads:i}=Ge(),n=ue(),[r,s]=(0,Qe.useState)(""),[a,o]=(0,Qe.useState)({}),[l,c]=(0,Qe.useState)({}),[u,d]=(0,Qe.useState)(null),[h,f]=(0,Qe.useState)(""),[p,_]=(0,Qe.useState)(!1),[y,m]=(0,Qe.useState)(null),[v,b]=(0,Qe.useState)(null),[w,k]=(0,Qe.useState)(null),[O,N,C]=Su(),[M,z,q]=Su(),B=(0,Qe.useRef)({}),I=(0,Qe.useRef)(null);(0,Qe.useEffect)(()=>{let U=xe=>{let me=xe.detail?.projectId,Fe=t.find(Q=>Q.id===me)??t[0];Fe&&m(Fe)},Z=()=>_(!0);return window.addEventListener("open-import",U),window.addEventListener("open-new-project",Z),()=>{window.removeEventListener("open-import",U),window.removeEventListener("open-new-project",Z)}},[t]);let x=(0,Qe.useMemo)(()=>{let U=r.trim().toLowerCase();return U?i.filter(Z=>Z.title.toLowerCase().includes(U)):i},[i,r]),H=(0,Qe.useMemo)(()=>{let U=new Map;for(let Z of x)(!Z.archived||a[Z.projectId])&&(U.get(Z.projectId)??U.set(Z.projectId,[]).get(Z.projectId)).push(Z);for(let Z of U.values())Z.sort((xe,me)=>Number(xe.archived)-Number(me.archived)||Number(me.pinned)-Number(xe.pinned)||me.updatedAt-xe.updatedAt);return U},[x,a]),T=(0,Qe.useMemo)(()=>{let U=new Map;for(let Z of x)Z.archived&&U.set(Z.projectId,(U.get(Z.projectId)??0)+1);return U},[x]);async function L(U){try{let Z=await HI(),xe=await Hl(),me=await V.call("threads.create",{projectId:U,provider:xe,model:null,mode:Z.defaultMode??"default"});n.select(U,me.id)}catch(Z){we(g("sidebar.failNewThread")+Xe(Z),!0)}}function D(U){return[{kind:"item",label:g("common.rename"),onClick:()=>{d(U.id),f(U.title)}},{kind:"item",label:U.pinned?g("sidebar.unpin"):g("sidebar.pin"),onClick:()=>{V.call("threads.update",{id:U.id,pinned:!U.pinned})}},{kind:"item",label:U.archived?g("sidebar.unarchive"):g("sidebar.archive"),onClick:()=>{P(U)}},{kind:"item",label:g("sidebar.exportMd"),onClick:()=>{FI(U)}},{kind:"sep"},{kind:"item",label:g("common.delete"),danger:!0,onClick:()=>b({title:g("sidebar.deleteThread"),body:pe("sidebar.deleteThreadBody",{title:U.title}),onOk:()=>{V.call("threads.delete",{id:U.id})}})}]}async function P(U){try{await V.call("threads.update",{id:U.id,archived:!U.archived}),U.archived?we(g("sidebar.unarchived")):(o(Z=>({...Z,[U.projectId]:!0})),we(g("sidebar.archivedHint")))}catch(Z){we(Xe(Z),!0)}}function Y(U){return[{kind:"item",label:g("sidebar.newThread"),onClick:()=>{L(U.id)}},{kind:"item",label:g("sidebar.importHist"),onClick:()=>m(U)},{kind:"item",label:g("common.rename"),onClick:()=>k(U)},{kind:"item",label:g("sidebar.openExplorer"),onClick:()=>{V.call("projects.open",{id:U.id})}},{kind:"sep"},{kind:"item",label:a[U.id]?g("sidebar.hideArchived"):g("sidebar.showArchived"),onClick:()=>o(Z=>({...Z,[U.id]:!Z[U.id]}))},{kind:"sep"},{kind:"item",label:g("sidebar.removeProject"),danger:!0,onClick:()=>b({title:g("sidebar.removeProject"),body:pe("sidebar.removeProjectBody",{name:U.name}),onOk:()=>{V.call("projects.remove",{id:U.id})}})}]}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("div",{className:"sb-row",children:[(0,X.jsx)(Dv,{}),(0,X.jsxs)("button",{className:"sb-new",onClick:()=>_(!0),children:[(0,X.jsx)("span",{className:"sb-new-tile",children:(0,X.jsx)(ie,{name:"plus",size:12})}),g("sidebar.newProject")]}),(0,X.jsx)("button",{className:"ibtn",title:g("common.settings"),onClick:()=>window.dispatchEvent(new CustomEvent("open-settings")),children:(0,X.jsx)(ie,{name:"settings"})}),(0,X.jsx)("button",{className:"ibtn",title:g("sidebar.searchTitle"),onClick:()=>I.current?.focus(),children:(0,X.jsx)(ie,{name:"search"})})]}),(0,X.jsx)("div",{className:"sb-row sb-row-search",children:(0,X.jsxs)("div",{className:"sb-search",children:[(0,X.jsx)(ie,{name:"search",size:13}),(0,X.jsx)("input",{ref:I,placeholder:g("sidebar.filterPlaceholder"),value:r,onChange:U=>s(U.target.value),onKeyDown:U=>{U.key==="Escape"&&s("")}})]})}),(0,X.jsxs)("div",{className:"sb-list",children:[t.length===0&&(0,X.jsxs)("div",{className:"sb-start",children:[(0,X.jsx)("div",{className:"sb-start-t",children:g("sidebar.noProjectsTitle")}),(0,X.jsx)("div",{className:"sb-start-s",children:g("sidebar.noProjectsSub")}),(0,X.jsx)("button",{className:"btn primary",onClick:()=>_(!0),children:g("sidebar.newProject")})]}),t.map(U=>{let Z=H.get(U.id)??[],xe=n.collapsed[U.id],me=T.get(U.id)??0,Fe=l[U.id]?Z:Z.slice(0,Uk);return(0,X.jsxs)("div",{className:"pj-group",children:[(0,X.jsxs)("div",{className:"pj",onContextMenu:Q=>{B.current.project=U,N(Q)},children:[(0,X.jsxs)("button",{className:"pj-toggle",onClick:()=>n.toggleCollapsed(U.id),children:[(0,X.jsx)("span",{className:`pj-caret${xe?"":" open"}`,children:(0,X.jsx)(ie,{name:"caret"})}),(0,X.jsx)("span",{className:"pj-badge",children:U.name.slice(0,1)}),(0,X.jsx)("span",{className:"pj-name",children:U.name})]}),(0,X.jsx)("span",{className:"pj-count",children:Z.length||""}),(0,X.jsx)("button",{className:"pj-act",title:g("sidebar.newThread"),onClick:()=>{L(U.id)},children:(0,X.jsx)(ie,{name:"plus"})}),(0,X.jsx)("button",{className:"pj-act",title:g("sidebar.projectMenu"),onClick:Q=>{B.current.project=U,N(Q)},children:(0,X.jsx)(ie,{name:"dots"})})]}),!xe&&(0,X.jsxs)("div",{className:"pj-sessions",children:[Fe.map(Q=>u===Q.id?(0,X.jsx)("div",{className:"t-item",children:(0,X.jsx)("input",{className:"t-rename",autoFocus:!0,value:h,onChange:ht=>f(ht.target.value),onBlur:()=>d(null),onKeyDown:ht=>{ht.key==="Enter"&&!Vn(ht.nativeEvent)&&h.trim()?(V.call("threads.update",{id:Q.id,title:h.trim()}),d(null)):ht.key==="Escape"&&d(null)}})},Q.id):(0,X.jsxs)("button",{className:`t-item${n.currentThreadId===Q.id?" on":""}${Q.archived?" archived":""}`,onClick:()=>n.select(U.id,Q.id),onContextMenu:ht=>{B.current.thread=Q,z(ht)},children:[(0,X.jsx)("span",{className:BI(Q,e)}),Q.pinned&&(0,X.jsx)("span",{className:"t-pin",children:(0,X.jsx)(ie,{name:"pin"})}),(0,X.jsx)("span",{className:"t-title",children:Nd(Q.title,Q.titleAuto)}),(0,X.jsx)("span",{className:"t-time",children:Av(Q.updatedAt)}),(0,X.jsx)("span",{className:"t-more",role:"button",onClick:ht=>{ht.stopPropagation(),B.current.thread=Q,z(ht)},children:(0,X.jsx)(ie,{name:"dots"})})]},Q.id)),Z.length>Uk&&!l[U.id]&&(0,X.jsx)("button",{className:"pj-more",onClick:()=>c(Q=>({...Q,[U.id]:!0})),children:pe("sidebar.showAll",{n:Z.length})}),me>0&&(0,X.jsx)("button",{className:"pj-more",onClick:()=>o(Q=>({...Q,[U.id]:!Q[U.id]})),children:a[U.id]?g("sidebar.hideArchived"):pe("sidebar.archivedN",{n:me})}),Z.length===0&&me===0&&(0,X.jsx)("div",{className:"pj-empty",children:g("sidebar.noThreads")})]})]},U.id)})]}),O&&B.current.project&&(0,X.jsx)(oo,{x:O.x,y:O.y,items:Y(B.current.project),onClose:C}),M&&B.current.thread&&(0,X.jsx)(oo,{x:M.x,y:M.y,items:D(B.current.thread),onClose:q}),p&&(0,X.jsx)(UI,{onClose:()=>_(!1)}),y&&(0,X.jsx)(qI,{project:y,onClose:()=>m(null)}),v&&(0,X.jsx)(Fl,{title:v.title,body:v.body,danger:!0,onOk:v.onOk,onClose:()=>b(null)}),w&&(0,X.jsx)(PI,{project:w,onClose:()=>k(null)})]})}function PI({project:e,onClose:t}){let[i,n]=(0,Qe.useState)(e.name),r=i.trim().length>0&&i.trim()!==e.name,s=()=>{r&&V.call("projects.rename",{id:e.id,name:i.trim()}).then(t).catch(a=>we(g("sidebar.failRename")+Xe(a),!0))};return(0,X.jsx)(Gr,{title:g("sidebar.renameProject"),onClose:t,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("button",{className:"btn ghost",onClick:t,children:g("common.cancel")}),(0,X.jsx)("button",{className:"btn primary",disabled:!r,onClick:s,children:g("common.save")})]}),children:(0,X.jsxs)("div",{className:"dlg-row",children:[(0,X.jsx)("label",{children:g("sidebar.projectName")}),(0,X.jsx)("input",{className:"tinput",autoFocus:!0,value:i,onChange:a=>n(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!Vn(a.nativeEvent)&&s()}})]})})}function HI(){return V.call("settings.get").then(e=>e).catch(()=>({}))}function UI({onClose:e}){let[t,i]=(0,Qe.useState)(""),[n,r]=(0,Qe.useState)(null),[s,a]=(0,Qe.useState)([]),[o,l]=(0,Qe.useState)(!1),c=ue();(0,Qe.useEffect)(()=>{V.call("fs.recentDirs").then(h=>a(h)).catch(()=>{})},[]),(0,Qe.useEffect)(()=>{let h=t.trim();if(!h){r(null);return}let f=setTimeout(()=>{V.call("fs.check",{path:h}).then(p=>r(p)).catch(()=>r(null))},200);return()=>clearTimeout(f)},[t]);let u=n?.exists&&n.isDir;async function d(){if(!(!u||o)){l(!0);try{let h=await V.call("projects.create",{path:t.trim()});c.select(h.id,null),e()}catch(h){we(g("sidebar.failAddProject")+Xe(h),!0),l(!1)}}}return(0,X.jsxs)(Gr,{title:g("sidebar.newProjectDlg"),onClose:e,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("button",{className:"btn ghost",onClick:e,children:g("common.cancel")}),(0,X.jsx)("button",{className:"btn primary",disabled:!u||o,onClick:()=>{d()},children:g("common.add")})]}),children:[(0,X.jsxs)("div",{className:"dlg-row",children:[(0,X.jsx)("label",{children:g("sidebar.dirLabel")}),(0,X.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,X.jsx)("input",{className:`tinput${n&&!u?" err":""}`,style:{flex:1},autoFocus:!0,placeholder:"D:\\\\path\\\\to\\\\project",value:t,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&!Vn(h.nativeEvent)&&d()}}),(0,X.jsx)("button",{className:"btn",style:{flex:"none",whiteSpace:"nowrap"},onClick:()=>{V.call("fs.pickFolder",{initial:t.trim()||void 0}).then(h=>{let f=h;f?.path?i(f.path):f&&!f.available&&we(g("sidebar.pickFolderUnsupported"))}).catch(()=>we(g("sidebar.pickFolderFailed")))},children:g("common.browse")})]}),n&&!n.exists&&(0,X.jsx)("div",{className:"dlg-hint err",children:g("sidebar.dirMissing")}),n&&n.exists&&!n.isDir&&(0,X.jsx)("div",{className:"dlg-hint err",children:g("sidebar.notDir")}),u&&(0,X.jsx)("div",{className:"dlg-hint",children:g("sidebar.dirOk")})]}),s.length>0&&(0,X.jsxs)("div",{className:"dlg-row",children:[(0,X.jsx)("label",{children:g("sidebar.recent")}),s.map(h=>(0,X.jsx)("button",{className:"mi",style:{height:26},onClick:()=>i(h),children:h},h))]})]})}function qI({project:e,onClose:t}){let[i,n]=(0,Qe.useState)(null),[r,s]=(0,Qe.useState)(new Set),[a,o]=(0,Qe.useState)(!1),l=ue();(0,Qe.useEffect)(()=>{V.call("history.list",{projectId:e.id}).then(d=>n(d)).catch(d=>{we(g("sidebar.failImportList")+Xe(d),!0),n([])})},[e.id]);let c=d=>{s(h=>{let f=new Set(h);return f.has(d)?f.delete(d):f.add(d),f})};async function u(){if(!(a||r.size===0||!i)){o(!0);try{let d=i.filter(f=>r.has(f.sessionId)&&!f.imported),h=await V.call("history.import",{projectId:e.id,items:d.map(f=>({provider:f.provider,sessionId:f.sessionId,title:f.title}))});we(pe("sidebar.importedN",{n:h.length})),h.length>0&&l.select(e.id,h[h.length-1].id),t()}catch(d){we(g("sidebar.failImport")+Xe(d),!0)}finally{o(!1)}}}return(0,X.jsxs)(Gr,{title:pe("sidebar.importTitle",{name:e.name}),onClose:t,wide:!0,footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("button",{className:"btn ghost",onClick:t,children:g("common.cancel")}),(0,X.jsx)("button",{className:"btn primary",disabled:a||r.size===0,onClick:()=>{u()},children:a?g("sidebar.importing"):pe("sidebar.importN",{n:r.size||0})})]}),children:[i===null&&(0,X.jsx)("div",{className:"dlg-hint",children:g("sidebar.scanning")}),i!==null&&i.length===0&&(0,X.jsx)("div",{className:"dlg-hint",children:g("sidebar.importEmpty")}),i!==null&&i.length>0&&(0,X.jsx)("div",{className:"imp-list",children:i.map(d=>(0,X.jsxs)("label",{className:`imp-row${d.imported?" done":""}`,children:[(0,X.jsx)("input",{type:"checkbox",disabled:d.imported,checked:r.has(d.sessionId),onChange:()=>c(d.sessionId)}),(0,X.jsx)("span",{className:"imp-title",children:d.title}),(0,X.jsxs)("span",{className:"imp-meta",children:[d.provider," \xB7 ",d.messageCount,g("common.messages")," \xB7 ",Av(d.updatedAt),d.imported?g("common.imported"):""]})]},d.sessionId))})]})}async function FI(e){try{let t=await V.call("thread.exportMarkdown",{id:e.id});if(t.path){we(pe("sidebar.exportSaved",{path:t.path}));return}let i=new Blob([t.markdown],{type:"text/markdown;charset=utf-8"}),n=document.createElement("a");n.href=URL.createObjectURL(i),n.download=t.filename||`${e.title}.md`,n.style.display="none",document.body.appendChild(n),n.click(),setTimeout(()=>{URL.revokeObjectURL(n.href),n.remove()},5e3)}catch(t){we(g("sidebar.failExport")+Xe(t),!0)}}function Dv({className:e=""}){let t=ue(r=>r.sbHidden),i=ue(r=>r.sbOpen),n=g(t&&!i?"sidebar.expand":"sidebar.collapse");return(0,X.jsx)("button",{type:"button",className:`ibtn sb-toggle ${e}`,title:`${n} (Ctrl+B)`,"aria-label":n,"aria-expanded":!t||i,onClick:()=>ue.getState().toggleSidebar(),children:(0,X.jsx)(ie,{name:"panelLeft"})})}var Qe,X,Uk,BI,Lv=se(()=>{Qe=te(mt(),1);Ul();Nn();Qi();Pi();Af();Lk();Mf();$l();An();fr();kt();X=te(_e(),1),Uk=10,BI=Dk});function Bv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function Qk(e){po=e}function lo(e){let t=[];return i=>{let n=Math.max(0,Math.min(3,i-1)),r=t[n];return r||(r=e(n),t[n]=r),r}}function Ne(e,t=""){let i=typeof e=="string"?e:e.source,n={replace:(r,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(ci.caret,"$1"),i=i.replace(r,a),n},getRegex:()=>new RegExp(i,t)};return n}function Mn(e,t){if(t){if(ci.escapeTest.test(e))return e.replace(ci.escapeReplace,Kk)}else if(ci.escapeTestNoEncode.test(e))return e.replace(ci.escapeReplaceNoEncode,Kk);return e}function qz(e){return ci.numericCharacterReference.test(e)?e.replace(ci.numericCharacterReferenceOrAmpersand,(t,i,n)=>{if(i===void 0&&n===void 0)return"&";let r=i===void 0?Number.parseInt(n,16):Number.parseInt(i,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":r===38?"&":String.fromCodePoint(r)}):e}function Gk(e){try{e=encodeURI(e).replace(ci.percentDecode,"%")}catch{return null}return e}function jk(e,t){let i=e.replace(ci.findPipe,(s,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),n=i.split(ci.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(ci.slashPipe,"|");return n}function ya(e,t,i){let n=e.length;if(n===0)return"";let r=0;for(;r<n;){let s=e.charAt(n-r-1);if(s===t&&!i)r++;else if(s!==t&&i)r++;else break}return e.slice(0,n-r)}function Yk(e){let t=e.split(`
|
|
`),i=t.length-1;for(;i>=0&&ci.blankLine.test(t[i]);)i--;return t.length-i<=2?e:t.slice(0,i+1).join(`
|
|
`)}function If(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function Vk(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let i=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])i++;else if(e[n]===t[1]&&(i--,i<0))return n;return i>0?-2:-1}function Rf(e,t=0){let i=t,n="";for(let r of e)if(r===" "){let s=4-i%4;n+=" ".repeat(s),i+=s}else n+=r,i++;return n}function Xk(e,t,i,n,r){let s=t.href,a=t.title||null,o=e[1].replace(r.other.outputLinkReplace,"$1"),l=e[0].charAt(0)==="!",c=n.state.inLink,u=n.state.linkEmitted,d=n.state.inRawBlock;n.state.inLink=!0,n.state.linkEmitted=!1;let h=n.inlineTokens(o),f=n.state.linkEmitted;if(n.state.linkEmitted=u,n.state.inLink=c,!l){if(f){n.state.inRawBlock=d;return}n.state.linkEmitted=!0}return{type:l?"image":"link",raw:i,href:s,title:a,text:o,tokens:h}}function Fz(e,t,i){let n=e.match(i.other.indentCodeCompensation);if(n===null)return t;let r=n[1];return t.split(`
|
|
`).map(s=>{let a=s.match(i.other.beginningSpace);if(a===null)return s;let[o]=a;return s.slice(Math.min(o.length,r.length))}).join(`
|
|
`)}function Zk(e,t,i,n){if(!t.includes("<"))return!1;for(let r=0;r<t.length;r++){if(t[r]==="\\"){r++;continue}if(t[r]==="`"){let o=n.inline.code.exec(t.slice(r));if(o){r+=o[0].length-1;continue}}if(t[r]!=="<")continue;let s=e.slice(i+r),a=n.inline.tag.exec(s)||n.inline.autolink.exec(s);if(a){if(a[0].length>t.length-r)return!0;r+=a[0].length-1}}return!1}function co(e,t){if(Array.isArray(t))for(let i=0;i<t.length;i++)e.push(t[i]);else e.push(t)}function Je(e,t){return fo.parse(e,t)}function Wz(...e){return fo.use(...e),Je.defaults=fo.defaults,Qk(Je.defaults),Je}var po,uo,$I,ci,WI,KI,GI,Eu,jI,Pv,Jk,eC,YI,Hv,VI,Uv,XI,ZI,ku,qv,QI,tC,JI,ez,tz,Fv,Fk,iz,nz,rz,sz,iC,az,jr,Gl,Cu,oz,lz,nC,cz,uz,dz,rC,hz,fz,pz,mz,sC,gz,_z,vz,bz,yz,Sz,wz,xz,Ez,kz,Cz,Tz,Nz,Az,Mz,aC,Lf,Oz,Rz,Dz,$k,Lz,Iz,Wk,zz,Bz,$v,Pz,Iv,Hz,Of,wu,Uz,Kk,Wl,Kl,oC,lC,ho,pr,zf,Wv,mr,Df,xu,$z,fo,c7,u7,d7,h7,f7,p7,cC=se(()=>{po=Bv();uo={exec:()=>null};$I=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),ci={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:lo(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:lo(e=>new RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:lo(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:lo(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:lo(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:lo(e=>new RegExp(`^ {0,${e}}(?:</?(?:${ku})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:lo(e=>new RegExp(`^ {0,${e}}>`))},WI=/^(?:[ \t]*(?:\n|$))+/,KI=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,GI=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Eu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,jI=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pv=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Jk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,eC=Ne(Jk).replace(/bull/g,Pv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),YI=Ne(Jk).replace(/bull/g,Pv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Hv=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,VI=/^[^\n]+/,Uv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,XI=Ne(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Uv).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ZI=Ne(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Pv).getRegex(),ku="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",qv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,QI=Ne("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",qv).replace("tag",ku).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),tC=e=>Ne(Hv).replace("hr",Eu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",ku).getRegex(),JI=tC(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ez=tC(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),tz=Ne(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",ez).getRegex(),Fv={blockquote:tz,code:KI,def:XI,fences:GI,heading:jI,hr:Eu,html:QI,lheading:eC,list:ZI,newline:WI,paragraph:JI,table:uo,text:VI},Fk=Ne("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Eu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",ku).getRegex(),iz={...Fv,lheading:YI,table:Fk,paragraph:Ne(Hv).replace("hr",Eu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Fk).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",ku).getRegex()},nz={...Fv,html:Ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qv).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:uo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ne(Hv).replace("hr",Eu).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",eC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rz=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,sz=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,iC=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,az=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,jr=/[\p{P}\p{S}]/u,Gl=/[\s\p{P}\p{S}]/u,Cu=/[^\s\p{P}\p{S}]/u,oz=Ne(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Gl).getRegex(),lz=/[\p{Pi}\p{Ps}"']/u,nC=/(?!~)[\p{P}\p{S}]/u,cz=/(?!~)[\s\p{P}\p{S}]/u,uz=/(?:[^\s\p{P}\p{S}]|~)/u,dz=Ne(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",$I?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),rC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,hz=Ne(rC,"u").replace(/punct/g,jr).getRegex(),fz=Ne(rC,"u").replace(/punct/g,nC).getRegex(),pz=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,mz=Ne(pz,"u").replace(/openQuote/g,lz).replace(/punct/g,jr).getRegex(),sC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",gz=Ne(sC,"gu").replace(/notPunctSpace/g,Cu).replace(/punctSpace/g,Gl).replace(/punct/g,jr).getRegex(),_z=Ne(sC,"gu").replace(/notPunctSpace/g,uz).replace(/punctSpace/g,cz).replace(/punct/g,nC).getRegex(),vz="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",bz=Ne(vz,"gu").replace(/notPunctSpace/g,Cu).replace(/punctSpace/g,Gl).replace(/punct/g,jr).getRegex(),yz=Ne("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Cu).replace(/punctSpace/g,Gl).replace(/punct/g,jr).getRegex(),Sz="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",wz=Ne(Sz,"gu").replace(/notPunctSpace/g,Cu).replace(/punctSpace/g,Gl).replace(/punct/g,jr).getRegex(),xz=Ne(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,jr).getRegex(),Ez="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",kz=Ne(Ez,"gu").replace(/notPunctSpace/g,Cu).replace(/punctSpace/g,Gl).replace(/punct/g,jr).getRegex(),Cz=Ne(/\\(punct)/,"gu").replace(/punct/g,jr).getRegex(),Tz=Ne(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,jr).getRegex(),Nz=Ne(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Az=Ne(qv).replace("(?:-->|$)","-->").getRegex(),Mz=Ne("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Az).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),aC=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Lf=Ne(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",aC).getRegex(),Oz=Ne(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Lf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rz=Ne(/^!?\[(label)\]\[(ref)\]/).replace("label",Lf).replace("ref",Uv).getRegex(),Dz=Ne(/^!?\[(ref)\](?:\[\])?/).replace("ref",Uv).getRegex(),$k=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Lz=Ne(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",aC).getRegex(),Iz=Ne("reflink|nolink(?!\\()","g").replace("reflink",Ne(/^!?\[(label)\]\[(ref)\]/).replace("label",Lz).replace("ref",$k).getRegex()).replace("nolink",Ne(/^!?\[(ref)\](?:\[\])?/).replace("ref",$k).getRegex()).getRegex(),Wk=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zz=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Bz=Ne(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,zz).getRegex(),$v={_backpedal:uo,anyPunctuation:Cz,anyPunctuationOutsideCode:Tz,autolink:Nz,blockSkip:dz,br:iC,code:sz,del:uo,delLDelim:uo,delRDelim:uo,emStrongLDelim:hz,emStrongRDelimAst:gz,emStrongRDelimUnd:yz,escape:rz,link:Oz,nolink:Dz,punctuation:oz,reflink:Rz,reflinkSearch:Iz,tag:Mz,text:az,url:uo},Pz={...$v,emStrongLDelim:mz,emStrongRDelimAst:bz,emStrongRDelimUnd:wz,link:Ne(/^!?\[(label)\]\((.*?)\)/).replace("label",Lf).getRegex(),reflink:Ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lf).getRegex()},Iv={...$v,emStrongRDelimAst:_z,emStrongLDelim:fz,delLDelim:xz,delRDelim:kz,url:Ne(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Bz).replace("protocol",Wk).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ne(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Wk).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Hz={...Iv,br:Ne(iC).replace("{2,}","*").getRegex(),text:Ne(Iv.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Of={normal:Fv,gfm:iz,pedantic:nz},wu={normal:$v,gfm:Iv,breaks:Hz,pedantic:Pz},Uz={"&":"&","<":"<",">":">",'"':""","'":"'"},Kk=e=>Uz[e];Wl=class{constructor(e){fe(this,"options");fe(this,"rules");fe(this,"lexer");this.options=e||po}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let i=this.options.pedantic?t[0]:Yk(t[0]),n=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],n=Fz(i,t[3]||"",this.rules);return{type:"code",raw:i,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(this.rules.other.endingHash.test(i)){let n=ya(i,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceTabChar.test(n))&&(i=n.trim())}return{type:"heading",raw:ya(t[0],`
|
|
`),depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ya(t[0],`
|
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=ya(t[0],`
|
|
`).split(`
|
|
`),n="",r="",s=[];for(;i.length>0;){let a=!1,o=[],l;for(l=0;l<i.length;l++)if(this.rules.other.blockquoteStart.test(i[l]))o.push(i[l]),a=!0;else if(!a)o.push(i[l]);else break;i=i.slice(l);let c=o.join(`
|
|
`),u=c.replace(this.rules.other.blockquoteMarkerWhitespace,(f,p,_)=>p+Rf(_,p.length)).replace(this.rules.other.blockquoteSetextReplace,`
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
${c}`:c,r=r?`${r}
|
|
${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=d,i.length===0)break;let h=s.at(-1);if(h?.type==="code"||h?.type==="heading"||h?.type==="hr"||h?.type==="html")break;if(h?.type==="blockquote"){let f=h,p=i.join(`
|
|
`),_=f.raw+`
|
|
`+p.replace(this.rules.other.blockquoteSetextReplace2,""),y=this.blockquote(_);s[s.length-1]=y;let m=_.substring(y.raw.length).replace(/^\n/,""),v=m?m.split(`
|
|
`).length:0,b=v?i.slice(0,-v):i;b.length>0&&(n=`${n}
|
|
${b.join(`
|
|
`)}`),r=r.substring(0,r.length-f.text.length)+y.text;break}else if(h?.type==="list"){let f=h,p=f.raw+`
|
|
`+i.join(`
|
|
`),_=this.list(p);s[s.length-1]=_;let y=_.raw.length>f.raw.length?p.slice(f.raw.length+1,_.raw.length).split(`
|
|
`).length:0;if(y>0){let m=i.slice(0,y).join(`
|
|
`);n=`${n}
|
|
${m}`,r=`${r}
|
|
${m}`}i=i.slice(y);continue}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=e,n=()=>i.length-e.length,r=t[1].trim(),s=r.length>1,a={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let o=this.rules.other.listItemRegex(r),l=!1;for(;e;){let u=!1,d="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;let h=n();e=e.substring(t[0].length);let f=t[2].split(`
|
|
`,1)[0],p=t[1].length,_=this.options.pedantic?Rf(f,p):f.replace(this.rules.other.leadingSpaceTab,w=>Rf(w,p)),y=e.split(`
|
|
`,1)[0],m=!_.trim(),v=0;if(this.options.pedantic?(v=2,d=_.trimStart()):m?v=p+1:(v=_.search(this.rules.other.nonSpaceChar),v=v>4?1:v,d=_.slice(v),v+=p),m&&this.rules.other.blankLine.test(y)&&(e=e.substring(y.length+1),u=!0),!u){let w=this.rules.other.nextBulletRegex(v),k=this.rules.other.hrRegex(v),O=this.rules.other.fencesBeginRegex(v),N=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(v):this.rules.other.headingBeginRegex(v),C=this.rules.other.htmlBeginRegex(v),M=this.rules.other.blockquoteBeginRegex(v);for(;e;){let z=e.split(`
|
|
`,1)[0],q;if(y=z,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),q=y):q=y.replace(this.rules.other.leadingSpaceTab,B=>Rf(B)),O.test(y)||N.test(y)||C.test(y)||M.test(y)||w.test(y)||k.test(y))break;if(q.search(this.rules.other.nonSpaceChar)>=v||!y.trim())d+=`
|
|
`+q.slice(v);else{if(m||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||O.test(_)||N.test(_)||k.test(_))break;let B=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(y)&&this.rules.block.lheading.test(`${_}
|
|
${y}`)?` ${q.replace(/^ {0,3}/,"")}`:y;d+=`
|
|
`+B}m=!y.trim(),e=e.substring(z.length+1),_=q.slice(v)}}let b=i.slice(h,n());a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(l=!0)),a.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]})}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=i.slice(0,n()).trimEnd();for(let u of a.items)if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),!a.loose){let d=u.tokens.filter(f=>f.type==="space"),h=d.length>0&&d.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=h}for(let u of a.items){let d=u.tokens[0];if(u.task&&(d?.type==="text"||d?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(u.raw);if(h){let f={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};u.checked=f.checked,a.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=f.raw+u.tokens[0].raw,u.tokens[0].text=f.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(f)):u.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):u.tokens.unshift(f)}}else u.task&&(u.task=!1)}if(a.loose)for(let u of a.items){u.loose=!0;for(let d of u.tokens)d.type==="text"&&(d.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t){let i=Yk(t[0]);return{type:"html",block:!0,raw:i,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:i}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Vk(t[2],"()")!==-1)return;let i=If(t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:i,raw:ya(t[0],`
|
|
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let i=jk(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
`):[],s={type:"table",raw:ya(t[0],`
|
|
`),header:[],align:[],rows:[]};if(i.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<i.length;a++)s.header.push({text:i[a],tokens:this.lexer.inline(i[a]),header:!0,align:s.align[a]});for(let a of r)s.rows.push(jk(a,s.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[l]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let i=t[1].trim();return{type:"heading",raw:ya(t[0],`
|
|
`),depth:t[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let i=t[1].charAt(t[1].length-1)===`
|
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let i=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Zk(e,t[1],i,this.rules))return;let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=ya(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Vk(t[2],"()");if(a===-2)return;if(a>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],s=a[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Xk(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let n=i[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Zk(e,i[1],n,this.rules))return;let r=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[If(r)];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return Xk(i,s,i[0],this.lexer,this.rules)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||!n[1]&&!n[2]&&!n[3]&&!n[4])return;let r=n[0][0],s=i===r,a=t.length-e.length,o=a;for(;!this.options.pedantic&&o>0&&t[o-1]===r;)o--;let l=[...t.slice(Math.max(0,o-2),o)].at(-1)??"",c=l==="*"||l==="_"||!!this.rules.inline.punctuation.exec(l);o<a&&(i=l);let u=o<a?c:!!this.rules.inline.punctuation.exec(i);if(n[4]&&i.match(this.rules.other.unicodeAlphaNumeric))return;let d=n[1]||n[3]||"";if(!d||!i||u){let h=[...n[0]].length-1,f,p,_=h,y=0,m=a-o+h,v=!this.options.pedantic&&!!l.trim()&&(!!d||r==="*"&&!c),b=r==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,t=t.slice(-1*e.length+h);(n=b.exec(t))!==null;){if(f=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!f)continue;if(p=[...f].length,n[3]||n[4]){_+=p;continue}else if(n[5]||n[6]||v){if(s&&(n[5]||n[6]))break;if(m%3&&!((m+p)%3)){y+=p;continue}}if(_-=p,_>0)continue;p=Math.min(p,p+_+y);let w=[...n[0]][0].length,k=e.slice(0,h+n.index+w+p);if(Math.min(h,p)%2){let N=k.slice(1,-1);return{type:"em",raw:k,text:N,tokens:this.lexer.inlineTokens(N)}}let O=k.slice(2,-2);return{type:"strong",raw:k,text:O,tokens:this.lexer.inlineTokens(O)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(i),r=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return n&&r&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,i=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!i||this.rules.inline.punctuation.exec(i))){let r=[...n[0]].length-1,s,a,o=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+r);(n=l.exec(t))!==null;){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s||(a=[...s].length,a!==r))continue;if(n[3]||n[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let c=[...n[0]][0].length,u=e.slice(0,r+n.index+c+a),d=u.slice(r,-r);return{type:"del",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let i,n;return t[2]==="@"?(i=t[1],n="mailto:"+i):(i=t[1],n=i),{type:"link",raw:t[0],text:i,href:n,autolink:!0,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let i,n;if(t[2]==="@")i=t[0],n="mailto:"+i;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);i=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:i,href:n,autolink:!0,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let i=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:i?t[0]:qz(t[0]),escaped:i}}}},pr=(ho=class{constructor(t){Cy(this,Kl);fe(this,"tokens");fe(this,"options");fe(this,"state");fe(this,"inlineQueue");fe(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||po,this.options.tokenizer=this.options.tokenizer||new Wl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let i={other:ci,block:Of.normal,inline:wu.normal};this.options.pedantic?(i.block=Of.pedantic,i.inline=wu.pedantic):this.options.gfm&&(i.block=Of.gfm,this.options.breaks?i.inline=wu.breaks:i.inline=wu.gfm),this.tokenizer.rules=i}static get rules(){return{block:Of,inline:wu}}static lex(t,i){return new ho(i).lex(t)}static lexInline(t,i){return new ho(i).inlineTokens(t)}lex(t){t=t.replace(ci.carriageReturn,`
|
|
`),this.blockTokens(t,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let n=this.inlineQueue[i];this.state.inRawBlock=!1,this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,i=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(ci.tabCharGlobal," ").replace(ci.spaceLine,""));let r=1/0;for(;t;){if(t.length<r)r=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},t,i))?(t=t.substring(s.raw.length),i.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let o=i.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
|
|
`:i.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let o=i.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
`)?"":`
|
|
`)+s.raw,o.text+=`
|
|
`+s.text,this.inlineQueue.at(-1).src=o.text):i.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),i.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),i.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),i.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),i.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),i.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),i.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let o=i.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
`)?"":`
|
|
`)+s.raw,o.text+=`
|
|
`+s.raw,this.inlineQueue.at(-1).src=o.text):(this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title}),i.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),i.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),i.push(s);continue}let a=t;if(this.options.extensions?.startBlock){let o=1/0,l=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(o=Math.min(o,c))}),o<1/0&&o>=0&&(a=t.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(a))){let o=i.at(-1);n&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
|
|
`)?"":`
|
|
`)+s.raw,o.text+=`
|
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):i.push(s),n=a.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let o=i.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
`)?"":`
|
|
`)+s.raw,o.text+=`
|
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):i.push(s);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,i}inline(t,i=[]){return this.inlineQueue.push({src:t,tokens:i}),i}linkInText(t){if(!t.includes("["))return!1;let i=this.tokenizer.rules.inline.link;for(let n of t.matchAll(this.tokenizer.rules.inline.blockSkip))if(i.test(n[0])&&t.charAt(n.index-1)!=="!")return!0;for(let n of t.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=n[0],s=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,If(r.slice(s+1,-1))))&&!(s>1&&this.linkInText(r.slice(1,s-1))))return!0}return!1}inlineTokens(t,i=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&t.includes(")");try{return cm(this,Kl,oC).call(this,t,i)}finally{this.state.linkParenPossible=n}}infiniteLoopError(t){let i="Infinite loop on byte: "+t;if(this.options.silent)console.error(i);else throw new Error(i)}},Kl=new WeakSet,oC=function(t,i){let n=t.includes("*")||t.includes("_")||t.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==Wl.prototype.emStrong||this.tokenizer.del!==Wl.prototype.del?cm(this,Kl,lC).call(this,t):t,r=!1,s="",a=1/0;for(;t;){if(t.length<a)a=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}r||(s=""),r=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},t,i))?(t=t.substring(o.raw.length),i.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let c=i.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):i.push(o);continue}if(o=this.tokenizer.emStrong(t,n,s)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.del(t,n,s)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),i.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),i.push(o);continue}let l=t;if(this.options.extensions?.startInline){let c=1/0,u=t.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},u),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(o=this.tokenizer.inlineText(l)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(s=o.raw.slice(-1)),r=!0;let c=i.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):i.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return i},lC=function(t){let i=t;if(this.tokens.links&&t.includes("[")){let n=this.tokenizer.rules.inline.reflinkSearch,r=s=>{let a=s.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,If(s.slice(a+1,-1))))return s;if(a>1&&s.charAt(0)!=="!"){let o=s.slice(1,a-1);if(this.linkInText(o))return"["+o.replace(n,r)+"]["+"a".repeat(s.length-a-2)+"]"}return"["+"a".repeat(s.length-2)+"]"};i=i.replace(n,r)}return i=i.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(n,r,s)=>s?"+".repeat(n.length):r?r+n.slice(r.length,-r.length).replace(/`/g,"+")+r:n),i=i.replace(this.tokenizer.rules.inline.blockSkip,(n,r,s)=>{let a=s?s.length:0;return n.slice(0,a)+"["+"a".repeat(n.length-a-2)+"]"}),i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i,i},ho),zf=class{constructor(e){fe(this,"options");fe(this,"parser");this.options=e||po}space(e){return""}code({text:e,lang:t,escaped:i}){let n=(t||"").match(ci.notSpaceStart)?.[0],r=e?e.replace(ci.endingNewline,"")+`
|
|
`:"";return n?'<pre><code class="language-'+Mn(n)+'">'+(i?r:Mn(r,!0))+`</code></pre>
|
|
`:"<pre><code>"+(i?r:Mn(r,!0))+`</code></pre>
|
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
${this.parser.parse(e)}</blockquote>
|
|
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
`}hr(e){return`<hr>
|
|
`}list(e){let t=e.ordered,i=e.start,n="";for(let a=0;a<e.items.length;a++){let o=e.items[a];n+=this.listitem(o)}let r=t?"ol":"ul",s=t&&i!==1?' start="'+i+'"':"";return"<"+r+s+`>
|
|
`+n+"</"+r+`>
|
|
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
`}table(e){let t="",i="";for(let r=0;r<e.header.length;r++)i+=this.tablecell(e.header[r]);t+=this.tablerow({text:i});let n="";for(let r=0;r<e.rows.length;r++){let s=e.rows[r];i="";for(let a=0;a<s.length;a++)i+=this.tablecell(s[a]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
<thead>
|
|
`+t+`</thead>
|
|
`+n+`</table>
|
|
`}tablerow({text:e}){return`<tr>
|
|
${e}</tr>
|
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
|
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Mn(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:i,tokens:n,autolink:r}){let s=r?Mn(i,!0):this.parser.parseInline(n),a=Gk(e);if(a===null)return s;e=Mn(a,r);let o='<a href="'+e+'"';return t&&(o+=' title="'+Mn(t)+'"'),o+=">"+s+"</a>",o}image({href:e,title:t,text:i,tokens:n}){n&&(i=this.parser.parseInline(n,this.parser.textRenderer));let r=Gk(e);if(r===null)return Mn(i);e=r;let s=`<img src="${Mn(e)}" alt="${Mn(i)}"`;return t&&(s+=` title="${Mn(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Mn(e.text)}},Wv=class{constructor(){fe(this,"parser")}strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return""}checkbox({raw:e}){return e}},mr=class zv{constructor(t){fe(this,"options");fe(this,"renderer");fe(this,"textRenderer");this.options=t||po,this.options.renderer=this.options.renderer||new zf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Wv,this.textRenderer.parser=this}static parse(t,i){return new zv(i).parse(t)}static parseInline(t,i){return new zv(i).parseInline(t)}parse(t){this.renderer.parser=this;let i="";for(let n=0;n<t.length;n++){let r=t[n];if(this.options.extensions?.renderers?.[r.type]){let a=r,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){i+=o||"";continue}}let s=r;switch(s.type){case"space":{i+=this.renderer.space(s);break}case"hr":{i+=this.renderer.hr(s);break}case"heading":{i+=this.renderer.heading(s);break}case"code":{i+=this.renderer.code(s);break}case"table":{i+=this.renderer.table(s);break}case"blockquote":{i+=this.renderer.blockquote(s);break}case"list":{i+=this.renderer.list(s);break}case"checkbox":{i+=this.renderer.checkbox(s);break}case"html":{i+=this.renderer.html(s);break}case"def":{i+=this.renderer.def(s);break}case"paragraph":{i+=this.renderer.paragraph(s);break}case"text":{i+=this.renderer.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}parseInline(t,i=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let s=t[r];if(this.options.extensions?.renderers?.[s.type]){let o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(s.type)){n+=o||"";continue}}let a=s;switch(a.type){case"escape":{n+=i.text(a);break}case"html":{n+=i.html(a);break}case"link":{n+=i.link(a);break}case"image":{n+=i.image(a);break}case"checkbox":{n+=i.checkbox(a);break}case"strong":{n+=i.strong(a);break}case"em":{n+=i.em(a);break}case"codespan":{n+=i.codespan(a);break}case"br":{n+=i.br(a);break}case"del":{n+=i.del(a);break}case"text":{n+=i.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},xu=(Df=class{constructor(e){fe(this,"options");fe(this,"block");this.options=e||po}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?pr.lex:pr.lexInline}provideParser(e=this.block){return e?mr.parse:mr.parseInline}},fe(Df,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),fe(Df,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Df);$z=class{constructor(...e){fe(this,"defaults",Bv());fe(this,"options",this.setOptions);fe(this,"parse",this.parseMarkdown(!0));fe(this,"parseInline",this.parseMarkdown(!1));fe(this,"Parser",mr);fe(this,"Renderer",zf);fe(this,"TextRenderer",Wv);fe(this,"Lexer",pr);fe(this,"Tokenizer",Wl);fe(this,"Hooks",xu);this.use(...e)}walkTokens(e,t){let i=[];for(let n of e)switch(co(i,t.call(this,n)),n.type){case"table":{let r=n;for(let s of r.header)co(i,this.walkTokens(s.tokens,t));for(let s of r.rows)for(let a of s)co(i,this.walkTokens(a.tokens,t));break}case"list":{let r=n;co(i,this.walkTokens(r.items,t));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(s=>{let a=r[s].flat(1/0);co(i,this.walkTokens(a,t))}):r.tokens&&co(i,this.walkTokens(r.tokens,t))}}return i}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=t.renderers[r.name];s?t.renderers[r.name]=function(...a){let o=r.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[r.level];s?s.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),n.extensions=t),i.renderer){let r=this.defaults.renderer||new zf(this.defaults);for(let s in i.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=i.renderer[a],l=r[a];r[a]=(...c)=>{let u=o.apply(r,c);return u===!1&&(u=l.apply(r,c)),u||""}}n.renderer=r}if(i.tokenizer){let r=this.defaults.tokenizer||new Wl(this.defaults);for(let s in i.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=i.tokenizer[a],l=r[a];r[a]=(...c)=>{let u=o.apply(r,c);return u===!1&&(u=l.apply(r,c)),u}}n.tokenizer=r}if(i.hooks){let r=this.defaults.hooks||new xu;for(let s in i.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=i.hooks[a],l=r[a];xu.passThroughHooks.has(s)?r[a]=c=>{if(r.options.async&&xu.passThroughHooksRespectAsync.has(s))return(async()=>{let d=await o.call(r,c);return l.call(r,d)})();let u=o.call(r,c);return l.call(r,u)}:r[a]=(...c)=>{if(r.options.async)return(async()=>{let d=await o.apply(r,c);return d===!1&&(d=await l.apply(r,c)),d})();let u=o.apply(r,c);return u===!1&&(u=l.apply(r,c)),u}}n.hooks=r}if(i.walkTokens){let r=this.defaults.walkTokens,s=i.walkTokens;n.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),r&&co(o,r.call(this,a)),o}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pr.lex(e,t??this.defaults)}parser(e,t){return mr.parse(e,t??this.defaults)}parseMarkdown(e){return(t,i)=>{let n={...i},r={...this.defaults,...n},s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=e),r.async)return(async()=>{let a=r.hooks?await r.hooks.preprocess(t):t,o=await(r.hooks?await r.hooks.provideLexer(e):e?pr.lex:pr.lexInline)(a,r),l=r.hooks?await r.hooks.processAllTokens(o):o;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser(e):e?mr.parse:mr.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(s);try{r.hooks&&(t=r.hooks.preprocess(t));let a=(r.hooks?r.hooks.provideLexer(e):e?pr.lex:pr.lexInline)(t,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let o=(r.hooks?r.hooks.provideParser(e):e?mr.parse:mr.parseInline)(a,r);return r.hooks&&(o=r.hooks.postprocess(o)),o}catch(a){return s(a)}}}onError(e,t){return i=>{if(i.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+Mn(i.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(i);throw i}}},fo=new $z;Je.options=Je.setOptions=function(e){return fo.setOptions(e),Je.defaults=fo.defaults,Qk(Je.defaults),Je};Je.getDefaults=Bv;Je.defaults=po;Je.use=Wz;Je.walkTokens=function(e,t){return fo.walkTokens(e,t)};Je.parseInline=fo.parseInline;Je.Parser=mr;Je.parser=mr.parse;Je.Renderer=zf;Je.TextRenderer=Wv;Je.Lexer=pr;Je.lexer=pr.lex;Je.Tokenizer=Wl;Je.Hooks=xu;Je.parse=Je;c7=Je.options,u7=Je.setOptions,d7=Je.walkTokens,h7=Je.parseInline,f7=mr.parse,p7=pr.lex});function Kz(e,t){this.v=e,this.k=t}function uC(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function Gz(e){if(Array.isArray(e))return e}function jz(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var n,r,s,a,o=[],l=!0,c=!1;try{if(s=(i=i.call(e)).next,t===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&i.return!=null&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw r}}return o}}function Yz(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vz(e,t){return Gz(e)||jz(e,t)||Xz(e,t)||Yz()}function Xz(e,t){if(e){if(typeof e=="string")return uC(e,t);var i={}.toString.call(e).slice(8,-1);return i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set"?Array.from(e):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?uC(e,t):void 0}}function Bf(e){var t,i;function n(s,a){try{var o=e[s](a),l=o.value,c=l instanceof Kz;Promise.resolve(c?l.v:l).then(function(u){if(c){var d=s==="return"&&l.k?s:"next";if(!l.k||u.done)return n(d,u);u=e[d](u).value}r(!!o.done,u)},function(u){n("throw",u)})}catch(u){r(2,u)}}function r(s,a){s===2?t.reject(a):t.resolve({value:a,done:s}),(t=t.next)?n(t.key,t.arg):i=null}this._invoke=function(s,a){return new Promise(function(o,l){var c={key:s,arg:a,resolve:o,reject:l,next:null};i?i=i.next=c:(t=i=c,n(s,a))})},typeof e.return!="function"&&(this.return=void 0)}function Nt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return eb(e,t,n)}}function AC(e){return function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return tb(e,i)}}function We(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mo;if(dC&&dC(e,null),!Yl(t))return e;let n=t.length;for(;n--;){let r=t[n];if(typeof r=="string"){let s=i(r);s!==r&&(Zz(t)||(t[n]=s),r=s)}e[r]=!0}return e}function rB(e){for(let t=0;t<e.length;t++)fn(e,t)||(e[t]=null);return e}function On(e){let t=jl(null);for(let n of kC(e)){var i=Vz(n,2);let r=i[0],s=i[1];fn(e,r)&&(Yl(s)?t[r]=rB(s):s&&typeof s=="object"&&s.constructor===Object?t[r]=On(s):t[r]=s)}return t}function sB(e){switch(typeof e){case"string":return e;case"number":return iB(e);case"boolean":return nB(e);case"bigint":return mC?mC(e):"0";case"symbol":return gC?gC(e):"Symbol()";case"undefined":return Mu(e);case"function":case"object":{if(e===null)return Mu(e);let t=e,i=Xn(t,"toString");if(typeof i=="function"){let n=i(t);return typeof n=="string"?n:Mu(n)}return Mu(e)}default:return Mu(e)}}function Xn(e,t){for(;e!==null;){let n=TC(e,t);if(n){if(n.get)return Nt(n.get);if(typeof n.value=="function")return Nt(n.value)}e=CC(e)}function i(){return null}return i}function aB(e,t){for(;e!==null;){let i=TC(e,t);if(i)return i.get?Nt(i.get):null;e=CC(e)}return null}function oB(e){try{return Ni(e,""),!0}catch{return!1}}function MC(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:SB(),t=j=>MC(j);if(t.version="3.4.17",t.removed=[],!e||!e.document||e.document.nodeType!==Gt.document||!e.Element)return t.isSupported=!1,t;let i=e.document,n=i,r=n.currentScript;e.DocumentFragment;let s=e.HTMLTemplateElement,a=e.Node,o=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let c=e.DOMParser,u=e.trustedTypes,d=o.prototype,h=Xn(d,"cloneNode"),f=Xn(d,"remove"),p=Xn(d,"removeAttributeNode"),_=Xn(d,"nextSibling"),y=Xn(d,"childNodes"),m=Xn(d,"parentNode"),v=Xn(d,"shadowRoot"),b=Xn(d,"attributes"),w=a&&a.prototype?Xn(a.prototype,"nodeType"):null,k=a&&a.prototype?Xn(a.prototype,"nodeName"):null,O=a&&a.prototype?Xn(a.prototype,"ownerDocument"):null,N=function(S){return w?w(S):S.nodeType},C=function(S){return k?k(S):S.nodeName},M=aB(d,"namespaceURI"),z=function(S){return M?M(S):S.namespaceURI};if(typeof s=="function"){let j=i.createElement("template");j.content&&j.content.ownerDocument&&(i=j.content.ownerDocument)}let q,B="",I,x=!1,H=0,T=function(){if(H>0)throw Es('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},L=function(S){T(),H++;try{return q.createHTML(S)}finally{H--}},D=function(S){T(),H++;try{return q.createScriptURL(S)}finally{H--}},P=function(){return x||(I=wB(u,r),x=!0),I},Y=i,U=Y.implementation,Z=Y.createNodeIterator,xe=Y.createDocumentFragment,me=Y.getElementsByTagName,Fe=n.importNode,Q=EC();t.isSupported=typeof kC=="function"&&typeof m=="function"&&U&&U.createHTMLDocument!==void 0;let ht=uB,Yt=dB,Vt=hB,gn=fB,Ri=pB,Pt=mB,ke=gB,Di=vB,ot=SC,de=null,bi=We({},[..._C,...Yv,...Vv,...Xv,...vC]),re=null,ir=We({},[...bC,...Zv,...yC,...Pf]),Ve=Object.seal(jl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),De=null,is=null,ri=Object.seal(jl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),nr=!0,rr=!0,ne=!1,ce=!0,ge=!1,Re=!0,ft=!1,Ki=!1,Is=null,xr=null,Ra=!1,Er=!1,Oo=!1,Ro=!1,Do=!0,E=!1,J="user-content-",le=!0,Te=!1,$e=null,lt={},Et=null,zs=We({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),sr=null,Li=We({},["audio","video","img","source","image","track"]),oy=null,ly=We({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vd="http://www.w3.org/1998/Math/MathML",bd="http://www.w3.org/2000/svg",kr="http://www.w3.org/1999/xhtml",Lo=kr,Vp=!1,Xp=null,u2=We({},[vd,bd,kr],jv),cy=ui(["mi","mo","mn","ms","mtext"]),Zp=We({},cy),uy=ui(["annotation-xml"]),Qp=We({},uy),d2=We({},["title","style","font","a","script"]),uc=null,h2=["application/xhtml+xml","text/html"],f2="text/html",Ht=null,Io=null,p2=i.createElement("form"),dy=function(S){return S instanceof RegExp||S instanceof Function},Jp=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Io&&Io===S)return;(!S||typeof S!="object")&&(S={}),S=On(S),uc=h2.indexOf(S.PARSER_MEDIA_TYPE)===-1?f2:S.PARSER_MEDIA_TYPE,Ht=uc==="application/xhtml+xml"?jv:mo,de=Sa(S,"ALLOWED_TAGS",bi,{transform:Ht}),re=Sa(S,"ALLOWED_ATTR",ir,{transform:Ht}),Xp=Sa(S,"ALLOWED_NAMESPACES",u2,{transform:jv}),oy=Sa(S,"ADD_URI_SAFE_ATTR",ly,{transform:Ht,base:ly}),sr=Sa(S,"ADD_DATA_URI_TAGS",Li,{transform:Ht,base:Li}),Et=Sa(S,"FORBID_CONTENTS",zs,{transform:Ht}),De=Sa(S,"FORBID_TAGS",On({}),{transform:Ht}),is=Sa(S,"FORBID_ATTR",On({}),{transform:Ht}),lt=fn(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?On(S.USE_PROFILES):S.USE_PROFILES:!1,nr=S.ALLOW_ARIA_ATTR!==!1,rr=S.ALLOW_DATA_ATTR!==!1,ne=S.ALLOW_UNKNOWN_PROTOCOLS||!1,ce=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ge=S.SAFE_FOR_TEMPLATES||!1,Re=S.SAFE_FOR_XML!==!1,ft=S.WHOLE_DOCUMENT||!1,Er=S.RETURN_DOM||!1,Oo=S.RETURN_DOM_FRAGMENT||!1,Ro=S.RETURN_TRUSTED_TYPE||!1,Ra=S.FORCE_BODY||!1,Do=S.SANITIZE_DOM!==!1,E=S.SANITIZE_NAMED_PROPS||!1,le=S.KEEP_CONTENT!==!1,Te=S.IN_PLACE||!1,ot=oB(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:SC,Lo=typeof S.NAMESPACE=="string"?S.NAMESPACE:kr,Zp=Jv(S,"MATHML_TEXT_INTEGRATION_POINTS",()=>We({},cy)),Qp=Jv(S,"HTML_INTEGRATION_POINTS",()=>We({},uy));let A=Jv(S,"CUSTOM_ELEMENT_HANDLING",()=>jl(null));if(Ve=jl(null),fn(A,"tagNameCheck")&&dy(A.tagNameCheck)&&(Ve.tagNameCheck=A.tagNameCheck),fn(A,"attributeNameCheck")&&dy(A.attributeNameCheck)&&(Ve.attributeNameCheck=A.attributeNameCheck),fn(A,"allowCustomizedBuiltInElements")&&typeof A.allowCustomizedBuiltInElements=="boolean"&&(Ve.allowCustomizedBuiltInElements=A.allowCustomizedBuiltInElements),Ai(Ve),ge&&(rr=!1),Oo&&(Er=!0),lt&&(de=We({},vC),re=jl(null),lt.html===!0&&(We(de,_C),We(re,bC)),lt.svg===!0&&(We(de,Yv),We(re,Zv),We(re,Pf)),lt.svgFilters===!0&&(We(de,Vv),We(re,Zv),We(re,Pf)),lt.mathMl===!0&&(We(de,Xv),We(re,yC),We(re,Pf))),ri.tagCheck=null,ri.attributeCheck=null,fn(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?ri.tagCheck=S.ADD_TAGS:Yl(S.ADD_TAGS)&&(de===bi&&(de=On(de)),We(de,S.ADD_TAGS,Ht))),fn(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?ri.attributeCheck=S.ADD_ATTR:Yl(S.ADD_ATTR)&&(re===ir&&(re=On(re)),We(re,S.ADD_ATTR,Ht))),fn(S,"ADD_FORBID_CONTENTS")&&Yl(S.ADD_FORBID_CONTENTS)&&(Et===zs&&(Et=On(Et)),We(Et,S.ADD_FORBID_CONTENTS,Ht)),le&&(de["#text"]=!0),ft&&We(de,["html","head","body"]),de.table&&(We(de,["tbody"]),delete De.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw Es('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Es('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let K=q;q=S.TRUSTED_TYPES_POLICY;try{B=L("")}catch(G){throw q=K,G}}else S.TRUSTED_TYPES_POLICY===null?(q=void 0,B=""):(q===void 0&&(q=P()),q&&typeof B=="string"&&(B=L("")));ui&&ui(S),Io=S},hy=We({},[...Yv,...Vv,...lB]),fy=We({},[...Xv,...cB]),m2=function(S,A,K){return A.namespaceURI===kr?S==="svg":A.namespaceURI===vd?S==="svg"&&(K==="annotation-xml"||Zp[K]):!!hy[S]},g2=function(S,A,K){return A.namespaceURI===kr?S==="math":A.namespaceURI===bd?S==="math"&&Qp[K]:!!fy[S]},_2=function(S,A,K){return A.namespaceURI===bd&&!Qp[K]||A.namespaceURI===vd&&!Zp[K]?!1:!fy[S]&&(d2[S]||!hy[S])},v2=function(S){let A=z(S),K=mo(C(S)),G=m(S),he,be;return G&&N(G)===Gt.element?(he={namespaceURI:z(G)},be=mo(C(G))):(he={namespaceURI:Lo},be="template"),Xp[A]?A===bd?m2(K,he,be):A===vd?g2(K,he,be):A===kr?_2(K,he,be):!!(uc==="application/xhtml+xml"&&Xp[A]):!1},Bs=function(S){Tu(t.removed,{element:S});try{m(S).removeChild(S)}catch{if(f(S),!m(S))throw Es("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},py=function(S,A,K){try{p(S,A)}catch{try{S.removeAttribute(K)}catch{}}},em=function(S){im(S);let A=y(S);A&&xs(Jz(A),G=>{try{f(G)}catch{}});let K=N(S)===Gt.element?b(S):null;if(K)for(let G=K.length-1;G>=0;--G){let he=K[G],be=he&&he.name;typeof be=="string"&&py(S,he,be)}},zo=function(S,A,K){if(!K)try{K=A.getAttributeNode(S)}catch{K=null}Tu(t.removed,{attribute:K||null,from:A});try{K?p(A,K):A.removeAttribute(S)}catch{try{A.removeAttribute(S)}catch{}}if(S==="is")if(Er||Oo)try{Bs(A)}catch{}else try{A.setAttribute(S,"")}catch{}},my=function(S){let A=b(S);if(A)for(let K=A.length-1;K>=0;--K){let G=A[K],he=G&&G.name;typeof he!="string"||re[Ht(he)]||py(S,G,he)}},tm=function(S,A){let K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,G=[S];for(;G.length>0;){let he=G.pop();if(A(he)===!1)continue;if(K&&N(he)===Gt.element){let ze=v(he);Ps(ze)&&G.push(ze)}let be=y(he);if(be)for(let ze=be.length-1;ze>=0;--ze)G.push(be[ze])}},im=function(S){tm(S,A=>{N(A)===Gt.element&&my(A)})},nm=function(S){let A=[];return tm(S,K=>{A.push(K)},!0),A},b2=function(S,A){let K=Kv();xs(nm(S),G=>{N(G)===Gt.element&&Gv(K,G)}),xs(A,G=>{N(G)===Gt.element&&!Nu(K,G)&&my(G)})},gy=function(S,A){let K=!1;return xs(t.removed,G=>{G.element&&(K=K||G.element===S,im(G.element))}),b2(S,A),K},y2=8,S2=function(S,A){let K=$e,G=null,he=()=>(G||(G=Kv(),xs(A,be=>{Gv(G,be)})),G);for(let be=0;;be++){let ze=nm(S),Xt=[S],Cr=!1;if(xs(ze,Gi=>{N(Gi)===Gt.documentFragment?Tu(Xt,Gi):!Cr&&!Nu(K,Gi)&&(Cr=Nu(he(),Gi))}),!Cr)return;if(be>=y2)throw Es("the tree kept changing during in-place sanitization; refusing to return it");xs(Xt,(Gi,nn)=>{w2(Gi,nn>0,S,he())})}},w2=function(S,A,K,G){let he=rm(S),be;for(;be=he.nextNode();)!Nu(G,be)||Nu($e,be)||(A&&ar(Q.uponSanitizeShadowNode,be,null),am(be,K),om(be,K),Ps(be.content)&&hc(be.content))},x2=function(S){$e&&Gv($e,S)},_y=function(S,A){return Re?S==="patchsrc"?!0:S==="for"&&A!=="label"&&A!=="output":!1},E2=function(S){Re&&tm(S,A=>{let K=N(A);if(K===Gt.processingInstruction||K===Gt.comment&&Ni(wC,A.data)){try{f(A)}catch{}return!1}if(K===Gt.element){let G=A,he=Ht(C(A));try{G.hasAttribute&&G.hasAttribute("patchsrc")&&G.removeAttribute("patchsrc"),G.hasAttribute&&G.hasAttribute("for")&&_y("for",he)&&G.removeAttribute("for")}catch{}}return!0})},vy=function(S){let A=null,K=null;if(Ra)S="<remove></remove>"+S;else{let be=fC(S,/^[\r\n\t ]+/);K=be&&be[0]}uc==="application/xhtml+xml"&&Lo===kr&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");let G=q?L(S):S;if(Lo===kr)try{A=new c().parseFromString(G,uc)}catch{}if(!A||!A.documentElement){A=U.createDocument(Lo,"template",null);try{A.documentElement.innerHTML=Vp?B:G}catch{}}let he=A.body||A.documentElement;return S&&K&&he.insertBefore(i.createTextNode(K),he.childNodes[0]||null),Lo===kr?me.call(A,ft?"html":"body")[0]:ft?A.documentElement:he},rm=function(S){let A=O?O(S):S.ownerDocument;return Z.call(A||S,S,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},yd=function(S){return S=Au(S,ht," "),S=Au(S,Yt," "),S=Au(S,Vt," "),S},sm=function(S){var A;by(S);let K=(A=S.querySelectorAll)===null||A===void 0?void 0:A.call(S,"template");K&&xs(K,G=>{Ps(G.content)&&sm(G.content)})},by=function(S){S.normalize();let A=O?O(S):S.ownerDocument,K=Z.call(A||S,S,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),G=K.nextNode();for(;G;)G.data=yd(G.data),G=K.nextNode()},Sd=function(S){let A=k?k(S):null;return typeof A!="string"||Ht(A)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==b(S)||typeof S.removeAttribute!="function"||typeof S.removeAttributeNode!="function"||typeof S.getAttributeNode!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==w(S)||S.childNodes!==y(S)},Ps=function(S){if(!w||typeof S!="object"||S===null)return!1;try{return w(S)===Gt.documentFragment}catch{return!1}},dc=function(S){if(!w||typeof S!="object"||S===null)return!1;try{return typeof w(S)=="number"}catch{return!1}};function ar(j,S,A){j.length!==0&&xs(j,K=>{K.call(t,S,A,Io)})}let k2=function(S,A){return!!(Re&&S.hasChildNodes()&&!dc(S.firstElementChild)&&Ni(Qv,S.textContent)&&Ni(Qv,S.innerHTML)||Re&&yB[A]&&N(S)===Gt.element&&z(S)===kr&&(dc(S.firstElementChild)||typeof S.textContent=="string"&&Ni(Qv,S.textContent))||S.nodeType===Gt.processingInstruction||Re&&S.nodeType===Gt.comment&&Ni(wC,S.data))},wd=function(S,A){if(S instanceof RegExp)return Ni(S,A);if(S instanceof Function){for(var K=arguments.length,G=new Array(K>2?K-2:0),he=2;he<K;he++)G[he-2]=arguments[he];return!!S(A,...G)}return!1},C2=function(S,A,K){if(!De[A]&&wy(A)&&wd(Ve.tagNameCheck,A))return!1;if(le&&!Et[A]&&!Et[mo(A)]){let G=m(S),he=y(S);if(he&&G){let be=he.length;for(let ze=be-1;ze>=0;--ze){let Xt=S===K?h(he[ze],!0):he[ze];G.insertBefore(Xt,_(S))}}}return Bs(S),!0},yy=function(S,A,K,G){return S.length===0?A:A===K||A===G?On(A):A},Bo=function(S,A){return S===A||m(S)!==null?!1:(Te&&im(S),!0)},am=function(S,A){if(x2(S),ar(Q.beforeSanitizeElements,S,null),Bo(S,A))return!0;if(Sd(S))return Bs(S),!0;let K=Ht(C(S));if(de=yy(Q.uponSanitizeElement,de,bi,Is),ar(Q.uponSanitizeElement,S,{tagName:K,allowedTags:de}),Bo(S,A))return!0;if(k2(S,K))return Bs(S),!0;if(De[K]||!(ri.tagCheck instanceof Function&&ri.tagCheck(K))&&!de[K]){let G=C2(S,K,A);return G===!1&&(ar(Q.afterSanitizeElements,S,null),Bo(S,A))?!0:G}if(N(S)===Gt.element&&!v2(S)||(K==="noscript"||K==="noembed"||K==="noframes")&&Ni(bB,S.innerHTML))return Bs(S),!0;if(ge&&S.nodeType===Gt.text){let G=yd(S.textContent);S.textContent!==G&&(Tu(t.removed,{element:S.cloneNode()}),S.textContent=G)}return ar(Q.afterSanitizeElements,S,null),Bo(S,A)},Sy=function(S,A,K){if(is[A]||_y(A,S)||Do&&(A==="id"||A==="name")&&(K in i||K in p2))return!1;let G=re[A]||ri.attributeCheck instanceof Function&&ri.attributeCheck(A,S);return rr&&Ni(gn,A)||nr&&Ni(Ri,A)?!0:G?oy[A]||Ni(ot,Au(K,ke,""))||(A==="src"||A==="xlink:href"||A==="href")&&S!=="script"&&pC(K,"data:")===0&&sr[S]||ne&&!Ni(Pt,Au(K,ke,""))?!0:!K:wy(S)&&wd(Ve.tagNameCheck,S)&&wd(Ve.attributeNameCheck,A,S)||A==="is"&&Ve.allowCustomizedBuiltInElements&&wd(Ve.tagNameCheck,K)},T2=We({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),wy=function(S){return!T2[mo(S)]&&Ni(Di,S)},N2=function(S,A,K,G){if(q&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!K)switch(u.getAttributeType(S,A)){case"TrustedHTML":return L(G);case"TrustedScriptURL":return D(G)}return G},A2=function(S,A,K,G){try{return K?S.setAttributeNS(K,A,G):S.setAttribute(A,G),Sd(S)?(Bs(S),!1):!0}catch{return zo(A,S),!1}},xy=function(S,A){return Re&&Ni(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,A)?!0:mo(S)==="attributename"&&fC(A,"href")!==null},om=function(S,A){if(ar(Q.beforeSanitizeAttributes,S,null),Bo(S,A))return;let K=S.attributes;if(!K||Sd(S))return;re=yy(Q.uponSanitizeAttribute,re,ir,xr);let G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:re,forceKeepAttr:void 0},he=K.length,be=Ht(S.nodeName);for(;he--;){let ze=K[he],Xt=ze.name,Cr=ze.namespaceURI,Gi=ze.value,nn=Ht(Xt),Po=Gi,rn=Xt==="value"?Po:tB(Po),Ey=!1;if(G.attrName=nn,G.attrValue=rn,G.keepAttr=!0,G.forceKeepAttr=void 0,ar(Q.uponSanitizeAttribute,S,G),rn=G.attrValue,E&&(nn==="id"||nn==="name")&&pC(rn,J)!==0&&(zo(Xt,S,ze),rn=J+rn,Ey=!0),xy(Xt,rn)){zo(Xt,S,ze);continue}if(!G.forceKeepAttr){if(!G.keepAttr){zo(Xt,S,ze);continue}if(!ce&&Ni(xC,rn)){zo(Xt,S,ze);continue}if(ge&&(rn=yd(rn)),!Sy(be,nn,rn)){zo(Xt,S,ze);continue}rn=N2(be,nn,Cr,rn),rn!==Po&&A2(S,Xt,Cr,rn)&&Ey&&hC(t.removed)}}ar(Q.afterSanitizeAttributes,S,null),Bo(S,A)},hc=function(S){let A=null,K=rm(S);for(ar(Q.beforeSanitizeShadowDOM,S,null);A=K.nextNode();)if(ar(Q.uponSanitizeShadowNode,A,null),am(A,S),om(A,S),Ps(A.content)&&hc(A.content),N(A)===Gt.element){let G=v(A);Ps(G)&&(lm(G),hc(G))}ge&&by(S),ar(Q.afterSanitizeShadowDOM,S,null)},lm=function(S){let A=[{node:S,shadow:null}];for(;A.length>0;){let K=A.pop();if(K.shadow){hc(K.shadow);continue}let G=K.node,he=N(G)===Gt.element,be=y(G);if(be)for(let ze=be.length-1;ze>=0;--ze)A.push({node:be[ze],shadow:null});if(he){let ze=k?k(G):null;if(typeof ze=="string"&&Ht(ze)==="template"){let Xt=G.content;Ps(Xt)&&A.push({node:Xt,shadow:null})}}if(he){let ze=v(G);Ps(ze)&&A.push({node:null,shadow:ze},{node:ze,shadow:null})}}};return t.sanitize=function(j){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,K=null,G=null,he=null;if(Vp=!j,Vp&&(j="<!-->"),typeof j!="string"&&!dc(j)&&(j=sB(j),typeof j!="string"))throw Es("dirty is not a string, aborting");if(!t.isSupported)return j;Ki?(de=Is,re=xr):Jp(S),(Q.uponSanitizeElement.length>0||Q.uponSanitizeAttribute.length>0)&&(de=On(de)),Q.uponSanitizeAttribute.length>0&&(re=On(re)),t.removed=[];let be=Te&&typeof j!="string"&&dc(j),ze=[],Xt=$e;if(be){E2(j);let nn=C(j);if(typeof nn=="string"){let Po=Ht(nn);if(!de[Po]||De[Po])throw em(j),Es("root node is forbidden and cannot be sanitized in-place")}if(Sd(j))throw em(j),Es("root node is clobbered and cannot be sanitized in-place");ze=nm(j),$e=Kv()}else if(dc(j))A=vy("<!---->"),K=A.ownerDocument.importNode(j,!0),K.nodeType===Gt.element&&K.nodeName==="BODY"||K.nodeName==="HTML"?A=K:A.appendChild(K),lm(A);else{if(!Er&&!ge&&!ft&&j.indexOf("<")===-1)return q&&Ro?L(j):j;if(A=vy(j),!A)return Er?null:Ro?B:""}A&&Ra&&Bs(A.firstChild);let Cr=be?j:A;try{be&&lm(j);let nn=rm(Cr);for(;G=nn.nextNode();)am(G,Cr),om(G,Cr),Ps(G.content)&&hc(G.content);be&&S2(j,ze)}catch(nn){throw be&&(em(j),gy(j,ze)),nn}finally{$e=Xt}if(be){if(gy(j,ze))throw Es("a node selected for removal could not be safely returned; refusing to sanitize in place");return ge&&sm(j),j}if(Er){if(ge&&sm(A),Oo)for(he=xe.call(A.ownerDocument);A.firstChild;)he.appendChild(A.firstChild);else he=A;return(re.shadowroot||re.shadowrootmode)&&(he=Fe.call(n,he,!0)),he}let Gi=ft?A.outerHTML:A.innerHTML;return ft&&de["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&Ni(_B,A.ownerDocument.doctype.name)&&(Gi="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
|
|
`+Gi),ge&&(Gi=yd(Gi)),q&&Ro?L(Gi):Gi},t.setConfig=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Jp(j),Ki=!0,Is=de,xr=re},t.clearConfig=function(){Io=null,Ki=!1,Is=null,xr=null,q=I,B=""},t.isValidAttribute=function(j,S,A){Io||Jp({});let K=Ht(j),G=Ht(S);return typeof A=="string"&&(xy(S,A)||!ce&&Ni(xC,A))?!1:Sy(K,G,A)},t.addHook=function(j,S){typeof S=="function"&&fn(Q,j)&&Tu(Q[j],S)},t.removeHook=function(j,S){if(fn(Q,j)){if(S!==void 0){let A=Qz(Q[j],S);return A===-1?void 0:eB(Q[j],A,1)[0]}return hC(Q[j])}},t.removeHooks=function(j){fn(Q,j)&&(Q[j]=[])},t.removeAllHooks=function(){Q=EC()},t}var kC,dC,Zz,CC,TC,ui,Ai,jl,NC,eb,tb,xs,Qz,hC,Tu,Jz,eB,Yl,Kv,Gv,Nu,mo,jv,fC,Au,pC,tB,iB,nB,mC,gC,fn,Mu,Ni,Es,_C,Yv,Vv,lB,Xv,cB,vC,bC,Zv,yC,Pf,uB,dB,hB,fB,pB,SC,mB,gB,_B,vB,Qv,wC,bB,xC,Gt,yB,SB,wB,EC,Sa,Jv,OC,RC=se(()=>{Bf.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Bf.prototype.next=function(e){return this._invoke("next",e)},Bf.prototype.throw=function(e){return this._invoke("throw",e)},Bf.prototype.return=function(e){return this._invoke("return",e)};kC=Object.entries,dC=Object.setPrototypeOf,Zz=Object.isFrozen,CC=Object.getPrototypeOf,TC=Object.getOwnPropertyDescriptor,ui=Object.freeze,Ai=Object.seal,jl=Object.create,NC=typeof Reflect<"u"&&Reflect,eb=NC.apply,tb=NC.construct;ui||(ui=function(t){return t});Ai||(Ai=function(t){return t});eb||(eb=function(t,i){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];return t.apply(i,r)});tb||(tb=function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return new t(...n)});xs=Nt(Array.prototype.forEach);Array.prototype.indexOf;Qz=Nt(Array.prototype.lastIndexOf),hC=Nt(Array.prototype.pop),Tu=Nt(Array.prototype.push),Jz=Nt(Array.prototype.slice),eB=Nt(Array.prototype.splice),Yl=Array.isArray,Kv=AC(Set),Gv=Nt(Set.prototype.add),Nu=Nt(Set.prototype.has),mo=Nt(String.prototype.toLowerCase),jv=Nt(String.prototype.toString),fC=Nt(String.prototype.match),Au=Nt(String.prototype.replace),pC=Nt(String.prototype.indexOf),tB=Nt(String.prototype.trim),iB=Nt(Number.prototype.toString),nB=Nt(Boolean.prototype.toString),mC=typeof BigInt>"u"?null:Nt(BigInt.prototype.toString),gC=typeof Symbol>"u"?null:Nt(Symbol.prototype.toString),fn=Nt(Object.prototype.hasOwnProperty),Mu=Nt(Object.prototype.toString),Ni=Nt(RegExp.prototype.test),Es=AC(TypeError);_C=ui(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Yv=ui(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Vv=ui(["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"]),lB=ui(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Xv=ui(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),cB=ui(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),vC=ui(["#text"]),bC=ui(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Zv=ui(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yC=ui(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Pf=ui(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),uB=Ai(/{{[\w\W]*|^[\w\W]*}}/g),dB=Ai(/<%[\w\W]*|^[\w\W]*%>/g),hB=Ai(/\${[\w\W]*/g),fB=Ai(/^data-[\-\w.\u00B7-\uFFFF]+$/),pB=Ai(/^aria-[\-\w]+$/),SC=Ai(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mB=Ai(/^(?:\w+script|data):/i),gB=Ai(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_B=Ai(/^html$/i),vB=Ai(/^[a-z][.\w]*(-[.\w]+)+$/i),Qv=Ai(/<[/\w!]/g),wC=Ai(/<[/\w]/g),bB=Ai(/<\/no(script|embed|frames)/i),xC=Ai(/\/>/i),Gt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},yB=ui(We({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),SB=function(){return typeof window>"u"?null:window},wB=function(t,i){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null,r="data-tt-policy-suffix";i&&i.hasAttribute(r)&&(n=i.getAttribute(r));let s="dompurify"+(n?"#"+n:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},EC=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sa=function(t,i,n,r){return fn(t,i)&&Yl(t[i])?We(r.base?On(r.base):{},t[i],r.transform):n},Jv=function(t,i,n){let r=fn(t,i)?t[i]:void 0;return r&&typeof r=="object"?On(r):n()};OC=MC()});var QC=ye((x7,ZC)=>{function HC(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let i=e[t],n=typeof i;(n==="object"||n==="function")&&!Object.isFrozen(i)&&HC(i)}),e}var Uf=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function UC(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function wa(e,...t){let i=Object.create(null);for(let n in e)i[n]=e[n];return t.forEach(function(n){for(let r in n)i[r]=n[r]}),i}var xB="</span>",DC=e=>!!e.scope,EB=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let i=e.split(".");return[`${t}${i.shift()}`,...i.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},nb=class{constructor(t,i){this.buffer="",this.classPrefix=i.classPrefix,t.walk(this)}addText(t){this.buffer+=UC(t)}openNode(t){if(!DC(t))return;let i=EB(t.scope,{prefix:this.classPrefix});this.span(i)}closeNode(t){DC(t)&&(this.buffer+=xB)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},LC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},rb=class e{constructor(){this.rootNode=LC(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let i=LC({scope:t});this.add(i),this.stack.push(i)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,i){return typeof i=="string"?t.addText(i):i.children&&(t.openNode(i),i.children.forEach(n=>this._walk(t,n)),t.closeNode(i)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(i=>typeof i=="string")?t.children=[t.children.join("")]:t.children.forEach(i=>{e._collapse(i)}))}},sb=class extends rb{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,i){let n=t.root;i&&(n.scope=`language:${i}`),this.add(n)}toHTML(){return new nb(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ou(e){return e?typeof e=="string"?e:e.source:null}function qC(e){return _o("(?=",e,")")}function kB(e){return _o("(?:",e,")*")}function CB(e){return _o("(?:",e,")?")}function _o(...e){return e.map(i=>Ou(i)).join("")}function TB(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ff(...e){return"("+(TB(e).capture?"":"?:")+e.map(n=>Ou(n)).join("|")+")"}function FC(e){return new RegExp(e.toString()+"|").exec("").length-1}function NB(e,t){let i=e&&e.exec(t);return i&&i.index===0}var AB=new RegExp(Ff(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function ob(e,{joinWith:t}){let i=0;return e.map(n=>{i+=1;let r=i,s=Ou(n),a="";for(;s.length>0;){let o=AB.exec(s);if(!o){a+=s;break}a+=s.substring(0,o.index),s=s.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+r):(a+=o[0],(o[0]==="("||/^\(\?[<']/.test(o[0]))&&i++)}return a}).map(n=>`(${n})`).join(t)}var MB=/\b\B/,$C="[a-zA-Z]\\w*",lb="[a-zA-Z_]\\w*",WC="\\b\\d+(\\.\\d+)?",KC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",GC="\\b(0b[01]+)",OB="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",RB=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_o(t,/.*\b/,e.binary,/\b.*/)),wa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(i,n)=>{i.index!==0&&n.ignoreMatch()}},e)},Ru={begin:"\\\\[\\s\\S]",relevance:0},DB={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ru]},LB={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ru]},IB={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},$f=function(e,t,i={}){let n=wa({scope:"comment",begin:e,end:t,contains:[]},i);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Ff("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:_o(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},zB=$f("//","$"),BB=$f("/\\*","\\*/"),PB=$f("#","$"),HB={scope:"number",begin:WC,relevance:0},UB={scope:"number",begin:KC,relevance:0},qB={scope:"number",begin:GC,relevance:0},FB={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ru,{begin:/\[/,end:/\]/,relevance:0,contains:[Ru]}]},$B={scope:"title",begin:$C,relevance:0},WB={scope:"title",begin:lb,relevance:0},KB={begin:"\\.\\s*"+lb,relevance:0},GB=function(e){return Object.assign(e,{"on:begin":(t,i)=>{i.data._beginMatch=t[1]},"on:end":(t,i)=>{i.data._beginMatch!==t[1]&&i.ignoreMatch()}})},Hf=Object.freeze({__proto__:null,APOS_STRING_MODE:DB,BACKSLASH_ESCAPE:Ru,BINARY_NUMBER_MODE:qB,BINARY_NUMBER_RE:GC,COMMENT:$f,C_BLOCK_COMMENT_MODE:BB,C_LINE_COMMENT_MODE:zB,C_NUMBER_MODE:UB,C_NUMBER_RE:KC,END_SAME_AS_BEGIN:GB,HASH_COMMENT_MODE:PB,IDENT_RE:$C,MATCH_NOTHING_RE:MB,METHOD_GUARD:KB,NUMBER_MODE:HB,NUMBER_RE:WC,PHRASAL_WORDS_MODE:IB,QUOTE_STRING_MODE:LB,REGEXP_MODE:FB,RE_STARTERS_RE:OB,SHEBANG:RB,TITLE_MODE:$B,UNDERSCORE_IDENT_RE:lb,UNDERSCORE_TITLE_MODE:WB});function jB(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function YB(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function VB(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=jB,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function XB(e,t){Array.isArray(e.illegal)&&(e.illegal=Ff(...e.illegal))}function ZB(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function QB(e,t){e.relevance===void 0&&(e.relevance=1)}var JB=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let i=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=i.keywords,e.begin=_o(i.beforeMatch,qC(i.begin)),e.starts={relevance:0,contains:[Object.assign(i,{endsParent:!0})]},e.relevance=0,delete i.beforeMatch},e5=["of","and","for","in","not","or","if","then","parent","list","value"],t5="keyword";function jC(e,t,i=t5){let n=Object.create(null);return typeof e=="string"?r(i,e.split(" ")):Array.isArray(e)?r(i,e):Object.keys(e).forEach(function(s){Object.assign(n,jC(e[s],t,s))}),n;function r(s,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){let l=o.split("|");n[l[0]]=[s,i5(l[0],l[1])]})}}function i5(e,t){return t?Number(t):n5(e)?0:1}function n5(e){return e5.includes(e.toLowerCase())}var IC={},go=e=>{console.error(e)},zC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Vl=(e,t)=>{IC[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),IC[`${e}/${t}`]=!0)},qf=new Error;function YC(e,t,{key:i}){let n=0,r=e[i],s={},a={};for(let o=1;o<=t.length;o++)a[o+n]=r[o],s[o+n]=!0,n+=FC(t[o-1]);e[i]=a,e[i]._emit=s,e[i]._multi=!0}function r5(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw go("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),qf;if(typeof e.beginScope!="object"||e.beginScope===null)throw go("beginScope must be object"),qf;YC(e,e.begin,{key:"beginScope"}),e.begin=ob(e.begin,{joinWith:""})}}function s5(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw go("skip, excludeEnd, returnEnd not compatible with endScope: {}"),qf;if(typeof e.endScope!="object"||e.endScope===null)throw go("endScope must be object"),qf;YC(e,e.end,{key:"endScope"}),e.end=ob(e.end,{joinWith:""})}}function a5(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function o5(e){a5(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),r5(e),s5(e)}function l5(e){function t(a,o){return new RegExp(Ou(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(o?"g":""))}class i{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=FC(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let o=this.regexes.map(l=>l[1]);this.matcherRe=t(ob(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(o);if(!l)return null;let c=l.findIndex((d,h)=>h>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];let l=new i;return this.rules.slice(o).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(o);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(o)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function r(a){let o=new n;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function s(a,o){let l=a;if(a.isCompiled)return l;[YB,ZB,o5,JB].forEach(u=>u(a,o)),e.compilerExtensions.forEach(u=>u(a,o)),a.__beforeBegin=null,[VB,XB,QB].forEach(u=>u(a,o)),a.isCompiled=!0;let c=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),c=a.keywords.$pattern,delete a.keywords.$pattern),c=c||/\w+/,a.keywords&&(a.keywords=jC(a.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=Ou(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(u){return c5(u==="self"?a:u)})),a.contains.forEach(function(u){s(u,l)}),a.starts&&s(a.starts,o),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=wa(e.classNameAliases||{}),s(e)}function VC(e){return e?e.endsWithParent||VC(e.starts):!1}function c5(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return wa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:VC(e)?wa(e,{starts:e.starts?wa(e.starts):null}):Object.isFrozen(e)?wa(e):e}var u5="11.12.0",ab=class extends Error{constructor(t,i){super(t),this.name="HTMLInjectionError",this.html=i}},ib=UC,BC=wa,PC=Symbol("nomatch"),d5=7,XC=function(e){let t=Object.create(null),i=Object.create(null),n=[],r=!0,s="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]},o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:sb};function l(T){return o.noHighlightRe.test(T)}function c(T){let L=T.className+" ";L+=T.parentNode?T.parentNode.className:"";let D=o.languageDetectRe.exec(L);if(D){let P=C(D[1]);return P||(zC(s.replace("{}",D[1])),zC("Falling back to no-highlight mode for this block.",T)),P?D[1]:"no-highlight"}return L.split(/\s+/).find(P=>l(P)||C(P))}function u(T,L,D){let P="",Y="";typeof L=="object"?(P=T,D=L.ignoreIllegals,Y=L.language):(Vl("10.7.0","highlight(lang, code, ...args) has been deprecated."),Vl("10.7.0",`Please use highlight(code, options) instead.
|
|
https://github.com/highlightjs/highlight.js/issues/2277`),Y=T,P=L),D===void 0&&(D=!0);let U={code:P,language:Y};x("before:highlight",U);let Z=U.result?U.result:d(U.language,U.code,D);return Z.code=U.code,x("after:highlight",Z),Z}function d(T,L,D,P){let Y=Object.create(null);function U(ne,ce){return ne.keywords[ce]}function Z(){if(!re.keywords){Ve.addText(De);return}let ne=0;re.keywordPatternRe.lastIndex=0;let ce=re.keywordPatternRe.exec(De),ge="";for(;ce;){ge+=De.substring(ne,ce.index);let Re=ot.case_insensitive?ce[0].toLowerCase():ce[0],ft=U(re,Re);if(ft){let[Ki,Is]=ft;if(Ve.addText(ge),ge="",Y[Re]=(Y[Re]||0)+1,Y[Re]<=d5&&(is+=Is),Ki.startsWith("_"))ge+=ce[0];else{let xr=ot.classNameAliases[Ki]||Ki;Fe(ce[0],xr)}}else ge+=ce[0];ne=re.keywordPatternRe.lastIndex,ce=re.keywordPatternRe.exec(De)}ge+=De.substring(ne),Ve.addText(ge)}function xe(){if(De==="")return;let ne=null;if(typeof re.subLanguage=="string"){if(!t[re.subLanguage]){Ve.addText(De);return}ne=d(re.subLanguage,De,!0,ir[re.subLanguage]),ir[re.subLanguage]=ne._top}else ne=f(De,re.subLanguage.length?re.subLanguage:null);re.relevance>0&&(is+=ne.relevance),Ve.__addSublanguage(ne._emitter,ne.language)}function me(){re.subLanguage!=null?xe():Z(),De=""}function Fe(ne,ce){ne!==""&&(Ve.startScope(ce),Ve.addText(ne),Ve.endScope())}function Q(ne,ce){let ge=1,Re=ce.length-1;for(;ge<=Re;){if(!ne._emit[ge]){ge++;continue}let ft=ot.classNameAliases[ne[ge]]||ne[ge],Ki=ce[ge];ft?Fe(Ki,ft):(De=Ki,Z(),De=""),ge++}}function ht(ne,ce){return ne.scope&&typeof ne.scope=="string"&&Ve.openNode(ot.classNameAliases[ne.scope]||ne.scope),ne.beginScope&&(ne.beginScope._wrap?(Fe(De,ot.classNameAliases[ne.beginScope._wrap]||ne.beginScope._wrap),De=""):ne.beginScope._multi&&(Q(ne.beginScope,ce),De="")),re=Object.create(ne,{parent:{value:re}}),re}function Yt(ne,ce,ge){let Re=NB(ne.endRe,ge);if(Re){if(ne["on:end"]){let ft=new Uf(ne);ne["on:end"](ce,ft),ft.isMatchIgnored&&(Re=!1)}if(Re){for(;ne.endsParent&&ne.parent;)ne=ne.parent;return ne}}if(ne.endsWithParent)return Yt(ne.parent,ce,ge)}function Vt(ne){return re.matcher.regexIndex===0?(De+=ne[0],1):(rr=!0,0)}function gn(ne){let ce=ne[0],ge=ne.rule,Re=new Uf(ge),ft=[ge.__beforeBegin,ge["on:begin"]];for(let Ki of ft)if(Ki&&(Ki(ne,Re),Re.isMatchIgnored))return Vt(ce);return ge.skip?De+=ce:(ge.excludeBegin&&(De+=ce),me(),!ge.returnBegin&&!ge.excludeBegin&&(De=ce)),ht(ge,ne),ge.returnBegin?0:ce.length}function Ri(ne){let ce=ne[0],ge=L.substring(ne.index),Re=Yt(re,ne,ge);if(!Re)return PC;let ft=re;re.endScope&&re.endScope._wrap?(me(),Fe(ce,re.endScope._wrap)):re.endScope&&re.endScope._multi?(me(),Q(re.endScope,ne)):ft.skip?De+=ce:(ft.returnEnd||ft.excludeEnd||(De+=ce),me(),ft.excludeEnd&&(De=ce));do re.scope&&Ve.closeNode(),!re.skip&&!re.subLanguage&&(is+=re.relevance),re=re.parent;while(re!==Re.parent);return Re.starts&&ht(Re.starts,ne),ft.returnEnd?0:ce.length}function Pt(){let ne=[];for(let ce=re;ce!==ot;ce=ce.parent)ce.scope&&ne.unshift(ce.scope);ne.forEach(ce=>Ve.openNode(ce))}let ke={};function Di(ne,ce){let ge=ce&&ce[0];if(De+=ne,ge==null)return me(),0;if(ke.type==="begin"&&ce.type==="end"&&ke.index===ce.index&&ge===""){if(De+=L.slice(ce.index,ce.index+1),!r){let Re=new Error(`0 width match regex (${T})`);throw Re.languageName=T,Re.badRule=ke.rule,Re}return 1}if(ke=ce,ce.type==="begin")return gn(ce);if(ce.type==="illegal"&&!D){let Re=new Error('Illegal lexeme "'+ge+'" for mode "'+(re.scope||"<unnamed>")+'"');throw Re.mode=re,Re}else if(ce.type==="end"){let Re=Ri(ce);if(Re!==PC)return Re}if(ce.type==="illegal"&&ge==="")return ce.index===L.length||(De+=`
|
|
`),1;if(nr>1e5&&nr>ce.index*3)throw new Error("potential infinite loop, way more iterations than matches");return De+=ge,ge.length}let ot=C(T);if(!ot)throw go(s.replace("{}",T)),new Error('Unknown language: "'+T+'"');let de=l5(ot),bi="",re=P||de,ir={},Ve=new o.__emitter(o);Pt();let De="",is=0,ri=0,nr=0,rr=!1;try{if(ot.__emitTokens)ot.__emitTokens(L,Ve);else{for(re.matcher.considerAll();;){nr++,rr?rr=!1:re.matcher.considerAll(),re.matcher.lastIndex=ri;let ne=re.matcher.exec(L);if(!ne)break;let ce=L.substring(ri,ne.index),ge=Di(ce,ne);ri=ne.index+ge}Di(L.substring(ri))}return Ve.finalize(),bi=Ve.toHTML(),{language:T,value:bi,relevance:is,illegal:!1,_emitter:Ve,_top:re}}catch(ne){if(ne.message&&ne.message.includes("Illegal"))return{language:T,value:ib(L),illegal:!0,relevance:0,_illegalBy:{message:ne.message,index:ri,context:L.slice(ri-100,ri+100),mode:ne.mode,resultSoFar:bi},_emitter:Ve};if(r)return{language:T,value:ib(L),illegal:!1,relevance:0,errorRaised:ne,_emitter:Ve,_top:re};throw ne}}function h(T){let L={value:ib(T),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return L._emitter.addText(T),L}function f(T,L){L=L||o.languages||Object.keys(t);let D=h(T),P=L.filter(C).filter(z).map(me=>d(me,T,!1));P.unshift(D);let Y=P.sort((me,Fe)=>{if(me.relevance!==Fe.relevance)return Fe.relevance-me.relevance;if(me.language&&Fe.language){if(C(me.language).supersetOf===Fe.language)return 1;if(C(Fe.language).supersetOf===me.language)return-1}return 0}),[U,Z]=Y,xe=U;return xe.secondBest=Z,xe}function p(T,L,D){let P=L&&i[L]||D;T.classList.add("hljs"),T.classList.add(`language-${P}`)}function _(T){let L=null,D=c(T);if(l(D))return;if(x("before:highlightElement",{el:T,language:D}),T.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",T);return}if(T.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(T)),o.throwUnescapedHTML))throw new ab("One of your code blocks includes unescaped HTML.",T.innerHTML);L=T;let P=L.textContent,Y=D?u(P,{language:D,ignoreIllegals:!0}):f(P);T.innerHTML=Y.value,T.dataset.highlighted="yes",p(T,D,Y.language),T.result={language:Y.language,re:Y.relevance,relevance:Y.relevance},Y.secondBest&&(T.secondBest={language:Y.secondBest.language,relevance:Y.secondBest.relevance}),x("after:highlightElement",{el:T,result:Y,text:P})}function y(T){o=BC(o,T)}let m=()=>{w(),Vl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function v(){w(),Vl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function w(){function T(){w()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",T,!1),b=!0;return}document.querySelectorAll(o.cssSelector).forEach(_)}function k(T,L){let D=null;try{D=L(e)}catch(P){if(go("Language definition for '{}' could not be registered.".replace("{}",T)),r)go(P);else throw P;D=a}D.name||(D.name=T),t[T]=D,D.rawDefinition=L.bind(null,e),D.aliases&&M(D.aliases,{languageName:T})}function O(T){delete t[T];for(let L of Object.keys(i))i[L]===T&&delete i[L]}function N(){return Object.keys(t)}function C(T){return T=(T||"").toLowerCase(),t[T]||t[i[T]]}function M(T,{languageName:L}){typeof T=="string"&&(T=[T]),T.forEach(D=>{i[D.toLowerCase()]=L})}function z(T){let L=C(T);return L&&!L.disableAutodetect}function q(T){T["before:highlightBlock"]&&!T["before:highlightElement"]&&(T["before:highlightElement"]=L=>{T["before:highlightBlock"](Object.assign({block:L.el},L))}),T["after:highlightBlock"]&&!T["after:highlightElement"]&&(T["after:highlightElement"]=L=>{T["after:highlightBlock"](Object.assign({block:L.el},L))})}function B(T){q(T),n.push(T)}function I(T){let L=n.indexOf(T);L!==-1&&n.splice(L,1)}function x(T,L){let D=T;n.forEach(function(P){P[D]&&P[D](L)})}function H(T){return Vl("10.7.0","highlightBlock will be removed entirely in v12.0"),Vl("10.7.0","Please use highlightElement now."),_(T)}Object.assign(e,{highlight:u,highlightAuto:f,highlightAll:w,highlightElement:_,highlightBlock:H,configure:y,initHighlighting:m,initHighlightingOnLoad:v,registerLanguage:k,unregisterLanguage:O,listLanguages:N,getLanguage:C,registerAliases:M,autoDetection:z,inherit:BC,addPlugin:B,removePlugin:I}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=u5,e.regex={concat:_o,lookahead:qC,either:Ff,optional:CB,anyNumberOfTimes:kB};for(let T in Hf)typeof Hf[T]=="object"&&HC(Hf[T]);return Object.assign(e,Hf),e},Xl=XC({});Xl.newInstance=()=>XC({});ZC.exports=Xl;Xl.HighlightJS=Xl;Xl.default=Xl});var eT=ye((E7,JC)=>{function h5(e){let t=e.regex,i=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(s,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,a,l,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(i,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}JC.exports=h5});var iT=ye((k7,tT)=>{function f5(e){let t=e.regex,i={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,r]};r.contains.push(o);let l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},_=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],m={match:/(\/[a-z._-]+)+/},v=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:_,literal:y,built_in:[...v,...b,"set","shopt",...w,...k]},contains:[f,e.SHEBANG(),p,d,s,a,m,o,l,c,u,i]}}tT.exports=f5});var rT=ye((C7,nT)=>{function p5(e){let t=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="("+n+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o=t.concat(/\batomic_/,t.either("bool","char","schar","uchar","short","ushort","int","uint","long","ulong","llong","ullong","char16_t","char32_t","wchar_t","int_least8_t","uint_least8_t","int_least16_t","uint_least16_t","int_least32_t","uint_least32_t","int_least64_t","uint_least64_t","int_fast8_t","uint_fast8_t","int_fast16_t","uint_fast16_t","int_fast32_t","uint_fast32_t","int_fast64_t","uint_fast64_t","intptr_t","uintptr_t","size_t","ptrdiff_t","intmax_t","uintmax_t"),/\b/),l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:o}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},h={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},u,{scope:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),i,e.C_BLOCK_COMMENT_MODE]},p=[h,f],_={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},y=t.optional(r)+e.IDENT_RE+"\\s*\\(",m=12,w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},k=[...p,l,i,e.C_BLOCK_COMMENT_MODE,d,u],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:k.concat([{begin:/\(/,end:/\)/,keywords:w,contains:k.concat(["self"]),relevance:0}]),relevance:0},N={begin:"("+a+"[\\*&\\s]+){1,"+m+"}"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:w,relevance:0},{begin:y,returnBegin:!0,contains:[e.inherit(_,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,i,e.C_BLOCK_COMMENT_MODE,...p]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"</",contains:[].concat(O,N,k,[...p,{begin:e.IDENT_RE+"::",keywords:w},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}nT.exports=p5});var aT=ye((T7,sT)=>{function m5(e){let t=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+n+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|\\b0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},c,{scope:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),i,e.C_BLOCK_COMMENT_MODE]},f=[d,h],p={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},_=t.optional(r)+e.IDENT_RE+"\\s*\\(",y=12,m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],w=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],N={type:v,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},C={className:"function.dispatch",relevance:0,keywords:{_hint:w},begin:t.concat(/\b/,`(?!${m.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},M=[C,...f,o,i,e.C_BLOCK_COMMENT_MODE,u,c],z={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:M.concat([{begin:/\(/,end:/\)/,keywords:N,contains:M.concat(["self"]),relevance:0}]),relevance:0},q={className:"function",begin:"("+a+"[\\*&\\s]+){1,"+y+"}"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:N,relevance:0},{begin:_,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,i,e.C_BLOCK_COMMENT_MODE,...f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:N,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(z,q,C,M,[...f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:N,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:N},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}sT.exports=m5});var lT=ye((N7,oT)=>{function g5(e){let t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],i=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],n=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:r.concat(s),built_in:t,literal:n},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l="\\d(_*\\d)*",c="([uU][lL]?|[lL][uU]?)?",d={className:"number",variants:[{begin:"\\b0[bB]_*[01](_*[01])*"+c},{begin:"(-?)\\b0[xX]_*[a-fA-F0-9](_*[a-fA-F0-9])*"+c},{begin:"(-?)(\\b"+l+"(\\.("+l+")?)?|\\."+l+")([eE][-+]?"+l+")?"+"([fFdDmM]|[uU][lL]?|[lL][uU]?)?"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(f,{illegal:/\n/}),_={className:"subst",begin:/\{/,end:/\}/,keywords:a},y=e.inherit(_,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,y]},v={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},_]},b=e.inherit(v,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});_.contains=[v,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.C_BLOCK_COMMENT_MODE],y.contains=[b,m,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let w={variants:[h,v,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},k={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},O=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",N={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},w,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,k,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,k,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+O+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:i.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,k],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[w,d,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},N]}}oT.exports=g5});var uT=ye((A7,cT)=>{var _5=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),v5=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],b5=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],y5=[...v5,...b5],S5=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),w5=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),x5=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),E5=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function k5(e){let t=e.regex,i=_5(e),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[i.BLOCK_COMMENT,n,i.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+w5.join("|")+")"},{begin:":(:)?("+x5.join("|")+")"}]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+E5.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[i.BLOCK_COMMENT,i.HEXCOLOR,i.IMPORTANT,i.CSS_NUMBER_MODE,i.UNICODE_RANGE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},i.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:S5.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,i.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+y5.join("|")+")\\b"}]}}cT.exports=k5});var hT=ye((M7,dT)=>{function C5(e){let t=e.regex,i={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(c,{contains:[]}),h=e.inherit(u,{contains:[]});c.contains.push(h),u.contains.push(d);let f=[i,l];return[c,u,d,h].forEach(m=>{m.contains=m.contains.concat(f)}),f=f.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},i,s,n,c,u,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},r,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}dT.exports=C5});var pT=ye((O7,fT)=>{function T5(e){let t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}fT.exports=T5});var gT=ye((R7,mT)=>{function N5(e){let t=e.regex,i="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(n,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:a},d={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},h="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},O=[d,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:a},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[_]},{begin:"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:i}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=O,_.contains=O;let z=[{begin:/^\s*=>/,starts:{end:"$",contains:O}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:O}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(z).concat(c).concat(O)}}mT.exports=N5});var vT=ye((D7,_T)=>{function A5(e){let s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}_T.exports=A5});var yT=ye((L7,bT)=>{function M5(e){let t=e.regex,i=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(i,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}bT.exports=M5});var wT=ye((I7,ST)=>{function O5(e){let t=e.regex,i={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},n=e.COMMENT();n.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},o={begin:/\[/,end:/\]/,contains:[n,s,r,a,i,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,u=/'[^']*'/,d=t.either(l,c,u),h=t.concat(d,"(\\s*\\.\\s*",d,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[n,{className:"section",begin:/\[+/,end:/\]+/},{begin:h,className:"attr",starts:{end:/$/,contains:[n,o,s,r,a,i]}}]}}ST.exports=O5});var CT=ye((z7,kT)=>{var Zl="[0-9](_*[0-9])*",Wf=`\\.(${Zl})`,Kf="[0-9a-fA-F](_*[0-9a-fA-F])*",xT={className:"number",variants:[{begin:`(\\b(${Zl})((${Wf})|\\.)?|(${Wf}))[eE][+-]?(${Zl})[fFdD]?\\b`},{begin:`\\b(${Zl})((${Wf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Wf})[fFdD]?\\b`},{begin:`\\b(${Zl})[fFdD]\\b`},{begin:`\\b0[xX]((${Kf})\\.?|(${Kf})?\\.(${Kf}))[pP][+-]?(${Zl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Kf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ET(e,t,i){return i===-1?"":e.replace(t,n=>ET(e,t,i-1))}function R5(e){let t=e.regex,i="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",n="(?:(?:\\s*\\[\\s*])+)?",r=i+"<@@@>"+n,a="(?:"+("\\?(?:\\s+(?:extends|super)\\s+"+r+")?")+"|"+r+")",o=ET("(?:\\s*<\\s*"+a+"(?:\\s*,\\s*"+a+")*\\s*>)?",/<@@@>/g,2),h={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},f={className:"meta",begin:"@"+i,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:h,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{beginKeywords:"new throw return else yield assert",relevance:0},{begin:[i,t.concat(o,n,/\s+/),i,n,/\s*/,/=(?!=)/],className:{1:"type",3:"variable",6:"operator"}},{begin:[/record/,/\s+/,i],className:{1:"keyword",3:"title.class"},contains:[p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:[i,t.concat(o,n,/\s+/),i,/\s*(?=\()/],className:{1:"type",3:"title.function"},keywords:h,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,xT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},xT,f]}}kT.exports=R5});var RT=ye((B7,OT)=>{var TT="[A-Za-z$_][0-9A-Za-z$_]*",D5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],L5=["true","false","null","undefined","NaN","Infinity"],NT=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],AT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],MT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],I5=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],z5=[].concat(MT,NT,AT);function B5(e){let t=e.regex,i=(D,{after:P})=>{let Y="</"+D[0].slice(1);return D.input.indexOf(Y,P)!==-1},n=TT,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,P)=>{let Y=D[0].length+D.index,U=D.input[Y];if(U==="<"||U===","){P.ignoreMatch();return}U===">"&&(i(D,{after:Y})||P.ignoreMatch());let Z,xe=D.input.substring(Y);if(Z=xe.match(/^\s*=/)){P.ignoreMatch();return}if((Z=xe.match(/^\s+extends\s+/))&&Z.index===0){P.ignoreMatch();return}}},o={$pattern:TT,keyword:D5,literal:L5,built_in:z5,"variable.language":I5},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},v={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,_,y,{match:/\$\d+/},d];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});let w=[].concat(v,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k},N={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...NT,...AT]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},z={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(D){return t.concat("(?!",D.join("|"),")")}let I={match:t.concat(/\b/,B([...MT,"super","import","await"].map(D=>`${D}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},x={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},T="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(T)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,_,y,v,{match:/\$\d+/},d,C,{scope:"attr",match:n+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,e.REGEXP_MODE,{className:"function",begin:T,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},z,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},I,q,N,H,{match:/\$[(.]/}]}}OT.exports=B5});var LT=ye((P7,DT)=>{var P5="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",H5={scope:"number",match:P5,relevance:0};function U5(e){let t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},i={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],r={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:n},contains:[t,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,H5,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}DT.exports=U5});var zT=ye((H7,IT)=>{var Ql="[0-9](_*[0-9])*",Gf=`\\.(${Ql})`,jf="[0-9a-fA-F](_*[0-9a-fA-F])*",q5={className:"number",variants:[{begin:`(\\b(${Ql})((${Gf})|\\.)?|(${Gf}))[eE][+-]?(${Ql})[fFdD]?\\b`},{begin:`\\b(${Ql})((${Gf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Gf})[fFdD]?\\b`},{begin:`\\b(${Ql})[fFdD]\\b`},{begin:`\\b0[xX]((${jf})\\.?|(${jf})?\\.(${jf}))[pP][+-]?(${Ql})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${jf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function F5(e){let t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},i={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(a);let o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},c=q5,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=d;return h.variants[1].contains=[d],d.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts","ktm","ktx"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,i,n,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,o,l,a,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
`},c]}}IT.exports=F5});var UT=ye((U7,HT)=>{var $5=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),W5=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],K5=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],G5=[...W5,...K5],j5=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),BT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),PT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Y5=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),V5=BT.concat(PT).sort().reverse();function X5(e){let t=$5(e),i=V5,n="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",a=[],o=[],l=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},c=function(b,w,k){return{className:b,begin:w,relevance:k}},u={$pattern:/[a-z-]+/,keyword:n,attribute:j5.join(" ")},d={begin:"\\(",end:"\\)",contains:o,keywords:u,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.UNICODE_RANGE,t.HEXCOLOR,d,c("variable","@@?"+r,10),c("variable","@\\{"+r+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);let h=o.concat({begin:/\{/,end:/\}/,contains:a}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},p={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Y5.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},_={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:o,relevance:0}},y={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},m={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c("keyword","all\\b"),c("variable","@\\{"+r+"\\}"),{begin:"\\b("+G5.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",s,0),c("selector-id","#"+s),c("selector-class","\\."+s,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+BT.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+PT.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},v={begin:r+`:(:)?(${i.join("|")})`,returnBegin:!0,contains:[m]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_,y,v,p,m,f,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}HT.exports=X5});var FT=ye((q7,qT)=>{function Z5(e){let t="\\[=*\\[",i="\\]=*\\]",n={begin:t,end:i,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,i,{contains:[n],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local global not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:i,contains:[n],relevance:5}])}}qT.exports=Z5});var WT=ye((F7,$T)=>{function Q5(e){let t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},i={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},n={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,i]},r={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},a={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,i,n,r,s,a]}}$T.exports=Q5});var GT=ye(($7,KT)=>{function J5(e){let t=e.regex,i=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:i.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,s,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(_,y,m="\\1")=>{let v=m==="\\1"?m:t.concat(m,y);return t.concat(t.concat("(?:",_,")"),y,/(?:\\.|[^\\\/])*?/,v,/(?:\\.|[^\\\/])*?/,m,n)},f=(_,y,m)=>t.concat(t.concat("(?:",_,")"),y,/(?:\\.|[^\\\/])*?/,m,n),p=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...d,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",t.either(...d,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=p,a.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:p}}KT.exports=J5});var YT=ye((W7,jT)=>{function e4(e){let t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:i,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:i,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}jT.exports=e4});var XT=ye((K7,VT)=>{function t4(e){let t=e.regex,i=/(?![A-Za-z0-9])(?![$])/,n=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,i),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,i),s=t.concat(/[A-Z]+/,i),a={scope:"variable",match:"\\$+"+n},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(x,H)=>{H.data._beginMatch=x[1]||x[2]},"on:end":(x,H)=>{H.data._beginMatch!==x[1]&&H.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[
|
|
]`,p={scope:"string",variants:[u,c,d,h]},_={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],m=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:m,literal:(x=>{let H=[];return x.forEach(T=>{H.push(T),T.toLowerCase()===T?H.push(T.toUpperCase()):H.push(T.toLowerCase())}),H})(y),built_in:v},k=x=>x.map(H=>H.replace(/\|\d+$/,"")),O={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",k(v).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},N=t.concat(n,"\\b(?!\\()"),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},M={scope:"attr",match:t.concat(n,t.lookahead(":"),t.lookahead(/(?!::)/))},z={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[M,a,C,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,p,_,O]},q={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(m).join("\\b|"),"|",k(v).join("\\b|"),"\\b)"),n,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[z]};z.contains.push(q);let B=[M,C,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,p,_,O],I={begin:t.concat(/#\[\s*\\?/,t.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:w,contains:[I,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},a,q,C,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},O,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",I,a,C,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,p,_]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},p,_]}}VT.exports=t4});var QT=ye((G7,ZT)=>{function i4(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}ZT.exports=i4});var eN=ye((j7,JT)=>{function n4(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}JT.exports=n4});var iN=ye((Y7,tN)=>{function r4(e){let t=e.regex,i=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",f=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,p=`\\b|${n.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${f}))[eE][+-]?(${h})[jJ]?(?=${p})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${h})[jJ](?=${p})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,_,d,e.HASH_COMMENT_MODE]}]};return c.contains=[d,_,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,m,d]}]}}tN.exports=r4});var rN=ye((V7,nN)=>{function s4(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}nN.exports=s4});var aN=ye((X7,sN)=>{function a4(e){let t=e.regex,i=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:i,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:i},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[s,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[i,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}sN.exports=a4});var lN=ye((Z7,oN)=>{function o4(e){let t=e.regex,i=/(r#)?/,n=t.concat(i,e.UNDERSCORE_IDENT_RE),r=t.concat(i,e.IDENT_RE),s={scope:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!(?:let|for|while|if|else|match)\b)/,r,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(16|32|64|128))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","raw","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f16","f32","f64","f128","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:o,literal:l,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|"|\\|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{scope:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/\bsafe/,/\s+/,/extern/],scope:{1:"keyword",3:"keyword"}},{begin:[/fn/,/\s+/,n],scope:{1:"keyword",3:"title.function"}},{scope:"meta",begin:"#!?\\[",end:"\\]",contains:[{scope:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,n],scope:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,n,/\s+/,/in/],scope:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,n],scope:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,n],scope:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{scope:"punctuation",begin:"->"},s]}}oN.exports=o4});var uN=ye((Q7,cN)=>{var l4=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),c4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],u4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],d4=[...c4,...u4],h4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),f4=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),p4=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),m4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function g4(e){let t=l4(e),i=p4,n=f4,r="@[a-z-]+",s="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+d4.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+i.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+m4.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,t.UNICODE_RANGE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:h4.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}cN.exports=g4});var hN=ye((J7,dN)=>{function _4(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}dN.exports=_4});var pN=ye((eq,fN)=>{function v4(e){let t=e.regex,i=e.COMMENT("--","$"),n={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=u,p=[...c,...l].filter(k=>!u.includes(k)),_={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},m={match:t.concat(/\b/,t.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function v(k){return t.concat(/\b/,t.either(...k.map(O=>O.replace(/\s+/,"\\s+"))),/\b/)}let b={scope:"keyword",match:v(h),relevance:0};function w(k,{exceptions:O,when:N}={}){let C=N;return O=O||[],k.map(M=>M.match(/\|\d+$/)||O.includes(M)?M:C(M)?`${M}|0`:M)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(p,{when:k=>k.length<3}),literal:s,type:o,built_in:d},contains:[{scope:"type",match:v(a)},b,m,_,n,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,i,y]}}fN.exports=v4});var xN=ye((tq,wN)=>{function vN(e){return e?typeof e=="string"?e:e.source:null}function Du(e){return rt("(?=",e,")")}function rt(...e){return e.map(i=>vN(i)).join("")}function b4(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Hi(...e){return"("+(b4(e).capture?"":"?:")+e.map(n=>vN(n)).join("|")+")"}new RegExp(Hi(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));var db=e=>rt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),y4=["Protocol","Type"].map(db),mN=["init","self"].map(db),S4=["Any","Self"],cb=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],gN=["false","nil","true"],w4=["assignment","associativity","higherThan","left","lowerThan","none","right"],x4=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],_N=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],bN=Hi(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),yN=Hi(bN,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ub=rt(bN,yN,"*"),SN=Hi(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Vf=Hi(SN,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Yr=rt(SN,Vf,"*"),Yf=rt(/[A-Z]/,Vf,"*"),E4=["attached","autoclosure",rt(/convention\(/,Hi("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",rt(/objc\(/,Yr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],k4=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function C4(e){let t={match:/\s+/,relevance:0},i=e.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[e.C_LINE_COMMENT_MODE,i],r={match:[/\./,Hi(...y4,...mN)],className:{2:"keyword"}},s={match:rt(/\./,Hi(...cb)),relevance:0},a=cb.filter(de=>typeof de=="string").concat(["_|0"]),o=cb.filter(de=>typeof de!="string").concat(S4).map(db),l={variants:[{className:"keyword",match:Hi(...o,...mN)}]},c={$pattern:Hi(/\b\w+/,/#\w+/),keyword:a.concat(x4),literal:gN},u=[r,s,l],d={match:rt(/\./,Hi(..._N)),relevance:0},h={className:"built_in",match:rt(/\b/,Hi(..._N),/(?=\()/)},f=[d,h],p={match:/->/,relevance:0},_={className:"operator",relevance:0,variants:[{match:ub},{match:`\\.(\\.|${yN})+`}]},y=[p,_],m="([0-9]_*)+",v="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${m})(\\.(${m}))?([eE][+-]?(${m}))?\\b`},{match:`\\b0x(${v})(\\.(${v}))?([pP][+-]?(${m}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(de="")=>({className:"subst",variants:[{match:rt(/\\/,de,/[0\\tnr"']/)},{match:rt(/\\/,de,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(de="")=>({className:"subst",match:rt(/\\/,de,/[\t ]*(?:[\r\n]|\r\n)/)}),O=(de="")=>({className:"subst",label:"interpol",begin:rt(/\\/,de,/\(/),end:/\)/}),N=(de="")=>({begin:rt(de,/"""/),end:rt(/"""/,de),contains:[w(de),k(de),O(de)]}),C=(de="")=>({begin:rt(de,/"/),end:rt(/"/,de),contains:[w(de),O(de)]}),M={className:"string",variants:[N(),N("#"),N("##"),N("###"),C(),C("#"),C("##"),C("###")]},z=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],q={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:z},B=de=>{let bi=rt(de,/\//),re=rt(/\//,de);return{begin:bi,end:re,contains:[...z,{scope:"comment",begin:`#(?!.*${re})`,end:/$/}]}},I={scope:"regexp",variants:[B("###"),B("##"),B("#"),q]},x={match:rt(/`/,Yr,/`/)},H={className:"variable",match:/\$\d+/},T={className:"variable",match:`\\$${Vf}+`},L=[x,H,T],D={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:k4,contains:[...y,b,M]}]}},P={scope:"keyword",match:rt(/@/,Hi(...E4),Du(Hi(/\(/,/\s+/)))},Y={scope:"meta",match:rt(/@/,Yr)},U=[D,P,Y],Z={match:Du(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:rt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Vf,"+")},{className:"type",match:Yf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:rt(/\s+&\s+/,Du(Yf)),relevance:0}]},xe={begin:/</,end:/>/,keywords:c,contains:[...n,...u,...U,p,Z]};Z.contains.push(xe);let me={match:rt(Yr,/\s*:/),keywords:"_|0",relevance:0},Fe={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",me,...n,I,...u,...f,...y,b,M,...L,...U,Z]},Q={begin:/</,end:/>/,keywords:"repeat each",contains:[...n,Z]},ht={begin:Hi(Du(rt(Yr,/\s*:/)),Du(rt(Yr,/\s+/,Yr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Yr}]},Yt={begin:/\(/,end:/\)/,keywords:c,contains:[ht,...n,...u,...y,b,M,...U,Z,Fe],endsParent:!0,illegal:/["']/},Vt={match:[/(func|macro)/,/\s+/,Hi(x.match,Yr,ub)],className:{1:"keyword",3:"title.function"},contains:[Q,Yt,t],illegal:[/\[/,/%/]},gn={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Q,Yt,t],illegal:/\[|%/},Ri={match:[/operator/,/\s+/,ub],className:{1:"keyword",3:"title"}},Pt={begin:[/precedencegroup/,/\s+/,Yf],className:{1:"keyword",3:"title"},contains:[Z],keywords:[...w4,...gN],end:/}/},ke={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Di={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ot={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Yr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[Q,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Yf},...u],relevance:0}]};for(let de of M.variants){let bi=de.contains.find(ir=>ir.label==="interpol");bi.keywords=c;let re=[...u,...f,...y,b,M,...L];bi.contains=[...re,{begin:/\(/,end:/\)/,contains:["self",...re]}]}return{name:"Swift",keywords:c,contains:[...n,Vt,gn,ke,Di,ot,Ri,Pt,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},I,...u,...f,...y,b,M,...L,...U,Z,Fe]}}wN.exports=C4});var kN=ye((iq,EN)=>{function T4(e){let t="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},y=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},p,_,s,a],m=[...y];return m.pop(),m.push(o),f.contains=m,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}EN.exports=T4});var LN=ye((nq,DN)=>{var Xf="[A-Za-z$_][0-9A-Za-z$_]*",CN=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],TN=["true","false","null","undefined","NaN","Infinity"],NN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],AN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],MN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ON=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],RN=[].concat(MN,NN,AN);function N4(e){let t=e.regex,i=(D,{after:P})=>{let Y="</"+D[0].slice(1);return D.input.indexOf(Y,P)!==-1},n=Xf,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,P)=>{let Y=D[0].length+D.index,U=D.input[Y];if(U==="<"||U===","){P.ignoreMatch();return}U===">"&&(i(D,{after:Y})||P.ignoreMatch());let Z,xe=D.input.substring(Y);if(Z=xe.match(/^\s*=/)){P.ignoreMatch();return}if((Z=xe.match(/^\s+extends\s+/))&&Z.index===0){P.ignoreMatch();return}}},o={$pattern:Xf,keyword:CN,literal:TN,built_in:RN,"variable.language":ON},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},v={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,_,y,{match:/\$\d+/},d];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});let w=[].concat(v,h.contains),k=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k},N={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...NN,...AN]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},z={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(D){return t.concat("(?!",D.join("|"),")")}let I={match:t.concat(/\b/,B([...MN,"super","import","await"].map(D=>`${D}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},x={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},T="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(T)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,_,y,v,{match:/\$\d+/},d,C,{scope:"attr",match:n+t.lookahead(":"),relevance:0},L,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,e.REGEXP_MODE,{className:"function",begin:T,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},z,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},I,q,N,H,{match:/\$[(.]/}]}}function A4(e){let t=e.regex,i=N4(e),n=Xf,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[i.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Xf,keyword:CN.concat(l),literal:TN,built_in:RN.concat(r),"variable.language":ON},u={className:"meta",begin:"@"+n},d=(_,y,m)=>{let v=_.contains.findIndex(b=>b.label===y);if(v===-1)throw new Error("can not find mode to replace");_.contains.splice(v,1,m)};Object.assign(i.keywords,c),i.exports.PARAMS_CONTAINS.push(u);let h=i.contains.find(_=>_.scope==="attr"),f=Object.assign({},h,{match:t.concat(n,t.lookahead(/\s*\?:/))});i.exports.PARAMS_CONTAINS.push([i.exports.CLASS_REFERENCE,h,f]),i.contains=i.contains.concat([u,s,a,f]),d(i,"shebang",e.SHEBANG()),d(i,"use_strict",o);let p=i.contains.find(_=>_.label==="func.def");return p.relevance=0,Object.assign(i,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),i}DN.exports=A4});var zN=ye((rq,IN)=>{function M4(e){let t=e.regex,i={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,r),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(s,r),/ +/,t.either(a,o),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[i,n,l,c,u,d,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}IN.exports=M4});var PN=ye((sq,BN)=>{function O4(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");let i=e.COMMENT(/;;/,/$/),n=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:n},contains:[i,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,r,e.QUOTE_STRING_MODE,l,c,o]}}BN.exports=O4});var UN=ye((aq,HN)=>{var Me=QC();Me.registerLanguage("xml",eT());Me.registerLanguage("bash",iT());Me.registerLanguage("c",rT());Me.registerLanguage("cpp",aT());Me.registerLanguage("csharp",lT());Me.registerLanguage("css",uT());Me.registerLanguage("markdown",hT());Me.registerLanguage("diff",pT());Me.registerLanguage("ruby",gT());Me.registerLanguage("go",vT());Me.registerLanguage("graphql",yT());Me.registerLanguage("ini",wT());Me.registerLanguage("java",CT());Me.registerLanguage("javascript",RT());Me.registerLanguage("json",LT());Me.registerLanguage("kotlin",zT());Me.registerLanguage("less",UT());Me.registerLanguage("lua",FT());Me.registerLanguage("makefile",WT());Me.registerLanguage("perl",GT());Me.registerLanguage("objectivec",YT());Me.registerLanguage("php",XT());Me.registerLanguage("php-template",QT());Me.registerLanguage("plaintext",eN());Me.registerLanguage("python",iN());Me.registerLanguage("python-repl",rN());Me.registerLanguage("r",aN());Me.registerLanguage("rust",lN());Me.registerLanguage("scss",uN());Me.registerLanguage("shell",hN());Me.registerLanguage("sql",pN());Me.registerLanguage("swift",xN());Me.registerLanguage("yaml",kN());Me.registerLanguage("typescript",LN());Me.registerLanguage("vbnet",zN());Me.registerLanguage("wasm",PN());Me.HighlightJS=Me;Me.default=Me;HN.exports=Me});var qN,Zf,hb=se(()=>{qN=te(UN(),1),Zf=qN.default});function KN(e){let t=[];if(!e)return t;fb.lastIndex=0;let i;for(;i=fb.exec(e);){let n=i.index,r=i[0],s=i[1],a=i[2],o=n>0?e[n-1]:"";if(o&&/[\w.@/\\:-]/.test(o)||!s&&!a)continue;let l=r.replace(FN,"");for(;/[)\]]$/.test(l);){let u=l.endsWith(")")?")":"]",d=u===")"?"(":"[",h=l.split(d).length-1;if(l.split(u).length-1>h)l=l.slice(0,-1).replace(FN,"");else break}r=l;let c=ns(r);c.ok&&(t.push({start:n,end:n+r.length,text:r,url:c.target.href}),fb.lastIndex=n+Math.max(1,r.length))}return t}function GN(e){let t=KN(e);if(!t.length)return[e];let i=[],n=0;for(let r of t)r.start>n&&i.push(e.slice(n,r.start)),i.push(r),n=r.end;return n<e.length&&i.push(e.slice(n)),i}function pb(e){if(!e||!/^https?:\/\//i.test(e))return null;let t=ns(e);return t.ok?t.target.href:null}function $N(e){let t=[],i=n=>{if(n.nodeType===3){t.push(n);return}if(n.nodeType===1&&!D4.has(n.tagName))for(let r=n.firstChild;r;r=r.nextSibling)i(r)};return i(e),t}function WN(e,t){let i=t.map(l=>l.data).join(""),n=KN(i);if(!n.length)return;let r=[],s=0;for(let l of t)r.push(s),s+=l.data.length;let a=(l,c)=>{for(let u=t.length-1;u>=0;u--){let d=r[u];if(c?l>d:l>=d)return[t[u],l-d]}return[t[0],0]},o=e.ownerDocument??document;for(let l of[...n].reverse()){let[c,u]=a(l.start,!1),[d,h]=a(l.end,!0),f=o.createRange();f.setStart(c,u),f.setEnd(d,h);let p=o.createElement("a");p.href=l.url,p.dataset.acLocal=l.url,p.className="ac-local",p.appendChild(f.extractContents()),f.insertNode(p)}}function jN(e,t){for(let i of Array.from(e.querySelectorAll("a[href]"))){let n=pb(i.getAttribute("href"));n&&(i.dataset.acLocal=n,i.classList.add("ac-local"))}for(let i of Array.from(e.querySelectorAll("pre")))i.dataset.acLinked||(i.dataset.acLinked="1",WN(i,$N(i)));for(let i of $N(e))i.parentElement?.closest("pre")||i.parentNode&&WN(i.parentNode,[i]);if(t)for(let i of Array.from(e.querySelectorAll("a.ac-local")))i.title=t}var R4,fb,FN,D4,Qf=se(()=>{Cd();R4=String.raw`(?:localhost|[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*\.localhost|127(?:\.\d{1,3}){3}|0\.0\.0\.0|\[::1?\])`,fb=new RegExp(String.raw`(https?:\/\/)?${R4}(:\d{1,5})?((?:[/?#][^\s<>"'\`)】」』,。;!?、]*)?)`,"gi"),FN=/[.,;:!?。,;:!?…'"’”]+$/;D4=new Set(["A","BUTTON","SCRIPT","STYLE","TEXTAREA"])});function L4(e){let t=ue.getState(),i=t.currentThreadId;t.openPanel("preview"),yi.getState().navigate((n,r)=>V.call(n,r),fc(i),i,e,{push:!0})}async function ks(e){try{if((await V.call("app.openExternal",{url:e}))?.ok)return}catch{}await gr(e),we(g("links.externalFailed"))}function Jf(e){let i=e.target?.closest?.("a");if(!i)return;let n=i.getAttribute("href")??"";e.preventDefault();let r=i.dataset.acLocal||pb(n),s=e.ctrlKey||e.metaKey;if(r&&!s){L4(r);return}/^https?:\/\//i.test(r||n)&&ks(r||n)}var Lu=se(()=>{Pi();Qi();Md();Qf();Iu();fr();kt()});function z4(e){return I4(Je.parse(e,{async:!1}))}function gb({text:e,streaming:t}){let i=(0,Jl.useRef)(null),n=(0,Jl.useMemo)(()=>z4(e),[e]);return(0,Jl.useEffect)(()=>{let r=i.current;if(r){for(let s of r.querySelectorAll("pre")){let a=s.querySelector("code");if(!a||a.dataset.hl)continue;a.dataset.hl="1";let o=(a.textContent??"").replace(/\n$/,""),l=/(?:^|\s)language-([\w+#.-]+)/.exec(a.className)?.[1];try{Zf.highlightElement(a)}catch{}let c=l??/(?:^|\s)language-([\w+#.-]+)/.exec(a.className)?.[1]??"";U4(s,a,o,c)}t||jN(r,g("links.openPreviewTitle"))}},[n,t]),(0,XN.jsx)("div",{ref:i,className:`md${t?" streaming":""}`,onClick:Jf,dangerouslySetInnerHTML:{__html:n}})}function mb(e){let t=document.createElementNS(YN,"svg");for(let[n,r]of Object.entries({width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))t.setAttribute(n,r);let i=document.createElementNS(YN,"path");return i.setAttribute("d",e),t.appendChild(i),t}function H4(e){let t=[],i=()=>{let s=document.createElement("span");return s.className="cb-l",t.push(s),s},n=i(),r=(s,a)=>{if(s.nodeType===Node.TEXT_NODE){(s.textContent??"").split(`
|
|
`).forEach((l,c)=>{if(c>0&&(n=i()),!l)return;let u=n;for(let d of a){let h=document.createElement("span");h.className=d,u.appendChild(h),u=h}u.appendChild(document.createTextNode(l))});return}if(s.nodeType===Node.ELEMENT_NODE){let o=s.getAttribute("class");for(let l of[...s.childNodes])r(l,o?[...a,o]:a)}};for(let s of[...e.childNodes])r(s,[]);for(;t.length>1&&!t[t.length-1].textContent;)t.pop();return t}function U4(e,t,i,n){if(e.parentElement?.classList.contains("cb"))return;let r=document.createElement("div");r.className="cb";let s=document.createElement("div");s.className="cb-head";let a=document.createElement("span");a.className="cb-lang",a.textContent=n||"text";let o=document.createElement("span");o.className="cb-acts";let l=(h,f,p)=>{let _=document.createElement("button");return _.type="button",_.className=`cb-btn ${p}`,_.title=h,_.setAttribute("aria-label",h),_.appendChild(mb(f)),_},c=l(g("timeline.codeWrap"),P4,"cb-wrap");c.setAttribute("aria-pressed","false"),c.onclick=()=>{let h=!r.classList.contains("wrap");r.classList.toggle("wrap",h),c.setAttribute("aria-pressed",String(h))};let u=l(g("common.copy"),VN,"cb-copy");u.onclick=()=>{gr(i).then(()=>{u.replaceChildren(mb(B4)),u.classList.add("done"),setTimeout(()=>{u.replaceChildren(mb(VN)),u.classList.remove("done")},1200)})},o.append(c,u),s.append(a,o);let d=H4(t);d.length>1&&(t.replaceChildren(...d),r.classList.add("numbered")),e.replaceWith(r),r.append(s,e)}async function gr(e){try{await navigator.clipboard.writeText(e);return}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}catch{}}var Jl,XN,I4,YN,VN,B4,P4,Iu=se(()=>{Jl=te(mt(),1);cC();RC();hb();Qf();Lu();kt();XN=te(_e(),1);Je.setOptions({gfm:!0,breaks:!0});I4=e=>OC.sanitize(e,{USE_PROFILES:{html:!0}});YN="http://www.w3.org/2000/svg";VN="M8 8h11v12H8zM5 16V4h11",B4="M5 13l4 4L19 7",P4="M4 6h16M4 12h13a3 3 0 0 1 0 6h-4m2-2-2 2 2 2M4 18h5"});function q4(e){let[t,i]=(0,vo.useState)(Date.now());return(0,vo.useEffect)(()=>{if(!e)return;let n=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(n)},[e]),t}function ZN({pendingCount:e,pendingKey:t}){let{projects:i,threads:n}=Ge(),r=ue(),{version:s}=Kr(),[a,o]=(0,vo.useState)(!1),[l,c]=(0,vo.useState)(!1),[u,d]=(0,vo.useState)(""),[h,f,p]=Su(),_=n.find(N=>N.id===r.currentThreadId)??null,y=_?i.find(N=>N.id===_.projectId):i.find(N=>N.id===r.currentProjectId),m=_?.status==="running"||_?.status==="initializing",v=q4(m),b=m&&_?Math.max(0,v-_.updatedAt):0,w=_?e>0?{cls:"wait",text:g("topbar.waitAuth")}:m?{cls:"run",text:pe("topbar.running",{s:Math.floor(b/1e3)})}:_.status==="error"?{cls:"err",text:g("topbar.error")}:_.status==="closed"?{cls:"",text:g("topbar.closedResume")}:null:null,k=[{tab:"changes",icon:"changes",title:g("topbar.panelChanges")},{tab:"files",icon:"files",title:g("topbar.panelFiles")},{tab:"terminal",icon:"term",title:g("topbar.panelTerminal")},{tab:"preview",icon:"globe",title:g("preview.tab")}],O=_?[{kind:"item",label:g("common.rename"),onClick:()=>{d(_.title),o(!0)}},{kind:"item",label:g("topbar.threadInfo"),onClick:()=>c(!0)},{kind:"sep"},{kind:"item",label:g("common.settings"),onClick:()=>window.dispatchEvent(new CustomEvent("open-settings"))},{kind:"label",text:s?`v${s}`:""}]:[{kind:"item",label:g("common.settings"),onClick:()=>window.dispatchEvent(new CustomEvent("open-settings"))},{kind:"label",text:s?`v${s}`:""}];return(0,dt.jsxs)("header",{className:"topbar",children:[(0,dt.jsx)(Dv,{className:`tb-menu-btn${r.sbHidden?" tb-sb-collapsed":""}`}),y&&(0,dt.jsx)("span",{className:"tb-crumb",children:y.name}),y&&_&&(0,dt.jsx)("span",{className:"tb-sep",children:"/"}),_?a?(0,dt.jsx)("input",{className:"tb-rename",autoFocus:!0,value:u,onChange:N=>d(N.target.value),onBlur:()=>o(!1),onKeyDown:N=>{N.key==="Enter"&&!Vn(N.nativeEvent)&&u.trim()?(V.call("threads.update",{id:_.id,title:u.trim()}),o(!1)):N.key==="Escape"&&o(!1)}}):(0,dt.jsx)("span",{className:"tb-title",title:g("topbar.clickRename"),onClick:()=>{d(_.title),o(!0)},children:Nd(_.title,_.titleAuto)}):(0,dt.jsx)("span",{className:"tb-title ghost",children:y?g("topbar.pickThread"):g("app.title")}),w&&(w.cls==="wait"&&t?(0,dt.jsx)("button",{type:"button",className:`tb-pill ${w.cls}`,title:g("topbar.showRequest"),onClick:()=>window.dispatchEvent(new CustomEvent("ac-show-item",{detail:{key:t}})),children:w.text}):(0,dt.jsxs)("span",{className:`tb-pill ${w.cls}`,children:[w.cls==="run"&&(0,dt.jsx)("span",{className:"tb-pill-dot"}),w.text]})),(0,dt.jsxs)("div",{className:"tb-right",children:[_?.model&&(0,dt.jsx)("span",{className:"tb-model",children:_.model}),k.map(N=>(0,dt.jsx)("button",{className:`ibtn${r.panelOpen&&r.panelTab===N.tab?" on":""}`,title:N.title,onClick:()=>r.panelOpen&&r.panelTab===N.tab?r.closePanel():r.openPanel(N.tab),children:(0,dt.jsx)(ie,{name:N.icon})},N.tab)),(0,dt.jsx)("button",{className:"ibtn",title:g("common.more"),onClick:N=>f(N),children:(0,dt.jsx)(ie,{name:"dots"})})]}),h&&(0,dt.jsx)(oo,{x:h.x,y:h.y,items:O,onClose:p}),l&&_&&(0,dt.jsx)(F4,{thread:_,project:y,onClose:()=>c(!1)})]})}function F4({thread:e,project:t,onClose:i}){let n=e.usage,r=Td(),s=[[g("thread.agent"),e.provider],[g("thread.model"),e.model??g("common.default")],[g("thread.mode"),e.mode],[g("thread.effort"),e.effort??g("common.default")],[g("thread.sessionId"),e.providerSessionId??g("thread.sessionNone")],[g("thread.tokens"),pe("thread.tokensFmt",{in:ql(n.inputTokens),out:ql(n.outputTokens),cache:ql(n.cacheReadTokens)})],[g("thread.cost"),n.costUsd>0?Nf(n.costUsd):"\u2014"],[g("thread.created"),new Date(e.createdAt).toLocaleString(r)],[g("thread.workdir"),t?.path??"\u2014"]];e.importedFrom&&s.push([g("thread.importedFrom"),`${e.importedFrom.provider} / ${e.importedFrom.sessionId.slice(0,8)}\u2026`]);let a=new Set([g("thread.sessionId"),g("thread.workdir")]);return(0,dt.jsx)(Gr,{title:g("thread.info"),onClose:i,children:(0,dt.jsx)("div",{className:"info-grid",children:s.map(([o,l])=>(0,dt.jsxs)("div",{className:"info-row",children:[(0,dt.jsx)("span",{className:"info-k",children:o}),(0,dt.jsx)("span",{className:"info-v",title:l,children:l}),a.has(o)&&l!=="\u2014"&&l!==g("thread.sessionNone")&&(0,dt.jsx)("button",{className:"ibtn",title:g("common.copy"),onClick:()=>{gr(l),we(g("common.copied"))},children:(0,dt.jsx)(ie,{name:"copy",size:12})})]},o))})})}var vo,dt,QN=se(()=>{vo=te(mt(),1);Ul();Nn();Qi();bu();Pi();An();Lv();Mf();$l();Iu();fr();Af();kt();dt=te(_e(),1)});function JN(e){return typeof e=="object"?e.key:e}function eA(e,t){let i=e.length;return new Proxy(e,{get(n,r,s){if(typeof r=="string"){let a=r.charCodeAt(0);if(a>=48&&a<=57){let o=+r;if(Number.isInteger(o)&&o>=0&&o<i){let l=n[o];if(typeof l!="object"){let c=t[o*2];l=n[o]={index:o,key:l,start:c,size:t[o*2+1],end:c+t[o*2+1],lane:0}}return l}}if(r==="length")return i}return Reflect.get(n,r,s)}})}var tA=se(()=>{});function bo(e,t,i){let n=i.initialDeps??[],r,s=!0;function a(){var o;let c=0,u=e();if(!(u.length!==n.length||u.some((f,p)=>n[p]!==f)))return r;n=u;let h=0;return r=t(...u),i?.onChange&&!(s&&i.skipInitialOnChange)&&i.onChange(r),s=!1,r}return a.updateDeps=o=>{n=o},a}function _b(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}var Cs,iA,vb=se(()=>{Cs=(e,t)=>Math.abs(e-t)<1.01,iA=(e,t,i)=>{let n;return Object.assign(function(...r){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,r),i)},{cancel:()=>{e.clearTimeout(n)}})}});function nA({offset:e,isScrolling:t,elementMax:i,holdOffset:n,scrollOffset:r,pendingWrite:s,clampedMaxAtWrite:a}){var o;return t&&s===null&&e===r?"spurious":s!==null&&Math.abs(e-s.target)<1.5?"readBack":s!==null&&!s.smooth&&i!==null&&s.target>i+n+.5&&Math.abs(e-(i+n))<1.5||s!==null&&!s.smooth&&((o=s.lowMaxes)!=null&&o.some(l=>Math.abs(e-l)<1.5))?"clampedReadBack":a!==null&&Math.abs(e-a)<1.5?"clampedEcho":"external"}function rA({kind:e,offset:t,command:i,target:n}){return e!=="spurious"&&e!=="readBack"&&e!=="clampedReadBack"&&i?.index!=null&&i.phase!=="queued"&&!$4(i.phase)&&!Cs(t,i.lastTargetOffset)&&!Cs(t,n())&&e!=="clampedEcho"}function sA(e){let t=e[e.length-1];if(t===void 0)return!1;let i=e.length-2;for(;i>=0&&t.t-e[i].t<bb;)i--;if(i<0)return!1;let n=e[i],r=i-1;for(;r>=0&&n.t-e[r].t<bb;)r--;if(r<0)return!1;let s=e[r],a=(t.offset-n.offset)/(t.t-n.t),o=(n.offset-s.offset)/(n.t-s.t);return a*o>=0&&Math.abs(a)>=2*Math.abs(o)&&Math.abs(a)-Math.abs(o)>=.8}function aA(e){let t=e[e.length-1];if(t===void 0)return!1;let i=e.length-2;for(;i>=0&&t.t-e[i].t<bb;)i--;if(i<0)return!1;let n=e[i];return Math.abs(t.offset-n.offset)/(t.t-n.t)>=.05}var $4,bb,oA=se(()=>{vb();$4=e=>e==="smooth"||e==="smoothFinishing";bb=40});var zu,Bu,yb,W4,lA,ec,ep,cA=se(()=>{Bu=()=>{if(zu!==void 0)return zu;if(typeof navigator>"u")return zu=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return zu=!0;let e=navigator.maxTouchPoints;return zu=navigator.platform==="MacIntel"&&e!==void 0&&e>0},W4=()=>yb!==void 0?yb:yb=Bu()&&typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("overflow-anchor: auto"),lA=()=>!Bu()||W4(),ec={capture:!0,passive:!0},ep=class{constructor(t){this.host=t,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!=="lateFling",this.dragging=()=>{var i;return((i=this._touch)==null?void 0:i.phase)==="down"&&this._touch.moved},this.tail=()=>{var i;return((i=this._touch)==null?void 0:i.phase)==="tail"?this._touch.moved?"fling":"tap":null},this.onScroll=({isScrolling:i,ownReadBack:n,moved:r,external:s})=>{var a,o,l;return i&&((a=this._touch)==null?void 0:a.phase)==="tail"?this._openTail(this._touch.moved||!n,!1):((o=this._touch)==null?void 0:o.phase)==="lateFling"&&(this.host.now()>this._touch.until?this._touch=null:s&&i&&r&&this._openTail(!0,!1)),!n&&i&&r&&((l=this._touch)==null?void 0:l.phase)==="down"?(this._touch.moved=!0,!0):!1},this.touchStart=()=>{this.end(),this._touch={phase:"down",moved:!1}},this.touchEnd=()=>{var i;let n=((i=this._touch)==null?void 0:i.phase)==="down"&&this._touch.moved;this.end(),this._openTail(n,n)},this.end=()=>{var i;let n=this.host.getWindow();((i=this._touch)==null?void 0:i.phase)==="tail"&&n!=null&&n.clearTimeout(this._touch.timerId),this._touch=null},this.listen=i=>{let n=()=>this.touchStart(),r=()=>this.touchEnd();return i.addEventListener("touchstart",n,ec),i.addEventListener("touchend",r,ec),i.addEventListener("touchcancel",r,ec),()=>{i.removeEventListener("touchstart",n,ec),i.removeEventListener("touchend",r,ec),i.removeEventListener("touchcancel",r,ec),this.end()}},this._openTail=(i,n)=>{let r=this.host.getWindow();if(r==null)return;this.end();let s={phase:"tail",moved:i,awaitingFling:n,timerId:r.setTimeout(()=>{if(this.host.tailStillMoving()){this._openTail(s.moved,s.awaitingFling);return}this._touch=s.awaitingFling?{phase:"lateFling",until:this.host.now()+1e3}:null,this.host.onTailClosed()},150)};this._touch=s}}get touch(){return this._touch}}});function Z4(e,t,i,n){if(t===0)return!1;let r=n(0),s=new Set,a=0;for(;a<e;){let l=i(a);if(l===r)break;s.add(l),a++}let o=e-a;if(o===0||o>=t)return!1;for(let l=0;l<o;l++)if(n(l)!==i(a+l))return!1;for(let l=o;l<t;l++)if(s.has(n(l)))return!1;return!0}function Q4(e,t,i){let n=0;for(;n<=t;){let r=(n+t)/2|0,s=e[r*2];if(s<i)n=r+1;else if(s>i)t=r-1;else return r}return n>0?n-1:0}function J4(e,t,i,n,r){let s=e.length-1;if(e.length<=n)return{startIndex:0,endIndex:s};if(n===1&&r!==null){let c=Q4(r,s,i),u=c,d=i+t;for(;u<s&&r[u*2]+r[u*2+1]<d;)u++;return{startIndex:c,endIndex:u}}let o=_A(0,s,c=>e[c].start,i),l=o;if(n===1)for(;l<s&&e[l].end<i+t;)l++;else if(n>1){let c=Array(n).fill(0);for(;l<s&&c.some(d=>d<i+t);){let d=e[l];c[d.lane]=d.end,l++}let u=Array(n).fill(i+t);for(;o>=0&&u.some(d=>d>=i);){let d=e[o];u[d.lane]=d.start,o--}o=Math.max(0,o-o%n),l=Math.min(s,l+(n-1-l%n))}return{startIndex:o,endIndex:l}}var uA,fA,K4,G4,pA,dA,j4,Y4,mA,V4,X4,gA,hA,Pu,tp,_A,Sb=se(()=>{tA();vb();oA();cA();uA=e=>{let{clientWidth:t,clientHeight:i}=e;return{width:t,height:i}},fA=e=>{let t=new Set;return{schedule:i=>{let n=e.requestAnimationFrame(()=>{t.delete(n),i()});t.add(n)},cancel:()=>{t.forEach(i=>e.cancelAnimationFrame(i)),t.clear()}}},K4=e=>e,G4=e=>{let t=e.overscan*Math.max(e.lanes??1,1),i=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-i+1,s=new Array(r);for(let a=0;a<r;a++)s[a]=i+a;return s},pA=(e,t)=>{let i=e.scrollElement;if(!i)return;let n=e.targetWindow;if(!n)return;let r=o=>{let{width:l,height:c}=o;t({width:Math.round(l),height:Math.round(c)})};if(r(uA(i)),!n.ResizeObserver)return()=>{};let s=fA(n),a=new n.ResizeObserver(()=>{let o=()=>{r(uA(i))};e.options.useAnimationFrameWithResizeObserver?s.schedule(o):o()});return a.observe(i,{box:"content-box"}),()=>{a.unobserve(i),s.cancel()}},dA={passive:!0},j4=typeof window>"u"?!0:"onscrollend"in window,Y4=(e,t,i)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let s=e.options.useScrollendEvent&&j4,a=0,o=s?null:iA(r,()=>t(i(n),!1),e.options.isScrollingResetDelay),l=d=>()=>{a=i(n),o?.(),t(a,d)},c=l(!0),u=l(!1);return n.addEventListener("scroll",c,dA),s&&n.addEventListener("scrollend",u,dA),()=>{n.removeEventListener("scroll",c),s&&n.removeEventListener("scrollend",u),o?.cancel()}},mA=(e,t)=>Y4(e,t,i=>{let{horizontal:n,isRtl:r}=e.options;return n?i.scrollLeft*(r&&-1||1):i.scrollTop}),V4=(e,t,i)=>{if(i.options.useCachedMeasurements){let n=i.indexFromElement(e),r=i.options.getItemKey(n);return i.itemSizeCache.get(r)??i.options.estimateSize(n)}if(t?.borderBoxSize){let n=t.borderBoxSize[0];if(n)return Math.round(n[i.options.horizontal?"inlineSize":"blockSize"])}if(!t){let n=i.indexFromElement(e),r=i.options.getItemKey(n),s=i.itemSizeCache.get(r);if(s!==void 0)return s}return e[i.options.horizontal?"offsetWidth":"offsetHeight"]},X4=(e,{adjustments:t=0,behavior:i},n)=>{var r,s;(s=(r=n.scrollElement)==null?void 0:r.scrollTo)==null||s.call(r,{[n.options.horizontal?"left":"top"]:e+t,behavior:i})},gA=X4,hA=(e,t)=>e==="smooth"?t?"smoothLanded":"smooth":"instant",Pu=e=>e?.phase==="smooth"||e?.phase==="smoothLanded";tp=class{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new ep({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let i=this.scrollState;if(i?.phase!=="queued"||this.pendingWrite!==null)return!1;let n=this._readElementOffset();return n===null||this._lastElementOffset===null||Math.abs(n-this._lastElementOffset)<1?!1:(this._lastElementOffset=n,i.samples=[...i.samples??[],{t:this.now(),offset:n}],!0)},onTailClosed:()=>{let i=this.scrollState;i?.phase==="queued"&&aA(i.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var i,n,r;return((r=(n=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:n.now)==null?void 0:r.call(n))??Date.now()},this.observer=(()=>{let i=null,n=null,r=!1,s=!1,a=new Set,o=()=>{if(i)return i;let c=this.targetWindow;if(!c||!c.ResizeObserver)return null;let u=n=fA(c);return i=new c.ResizeObserver(d=>{let h=()=>{let f={sync:!1};this._resizeBatch=f;try{d.forEach(l)}finally{this._resizeBatch=null,f.notify&&(this.notify(f.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)u.schedule(h);else{r=!0;try{h()}finally{r=!1}}})},l=c=>{let u=c.target,d=this.indexFromElement(u);if(!u.isConnected){this.observer.unobserve(u);for(let[h,f]of this.elementsCache)if(f===u){this.elementsCache.delete(h);break}return}this.isIndexInRange(d)&&this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(u,c,this))};return{disconnect:()=>{var c;(c=o())==null||c.disconnect(),n?.cancel(),a.clear(),s=!1,i=null,n=null},observe:c=>{let u=o();if(u){if(!r){u.observe(c,{box:"border-box"});return}a.add(c),s||(s=!0,n?.schedule(()=>{s=!1,a.forEach(d=>{d.isConnected&&i?.observe(d,{box:"border-box"})}),a.clear()}))}},unobserve:c=>{var u;a.delete(c),(u=o())==null||u.unobserve(c)}}})(),this.range=null,this.setOptions=i=>{var n;let r={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:K4,rangeExtractor:G4,onChange:()=>{},measureElement:V4,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let u in i){let d=i[u];d!==void 0&&(r[u]=d)}let s=this.options,a=null,o=null,l=!1;if(s!==void 0&&s.enabled&&r.enabled&&r.anchorTo==="end"&&this.scrollElement!==null){let u=s.count,d=r.count,h=this.getMeasurements(),f=((n=this._singleLaneMeasurements)==null?void 0:n.items)??h,p=b=>JN(f[b]),_=u>0?p(0):null,y=u>0?p(u-1):null;if(d!==u||u>0&&d>0&&(r.getItemKey(0)!==_||r.getItemKey(d-1)!==y)){l=!0;let b=u>0?this.getVirtualItemForOffset(this.getScrollOffset())??h[0]:null;b&&(a=[b.key,this.getScrollOffset()-b.start]);let w=r.followOnAppend===!0?"auto":r.followOnAppend||null;w&&d>0&&this.isAtEnd(s.scrollEndThreshold)&&(u===0||r.getItemKey(d-1)!==y)&&(d>u||Z4(u,d,p,r.getItemKey))&&(o=w)}}this.options=r,l&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=null;if(a&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[u,d]=a,h=this.getMeasurements(),{count:f,getItemKey:p}=this.options,_=0;for(;_<f&&p(_)!==u;)_++;if(_<f){let y=h[_];if(y){let m=Math.max(0,y.start+d);!o&&m!==this.scrollOffset&&(c=m-this.scrollOffset,this.scrollOffset=m)}}}o?this.pendingScrollAnchor={kind:"follow",behavior:o}:c!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:"anchor",delta:c}:(this._holdOffset+=c,this._followOffsetTarget(c)))},this.notify=i=>{var n,r;(r=(n=this.options).onChange)==null||r.call(n,this,i)},this.maybeNotify=bo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var i;this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(i=this._momentumStop)==null||i.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;let n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{var o,l,c,u;let d=a?this._elementMaxScrollOffset():null,h=this._reportedOverscroll;this._reportedOverscroll=s<0||d!==null&&s>d+1;let f=s;this._lastElementOffset=f,s=this._toLayoutOffset(s);let p=this._classifyScrollEvent(s,a,d);if(p==="spurious")return;p==="readBack"?s=this.pendingWrite.target:p==="clampedReadBack"&&((o=this.scrollState)==null?void 0:o.index)!=null&&s<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=s:rA({kind:p,offset:s,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(s-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let _=this.getScrollOffset(),y=this.scrollDirection;this.scrollDirection=a?_===s?this.scrollDirection:_<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=a;let m=this.scrollState;if(m?.phase==="queued"&&p==="external"&&a)if(h||this._reportedOverscroll)m.samples=[];else{let v=this.now();m.samples=[...(m.samples??[]).filter(b=>v-b.t<=200),{t:v,offset:f}],(y!==null&&this.scrollDirection!==y||sA(m.samples))&&(this.scrollState=null)}this._iosGesture.onScroll({isScrolling:a,ownReadBack:p==="readBack",moved:s!==_,external:p==="external"&&((l=this.scrollState)==null?void 0:l.phase)!=="smooth"&&((c=this.scrollState)==null?void 0:c.phase)!=="smoothFinishing"})&&((u=this.scrollState)==null?void 0:u.phase)==="queued"&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let r=this.pendingScrollAnchor;this.pendingScrollAnchor=null,r&&this.scrollElement&&this.options.enabled&&(r.kind==="anchor"?this._canWriteScroll()?Pu(this.scrollState)&&!Cs(this.getScrollOffset()-r.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(r.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=r.delta,this._followOffsetTarget(r.delta),this.notify(!1)):this.scrollToEnd({behavior:r.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(i,n,r)=>{var s;return nA({offset:i,isScrolling:n,elementMax:r,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:((s=this._clampedAdjustment)==null?void 0:s.maxAtWrite)??null})},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;let{target:i,maxAtWrite:n}=this._clampedAdjustment,r=this.getMaxScrollOffset();r>n+.5&&(this._clampedAdjustment=i>r+.5?{target:i,maxAtWrite:r}:null,this._scrollToOffset(i))},this._writeAwaitingCommand=()=>{let i=this.scrollState;if(i===null||i.phase!=="queued")return;let{behavior:n}=i;this.getMeasurements();let r=this.getScrollStateTarget(i);i.lastTargetOffset=r,this._clampedAdjustment=null,i.phase=hA(n,i.index!=null&&Cs(r,this.getScrollOffset())),this._scrollToOffset(r,{behavior:n}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let i=this.scrollElement;if(i==null)return null;let{horizontal:n,isRtl:r}=this.options;return typeof i.scrollTop=="number"?n?i.scrollLeft*(r&&-1||1):i.scrollTop:typeof i.scrollY=="number"?n?i.scrollX:i.scrollY:null},this._canWriteScroll=()=>!(Bu()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=i=>{var n;if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||((n=this.scrollState)==null?void 0:n.phase)==="smooth")return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(i);let r=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(r),this._scrollToOffset(r)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=bo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,n,r,s,a,o,l,c)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:i,paddingStart:n,scrollMargin:r,getItemKey:s,enabled:a,lanes:o,laneAssignmentMode:l,gap:c}),{key:!1}),this.isIndexInRange=i=>i>=0&&i<this.options.count,this.getMeasurements=bo(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:n,scrollMargin:r,getItemKey:s,enabled:a,lanes:o,laneAssignmentMode:l,gap:c},u)=>{var d;let h=this.itemSizeCache;if(!a)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(let v of this.laneAssignments.keys())v>=i&&this.laneAssignments.delete(v);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(v=>{this.itemSizeCache.set(v.key,v.size)}));let f=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),o===1){let v=i*2,b=(d=this._singleLaneMeasurements)==null?void 0:d.flat;if(!b||b.length<v){let N=new Float64Array(v);b&&f>0&&N.set(b.subarray(0,f*2)),b=N}let w=f===0?new Array(i):this._singleLaneMeasurements.items.slice(),k;if(f===0)k=n+r;else{let N=f-1;k=b[N*2]+b[N*2+1]+c}for(let N=f;N<i;N++){let C=s(N);w[N]=C;let M=h.get(C),z=typeof M=="number"?M:this.options.estimateSize(N);b[N*2]=k,b[N*2+1]=z,k+=z+c}this._singleLaneMeasurements={flat:b,items:w};let O=eA(w,b);return this.measurementsCache=O,O}let p=this.measurementsCache.slice(0,f),_=new Array(o).fill(void 0),y=new Float64Array(o),m=0;for(let v=0;v<f;v++){let b=p[v];b&&(_[b.lane]===void 0&&m++,_[b.lane]=v,y[b.lane]=b.end)}for(let v=f;v<i;v++){let b=s(v),w=this.laneAssignments.get(v),k,O,N=l==="estimate"||h.has(b);if(w!==void 0&&this.options.lanes>1){k=w;let q=_[k],B=q!==void 0?p[q]:void 0;O=B?B.end+c:n+r}else if(m===o){let q=0,B=y[0],I=_[0];for(let x=1;x<o;x++){let H=y[x];(H<B||H===B&&_[x]<I)&&(q=x,B=H,I=_[x])}k=q,O=B+c,N&&this.laneAssignments.set(v,k)}else k=v%this.options.lanes,O=n+r,N&&this.laneAssignments.set(v,k);let C=h.get(b),M=typeof C=="number"?C:this.options.estimateSize(v),z=O+M;p[v]={index:v,start:O,size:M,end:z,key:b,lane:k},_[k]===void 0&&m++,_[k]=v,y[k]=z}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=bo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,n,r,s)=>i.length===0||n===0?(this.range=null,null):(this.range=J4(i,n,r,s,s===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=bo(()=>{let i=null,n=null,r=this.calculateRange();return r&&(i=r.startIndex,n=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,n,this.options.lanes]},(i,n,r,s,a,o)=>s===null||a===null?[]:i({startIndex:s,endIndex:a,overscan:n,count:r,lanes:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{let n=this.options.indexAttribute,r=i.getAttribute(n);return r?parseInt(r,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var n;if(!Pu(this.scrollState))return!0;let r=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(r!==void 0&&this.range){let s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,r-s),o=Math.min(this.options.count-1,r+s);return i>=a&&i<=o}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}let n=this.indexFromElement(i);if(!this.isIndexInRange(n))return;let r=this.options.getItemKey(n),s=this.elementsCache.get(r);s!==i&&(s&&this.observer.unobserve(s),this.observer.observe(i),this.elementsCache.set(r,i)),i.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,n)=>{var r,s,a;if(!this.isIndexInRange(i))return;(r=this._resizeBatch)!=null&&r.sync&&this.getMeasurements();let o,l,c,u=(s=this._singleLaneMeasurements)==null?void 0:s.flat;if(this.options.lanes===1&&u!=null)c=this.options.getItemKey(i),l=u[i*2],o=u[i*2+1];else{let f=this.measurementsCache[i];if(!f)return;c=f.key,l=f.start,o=f.size}let d=this.itemSizeCache.get(c)??o,h=n-d;if(h!==0){let f=this.options.anchorTo==="end"&&!Pu(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,p=f?this._getLayoutTotalSize():0,_=this.getScrollOffset(),m=!this.itemSizeCache.has(c)?l<_:l+d<=_&&this.scrollDirection!=="backward",v=!Pu(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[i]??{index:i,key:c,start:l,size:o,end:l+o,lane:0},h,this):m);(this.pendingMin===null||i<this.pendingMin)&&(this.pendingMin=i),this.itemSizeCache.set(c,n),this.itemSizeCacheVersion++;let b=!1;if(this._awaitingCommandReadBack()||(f?b=this.applyScrollAdjustment(this._getLayoutTotalSize()-p):v&&(b=this.applyScrollAdjustment(h))),this._resizeBatch){this._resizeBatch.notify=!0,(a=this._resizeBatch).sync||(a.sync=b);return}this.notify(b),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=bo(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(i,n,r)=>{let s=[];for(let a=0,o=i.length;a<o;a++){let l=i[a],c=n[l];s.push(r===0?c:{...c,start:c.start-r,end:c.end-r})}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=i=>{var n;let r=this.getMeasurements();if(r.length===0)return;let s=(n=this._singleLaneMeasurements)==null?void 0:n.flat,a=this.options.lanes===1&&s!=null,o=_A(0,r.length-1,a?l=>s[l*2]:l=>_b(r[l]).start,i);return _b(r[o])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let i=this._elementMaxScrollOffset();if(i===null)return;let n=this.pendingWrite,r=Math.max(i,0)+this._holdOffset;if(r>=n.target)return;let s=n.lowMaxes??(n.lowMaxes=[]);s[s.length-1]!==r&&s.push(r)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=i=>{var n;let r=i+this._holdOffset;return((n=this.pendingScrollAnchor)==null?void 0:n.kind)==="anchor"&&(r+=this.pendingScrollAnchor.delta),r},this._elementMaxScrollOffset=()=>{let i=this.scrollElement;if(i===null)return null;if("scrollHeight"in i)return this.options.horizontal?i.scrollWidth-i.clientWidth:i.scrollHeight-i.clientHeight;if("document"in i){let n=i.document.documentElement;return this.options.horizontal?n.scrollWidth-i.innerWidth:n.scrollHeight-i.innerHeight}return null},this._momentumStop=null,this._stopMomentum=i=>{let n=this.scrollElement,r=this.targetWindow;if(n===null||r===null)return;let s="document"in n?n.document.scrollingElement:n;if(!s?.style)return;if(this._momentumStop){this._momentumStop.done=i;return}let{style:a}=s,o=this.options.horizontal?"overflow-x":"overflow-y",l=a.getPropertyValue(o),c=a.getPropertyPriority(o),u=()=>this.options.horizontal?s.clientHeight:s.clientWidth,d=u();if(a.setProperty(o,"hidden","important"),u()!==d){a.setProperty(o,l,c);return}let h={restore:()=>a.getPropertyValue(o)!=="hidden"||a.getPropertyPriority(o)!=="important"?!1:(a.setProperty(o,l,c),!0),done:i};this._momentumStop=h,r.requestAnimationFrame(()=>r.requestAnimationFrame(()=>{this._momentumStop===h&&(this._momentumStop=null,h.restore()&&h.done())}))},this._clampedBy=i=>{let n=this._elementMaxScrollOffset();if(n===null)return null;let r=n+this._holdOffset;return i>r+.5?{target:i,maxAtWrite:r}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,n,r=0)=>{if(!this.scrollElement)return 0;let s=this.getSize(),a=this.getScrollOffset();n==="auto"&&(n=i>=a+s?"end":"start"),n==="center"?i+=(r-s)/2:n==="end"&&(i-=s);let o=this.getMaxScrollOffset();return Math.max(Math.min(o,i),0)},this.getOffsetForIndex=(i,n="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));let r=this.getSize(),s=this.getScrollOffset(),a=this.measurementsCache[i];if(!a)return;if(n==="auto")if(a.end>=s+r-this.options.scrollPaddingEnd)n="end";else if(a.start<=s+this.options.scrollPaddingStart)n="start";else return[s,n];if(n==="end"&&i===this.options.count-1){let l=this.getMaxScrollOffset(),c=l-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(c,l),0),n]}let o=n==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,n,a.size),n]},this.scrollToOffset=(i,{align:n="start",behavior:r="auto"}={})=>{this._startScroll({index:null,align:n},this.getOffsetForAlignment(i,n),r,"absolute")},this.scrollToIndex=(i,{align:n="auto",behavior:r="auto"}={})=>{i=Math.max(0,Math.min(i,this.options.count-1));let s=this.getOffsetForIndex(i,n);if(!s)return;let[a,o]=s;this._startScroll({index:i,align:o},a,r,"absolute")},this.scrollBy=(i,{behavior:n="auto"}={})=>{let r=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+i,"start");this._startScroll({index:null,align:"start"},r,n,"relative")},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this._startScroll({index:this.options.count-1,align:"end",toEnd:!0},Math.max(this.getMaxScrollOffset(),0),i,"absolute");return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{var i,n;let r=this.getMeasurements(),s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){let a=r.length-1,o=(i=this._singleLaneMeasurements)==null?void 0:i.flat;o!=null?s=o[a*2]+o[a*2+1]:s=((n=r[a])==null?void 0:n.end)??0}else{let a=Array(this.options.lanes).fill(null),o=r.length-1;for(;o>=0&&a.some(l=>l===null);){let l=r[o];a[l.lane]===null&&(a[l.lane]=l.end),o--}s=Math.max(...a.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let i=[];if(this.itemSizeCache.size===0)return i;let n=this.getMeasurements();for(let r of n)r&&this.itemSizeCache.has(r.key)&&i.push({index:r.index,key:r.key,start:r.start,size:r.size,end:r.end,lane:r.lane});return i},this._scrollToOffset=(i,{adjustments:n,behavior:r}={})=>{let s={target:i+(n??0),smooth:r==="smooth"};return this.pendingWrite=s,this.options.scrollToFn(i-this._holdOffset,{behavior:r,adjustments:n},this),s},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let i=this.getCommandWrittenOffset();return!(Bu()&&this._iosGesture.dragging())&&i!==null&&!Cs(i,this.getScrollOffset())},this._followOffsetTarget=i=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=i)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}get scrollAdjustments(){return 0}applyScrollAdjustment(t,i){if(t===0)return!1;if(this._followOffsetTarget(t),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+t);let r=this._scrollToOffset(n,{adjustments:t,behavior:i});return this.scrollOffset!==null&&(this.pendingWrite===r&&(this.scrollOffset+=t),this.scrollOffset<0&&(this.scrollOffset=0)),!0}else return this._holdOffset+=t,this.scrollOffset!==null&&(this.scrollOffset+=t),!0}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}getScrollStateTarget(t){let i=t.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:t.index!=null?this.getOffsetForIndex(t.index,t.align):void 0;return i?i[0]:t.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase==="queued"){this.scheduleScrollReconcile();return}this.getMeasurements();let n=this.getScrollStateTarget(this.scrollState),r=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,s=n!==this.scrollState.lastTargetOffset;if(!s&&Cs(n,this.getScrollOffset())){if(this.scrollState.phase==="smooth"?this.scrollState.phase="smoothLanded":this.scrollState.phase==="smoothFinishing"&&(this.scrollState.phase="instant"),this.scrollState.stableFrames++,this.scrollState.stableFrames>=r){this.getScrollOffset()!==n&&this._scrollToOffset(n,{behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){let a=this.getSize()||600,o=Math.abs(n-this.getScrollOffset()),l=Pu(this.scrollState)&&o>a;this.scrollState.lastTargetOffset=n,l?this.scrollState.phase="smooth":this.scrollState.phase==="smooth"?this.scrollState.phase="smoothFinishing":this.scrollState.phase==="smoothLanded"&&(this.scrollState.phase="instant"),this._scrollToOffset(n,{behavior:l?"smooth":"auto"})}this.scheduleScrollReconcile()}_startScroll(t,i,n,r){this.pendingScrollAnchor=null,this._clampedAdjustment=null;let s=this._iosGesture.tail();if(r==="absolute"&&s!==null){if(s==="fling"&&lA()){this._stopMomentum(()=>{let a=this.scrollState;a?.phase!=="queued"||this._iosGesture.tail()!=="fling"||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...t,startedAt:this.now(),lastTargetOffset:i,stableFrames:0,phase:"queued",behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...t,startedAt:this.now(),lastTargetOffset:i,stableFrames:0,behavior:n,phase:hA(n,t.index!=null&&Cs(i,this.getScrollOffset()))},this._scrollToOffset(i,{behavior:n}),this.scheduleScrollReconcile()}},_A=(e,t,i,n)=>{for(;e<=t;){let r=(e+t)/2|0,s=i(r);if(s<n)e=r+1;else if(s>n)t=r-1;else return r}return e>0?e-1:0}});function e6({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:i="transform",...n}){let r=_r.useReducer(h=>h+1,0)[1],s=_r.useRef({enabled:t,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});s.current.enabled=t,s.current.mode=i;let a=_r.useRef(!1),o=h=>{let f=s.current;if(!f.enabled||!f.container)return;let p=h.getTotalSize();if(p!==f.lastSize){f.lastSize=p;let _=h.options.horizontal?"width":"height";f.container.style[_]=`${p}px`}},l=(h,f,p)=>{let _=s.current,y=!!h.options.horizontal,m=f.start-h.options.scrollMargin;_.lastPositions.get(p)!==m&&(_.lastPositions.set(p,m),_.mode==="transform"?p.style.transform=y?`translate3d(${m}px, 0, 0)`:`translate3d(0, ${m}px, 0)`:p.style[y?"left":"top"]=`${m}px`)},c=h=>{let f=s.current;if(!(!f.enabled||!f.container)){o(h);for(let p of h.getVirtualItems()){let _=h.elementsCache.get(p.key);_&&l(h,p,_)}}},u={...n,onChange:(h,f)=>{var p;let _=s.current,y=!0;if(_.enabled){c(h);let m=h.range,v=_.prevRange;y=!v||v.isScrolling!==h.isScrolling||v.startIndex!==m?.startIndex||v.endIndex!==m?.endIndex,y&&(_.prevRange=m?{startIndex:m.startIndex,endIndex:m.endIndex,isScrolling:h.isScrolling}:null)}y&&(e&&f&&!a.current?(0,vA.flushSync)(r):r()),(p=n.onChange)==null||p.call(n,h,f)}},[d]=_r.useState(()=>{let h=new tp(u),f=h.measureElement;return h.measureElement=p=>{a.current=!0;try{f(p)}finally{a.current=!1}let _=s.current;if(p!==null&&_.enabled&&_.container){let y=h.measurementsCache[h.indexFromElement(p)];y&&l(h,y,p)}},Object.assign(h,{containerRef:p=>{let _=s.current;_.container=p,_.lastSize=null,p!==null&&c(h)}})});return d.setOptions(u),wb(()=>d._didMount(),[]),wb(()=>(o(d),d._willUpdate())),wb(()=>{c(d)}),d}function bA(e){return e6({observeElementRect:pA,observeElementOffset:mA,scrollToFn:gA,...e})}var _r,vA,wb,yA=se(()=>{_r=te(mt(),1),vA=te(qs(),1);Sb();Sb();wb=typeof document<"u"?_r.useLayoutEffect:_r.useEffect});function SA(e=Date.now()){return xb=(xb+1)%1e6,`c${e.toString(36)}${xb.toString(36)}${Math.random().toString(36).slice(2,8)}`}function Eb(e,t){return t?`u:c:${t}`:`u:${e}`}function wA(e,t){return t.length?[...e,...t]:e}var xb,ip,kb=se(()=>{xb=0;ip=class{constructor(){fe(this,"list",[])}add(t){let i={ts:Date.now(),...t,state:"sending",echoed:!1,settled:!1,busySeen:!1};return this.list.push(i),i}get(t){return this.list.find(i=>i.clientId===t)}entries(t){return this.list.filter(i=>i.threadId===t)}remove(t){this.list=this.list.filter(i=>i.clientId!==t)}gc(t){t.echoed&&t.settled&&this.remove(t.clientId)}echo(t){if(!t)return!1;let i=this.get(t);return i?(i.echoed=!0,i.state="sending",i.error=void 0,this.gc(i),!0):!1}ok(t,i){let n=this.get(t);if(n){if(i==="queued"&&!n.echoed){this.remove(t);return}n.settled=!0,this.gc(n)}}fail(t,i){let n=this.get(t);return n?(n.settled=!0,n.echoed?(this.gc(n),!1):(n.state="failed",n.error=i,!0)):!1}busy(t){for(let i of this.list)i.threadId===t&&(i.busySeen=!0)}reconcile(t,i){for(let n of i){let r=this.get(n);r&&r.threadId===t&&this.echo(n)}}items(t){return this.entries(t).filter(i=>!i.echoed).map(i=>({kind:"user",key:Eb(0,i.clientId),text:i.payload.text,...i.display.attachments?.length?{attachments:i.display.attachments}:{},...i.display.mentions?.length?{mentions:i.display.mentions}:{},...i.payload.behavior==="steer"?{steered:!0}:{},ts:i.ts,clientId:i.clientId,sendState:i.state,...i.error?{sendError:i.error}:{}}))}starting(t){return this.entries(t).some(i=>i.startsTurn&&i.state==="sending"&&!i.settled&&!i.busySeen)}}});function tc(){return{items:[],seenSeq:new Set,byItemId:new Map,toolLoc:new Map,openGroup:null,reqLoc:new Map,turnUsage:new Map,lastUserIdx:new Map,turnStart:new Map,turnModel:new Map}}function Ts(e){e.openGroup=null}function xA(e,t,i,n){let r=e.byItemId.get(t);if(r){let o=e.items[r.idx];o.text+=n,o.streaming=!0;return}Ts(e);let s=`${i}:${t}`,a=i==="assistant"?{kind:"assistant",key:s,itemId:t,text:n,streaming:!0}:{kind:"reasoning",key:s,itemId:t,text:n,streaming:!0};e.byItemId.set(t,{idx:e.items.length,field:i}),e.items.push(a)}function t6(e,t,i){let n=/^(.*):[ktx]\d+$/.exec(t);if(!n)return;let r=n[1]+":";for(let[s,a]of[...e.byItemId])a.field===i&&s.startsWith(r)&&s!==t&&(e.items[a.idx]={kind:"gone",key:`gone:${s}`},e.byItemId.delete(s))}function EA(e,t,i,n){t6(e,t,i);let r=e.byItemId.get(t);if(r){let o=e.items[r.idx];o.text=n,o.streaming=!1;return}Ts(e);let s=`${i}:${t}`,a=i==="assistant"?{kind:"assistant",key:s,itemId:t,text:n,streaming:!1}:{kind:"reasoning",key:s,itemId:t,text:n,streaming:!1};e.byItemId.set(t,{idx:e.items.length,field:i}),e.items.push(a)}function i6(e,t){let i=e.toolLoc.get(t.itemId);if(i){let a=e.items[i.group];if(a?.kind==="toolgroup"){let o=a.steps[i.step];a.steps[i.step]={...o,kind:t.kind==="other"&&o.kind!=="other"?o.kind:t.kind,title:t.title||o.title,status:t.status,input:t.input??o.input,detail:t.detail??o.detail,output:t.output??o.output,exitCode:t.exitCode??o.exitCode,durationMs:t.durationMs??o.durationMs}}return}let n={itemId:t.itemId,kind:t.kind,title:t.title,status:t.status,input:t.input,detail:t.detail,output:t.output,exitCode:t.exitCode,durationMs:t.durationMs},r=e.openGroup;(r==null||e.items[r]?.kind!=="toolgroup")&&(r=e.items.length,e.items.push({kind:"toolgroup",key:`tg:${t.itemId}`,steps:[]}),e.openGroup=r);let s=e.items[r];e.toolLoc.set(t.itemId,{group:r,step:s.steps.length}),s.steps.push(n)}function np(e,t){if(t.seq!=null&&t.seq>0){if(e.seenSeq.has(t.seq))return;e.seenSeq.add(t.seq)}switch(t.type){case"user_message":Ts(e),e.lastUserIdx.set(t.turnId??"",e.items.length),e.items.push({kind:"user",key:Eb(t.seq,t.clientId),text:t.text,attachments:t.attachments,...t.mentions?.length?{mentions:t.mentions}:{},steered:t.steered,ts:t.ts,...t.clientId?{clientId:t.clientId}:{}});return;case"assistant_delta":xA(e,t.itemId,"assistant",t.text);return;case"reasoning_delta":xA(e,t.itemId,"reasoning",t.text);return;case"assistant_message":EA(e,t.itemId,"assistant",t.text);return;case"reasoning":EA(e,t.itemId,"reasoning",t.text);return;case"tool_output_delta":{let i=e.toolLoc.get(t.itemId);if(i){let n=e.items[i.group];if(n?.kind==="toolgroup"){let r=n.steps[i.step];r.output=(r.output??"")+t.text}}return}case"tool_call":i6(e,t);return;case"plan":if(Ts(e),t.entries?.length){e.items.push({kind:"todo",key:`todo:${t.seq}`,items:t.entries.map(i=>({text:i.step,status:i.status==="completed"?"done":i.status||"pending"}))});return}e.items.push({kind:"plan",key:`plan:${t.itemId}`,itemId:t.itemId,markdown:t.markdown});return;case"todo":Ts(e),e.items.push({kind:"todo",key:`todo:${t.seq}`,items:t.items});return;case"permission_request":Ts(e),e.reqLoc.set(t.requestId,e.items.length),e.items.push({kind:"permission",key:`perm:${t.requestId}`,requestId:t.requestId,title:t.title,kindStr:t.kind,detail:t.detail,options:t.options,status:"pending",...t.auto?{auto:!0}:{}});return;case"permission_resolved":{let i=e.reqLoc.get(t.requestId),n=i!=null?e.items[i]:null;n?.kind==="permission"?(n.status=t.cancelled?"cancelled":"resolved",n.choice=t.optionId,t.auto&&(n.auto=!0)):n?.kind==="question"&&t.cancelled&&n.status==="pending"&&(n.status="cancelled");return}case"question":Ts(e),e.reqLoc.set(t.requestId,e.items.length),e.items.push({kind:"question",key:`q:${t.requestId}`,requestId:t.requestId,questions:t.questions,status:"pending"});return;case"question_answered":{let i=e.reqLoc.get(t.requestId),n=i!=null?e.items[i]:null;n?.kind==="question"&&(n.status="answered",n.answers=t.answers);return}case"usage":{let i=t.turnId??"",n=e.turnUsage.get(i)??{inputTokens:0,outputTokens:0,cacheReadTokens:0,costUsd:0};n.inputTokens+=t.inputTokens,n.outputTokens+=t.outputTokens,n.cacheReadTokens+=t.cacheReadTokens,n.costUsd+=t.costUsd,e.turnUsage.set(i,n);return}case"notice":Ts(e),e.items.push({kind:"notice",key:`n:${t.seq}`,level:t.level,message:t.message,...t.code?{code:t.code}:{}});return;case"turn_ended":Ts(e),n6(e),e.items.push({kind:"turnend",key:`te:${t.seq}`,status:t.status,durationMs:t.durationMs??(e.turnStart.has(t.turnId)?Math.max(0,t.ts-e.turnStart.get(t.turnId)):void 0),error:t.error,filesChanged:t.filesChanged,usage:e.turnUsage.get(t.turnId),...e.turnModel.has(t.turnId)?{model:e.turnModel.get(t.turnId)}:{},ts:t.ts});return;case"turn_started":e.turnStart.set(t.turnId,t.ts),e.turnModel.set(t.turnId,t.model??null);return;case"status":return;default:return}}function n6(e){for(let t of e.reqLoc.values()){let i=e.items[t];(i?.kind==="permission"||i?.kind==="question")&&i.status==="pending"&&(i.status="cancelled")}}function Hu(e){let t=[];for(let i of e)(i.kind==="permission"||i.kind==="question")&&i.status==="pending"&&t.push({requestId:i.requestId,kind:i.kind,key:i.key});return t}function kA(e,t={}){let i=tc();for(let s of e)np(i,s);let n=t.runtimeStatus!=="running"&&t.runtimeStatus!=="initializing",r=null;for(let s of i.items){if(s.kind==="user"&&(r=s.text),n&&s.kind==="permission"&&s.status==="pending"&&(s.status="cancelled"),n&&s.kind==="question"&&s.status==="pending"&&(s.status="cancelled"),n&&s.kind==="toolgroup")for(let a of s.steps)a.status==="running"&&(a.status="failed");(s.kind==="assistant"||s.kind==="reasoning")&&n&&s.streaming&&(s.streaming=!1)}return{items:i.items,lastUserText:r}}var CA=se(()=>{kb()});var NA={};z2(NA,{localClientIds:()=>sp,useTimeline:()=>Mi});function TA(){let e=br!=="running"&&br!=="initializing";for(let t of vr.items)if(e&&t.kind==="permission"&&t.status==="pending"&&(t.status="cancelled"),e&&t.kind==="question"&&t.status==="pending"&&(t.status="cancelled"),e&&(t.kind==="assistant"||t.kind==="reasoning")&&t.streaming&&(t.streaming=!1),e&&t.kind==="toolgroup")for(let i of t.steps)i.status==="running"&&(i.status="failed")}var Rn,sp,Cb,vr,yo,br,rp,Mi,So=se(()=>{Da();CA();Pi();kb();Rn=new ip,sp=new Set,Cb=e=>e==="running"||e==="initializing",vr=tc(),yo=0,br="idle",rp=null;Mi=Pn((e,t)=>{let i=s=>({items:wA(vr.items.slice(),Rn.items(s)),status:!Cb(br)&&Rn.starting(s)?"initializing":br}),n=s=>{t().threadId===s&&e(i(s))},r=s=>{rp?.(),rp=V.subscribe(`thread:${s}`,(a,o)=>{let l=o;if(t().threadId===s){if(l.type==="event"&&l.event){let c=l.event;if(c.seq!=null&&c.seq>0){if(c.seq<=yo)return;yo=Math.max(yo,c.seq)}c.type==="user_message"&&(e({lastUserText:c.text}),Rn.echo(c.clientId)),np(vr,c),e({...i(s),pending:Hu(vr.items)});return}if(l.type==="status"&&l.status){br=l.status,(Cb(br)||br==="error"||br==="closed")&&Rn.busy(s),TA(),e({...i(s),pending:Hu(vr.items)});return}if(l.type==="queue"&&l.queue){e({queue:l.queue});return}if(l.type==="pending"&&l.pending){e({pending:Hu(vr.items).filter(c=>l.pending.some(u=>u.requestId===c.requestId))});return}if(l.type==="commands"&&l.commands){e({slashCommands:l.commands});return}}},()=>yo)};return{threadId:null,status:"idle",items:[],queue:[],pending:[],lastUserText:null,error:null,slashCommands:[],sentAt:0,open:s=>{t().threadId!==s&&(t().close(),e({threadId:s,status:"initializing",items:Rn.items(s),queue:[],pending:[],lastUserText:null,error:null,slashCommands:[]}),vr=tc(),yo=0,br="initializing",(async()=>{try{let a=await V.call("threads.get",{id:s});if(t().threadId!==s)return;br=a.runtimeStatus??a.meta.status;let o=kA(a.events,{runtimeStatus:br});vr=tc();for(let l of a.events)np(vr,l);yo=Math.max(0,...a.events.map(l=>l.seq??0)),Rn.reconcile(s,a.events.flatMap(l=>l.type==="user_message"&&l.clientId?[l.clientId]:[])),TA(),e({...i(s),queue:a.queue??[],pending:Hu(vr.items),lastUserText:o.lastUserText}),t().threadId===s&&r(s)}catch(a){t().threadId===s&&e({error:String(a?.message??a),status:"error"})}})())},close:()=>{rp?.(),rp=null,vr=tc(),yo=0,e({threadId:null,items:[],queue:[],pending:[],lastUserText:null,error:null,status:"idle",slashCommands:[]})},send:async(s,a,o={},l={})=>{let c=SA();if(l.optimistic!==!1){let d=t().threadId===s?t().status:"idle";Rn.add({clientId:c,threadId:s,payload:a,display:o,startsTurn:!Cb(d)&&a.behavior!=="steer"}),sp.add(c),t().threadId===s&&e({...i(s),sentAt:Date.now()})}try{let d=await V.call("thread.send",{id:s,text:a.text,...a.attachments?.length?{attachments:a.attachments}:{},...a.mentions?.length?{mentions:a.mentions}:{},...a.behavior?{behavior:a.behavior}:{},clientId:c});return Rn.ok(c,d?.delivered),n(s),d}catch(d){throw Rn.fail(c,String(d?.message??d)),n(s),d}},retry:s=>{let a=Rn.get(s);!a||a.state!=="failed"||(Rn.remove(s),t().send(a.threadId,a.payload,a.display).catch(()=>{}))},dismiss:s=>{let a=Rn.get(s);!a||a.state!=="failed"||(Rn.remove(s),n(a.threadId))}}})});var ap,AA=se(()=>{ap=class{constructor(t,i=2,n=8){fe(this,"render",t);fe(this,"minStep",i);fe(this,"frac",n);fe(this,"target","");fe(this,"shown","");fe(this,"raf",0);fe(this,"running",!1);fe(this,"tick",()=>{if(this.shown===this.target){this.running=!1;return}let t=this.target.length-this.shown.length,i=Math.max(this.minStep,Math.ceil(t/this.frac));this.shown=this.target.slice(0,this.shown.length+i),this.render(this.shown),this.raf=requestAnimationFrame(this.tick)})}push(t){this.target=t,this.shown.length>t.length&&(this.shown=t),this.running||(this.running=!0,this.tick())}flush(){this.shown=this.target,this.render(this.shown),this.running=!1,this.raf&&cancelAnimationFrame(this.raf)}stop(){this.running=!1,this.raf&&cancelAnimationFrame(this.raf)}}});function ic(){let e=location.hash.startsWith("#")?location.hash.slice(1):location.hash;return new URLSearchParams(e).get("t")??""}var op=se(()=>{});function r6(e){return e==="+"||e==="-"?e:" "}function MA(e){if(!Array.isArray(e))return[];let t=[];for(let i of e){if(!i||typeof i!="object")continue;let n=i,r=[];for(let a of Array.isArray(n.lines)?n.lines:[]){if(!a||typeof a!="object")continue;let o=typeof a.text=="string"?a.text:typeof a.s=="string"?a.s:"";r.push({t:r6(a.t),text:o})}let s=typeof n.head=="string"?n.head:void 0;s===void 0&&Number.isInteger(n.oldStart)&&Number.isInteger(n.newStart)&&(s=`@@ -${n.oldStart} +${n.newStart} @@`),t.push({head:s,lines:r})}return t}var OA=se(()=>{});function Tb(e){return e.kind==="reasoning"&&e.text.trim().length<=200}function RA(e){return{itemId:`think:${e.itemId}`,kind:"think",title:"",status:e.streaming?"running":"ok",think:{text:e.text,streaming:e.streaming}}}function s6(e){let t=new Set,i=null;for(let n of e)n.kind==="user"?i=null:n.kind==="todo"&&(i&&t.add(i),i=n);return t}function DA(e,t={}){let i=t.showThinking!==!1,n=s6(e),r=[],s=null,a=[],o=()=>{for(let l of a)(l.streaming||l.text.trim())&&r.push(l);a=[]};for(let l of e)if(!(l.kind==="gone"||n.has(l))){if(l.kind==="toolgroup"){let c=l.steps.filter(u=>u.kind!=="todo");if(!c.length)continue;s?s.steps.push(...c):(s={kind:"toolgroup",key:l.key,steps:[...i?a.map(RA):[],...c]},a=[],r.push(s));continue}if(l.kind==="reasoning"){if(!i)continue;if(Tb(l)){if(!l.streaming&&!l.text.trim())continue;s?s.steps.push(RA(l)):a.push(l);continue}}o(),s=null,r.push(l)}return o(),r}function Nb(e){switch(e){case"think":return"think";case"edit":case"write":return"edit";case"bash":return"run";case"read":return"read";case"search":case"glob":case"web":return"search";default:return"other"}}function LA(e){let t=new Map,i=0,n=0;for(let r of e){let s=Nb(r.kind);if(s==="think"){n+=r.think?.text.length??0;continue}t.set(s,(t.get(s)??0)+1),r.status==="failed"&&i++}return{counts:a6.filter(r=>t.has(r)).map(r=>[r,t.get(r)]),failed:i,thinkSecs:n?Math.max(1,Math.round(n/40)):0}}function Ab(e){let t=e.input??{},i=e.detail??{};return(yr(i.command)||yr(t.command)||yr(t.cmd)||yr(t.file_path)||yr(t.path)||yr(i.path)||yr(t.filePath)||yr(t.pattern)||yr(t.query)||yr(t.url)||yr(e.title)).replace(/\s+/g," ")}function IA(e){for(let i=e.length-1;i>=0;i--){let n=e[i];if(n.status==="running"&&n.kind!=="think")return n}let t=e[e.length-1];return t&&t.kind==="think"&&t.think?.streaming?t:null}function zA(e){let t=0;for(let i of e)i.kind!=="think"&&t++;return t}function BA(e){let t=e.detail??null;if(!t||typeof t!="object")return null;if(typeof t.added=="number"&&typeof t.removed=="number")return{added:t.added,removed:t.removed};let i=Array.isArray(t.hunks)?t.hunks:Array.isArray(t.diff?.hunks)?t.diff.hunks:null;if(!i)return null;let n=0,r=0;for(let s of i)for(let a of s.lines??[])a?.t==="+"?n++:a?.t==="-"&&r++;return{added:n,removed:r}}function cp(e){return{done:e.filter(t=>t.status==="done"||t.status==="completed").length,total:e.length}}function PA(e){for(let t=e.length-1;t>=0;t--){let i=e[t];if(i.kind==="todo")return i.items.some(n=>n.status!=="done")?i:null;if(i.kind==="user")return null}return null}var lp,a6,yr,Uu=se(()=>{lp=6;a6=["edit","run","read","search","other"];yr=e=>typeof e=="string"&&e.trim()?e.trim():""});function o6(e){let t=e.replace(/\r\n?/g,`
|
|
`).replace(/\u00a0/g," ");return t=t.split(`
|
|
`).map(i=>i.replace(/\s+$/u,"")).join(`
|
|
`),t=t.replace(/\n{3,}/g,`
|
|
|
|
`).replace(/^\n+|\n+$/g,""),t.length>4e3&&(t=t.slice(0,4e3).replace(/\s+$/u,"")+"\u2026"),t}function up(e,t,i){let n=o6(t);return!n.trim()||e.some(r=>r.text===n&&r.src===i)||e.length>=10?e:[...e,{id:`q${Date.now().toString(36)}${(l6++).toString(36)}`,text:n,src:i}]}function HA(e,t){return e.length?[...e.map(n=>{let r=n.text.split(`
|
|
`).map(s=>s?`> ${s}`:">");return(n.src?[`> [${n.src}]`,...r]:r).join(`
|
|
`)}),t].filter(n=>n.trim()).join(`
|
|
|
|
`):t}function UA(e,t=28){let n=(e.text.split(`
|
|
`).find(r=>r.trim())??"").trim().replace(/\s+/g," ");return n.length>t?n.slice(0,t-1)+"\u2026":n}function qA(e,t,i,n,r=6){let s=e.filter(d=>d.bottom>t.top&&d.top<t.bottom&&d.right>d.left);if(!s.length)return null;let a=Math.min(...s.map(d=>d.top)),o=Math.max(...s.map(d=>d.bottom)),l=s.reduce((d,h)=>h.top<d.top?h:d),c=s.reduce((d,h)=>h.bottom>d.bottom||h.bottom===d.bottom&&h.right>d.right?h:d),u=d=>Math.max(8,Math.min(d,n-i.w-8));return a-r-i.h>=t.top?{left:u(l.left),top:a-r-i.h,side:"above"}:o+r+i.h<=t.bottom?{left:u(c.right-i.w),top:o+r,side:"below"}:{left:u(c.right-i.w),top:Math.max(t.top,t.bottom-i.h-r),side:"inside"}}function Mb(e){let t=e.split(/\n{2,}/),i=[],n=0;for(;n<t.length;n++){let r=t[n].split(`
|
|
`);if(!r.every(s=>s===">"||s.startsWith("> ")))break;i.push(r.map(s=>s===">"?"":s.slice(2)).join(`
|
|
`))}return n===t.length?{quotes:[],rest:e}:{quotes:i,rest:t.slice(n).join(`
|
|
|
|
`)}}function FA(e){let t=Mb(e),i=[];for(let n of t.quotes){let r=/^\[([^\]\n]+)\]\n([\s\S]*)$/.exec(n);i=r?up(i,r[2],r[1]):up(i,n)}return{quotes:i,rest:t.rest}}var l6,dp=se(()=>{l6=0});function $A(e){return e.kind==="permission"&&!!e.auto&&e.status!=="cancelled"}function c6(e){return e.kind==="toolgroup"||e.kind==="gone"||Tb(e)}function WA(e){if(!e.some($A))return e;let t=[],i=null,n=()=>{i&&t.push(i),i=null};for(let r of e){if($A(r)){i||(i={kind:"autoperm",key:`autoperm:${r.requestId}`,items:[]}),i.items.push(r);continue}i&&!c6(r)&&n(),t.push(r)}return n(),t}function KA(e){let t=e.detail??{};return(typeof t.command=="string"&&t.command.trim()?t.command:typeof t.path=="string"&&t.path.trim()?t.path:typeof t.diff?.path=="string"&&t.diff.path.trim()?t.diff.path:e.title).replace(/\s+/g," ").trim()}function GA(e){return e.choice?e.options.find(t=>t.id===e.choice)?.label??e.choice:null}var Ob=se(()=>{Uu()});function jA({it:e}){let[t,i]=(0,Rb.useState)(!1),n=e.items.map(KA).filter(Boolean).join(" \xB7 ");return(0,bt.jsxs)("div",{className:`apv${t?" open":""}`,"data-testid":"auto-approved",children:[(0,bt.jsxs)("button",{className:"apv-head","aria-expanded":t,onClick:()=>i(!t),title:g("timeline.autoApproved.title"),children:[(0,bt.jsx)("span",{className:"apv-ic","aria-hidden":!0,children:(0,bt.jsx)(ie,{name:"shieldCheck",size:13})}),(0,bt.jsx)("span",{className:"apv-n",children:pe("timeline.autoApproved.count",{n:e.items.length})}),!t&&n&&(0,bt.jsx)("span",{className:"apv-peek",children:n}),(0,bt.jsx)("span",{className:`caret${t?" open":""}`,"aria-hidden":!0,children:"\u203A"})]}),t&&(0,bt.jsx)("div",{className:"apv-list",children:e.items.map(r=>{let s=r.detail??{},a=GA(r),o=typeof s.command=="string"&&s.command.trim()?s.command.trim():"",l=!o&&typeof s.path=="string"&&s.path.trim()?s.path.trim():"",c=r.status==="pending"?g("timeline.autoApproved.pending"):pe("timeline.autoApproved.answer",{opt:a??g("timeline.permAllowed")});return(0,bt.jsxs)("div",{className:"apv-row",title:[r.title,o||l,c].filter(Boolean).join(`
|
|
`),children:[(0,bt.jsx)("span",{className:"ts-ic","aria-hidden":!0,children:(0,bt.jsx)(ie,{name:r.status==="pending"?"hourglass":"check",size:13})}),o?(0,bt.jsx)("span",{className:"apv-cmd",children:o}):l?(0,bt.jsx)("span",{className:"apv-path",children:l}):(0,bt.jsx)("span",{className:"apv-title",children:r.title}),(0,bt.jsx)("span",{className:"apv-meta",children:c})]},r.requestId)})})]})}function VA({it:e,threadId:t}){let[i,n]=(0,Rb.useState)(!1),r=e.code==="auto_approve_migrated",s=()=>{n(!0),V.call("thread.setMode",{id:t,mode:"bypassPermissions"}).catch(()=>{}).finally(()=>n(!1))};return(0,bt.jsxs)("div",{className:"nt nt-auto","data-testid":"auto-upgrade-notice",role:"note",children:[(0,bt.jsxs)("div",{className:"nt-auto-h",children:[(0,bt.jsx)("span",{className:"apv-ic",children:(0,bt.jsx)(ie,{name:"shieldCheck",size:14})}),(0,bt.jsx)("b",{children:g("timeline.autoUpgrade.title")})]}),(0,bt.jsx)("div",{children:g(r?"timeline.autoUpgrade.migrated":"timeline.autoUpgrade.body")}),(0,bt.jsxs)("div",{className:"nt-actions",children:[(0,bt.jsx)("button",{type:"button",className:"btn",disabled:i,onClick:s,children:g("timeline.autoUpgrade.turnOn")}),(0,bt.jsx)("button",{type:"button",className:"btn",onClick:()=>window.dispatchEvent(new Event("open-settings")),children:g("timeline.autoUpgrade.settings")})]})]})}var Rb,bt,YA,XA=se(()=>{Rb=te(mt(),1);Ob();An();kt();Pi();bt=te(_e(),1);YA=new Set(["auto_approve_upgrade","auto_approve_migrated"])});function tM(e){return`/attachments/${e}?t=${eM()}`}function u6({text:e}){let t=(0,Ot.useMemo)(()=>GN(e),[e]);return t.length===1&&typeof t[0]=="string"?(0,R.jsx)(R.Fragment,{children:e}):(0,R.jsx)(R.Fragment,{children:t.map((i,n)=>typeof i=="string"?i:(0,R.jsx)("a",{href:i.url,"data-ac-local":i.url,className:"ac-local",title:g("links.openPreviewTitle"),children:i.text},n))})}function Ib({path:e,isDir:t,onRemove:i}){return(0,R.jsxs)("span",{className:"mention",title:e,children:[(0,R.jsx)(ie,{name:t?"files":"file",size:12}),(0,R.jsxs)("span",{className:"mention-name",children:[d6(e),t?"/":""]}),i&&(0,R.jsx)("button",{type:"button",className:"att-x","aria-label":g("mention.remove"),onClick:i,children:"\xD7"})]})}function iM(){let[e,t]=(0,Ot.useState)(!1);return(0,Ot.useEffect)(()=>{if(!e)return;let i=setTimeout(()=>t(!1),1500);return()=>clearTimeout(i)},[e]),[e,i=>{gr(i).then(()=>t(!0))}]}function h6({it:e,onRetry:t}){let[i,n]=iM(),r=(0,Ot.useMemo)(()=>Mb(e.text),[e.text]),s=()=>window.dispatchEvent(new CustomEvent("ac-composer-fill",{detail:{text:e.text,mentions:e.mentions??[]}})),a=!!e.clientId&&sp.has(e.clientId),o=e.sendState==="failed";return(0,R.jsxs)("div",{className:`um-row${a?" fresh":""}${e.sendState?` ${e.sendState}`:""}`,"data-client-id":e.clientId,children:[(0,R.jsxs)("div",{className:"um",children:[e.attachments?.filter(l=>Db(l.mime)).map(l=>(0,R.jsx)("img",{className:"um-img",src:`/attachments/${l.id}?t=${eM()}`,alt:l.name},l.id)),e.attachments?.some(l=>!Db(l.mime))&&(0,R.jsx)("span",{className:"um-mentions",children:e.attachments.filter(l=>!Db(l.mime)).map(l=>(0,R.jsxs)("span",{className:"mention",title:l.name,children:[(0,R.jsx)(ie,{name:"file",size:12}),(0,R.jsx)("span",{className:"mention-name",children:l.name})]},l.id))}),e.mentions&&e.mentions.length>0&&(0,R.jsx)("span",{className:"um-mentions",children:e.mentions.map(l=>(0,R.jsx)(Ib,{path:l.path,isDir:l.isDir},l.path))}),r.quotes.map((l,c)=>(0,R.jsx)("span",{className:"um-quote",children:l},c)),(0,R.jsx)("span",{className:"um-text",children:r.rest})]}),e.steered&&(0,R.jsx)("div",{className:"um-tag",children:g("timeline.steer")}),o&&e.clientId&&(0,R.jsxs)("div",{className:"um-fail",role:"alert",children:[(0,R.jsxs)("span",{className:"um-fail-t",title:e.sendError?Nr(e.sendError):void 0,children:[(0,R.jsx)(ie,{name:"x",size:12}),g("timeline.sendFailed")]}),(0,R.jsxs)("button",{type:"button",className:"um-fail-b",title:g("timeline.sendRetry"),onClick:()=>Mi.getState().retry(e.clientId),children:[(0,R.jsx)(ie,{name:"refresh",size:12}),(0,R.jsx)("span",{children:g("common.retry")})]}),(0,R.jsx)("button",{type:"button",className:"um-fail-b",title:g("timeline.sendDismiss"),"aria-label":g("timeline.sendDismiss"),onClick:()=>Mi.getState().dismiss(e.clientId),children:(0,R.jsx)("span",{children:g("common.remove")})})]}),(0,R.jsxs)("div",{className:"um-act",role:"toolbar","aria-label":g("timeline.msgActions"),children:[(0,R.jsx)("button",{type:"button",className:`ibtn${i?" done":""}`,title:i?g("common.copied"):g("common.copy"),"aria-label":i?g("common.copied"):g("common.copy"),onClick:()=>n(e.text),children:(0,R.jsx)(ie,{name:i?"check":"copy",size:13})}),(0,R.jsx)("button",{type:"button",className:"ibtn",title:g("timeline.editMsg"),"aria-label":g("timeline.editMsg"),onClick:s,children:(0,R.jsx)(ie,{name:"pencil",size:13})}),t&&!e.sendState&&(0,R.jsx)("button",{type:"button",className:"ibtn",title:g("timeline.resend"),"aria-label":g("timeline.resend"),onClick:()=>t(e.text,e.mentions),children:(0,R.jsx)(ie,{name:"refresh",size:13})})]})]})}function f6({it:e}){let[t,i]=(0,Ot.useState)(e.streaming?"":e.text),n=(0,Ot.useRef)(null);return(0,Ot.useEffect)(()=>{n.current||(n.current=new ap(i)),n.current.push(e.text),e.streaming||n.current.flush()},[e.text,e.streaming]),(0,Ot.useEffect)(()=>()=>n.current?.stop(),[]),(0,R.jsx)(gb,{text:t,streaming:e.streaming})}function p6({it:e}){let[t,i]=(0,Ot.useState)(!1),n=Math.max(1,Math.round(e.text.length/40));return(0,R.jsxs)("div",{className:"rs-item",children:[(0,R.jsxs)("button",{className:"rs-head",onClick:()=>i(!t),children:[(0,R.jsx)("span",{className:`caret${t?" open":""}`,children:"\u203A"})," ",e.streaming?g("timeline.nowThinking"):pe("timeline.thinking",{s:n})]}),t&&(0,R.jsx)("div",{className:"rs-body",children:e.text})]})}function m6({it:e}){return(0,R.jsxs)("div",{className:`nt ${e.level} nt-bash`,children:[(0,R.jsx)("div",{children:g("timeline.bashMissing")}),(0,R.jsxs)("div",{className:"nt-actions",children:[(0,R.jsx)("button",{type:"button",className:"btn",onClick:()=>{ks(Lb)},children:g("timeline.bashDownload")}),(0,R.jsx)("button",{type:"button",className:"btn",onClick:()=>window.dispatchEvent(new Event("open-settings")),children:g("timeline.bashSetting")})]})]})}function ZA(e){let t=`timeline.tool.${e}`,i=g(t);return i.startsWith("timeline.tool.")?g("timeline.tool.other"):i}function v6(){let e=ue(i=>i.currentProjectId);return Ge(i=>i.projects).find(i=>i.id===e)?.path??null}function b6(e,t){if(!t)return e;let n=(s=>s.replace(/\\/g,"/").replace(/\/+$/,"").toLowerCase())(t),r=e.replace(/\\/g,"/").toLowerCase();return n&&r.startsWith(n+"/")?e.slice(n.length+1):e}function y6({it:e}){let[t,i]=(0,Ot.useState)(!1);if(!(zA(e.steps)>lp))return(0,R.jsx)("div",{className:"tg flat",children:(0,R.jsx)("div",{className:"tg-list",children:e.steps.map(o=>o.kind==="think"?(0,R.jsx)(QA,{s:o},o.itemId):(0,R.jsx)(JA,{s:o},o.itemId))})});let r=LA(e.steps),s=r.counts.map(([o,l])=>pe(`timeline.cat.${o}`,{n:l}));!s.length&&r.thinkSecs&&s.push(pe("timeline.thinking",{s:r.thinkSecs}));let a=IA(e.steps);return(0,R.jsxs)("div",{className:`tg${t?" open":""}`,children:[(0,R.jsxs)("button",{className:"tg-head","aria-expanded":t,onClick:()=>i(!t),children:[(0,R.jsx)("span",{className:"tg-ic","aria-hidden":!0,children:(0,R.jsx)(ie,{name:"layers",size:13})}),(0,R.jsx)("span",{className:"tg-sum",children:s.join(" \xB7 ")}),r.failed>0&&(0,R.jsx)("span",{className:"tg-fail",children:pe("timeline.failedCount",{n:r.failed})}),(0,R.jsx)("span",{className:`caret${t?" open":""}`,"aria-hidden":!0,children:"\u203A"})]}),!t&&a&&(0,R.jsx)(S6,{s:a}),t&&(0,R.jsx)("div",{className:"tg-list",children:e.steps.map(o=>o.kind==="think"?(0,R.jsx)(QA,{s:o},o.itemId):(0,R.jsx)(JA,{s:o},o.itemId))})]})}function S6({s:e}){let t=Nb(e.kind),i=t==="think"?g("timeline.nowThinking"):pe(`timeline.now.${t}`,{x:Ab(e)});return(0,R.jsxs)("div",{className:"tg-run",title:i,children:[(0,R.jsx)("span",{className:"spin","aria-hidden":!0}),(0,R.jsx)("span",{className:"tg-run-text",children:i})]})}function QA({s:e}){let[t,i]=(0,Ot.useState)(!1),n=e.think?.text??"",r=Math.max(1,Math.round(n.length/40)),s=!!e.think?.streaming;return(0,R.jsxs)("div",{className:"ts ts-think",children:[(0,R.jsxs)("button",{className:"ts-head","aria-expanded":t,onClick:()=>n.trim()&&i(!t),children:[(0,R.jsx)("span",{className:"ts-ic","aria-hidden":!0,children:(0,R.jsx)(ie,{name:"spark",size:13})}),(0,R.jsx)("span",{className:"ts-title",children:s?g("timeline.nowThinking"):pe("timeline.thinking",{s:r})}),s&&(0,R.jsx)("span",{className:"ts-st","aria-hidden":!0,children:(0,R.jsx)("span",{className:"spin"})})]}),t&&(0,R.jsx)("div",{className:"rs-body",children:n})]})}function w6({status:e}){return e==="running"?(0,R.jsx)("span",{className:"ts-st run","aria-label":"running",children:(0,R.jsx)("span",{className:"spin"})}):e==="failed"?(0,R.jsx)("span",{className:"ts-st fail","aria-label":"failed",children:(0,R.jsx)(ie,{name:"x",size:12})}):(0,R.jsx)("span",{className:"ts-st ok","aria-label":"ok",children:(0,R.jsx)(ie,{name:"check",size:12})})}function JA({s:e}){let[t,i]=(0,Ot.useState)(e.status==="failed"),n=e.status==="failed",r=(0,Ot.useRef)(n);(0,Ot.useEffect)(()=>{n&&!r.current&&i(!0),r.current=n},[n]);let s=v6(),a=!!(e.output||e.detail||e.input!=null||n),o=b6(Ab(e),s)||ZA(e.kind),l=e.kind==="edit"||e.kind==="write"?BA(e):null,c=_6.has(e.kind)&&o!==e.title,u=`${ZA(e.kind)} \xB7 ${e.title||o}${e.durationMs!=null?` \xB7 ${Mv(e.durationMs)}`:""}`;return(0,R.jsxs)("div",{className:`ts${n?" failed":""}${t?" open":""}`,"data-kind":e.kind,children:[(0,R.jsxs)("button",{className:"ts-head",title:u,"aria-expanded":a?t:void 0,onClick:()=>a&&i(!t),children:[(0,R.jsx)("span",{className:"ts-ic","aria-hidden":!0,children:(0,R.jsx)(ie,{name:g6[e.kind]??"wrench",size:13})}),(0,R.jsx)("span",{className:`ts-title${c?" mono":""}`,children:o}),l&&(l.added>0||l.removed>0)&&(0,R.jsxs)("span",{className:"ts-diff",children:[(0,R.jsxs)("span",{className:"add",children:["+",l.added]}),(0,R.jsxs)("span",{className:"del",children:["-",l.removed]})]}),e.exitCode!=null&&e.exitCode!==0&&(0,R.jsxs)("span",{className:"ts-meta err",children:["exit ",e.exitCode]}),(0,R.jsx)(w6,{status:e.status})]}),t&&(0,R.jsx)(x6,{s:e})]})}function x6({s:e}){let[t,i]=(0,Ot.useState)(!1),n=e.detail,r=n?.hunks??n?.diff?.hunks;if(r)return(0,R.jsx)(hp,{hunks:MA(r),path:n?.diff?.path??n?.path});if(e.status==="failed"&&!e.output?.trim())return(0,R.jsxs)("div",{className:"ts-out",children:[(0,R.jsx)("div",{className:"ts-noerr",children:g("timeline.noErrorOutput")}),e.input!=null&&(0,R.jsx)("pre",{children:JSON.stringify(e.input,null,2).slice(0,4e3)})]});if(e.output!=null){let s=e.output.split(`
|
|
`),a=s.length>50&&!t,o=a?s.slice(-50).join(`
|
|
`):e.output;return(0,R.jsxs)("div",{className:"ts-out",children:[a&&(0,R.jsx)("button",{className:"ts-more",onClick:()=>i(!0),children:pe("timeline.showAllLines",{n:s.length})}),(0,R.jsx)("pre",{onClick:Jf,children:(0,R.jsx)(u6,{text:o})})]})}return e.input!=null?(0,R.jsx)("pre",{className:"ts-out",children:JSON.stringify(e.input,null,2).slice(0,4e3)}):null}function hp({hunks:e,path:t,max:i=3e3}){let n=0,r=!1;return(0,R.jsxs)("div",{className:"diff",children:[t&&(0,R.jsx)("div",{className:"diff-path",children:t}),(0,R.jsx)("pre",{className:"diff-pre",children:e.map((s,a)=>(0,R.jsxs)("span",{className:"dh",children:[(0,R.jsx)("span",{className:"dh-head",children:s.head??"@@"}),s.lines.map((o,l)=>(n++,n>i?(r=!0,null):(0,R.jsxs)("span",{className:`dl ${o.t==="+"?"add":o.t==="-"?"del":""}`,children:[o.t," ",o.text,`
|
|
`]},l)))]},a))}),r&&(0,R.jsx)("div",{className:"dlg-hint",children:pe("timeline.diffClip",{n:i})})]})}function E6({it:e}){return(0,R.jsx)("div",{className:"card plan",children:(0,R.jsx)(gb,{text:e.markdown})})}function k6({it:e}){let{done:t,total:i}=cp(e.items);return(0,R.jsxs)("div",{className:"ck","data-todo-key":e.key,children:[(0,R.jsxs)("div",{className:"ck-head",children:[(0,R.jsx)(ie,{name:"listChecks",size:13}),(0,R.jsxs)("span",{className:"ck-n",children:[t,"/",i]}),(0,R.jsx)("span",{className:"ck-l",children:g("timeline.tasks")})]}),(0,R.jsx)("ul",{className:"ck-list",children:e.items.map((n,r)=>{let s=n.status==="done"||n.status==="completed"?"done":n.status==="in_progress"?"doing":"todo";return(0,R.jsxs)("li",{className:`ck-i ${s}`,children:[(0,R.jsx)("span",{className:"ck-box","aria-hidden":!0,children:s==="done"?(0,R.jsx)(ie,{name:"check",size:12}):s==="doing"?(0,R.jsx)("span",{className:"spin"}):(0,R.jsx)(ie,{name:"circle",size:12})}),(0,R.jsx)("span",{className:"ck-t",children:n.text})]},r)})})]})}function C6({it:e,threadId:t}){let[i,n]=(0,Ot.useState)(!1),r=l=>{n(!0),V.call("thread.respond",{id:t,requestId:e.requestId,optionId:l}).catch(()=>n(!1))},s=e.detail,a=s?.hunks??s?.diff?.hunks,o=e.status==="resolved"?e.auto?g("timeline.permAutoAllowed"):e.choice==="allow_always"||e.choice==="acceptForSession"?g("timeline.permAllowSession"):e.choice==="deny"||e.choice==="reject"||e.choice==="decline"?g("timeline.permDenied"):e.choice==="implement"?g("timeline.permAllowed"):g("timeline.permAllowed"):g("timeline.permCancelled");return(0,R.jsxs)("div",{className:`card perm${e.status!=="pending"?" done":""}`,children:[(0,R.jsx)("div",{className:"perm-title",children:e.title}),s?.command&&(0,R.jsx)("pre",{className:"perm-cmd",children:s.command}),s?.path&&(0,R.jsx)("div",{className:"perm-path",children:s.path}),a&&(0,R.jsx)(hp,{hunks:a,path:s?.diff?.path??s?.path,max:200}),e.status==="pending"?(0,R.jsx)("div",{className:"perm-btns",children:e.options.map(l=>(0,R.jsx)("button",{className:`btn ${l.kind==="allow_once"?"primary":l.kind==="reject_once"?"danger":""}`,disabled:i,onClick:()=>r(l.id),children:l.label},l.id))}):(0,R.jsx)("div",{className:"perm-done",children:o})]})}function T6({it:e,threadId:t}){let[i,n]=(0,Ot.useState)({}),[r,s]=(0,Ot.useState)({}),a=e.questions,o=(c,u)=>c.id??c.question??c.header??`q${u}`,l=()=>{let c={};a.forEach((u,d)=>{c[o(u,d)]=i[d]?.trim()||r[d]||""}),V.call("thread.respond",{id:t,requestId:e.requestId,answers:c})};return(0,R.jsxs)("div",{className:`card ask${e.status!=="pending"?" done":""}`,children:[a.map((c,u)=>(0,R.jsxs)("div",{className:"ask-q",children:[(0,R.jsx)("div",{className:"ask-t",children:c.header??c.question}),e.status==="pending"?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"ask-opts",children:c.options?.map(d=>(0,R.jsx)("button",{className:`btn${r[u]===d.label?" primary":""}`,onClick:()=>s(h=>({...h,[u]:d.label})),children:d.label},d.label))}),(0,R.jsx)("input",{className:"tinput ask-free",placeholder:g("common.other"),value:i[u]??"",onChange:d=>n(h=>({...h,[u]:d.target.value}))})]}):(0,R.jsx)("div",{className:"perm-done",children:e.answers?pe("timeline.submitted",{ans:Object.values(e.answers).join("\u3001")}):g("timeline.permCancelled")})]},u)),e.status==="pending"&&(0,R.jsx)("button",{className:"btn primary",onClick:l,children:g("common.submit")})]})}function N6({it:e,onRetry:t,replyText:i}){let n=ue(),[r,s]=(0,Ot.useState)(!1),[a,o]=iM(),l=M6(e.model,e.model!==void 0);if(e.status==="failed")return(0,R.jsxs)("div",{className:"card err-card",children:[(0,R.jsx)("div",{className:"err-line",children:pe("timeline.turnError",{err:Nr(e.error??g("timeline.unknownError"))})}),(0,R.jsxs)("div",{className:"perm-btns",children:[t&&(0,R.jsx)("button",{className:"btn",onClick:t,children:g("common.retry")}),e.error&&e.error.length>60&&(0,R.jsx)("button",{className:"btn ghost",onClick:()=>s(!r),children:g("common.details")})]}),r&&(0,R.jsx)("pre",{className:"perm-cmd",children:Nr(e.error??"")})]});let c=[];if(e.usage){let u=e.usage.inputTokens+e.usage.outputTokens;u&&c.push(`${ql(u)} tokens`),e.usage.costUsd&&c.push(Nf(e.usage.costUsd))}return(0,R.jsxs)("div",{className:"te",children:[i&&(0,R.jsxs)("button",{type:"button",className:`te-act te-copy${a?" done":""}`,title:a?g("common.copied"):g("common.copy"),"aria-label":a?g("common.copied"):g("common.copy"),onClick:()=>o(i),children:[(0,R.jsx)(ie,{name:a?"check":"copy",size:13}),(0,R.jsx)("span",{children:a?g("common.copied"):g("common.copy")})]}),l&&(0,R.jsxs)("span",{className:"te-m",title:l,children:[(0,R.jsx)(ie,{name:"cpu",size:12}),(0,R.jsx)("span",{children:l})]}),e.ts!=null&&(0,R.jsxs)("span",{className:"te-m",title:new Date(e.ts).toLocaleString(),children:[(0,R.jsx)(ie,{name:"clock",size:12}),(0,R.jsx)("span",{children:A6(e.ts)})]}),e.durationMs!=null&&(0,R.jsxs)("span",{className:"te-m",children:[(0,R.jsx)(ie,{name:"hourglass",size:12}),(0,R.jsx)("span",{children:Mv(e.durationMs)})]}),c.length>0&&(0,R.jsx)("span",{className:"te-m te-u",children:c.join(" \xB7 ")}),e.status==="interrupted"&&(0,R.jsx)("span",{className:"te-m",children:g("timeline.interrupted")}),t&&(0,R.jsx)("button",{type:"button",className:"te-act",title:g("timeline.retryHint"),"aria-label":g("timeline.retryHint"),onClick:t,children:(0,R.jsx)(ie,{name:"refresh",size:13})}),e.filesChanged!=null&&e.filesChanged>0&&(0,R.jsx)("button",{className:"te-files",onClick:()=>n.openPanel("changes"),children:pe("timeline.filesChanged",{n:e.filesChanged})})]})}function A6(e){let t=new Date(e),i=r=>String(r).padStart(2,"0"),n=`${i(t.getHours())}:${i(t.getMinutes())}`;return t.toDateString()===new Date().toDateString()?n:`${t.getMonth()+1}/${t.getDate()} ${n}`}function M6(e,t){let i=ue(o=>o.currentThreadId),n=Ge(o=>o.threads),r=Ge(o=>o.providers);if(!t)return null;let s=n.find(o=>o.id===i),a=r.find(o=>o.id===s?.provider)?.models??[];return e?a.find(o=>o.id===e)?.name??e:a.find(o=>o.isDefault)?.name??null}function nM({it:e,threadId:t,onEditResend:i,onRetryLast:n,replyText:r}){switch(e.kind){case"user":return(0,R.jsx)(h6,{it:e,onRetry:i});case"assistant":return(0,R.jsx)("div",{className:"as",children:(0,R.jsx)(f6,{it:e})});case"reasoning":return(0,R.jsx)(p6,{it:e});case"toolgroup":return(0,R.jsx)(y6,{it:e});case"plan":return(0,R.jsx)(E6,{it:e});case"todo":return(0,R.jsx)(k6,{it:e});case"permission":return(0,R.jsx)(C6,{it:e,threadId:t});case"autoperm":return(0,R.jsx)(jA,{it:e});case"question":return(0,R.jsx)(T6,{it:e,threadId:t});case"notice":return e.code==="bash_missing"?(0,R.jsx)(m6,{it:e}):e.code&&YA.has(e.code)?(0,R.jsx)(VA,{it:e,threadId:t}):(0,R.jsx)("div",{className:`nt ${e.level}`,children:Nr(e.message)});case"turnend":return(0,R.jsx)(N6,{it:e,onRetry:n,replyText:r});case"gone":return null;default:return null}}var Ot,R,Lb,eM,d6,Db,g6,_6,qu=se(()=>{Ot=te(mt(),1);Iu();AA();An();Pi();op();OA();Uu();Nn();Af();Qi();kt();Qf();Lu();dp();So();XA();R=te(_e(),1),Lb="https://git-scm.com/download/win",eM=()=>ic();d6=e=>e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()||e,Db=e=>!e||e.startsWith("image/");g6={edit:"pencil",write:"pencil",bash:"prompt",read:"fileText",search:"search",glob:"search",web:"globe",task:"layers",mcp:"wrench",todo:"listChecks"},_6=new Set(["edit","write","bash","read","search","glob"])});function rc(e,t){let i=/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith("\\\\"),n=i?"\\":"/",r=t==="."?"":i?t.replace(/\//g,"\\"):t;return r?e.replace(/[\\/]+$/,"")+n+r:e}function rM(e){if(!e||e.length>1e4)return null;try{let t=JSON.parse(e);return typeof t.projectId!="string"||typeof t.rel!="string"||!t.rel||t.rel.length>4096?null:{projectId:t.projectId,rel:t.rel,isDir:t.isDir===!0}}catch{return null}}function zb(e,t){return e.some(i=>i.projectId===t.projectId&&i.rel===t.rel)||e.length>=50?e:[...e,t]}function sM(e){return e.map(t=>({rel:t.rel,isDir:t.isDir}))}function fp(e,t){let i=o=>o.replace(/\\/g,"/").replace(/\/+$/,""),n=i(e),r=i(t),s=/^[a-zA-Z]:\//.test(n),a=(o,l)=>s?o.toLowerCase()===l.toLowerCase():o===l;return a(r,n)?".":r.length>n.length&&a(r.slice(0,n.length),n)&&r[n.length]==="/"?r.slice(n.length+1):null}var nc,pp=se(()=>{nc="application/x-agent-console-path"});function pn({value:e,options:t,onChange:i,ariaLabel:n,title:r,className:s,children:a,prefer:o="down",matchWidth:l=!1,menuClassName:c,upAnchor:u}){let[d,h]=(0,Oi.useState)(!1),[f,p]=(0,Oi.useState)(-1),[_,y]=(0,Oi.useState)(null),m=(0,Oi.useRef)(null),v=(0,Oi.useRef)(null),b=(0,Oi.useId)(),w=t.find(B=>B.value===e),k=B=>B>=0&&B<t.length&&!t[B].disabled,O=(0,Oi.useCallback)((B,I)=>{for(let x=1;x<=t.length;x++){let H=(B+I*x+t.length*2)%t.length;if(!t[H].disabled)return H}return B},[t]),N=B=>{let I=t.findIndex(H=>H.value===e),x=B==="first"?O(-1,1):B==="last"?O(0,-1):I;k(x)||(x=O(-1,1)),p(x),y(null),h(!0)},C=B=>{h(!1),B&&m.current?.focus()},M=B=>{k(B)&&(C(!0),t[B].value!==e&&i(t[B].value))};(0,Oi.useLayoutEffect)(()=>{if(!d)return;let B=m.current?.getBoundingClientRect(),I=v.current;if(!B||!I)return;let x=window.innerWidth,H=window.innerHeight,T=l?B.width:0;I.style.minWidth=`${T}px`;let L=I.offsetWidth,D=I.scrollHeight,P=H-B.bottom-mp-Fu,Y=u&&m.current?.closest(u)?.getBoundingClientRect().top||B.top,U=Y-mp-Fu,Z=o==="up"?!(U<D&&P>U):P<D&&U>P,xe=Z?U:P,me=Math.min(D,xe),Fe=Z?Y-mp-me:B.bottom+mp,Q=Math.max(Fu,Math.min(B.left,x-L-Fu));y({left:Q,top:Math.max(Fu,Fe),minWidth:T,maxHeight:Math.max(80,xe)})},[d,o,l,t.length,u]),(0,Oi.useEffect)(()=>{d&&_&&v.current?.focus({preventScroll:!0})},[d,_]),(0,Oi.useEffect)(()=>{!d||f<0||v.current?.querySelector(`[data-i="${f}"]`)?.scrollIntoView({block:"nearest"})},[d,f]),(0,Oi.useEffect)(()=>{if(!d)return;let B=x=>{let H=x.target;v.current?.contains(H)||m.current?.contains(H)||C(!1)},I=()=>C(!1);return window.addEventListener("pointerdown",B,!0),window.addEventListener("resize",I),window.addEventListener("blur",I),()=>{window.removeEventListener("pointerdown",B,!0),window.removeEventListener("resize",I),window.removeEventListener("blur",I)}},[d]);let z=B=>{(B.key==="ArrowDown"||B.key==="ArrowUp"||B.key==="Enter"||B.key===" ")&&(B.preventDefault(),d?C(!1):N(B.key==="ArrowUp"?"last":void 0))},q=B=>{let I=B.key;if(I==="ArrowDown")p(x=>O(x<0?-1:x,1));else if(I==="ArrowUp")p(x=>O(x<0?0:x,-1));else if(I==="Home")p(O(-1,1));else if(I==="End")p(O(0,-1));else if(I==="Enter"||I===" ")M(f);else if(I==="Escape")C(!0);else if(I==="Tab"){C(!0);return}else if(I.length===1&&/\S/.test(I)){let x=I.toLowerCase();for(let H=1;H<=t.length;H++){let T=(Math.max(f,0)+H)%t.length;if(!t[T].disabled&&t[T].label.toLowerCase().startsWith(x)){p(T);break}}}else return;B.preventDefault(),B.stopPropagation()};return(0,Ui.jsxs)(Ui.Fragment,{children:[(0,Ui.jsx)("button",{ref:m,type:"button",className:s,title:r,"aria-label":n,"aria-haspopup":"listbox","aria-expanded":d,"aria-controls":d?`${b}-lb`:void 0,onClick:()=>d?C(!1):N(),onKeyDown:z,children:a??(0,Ui.jsx)("span",{className:"sm-val",children:w?.label??""})}),d&&(0,aM.createPortal)((0,Ui.jsx)("div",{ref:v,id:`${b}-lb`,className:`menu select-menu${c?` ${c}`:""}`,role:"listbox","aria-label":n,"aria-activedescendant":f>=0?`${b}-o${f}`:void 0,tabIndex:-1,"data-select-menu":"",style:_?{left:_.left,top:_.top,minWidth:_.minWidth,maxHeight:_.maxHeight}:{left:-9999,top:0,visibility:"hidden"},onKeyDown:q,children:t.map((B,I)=>(0,Ui.jsxs)("div",{id:`${b}-o${I}`,"data-i":I,role:"option","aria-selected":B.value===e,"aria-disabled":B.disabled||void 0,className:`mi sm-opt${I===f?" on":""}${B.disabled?" off":""}${B.danger?" danger":""}${B.warn?" warn":""}${B.hint?" has-hint":""}`,onPointerMove:()=>{!B.disabled&&f!==I&&p(I)},onClick:()=>M(I),children:[(0,Ui.jsxs)("span",{className:"sm-text",children:[(0,Ui.jsxs)("span",{className:"sm-label",children:[B.icon&&(0,Ui.jsx)(ie,{name:B.icon,size:13}),B.label]}),B.hint&&(0,Ui.jsx)("span",{className:"sm-hint",children:B.hint})]}),(0,Ui.jsx)("span",{className:"sm-check","aria-hidden":"true",children:B.value===e?(0,Ui.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",children:(0,Ui.jsx)("path",{d:"M2.5 6.2 5 8.6l4.5-5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}):null})]},B.value))}),document.body)]})}var Oi,aM,Ui,mp,Fu,gp=se(()=>{An();Oi=te(mt(),1),aM=te(qs(),1),Ui=te(_e(),1),mp=4,Fu=8});function lM(e){return g(`composer.autoDesc.${e&&oM.has(e)?e:"generic"}`)}function cM(e){let t=lM(e);return!e||!oM.has(e)||O6.has(e)?`${t}
|
|
${g("composer.autoOn.keeps")}`:t}function Bb(){return[{id:"plan",label:g("composer.mode.plan.label"),desc:g("composer.mode.plan.desc")},{id:"default",label:g("composer.mode.default.label"),desc:g("composer.mode.default.desc")},{id:"acceptEdits",label:g("composer.mode.acceptEdits.label"),desc:g("composer.mode.acceptEdits.desc")},{id:"bypassPermissions",label:g("composer.mode.bypass.label"),desc:g("composer.mode.bypass.desc"),auto:!0}]}function D6(){return[{id:"default",label:g("composer.mode.cursorAgent.label"),desc:g("composer.mode.cursorAgent.desc")},{id:"bypassPermissions",label:g("composer.mode.cursorBypass.label"),desc:g("composer.mode.cursorBypass.desc"),auto:!0},{id:"plan",label:g("composer.mode.cursorPlan.label"),desc:g("composer.mode.cursorPlan.desc")},{id:"ask",label:g("composer.mode.cursorAsk.label"),desc:g("composer.mode.cursorAsk.desc")}]}function uM(e,t,i){return(e==="cursor"?D6():Bb()).filter(r=>t.includes(r.id)).map(r=>e==="pi"&&r.id==="default"?{...r,label:g("composer.mode.pi.label"),desc:g("composer.mode.pi.desc"),auto:!0}:r.id===R6?{...r,desc:lM(e)}:i?.[r.id]?{...r,label:L6(i[r.id])}:r)}function L6(e){let t=g(`composer.agentMode.${e}`);return t.startsWith("composer.agentMode.")?e:t}function _p(e,t){let i=g(`composer.effort.${e}`);return i.startsWith("composer.effort.")?t??e:i}var oM,O6,R6,vp=se(()=>{kt();oM=new Set(["claude","codex","copilot","devin","cursor","opencode","pi"]),O6=new Set(["cursor","opencode","dsh"]);R6="bypassPermissions"});function dM({value:e,save:t}){let[i,n]=(0,wo.useState)(null),[r,s]=(0,wo.useState)(null),[a,o]=(0,wo.useState)(null),[l,c]=(0,wo.useState)(!1),u=()=>V.call("shell.status").then(y=>n(y)).catch(()=>{});if((0,wo.useEffect)(()=>{u()},[]),!i)return null;if(i.platform!=="win32")return(0,Ji.jsx)("div",{className:"dlg-hint",children:g("settings.bashNotWindows")});let d=r??e,h=async()=>{try{return await V.call("shell.check",{path:d.trim()})}catch(y){return o({ok:!1,text:Xe(y)}),null}},f=async()=>{if(!d.trim()){o(null);return}c(!0);let y=await h();c(!1),y&&o(y.ok?{ok:!0,text:pe("settings.bashOk",{path:y.path})}:{ok:!1,text:Pb(y.reason)})},p=async()=>{if(r===null||r.trim()===e){s(null);return}let y="";if(r.trim()){let v=await h();if(!v)return;if(!v.ok){o({ok:!1,text:Pb(v.reason)});return}y=v.path}c(!0);let m=await t(y);c(!1),m&&(s(null),o(null),await u())},_=i.found?g(`settings.bashSrc.${i.found.source}`):"";return(0,Ji.jsxs)("div",{className:"bash-set",children:[(0,Ji.jsxs)("div",{className:"bash-row",children:[(0,Ji.jsx)("input",{className:`tinput${a&&!a.ok?" err":""}`,spellCheck:!1,"aria-label":g("settings.bashPath"),placeholder:"E:\\Git\\bin\\bash.exe",value:d,onChange:y=>{s(y.target.value),o(null)},onBlur:()=>{p()},onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),p())}}),(0,Ji.jsx)("button",{type:"button",className:"btn",disabled:l||!d.trim(),onMouseDown:y=>y.preventDefault(),onClick:()=>{f()},children:g("settings.bashCheck")})]}),a&&(0,Ji.jsx)("div",{className:`dlg-hint${a.ok?"":" err"}`,children:a.text}),!a&&i.manualError&&(0,Ji.jsx)("div",{className:"dlg-hint err",children:pe("settings.bashManualBad",{why:Pb(i.manualError)})}),(0,Ji.jsx)("div",{className:"dlg-hint",children:i.found?pe("settings.bashUsing",{path:i.found.path,src:_}):(0,Ji.jsxs)(Ji.Fragment,{children:[g("settings.bashNone")," ",(0,Ji.jsx)("button",{type:"button",className:"te-files",onClick:()=>{ks(Lb)},children:g("timeline.bashDownload")})]})}),(0,Ji.jsx)("div",{className:"dlg-hint",children:g("settings.bashHint")})]})}var wo,Ji,Pb,hM=se(()=>{wo=te(mt(),1);Pi();kt();Lu();qu();Ji=te(_e(),1),Pb=e=>{let t=`settings.bashBad.${e}`,i=g(t);return i===t?e:i}});function Hb(e){let t=e.trim();if(t){try{let i=JSON.parse(t);if(Array.isArray(i)&&i.every(n=>typeof n=="string"))return i}catch{}return null}}function Ub(e){let t=e.trim();if(!/^\d+$/.test(t))return null;let i=Number(t);return i>=5&&i<=240?i:null}var fM=se(()=>{});function pM(e){return!(e.enabled===!1||!e.available||e.status==="planned")}function B6(e){return e.status==="verified"?g("settings.providerVerified"):e.status==="experimental"?g("settings.providerExperimental"):e.status==="planned"?g("settings.providerPlanned"):g("settings.providerPending")}function mM(){V.call("providers.list").then(e=>{Ge.setState({providers:e})}).catch(()=>{})}function _M({onClose:e,providers:t}){let[i,n]=(0,Dn.useState)(null),[r,s]=(0,Dn.useState)({}),[a,o]=(0,Dn.useState)(null),[l,c]=(0,Dn.useState)({}),[u,d]=(0,Dn.useState)({}),[h,f]=(0,Dn.useState)({}),[p,_]=(0,Dn.useState)({}),[y,m]=(0,Dn.useState)(null),v=Bb();(0,Dn.useEffect)(()=>{V.call("settings.get").then(x=>n(x)),V.call("app.info").then(x=>s(x)).catch(()=>{})},[]);let b=async x=>{let H=i,T={...i,...x};n(T),x.theme&&Wr(x.theme);let L=x.contentWidth!==void 0||x.chatFontSize!==void 0;L&&_u(T);try{return await V.call("settings.set",{patch:x}),window.dispatchEvent(new CustomEvent("settings-changed",{detail:T})),!0}catch(D){return n(H),x.theme&&Wr(H?.theme),L&&_u(H??{}),we(g("settings.failSave")+Xe(D),!0),!1}},w=async(x,H)=>{c(P=>({...P,[x]:H}));let T=i?.providerEnabled??{},L=i,D={...i,providerEnabled:{...T,[x]:H}};n(D);try{await V.call("settings.set",{patch:{providerEnabled:D.providerEnabled}}),window.dispatchEvent(new CustomEvent("settings-changed",{detail:D})),H||Ge.setState(P=>({providers:P.providers.map(Y=>Y.id===x?{...Y,enabled:!1}:Y)})),mM()}catch(P){n(L),we(g("settings.providerToggleFailed")+Xe(P),!0)}finally{c(P=>{let Y={...P};return delete Y[x],Y})}},k=()=>{V.call("providers.list",{refresh:!0}).then(x=>{Ge.setState({providers:x}),we(g("settings.providerRedetect")+" \u2713")}).catch(x=>we(Xe(x),!0))},O=async(x,H)=>{let T={...i?.providerCommand??{}},L={...T[x],...H};L.executable||delete L.executable,(!L.args||L.args.length===0)&&delete L.args,JSON.stringify(T[x]??{})!==JSON.stringify(L)&&(T[x]=L,await b({providerCommand:T})&&mM())},N=x=>{let H=u[x];H!==void 0&&(O(x,{executable:H.trim()||void 0}),d(T=>{let L={...T};return delete L[x],L}))},C=x=>{let H=h[x];if(H===void 0)return;let T=Hb(H);if(T===null){_(L=>({...L,[x]:!0}));return}_(L=>({...L,[x]:!1})),O(x,{args:T}),f(L=>{let D={...L};return delete D[x],D})},M=()=>{if(y===null)return;let x=Ub(y);x!==null&&(m(null),x!==i?.idleCloseMinutes&&b({idleCloseMinutes:x}))},z=(x,H)=>{if(!H)return{dot:"off",text:g("settings.providerOff")};if(x.enabled===!1)return{dot:"pending",text:g("settings.providerPending")};if(!x.available)return{dot:"off",text:x.reason??g("common.notDetected")};let T=x.models?.length??0,L=B6(x),D=T>0?` \xB7 ${pe("settings.providerModels",{n:String(T)})}`:"";return{dot:x.status==="verified"?"on":"pending",text:L+D}};if(!i)return(0,ve.jsx)(Gr,{title:g("settings.title"),onClose:e,children:(0,ve.jsx)("div",{className:"dlg-hint",children:g("common.loading")})});let q=(x,H,T)=>(0,ve.jsxs)("div",{className:"dlg-row",children:[(0,ve.jsx)("label",{children:x}),H,T&&(0,ve.jsx)("div",{className:"dlg-hint",style:{marginTop:4},children:T})]}),B=y!==null&&Ub(y)===null,I=x=>H=>{H.key==="Enter"&&(H.preventDefault(),x())};return(0,ve.jsxs)(Gr,{title:g("settings.title"),onClose:e,wide:!0,footer:(0,ve.jsx)("button",{className:"btn primary",onClick:e,children:g("common.done")}),children:[q(g("settings.defaultAgent"),(0,ve.jsx)(pn,{className:"tinput sm-field",matchWidth:!0,ariaLabel:g("settings.defaultAgent"),value:i.defaultProvider??"claude",onChange:x=>{b({defaultProvider:x})},options:t.map(x=>({value:x.id,label:x.name+(pM(x)?"":g("common.notInstalled")),disabled:!pM(x)}))})),(0,ve.jsxs)("div",{className:"dlg-row dlg-row-top",children:[(0,ve.jsx)("label",{children:g("settings.providers")}),(0,ve.jsxs)("div",{className:"provider-list",children:[(0,ve.jsx)("button",{type:"button",className:"btn sm provider-redetect",onClick:k,children:g("settings.providerRedetect")}),t.map(x=>{let H=l[x.id]??i.providerEnabled?.[x.id]??x.enabled!==!1,T=z(x,H),L=a===x.id,D=i.providerCommand?.[x.id],P=h[x.id]??(D?.args?.length?JSON.stringify(D.args):"");return(0,ve.jsxs)("div",{className:`provider-row${L?" open":""}`,children:[(0,ve.jsxs)("button",{type:"button",className:"provider-head",onClick:()=>o(L?null:x.id),children:[(0,ve.jsx)("span",{className:`provider-dot provider-dot-${T.dot}`,"aria-hidden":!0}),(0,ve.jsxs)("div",{className:"provider-meta",children:[(0,ve.jsx)("span",{className:"provider-name",children:x.name}),(0,ve.jsx)("span",{className:"dlg-hint",children:T.text})]}),(0,ve.jsx)("span",{className:"mi-caret",children:L?"\u25BE":"\u25B8"})]}),(0,ve.jsx)("label",{className:"provider-switch",title:x.name,children:(0,ve.jsx)("input",{type:"checkbox",checked:H,disabled:l[x.id]!==void 0,onChange:Y=>{w(x.id,Y.target.checked)}})}),L&&(0,ve.jsxs)("div",{className:"provider-detail",children:[x.bin&&(0,ve.jsxs)("div",{className:"dlg-hint",children:[x.bin,x.version?` \xB7 ${x.version}`:""]}),x.installHint&&(0,ve.jsxs)("div",{className:"provider-hint-row",children:[(0,ve.jsx)("code",{className:"dlg-hint",children:x.installHint}),(0,ve.jsx)("button",{type:"button",className:"te-files",onClick:()=>{navigator.clipboard?.writeText(x.installHint??"").then(()=>we(g("common.copied")))},children:g("settings.providerCopyHint")})]}),(0,ve.jsx)("div",{className:"dlg-hint",children:g("settings.providerLaunchCmd")}),(0,ve.jsx)("input",{className:"tinput",placeholder:g("settings.providerLaunchExe"),"aria-label":g("settings.providerLaunchExe"),value:u[x.id]??D?.executable??"",onChange:Y=>{let U=Y.target.value;d(Z=>({...Z,[x.id]:U}))},onBlur:()=>N(x.id),onKeyDown:I(()=>N(x.id))}),(0,ve.jsx)("input",{className:`tinput${p[x.id]?" err":""}`,placeholder:'["--foo"]',"aria-label":g("settings.providerLaunchArgs"),value:P,onChange:Y=>{let U=Y.target.value;f(Z=>({...Z,[x.id]:U})),p[x.id]&&_(Z=>({...Z,[x.id]:Hb(U)===null}))},onBlur:()=>C(x.id),onKeyDown:I(()=>C(x.id))}),(0,ve.jsx)("div",{className:`dlg-hint${p[x.id]?" err":""}`,children:p[x.id]?g("settings.providerArgsInvalid"):g("settings.providerLaunchArgsHint")})]})]},x.id)})]})]}),q(g("settings.defaultMode"),(0,ve.jsx)(pn,{className:"tinput sm-field",matchWidth:!0,ariaLabel:g("settings.defaultMode"),value:i.defaultMode??"default",onChange:x=>{b({defaultMode:x})},options:v.map(x=>({value:x.id,label:x.label,hint:x.desc,icon:x.auto?"shieldCheck":void 0})),children:(0,ve.jsx)("span",{className:"sm-val",children:(()=>{let x=v.find(H=>H.id===(i.defaultMode??"default"));return x?`${x.label} \u2014 ${x.desc}`:""})()})}),i.defaultMode==="bypassPermissions"?`${g("settings.defaultModeHint")} ${g("composer.autoWarn")}`:g("settings.defaultModeHint")),q(g("settings.theme"),(0,ve.jsx)(pn,{className:"tinput sm-field",matchWidth:!0,ariaLabel:g("settings.theme"),value:Sv(i.theme),onChange:x=>{b({theme:x})},options:[{value:"auto",label:hk()?g("settings.themeMagpie"):g("settings.themeAuto")},{value:"light",label:g("settings.themeLight")},{value:"dark",label:g("settings.themeDark")}]})),q(g("settings.contentWidth"),(0,ve.jsx)(pn,{className:"tinput sm-field",matchWidth:!0,ariaLabel:g("settings.contentWidth"),value:yf(i.contentWidth),onChange:x=>{b({contentWidth:x})},options:[{value:"narrow",label:g("settings.widthNarrow")},{value:"default",label:g("settings.widthDefault")},{value:"wide",label:g("settings.widthWide")},{value:"full",label:g("settings.widthFull")}]})),q(g("settings.chatFont"),(0,ve.jsx)(pn,{className:"tinput sm-field",matchWidth:!0,ariaLabel:g("settings.chatFont"),value:String(Ev(i.chatFontSize)),onChange:x=>{b({chatFontSize:Number(x)})},options:Array.from({length:wv-bf+1},(x,H)=>bf+H).map(x=>({value:String(x),label:`${x} px${x===xv?g("settings.chatFontDefault"):""}`}))}),g("settings.chatFontHint")),q(g("settings.sendKey"),(0,ve.jsx)(pn,{className:"tinput sm-field",matchWidth:!0,ariaLabel:g("settings.sendKey"),value:i.sendKey??"enter",onChange:x=>{b({sendKey:x})},options:[{value:"enter",label:g("settings.sendEnter")},{value:"ctrlEnter",label:g("settings.sendCtrl")}]})),q(g("settings.runningSend"),(0,ve.jsx)(pn,{className:"tinput sm-field",matchWidth:!0,ariaLabel:g("settings.runningSend"),value:i.runningSend??"queue",onChange:x=>{b({runningSend:x})},options:[{value:"queue",label:g("settings.queue")},{value:"steer",label:g("settings.steer")}]}),g("settings.steerHint")),q(g("settings.thinking"),(0,ve.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center",fontSize:"var(--fs-m)",color:"var(--fg)"},children:[(0,ve.jsx)("input",{type:"checkbox",checked:i.showThinking!==!1,onChange:x=>{b({showThinking:x.target.checked})}}),g("settings.showThinking")]})),q(g("settings.idleClose"),(0,ve.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,ve.jsx)("input",{className:`tinput${B?" err":""}`,type:"number",min:5,max:240,step:1,style:{width:90,flex:"none"},"aria-label":g("settings.idleClose"),value:y??String(i.idleCloseMinutes??30),onChange:x=>m(x.target.value),onBlur:M,onKeyDown:I(M)}),(0,ve.jsx)("span",{className:"dlg-hint",children:g("settings.idleMinutes")})]}),B?g("settings.idleInvalid"):void 0),q(g("settings.bashPath"),(0,ve.jsx)(dM,{value:i.bashPath??"",save:x=>b({bashPath:x})})),(0,ve.jsx)("div",{className:"msep"}),(0,ve.jsxs)("div",{className:"dlg-hint",children:[pe("settings.versionLine",{ver:r.version??"?",pid:r.pid??"?"}),(0,ve.jsx)("br",{}),g("settings.dataDir"),r.dataDir??"?"," ",(0,ve.jsx)("button",{className:"te-files",onClick:()=>{navigator.clipboard?.writeText(r.dataDir??"").catch(()=>{})},children:g("common.copy")})]})]})}function gM(e){return{sendKey:e?.sendKey==="ctrlEnter"?"ctrlEnter":"enter",runningSend:e?.runningSend==="steer"?"steer":"queue",showThinking:e?.showThinking!==!1}}function $u(){let[e,t]=(0,Dn.useState)(P6);return(0,Dn.useEffect)(()=>{V.call("settings.get").then(n=>t(gM(n))).catch(()=>{});let i=n=>t(gM(n.detail));return window.addEventListener("settings-changed",i),()=>window.removeEventListener("settings-changed",i)},[]),e}var Dn,ve,P6,bp=se(()=>{Dn=te(mt(),1);$l();gp();Pi();fr();vp();kt();hM();Nn();fM();gu();kv();ve=te(_e(),1);P6={sendKey:"enter",runningSend:"queue",showThinking:!0}});function vM({size:e=18,className:t}){return(0,xa.jsxs)("svg",{className:t,width:e,height:e,viewBox:"0 0 64 64","aria-hidden":"true",children:[(0,xa.jsx)("rect",{width:"64",height:"64",rx:"15",fill:"#26292b"}),(0,xa.jsxs)("g",{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"5.2",children:[(0,xa.jsx)("path",{d:"M14 20.5 25 31 14 41.5",stroke:"#fff"}),(0,xa.jsx)("path",{d:"M29.14 23.61A12 12 0 1 1 46.63 39.92L48.6 47.6 39.85 42.93A12 12 0 0 1 29.14 38.39",stroke:"#fff"}),(0,xa.jsx)("path",{d:"M35.6 35.4h6",stroke:"#2dd4bf"})]})]})}var xa,bM=se(()=>{xa=te(_e(),1)});function SM({providerId:e,onBack:t}){let i=cM(e),n=(0,yM.useId)();return(0,Ns.jsxs)("div",{className:"cp-auto-on",role:"status","aria-live":"polite","data-testid":"auto-on",children:[(0,Ns.jsxs)("span",{className:"cp-auto-t",title:i,"aria-describedby":n,tabIndex:0,children:[(0,Ns.jsx)("span",{className:"cp-auto-ic","aria-hidden":!0,children:(0,Ns.jsx)(ie,{name:"shieldCheck",size:13})}),(0,Ns.jsx)("b",{children:g("composer.autoOn.title")})]}),(0,Ns.jsx)("span",{id:n,className:"sr-only",children:i}),t&&(0,Ns.jsx)("button",{type:"button",className:"cp-auto-back",onClick:t,children:g("composer.autoOn.back")})]})}var yM,Ns,wM=se(()=>{yM=te(mt(),1);An();vp();kt();Ns=te(_e(),1)});function xM(e,t=!1){if(t||!e.startsWith("/"))return{open:!1,query:""};let i=e.slice(1);return i.includes(`
|
|
`)||i.includes(" ")?{open:!1,query:""}:{open:!0,query:i}}function EM(e,t){let i=t.trim().toLowerCase();return i?e.filter(n=>n.name.toLowerCase().includes(i)||n.description.toLowerCase().includes(i)||(n.argumentHint??"").toLowerCase().includes(i)):e}function kM(e){let t=e.filter(r=>r.kind==="command"),i=e.filter(r=>r.kind==="skill"),n=[];if(t.length){n.push({type:"heading",id:"h-cmd",labelKey:"slashGroupCommand"});for(let r of t)n.push({type:"item",id:`c:${r.name}`,command:r})}if(i.length){n.push({type:"heading",id:"h-skill",labelKey:"slashGroupSkill"});for(let r of i)n.push({type:"item",id:`s:${r.name}`,command:r})}return n}function CM(e){return e.filter(t=>t.type==="item").map(t=>t.command)}function qb(e){return`/${e} `}function TM(e,t){return!!t&&e.trim()===`/${t}`}function Fb(e,t){return t<=0?0:e<0?t-1:e>=t?0:e}var NM=se(()=>{});function MM(){let e=ue(),{threads:t,providers:i,projects:n}=Ge(),r=Mi(),[s,a]=(0,Be.useState)(""),[o,l]=(0,Be.useState)([]),[c,u]=(0,Be.useState)([]),[d,h]=(0,Be.useState)([]),[f,p]=(0,Be.useState)(!1),[_,y]=(0,Be.useState)(!1),[m,v]=(0,Be.useState)(null),[b,w]=(0,Be.useState)(""),k=(0,Be.useRef)(null),O=(0,Be.useRef)(null),N=(0,Be.useRef)(null),[C,M]=(0,Be.useState)([]),[z,q]=(0,Be.useState)(0),[B,I]=(0,Be.useState)(0),x=(0,Be.useRef)(!1),H=(0,Be.useRef)(new Set),[T,L]=(0,Be.useState)(!1),D=$u(),P=t.find(E=>E.id===e.currentThreadId),Y=i.find(E=>E.id===P?.provider),U=r.status==="running"||r.status==="initializing",Z=r.pending.length>0,xe=Y?.capabilities.steer??!1,me=!!Y&&!Y.capabilities.images&&Y.capabilities.imagesKnown!==!1,Fe=P?.mode??"default",Q=uM(P?.provider,Y?.capabilities.modes??[],Y?.capabilities.modeLabels),ht=Q.find(E=>E.id===Fe),Yt=r.items.some(E=>E.kind==="user")&&(U||!!P?.providerSessionId||r.items.some(E=>E.kind==="assistant"||E.kind==="reasoning"||E.kind==="toolgroup"||E.kind==="permission")),Vt=(0,Be.useMemo)(()=>xM(s,x.current),[s]),gn=(0,Be.useMemo)(()=>EM(r.slashCommands,Vt.query),[r.slashCommands,Vt.query]),Ri=(0,Be.useMemo)(()=>kM(gn),[gn]),Pt=(0,Be.useMemo)(()=>CM(Ri),[Ri]),ke=Vt.open&&!Z;(0,Be.useEffect)(()=>{I(0)},[Vt.query,ke]),(0,Be.useEffect)(()=>{let E=P?.id;!ke||!E||H.current.has(E)||(H.current.add(E),L(!0),V.call("thread.commands",{id:E,load:!0},3e4).then(J=>{let le=J.commands??[];(le.length||!Mi.getState().slashCommands.length)&&Mi.setState({slashCommands:le})}).catch(()=>{}).finally(()=>L(!1)))},[ke,P?.id]);let Di=(0,Be.useMemo)(()=>i.filter(E=>E.enabled!==!1||E.id===P?.provider),[i,P?.provider]),ot=Di.find(E=>E.id===(m??P?.provider)),de=E=>E.enabled!==!1&&E.available&&E.status!=="planned",bi=E=>{y(E),E&&(v(null),w(""))};(0,Be.useEffect)(()=>{if(!_)return;let E=le=>{k.current&&!k.current.contains(le.target)&&bi(!1)},J=le=>{le.key==="Escape"&&(le.stopPropagation(),bi(!1))};return document.addEventListener("pointerdown",E,!0),window.addEventListener("keydown",J,!0),()=>{document.removeEventListener("pointerdown",E,!0),window.removeEventListener("keydown",J,!0)}},[_]);let re=async(E,J)=>{if(P){bi(!1);try{!Yt&&E!==P.provider&&await V.call("thread.setProvider",{id:P.id,provider:E}),await V.call("thread.setModel",{id:P.id,model:J})}catch(le){we(g("composer.failSwitchAgent")+Xe(le),!0)}}},ir=(0,Be.useMemo)(()=>{let E=b.trim().toLowerCase();if(!E)return[];let J=[];for(let le of Di)if(de(le))for(let Te of le.models??[])(Te.name.toLowerCase().includes(E)||Te.id.toLowerCase().includes(E))&&J.push({providerId:le.id,providerName:le.name,model:Te});return J.slice(0,100)},[b,Di]),Ve=!!(m&&!b.trim());(0,Be.useEffect)(()=>{if(!U)return;let E=Date.now(),J=setInterval(()=>q(Math.floor((Date.now()-E)/1e3)),1e3);return()=>clearInterval(J)},[U]),(0,Be.useEffect)(()=>{let E=O.current;if(!E)return;E.style.height="auto";let J=parseFloat(getComputedStyle(E).lineHeight)||22;E.style.height=Math.min(E.scrollHeight,Math.round(12*J))+"px"},[s]);let De=(0,Be.useCallback)(async(E="queue")=>{let J=e.currentThreadId,le=s.trim();if(!J||!le&&o.length===0&&c.length===0&&d.length===0)return;let Te=HA(d,le),$e=U&&E==="steer"&&xe,lt=!U||$e,Et={attachments:o,mentions:c,quotes:d};U&&E==="queue"&&M(sr=>[...sr,Te]),a(""),l([]),u([]),h([]);let zs=n.find(sr=>sr.id===P?.projectId)?.path;try{let sr=await Mi.getState().send(J,{text:Te,attachments:Et.attachments.map(Li=>({path:Li.path,mime:Li.mime,name:Li.name})),...Et.mentions.length?{mentions:sM(Et.mentions)}:{},behavior:$e?"steer":"queue"},{attachments:Et.attachments.map(Li=>({id:Li.path,name:Li.name.trim()||Li.path,mime:Li.mime})),...zs&&Et.mentions.length?{mentions:Et.mentions.map(Li=>({path:rc(zs,Li.rel),isDir:Li.isDir}))}:{}},{optimistic:lt});sr?.delivered==="queued"&&U?we(g("composer.queuedToast")):sr?.delivered==="steered"&&we(g("composer.steeredToast")),U||M(Li=>[...Li.slice(-9),Te])}catch(sr){lt||(a(le),l(Et.attachments),u(Et.mentions),h(Et.quotes)),we(g("composer.failSend")+Xe(sr),!0)}},[s,o,c,d,e.currentThreadId,U,xe,n,P?.projectId]),is=E=>{if(Vn(E.nativeEvent))return;if(ke&&Pt.length>0){if(E.key==="ArrowDown"){E.preventDefault(),I(lt=>Fb(lt+1,Pt.length));return}if(E.key==="ArrowUp"){E.preventDefault(),I(lt=>Fb(lt-1,Pt.length));return}if(E.key==="Escape"){E.preventDefault(),x.current=!0,I(0);return}let Te=Pt[B]??Pt[0],$e=E.key==="Enter"&&TM(s,Te?.name);if((E.key==="Enter"&&!E.shiftKey||E.key==="Tab")&&!$e){E.preventDefault(),Te&&(x.current=!1,a(qb(Te.name)));return}}let J=E.ctrlKey||E.metaKey;if(D.sendKey==="ctrlEnter"?E.key==="Enter"&&J:E.key==="Enter"&&!E.shiftKey&&!J){E.preventDefault(),U&&D.runningSend==="steer"&&xe?De("steer"):De("queue");return}if(D.sendKey==="enter"&&E.key==="Enter"&&J&&U){E.preventDefault(),De(xe?"steer":"queue");return}E.key==="ArrowUp"&&s===""&&C.length>0&&(E.preventDefault(),a(C[C.length-1]))},ri=async E=>{let J=E.clipboardData?.items;if(!J)return;for(let Te of J)if(Te.type.startsWith("image/")){E.preventDefault();let $e=Te.getAsFile();$e&&await nr($e);return}let le=E.clipboardData.getData("text/plain");if(le&&le.length>32*1024){E.preventDefault();let Te=new File([le],"paste.txt",{type:"text/plain"});await nr(Te)}},nr=async E=>{let J=ic(),le={path:"",name:E.name,mime:E.type||"application/octet-stream",uploading:!0};l(Te=>[...Te,le]);try{let $e=await(await fetch(`/api/upload?name=${encodeURIComponent(E.name)}`,{method:"POST",headers:{"x-agent-console":J},body:E})).json();if(!$e.ok)throw new Error($e.e?.message??g("composer.uploadFailed"));l(lt=>lt.map(Et=>Et===le?{...Et,path:$e.id,name:$e.name??E.name,uploading:!1}:Et))}catch(Te){l($e=>$e.filter(lt=>lt!==le)),we(g("composer.failUpload")+Xe(Te),!0)}},rr=n.find(E=>E.id===P?.projectId)??null,ne=E=>{if(E){if(!P||E.projectId!==P.projectId){we(g("mention.otherProject"),!0);return}u(J=>zb(J,E)),O.current?.focus()}};(0,Be.useEffect)(()=>{let E=J=>ne(J.detail);return window.addEventListener("ac-insert-mention",E),()=>window.removeEventListener("ac-insert-mention",E)}),(0,Be.useEffect)(()=>{let E=J=>{let le=J.detail;if(!le||typeof le.text!="string")return;if(s.trim()||d.length>0||c.length>0||o.length>0){we(g("timeline.editBusy"),!0);return}let Te=FA(le.text);h(Te.quotes),a(Te.rest);let $e=rr?.path;if(P&&$e&&le.mentions?.length){let lt=[];for(let Et of le.mentions){let zs=fp($e,Et.path);zs&&(lt=zb(lt,{projectId:P.projectId,rel:zs,isDir:Et.isDir}))}u(lt)}requestAnimationFrame(()=>{let lt=O.current;lt&&(lt.focus(),lt.setSelectionRange(lt.value.length,lt.value.length))})};return window.addEventListener("ac-composer-fill",E),()=>window.removeEventListener("ac-composer-fill",E)}),(0,Be.useEffect)(()=>{let E=J=>{let le=J.detail;if(le?.text){if(d.length>=10){we(pe("quote.full",{n:10}),!0);return}h(Te=>up(Te,le.text,le.src)),O.current?.focus()}};return window.addEventListener("ac-add-quote",E),()=>window.removeEventListener("ac-add-quote",E)}),(0,Be.useEffect)(()=>{u([]),h([])},[e.currentThreadId]);let ce=async E=>{if(E.preventDefault(),p(!1),E.dataTransfer.types.includes(nc)){ne(rM(E.dataTransfer.getData(nc)));return}for(let J of E.dataTransfer.files)(J.type.startsWith("image/")||J.type.startsWith("text/"))&&await nr(J)},ge=E=>{P&&V.call("thread.setMode",{id:P.id,mode:E}).catch(J=>we(Xe(J),!0))},Re=!!(Q.find(E=>E.id===Fe)??Q[0])?.auto,ft=Q.some(E=>E.id==="default"&&!E.auto),Ki=E=>{P&&V.call("thread.setEffort",{id:P.id,effort:E})},Is=E=>{P&&V.call("thread.setCursorOpts",{id:P.id,...E}).catch(J=>we(Xe(J),!0))},xr=P?.model?Y?.models?.find(E=>E.id===P.model):Y?.models?.find(E=>E.isDefault)??Y?.models?.[0],Ra=(xr?.thinkingOptions??[]).map(E=>{let J=E,le=typeof J.id=="string"?J.id:typeof J.reasoningEffort=="string"?J.reasoningEffort:null,Te=J.id,$e=le??(Te&&typeof Te.reasoningEffort=="string"?Te.reasoningEffort:null);return $e?{id:$e,label:typeof J.label=="string"?J.label:$e}:null}).filter(E=>E!==null),Er=typeof xr?.defaultThinking=="string"?xr.defaultThinking:null,Oo=Ra.length>0,Ro=(()=>{if(!P?.model){let le=Y?.models?.find(Te=>Te.isDefault);return le?le.name:g("composer.defaultModel")}let J=Y?.models?.find(le=>le.id===P.model)?.name??P.model;return P.cursorFast&&(J+=" \xB7 Fast"),J})();if(!e.currentThreadId)return null;let Do=PA(r.items);return(0,$.jsxs)("div",{className:`composer${Z?" waiting":""}`,onDrop:ce,onDragOver:E=>{E.preventDefault();let J=E.dataTransfer.types.includes(nc);J&&(E.dataTransfer.dropEffect="copy"),J!==f&&p(J)},onDragLeave:E=>{E.currentTarget.contains(E.relatedTarget)||p(!1)},children:[Do&&(0,$.jsx)("div",{className:"cp-tasks",children:(0,$.jsxs)("button",{type:"button",className:"tasks-pill",title:g("timeline.tasksPillTitle"),onClick:()=>window.dispatchEvent(new CustomEvent("ac-show-item",{detail:{key:Do.key}})),children:[(0,$.jsx)(ie,{name:"listChecks",size:12}),(0,$.jsx)("span",{children:pe("timeline.tasksPill",cp(Do.items))})]})}),r.queue.length>0&&(0,$.jsx)("div",{className:"q-list",children:r.queue.map(E=>(0,$.jsxs)("div",{className:"q-item",children:[(0,$.jsx)("span",{className:"q-text",children:E.text}),(0,$.jsx)("button",{className:"ibtn",title:g("common.remove"),onClick:()=>{V.call("thread.queueRemove",{id:P?.id,queueId:E.id}).catch(()=>{})},children:(0,$.jsx)(ie,{name:"x",size:12})})]},E.id))}),Re&&(0,$.jsx)(SM,{providerId:P?.provider,onBack:ft?()=>ge("default"):void 0}),(0,$.jsxs)("div",{className:`cp-card${Z?" waiting":""}${Re?" auto-on":""}${f?" drop-on":""}`,children:[f&&(0,$.jsx)("div",{className:"cp-drop-hint",children:g("mention.drop")}),me&&o.some(E=>E.mime.startsWith("image/"))&&(0,$.jsx)("div",{className:"att-note",children:pe("composer.imagesByPath",{agent:Y?.name??""})}),d.length>0&&(0,$.jsx)("div",{className:"att-bar q-bar",children:d.map(E=>(0,$.jsxs)("span",{className:"qchip",title:`${g("quote.chipTitle")}
|
|
|
|
${E.src?`[${E.src}]
|
|
`:""}${E.text.slice(0,600)}`,children:[(0,$.jsx)(ie,{name:"quote",size:12}),(0,$.jsx)("span",{className:"qchip-t",children:UA(E)}),E.text.includes(`
|
|
`)&&(0,$.jsx)("span",{className:"qchip-n",children:pe("quote.lines",{n:E.text.split(`
|
|
`).length})}),(0,$.jsx)("button",{type:"button",className:"att-x","aria-label":g("quote.remove"),title:g("quote.remove"),onClick:()=>h(J=>J.filter(le=>le.id!==E.id)),children:"\xD7"})]},E.id))}),(o.length>0||c.length>0)&&(0,$.jsxs)("div",{className:"att-bar",children:[c.map(E=>(0,$.jsx)(Ib,{path:rr?rc(rr.path,E.rel):E.rel,isDir:E.isDir,onRemove:()=>u(J=>J.filter(le=>le!==E))},E.rel)),o.map((E,J)=>(0,$.jsxs)("span",{className:`att${E.uploading?" up":""}`,children:[E.mime.startsWith("image/")&&E.path?(0,$.jsx)("img",{src:tM(E.path),alt:E.name}):(0,$.jsx)(ie,{name:"attach",size:12}),(0,$.jsx)("span",{className:"att-name",children:E.name}),E.uploading&&(0,$.jsx)("span",{className:"att-prog",children:"\u2026"}),(0,$.jsx)("button",{className:"att-x",onClick:()=>l(le=>le.filter((Te,$e)=>$e!==J)),children:"\xD7"})]},J))]}),(0,$.jsxs)("div",{className:"cp-ta-wrap",children:[ke&&(0,$.jsx)("div",{className:"pop agent-picker slash-pop",role:"listbox",children:(0,$.jsx)("div",{className:"ap-scroll",children:Ri.length===0?(0,$.jsx)("div",{className:"ap-empty",children:g(T?"composer.slashLoading":"composer.slashNoCommands")}):Ri.map(E=>{if(E.type==="heading")return(0,$.jsx)("div",{className:"slash-h",children:E.labelKey==="slashGroupCommand"?g("composer.slashGroupCommand"):g("composer.slashGroupSkill")},E.id);let le=Pt.indexOf(E.command)===B;return(0,$.jsxs)("button",{type:"button",role:"option","aria-selected":le,className:`mi slash-item${le?" sel":""}`,onMouseDown:Te=>Te.preventDefault(),onClick:()=>{x.current=!1,a(qb(E.command.name))},children:[(0,$.jsxs)("span",{className:"slash-name",children:["/",E.command.name]}),(0,$.jsx)("span",{className:"slash-desc",children:E.command.description}),E.command.argumentHint?(0,$.jsx)("span",{className:"slash-hint",children:E.command.argumentHint}):null]},E.id)})})}),(0,$.jsx)("textarea",{ref:O,className:"cp-ta",rows:1,placeholder:Z?g("composer.waitPerm"):U?g(xe?"composer.queuePlaceholder":"composer.queuePlaceholderNoSteer"):g("composer.inputPlaceholder"),value:s,disabled:Z,onChange:E=>{x.current=!1,a(E.target.value)},onKeyDown:is,onPaste:ri})]}),(0,$.jsxs)("div",{className:"cp-bar",children:[(0,$.jsxs)("div",{className:"pill-wrap",ref:k,children:[(0,$.jsxs)("button",{className:"pill chip",onClick:()=>bi(!_),title:g("composer.agentModel"),children:[(0,$.jsx)(vM,{size:16,className:"chip-logo"}),(0,$.jsx)("span",{className:"p-a",children:Y?.name??P?.provider??g("composer.agent")}),(0,$.jsx)("span",{className:"p-t",children:Ro}),(0,$.jsx)(yp,{})]}),_&&(0,$.jsxs)("div",{className:"pop agent-pop agent-picker",children:[(0,$.jsxs)("div",{className:"ap-search",children:[(0,$.jsx)(ie,{name:"search",size:14}),(0,$.jsx)("input",{className:"ap-search-in",autoFocus:!0,placeholder:g("composer.searchAllModels"),value:b,onChange:E=>w(E.target.value)})]}),b.trim()?(0,$.jsxs)("div",{className:"ap-scroll",children:[ir.length===0&&(0,$.jsx)("div",{className:"ap-empty",children:g("composer.noModelMatch")}),ir.map(({providerId:E,providerName:J,model:le})=>{let Te=Yt&&E!==P?.provider;return(0,$.jsxs)("button",{className:"mi mi-row",disabled:Te,onClick:()=>{re(E,le.id)},children:[(0,$.jsx)("span",{className:"mi-sub",children:J}),(0,$.jsx)("span",{className:"mi-name",children:le.name}),P?.provider===E&&P?.model===le.id&&(0,$.jsx)("span",{className:"mi-check",children:"\u2713"})]},`${E}:${le.id}`)})]}):Ve&&ot?(0,$.jsxs)("div",{className:"ap-scroll",children:[(0,$.jsxs)("button",{type:"button",className:"ap-back mi",onClick:()=>v(null),children:[(0,$.jsx)("span",{className:"ap-back-icon",children:(0,$.jsx)(ie,{name:"caret",size:14})}),ot.name]}),(0,$.jsxs)("button",{className:"mi model-pick-row",title:ot.models?.find(E=>E.isDefault)?.name??g("composer.defaultModel"),onClick:()=>{re(ot.id,null)},children:[(0,$.jsx)("span",{className:"model-pick-name",children:g("composer.defaultModel")}),(()=>{let E=ot.models?.find(J=>J.isDefault);return E?(0,$.jsxs)("span",{className:"mi-sub model-pick-default",children:[" (",E.name,")"]}):null})(),P?.provider===ot.id&&!P?.model?(0,$.jsx)("span",{className:"mi-check",children:"\u2713"}):""]}),(ot.models??[]).filter(E=>!E.isDefault).slice(0,$b).map(E=>(0,$.jsxs)("button",{className:"mi model-pick-row",title:E.name,onClick:()=>{re(ot.id,E.id)},children:[(0,$.jsx)("span",{className:"model-pick-name",children:E.name}),P?.provider===ot.id&&P?.model===E.id?(0,$.jsx)("span",{className:"mi-check",children:"\u2713"}):""]},E.id)),(ot.models?.length??0)>$b&&(0,$.jsx)("div",{className:"ap-empty",children:pe("composer.moreModels",{n:String((ot.models?.length??0)-$b)})})]}):(0,$.jsxs)("div",{className:"ap-scroll",children:[(0,$.jsx)("div",{className:"mlabel",children:Yt?g("composer.agentLocked"):g("composer.providers")}),Yt&&(0,$.jsx)("div",{className:"ap-empty",children:g("composer.agentLockedHint")}),Di.length===0&&(0,$.jsx)("div",{className:"ap-empty",children:g("composer.providersLoading")}),Di.map(E=>{let le=de(E)&&(!Yt||E.id===P?.provider),Te=E.models?.length??0,$e=E.name?.trim()||E.id;return(0,$.jsxs)("button",{className:"mi mi-row provider-pick-row",disabled:!le,onClick:()=>{le&&v(E.id)},children:[(0,$.jsx)("span",{className:"provider-pick-name",children:$e}),(0,$.jsxs)("span",{className:"provider-pick-meta",children:[E.id===P?.provider&&(0,$.jsx)("span",{className:"mi-tag",children:"Current"}),(0,$.jsx)("span",{className:"mi-meta",children:Te===1?"1 model":`${Te} models`}),le&&(0,$.jsx)("span",{className:"mi-caret",children:(0,$.jsx)(ie,{name:"caret",size:14})}),E.enabled===!1&&(0,$.jsx)("span",{className:"dlg-hint",children:"Disabled"}),E.enabled!==!1&&E.status==="planned"&&(0,$.jsx)("span",{className:"dlg-hint",children:"Not available"}),E.enabled!==!1&&E.status!=="planned"&&!E.available&&(0,$.jsx)("span",{className:"dlg-hint",children:"Not detected"})]})]},E.id)})]})]})]}),Oo&&(0,$.jsxs)(pn,{className:"pill ipill",title:g("composer.effortTitle"),ariaLabel:g("composer.effortTitle"),prefer:"up",upAnchor:".cp-card",value:P?.effort??"",onChange:E=>Ki(E||null),options:[{value:"",label:Er?pe("composer.defaultEffortNamed",{level:_p(Er)}):g("composer.defaultEffort")},...Ra.filter(E=>E.id!=="default").map(E=>({value:E.id,label:_p(E.id,E.label)}))],children:[(0,$.jsx)(ie,{name:"gauge",size:14}),(0,$.jsx)("span",{className:"ip-l",children:(()=>{let E=P?.effort??Er;return E?_p(E,Ra.find(J=>J.id===E)?.label):g("composer.defaultEffort")})()}),(0,$.jsx)(yp,{})]}),Q.length===1&&(0,$.jsxs)("span",{className:`pill ipill mode-chip static${Q[0].auto?" auto":""}`,title:Q[0].desc,"data-mode":Q[0].id,children:[(0,$.jsx)(ie,{name:Q[0].auto?"shieldCheck":"shield",size:14}),(0,$.jsx)("span",{className:"ip-l",children:Q[0].label})]}),Q.length>1&&(()=>{let E=Q.find(J=>J.id===Fe)??Q[0];return(0,$.jsxs)(pn,{className:`pill ipill mode-chip${E.danger?" danger":""}${E.auto?" auto":""}`,title:E.desc,ariaLabel:g("composer.modeTitle"),prefer:"up",upAnchor:".cp-card",menuClassName:"mode-menu",value:E.id,onChange:J=>ge(J),options:Q.map(J=>({value:J.id,label:J.label,hint:J.desc,danger:J.danger,warn:J.auto,icon:J.auto?"shieldCheck":void 0})),children:[(0,$.jsx)(ie,{name:E.auto?"shieldCheck":"shield",size:14}),(0,$.jsx)("span",{className:"ip-l",children:E.label}),(0,$.jsx)(yp,{})]})})(),P?.provider==="cursor"&&(0,$.jsxs)(pn,{className:"pill ipill cursor-fast",title:"Fast",ariaLabel:"Fast",prefer:"up",upAnchor:".cp-card",value:P.cursorFast?"fast":"off",onChange:E=>Is({cursorFast:E==="fast"}),options:[{value:"off",label:"Fast: Off"},{value:"fast",label:"Fast: On"}],children:[(0,$.jsx)(ie,{name:"zap",size:13}),(0,$.jsx)("span",{className:"ip-l",children:P.cursorFast?"Fast: On":"Fast: Off"}),(0,$.jsx)(yp,{})]}),(0,$.jsx)("span",{className:"cp-div","aria-hidden":"true"}),(0,$.jsx)("button",{className:"ibtn cp-attach",title:g("composer.attachTitle"),onClick:()=>N.current?.click(),children:(0,$.jsx)(ie,{name:"attach"})}),(0,$.jsx)("input",{ref:N,type:"file",hidden:!0,multiple:!0,accept:"image/*,.txt,.md,.log,.json,.csv",onChange:E=>{for(let J of E.target.files??[])nr(J);E.target.value=""}}),(0,$.jsx)("div",{className:"cp-right",children:U?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("span",{className:"cp-clock",children:[z,"s"]}),(s.trim()||o.length>0||c.length>0||d.length>0)&&(0,$.jsx)("button",{className:"cp-send",title:g(xe&&D.runningSend==="steer"?"settings.steer":"settings.queue"),disabled:Z||o.some(E=>E.uploading),onClick:()=>{De(D.runningSend==="steer"&&xe?"steer":"queue")},children:(0,$.jsx)(ie,{name:"arrowUp"})}),(0,$.jsx)("button",{className:"cp-stop",title:g("common.stop"),onClick:()=>{V.call("thread.interrupt",{id:P?.id})},children:(0,$.jsx)(ie,{name:"stopFill"})})]}):(0,$.jsx)("button",{className:"cp-send",title:g("common.send"),disabled:Z||!s.trim()&&o.length===0&&c.length===0&&d.length===0||o.some(E=>E.uploading),onClick:()=>{De("queue")},children:(0,$.jsx)(ie,{name:"arrowUp"})})})]})]}),U&&!xe&&D.runningSend==="steer"&&(0,$.jsx)("div",{className:"cp-hint",children:pe("composer.steerUnsupported",{agent:Y?.name??P?.provider??""})})]})}function yp(){return(0,$.jsx)("svg",{className:"chip-caret",width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true",children:(0,$.jsx)("path",{d:"M2.5 4l2.5 2.5L7.5 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var Be,$,$b,OM=se(()=>{Be=te(mt(),1);Ul();Qi();Nn();So();Pi();op();An();qu();dp();pp();fr();bp();vp();bM();Uu();gp();wM();kt();NM();$=te(_e(),1),$b=150});function Wb(e){return e?e.nodeType===1?e:e.parentElement:null}function q6(e){if(!e||e.isCollapsed||e.rangeCount===0)return null;let t=e.toString();if(!t.trim())return null;let i=Wb(e.anchorNode),n=Wb(e.focusNode);if(!i||!n)return null;let r=i.closest("[data-quote-root]");if(!r||r!==n.closest("[data-quote-root]")||i.closest(RM)||n.closest(RM))return null;let s=e.getRangeAt(0),o=Wb(s.commonAncestorContainer)?.closest("[data-quote-src]")?.getAttribute("data-quote-src")||void 0;return{range:s,text:t,root:r,src:o}}function F6(e){let t=e;for(;t&&t!==document.body;){let s=getComputedStyle(t).overflowY;if(s==="auto"||s==="scroll")break;t=t.parentElement}let i=(t&&t!==document.body?t:document.documentElement).getBoundingClientRect(),n=Math.min(i.bottom,window.innerHeight),r=document.querySelector(".composer");return e.getAttribute("data-quote-root")==="chat"&&r&&(n=Math.min(n,r.getBoundingClientRect().top)),{left:i.left,right:i.right,top:Math.max(i.top,0)+4,bottom:n-4}}function LM(){let[e,t]=(0,Vr.useState)(null),i=(0,Vr.useRef)(!1),n=(0,Vr.useRef)(null),r=(0,Vr.useRef)(0),s=(0,Vr.useCallback)(()=>{cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{if(i.current)return;let o=q6(window.getSelection());if(!o){t(null);return}let l=n.current?.offsetWidth||H6,c=[...o.range.getClientRects()].map(d=>({left:d.left,top:d.top,right:d.right,bottom:d.bottom})),u=qA(c,F6(o.root),{w:l,h:U6},window.innerWidth);if(!u){t(null);return}t({text:o.text,src:o.src,left:u.left,top:u.top})})},[]);if((0,Vr.useEffect)(()=>{let o=h=>{h.target?.closest?.(".qs-pop")||h.button===0&&(i.current=!0,t(null))},l=()=>{i.current&&(i.current=!1,s())},c=h=>{if(h.key==="Escape"){t(null);return}s()},u=()=>s(),d=()=>s();return document.addEventListener("pointerdown",o,!0),document.addEventListener("pointerup",l,!0),document.addEventListener("keyup",c,!0),document.addEventListener("selectionchange",u),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{document.removeEventListener("pointerdown",o,!0),document.removeEventListener("pointerup",l,!0),document.removeEventListener("keyup",c,!0),document.removeEventListener("selectionchange",u),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d),cancelAnimationFrame(r.current)}},[s]),!e)return null;let a=()=>{window.dispatchEvent(new CustomEvent("ac-add-quote",{detail:{text:e.text,src:e.src}})),window.getSelection()?.removeAllRanges(),t(null)};return(0,DM.createPortal)((0,Wu.jsxs)("button",{ref:n,type:"button",className:"qs-pop",style:{left:e.left,top:e.top},title:g("quote.addHint"),onMouseDown:o=>o.preventDefault(),onPointerDown:o=>o.preventDefault(),onClick:a,children:[(0,Wu.jsx)(ie,{name:"chat",size:13}),(0,Wu.jsx)("span",{children:g("quote.add")})]}),document.body)}var Vr,DM,Wu,H6,U6,RM,IM=se(()=>{Vr=te(mt(),1),DM=te(qs(),1);An();kt();dp();Wu=te(_e(),1),H6=118,U6=30,RM="input, textarea, select, [contenteditable=''], [contenteditable='true'], button, .cp-card, .qs-pop, [data-quote-off]"});function BM(){let e=ue(),{projects:t,threads:i}=Ge(),n=Mi(),r=$u(),s=(0,qi.useMemo)(()=>DA(WA(n.items),{showThinking:r.showThinking}),[n.items,r.showThinking]),a=(0,qi.useRef)(null),[o,l]=(0,qi.useState)(!0),[c,u]=(0,qi.useState)(!1),d=t.find(C=>C.id===e.currentProjectId)??null,h=e.currentThreadId,f=h?i.find(C=>C.id===h)??null:null,p=d&&f&&f.projectId===d.id?f.id:null;(0,qi.useEffect)(()=>{p?n.open(p):n.close(),l(!0),u(!1)},[p]);let _=(0,qi.useCallback)(C=>{let M=s[C];if(!M)return 80;switch(M.kind){case"user":return 60;case"assistant":case"reasoning":return 120;case"toolgroup":return M.steps.length>lp?34:8+26*M.steps.length;case"plan":return 200;case"permission":case"question":return 120;case"todo":return 34+24*M.items.length;case"turnend":case"notice":return 30;default:return 60}},[s]),y=bA({count:s.length,getScrollElement:()=>a.current,estimateSize:_,getItemKey:C=>s[C]?.key??C,overscan:8,measureElement:C=>C.getBoundingClientRect().height});(0,qi.useEffect)(()=>{let C=M=>{let z=M.detail?.key,q=z?s.findIndex(B=>B.key===z):-1;q<0||(y.scrollToIndex(q,{align:"center"}),requestAnimationFrame(()=>{let B=a.current?.querySelector(`[data-todo-key="${CSS.escape(z)}"]`);B?.classList.remove("flash"),B?.offsetWidth,B?.classList.add("flash")}))};return window.addEventListener("ac-show-item",C),()=>window.removeEventListener("ac-show-item",C)},[s,y]);let m=s.length;(0,qi.useEffect)(()=>{let C=a.current;C&&(o?C.scrollTop=C.scrollHeight:u(!0))},[m,o]),(0,qi.useEffect)(()=>{if(!n.sentAt)return;l(!0),u(!1);let C=a.current;if(!C)return;C.scrollTop=C.scrollHeight;let M=requestAnimationFrame(()=>{C.scrollTop=C.scrollHeight});return()=>cancelAnimationFrame(M)},[n.sentAt]);let v=()=>{let C=a.current;if(!C)return;let M=C.scrollHeight-C.scrollTop-C.clientHeight<60;l(M),M&&u(!1)},b=()=>{a.current?.scrollTo({top:a.current.scrollHeight,behavior:"smooth"}),l(!0),u(!1)},w=(C,M)=>{if(!p)return;let z=d?.path,q=z&&M?.length?M.map(I=>({rel:fp(z,I.path),isDir:I.isDir})).filter(I=>!!I.rel):[],B=n.status==="running"||n.status==="initializing";n.send(p,{text:C,...q.length?{mentions:q}:{}},M?.length?{mentions:M}:{},{optimistic:!B}).catch(I=>we(g("composer.failSend")+Xe(I),!0))},k=()=>{n.lastUserText&&w(n.lastUserText)};if(t.length===0)return(0,qe.jsx)("div",{className:"scroll",ref:a,children:(0,qe.jsx)(zM,{kind:"no-projects"})});if(!p)return(0,qe.jsx)("div",{className:"scroll",ref:a,children:d?(0,qe.jsxs)("div",{className:"empty-wrap",children:[(0,qe.jsx)("div",{className:"cp-hero-t",children:pe("chat.newInProject",{name:d.name})}),(0,qe.jsx)($6,{projectId:d.id})]}):(0,qe.jsx)(zM,{kind:"pick-project"})});let O=-1;for(let C=s.length-1;C>=0;C--)if(s[C].kind==="turnend"){O=C;break}let N=C=>{let M=[];for(let z=C-1;z>=0;z--){let q=s[z];if(q.kind==="user"||q.kind==="turnend")break;q.kind==="assistant"&&M.unshift(q.text)}return M.join(`
|
|
|
|
`)};return(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)("div",{className:"scroll",ref:a,onScroll:v,children:(0,qe.jsxs)("div",{className:"tl-wrap","data-quote-root":"chat",children:[(0,qe.jsx)("div",{style:{height:y.getTotalSize(),position:"relative"},children:y.getVirtualItems().map(C=>{let M=s[C.index];return M?(0,qe.jsx)("div",{"data-index":C.index,ref:y.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${C.start}px)`},children:(0,qe.jsx)(nM,{it:M,threadId:p,onEditResend:w,onRetryLast:C.index===O?k:void 0,replyText:M.kind==="turnend"?N(C.index):void 0})},C.key):null})}),n.items.length===0&&!n.error&&(0,qe.jsx)("div",{className:"sb-empty",children:g("chat.emptyHint")}),n.error&&(0,qe.jsx)("div",{className:"nt error",children:Nr(n.error)})]})}),!o&&(0,qe.jsxs)("button",{className:"jump",onClick:b,title:g("chat.jumpBottom"),children:[(0,qe.jsx)(ie,{name:"caret"}),c&&(0,qe.jsx)("span",{className:"jd"})]}),(0,qe.jsx)(MM,{}),(0,qe.jsx)(LM,{})]})}function zM({kind:e}){let t=e==="pick-project";return(0,qe.jsxs)("div",{className:"empty-wrap workspace-empty",children:[(0,qe.jsx)("div",{className:"cp-hero-t",children:g(t?"chat.pickProjectTitle":"sidebar.noProjectsTitle")}),(0,qe.jsx)("div",{className:"cp-hero-s",children:g(t?"chat.pickProjectSub":"sidebar.noProjectsSub")}),(0,qe.jsx)("div",{className:"empty-actions",children:(0,qe.jsx)("button",{type:"button",className:"btn primary",onClick:()=>window.dispatchEvent(new CustomEvent("open-new-project")),children:g("sidebar.newProject")})})]})}function $6({projectId:e}){let t=ue(),i=$u(),[n,r]=(0,qi.useState)(""),[s,a]=(0,qi.useState)(!1),o=async()=>{if(!(!n.trim()||s)){a(!0);try{let l=await Hl(),c=await V.call("settings.get"),u=await V.call("threads.create",{projectId:e,provider:l,model:null,mode:c.defaultMode??"default"});t.select(e,u.id),await Mi.getState().send(u.id,{text:n.trim()})}catch(l){we(g("chat.failSend")+Xe(l),!0),a(!1)}}};return(0,qe.jsxs)("div",{className:"cp-card",style:{marginTop:18},children:[(0,qe.jsx)("textarea",{className:"cp-ta",rows:3,placeholder:g("chat.emptyPlaceholder"),value:n,onChange:l=>r(l.target.value),onKeyDown:l=>{if(Vn(l.nativeEvent))return;let c=l.ctrlKey||l.metaKey;(i.sendKey==="ctrlEnter"?l.key==="Enter"&&c:l.key==="Enter"&&!l.shiftKey&&!c)&&(l.preventDefault(),o())}}),(0,qe.jsxs)("div",{className:"cp-bar",children:[(0,qe.jsx)("span",{className:"dlg-hint",children:g("chat.autoNewThread")}),(0,qe.jsx)("div",{className:"cp-right",children:(0,qe.jsx)("button",{className:"cp-send",disabled:!n.trim()||s,onClick:()=>{o()},title:g("common.send"),children:(0,qe.jsx)(ie,{name:"send"})})})]})]})}var qi,qe,PM=se(()=>{qi=te(mt(),1);Ul();yA();Qi();Nn();So();qu();Uu();Ob();OM();IM();An();Pi();fr();pp();bp();kt();qe=te(_e(),1)});function UM({onClose:e}){let{projects:t,threads:i,providers:n}=Ge(),r=ue(),[s,a]=(0,Zr.useState)(""),[o,l]=(0,Zr.useState)(0),c=(0,Zr.useRef)(null);(0,Zr.useEffect)(()=>{c.current?.focus()},[]);let u=(0,Zr.useMemo)(()=>{let f=[],p=s.trim().toLowerCase(),_=m=>!p||m.toLowerCase().includes(p),y=[[g("palette.actNewThread"),()=>{let m=r.currentProjectId??t[0]?.id;m&&h(m)}],[g("palette.actSettings"),()=>window.dispatchEvent(new CustomEvent("open-settings"))],[g("palette.actTheme"),()=>{W6()}],[g("palette.actChanges"),()=>r.openPanel("changes")],[g("palette.actFiles"),()=>r.openPanel("files")],[g("palette.actTerminal"),()=>r.openPanel("terminal")],[g("palette.actImport"),()=>{let m=r.currentProjectId??t[0]?.id;m&&window.dispatchEvent(new CustomEvent("open-import",{detail:{projectId:m}}))}]];for(let[m,v]of y)_(m)&&f.push({id:`act:${m}`,label:m,hint:g("palette.hintAction"),run:v});for(let m of t)_(m.name)&&f.push({id:`p:${m.id}`,label:m.name,hint:g("palette.hintProject"),run:()=>r.select(m.id,null)});for(let m of i){let v=t.find(w=>w.id===m.projectId),b=`${m.title} ${v?.name??""}`;_(b)&&f.push({id:`t:${m.id}`,label:m.title,hint:v?.name??g("palette.hintThread"),run:()=>r.select(m.projectId,m.id)})}return f.slice(0,30)},[s,t,i]);(0,Zr.useEffect)(()=>{l(0)},[s]);let d=f=>{if(f.key==="ArrowDown")f.preventDefault(),l(p=>Math.min(u.length-1,p+1));else if(f.key==="ArrowUp")f.preventDefault(),l(p=>Math.max(0,p-1));else if(f.key==="Enter"&&!Vn(f.nativeEvent)){f.preventDefault();let p=u[o];p&&(e(),p.run())}else f.key==="Escape"&&(f.preventDefault(),e())};async function h(f){try{let p=await V.call("settings.get"),_=await Hl(),y=await V.call("threads.create",{projectId:f,provider:_,mode:p.defaultMode??"default"});ue.getState().select(f,y.id)}catch(p){we(g("palette.failNew")+Xe(p),!0)}}return(0,HM.createPortal)((0,Xr.jsx)("div",{className:"dlg-scrim",style:{alignItems:"flex-start",paddingTop:"14vh"},onPointerDown:f=>{f.target===f.currentTarget&&e()},children:(0,Xr.jsxs)("div",{className:"dlg cpal",role:"dialog","aria-label":g("palette.aria"),children:[(0,Xr.jsx)("input",{ref:c,className:"cpal-in",placeholder:g("palette.placeholder"),value:s,onChange:f=>a(f.target.value),onKeyDown:d}),(0,Xr.jsxs)("div",{className:"cpal-list",children:[u.map((f,p)=>(0,Xr.jsxs)("button",{className:`cpal-item${p===o?" on":""}`,onMouseEnter:()=>l(p),onClick:()=>{e(),f.run()},children:[(0,Xr.jsx)("span",{className:"cpal-label",children:f.label}),f.hint&&(0,Xr.jsx)("span",{className:"cpal-hint",children:f.hint})]},f.id)),u.length===0&&(0,Xr.jsx)("div",{className:"sb-empty",children:g("palette.noMatch")})]})]})}),document.body)}async function W6(){let e=pk()==="dark"?"light":"dark";Wr(e);try{await V.call("settings.set",{patch:{theme:e}})}catch{}}var Zr,HM,Xr,qM=se(()=>{gu();Zr=te(mt(),1);Ul();HM=te(qs(),1);Nn();Qi();Pi();fr();kt();Xr=te(_e(),1)});function j6(e){return e.replace(/\r?\n/g,"\r")}function Y6(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function V6(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function X6(e,t,i,n){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");VO(r,t,i,n)}}function VO(e,t,i,n){e=j6(e),e=Y6(e,i.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function XO(e,t,i){let n=i.getBoundingClientRect(),r=e.clientX-n.left-10,s=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${s}px`,t.style.zIndex="1000",t.focus()}function WM(e,t,i,n,r){XO(e,t,i),r&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function Na(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function $p(e,t=0,i=e.length){let n="";for(let r=t;r<i;++r){let s=e[r];s>65535?(s-=65536,n+=String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):n+=String.fromCharCode(s)}return n}function J6(e){return e[c0]||[]}function gi(e){if(Kb.has(e))return Kb.get(e);let t=function(i,n,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");eP(t,i,r)};return t._id=e,Kb.set(e,t),t}function eP(e,t,i){t[KM]===t?t[c0].push({id:e,index:i}):(t[c0]=[{id:e,index:i}],t[KM]=t)}function nP(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
|
|
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}function Cp(e){oP(e)||aP.onUnexpectedError(e)}function oP(e){return e instanceof lP?!0:e instanceof Error&&e.name===d0&&e.message===d0}function cP(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function uP(e,t,i=0,n=e.length){let r=i,s=n;for(;r<s;){let a=Math.floor((r+s)/2);t(e[a])?r=a+1:s=a}return r-1}function Ln(e,t=0){return e[e.length-(1+t)]}function hP(e,t){return(i,n)=>t(e(i),e(n))}function pP(e,t){let i=Object.create(null);for(let n of e){let r=t(n),s=i[r];s||(s=i[r]=[]),s.push(n)}return i}function gP(e,t){let i=this,n=!1,r;return function(){if(n)return r;if(n=!0,t)try{r=e.apply(i,arguments)}finally{t()}else r=e.apply(i,arguments);return r}}function bP(e){To=e}function Kp(e){return To?.trackDisposable(e),e}function Gp(e){To?.markAsDisposed(e)}function ld(e,t){To?.setParent(e,t)}function yP(e,t){if(To)for(let i of e)To.setParent(i,t)}function XM(e){return To?.markAsSingleton(e),e}function No(e){if(g0.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function SP(...e){let t=St(()=>No(e));return yP(e,t),t}function St(e){let t=Kp({dispose:gP(()=>{Gp(t),e()})});return t}function LP(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}function IP(e){return Z0.INSTANCE.getZoomFactor(e)}function zP(){return Mp}function QP(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return E0.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(x0)switch(t){case 59:return 85;case 60:if(WP)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(es)return 57;break}else if(Ap&&(es&&t===93||!es&&t===92))return 57;return VP[t]||0}function nH(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}function lH(e){return 55296<=e&&e<=56319}function cO(e){return 56320<=e&&e<=57343}function cH(e,t){return(e-55296<<10)+(t-56320)+65536}function uH(e){return ty(e,0)}function ty(e,t){switch(typeof e){case"object":return e===null?Os(349,t):Array.isArray(e)?hH(e,t):fH(e,t);case"string":return wR(e,t);case"boolean":return dH(e,t);case"number":return Os(e,t);case"undefined":return Os(937,t);default:return Os(617,t)}}function Os(e,t){return(t<<5)-t+e|0}function dH(e,t){return Os(e?433:863,t)}function wR(e,t){t=Os(149417,t);for(let i=0,n=e.length;i<n;i++)t=Os(e.charCodeAt(i),t);return t}function hH(e,t){return t=Os(104579,t),e.reduce((i,n)=>ty(n,i),t)}function fH(e,t){return t=Os(181387,t),Object.keys(e).sort().reduce((i,n)=>(i=wR(n,i),ty(e[n],i)),t)}function Xb(e,t,i=32){let n=i-t,r=~((1<<n)-1);return(e<<t|(r&e)>>>n)>>>0}function uO(e,t=0,i=e.byteLength,n=0){for(let r=0;r<i;r++)e[t+r]=n}function pH(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function Ku(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):pH((e>>>0).toString(16),t/4)}function Ee(e,t,i,n){return new _H(e,t,i,n)}function vH(e,t){return function(i){return t(new Qu(e,i))}}function bH(e){return function(t){return e(new k0(t))}}function wH(e){let t=e.getBoundingClientRect(),i=wr(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}function ER(e,t,i,...n){let r=xH.exec(t);if(!r)throw new Error("Bad use of emmet");let s=r[1]||"div",a;return e!=="http://www.w3.org/1999/xhtml"?a=document.createElementNS(e,s):a=document.createElement(s),r[3]&&(a.id=r[3]),r[4]&&(a.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([o,l])=>{typeof l>"u"||(/^on\w+$/.test(o)?a[o]=l:o==="selected"?l&&a.setAttribute(o,"true"):a.setAttribute(o,l))}),a.append(...n),a}function EH(e,t,...i){return ER("http://www.w3.org/1999/xhtml",e,t,...i)}function mn(e){return typeof e=="number"?`${e}px`:e}function sd(e){return new kH(e)}function CH(e,t,i){let n=null,r=null;if(typeof i.value=="function"?(n="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(n="get",r=i.get),!r)throw new Error("not supported");let s=`$memoize$${t}`;i[n]=function(...a){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,a)}),this[s]}}function Qb(e,t){let i=t-e;return function(n){return e+i*DH(n)}}function OH(e,t,i){return function(n){return n<i?e(n/i):t((n-i)/(1-i))}}function RH(e){return Math.pow(e,3)}function DH(e){return 1-RH(1-e)}function $H(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,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:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,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:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,es&&(t.className+=" mac"),t}function xo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function As(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function GH(e){return 57508<=e&&e<=57558}function jH(e){return 9472<=e&&e<=9631}function YH(e){return GH(e)||jH(e)}function VH(){return{css:{canvas:wp(),cell:wp()},device:{canvas:wp(),cell:wp(),char:{width:0,height:0,left:0,top:0}}}}function wp(){return{width:0,height:0}}function yO(e,t,i){for(;e.length<i;)e=t+e;return e}function QH(){return new ZH}function ny(e,t,i){let n=i.getBoundingClientRect(),r=e.getComputedStyle(i),s=parseInt(r.getPropertyValue("padding-left")),a=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-n.left-s,t.clientY-n.top-a]}function sU(e,t,i,n,r,s,a,o,l){if(!s)return;let c=ny(e,t,i);if(c)return c[0]=Math.ceil((c[0]+(l?a/2:0))/a),c[1]=Math.ceil(c[1]/o),c[0]=Math.min(Math.max(c[0],1),n+(l?1:0)),c[1]=Math.min(Math.max(c[1],1),r),c}function lU(){if(!OR)return 0;let e=pd.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}function mU(e,t,i,n){let r=i.buffer.x,s=i.buffer.y;if(!i.buffer.hasScrollback)return vU(r,s,e,t,i,n)+Yp(s,t,i,n)+bU(r,s,e,t,i,n);let a;if(s===t)return a=r>e?"D":"C",ud(Math.abs(r-e),cd(a,n));a=s>t?"D":"C";let o=Math.abs(s-t),l=_U(s>t?e:r,i)+(o-1)*i.cols+1+gU(s>t?r:e,i);return ud(l,cd(a,n))}function gU(e,t){return e-1}function _U(e,t){return t.cols-e}function vU(e,t,i,n,r,s){return Yp(t,n,r,s).length===0?"":ud(zR(e,t,e,t-Ao(t,r),!1,r).length,cd("D",s))}function Yp(e,t,i,n){let r=e-Ao(e,i),s=t-Ao(t,i),a=Math.abs(r-s)-yU(e,t,i);return ud(a,cd(IR(e,t),n))}function bU(e,t,i,n,r,s){let a;Yp(t,n,r,s).length>0?a=n-Ao(n,r):a=t;let o=n,l=SU(e,t,i,n,r,s);return ud(zR(e,a,i,o,l==="C",r).length,cd(l,s))}function yU(e,t,i){let n=0,r=e-Ao(e,i),s=t-Ao(t,i);for(let a=0;a<Math.abs(r-s);a++){let o=IR(e,t)==="A"?-1:1;i.buffer.lines.get(r+o*a)?.isWrapped&&n++}return n}function Ao(e,t){let i=0,n=t.buffer.lines.get(e),r=n?.isWrapped;for(;r&&e>=0&&e<t.rows;)i++,n=t.buffer.lines.get(--e),r=n?.isWrapped;return i}function SU(e,t,i,n,r,s){let a;return Yp(i,n,r,s).length>0?a=n-Ao(n,r):a=t,e<i&&a<=n||e>=i&&a<n?"C":"D"}function IR(e,t){return e>t?"A":"B"}function zR(e,t,i,n,r,s){let a=e,o=t,l="";for(;(a!==i||o!==n)&&o>=0&&o<s.buffer.lines.length;)a+=r?1:-1,r&&a>s.cols-1?(l+=s.buffer.translateBufferLineToString(o,!1,e,a),a=0,e=0,o++):!r&&a<0&&(l+=s.buffer.translateBufferLineToString(o,!1,0,e+1),a=s.cols-1,e=a,o--);return l+s.buffer.translateBufferLineToString(o,!1,e,a)}function cd(e,t){let i=t?"O":"[";return W.ESC+i+e}function ud(e,t){e=Math.floor(e);let i="";for(let n=0;n<e;n++)i+=t;return i}function wO(e,t){if(e.start.y>e.end.y)throw new 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)}function st(e,t){if(e!==void 0)try{return At.toColor(e)}catch{}return t}function LU(e,t,i,n,r,s){let a=[];for(let o=0;o<e.length-1;o++){let l=o,c=e.get(++l);if(!c.isWrapped)continue;let u=[e.get(o)];for(;l<e.length&&c.isWrapped;)u.push(c),c=e.get(++l);if(!s&&n>=o&&n<l){o+=u.length-1;continue}let d=0,h=dd(u,d,t),f=1,p=0;for(;f<u.length;){let y=dd(u,f,t),m=y-p,v=i-h,b=Math.min(m,v);u[d].copyCellsFrom(u[f],p,h,b,!1),h+=b,h===i&&(d++,h=0),p+=b,p===y&&(f++,p=0),h===0&&d!==0&&u[d-1].getWidth(i-1)===2&&(u[d].copyCellsFrom(u[d-1],i-1,h++,1,!1),u[d-1].setCell(i-1,r))}u[d].replaceCells(h,i,r);let _=0;for(let y=u.length-1;y>0&&(y>d||u[y].getTrimmedLength()===0);y--)_++;_>0&&(a.push(o+u.length-_),a.push(_)),o+=u.length-1}return a}function IU(e,t){let i=[],n=0,r=t[n],s=0;for(let a=0;a<e.length;a++)if(r===a){let o=t[++n];e.onDeleteEmitter.fire({index:a-s,amount:o}),a+=o-1,s+=o,r=t[++n]}else i.push(a);return{layout:i,countRemoved:s}}function zU(e,t){let i=[];for(let n=0;n<t.length;n++)i.push(e.get(t[n]));for(let n=0;n<i.length;n++)e.set(n,i[n]);e.length=t.length}function BU(e,t,i){let n=[],r=e.map((l,c)=>dd(e,c,t)).reduce((l,c)=>l+c),s=0,a=0,o=0;for(;o<r;){if(r-o<i){n.push(r-o);break}s+=i;let l=dd(e,a,t);s>l&&(s-=l,a++);let c=e[a].getWidth(s-1)===2;c&&s--;let u=c?i-1:i;n.push(u),o+=u}return n}function dd(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,r=e[t+1].getWidth(0)===2;return n&&r?i-1:i}function FU(e){return e==="block"||e==="underline"||e==="bar"}function id(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let n in e)i[n]=t<=1?e[n]:e[n]&&id(e[n],t-1);return i}function i0(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}function WU(e,t){let i=0,n=t.length-1,r;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=i;)if(r=i+n>>1,e>t[r][1])i=r+1;else if(e<t[r][0])n=r-1;else return!0;return!1}function LO(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}function zO(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=JU.exec(t);if(i){let n=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/n*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/n*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),e8.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let s=parseInt(t.slice(i*r,i*r+i),16);n[r]=i===1?s<<4:i===2?s:i===3?s>>4:s>>8}return n}}function s0(e,t){let i=e.toString(16),n=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function t8(e,t=16){let[i,n,r]=e;return`rgb:${s0(i,t)}/${s0(n,t)}/${s0(r,t)}`}function PO(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}function qO(e){return 0<=e&&e<256}function c8(e,t,i,n){let r={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?r.key=W.ESC+"OA":r.key=W.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?r.key=W.ESC+"OD":r.key=W.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?r.key=W.ESC+"OC":r.key=W.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?r.key=W.ESC+"OB":r.key=W.ESC+"[B");break;case 8:r.key=e.ctrlKey?"\b":W.DEL,e.altKey&&(r.key=W.ESC+r.key);break;case 9:if(e.shiftKey){r.key=W.ESC+"[Z";break}r.key=W.HT,r.cancel=!0;break;case 13:r.key=e.altKey?W.ESC+W.CR:W.CR,r.cancel=!0;break;case 27:r.key=W.ESC,e.altKey&&(r.key=W.ESC+W.ESC),r.cancel=!0;break;case 37:if(e.metaKey)break;s?r.key=W.ESC+"[1;"+(s+1)+"D":t?r.key=W.ESC+"OD":r.key=W.ESC+"[D";break;case 39:if(e.metaKey)break;s?r.key=W.ESC+"[1;"+(s+1)+"C":t?r.key=W.ESC+"OC":r.key=W.ESC+"[C";break;case 38:if(e.metaKey)break;s?r.key=W.ESC+"[1;"+(s+1)+"A":t?r.key=W.ESC+"OA":r.key=W.ESC+"[A";break;case 40:if(e.metaKey)break;s?r.key=W.ESC+"[1;"+(s+1)+"B":t?r.key=W.ESC+"OB":r.key=W.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(r.key=W.ESC+"[2~");break;case 46:s?r.key=W.ESC+"[3;"+(s+1)+"~":r.key=W.ESC+"[3~";break;case 36:s?r.key=W.ESC+"[1;"+(s+1)+"H":t?r.key=W.ESC+"OH":r.key=W.ESC+"[H";break;case 35:s?r.key=W.ESC+"[1;"+(s+1)+"F":t?r.key=W.ESC+"OF":r.key=W.ESC+"[F";break;case 33:e.shiftKey?r.type=2:e.ctrlKey?r.key=W.ESC+"[5;"+(s+1)+"~":r.key=W.ESC+"[5~";break;case 34:e.shiftKey?r.type=3:e.ctrlKey?r.key=W.ESC+"[6;"+(s+1)+"~":r.key=W.ESC+"[6~";break;case 112:s?r.key=W.ESC+"[1;"+(s+1)+"P":r.key=W.ESC+"OP";break;case 113:s?r.key=W.ESC+"[1;"+(s+1)+"Q":r.key=W.ESC+"OQ";break;case 114:s?r.key=W.ESC+"[1;"+(s+1)+"R":r.key=W.ESC+"OR";break;case 115:s?r.key=W.ESC+"[1;"+(s+1)+"S":r.key=W.ESC+"OS";break;case 116:s?r.key=W.ESC+"[15;"+(s+1)+"~":r.key=W.ESC+"[15~";break;case 117:s?r.key=W.ESC+"[17;"+(s+1)+"~":r.key=W.ESC+"[17~";break;case 118:s?r.key=W.ESC+"[18;"+(s+1)+"~":r.key=W.ESC+"[18~";break;case 119:s?r.key=W.ESC+"[19;"+(s+1)+"~":r.key=W.ESC+"[19~";break;case 120:s?r.key=W.ESC+"[20;"+(s+1)+"~":r.key=W.ESC+"[20~";break;case 121:s?r.key=W.ESC+"[21;"+(s+1)+"~":r.key=W.ESC+"[21~";break;case 122:s?r.key=W.ESC+"[23;"+(s+1)+"~":r.key=W.ESC+"[23~";break;case 123:s?r.key=W.ESC+"[24;"+(s+1)+"~":r.key=W.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?r.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?r.key=W.NUL:e.keyCode>=51&&e.keyCode<=55?r.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?r.key=W.DEL:e.keyCode===219?r.key=W.ESC:e.keyCode===220?r.key=W.FS:e.keyCode===221&&(r.key=W.GS);else if((!i||n)&&e.altKey&&!e.metaKey){let a=l8[e.keyCode]?.[e.shiftKey?1:0];if(a)r.key=W.ESC+a;else if(e.keyCode>=65&&e.keyCode<=90){let o=e.ctrlKey?e.keyCode-64:e.keyCode+32,l=String.fromCharCode(o);e.shiftKey&&(l=l.toUpperCase()),r.key=W.ESC+l}else if(e.keyCode===32)r.key=W.ESC+(e.ctrlKey?W.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let o=e.code.slice(3,4);e.shiftKey||(o=o.toLowerCase()),r.key=W.ESC+o,r.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(r.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?r.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(r.key=W.US),e.key==="@"&&(r.key=W.NUL));break}return r}function m8(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}function _8(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var YO,K6,G6,Bt,oe,FM,o0,$M,l0,Z6,Q6,ZO,Aa,hd,Lp,er,KM,c0,Kb,en,tR,Mo,tP,V0,iR,tn,nR,iP,fd,u0,Wp,Ds,X0,Ls,rP,rR,lc,sR,sP,aP,d0,lP,GM,f0,dP,p0,fP,jM,YM,VM,cW,mP,g0,_P,To,vP,cR,Ma,Oe,oc,Bn,_0,Rt,ZM,wP,xP,EP,QM,kP,mi,b0,CP,JM,hR,TP,S0,NP,AP,MP,Tp,OP,RP,Np,ee,DP,w0,Z0,dW,hW,cc,x0,Ap,Q0,mR,fW,pW,Mp,ac,Ip,zp,rd,BP,gR,_R,PP,HP,UP,qP,Sp,Op,eO,FP,Ms,Rs,zn,vR,$P,Gb,bR,es,WP,jb,KP,mW,ts,Ea,tO,GP,jP,YP,gW,_W,vW,bW,ka,yW,J0,Yb,iO,nO,VP,E0,XP,ZP,JP,eH,tH,iH,k0,rO,rH,Qu,sO,SR,aO,sH,ey,aH,oH,Vb,oO,lO,mH,SW,wr,wW,xW,EW,dO,kW,CW,gH,TW,NW,_H,hO,yH,Bp,SH,Zb,fO,AW,di,xH,kH,kR,Sr,Ju,TH,iy,pO,NH,AH,MH,mO,gO,LH,IH,CR,TR,zH,BH,PH,_O,vO,HH,A0,UH,qH,FH,M0,O0,WH,Qr,Ca,Gu,Pp,W,ad,R0,D0,hi,fi,pi,zt,bO,Ft,yt,At,$i,od,KH,Hp,L0,XH,ZH,Jb,Zn,xp,SO,ju,Ep,JH,I0,z0,NR,eU,tU,iU,nU,rU,B0,aU,AR,jp,pd,md,MR,oU,OR,Up,cU,uU,RR,ry,DR,LR,dU,hU,qp,fU,P0,pU,wU,e0,xU,EU,kU,CU,TU,H0,xO,EO,ei,Eo,ed,kO,CO,Yu,NU,U0,AU,MU,OU,RU,q0,DU,TO,Ie,jt,kp,t0,td,PR,PU,ii,ko,NO,AO,HU,UR,qR,F0,sc,UU,qU,MO,OO,$0,RO,n0,DO,W0,r0,$U,ti,KU,Co,GU,Vu,jU,FR,Xu,YU,In,Zu,VU,nd,IO,XU,Jn,ZU,QU,JU,e8,i8,Ta,BO,HO,UO,n8,G0,r8,FO,s8,a8,j0,$O,o8,l8,qt,u8,a0,WO,d8,h8,f8,p8,KO,GO,Fp,Y0,g8,v8,b8,jO,y8,S8,w8,x8,Jr,$R,WR=se(()=>{YO=Object.defineProperty,K6=Object.getOwnPropertyDescriptor,G6=(e,t)=>{for(var i in t)YO(e,i,{get:t[i],enumerable:!0})},Bt=(e,t,i,n)=>{for(var r=n>1?void 0:n?K6(t,i):t,s=e.length-1,a;s>=0;s--)(a=e[s])&&(r=(n?a(t,i,r):a(r))||r);return n&&r&&YO(t,i,r),r},oe=(e,t)=>(i,n)=>t(i,n,e),FM="Terminal input",o0={get:()=>FM,set:e=>FM=e},$M="Too much output to announce, navigate to rows manually to read",l0={get:()=>$M,set:e=>$M=e};Z6=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let n=0,r=0;if(this._interim){let s=e.charCodeAt(r++);56320<=s&&s<=57343?t[n++]=(this._interim-55296)*1024+s-56320+65536:(t[n++]=this._interim,t[n++]=s),this._interim=0}for(let s=r;s<i;++s){let a=e.charCodeAt(s);if(55296<=a&&a<=56319){if(++s>=i)return this._interim=a,n;let o=e.charCodeAt(s);56320<=o&&o<=57343?t[n++]=(a-55296)*1024+o-56320+65536:(t[n++]=a,t[n++]=o);continue}a!==65279&&(t[n++]=a)}return n}},Q6=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let n=0,r,s,a,o,l=0,c=0;if(this.interim[0]){let h=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let p=0,_;for(;(_=this.interim[++p]&63)&&p<4;)f<<=6,f|=_;let y=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,m=y-p;for(;c<m;){if(c>=i)return 0;if(_=e[c++],(_&192)!==128){c--,h=!0;break}else this.interim[p++]=_,f<<=6,f|=_&63}h||(y===2?f<128?c--:t[n++]=f:y===3?f<2048||f>=55296&&f<=57343||f===65279||(t[n++]=f):f<65536||f>1114111||(t[n++]=f)),this.interim.fill(0)}let u=i-4,d=c;for(;d<i;){for(;d<u&&!((r=e[d])&128)&&!((s=e[d+1])&128)&&!((a=e[d+2])&128)&&!((o=e[d+3])&128);)t[n++]=r,t[n++]=s,t[n++]=a,t[n++]=o,d+=4;if(r=e[d++],r<128)t[n++]=r;else if((r&224)===192){if(d>=i)return this.interim[0]=r,n;if(s=e[d++],(s&192)!==128){d--;continue}if(l=(r&31)<<6|s&63,l<128){d--;continue}t[n++]=l}else if((r&240)===224){if(d>=i)return this.interim[0]=r,n;if(s=e[d++],(s&192)!==128){d--;continue}if(d>=i)return this.interim[0]=r,this.interim[1]=s,n;if(a=e[d++],(a&192)!==128){d--;continue}if(l=(r&15)<<12|(s&63)<<6|a&63,l<2048||l>=55296&&l<=57343||l===65279)continue;t[n++]=l}else if((r&248)===240){if(d>=i)return this.interim[0]=r,n;if(s=e[d++],(s&192)!==128){d--;continue}if(d>=i)return this.interim[0]=r,this.interim[1]=s,n;if(a=e[d++],(a&192)!==128){d--;continue}if(d>=i)return this.interim[0]=r,this.interim[1]=s,this.interim[2]=a,n;if(o=e[d++],(o&192)!==128){d--;continue}if(l=(r&7)<<18|(s&63)<<12|(a&63)<<6|o&63,l<65536||l>1114111)continue;t[n++]=l}}return n}},ZO="",Aa=" ",hd=class QO{constructor(){this.fg=0,this.bg=0,this.extended=new Lp}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new QO;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)===0}isBgDefault(){return(this.bg&50331648)===0}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)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Lp=class JO{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new JO(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},er=class eR extends hd{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Lp,this.combinedData=""}static fromCharData(t){let i=new eR;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Na(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},KM="di$target",c0="di$dependencies",Kb=new Map;en=gi("BufferService"),tR=gi("CoreMouseService"),Mo=gi("CoreService"),tP=gi("CharsetService"),V0=gi("InstantiationService"),iR=gi("LogService"),tn=gi("OptionsService"),nR=gi("OscLinkService"),iP=gi("UnicodeService"),fd=gi("DecorationService"),u0=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let n=[],r=this._optionsService.rawOptions.linkHandler,s=new er,a=i.getTrimmedLength(),o=-1,l=-1,c=!1;for(let u=0;u<a;u++)if(!(l===-1&&!i.hasContent(u))){if(i.loadCell(u,s),s.hasExtendedAttrs()&&s.extended.urlId)if(l===-1){l=u,o=s.extended.urlId;continue}else c=s.extended.urlId!==o;else l!==-1&&(c=!0);if(c||l!==-1&&u===a-1){let d=this._oscLinkService.getLinkData(o)?.uri;if(d){let h={start:{x:l+1,y:e},end:{x:u+(!c&&u===a-1?1:0),y:e}},f=!1;if(!r?.allowNonHttpProtocols)try{let p=new URL(d);["http:","https:"].includes(p.protocol)||(f=!0)}catch{f=!0}f||n.push({text:d,range:h,activate:(p,_)=>r?r.activate(p,_,h):nP(p,_),hover:(p,_)=>r?.hover?.(p,_,h),leave:(p,_)=>r?.leave?.(p,_,h)})}c=!1,s.hasExtendedAttrs()&&s.extended.urlId?(l=u,o=s.extended.urlId):(l=-1,o=-1)}}t(n)}};u0=Bt([oe(0,en),oe(1,tn),oe(2,nR)],u0);Wp=gi("CharSizeService"),Ds=gi("CoreBrowserService"),X0=gi("MouseService"),Ls=gi("RenderService"),rP=gi("SelectionService"),rR=gi("CharacterJoinerService"),lc=gi("ThemeService"),sR=gi("LinkProviderService"),sP=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?GM.isErrorNoTelemetry(e)?new GM(e.message+`
|
|
|
|
`+e.stack):new Error(e.message+`
|
|
|
|
`+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)}},aP=new sP;d0="Canceled";lP=class extends Error{constructor(){super(d0),this.name=this.message}};GM=class h0 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof h0)return t;let i=new h0;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},f0=class aR extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,aR.prototype)}};dP=class oR{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(oR.assertInvariants){if(this._prevFindLastPredicate){for(let n of this._array)if(this._prevFindLastPredicate(n)&&!t(n))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=uP(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};dP.assertInvariants=!1;(e=>{function t(s){return s<0}e.isLessThan=t;function i(s){return s<=0}e.isLessThanOrEqual=i;function n(s){return s>0}e.isGreaterThan=n;function r(s){return s===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(p0||(p0={}));fP=(e,t)=>e-t,jM=class m0{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new m0(i=>this.iterate(n=>t(n)?i(n):!0))}map(t){return new m0(i=>this.iterate(n=>i(t(n))))}some(t){let i=!1;return this.iterate(n=>(i=t(n),!i)),i}findFirst(t){let i;return this.iterate(n=>t(n)?(i=n,!1):!0),i}findLast(t){let i;return this.iterate(n=>(t(n)&&(i=n),!0)),i}findLastMaxBy(t){let i,n=!0;return this.iterate(r=>((n||p0.isGreaterThan(t(r,i)))&&(n=!1,i=r),!0)),i}};jM.empty=new jM(e=>{});cW=class{constructor(e,t){this.toKey=t,this._map=new Map,this[YM]="SetWithKey";for(let i of e)this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[(VM=Symbol.iterator,YM=Symbol.toStringTag,VM)](){return this.values()}},mP=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}};(e=>{function t(w){return w&&typeof w=="object"&&typeof w[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function n(){return i}e.empty=n;function*r(w){yield w}e.single=r;function s(w){return t(w)?w:r(w)}e.wrap=s;function a(w){return w||i}e.from=a;function*o(w){for(let k=w.length-1;k>=0;k--)yield w[k]}e.reverse=o;function l(w){return!w||w[Symbol.iterator]().next().done===!0}e.isEmpty=l;function c(w){return w[Symbol.iterator]().next().value}e.first=c;function u(w,k){let O=0;for(let N of w)if(k(N,O++))return!0;return!1}e.some=u;function d(w,k){for(let O of w)if(k(O))return O}e.find=d;function*h(w,k){for(let O of w)k(O)&&(yield O)}e.filter=h;function*f(w,k){let O=0;for(let N of w)yield k(N,O++)}e.map=f;function*p(w,k){let O=0;for(let N of w)yield*k(N,O++)}e.flatMap=p;function*_(...w){for(let k of w)yield*k}e.concat=_;function y(w,k,O){let N=O;for(let C of w)N=k(N,C);return N}e.reduce=y;function*m(w,k,O=w.length){for(k<0&&(k+=w.length),O<0?O+=w.length:O>w.length&&(O=w.length);k<O;k++)yield w[k]}e.slice=m;function v(w,k=Number.POSITIVE_INFINITY){let O=[];if(k===0)return[O,w];let N=w[Symbol.iterator]();for(let C=0;C<k;C++){let M=N.next();if(M.done)return[O,e.empty()];O.push(M.value)}return[O,{[Symbol.iterator](){return N}}]}e.consume=v;async function b(w){let k=[];for await(let O of w)k.push(O);return Promise.resolve(k)}e.asyncToArray=b})(g0||(g0={}));_P=!1,To=null,vP=class lR{constructor(){this.livingDisposables=new Map}getDisposableData(t){let i=this.livingDisposables.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:lR.idx++},this.livingDisposables.set(t,i)),i}trackDisposable(t){let i=this.getDisposableData(t);i.source||(i.source=new Error().stack)}setParent(t,i){let n=this.getDisposableData(t);n.parent=i}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,i){let n=i.get(t);if(n)return n;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),i):t;return i.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,i])=>i.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,i){let n;if(i)n=i;else{let l=new Map,c=[...this.livingDisposables.values()].filter(d=>d.source!==null&&!this.getRootParent(d,l).isSingleton);if(c.length===0)return;let u=new Set(c.map(d=>d.value));if(n=c.filter(d=>!(d.parent&&u.has(d.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function r(l){function c(d,h){for(;d.length>0&&h.some(f=>typeof f=="string"?f===d[0]:d[0].match(f));)d.shift()}let u=l.source.split(`
|
|
`).map(d=>d.trim().replace("at ","")).filter(d=>d!=="");return c(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}let s=new mP;for(let l of n){let c=r(l);for(let u=0;u<=c.length;u++)s.add(c.slice(0,u).join(`
|
|
`),l)}n.sort(hP(l=>l.idx,fP));let a="",o=0;for(let l of n.slice(0,t)){o++;let c=r(l),u=[];for(let d=0;d<c.length;d++){let h=c[d];h=`(shared with ${s.get(c.slice(0,d+1).join(`
|
|
`)).size}/${n.length} leaks) at ${h}`;let f=s.get(c.slice(0,d).join(`
|
|
`)),p=pP([...f].map(_=>r(_)[d]),_=>_);delete p[c[d]];for(let[_,y]of Object.entries(p))u.unshift(` - stacktraces of ${y.length} other leaks continue with ${_}`);u.unshift(h)}a+=`
|
|
|
|
|
|
==================== Leaking disposable ${o}/${n.length}: ${l.value.constructor.name} ====================
|
|
${u.join(`
|
|
`)}
|
|
============================================================
|
|
|
|
`}return n.length>t&&(a+=`
|
|
|
|
|
|
... and ${n.length-t} more leaking disposables
|
|
|
|
`),{leaks:n,details:a}}};vP.idx=0;if(_P){let e="__is_disposable_tracked__";bP(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==Oe.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==Oe.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}cR=class uR{constructor(){this._toDispose=new Set,this._isDisposed=!1,Kp(this)}dispose(){this._isDisposed||(Gp(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{No(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return ld(t,this),this._isDisposed?uR.DISABLE_DISPOSED_WARNING||console.warn(new 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(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),ld(t,null))}};cR.DISABLE_DISPOSED_WARNING=!1;Ma=cR,Oe=class{constructor(){this._store=new Ma,Kp(this),ld(this._store,this)}dispose(){Gp(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Oe.None=Object.freeze({dispose(){}});oc=class{constructor(){this._isDisposed=!1,Kp(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&ld(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Gp(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&ld(e,null),e}},Bn=typeof window=="object"?window:globalThis,_0=class v0{constructor(t){this.element=t,this.next=v0.Undefined,this.prev=v0.Undefined}};_0.Undefined=new _0(void 0);Rt=_0,ZM=class{constructor(){this._first=Rt.Undefined,this._last=Rt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Rt.Undefined}clear(){let e=this._first;for(;e!==Rt.Undefined;){let t=e.next;e.prev=Rt.Undefined,e.next=Rt.Undefined,e=t}this._first=Rt.Undefined,this._last=Rt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new Rt(e);if(this._first===Rt.Undefined)this._first=i,this._last=i;else if(t){let r=this._last;this._last=i,i.prev=r,r.next=i}else{let r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==Rt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Rt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Rt.Undefined&&e.next!==Rt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Rt.Undefined&&e.next===Rt.Undefined?(this._first=Rt.Undefined,this._last=Rt.Undefined):e.next===Rt.Undefined?(this._last=this._last.prev,this._last.next=Rt.Undefined):e.prev===Rt.Undefined&&(this._first=this._first.next,this._first.prev=Rt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Rt.Undefined;)yield e.element,e=e.next}},wP=globalThis.performance&&typeof globalThis.performance.now=="function",xP=class dR{static create(t){return new dR(t)}constructor(t){this._now=wP&&t===!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._stopTime-this._startTime:this._now()-this._startTime}},EP=!1,QM=!1,kP=!1;(e=>{e.None=()=>Oe.None;function t(I){if(kP){let{onDidAddListener:x}=I,H=S0.create(),T=0;I.onDidAddListener=()=>{++T===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),H.print()),x?.()}}}function i(I,x){return h(I,()=>{},0,void 0,!0,void 0,x)}e.defer=i;function n(I){return(x,H=null,T)=>{let L=!1,D;return D=I(P=>{if(!L)return D?D.dispose():L=!0,x.call(H,P)},null,T),L&&D.dispose(),D}}e.once=n;function r(I,x,H){return u((T,L=null,D)=>I(P=>T.call(L,x(P)),null,D),H)}e.map=r;function s(I,x,H){return u((T,L=null,D)=>I(P=>{x(P),T.call(L,P)},null,D),H)}e.forEach=s;function a(I,x,H){return u((T,L=null,D)=>I(P=>x(P)&&T.call(L,P),null,D),H)}e.filter=a;function o(I){return I}e.signal=o;function l(...I){return(x,H=null,T)=>{let L=SP(...I.map(D=>D(P=>x.call(H,P))));return d(L,T)}}e.any=l;function c(I,x,H,T){let L=H;return r(I,D=>(L=x(L,D),L),T)}e.reduce=c;function u(I,x){let H,T={onWillAddFirstListener(){H=I(L.fire,L)},onDidRemoveLastListener(){H?.dispose()}};x||t(T);let L=new ee(T);return x?.add(L),L.event}function d(I,x){return x instanceof Array?x.push(I):x&&x.add(I),I}function h(I,x,H=100,T=!1,L=!1,D,P){let Y,U,Z,xe=0,me,Fe={leakWarningThreshold:D,onWillAddFirstListener(){Y=I(ht=>{xe++,U=x(U,ht),T&&!Z&&(Q.fire(U),U=void 0),me=()=>{let Yt=U;U=void 0,Z=void 0,(!T||xe>1)&&Q.fire(Yt),xe=0},typeof H=="number"?(clearTimeout(Z),Z=setTimeout(me,H)):Z===void 0&&(Z=0,queueMicrotask(me))})},onWillRemoveListener(){L&&xe>0&&me?.()},onDidRemoveLastListener(){me=void 0,Y.dispose()}};P||t(Fe);let Q=new ee(Fe);return P?.add(Q),Q.event}e.debounce=h;function f(I,x=0,H){return e.debounce(I,(T,L)=>T?(T.push(L),T):[L],x,void 0,!0,void 0,H)}e.accumulate=f;function p(I,x=(T,L)=>T===L,H){let T=!0,L;return a(I,D=>{let P=T||!x(D,L);return T=!1,L=D,P},H)}e.latch=p;function _(I,x,H){return[e.filter(I,x,H),e.filter(I,T=>!x(T),H)]}e.split=_;function y(I,x=!1,H=[],T){let L=H.slice(),D=I(U=>{L?L.push(U):Y.fire(U)});T&&T.add(D);let P=()=>{L?.forEach(U=>Y.fire(U)),L=null},Y=new ee({onWillAddFirstListener(){D||(D=I(U=>Y.fire(U)),T&&T.add(D))},onDidAddFirstListener(){L&&(x?setTimeout(P):P())},onDidRemoveLastListener(){D&&D.dispose(),D=null}});return T&&T.add(Y),Y.event}e.buffer=y;function m(I,x){return(H,T,L)=>{let D=x(new b);return I(function(P){let Y=D.evaluate(P);Y!==v&&H.call(T,Y)},void 0,L)}}e.chain=m;let v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(x){return this.steps.push(x),this}forEach(x){return this.steps.push(H=>(x(H),H)),this}filter(x){return this.steps.push(H=>x(H)?H:v),this}reduce(x,H){let T=H;return this.steps.push(L=>(T=x(T,L),T)),this}latch(x=(H,T)=>H===T){let H=!0,T;return this.steps.push(L=>{let D=H||!x(L,T);return H=!1,T=L,D?L:v}),this}evaluate(x){for(let H of this.steps)if(x=H(x),x===v)break;return x}}function w(I,x,H=T=>T){let T=(...Y)=>P.fire(H(...Y)),L=()=>I.on(x,T),D=()=>I.removeListener(x,T),P=new ee({onWillAddFirstListener:L,onDidRemoveLastListener:D});return P.event}e.fromNodeEventEmitter=w;function k(I,x,H=T=>T){let T=(...Y)=>P.fire(H(...Y)),L=()=>I.addEventListener(x,T),D=()=>I.removeEventListener(x,T),P=new ee({onWillAddFirstListener:L,onDidRemoveLastListener:D});return P.event}e.fromDOMEventEmitter=k;function O(I){return new Promise(x=>n(I)(x))}e.toPromise=O;function N(I){let x=new ee;return I.then(H=>{x.fire(H)},()=>{x.fire(void 0)}).finally(()=>{x.dispose()}),x.event}e.fromPromise=N;function C(I,x){return I(H=>x.fire(H))}e.forward=C;function M(I,x,H){return x(H),I(T=>x(T))}e.runAndSubscribe=M;class z{constructor(x,H){this._observable=x,this._counter=0,this._hasChanged=!1;let T={onWillAddFirstListener:()=>{x.addObserver(this)},onDidRemoveLastListener:()=>{x.removeObserver(this)}};H||t(T),this.emitter=new ee(T),H&&H.add(this.emitter)}beginUpdate(x){this._counter++}handlePossibleChange(x){}handleChange(x,H){this._hasChanged=!0}endUpdate(x){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function q(I,x){return new z(I,x).emitter.event}e.fromObservable=q;function B(I){return(x,H,T)=>{let L=0,D=!1,P={beginUpdate(){L++},endUpdate(){L--,L===0&&(I.reportChanges(),D&&(D=!1,x.call(H)))},handlePossibleChange(){},handleChange(){D=!0}};I.addObserver(P),I.reportChanges();let Y={dispose(){I.removeObserver(P)}};return T instanceof Ma?T.add(Y):Array.isArray(T)&&T.push(Y),Y}}e.fromObservableLight=B})(mi||(mi={}));b0=class y0{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${y0._idPool++}`,y0.all.add(this)}start(t){this._stopWatch=new xP,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};b0.all=new Set,b0._idPool=0;CP=b0,JM=-1,hR=class fR{constructor(t,i,n=(fR._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[s,a]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${a}):`;console.warn(o),console.warn(s);let l=new NP(o,s);this._errorHandler(l)}return()=>{let s=this._stacks.get(t.value)||0;this._stacks.set(t.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[n,r]of this._stacks)(!t||i<r)&&(t=[n,r],i=r);return t}};hR._idPool=1;TP=hR,S0=class pR{constructor(t){this.value=t}static create(){let t=new Error;return new pR(t.stack??"")}print(){console.warn(this.value.split(`
|
|
`).slice(2).join(`
|
|
`))}},NP=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},AP=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},MP=0,Tp=class{constructor(e){this.value=e,this.id=MP++}},OP=2,RP=(e,t)=>{if(e instanceof Tp)t(e);else for(let i=0;i<e.length;i++){let n=e[i];n&&t(n)}};if(EP){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
|
|
`)),e.length=0)},3e3),Np=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}ee=class{constructor(e){this._size=0,this._options=e,this._leakageMon=JM>0||this._options?.leakWarningThreshold?new TP(e?.onListenerError??Cp,this._options?.leakWarningThreshold??JM):void 0,this._perfMon=this._options?._profName?new CP(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(QM){let e=this._listeners;queueMicrotask(()=>{RP(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??(this._event=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);let l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new AP(`${o}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||Cp)(c),Oe.None}if(this._disposed)return Oe.None;t&&(e=e.bind(t));let n=new Tp(e),r,s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=S0.create(),r=this._leakageMon.check(n.stack,this._size+1)),QM&&(n.stack=s??S0.create()),this._listeners?this._listeners instanceof Tp?(this._deliveryQueue??(this._deliveryQueue=new DP),this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=St(()=>{Np?.unregister(a),r?.(),this._removeListener(n)});if(i instanceof Ma?i.add(a):Array.isArray(i)&&i.push(a),Np){let o=new Error().stack.split(`
|
|
`).slice(2,3).join(`
|
|
`).trim(),l=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(o);Np.register(a,l?.[2]??o,a)}return 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,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let n=this._deliveryQueue.current===this;if(this._size*OP<=t.length){let r=0;for(let s=0;s<t.length;s++)t[s]?t[r++]=t[s]:n&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||Cp;if(!i){e.value(t);return}try{e.value(t)}catch(n){i(n)}}_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 Tp)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}},DP=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},w0=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ee,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ee,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};w0.INSTANCE=new w0;Z0=w0;dW=Z0.INSTANCE.onDidChangeZoomLevel;hW=Z0.INSTANCE.onDidChangeFullscreen,cc=typeof navigator=="object"?navigator.userAgent:"",x0=cc.indexOf("Firefox")>=0,Ap=cc.indexOf("AppleWebKit")>=0,Q0=cc.indexOf("Chrome")>=0,mR=!Q0&&cc.indexOf("Safari")>=0,fW=cc.indexOf("Electron/")>=0,pW=cc.indexOf("Android")>=0,Mp=!1;if(typeof Bn.matchMedia=="function"){let e=Bn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Bn.matchMedia("(display-mode: fullscreen)");Mp=e.matches,LP(Bn,e,({matches:i})=>{Mp&&t.matches||(Mp=i)})}ac="en",Ip=!1,zp=!1,rd=!1,BP=!1,gR=!1,_R=!1,PP=!1,HP=!1,UP=!1,qP=!1,Op=ac,eO=ac,Rs=globalThis;typeof Rs.vscode<"u"&&typeof Rs.vscode.process<"u"?zn=Rs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(zn=process);vR=typeof zn?.versions?.electron=="string",$P=vR&&zn?.type==="renderer";if(typeof zn=="object"){Ip=zn.platform==="win32",zp=zn.platform==="darwin",rd=zn.platform==="linux",BP=rd&&!!zn.env.SNAP&&!!zn.env.SNAP_REVISION,PP=vR,UP=!!zn.env.CI||!!zn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Sp=ac,Op=ac;let e=zn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Sp=t.userLocale,eO=t.osLocale,Op=t.resolvedLanguage||ac,FP=t.languagePack?.translationsConfigFile}catch{}gR=!0}else typeof navigator=="object"&&!$P?(Ms=navigator.userAgent,Ip=Ms.indexOf("Windows")>=0,zp=Ms.indexOf("Macintosh")>=0,HP=(Ms.indexOf("Macintosh")>=0||Ms.indexOf("iPad")>=0||Ms.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,rd=Ms.indexOf("Linux")>=0,qP=Ms?.indexOf("Mobi")>=0,_R=!0,Op=globalThis._VSCODE_NLS_LANGUAGE||ac,Sp=navigator.language.toLowerCase(),eO=Sp):console.error("Unable to resolve platform.");Gb=0;zp?Gb=1:Ip?Gb=3:rd&&(Gb=2);bR=Ip,es=zp,WP=rd,jb=gR,KP=_R&&typeof Rs.importScripts=="function",mW=KP?Rs.origin:void 0,ts=Ms,Ea=Op;(e=>{function t(){return Ea}e.value=t;function i(){return Ea.length===2?Ea==="en":Ea.length>=3?Ea[0]==="e"&&Ea[1]==="n"&&Ea[2]==="-":!1}e.isDefaultVariant=i;function n(){return Ea==="en"}e.isDefault=n})(tO||(tO={}));GP=typeof Rs.postMessage=="function"&&!Rs.importScripts,jP=(()=>{if(GP){let e=[];Rs.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let s=e[n];if(s.id===i.data.vscodeScheduleAsyncWork){e.splice(n,1),s.callback();return}}});let t=0;return i=>{let n=++t;e.push({id:n,callback:i}),Rs.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),YP=!!(ts&&ts.indexOf("Chrome")>=0),gW=!!(ts&&ts.indexOf("Firefox")>=0),_W=!!(!YP&&ts&&ts.indexOf("Safari")>=0),vW=!!(ts&&ts.indexOf("Edg/")>=0),bW=!!(ts&&ts.indexOf("Android")>=0),ka=typeof navigator=="object"?navigator:{},yW={clipboard:{writeText:jb||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(ka&&ka.clipboard&&ka.clipboard.writeText),readText:jb||!!(ka&&ka.clipboard&&ka.clipboard.readText)},keyboard:jb||zP()?0:ka.keyboard||mR?1:2,touch:"ontouchstart"in Bn||ka.maxTouchPoints>0,pointerEvents:Bn.PointerEvent&&("ontouchstart"in Bn||navigator.maxTouchPoints>0)},J0=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}},Yb=new J0,iO=new J0,nO=new J0,VP=new Array(230);(e=>{function t(o){return Yb.keyCodeToStr(o)}e.toString=t;function i(o){return Yb.strToKeyCode(o)}e.fromString=i;function n(o){return iO.keyCodeToStr(o)}e.toUserSettingsUS=n;function r(o){return nO.keyCodeToStr(o)}e.toUserSettingsGeneral=r;function s(o){return iO.strToKeyCode(o)||nO.strToKeyCode(o)}e.fromUserSettings=s;function a(o){if(o>=98&&o<=113)return null;switch(o){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Yb.keyCodeToStr(o)}e.toElectronAccelerator=a})(E0||(E0={}));XP=class yR{constructor(t,i,n,r,s){this.ctrlKey=t,this.shiftKey=i,this.altKey=n,this.metaKey=r,this.keyCode=s}equals(t){return t instanceof yR&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",n=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${t}${i}${n}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new ZP([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},ZP=class{constructor(e){if(e.length===0)throw cP("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;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}};JP=es?256:2048,eH=512,tH=1024,iH=es?2048:256,k0=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=QP(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|=JP),this.altKey&&(t|=eH),this.shiftKey&&(t|=tH),this.metaKey&&(t|=iH),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new XP(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},rO=new WeakMap;rH=class{static getSameOriginWindowChain(e){let t=rO.get(e);if(!t){t=[],rO.set(e,t);let i=e,n;do n=nH(i),n?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=n;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0,r=this.getSameOriginWindowChain(e);for(let s of r){let a=s.window.deref();if(i+=a?.scrollY??0,n+=a?.scrollX??0,a===t||!s.iframeElement)break;let o=s.iframeElement.getBoundingClientRect();i+=o.top,n+=o.left}return{top:i,left:n}}},Qu=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 i=rH.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},sO=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let n=!1;if(Q0){let r=navigator.userAgent.match(/Chrome\/(\d+)/);n=(r?parseInt(r[1]):123)<=122}if(e){let r=e,s=e,a=e.view?.devicePixelRatio||1;if(typeof r.wheelDeltaY<"u")n?this.deltaY=r.wheelDeltaY/(120*a):this.deltaY=r.wheelDeltaY/120;else if(typeof s.VERTICAL_AXIS<"u"&&s.axis===s.VERTICAL_AXIS)this.deltaY=-s.detail/3;else if(e.type==="wheel"){let o=e;o.deltaMode===o.DOM_DELTA_LINE?x0&&!es?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")mR&&bR?this.deltaX=-(r.wheelDeltaX/120):n?this.deltaX=r.wheelDeltaX/(120*a):this.deltaX=r.wheelDeltaX/120;else if(typeof s.HORIZONTAL_AXIS<"u"&&s.axis===s.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let o=e;o.deltaMode===o.DOM_DELTA_LINE?x0&&!es?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*a):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},SR=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof sH?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:mi.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:SR})})(aO||(aO={}));sH=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?SR:(this._emitter||(this._emitter=new ee),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},ey=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 f0("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new f0("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},aH=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new f0("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=i.setInterval(()=>{e()},t);this.disposable=St(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?Vb=(e,t)=>{jP(()=>{if(i)return;let n=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,n-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:Vb=(e,t,i)=>{let n=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(n))}}},oH=e=>Vb(globalThis,e)})();(e=>{async function t(n){let r,s=await Promise.all(n.map(a=>a.then(o=>o,o=>{r||(r=o)})));if(typeof r<"u")throw r;return s}e.settled=t;function i(n){return new Promise(async(r,s)=>{try{await n(r,s)}catch(a){s(a)}})}e.withAsyncBody=i})(oO||(oO={}));lO=class Qn{static fromArray(t){return new Qn(i=>{i.emitMany(t)})}static fromPromise(t){return new Qn(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Qn(async i=>{await Promise.all(t.map(async n=>i.emitOne(await n)))})}static merge(t){return new Qn(async i=>{await Promise.all(t.map(async n=>{for await(let r of n)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new ee,queueMicrotask(async()=>{let n={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(n)),this.resolve()}catch(r){this.reject(r)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await mi.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Qn(async n=>{for await(let r of t)n.emitOne(i(r))})}map(t){return Qn.map(this,t)}static filter(t,i){return new Qn(async n=>{for await(let r of t)i(r)&&n.emitOne(r)})}filter(t){return Qn.filter(this,t)}static coalesce(t){return Qn.filter(t,i=>!!i)}coalesce(){return Qn.coalesce(this)}static async toPromise(t){let i=[];for await(let n of t)i.push(n);return i}toPromise(){return Qn.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};lO.EMPTY=lO.fromArray([]);mH=class xR{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let n=this._buff,r=this._buffLen,s=this._leftoverHighSurrogate,a,o;for(s!==0?(a=s,o=-1,s=0):(a=t.charCodeAt(0),o=0);;){let l=a;if(lH(a))if(o+1<i){let c=t.charCodeAt(o+1);cO(c)?(o++,l=cH(a,c)):l=65533}else{s=a;break}else cO(a)&&(l=65533);if(r=this._push(n,r,l),o++,o<i)a=t.charCodeAt(o);else break}this._buffLen=r,this._leftoverHighSurrogate=s}_push(t,i,n){return n<128?t[i++]=n:n<2048?(t[i++]=192|(n&1984)>>>6,t[i++]=128|(n&63)>>>0):n<65536?(t[i++]=224|(n&61440)>>>12,t[i++]=128|(n&4032)>>>6,t[i++]=128|(n&63)>>>0):(t[i++]=240|(n&1835008)>>>18,t[i++]=128|(n&258048)>>>12,t[i++]=128|(n&4032)>>>6,t[i++]=128|(n&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Ku(this._h0)+Ku(this._h1)+Ku(this._h2)+Ku(this._h3)+Ku(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,uO(this._buff,this._buffLen),this._buffLen>56&&(this._step(),uO(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=xR._bigBlock32,i=this._buffDV;for(let d=0;d<64;d+=4)t.setUint32(d,i.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)t.setUint32(d,Xb(t.getUint32(d-12,!1)^t.getUint32(d-32,!1)^t.getUint32(d-56,!1)^t.getUint32(d-64,!1),1),!1);let n=this._h0,r=this._h1,s=this._h2,a=this._h3,o=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=r&s|~r&a,c=1518500249):d<40?(l=r^s^a,c=1859775393):d<60?(l=r&s|r&a|s&a,c=2400959708):(l=r^s^a,c=3395469782),u=Xb(n,5)+l+o+c+t.getUint32(d*4,!1)&4294967295,o=a,a=s,s=Xb(r,30),r=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+a&4294967295,this._h4=this._h4+o&4294967295}};mH._bigBlock32=new DataView(new ArrayBuffer(320));({registerWindow:SW,getWindow:wr,getDocument:wW,getWindows:xW,getWindowsCount:EW,getWindowId:dO,getWindowById:kW,hasWindow:CW,onDidRegisterWindow:gH,onWillUnregisterWindow:TW,onDidUnregisterWindow:NW}=(function(){let e=new Map,t={window:Bn,disposables:new Ma};e.set(Bn.vscodeWindowId,t);let i=new ee,n=new ee,r=new ee;function s(a,o){return(typeof a=="number"?e.get(a):void 0)??(o?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:n.event,registerWindow(a){if(e.has(a.vscodeWindowId))return Oe.None;let o=new Ma,l={window:a,disposables:o.add(new Ma)};return e.set(a.vscodeWindowId,l),o.add(St(()=>{e.delete(a.vscodeWindowId),n.fire(a)})),o.add(Ee(a,di.BEFORE_UNLOAD,()=>{r.fire(a)})),i.fire(l),o},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return e.has(a)},getWindowById:s,getWindow(a){let o=a;if(o?.ownerDocument?.defaultView)return o.ownerDocument.defaultView.window;let l=a;return l?.view?l.view.window:Bn},getDocument(a){return wr(a).document}}})()),_H=class{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!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,this._handler=null)}};hO=function(e,t,i,n){let r=i;return t==="click"||t==="mousedown"||t==="contextmenu"?r=vH(wr(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=bH(i)),Ee(e,t,r,n)},SH=class extends aH{constructor(e){super(),this.defaultTarget=e&&wr(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},Zb=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){Cp(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,n=new Map,r=s=>{i.set(s,!1);let a=e.get(s)??[];for(t.set(s,a),e.set(s,[]),n.set(s,!0);a.length>0;)a.sort(Zb.sort),a.shift().execute();n.set(s,!1)};Bp=(s,a,o=0)=>{let l=dO(s),c=new Zb(a,o),u=e.get(l);return u||(u=[],e.set(l,u)),u.push(c),i.get(l)||(i.set(l,!0),s.requestAnimationFrame(()=>r(l))),c},yH=(s,a,o)=>{let l=dO(s);if(n.get(l)){let c=new Zb(a,o),u=t.get(l);return u||(u=[],t.set(l,u)),u.push(c),c}else return Bp(s,a,o)}})();fO=class Rp{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new Rp(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof Rp?t:new Rp(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};fO.None=new fO(0,0);AW=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let n=this.mutationObservers.get(e);n||(n=new Map,this.mutationObservers.set(e,n));let r=uH(i),s=n.get(r);if(s)s.users+=1;else{let a=new ee,o=new MutationObserver(c=>a.fire(c));o.observe(e,i);let l=s={users:1,observer:o,onDidMutate:a.event};t.add(St(()=>{l.users-=1,l.users===0&&(a.dispose(),o.disconnect(),n?.delete(r),n?.size===0&&this.mutationObservers.delete(e))})),n.set(r,s)}return s.onDidMutate}},di={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:Ap?"webkitAnimationStart":"animationstart",ANIMATION_END:Ap?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Ap?"webkitAnimationIteration":"animationiteration"},xH=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;EH.SVG=function(e,t,...i){return ER("http://www.w3.org/2000/svg",e,t,...i)};kH=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=mn(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=mn(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=mn(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=mn(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=mn(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=mn(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=mn(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=mn(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=mn(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=mn(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=mn(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=mn(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=mn(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=mn(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)}};kR=class{constructor(){this._hooks=new Ma,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 i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=r;let s=e;try{e.setPointerCapture(t),this._hooks.add(St(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=wr(e)}this._hooks.add(Ee(s,di.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(Ee(s,di.POINTER_UP,a=>this.stopMonitoring(!0)))}};(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Sr||(Sr={}));Ju=class Fi extends Oe{constructor(){super(),this.dispatched=!1,this.targets=new ZM,this.ignoreTargets=new ZM,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(mi.runAndSubscribe(gH,({window:t,disposables:i})=>{i.add(Ee(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),i.add(Ee(t.document,"touchend",n=>this.onTouchEnd(t,n))),i.add(Ee(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:Bn,disposables:this._store}))}static addTarget(t){if(!Fi.isTouchDevice())return Oe.None;Fi.INSTANCE||(Fi.INSTANCE=XM(new Fi));let i=Fi.INSTANCE.targets.push(t);return St(i)}static ignoreTarget(t){if(!Fi.isTouchDevice())return Oe.None;Fi.INSTANCE||(Fi.INSTANCE=XM(new Fi));let i=Fi.INSTANCE.ignoreTargets.push(t);return St(i)}static isTouchDevice(){return"ontouchstart"in Bn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,r=t.targetTouches.length;n<r;n++){let s=t.targetTouches.item(n);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:i,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[i],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};let a=this.newGestureEvent(Sr.Start,s.target);a.pageX=s.pageX,a.pageY=s.pageY,this.dispatchEvent(a)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let n=Date.now(),r=Object.keys(this.activeTouches).length;for(let s=0,a=i.changedTouches.length;s<a;s++){let o=i.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("move of an UNKNOWN touch",o);continue}let l=this.activeTouches[o.identifier],c=Date.now()-l.initialTimeStamp;if(c<Fi.HOLD_DELAY&&Math.abs(l.initialPageX-Ln(l.rollingPageX))<30&&Math.abs(l.initialPageY-Ln(l.rollingPageY))<30){let u=this.newGestureEvent(Sr.Tap,l.initialTarget);u.pageX=Ln(l.rollingPageX),u.pageY=Ln(l.rollingPageY),this.dispatchEvent(u)}else if(c>=Fi.HOLD_DELAY&&Math.abs(l.initialPageX-Ln(l.rollingPageX))<30&&Math.abs(l.initialPageY-Ln(l.rollingPageY))<30){let u=this.newGestureEvent(Sr.Contextmenu,l.initialTarget);u.pageX=Ln(l.rollingPageX),u.pageY=Ln(l.rollingPageY),this.dispatchEvent(u)}else if(r===1){let u=Ln(l.rollingPageX),d=Ln(l.rollingPageY),h=Ln(l.rollingTimestamps)-l.rollingTimestamps[0],f=u-l.rollingPageX[0],p=d-l.rollingPageY[0],_=[...this.targets].filter(y=>l.initialTarget instanceof Node&&y.contains(l.initialTarget));this.inertia(t,_,n,Math.abs(f)/h,f>0?1:-1,u,Math.abs(p)/h,p>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Sr.End,l.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=i,n.tapCount=0,n}dispatchEvent(t){if(t.type===Sr.Tap){let i=new Date().getTime(),n=0;i-this._lastSetTapCountTime>Fi.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=i,t.tapCount=n}else(t.type===Sr.Change||t.type===Sr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let i=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,s=t.initialTarget;for(;s&&s!==n;)r++,s=s.parentElement;i.push([r,n])}i.sort((n,r)=>n[0]-r[0]);for(let[n,r]of i)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,n,r,s,a,o,l,c){this.handle=Bp(t,()=>{let u=Date.now(),d=u-n,h=0,f=0,p=!0;r+=Fi.SCROLL_FRICTION*d,o+=Fi.SCROLL_FRICTION*d,r>0&&(p=!1,h=s*r*d),o>0&&(p=!1,f=l*o*d);let _=this.newGestureEvent(Sr.Change);_.translationX=h,_.translationY=f,i.forEach(y=>y.dispatchEvent(_)),p||this.inertia(t,i,u,r,s,a+h,o,l,c+f)})}onTouchMove(t){let i=Date.now();for(let n=0,r=t.changedTouches.length;n<r;n++){let s=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}let a=this.activeTouches[s.identifier],o=this.newGestureEvent(Sr.Change,a.initialTarget);o.translationX=s.pageX-Ln(a.rollingPageX),o.translationY=s.pageY-Ln(a.rollingPageY),o.pageX=s.pageX,o.pageY=s.pageY,this.dispatchEvent(o),a.rollingPageX.length>3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(s.pageX),a.rollingPageY.push(s.pageY),a.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Ju.SCROLL_FRICTION=-.005,Ju.HOLD_DELAY=700,Ju.CLEAR_TAP_COUNT_TIME=400,Bt([CH],Ju,"isTouchDevice",1);TH=Ju,iy=class extends Oe{onclick(e,t){this._register(Ee(e,di.CLICK,i=>t(new Qu(wr(e),i))))}onmousedown(e,t){this._register(Ee(e,di.MOUSE_DOWN,i=>t(new Qu(wr(e),i))))}onmouseover(e,t){this._register(Ee(e,di.MOUSE_OVER,i=>t(new Qu(wr(e),i))))}onmouseleave(e,t){this._register(Ee(e,di.MOUSE_LEAVE,i=>t(new Qu(wr(e),i))))}onkeydown(e,t){this._register(Ee(e,di.KEY_DOWN,i=>t(new k0(i))))}onkeyup(e,t){this._register(Ee(e,di.KEY_UP,i=>t(new k0(i))))}oninput(e,t){this._register(Ee(e,di.INPUT,t))}onblur(e,t){this._register(Ee(e,di.BLUR,t))}onfocus(e,t){this._register(Ee(e,di.FOCUS,t))}onchange(e,t){this._register(Ee(e,di.CHANGE,t))}ignoreGesture(e){return TH.ignoreTarget(e)}},pO=11,NH=class extends iy{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=pO+"px",this.domNode.style.height=pO+"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 kR),this._register(hO(this.bgDomNode,di.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(hO(this.domNode,di.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new SH),this._pointerdownScheduleRepeatTimer=this._register(new ey)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,wr(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},AH=class C0{constructor(t,i,n,r,s,a,o){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,n=n|0,r=r|0,s=s|0,a=a|0,o=o|0),this.rawScrollLeft=r,this.rawScrollTop=o,i<0&&(i=0),r+i>n&&(r=n-i),r<0&&(r=0),s<0&&(s=0),o+s>a&&(o=a-s),o<0&&(o=0),this.width=i,this.scrollWidth=n,this.scrollLeft=r,this.height=s,this.scrollHeight=a,this.scrollTop=o}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new C0(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new C0(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(t,i){let n=this.width!==t.width,r=this.scrollWidth!==t.scrollWidth,s=this.scrollLeft!==t.scrollLeft,a=this.height!==t.height,o=this.scrollHeight!==t.scrollHeight,l=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:s,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:l}}},MH=class extends Oe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ee),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new AH(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!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(),this._smoothScrolling=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 i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;t?n=new gO(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=gO.start(this._state,i,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 i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},mO=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};gO=class T0{constructor(t,i,n,r){this.from=t,this.to=i,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(t,i,n){if(Math.abs(t-i)>2.5*n){let r,s;return t<i?(r=t+.75*n,s=i-.75*n):(r=t-.75*n,s=i+.75*n),OH(Qb(t,r),Qb(s,i),.33)}return Qb(t,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let i=(t-this.startTime)/this.duration;if(i<1){let n=this.scrollLeft(i),r=this.scrollTop(i);return new mO(n,r,!1)}return new mO(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,n){return T0.start(t,i,n)}static start(t,i,n){n=n+10;let r=Date.now()-10;return new T0(t,i,r,n)}};LH=class extends Oe{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new ey)}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?!0: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":"")))}},IH=140,CR=class extends iy{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 LH(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new kR),this._shouldRender=!0,this.domNode=sd(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(Ee(this.domNode.domNode,di.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new NH(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=sd(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ee(this.slider.domNode,di.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.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,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let r=wH(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}let n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let s=this._sliderOrthogonalPointerPosition(r),a=Math.abs(s-i);if(bR&&a>IH){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let o=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(n.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()}},TR=class N0{constructor(t,i,n,r,s,a){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=r,this._scrollSize=s,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new N0(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,n,r,s){let a=Math.max(0,n-t),o=Math.max(0,a-2*i),l=r>0&&r>n;if(!l)return{computedAvailableSize:Math.round(a),computedIsNeeded:l,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),u=(o-c)/(r-n),d=s*u;return{computedAvailableSize:Math.round(a),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){let t=N0._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(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,n=this._scrollPosition;return i<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},zH=class extends CR{constructor(e,t,i){let n=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new TR(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,r.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new 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}},BH=class extends CR{constructor(e,t,i){let n=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new TR(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new 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}},PH=500,_O=50,vO=!0,HH=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},A0=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,i=0,n=1,r=this._rear;do{let s=r===this._front?t:Math.pow(2,-n);if(t-=s,i+=this._memory[r].score*s,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(Q0){let i=wr(t.browserEvent),n=IP(i);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,n){let r=null,s=new HH(t,i,n);this._front===-1&&this._rear===-1?(this._memory[0]=s,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]=s),s.score=this._computeScore(s,r)}_computeScore(t,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),i){let r=Math.abs(t.deltaX),s=Math.abs(t.deltaY),a=Math.abs(i.deltaX),o=Math.abs(i.deltaY),l=Math.max(Math.min(r,a),1),c=Math.max(Math.min(s,o),1),u=Math.max(r,a),d=Math.max(s,o);u%l===0&&d%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};A0.INSTANCE=new A0;UH=A0,qH=class extends iy{constructor(e,t,i){super(),this._onScroll=this._register(new ee),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ee),this.onWillScroll=this._onWillScroll.event,this._options=$H(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let n={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new BH(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new zH(this._scrollable,this._options,n)),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=sd(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=sd(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=sd(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,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new ey),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=No(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,es&&(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 sO(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=No(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new sO(i))};this._mouseWheelToDispose.push(Ee(this._listenOnDomNode,di.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=UH.INSTANCE;vO&&t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,s=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&s+r===0?s=r=0:Math.abs(r)>=Math.abs(s)?s=0:r=0),this._options.flipAxes&&([r,s]=[s,r]);let a=!es&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!s&&(s=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(s=s*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),l={};if(r){let c=_O*r,u=o.scrollTop-(c<0?Math.floor(c):Math.ceil(c));this._verticalScrollbar.writeScrollPosition(l,u)}if(s){let c=_O*s,u=o.scrollLeft-(c<0?Math.floor(c):Math.ceil(c));this._horizontalScrollbar.writeScrollPosition(l,u)}l=this._scrollable.validateScrollPosition(l),(o.scrollLeft!==l.scrollLeft||o.scrollTop!==l.scrollTop)&&(vO&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(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 new 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,i=e.scrollLeft>0,n=i?" left":"",r=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${r}${n}`)}}_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(),PH)}},FH=class extends qH{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};M0=class extends Oe{constructor(e,t,i,n,r,s,a,o){super(),this._bufferService=i,this._optionsService=a,this._renderService=o,this._onRequestScrollLines=this._register(new ee),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let l=this._register(new MH({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>Bp(n.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{l.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new FH(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},l)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(mi.runAndSubscribe(s.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=s.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(St(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(St(()=>this._styleElement.remove())),this._register(mi.runAndSubscribe(s.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${s.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${s.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${s.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
`)})),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(c=>this._handleScroll(c)))}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),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};M0=Bt([oe(2,en),oe(3,Ds),oe(4,tR),oe(5,lc),oe(6,tn),oe(7,Ls)],M0);O0=class extends Oe{constructor(e,t,i,n,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=n,this._renderService=r,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(s=>this._removeDecoration(s))),this._register(St(()=>{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 i=e.options.x??0;return i&&i>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 i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};O0=Bt([oe(1,en),oe(2,Ds),oe(3,fd),oe(4,Ls)],O0);WH=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,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Qr={full:0,left:0,center:0,right:0},Ca={full:0,left:0,center:0,right:0},Gu={full:0,left:0,center:0,right:0},Pp=class extends Oe{constructor(e,t,i,n,r,s,a,o){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=n,this._renderService=r,this._optionsService=s,this._themeService=a,this._coreBrowserService=o,this._colorZoneStore=new WH,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(St(()=>this._canvas?.remove()));let l=this._canvas.getContext("2d");if(l)this._ctx=l;else throw new 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);Ca.full=this._canvas.width,Ca.left=e,Ca.center=t,Ca.right=e,this._refreshDrawHeightConstants(),Gu.full=1,Gu.left=1,Gu.center=1+Ca.left,Gu.right=1+Ca.left+Ca.center}_refreshDrawHeightConstants(){Qr.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);Qr.left=t,Qr.center=t,Qr.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Qr.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 t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);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(Gu[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Qr[e.position||"full"]/2),Ca[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Qr[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}))}};Pp=Bt([oe(2,en),oe(3,fd),oe(4,Ls),oe(5,tn),oe(6,lc),oe(7,Ds)],Pp);(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=`
|
|
`,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="\x7F"))(W||(W={}));(e=>(e.PAD="\x80",e.HOP="\x81",e.BPH="\x82",e.NBH="\x83",e.IND="\x84",e.NEL="\x85",e.SSA="\x86",e.ESA="\x87",e.HTS="\x88",e.HTJ="\x89",e.VTS="\x8A",e.PLD="\x8B",e.PLU="\x8C",e.RI="\x8D",e.SS2="\x8E",e.SS3="\x8F",e.DCS="\x90",e.PU1="\x91",e.PU2="\x92",e.STS="\x93",e.CCH="\x94",e.MW="\x95",e.SPA="\x96",e.EPA="\x97",e.SOS="\x98",e.SGCI="\x99",e.SCI="\x9A",e.CSI="\x9B",e.ST="\x9C",e.OSC="\x9D",e.PM="\x9E",e.APC="\x9F"))(ad||(ad={}));(e=>e.ST=`${W.ESC}\\`)(R0||(R0={}));D0=class{constructor(e,t,i,n,r,s){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=n,this._coreService=r,this._renderService=s,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):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${W.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 t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let s=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};D0=Bt([oe(2,en),oe(3,tn),oe(4,Mo),oe(5,Ls)],D0);hi=0,fi=0,pi=0,zt=0,bO={css:"#00000000",rgba:0};(e=>{function t(r,s,a,o){return o!==void 0?`#${xo(r)}${xo(s)}${xo(a)}${xo(o)}`:`#${xo(r)}${xo(s)}${xo(a)}`}e.toCss=t;function i(r,s,a,o=255){return(r<<24|s<<16|a<<8|o)>>>0}e.toRgba=i;function n(r,s,a,o){return{css:e.toCss(r,s,a,o),rgba:e.toRgba(r,s,a,o)}}e.toColor=n})(Ft||(Ft={}));(e=>{function t(l,c){if(zt=(c.rgba&255)/255,zt===1)return{css:c.css,rgba:c.rgba};let u=c.rgba>>24&255,d=c.rgba>>16&255,h=c.rgba>>8&255,f=l.rgba>>24&255,p=l.rgba>>16&255,_=l.rgba>>8&255;hi=f+Math.round((u-f)*zt),fi=p+Math.round((d-p)*zt),pi=_+Math.round((h-_)*zt);let y=Ft.toCss(hi,fi,pi),m=Ft.toRgba(hi,fi,pi);return{css:y,rgba:m}}e.blend=t;function i(l){return(l.rgba&255)===255}e.isOpaque=i;function n(l,c,u){let d=od.ensureContrastRatio(l.rgba,c.rgba,u);if(d)return Ft.toColor(d>>24&255,d>>16&255,d>>8&255)}e.ensureContrastRatio=n;function r(l){let c=(l.rgba|255)>>>0;return[hi,fi,pi]=od.toChannels(c),{css:Ft.toCss(hi,fi,pi),rgba:c}}e.opaque=r;function s(l,c){return zt=Math.round(c*255),[hi,fi,pi]=od.toChannels(l.rgba),{css:Ft.toCss(hi,fi,pi,zt),rgba:Ft.toRgba(hi,fi,pi,zt)}}e.opacity=s;function a(l,c){return zt=l.rgba&255,s(l,zt*c/255)}e.multiplyOpacity=a;function o(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}e.toColorRGB=o})(yt||(yt={}));(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let s=r.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function n(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return hi=parseInt(r.slice(1,2).repeat(2),16),fi=parseInt(r.slice(2,3).repeat(2),16),pi=parseInt(r.slice(3,4).repeat(2),16),Ft.toColor(hi,fi,pi);case 5:return hi=parseInt(r.slice(1,2).repeat(2),16),fi=parseInt(r.slice(2,3).repeat(2),16),pi=parseInt(r.slice(3,4).repeat(2),16),zt=parseInt(r.slice(4,5).repeat(2),16),Ft.toColor(hi,fi,pi,zt);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let s=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return hi=parseInt(s[1]),fi=parseInt(s[2]),pi=parseInt(s[3]),zt=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),Ft.toColor(hi,fi,pi,zt);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[hi,fi,pi,zt]=t.getImageData(0,0,1,1).data,zt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ft.toRgba(hi,fi,pi,zt),css:r}}e.toColor=n})(At||(At={}));(e=>{function t(n){return i(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function i(n,r,s){let a=n/255,o=r/255,l=s/255,c=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4);return c*.2126+u*.7152+d*.0722}e.relativeLuminance2=i})($i||($i={}));(e=>{function t(a,o){if(zt=(o&255)/255,zt===1)return o;let l=o>>24&255,c=o>>16&255,u=o>>8&255,d=a>>24&255,h=a>>16&255,f=a>>8&255;return hi=d+Math.round((l-d)*zt),fi=h+Math.round((c-h)*zt),pi=f+Math.round((u-f)*zt),Ft.toRgba(hi,fi,pi)}e.blend=t;function i(a,o,l){let c=$i.relativeLuminance(a>>8),u=$i.relativeLuminance(o>>8);if(As(c,u)<l){if(u<c){let f=n(a,o,l),p=As(c,$i.relativeLuminance(f>>8));if(p<l){let _=r(a,o,l),y=As(c,$i.relativeLuminance(_>>8));return p>y?f:_}return f}let d=r(a,o,l),h=As(c,$i.relativeLuminance(d>>8));if(h<l){let f=n(a,o,l),p=As(c,$i.relativeLuminance(f>>8));return h>p?d:f}return d}}e.ensureContrastRatio=i;function n(a,o,l){let c=a>>24&255,u=a>>16&255,d=a>>8&255,h=o>>24&255,f=o>>16&255,p=o>>8&255,_=As($i.relativeLuminance2(h,f,p),$i.relativeLuminance2(c,u,d));for(;_<l&&(h>0||f>0||p>0);)h-=Math.max(0,Math.ceil(h*.1)),f-=Math.max(0,Math.ceil(f*.1)),p-=Math.max(0,Math.ceil(p*.1)),_=As($i.relativeLuminance2(h,f,p),$i.relativeLuminance2(c,u,d));return(h<<24|f<<16|p<<8|255)>>>0}e.reduceLuminance=n;function r(a,o,l){let c=a>>24&255,u=a>>16&255,d=a>>8&255,h=o>>24&255,f=o>>16&255,p=o>>8&255,_=As($i.relativeLuminance2(h,f,p),$i.relativeLuminance2(c,u,d));for(;_<l&&(h<255||f<255||p<255);)h=Math.min(255,h+Math.ceil((255-h)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),p=Math.min(255,p+Math.ceil((255-p)*.1)),_=As($i.relativeLuminance2(h,f,p),$i.relativeLuminance2(c,u,d));return(h<<24|f<<16|p<<8|255)>>>0}e.increaseLuminance=r;function s(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=s})(od||(od={}));KH=class extends hd{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Hp=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new er}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 i=[],n=t.translateToString(!0),r=0,s=0,a=0,o=t.getFg(0),l=t.getBg(0);for(let c=0;c<t.getTrimmedLength();c++)if(t.loadCell(c,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==o||this._workCell.bg!==l){if(c-r>1){let u=this._getJoinedRanges(n,a,s,t,r);for(let d=0;d<u.length;d++)i.push(u[d])}r=c,a=s,o=this._workCell.fg,l=this._workCell.bg}s+=this._workCell.getChars().length||Aa.length}if(this._bufferService.cols-r>1){let c=this._getJoinedRanges(n,a,s,t,r);for(let u=0;u<c.length;u++)i.push(c[u])}return i}_getJoinedRanges(e,t,i,n,r){let s=e.substring(t,i),a=[];try{a=this._characterJoiners[0].handler(s)}catch(o){console.error(o)}for(let o=1;o<this._characterJoiners.length;o++)try{let l=this._characterJoiners[o].handler(s);for(let c=0;c<l.length;c++)Hp._mergeRanges(a,l[c])}catch(l){console.error(l)}return this._stringRangesToCellRanges(a,n,r),a}_stringRangesToCellRanges(e,t,i){let n=0,r=!1,s=0,a=e[n];if(a){for(let o=i;o<this._bufferService.cols;o++){let l=t.getWidth(o),c=t.getString(o).length||Aa.length;if(l!==0){if(!r&&a[0]<=s&&(a[0]=o,r=!0),a[1]<=s){if(a[1]=o,a=e[++n],!a)break;a[0]<=s?(a[0]=o,r=!0):r=!1}s+=c}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let n=0;n<e.length;n++){let r=e[n];if(i){if(t[1]<=r[0])return e[n-1][1]=t[1],e;if(t[1]<=r[1])return e[n-1][1]=Math.max(t[1],r[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=r[0])return e.splice(n,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};Hp=Bt([oe(0,en)],Hp);L0=class{constructor(e,t,i,n,r,s,a){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=n,this._coreService=r,this._decorationService=s,this._themeService=a,this._workCell=new er,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,n,r,s,a,o,l,c,u){let d=[],h=this._characterJoinerService.getJoinedCharacters(t),f=this._themeService.colors,p=e.getNoBgTrimmedLength();i&&p<s+1&&(p=s+1);let _,y=0,m="",v=0,b=0,w=0,k=0,O=!1,N=0,C=!1,M=0,z=0,q=[],B=c!==-1&&u!==-1;for(let I=0;I<p;I++){e.loadCell(I,this._workCell);let x=this._workCell.getWidth();if(x===0)continue;let H=!1,T=I>=z,L=I,D=this._workCell;if(h.length>0&&I===h[0][0]&&T){let ke=h.shift(),Di=this._isCellInSelection(ke[0],t);for(v=ke[0]+1;v<ke[1];v++)T&&(T=Di===this._isCellInSelection(v,t));T&&(T=!i||s<ke[0]||s>=ke[1]),T?(H=!0,D=new KH(this._workCell,e.translateToString(!0,ke[0],ke[1]),ke[1]-ke[0]),L=ke[1]-1,x=D.getWidth()):z=ke[1]}let P=this._isCellInSelection(I,t),Y=i&&I===s,U=B&&I>=c&&I<=u,Z=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,ke=>{Z=!0});let xe=D.getChars()||Aa;if(xe===" "&&(D.isUnderline()||D.isOverline())&&(xe="\xA0"),M=x*o-l.get(xe,D.isBold(),D.isItalic()),!_)_=this._document.createElement("span");else if(y&&(P&&C||!P&&!C&&D.bg===b)&&(P&&C&&f.selectionForeground||D.fg===w)&&D.extended.ext===k&&U===O&&M===N&&!Y&&!H&&!Z&&T){D.isInvisible()?m+=Aa:m+=xe,y++;continue}else y&&(_.textContent=m),_=this._document.createElement("span"),y=0,m="";if(b=D.bg,w=D.fg,k=D.extended.ext,O=U,N=M,C=P,H&&s>=I&&s<=L&&(s=I),!this._coreService.isCursorHidden&&Y&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&q.push("xterm-cursor-blink"),q.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline");break;default:break}}if(D.isBold()&&q.push("xterm-bold"),D.isItalic()&&q.push("xterm-italic"),D.isDim()&&q.push("xterm-dim"),D.isInvisible()?m=Aa:m=D.getChars()||Aa,D.isUnderline()&&(q.push(`xterm-underline-${D.extended.underlineStyle}`),m===" "&&(m="\xA0"),!D.isUnderlineColorDefault()))if(D.isUnderlineColorRGB())_.style.textDecorationColor=`rgb(${hd.toColorRGB(D.getUnderlineColor()).join(",")})`;else{let ke=D.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&D.isBold()&&ke<8&&(ke+=8),_.style.textDecorationColor=f.ansi[ke].css}D.isOverline()&&(q.push("xterm-overline"),m===" "&&(m="\xA0")),D.isStrikethrough()&&q.push("xterm-strikethrough"),U&&(_.style.textDecoration="underline");let me=D.getFgColor(),Fe=D.getFgColorMode(),Q=D.getBgColor(),ht=D.getBgColorMode(),Yt=!!D.isInverse();if(Yt){let ke=me;me=Q,Q=ke;let Di=Fe;Fe=ht,ht=Di}let Vt,gn,Ri=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,ke=>{ke.options.layer!=="top"&&Ri||(ke.backgroundColorRGB&&(ht=50331648,Q=ke.backgroundColorRGB.rgba>>8&16777215,Vt=ke.backgroundColorRGB),ke.foregroundColorRGB&&(Fe=50331648,me=ke.foregroundColorRGB.rgba>>8&16777215,gn=ke.foregroundColorRGB),Ri=ke.options.layer==="top")}),!Ri&&P&&(Vt=this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque,Q=Vt.rgba>>8&16777215,ht=50331648,Ri=!0,f.selectionForeground&&(Fe=50331648,me=f.selectionForeground.rgba>>8&16777215,gn=f.selectionForeground)),Ri&&q.push("xterm-decoration-top");let Pt;switch(ht){case 16777216:case 33554432:Pt=f.ansi[Q],q.push(`xterm-bg-${Q}`);break;case 50331648:Pt=Ft.toColor(Q>>16,Q>>8&255,Q&255),this._addStyle(_,`background-color:#${yO((Q>>>0).toString(16),"0",6)}`);break;default:Yt?(Pt=f.foreground,q.push("xterm-bg-257")):Pt=f.background}switch(Vt||D.isDim()&&(Vt=yt.multiplyOpacity(Pt,.5)),Fe){case 16777216:case 33554432:D.isBold()&&me<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(me+=8),this._applyMinimumContrast(_,Pt,f.ansi[me],D,Vt,void 0)||q.push(`xterm-fg-${me}`);break;case 50331648:let ke=Ft.toColor(me>>16&255,me>>8&255,me&255);this._applyMinimumContrast(_,Pt,ke,D,Vt,gn)||this._addStyle(_,`color:#${yO(me.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(_,Pt,f.foreground,D,Vt,gn)||Yt&&q.push("xterm-fg-257")}q.length&&(_.className=q.join(" "),q.length=0),!Y&&!H&&!Z&&T?y++:_.textContent=m,M!==this.defaultSpacing&&(_.style.letterSpacing=`${M}px`),d.push(_),I=L}return _&&y&&(_.textContent=m),d}_applyMinimumContrast(e,t,i,n,r,s){if(this._optionsService.rawOptions.minimumContrastRatio===1||YH(n.getCode()))return!1;let a=this._getContrastCache(n),o;if(!r&&!s&&(o=a.getColor(t.rgba,i.rgba)),o===void 0){let l=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);o=yt.ensureContrastRatio(r||t,s||i,l),a.setColor((r||t).rgba,(s||i).rgba,o??null)}return o?(this._addStyle(e,`color:${o.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 i=this._selectionStart,n=this._selectionEnd;return!i||!n?!1:this._columnSelectMode?i[0]<=n[0]?e>=i[0]&&t>=i[1]&&e<n[0]&&t<=n[1]:e<i[0]&&t>=i[1]&&e>=n[0]&&t<=n[1]:t>i[1]&&t<n[1]||i[1]===n[1]&&t===i[1]&&e>=i[0]&&e<n[0]||i[1]<n[1]&&t===n[1]&&e<n[0]||i[1]<n[1]&&t===i[1]&&e>=i[0]}};L0=Bt([oe(1,rR),oe(2,tn),oe(3,Ds),oe(4,Mo),oe(5,fd),oe(6,lc)],L0);XH=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 i=e.createElement("span");i.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold",s.style.fontStyle="italic",this._measureElements=[i,n,r,s],this._container.appendChild(i),this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),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,i,n){e===this._font&&t===this._fontSize&&i===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,i){let n=0;if(!t&&!i&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let a=this._measure(e,0);return a>0&&(this._flat[n]=a),a}let r=e;t&&(r+="B"),i&&(r+="I");let s=this._holey.get(r);if(s===void 0){let a=0;t&&(a|=1),i&&(a|=2),s=this._measure(e,a),s>0&&this._holey.set(r,s)}return s}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},ZH=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,i,n=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,s=t[1]-r,a=i[1]-r,o=Math.max(s,0),l=Math.min(a,e.rows-1);if(o>=e.rows||l<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=s,this.viewportEndRow=a,this.viewportCappedStartRow=o,this.viewportCappedEndRow=l,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};Jb="xterm-dom-renderer-owner-",Zn="xterm-rows",xp="xterm-fg-",SO="xterm-bg-",ju="xterm-focus",Ep="xterm-selection",JH=1,I0=class extends Oe{constructor(e,t,i,n,r,s,a,o,l,c,u,d,h,f){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=n,this._viewportElement=r,this._helperContainer=s,this._linkifier2=a,this._charSizeService=l,this._optionsService=c,this._bufferService=u,this._coreService=d,this._coreBrowserService=h,this._themeService=f,this._terminalClass=JH++,this._rowElements=[],this._selectionRenderModel=QH(),this.onRequestRedraw=this._register(new ee).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Zn),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(Ep),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=VH(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(p=>this._injectCss(p))),this._injectCss(this._themeService.colors),this._rowFactory=o.createInstance(L0,document),this._element.classList.add(Jb+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(p=>this._handleLinkHover(p))),this._register(this._linkifier2.onHideLinkUnderline(p=>this._handleLinkLeave(p))),this._register(St(()=>{this._element.classList.remove(Jb+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new XH(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 i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Zn} 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} .${Zn} { 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} .${Zn} .xterm-dim { color: ${yt.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 i=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Zn}.${ju} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Zn}.${ju} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Zn}.${ju} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Zn} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Zn} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Zn} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Zn} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Zn} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Ep} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ep} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ep} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[s,a]of e.ansi.entries())t+=`${this._terminalSelector} .${xp}${s} { color: ${a.css}; }${this._terminalSelector} .${xp}${s}.xterm-dim { color: ${yt.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${SO}${s} { background-color: ${a.css}; }`;t+=`${this._terminalSelector} .${xp}257 { color: ${yt.opaque(e.background).css}; }${this._terminalSelector} .${xp}257.xterm-dim { color: ${yt.multiplyOpacity(yt.opaque(e.background),.5).css}; }${this._terminalSelector} .${SO}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 i=this._rowElements.length;i<=t;i++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}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(ju),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ju),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,s=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,o=this._document.createDocumentFragment();if(i){let l=e[0]>t[0];o.appendChild(this._createSelectionElement(s,l?t[0]:e[0],l?e[0]:t[0],a-s+1))}else{let l=n===s?e[0]:0,c=s===r?t[0]:this._bufferService.cols;o.appendChild(this._createSelectionElement(s,l,c));let u=a-s-1;if(o.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,u)),s!==a){let d=r===a?t[0]:this._bufferService.cols;o.appendChild(this._createSelectionElement(a,0,d))}}this._selectionContainer.appendChild(o)}_createSelectionElement(e,t,i,n=1){let r=this._document.createElement("div"),s=t*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(i-t);return s+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-s),r.style.height=`${n*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${s}px`,r.style.width=`${a}px`,r}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 i=this._bufferService.buffer,n=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),s=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,o=this._optionsService.rawOptions.cursorInactiveStyle;for(let l=e;l<=t;l++){let c=l+i.ydisp,u=this._rowElements[l],d=i.lines.get(c);if(!u||!d)break;u.replaceChildren(...this._rowFactory.createRow(d,c,c===n,a,o,r,s,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Jb}${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,i,n,r,s){i<0&&(e=0),n<0&&(t=0);let a=this._bufferService.rows-1;i=Math.max(Math.min(i,a),0),n=Math.max(Math.min(n,a),0),r=Math.min(r,this._bufferService.cols);let o=this._bufferService.buffer,l=o.ybase+o.y,c=Math.min(o.x,r-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=i;f<=n;++f){let p=f+o.ydisp,_=this._rowElements[f],y=o.lines.get(p);if(!_||!y)break;_.replaceChildren(...this._rowFactory.createRow(y,p,p===l,d,h,c,u,this.dimensions.css.cell.width,this._widthCache,s?f===i?e:0:-1,s?(f===n?t:r)-1:-1))}}};I0=Bt([oe(7,V0),oe(8,Wp),oe(9,tn),oe(10,en),oe(11,Mo),oe(12,Ds),oe(13,lc)],I0);z0=class extends Oe{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ee),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new tU(this._optionsService))}catch{this._measureStrategy=this._register(new eU(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())}};z0=Bt([oe(2,tn)],z0);NR=class extends Oe{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)}},eU=class extends NR{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,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}},tU=class extends NR{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 new 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}},iU=class extends Oe{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new nU(this._window)),this._onDprChange=this._register(new ee),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ee),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(mi.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ee(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ee(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}},nU=class extends Oe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new oc),this._onDprChange=this._register(new ee),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(St(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ee(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)}},rU=class extends Oe{constructor(){super(),this.linkProviders=[],this._register(St(()=>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)}}}};B0=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,n,r){return sU(window,e,t,i,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){let i=ny(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};B0=Bt([oe(0,Ls),oe(1,Wp)],B0);aU=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):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=[]}},AR={};G6(AR,{getSafariVersion:()=>lU,isChromeOS:()=>DR,isFirefox:()=>MR,isIpad:()=>cU,isIphone:()=>uU,isLegacyEdge:()=>oU,isLinux:()=>ry,isMac:()=>Up,isNode:()=>jp,isSafari:()=>OR,isWindows:()=>RR});jp=typeof process<"u"&&"title"in process,pd=jp?"node":navigator.userAgent,md=jp?"node":navigator.platform,MR=pd.includes("Firefox"),oU=pd.includes("Edge"),OR=/^((?!chrome|android).)*safari/i.test(pd);Up=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(md),cU=md==="iPad",uU=md==="iPhone",RR=["Windows","Win16","Win32","WinCE"].includes(md),ry=md.indexOf("Linux")>=0,DR=/\bCrOS\b/.test(pd),LR=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),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,n=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),i*1.5>r){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=r}this.clear()}},dU=class extends LR{_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())}}},hU=class extends LR{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},qp=!jp&&"requestIdleCallback"in window?hU:dU,fU=class{constructor(){this._queue=new qp}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},P0=class extends Oe{constructor(e,t,i,n,r,s,a,o,l){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=n,this._coreService=r,this._coreBrowserService=o,this._renderer=this._register(new oc),this._pausedResizeTask=new fU,this._observerDisposable=this._register(new oc),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 ee),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ee),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ee),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ee),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new aU((c,u)=>this._renderRows(c,u),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new pU(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(St(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(s.onDecorationRegistered(()=>this._fullRefresh())),this._register(s.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(l.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=St(()=>i.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,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),i||(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),this._needsSelectionRefresh=!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(t=>this.refreshRows(t.start,t.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,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};P0=Bt([oe(2,tn),oe(3,Wp),oe(4,Mo),oe(5,fd),oe(6,en),oe(7,Ds),oe(8,lc)],P0);pU=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,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)}};wU=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)}};e0=50,xU=15,EU=50,kU=500,CU="\xA0",TU=new RegExp(CU,"g"),H0=class extends Oe{constructor(e,t,i,n,r,s,a,o,l){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=n,this._coreService=r,this._mouseService=s,this._optionsService=a,this._renderService=o,this._coreBrowserService=l,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new er,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ee),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ee),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ee),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ee),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new wU(this._bufferService),this._activeSelectionMode=0,this._register(St(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.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 i=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let r=e[0]<t[0]?e[0]:t[0],s=e[0]<t[0]?t[0]:e[0];for(let a=e[1];a<=t[1];a++){let o=i.translateBufferLineToString(a,!0,r,s);n.push(o)}}else{let r=e[1]===t[1]?t[0]:void 0;n.push(i.translateBufferLineToString(e[1],!0,e[0],r));for(let s=e[1]+1;s<=t[1]-1;s++){let a=i.lines.get(s),o=i.translateBufferLineToString(s,!0);a?.isWrapped?n[n.length-1]+=o:n.push(o)}if(e[1]!==t[1]){let s=i.lines.get(t[1]),a=i.translateBufferLineToString(t[1],!0,0,t[0]);s&&s.isWrapped?n[n.length-1]+=a:n.push(a)}}return n.map(r=>r.replace(TU," ")).join(RR?`\r
|
|
`:`
|
|
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),ry&&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),i=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!i||!n||!t?!1:this._areCoordsInSelection(t,i,n)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!i||!n?!1:this._areCoordsInSelection([e,t],i,n)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=wO(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,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=ny(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-e0),e0),t/=e0,t/Math.abs(t)+Math.round(t*(xU-1)))}shouldForceSelection(e){return Up?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(),EU)}_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&&!(Up&&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 i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let n=i.lines.get(this._model.selectionEnd[1]);n&&n.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<kU&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let n=mU(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);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,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let n=0;t>=n;n++){let r=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:r>1&&t!==n&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,s=r.lines.get(e[1]);if(!s)return;let a=r.translateBufferLineToString(e[1],!1),o=this._convertViewportColToCharacterIndex(s,e[0]),l=o,c=e[0]-o,u=0,d=0,h=0,f=0;if(a.charAt(o)===" "){for(;o>0&&a.charAt(o-1)===" ";)o--;for(;l<a.length&&a.charAt(l+1)===" ";)l++}else{let y=e[0],m=e[0];s.getWidth(y)===0&&(u++,y--),s.getWidth(m)===2&&(d++,m++);let v=s.getString(m).length;for(v>1&&(f+=v-1,l+=v-1);y>0&&o>0&&!this._isCharWordSeparator(s.loadCell(y-1,this._workCell));){s.loadCell(y-1,this._workCell);let b=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,y--):b>1&&(h+=b-1,o-=b-1),o--,y--}for(;m<s.length&&l+1<a.length&&!this._isCharWordSeparator(s.loadCell(m+1,this._workCell));){s.loadCell(m+1,this._workCell);let b=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,m++):b>1&&(f+=b-1,l+=b-1),l++,m++}}l++;let p=o+c-u+h,_=Math.min(this._bufferService.cols,l-o+u+d-h-f);if(!(!t&&a.slice(o,l).trim()==="")){if(i&&p===0&&s.getCodePoint(0)!==32){let y=r.lines.get(e[1]-1);if(y&&s.isWrapped&&y.getCodePoint(this._bufferService.cols-1)!==32){let m=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(m){let v=this._bufferService.cols-m.start;p-=v,_+=v}}}if(n&&p+_===this._bufferService.cols&&s.getCodePoint(this._bufferService.cols-1)!==32){let y=r.lines.get(e[1]+1);if(y?.isWrapped&&y.getCodePoint(0)!==32){let m=this._getWordAt([0,e[1]+1],!1,!1,!0);m&&(_+=m.length)}}return{start:p,length:_}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={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=wO(i,this._bufferService.cols)}};H0=Bt([oe(3,en),oe(4,Mo),oe(5,X0),oe(6,tn),oe(7,Ls),oe(8,Ds)],H0);xO=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},EO=class{constructor(){this._color=new xO,this._css=new xO}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},ei=Object.freeze((()=>{let e=[At.toColor("#2e3436"),At.toColor("#cc0000"),At.toColor("#4e9a06"),At.toColor("#c4a000"),At.toColor("#3465a4"),At.toColor("#75507b"),At.toColor("#06989a"),At.toColor("#d3d7cf"),At.toColor("#555753"),At.toColor("#ef2929"),At.toColor("#8ae234"),At.toColor("#fce94f"),At.toColor("#729fcf"),At.toColor("#ad7fa8"),At.toColor("#34e2e2"),At.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=t[i/36%6|0],r=t[i/6%6|0],s=t[i%6];e.push({css:Ft.toCss(n,r,s),rgba:Ft.toRgba(n,r,s)})}for(let i=0;i<24;i++){let n=8+i*10;e.push({css:Ft.toCss(n,n,n),rgba:Ft.toRgba(n,n,n)})}return e})()),Eo=At.toColor("#ffffff"),ed=At.toColor("#000000"),kO=At.toColor("#ffffff"),CO=ed,Yu={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},NU=Eo,U0=class extends Oe{constructor(e){super(),this._optionsService=e,this._contrastCache=new EO,this._halfContrastCache=new EO,this._onChangeColors=this._register(new ee),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Eo,background:ed,cursor:kO,cursorAccent:CO,selectionForeground:void 0,selectionBackgroundTransparent:Yu,selectionBackgroundOpaque:yt.blend(ed,Yu),selectionInactiveBackgroundTransparent:Yu,selectionInactiveBackgroundOpaque:yt.blend(ed,Yu),scrollbarSliderBackground:yt.opacity(Eo,.2),scrollbarSliderHoverBackground:yt.opacity(Eo,.4),scrollbarSliderActiveBackground:yt.opacity(Eo,.5),overviewRulerBorder:Eo,ansi:ei.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=st(e.foreground,Eo),t.background=st(e.background,ed),t.cursor=yt.blend(t.background,st(e.cursor,kO)),t.cursorAccent=yt.blend(t.background,st(e.cursorAccent,CO)),t.selectionBackgroundTransparent=st(e.selectionBackground,Yu),t.selectionBackgroundOpaque=yt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=st(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=yt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?st(e.selectionForeground,bO):void 0,t.selectionForeground===bO&&(t.selectionForeground=void 0),yt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=yt.opacity(t.selectionBackgroundTransparent,.3)),yt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=yt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=st(e.scrollbarSliderBackground,yt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=st(e.scrollbarSliderHoverBackground,yt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=st(e.scrollbarSliderActiveBackground,yt.opacity(t.foreground,.5)),t.overviewRulerBorder=st(e.overviewRulerBorder,NU),t.ansi=ei.slice(),t.ansi[0]=st(e.black,ei[0]),t.ansi[1]=st(e.red,ei[1]),t.ansi[2]=st(e.green,ei[2]),t.ansi[3]=st(e.yellow,ei[3]),t.ansi[4]=st(e.blue,ei[4]),t.ansi[5]=st(e.magenta,ei[5]),t.ansi[6]=st(e.cyan,ei[6]),t.ansi[7]=st(e.white,ei[7]),t.ansi[8]=st(e.brightBlack,ei[8]),t.ansi[9]=st(e.brightRed,ei[9]),t.ansi[10]=st(e.brightGreen,ei[10]),t.ansi[11]=st(e.brightYellow,ei[11]),t.ansi[12]=st(e.brightBlue,ei[12]),t.ansi[13]=st(e.brightMagenta,ei[13]),t.ansi[14]=st(e.brightCyan,ei[14]),t.ansi[15]=st(e.brightWhite,ei[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<i;n++)t.ansi[n+16]=st(e.extendedAnsi[n],ei[n+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 t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];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()}}};U0=Bt([oe(0,tn)],U0);AU=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},MU=class{constructor(){this._services=new AU,this._services.set(V0,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=J6(e).sort((s,a)=>s.index-a.index),n=[];for(let s of i){let a=this._services.get(s.id);if(!a)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${s.id._id}.`);n.push(a)}let r=i.length>0?i[0].index:t.length;if(t.length!==r)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},OU={trace:0,debug:1,info:2,warn:3,error:4,off:5},RU="xterm.js: ",q0=class extends Oe{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),DU=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=OU[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,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":RU)+t,...i)}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)}};q0=Bt([oe(0,tn)],q0);TO=class extends Oe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ee),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ee),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ee),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];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 new 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,...i){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 n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+i.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<i.length;n++)this._array[this._getCyclicIndex(e+n)]=i[n];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let n=this._length+i.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));let n=e+t+i-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+i,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ie=3,jt=Object.freeze(new hd),kp=0,t0=2,td=class BR{constructor(t,i,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ie);let r=i||er.fromCharData([0,ZO,1,0]);for(let s=0;s<t;++s)this.setCell(s,r);this.length=t}get(t){let i=this._data[t*Ie+0],n=i&2097151;return[this._data[t*Ie+1],i&2097152?this._combined[t]:n?Na(n):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,i){this._data[t*Ie+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Ie+0]=t|2097152|i[2]<<22):this._data[t*Ie+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*Ie+0]>>22}hasWidth(t){return this._data[t*Ie+0]&12582912}getFg(t){return this._data[t*Ie+1]}getBg(t){return this._data[t*Ie+2]}hasContent(t){return this._data[t*Ie+0]&4194303}getCodePoint(t){let i=this._data[t*Ie+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Ie+0]&2097152}getString(t){let i=this._data[t*Ie+0];return i&2097152?this._combined[t]:i&2097151?Na(i&2097151):""}isProtected(t){return this._data[t*Ie+2]&536870912}loadCell(t,i){return kp=t*Ie,i.content=this._data[kp+0],i.fg=this._data[kp+1],i.bg=this._data[kp+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Ie+0]=i.content,this._data[t*Ie+1]=i.fg,this._data[t*Ie+2]=i.bg}setCellFromCodepoint(t,i,n,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Ie+0]=i|n<<22,this._data[t*Ie+1]=r.fg,this._data[t*Ie+2]=r.bg}addCodepointToCell(t,i,n){let r=this._data[t*Ie+0];r&2097152?this._combined[t]+=Na(i):r&2097151?(this._combined[t]=Na(r&2097151)+Na(i),r&=-2097152,r|=2097152):r=i|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[t*Ie+0]=r}insertCells(t,i,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),i<this.length-t){let r=new er;for(let s=this.length-t-i-1;s>=0;--s)this.setCell(t+i+s,this.loadCell(t+s,r));for(let s=0;s<i;++s)this.setCell(t+s,n)}else for(let r=t;r<this.length;++r)this.setCell(r,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,i,n){if(t%=this.length,i<this.length-t){let r=new er;for(let s=0;s<this.length-t-i;++s)this.setCell(t+s,this.loadCell(t+i+s,r));for(let s=this.length-i;s<this.length;++s)this.setCell(s,n)}else for(let r=t;r<this.length;++r)this.setCell(r,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,i,n,r=!1){if(r){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,n);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,n);t<i&&t<this.length;)this.setCell(t++,n)}resize(t,i){if(t===this.length)return this._data.length*4*t0<this._data.buffer.byteLength;let n=t*Ie;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let r=new Uint32Array(n);r.set(this._data),this._data=r}for(let r=this.length;r<t;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,n);let r=Object.keys(this._combined);for(let a=0;a<r.length;a++){let o=parseInt(r[a],10);o>=t&&delete this._combined[o]}let s=Object.keys(this._extendedAttrs);for(let a=0;a<s.length;a++){let o=parseInt(s[a],10);o>=t&&delete this._extendedAttrs[o]}}return this.length=t,n*4*t0<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*t0<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new BR(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ie+0]&4194303)return t+(this._data[t*Ie+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ie+0]&4194303||this._data[t*Ie+2]&50331648)return t+(this._data[t*Ie+0]>>22);return 0}copyCellsFrom(t,i,n,r,s){let a=t._data;if(s)for(let l=r-1;l>=0;l--){for(let c=0;c<Ie;c++)this._data[(n+l)*Ie+c]=a[(i+l)*Ie+c];a[(i+l)*Ie+2]&268435456&&(this._extendedAttrs[n+l]=t._extendedAttrs[i+l])}else for(let l=0;l<r;l++){for(let c=0;c<Ie;c++)this._data[(n+l)*Ie+c]=a[(i+l)*Ie+c];a[(i+l)*Ie+2]&268435456&&(this._extendedAttrs[n+l]=t._extendedAttrs[i+l])}let o=Object.keys(t._combined);for(let l=0;l<o.length;l++){let c=parseInt(o[l],10);c>=i&&(this._combined[c-i+n]=t._combined[c])}}translateToString(t,i,n,r){i=i??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let s="";for(;i<n;){let a=this._data[i*Ie+0],o=a&2097151,l=a&2097152?this._combined[i]:o?Na(o):Aa;if(s+=l,r)for(let c=0;c<l.length;++c)r.push(i);i+=a>>22||1}return r&&r.push(i),s}};PR=class HR{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=HR._nextId++,this._onDispose=this.register(new ee),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),No(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};PR._nextId=1;PU=PR,ii={},ko=ii.B;ii[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"};ii.A={"#":"\xA3"};ii.B=void 0;ii[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"};ii.C=ii[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"};ii.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"};ii.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"};ii.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"};ii.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"};ii.E=ii[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"};ii.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"};ii.H=ii[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"};ii["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"};NO=4294967295,AO=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=jt.clone(),this.savedCharset=ko,this.markers=[],this._nullCell=er.fromCharData([0,ZO,1,0]),this._whitespaceCell=er.fromCharData([0,Aa,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new qp,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new TO(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 Lp),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 Lp),this._whitespaceCell}getBlankLine(e,t){return new td(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>NO?NO:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=jt);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 TO(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(jt),n=0,r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(let a=0;a<this.lines.length;a++)n+=+this.lines.get(a).resize(e,i);let s=0;if(this._rows<t)for(let a=this._rows;a<t;a++)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 td(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new td(e,i)));else for(let a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){let a=this.lines.length-r;a>0&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),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 s=0;s<this.lines.length;s++)n+=+this.lines.get(s).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.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 i=this._optionsService.rawOptions.reflowCursorLine,n=LU(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(jt),i);if(n.length>0){let r=IU(this.lines,n);zU(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let n=this.getNullCell(jt),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new td(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(jt),r=[],s=0;for(let a=this.lines.length-1;a>=0;a--){let o=this.lines.get(a);if(!o||!o.isWrapped&&o.getTrimmedLength()<=e)continue;let l=[o];for(;o.isWrapped&&a>0;)o=this.lines.get(--a),l.unshift(o);if(!i){let b=this.ybase+this.y;if(b>=a&&b<a+l.length)continue}let c=l[l.length-1].getTrimmedLength(),u=BU(l,this._cols,e),d=u.length-l.length,h;this.ybase===0&&this.y!==this.lines.length-1?h=Math.max(0,this.y-this.lines.maxLength+d):h=Math.max(0,this.lines.length-this.lines.maxLength+d);let f=[];for(let b=0;b<d;b++){let w=this.getBlankLine(jt,!0);f.push(w)}f.length>0&&(r.push({start:a+l.length+s,newLines:f}),s+=f.length),l.push(...f);let p=u.length-1,_=u[p];_===0&&(p--,_=u[p]);let y=l.length-d-1,m=c;for(;y>=0;){let b=Math.min(m,_);if(l[p]===void 0)break;if(l[p].copyCellsFrom(l[y],m-b,_-b,b,!0),_-=b,_===0&&(p--,_=u[p]),m-=b,m===0){y--;let w=Math.max(y,0);m=dd(l,w,this._cols)}}for(let b=0;b<l.length;b++)u[b]<e&&l[b].setCell(u[b],n);let v=d-h;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+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(r.length>0){let a=[],o=[];for(let _=0;_<this.lines.length;_++)o.push(this.lines.get(_));let l=this.lines.length,c=l-1,u=0,d=r[u];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);let h=0;for(let _=Math.min(this.lines.maxLength-1,l+s-1);_>=0;_--)if(d&&d.start>c+h){for(let y=d.newLines.length-1;y>=0;y--)this.lines.set(_--,d.newLines[y]);_++,a.push({index:c+1,amount:d.newLines.length}),h+=d.newLines.length,d=r[++u]}else this.lines.set(_,o[c--]);let f=0;for(let _=a.length-1;_>=0;_--)a[_].index+=f,this.lines.onInsertEmitter.fire(a[_]),f+=a[_].amount;let p=Math.max(0,l+s-this.lines.maxLength);p>0&&this.lines.onTrimEmitter.fire(p)}}translateBufferLineToString(e,t,i=0,n){let r=this.lines.get(e);return r?r.translateToString(t,i,n):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(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 PU(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},HU=class extends Oe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ee),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 AO(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new AO(!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)}},UR=2,qR=1,F0=class extends Oe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ee),this.onResize=this._onResize.event,this._onScroll=this._register(new ee),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,UR),this.rows=Math.max(e.rawOptions.rows||0,qR),this.buffers=this._register(new HU(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=i.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let r=i.ybase+i.scrollTop,s=i.ybase+i.scrollBottom;if(i.scrollTop===0){let a=i.lines.isFull;s===i.lines.length-1?a?i.lines.recycle().copyFrom(n):i.lines.push(n.clone()):i.lines.splice(s+1,0,n.clone()),a?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let a=s-r+1;i.lines.shiftElements(r+1,a-1,-1),i.lines.set(s,n.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let n=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),n!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};F0=Bt([oe(0,tn)],F0);sc={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:Up,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},UU=["normal","bold","100","200","300","400","500","600","700","800","900"],qU=class extends Oe{constructor(e){super(),this._onOptionChange=this._register(new ee),this.onOptionChange=this._onOptionChange.event;let t={...sc};for(let i in e)if(i in t)try{let n=e[i];t[i]=this._sanitizeAndValidateOption(i,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(St(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in sc))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,n)=>{if(!(i in sc))throw new Error(`No option with key "${i}"`);n=this._sanitizeAndValidateOption(i,n),this.rawOptions[i]!==n&&(this.rawOptions[i]=n,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let n={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=sc[e]),!FU(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=sc[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=UU.includes(t)?t:sc[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new 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 new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};MO=Object.freeze({insertMode:!1}),OO=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),$0=class extends Oe{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ee),this.onData=this._onData.event,this._onUserInput=this._register(new ee),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ee),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ee),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=id(MO),this.decPrivateModes=id(OO)}reset(){this.modes=id(MO),this.decPrivateModes=id(OO)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.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(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};$0=Bt([oe(0,en),oe(1,iR),oe(2,tn)],$0);RO={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}};n0=String.fromCharCode,DO={DEFAULT:e=>{let t=[i0(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${n0(t[0])}${n0(t[1])}${n0(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${i0(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${i0(e,!0)};${e.x};${e.y}${t}`}},W0=class extends Oe{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ee),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(RO))this.addProtocol(n,RO[n]);for(let n of Object.keys(DO))this.addEncoding(n,DO[n]);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 new 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 new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let n=t/i,r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=n+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_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,i){if(i){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)}};W0=Bt([oe(0,en),oe(1,Mo),oe(2,tn)],W0);r0=[[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]],$U=[[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]];KU=class{constructor(){if(this.version="6",!ti){ti=new Uint8Array(65536),ti.fill(1),ti[0]=0,ti.fill(0,1,32),ti.fill(0,127,160),ti.fill(2,4352,4448),ti[9001]=2,ti[9002]=2,ti.fill(2,11904,42192),ti[12351]=1,ti.fill(2,44032,55204),ti.fill(2,63744,64256),ti.fill(2,65040,65050),ti.fill(2,65072,65136),ti.fill(2,65280,65377),ti.fill(2,65504,65511);for(let e=0;e<r0.length;++e)ti.fill(0,r0[e][0],r0[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ti[e]:WU(e,$U)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),n=i===0&&t!==0;if(n){let r=Co.extractWidth(t);r===0?n=!1:r>i&&(i=r)}return Co.createPropertyValue(0,i,n)}},Co=class Dp{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ee,this.onChange=this._onChange.event;let t=new KU;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,n=!1){return(t&16777215)<<3|(i&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,n=0,r=t.length;for(let s=0;s<r;++s){let a=t.charCodeAt(s);if(55296<=a&&a<=56319){if(++s>=r)return i+this.wcwidth(a);let c=t.charCodeAt(s);56320<=c&&c<=57343?a=(a-55296)*1024+c-56320+65536:i+=this.wcwidth(c)}let o=this.charProperties(a,n),l=Dp.extractWidth(o);Dp.extractShouldJoin(o)&&(l-=Dp.extractWidth(n)),i+=l,n=o}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},GU=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)}};Vu=2147483647,jU=256,FR=class K0{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>jU)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new K0;if(!t.length)return i;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let r=t[n];if(Array.isArray(r))for(let s=0;s<r.length;++s)i.addSubParam(r[s]);else i.addParam(r)}return i}clone(){let t=new K0(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 t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let n=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Vu?Vu:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Vu?Vu:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-i>0?this._subParams.subarray(i,n):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let n=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-n>0&&(t[i]=this._subParams.slice(n,r))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[i-1];n[i-1]=~r?Math.min(r*10+t,Vu):t}},Xu=[],YU=class{constructor(){this._state=0,this._active=Xu,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 i=this._handlers[e];return i.push(t),{dispose:()=>{let n=i.indexOf(t);n!==-1&&i.splice(n,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=Xu}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=Xu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Xu,!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,i){if(!this._active.length)this._handlerFb(this._id,"PUT",$p(e,t,i));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){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&&i-t>0&&this._put(e,t,i)}}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 i=!1,n=this._active.length-1,r=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;n>=0&&(i=this._active[n].end(e),i!==!0);n--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,i;n--}for(;n>=0;n--)if(i=this._active[n].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,i}this._active=Xu,this._id=-1,this._state=0}}},In=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=$p(e,t,i),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(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},Zu=[],VU=class{constructor(){this._handlers=Object.create(null),this._active=Zu,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Zu}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let n=i.indexOf(t);n!==-1&&i.splice(n,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=Zu,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Zu,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",$p(e,t,i));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,n=this._active.length-1,r=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;n>=0&&(i=this._active[n].unhook(e),i!==!0);n--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,i;n--}for(;n>=0;n--)if(i=this._active[n].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,i}this._active=Zu,this._ident=0}},nd=new FR;nd.addParam(0);IO=class{constructor(e){this._handler=e,this._data="",this._params=nd,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():nd,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=$p(e,t,i),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(i=>(this._params=nd,this._data="",this._hitLimit=!1,i));return this._params=nd,this._data="",this._hitLimit=!1,t}},XU=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,n){this.table[t<<8|e]=i<<4|n}addMany(e,t,i,n){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|n}},Jn=160,ZU=(function(){let e=new XU(4095),t=Array.apply(null,Array(256)).map((o,l)=>l),i=(o,l)=>t.slice(o,l),n=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let s=i(0,14),a;e.setDefault(1,0),e.addMany(n,0,2,0);for(a in s)e.addMany([24,26,153,154],a,3,0),e.addMany(i(128,144),a,3,0),e.addMany(i(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Jn,0,2,0),e.add(Jn,8,5,8),e.add(Jn,6,0,6),e.add(Jn,11,0,11),e.add(Jn,13,13,13),e})(),QU=class extends Oe{constructor(e=ZU){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 FR,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(St(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new YU),this._dcsParser=this._register(new VU),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;r<e.intermediates.length;++r){let s=e.intermediates.charCodeAt(r);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=s}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=n,i}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 i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let n=this._escHandlers[i];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,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 i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let n=this._csiHandlers[i];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,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,i,n,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=n,this._parseStack.chunkPos=r}parse(e,t,i){let n=0,r=0,s=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,s=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let o=this._parseStack.handlers,l=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&l>-1){for(;l>=0&&(a=o[l](this._params),a!==!0);l--)if(a instanceof Promise)return this._parseStack.handlerPos=l,a}this._parseStack.handlers=[];break;case 4:if(i===!1&&l>-1){for(;l>=0&&(a=o[l](),a!==!0);l--)if(a instanceof Promise)return this._parseStack.handlerPos=l,a}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(n!==24&&n!==26,i),a)return a;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],a=this._oscParser.end(n!==24&&n!==26,i),a)return a;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,s=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let o=s;o<t;++o){switch(n=e[o],r=this._transitions.table[this.currentState<<8|(n<160?n:Jn)],r>>4){case 2:for(let h=o+1;;++h){if(h>=t||(n=e[h])<32||n>126&&n<Jn){this._printHandler(e,o,h),o=h-1;break}if(++h>=t||(n=e[h])<32||n>126&&n<Jn){this._printHandler(e,o,h),o=h-1;break}if(++h>=t||(n=e[h])<32||n>126&&n<Jn){this._printHandler(e,o,h),o=h-1;break}if(++h>=t||(n=e[h])<32||n>126&&n<Jn){this._printHandler(e,o,h),o=h-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:o,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let l=this._csiHandlers[this._collect<<8|n],c=l?l.length-1:-1;for(;c>=0&&(a=l[c](this._params),a!==!0);c--)if(a instanceof Promise)return this._preserveStack(3,l,c,r,o),a;c<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++o<t&&(n=e[o])>47&&n<60);o--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let u=this._escHandlers[this._collect<<8|n],d=u?u.length-1:-1;for(;d>=0&&(a=u[d](),a!==!0);d--)if(a instanceof Promise)return this._preserveStack(4,u,d,r,o),a;d<0&&this._escHandlerFb(this._collect<<8|n),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|n,this._params);break;case 13:for(let h=o+1;;++h)if(h>=t||(n=e[h])===24||n===26||n===27||n>127&&n<Jn){this._dcsParser.put(e,o,h),o=h-1;break}break;case 14:if(a=this._dcsParser.unhook(n!==24&&n!==26),a)return this._preserveStack(6,[],0,r,o),a;n===27&&(r|=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 h=o+1;;h++)if(h>=t||(n=e[h])<32||n>127&&n<Jn){this._oscParser.put(e,o,h),o=h-1;break}break;case 6:if(a=this._oscParser.end(n!==24&&n!==26),a)return this._preserveStack(5,[],0,r,o),a;n===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=r&15}}},JU=/^([\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})$/,e8=/^[\da-f]+$/;i8={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ta=131072,BO=10;HO=5e3,UO=0,n8=class extends Oe{constructor(e,t,i,n,r,s,a,o,l=new QU){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=n,this._optionsService=r,this._oscLinkService=s,this._coreMouseService=a,this._unicodeService=o,this._parser=l,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Z6,this._utf8Decoder=new Q6,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=jt.clone(),this._eraseAttrDataInternal=jt.clone(),this._onRequestBell=this._register(new ee),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ee),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ee),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ee),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ee),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ee),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ee),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ee),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ee),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ee),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ee),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ee),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ee),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 G0(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(c=>this._activeBuffer=c.activeBuffer)),this._parser.setCsiHandlerFallback((c,u)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(c),params:u.toArray()})}),this._parser.setEscHandlerFallback(c=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(c)})}),this._parser.setExecuteHandlerFallback(c=>{this._logService.debug("Unknown EXECUTE code: ",{code:c})}),this._parser.setOscHandlerFallback((c,u,d)=>{this._logService.debug("Unknown OSC code: ",{identifier:c,action:u,data:d})}),this._parser.setDcsHandlerFallback((c,u,d)=>{u==="HOOK"&&(d=d.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(c),action:u,payload:d})}),this._parser.setPrintHandler((c,u,d)=>this.print(c,u,d)),this._parser.registerCsiHandler({final:"@"},c=>this.insertChars(c)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},c=>this.scrollLeft(c)),this._parser.registerCsiHandler({final:"A"},c=>this.cursorUp(c)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},c=>this.scrollRight(c)),this._parser.registerCsiHandler({final:"B"},c=>this.cursorDown(c)),this._parser.registerCsiHandler({final:"C"},c=>this.cursorForward(c)),this._parser.registerCsiHandler({final:"D"},c=>this.cursorBackward(c)),this._parser.registerCsiHandler({final:"E"},c=>this.cursorNextLine(c)),this._parser.registerCsiHandler({final:"F"},c=>this.cursorPrecedingLine(c)),this._parser.registerCsiHandler({final:"G"},c=>this.cursorCharAbsolute(c)),this._parser.registerCsiHandler({final:"H"},c=>this.cursorPosition(c)),this._parser.registerCsiHandler({final:"I"},c=>this.cursorForwardTab(c)),this._parser.registerCsiHandler({final:"J"},c=>this.eraseInDisplay(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},c=>this.eraseInDisplay(c,!0)),this._parser.registerCsiHandler({final:"K"},c=>this.eraseInLine(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},c=>this.eraseInLine(c,!0)),this._parser.registerCsiHandler({final:"L"},c=>this.insertLines(c)),this._parser.registerCsiHandler({final:"M"},c=>this.deleteLines(c)),this._parser.registerCsiHandler({final:"P"},c=>this.deleteChars(c)),this._parser.registerCsiHandler({final:"S"},c=>this.scrollUp(c)),this._parser.registerCsiHandler({final:"T"},c=>this.scrollDown(c)),this._parser.registerCsiHandler({final:"X"},c=>this.eraseChars(c)),this._parser.registerCsiHandler({final:"Z"},c=>this.cursorBackwardTab(c)),this._parser.registerCsiHandler({final:"`"},c=>this.charPosAbsolute(c)),this._parser.registerCsiHandler({final:"a"},c=>this.hPositionRelative(c)),this._parser.registerCsiHandler({final:"b"},c=>this.repeatPrecedingCharacter(c)),this._parser.registerCsiHandler({final:"c"},c=>this.sendDeviceAttributesPrimary(c)),this._parser.registerCsiHandler({prefix:">",final:"c"},c=>this.sendDeviceAttributesSecondary(c)),this._parser.registerCsiHandler({final:"d"},c=>this.linePosAbsolute(c)),this._parser.registerCsiHandler({final:"e"},c=>this.vPositionRelative(c)),this._parser.registerCsiHandler({final:"f"},c=>this.hVPosition(c)),this._parser.registerCsiHandler({final:"g"},c=>this.tabClear(c)),this._parser.registerCsiHandler({final:"h"},c=>this.setMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"h"},c=>this.setModePrivate(c)),this._parser.registerCsiHandler({final:"l"},c=>this.resetMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"l"},c=>this.resetModePrivate(c)),this._parser.registerCsiHandler({final:"m"},c=>this.charAttributes(c)),this._parser.registerCsiHandler({final:"n"},c=>this.deviceStatus(c)),this._parser.registerCsiHandler({prefix:"?",final:"n"},c=>this.deviceStatusPrivate(c)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},c=>this.softReset(c)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},c=>this.setCursorStyle(c)),this._parser.registerCsiHandler({final:"r"},c=>this.setScrollRegion(c)),this._parser.registerCsiHandler({final:"s"},c=>this.saveCursor(c)),this._parser.registerCsiHandler({final:"t"},c=>this.windowOptions(c)),this._parser.registerCsiHandler({final:"u"},c=>this.restoreCursor(c)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},c=>this.insertColumns(c)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},c=>this.deleteColumns(c)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},c=>this.selectProtected(c)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},c=>this.requestMode(c,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},c=>this.requestMode(c,!1)),this._parser.setExecuteHandler(W.BEL,()=>this.bell()),this._parser.setExecuteHandler(W.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(W.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(W.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(W.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(W.BS,()=>this.backspace()),this._parser.setExecuteHandler(W.HT,()=>this.tab()),this._parser.setExecuteHandler(W.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(W.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ad.IND,()=>this.index()),this._parser.setExecuteHandler(ad.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ad.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new In(c=>(this.setTitle(c),this.setIconName(c),!0))),this._parser.registerOscHandler(1,new In(c=>this.setIconName(c))),this._parser.registerOscHandler(2,new In(c=>this.setTitle(c))),this._parser.registerOscHandler(4,new In(c=>this.setOrReportIndexedColor(c))),this._parser.registerOscHandler(8,new In(c=>this.setHyperlink(c))),this._parser.registerOscHandler(10,new In(c=>this.setOrReportFgColor(c))),this._parser.registerOscHandler(11,new In(c=>this.setOrReportBgColor(c))),this._parser.registerOscHandler(12,new In(c=>this.setOrReportCursorColor(c))),this._parser.registerOscHandler(104,new In(c=>this.restoreIndexedColor(c))),this._parser.registerOscHandler(110,new In(c=>this.restoreFgColor(c))),this._parser.registerOscHandler(111,new In(c=>this.restoreBgColor(c))),this._parser.registerOscHandler(112,new In(c=>this.restoreCursorColor(c))),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 c in ii)this._parser.registerEscHandler({intermediates:"(",final:c},()=>this.selectCharset("("+c)),this._parser.registerEscHandler({intermediates:")",final:c},()=>this.selectCharset(")"+c)),this._parser.registerEscHandler({intermediates:"*",final:c},()=>this.selectCharset("*"+c)),this._parser.registerEscHandler({intermediates:"+",final:c},()=>this.selectCharset("+"+c)),this._parser.registerEscHandler({intermediates:"-",final:c},()=>this.selectCharset("-"+c)),this._parser.registerEscHandler({intermediates:".",final:c},()=>this.selectCharset("."+c)),this._parser.registerEscHandler({intermediates:"/",final:c},()=>this.selectCharset("/"+c));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(c=>(this._logService.error("Parsing error: ",c),c)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new IO((c,u)=>this.requestStatusString(c,u)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),HO))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${HO} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,n=this._activeBuffer.x,r=this._activeBuffer.y,s=0,a=this._parseStack.paused;if(a){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;n=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Ta&&(s=this._parseStack.position+Ta)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,c=>String.fromCharCode(c)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(c=>c.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Ta&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ta))),a||this._dirtyRowTracker.clearRange(),e.length>Ta)for(let c=s;c<e.length;c+=Ta){let u=c+Ta<e.length?c+Ta:e.length,d=typeof e=="string"?this._stringDecoder.decode(e.substring(c,u),this._parseBuffer):this._utf8Decoder.decode(e.subarray(c,u),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,d))return this._preserveStack(n,r,d,c),this._logSlowResolvingAsync(i),i}else if(!a){let c=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,c))return this._preserveStack(n,r,c,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==n||this._activeBuffer.y!==r)&&this._onCursorMove.fire();let o=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),l=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);l<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(l,this._bufferService.rows-1),end:Math.min(o,this._bufferService.rows-1)})}print(e,t,i){let n,r,s=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,o=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,c=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&&i-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let h=this._parser.precedingJoinState;for(let f=t;f<i;++f){if(n=e[f],n<127&&s){let m=s[String.fromCharCode(n)];m&&(n=m.charCodeAt(0))}let p=this._unicodeService.charProperties(n,h);r=Co.extractWidth(p);let _=Co.extractShouldJoin(p),y=_?Co.extractWidth(h):0;if(h=p,a&&this._onA11yChar.fire(Na(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-y>o){if(l){let m=d,v=this._activeBuffer.x-y;for(this._activeBuffer.x=y,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),y>0&&d instanceof td&&d.copyCellsFrom(m,v,0,y,!1);v<o;)m.setCellFromCodepoint(v++,0,1,u)}else if(this._activeBuffer.x=o-1,r===2)continue}if(_&&this._activeBuffer.x){let m=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-m,n,r);for(let v=r-y;--v>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(c&&(d.insertCells(this._activeBuffer.x,r-y,this._activeBuffer.getNullCell(u)),d.getWidth(o-1)===2&&d.setCellFromCodepoint(o-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,n,r,u),r>0)for(;--r;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=h,this._activeBuffer.x<o&&i-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,i=>PO(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new IO(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new In(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,i,n=!1,r=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),n&&(s.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0));break}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);break}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 i=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,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 i=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(i,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}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(jt));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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);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 i=e.params[0]||1,n=Co.extractWidth(t),r=this._activeBuffer.x-n,s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),a=new Uint32Array(s.length*i),o=0;for(let c=0;c<s.length;){let u=s.codePointAt(c)||0;a[o++]=u,c+=u>65535?2:1}let l=o;for(let c=1;c<i;++c)a.copyWithin(l,0,o),l+=o;return this.print(a,0,l),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(W.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(W.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(W.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(W.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(W.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,ko),this._charsetService.setgCharset(1,ko),this._charsetService.setgCharset(2,ko),this._charsetService.setgCharset(3,ko);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 i;(_=>(_[_.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",_[_.SET=1]="SET",_[_.RESET=2]="RESET",_[_.PERMANENTLY_SET=3]="PERMANENTLY_SET",_[_.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||(i={}));let n=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:s}=this._coreMouseService,a=this._coreService,{buffers:o,cols:l}=this._bufferService,{active:c,alt:u}=o,d=this._optionsService.rawOptions,h=(_,y)=>(a.triggerDataEvent(`${W.ESC}[${t?"":"?"}${_};${y}$y`),!0),f=_=>_?1:2,p=e.params[0];return t?p===2?h(p,4):p===4?h(p,f(a.modes.insertMode)):p===12?h(p,3):p===20?h(p,f(d.convertEol)):h(p,0):p===1?h(p,f(n.applicationCursorKeys)):p===3?h(p,d.windowOptions.setWinLines?l===80?2:l===132?1:0:0):p===6?h(p,f(n.origin)):p===7?h(p,f(n.wraparound)):p===8?h(p,3):p===9?h(p,f(r==="X10")):p===12?h(p,f(d.cursorBlink)):p===25?h(p,f(!a.isCursorHidden)):p===45?h(p,f(n.reverseWraparound)):p===66?h(p,f(n.applicationKeypad)):p===67?h(p,4):p===1e3?h(p,f(r==="VT200")):p===1002?h(p,f(r==="DRAG")):p===1003?h(p,f(r==="ANY")):p===1004?h(p,f(n.sendFocus)):p===1005?h(p,4):p===1006?h(p,f(s==="SGR")):p===1015?h(p,4):p===1016?h(p,f(s==="SGR_PIXELS")):p===1048?h(p,1):p===47||p===1047||p===1049?h(p,f(c===u)):p===2004?h(p,f(n.bracketedPasteMode)):p===2026?h(p,f(n.synchronizedOutput)):h(p,0)}_updateAttrColor(e,t,i,n,r){return t===2?(e|=50331648,e&=-16777216,e|=hd.fromColorRGB([i,n,r])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let n=[0,0,-1,0,0,0],r=0,s=0;do{if(n[s+r]=e.params[t+s],e.hasSubParams(t+s)){let a=e.getSubParams(t+s),o=0;do n[1]===5&&(r=1),n[s+o+1+r]=a[o];while(++o<a.length&&o+s+1+r<n.length);break}if(n[1]===5&&s+r>=2||n[1]===2&&s+r>=5)break;n[1]&&(r=1)}while(++s+t<e.length&&s+r<n.length);for(let a=2;a<n.length;++a)n[a]===-1&&(n[a]=0);switch(n[0]){case 38:i.fg=this._updateAttrColor(i.fg,n[1],n[3],n[4],n[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,n[1],n[3],n[4],n[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,n[1],n[3],n[4],n[5])}return s}_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=jt.fg,e.bg=jt.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,i,n=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(n.fg&=-50331904,n.fg|=16777216|i-30):i>=40&&i<=47?(n.bg&=-50331904,n.bg|=16777216|i-40):i>=90&&i<=97?(n.fg&=-50331904,n.fg|=16777216|i-90|8):i>=100&&i<=107?(n.bg&=-50331904,n.bg|=16777216|i-100|8):i===0?this._processSGR0(n):i===1?n.fg|=134217728:i===3?n.bg|=67108864:i===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,n)):i===5?n.fg|=536870912:i===7?n.fg|=67108864:i===8?n.fg|=1073741824:i===9?n.fg|=2147483648:i===2?n.bg|=134217728:i===21?this._processUnderline(2,n):i===22?(n.fg&=-134217729,n.bg&=-134217729):i===23?n.bg&=-67108865:i===24?(n.fg&=-268435457,this._processUnderline(0,n)):i===25?n.fg&=-536870913:i===27?n.fg&=-67108865:i===28?n.fg&=-1073741825:i===29?n.fg&=2147483647:i===39?(n.fg&=-67108864,n.fg|=jt.fg&16777215):i===49?(n.bg&=-67108864,n.bg|=jt.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(e,r,n):i===53?n.bg|=1073741824:i===55?n.bg&=-1073741825:i===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):i===100?(n.fg&=-67108864,n.fg|=jt.fg&16777215,n.bg&=-67108864,n.bg|=jt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${W.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${W.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${W.ESC}[?${t};${i}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}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=jt.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";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!PO(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(`${W.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>BO&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>BO&&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());break}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=[],i=e.split(";");for(;i.length>1;){let n=i.shift(),r=i.shift();if(/^\d+$/.exec(n)){let s=parseInt(n);if(qO(s))if(r==="?")t.push({type:0,index:s});else{let a=zO(r);a&&t.push({type:1,index:s,color:a})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(i,n):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),n,r=i.findIndex(s=>s.startsWith("id="));return r!==-1&&(n=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,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 i=e.split(";");for(let n=0;n<i.length&&!(t>=this._specialColors.length);++n,++t)if(i[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=zO(i[n]);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=[],i=e.split(";");for(let n=0;n<i.length;++n)if(/^\d+$/.exec(i[n])){let r=parseInt(i[n]);qO(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,ko),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(i8[e[0]],ii[e[1]]||ko),!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=jt.clone(),this._eraseAttrDataInternal=jt.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 er;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(i);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=a=>(this._coreService.triggerDataEvent(`${W.ESC}${a}${W.ESC}\\`),!0),n=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},G0=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&&(UO=e,e=t,t=UO),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};G0=Bt([oe(0,en)],G0);r8=5e7,FO=12,s8=50,a8=class extends Oe{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 ee),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 i;for(;i=this._writeBuffer.shift();){this._action(i);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>r8)throw new 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 i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],r=this._action(n,t);if(r){let a=o=>performance.now()-i>=FO?setTimeout(()=>this._innerWrite(0,o)):this._innerWrite(i,o);r.catch(o=>(queueMicrotask(()=>{throw o}),Promise.resolve(!1))).then(a);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-i>=FO)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>s8&&(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()}},j0=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 o=t.addMarker(t.ybase+t.y),l={data:e,id:this._nextId++,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(l,o)),this._dataByLinkId.set(l.id,l),l.id}let i=e,n=this._getEntryIdKey(i),r=this._entriesWithId.get(n);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;let s=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(a,s)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);i.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(i,n))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};j0=Bt([oe(0,en)],j0);$O=!1,o8=class extends Oe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new oc),this._onBinary=this._register(new ee),this.onBinary=this._onBinary.event,this._onData=this._register(new ee),this.onData=this._onData.event,this._onLineFeed=this._register(new ee),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ee),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ee),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ee),this._instantiationService=new MU,this.optionsService=this._register(new qU(e)),this._instantiationService.setService(tn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(F0)),this._instantiationService.setService(en,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(q0)),this._instantiationService.setService(iR,this._logService),this.coreService=this._register(this._instantiationService.createInstance($0)),this._instantiationService.setService(Mo,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(W0)),this._instantiationService.setService(tR,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Co)),this._instantiationService.setService(iP,this.unicodeService),this._charsetService=this._instantiationService.createInstance(GU),this._instantiationService.setService(tP,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j0),this._instantiationService.setService(nR,this._oscLinkService),this._inputHandler=this._register(new n8(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(mi.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(mi.forward(this._bufferService.onResize,this._onResize)),this._register(mi.forward(this.coreService.onData,this._onData)),this._register(mi.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 a8((t,i)=>this._inputHandler.parse(t,i))),this._register(mi.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ee),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&&!$O&&(this._logService.warn("writeSync is unreliable and will be removed soon."),$O=!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,UR),t=Math.max(t,qR),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(LO.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(LO(this._bufferService),!1))),this._windowsWrappingHeuristics.value=St(()=>{for(let t of e)t.dispose()})}}},l8={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:["'",'"']};qt=0,u8=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new qp,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new qp,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((r,s)=>this._getKey(r)-this._getKey(s)),t=0,i=0,n=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<n.length;r++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(n[r]=e[t],t++):n[r]=this._array[i++];this._array=n,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||(qt=this._search(t),qt===-1)||this._getKey(this._array[qt])!==t)return!1;do if(this._array[qt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(qt),!0;while(++qt<this._array.length&&this._getKey(this._array[qt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((r,s)=>r-s),t=0,i=new Array(this._array.length-e.length),n=0;for(let r=0;r<this._array.length;r++)e[t]===r?t++:i[n++]=this._array[r];this._array=i,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&&(qt=this._search(e),!(qt<0||qt>=this._array.length)&&this._getKey(this._array[qt])===e))do yield this._array[qt];while(++qt<this._array.length&&this._getKey(this._array[qt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(qt=this._search(e),!(qt<0||qt>=this._array.length)&&this._getKey(this._array[qt])===e))do t(this._array[qt]);while(++qt<this._array.length&&this._getKey(this._array[qt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let n=t+i>>1,r=this._getKey(this._array[n]);if(r>e)i=n-1;else if(r<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},a0=0,WO=0,d8=class extends Oe{constructor(){super(),this._decorations=new u8(e=>e?.marker.line),this._onDecorationRegistered=this._register(new ee),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ee),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(St(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new h8(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.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,i){let n=0,r=0;for(let s of this._decorations.getKeyIterator(t))n=s.options.x??0,r=n+(s.options.width??1),e>=n&&e<r&&(!i||(s.options.layer??"bottom")===i)&&(yield s)}forEachDecorationAtCell(e,t,i,n){this._decorations.forEachByKey(t,r=>{a0=r.options.x??0,WO=a0+(r.options.width??1),e>=a0&&e<WO&&(!i||(r.options.layer??"bottom")===i)&&n(r)})}},h8=class extends Ma{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ee),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ee),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.options.backgroundColor?this._cachedBg=At.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=At.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},f8=1e3,p8=class{constructor(e,t=f8){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=n-this._lastRefreshMs,s=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},s)}}_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)}},KO=20,GO=!1,Fp=class extends Oe{constructor(e,t,i,n){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let s=0;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);if(this._topBoundaryFocusListener=s=>this._handleBoundaryFocus(s,0),this._bottomBoundaryFocusListener=s=>this._handleBoundaryFocus(s,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=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new p8(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");GO?(this._accessibilityContainer.classList.add("debug"),this._rowContainer.classList.add("debug"),this._debugRootContainer=r.createElement("div"),this._debugRootContainer.classList.add("xterm"),this._debugRootContainer.appendChild(r.createTextNode("------start a11y------")),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(r.createTextNode("------end a11y------")),this._terminal.element.insertAdjacentElement("afterend",this._debugRootContainer)):this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(s=>this._handleResize(s.rows))),this._register(this._terminal.onRender(s=>this._refreshRows(s.start,s.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(s=>this._handleChar(s))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
`))),this._register(this._terminal.onA11yTab(s=>this._handleTab(s))),this._register(this._terminal.onKey(s=>this._handleKey(s.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ee(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(St(()=>{GO?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<KO+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===KO+1&&(this._liveRegion.textContent+=l0.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 i=this._terminal.buffer,n=i.lines.length.toString();for(let r=e;r<=t;r++){let s=i.lines.get(i.ydisp+r),a=[],o=s?.translateToString(!0,void 0,void 0,a)||"",l=(i.ydisp+r+1).toString(),c=this._rowElements[r];c&&(o.length===0?(c.textContent="\xA0",this._rowColumns.set(c,[0,1])):(c.textContent=o,this._rowColumns.set(c,a)),c.setAttribute("aria-posinset",l),c.setAttribute("aria-setsize",n),this._alignRowWidth(c))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),s=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===s||e.relatedTarget!==n)return;let a,o;if(t===0?(a=i,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(a=this._rowElements.shift(),o=i,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{let l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}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},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,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 n=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:o,offset:l})=>{let c=o instanceof Text?o.parentNode:o,u=parseInt(c?.getAttribute("aria-posinset"),10)-1;if(isNaN(u))return console.warn("row is invalid. Race condition?"),null;let d=this._rowColumns.get(c);if(!d)return console.warn("columns is null. Race condition?"),null;let h=l<d.length?d[l]:d.slice(-1)[0]+1;return h>=this._terminal.cols&&(++u,h=0),{row:u,column:h}},s=r(t),a=r(i);if(!(!s||!a)){if(s.row>a.row||s.row===a.row&&s.column>=a.column)throw new Error("invalid range");this._terminal.select(s.column,s.row,(a.row-s.row)*this._terminal.cols-s.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);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,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let n=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};Fp=Bt([oe(1,V0),oe(2,Ds),oe(3,Ls)],Fp);Y0=class extends Oe{constructor(e,t,i,n,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=n,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ee),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ee),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(St(()=>{No(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(Ee(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ee(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ee(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ee(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 i=e.composedPath();for(let n=0;n<i.length;n++){let r=i[n];if(r.classList.contains("xterm"))break;if(r.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(n=>{n?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[n,r]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(n)&&(i=this._checkLinkProviderResult(n,e,i)):r.provideLinks(e.y,s=>{if(this._isMouseOut)return;let a=s?.map(o=>({link:o}));this._activeProviderReplies?.set(n,a),i=this._checkLinkProviderResult(n,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let n=0;n<t.size;n++){let r=t.get(n);if(r)for(let s=0;s<r.length;s++){let a=r[s],o=a.link.range.start.y<e?0:a.link.range.start.x,l=a.link.range.end.y>e?this._bufferService.cols:a.link.range.end.x;for(let c=o;c<=l;c++){if(i.has(c)){r.splice(s--,1);break}i.add(c)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let n=this._activeProviderReplies.get(e),r=!1;for(let s=0;s<e;s++)(!this._activeProviderReplies.has(s)||this._activeProviderReplies.get(s))&&(r=!0);if(!r&&n){let s=n.find(a=>this._linkAtPosition(a.link,t));s&&(i=!0,this._handleNewLink(s))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let s=0;s<this._activeProviderReplies.size;s++){let a=this._activeProviderReplies.get(s)?.find(o=>this._linkAtPosition(o.link,t));if(a){i=!0,this._handleNewLink(a);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&m8(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,No(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?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!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:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let n=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(n,r),this._lastMouseEvent)){let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._askForLink(s,!1)}})))}_linkHover(e,t,i){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(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,n=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-n-1,i.end.x,i.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){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(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=n}_positionFromMouseEvent(e,t,i){let n=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,n,r){return{x1:e,y1:t,x2:i,y2:n,cols:this._bufferService.cols,fg:r}}};Y0=Bt([oe(1,X0),oe(2,Ls),oe(3,en),oe(4,sR)],Y0);g8=class extends o8{constructor(e={}){super(e),this._linkifier=this._register(new oc),this.browser=AR,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new oc),this._onCursorMove=this._register(new ee),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ee),this.onKey=this._onKey.event,this._onRender=this._register(new ee),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ee),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ee),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ee),this.onBell=this._onBell.event,this._onFocus=this._register(new ee),this._onBlur=this._register(new ee),this._onA11yCharEmitter=this._register(new ee),this._onA11yTabEmitter=this._register(new ee),this._onWillOpen=this._register(new ee),this._setup(),this._decorationService=this._instantiationService.createInstance(d8),this._instantiationService.setService(fd,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(rU),this._instantiationService.setService(sR,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(u0)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(mi.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(mi.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(mi.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(mi.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(St(()=>{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 i,n="";switch(t.index){case 256:i="foreground",n="10";break;case 257:i="background",n="11";break;case 258:i="cursor",n="12";break;default:i="ansi",n="4;"+t.index}switch(t.type){case 0:let r=yt.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${W.ESC}]${n};${t8(r)}${R0.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(s=>s.ansi[t.index]=Ft.toColor(...t.color));else{let s=i;this._themeService.modifyColors(a=>a[s]=Ft.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_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(Fp,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.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(W.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 i=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),s=this._renderService.dimensions.css.cell.width*r,a=this.buffer.y*this._renderService.dimensions.css.cell.height,o=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=o+"px",this.textarea.style.top=a+"px",this.textarea.style.width=s+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ee(this.element,"copy",t=>{this.hasSelection()&&V6(t,this._selectionService)}));let e=t=>X6(t,this.textarea,this.coreService,this.optionsService);this._register(Ee(this.textarea,"paste",e)),this._register(Ee(this.element,"paste",e)),MR?this._register(Ee(this.element,"mousedown",t=>{t.button===2&&WM(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ee(this.element,"contextmenu",t=>{WM(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),ry&&this._register(Ee(this.element,"auxclick",t=>{t.button===1&&XO(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ee(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ee(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ee(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ee(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ee(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ee(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ee(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new 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(Ee(this.screenElement,"mousemove",r=>this.updateCursorStyle(r))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",o0.get()),DR||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",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(iU,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Ds,this._coreBrowserService),this._register(Ee(this.textarea,"focus",r=>this._handleTextAreaFocus(r))),this._register(Ee(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(z0,this._document,this._helperContainer),this._instantiationService.setService(Wp,this._charSizeService),this._themeService=this._instantiationService.createInstance(U0),this._instantiationService.setService(lc,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Hp),this._instantiationService.setService(rR,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(P0,this.rows,this.screenElement)),this._instantiationService.setService(Ls,this._renderService),this._register(this._renderService.onRenderedViewportChange(r=>this._onRender.fire(r))),this.onResize(r=>this._renderService.resize(r.cols,r.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(D0,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(B0),this._instantiationService.setService(X0,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(Y0,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(M0,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(r=>{super.scrollLines(r,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(H0,this.element,this.screenElement,n)),this._instantiationService.setService(rP,this._selectionService),this._register(this._selectionService.onRequestScrollLines(r=>this.scrollLines(r.amount,r.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(r=>this._renderService.handleSelectionChanged(r.start,r.end,r.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(r=>{this.textarea.value=r,this.textarea.focus(),this.textarea.select()})),this._register(mi.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(O0,this.screenElement)),this._register(Ee(this.element,"mousedown",r=>this._selectionService.handleMouseDown(r))),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(Fp,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",r=>this._handleScreenReaderModeOptionChange(r))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Pp,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",r=>{!this._overviewRulerRenderer&&r&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Pp,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(I0,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(s){let a=e._mouseService.getMouseReportCoords(s,e.screenElement);if(!a)return!1;let o,l;switch(s.overrideType||s.type){case"mousemove":l=32,s.buttons===void 0?(o=3,s.button!==void 0&&(o=s.button<3?s.button:3)):o=s.buttons&1?0:s.buttons&4?1:s.buttons&2?2:3;break;case"mouseup":l=0,o=s.button<3?s.button:3;break;case"mousedown":l=1,o=s.button<3?s.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(s)===!1)return!1;let c=s.deltaY;if(c===0||e.coreMouseService.consumeWheelEvent(s,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;l=c<0?0:1,o=4;break;default:return!1}return l===void 0||o===void 0||o>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:o,action:l,ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:s=>(i(s),s.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(s)),wheel:s=>(i(s),this.cancel(s,!0)),mousedrag:s=>{s.buttons&&i(s)},mousemove:s=>{s.buttons||i(s)}};this._register(this.coreMouseService.onProtocolChange(s=>{s?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(s)),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()),s&8?n.mousemove||(t.addEventListener("mousemove",r.mousemove),n.mousemove=r.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),s&16?n.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),n.wheel=r.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),s&2?n.mouseup||(n.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),s&4?n.mousedrag||(n.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ee(t,"mousedown",s=>{if(s.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(s)))return i(s),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(s)})),this._register(Ee(t,"wheel",s=>{if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(s)===!1)return!1;if(!this.buffer.hasScrollback){if(s.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(s,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(s,!0);let a=W.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(s.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(a,!0),this.cancel(s,!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){VO(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 new 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 new 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,i){this._selectionService.setSelection(e,t,i)}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 i=c8(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let n=this.rows-1;return this.scrollLines(i.type===2?-n:n),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.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((i.key===W.ETX||i.key===W.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=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"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(_8(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(jt));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(W.ESC+"[I"):this.coreService.triggerDataEvent(W.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.ESC}[4;${i};${t}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(`${W.ESC}[6;${r};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};v8=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},b8=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 er)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},jO=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 b8(t)}getNullCell(){return new er}},y8=class extends Oe{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ee),this.onBufferChange=this._onBufferChange.event,this._normal=new jO(this._core.buffers.normal,"normal"),this._alternate=new jO(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 new 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)}},S8=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,n)=>t(i,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)}},w8=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}},x8=["cols","rows"],Jr=0,$R=class extends Oe{constructor(e){super(),this._core=this._register(new g8(e)),this._addonManager=this._register(new v8),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],i=(n,r)=>{this._checkReadonlyOptions(n),this._core.options[n]=r};for(let n in this._core.options){let r={get:t.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this._publicOptions,n,r)}}_checkReadonlyOptions(e){if(x8.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new 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||(this._parser=new S8(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w8(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._buffer=this._register(new y8(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";break}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,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}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
|
|
`,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 o0.get()},set promptLabel(e){o0.set(e)},get tooMuchOutput(){return l0.get()},set tooMuchOutput(e){l0.set(e)}}}_verifyIntegers(...e){for(Jr of e)if(Jr===1/0||isNaN(Jr)||Jr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Jr of e)if(Jr&&(Jr===1/0||isNaN(Jr)||Jr%1!==0||Jr<0))throw new Error("This API only accepts positive integers")}}});var E8,k8,KR,GR=se(()=>{E8=2,k8=1,KR=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,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),a={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},o=a.top+a.bottom,l=a.right+a.left,c=n-o,u=r-l-t;return{cols:Math.max(E8,Math.floor(u/e.css.cell.width)),rows:Math.max(k8,Math.floor(c/e.css.cell.height))}}}});var jR=se(()=>{});function C8(){let e=document.documentElement.dataset.theme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function sy(){return C8()?{background:"#0c0c0c",foreground:"#cccccc",cursor:"#cccccc",cursorAccent:"#0c0c0c",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#0c0c0c",red:"#f14c4c",green:"#23d18b",yellow:"#f5f543",blue:"#3b8eea",magenta:"#d670d6",cyan:"#29b8db",white:"#cccccc",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff"}:{background:"#ffffff",foreground:"#1e1e1e",cursor:"#1e1e1e",cursorAccent:"#ffffff",selectionBackground:"#add6ff",selectionForeground:"#1e1e1e",black:"#000000",red:"#cd3131",green:"#00bc00",yellow:"#949800",blue:"#0451a5",magenta:"#bc05bc",cyan:"#0598bc",white:"#555555",brightBlack:"#666666",brightRed:"#cd3131",brightGreen:"#14ce14",brightYellow:"#b5ba00",brightBlue:"#0451a5",brightMagenta:"#bc05bc",brightCyan:"#0598bc",brightWhite:"#a5a5a5"}}var YR=se(()=>{});function VR(){let{projects:e,threads:t}=Ge(),i=ue(),n=t.find(y=>y.id===i.currentThreadId)??null,r=n?e.find(y=>y.id===n.projectId):e.find(y=>y.id===i.currentProjectId),s=r?.id??null,[a,o]=(0,_i.useState)([]),[l,c]=(0,_i.useState)(null),[u,d]=(0,_i.useState)(null),h=(0,_i.useCallback)(async()=>{if(!s){o([]);return}try{let y=await V.call("terminal.list",{projectId:s});o(y),c(m=>m&&y.some(v=>v.id===m)?m:y[0]?.id??null)}catch{}},[s]);(0,_i.useEffect)(()=>{h()},[h]),(0,_i.useEffect)(()=>V.subscribe("terminals",(m,v)=>{let b=v;b?.type==="terminal.exit"&&(o(w=>w.filter(k=>k.id!==b.id)),c(w=>w===b.id?null:w))}),[]);let f=async()=>{if(s)try{let y=await V.call("terminal.create",{projectId:s,cols:100,rows:28});await h(),c(y.id)}catch(y){we(g("terminal.failNew")+Xe(y),!0)}},p=async y=>{try{await V.call("terminal.kill",{id:y.id}),o(m=>m.filter(v=>v.id!==y.id)),c(m=>m===y.id?null:m)}catch(m){we(g("terminal.failKill")+Xe(m),!0)}};if(!r)return(0,ni.jsx)("div",{className:"pn-empty",children:g("panel.pickProject")});let _=a.find(y=>y.id===l)??null;return(0,ni.jsxs)(ni.Fragment,{children:[(0,ni.jsxs)("div",{className:"tm-tabs",children:[a.map(y=>(0,ni.jsxs)("button",{className:`tm-tab${y.id===l?" on":""}`,onClick:()=>c(y.id),title:y.title,children:[y.title,(0,ni.jsx)("span",{className:"tm-x",onClick:m=>{m.stopPropagation(),d(y)},children:"\xD7"})]},y.id)),(0,ni.jsx)("button",{className:"ibtn",title:g("terminal.new"),onClick:()=>{f()},children:(0,ni.jsx)(ie,{name:"plus",size:14})})]}),_?.simple&&(0,ni.jsx)("div",{className:"tm-note",children:g("terminal.simpleNote")}),(0,ni.jsxs)("div",{className:"tm-body",children:[a.length===0&&(0,ni.jsxs)("div",{className:"pn-empty",children:[g("terminal.noTerm"),(0,ni.jsx)("div",{style:{marginTop:8},children:(0,ni.jsx)("button",{className:"btn primary",onClick:()=>{f()},children:g("terminal.new")})})]}),a.map(y=>(0,ni.jsx)(T8,{term:y,visible:y.id===l},y.id))]}),u&&(0,ni.jsx)(Fl,{title:g("terminal.closeTitle"),body:pe("terminal.closeBody",{title:u.title}),okLabel:g("terminal.closeOk"),danger:!0,onOk:()=>{p(u)},onClose:()=>d(null)})]})}function T8({term:e,visible:t}){let i=(0,_i.useRef)(null),n=(0,_i.useRef)(null),r=(0,_i.useRef)(null),[s,a]=(0,_i.useState)(!1);return(0,_i.useEffect)(()=>{let o=i.current;if(!o)return;let l=new $R({fontFamily:'"Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, Monaco, "DejaVu Sans Mono", "Ubuntu Mono", "Microsoft YaHei UI", "PingFang SC", "Noto Sans Mono CJK SC", monospace',fontSize:13,lineHeight:1.25,cursorBlink:!0,scrollback:5e3,allowTransparency:!1,theme:sy()}),c=new KR;l.loadAddon(c),l.open(o),n.current=l,r.current=c;try{c.fit()}catch{}let u=new TextDecoder,d=new TextEncoder,h=V.onBinaryFrame((f,p,_)=>{p!==e.index||f!==1||l.write(u.decode(_))});return l.onData(f=>V.sendBinary(2,e.index,d.encode(f))),(async()=>{try{let f=await V.call("terminal.attach",{id:e.id});f.windowsPty&&(l.options.windowsPty=f.windowsPty),f.snapshot&&l.write(f.snapshot),a(!0)}catch{l.writeln(g("terminal.ended"))}})(),()=>{h(),l.dispose(),n.current=null,r.current=null}},[e.id,e.index]),(0,_i.useEffect)(()=>{let o=document.documentElement,l=()=>{let d=n.current;d&&(d.options.theme=sy())},c=new MutationObserver(l);c.observe(o,{attributes:!0,attributeFilter:["data-theme"]});let u=window.matchMedia("(prefers-color-scheme: dark)");return u.addEventListener("change",l),()=>{c.disconnect(),u.removeEventListener("change",l)}},[]),(0,_i.useEffect)(()=>{if(!t)return;let o=r.current,l=n.current;if(!o||!l||!s)return;let c=setTimeout(()=>{try{o.fit();let u=new TextEncoder;V.sendBinary(3,e.index,u.encode(JSON.stringify({cols:l.cols,rows:l.rows})))}catch{}},50);return()=>clearTimeout(c)},[t,s,e.index]),(0,_i.useEffect)(()=>{let o=i.current;if(!o)return;let l=new ResizeObserver(()=>{let c=r.current,u=n.current;if(!(!c||!u||!t))try{c.fit();let d=new TextEncoder;V.sendBinary(3,e.index,d.encode(JSON.stringify({cols:u.cols,rows:u.rows})))}catch{}});return l.observe(o),()=>l.disconnect()},[t,e.index]),(0,ni.jsx)("div",{className:"tm-view",ref:i,style:{display:t?"block":"none"}})}var _i,ni,XR=se(()=>{_i=te(mt(),1);WR();GR();Qi();Nn();Pi();An();$l();fr();kt();jR();YR();ni=te(_e(),1)});function ZR(){let e=ue(),t=Ge(z=>z.threads),i=e.currentThreadId,n=fc(i),r=yi(z=>z.byThread[n]),s=t.find(z=>z.id===i)??null,a=(0,tr.useRef)(null),[o,l]=(0,tr.useState)(""),[c,u]=(0,tr.useState)(!1),[d,h]=(0,tr.useState)(null),f=(0,tr.useRef)(null);(0,tr.useEffect)(()=>{let z=yi.getState(),q=z.byThread[n];if(q&&q.proxyHref)return;let B=q?.url??s?.previewUrl??null;B&&z.navigate(gd,n,i,B,{push:!1})},[n,i,s?.previewUrl]);let p=r?.origin,_=!!r?.proxyOrigin;(0,tr.useEffect)(()=>{if(!(!p||!_))return()=>{let z=yi.getState(),q=fc(ue.getState().currentThreadId),B=ue.getState().panelOpen&&ue.getState().panelTab==="preview"&&z.byThread[q]?.origin===p&&q!==n;z.detach(n),B||V.call("preview.release",{url:p}).catch(()=>{})}},[p,_,n]),(0,tr.useEffect)(()=>{c||l(r?Ad(r.url):"")},[r?.url,c]),(0,tr.useEffect)(()=>{let z=q=>{let B=a.current?.contentWindow;if(!B||q.source!==B)return;let I=q.data;if(!I||typeof I!="object"||I.ac_preview!==1||typeof I.href!="string")return;let x=yi.getState().byThread[n];if(!x?.proxyOrigin)return;let H=Ky(I.href.slice(0,2048),x.proxyOrigin,x.origin),T=ns(H);if(!T.ok||T.target.origin!==x.origin)return;let L=typeof I.title=="string"?I.title.slice(0,200):"";yi.getState().reported(n,T.target.href,L),i&&T.target.href!==x.url&&(f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{V.call("threads.update",{id:i,previewUrl:T.target.href}).catch(()=>{})},800))};return window.addEventListener("message",z),()=>window.removeEventListener("message",z)},[n,i]);let y=z=>{let q=z.trim();if(!q)return;let B=ns(q);if(!B.ok){h(q);return}h(null),u(!1),yi.getState().navigate(gd,n,i,B.target.href,{push:!0})},m=z=>{try{a.current?.contentWindow?.postMessage({ac_preview_cmd:z},"*")}catch{}},v=()=>{if(r?.bridged)return m("back");let z=yi.getState().step(n,-1);z&&yi.getState().navigate(gd,n,i,z,{push:!1})},b=()=>{if(r?.bridged)return m("forward");let z=yi.getState().step(n,1);z&&yi.getState().navigate(gd,n,i,z,{push:!1})},w=()=>{if(r){if(r.error||!r.proxyHref){yi.getState().navigate(gd,n,i,r.url,{push:!1});return}r.bridged?m("reload"):yi.getState().reload(n)}},k=!!r&&(r.bridged||r.idx>0),O=!!r&&(r.bridged||r.idx<r.stack.length-1),N=r?bm(r.url):null,C=d?bm(/^[a-z][a-z0-9+.-]*:\/\//i.test(d)?d:`https://${d}`):null,M=()=>e.setPanelWidth(Math.min(yu,ys({...ue.getState(),panelOpen:!0})));return(0,at.jsxs)("div",{className:"pv",children:[(0,at.jsxs)("div",{className:"pv-bar",children:[(0,at.jsx)("button",{type:"button",className:"ibtn",title:g("preview.back"),"aria-label":g("preview.back"),disabled:!k,onClick:v,children:(0,at.jsx)(ie,{name:"arrowLeft",size:15})}),(0,at.jsx)("button",{type:"button",className:"ibtn",title:g("preview.forward"),"aria-label":g("preview.forward"),disabled:!O,onClick:b,children:(0,at.jsx)(ie,{name:"arrowRight",size:15})}),(0,at.jsx)("button",{type:"button",className:"ibtn",title:g("preview.reload"),"aria-label":g("preview.reload"),disabled:!r,onClick:w,children:(0,at.jsx)(ie,{name:"refresh",size:14})}),(0,at.jsx)("input",{className:`pv-addr${d?" err":""}`,value:o,spellCheck:!1,placeholder:g("preview.placeholder"),"aria-label":g("preview.address"),onFocus:z=>{u(!0),z.currentTarget.select()},onBlur:()=>{u(!1)},onChange:z=>{l(z.target.value),d&&h(null)},onKeyDown:z=>{z.nativeEvent.isComposing||(z.key==="Enter"?(z.preventDefault(),y(o)):z.key==="Escape"&&(u(!1),h(null),l(r?Ad(r.url):""),z.target.blur()))}}),(0,at.jsx)("button",{type:"button",className:"ibtn",title:g("preview.openExternal"),"aria-label":g("preview.openExternal"),disabled:!N,onClick:()=>N&&void ks(N),children:(0,at.jsx)(ie,{name:"external",size:14})}),(0,at.jsx)("button",{type:"button",className:"ibtn",title:g("preview.widen"),"aria-label":g("preview.widen"),onClick:M,children:(0,at.jsx)(ie,{name:"widen",size:15})})]}),d&&(0,at.jsxs)("div",{className:"pv-note err",children:[(0,at.jsx)("span",{children:g("preview.onlyLocal")}),C&&(0,at.jsx)("button",{type:"button",className:"btn",onClick:()=>{ks(C),h(null)},children:g("preview.openExternal")})]}),r?.error&&(0,at.jsxs)("div",{className:"pv-note err",children:[(0,at.jsxs)("span",{children:[g("preview.failed"),Nr(r.error)]}),N&&(0,at.jsx)("button",{type:"button",className:"btn",onClick:()=>{ks(N)},children:g("preview.openExternal")}),(0,at.jsx)("button",{type:"button",className:"btn",onClick:w,children:g("common.retry")})]}),r?(0,at.jsxs)("div",{className:"pv-frame-wrap",children:[r.loading&&(0,at.jsx)("div",{className:"pv-loading"}),r.proxyHref&&(0,at.jsx)("iframe",{ref:a,className:"pv-frame",title:r.title||Ad(r.url),src:r.proxyHref,referrerPolicy:"no-referrer"},`${r.proxyOrigin}|${r.nonce}`)]}):(0,at.jsxs)("div",{className:"pv-empty",children:[(0,at.jsx)("div",{children:g("preview.empty")}),(0,at.jsx)("div",{className:"pv-hint",children:g("preview.limits")})]})]})}var tr,at,gd,QR=se(()=>{tr=te(mt(),1);Pi();Qi();Nn();Md();Cd();Lu();kt();An();Cf();at=te(_e(),1),gd=(e,t)=>V.call(e,t)});function JR(){let e=ue(),t=[{tab:"changes",label:g("panel.changes")},{tab:"files",label:g("panel.files")},{tab:"terminal",label:g("panel.terminal")},{tab:"preview",label:g("preview.tab")}];return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)("div",{className:"pn-head",children:[(0,ae.jsx)("div",{className:"pn-tabs",children:t.map(i=>(0,ae.jsx)("button",{className:`pn-tab${e.panelTab===i.tab?" on":""}`,onClick:()=>e.setPanelTab(i.tab),children:i.label},i.tab))}),(0,ae.jsx)("button",{className:"ibtn pn-close",title:g("panel.closeTitle"),onClick:()=>e.closePanel(),children:(0,ae.jsx)(ie,{name:"x"})})]}),(0,ae.jsxs)("div",{className:"pn-body",children:[e.panelTab==="changes"&&(0,ae.jsx)(O8,{}),e.panelTab==="files"&&(0,ae.jsx)(D8,{}),e.panelTab==="terminal"&&(0,ae.jsx)(VR,{}),e.panelTab==="preview"&&e.panelOpen&&(0,ae.jsx)(ZR,{})]})]})}function A8(e){let t=[],i=null;for(let n of e.split(`
|
|
`))if(!(n.startsWith("diff ")||n.startsWith("index ")||n.startsWith("--- ")||n.startsWith("+++ "))){if(n.startsWith("@@")){i={head:n,lines:[]},t.push(i);continue}i&&(n.startsWith("+")?i.lines.push({t:"+",text:n.slice(1)}):n.startsWith("-")?i.lines.push({t:"-",text:n.slice(1)}):n.startsWith("\\")?i.lines.push({t:" ",text:n}):i.lines.push({t:" ",text:n.startsWith(" ")?n.slice(1):n}))}return t}function M8(e){let t=0,i=0;for(let n of e.split(`
|
|
`))n.startsWith("+")&&!n.startsWith("+++")?t++:n.startsWith("-")&&!n.startsWith("---")&&i++;return{add:t,del:i}}function O8(){let{projects:e,threads:t}=Ge(),i=ue(),n=Mi(C=>C.status),[r,s]=(0,wt.useState)(null),[a,o]=(0,wt.useState)(!1),[l,c]=(0,wt.useState)(null),[u,d]=(0,wt.useState)(null),[h,f]=(0,wt.useState)(null),[p,_]=(0,wt.useState)({}),y=(0,wt.useRef)(n),m=(0,wt.useRef)(null);m.current=l;let v=t.find(C=>C.id===i.currentThreadId)??null,b=v?e.find(C=>C.id===v.projectId):e.find(C=>C.id===i.currentProjectId),w=b?.id??null,k=(0,wt.useCallback)(async()=>{if(!w){s(null);return}try{let C=await V.call("git.status",{projectId:w});s(C);let M=m.current;M&&!C.files?.some(z=>z.path===M)&&(c(null),d(null))}catch(C){s({isRepo:!1,error:String(C?.message??C)})}},[w]);(0,wt.useEffect)(()=>{k();let C=setInterval(()=>{k()},3e3);return()=>clearInterval(C)},[k]),(0,wt.useEffect)(()=>{let C=y.current;y.current=n,(C==="running"||C==="initializing")&&n!=="running"&&n!=="initializing"&&k()},[n,k]);let O=(0,wt.useCallback)(async C=>{if(w){c(C.path),d({loading:!0});try{let M=await V.call("git.diff",{projectId:w,path:C.path});if(M.tooLarge)d({tooLarge:!0});else if(M.error)d({error:M.error});else{let z=A8(M.diff??"");d({hunks:z}),_(q=>({...q,[C.path]:M8(M.diff??"")}))}}catch(M){d({error:String(M?.message??M)})}}},[w]),N=(0,wt.useCallback)(async C=>{if(w){o(!0);try{await V.call("git.discard",{projectId:w,path:C.path}),l===C.path&&(c(null),d(null)),await k()}catch(M){we(g("panel.failDiscard")+Xe(M),!0)}finally{o(!1)}}},[w,l,k]);return b?r&&!r.isRepo?(0,ae.jsxs)("div",{className:"pn-empty",children:[g("panel.notGit"),r.error&&(0,ae.jsx)("div",{className:"pn-empty-sub",children:r.error})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)("div",{className:"chg-head",children:[(0,ae.jsxs)("span",{className:"chg-branch",title:g("panel.branch"),children:[(0,ae.jsx)(ie,{name:"changes",size:13})," ",r?.branch??"\u2026"]}),(0,ae.jsx)("button",{className:"ibtn",title:g("common.refresh"),onClick:()=>{k()},children:(0,ae.jsx)(ie,{name:"refresh",size:14})})]}),(0,ae.jsxs)("div",{className:"chg-list",children:[(r?.files??[]).length===0&&(0,ae.jsx)("div",{className:"pn-empty",children:g("panel.clean")}),r?.files?.map(C=>{let M=p[C.path];return(0,ae.jsxs)("div",{className:`chg-row${l===C.path?" on":""}`,onClick:()=>{O(C)},children:[(0,ae.jsx)("span",{className:`chg-kind k-${C.kind}`,title:C.kind,children:N8(C.kind)}),(0,ae.jsx)("span",{className:"chg-path",title:C.path,children:C.path}),M&&(0,ae.jsxs)("span",{className:"chg-stat",children:[(0,ae.jsxs)("em",{className:"add",children:["+",M.add]})," ",(0,ae.jsxs)("em",{className:"del",children:["\u2212",M.del]})]}),(0,ae.jsx)("button",{className:"ibtn chg-discard",title:g("panel.discardBtn"),disabled:a,onClick:z=>{z.stopPropagation(),f(C)},children:(0,ae.jsx)(ie,{name:"x",size:13})})]},C.path)})]}),(0,ae.jsxs)("div",{className:"chg-diff","data-quote-root":"panel","data-quote-src":l??void 0,children:[u?.loading&&(0,ae.jsx)("div",{className:"pn-empty",children:g("panel.loadingDiff")}),u?.tooLarge&&(0,ae.jsx)("div",{className:"pn-empty",children:g("panel.diffTooLarge")}),u?.error&&(0,ae.jsx)("div",{className:"pn-empty",children:u.error}),u?.hunks&&(0,ae.jsx)(hp,{hunks:u.hunks,path:l??void 0})]}),h&&(0,ae.jsx)(Fl,{title:g("panel.discardTitle"),body:h.kind==="untracked"?pe("panel.discardUntracked",{path:h.path}):pe("panel.discardTracked",{path:h.path}),okLabel:g("common.discard"),danger:!0,onOk:()=>{N(h)},onClose:()=>f(null)})]}):(0,ae.jsx)("div",{className:"pn-empty",children:g("panel.pickProject")})}function R8(e){window.dispatchEvent(new CustomEvent("ac-insert-mention",{detail:e}))}function D8(){let{projects:e,threads:t}=Ge(),i=ue(),n=t.find(k=>k.id===i.currentThreadId)??null,r=n?e.find(k=>k.id===n.projectId):e.find(k=>k.id===i.currentProjectId),s=r?.id??null,[a,o]=(0,wt.useState)({}),[l,c]=(0,wt.useState)(null),[u,d]=(0,wt.useState)(null),[h,f]=(0,wt.useState)(null),p=(0,wt.useCallback)(async k=>{if(s){o(O=>({...O,[k]:"loading"}));try{let O=await V.call("files.tree",{projectId:s,dir:k});o(N=>({...N,[k]:O.error?`err:${O.error}`:O.entries??[]}))}catch(O){o(N=>({...N,[k]:`err:${String(O?.message??O)}`}))}}},[s]);(0,wt.useEffect)(()=>{o({}),c(null),d(null),s&&p(".")},[s,p]);let _=k=>{if(!k.isDir){y(k.path);return}let O=a[k.path];O&&O!=="loading"?o(N=>{let C={...N};return delete C[k.path],C}):O||p(k.path)},y=async k=>{if(s){c(k),d({loading:!0});try{let O=await V.call("files.read",{projectId:s,path:k});d(O)}catch(O){d({error:String(O?.message??O)})}}},m=(0,wt.useRef)(null);if((0,wt.useEffect)(()=>{let k=m.current;if(!(!k||!u?.text))try{Zf.highlightElement(k)}catch{}},[u?.text,u?.language]),!r)return(0,ae.jsx)("div",{className:"pn-empty",children:g("panel.pickProject")});let v=l?l.split("/"):[],b=(k,O)=>{let N=a[k];return!N||N==="loading"?null:typeof N=="string"?(0,ae.jsx)("div",{className:"ft-err",style:{paddingLeft:8+O*14},children:N.slice(4)}):N.map(C=>(0,ae.jsxs)("div",{children:[(0,ae.jsxs)("div",{className:`ft-row${l===C.path?" on":""}`,style:{paddingLeft:8+O*14},onClick:()=>_(C),title:C.path,draggable:!0,onDragStart:M=>{M.dataTransfer.effectAllowed="copy",M.dataTransfer.setData(nc,JSON.stringify({projectId:r.id,rel:C.path,isDir:C.isDir})),M.dataTransfer.setData("text/plain",rc(r.path,C.path))},onContextMenu:M=>{M.preventDefault(),f({x:M.clientX,y:M.clientY,entry:C})},children:[C.isDir?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("span",{className:`caret${a[C.path]&&a[C.path]!=="loading"?" open":""}`,children:"\u203A"}),(0,ae.jsx)(ie,{name:"files",size:13})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("span",{className:"caret",style:{visibility:"hidden"},children:"\u203A"}),(0,ae.jsx)("span",{className:"ft-dot"})]}),(0,ae.jsx)("span",{className:"ft-name",children:C.name})]}),C.isDir&&b(C.path,O+1)]},C.path))},w=h?[{kind:"item",label:g("mention.add"),onClick:()=>R8({projectId:r.id,rel:h.entry.path,isDir:h.entry.isDir})},{kind:"sep"},{kind:"item",label:g("common.copyPath"),onClick:()=>{gr(rc(r.path,h.entry.path)),we(g("common.copiedPath"))}},{kind:"item",label:g("mention.copyRel"),onClick:()=>{gr(h.entry.path),we(g("common.copiedPath"))}}]:[];return(0,ae.jsxs)(ae.Fragment,{children:[h&&(0,ae.jsx)(oo,{x:h.x,y:h.y,items:w,onClose:()=>f(null)}),(0,ae.jsx)("div",{className:"ft-crumbs",children:l?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("button",{className:"ft-crumb",onClick:()=>c(null),title:g("panel.closePreview"),children:"\xD7"}),v.map((k,O)=>(0,ae.jsxs)("span",{className:"ft-crumb-t",children:[O>0?"/":"",k]},O)),(0,ae.jsx)("button",{className:"ibtn",title:g("common.copyPath"),onClick:()=>{gr(l),we(g("common.copiedPath"))},children:(0,ae.jsx)(ie,{name:"copy",size:13})})]}):(0,ae.jsx)("span",{className:"ft-crumb-t muted",children:r.name})}),(0,ae.jsx)("div",{className:"ft-tree",children:b(".",0)}),l&&(0,ae.jsxs)("div",{className:"ft-view","data-quote-root":"panel","data-quote-src":l,children:[u?.loading&&(0,ae.jsx)("div",{className:"pn-empty",children:g("panel.reading")}),u?.binary&&(0,ae.jsx)("div",{className:"pn-empty",children:g("panel.binary")}),u?.tooLarge&&(0,ae.jsx)("div",{className:"pn-empty",children:g("panel.tooLarge")}),u?.error&&(0,ae.jsx)("div",{className:"pn-empty",children:u.error}),u?.text!=null&&(0,ae.jsx)("pre",{className:"ft-pre",children:(0,ae.jsx)("code",{ref:m,className:`language-${u.language??"plaintext"}`,children:u.text})})]})]})}var wt,ae,N8,e2=se(()=>{wt=te(mt(),1);Qi();Nn();So();Pi();An();qu();$l();fr();kt();XR();QR();Mf();pp();Iu();hb();ae=te(_e(),1);N8=e=>g(`panel.gitKind.${e}`)});function t2(){let{state:e,version:t}=Kr(),i=Mi(l=>l.pending),n=Ge(l=>l.providers),[r,s]=(0,_d.useState)(!1),[a,o]=(0,_d.useState)(!1);return(0,_d.useEffect)(()=>{let l=u=>{(u.ctrlKey||u.metaKey)&&u.key.toLowerCase()==="k"&&(u.preventDefault(),s(d=>!d))},c=()=>o(!0);return window.addEventListener("keydown",l),window.addEventListener("open-settings",c),()=>{window.removeEventListener("keydown",l),window.removeEventListener("open-settings",c)}},[]),e==="down"?(0,vi.jsx)("div",{className:"boot-screen",children:(0,vi.jsxs)("div",{className:"boot-wrap",children:[(0,vi.jsx)("span",{children:g("boot.serviceDown")}),(0,vi.jsx)("button",{className:"btn primary",onClick:()=>{wf()?xf():Sf()||location.reload()},children:g("boot.retry")})]})}):e==="connecting"&&!t?(0,vi.jsxs)("div",{className:"boot-screen",children:[(0,vi.jsx)("div",{className:"boot-dot","data-state":e}),(0,vi.jsx)("span",{className:"boot-label",children:g("boot.connecting")})]}):(0,vi.jsxs)(Ok,{sidebar:(0,vi.jsx)(qk,{pendingByThread:new Set(i.map(l=>Mi.getState().threadId).filter(Boolean))}),topbar:(0,vi.jsx)(ZN,{pendingCount:i.length,pendingKey:i[0]?.key}),panel:(0,vi.jsx)(JR,{}),children:[e==="reconnecting"&&(0,vi.jsx)("div",{className:"connbar",children:g("boot.reconnecting")}),(0,vi.jsx)(BM,{}),r&&(0,vi.jsx)(UM,{onClose:()=>s(!1)}),a&&(0,vi.jsx)(_M,{onClose:()=>o(!1),providers:n}),(0,vi.jsx)(Hk,{})]})}var _d,vi,i2=se(()=>{bu();Rk();Lv();QN();PM();So();Nn();_d=te(mt(),1);qM();e2();bp();fr();kt();Cv();vi=te(_e(),1)});function n2(){let{state:e,version:t}=Kr(),[i,n]=(0,Wi.useState)([]),[r,s]=(0,Wi.useState)([]),[a,o]=(0,Wi.useState)(""),[l,c]=(0,Wi.useState)(""),[u,d]=(0,Wi.useState)([]),[h,f]=(0,Wi.useState)([]),[p,_]=(0,Wi.useState)([]),[y,m]=(0,Wi.useState)(""),[v,b]=(0,Wi.useState)(""),w=(0,Wi.useRef)(null);(0,Wi.useEffect)(()=>{e==="open"&&(Oa("projects.list").then(M=>n(M??[])),Oa("threads.list").then(M=>s(M??[])))},[e]),(0,Wi.useEffect)(()=>{if(w.current?.(),w.current=null,d([]),f([]),_([]),!(!l||e!=="open"))return Oa("threads.get",{id:l}).then(M=>{let z=M;d(z.events??[]),f(z.pending??[]),_(z.queue??[])}),w.current=V.subscribe(`thread:${l}`,(M,z)=>{let q=z;if(q.type==="event"&&q.event&&(d(B=>[...B,q.event]),q.event.type==="permission_resolved"||q.event.type==="question_answered")){let B=q.event.requestId;f(I=>I.filter(x=>x.requestId!==B))}q.type==="queue"&&q.queue&&_(q.queue)}),()=>w.current?.()},[l,e]),(0,Wi.useEffect)(()=>{let M=u.filter(B=>B.type==="permission_request"||B.type==="question"),z=new Set(u.filter(B=>B.type==="permission_resolved"||B.type==="question_answered").map(B=>B.requestId)),q=M.filter(B=>!z.has(B.requestId)).map(B=>({requestId:B.requestId??"",kind:B.type==="question"?"question":"permission",options:B.options}));f(B=>{let I=new Map(B.map(x=>[x.requestId,x]));for(let x of q)I.set(x.requestId,x);return[...I.values()]})},[u]);let k=async()=>{if(!l)return;let M=await Oa("threads.get",{id:l}).catch(()=>null);M&&(d(M.events??[]),f(z=>{let q=new Map(z.map(B=>[B.requestId,B]));for(let B of M.pending??[])q.set(B.requestId,B);return[...q.values()]}),_(M.queue??[]))},O=async M=>{if(b(""),!l||!y.trim())return;let z=y;m("");try{await Oa("thread.send",{id:l,text:z,behavior:M})}catch(q){b(String(q?.message??q))}await k()},N=async(M,z,q)=>{await Oa("thread.respond",{id:l,requestId:M,optionId:z,answers:q}).catch(B=>b(String(B?.message??B))),setTimeout(()=>{k()},1500)},C=async()=>{if(!a)return;let M=await Oa("threads.create",{projectId:a,provider:"mock"}).catch(z=>(b(String(z?.message??z)),null));M&&(s(z=>[M,...z]),c(M.id))};return(0,xt.jsxs)("div",{style:{display:"flex",height:"100vh",font:"13px/1.5 system-ui",color:"var(--fg)"},children:[(0,xt.jsxs)("div",{style:{width:260,borderRight:"1px solid var(--border)",padding:12,overflowY:"auto"},children:[(0,xt.jsx)("div",{style:{marginBottom:8},children:e==="open"?`\u5DF2\u8FDE\u63A5 \xB7 ${t??""}`:"\u8FDE\u63A5\u4E2D\u2026"}),(0,xt.jsx)(pn,{className:"tinput sm-field",matchWidth:!0,ariaLabel:"\u9009\u62E9\u9879\u76EE",value:a,onChange:o,options:[{value:"",label:"\u9009\u62E9\u9879\u76EE"},...i.map(M=>({value:M.id,label:M.name}))]}),(0,xt.jsx)("button",{onClick:()=>{C()},disabled:!a,style:{width:"100%",marginTop:8},children:"\u65B0\u5EFA\u5BF9\u8BDD\uFF08mock\uFF09"}),(0,xt.jsx)("div",{style:{marginTop:12},children:r.filter(M=>!a||M.projectId===a).map(M=>(0,xt.jsxs)("div",{onClick:()=>c(M.id),style:{padding:"6px 8px",cursor:"pointer",borderRadius:4,background:M.id===l?"var(--bg-active, #333)":"transparent"},children:[M.title," ",(0,xt.jsxs)("span",{style:{opacity:.6},children:["(",M.status,")"]})]},M.id))})]}),(0,xt.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[(0,xt.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:12},children:[u.map((M,z)=>(0,xt.jsx)("pre",{style:{margin:"4px 0",fontSize:11,whiteSpace:"pre-wrap",borderBottom:"1px solid var(--border)",paddingBottom:4},children:(M.seq??"")+" "+(M.type??"?")+" "+JSON.stringify(M).slice(0,400)},z)),h.map(M=>(0,xt.jsxs)("div",{style:{border:"1px solid var(--warn, orange)",borderRadius:6,padding:8,margin:"8px 0"},children:[(0,xt.jsxs)("div",{children:["\u6388\u6743/\u63D0\u95EE ",M.requestId]}),M.options?.map(z=>(0,xt.jsx)("button",{onClick:()=>{N(M.requestId,z.id)},style:{marginRight:8},children:z.label},z.id)),M.kind==="question"&&(0,xt.jsx)("button",{onClick:()=>{N(M.requestId,void 0,{q1:"staging",q2:""})},children:"\u586B\u8868\u63D0\u4EA4"}),(0,xt.jsx)("button",{onClick:()=>{N(M.requestId,void 0,void 0)},children:"\u53D6\u6D88"})]},M.requestId))]}),p.length>0&&(0,xt.jsxs)("div",{style:{padding:"4px 12px",opacity:.7},children:["\u6392\u961F\u4E2D\uFF1A",p.length," \u6761"]}),v&&(0,xt.jsx)("div",{style:{padding:"4px 12px",color:"var(--danger, red)"},children:v}),(0,xt.jsxs)("div",{style:{display:"flex",gap:8,padding:12,borderTop:"1px solid var(--border)"},children:[(0,xt.jsx)("input",{value:y,onChange:M=>m(M.target.value),onKeyDown:M=>{M.key==="Enter"&&O()},placeholder:"/perm /plan /slow /exit \u2026",style:{flex:1}}),(0,xt.jsx)("button",{onClick:()=>{O()},children:"\u53D1\u9001"}),(0,xt.jsx)("button",{onClick:()=>{O("steer")},children:"\u63D2\u8BDD"}),(0,xt.jsx)("button",{onClick:()=>{Oa("thread.interrupt",{id:l})},children:"\u6253\u65AD"})]})]})]})}var Wi,xt,Oa,r2=se(()=>{Wi=te(mt(),1);bu();Pi();gp();xt=te(_e(),1),Oa=(e,t)=>V.call(e,t)});function c2(){s2++,z8.render(I8?(0,ay.jsx)(n2,{}):(0,ay.jsx)(t2,{},`${La()}-${s2}`))}var a2,ay,L8,o2,V,l2,I8,z8,s2,Pi=se(()=>{Md();Qy();Jy();eS();tS();iS();a2=te(lk(),1);yv();gu();vk();kv();Cv();kt();Sk();bu();Qi();Nn();i2();r2();op();ay=te(_e(),1),L8=ic(),o2=new URLSearchParams(location.search);Yy(location.search);ck(location.search);dk(location.search);V=new Ef(L8,La());_k(e=>{!e.lang||!Vy(e.lang)||(V.setLang(La()),V.call("app.setLocale",{lang:La()}).catch(()=>{}),c2())});window.__ws=V;window.__stores={useData:Ge,useUi:ue,useConnection:Kr,usePreview:yi};Promise.resolve().then(()=>(So(),NA)).then(e=>{window.__tl=e.useTimeline});V.onState(e=>Kr.getState().set({state:e}));l2=wf();bk(V,()=>{l2?xf():Sf()});l2&&(yk(V),V.onState(e=>{if(e==="open")try{window.parent.postMessage({ac_console:"alive"},"*")}catch{}}));V.connect();V.waitHello().then(async e=>{Kr.getState().set({version:e.version??null}),ue.getState().bind(V);try{let t=await V.call("settings.get");ue.getState().hydrate(t),Wr(t.theme),_u(t)}catch{}await Ge.getState().bind(V)});setInterval(()=>V.ping(),1e4);I8=o2.get("debug")==="1",z8=(0,a2.createRoot)(document.getElementById("root")),s2=0;c2();o2.get("audit")==="1"&&setTimeout(()=>{try{let e=window.innerWidth,t=document.documentElement.scrollWidth,i=new Set,n=[],r=0,s=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim(),a=c=>c.top<window.innerHeight&&c.bottom>0&&c.width>0;document.querySelectorAll("*").forEach(c=>{let u=c,d=getComputedStyle(u),h=u.getBoundingClientRect();if(!a(h)||d.display==="none"||d.visibility==="hidden"||h.width<3||h.height<3)return;i.add(d.fontSize),d.borderTopWidth!=="0px"&&d.borderTopStyle!=="none"&&r++,d.borderBottomWidth!=="0px"&&d.borderBottomStyle!=="none"&&r++;let f=d.backgroundColor,p=d.color;if(s&&(f===s||p===s)){let _=(u.getAttribute("class")??"").split(" ")[0];n.includes(_)||n.push(_)}});let o={vw:e,docW:t,noHScroll:t<=e+1,fontSizes:[...i].sort(),bordersFirstScreen:r,accentEls:n},l=document.createElement("pre");l.id="audit",l.style.display="none",l.textContent=JSON.stringify(o),document.body.appendChild(l)}catch(e){let t=document.createElement("pre");t.id="audit",t.textContent=JSON.stringify({error:String(e)}),document.body.appendChild(t)}},1500)});Pi();})();
|
|
/*! Bundled license information:
|
|
|
|
react/cjs/react.production.js:
|
|
(**
|
|
* @license React
|
|
* react.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*)
|
|
|
|
scheduler/cjs/scheduler.production.js:
|
|
(**
|
|
* @license React
|
|
* scheduler.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*)
|
|
|
|
react-dom/cjs/react-dom.production.js:
|
|
(**
|
|
* @license React
|
|
* react-dom.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*)
|
|
|
|
react-dom/cjs/react-dom-client.production.js:
|
|
(**
|
|
* @license React
|
|
* react-dom-client.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*)
|
|
|
|
react/cjs/react-jsx-runtime.production.js:
|
|
(**
|
|
* @license React
|
|
* react-jsx-runtime.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*)
|
|
|
|
dompurify/dist/purify.es.mjs:
|
|
(*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE *)
|
|
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
|
|
|
|
@xterm/xterm/lib/xterm.mjs:
|
|
@xterm/addon-fit/lib/addon-fit.mjs:
|
|
(**
|
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
* @license MIT
|
|
*
|
|
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
* @license MIT
|
|
*
|
|
* Originally forked from (with the author's permission):
|
|
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
* http://bellard.org/jslinux/
|
|
* Copyright (c) 2011 Fabrice Bellard
|
|
*)
|
|
*/
|