teamcopilot 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/frontend/assets/{cssMode-DiiiM5B_.js → cssMode-DcNi8U1f.js} +1 -1
- package/dist/frontend/assets/{freemarker2-mbYRZM7v.js → freemarker2-qchF6xJx.js} +1 -1
- package/dist/frontend/assets/{handlebars-BxsvNCS_.js → handlebars-YuGUIDI6.js} +1 -1
- package/dist/frontend/assets/{html-L2JtNRP-.js → html-Bymr0Pmu.js} +1 -1
- package/dist/frontend/assets/{htmlMode-C6Ob6SpL.js → htmlMode-DBCwqW9X.js} +1 -1
- package/dist/frontend/assets/{index-Tanisj53.js → index-DJhaLMXX.js} +4 -4
- package/dist/frontend/assets/{javascript-B3VBQ2aj.js → javascript-DNveax_C.js} +1 -1
- package/dist/frontend/assets/{jsonMode-DBfewrrL.js → jsonMode-FNolO9rf.js} +1 -1
- package/dist/frontend/assets/{liquid-MsmHPgUq.js → liquid-BJOeA7Xj.js} +1 -1
- package/dist/frontend/assets/{mdx-b592lU5a.js → mdx-wQMBXlam.js} +1 -1
- package/dist/frontend/assets/{python-CRTDq_yq.js → python-Dm8r6f9J.js} +1 -1
- package/dist/frontend/assets/{razor-Bra6tOBG.js → razor-DgEdGyIF.js} +1 -1
- package/dist/frontend/assets/{tsMode-DboToZev.js → tsMode-C8gaaWwI.js} +1 -1
- package/dist/frontend/assets/{typescript-B1tKC8Cs.js → typescript-CJ_h9ueS.js} +1 -1
- package/dist/frontend/assets/{xml-DwtGsUdF.js → xml-dtW8lexD.js} +1 -1
- package/dist/frontend/assets/{yaml-BVE9WPwp.js → yaml-B6ngX1LG.js} +1 -1
- package/dist/frontend/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/javascript-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/javascript-DNveax_C.js","assets/typescript-CJ_h9ueS.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(n){if(n.ep)return;n.ep=!0;const o=t(n);fetch(n.href,o)}})();function Nz(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var $F={exports:{}},m0={};var jZ;function Z_e(){if(jZ)return m0;jZ=1;var s=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,n,o){var r=null;if(o!==void 0&&(r=""+o),n.key!==void 0&&(r=""+n.key),"key"in n){o={};for(var a in n)a!=="key"&&(o[a]=n[a])}else o=n;return n=o.ref,{$$typeof:s,type:i,key:r,ref:n!==void 0?n:null,props:o}}return m0.Fragment=e,m0.jsx=t,m0.jsxs=t,m0}var UZ;function X_e(){return UZ||(UZ=1,$F.exports=Z_e()),$F.exports}var x=X_e(),qF={exports:{}},ki={};var $Z;function Q_e(){if($Z)return ki;$Z=1;var s=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),r=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),f=Symbol.iterator;function p($){return $===null||typeof $!="object"?null:($=f&&$[f]||$["@@iterator"],typeof $=="function"?$:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,C={};function y($,le,q){this.props=$,this.context=le,this.refs=C,this.updater=q||m}y.prototype.isReactComponent={},y.prototype.setState=function($,le){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,le,"setState")},y.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function S(){}S.prototype=y.prototype;function L($,le,q){this.props=$,this.context=le,this.refs=C,this.updater=q||m}var k=L.prototype=new S;k.constructor=L,b(k,y.prototype),k.isPureReactComponent=!0;var N=Array.isArray;function I(){}var T={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function M($,le,q){var Ae=q.ref;return{$$typeof:s,type:$,key:le,ref:Ae!==void 0?Ae:null,props:q}}function B($,le){return M($.type,le,$.props)}function W($){return typeof $=="object"&&$!==null&&$.$$typeof===s}function j($){var le={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(q){return le[q]})}var ee=/\/+/g;function G($,le){return typeof $=="object"&&$!==null&&$.key!=null?j(""+$.key):le.toString(36)}function te($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(I,I):($.status="pending",$.then(function(le){$.status==="pending"&&($.status="fulfilled",$.value=le)},function(le){$.status==="pending"&&($.status="rejected",$.reason=le)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function Z($,le,q,Ae,Ze){var it=typeof $;(it==="undefined"||it==="boolean")&&($=null);var ut=!1;if($===null)ut=!0;else switch(it){case"bigint":case"string":case"number":ut=!0;break;case"object":switch($.$$typeof){case s:case e:ut=!0;break;case d:return ut=$._init,Z(ut($._payload),le,q,Ae,Ze)}}if(ut)return Ze=Ze($),ut=Ae===""?"."+G($,0):Ae,N(Ze)?(q="",ut!=null&&(q=ut.replace(ee,"$&/")+"/"),Z(Ze,le,q,"",function(yt){return yt})):Ze!=null&&(W(Ze)&&(Ze=B(Ze,q+(Ze.key==null||$&&$.key===Ze.key?"":(""+Ze.key).replace(ee,"$&/")+"/")+ut)),le.push(Ze)),1;ut=0;var ht=Ae===""?".":Ae+":";if(N($))for(var Re=0;Re<$.length;Re++)Ae=$[Re],it=ht+G(Ae,Re),ut+=Z(Ae,le,q,it,Ze);else if(Re=p($),typeof Re=="function")for($=Re.call($),Re=0;!(Ae=$.next()).done;)Ae=Ae.value,it=ht+G(Ae,Re++),ut+=Z(Ae,le,q,it,Ze);else if(it==="object"){if(typeof $.then=="function")return Z(te($),le,q,Ae,Ze);throw le=String($),Error("Objects are not valid as a React child (found: "+(le==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":le)+"). If you meant to render a collection of children, use an array instead.")}return ut}function X($,le,q){if($==null)return $;var Ae=[],Ze=0;return Z($,Ae,"","",function(it){return le.call(q,it,Ze++)}),Ae}function re($){if($._status===-1){var le=$._result;le=le(),le.then(function(q){($._status===0||$._status===-1)&&($._status=1,$._result=q)},function(q){($._status===0||$._status===-1)&&($._status=2,$._result=q)}),$._status===-1&&($._status=0,$._result=le)}if($._status===1)return $._result.default;throw $._result}var J=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var le=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(le))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)},H={map:X,forEach:function($,le,q){X($,function(){le.apply(this,arguments)},q)},count:function($){var le=0;return X($,function(){le++}),le},toArray:function($){return X($,function(le){return le})||[]},only:function($){if(!W($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return ki.Activity=u,ki.Children=H,ki.Component=y,ki.Fragment=t,ki.Profiler=n,ki.PureComponent=L,ki.StrictMode=i,ki.Suspense=l,ki.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ki.__COMPILER_RUNTIME={__proto__:null,c:function($){return T.H.useMemoCache($)}},ki.cache=function($){return function(){return $.apply(null,arguments)}},ki.cacheSignal=function(){return null},ki.cloneElement=function($,le,q){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var Ae=b({},$.props),Ze=$.key;if(le!=null)for(it in le.key!==void 0&&(Ze=""+le.key),le)!O.call(le,it)||it==="key"||it==="__self"||it==="__source"||it==="ref"&&le.ref===void 0||(Ae[it]=le[it]);var it=arguments.length-2;if(it===1)Ae.children=q;else if(1<it){for(var ut=Array(it),ht=0;ht<it;ht++)ut[ht]=arguments[ht+2];Ae.children=ut}return M($.type,Ze,Ae)},ki.createContext=function($){return $={$$typeof:r,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:o,_context:$},$},ki.createElement=function($,le,q){var Ae,Ze={},it=null;if(le!=null)for(Ae in le.key!==void 0&&(it=""+le.key),le)O.call(le,Ae)&&Ae!=="key"&&Ae!=="__self"&&Ae!=="__source"&&(Ze[Ae]=le[Ae]);var ut=arguments.length-2;if(ut===1)Ze.children=q;else if(1<ut){for(var ht=Array(ut),Re=0;Re<ut;Re++)ht[Re]=arguments[Re+2];Ze.children=ht}if($&&$.defaultProps)for(Ae in ut=$.defaultProps,ut)Ze[Ae]===void 0&&(Ze[Ae]=ut[Ae]);return M($,it,Ze)},ki.createRef=function(){return{current:null}},ki.forwardRef=function($){return{$$typeof:a,render:$}},ki.isValidElement=W,ki.lazy=function($){return{$$typeof:d,_payload:{_status:-1,_result:$},_init:re}},ki.memo=function($,le){return{$$typeof:c,type:$,compare:le===void 0?null:le}},ki.startTransition=function($){var le=T.T,q={};T.T=q;try{var Ae=$(),Ze=T.S;Ze!==null&&Ze(q,Ae),typeof Ae=="object"&&Ae!==null&&typeof Ae.then=="function"&&Ae.then(I,J)}catch(it){J(it)}finally{le!==null&&q.types!==null&&(le.types=q.types),T.T=le}},ki.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ki.use=function($){return T.H.use($)},ki.useActionState=function($,le,q){return T.H.useActionState($,le,q)},ki.useCallback=function($,le){return T.H.useCallback($,le)},ki.useContext=function($){return T.H.useContext($)},ki.useDebugValue=function(){},ki.useDeferredValue=function($,le){return T.H.useDeferredValue($,le)},ki.useEffect=function($,le){return T.H.useEffect($,le)},ki.useEffectEvent=function($){return T.H.useEffectEvent($)},ki.useId=function(){return T.H.useId()},ki.useImperativeHandle=function($,le,q){return T.H.useImperativeHandle($,le,q)},ki.useInsertionEffect=function($,le){return T.H.useInsertionEffect($,le)},ki.useLayoutEffect=function($,le){return T.H.useLayoutEffect($,le)},ki.useMemo=function($,le){return T.H.useMemo($,le)},ki.useOptimistic=function($,le){return T.H.useOptimistic($,le)},ki.useReducer=function($,le,q){return T.H.useReducer($,le,q)},ki.useRef=function($){return T.H.useRef($)},ki.useState=function($){return T.H.useState($)},ki.useSyncExternalStore=function($,le,q){return T.H.useSyncExternalStore($,le,q)},ki.useTransition=function(){return T.H.useTransition()},ki.version="19.2.4",ki}var qZ;function Iz(){return qZ||(qZ=1,qF.exports=Q_e()),qF.exports}var F=Iz();const Ds=Nz(F);var KF={exports:{}},_0={},GF={exports:{}},YF={};var KZ;function J_e(){return KZ||(KZ=1,(function(s){function e(Z,X){var re=Z.length;Z.push(X);e:for(;0<re;){var J=re-1>>>1,H=Z[J];if(0<n(H,X))Z[J]=X,Z[re]=H,re=J;else break e}}function t(Z){return Z.length===0?null:Z[0]}function i(Z){if(Z.length===0)return null;var X=Z[0],re=Z.pop();if(re!==X){Z[0]=re;e:for(var J=0,H=Z.length,$=H>>>1;J<$;){var le=2*(J+1)-1,q=Z[le],Ae=le+1,Ze=Z[Ae];if(0>n(q,re))Ae<H&&0>n(Ze,q)?(Z[J]=Ze,Z[Ae]=re,J=Ae):(Z[J]=q,Z[le]=re,J=le);else if(Ae<H&&0>n(Ze,re))Z[J]=Ze,Z[Ae]=re,J=Ae;else break e}}return X}function n(Z,X){var re=Z.sortIndex-X.sortIndex;return re!==0?re:Z.id-X.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;s.unstable_now=function(){return o.now()}}else{var r=Date,a=r.now();s.unstable_now=function(){return r.now()-a}}var l=[],c=[],d=1,u=null,f=3,p=!1,m=!1,b=!1,C=!1,y=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function k(Z){for(var X=t(c);X!==null;){if(X.callback===null)i(c);else if(X.startTime<=Z)i(c),X.sortIndex=X.expirationTime,e(l,X);else break;X=t(c)}}function N(Z){if(b=!1,k(Z),!m)if(t(l)!==null)m=!0,I||(I=!0,j());else{var X=t(c);X!==null&&te(N,X.startTime-Z)}}var I=!1,T=-1,O=5,M=-1;function B(){return C?!0:!(s.unstable_now()-M<O)}function W(){if(C=!1,I){var Z=s.unstable_now();M=Z;var X=!0;try{e:{m=!1,b&&(b=!1,S(T),T=-1),p=!0;var re=f;try{t:{for(k(Z),u=t(l);u!==null&&!(u.expirationTime>Z&&B());){var J=u.callback;if(typeof J=="function"){u.callback=null,f=u.priorityLevel;var H=J(u.expirationTime<=Z);if(Z=s.unstable_now(),typeof H=="function"){u.callback=H,k(Z),X=!0;break t}u===t(l)&&i(l),k(Z)}else i(l);u=t(l)}if(u!==null)X=!0;else{var $=t(c);$!==null&&te(N,$.startTime-Z),X=!1}}break e}finally{u=null,f=re,p=!1}X=void 0}}finally{X?j():I=!1}}}var j;if(typeof L=="function")j=function(){L(W)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,G=ee.port2;ee.port1.onmessage=W,j=function(){G.postMessage(null)}}else j=function(){y(W,0)};function te(Z,X){T=y(function(){Z(s.unstable_now())},X)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(Z){Z.callback=null},s.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<Z?Math.floor(1e3/Z):5},s.unstable_getCurrentPriorityLevel=function(){return f},s.unstable_next=function(Z){switch(f){case 1:case 2:case 3:var X=3;break;default:X=f}var re=f;f=X;try{return Z()}finally{f=re}},s.unstable_requestPaint=function(){C=!0},s.unstable_runWithPriority=function(Z,X){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var re=f;f=Z;try{return X()}finally{f=re}},s.unstable_scheduleCallback=function(Z,X,re){var J=s.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?J+re:J):re=J,Z){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=re+H,Z={id:d++,callback:X,priorityLevel:Z,startTime:re,expirationTime:H,sortIndex:-1},re>J?(Z.sortIndex=re,e(c,Z),t(l)===null&&Z===t(c)&&(b?(S(T),T=-1):b=!0,te(N,re-J))):(Z.sortIndex=H,e(l,Z),m||p||(m=!0,I||(I=!0,j()))),Z},s.unstable_shouldYield=B,s.unstable_wrapCallback=function(Z){var X=f;return function(){var re=f;f=X;try{return Z.apply(this,arguments)}finally{f=re}}}})(YF)),YF}var GZ;function ebe(){return GZ||(GZ=1,GF.exports=J_e()),GF.exports}var ZF={exports:{}},Rr={};var YZ;function tbe(){if(YZ)return Rr;YZ=1;var s=Iz();function e(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},n=Symbol.for("react.portal");function o(l,c,d){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:n,key:u==null?null:""+u,children:l,containerInfo:c,implementation:d}}var r=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,c){if(l==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return Rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Rr.createPortal=function(l,c){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(e(299));return o(l,c,null,d)},Rr.flushSync=function(l){var c=r.T,d=i.p;try{if(r.T=null,i.p=2,l)return l()}finally{r.T=c,i.p=d,i.d.f()}},Rr.preconnect=function(l,c){typeof l=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,i.d.C(l,c))},Rr.prefetchDNS=function(l){typeof l=="string"&&i.d.D(l)},Rr.preinit=function(l,c){if(typeof l=="string"&&c&&typeof c.as=="string"){var d=c.as,u=a(d,c.crossOrigin),f=typeof c.integrity=="string"?c.integrity:void 0,p=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;d==="style"?i.d.S(l,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:u,integrity:f,fetchPriority:p}):d==="script"&&i.d.X(l,{crossOrigin:u,integrity:f,fetchPriority:p,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},Rr.preinitModule=function(l,c){if(typeof l=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var d=a(c.as,c.crossOrigin);i.d.M(l,{crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&i.d.M(l)},Rr.preload=function(l,c){if(typeof l=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var d=c.as,u=a(d,c.crossOrigin);i.d.L(l,d,{crossOrigin:u,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},Rr.preloadModule=function(l,c){if(typeof l=="string")if(c){var d=a(c.as,c.crossOrigin);i.d.m(l,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else i.d.m(l)},Rr.requestFormReset=function(l){i.d.r(l)},Rr.unstable_batchedUpdates=function(l,c){return l(c)},Rr.useFormState=function(l,c,d){return r.H.useFormState(l,c,d)},Rr.useFormStatus=function(){return r.H.useHostTransitionStatus()},Rr.version="19.2.4",Rr}var ZZ;function ibe(){if(ZZ)return ZF.exports;ZZ=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(e){console.error(e)}}return s(),ZF.exports=tbe(),ZF.exports}var XZ;function nbe(){if(XZ)return _0;XZ=1;var s=ebe(),e=Iz(),t=ibe();function i(h){var g="https://react.dev/errors/"+h;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)g+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+h+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(h){return!(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)}function o(h){var g=h,_=h;if(h.alternate)for(;g.return;)g=g.return;else{h=g;do g=h,(g.flags&4098)!==0&&(_=g.return),h=g.return;while(h)}return g.tag===3?_:null}function r(h){if(h.tag===13){var g=h.memoizedState;if(g===null&&(h=h.alternate,h!==null&&(g=h.memoizedState)),g!==null)return g.dehydrated}return null}function a(h){if(h.tag===31){var g=h.memoizedState;if(g===null&&(h=h.alternate,h!==null&&(g=h.memoizedState)),g!==null)return g.dehydrated}return null}function l(h){if(o(h)!==h)throw Error(i(188))}function c(h){var g=h.alternate;if(!g){if(g=o(h),g===null)throw Error(i(188));return g!==h?null:h}for(var _=h,w=g;;){var D=_.return;if(D===null)break;var E=D.alternate;if(E===null){if(w=D.return,w!==null){_=w;continue}break}if(D.child===E.child){for(E=D.child;E;){if(E===_)return l(D),h;if(E===w)return l(D),g;E=E.sibling}throw Error(i(188))}if(_.return!==w.return)_=D,w=E;else{for(var P=!1,K=D.child;K;){if(K===_){P=!0,_=D,w=E;break}if(K===w){P=!0,w=D,_=E;break}K=K.sibling}if(!P){for(K=E.child;K;){if(K===_){P=!0,_=E,w=D;break}if(K===w){P=!0,w=E,_=D;break}K=K.sibling}if(!P)throw Error(i(189))}}if(_.alternate!==w)throw Error(i(190))}if(_.tag!==3)throw Error(i(188));return _.stateNode.current===_?h:g}function d(h){var g=h.tag;if(g===5||g===26||g===27||g===6)return h;for(h=h.child;h!==null;){if(g=d(h),g!==null)return g;h=h.sibling}return null}var u=Object.assign,f=Symbol.for("react.element"),p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),L=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function j(h){return h===null||typeof h!="object"?null:(h=W&&h[W]||h["@@iterator"],typeof h=="function"?h:null)}var ee=Symbol.for("react.client.reference");function G(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===ee?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case b:return"Fragment";case y:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case I:return"SuspenseList";case M:return"Activity"}if(typeof h=="object")switch(h.$$typeof){case m:return"Portal";case L:return h.displayName||"Context";case S:return(h._context.displayName||"Context")+".Consumer";case k:var g=h.render;return h=h.displayName,h||(h=g.displayName||g.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case T:return g=h.displayName||null,g!==null?g:G(h.type)||"Memo";case O:g=h._payload,h=h._init;try{return G(h(g))}catch{}}return null}var te=Array.isArray,Z=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},J=[],H=-1;function $(h){return{current:h}}function le(h){0>H||(h.current=J[H],J[H]=null,H--)}function q(h,g){H++,J[H]=h.current,h.current=g}var Ae=$(null),Ze=$(null),it=$(null),ut=$(null);function ht(h,g){switch(q(it,g),q(Ze,h),q(Ae,null),g.nodeType){case 9:case 11:h=(h=g.documentElement)&&(h=h.namespaceURI)?hZ(h):0;break;default:if(h=g.tagName,g=g.namespaceURI)g=hZ(g),h=fZ(g,h);else switch(h){case"svg":h=1;break;case"math":h=2;break;default:h=0}}le(Ae),q(Ae,h)}function Re(){le(Ae),le(Ze),le(it)}function yt(h){h.memoizedState!==null&&q(ut,h);var g=Ae.current,_=fZ(g,h.type);g!==_&&(q(Ze,h),q(Ae,_))}function mt(h){Ze.current===h&&(le(Ae),le(Ze)),ut.current===h&&(le(ut),h0._currentValue=re)}var jt,Ti;function Fi(h){if(jt===void 0)try{throw Error()}catch(_){var g=_.stack.trim().match(/\n( *(at )?)/);jt=g&&g[1]||"",Ti=-1<_.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<_.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+jt+h+Ti}var tn=!1;function $i(h,g){if(!h||tn)return"";tn=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var w={DetermineComponentFrameRoot:function(){try{if(g){var Ge=function(){throw Error()};if(Object.defineProperty(Ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ge,[])}catch(Pe){var Ne=Pe}Reflect.construct(h,[],Ge)}else{try{Ge.call()}catch(Pe){Ne=Pe}h.call(Ge.prototype)}}else{try{throw Error()}catch(Pe){Ne=Pe}(Ge=h())&&typeof Ge.catch=="function"&&Ge.catch(function(){})}}catch(Pe){if(Pe&&Ne&&typeof Pe.stack=="string")return[Pe.stack,Ne.stack]}return[null,null]}};w.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var D=Object.getOwnPropertyDescriptor(w.DetermineComponentFrameRoot,"name");D&&D.configurable&&Object.defineProperty(w.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=w.DetermineComponentFrameRoot(),P=E[0],K=E[1];if(P&&K){var de=P.split(`
|
|
@@ -15,7 +15,7 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
|
|
|
15
15
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(n=>i.set(n)),i}static accessor(e){const i=(this[dX]=this[dX]={accessors:{}}).accessors,n=this.prototype;function o(r){const a=v0(r);i[a]||(Lwe(n,r),i[a]=!0)}return Oe.isArray(e)?e.forEach(o):o(e),this}};sl.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Oe.reduceDescriptors(sl.prototype,({value:s},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(i){this[t]=i}}});Oe.freezeMethods(sl);function t5(s,e){const t=this||kk,i=e||t,n=sl.from(i.headers);let o=i.data;return Oe.forEach(s,function(a){o=a.call(t,o,n.normalize(),e?e.status:void 0)}),n.normalize(),o}function Foe(s){return!!(s&&s.__CANCEL__)}let Dk=class extends vi{constructor(e,t,i){super(e??"canceled",vi.ERR_CANCELED,t,i),this.name="CanceledError",this.__CANCEL__=!0}};function Boe(s,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?s(t):e(new vi("Request failed with status code "+t.status,[vi.ERR_BAD_REQUEST,vi.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function kwe(s){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}function Dwe(s,e){s=s||10;const t=new Array(s),i=new Array(s);let n=0,o=0,r;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),d=i[o];r||(r=c),t[n]=l,i[n]=c;let u=o,f=0;for(;u!==n;)f+=t[u++],u=u%s;if(n=(n+1)%s,n===o&&(o=(o+1)%s),c-r<e)return;const p=d&&c-d;return p?Math.round(f*1e3/p):void 0}}function Ewe(s,e){let t=0,i=1e3/e,n,o;const r=(c,d=Date.now())=>{t=d,n=null,o&&(clearTimeout(o),o=null),s(...c)};return[(...c)=>{const d=Date.now(),u=d-t;u>=i?r(c,d):(n=c,o||(o=setTimeout(()=>{o=null,r(n)},i-u)))},()=>n&&r(n)]}const KI=(s,e,t=3)=>{let i=0;const n=Dwe(50,250);return Ewe(o=>{const r=o.loaded,a=o.lengthComputable?o.total:void 0,l=r-i,c=n(l),d=r<=a;i=r;const u={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&d?(a-r)/c:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};s(u)},t)},uX=(s,e)=>{const t=s!=null;return[i=>e[0]({lengthComputable:t,total:s,loaded:i}),e[1]]},hX=s=>(...e)=>Oe.asap(()=>s(...e)),Nwe=Wr.hasStandardBrowserEnv?((s,e)=>t=>(t=new URL(t,Wr.origin),s.protocol===t.protocol&&s.host===t.host&&(e||s.port===t.port)))(new URL(Wr.origin),Wr.navigator&&/(msie|trident)/i.test(Wr.navigator.userAgent)):()=>!0,Iwe=Wr.hasStandardBrowserEnv?{write(s,e,t,i,n,o,r){if(typeof document>"u")return;const a=[`${s}=${encodeURIComponent(e)}`];Oe.isNumber(t)&&a.push(`expires=${new Date(t).toUTCString()}`),Oe.isString(i)&&a.push(`path=${i}`),Oe.isString(n)&&a.push(`domain=${n}`),o===!0&&a.push("secure"),Oe.isString(r)&&a.push(`SameSite=${r}`),document.cookie=a.join("; ")},read(s){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Twe(s){return typeof s!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Rwe(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}function Woe(s,e,t){let i=!Twe(e);return s&&(i||t==!1)?Rwe(s,e):e}const fX=s=>s instanceof sl?{...s}:s;function yb(s,e){e=e||{};const t={};function i(c,d,u,f){return Oe.isPlainObject(c)&&Oe.isPlainObject(d)?Oe.merge.call({caseless:f},c,d):Oe.isPlainObject(d)?Oe.merge({},d):Oe.isArray(d)?d.slice():d}function n(c,d,u,f){if(Oe.isUndefined(d)){if(!Oe.isUndefined(c))return i(void 0,c,u,f)}else return i(c,d,u,f)}function o(c,d){if(!Oe.isUndefined(d))return i(void 0,d)}function r(c,d){if(Oe.isUndefined(d)){if(!Oe.isUndefined(c))return i(void 0,c)}else return i(void 0,d)}function a(c,d,u){if(u in e)return i(c,d);if(u in s)return i(void 0,c)}const l={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(c,d,u)=>n(fX(c),fX(d),u,!0)};return Oe.forEach(Object.keys({...s,...e}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const u=Oe.hasOwnProp(l,d)?l[d]:n,f=u(s[d],e[d],d);Oe.isUndefined(f)&&u!==a||(t[d]=f)}),t}const Hoe=s=>{const e=yb({},s);let{data:t,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:o,headers:r,auth:a}=e;if(e.headers=r=sl.from(r),e.url=Ooe(Woe(e.baseURL,e.url,e.allowAbsoluteUrls),s.params,s.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Oe.isFormData(t)){if(Wr.hasStandardBrowserEnv||Wr.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(Oe.isFunction(t.getHeaders)){const l=t.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([d,u])=>{c.includes(d.toLowerCase())&&r.set(d,u)})}}if(Wr.hasStandardBrowserEnv&&(i&&Oe.isFunction(i)&&(i=i(e)),i||i!==!1&&Nwe(e.url))){const l=n&&o&&Iwe.read(o);l&&r.set(n,l)}return e},Mwe=typeof XMLHttpRequest<"u",Awe=Mwe&&function(s){return new Promise(function(t,i){const n=Hoe(s);let o=n.data;const r=sl.from(n.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=n,d,u,f,p,m;function b(){p&&p(),m&&m(),n.cancelToken&&n.cancelToken.unsubscribe(d),n.signal&&n.signal.removeEventListener("abort",d)}let C=new XMLHttpRequest;C.open(n.method.toUpperCase(),n.url,!0),C.timeout=n.timeout;function y(){if(!C)return;const L=sl.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),N={data:!a||a==="text"||a==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:L,config:s,request:C};Boe(function(T){t(T),b()},function(T){i(T),b()},N),C=null}"onloadend"in C?C.onloadend=y:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(y)},C.onabort=function(){C&&(i(new vi("Request aborted",vi.ECONNABORTED,s,C)),C=null)},C.onerror=function(k){const N=k&&k.message?k.message:"Network Error",I=new vi(N,vi.ERR_NETWORK,s,C);I.event=k||null,i(I),C=null},C.ontimeout=function(){let k=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const N=n.transitional||Hz;n.timeoutErrorMessage&&(k=n.timeoutErrorMessage),i(new vi(k,N.clarifyTimeoutError?vi.ETIMEDOUT:vi.ECONNABORTED,s,C)),C=null},o===void 0&&r.setContentType(null),"setRequestHeader"in C&&Oe.forEach(r.toJSON(),function(k,N){C.setRequestHeader(N,k)}),Oe.isUndefined(n.withCredentials)||(C.withCredentials=!!n.withCredentials),a&&a!=="json"&&(C.responseType=n.responseType),c&&([f,m]=KI(c,!0),C.addEventListener("progress",f)),l&&C.upload&&([u,p]=KI(l),C.upload.addEventListener("progress",u),C.upload.addEventListener("loadend",p)),(n.cancelToken||n.signal)&&(d=L=>{C&&(i(!L||L.type?new Dk(null,s,C):L),C.abort(),C=null)},n.cancelToken&&n.cancelToken.subscribe(d),n.signal&&(n.signal.aborted?d():n.signal.addEventListener("abort",d)));const S=kwe(n.url);if(S&&Wr.protocols.indexOf(S)===-1){i(new vi("Unsupported protocol "+S+":",vi.ERR_BAD_REQUEST,s));return}C.send(o||null)})},Owe=(s,e)=>{const{length:t}=s=s?s.filter(Boolean):[];if(e||t){let i=new AbortController,n;const o=function(c){if(!n){n=!0,a();const d=c instanceof Error?c:this.reason;i.abort(d instanceof vi?d:new Dk(d instanceof Error?d.message:d))}};let r=e&&setTimeout(()=>{r=null,o(new vi(`timeout of ${e}ms exceeded`,vi.ETIMEDOUT))},e);const a=()=>{s&&(r&&clearTimeout(r),r=null,s.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),s=null)};s.forEach(c=>c.addEventListener("abort",o));const{signal:l}=i;return l.unsubscribe=()=>Oe.asap(a),l}},Pwe=function*(s,e){let t=s.byteLength;if(t<e){yield s;return}let i=0,n;for(;i<t;)n=i+e,yield s.slice(i,n),i=n},Fwe=async function*(s,e){for await(const t of Bwe(s))yield*Pwe(t,e)},Bwe=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const e=s.getReader();try{for(;;){const{done:t,value:i}=await e.read();if(t)break;yield i}}finally{await e.cancel()}},gX=(s,e,t,i)=>{const n=Fwe(s,e);let o=0,r,a=l=>{r||(r=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:d}=await n.next();if(c){a(),l.close();return}let u=d.byteLength;if(t){let f=o+=u;t(f)}l.enqueue(new Uint8Array(d))}catch(c){throw a(c),c}},cancel(l){return a(l),n.return()}},{highWaterMark:2})},pX=64*1024,{isFunction:RE}=Oe,Wwe=(({Request:s,Response:e})=>({Request:s,Response:e}))(Oe.global),{ReadableStream:mX,TextEncoder:_X}=Oe.global,bX=(s,...e)=>{try{return!!s(...e)}catch{return!1}},Hwe=s=>{s=Oe.merge.call({skipUndefined:!0},Wwe,s);const{fetch:e,Request:t,Response:i}=s,n=e?RE(e):typeof fetch=="function",o=RE(t),r=RE(i);if(!n)return!1;const a=n&&RE(mX),l=n&&(typeof _X=="function"?(m=>b=>m.encode(b))(new _X):async m=>new Uint8Array(await new t(m).arrayBuffer())),c=o&&a&&bX(()=>{let m=!1;const b=new t(Wr.origin,{body:new mX,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!b}),d=r&&a&&bX(()=>Oe.isReadableStream(new i("").body)),u={stream:d&&(m=>m.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!u[m]&&(u[m]=(b,C)=>{let y=b&&b[m];if(y)return y.call(b);throw new vi(`Response type '${m}' is not supported`,vi.ERR_NOT_SUPPORT,C)})});const f=async m=>{if(m==null)return 0;if(Oe.isBlob(m))return m.size;if(Oe.isSpecCompliantForm(m))return(await new t(Wr.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(Oe.isArrayBufferView(m)||Oe.isArrayBuffer(m))return m.byteLength;if(Oe.isURLSearchParams(m)&&(m=m+""),Oe.isString(m))return(await l(m)).byteLength},p=async(m,b)=>{const C=Oe.toFiniteNumber(m.getContentLength());return C??f(b)};return async m=>{let{url:b,method:C,data:y,signal:S,cancelToken:L,timeout:k,onDownloadProgress:N,onUploadProgress:I,responseType:T,headers:O,withCredentials:M="same-origin",fetchOptions:B}=Hoe(m),W=e||fetch;T=T?(T+"").toLowerCase():"text";let j=Owe([S,L&&L.toAbortSignal()],k),ee=null;const G=j&&j.unsubscribe&&(()=>{j.unsubscribe()});let te;try{if(I&&c&&C!=="get"&&C!=="head"&&(te=await p(O,y))!==0){let $=new t(b,{method:"POST",body:y,duplex:"half"}),le;if(Oe.isFormData(y)&&(le=$.headers.get("content-type"))&&O.setContentType(le),$.body){const[q,Ae]=uX(te,KI(hX(I)));y=gX($.body,pX,q,Ae)}}Oe.isString(M)||(M=M?"include":"omit");const Z=o&&"credentials"in t.prototype,X={...B,signal:j,method:C.toUpperCase(),headers:O.normalize().toJSON(),body:y,duplex:"half",credentials:Z?M:void 0};ee=o&&new t(b,X);let re=await(o?W(ee,B):W(b,X));const J=d&&(T==="stream"||T==="response");if(d&&(N||J&&G)){const $={};["status","statusText","headers"].forEach(Ze=>{$[Ze]=re[Ze]});const le=Oe.toFiniteNumber(re.headers.get("content-length")),[q,Ae]=N&&uX(le,KI(hX(N),!0))||[];re=new i(gX(re.body,pX,q,()=>{Ae&&Ae(),G&&G()}),$)}T=T||"text";let H=await u[Oe.findKey(u,T)||"text"](re,m);return!J&&G&&G(),await new Promise(($,le)=>{Boe($,le,{data:H,headers:sl.from(re.headers),status:re.status,statusText:re.statusText,config:m,request:ee})})}catch(Z){throw G&&G(),Z&&Z.name==="TypeError"&&/Load failed|fetch/i.test(Z.message)?Object.assign(new vi("Network Error",vi.ERR_NETWORK,m,ee,Z&&Z.response),{cause:Z.cause||Z}):vi.from(Z,Z&&Z.code,m,ee,Z&&Z.response)}}},Vwe=new Map,Voe=s=>{let e=s&&s.env||{};const{fetch:t,Request:i,Response:n}=e,o=[i,n,t];let r=o.length,a=r,l,c,d=Vwe;for(;a--;)l=o[a],c=d.get(l),c===void 0&&d.set(l,c=a?new Map:Hwe(e)),d=c;return c};Voe();const zz={http:swe,xhr:Awe,fetch:{get:Voe}};Oe.forEach(zz,(s,e)=>{if(s){try{Object.defineProperty(s,"name",{value:e})}catch{}Object.defineProperty(s,"adapterName",{value:e})}});const vX=s=>`- ${s}`,zwe=s=>Oe.isFunction(s)||s===null||s===!1;function jwe(s,e){s=Oe.isArray(s)?s:[s];const{length:t}=s;let i,n;const o={};for(let r=0;r<t;r++){i=s[r];let a;if(n=i,!zwe(i)&&(n=zz[(a=String(i)).toLowerCase()],n===void 0))throw new vi(`Unknown adapter '${a}'`);if(n&&(Oe.isFunction(n)||(n=n.get(e))))break;o[a||"#"+r]=n}if(!n){const r=Object.entries(o).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
|
|
16
16
|
`+r.map(vX).join(`
|
|
17
17
|
`):" "+vX(r[0]):"as no adapter specified";throw new vi("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n}const zoe={getAdapter:jwe,adapters:zz};function i5(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Dk(null,s)}function CX(s){return i5(s),s.headers=sl.from(s.headers),s.data=t5.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),zoe.getAdapter(s.adapter||kk.adapter,s)(s).then(function(i){return i5(s),i.data=t5.call(s,s.transformResponse,i),i.headers=sl.from(i.headers),i},function(i){return Foe(i)||(i5(s),i&&i.response&&(i.response.data=t5.call(s,s.transformResponse,i.response),i.response.headers=sl.from(i.response.headers))),Promise.reject(i)})}const joe="1.13.5",q2={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{q2[s]=function(i){return typeof i===s||"a"+(e<1?"n ":" ")+s}});const wX={};q2.transitional=function(e,t,i){function n(o,r){return"[Axios v"+joe+"] Transitional option '"+o+"'"+r+(i?". "+i:"")}return(o,r,a)=>{if(e===!1)throw new vi(n(r," has been removed"+(t?" in "+t:"")),vi.ERR_DEPRECATED);return t&&!wX[r]&&(wX[r]=!0,console.warn(n(r," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,r,a):!0}};q2.spelling=function(e){return(t,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function Uwe(s,e,t){if(typeof s!="object")throw new vi("options must be an object",vi.ERR_BAD_OPTION_VALUE);const i=Object.keys(s);let n=i.length;for(;n-- >0;){const o=i[n],r=e[o];if(r){const a=s[o],l=a===void 0||r(a,o,s);if(l!==!0)throw new vi("option "+o+" must be "+l,vi.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new vi("Unknown option "+o,vi.ERR_BAD_OPTION)}}const iI={assertOptions:Uwe,validators:q2},gc=iI.validators;let d_=class{constructor(e){this.defaults=e||{},this.interceptors={request:new cX,response:new cX}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const o=n.stack?n.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
|
18
|
-
`+o):i.stack=o}catch{}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=yb(this.defaults,t);const{transitional:i,paramsSerializer:n,headers:o}=t;i!==void 0&&iI.assertOptions(i,{silentJSONParsing:gc.transitional(gc.boolean),forcedJSONParsing:gc.transitional(gc.boolean),clarifyTimeoutError:gc.transitional(gc.boolean),legacyInterceptorReqResOrdering:gc.transitional(gc.boolean)},!1),n!=null&&(Oe.isFunction(n)?t.paramsSerializer={serialize:n}:iI.assertOptions(n,{encode:gc.function,serialize:gc.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),iI.assertOptions(t,{baseUrl:gc.spelling("baseURL"),withXsrfToken:gc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&Oe.merge(o.common,o[t.method]);o&&Oe.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),t.headers=sl.concat(r,o);const a=[];let l=!0;this.interceptors.request.forEach(function(b){if(typeof b.runWhen=="function"&&b.runWhen(t)===!1)return;l=l&&b.synchronous;const C=t.transitional||Hz;C&&C.legacyInterceptorReqResOrdering?a.unshift(b.fulfilled,b.rejected):a.push(b.fulfilled,b.rejected)});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let d,u=0,f;if(!l){const m=[CX.bind(this),void 0];for(m.unshift(...a),m.push(...c),f=m.length,d=Promise.resolve(t);u<f;)d=d.then(m[u++],m[u++]);return d}f=a.length;let p=t;for(;u<f;){const m=a[u++],b=a[u++];try{p=m(p)}catch(C){b.call(this,C);break}}try{d=CX.call(this,p)}catch(m){return Promise.reject(m)}for(u=0,f=c.length;u<f;)d=d.then(c[u++],c[u++]);return d}getUri(e){e=yb(this.defaults,e);const t=Woe(e.baseURL,e.url,e.allowAbsoluteUrls);return Ooe(t,e.params,e.paramsSerializer)}};Oe.forEach(["delete","get","head","options"],function(e){d_.prototype[e]=function(t,i){return this.request(yb(i||{},{method:e,url:t,data:(i||{}).data}))}});Oe.forEach(["post","put","patch"],function(e){function t(i){return function(o,r,a){return this.request(yb(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}d_.prototype[e]=t(),d_.prototype[e+"Form"]=t(!0)});let $we=class Uoe{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});const i=this;this.promise.then(n=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o;const r=new Promise(a=>{i.subscribe(a),o=a}).then(n);return r.cancel=function(){i.unsubscribe(o)},r},e(function(o,r,a){i.reason||(i.reason=new Dk(o,r,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=i=>{e.abort(i)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Uoe(function(n){e=n}),cancel:e}}};function qwe(s){return function(t){return s.apply(null,t)}}function Kwe(s){return Oe.isObject(s)&&s.isAxiosError===!0}const $B={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($B).forEach(([s,e])=>{$B[e]=s});function $oe(s){const e=new d_(s),t=xoe(d_.prototype.request,e);return Oe.extend(t,d_.prototype,e,{allOwnKeys:!0}),Oe.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return $oe(yb(s,n))},t}const eo=$oe(kk);eo.Axios=d_;eo.CanceledError=Dk;eo.CancelToken=$we;eo.isCancel=Foe;eo.VERSION=joe;eo.toFormData=$2;eo.AxiosError=vi;eo.Cancel=eo.CanceledError;eo.all=function(e){return Promise.all(e)};eo.spread=qwe;eo.isAxiosError=Kwe;eo.mergeConfig=yb;eo.AxiosHeaders=sl;eo.formToJSON=s=>Poe(Oe.isHTMLForm(s)?new FormData(s):s);eo.getAdapter=zoe.getAdapter;eo.HttpStatusCode=$B;eo.default=eo;const{Axios:Rit,AxiosError:Hi,CanceledError:n5,isCancel:Mit,CancelToken:Ait,VERSION:Oit,all:Pit,Cancel:Fit,isAxiosError:Bit,spread:Wit,toFormData:Hit,AxiosHeaders:Vit,HttpStatusCode:zit,formToJSON:jit,getAdapter:Uit,mergeConfig:$it}=eo,xt=eo.create({headers:{"Content-Type":"application/json"}}),qoe=eo.create();function Koe(s){s.interceptors.response.use(e=>e,e=>{const t=e.config?.url,i=typeof t=="string"&&t.startsWith("/api/auth/");return e.response?.status===401&&!i&&(Yoe(),window.location.href="/login"),Promise.reject(e)})}Koe(xt);Koe(qoe);function Gwe(s){if(s==="busy"||s==="retry"||s==="idle")return s;throw new Error(`Invalid session_status from /messages: ${String(s)}`)}function Ywe(s){if(Array.isArray(s))return s;throw new Error("Invalid messages payload from /messages")}const Goe=F.createContext(null);function yX(s,e){if(s instanceof Hi){const t=s.response?.data;return typeof t?.message=="string"?t.message:typeof t?.error=="string"?t.error:typeof t=="string"?t:s.message||e}return s instanceof Error?s.message:e}function Zwe({children:s}){const[e,t]=F.useState(null),i=localStorage.getItem("token"),[n,o]=F.useState(i),[r,a]=F.useState(!!i);F.useEffect(()=>{n&&(async()=>{try{const f=await xt.get("/api/auth/me",{headers:{Authorization:`Bearer ${n}`}});t(f.data),a(!1)}catch(f){if(f instanceof Hi&&f.response?.status===401){localStorage.removeItem("token"),o(null),a(!1);return}a(!0)}})()},[n]);const l=async(f,p)=>{try{const m=await xt.post("/api/auth/signin",{email:f,password:p});if(m.data.requires_password_change){if(typeof m.data.challenge_token!="string"||m.data.challenge_token.length===0)throw new Error("Missing challenge token for password change");return{type:"password_change_required",challengeToken:m.data.challenge_token}}if(typeof m.data.token!="string"||m.data.token.length===0)throw new Error("Missing authentication token from sign in response");return localStorage.setItem("token",m.data.token),o(m.data.token),{type:"authenticated"}}catch(m){throw new Error(yX(m,"Sign in failed"))}},c=async(f,p)=>{try{const m=await xt.post("/api/auth/complete-password-change",{challengeToken:f,newPassword:p});if(typeof m.data.token!="string"||m.data.token.length===0)throw new Error("Missing authentication token from password change response");localStorage.setItem("token",m.data.token),o(m.data.token)}catch(m){throw new Error(yX(m,"Password change failed"))}},d=()=>{Yoe(),o(null),t(null)},u=r?{loading:!0,login:l,completePasswordChange:c,logout:d}:{loading:!1,user:e,token:n,login:l,completePasswordChange:c,logout:d};return x.jsx(Goe.Provider,{value:u,children:s})}function Ss(){const s=F.useContext(Goe);if(!s)throw new Error("useAuth must be used within AuthProvider");return s}function Yoe(){localStorage.removeItem("token")}const SX="TeamCopilot";function Da(s){F.useEffect(()=>{const e=typeof s=="string"?s.trim():"";document.title=e?`${SX} - ${e}`:SX},[s])}function Xwe(){const[s,e]=F.useState("signin"),[t,i]=F.useState(""),[n,o]=F.useState(""),[r,a]=F.useState(""),[l,c]=F.useState(!1),[d,u]=F.useState(!1),[f,p]=F.useState(""),[m,b]=F.useState(""),{login:C,completePasswordChange:y,logout:S}=Ss(),L=Io();Da(s==="signin"?"Sign In":"Set New Password");const k=async I=>{I.preventDefault(),b("");try{const T=await C(t,n);if(T.type==="password_change_required"){p(T.challengeToken),e("change-password"),o("");return}L("/")}catch(T){const O=T instanceof Error?T.message:"Sign in failed";b(O),o(""),et.error(O)}},N=async I=>{I.preventDefault(),b("");try{await y(f,r),L("/")}catch(T){const O=T instanceof Error?T.message:"Password change failed";b(O),et.error(O)}};return x.jsxs("div",{className:"auth-container",children:[x.jsx("h1",{children:s==="signin"?"Sign In":"Set New Password"}),s==="signin"?x.jsxs("form",{onSubmit:k,className:"auth-form",children:[m&&x.jsx("p",{className:"auth-error",children:m}),x.jsx("label",{htmlFor:"email",children:"Email"}),x.jsx("input",{id:"email",name:"email",type:"email",value:t,onChange:I=>i(I.target.value),autoComplete:"username",required:!0}),x.jsx("label",{htmlFor:"password",children:"Password"}),x.jsxs("div",{className:"password-input-row",children:[x.jsx("input",{id:"password",name:"password",type:l?"text":"password",value:n,onChange:I=>o(I.target.value),autoComplete:"current-password",required:!0}),x.jsx("button",{type:"button",className:"password-toggle-button",onClick:()=>c(I=>!I),children:l?"Hide":"Show"})]}),x.jsx("button",{className:"auth-submit-button",type:"submit",children:"Sign In"})]}):x.jsxs("form",{onSubmit:N,className:"auth-form",children:[m&&x.jsx("p",{className:"auth-error",children:m}),x.jsx("p",{children:"You must set a new password before continuing."}),x.jsx("label",{htmlFor:"password-change-email",children:"Email"}),x.jsx("input",{id:"password-change-email",name:"email",type:"email",value:t,autoComplete:"username",readOnly:!0,required:!0}),x.jsx("label",{htmlFor:"new-password",children:"New Password (min 8 characters)"}),x.jsxs("div",{className:"password-input-row",children:[x.jsx("input",{id:"new-password",name:"new-password",type:d?"text":"password",value:r,onChange:I=>a(I.target.value),autoComplete:"new-password",minLength:8,required:!0}),x.jsx("button",{type:"button",className:"password-toggle-button",onClick:()=>u(I=>!I),children:d?"Hide":"Show"})]}),x.jsx("button",{className:"auth-submit-button",type:"submit",children:"Save Password"}),x.jsx("button",{className:"auth-submit-button",type:"button",onClick:()=>{S(),e("signin"),p(""),o(""),a(""),L("/login")},children:"Sign Out"})]}),x.jsx("p",{className:"auth-link",children:"Accounts are created by an administrator via CLI."})]})}function Qwe({viewLabel:s,onView:e,showRunAction:t,runLabel:i,canRun:n,onRunAi:o,onRunManual:r,onRunApi:a,deleteVisible:l,deleteLabel:c="Delete",deleting:d=!1,onDelete:u}){const[f,p]=F.useState(!1),m=!!(o&&r);return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"workflow-card-actions",children:[x.jsx("button",{className:"workflow-card-run-btn",onClick:e,children:s}),t&&x.jsx("button",{className:"workflow-card-run-btn",disabled:!n,onClick:()=>{m&&p(!0)},children:i}),l&&x.jsx("button",{className:"workflow-card-delete-btn",onClick:u,disabled:d,children:d?"Deleting...":c})]}),m&&f&&x.jsx("div",{className:"workflow-run-mode-modal-backdrop",onClick:()=>p(!1),children:x.jsxs("div",{className:"workflow-run-mode-modal",onClick:b=>b.stopPropagation(),children:[x.jsx("button",{type:"button",className:"workflow-run-mode-close-btn","aria-label":"Close",onClick:()=>p(!1)}),x.jsx("h4",{children:"Choose run mode"}),x.jsx("p",{children:"Pick how you want to run this workflow."}),x.jsx("button",{type:"button",className:"workflow-run-mode-ai-btn",onClick:()=>{o&&(o(),p(!1))},children:"AI mode (recommended)"}),x.jsx("button",{type:"button",className:"workflow-run-mode-manual-btn",onClick:()=>{r&&(r(),p(!1))},children:"Manual mode"}),a&&x.jsx("button",{type:"button",className:"workflow-run-mode-manual-btn",onClick:()=>{a(),p(!1)},children:"Using API"})]})})]})}function Zoe({kind:s,slug:e,name:t,description:i,created_by_user_id:n,created_by_user_name:o,created_by_user_email:r,approved_by_user_id:a,is_approved:l,can_edit:c,permission_mode:d,is_locked_due_to_missing_users:u,required_secrets:f,missing_required_secrets:p,can_run:m,userRole:b,currentUserId:C,token:y,viewLabel:S,showRunAction:L,runLabel:k,onUpdated:N,onDeleted:I,onOpen:T,onRunAi:O,onRunManual:M,onRunApi:B}){const[W,j]=F.useState(!1),[ee,G]=F.useState(!1),[te,Z]=F.useState(!1),[X,re]=F.useState(!1),[J,H]=F.useState(null),[$,le]=F.useState([]),[q,Ae]=F.useState("restricted"),[Ze,it]=F.useState([]),[ut,ht]=F.useState(n),[Re,yt]=F.useState(a),jt=n===C||b==="Engineer"&&(n===null||!o&&!r),Ti=l&&c,Fi=s==="workflow"?"Run access":"Access",tn=s==="workflow"?"Manage Run Permissions":"Manage Access Permissions",$i=s==="workflow"?"workflow":"skill",qi=s==="workflow"?"Workflow":"Skill",pn=`/api/${s==="workflow"?"workflows":"skills"}/${e}`,mn="/api/users",Ln=`/api/${s==="workflow"?"workflows":"skills"}/${e}/permissions`,go=async()=>{Z(!0),H(null);try{const[ve,Xe]=await Promise.all([xt.get(pn,{headers:{Authorization:`Bearer ${y}`}}),xt.get(mn,{headers:{Authorization:`Bearer ${y}`}})]),bt=s==="workflow"?ve.data.workflow:ve.data.skill,Ve=bt.permissions;if(!Ve)throw new Error("Missing permissions in response");ht(bt.created_by_user_id),yt(bt.approved_by_user_id),Ae(Ve.mode),it(Ve.mode==="restricted"?Ve.allowed_user_ids:[]),le(Xe.data.users),G(!0)}catch(ve){const Xe=ve instanceof Hi?ve.response?.data?.message||ve.response?.data||ve.message:`Failed to load ${$i} permissions`;H(String(Xe))}finally{Z(!1)}},js=ve=>{ut!==ve&&it(Xe=>Xe.includes(ve)?Xe.filter(bt=>bt!==ve):[...Xe,ve])},Wn=async()=>{re(!0);try{const ve=q==="everyone"?{mode:"everyone"}:{mode:"restricted",allowed_user_ids:Array.from(new Set(Ze))};await xt.patch(Ln,ve,{headers:{Authorization:`Bearer ${y}`}}),et.success(`${qi} permissions updated`),G(!1),N()}catch(ve){const Xe=ve instanceof Hi?ve.response?.data?.message||ve.response?.data||ve.message:`Failed to update ${$i} permissions`;et.error(String(Xe))}finally{re(!1)}},Vi=()=>{const ve=s==="workflow"?`/workflows/${encodeURIComponent(e)}/approval-review`:`/skills/${encodeURIComponent(e)}/approval-review`;window.open(ve,"_blank","noopener,noreferrer")},Us=async()=>{if(window.confirm(`Delete ${$i} "${t||e}"?
|
|
18
|
+
`+o):i.stack=o}catch{}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=yb(this.defaults,t);const{transitional:i,paramsSerializer:n,headers:o}=t;i!==void 0&&iI.assertOptions(i,{silentJSONParsing:gc.transitional(gc.boolean),forcedJSONParsing:gc.transitional(gc.boolean),clarifyTimeoutError:gc.transitional(gc.boolean),legacyInterceptorReqResOrdering:gc.transitional(gc.boolean)},!1),n!=null&&(Oe.isFunction(n)?t.paramsSerializer={serialize:n}:iI.assertOptions(n,{encode:gc.function,serialize:gc.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),iI.assertOptions(t,{baseUrl:gc.spelling("baseURL"),withXsrfToken:gc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&Oe.merge(o.common,o[t.method]);o&&Oe.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),t.headers=sl.concat(r,o);const a=[];let l=!0;this.interceptors.request.forEach(function(b){if(typeof b.runWhen=="function"&&b.runWhen(t)===!1)return;l=l&&b.synchronous;const C=t.transitional||Hz;C&&C.legacyInterceptorReqResOrdering?a.unshift(b.fulfilled,b.rejected):a.push(b.fulfilled,b.rejected)});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let d,u=0,f;if(!l){const m=[CX.bind(this),void 0];for(m.unshift(...a),m.push(...c),f=m.length,d=Promise.resolve(t);u<f;)d=d.then(m[u++],m[u++]);return d}f=a.length;let p=t;for(;u<f;){const m=a[u++],b=a[u++];try{p=m(p)}catch(C){b.call(this,C);break}}try{d=CX.call(this,p)}catch(m){return Promise.reject(m)}for(u=0,f=c.length;u<f;)d=d.then(c[u++],c[u++]);return d}getUri(e){e=yb(this.defaults,e);const t=Woe(e.baseURL,e.url,e.allowAbsoluteUrls);return Ooe(t,e.params,e.paramsSerializer)}};Oe.forEach(["delete","get","head","options"],function(e){d_.prototype[e]=function(t,i){return this.request(yb(i||{},{method:e,url:t,data:(i||{}).data}))}});Oe.forEach(["post","put","patch"],function(e){function t(i){return function(o,r,a){return this.request(yb(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}d_.prototype[e]=t(),d_.prototype[e+"Form"]=t(!0)});let $we=class Uoe{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});const i=this;this.promise.then(n=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o;const r=new Promise(a=>{i.subscribe(a),o=a}).then(n);return r.cancel=function(){i.unsubscribe(o)},r},e(function(o,r,a){i.reason||(i.reason=new Dk(o,r,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=i=>{e.abort(i)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Uoe(function(n){e=n}),cancel:e}}};function qwe(s){return function(t){return s.apply(null,t)}}function Kwe(s){return Oe.isObject(s)&&s.isAxiosError===!0}const $B={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($B).forEach(([s,e])=>{$B[e]=s});function $oe(s){const e=new d_(s),t=xoe(d_.prototype.request,e);return Oe.extend(t,d_.prototype,e,{allOwnKeys:!0}),Oe.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return $oe(yb(s,n))},t}const eo=$oe(kk);eo.Axios=d_;eo.CanceledError=Dk;eo.CancelToken=$we;eo.isCancel=Foe;eo.VERSION=joe;eo.toFormData=$2;eo.AxiosError=vi;eo.Cancel=eo.CanceledError;eo.all=function(e){return Promise.all(e)};eo.spread=qwe;eo.isAxiosError=Kwe;eo.mergeConfig=yb;eo.AxiosHeaders=sl;eo.formToJSON=s=>Poe(Oe.isHTMLForm(s)?new FormData(s):s);eo.getAdapter=zoe.getAdapter;eo.HttpStatusCode=$B;eo.default=eo;const{Axios:Mit,AxiosError:Hi,CanceledError:n5,isCancel:Ait,CancelToken:Oit,VERSION:Pit,all:Fit,Cancel:Bit,isAxiosError:Wit,spread:Hit,toFormData:Vit,AxiosHeaders:zit,HttpStatusCode:jit,formToJSON:Uit,getAdapter:$it,mergeConfig:qit}=eo,xt=eo.create({headers:{"Content-Type":"application/json"}}),qoe=eo.create();function Koe(s){s.interceptors.response.use(e=>e,e=>{const t=e.config?.url,i=typeof t=="string"&&t.startsWith("/api/auth/");return e.response?.status===401&&!i&&(Yoe(),window.location.href="/login"),Promise.reject(e)})}Koe(xt);Koe(qoe);function Gwe(s){if(s==="busy"||s==="retry"||s==="idle")return s;throw new Error(`Invalid session_status from /messages: ${String(s)}`)}function Ywe(s){if(Array.isArray(s))return s;throw new Error("Invalid messages payload from /messages")}const Goe=F.createContext(null);function yX(s,e){if(s instanceof Hi){const t=s.response?.data;return typeof t?.message=="string"?t.message:typeof t?.error=="string"?t.error:typeof t=="string"?t:s.message||e}return s instanceof Error?s.message:e}function Zwe({children:s}){const[e,t]=F.useState(null),i=localStorage.getItem("token"),[n,o]=F.useState(i),[r,a]=F.useState(!!i);F.useEffect(()=>{n&&(async()=>{try{const f=await xt.get("/api/auth/me",{headers:{Authorization:`Bearer ${n}`}});t(f.data),a(!1)}catch(f){if(f instanceof Hi&&f.response?.status===401){localStorage.removeItem("token"),o(null),a(!1);return}a(!0)}})()},[n]);const l=async(f,p)=>{try{const m=await xt.post("/api/auth/signin",{email:f,password:p});if(m.data.requires_password_change){if(typeof m.data.challenge_token!="string"||m.data.challenge_token.length===0)throw new Error("Missing challenge token for password change");return{type:"password_change_required",challengeToken:m.data.challenge_token}}if(typeof m.data.token!="string"||m.data.token.length===0)throw new Error("Missing authentication token from sign in response");return localStorage.setItem("token",m.data.token),o(m.data.token),{type:"authenticated"}}catch(m){throw new Error(yX(m,"Sign in failed"))}},c=async(f,p)=>{try{const m=await xt.post("/api/auth/complete-password-change",{challengeToken:f,newPassword:p});if(typeof m.data.token!="string"||m.data.token.length===0)throw new Error("Missing authentication token from password change response");localStorage.setItem("token",m.data.token),o(m.data.token)}catch(m){throw new Error(yX(m,"Password change failed"))}},d=()=>{Yoe(),o(null),t(null)},u=r?{loading:!0,login:l,completePasswordChange:c,logout:d}:{loading:!1,user:e,token:n,login:l,completePasswordChange:c,logout:d};return x.jsx(Goe.Provider,{value:u,children:s})}function Ss(){const s=F.useContext(Goe);if(!s)throw new Error("useAuth must be used within AuthProvider");return s}function Yoe(){localStorage.removeItem("token")}const SX="TeamCopilot";function Da(s){F.useEffect(()=>{const e=typeof s=="string"?s.trim():"";document.title=e?`${SX} - ${e}`:SX},[s])}function Xwe(){const[s,e]=F.useState("signin"),[t,i]=F.useState(""),[n,o]=F.useState(""),[r,a]=F.useState(""),[l,c]=F.useState(!1),[d,u]=F.useState(!1),[f,p]=F.useState(""),[m,b]=F.useState(""),{login:C,completePasswordChange:y,logout:S}=Ss(),L=Io();Da(s==="signin"?"Sign In":"Set New Password");const k=async I=>{I.preventDefault(),b("");try{const T=await C(t,n);if(T.type==="password_change_required"){p(T.challengeToken),e("change-password"),o("");return}L("/")}catch(T){const O=T instanceof Error?T.message:"Sign in failed";b(O),o(""),et.error(O)}},N=async I=>{I.preventDefault(),b("");try{await y(f,r),L("/")}catch(T){const O=T instanceof Error?T.message:"Password change failed";b(O),et.error(O)}};return x.jsxs("div",{className:"auth-container",children:[x.jsx("h1",{children:s==="signin"?"Sign In":"Set New Password"}),s==="signin"?x.jsxs("form",{onSubmit:k,className:"auth-form",children:[m&&x.jsx("p",{className:"auth-error",children:m}),x.jsx("label",{htmlFor:"email",children:"Email"}),x.jsx("input",{id:"email",name:"email",type:"email",value:t,onChange:I=>i(I.target.value),autoComplete:"username",required:!0}),x.jsx("label",{htmlFor:"password",children:"Password"}),x.jsxs("div",{className:"password-input-row",children:[x.jsx("input",{id:"password",name:"password",type:l?"text":"password",value:n,onChange:I=>o(I.target.value),autoComplete:"current-password",required:!0}),x.jsx("button",{type:"button",className:"password-toggle-button",onClick:()=>c(I=>!I),children:l?"Hide":"Show"})]}),x.jsx("button",{className:"auth-submit-button",type:"submit",children:"Sign In"})]}):x.jsxs("form",{onSubmit:N,className:"auth-form",children:[m&&x.jsx("p",{className:"auth-error",children:m}),x.jsx("p",{children:"You must set a new password before continuing."}),x.jsx("label",{htmlFor:"password-change-email",children:"Email"}),x.jsx("input",{id:"password-change-email",name:"email",type:"email",value:t,autoComplete:"username",readOnly:!0,required:!0}),x.jsx("label",{htmlFor:"new-password",children:"New Password (min 8 characters)"}),x.jsxs("div",{className:"password-input-row",children:[x.jsx("input",{id:"new-password",name:"new-password",type:d?"text":"password",value:r,onChange:I=>a(I.target.value),autoComplete:"new-password",minLength:8,required:!0}),x.jsx("button",{type:"button",className:"password-toggle-button",onClick:()=>u(I=>!I),children:d?"Hide":"Show"})]}),x.jsx("button",{className:"auth-submit-button",type:"submit",children:"Save Password"}),x.jsx("button",{className:"auth-submit-button",type:"button",onClick:()=>{S(),e("signin"),p(""),o(""),a(""),L("/login")},children:"Sign Out"})]}),x.jsx("p",{className:"auth-link",children:"Accounts are created by an administrator via CLI."})]})}function Qwe({viewLabel:s,onView:e,showRunAction:t,runLabel:i,canRun:n,onRunAi:o,onRunManual:r,onRunApi:a,deleteVisible:l,deleteLabel:c="Delete",deleting:d=!1,onDelete:u}){const[f,p]=F.useState(!1),m=!!(o&&r);return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"workflow-card-actions",children:[x.jsx("button",{className:"workflow-card-run-btn",onClick:e,children:s}),t&&x.jsx("button",{className:"workflow-card-run-btn",disabled:!n,onClick:()=>{m&&p(!0)},children:i}),l&&x.jsx("button",{className:"workflow-card-delete-btn",onClick:u,disabled:d,children:d?"Deleting...":c})]}),m&&f&&x.jsx("div",{className:"workflow-run-mode-modal-backdrop",onClick:()=>p(!1),children:x.jsxs("div",{className:"workflow-run-mode-modal",onClick:b=>b.stopPropagation(),children:[x.jsx("button",{type:"button",className:"workflow-run-mode-close-btn","aria-label":"Close",onClick:()=>p(!1)}),x.jsx("h4",{children:"Choose run mode"}),x.jsx("p",{children:"Pick how you want to run this workflow."}),x.jsx("button",{type:"button",className:"workflow-run-mode-ai-btn",onClick:()=>{o&&(o(),p(!1))},children:"AI mode (recommended)"}),x.jsx("button",{type:"button",className:"workflow-run-mode-manual-btn",onClick:()=>{r&&(r(),p(!1))},children:"Manual mode"}),a&&x.jsx("button",{type:"button",className:"workflow-run-mode-manual-btn",onClick:()=>{a(),p(!1)},children:"Using API"})]})})]})}function Zoe({kind:s,slug:e,name:t,description:i,created_by_user_id:n,created_by_user_name:o,created_by_user_email:r,approved_by_user_id:a,is_approved:l,can_edit:c,permission_mode:d,is_locked_due_to_missing_users:u,required_secrets:f,missing_required_secrets:p,can_run:m,userRole:b,currentUserId:C,token:y,viewLabel:S,showRunAction:L,runLabel:k,onUpdated:N,onDeleted:I,onOpen:T,onRunAi:O,onRunManual:M,onRunApi:B}){const[W,j]=F.useState(!1),[ee,G]=F.useState(!1),[te,Z]=F.useState(!1),[X,re]=F.useState(!1),[J,H]=F.useState(null),[$,le]=F.useState([]),[q,Ae]=F.useState("restricted"),[Ze,it]=F.useState([]),[ut,ht]=F.useState(n),[Re,yt]=F.useState(a),jt=n===C||b==="Engineer"&&(n===null||!o&&!r),Ti=l&&c,Fi=s==="workflow"?"Run access":"Access",tn=s==="workflow"?"Manage Run Permissions":"Manage Access Permissions",$i=s==="workflow"?"workflow":"skill",qi=s==="workflow"?"Workflow":"Skill",pn=`/api/${s==="workflow"?"workflows":"skills"}/${e}`,mn="/api/users",Ln=`/api/${s==="workflow"?"workflows":"skills"}/${e}/permissions`,go=async()=>{Z(!0),H(null);try{const[ve,Xe]=await Promise.all([xt.get(pn,{headers:{Authorization:`Bearer ${y}`}}),xt.get(mn,{headers:{Authorization:`Bearer ${y}`}})]),bt=s==="workflow"?ve.data.workflow:ve.data.skill,Ve=bt.permissions;if(!Ve)throw new Error("Missing permissions in response");ht(bt.created_by_user_id),yt(bt.approved_by_user_id),Ae(Ve.mode),it(Ve.mode==="restricted"?Ve.allowed_user_ids:[]),le(Xe.data.users),G(!0)}catch(ve){const Xe=ve instanceof Hi?ve.response?.data?.message||ve.response?.data||ve.message:`Failed to load ${$i} permissions`;H(String(Xe))}finally{Z(!1)}},js=ve=>{ut!==ve&&it(Xe=>Xe.includes(ve)?Xe.filter(bt=>bt!==ve):[...Xe,ve])},Wn=async()=>{re(!0);try{const ve=q==="everyone"?{mode:"everyone"}:{mode:"restricted",allowed_user_ids:Array.from(new Set(Ze))};await xt.patch(Ln,ve,{headers:{Authorization:`Bearer ${y}`}}),et.success(`${qi} permissions updated`),G(!1),N()}catch(ve){const Xe=ve instanceof Hi?ve.response?.data?.message||ve.response?.data||ve.message:`Failed to update ${$i} permissions`;et.error(String(Xe))}finally{re(!1)}},Vi=()=>{const ve=s==="workflow"?`/workflows/${encodeURIComponent(e)}/approval-review`:`/skills/${encodeURIComponent(e)}/approval-review`;window.open(ve,"_blank","noopener,noreferrer")},Us=async()=>{if(window.confirm(`Delete ${$i} "${t||e}"?
|
|
19
19
|
|
|
20
20
|
This will permanently delete the ${$i} folder${s==="workflow"?" and all past runs":""}. This cannot be undone.`)){j(!0);try{await xt.delete(pn,{headers:{Authorization:`Bearer ${y}`}}),et.success(`${qi} deleted successfully`),I()}catch(Xe){const bt=Xe instanceof Hi?Xe.response?.data?.message||Xe.response?.data||Xe.message:`Failed to delete ${$i}`;et.error(String(bt))}finally{j(!1)}}};return x.jsxs("div",{className:"workflow-card",children:[x.jsxs("div",{className:"workflow-card-header",children:[x.jsx("h3",{className:"workflow-card-title",children:t}),x.jsx("span",{className:`workflow-approval-badge ${l?"approved":"pending"}`,children:l?"Approved":"Pending Approval"})]}),s==="skill"?x.jsx("p",{className:"workflow-card-description workflow-card-description-scrollable",children:i.trim()||"No description available"}):i&&x.jsx("p",{className:"workflow-card-description",children:i}),x.jsxs("p",{className:"workflow-card-meta",children:["Created by: ",o??r??"Unknown User"]}),f.length>0&&x.jsxs("div",{className:"workflow-secret-section",children:[x.jsxs("p",{className:"workflow-secret-summary",children:["Requires secrets: ",f.join(", ")]}),p.length>0&&x.jsxs("p",{className:"workflow-secret-warning",children:["Missing for your account: ",p.join(", "),". Add them in Profile Secrets."]})]}),!l&&x.jsx("div",{className:"workflow-approval-section",children:b==="Engineer"?x.jsx("button",{className:"workflow-approve-btn",onClick:()=>{Vi()},children:"Review & Approve"}):x.jsxs("p",{className:"workflow-approval-message",children:["Ask an engineer to approve this ",$i," before it can be used."]})}),l&&x.jsxs("div",{className:"workflow-approval-section",children:[x.jsx("p",{className:"workflow-approval-message",children:d==="everyone"?`${Fi}: Everyone`:u?`${Fi}: Restricted (locked - no allowed users remain)`:`${Fi}: Restricted`}),J&&!ee&&x.jsx("p",{className:"workflow-approval-message",children:J}),te&&x.jsx("p",{className:"workflow-approval-message",children:"Loading permissions..."}),x.jsx("button",{className:"workflow-approve-btn",onClick:()=>{go()},disabled:!Ti||te,type:"button",children:"Manage Permissions"}),!Ti&&x.jsx("p",{className:"workflow-approval-message",children:u?"No one can modify permissions because no allowed users remain.":`Only users who can use this ${$i} can change permissions.`}),ee&&x.jsxs("div",{className:"permissions-editor",children:[x.jsxs("div",{className:"permissions-editor-header",children:[x.jsx("h4",{className:"permissions-editor-title",children:tn}),x.jsxs("div",{className:"permissions-mode-group",children:[x.jsx("label",{className:"permissions-mode-label",htmlFor:`permission-mode-select-${e}`,children:"Permission Mode"}),x.jsxs("select",{id:`permission-mode-select-${e}`,className:"permissions-mode-select",value:q,onChange:ve=>Ae(ve.target.value),children:[x.jsx("option",{value:"restricted",children:"Restricted (Specific Users)"}),x.jsx("option",{value:"everyone",children:"Everyone"})]})]})]}),q==="restricted"&&x.jsxs("div",{className:"permissions-users-section",children:[x.jsx("div",{className:"permissions-users-title",children:"Allowed Users"}),x.jsx("div",{className:"permissions-users-list",children:$.map(ve=>{const Xe=Ze.includes(ve.id),bt=ut===ve.id,Ve=Re===ve.id;return x.jsxs("div",{className:`permissions-user-item ${bt?"permissions-user-item-disabled":""}`,onClick:()=>!bt&&js(ve.id),children:[x.jsx("input",{type:"checkbox",className:"permissions-user-checkbox",checked:Xe,disabled:bt,onChange:()=>js(ve.id),onClick:ye=>ye.stopPropagation()}),x.jsxs("div",{className:"permissions-user-info",children:[x.jsx("div",{className:"permissions-user-name",children:ve.name}),x.jsx("div",{className:"permissions-user-email",children:ve.email})]}),(bt||Ve)&&x.jsxs("div",{className:"permissions-user-badges",children:[bt&&x.jsx("span",{className:"permissions-user-badge permissions-user-badge-owner",children:"Owner"}),Ve&&x.jsx("span",{className:"permissions-user-badge permissions-user-badge-approver",children:"Approver"})]})]},ve.id)})})]}),x.jsxs("div",{className:"permissions-editor-actions",children:[x.jsx("button",{type:"button",className:"permissions-editor-save-btn",onClick:Wn,onMouseDown:ve=>ve.stopPropagation(),disabled:X,children:X?"Saving...":"Save Permissions"}),x.jsx("button",{type:"button",className:"permissions-editor-cancel-btn",onClick:()=>G(!1),onMouseDown:ve=>ve.stopPropagation(),disabled:X,children:"Cancel"})]})]})]}),x.jsx(Qwe,{viewLabel:S,onView:()=>T(e),showRunAction:L,runLabel:k,canRun:m,onRunAi:O,onRunManual:M,onRunApi:B,deleteVisible:jt,deleting:W,onDelete:()=>{Us()}})]})}function Jwe(s){return x.jsx(Zoe,{kind:"workflow",slug:s.slug,name:s.name,description:s.intent_summary,created_by_user_id:s.created_by_user_id,created_by_user_name:s.created_by_user_name,created_by_user_email:s.created_by_user_email,approved_by_user_id:s.approved_by_user_id,is_approved:s.is_approved,can_view:s.can_view,can_edit:s.can_edit,permission_mode:s.permission_mode,is_locked_due_to_missing_users:s.is_locked_due_to_missing_users,required_secrets:s.required_secrets,missing_required_secrets:s.missing_required_secrets,can_run:s.is_approved&&s.can_edit&&s.missing_required_secrets.length===0,userRole:s.userRole,currentUserId:s.currentUserId,token:s.token,viewLabel:"View Code",showRunAction:!0,runLabel:"Run Workflow",onUpdated:s.onApproved,onDeleted:s.onDeleted,onOpen:s.onOpenWorkflow,onRunAi:()=>s.onRunWorkflow(s.name||s.slug),onRunManual:()=>s.onRunWorkflowManual(s.slug),onRunApi:()=>s.onRunWorkflowApi(s.slug)})}function xX(s){return s.toLowerCase().trim().replace(/\s+/g,"-").replace(/-+/g,"-")}function eye(s,e){const t=xX(e);if(!t)return!0;const i=xX(s);if(!i)return!1;const n=i.split("-").filter(Boolean),o=new Set;o.add(i);for(let r=0;r<n.length;r+=1)o.add(n[r]),o.add(n.slice(r).join("-"));for(const r of o)if(r.startsWith(t))return!0;return!1}function tye({onRunWorkflow:s}){const e=Io(),t=Ss(),[i,n]=F.useState([]),[o,r]=F.useState(!0),[a,l]=F.useState(null),[c,d]=F.useState("all"),[u,f]=F.useState("everyone"),[p,m]=F.useState(""),b=t.loading?null:t.token,C=t.loading?null:t.user,y=F.useCallback(async()=>{if(b)try{const L=await xt.get("/api/workflows",{headers:{Authorization:`Bearer ${b}`}});n(L.data.workflows)}catch(L){const k=L instanceof Hi?L.response?.data?.message||L.response?.data||L.message:"Failed to load workflows";l(k)}finally{r(!1)}},[b]);if(F.useEffect(()=>{y()},[y]),t.loading)return null;if(o)return x.jsx("div",{className:"section-loading",children:"Loading workflows..."});if(a)return x.jsx("div",{className:"section-error",children:a});if(i.length===0)return x.jsxs("div",{className:"section-empty",children:[x.jsx("h3",{children:"No Workflows Available"}),x.jsx("p",{children:"Create a workflow by talking to the AI Assistant."})]});const S=i.filter(L=>{const k=c==="all"?!0:c==="approved"?L.is_approved:!L.is_approved,N=u==="everyone"?!0:L.created_by_user_id===C?.userId,I=eye(L.name||L.slug,p);return k&&N&&I});return x.jsxs("div",{className:"workflows-section-content",children:[x.jsxs("div",{className:"workflow-filters",children:[x.jsxs("div",{className:"workflow-filters-title",children:[x.jsx("span",{className:"workflow-filters-heading",children:"Filters"}),x.jsxs("span",{className:"workflow-filters-count",children:[S.length," / ",i.length," shown"]})]}),x.jsxs("div",{className:"workflow-filter-group",children:[x.jsx("label",{htmlFor:"workflow-approval-filter",children:"Approval"}),x.jsx("div",{className:"workflow-filter-select-wrap",children:x.jsxs("select",{id:"workflow-approval-filter",value:c,onChange:L=>d(L.target.value),children:[x.jsx("option",{value:"all",children:"All"}),x.jsx("option",{value:"approved",children:"Approved"}),x.jsx("option",{value:"pending",children:"Pending approval"})]})})]}),x.jsxs("div",{className:"workflow-filter-group",children:[x.jsx("label",{htmlFor:"workflow-ownership-filter",children:"Scope"}),x.jsx("div",{className:"workflow-filter-select-wrap",children:x.jsxs("select",{id:"workflow-ownership-filter",value:u,onChange:L=>f(L.target.value),children:[x.jsx("option",{value:"everyone",children:"Everyone's"}),x.jsx("option",{value:"mine",children:"Only mine"})]})})]}),x.jsxs("div",{className:"workflow-filter-group workflow-filter-group-search",children:[x.jsx("label",{htmlFor:"workflow-title-search",children:"Search title"}),x.jsx("div",{className:"workflow-filter-search-wrap",children:x.jsx("input",{id:"workflow-title-search",type:"search",value:p,onChange:L=>m(L.target.value),placeholder:"Search workflow title..."})})]})]}),S.length===0?x.jsxs("div",{className:"section-empty",children:[x.jsx("h3",{children:"No Workflows Match Filters"}),x.jsx("p",{children:"Try changing the approval or ownership filters."})]}):x.jsx("div",{className:"workflows-grid",children:S.map(L=>x.jsx(Jwe,{...L,userRole:C?.role??"User",currentUserId:C?.userId??null,token:b??"",onApproved:y,onDeleted:y,onRunWorkflow:s,onRunWorkflowManual:k=>e(`/workflows/${encodeURIComponent(k)}/manual-run`),onRunWorkflowApi:k=>e(`/workflows/${encodeURIComponent(k)}/api-run`),onOpenWorkflow:k=>e(`/workflows/${encodeURIComponent(k)}`)},L.slug))})]})}function Xoe(s,e={}){const t=e.includeEmailForUserRuns===!0;return s.run_source==="cronjob"?s.user?`Cronjob (${s.user.name})`:"Cronjob":s.user?t?`${s.user.name} (${s.user.email})`:s.user.name:s.run_source==="api"?"Workflow API":"Unknown"}function iye(s){return new Date(s).toLocaleString()}function nye(s,e){if(!e)return"Running...";const t=e-s;return t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:`${(t/6e4).toFixed(1)}m`}function sye({status:s}){return x.jsx("span",{className:`status-badge status-${s}`,children:s})}function oye(){const s=Ss(),e=Io(),[t,i]=F.useState([]),[n,o]=F.useState(!0),[r,a]=F.useState(null),l=s.loading?null:s.token;return F.useEffect(()=>{if(!l)return;(async()=>{try{const d=await xt.get("/api/workflows/runs",{headers:{Authorization:`Bearer ${l}`}});i(d.data.runs)}catch(d){const u=d instanceof Hi?d.response?.data?.message||d.response?.data||d.message:"Failed to load run history";a(u)}finally{o(!1)}})()},[l]),s.loading?null:n?x.jsx("div",{className:"section-loading",children:"Loading run history..."}):r?x.jsx("div",{className:"section-error",children:r}):t.length===0?x.jsxs("div",{className:"section-empty",children:[x.jsx("h3",{children:"No Run History"}),x.jsx("p",{children:"Workflow runs will appear here once you start running workflows."})]}):x.jsx("div",{className:"run-history-table-container",children:x.jsxs("table",{className:"run-history-table",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx("th",{children:"Workflow"}),x.jsx("th",{children:"Status"}),x.jsx("th",{children:"Started"}),x.jsx("th",{children:"Duration"}),x.jsx("th",{children:"User"})]})}),x.jsx("tbody",{children:t.map(c=>x.jsxs("tr",{className:"run-history-row",onClick:()=>e(`/runs/${encodeURIComponent(c.id)}`),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),e(`/runs/${encodeURIComponent(c.id)}`))},tabIndex:0,role:"button",children:[x.jsx("td",{className:"workflow-name-cell",children:c.workflow_slug}),x.jsx("td",{children:x.jsx(sye,{status:c.status})}),x.jsx("td",{children:iye(c.started_at)}),x.jsx("td",{children:nye(c.started_at,c.completed_at)}),x.jsx("td",{children:Xoe(c)})]},c.id))})]})})}function rye({sessions:s,activeSessionId:e,attentionStateBySessionId:t,onSelectSession:i,onNewSession:n,isOpen:o,onToggle:r,loading:a}){const l=c=>{const d=new Date(c),u=new Date;return d.toDateString()===u.toDateString()?d.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):d.toLocaleDateString([],{month:"short",day:"numeric"})};return x.jsxs("aside",{className:`chat-sidebar ${o?"open":"collapsed"}`,children:[x.jsxs("div",{className:"chat-sidebar-header",children:[x.jsxs("div",{className:"chat-sidebar-header-title",children:[x.jsx("button",{type:"button",className:"chat-sidebar-toggle",onClick:r,"aria-label":o?"Collapse sessions sidebar":"Expand sessions sidebar","aria-expanded":o,children:o?"←":"→"}),o?x.jsx("h3",{children:"Sessions"}):null]}),o?x.jsx("button",{className:"new-session-btn",onClick:n,disabled:a,children:"+ New"}):null]}),x.jsx("div",{className:"session-list",id:"chat-session-list",children:s.length===0?x.jsx("div",{className:"no-sessions",children:a?"Loading...":"No sessions yet"}):s.map(c=>{const d=c.title||"New Chat",u=t[c.id],f=c.state==="attention"?c.latest_message_id:null,p=f!==null&&!(u?.messageId===f&&u.delivery==="seen");return x.jsx("div",{className:`session-item ${c.id===e?"active":""} ${p?"has-unread":""}`,onClick:()=>i(c.id),role:"button",tabIndex:0,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),i(c.id))},children:x.jsxs("div",{className:"session-title","data-full-title":d,children:[x.jsxs("span",{className:"session-status-icons","aria-hidden":"true",children:[c.state==="processing"&&x.jsx("span",{className:"session-running-indicator"}),p&&x.jsx("span",{className:"session-unread-indicator"})]}),x.jsx("span",{className:"session-title-text",children:d}),x.jsx("span",{className:"session-updated-at",children:l(Number(c.updated_at))})]})},c.id)})})]})}function aye(s){return s.role==="user"}function lye(s){return s.role==="assistant"}function cye(s){return s.type==="text"}function dye(s){return s.type==="tool"}function uye(s){return s.type==="reasoning"}function hye(s,e){const t={};return(s[s.length-1]===""?[...s,""]:s).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const fye=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gye=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pye={};function LX(s,e){return(pye.jsx?gye:fye).test(s)}const mye=/[ \t\n\f\r]/g;function _ye(s){return typeof s=="object"?s.type==="text"?kX(s.value):!1:kX(s)}function kX(s){return s.replace(mye,"")===""}class Ek{constructor(e,t,i){this.normal=t,this.property=e,i&&(this.space=i)}}Ek.prototype.normal={};Ek.prototype.property={};Ek.prototype.space=void 0;function Qoe(s,e){const t={},i={};for(const n of s)Object.assign(t,n.property),Object.assign(i,n.normal);return new Ek(t,i,e)}function qB(s){return s.toLowerCase()}class fl{constructor(e,t){this.attribute=t,this.property=e}}fl.prototype.attribute="";fl.prototype.booleanish=!1;fl.prototype.boolean=!1;fl.prototype.commaOrSpaceSeparated=!1;fl.prototype.commaSeparated=!1;fl.prototype.defined=!1;fl.prototype.mustUseProperty=!1;fl.prototype.number=!1;fl.prototype.overloadedBoolean=!1;fl.prototype.property="";fl.prototype.spaceSeparated=!1;fl.prototype.space=void 0;let bye=0;const Oi=Jb(),So=Jb(),KB=Jb(),ct=Jb(),Cs=Jb(),ww=Jb(),Il=Jb();function Jb(){return 2**++bye}const GB=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oi,booleanish:So,commaOrSpaceSeparated:Il,commaSeparated:ww,number:ct,overloadedBoolean:KB,spaceSeparated:Cs},Symbol.toStringTag,{value:"Module"})),s5=Object.keys(GB);class jz extends fl{constructor(e,t,i,n){let o=-1;if(super(e,t),DX(this,"space",n),typeof i=="number")for(;++o<s5.length;){const r=s5[o];DX(this,s5[o],(i&GB[r])===GB[r])}}}jz.prototype.defined=!0;function DX(s,e,t){t&&(s[e]=t)}function Jy(s){const e={},t={};for(const[i,n]of Object.entries(s.properties)){const o=new jz(i,s.transform(s.attributes||{},i),n,s.space);s.mustUseProperty&&s.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),e[i]=o,t[qB(i)]=i,t[qB(o.attribute)]=i}return new Ek(e,t,s.space)}const Joe=Jy({properties:{ariaActiveDescendant:null,ariaAtomic:So,ariaAutoComplete:null,ariaBusy:So,ariaChecked:So,ariaColCount:ct,ariaColIndex:ct,ariaColSpan:ct,ariaControls:Cs,ariaCurrent:null,ariaDescribedBy:Cs,ariaDetails:null,ariaDisabled:So,ariaDropEffect:Cs,ariaErrorMessage:null,ariaExpanded:So,ariaFlowTo:Cs,ariaGrabbed:So,ariaHasPopup:null,ariaHidden:So,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Cs,ariaLevel:ct,ariaLive:null,ariaModal:So,ariaMultiLine:So,ariaMultiSelectable:So,ariaOrientation:null,ariaOwns:Cs,ariaPlaceholder:null,ariaPosInSet:ct,ariaPressed:So,ariaReadOnly:So,ariaRelevant:null,ariaRequired:So,ariaRoleDescription:Cs,ariaRowCount:ct,ariaRowIndex:ct,ariaRowSpan:ct,ariaSelected:So,ariaSetSize:ct,ariaSort:null,ariaValueMax:ct,ariaValueMin:ct,ariaValueNow:ct,ariaValueText:null,role:null},transform(s,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function ere(s,e){return e in s?s[e]:e}function tre(s,e){return ere(s,e.toLowerCase())}const vye=Jy({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ww,acceptCharset:Cs,accessKey:Cs,action:null,allow:null,allowFullScreen:Oi,allowPaymentRequest:Oi,allowUserMedia:Oi,alt:null,as:null,async:Oi,autoCapitalize:null,autoComplete:Cs,autoFocus:Oi,autoPlay:Oi,blocking:Cs,capture:null,charSet:null,checked:Oi,cite:null,className:Cs,cols:ct,colSpan:null,content:null,contentEditable:So,controls:Oi,controlsList:Cs,coords:ct|ww,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oi,defer:Oi,dir:null,dirName:null,disabled:Oi,download:KB,draggable:So,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oi,formTarget:null,headers:Cs,height:ct,hidden:KB,high:ct,href:null,hrefLang:null,htmlFor:Cs,httpEquiv:Cs,id:null,imageSizes:null,imageSrcSet:null,inert:Oi,inputMode:null,integrity:null,is:null,isMap:Oi,itemId:null,itemProp:Cs,itemRef:Cs,itemScope:Oi,itemType:Cs,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oi,low:ct,manifest:null,max:null,maxLength:ct,media:null,method:null,min:null,minLength:ct,multiple:Oi,muted:Oi,name:null,nonce:null,noModule:Oi,noValidate:Oi,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Oi,optimum:ct,pattern:null,ping:Cs,placeholder:null,playsInline:Oi,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oi,referrerPolicy:null,rel:Cs,required:Oi,reversed:Oi,rows:ct,rowSpan:ct,sandbox:Cs,scope:null,scoped:Oi,seamless:Oi,selected:Oi,shadowRootClonable:Oi,shadowRootDelegatesFocus:Oi,shadowRootMode:null,shape:null,size:ct,sizes:null,slot:null,span:ct,spellCheck:So,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ct,step:null,style:null,tabIndex:ct,target:null,title:null,translate:null,type:null,typeMustMatch:Oi,useMap:null,value:So,width:ct,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Cs,axis:null,background:null,bgColor:null,border:ct,borderColor:null,bottomMargin:ct,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oi,declare:Oi,event:null,face:null,frame:null,frameBorder:null,hSpace:ct,leftMargin:ct,link:null,longDesc:null,lowSrc:null,marginHeight:ct,marginWidth:ct,noResize:Oi,noHref:Oi,noShade:Oi,noWrap:Oi,object:null,profile:null,prompt:null,rev:null,rightMargin:ct,rules:null,scheme:null,scrolling:So,standby:null,summary:null,text:null,topMargin:ct,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ct,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Oi,disableRemotePlayback:Oi,prefix:null,property:null,results:ct,security:null,unselectable:null},space:"html",transform:tre}),Cye=Jy({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Il,accentHeight:ct,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ct,amplitude:ct,arabicForm:null,ascent:ct,attributeName:null,attributeType:null,azimuth:ct,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ct,by:null,calcMode:null,capHeight:ct,className:Cs,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ct,diffuseConstant:ct,direction:null,display:null,dur:null,divisor:ct,dominantBaseline:null,download:Oi,dx:null,dy:null,edgeMode:null,editable:null,elevation:ct,enableBackground:null,end:null,event:null,exponent:ct,externalResourcesRequired:null,fill:null,fillOpacity:ct,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ww,g2:ww,glyphName:ww,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ct,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ct,horizOriginX:ct,horizOriginY:ct,id:null,ideographic:ct,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ct,k:ct,k1:ct,k2:ct,k3:ct,k4:ct,kernelMatrix:Il,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ct,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ct,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ct,overlineThickness:ct,paintOrder:null,panose1:null,path:null,pathLength:ct,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Cs,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ct,pointsAtY:ct,pointsAtZ:ct,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Il,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Il,rev:Il,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Il,requiredFeatures:Il,requiredFonts:Il,requiredFormats:Il,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ct,specularExponent:ct,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ct,strikethroughThickness:ct,string:null,stroke:null,strokeDashArray:Il,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ct,strokeOpacity:ct,strokeWidth:null,style:null,surfaceScale:ct,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Il,tabIndex:ct,tableValues:null,target:null,targetX:ct,targetY:ct,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Il,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ct,underlineThickness:ct,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ct,values:null,vAlphabetic:ct,vMathematical:ct,vectorEffect:null,vHanging:ct,vIdeographic:ct,version:null,vertAdvY:ct,vertOriginX:ct,vertOriginY:ct,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ct,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ere}),ire=Jy({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(s,e){return"xlink:"+e.slice(5).toLowerCase()}}),nre=Jy({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tre}),sre=Jy({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(s,e){return"xml:"+e.slice(3).toLowerCase()}}),wye={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},yye=/[A-Z]/g,EX=/-[a-z]/g,Sye=/^data[-\w.:]+$/i;function xye(s,e){const t=qB(e);let i=e,n=fl;if(t in s.normal)return s.property[s.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Sye.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(EX,kye);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!EX.test(o)){let r=o.replace(yye,Lye);r.charAt(0)!=="-"&&(r="-"+r),e="data"+r}}n=jz}return new n(i,e)}function Lye(s){return"-"+s.toLowerCase()}function kye(s){return s.charAt(1).toUpperCase()}const Dye=Qoe([Joe,vye,ire,nre,sre],"html"),Uz=Qoe([Joe,Cye,ire,nre,sre],"svg");function Eye(s){return s.join(" ").trim()}var Xv={},o5,NX;function Nye(){if(NX)return o5;NX=1;var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,n=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,r=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
|
|
21
21
|
`,c="/",d="*",u="",f="comment",p="declaration";function m(C,y){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];y=y||{};var S=1,L=1;function k(G){var te=G.match(e);te&&(S+=te.length);var Z=G.lastIndexOf(l);L=~Z?G.length-Z:L+G.length}function N(){var G={line:S,column:L};return function(te){return te.position=new I(G),M(),te}}function I(G){this.start=G,this.end={line:S,column:L},this.source=y.source}I.prototype.content=C;function T(G){var te=new Error(y.source+":"+S+":"+L+": "+G);if(te.reason=G,te.filename=y.source,te.line=S,te.column=L,te.source=C,!y.silent)throw te}function O(G){var te=G.exec(C);if(te){var Z=te[0];return k(Z),C=C.slice(Z.length),te}}function M(){O(t)}function B(G){var te;for(G=G||[];te=W();)te!==!1&&G.push(te);return G}function W(){var G=N();if(!(c!=C.charAt(0)||d!=C.charAt(1))){for(var te=2;u!=C.charAt(te)&&(d!=C.charAt(te)||c!=C.charAt(te+1));)++te;if(te+=2,u===C.charAt(te-1))return T("End of comment missing");var Z=C.slice(2,te-2);return L+=2,k(Z),C=C.slice(te),L+=2,G({type:f,comment:Z})}}function j(){var G=N(),te=O(i);if(te){if(W(),!O(n))return T("property missing ':'");var Z=O(o),X=G({type:p,property:b(te[0].replace(s,u)),value:Z?b(Z[0].replace(s,u)):u});return O(r),X}}function ee(){var G=[];B(G);for(var te;te=j();)te!==!1&&(G.push(te),B(G));return G}return M(),ee()}function b(C){return C?C.replace(a,u):u}return o5=m,o5}var IX;function Iye(){if(IX)return Xv;IX=1;var s=Xv&&Xv.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Xv,"__esModule",{value:!0}),Xv.default=t;const e=s(Nye());function t(i,n){let o=null;if(!i||typeof i!="string")return o;const r=(0,e.default)(i),a=typeof n=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:d}=l;a?n(c,d,l):d&&(o=o||{},o[c]=d)}),o}return Xv}var C0={},TX;function Tye(){if(TX)return C0;TX=1,Object.defineProperty(C0,"__esModule",{value:!0}),C0.camelCase=void 0;var s=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,n=/^-(ms)-/,o=function(c){return!c||t.test(c)||s.test(c)},r=function(c,d){return d.toUpperCase()},a=function(c,d){return"".concat(d,"-")},l=function(c,d){return d===void 0&&(d={}),o(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(n,a):c=c.replace(i,a),c.replace(e,r))};return C0.camelCase=l,C0}var w0,RX;function Rye(){if(RX)return w0;RX=1;var s=w0&&w0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},e=s(Iye()),t=Tye();function i(n,o){var r={};return!n||typeof n!="string"||(0,e.default)(n,function(a,l){a&&l&&(r[(0,t.camelCase)(a,o)]=l)}),r}return i.default=i,w0=i,w0}var Mye=Rye();const Aye=Nz(Mye),ore=rre("end"),$z=rre("start");function rre(s){return e;function e(t){const i=t&&t.position&&t.position[s]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Oye(s){const e=$z(s),t=ore(s);if(e&&t)return{start:e,end:t}}function xS(s){return!s||typeof s!="object"?"":"position"in s||"type"in s?MX(s.position):"start"in s||"end"in s?MX(s):"line"in s||"column"in s?YB(s):""}function YB(s){return AX(s&&s.line)+":"+AX(s&&s.column)}function MX(s){return YB(s&&s.start)+"-"+YB(s&&s.end)}function AX(s){return s&&typeof s=="number"?s:1}class Gr extends Error{constructor(e,t,i){super(),typeof t=="string"&&(i=t,t=void 0);let n="",o={},r=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof e=="string"?n=e:!o.cause&&e&&(r=!0,n=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?o.ruleId=i:(o.source=i.slice(0,l),o.ruleId=i.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=n,this.line=a?a.line:void 0,this.name=xS(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=r&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Gr.prototype.file="";Gr.prototype.name="";Gr.prototype.reason="";Gr.prototype.message="";Gr.prototype.stack="";Gr.prototype.column=void 0;Gr.prototype.line=void 0;Gr.prototype.ancestors=void 0;Gr.prototype.cause=void 0;Gr.prototype.fatal=void 0;Gr.prototype.place=void 0;Gr.prototype.ruleId=void 0;Gr.prototype.source=void 0;const qz={}.hasOwnProperty,Pye=new Map,Fye=/[A-Z]/g,Bye=new Set(["table","tbody","thead","tfoot","tr"]),Wye=new Set(["td","th"]),are="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Hye(s,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Gye(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=Kye(t,e.jsx,e.jsxs)}const n={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Uz:Dye,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},o=lre(n,s,void 0);return o&&typeof o!="string"?o:n.create(s,n.Fragment,{children:o||void 0},void 0)}function lre(s,e,t){if(e.type==="element")return Vye(s,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return zye(s,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Uye(s,e,t);if(e.type==="mdxjsEsm")return jye(s,e);if(e.type==="root")return $ye(s,e,t);if(e.type==="text")return qye(s,e)}function Vye(s,e,t){const i=s.schema;let n=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(n=Uz,s.schema=n),s.ancestors.push(e);const o=dre(s,e.tagName,!1),r=Yye(s,e);let a=Gz(s,e);return Bye.has(e.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!_ye(l):!0})),cre(s,r,o,e),Kz(r,a),s.ancestors.pop(),s.schema=i,s.create(e,o,r,t)}function zye(s,e){if(e.data&&e.data.estree&&s.evaluater){const i=e.data.estree.body[0];return i.type,s.evaluater.evaluateExpression(i.expression)}Ox(s,e.position)}function jye(s,e){if(e.data&&e.data.estree&&s.evaluater)return s.evaluater.evaluateProgram(e.data.estree);Ox(s,e.position)}function Uye(s,e,t){const i=s.schema;let n=i;e.name==="svg"&&i.space==="html"&&(n=Uz,s.schema=n),s.ancestors.push(e);const o=e.name===null?s.Fragment:dre(s,e.name,!0),r=Zye(s,e),a=Gz(s,e);return cre(s,r,o,e),Kz(r,a),s.ancestors.pop(),s.schema=i,s.create(e,o,r,t)}function $ye(s,e,t){const i={};return Kz(i,Gz(s,e)),s.create(e,s.Fragment,i,t)}function qye(s,e){return e.value}function cre(s,e,t,i){typeof t!="string"&&t!==s.Fragment&&s.passNode&&(e.node=i)}function Kz(s,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(s.children=t)}}function Kye(s,e,t){return i;function i(n,o,r,a){const c=Array.isArray(r.children)?t:e;return a?c(o,r,a):c(o,r)}}function Gye(s,e){return t;function t(i,n,o,r){const a=Array.isArray(o.children),l=$z(i);return e(n,o,r,a,{columnNumber:l?l.column-1:void 0,fileName:s,lineNumber:l?l.line:void 0},void 0)}}function Yye(s,e){const t={};let i,n;for(n in e.properties)if(n!=="children"&&qz.call(e.properties,n)){const o=Xye(s,n,e.properties[n]);if(o){const[r,a]=o;s.tableCellAlignToStyle&&r==="align"&&typeof a=="string"&&Wye.has(e.tagName)?i=a:t[r]=a}}if(i){const o=t.style||(t.style={});o[s.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return t}function Zye(s,e){const t={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&s.evaluater){const o=i.data.estree.body[0];o.type;const r=o.expression;r.type;const a=r.properties[0];a.type,Object.assign(t,s.evaluater.evaluateExpression(a.argument))}else Ox(s,e.position);else{const n=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&s.evaluater){const a=i.value.data.estree.body[0];a.type,o=s.evaluater.evaluateExpression(a.expression)}else Ox(s,e.position);else o=i.value===null?!0:i.value;t[n]=o}return t}function Gz(s,e){const t=[];let i=-1;const n=s.passKeys?new Map:Pye;for(;++i<e.children.length;){const o=e.children[i];let r;if(s.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=n.get(l)||0;r=l+"-"+c,n.set(l,c+1)}}const a=lre(s,o,r);a!==void 0&&t.push(a)}return t}function Xye(s,e,t){const i=xye(s.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=i.commaSeparated?hye(t):Eye(t)),i.property==="style"){let n=typeof t=="object"?t:Qye(s,String(t));return s.stylePropertyNameCase==="css"&&(n=Jye(n)),["style",n]}return[s.elementAttributeNameCase==="react"&&i.space?wye[i.property]||i.property:i.attribute,t]}}function Qye(s,e){try{return Aye(e,{reactCompat:!0})}catch(t){if(s.ignoreInvalidStyle)return{};const i=t,n=new Gr("Cannot parse `style` attribute",{ancestors:s.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw n.file=s.filePath||void 0,n.url=are+"#cannot-parse-style-attribute",n}}function dre(s,e,t){let i;if(!t)i={type:"Literal",value:e};else if(e.includes(".")){const n=e.split(".");let o=-1,r;for(;++o<n.length;){const a=LX(n[o])?{type:"Identifier",name:n[o]}:{type:"Literal",value:n[o]};r=r?{type:"MemberExpression",object:r,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}i=r}else i=LX(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const n=i.value;return qz.call(s.components,n)?s.components[n]:n}if(s.evaluater)return s.evaluater.evaluateExpression(i);Ox(s)}function Ox(s,e){const t=new Gr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:s.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=s.filePath||void 0,t.url=are+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Jye(s){const e={};let t;for(t in s)qz.call(s,t)&&(e[e1e(t)]=s[t]);return e}function e1e(s){let e=s.replace(Fye,t1e);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function t1e(s){return"-"+s.toLowerCase()}const r5={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},i1e={};function Yz(s,e){const t=i1e,i=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,n=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return ure(s,i,n)}function ure(s,e,t){if(n1e(s)){if("value"in s)return s.type==="html"&&!t?"":s.value;if(e&&"alt"in s&&s.alt)return s.alt;if("children"in s)return OX(s.children,e,t)}return Array.isArray(s)?OX(s,e,t):""}function OX(s,e,t){const i=[];let n=-1;for(;++n<s.length;)i[n]=ure(s[n],e,t);return i.join("")}function n1e(s){return!!(s&&typeof s=="object")}const PX=document.createElement("i");function Zz(s){const e="&"+s+";";PX.innerHTML=e;const t=PX.textContent;return t.charCodeAt(t.length-1)===59&&s!=="semi"||t===e?!1:t}function zl(s,e,t,i){const n=s.length;let o=0,r;if(e<0?e=-e>n?0:n+e:e=e>n?n:e,t=t>0?t:0,i.length<1e4)r=Array.from(i),r.unshift(e,t),s.splice(...r);else for(t&&s.splice(e,t);o<i.length;)r=i.slice(o,o+1e4),r.unshift(e,0),s.splice(...r),o+=1e4,e+=1e4}function Sc(s,e){return s.length>0?(zl(s,s.length,0,e),s):e}const FX={}.hasOwnProperty;function hre(s){const e={};let t=-1;for(;++t<s.length;)s1e(e,s[t]);return e}function s1e(s,e){let t;for(t in e){const n=(FX.call(s,t)?s[t]:void 0)||(s[t]={}),o=e[t];let r;if(o)for(r in o){FX.call(n,r)||(n[r]=[]);const a=o[r];o1e(n[r],Array.isArray(a)?a:a?[a]:[])}}}function o1e(s,e){let t=-1;const i=[];for(;++t<e.length;)(e[t].add==="after"?s:i).push(e[t]);zl(s,0,0,i)}function fre(s,e){const t=Number.parseInt(s,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function _d(s){return s.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ha=Bp(/[A-Za-z]/),Hr=Bp(/[\dA-Za-z]/),r1e=Bp(/[#-'*+\--9=?A-Z^-~]/);function GI(s){return s!==null&&(s<32||s===127)}const ZB=Bp(/\d/),a1e=Bp(/[\dA-Fa-f]/),l1e=Bp(/[!-/:-@[-`{-~]/);function li(s){return s!==null&&s<-2}function bs(s){return s!==null&&(s<0||s===32)}function Qi(s){return s===-2||s===-1||s===32}const K2=Bp(new RegExp("\\p{P}|\\p{S}","u")),Sb=Bp(/\s/);function Bp(s){return e;function e(t){return t!==null&&t>-1&&s.test(String.fromCharCode(t))}}function e1(s){const e=[];let t=-1,i=0,n=0;for(;++t<s.length;){const o=s.charCodeAt(t);let r="";if(o===37&&Hr(s.charCodeAt(t+1))&&Hr(s.charCodeAt(t+2)))n=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(r=String.fromCharCode(o));else if(o>55295&&o<57344){const a=s.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(r=String.fromCharCode(o,a),n=1):r="�"}else r=String.fromCharCode(o);r&&(e.push(s.slice(i,t),encodeURIComponent(r)),i=t+n+1,r=""),n&&(t+=n,n=0)}return e.join("")+s.slice(i)}function wn(s,e,t,i){const n=i?i-1:Number.POSITIVE_INFINITY;let o=0;return r;function r(l){return Qi(l)?(s.enter(t),a(l)):e(l)}function a(l){return Qi(l)&&o++<n?(s.consume(l),a):(s.exit(t),e(l))}}const c1e={tokenize:d1e};function d1e(s){const e=s.attempt(this.parser.constructs.contentInitial,i,n);let t;return e;function i(a){if(a===null){s.consume(a);return}return s.enter("lineEnding"),s.consume(a),s.exit("lineEnding"),wn(s,e,"linePrefix")}function n(a){return s.enter("paragraph"),o(a)}function o(a){const l=s.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,r(a)}function r(a){if(a===null){s.exit("chunkText"),s.exit("paragraph"),s.consume(a);return}return li(a)?(s.consume(a),s.exit("chunkText"),o):(s.consume(a),r)}}const u1e={tokenize:h1e},BX={tokenize:f1e};function h1e(s){const e=this,t=[];let i=0,n,o,r;return a;function a(L){if(i<t.length){const k=t[i];return e.containerState=k[1],s.attempt(k[0].continuation,l,c)(L)}return c(L)}function l(L){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,n&&S();const k=e.events.length;let N=k,I;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){I=e.events[N][1].end;break}y(i);let T=k;for(;T<e.events.length;)e.events[T][1].end={...I},T++;return zl(e.events,N+1,0,e.events.slice(k)),e.events.length=T,c(L)}return a(L)}function c(L){if(i===t.length){if(!n)return f(L);if(n.currentConstruct&&n.currentConstruct.concrete)return m(L);e.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return e.containerState={},s.check(BX,d,u)(L)}function d(L){return n&&S(),y(i),f(L)}function u(L){return e.parser.lazy[e.now().line]=i!==t.length,r=e.now().offset,m(L)}function f(L){return e.containerState={},s.attempt(BX,p,m)(L)}function p(L){return i++,t.push([e.currentConstruct,e.containerState]),f(L)}function m(L){if(L===null){n&&S(),y(0),s.consume(L);return}return n=n||e.parser.flow(e.now()),s.enter("chunkFlow",{_tokenizer:n,contentType:"flow",previous:o}),b(L)}function b(L){if(L===null){C(s.exit("chunkFlow"),!0),y(0),s.consume(L);return}return li(L)?(s.consume(L),C(s.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(s.consume(L),b)}function C(L,k){const N=e.sliceStream(L);if(k&&N.push(null),L.previous=o,o&&(o.next=L),o=L,n.defineSkip(L.start),n.write(N),e.parser.lazy[L.start.line]){let I=n.events.length;for(;I--;)if(n.events[I][1].start.offset<r&&(!n.events[I][1].end||n.events[I][1].end.offset>r))return;const T=e.events.length;let O=T,M,B;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(M){B=e.events[O][1].end;break}M=!0}for(y(i),I=T;I<e.events.length;)e.events[I][1].end={...B},I++;zl(e.events,O+1,0,e.events.slice(T)),e.events.length=I}}function y(L){let k=t.length;for(;k-- >L;){const N=t[k];e.containerState=N[1],N[0].exit.call(e,s)}t.length=L}function S(){n.write([null]),o=void 0,n=void 0,e.containerState._closeFlow=void 0}}function f1e(s,e,t){return wn(s,s.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ay(s){if(s===null||bs(s)||Sb(s))return 1;if(K2(s))return 2}function G2(s,e,t){const i=[];let n=-1;for(;++n<s.length;){const o=s[n].resolveAll;o&&!i.includes(o)&&(e=o(e,t),i.push(o))}return e}const XB={name:"attention",resolveAll:g1e,tokenize:p1e};function g1e(s,e){let t=-1,i,n,o,r,a,l,c,d;for(;++t<s.length;)if(s[t][0]==="enter"&&s[t][1].type==="attentionSequence"&&s[t][1]._close){for(i=t;i--;)if(s[i][0]==="exit"&&s[i][1].type==="attentionSequence"&&s[i][1]._open&&e.sliceSerialize(s[i][1]).charCodeAt(0)===e.sliceSerialize(s[t][1]).charCodeAt(0)){if((s[i][1]._close||s[t][1]._open)&&(s[t][1].end.offset-s[t][1].start.offset)%3&&!((s[i][1].end.offset-s[i][1].start.offset+s[t][1].end.offset-s[t][1].start.offset)%3))continue;l=s[i][1].end.offset-s[i][1].start.offset>1&&s[t][1].end.offset-s[t][1].start.offset>1?2:1;const u={...s[i][1].end},f={...s[t][1].start};WX(u,-l),WX(f,l),r={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...s[i][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...s[t][1].start},end:f},o={type:l>1?"strongText":"emphasisText",start:{...s[i][1].end},end:{...s[t][1].start}},n={type:l>1?"strong":"emphasis",start:{...r.start},end:{...a.end}},s[i][1].end={...r.start},s[t][1].start={...a.end},c=[],s[i][1].end.offset-s[i][1].start.offset&&(c=Sc(c,[["enter",s[i][1],e],["exit",s[i][1],e]])),c=Sc(c,[["enter",n,e],["enter",r,e],["exit",r,e],["enter",o,e]]),c=Sc(c,G2(e.parser.constructs.insideSpan.null,s.slice(i+1,t),e)),c=Sc(c,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",n,e]]),s[t][1].end.offset-s[t][1].start.offset?(d=2,c=Sc(c,[["enter",s[t][1],e],["exit",s[t][1],e]])):d=0,zl(s,i-1,t-i+3,c),t=i+c.length-d-2;break}}for(t=-1;++t<s.length;)s[t][1].type==="attentionSequence"&&(s[t][1].type="data");return s}function p1e(s,e){const t=this.parser.constructs.attentionMarkers.null,i=this.previous,n=ay(i);let o;return r;function r(l){return o=l,s.enter("attentionSequence"),a(l)}function a(l){if(l===o)return s.consume(l),a;const c=s.exit("attentionSequence"),d=ay(l),u=!d||d===2&&n||t.includes(l),f=!n||n===2&&d||t.includes(i);return c._open=!!(o===42?u:u&&(n||!f)),c._close=!!(o===42?f:f&&(d||!u)),e(l)}}function WX(s,e){s.column+=e,s.offset+=e,s._bufferIndex+=e}const m1e={name:"autolink",tokenize:_1e};function _1e(s,e,t){let i=0;return n;function n(p){return s.enter("autolink"),s.enter("autolinkMarker"),s.consume(p),s.exit("autolinkMarker"),s.enter("autolinkProtocol"),o}function o(p){return ha(p)?(s.consume(p),r):p===64?t(p):c(p)}function r(p){return p===43||p===45||p===46||Hr(p)?(i=1,a(p)):c(p)}function a(p){return p===58?(s.consume(p),i=0,l):(p===43||p===45||p===46||Hr(p))&&i++<32?(s.consume(p),a):(i=0,c(p))}function l(p){return p===62?(s.exit("autolinkProtocol"),s.enter("autolinkMarker"),s.consume(p),s.exit("autolinkMarker"),s.exit("autolink"),e):p===null||p===32||p===60||GI(p)?t(p):(s.consume(p),l)}function c(p){return p===64?(s.consume(p),d):r1e(p)?(s.consume(p),c):t(p)}function d(p){return Hr(p)?u(p):t(p)}function u(p){return p===46?(s.consume(p),i=0,d):p===62?(s.exit("autolinkProtocol").type="autolinkEmail",s.enter("autolinkMarker"),s.consume(p),s.exit("autolinkMarker"),s.exit("autolink"),e):f(p)}function f(p){if((p===45||Hr(p))&&i++<63){const m=p===45?f:u;return s.consume(p),m}return t(p)}}const Nk={partial:!0,tokenize:b1e};function b1e(s,e,t){return i;function i(o){return Qi(o)?wn(s,n,"linePrefix")(o):n(o)}function n(o){return o===null||li(o)?e(o):t(o)}}const gre={continuation:{tokenize:C1e},exit:w1e,name:"blockQuote",tokenize:v1e};function v1e(s,e,t){const i=this;return n;function n(r){if(r===62){const a=i.containerState;return a.open||(s.enter("blockQuote",{_container:!0}),a.open=!0),s.enter("blockQuotePrefix"),s.enter("blockQuoteMarker"),s.consume(r),s.exit("blockQuoteMarker"),o}return t(r)}function o(r){return Qi(r)?(s.enter("blockQuotePrefixWhitespace"),s.consume(r),s.exit("blockQuotePrefixWhitespace"),s.exit("blockQuotePrefix"),e):(s.exit("blockQuotePrefix"),e(r))}}function C1e(s,e,t){const i=this;return n;function n(r){return Qi(r)?wn(s,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(r):o(r)}function o(r){return s.attempt(gre,e,t)(r)}}function w1e(s){s.exit("blockQuote")}const pre={name:"characterEscape",tokenize:y1e};function y1e(s,e,t){return i;function i(o){return s.enter("characterEscape"),s.enter("escapeMarker"),s.consume(o),s.exit("escapeMarker"),n}function n(o){return l1e(o)?(s.enter("characterEscapeValue"),s.consume(o),s.exit("characterEscapeValue"),s.exit("characterEscape"),e):t(o)}}const mre={name:"characterReference",tokenize:S1e};function S1e(s,e,t){const i=this;let n=0,o,r;return a;function a(u){return s.enter("characterReference"),s.enter("characterReferenceMarker"),s.consume(u),s.exit("characterReferenceMarker"),l}function l(u){return u===35?(s.enter("characterReferenceMarkerNumeric"),s.consume(u),s.exit("characterReferenceMarkerNumeric"),c):(s.enter("characterReferenceValue"),o=31,r=Hr,d(u))}function c(u){return u===88||u===120?(s.enter("characterReferenceMarkerHexadecimal"),s.consume(u),s.exit("characterReferenceMarkerHexadecimal"),s.enter("characterReferenceValue"),o=6,r=a1e,d):(s.enter("characterReferenceValue"),o=7,r=ZB,d(u))}function d(u){if(u===59&&n){const f=s.exit("characterReferenceValue");return r===Hr&&!Zz(i.sliceSerialize(f))?t(u):(s.enter("characterReferenceMarker"),s.consume(u),s.exit("characterReferenceMarker"),s.exit("characterReference"),e)}return r(u)&&n++<o?(s.consume(u),d):t(u)}}const HX={partial:!0,tokenize:L1e},VX={concrete:!0,name:"codeFenced",tokenize:x1e};function x1e(s,e,t){const i=this,n={partial:!0,tokenize:N};let o=0,r=0,a;return l;function l(I){return c(I)}function c(I){const T=i.events[i.events.length-1];return o=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=I,s.enter("codeFenced"),s.enter("codeFencedFence"),s.enter("codeFencedFenceSequence"),d(I)}function d(I){return I===a?(r++,s.consume(I),d):r<3?t(I):(s.exit("codeFencedFenceSequence"),Qi(I)?wn(s,u,"whitespace")(I):u(I))}function u(I){return I===null||li(I)?(s.exit("codeFencedFence"),i.interrupt?e(I):s.check(HX,b,k)(I)):(s.enter("codeFencedFenceInfo"),s.enter("chunkString",{contentType:"string"}),f(I))}function f(I){return I===null||li(I)?(s.exit("chunkString"),s.exit("codeFencedFenceInfo"),u(I)):Qi(I)?(s.exit("chunkString"),s.exit("codeFencedFenceInfo"),wn(s,p,"whitespace")(I)):I===96&&I===a?t(I):(s.consume(I),f)}function p(I){return I===null||li(I)?u(I):(s.enter("codeFencedFenceMeta"),s.enter("chunkString",{contentType:"string"}),m(I))}function m(I){return I===null||li(I)?(s.exit("chunkString"),s.exit("codeFencedFenceMeta"),u(I)):I===96&&I===a?t(I):(s.consume(I),m)}function b(I){return s.attempt(n,k,C)(I)}function C(I){return s.enter("lineEnding"),s.consume(I),s.exit("lineEnding"),y}function y(I){return o>0&&Qi(I)?wn(s,S,"linePrefix",o+1)(I):S(I)}function S(I){return I===null||li(I)?s.check(HX,b,k)(I):(s.enter("codeFlowValue"),L(I))}function L(I){return I===null||li(I)?(s.exit("codeFlowValue"),S(I)):(s.consume(I),L)}function k(I){return s.exit("codeFenced"),e(I)}function N(I,T,O){let M=0;return B;function B(te){return I.enter("lineEnding"),I.consume(te),I.exit("lineEnding"),W}function W(te){return I.enter("codeFencedFence"),Qi(te)?wn(I,j,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):j(te)}function j(te){return te===a?(I.enter("codeFencedFenceSequence"),ee(te)):O(te)}function ee(te){return te===a?(M++,I.consume(te),ee):M>=r?(I.exit("codeFencedFenceSequence"),Qi(te)?wn(I,G,"whitespace")(te):G(te)):O(te)}function G(te){return te===null||li(te)?(I.exit("codeFencedFence"),T(te)):O(te)}}}function L1e(s,e,t){const i=this;return n;function n(r){return r===null?t(r):(s.enter("lineEnding"),s.consume(r),s.exit("lineEnding"),o)}function o(r){return i.parser.lazy[i.now().line]?t(r):e(r)}}const a5={name:"codeIndented",tokenize:D1e},k1e={partial:!0,tokenize:E1e};function D1e(s,e,t){const i=this;return n;function n(c){return s.enter("codeIndented"),wn(s,o,"linePrefix",5)(c)}function o(c){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?r(c):t(c)}function r(c){return c===null?l(c):li(c)?s.attempt(k1e,r,l)(c):(s.enter("codeFlowValue"),a(c))}function a(c){return c===null||li(c)?(s.exit("codeFlowValue"),r(c)):(s.consume(c),a)}function l(c){return s.exit("codeIndented"),e(c)}}function E1e(s,e,t){const i=this;return n;function n(r){return i.parser.lazy[i.now().line]?t(r):li(r)?(s.enter("lineEnding"),s.consume(r),s.exit("lineEnding"),n):wn(s,o,"linePrefix",5)(r)}function o(r){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(r):li(r)?n(r):t(r)}}const N1e={name:"codeText",previous:T1e,resolve:I1e,tokenize:R1e};function I1e(s){let e=s.length-4,t=3,i,n;if((s[t][1].type==="lineEnding"||s[t][1].type==="space")&&(s[e][1].type==="lineEnding"||s[e][1].type==="space")){for(i=t;++i<e;)if(s[i][1].type==="codeTextData"){s[t][1].type="codeTextPadding",s[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(i=t-1,e++;++i<=e;)n===void 0?i!==e&&s[i][1].type!=="lineEnding"&&(n=i):(i===e||s[i][1].type==="lineEnding")&&(s[n][1].type="codeTextData",i!==n+2&&(s[n][1].end=s[i-1][1].end,s.splice(n+2,i-n-2),e-=i-n-2,i=n+2),n=void 0);return s}function T1e(s){return s!==96||this.events[this.events.length-1][1].type==="characterEscape"}function R1e(s,e,t){let i=0,n,o;return r;function r(u){return s.enter("codeText"),s.enter("codeTextSequence"),a(u)}function a(u){return u===96?(s.consume(u),i++,a):(s.exit("codeTextSequence"),l(u))}function l(u){return u===null?t(u):u===32?(s.enter("space"),s.consume(u),s.exit("space"),l):u===96?(o=s.enter("codeTextSequence"),n=0,d(u)):li(u)?(s.enter("lineEnding"),s.consume(u),s.exit("lineEnding"),l):(s.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||li(u)?(s.exit("codeTextData"),l(u)):(s.consume(u),c)}function d(u){return u===96?(s.consume(u),n++,d):n===i?(s.exit("codeTextSequence"),s.exit("codeText"),e(u)):(o.type="codeTextData",c(u))}}class M1e{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const i=t??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,t,i){const n=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return i&&y0(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),y0(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),y0(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);y0(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);y0(this.left,t.reverse())}}}function y0(s,e){let t=0;if(e.length<1e4)s.push(...e);else for(;t<e.length;)s.push(...e.slice(t,t+1e4)),t+=1e4}function _re(s){const e={};let t=-1,i,n,o,r,a,l,c;const d=new M1e(s);for(;++t<d.length;){for(;t in e;)t=e[t];if(i=d.get(t),t&&i[1].type==="chunkFlow"&&d.get(t-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,A1e(d,t)),t=e[t],c=!0);else if(i[1]._container){for(o=t,n=void 0;o--;)if(r=d.get(o),r[1].type==="lineEnding"||r[1].type==="lineEndingBlank")r[0]==="enter"&&(n&&(d.get(n)[1].type="lineEndingBlank"),r[1].type="lineEnding",n=o);else if(!(r[1].type==="linePrefix"||r[1].type==="listItemIndent"))break;n&&(i[1].end={...d.get(n)[1].start},a=d.slice(n,t),a.unshift(i),d.splice(n,t-n+1,a))}}return zl(s,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function A1e(s,e){const t=s.get(e)[1],i=s.get(e)[2];let n=e-1;const o=[];let r=t._tokenizer;r||(r=i.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(r._contentTypeTextTrailing=!0));const a=r.events,l=[],c={};let d,u,f=-1,p=t,m=0,b=0;const C=[b];for(;p;){for(;s.get(++n)[1]!==p;);o.push(n),p._tokenizer||(d=i.sliceStream(p),p.next||d.push(null),u&&r.defineSkip(p.start),p._isInFirstContentOfListItem&&(r._gfmTasklistFirstContentOfListItem=!0),r.write(d),p._isInFirstContentOfListItem&&(r._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=t;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(b=f+1,C.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(r.events=[],p?(p._tokenizer=void 0,p.previous=void 0):C.pop(),f=C.length;f--;){const y=a.slice(C[f],C[f+1]),S=o.pop();l.push([S,S+y.length-1]),s.splice(S,2,y)}for(l.reverse(),f=-1;++f<l.length;)c[m+l[f][0]]=m+l[f][1],m+=l[f][1]-l[f][0]-1;return c}const O1e={resolve:F1e,tokenize:B1e},P1e={partial:!0,tokenize:W1e};function F1e(s){return _re(s),s}function B1e(s,e){let t;return i;function i(a){return s.enter("content"),t=s.enter("chunkContent",{contentType:"content"}),n(a)}function n(a){return a===null?o(a):li(a)?s.check(P1e,r,o)(a):(s.consume(a),n)}function o(a){return s.exit("chunkContent"),s.exit("content"),e(a)}function r(a){return s.consume(a),s.exit("chunkContent"),t.next=s.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,n}}function W1e(s,e,t){const i=this;return n;function n(r){return s.exit("chunkContent"),s.enter("lineEnding"),s.consume(r),s.exit("lineEnding"),wn(s,o,"linePrefix")}function o(r){if(r===null||li(r))return t(r);const a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(r):s.interrupt(i.parser.constructs.flow,t,e)(r)}}function bre(s,e,t,i,n,o,r,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return u;function u(y){return y===60?(s.enter(i),s.enter(n),s.enter(o),s.consume(y),s.exit(o),f):y===null||y===32||y===41||GI(y)?t(y):(s.enter(i),s.enter(r),s.enter(a),s.enter("chunkString",{contentType:"string"}),b(y))}function f(y){return y===62?(s.enter(o),s.consume(y),s.exit(o),s.exit(n),s.exit(i),e):(s.enter(a),s.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(s.exit("chunkString"),s.exit(a),f(y)):y===null||y===60||li(y)?t(y):(s.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(s.consume(y),p):p(y)}function b(y){return!d&&(y===null||y===41||bs(y))?(s.exit("chunkString"),s.exit(a),s.exit(r),s.exit(i),e(y)):d<c&&y===40?(s.consume(y),d++,b):y===41?(s.consume(y),d--,b):y===null||y===32||y===40||GI(y)?t(y):(s.consume(y),y===92?C:b)}function C(y){return y===40||y===41||y===92?(s.consume(y),b):b(y)}}function vre(s,e,t,i,n,o){const r=this;let a=0,l;return c;function c(p){return s.enter(i),s.enter(n),s.consume(p),s.exit(n),s.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in r.parser.constructs?t(p):p===93?(s.exit(o),s.enter(n),s.consume(p),s.exit(n),s.exit(i),e):li(p)?(s.enter("lineEnding"),s.consume(p),s.exit("lineEnding"),d):(s.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===null||p===91||p===93||li(p)||a++>999?(s.exit("chunkString"),d(p)):(s.consume(p),l||(l=!Qi(p)),p===92?f:u)}function f(p){return p===91||p===92||p===93?(s.consume(p),a++,u):u(p)}}function Cre(s,e,t,i,n,o){let r;return a;function a(f){return f===34||f===39||f===40?(s.enter(i),s.enter(n),s.consume(f),s.exit(n),r=f===40?41:f,l):t(f)}function l(f){return f===r?(s.enter(n),s.consume(f),s.exit(n),s.exit(i),e):(s.enter(o),c(f))}function c(f){return f===r?(s.exit(o),l(r)):f===null?t(f):li(f)?(s.enter("lineEnding"),s.consume(f),s.exit("lineEnding"),wn(s,c,"linePrefix")):(s.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===r||f===null||li(f)?(s.exit("chunkString"),c(f)):(s.consume(f),f===92?u:d)}function u(f){return f===r||f===92?(s.consume(f),d):d(f)}}function LS(s,e){let t;return i;function i(n){return li(n)?(s.enter("lineEnding"),s.consume(n),s.exit("lineEnding"),t=!0,i):Qi(n)?wn(s,i,t?"linePrefix":"lineSuffix")(n):e(n)}}const H1e={name:"definition",tokenize:z1e},V1e={partial:!0,tokenize:j1e};function z1e(s,e,t){const i=this;let n;return o;function o(p){return s.enter("definition"),r(p)}function r(p){return vre.call(i,s,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return n=_d(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),p===58?(s.enter("definitionMarker"),s.consume(p),s.exit("definitionMarker"),l):t(p)}function l(p){return bs(p)?LS(s,c)(p):c(p)}function c(p){return bre(s,d,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return s.attempt(V1e,u,u)(p)}function u(p){return Qi(p)?wn(s,f,"whitespace")(p):f(p)}function f(p){return p===null||li(p)?(s.exit("definition"),i.parser.defined.push(n),e(p)):t(p)}}function j1e(s,e,t){return i;function i(a){return bs(a)?LS(s,n)(a):t(a)}function n(a){return Cre(s,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Qi(a)?wn(s,r,"whitespace")(a):r(a)}function r(a){return a===null||li(a)?e(a):t(a)}}const U1e={name:"hardBreakEscape",tokenize:$1e};function $1e(s,e,t){return i;function i(o){return s.enter("hardBreakEscape"),s.consume(o),n}function n(o){return li(o)?(s.exit("hardBreakEscape"),e(o)):t(o)}}const q1e={name:"headingAtx",resolve:K1e,tokenize:G1e};function K1e(s,e){let t=s.length-2,i=3,n,o;return s[i][1].type==="whitespace"&&(i+=2),t-2>i&&s[t][1].type==="whitespace"&&(t-=2),s[t][1].type==="atxHeadingSequence"&&(i===t-1||t-4>i&&s[t-2][1].type==="whitespace")&&(t-=i+1===t?2:4),t>i&&(n={type:"atxHeadingText",start:s[i][1].start,end:s[t][1].end},o={type:"chunkText",start:s[i][1].start,end:s[t][1].end,contentType:"text"},zl(s,i,t-i+1,[["enter",n,e],["enter",o,e],["exit",o,e],["exit",n,e]])),s}function G1e(s,e,t){let i=0;return n;function n(d){return s.enter("atxHeading"),o(d)}function o(d){return s.enter("atxHeadingSequence"),r(d)}function r(d){return d===35&&i++<6?(s.consume(d),r):d===null||bs(d)?(s.exit("atxHeadingSequence"),a(d)):t(d)}function a(d){return d===35?(s.enter("atxHeadingSequence"),l(d)):d===null||li(d)?(s.exit("atxHeading"),e(d)):Qi(d)?wn(s,a,"whitespace")(d):(s.enter("atxHeadingText"),c(d))}function l(d){return d===35?(s.consume(d),l):(s.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||bs(d)?(s.exit("atxHeadingText"),a(d)):(s.consume(d),c)}}const Y1e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zX=["pre","script","style","textarea"],Z1e={concrete:!0,name:"htmlFlow",resolveTo:J1e,tokenize:e0e},X1e={partial:!0,tokenize:i0e},Q1e={partial:!0,tokenize:t0e};function J1e(s){let e=s.length;for(;e--&&!(s[e][0]==="enter"&&s[e][1].type==="htmlFlow"););return e>1&&s[e-2][1].type==="linePrefix"&&(s[e][1].start=s[e-2][1].start,s[e+1][1].start=s[e-2][1].start,s.splice(e-2,2)),s}function e0e(s,e,t){const i=this;let n,o,r,a,l;return c;function c(q){return d(q)}function d(q){return s.enter("htmlFlow"),s.enter("htmlFlowData"),s.consume(q),u}function u(q){return q===33?(s.consume(q),f):q===47?(s.consume(q),o=!0,b):q===63?(s.consume(q),n=3,i.interrupt?e:H):ha(q)?(s.consume(q),r=String.fromCharCode(q),C):t(q)}function f(q){return q===45?(s.consume(q),n=2,p):q===91?(s.consume(q),n=5,a=0,m):ha(q)?(s.consume(q),n=4,i.interrupt?e:H):t(q)}function p(q){return q===45?(s.consume(q),i.interrupt?e:H):t(q)}function m(q){const Ae="CDATA[";return q===Ae.charCodeAt(a++)?(s.consume(q),a===Ae.length?i.interrupt?e:j:m):t(q)}function b(q){return ha(q)?(s.consume(q),r=String.fromCharCode(q),C):t(q)}function C(q){if(q===null||q===47||q===62||bs(q)){const Ae=q===47,Ze=r.toLowerCase();return!Ae&&!o&&zX.includes(Ze)?(n=1,i.interrupt?e(q):j(q)):Y1e.includes(r.toLowerCase())?(n=6,Ae?(s.consume(q),y):i.interrupt?e(q):j(q)):(n=7,i.interrupt&&!i.parser.lazy[i.now().line]?t(q):o?S(q):L(q))}return q===45||Hr(q)?(s.consume(q),r+=String.fromCharCode(q),C):t(q)}function y(q){return q===62?(s.consume(q),i.interrupt?e:j):t(q)}function S(q){return Qi(q)?(s.consume(q),S):B(q)}function L(q){return q===47?(s.consume(q),B):q===58||q===95||ha(q)?(s.consume(q),k):Qi(q)?(s.consume(q),L):B(q)}function k(q){return q===45||q===46||q===58||q===95||Hr(q)?(s.consume(q),k):N(q)}function N(q){return q===61?(s.consume(q),I):Qi(q)?(s.consume(q),N):L(q)}function I(q){return q===null||q===60||q===61||q===62||q===96?t(q):q===34||q===39?(s.consume(q),l=q,T):Qi(q)?(s.consume(q),I):O(q)}function T(q){return q===l?(s.consume(q),l=null,M):q===null||li(q)?t(q):(s.consume(q),T)}function O(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||bs(q)?N(q):(s.consume(q),O)}function M(q){return q===47||q===62||Qi(q)?L(q):t(q)}function B(q){return q===62?(s.consume(q),W):t(q)}function W(q){return q===null||li(q)?j(q):Qi(q)?(s.consume(q),W):t(q)}function j(q){return q===45&&n===2?(s.consume(q),Z):q===60&&n===1?(s.consume(q),X):q===62&&n===4?(s.consume(q),$):q===63&&n===3?(s.consume(q),H):q===93&&n===5?(s.consume(q),J):li(q)&&(n===6||n===7)?(s.exit("htmlFlowData"),s.check(X1e,le,ee)(q)):q===null||li(q)?(s.exit("htmlFlowData"),ee(q)):(s.consume(q),j)}function ee(q){return s.check(Q1e,G,le)(q)}function G(q){return s.enter("lineEnding"),s.consume(q),s.exit("lineEnding"),te}function te(q){return q===null||li(q)?ee(q):(s.enter("htmlFlowData"),j(q))}function Z(q){return q===45?(s.consume(q),H):j(q)}function X(q){return q===47?(s.consume(q),r="",re):j(q)}function re(q){if(q===62){const Ae=r.toLowerCase();return zX.includes(Ae)?(s.consume(q),$):j(q)}return ha(q)&&r.length<8?(s.consume(q),r+=String.fromCharCode(q),re):j(q)}function J(q){return q===93?(s.consume(q),H):j(q)}function H(q){return q===62?(s.consume(q),$):q===45&&n===2?(s.consume(q),H):j(q)}function $(q){return q===null||li(q)?(s.exit("htmlFlowData"),le(q)):(s.consume(q),$)}function le(q){return s.exit("htmlFlow"),e(q)}}function t0e(s,e,t){const i=this;return n;function n(r){return li(r)?(s.enter("lineEnding"),s.consume(r),s.exit("lineEnding"),o):t(r)}function o(r){return i.parser.lazy[i.now().line]?t(r):e(r)}}function i0e(s,e,t){return i;function i(n){return s.enter("lineEnding"),s.consume(n),s.exit("lineEnding"),s.attempt(Nk,e,t)}}const n0e={name:"htmlText",tokenize:s0e};function s0e(s,e,t){const i=this;let n,o,r;return a;function a(H){return s.enter("htmlText"),s.enter("htmlTextData"),s.consume(H),l}function l(H){return H===33?(s.consume(H),c):H===47?(s.consume(H),N):H===63?(s.consume(H),L):ha(H)?(s.consume(H),O):t(H)}function c(H){return H===45?(s.consume(H),d):H===91?(s.consume(H),o=0,m):ha(H)?(s.consume(H),S):t(H)}function d(H){return H===45?(s.consume(H),p):t(H)}function u(H){return H===null?t(H):H===45?(s.consume(H),f):li(H)?(r=u,X(H)):(s.consume(H),u)}function f(H){return H===45?(s.consume(H),p):u(H)}function p(H){return H===62?Z(H):H===45?f(H):u(H)}function m(H){const $="CDATA[";return H===$.charCodeAt(o++)?(s.consume(H),o===$.length?b:m):t(H)}function b(H){return H===null?t(H):H===93?(s.consume(H),C):li(H)?(r=b,X(H)):(s.consume(H),b)}function C(H){return H===93?(s.consume(H),y):b(H)}function y(H){return H===62?Z(H):H===93?(s.consume(H),y):b(H)}function S(H){return H===null||H===62?Z(H):li(H)?(r=S,X(H)):(s.consume(H),S)}function L(H){return H===null?t(H):H===63?(s.consume(H),k):li(H)?(r=L,X(H)):(s.consume(H),L)}function k(H){return H===62?Z(H):L(H)}function N(H){return ha(H)?(s.consume(H),I):t(H)}function I(H){return H===45||Hr(H)?(s.consume(H),I):T(H)}function T(H){return li(H)?(r=T,X(H)):Qi(H)?(s.consume(H),T):Z(H)}function O(H){return H===45||Hr(H)?(s.consume(H),O):H===47||H===62||bs(H)?M(H):t(H)}function M(H){return H===47?(s.consume(H),Z):H===58||H===95||ha(H)?(s.consume(H),B):li(H)?(r=M,X(H)):Qi(H)?(s.consume(H),M):Z(H)}function B(H){return H===45||H===46||H===58||H===95||Hr(H)?(s.consume(H),B):W(H)}function W(H){return H===61?(s.consume(H),j):li(H)?(r=W,X(H)):Qi(H)?(s.consume(H),W):M(H)}function j(H){return H===null||H===60||H===61||H===62||H===96?t(H):H===34||H===39?(s.consume(H),n=H,ee):li(H)?(r=j,X(H)):Qi(H)?(s.consume(H),j):(s.consume(H),G)}function ee(H){return H===n?(s.consume(H),n=void 0,te):H===null?t(H):li(H)?(r=ee,X(H)):(s.consume(H),ee)}function G(H){return H===null||H===34||H===39||H===60||H===61||H===96?t(H):H===47||H===62||bs(H)?M(H):(s.consume(H),G)}function te(H){return H===47||H===62||bs(H)?M(H):t(H)}function Z(H){return H===62?(s.consume(H),s.exit("htmlTextData"),s.exit("htmlText"),e):t(H)}function X(H){return s.exit("htmlTextData"),s.enter("lineEnding"),s.consume(H),s.exit("lineEnding"),re}function re(H){return Qi(H)?wn(s,J,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):J(H)}function J(H){return s.enter("htmlTextData"),r(H)}}const Xz={name:"labelEnd",resolveAll:l0e,resolveTo:c0e,tokenize:d0e},o0e={tokenize:u0e},r0e={tokenize:h0e},a0e={tokenize:f0e};function l0e(s){let e=-1;const t=[];for(;++e<s.length;){const i=s[e][1];if(t.push(s[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const n=i.type==="labelImage"?4:2;i.type="data",e+=n}}return s.length!==t.length&&zl(s,0,s.length,t),s}function c0e(s,e){let t=s.length,i=0,n,o,r,a;for(;t--;)if(n=s[t][1],o){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;s[t][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(r){if(s[t][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(o=t,n.type!=="labelLink")){i=2;break}}else n.type==="labelEnd"&&(r=t);const l={type:s[o][1].type==="labelLink"?"link":"image",start:{...s[o][1].start},end:{...s[s.length-1][1].end}},c={type:"label",start:{...s[o][1].start},end:{...s[r][1].end}},d={type:"labelText",start:{...s[o+i+2][1].end},end:{...s[r-2][1].start}};return a=[["enter",l,e],["enter",c,e]],a=Sc(a,s.slice(o+1,o+i+3)),a=Sc(a,[["enter",d,e]]),a=Sc(a,G2(e.parser.constructs.insideSpan.null,s.slice(o+i+4,r-3),e)),a=Sc(a,[["exit",d,e],s[r-2],s[r-1],["exit",c,e]]),a=Sc(a,s.slice(r+1)),a=Sc(a,[["exit",l,e]]),zl(s,o,s.length,a),s}function d0e(s,e,t){const i=this;let n=i.events.length,o,r;for(;n--;)if((i.events[n][1].type==="labelImage"||i.events[n][1].type==="labelLink")&&!i.events[n][1]._balanced){o=i.events[n][1];break}return a;function a(f){return o?o._inactive?u(f):(r=i.parser.defined.includes(_d(i.sliceSerialize({start:o.end,end:i.now()}))),s.enter("labelEnd"),s.enter("labelMarker"),s.consume(f),s.exit("labelMarker"),s.exit("labelEnd"),l):t(f)}function l(f){return f===40?s.attempt(o0e,d,r?d:u)(f):f===91?s.attempt(r0e,d,r?c:u)(f):r?d(f):u(f)}function c(f){return s.attempt(a0e,d,u)(f)}function d(f){return e(f)}function u(f){return o._balanced=!0,t(f)}}function u0e(s,e,t){return i;function i(u){return s.enter("resource"),s.enter("resourceMarker"),s.consume(u),s.exit("resourceMarker"),n}function n(u){return bs(u)?LS(s,o)(u):o(u)}function o(u){return u===41?d(u):bre(s,r,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function r(u){return bs(u)?LS(s,l)(u):d(u)}function a(u){return t(u)}function l(u){return u===34||u===39||u===40?Cre(s,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return bs(u)?LS(s,d)(u):d(u)}function d(u){return u===41?(s.enter("resourceMarker"),s.consume(u),s.exit("resourceMarker"),s.exit("resource"),e):t(u)}}function h0e(s,e,t){const i=this;return n;function n(a){return vre.call(i,s,o,r,"reference","referenceMarker","referenceString")(a)}function o(a){return i.parser.defined.includes(_d(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(a):t(a)}function r(a){return t(a)}}function f0e(s,e,t){return i;function i(o){return s.enter("reference"),s.enter("referenceMarker"),s.consume(o),s.exit("referenceMarker"),n}function n(o){return o===93?(s.enter("referenceMarker"),s.consume(o),s.exit("referenceMarker"),s.exit("reference"),e):t(o)}}const g0e={name:"labelStartImage",resolveAll:Xz.resolveAll,tokenize:p0e};function p0e(s,e,t){const i=this;return n;function n(a){return s.enter("labelImage"),s.enter("labelImageMarker"),s.consume(a),s.exit("labelImageMarker"),o}function o(a){return a===91?(s.enter("labelMarker"),s.consume(a),s.exit("labelMarker"),s.exit("labelImage"),r):t(a)}function r(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(a):e(a)}}const m0e={name:"labelStartLink",resolveAll:Xz.resolveAll,tokenize:_0e};function _0e(s,e,t){const i=this;return n;function n(r){return s.enter("labelLink"),s.enter("labelMarker"),s.consume(r),s.exit("labelMarker"),s.exit("labelLink"),o}function o(r){return r===94&&"_hiddenFootnoteSupport"in i.parser.constructs?t(r):e(r)}}const l5={name:"lineEnding",tokenize:b0e};function b0e(s,e){return t;function t(i){return s.enter("lineEnding"),s.consume(i),s.exit("lineEnding"),wn(s,e,"linePrefix")}}const nI={name:"thematicBreak",tokenize:v0e};function v0e(s,e,t){let i=0,n;return o;function o(c){return s.enter("thematicBreak"),r(c)}function r(c){return n=c,a(c)}function a(c){return c===n?(s.enter("thematicBreakSequence"),l(c)):i>=3&&(c===null||li(c))?(s.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===n?(s.consume(c),i++,l):(s.exit("thematicBreakSequence"),Qi(c)?wn(s,a,"whitespace")(c):a(c))}}const Wa={continuation:{tokenize:S0e},exit:L0e,name:"list",tokenize:y0e},C0e={partial:!0,tokenize:k0e},w0e={partial:!0,tokenize:x0e};function y0e(s,e,t){const i=this,n=i.events[i.events.length-1];let o=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,r=0;return a;function a(p){const m=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:ZB(p)){if(i.containerState.type||(i.containerState.type=m,s.enter(m,{_container:!0})),m==="listUnordered")return s.enter("listItemPrefix"),p===42||p===45?s.check(nI,t,c)(p):c(p);if(!i.interrupt||p===49)return s.enter("listItemPrefix"),s.enter("listItemValue"),l(p)}return t(p)}function l(p){return ZB(p)&&++r<10?(s.consume(p),l):(!i.interrupt||r<2)&&(i.containerState.marker?p===i.containerState.marker:p===41||p===46)?(s.exit("listItemValue"),c(p)):t(p)}function c(p){return s.enter("listItemMarker"),s.consume(p),s.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||p,s.check(Nk,i.interrupt?t:d,s.attempt(C0e,f,u))}function d(p){return i.containerState.initialBlankLine=!0,o++,f(p)}function u(p){return Qi(p)?(s.enter("listItemPrefixWhitespace"),s.consume(p),s.exit("listItemPrefixWhitespace"),f):t(p)}function f(p){return i.containerState.size=o+i.sliceSerialize(s.exit("listItemPrefix"),!0).length,e(p)}}function S0e(s,e,t){const i=this;return i.containerState._closeFlow=void 0,s.check(Nk,n,o);function n(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,wn(s,e,"listItemIndent",i.containerState.size+1)(a)}function o(a){return i.containerState.furtherBlankLines||!Qi(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s.attempt(w0e,e,r)(a))}function r(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,wn(s,s.attempt(Wa,e,t),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function x0e(s,e,t){const i=this;return wn(s,n,"listItemIndent",i.containerState.size+1);function n(o){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?e(o):t(o)}}function L0e(s){s.exit(this.containerState.type)}function k0e(s,e,t){const i=this;return wn(s,n,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(o){const r=i.events[i.events.length-1];return!Qi(o)&&r&&r[1].type==="listItemPrefixWhitespace"?e(o):t(o)}}const jX={name:"setextUnderline",resolveTo:D0e,tokenize:E0e};function D0e(s,e){let t=s.length,i,n,o;for(;t--;)if(s[t][0]==="enter"){if(s[t][1].type==="content"){i=t;break}s[t][1].type==="paragraph"&&(n=t)}else s[t][1].type==="content"&&s.splice(t,1),!o&&s[t][1].type==="definition"&&(o=t);const r={type:"setextHeading",start:{...s[i][1].start},end:{...s[s.length-1][1].end}};return s[n][1].type="setextHeadingText",o?(s.splice(n,0,["enter",r,e]),s.splice(o+1,0,["exit",s[i][1],e]),s[i][1].end={...s[o][1].end}):s[i][1]=r,s.push(["exit",r,e]),s}function E0e(s,e,t){const i=this;let n;return o;function o(c){let d=i.events.length,u;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){u=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||u)?(s.enter("setextHeadingLine"),n=c,r(c)):t(c)}function r(c){return s.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===n?(s.consume(c),a):(s.exit("setextHeadingLineSequence"),Qi(c)?wn(s,l,"lineSuffix")(c):l(c))}function l(c){return c===null||li(c)?(s.exit("setextHeadingLine"),e(c)):t(c)}}const N0e={tokenize:I0e};function I0e(s){const e=this,t=s.attempt(Nk,i,s.attempt(this.parser.constructs.flowInitial,n,wn(s,s.attempt(this.parser.constructs.flow,n,s.attempt(O1e,n)),"linePrefix")));return t;function i(o){if(o===null){s.consume(o);return}return s.enter("lineEndingBlank"),s.consume(o),s.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function n(o){if(o===null){s.consume(o);return}return s.enter("lineEnding"),s.consume(o),s.exit("lineEnding"),e.currentConstruct=void 0,t}}const T0e={resolveAll:yre()},R0e=wre("string"),M0e=wre("text");function wre(s){return{resolveAll:yre(s==="text"?A0e:void 0),tokenize:e};function e(t){const i=this,n=this.parser.constructs[s],o=t.attempt(n,r,a);return r;function r(d){return c(d)?o(d):a(d)}function a(d){if(d===null){t.consume(d);return}return t.enter("data"),t.consume(d),l}function l(d){return c(d)?(t.exit("data"),o(d)):(t.consume(d),l)}function c(d){if(d===null)return!0;const u=n[d];let f=-1;if(u)for(;++f<u.length;){const p=u[f];if(!p.previous||p.previous.call(i,i.previous))return!0}return!1}}}function yre(s){return e;function e(t,i){let n=-1,o;for(;++n<=t.length;)o===void 0?t[n]&&t[n][1].type==="data"&&(o=n,n++):(!t[n]||t[n][1].type!=="data")&&(n!==o+2&&(t[o][1].end=t[n-1][1].end,t.splice(o+2,n-o-2),n=o+2),o=void 0);return s?s(t,i):t}}function A0e(s,e){let t=0;for(;++t<=s.length;)if((t===s.length||s[t][1].type==="lineEnding")&&s[t-1][1].type==="data"){const i=s[t-1][1],n=e.sliceStream(i);let o=n.length,r=-1,a=0,l;for(;o--;){const c=n[o];if(typeof c=="string"){for(r=c.length;c.charCodeAt(r-1)===32;)a++,r--;if(r)break;r=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(e._contentTypeTextTrailing&&t===s.length&&(a=0),a){const c={type:t===s.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?r:i.start._bufferIndex+r,_index:i.start._index+o,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...c.start},i.start.offset===i.end.offset?Object.assign(i,c):(s.splice(t,0,["enter",c,e],["exit",c,e]),t+=2)}t++}return s}const O0e={42:Wa,43:Wa,45:Wa,48:Wa,49:Wa,50:Wa,51:Wa,52:Wa,53:Wa,54:Wa,55:Wa,56:Wa,57:Wa,62:gre},P0e={91:H1e},F0e={[-2]:a5,[-1]:a5,32:a5},B0e={35:q1e,42:nI,45:[jX,nI],60:Z1e,61:jX,95:nI,96:VX,126:VX},W0e={38:mre,92:pre},H0e={[-5]:l5,[-4]:l5,[-3]:l5,33:g0e,38:mre,42:XB,60:[m1e,n0e],91:m0e,92:[U1e,pre],93:Xz,95:XB,96:N1e},V0e={null:[XB,T0e]},z0e={null:[42,95]},j0e={null:[]},U0e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:z0e,contentInitial:P0e,disable:j0e,document:O0e,flow:B0e,flowInitial:F0e,insideSpan:V0e,string:W0e,text:H0e},Symbol.toStringTag,{value:"Module"}));function $0e(s,e,t){let i={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const n={},o=[];let r=[],a=[];const l={attempt:T(N),check:T(I),consume:S,enter:L,exit:k,interrupt:T(I,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:m,parser:s,previous:null,sliceSerialize:f,sliceStream:p,write:u};let d=e.tokenize.call(c,l);return e.resolveAll&&o.push(e),c;function u(W){return r=Sc(r,W),C(),r[r.length-1]!==null?[]:(O(e,0),c.events=G2(o,c.events,c),c.events)}function f(W,j){return K0e(p(W),j)}function p(W){return q0e(r,W)}function m(){const{_bufferIndex:W,_index:j,line:ee,column:G,offset:te}=i;return{_bufferIndex:W,_index:j,line:ee,column:G,offset:te}}function b(W){n[W.line]=W.column,B()}function C(){let W;for(;i._index<r.length;){const j=r[i._index];if(typeof j=="string")for(W=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===W&&i._bufferIndex<j.length;)y(j.charCodeAt(i._bufferIndex));else y(j)}}function y(W){d=d(W)}function S(W){li(W)?(i.line++,i.column=1,i.offset+=W===-3?2:1,B()):W!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===r[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=W}function L(W,j){const ee=j||{};return ee.type=W,ee.start=m(),c.events.push(["enter",ee,c]),a.push(ee),ee}function k(W){const j=a.pop();return j.end=m(),c.events.push(["exit",j,c]),j}function N(W,j){O(W,j.from)}function I(W,j){j.restore()}function T(W,j){return ee;function ee(G,te,Z){let X,re,J,H;return Array.isArray(G)?le(G):"tokenize"in G?le([G]):$(G);function $(it){return ut;function ut(ht){const Re=ht!==null&&it[ht],yt=ht!==null&&it.null,mt=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(yt)?yt:yt?[yt]:[]];return le(mt)(ht)}}function le(it){return X=it,re=0,it.length===0?Z:q(it[re])}function q(it){return ut;function ut(ht){return H=M(),J=it,it.partial||(c.currentConstruct=it),it.name&&c.parser.constructs.disable.null.includes(it.name)?Ze():it.tokenize.call(j?Object.assign(Object.create(c),j):c,l,Ae,Ze)(ht)}}function Ae(it){return W(J,H),te}function Ze(it){return H.restore(),++re<X.length?q(X[re]):Z}}}function O(W,j){W.resolveAll&&!o.includes(W)&&o.push(W),W.resolve&&zl(c.events,j,c.events.length-j,W.resolve(c.events.slice(j),c)),W.resolveTo&&(c.events=W.resolveTo(c.events,c))}function M(){const W=m(),j=c.previous,ee=c.currentConstruct,G=c.events.length,te=Array.from(a);return{from:G,restore:Z};function Z(){i=W,c.previous=j,c.currentConstruct=ee,c.events.length=G,a=te,B()}}function B(){i.line in n&&i.column<2&&(i.column=n[i.line],i.offset+=n[i.line]-1)}}function q0e(s,e){const t=e.start._index,i=e.start._bufferIndex,n=e.end._index,o=e.end._bufferIndex;let r;if(t===n)r=[s[t].slice(i,o)];else{if(r=s.slice(t,n),i>-1){const a=r[0];typeof a=="string"?r[0]=a.slice(i):r.shift()}o>0&&r.push(s[n].slice(0,o))}return r}function K0e(s,e){let t=-1;const i=[];let n;for(;++t<s.length;){const o=s[t];let r;if(typeof o=="string")r=o;else switch(o){case-5:{r="\r";break}case-4:{r=`
|
|
@@ -717,7 +717,7 @@ ${e.toString()}`}}class kR{constructor(e=new v1,t=!1,i,n=B7e){this._services=e,t
|
|
|
717
717
|
`:`\r
|
|
718
718
|
`),await this._clipboardService.writeText(L)})),i.getOption(92)||C.push(new va("diff.inline.revertChange",v("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),C},autoSelectFirstItem:!0})};this._register(zn(this._diffActions,"mousedown",m=>{if(!m.leftButton)return;const{top:b,height:C}=is(this._diffActions),y=Math.floor(d/3);m.preventDefault(),p(m.posx,b+C+y)})),this._register(i.onMouseMove(m=>{(m.target.type===8||m.target.type===5)&&m.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,m.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(m=>{m.event.leftButton&&(m.target.type===8||m.target.type===5)&&m.target.detail.viewZoneId===this._getViewZoneId()&&(m.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,m.event.browserEvent.y,d),p(m.event.posx,m.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:n}=is(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;c<this._viewLineCounts.length;c++)if(l+=this._viewLineCounts[c],r<l)return c}return r}}const Aie=Df("diffEditorWidget",{createHTML:s=>s});function yVe(s,e,t,i){fo(i,e.fontInfo);const n=t.length>0,o=new a1(1e4);let r=0,a=0;const l=[];for(let f=0;f<s.lineTokens.length;f++){const p=f+1,m=s.lineTokens[f],b=s.lineBreakData[f],C=br.filter(t,p,1,Number.MAX_SAFE_INTEGER);if(b){let y=0;for(const S of b.breakOffsets){const L=m.sliceAndInflate(y,S,0);r=Math.max(r,Oie(a,L,br.extractWrapped(C,y,S),n,s.mightContainNonBasicASCII,s.mightContainRTL,e,o)),a++,y=S}l.push(b.breakOffsets.length)}else l.push(1),r=Math.max(r,Oie(a,m,C,n,s.mightContainNonBasicASCII,s.mightContainRTL,e,o)),a++}r+=e.scrollBeyondLastColumn;const c=o.build(),d=Aie?Aie.createHTML(c):c;i.innerHTML=d;const u=r*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:u,viewLineCounts:l}}class SVe{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class z${static fromEditor(e){const t=e.getOptions(),i=t.get(50),n=t.get(146);return new z$(e.getModel()?.getOptions().tabSize||0,i,t.get(33),i.typicalHalfwidthCharacterWidth,t.get(105),t.get(67),n.decorationsWidth,t.get(118),t.get(100),t.get(95),t.get(51))}constructor(e,t,i,n,o,r,a,l,c,d,u){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=o,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=u}}function Oie(s,e,t,i,n,o,r,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(s*r.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),c=ul.isBasicASCII(l,n),d=ul.containsRTL(l,c,o),u=nD(new $p(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==mp.OFF,null),a);return a.appendString("</div>"),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var xVe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Pie=function(s,e){return function(t,i){e(t,i,s)}};let D6=class extends oe{constructor(e,t,i,n,o,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=Vt(this,0),this._originalScrollOffset=Vt(this,0),this._originalScrollOffsetAnimated=Nie(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Vt(this,0),this._modifiedScrollOffset=Vt(this,0),this._modifiedScrollOffsetAnimated=Nie(this._targetWindow,this._modifiedScrollOffset,this._store);const u=Vt("invalidateAlignmentsState",0),f=this._register(new Pi(()=>{u.set(u.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(L=>{this._canIgnoreViewZoneUpdateEvent()||f.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(L=>{this._canIgnoreViewZoneUpdateEvent()||f.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(L=>{(L.hasChanged(147)||L.hasChanged(67))&&f.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(L=>{(L.hasChanged(147)||L.hasChanged(67))&&f.schedule()}));const p=this._diffModel.map(L=>L?Ni(this,L.model.original.onDidChangeTokens,()=>L.model.original.tokenization.backgroundTokenizationState===2):void 0).map((L,k)=>L?.read(k)),m=nt(L=>{const k=this._diffModel.read(L),N=k?.diff.read(L);if(!k||!N)return null;u.read(L);const T=this._options.renderSideBySide.read(L);return Fie(this._editors.original,this._editors.modified,N.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,T)}),b=nt(L=>{const k=this._diffModel.read(L)?.movedTextToCompare.read(L);if(!k)return null;u.read(L);const N=k.changes.map(I=>new Dhe(I));return Fie(this._editors.original,this._editors.modified,N,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function C(){const L=document.createElement("div");return L.className="diagonal-fill",L}const y=this._register(new ge);this.viewZones=zp(this,(L,k)=>{y.clear();const N=m.read(L)||[],I=[],T=[],O=this._modifiedTopPadding.read(L);O>0&&T.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:O,showInHiddenAreas:!0,suppressMouseDown:!0});const M=this._originalTopPadding.read(L);M>0&&I.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:M,showInHiddenAreas:!0,suppressMouseDown:!0});const B=this._options.renderSideBySide.read(L),W=B?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(W){const J=this._editors.original.getModel();for(const H of N)if(H.diff)for(let $=H.originalRange.startLineNumber;$<H.originalRange.endLineNumberExclusive;$++){if($>J.getLineCount())return{orig:I,mod:T};W?.addRequest(J.getLineContent($),null,null)}}const j=W?.finalize()??[];let ee=0;const G=this._editors.modified.getOption(67),te=this._diffModel.read(L)?.movedTextToCompare.read(L),Z=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,X=this._editors.original.getModel()?.mightContainRTL()??!1,re=z$.fromEditor(this._editors.modified);for(const J of N)if(J.diff&&!B&&(!this._options.useTrueInlineDiffRendering.read(L)||!j$(J.diff))){if(!J.originalRange.isEmpty){p.read(L);const $=document.createElement("div");$.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const le=this._editors.original.getModel();if(J.originalRange.endLineNumberExclusive-1>le.getLineCount())return{orig:I,mod:T};const q=new SVe(J.originalRange.mapToLineArray(ht=>le.tokenization.getLineTokens(ht)),J.originalRange.mapToLineArray(ht=>j[ee++]),Z,X),Ae=[];for(const ht of J.diff.innerChanges||[])Ae.push(new KS(ht.originalRange.delta(-(J.diff.original.startLineNumber-1)),Ry.className,0));const Ze=yVe(q,re,Ae,$),it=document.createElement("div");if(it.className="inline-deleted-margin-view-zone",fo(it,re.fontInfo),this._options.renderIndicators.read(L))for(let ht=0;ht<Ze.heightInLines;ht++){const Re=document.createElement("div");Re.className=`delete-sign ${_t.asClassName(xhe)}`,Re.setAttribute("style",`position:absolute;top:${ht*G}px;width:${re.lineDecorationsWidth}px;height:${G}px;right:0;`),it.appendChild(Re)}let ut;y.add(new wVe(()=>Ig(ut),it,this._editors.modified,J.diff,this._diffEditorWidget,Ze.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let ht=0;ht<Ze.viewLineCounts.length;ht++){const Re=Ze.viewLineCounts[ht];Re>1&&I.push({afterLineNumber:J.originalRange.startLineNumber+ht,domNode:C(),heightInPx:(Re-1)*G,showInHiddenAreas:!0,suppressMouseDown:!0})}T.push({afterLineNumber:J.modifiedRange.startLineNumber-1,domNode:$,heightInPx:Ze.heightInLines*G,minWidthInPx:Ze.minWidthInPx,marginDomNode:it,setZoneId(ht){ut=ht},showInHiddenAreas:!0,suppressMouseDown:!0})}const H=document.createElement("div");H.className="gutter-delete",I.push({afterLineNumber:J.originalRange.endLineNumberExclusive-1,domNode:C(),heightInPx:J.modifiedHeightInPx,marginDomNode:H,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const H=J.modifiedHeightInPx-J.originalHeightInPx;if(H>0){if(te?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(J.originalRange.endLineNumberExclusive-1))continue;I.push({afterLineNumber:J.originalRange.endLineNumberExclusive-1,domNode:C(),heightInPx:H,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let $=function(){const q=document.createElement("div");return q.className="arrow-revert-change "+_t.asClassName(ke.arrowRight),k.add(ue(q,"mousedown",Ae=>Ae.stopPropagation())),k.add(ue(q,"click",Ae=>{Ae.stopPropagation(),o.revert(J.diff)})),Ee("div",{},q)};if(te?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(J.modifiedRange.endLineNumberExclusive-1))continue;let le;J.diff&&J.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(L)&&(le=$()),T.push({afterLineNumber:J.modifiedRange.endLineNumberExclusive-1,domNode:C(),heightInPx:-H,marginDomNode:le,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const J of b.read(L)??[]){if(!te?.lineRangeMapping.original.intersect(J.originalRange)||!te?.lineRangeMapping.modified.intersect(J.modifiedRange))continue;const H=J.modifiedHeightInPx-J.originalHeightInPx;H>0?I.push({afterLineNumber:J.originalRange.endLineNumberExclusive-1,domNode:C(),heightInPx:H,showInHiddenAreas:!0,suppressMouseDown:!0}):T.push({afterLineNumber:J.modifiedRange.endLineNumberExclusive-1,domNode:C(),heightInPx:-H,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:I,mod:T}});let S=!1;this._register(this._editors.original.onDidScrollChange(L=>{L.scrollLeftChanged&&!S&&(S=!0,this._editors.modified.setScrollLeft(L.scrollLeft),S=!1)})),this._register(this._editors.modified.onDidScrollChange(L=>{L.scrollLeftChanged&&!S&&(S=!0,this._editors.original.setScrollLeft(L.scrollLeft),S=!1)})),this._originalScrollTop=Ni(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ni(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Lt(L=>{const k=this._originalScrollTop.read(L)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(L))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(L));k!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(k,1)})),this._register(Lt(L=>{const k=this._modifiedScrollTop.read(L)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(L))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(L));k!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(k,1)})),this._register(Lt(L=>{const k=this._diffModel.read(L)?.movedTextToCompare.read(L);let N=0;if(k){const I=this._editors.original.getTopForLineNumber(k.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();N=this._editors.modified.getTopForLineNumber(k.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-I}N>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(N,void 0)):N<0?(this._modifiedTopPadding.set(-N,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-N,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+N,void 0,!0)}))}};D6=xVe([Pie(8,Tf),Pie(9,Ea)],D6);function Fie(s,e,t,i,n,o){const r=new hf(Bie(s,i)),a=new hf(Bie(e,n)),l=s.getOption(67),c=e.getOption(67),d=[];let u=0,f=0;function p(m,b){for(;;){let C=r.peek(),y=a.peek();if(C&&C.lineNumber>=m&&(C=void 0),y&&y.lineNumber>=b&&(y=void 0),!C&&!y)break;const S=C?C.lineNumber-u:Number.MAX_VALUE,L=y?y.lineNumber-f:Number.MAX_VALUE;S<L?(r.dequeue(),y={lineNumber:C.lineNumber-u+f,heightInPx:0}):S>L?(a.dequeue(),C={lineNumber:y.lineNumber-f+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Nt.ofLength(C.lineNumber,1),modifiedRange:Nt.ofLength(y.lineNumber,1),originalHeightInPx:l+C.heightInPx,modifiedHeightInPx:c+y.heightInPx,diff:void 0})}}for(const m of t){let L=function(k,N,I=!1){if(k<S||N<y)return;if(C)C=!1;else if(!I&&(k===S||N===y))return;const T=new Nt(S,k),O=new Nt(y,N);if(T.isEmpty&&O.isEmpty)return;const M=r.takeWhile(W=>W.lineNumber<k)?.reduce((W,j)=>W+j.heightInPx,0)??0,B=a.takeWhile(W=>W.lineNumber<N)?.reduce((W,j)=>W+j.heightInPx,0)??0;d.push({originalRange:T,modifiedRange:O,originalHeightInPx:T.length*l+M,modifiedHeightInPx:O.length*c+B,diff:m.lineRangeMapping}),S=k,y=N};const b=m.lineRangeMapping;p(b.original.startLineNumber,b.modified.startLineNumber);let C=!0,y=b.modified.startLineNumber,S=b.original.startLineNumber;if(o)for(const k of b.innerChanges||[]){k.originalRange.startColumn>1&&k.modifiedRange.startColumn>1&&L(k.originalRange.startLineNumber,k.modifiedRange.startLineNumber);const N=s.getModel(),I=k.originalRange.endLineNumber<=N.getLineCount()?N.getLineMaxColumn(k.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;k.originalRange.endColumn<I&&L(k.originalRange.endLineNumber,k.modifiedRange.endLineNumber)}L(b.original.endLineNumberExclusive,b.modified.endLineNumberExclusive,!0),u=b.original.endLineNumberExclusive,f=b.modified.endLineNumberExclusive}return p(Number.MAX_VALUE,Number.MAX_VALUE),d}function Bie(s,e){const t=[],i=[],n=s.getOption(147).wrappingColumn!==-1,o=s._getViewModel().coordinatesConverter,r=s.getOption(67);if(n)for(let l=1;l<=s.getModel().getLineCount();l++){const c=o.getModelLineViewLineCount(l);c>1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of s.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new ne(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return XHe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function j$(s){return s.innerChanges?s.innerChanges.every(e=>Wie(e.modifiedRange)&&Wie(e.originalRange)||e.originalRange.equalsRange(new A(1,1,1,1))):!1}function Wie(s){return s.startLineNumber===s.endLineNumber}const Dx=class Dx extends oe{constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=Ni(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ni(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Lo("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Vt(this,0),this._modifiedViewZonesChangedSignal=Lo("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Lo("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=zp(this,(d,u)=>{this._element.replaceChildren();const f=this._diffModel.read(d),p=f?.diff.read(d)?.movedTexts;if(!p||p.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const m=this._originalEditorLayoutInfo.read(d),b=this._modifiedEditorLayoutInfo.read(d);if(!m||!b){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const C=p.map(T=>{function O(X,re){const J=re.getTopForLineNumber(X.startLineNumber,!0),H=re.getTopForLineNumber(X.endLineNumberExclusive,!0);return(J+H)/2}const M=O(T.lineRangeMapping.original,this._editors.original),B=this._originalScrollTop.read(d),W=O(T.lineRangeMapping.modified,this._editors.modified),j=this._modifiedScrollTop.read(d),ee=M-B,G=W-j,te=Math.min(M,W),Z=Math.max(M,W);return{range:new Ut(te,Z),from:ee,to:G,fromWithoutScroll:M,toWithoutScroll:W,move:T}});C.sort(yDe(Cr(T=>T.fromWithoutScroll>T.toWithoutScroll,SDe),Cr(T=>T.fromWithoutScroll>T.toWithoutScroll?T.fromWithoutScroll:-T.toWithoutScroll,Tc)));const y=U$.compute(C.map(T=>T.range)),S=10,L=m.verticalScrollbarWidth,k=(y.getTrackCount()-1)*10+S*2,N=L+k+(b.contentLeft-Dx.movedCodeBlockPadding);let I=0;for(const T of C){const O=y.getTrack(I),M=L+S+O*10,B=15,W=15,j=N,ee=b.glyphMarginWidth+b.lineNumbersWidth,G=18,te=document.createElementNS("http://www.w3.org/2000/svg","rect");te.classList.add("arrow-rectangle"),te.setAttribute("x",`${j-ee}`),te.setAttribute("y",`${T.to-G/2}`),te.setAttribute("width",`${ee}`),te.setAttribute("height",`${G}`),this._element.appendChild(te);const Z=document.createElementNS("http://www.w3.org/2000/svg","g"),X=document.createElementNS("http://www.w3.org/2000/svg","path");X.setAttribute("d",`M 0 ${T.from} L ${M} ${T.from} L ${M} ${T.to} L ${j-W} ${T.to}`),X.setAttribute("fill","none"),Z.appendChild(X);const re=document.createElementNS("http://www.w3.org/2000/svg","polygon");re.classList.add("arrow"),u.add(Lt(J=>{X.classList.toggle("currentMove",T.move===f.activeMovedText.read(J)),re.classList.toggle("currentMove",T.move===f.activeMovedText.read(J))})),re.setAttribute("points",`${j-W},${T.to-B/2} ${j},${T.to} ${j-W},${T.to+B/2}`),Z.appendChild(re),this._element.appendChild(Z),I++}this.width.set(k,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(ot(()=>this._element.remove())),this._register(Lt(d=>{const u=this._originalEditorLayoutInfo.read(d),f=this._modifiedEditorLayoutInfo.read(d);!u||!f||(this._element.style.left=`${u.width-u.verticalScrollbarWidth}px`,this._element.style.height=`${u.height}px`,this._element.style.width=`${u.verticalScrollbarWidth+u.contentLeft-Dx.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(p1(this._state));const r=nt(d=>{const f=this._diffModel.read(d)?.diff.read(d);return f?f.movedTexts.map(p=>({move:p,original:new ZC(Vl(p.lineRangeMapping.original.startLineNumber-1),18),modified:new ZC(Vl(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(qR(this._editors.original,r.map(d=>d.map(u=>u.original)))),this._register(qR(this._editors.modified,r.map(d=>d.map(u=>u.modified)))),this._register(jr((d,u)=>{const f=r.read(d);for(const p of f)u.add(new Hie(this._editors.original,p.original,p.move,"original",this._diffModel.get())),u.add(new Hie(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=Lo("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=Lo("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(Yk({createEmptyChangeSummary:()=>{},handleChange:(d,u)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)},d=>{a.read(d),l.read(d);const u=this._diffModel.read(d);if(!u)return;const f=u.diff.read(d);let p;if(f&&c==="original"){const m=this._editors.originalCursor.read(d);m&&(p=f.movedTexts.find(b=>b.lineRangeMapping.original.contains(m.lineNumber)))}if(f&&c==="modified"){const m=this._editors.modifiedCursor.read(d);m&&(p=f.movedTexts.find(b=>b.lineRangeMapping.modified.contains(m.lineNumber)))}p!==u.movedTextToCompare.get()&&u.movedTextToCompare.set(void 0,void 0),u.setActiveMovedText(p)}))}};Dx.movedCodeBlockPadding=4;let Uw=Dx;class U${static compute(e){const t=[],i=[];for(const n of e){let o=t.findIndex(r=>!r.intersectsStrict(n));o===-1&&(t.length>=6?o=oMe(t,Cr(a=>a.intersectWithRangeLength(n),Tc)):(o=t.length,t.push(new Uj))),t[o].addRange(n),i.push(o)}return new U$(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class Hie extends A${constructor(e,t,i,n,o){const r=Kt("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=Kt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Kt("div.text-content@textContent"),Kt("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Ni(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(bf(this._nodes.root,{paddingRight:a.map(f=>f.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?v("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):v("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?v("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):v("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new al(this._nodes.actionBar,{highlightToggledItems:!0})),d=new va("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new va("","Compare",_t.asClassName(ke.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(Lt(f=>{const p=this._diffModel.movedTextToCompare.read(f)===i;u.checked=p})),c.push(u,{icon:!1,label:!0})}}class LVe extends oe{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=nt(this,o=>{const r=this._diffModel.read(o),a=r?.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),d=this._options.showEmptyDecorations.read(o),u=[],f=[];if(!l)for(const m of a.mappings)if(m.lineRangeMapping.original.isEmpty||u.push({range:m.lineRangeMapping.original.toInclusiveRange(),options:c?BL:Mie}),m.lineRangeMapping.modified.isEmpty||f.push({range:m.lineRangeMapping.modified.toInclusiveRange(),options:c?GR:Rie}),m.lineRangeMapping.modified.isEmpty||m.lineRangeMapping.original.isEmpty)m.lineRangeMapping.original.isEmpty||u.push({range:m.lineRangeMapping.original.toInclusiveRange(),options:W$}),m.lineRangeMapping.modified.isEmpty||f.push({range:m.lineRangeMapping.modified.toInclusiveRange(),options:F$});else{const b=this._options.useTrueInlineDiffRendering.read(o)&&j$(m.lineRangeMapping);for(const C of m.lineRangeMapping.innerChanges||[])if(m.lineRangeMapping.original.contains(C.originalRange.startLineNumber)&&u.push({range:C.originalRange,options:C.originalRange.isEmpty()&&d?H$:Ry}),m.lineRangeMapping.modified.contains(C.modifiedRange.startLineNumber)&&f.push({range:C.modifiedRange,options:C.modifiedRange.isEmpty()&&d&&!b?B$:YR}),b){const y=r.model.original.getValueInRange(C.originalRange);f.push({range:C.modifiedRange,options:{description:"deleted-text",before:{content:y,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(l)for(const m of l.changes){const b=m.original.toInclusiveRange();b&&u.push({range:b,options:c?BL:Mie});const C=m.modified.toInclusiveRange();C&&f.push({range:C,options:c?GR:Rie});for(const y of m.innerChanges||[])u.push({range:y.originalRange,options:Ry}),f.push({range:y.modifiedRange,options:YR})}const p=this._diffModel.read(o).activeMovedText.read(o);for(const m of a.movedTexts)u.push({range:m.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(m===p?" currentMove":""),blockPadding:[Uw.movedCodeBlockPadding,0,Uw.movedCodeBlockPadding,Uw.movedCodeBlockPadding]}}),f.push({range:m.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(m===p?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:f}}),this._register($R(this._editors.original,this._decorations.map(o=>o?.originalDecorations||[]))),this._register($R(this._editors.modified,this._decorations.map(o=>o?.modifiedDecorations||[])))}}class kVe{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=Kk(this,i=>{const n=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,n)}),this._sashRatio=Vt(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:o<r?r:o>i-r?i-r:o}}class Ehe extends oe{constructor(e,t,i,n,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new Po(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(Lt(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(Lt(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class DVe extends oe{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Ni(this,this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Ni(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=Lo("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=Lo("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=g1("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Kt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{On(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(ot(()=>o.disconnect())),this._register(Lt(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(Lt(r=>this.render(r)))}dispose(){super.dispose(),ho(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),n=new Set(this.views.keys()),o=Ut.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new Nt(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);On(c=>{for(const d of l){if(!d.range.intersect(a))continue;n.delete(d.id);let u=this.views.get(d.id);if(u)u.item.set(d,c);else{const b=document.createElement("div");this._domNode.appendChild(b);const C=Vt("item",d),y=this.itemProvider.createView(C,b);u=new EVe(C,y,b),this.views.set(d.id,u)}const f=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t,m=(d.range.endLineNumberExclusive===1?Math.max(f,this._editor.getTopForLineNumber(d.range.startLineNumber,!1)-t):Math.max(f,this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t))-f;u.domNode.style.top=`${f}px`,u.domNode.style.height=`${m}px`,u.gutterItemView.layout(Ut.ofStartAndLength(f,m),o)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class EVe{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class Nhe extends Nb{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class Vie extends Kle{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new Bc(e-1,t)}}class NVe extends oe{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new KEe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new ge),i.hoverDelegate=i.hoverDelegate??this._register(xy()),this.options=i,this.toggleMenuAction=this._register(new WL(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new al(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(n,o)=>{if(n.id===WL.ID)return this.toggleMenuActionViewItem=new XT(n,n.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:_t.asClassNameArray(i.moreIcon??ke.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const r=i.actionViewItemProvider(n,o);if(r)return r}if(n instanceof uy){const r=new XT(n,n.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:n.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return r.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(r),this.disposables.add(this._onDidChangeDropdownVisibility.add(r.onDidChangeVisibility)),r}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(n=>{this.actionBar.push(n,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(n)})})}getKeybindingLabel(e){return this.options.getKeyBinding?.(e)?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const qA=class qA extends va{constructor(e,t){t=t||v("moreActions","More Actions..."),super(qA.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};qA.ID="toolbar.toggle.more";let WL=qA;var Ihe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Lc=function(s,e){return function(t,i){e(t,i,s)}};let HL=class extends NVe{constructor(e,t,i,n,o,r,a,l){super(e,o,{getKeyBinding:d=>r.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new ge);const c=t?.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],i){this._sessionDisposables.clear();const n=e.slice(),o=t.slice(),r=[];let a=0;const l=[];let c=!1;if(this._options?.hiddenItemStrategy!==-1)for(let d=0;d<n.length;d++){const u=n[d];!(u instanceof Ca)&&!(u instanceof kw)||u.hideActions&&(r.push(u.hideActions.toggle),u.hideActions.toggle.checked&&a++,u.hideActions.isHidden&&(c=!0,n[d]=void 0,this._options?.hiddenItemStrategy!==0&&(l[d]=u)))}if(this._options?.overflowBehavior!==void 0){const d=z5e(new Set(this._options.overflowBehavior.exempted),ri.map(n,p=>p?.id)),u=this._options.overflowBehavior.maxItems-d.size;let f=0;for(let p=0;p<n.length;p++){const m=n[p];m&&(f++,!d.has(m.id)&&f>=u&&(n[p]=void 0,l[p]=m))}}_Q(n),_Q(l),super.setActions(n,Vs.join(l,o)),(r.length>0||n.length>0)&&this._sessionDisposables.add(ue(this.getElement(),"contextmenu",d=>{const u=new Ec(ft(this.getElement()),d),f=this.getItemAction(u.target);if(!f)return;u.preventDefault(),u.stopPropagation();const p=[];if(f instanceof Ca&&f.menuKeybinding)p.push(f.menuKeybinding);else if(!(f instanceof kw||f instanceof WL)){const b=!!this._keybindingService.lookupKeybinding(f.id);p.push(Kue(this._commandService,this._keybindingService,f.id,void 0,b))}if(r.length>0){let b=!1;if(a===1&&this._options?.hiddenItemStrategy===0){b=!0;for(let C=0;C<r.length;C++)if(r[C].checked){r[C]=g_({id:f.id,label:f.label,checked:!0,enabled:!1,run(){}});break}}if(!b&&(f instanceof Ca||f instanceof kw)){if(!f.hideActions)return;p.push(f.hideActions.hide)}else p.push(g_({id:"label",label:v("hide","Hide"),enabled:!1,run(){}}))}const m=Vs.join(p,r);this._options?.resetMenu&&!i&&(i=[this._options.resetMenu]),c&&i&&(m.push(new Vs),m.push(g_({id:"resetThisMenu",label:v("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),m.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>u,getActions:()=>m,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:typeof this._options?.telemetrySource=="string",contextKeyService:this._contextKeyService})}))}};HL=Ihe([Lc(2,gl),Lc(3,vt),Lc(4,Ea),Lc(5,Li),Lc(6,rn),Lc(7,zo)],HL);let ZR=class extends HL{constructor(e,t,i,n,o,r,a,l,c){super(e,{resetMenu:t,...i},n,o,r,a,l,c),this._onDidChangeMenuItems=this._store.add(new se),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),u=()=>{const f=[],p=[];KO(d,i?.menuOptions,{primary:f,secondary:p},i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",f.length===0&&p.length===0),super.setActions(f,p)};this._store.add(d.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new wi("This toolbar is populated from a menu.")}};ZR=Ihe([Lc(3,gl),Lc(4,vt),Lc(5,Ea),Lc(6,Li),Lc(7,rn),Lc(8,zo)],ZR);var The=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},TI=function(s,e){return function(t,i){e(t,i,s)}};const Y3=[],kN=35;let E6=class extends oe{constructor(e,t,i,n,o,r,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(Je.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Ni(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=nt(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=nt(this,d=>this._hasActions.read(d)?kN:0),this.elements=Kt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:kN+"px"}},[]),this._currentDiff=nt(this,d=>{const u=this._diffModel.read(d);if(!u)return;const f=u.diff.read(d)?.mappings,p=this._editors.modifiedCursor.read(d);if(p)return f?.find(m=>m.lineRangeMapping.modified.contains(p.lineNumber))}),this._selectedDiffs=nt(this,d=>{const f=this._diffModel.read(d)?.diff.read(d);if(!f)return Y3;const p=this._editors.modifiedSelections.read(d);if(p.every(y=>y.isEmpty()))return Y3;const m=new Wl(p.map(y=>Nt.fromRangeInclusive(y))),C=f.mappings.filter(y=>y.lineRangeMapping.innerChanges&&m.intersects(y.lineRangeMapping.modified)).map(y=>({mapping:y,rangeMappings:y.lineRangeMapping.innerChanges.filter(S=>p.some(L=>A.areIntersecting(S.modifiedRange,L)))}));return C.length===0||C.every(y=>y.rangeMappings.length===0)?Y3:C}),this._register(QHe(e,this.elements.root)),this._register(ue(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(bf(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),Jo(this,d=>this._showSash.read(d)?new Ehe(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,Kk(this,f=>this._sashLayout.sashLeft.read(f)-kN,(f,p)=>this._sashLayout.sashLeft.set(f+kN,p)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new DVe(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(d,u)=>{const f=this._diffModel.read(u);if(!f)return[];const p=f.diff.read(u);if(!p)return[];const m=this._selectedDiffs.read(u);if(m.length>0){const C=rl.fromRangeMappings(m.flatMap(y=>y.rangeMappings));return[new zie(C,!0,Je.DiffEditorSelectionToolbar,void 0,f.model.original.uri,f.model.modified.uri)]}const b=this._currentDiff.read(u);return p.mappings.map(C=>new zie(C.lineRangeMapping.withInnerChangesFromLineRanges(),C.lineRangeMapping===b?.lineRangeMapping,Je.DiffEditorHunkToolbar,void 0,f.model.original.uri,f.model.modified.uri))},createView:(d,u)=>this._instantiationService.createInstance(N6,d,u,this)})),this._register(ue(this.elements.gutter,De.MOUSE_WHEEL,d=>{this._editors.modified.getOption(104).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(d)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new Vie(this._editors.modifiedModel.get()),n=new Vie(this._editors.original.getModel());return new qj(t.map(a=>a.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};E6=The([TI(6,rt),TI(7,vt),TI(8,gl)],E6);class zie{constructor(e,t,i,n,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let N6=class extends oe{constructor(e,t,i,n){super(),this._item=e,this._elements=Kt("div.gutterItem",{style:{height:"20px",width:"34px"}},[Kt("div.background@background",{},[]),Kt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=Vt(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(_y,"element",!0,{position:{hoverPosition:1}}));this._register(YC(t,this._elements.root)),this._register(Lt(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(jr((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(n.createInstance(ZR,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:o,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:new Nhe(()=>{const c=this._item.get(),d=c.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const n=e.length/2-i/2,o=i;let r=e.start+n;const a=Ut.tryCreate(o,t.endExclusive-o-i),l=Ut.tryCreate(e.start+o,e.endExclusive-i-o);l&&a&&l.start<l.endExclusive&&(r=a.clip(r),r=l.clip(r)),this._elements.buttons.style.top=`${r-e.start}px`}};N6=The([TI(3,rt)],N6);function pa(s){return I6.get(s)}const bg=class bg extends oe{static get(e){let t=bg._map.get(e);if(!t){t=new bg(e),bg._map.set(e,t);const i=e.onDidDispose(()=>{const n=bg._map.get(e);n&&(bg._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new f1(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=Vt(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Ni(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(92)),this._versionId=O8({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=O8({owner:this,equalsFn:R8(GT(tt.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.isFocused=Ni(this,t=>{const i=this.editor.onDidFocusEditorWidget(t),n=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=Kk(this,t=>(this.versionId.read(t),this.model.read(t)?.getValue()??""),(t,i)=>{const n=this.model.get();n!==null&&t!==n.getValue()&&n.setValue(t)}),this.valueIsEmpty=nt(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=Za({owner:this,equalsFn:R8(tt.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.onDidType=g1(this),this.scrollTop=Ni(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Ni(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Ni(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.contentWidth=Ni(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this._overlayWidgetCounter=0,this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(t=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(t=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}}))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e){return Ni(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e))}setDecorations(e){const t=new ge,i=this.editor.createDecorationsCollection();return t.add(Gk({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._overlayWidgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const n=Lt(o=>{e.position.read(o),e.minContentWidthInPx.read(o),this.editor.layoutOverlayWidget(i)});return ot(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}};bg._map=new Map;let I6=bg;function T6(s,e){return Q4e({createEmptyChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(s)){const n=t.change;n!==void 0&&i.deltas.push(n),i.didChange=!0}return!0}},(t,i)=>{const n=s.read(t);i.didChange&&e(n,i.deltas)})}function IVe(s,e){const t=new ge,i=T6(s,(n,o)=>{t.clear(),e(n,o,t)});return{dispose(){i.dispose(),t.dispose()}}}var TVe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},RVe=function(s,e){return function(t,i){e(t,i,s)}},RI,M_;let XR=(M_=class extends oe{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=Jo(this,l=>{const c=this._editors.modifiedModel.read(l),d=RI._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();On(d=>{for(const u of this._editors.original.getSelections()||[])c?.ensureOriginalLineIsVisible(u.getStartPosition().lineNumber,0,d),c?.ensureOriginalLineIsVisible(u.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();On(d=>{for(const u of this._editors.modified.getSelections()||[])c?.ensureModifiedLineIsVisible(u.getStartPosition().lineNumber,0,d),c?.ensureModifiedLineIsVisible(u.getEndPosition().lineNumber,0,d)})}));const o=this._diffModel.map((l,c)=>{const d=l?.unchangedRegions.read(c)??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===this._editors.modifiedModel.read(c)?.getLineCount()?[]:d});this.viewZones=zp(this,(l,c)=>{const d=this._modifiedOutlineSource.read(l);if(!d)return{origViewZones:[],modViewZones:[]};const u=[],f=[],p=this._options.renderSideBySide.read(l),m=this._options.compactMode.read(l),b=o.read(l);for(let C=0;C<b.length;C++){const y=b[C];if(!y.shouldHideControls(l)&&!(m&&(C===0||C===b.length-1)))if(m){{const S=nt(this,k=>y.getHiddenOriginalRange(k).startLineNumber-1),L=new ZC(S,12);u.push(L),c.add(new jie(this._editors.original,L,y,!p))}{const S=nt(this,k=>y.getHiddenModifiedRange(k).startLineNumber-1),L=new ZC(S,12);f.push(L),c.add(new jie(this._editors.modified,L,y))}}else{{const S=nt(this,k=>y.getHiddenOriginalRange(k).startLineNumber-1),L=new ZC(S,24);u.push(L),c.add(new Uie(this._editors.original,L,y,y.originalUnchangedRange,!p,d,k=>this._diffModel.get().ensureModifiedLineIsVisible(k,2,void 0),this._options))}{const S=nt(this,k=>y.getHiddenModifiedRange(k).startLineNumber-1),L=new ZC(S,24);f.push(L),c.add(new Uie(this._editors.modified,L,y,y.modifiedUnchangedRange,!1,d,k=>this._diffModel.get().ensureModifiedLineIsVisible(k,2,void 0),this._options))}}}return{origViewZones:u,modViewZones:f}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Bo(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(v("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+_t.asClassName(ke.fold),zIndex:10001};this._register($R(this._editors.original,nt(this,l=>{const c=o.read(l),d=c.map(u=>({range:u.originalUnchangedRange.toInclusiveRange(),options:r}));for(const u of c)u.shouldHideControls(l)&&d.push({range:A.fromPositions(new ne(u.originalLineNumber,1)),options:a});return d}))),this._register($R(this._editors.modified,nt(this,l=>{const c=o.read(l),d=c.map(u=>({range:u.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const u of c)u.shouldHideControls(l)&&d.push({range:Nt.ofLength(u.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(Lt(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(Lu)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(Lu))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{if(!l.event.rightButton&&l.target.position&&l.target.element?.className.includes("fold-unchanged")){const c=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const u=d.unchangedRegions.get().find(f=>f.modifiedUnchangedRange.includes(c));if(!u)return;u.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{if(!l.event.rightButton&&l.target.position&&l.target.element?.className.includes("fold-unchanged")){const c=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const u=d.unchangedRegions.get().find(f=>f.originalUnchangedRange.includes(c));if(!u)return;u.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}},RI=M_,M_._breadcrumbsSourceFactory=Vt(RI,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),M_);XR=RI=TVe([RVe(3,rt)],XR);class jie extends A${constructor(e,t,i,n=!1){const o=Kt("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=n,this._nodes=Kt("div.diff-hidden-lines-compact",[Kt("div.line-left",[]),Kt("div.text@text",[]),Kt("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(Lt(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,l=v("hiddenLines","{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class Uie extends A${constructor(e,t,i,n,o,r,a,l){const c=Kt("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Kt("div.diff-hidden-lines",[Kt("div.top@top",{title:v("diff.hiddenLines.top","Click or drag to show more above")}),Kt("div.center@content",{style:{display:"flex"}},[Kt("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[Ee("a",{title:v("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Kg("$(unfold)"))]),Kt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Kt("div.bottom@bottom",{title:v("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?ho(this._nodes.first):this._register(bf(this._nodes.first,{width:pa(this._editor).layoutInfoContentLeft})),this._register(Lt(u=>{const f=this._unchangedRegion.visibleLineCountTop.read(u)+this._unchangedRegion.visibleLineCountBottom.read(u)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const p=this._unchangedRegion.isDragged.read(u),m=this._editor.getDomNode();m&&(m.classList.toggle("draggingUnchangedRegion",!!p),p==="top"?(m.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),m.classList.toggle("canMoveBottom",!f)):p==="bottom"?(m.classList.toggle("canMoveTop",!f),m.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0)):(m.classList.toggle("canMoveTop",!1),m.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(ue(this._nodes.top,"mousedown",u=>{if(u.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const b=ft(this._nodes.top),C=ue(b,"mousemove",S=>{const k=S.clientY-f;p=p||Math.abs(k)>2;const N=Math.round(k/d.getOption(67)),I=Math.max(0,Math.min(m+N,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(I,void 0)}),y=ue(b,"mouseup",S=>{p||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),C.dispose(),y.dispose()})})),this._register(ue(this._nodes.bottom,"mousedown",u=>{if(u.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const b=ft(this._nodes.bottom),C=ue(b,"mousemove",S=>{const k=S.clientY-f;p=p||Math.abs(k)>2;const N=Math.round(k/d.getOption(67)),I=Math.max(0,Math.min(m-N,this._unchangedRegion.getMaxVisibleLineCountBottom())),T=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(I,void 0);const O=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(O-T))}),y=ue(b,"mouseup",S=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!p){const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const k=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(k-L))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),C.dispose(),y.dispose()})})),this._register(Lt(u=>{const f=[];if(!this._hide){const p=i.getHiddenModifiedRange(u).length,m=v("hiddenLines","{0} hidden lines",p),b=Ee("span",{title:v("diff.hiddenLines.expandAll","Double click to unfold")},m);b.addEventListener("dblclick",S=>{S.button===0&&(S.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(b);const C=this._unchangedRegion.getHiddenModifiedRange(u),y=this._modifiedOutlineSource.getBreadcrumbItems(C,u);if(y.length>0){f.push(Ee("span",void 0," | "));for(let S=0;S<y.length;S++){const L=y[S],k=dT.toIcon(L.kind),N=Kt("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[Rb(k)," ",L.name,...S===y.length-1?[]:[Rb(ke.chevronRight)]]).root;f.push(N),N.onclick=()=>{this._revealModifiedHiddenLine(L.startLineNumber)}}}}ho(this._nodes.others,...f)}))}}var MVe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},AVe=function(s,e){return function(t,i){e(t,i,s)}},Xc,Qh;let VL=(Qh=class extends oe{constructor(e,t,i,n,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=Xc.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=Ni(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=nt(f=>{const p=l.read(f),m=p.getColor(QAe)||(p.getColor(ZAe)||e8).transparent(2),b=p.getColor(JAe)||(p.getColor(XAe)||t8).transparent(2);return{insertColor:m,removeColor:b}}),d=xi(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const u=Kt("div.diffOverview",{style:{position:"absolute",top:"0px",width:Xc.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(YC(u,d.domNode)),this._register(zn(u,De.POINTER_DOWN,f=>{this._editors.modified.delegateVerticalScrollbarPointerDown(f)})),this._register(ue(u,De.MOUSE_WHEEL,f=>{this._editors.modified.delegateScrollFromMouseWheelEvent(f)},{passive:!1})),this._register(YC(this._rootElement,u)),this._register(jr((f,p)=>{const m=this._diffModel.read(f),b=this._editors.original.createOverviewRuler("original diffOverviewRuler");b&&(p.add(b),p.add(YC(u,b.getDomNode())));const C=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(C&&(p.add(C),p.add(YC(u,C.getDomNode()))),!b||!C)return;const y=Lo("viewZoneChanged",this._editors.original.onDidChangeViewZones),S=Lo("viewZoneChanged",this._editors.modified.onDidChangeViewZones),L=Lo("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),k=Lo("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);p.add(Lt(N=>{y.read(N),S.read(N),L.read(N),k.read(N);const I=c.read(N),T=m?.diff.read(N)?.mappings;function O(W,j,ee){const G=ee._getViewModel();return G?W.filter(te=>te.length>0).map(te=>{const Z=G.coordinatesConverter.convertModelPositionToViewPosition(new ne(te.startLineNumber,1)),X=G.coordinatesConverter.convertModelPositionToViewPosition(new ne(te.endLineNumberExclusive,1)),re=X.lineNumber-Z.lineNumber;return new bhe(Z.lineNumber,X.lineNumber,re,j.toString())}):[]}const M=O((T||[]).map(W=>W.lineRangeMapping.original),I.removeColor,this._editors.original),B=O((T||[]).map(W=>W.lineRangeMapping.modified),I.insertColor,this._editors.modified);b?.setZones(M),C?.setZones(B)})),p.add(Lt(N=>{const I=this._rootHeight.read(N),T=this._rootWidth.read(N),O=this._modifiedEditorLayoutInfo.read(N);if(O){const M=Xc.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Xc.ONE_OVERVIEW_WIDTH;b.setLayout({top:0,height:I,right:M+Xc.ONE_OVERVIEW_WIDTH,width:Xc.ONE_OVERVIEW_WIDTH}),C.setLayout({top:0,height:I,right:0,width:Xc.ONE_OVERVIEW_WIDTH});const B=this._editors.modifiedScrollTop.read(N),W=this._editors.modifiedScrollHeight.read(N),j=this._editors.modified.getOption(104),ee=new vy(j.verticalHasArrows?j.arrowSize:0,j.verticalScrollbarSize,0,O.height,W,B);d.setTop(ee.getSliderPosition()),d.setHeight(ee.getSliderSize())}else d.setTop(0),d.setHeight(0);u.style.height=I+"px",u.style.left=T-Xc.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(Xc.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},Xc=Qh,Qh.ONE_OVERVIEW_WIDTH=15,Qh.ENTIRE_DIFF_OVERVIEW_WIDTH=Qh.ONE_OVERVIEW_WIDTH*2,Qh);VL=Xc=MVe([AVe(6,As)],VL);const Z3=[];class OVe extends oe{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=nt(this,o=>{const a=this._diffModel.read(o)?.diff.read(o);if(!a)return Z3;const l=this._editors.modifiedSelections.read(o);if(l.every(f=>f.isEmpty()))return Z3;const c=new Wl(l.map(f=>Nt.fromRangeInclusive(f))),u=a.mappings.filter(f=>f.lineRangeMapping.innerChanges&&c.intersects(f.lineRangeMapping.modified)).map(f=>({mapping:f,rangeMappings:f.lineRangeMapping.innerChanges.filter(p=>l.some(m=>A.areIntersecting(p.modifiedRange,m)))}));return u.length===0||u.every(f=>f.rangeMappings.length===0)?Z3:u}),this._register(jr((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a?.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const c=[],d=this._selectedDiffs.read(o),u=new Set(d.map(f=>f.mapping));if(d.length>0){const f=this._editors.modifiedSelections.read(o),p=r.add(new QR(f[f.length-1].positionLineNumber,this._widget,d.flatMap(m=>m.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(p),c.push(p)}for(const f of l.mappings)if(!u.has(f)&&!f.lineRangeMapping.modified.isEmpty&&f.lineRangeMapping.innerChanges){const p=r.add(new QR(f.lineRangeMapping.modified.startLineNumber,this._widget,f.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(p),c.push(p)}r.add(ot(()=>{for(const f of c)this._editors.modified.removeGlyphMarginWidget(f)}))}))}}const KA=class KA extends oe{getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id=`revertButton${KA.counter++}`,this._domNode=Kt("div.revertButton",{title:this._revertSelection?v("revertSelectedChanges","Revert Selected Changes"):v("revertChange","Revert Change")},[Rb(ke.arrowRight)]).root,this._register(ue(this._domNode,De.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(ue(this._domNode,De.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(ue(this._domNode,De.CLICK,o=>{this._diffs instanceof tr?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Fc.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};KA.counter=0;let QR=KA;function PVe(s,e,t){return eFe({debugName:()=>`Configuration Key "${s}"`},i=>t.onDidChangeConfiguration(n=>{n.affectsConfiguration(s)&&i(n)}),()=>t.getValue(s)??e)}function ed(s,e,t){const i=s.bindTo(e);return Gk({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}var FVe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$ie=function(s,e){return function(t,i){e(t,i,s)}};let R6=class extends oe{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new se),this.modifiedScrollTop=Ni(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Ni(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=pa(this.modified),this.originalObs=pa(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Ni(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Za({owner:this,equalsFn:ne.equals},l=>this.modifiedSelections.read(l)[0]?.getPosition()??new ne(1,1)),this.originalCursor=Ni(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new ne(1,1)),this._argCodeEditorWidgetOptions=null,this._register(Yk({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return n.setContextValue("isInDiffLeftEditor",!0),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return n.setContextValue("isInDiffRightEditor",!0),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+VL.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=Od.revealHorizontalRightPadding.defaultValue+VL.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=v("diff-aria-navigation-tip"," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};R6=FVe([$ie(5,rt),$ie(6,Li)],R6);const GA=class GA extends oe{constructor(){super(...arguments),this._id=++GA.idCounter,this._onDidDispose=this._register(new se),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};GA.idCounter=0;let M6=GA;var BVe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},WVe=function(s,e){return function(t,i){e(t,i,s)}};let A6=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Vt(this,0),this._screenReaderMode=Ni(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=nt(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=nt(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=nt(this,n=>this.compactMode.read(n)&&this.shouldRenderInlineViewInSmartMode.read(n)?!1:this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n)&&!this._screenReaderMode.read(n))),this.readOnly=nt(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=nt(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=nt(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=nt(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=nt(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=nt(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=nt(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=nt(this,n=>this._options.read(n).maxComputationTime),this.showMoves=nt(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=nt(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=nt(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=nt(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=nt(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=nt(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=nt(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=nt(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=nt(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=nt(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=nt(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=nt(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=nt(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=nt(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=nt(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=nt(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=Vt(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>sFe(this,o=>{const r=n?.diff.read(o);return r?HVe(r,this.trueInlineDiffRenderingEnabled.read(o)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...qie(e,vo)};this._options=Vt(this,i)}updateOptions(e){const t=qie(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};A6=BVe([WVe(1,Na)],A6);function HVe(s,e){return s.mappings.every(t=>VVe(t.lineRangeMapping)||zVe(t.lineRangeMapping)||e&&j$(t.lineRangeMapping))}function VVe(s){return s.original.length===0}function zVe(s){return s.modified.length===0}function qie(s,e){return{enableSplitViewResizing:st(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:UDe(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:st(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:st(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:xm(s.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:xm(s.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:st(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:st(s.renderIndicators,e.renderIndicators),originalEditable:st(s.originalEditable,e.originalEditable),diffCodeLens:st(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:st(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:$n(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:$n(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:st(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:st(s.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:st(s.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:st(s.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:st(s.hideUnchangedRegions?.enabled??s.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:xm(s.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:xm(s.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:xm(s.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:st(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:st(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:xm(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:st(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:st(s.renderGutterMenu,e.renderGutterMenu),compactMode:st(s.compactMode,e.compactMode)}}var jVe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},K0=function(s,e){return function(t,i){e(t,i,s)}};let vf=class extends M6{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,o,r,a,l){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=Kt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Kt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Kt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Kt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(pL(this,void 0)),this._diffModel=nt(this,k=>this._diffModelSrc.read(k)?.object),this.onDidChangeModel=Te.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new v1([vt,this._contextKeyService]))),this._boundarySashes=Vt(this,void 0),this._accessibleDiffViewerShouldBeVisible=Vt(this,!1),this._accessibleDiffViewerVisible=nt(this,k=>this._options.onlyShowAccessibleDiffViewer.read(k)?!0:this._accessibleDiffViewerShouldBeVisible.read(k)),this._movedBlocksLinesPart=Vt(this,void 0),this._layoutInfo=nt(this,k=>{const N=this._rootSizeObserver.width.read(k),I=this._rootSizeObserver.height.read(k);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=I+"px";const T=this._sash.read(k),O=this._gutter.read(k),M=O?.width.read(k)??0,B=this._overviewRulerPart.read(k)?.width??0;let W,j,ee,G,te;if(!!T){const X=T.sashLeft.read(k),re=this._movedBlocksLinesPart.read(k)?.width.read(k)??0;W=0,j=X-M-re,te=X-M,ee=X,G=N-ee-B}else{te=0;const X=this._options.inlineViewHideOriginalLineNumbers.read(k);W=M,X?j=0:j=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(k)),ee=M+j,G=N-ee-B}return this.elements.original.style.left=W+"px",this.elements.original.style.width=j+"px",this._editors.original.layout({width:j,height:I},!0),O?.layout(te),this.elements.modified.style.left=ee+"px",this.elements.modified.style.width=G+"px",this._editors.modified.layout({width:G,height:I},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((k,N)=>k?.diff.read(N)),this.onDidUpdateDiff=Te.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(ot(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new She(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(A6,t),this._register(Lt(k=>{this._options.setWidth(this._rootSizeObserver.width.read(k))})),this._contextKeyService.createKey(V.isEmbeddedDiffEditor.key,!1),this._register(ed(V.isEmbeddedDiffEditor,this._contextKeyService,k=>this._options.isInEmbeddedEditor.read(k))),this._register(ed(V.comparingMovedCode,this._contextKeyService,k=>!!this._diffModel.read(k)?.movedTextToCompare.read(k))),this._register(ed(V.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,k=>this._options.couldShowInlineViewBecauseOfSize.read(k))),this._register(ed(V.diffEditorInlineMode,this._contextKeyService,k=>!this._options.renderSideBySide.read(k))),this._register(ed(V.hasChanges,this._contextKeyService,k=>(this._diffModel.read(k)?.diff.read(k)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(R6,this.elements.original,this.elements.modified,this._options,i,(k,N,I,T)=>this._createInnerEditor(k,N,I,T))),this._register(ed(V.diffEditorOriginalWritable,this._contextKeyService,k=>this._options.originalEditable.read(k))),this._register(ed(V.diffEditorModifiedWritable,this._contextKeyService,k=>!this._options.readOnly.read(k))),this._register(ed(V.diffEditorOriginalUri,this._contextKeyService,k=>this._diffModel.read(k)?.model.original.uri.toString()??"")),this._register(ed(V.diffEditorModifiedUri,this._contextKeyService,k=>this._diffModel.read(k)?.model.modified.uri.toString()??"")),this._overviewRulerPart=Jo(this,k=>this._options.renderOverviewRuler.read(k)?this._instantiationService.createInstance(da(VL,k),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(N=>N.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((k,N)=>k-(this._overviewRulerPart.read(N)?.width??0))};this._sashLayout=new kVe(this._options,c),this._sash=Jo(this,k=>{const N=this._options.renderSideBySide.read(k);return this.elements.root.classList.toggle("side-by-side",N),N?new Ehe(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=Jo(this,k=>this._instantiationService.createInstance(da(XR,k),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Jo(this,k=>this._instantiationService.createInstance(da(LVe,k),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const u=new Set,f=new Set;let p=!1;const m=Jo(this,k=>this._instantiationService.createInstance(da(D6,k),ft(this._domElement),this._editors,this._diffModel,this._options,this,()=>p||d.get().isUpdatingHiddenAreas,u,f)).recomputeInitiallyAndOnChange(this._store),b=nt(this,k=>{const N=m.read(k).viewZones.read(k).orig,I=d.read(k).viewZones.read(k).origViewZones;return N.concat(I)}),C=nt(this,k=>{const N=m.read(k).viewZones.read(k).mod,I=d.read(k).viewZones.read(k).modViewZones;return N.concat(I)});this._register(qR(this._editors.original,b,k=>{p=k},u));let y;this._register(qR(this._editors.modified,C,k=>{p=k,p?y=Rd.capture(this._editors.modified):(y?.restore(this._editors.modified),y=void 0)},f)),this._accessibleDiffViewer=Jo(this,k=>this._instantiationService.createInstance(da(a_,k),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(N,I)=>this._accessibleDiffViewerShouldBeVisible.set(N,I),this._options.onlyShowAccessibleDiffViewer.map(N=>!N),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((N,I)=>N?.diff.read(I)?.mappings.map(T=>T.lineRangeMapping)),new fVe(this._editors))).recomputeInitiallyAndOnChange(this._store);const S=this._accessibleDiffViewerVisible.map(k=>k?"hidden":"visible");this._register(bf(this.elements.modified,{visibility:S})),this._register(bf(this.elements.original,{visibility:S})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=Jo(this,k=>this._options.shouldRenderGutterMenu.read(k)?this._instantiationService.createInstance(da(E6,k),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(p1(this._layoutInfo)),Jo(this,k=>new(da(Uw,k))(this.elements.root,this._diffModel,this._layoutInfo.map(N=>N.originalEditor),this._layoutInfo.map(N=>N.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,k=>{this._movedBlocksLinesPart.set(k,void 0)}),this._register(Te.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,k=>this._handleCursorPositionChange(k,!0))),this._register(Te.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,k=>this._handleCursorPositionChange(k,!1)));const L=this._diffModel.map(this,(k,N)=>{if(k)return k.diff.read(N)===void 0&&!k.isDiffUpToDate.read(N)});this._register(jr((k,N)=>{if(L.read(k)===!0){const I=this._editorProgressService.show(!0,1e3);N.add(ot(()=>I.done()))}})),this._register(jr((k,N)=>{N.add(new(da(OVe,k))(this._editors,this._diffModel,this._options,this))})),this._register(jr((k,N)=>{const I=this._diffModel.read(k);if(I)for(const T of[I.model.original,I.model.modified])N.add(T.onWillDispose(O=>{kt(new wi("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(Lt(k=>{this._options.setModel(this._diffModel.read(k))}))}_createInnerEditor(e,t,i,n){return e.createInstance(FL,t,i,n)}_createDiffEditorContributions(){const e=p_.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){kt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return iD.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(k6,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?KR.create(e).createNewRef(this):KR.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&Ob(t,n=>{const o=e?.object;Ni.batchEventsGlobally(n,()=>{this._editors.original.setModel(o?o.model.original:null),this._editors.modified.setModel(o?o.model.modified:null)});const r=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),n),setTimeout(()=>{r?.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?UVe(e):null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(n=>({range:n.modifiedRange,text:t.model.original.getValueInRange(n.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new ne(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let n;e==="next"?n=t.find(o=>o.lineRangeMapping.modified.startLineNumber>i)??t[0]:n=Qx(t,o=>o.lineRangeMapping.modified.startLineNumber<i)??t[t.length-1],this._goTo(n),n.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Ka.diffLineDeleted,{source:"diffEditor.goToDiff"}):n.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Ka.diffLineInserted,{source:"diffEditor.goToDiff"}):n&&this._accessibilitySignalService.playSignal(Ka.diffLineModified,{source:"diffEditor.goToDiff"})}revealFirstDiff(){const e=this._diffModel.get();e&&this.waitForDiff().then(()=>{const t=e.diff.get()?.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let n;const o=t.getSelection();if(o){const r=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(r){const a=Iie(o.getStartPosition(),r),l=Iie(o.getEndPosition(),r);n=A.plusRange(a,l)}}return{destination:i,destinationSelection:n}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&On(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&On(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===3){const i=this._diffModel.get()?.diff.get()?.mappings.find(n=>t?n.lineRangeMapping.modified.contains(e.position.lineNumber):n.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Ka.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Ka.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(Ka.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};vf=jVe([K0(3,vt),K0(4,rt),K0(5,mi),K0(6,Up),K0(7,Vp)],vf);function UVe(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,a=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a?.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var $$=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ln=function(s,e){return function(t,i){e(t,i,s)}};let $Ve=0,Kie=!1;function qVe(s){if(!s){if(Kie)return;Kie=!0}YPe(s||Ui.document.body)}let JR=class extends FL{constructor(e,t,i,n,o,r,a,l,c,d,u,f,p){const m={...t};m.ariaLabel=m.ariaLabel||E8.editorViewAccessibleLabel,super(e,m,{},i,n,o,r,c,d,u,f,p),l instanceof Ny?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,qVe(m.ariaContainerElement),cFe((b,C)=>i.createInstance(_y,b,C,{})),dFe(a)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++$Ve,o=pe.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),oe.None;const t=e.id,i=e.label,n=pe.and(pe.equals("editorId",this.getId()),pe.deserialize(e.precondition)),o=e.keybindings,r=pe.and(n,pe.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(p,...m)=>Promise.resolve(e.run(this,...m)),d=new ge,u=this.getId()+":"+t;if(d.add(ai.registerCommand(u,c)),a){const p={command:{id:u,title:i},when:n,group:a,order:l};d.add(Qs.appendMenuItem(Je.EditorContext,p))}if(Array.isArray(o))for(const p of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,p,c,r));const f=new vhe(u,i,i,void 0,n,(...p)=>Promise.resolve(e.run(this,...p)),this._contextKeyService);return this._actions.set(t,f),d.add(ot(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof RT)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};JR=$$([ln(2,rt),ln(3,mi),ln(4,rn),ln(5,vt),ln(6,$u),ln(7,Li),ln(8,As),ln(9,us),ln(10,Na),ln(11,Bn),ln(12,Ye)],JR);let O6=class extends JR{constructor(e,t,i,n,o,r,a,l,c,d,u,f,p,m,b,C){const y={...t};ER(u,y,!1);const S=c.registerEditorContainer(e);typeof y.theme=="string"&&c.setTheme(y.theme),typeof y.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!y.autoDetectHighContrast);const L=y.model;delete y.model,super(e,y,i,n,o,r,a,l,c,d,f,b,C),this._configurationService=u,this._standaloneThemeService=c,this._register(S);let k;if(typeof L>"u"){const N=m.getLanguageIdByMimeType(y.language)||y.language||yr;k=Rhe(p,m,y.value||"",N,void 0),this._ownsModel=!0}else k=L,this._ownsModel=!1;if(this._attachModel(k),k){const N={oldModelUrl:null,newModelUrl:k.uri};this._onDidChangeModel.fire(N)}}dispose(){super.dispose()}updateOptions(e){ER(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};O6=$$([ln(2,rt),ln(3,mi),ln(4,rn),ln(5,vt),ln(6,$u),ln(7,Li),ln(8,bl),ln(9,us),ln(10,zt),ln(11,Na),ln(12,fn),ln(13,In),ln(14,Bn),ln(15,Ye)],O6);let P6=class extends vf{constructor(e,t,i,n,o,r,a,l,c,d,u,f){const p={...t};ER(l,p,!0);const m=r.registerEditorContainer(e);typeof p.theme=="string"&&r.setTheme(p.theme),typeof p.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!p.autoDetectHighContrast),super(e,p,{},n,i,o,f,d),this._configurationService=l,this._standaloneThemeService=r,this._register(m)}dispose(){super.dispose()}updateOptions(e){ER(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(JR,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};P6=$$([ln(2,rt),ln(3,vt),ln(4,mi),ln(5,bl),ln(6,us),ln(7,zt),ln(8,Ea),ln(9,Vp),ln(10,Tf),ln(11,Up)],P6);function Rhe(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(`
|
|
719
719
|
`);let r=t;return o!==-1&&(r=t.substring(0,o)),Gie(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return Gie(s,t,e.createById(i),n)}function Gie(s,e,t,i){return s.createModel(e,t,i)}var KVe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Yie=function(s,e){return function(t,i){e(t,i,s)}};class GVe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let eM=class extends oe{constructor(e,t,i,n,o){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Vt(this,void 0),this._collapsed=nt(this,l=>this._viewModel.read(l)?.collapsed.read(l)),this._editorContentHeight=Vt(this,500),this.contentHeight=nt(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Vt(this,0),this._modifiedWidth=Vt(this,0),this._originalContentWidth=Vt(this,0),this._originalWidth=Vt(this,0),this.maxScroll=nt(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=Kt("div.multiDiffEntry",[Kt("div.header@header",[Kt("div.header-content",[Kt("div.collapse-button@collapseButton"),Kt("div.file-path",[Kt("div.title.modified.show-file-icons@primaryPath",[]),Kt("div.status.deleted@status",["R"]),Kt("div.title.original.show-file-icons@secondaryPath",[])]),Kt("div.actions@actions")])]),Kt("div.editorParent",[Kt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(vf,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=pa(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=pa(this.editor.getOriginalEditor()).isFocused,this.isFocused=nt(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new ge),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new uR(this._elements.collapseButton,{});this._register(Lt(l=>{r.element.className="",r.icon=this._collapsed.read(l)?ke.chevronRight:ke.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Lt(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{rS(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(Lt(l=>{const c=this._viewModel.read(l)?.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(o.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new v1([vt,this._contextKeyService])));this._register(a.createInstance(ZR,this._elements.actions,Je.MultiDiffEditorFileToolbar,{actionRunner:this._register(new Nhe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>Lde(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(n){return{...n,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){rS(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(rS(n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let o=!1,r=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",r=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,this._resourceLabel2?.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,n=>{n||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[n,o]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(n,o)}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,rS(a=>{this.editor.layout({width:t-16-2,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};eM=KVe([Yie(3,rt),Yie(4,vt)],eM);class YVe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(n=>this._itemData.get(n).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var ZVe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Zie=function(s,e){return function(t,i){e(t,i,s)}};let F6=class extends oe{constructor(e,t,i,n,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=Kt("div.scrollContent",[Kt("div@content",{style:{overflow:"hidden"}}),Kt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new u1({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>La(ft(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new AO(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=Kt("div.monaco-component.multiDiffEditor",{},[Kt("div",{},[this._scrollableElement.getDomNode()]),Kt("div.placeholder@placeholder",{},[Kt("div",[v("noChangedFiles","No Changed Files")])])]),this._sizeObserver=this._register(new She(this._element,void 0)),this._objectPool=this._register(new YVe(l=>{const c=this._instantiationService.createInstance(eM,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this.scrollTop=Ni(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Ni(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=zp(this,(l,c)=>{const d=this._viewModel.read(l);if(!d)return{items:[],getItem:m=>{throw new wi}};const u=d.items.read(l),f=new Map;return{items:u.map(m=>{const b=c.add(new XVe(m,this._objectPool,this.scrollLeft,y=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+y})})),C=this._lastDocStates?.[b.getKey()];return C&&On(y=>{b.setViewState(C,y)}),f.set(m,b),b}),getItem:m=>f.get(m)}}),this._viewItems=this._viewItemsInfo.map(this,l=>l.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((d,u)=>d+u.contentHeight.read(c)+this._spaceBetweenPx,0)),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new v1([vt,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(V.inMultiDiffEditor.key,!0),this._register(jr((l,c)=>{const d=this._viewModel.read(l);if(d&&d.contextKeys)for(const[u,f]of Object.entries(d.contextKeys)){const p=this._contextKeyService.createKey(u,void 0);p.set(f),c.add(ot(()=>p.reset()))}}));const a=this._parentContextKeyService.createKey(V.multiDiffEditorAllCollapsed.key,!1);this._register(Lt(l=>{const c=this._viewModel.read(l);if(c){const d=c.items.read(l).every(u=>u.collapsed.read(l));a.set(d)}})),this._register(Lt(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._register(Lt(l=>{const c=this._viewItems.read(l);this._elements.placeholder.classList.toggle("visible",c.length===0)})),this._scrollableElements.content.style.position="relative",this._register(Lt(l=>{const c=this._sizeObserver.height.read(l);this._scrollableElements.root.style.height=`${c}px`;const d=this._totalHeight.read(l);this._scrollableElements.content.style.height=`${d}px`;const u=this._sizeObserver.width.read(l);let f=u;const p=this._viewItems.read(l),m=$j(p,Cr(b=>b.maxScroll.read(l).maxScroll,Tc));if(m){const b=m.maxScroll.read(l);f=u+b.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:c,scrollHeight:d,scrollWidth:f})})),e.replaceChildren(this._elements.root),this._register(ot(()=>{e.replaceChildren()})),this._register(this._register(Lt(l=>{rS(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let i=0,n=0,o=0;const r=this._sizeObserver.height.read(e),a=Ut.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),u=Math.min(d,r),f=Ut.ofStartAndLength(n,u),p=Ut.ofStartAndLength(o,d);if(p.isBefore(a))i-=d-u,c.hide();else if(p.isAfter(a))c.hide();else{const m=Math.max(0,Math.min(a.start-p.start,d-u));i-=m;const b=Ut.ofStartAndLength(t+i,r);c.render(f,m,l,b)}n+=u+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};F6=ZVe([Zie(4,vt),Zie(5,rt)],F6);class XVe extends oe{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(pL(this,void 0)),this.contentHeight=nt(this,o=>this._templateRef.read(o)?.object.contentHeight?.read(o)??this.viewModel.lastTemplateData.read(o).contentHeight),this.maxScroll=nt(this,o=>this._templateRef.read(o)?.object.maxScroll.read(o)??{maxScroll:0,scrollWidth:0}),this.template=nt(this,o=>this._templateRef.read(o)?.object),this._isHidden=Vt(this,!1),this._isFocused=nt(this,o=>this.template.read(o)?.isFocused.read(o)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(Lt(o=>{const r=this._scrollLeft.read(o);this._templateRef.read(o)?.object.setScrollLeft(r)})),this._register(Lt(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),n=e.selections?.map(tt.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const o=this._templateRef.get();o&&n&&o.object.editor.setSelections(n)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&On(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new GVe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,n)}}z("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},v("multiDiffEditor.headerBackground","The background color of the diff editor's header"));z("multiDiffEditor.background",Wc,v("multiDiffEditor.background","The background color of the multi file diff editor"));z("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},v("multiDiffEditor.border","The border color of the multi file diff editor"));var QVe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},JVe=function(s,e){return function(t,i){e(t,i,s)}};let B6=class extends oe{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Vt(this,void 0),this._viewModel=Vt(this,void 0),this._widgetImpl=zp(this,(n,o)=>(da(eM,n),o.add(this._instantiationService.createInstance(da(F6,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(p1(this._widgetImpl))}};B6=QVe([JVe(2,rt)],B6);function eze(s,e,t){return wt.initialize(t||{}).createInstance(O6,s,e)}function tze(s){return wt.get(mi).onCodeEditorAdd(t=>{s(t)})}function ize(s){return wt.get(mi).onDiffEditorAdd(t=>{s(t)})}function nze(){return wt.get(mi).listCodeEditors()}function sze(){return wt.get(mi).listDiffEditors()}function oze(s,e,t){return wt.initialize(t||{}).createInstance(P6,s,e)}function rze(s,e){const t=wt.initialize(e||{});return new B6(s,{},t)}function aze(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return ai.registerCommand(s.id,s.run)}function lze(s){if(typeof s.id!="string"||typeof s.label!="string"||typeof s.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=pe.deserialize(s.precondition),t=(n,...o)=>Ms.runEditorCommand(n,o,e,(r,a,l)=>Promise.resolve(s.run(a,...l))),i=new ge;if(i.add(ai.registerCommand(s.id,t)),s.contextMenuGroupId){const n={command:{id:s.id,title:s.label},when:e,group:s.contextMenuGroupId,order:s.contextMenuOrder||0};i.add(Qs.appendMenuItem(Je.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=wt.get(Li);if(!(n instanceof Ny))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=pe.and(e,pe.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(r=>({keybinding:r,command:s.id,when:o}))))}}return i}function cze(s){return Mhe([s])}function Mhe(s){const e=wt.get(Li);return e instanceof Ny?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:pe.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),oe.None)}function dze(s,e,t){const i=wt.get(In),n=i.getLanguageIdByMimeType(e)||e;return Rhe(wt.get(fn),i,s,n,t)}function uze(s,e){const t=wt.get(In),i=t.getLanguageIdByMimeType(e)||e||yr;s.setLanguage(t.createById(i))}function hze(s,e,t){s&&wt.get(qu).changeOne(e,s.uri,t)}function fze(s){wt.get(qu).changeAll(s,[])}function gze(s){return wt.get(qu).read(s)}function pze(s){return wt.get(qu).onMarkerChanged(s)}function mze(s){return wt.get(fn).getModel(s)}function _ze(){return wt.get(fn).getModels()}function bze(s){return wt.get(fn).onModelAdded(s)}function vze(s){return wt.get(fn).onModelRemoved(s)}function Cze(s){return wt.get(fn).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function wze(s){return s8e(wt.get(fn),s)}function yze(s,e){const t=wt.get(In),i=wt.get(bl);return h$.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function Sze(s,e,t){const i=wt.get(In);return wt.get(bl).registerEditorContainer(Ui.document.body),h$.colorize(i,s,e,t)}function xze(s,e,t=4){return wt.get(bl).registerEditorContainer(Ui.document.body),h$.colorizeModelLine(s,e,t)}function Lze(s){const e=qn.get(s);return e||{getInitialState:()=>wy,tokenize:(t,i,n)=>wU(s,n)}}function kze(s,e){qn.getOrCreate(e);const t=Lze(e),i=Vu(s),n=[];let o=t.getInitialState();for(let r=0,a=i.length;r<a;r++){const l=i[r],c=t.tokenize(l,!0,o);n[r]=c.tokens,o=c.endState}return n}function Dze(s,e){wt.get(bl).defineTheme(s,e)}function Eze(s){wt.get(bl).setTheme(s)}function Nze(){L7.clearAllFontInfos()}function Ize(s,e){return ai.registerCommand({id:s,handler:e})}function Tze(s){return wt.get(Xr).registerOpener({async open(t){return typeof t=="string"&&(t=at.parse(t)),s.open(t)}})}function Rze(s){return wt.get(mi).registerCodeEditorOpenHandler(async(t,i,n)=>{if(!i)return null;const o=t.options?.selection;let r;return o&&typeof o.endLineNumber=="number"&&typeof o.endColumn=="number"?r=o:o&&(r={lineNumber:o.startLineNumber,column:o.startColumn}),await s.openCodeEditor(i,t.resource,r)?i:null})}function Mze(){return{create:eze,getEditors:nze,getDiffEditors:sze,onDidCreateEditor:tze,onDidCreateDiffEditor:ize,createDiffEditor:oze,addCommand:aze,addEditorAction:lze,addKeybindingRule:cze,addKeybindingRules:Mhe,createModel:dze,setModelLanguage:uze,setModelMarkers:hze,getModelMarkers:gze,removeAllMarkers:fze,onDidChangeMarkers:pze,getModels:_ze,getModel:mze,onDidCreateModel:bze,onWillDisposeModel:vze,onDidChangeModelLanguage:Cze,createWebWorker:wze,colorizeElement:yze,colorize:Sze,colorizeModelLine:xze,tokenize:kze,defineTheme:Dze,setTheme:Eze,remeasureFonts:Nze,registerCommand:Ize,registerLinkOpener:Tze,registerEditorOpener:Rze,AccessibilitySupport:C9,ContentWidgetPositionPreference:k9,CursorChangeReason:D9,DefaultEndOfLine:E9,EditorAutoIndentStrategy:I9,EditorOption:T9,EndOfLinePreference:R9,EndOfLineSequence:M9,MinimapPosition:U9,MinimapSectionHeaderStyle:$9,MouseTargetType:q9,OverlayWidgetPositionPreference:Y9,OverviewRulerLane:Z9,GlyphMarginLane:A9,RenderLineNumbersType:J9,RenderMinimap:e7,ScrollbarVisibility:i7,ScrollType:t7,TextEditorCursorBlinkingStyle:l7,TextEditorCursorStyle:c7,TrackedRangeStickiness:d7,WrappingIndent:u7,InjectedTextCursorStops:F9,PositionAffinity:Q9,ShowLightbulbIconMode:s7,ConfigurationChangedEvent:yae,BareFontInfo:f_,FontInfo:x7,TextModelResolvedOptions:uI,FindMatch:Xx,ApplyUpdateResult:ES,EditorZoom:Fl,createMultiFileDiffEditor:rze,EditorType:iD,EditorOptions:Od}}function Aze(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function DN(s,e){return typeof s=="boolean"?s:e}function Xie(s,e){return typeof s=="string"?s:e}function Oze(s){const e={};for(const t of s)e[t]=!0;return e}function Qie(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=Oze(s);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function W6(s,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,a){n=!0;let l="";if(typeof s[a]=="string")l=s[a];else if(s[a]&&s[a]instanceof RegExp)l=s[a].source;else throw s[a]===void 0?vn(s,"language definition does not contain attribute '"+a+"', used at: "+e):vn(s,"attribute reference '"+a+"' must be a string, used at: "+e);return Um(l)?"":"(?:"+l+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const o=(s.ignoreCase?"i":"")+(s.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(S8e(s,e,c),o)),l)}return new RegExp(e,o)}function Pze(s,e,t,i){if(i<0)return s;if(i<e.length)return e[i];if(i>=100){i=i-100;const n=t.split(".");if(n.unshift(t),i<n.length)return n[i]}return null}function Fze(s,e,t,i){let n=-1,o=t,r=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(n=parseInt(r[3]),r[2]&&(n=n+100)),o=r[4]);let a="~",l=o;!o||o.length===0?(a="!=",l=""):/^\w*$/.test(l)?a="==":(r=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(a=r[1],l=r[2]));let c;if((a==="~"||a==="!~")&&/^(\w|\|)*$/.test(l)){const d=Qie(l.split("|"),s.ignoreCase);c=function(u){return a==="~"?d(u):!d(u)}}else if(a==="@"||a==="!@"){const d=s[l];if(!d)throw vn(s,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!Aze(function(f){return typeof f=="string"},d))throw vn(s,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);const u=Qie(d,s.ignoreCase);c=function(f){return a==="@"?u(f):!u(f)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){const d=W6(s,"^"+l+"$",!1);c=function(u){return a==="~"?d.test(u):!d.test(u)}}else c=function(d,u,f,p){return W6(s,"^"+xg(s,l,u,f,p)+"$",!1).test(d)};else if(l.indexOf("$")<0){const d=rf(s,l);c=function(u){return a==="=="?u===d:u!==d}}else{const d=rf(s,l);c=function(u,f,p,m,b){const C=xg(s,d,f,p,m);return a==="=="?u===C:u!==C}}return n===-1?{name:t,value:i,test:function(d,u,f,p){return c(d,d,u,f,p)}}:{name:t,value:i,test:function(d,u,f,p){const m=Pze(d,u,f,n);return c(m||"",d,u,f,p)}}}function H6(s,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw vn(s,"a 'token' attribute must be of type string, in rule: "+e);{const i={token:t.token};if(t.token.indexOf("$")>=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw vn(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw vn(s,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!x8e(s,xg(s,n,"",[],""))))throw vn(s,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,s.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,o=t.length;n<o;n++)i[n]=H6(s,e,t[n]);return{group:i}}else if(t.cases){const i=[];for(const o in t.cases)if(t.cases.hasOwnProperty(o)){const r=H6(s,e,t.cases[o]);o==="@default"||o==="@"||o===""?i.push({test:void 0,value:r,name:o}):o==="@eos"?i.push({test:function(a,l,c,d){return d},value:r,name:o}):i.push(Fze(s,e,o,r))}const n=s.defaultToken;return{test:function(o,r,a,l){for(const c of i)if(!c.test||c.test(o,r,a,l))return c.value;return n}}}else throw vn(s,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+e)}else return{token:""}}class Bze{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if(typeof t=="string")i=t;else if(t instanceof RegExp)i=t.source;else throw vn(e,"rules must start with a match string or regular expression: "+this.name);this.matchOnlyAtLineStart=i.length>0&&i[0]==="^",this.name=this.name+": "+i,this.regex=W6(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=H6(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function Ahe(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:s,includeLF:DN(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:DN(e.ignoreCase,!1),unicode:DN(e.unicode,!1),tokenPostfix:Xie(e.tokenPostfix,"."+s),defaultToken:Xie(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=s,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function n(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw vn(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw vn(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const u=new Bze(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const f=c[1];f.next=c[2],u.setAction(i,f)}else throw vn(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else u.setAction(i,c[1]);else{if(!c.regex)throw vn(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=DN(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw vn(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw vn(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw vn(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+`
|
|
720
|
-
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:rf(t,a.open),close:rf(t,a.close)});else throw vn(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function Wze(s){hy.registerLanguage(s)}function Hze(){let s=[];return s=s.concat(hy.getLanguages()),s}function Vze(s){return wt.get(In).languageIdCodec.encodeLanguageId(s)}function zze(s,e){return wt.withServices(()=>{const i=wt.get(In).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function jze(s,e){return wt.withServices(()=>{const i=wt.get(In).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function Uze(s,e){if(!wt.get(In).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return wt.get(Bn).register(s,e,100)}class $ze{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return zL.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new iO(n.tokens,n.endState)}}class zL{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,r=e.length;o<r;o++){const a=e[o];let l=a.startIndex;o===0?l=0:l<n&&(l=n),i[o]=new zx(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),r=zL._toClassicTokens(o.tokens,e);let a;return o.endState.equals(n)?a=n:a=o.endState,new Cj(r,a)}tokenize(e,t,i){return zL.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const u=t[c],f=n.match(i,u.scopes)|1024;if(r>0&&o[r-1]===f)continue;let p=u.startIndex;c===0?p=0:p<a&&(p=a),o[r++]=p,o[r++]=f,a=p}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=o[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new iO(o,r)}}function qze(s){return typeof s.getInitialState=="function"}function Kze(s){return"tokenizeEncoded"in s}function Ohe(s){return s&&typeof s.then=="function"}function Gze(s){const e=wt.get(bl);if(s){const t=[null];for(let i=1,n=s.length;i<n;i++)t[i]=me.fromHex(s[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function Phe(s,e){return Kze(e)?new $ze(s,e):new zL(s,e,wt.get(In),wt.get(bl))}function q$(s,e){const t=new SNe(async()=>{const i=await Promise.resolve(e.create());return i?qze(i)?Phe(s,i):new IL(wt.get(In),wt.get(bl),s,Ahe(s,i),wt.get(zt)):null});return qn.registerFactory(s,t)}function Yze(s,e){if(!wt.get(In).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return Ohe(e)?q$(s,{create:()=>e}):qn.register(s,Phe(s,e))}function Zze(s,e){const t=i=>new IL(wt.get(In),wt.get(bl),s,Ahe(s,i),wt.get(zt));return Ohe(e)?q$(s,{create:()=>e}):qn.register(s,t(e))}function Xze(s,e){return wt.get(Ye).referenceProvider.register(s,e)}function Qze(s,e){return wt.get(Ye).renameProvider.register(s,e)}function Jze(s,e){return wt.get(Ye).newSymbolNamesProvider.register(s,e)}function eje(s,e){return wt.get(Ye).signatureHelpProvider.register(s,e)}function tje(s,e){return wt.get(Ye).hoverProvider.register(s,{provideHover:async(i,n,o,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new A(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new A(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function ije(s,e){return wt.get(Ye).documentSymbolProvider.register(s,e)}function nje(s,e){return wt.get(Ye).documentHighlightProvider.register(s,e)}function sje(s,e){return wt.get(Ye).linkedEditingRangeProvider.register(s,e)}function oje(s,e){return wt.get(Ye).definitionProvider.register(s,e)}function rje(s,e){return wt.get(Ye).implementationProvider.register(s,e)}function aje(s,e){return wt.get(Ye).typeDefinitionProvider.register(s,e)}function lje(s,e){return wt.get(Ye).codeLensProvider.register(s,e)}function cje(s,e,t){return wt.get(Ye).codeActionProvider.register(s,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,o,r,a)=>{const c=wt.get(qu).read({resource:n.uri}).filter(d=>A.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function dje(s,e){return wt.get(Ye).documentFormattingEditProvider.register(s,e)}function uje(s,e){return wt.get(Ye).documentRangeFormattingEditProvider.register(s,e)}function hje(s,e){return wt.get(Ye).onTypeFormattingEditProvider.register(s,e)}function fje(s,e){return wt.get(Ye).linkProvider.register(s,e)}function gje(s,e){return wt.get(Ye).completionProvider.register(s,e)}function pje(s,e){return wt.get(Ye).colorProvider.register(s,e)}function mje(s,e){return wt.get(Ye).foldingRangeProvider.register(s,e)}function _je(s,e){return wt.get(Ye).declarationProvider.register(s,e)}function bje(s,e){return wt.get(Ye).selectionRangeProvider.register(s,e)}function vje(s,e){return wt.get(Ye).documentSemanticTokensProvider.register(s,e)}function Cje(s,e){return wt.get(Ye).documentRangeSemanticTokensProvider.register(s,e)}function wje(s,e){return wt.get(Ye).inlineCompletionsProvider.register(s,e)}function yje(s,e){return wt.get(Ye).inlineEditProvider.register(s,e)}function Sje(s,e){return wt.get(Ye).inlayHintsProvider.register(s,e)}function xje(){return{register:Wze,getLanguages:Hze,onLanguage:zze,onLanguageEncountered:jze,getEncodedLanguageId:Vze,setLanguageConfiguration:Uze,setColorMap:Gze,registerTokensProviderFactory:q$,setTokensProvider:Yze,setMonarchTokensProvider:Zze,registerReferenceProvider:Xze,registerRenameProvider:Qze,registerNewSymbolNameProvider:Jze,registerCompletionItemProvider:gje,registerSignatureHelpProvider:eje,registerHoverProvider:tje,registerDocumentSymbolProvider:ije,registerDocumentHighlightProvider:nje,registerLinkedEditingRangeProvider:sje,registerDefinitionProvider:oje,registerImplementationProvider:rje,registerTypeDefinitionProvider:aje,registerCodeLensProvider:lje,registerCodeActionProvider:cje,registerDocumentFormattingEditProvider:dje,registerDocumentRangeFormattingEditProvider:uje,registerOnTypeFormattingEditProvider:hje,registerLinkProvider:fje,registerColorProvider:pje,registerFoldingRangeProvider:mje,registerDeclarationProvider:_je,registerSelectionRangeProvider:bje,registerDocumentSemanticTokensProvider:vje,registerDocumentRangeSemanticTokensProvider:Cje,registerInlineCompletionsProvider:wje,registerInlineEditProvider:yje,registerInlayHintsProvider:Sje,DocumentHighlightKind:N9,CompletionItemKind:S9,CompletionItemTag:x9,CompletionItemInsertTextRule:y9,SymbolKind:r7,SymbolTag:a7,IndentAction:P9,CompletionTriggerKind:L9,SignatureHelpTriggerKind:o7,InlayHintKind:B9,InlineCompletionTriggerKind:W9,InlineEditTriggerKind:H9,CodeActionTriggerType:w9,NewSymbolNameTag:K9,NewSymbolNameTriggerKind:G9,PartialAcceptTriggerKind:X9,HoverVerbosityAction:O9,FoldingRangeKind:bp,SelectedSuggestionInfo:Bae}}const K$=Jt("IEditorCancelService"),Fhe=new He("cancellableOperation",!1,v("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));oi(K$,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=Fhe.bindTo(n.get(vt)),r=new mr;return{key:o,tokens:r}}),this._tokens.set(s,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class Lje extends Pn{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(K$).add(e,this))}dispose(){this._unregister(),super.dispose()}}Fe(new class extends Ms{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:Fhe})}runEditorCommand(s,e){s.get(K$).cancel(e)}});let Bhe=class V6{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?Lb("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof V6))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new V6(e,this.flags))}};class Rp extends Lje{constructor(e,t,i,n){super(e,n),this._listener=new ge,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!A.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!A.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class G$ extends Pn{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Wu(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===iD.ICodeEditor:!1}function Y$(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===iD.IDiffEditor:!1}function kje(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function Whe(s){return Wu(s)?s:Y$(s)?s.getModifiedEditor():kje(s)&&Wu(s.activeCodeEditor)?s.activeCodeEditor:null}class My{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=Rd.capture(e),o=My._handleEolEdits(e,t);o.length===1&&My._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>An.replace(A.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>An.replaceMove(A.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class Jie{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class Dje{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(Jie.toKey(e))}has(e){return this._set.has(Jie.toKey(e))}}function Hhe(s,e,t){const i=[],n=new Dje,o=s.ordered(t);for(const a of o)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}const Ex=class Ex{static setFormatterSelector(e){return{dispose:Ex._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const o=ri.first(Ex._selectors);if(o)return await o(e,t,i,n)}};Ex._selectors=new mr;let jL=Ex;async function Vhe(s,e,t,i,n,o,r){const a=s.get(rt),{documentRangeFormattingEditProvider:l}=s.get(Ye),c=Wu(e)?e.getModel():e,d=l.ordered(c),u=await jL.select(d,c,i,2);u&&(n.report(u),await a.invokeFunction(Eje,u,e,t,o,r))}async function Eje(s,e,t,i,n,o){const r=s.get(Qr),a=s.get(To),l=s.get(Up);let c,d;Wu(t)?(c=t.getModel(),d=new Rp(t,5,void 0,n)):(c=t,d=new G$(t,n));const u=[];let f=0;for(const y of cj(i).sort(A.compareRangesUsingStarts))f>0&&A.areIntersectingOrTouching(u[f-1],y)?u[f-1]=A.fromPositions(u[f-1].getStartPosition(),y.getEndPosition()):f=u.push(y);const p=async y=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,y);const S=await e.provideDocumentRangeFormattingEdits(c,y,c.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,S),S},m=(y,S)=>{if(!y.length||!S.length)return!1;const L=y.reduce((k,N)=>A.plusRange(k,N.range),y[0].range);if(!S.some(k=>A.intersectRanges(L,k.range)))return!1;for(const k of y)for(const N of S)if(A.intersectRanges(k.range,N.range))return!0;return!1},b=[],C=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,u);const y=await e.provideDocumentRangesFormattingEdits(c,u,c.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,y),C.push(y)}else{for(const y of u){if(d.token.isCancellationRequested)return!0;C.push(await p(y))}for(let y=0;y<u.length;++y)for(let S=y+1;S<u.length;++S){if(d.token.isCancellationRequested)return!0;if(m(C[y],C[S])){const L=A.plusRange(u[y],u[S]),k=await p(L);u.splice(S,1),u.splice(y,1),u.push(L),C.splice(S,1),C.splice(y,1),C.push(k),y=0,S=0}}}for(const y of C){if(d.token.isCancellationRequested)return!0;const S=await r.computeMoreMinimalEdits(c.uri,y);S&&b.push(...S)}}finally{d.dispose()}if(b.length===0)return!1;if(Wu(t))My.execute(t,b,!0),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:y}]=b,S=new tt(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn);c.pushEditOperations([S],b.map(L=>({text:L.text,range:A.lift(L.range),forceMoveMarkers:!0})),L=>{for(const{range:k}of L)if(A.areIntersectingOrTouching(k,S))return[new tt(k.startLineNumber,k.startColumn,k.endLineNumber,k.endColumn)];return null})}return l.playSignal(Ka.format,{userGesture:o}),!0}async function Nje(s,e,t,i,n,o){const r=s.get(rt),a=s.get(Ye),l=Wu(e)?e.getModel():e,c=Hhe(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await jL.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(Ije,d,e,t,n,o))}async function Ije(s,e,t,i,n,o){const r=s.get(Qr),a=s.get(Up);let l,c;Wu(t)?(l=t.getModel(),c=new Rp(t,5,void 0,n)):(l=t,c=new G$(t,n));let d;try{const u=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,u),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(Wu(t))My.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:u}]=d,f=new tt(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);l.pushEditOperations([f],d.map(p=>({text:p.text,range:A.lift(p.range),forceMoveMarkers:!0})),p=>{for(const{range:m}of p)if(A.areIntersectingOrTouching(m,f))return[new tt(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)];return null})}return a.playSignal(Ka.format,{userGesture:o}),!0}async function Tje(s,e,t,i,n,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(ns);if(nr(l))return await s.computeMoreMinimalEdits(t.uri,l)}}async function Rje(s,e,t,i,n){const o=Hhe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(ns);if(nr(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function zhe(s,e,t,i,n,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,o,r)).catch(ns).then(l=>s.computeMoreMinimalEdits(t.uri,l))}ai.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;pi(at.isUri(t)),pi(A.isIRange(i));const o=s.get(Yr),r=s.get(Qr),a=s.get(Ye),l=await o.createModelReference(t);try{return Tje(r,a,l.object.textEditorModel,A.lift(i),n,Ot.None)}finally{l.dispose()}});ai.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;pi(at.isUri(t));const n=s.get(Yr),o=s.get(Qr),r=s.get(Ye),a=await n.createModelReference(t);try{return Rje(o,r,a.object.textEditorModel,i,Ot.None)}finally{a.dispose()}});ai.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,o]=e;pi(at.isUri(t)),pi(ne.isIPosition(i)),pi(typeof n=="string");const r=s.get(Yr),a=s.get(Qr),l=s.get(Ye),c=await r.createModelReference(t);try{return zhe(a,l,c.object.textEditorModel,ne.lift(i),n,o,Ot.None)}finally{c.dispose()}});Od.wrappingIndent.defaultValue=0;Od.glyphMargin.defaultValue=!1;Od.autoIndent.defaultValue=3;Od.overviewRulerLanes.defaultValue=2;jL.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const Ir=Wae();Ir.editor=Mze();Ir.languages=xje();const Mje=Ir.CancellationTokenSource,Aje=Ir.Emitter,Oje=Ir.KeyCode,Pje=Ir.KeyMod,Fje=Ir.Position,Bje=Ir.Range,Wje=Ir.Selection,Hje=Ir.SelectionDirection,Vje=Ir.MarkerSeverity,zje=Ir.MarkerTag,jje=Ir.Uri,Uje=Ir.Token,z6=Ir.editor,$je=Ir.languages,qje=globalThis.MonacoEnvironment;(qje?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Ir);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const rD=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Mje,Emitter:Aje,KeyCode:Oje,KeyMod:Pje,MarkerSeverity:Vje,MarkerTag:zje,Position:Fje,Range:Bje,Selection:Wje,SelectionDirection:Hje,Token:Uje,Uri:jje,editor:z6,languages:$je},Symbol.toStringTag,{value:"Module"}));var Kje=Object.defineProperty,Gje=Object.getOwnPropertyDescriptor,Yje=Object.getOwnPropertyNames,Zje=Object.prototype.hasOwnProperty,Xje=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Yje(e))!Zje.call(s,n)&&n!==t&&Kje(s,n,{get:()=>e[n],enumerable:!(i=Gje(e,n))||i.enumerable});return s},Qje=(s,e,t)=>(Xje(s,e,"default"),t),hS={};Qje(hS,rD);var jhe={},X3={},Jje=class Uhe{static getOrCreate(e){return X3[e]||(X3[e]=new Uhe(e)),X3[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,jhe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function gt(s){const e=s.id;jhe[e]=s,hS.languages.register(s);const t=Jje.getOrCreate(e);hS.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),hS.languages.onLanguageEncountered(e,async()=>{const i=await t.load();hS.languages.setLanguageConfiguration(e,i.conf)})}gt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>lt(()=>import("./abap-CRCWOmpq.js"),[])});gt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>lt(()=>import("./apex-DnsZk_dE.js"),[])});gt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>lt(()=>import("./azcli-1IWB1ccx.js"),[])});gt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>lt(()=>import("./bat-DPkNLes8.js"),[])});gt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>lt(()=>import("./bicep-Corcdgou.js"),[])});gt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>lt(()=>import("./cameligo-CGrWLZr3.js"),[])});gt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>lt(()=>import("./clojure-D9WOWImG.js"),[])});gt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>lt(()=>import("./coffee-B7EJu28W.js"),[])});gt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>lt(()=>import("./cpp-SEyurbux.js"),[])});gt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>lt(()=>import("./cpp-SEyurbux.js"),[])});gt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>lt(()=>import("./csharp-BoL64M5l.js"),[])});gt({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>lt(()=>import("./csp-C46ZqvIl.js"),[])});gt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>lt(()=>import("./css-DQU6DXDx.js"),[])});gt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>lt(()=>import("./cypher-D84EuPTj.js"),[])});gt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>lt(()=>import("./dart-D8lhlL1r.js"),[])});gt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>lt(()=>import("./dockerfile-DLk6rpji.js"),[])});gt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>lt(()=>import("./ecl-BO6FnfXk.js"),[])});gt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>lt(()=>import("./elixir-BRjLKONM.js"),[])});gt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>lt(()=>import("./flow9-Cac8vKd7.js"),[])});gt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>lt(()=>import("./fsharp-fd1GTHhf.js"),[])});gt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>lt(()=>import("./freemarker2-mbYRZM7v.js"),[]).then(s=>s.TagAutoInterpolationDollar)});gt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>lt(()=>import("./freemarker2-mbYRZM7v.js"),[]).then(s=>s.TagAngleInterpolationDollar)});gt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>lt(()=>import("./freemarker2-mbYRZM7v.js"),[]).then(s=>s.TagBracketInterpolationDollar)});gt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>lt(()=>import("./freemarker2-mbYRZM7v.js"),[]).then(s=>s.TagAngleInterpolationBracket)});gt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>lt(()=>import("./freemarker2-mbYRZM7v.js"),[]).then(s=>s.TagBracketInterpolationBracket)});gt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>lt(()=>import("./freemarker2-mbYRZM7v.js"),[]).then(s=>s.TagAutoInterpolationDollar)});gt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>lt(()=>import("./freemarker2-mbYRZM7v.js"),[]).then(s=>s.TagAutoInterpolationBracket)});gt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>lt(()=>import("./go-O9LJTZXk.js"),[])});gt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>lt(()=>import("./graphql-LQdxqEYJ.js"),[])});gt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>lt(()=>import("./handlebars-BxsvNCS_.js"),[])});gt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>lt(()=>import("./hcl-DxDQ3s82.js"),[])});gt({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>lt(()=>import("./html-L2JtNRP-.js"),[])});gt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>lt(()=>import("./ini-BvajGCUy.js"),[])});gt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>lt(()=>import("./java-SYsfObOQ.js"),[])});gt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>lt(()=>import("./javascript-B3VBQ2aj.js"),__vite__mapDeps([0,1]))});gt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>lt(()=>import("./julia-DQXNmw_w.js"),[])});gt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>lt(()=>import("./kotlin-qQ0MG-9I.js"),[])});gt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>lt(()=>import("./less-GGFNNJHn.js"),[])});gt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>lt(()=>import("./lexon-Canl7DCW.js"),[])});gt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>lt(()=>import("./lua-D28Ae8-K.js"),[])});gt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>lt(()=>import("./liquid-MsmHPgUq.js"),[])});gt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>lt(()=>import("./m3-DPitgjJI.js"),[])});gt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>lt(()=>import("./markdown-B811l8j2.js"),[])});gt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>lt(()=>import("./mdx-b592lU5a.js"),[])});gt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>lt(()=>import("./mips-CdjsipkG.js"),[])});gt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>lt(()=>import("./msdax-CYqgjx_P.js"),[])});gt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>lt(()=>import("./mysql-BHd6q0vd.js"),[])});gt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>lt(()=>import("./objective-c-B1aVtJYH.js"),[])});gt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>lt(()=>import("./pascal-BhNW15KB.js"),[])});gt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>lt(()=>import("./pascaligo-5jv8CcQD.js"),[])});gt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>lt(()=>import("./perl-DlYyT36c.js"),[])});gt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>lt(()=>import("./pgsql-Dy0bjov7.js"),[])});gt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>lt(()=>import("./php-120yhfDK.js"),[])});gt({id:"pla",extensions:[".pla"],loader:()=>lt(()=>import("./pla-CjnFlu4u.js"),[])});gt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>lt(()=>import("./postiats-CQpG440k.js"),[])});gt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>lt(()=>import("./powerquery-DdJtto1Z.js"),[])});gt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>lt(()=>import("./powershell-Bu_VLpJB.js"),[])});gt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>lt(()=>import("./protobuf-IBS6jZEB.js"),[])});gt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>lt(()=>import("./pug-kFxLfcjb.js"),[])});gt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>lt(()=>import("./python-CRTDq_yq.js"),[])});gt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>lt(()=>import("./qsharp-q7JyzKFN.js"),[])});gt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>lt(()=>import("./r-BIFz-_sK.js"),[])});gt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>lt(()=>import("./razor-Bra6tOBG.js"),[])});gt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>lt(()=>import("./redis-CHOsPHWR.js"),[])});gt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>lt(()=>import("./redshift-CBifECDb.js"),[])});gt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>lt(()=>import("./restructuredtext-CghPJEOS.js"),[])});gt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>lt(()=>import("./ruby-CYWGW-b1.js"),[])});gt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>lt(()=>import("./rust-DMDD0SHb.js"),[])});gt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>lt(()=>import("./sb-BYAiYHFx.js"),[])});gt({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>lt(()=>import("./scala-Bqvq8jcR.js"),[])});gt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>lt(()=>import("./scheme-Dhb-2j9p.js"),[])});gt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>lt(()=>import("./scss-CTwUZ5N7.js"),[])});gt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>lt(()=>import("./shell-CsDZo4DB.js"),[])});gt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>lt(()=>import("./solidity-CME5AdoB.js"),[])});gt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>lt(()=>import("./sophia-RYC1BQQz.js"),[])});gt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>lt(()=>import("./sparql-KEyrF7De.js"),[])});gt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>lt(()=>import("./sql-BdTr02Mf.js"),[])});gt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>lt(()=>import("./st-C7iG7M4S.js"),[])});gt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>lt(()=>import("./swift-D7IUmUK8.js"),[])});gt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>lt(()=>import("./systemverilog-DgMryOEJ.js"),[])});gt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>lt(()=>import("./systemverilog-DgMryOEJ.js"),[])});gt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>lt(()=>import("./tcl-PloMZuKG.js"),[])});gt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>lt(()=>import("./twig-BfRIq3la.js"),[])});gt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>lt(()=>import("./typescript-B1tKC8Cs.js"),[])});gt({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>lt(()=>import("./typespec-CzxlYoT_.js"),[])});gt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>lt(()=>import("./vb-BwAE3J76.js"),[])});gt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>lt(()=>import("./wgsl-B_1kOXbF.js"),[])});gt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>lt(()=>import("./xml-DwtGsUdF.js"),[])});gt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>lt(()=>import("./yaml-BVE9WPwp.js"),[])});var eUe=Object.defineProperty,tUe=Object.getOwnPropertyDescriptor,iUe=Object.getOwnPropertyNames,nUe=Object.prototype.hasOwnProperty,sUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of iUe(e))!nUe.call(s,n)&&n!==t&&eUe(s,n,{get:()=>e[n],enumerable:!(i=tUe(e,n))||i.enumerable});return s},oUe=(s,e,t)=>(sUe(s,e,"default"),t),y1={};oUe(y1,rD);var Z$=class{constructor(e,t,i){this._onDidChange=new y1.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},X$={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},Q$={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},$he=new Z$("css",X$,Q$),qhe=new Z$("scss",X$,Q$),Khe=new Z$("less",X$,Q$);y1.languages.css={cssDefaults:$he,lessDefaults:Khe,scssDefaults:qhe};function J$(){return lt(()=>import("./cssMode-DiiiM5B_.js"),[])}y1.languages.onLanguage("less",()=>{J$().then(s=>s.setupMode(Khe))});y1.languages.onLanguage("scss",()=>{J$().then(s=>s.setupMode(qhe))});y1.languages.onLanguage("css",()=>{J$().then(s=>s.setupMode($he))});var rUe=Object.defineProperty,aUe=Object.getOwnPropertyDescriptor,lUe=Object.getOwnPropertyNames,cUe=Object.prototype.hasOwnProperty,dUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of lUe(e))!cUe.call(s,n)&&n!==t&&rUe(s,n,{get:()=>e[n],enumerable:!(i=aUe(e,n))||i.enumerable});return s},uUe=(s,e,t)=>(dUe(s,e,"default"),t),hP={};uUe(hP,rD);var hUe=class{constructor(e,t,i){this._onDidChange=new hP.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},fUe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},fP={format:fUe,suggest:{},data:{useDefaultDataProvider:!0}};function gP(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===nx,documentFormattingEdits:s===nx,documentRangeFormattingEdits:s===nx}}var nx="html",ene="handlebars",tne="razor",Ghe=pP(nx,fP,gP(nx)),gUe=Ghe.defaults,Yhe=pP(ene,fP,gP(ene)),pUe=Yhe.defaults,Zhe=pP(tne,fP,gP(tne)),mUe=Zhe.defaults;hP.languages.html={htmlDefaults:gUe,razorDefaults:mUe,handlebarDefaults:pUe,htmlLanguageService:Ghe,handlebarLanguageService:Yhe,razorLanguageService:Zhe,registerHTMLLanguageService:pP};function _Ue(){return lt(()=>import("./htmlMode-C6Ob6SpL.js"),[])}function pP(s,e=fP,t=gP(s)){const i=new hUe(s,e,t);let n;const o=hP.languages.onLanguage(s,async()=>{n=(await _Ue()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),n?.dispose(),n=void 0}}}var bUe=Object.defineProperty,vUe=Object.getOwnPropertyDescriptor,CUe=Object.getOwnPropertyNames,wUe=Object.prototype.hasOwnProperty,yUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of CUe(e))!wUe.call(s,n)&&n!==t&&bUe(s,n,{get:()=>e[n],enumerable:!(i=vUe(e,n))||i.enumerable});return s},SUe=(s,e,t)=>(yUe(s,e,"default"),t),aD={};SUe(aD,rD);var xUe=class{constructor(e,t,i){this._onDidChange=new aD.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},LUe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},kUe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Xhe=new xUe("json",LUe,kUe),DUe=()=>Qhe().then(s=>s.getWorker());aD.languages.json={jsonDefaults:Xhe,getWorker:DUe};function Qhe(){return lt(()=>import("./jsonMode-DBfewrrL.js"),[])}aD.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});aD.languages.onLanguage("json",()=>{Qhe().then(s=>s.setupMode(Xhe))});var EUe=Object.defineProperty,NUe=Object.getOwnPropertyDescriptor,IUe=Object.getOwnPropertyNames,TUe=Object.prototype.hasOwnProperty,RUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of IUe(e))!TUe.call(s,n)&&n!==t&&EUe(s,n,{get:()=>e[n],enumerable:!(i=NUe(e,n))||i.enumerable});return s},MUe=(s,e,t)=>(RUe(s,e,"default"),t),AUe="5.4.5",Ay={};MUe(Ay,rD);var Jhe=(s=>(s[s.None=0]="None",s[s.CommonJS=1]="CommonJS",s[s.AMD=2]="AMD",s[s.UMD=3]="UMD",s[s.System=4]="System",s[s.ES2015=5]="ES2015",s[s.ESNext=99]="ESNext",s))(Jhe||{}),efe=(s=>(s[s.None=0]="None",s[s.Preserve=1]="Preserve",s[s.React=2]="React",s[s.ReactNative=3]="ReactNative",s[s.ReactJSX=4]="ReactJSX",s[s.ReactJSXDev=5]="ReactJSXDev",s))(efe||{}),tfe=(s=>(s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s))(tfe||{}),ife=(s=>(s[s.ES3=0]="ES3",s[s.ES5=1]="ES5",s[s.ES2015=2]="ES2015",s[s.ES2016=3]="ES2016",s[s.ES2017=4]="ES2017",s[s.ES2018=5]="ES2018",s[s.ES2019=6]="ES2019",s[s.ES2020=7]="ES2020",s[s.ESNext=99]="ESNext",s[s.JSON=100]="JSON",s[s.Latest=99]="Latest",s))(ife||{}),nfe=(s=>(s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs",s))(nfe||{}),sfe=class{constructor(s,e,t,i,n){this._onDidChange=new Ay.Emitter,this._onDidExtraLibsChange=new Ay.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(s),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(s,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===s)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:s,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(s){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),s&&s.length>0)for(const e of s){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(s){this._compilerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(s){this._diagnosticsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(s){this._workerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(s){this._inlayHintsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(s){}setEagerModelSync(s){this._eagerModelSync=s}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(void 0)}},OUe=AUe,ofe={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},rfe=new sfe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},ofe),afe=new sfe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},ofe),PUe=()=>mP().then(s=>s.getTypeScriptWorker()),FUe=()=>mP().then(s=>s.getJavaScriptWorker());Ay.languages.typescript={ModuleKind:Jhe,JsxEmit:efe,NewLineKind:tfe,ScriptTarget:ife,ModuleResolutionKind:nfe,typescriptVersion:OUe,typescriptDefaults:rfe,javascriptDefaults:afe,getTypeScriptWorker:PUe,getJavaScriptWorker:FUe};function mP(){return lt(()=>import("./tsMode-DboToZev.js"),[])}Ay.languages.onLanguage("typescript",()=>mP().then(s=>s.setupTypeScript(rfe)));Ay.languages.onLanguage("javascript",()=>mP().then(s=>s.setupJavaScript(afe)));class BUe extends Er{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Ct("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:ke.map,toggled:pe.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:pe.has("isInDiffEditor"),menu:{when:pe.has("isInDiffEditor"),id:Je.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(zt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class lfe extends Er{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Ct("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:pe.has("isInDiffEditor")})}run(e,...t){const i=e.get(zt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class cfe extends Er{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Ct("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:pe.has("isInDiffEditor")})}run(e,...t){const i=e.get(zt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const lD=Ct("diffEditor","Diff Editor");class WUe extends Pd{constructor(){super({id:"diffEditor.switchSide",title:Ct("switchSide","Switch Side"),icon:ke.arrowSwap,precondition:pe.has("isInDiffEditor"),f1:!0,category:lD})}runEditorCommand(e,t,i){const n=S1(e);if(n instanceof vf){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class HUe extends Pd{constructor(){super({id:"diffEditor.exitCompareMove",title:Ct("exitCompareMove","Exit Compare Move"),icon:ke.close,precondition:V.comparingMovedCode,f1:!1,category:lD,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=S1(e);n instanceof vf&&n.exitCompareMove()}}class VUe extends Pd{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Ct("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:ke.fold,precondition:pe.has("isInDiffEditor"),f1:!0,category:lD})}runEditorCommand(e,t,...i){const n=S1(e);n instanceof vf&&n.collapseAllUnchangedRegions()}}class zUe extends Pd{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Ct("showAllUnchangedRegions","Show All Unchanged Regions"),icon:ke.unfold,precondition:pe.has("isInDiffEditor"),f1:!0,category:lD})}runEditorCommand(e,t,...i){const n=S1(e);n instanceof vf&&n.showAllUnchangedRegions()}}class j6 extends Er{constructor(){super({id:"diffEditor.revert",title:Ct("revert","Revert"),f1:!1,category:lD})}run(e,t){const i=jUe(e,t.originalUri,t.modifiedUri);i instanceof vf&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const dfe=Ct("accessibleDiffViewer","Accessible Diff Viewer"),YA=class YA extends Er{constructor(){super({id:YA.id,title:Ct("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:dfe,precondition:pe.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){S1(e)?.accessibleDiffViewerNext()}};YA.id="editor.action.accessibleDiffViewer.next";let UL=YA;const ZA=class ZA extends Er{constructor(){super({id:ZA.id,title:Ct("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:dfe,precondition:pe.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){S1(e)?.accessibleDiffViewerPrev()}};ZA.id="editor.action.accessibleDiffViewer.prev";let tM=ZA;function jUe(s,e,t){return s.get(mi).listDiffEditors().find(o=>{const r=o.getModifiedEditor(),a=o.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function S1(s){const t=s.get(mi).listDiffEditors(),i=Do();if(i)for(const n of t){const o=n.getContainerDomNode();if(UUe(o,i))return n}return null}function UUe(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}en(BUe);en(lfe);en(cfe);Qs.appendMenuItem(Je.EditorTitle,{command:{id:new cfe().desc.id,title:v("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:pe.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:pe.has("isInDiffEditor")},order:11,group:"1_diff",when:pe.and(V.diffEditorRenderSideBySideInlineBreakpointReached,pe.has("isInDiffEditor"))});Qs.appendMenuItem(Je.EditorTitle,{command:{id:new lfe().desc.id,title:v("showMoves","Show Moved Code Blocks"),icon:ke.move,toggled:o1.create("config.diffEditor.experimental.showMoves",!0),precondition:pe.has("isInDiffEditor")},order:10,group:"1_diff",when:pe.has("isInDiffEditor")});en(j6);for(const s of[{icon:ke.arrowRight,key:V.diffEditorInlineMode.toNegated()},{icon:ke.discard,key:V.diffEditorInlineMode}])Qs.appendMenuItem(Je.DiffEditorHunkToolbar,{command:{id:new j6().desc.id,title:v("revertHunk","Revert Block"),icon:s.icon},when:pe.and(V.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),Qs.appendMenuItem(Je.DiffEditorSelectionToolbar,{command:{id:new j6().desc.id,title:v("revertSelection","Revert Selection"),icon:s.icon},when:pe.and(V.diffEditorModifiedWritable,s.key),order:5,group:"primary"});en(WUe);en(HUe);en(VUe);en(zUe);Qs.appendMenuItem(Je.EditorTitle,{command:{id:UL.id,title:v("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:pe.has("isInDiffEditor")},order:10,group:"2_diff",when:pe.and(V.accessibleDiffViewerVisible.negate(),pe.has("isInDiffEditor"))});ai.registerCommandAlias("editor.action.diffReview.next",UL.id);en(UL);ai.registerCommandAlias("editor.action.diffReview.prev",tM.id);en(tM);var $Ue=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qUe=function(s,e){return function(t,i){e(t,i,s)}},U6;const _P=new He("selectionAnchorSet",!1);var A_;let Mp=(A_=class{static get(e){return e.getContribution(U6.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=_P.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(tt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Bo().appendText(v("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),kr(v("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(tt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},U6=A_,A_.ID="editor.contrib.selectionAnchorController",A_);Mp=U6=$Ue([qUe(1,vt)],Mp);class KUe extends $e{constructor(){super({id:"editor.action.setSelectionAnchor",label:v("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:V.editorTextFocus,primary:ys(2089,2080),weight:100}})}async run(e,t){Mp.get(t)?.setSelectionAnchor()}}class GUe extends $e{constructor(){super({id:"editor.action.goToSelectionAnchor",label:v("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:_P})}async run(e,t){Mp.get(t)?.goToSelectionAnchor()}}class YUe extends $e{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:v("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:_P,kbOpts:{kbExpr:V.editorTextFocus,primary:ys(2089,2089),weight:100}})}async run(e,t){Mp.get(t)?.selectFromAnchorToCursor()}}class ZUe extends $e{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:v("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:_P,kbOpts:{kbExpr:V.editorTextFocus,primary:9,weight:100}})}async run(e,t){Mp.get(t)?.cancelSelectionAnchor()}}di(Mp.ID,Mp,4);we(KUe);we(GUe);we(YUe);we(ZUe);const XUe=z("editorOverviewRuler.bracketMatchForeground","#A0A0A0",v("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class QUe extends $e{constructor(){super({id:"editor.action.jumpToBracket",label:v("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:V.editorTextFocus,primary:3165,weight:100}})}run(e,t){Hb.get(t)?.jumpToBracket()}}class JUe extends $e{constructor(){super({id:"editor.action.selectToBracket",label:v("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Ct("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let n=!0;i&&i.selectBrackets===!1&&(n=!1),Hb.get(t)?.selectToBracket(n)}}class e$e extends $e{constructor(){super({id:"editor.action.removeBrackets",label:v("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:V.editorTextFocus,primary:2561,weight:100}})}run(e,t){Hb.get(t)?.removeBrackets(this.id)}}class t$e{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const vg=class vg extends oe{static get(e){return e.getContribution(vg.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Pi(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),o=e.bracketPairs.matchBracket(n);let r=null;if(o)o[0].containsPosition(n)&&!o[1].containsPosition(n)?r=o[1].getStartPosition():o[1].containsPosition(n)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new tt(r.lineNumber,r.column,r.lineNumber,r.column):new tt(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const o=n.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(A.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const u=a;a=l,l=u}}a&&l&&i.push(new tt(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let o=t.bracketPairs.matchBracket(n);o||(o=t.bracketPairs.findEnclosingBrackets(n)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const o=[];let r=0;for(let u=0,f=e.length;u<f;u++){const p=e[u];p.isEmpty()&&(o[r++]=p.getStartPosition())}o.length>1&&o.sort(ne.compare);const a=[];let l=0,c=0;const d=n.length;for(let u=0,f=o.length;u<f;u++){const p=o[u];for(;c<d&&n[c].position.isBefore(p);)c++;if(c<d&&n[c].position.equals(p))a[l++]=n[c];else{let m=t.bracketPairs.matchBracket(p,20),b=vg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(p,20),b=vg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new t$e(p,m,b)}}this._lastBracketsData=a,this._lastVersionId=i}};vg.ID="editor.contrib.bracketMatchingController",vg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Et.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Kn(XUe),position:ol.Center}}),vg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Et.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Hb=vg;di(Hb.ID,Hb,1);we(JUe);we(QUe);we(e$e);Qs.appendMenuItem(Je.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:v({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class i$e{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new A(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new A(i,o,i,o),a)}else{const r=new A(i,o,i,o+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new A(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new tt(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new tt(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class ufe extends $e{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const o of n)i.push(new i$e(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class n$e extends ufe{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:v("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:V.writable})}}class s$e extends ufe{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:v("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:V.writable})}}we(n$e);we(s$e);class o$e extends $e{constructor(){super({id:"editor.action.transposeLetters",label:v("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:V.writable,kbOpts:{kbExpr:V.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],o=t.getSelections();for(const r of o){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,c=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&c===2))continue;const d=l===c?r.getPosition():Ei.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),u=Ei.leftPosition(i,d),f=Ei.leftPosition(i,u),p=i.getValueInRange(A.fromPositions(f,u)),m=i.getValueInRange(A.fromPositions(u,d)),b=A.fromPositions(f,d);n.push(new ko(b,m+p))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}we(o$e);const bP=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){s(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,o="";return o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o}})();function eq(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function r$e(s,e,t){const i={id:bP(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class hfe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return ri.some(this,([i,n])=>n.asFile())&&t.push("files"),gfe(iM(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return iM(e)}}function iM(s){return s.toLowerCase()}function ffe(s,e){return gfe(iM(s),e.map(iM))}function gfe(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,o]=t;return o==="*"?e.some(r=>r.startsWith(n+"/")):!1}const vP=Object.freeze({create:s=>uf(s.map(e=>e.toString())).join(`\r
|
|
720
|
+
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:rf(t,a.open),close:rf(t,a.close)});else throw vn(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function Wze(s){hy.registerLanguage(s)}function Hze(){let s=[];return s=s.concat(hy.getLanguages()),s}function Vze(s){return wt.get(In).languageIdCodec.encodeLanguageId(s)}function zze(s,e){return wt.withServices(()=>{const i=wt.get(In).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function jze(s,e){return wt.withServices(()=>{const i=wt.get(In).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function Uze(s,e){if(!wt.get(In).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return wt.get(Bn).register(s,e,100)}class $ze{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return zL.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new iO(n.tokens,n.endState)}}class zL{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,r=e.length;o<r;o++){const a=e[o];let l=a.startIndex;o===0?l=0:l<n&&(l=n),i[o]=new zx(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),r=zL._toClassicTokens(o.tokens,e);let a;return o.endState.equals(n)?a=n:a=o.endState,new Cj(r,a)}tokenize(e,t,i){return zL.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const u=t[c],f=n.match(i,u.scopes)|1024;if(r>0&&o[r-1]===f)continue;let p=u.startIndex;c===0?p=0:p<a&&(p=a),o[r++]=p,o[r++]=f,a=p}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=o[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new iO(o,r)}}function qze(s){return typeof s.getInitialState=="function"}function Kze(s){return"tokenizeEncoded"in s}function Ohe(s){return s&&typeof s.then=="function"}function Gze(s){const e=wt.get(bl);if(s){const t=[null];for(let i=1,n=s.length;i<n;i++)t[i]=me.fromHex(s[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function Phe(s,e){return Kze(e)?new $ze(s,e):new zL(s,e,wt.get(In),wt.get(bl))}function q$(s,e){const t=new SNe(async()=>{const i=await Promise.resolve(e.create());return i?qze(i)?Phe(s,i):new IL(wt.get(In),wt.get(bl),s,Ahe(s,i),wt.get(zt)):null});return qn.registerFactory(s,t)}function Yze(s,e){if(!wt.get(In).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return Ohe(e)?q$(s,{create:()=>e}):qn.register(s,Phe(s,e))}function Zze(s,e){const t=i=>new IL(wt.get(In),wt.get(bl),s,Ahe(s,i),wt.get(zt));return Ohe(e)?q$(s,{create:()=>e}):qn.register(s,t(e))}function Xze(s,e){return wt.get(Ye).referenceProvider.register(s,e)}function Qze(s,e){return wt.get(Ye).renameProvider.register(s,e)}function Jze(s,e){return wt.get(Ye).newSymbolNamesProvider.register(s,e)}function eje(s,e){return wt.get(Ye).signatureHelpProvider.register(s,e)}function tje(s,e){return wt.get(Ye).hoverProvider.register(s,{provideHover:async(i,n,o,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new A(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new A(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function ije(s,e){return wt.get(Ye).documentSymbolProvider.register(s,e)}function nje(s,e){return wt.get(Ye).documentHighlightProvider.register(s,e)}function sje(s,e){return wt.get(Ye).linkedEditingRangeProvider.register(s,e)}function oje(s,e){return wt.get(Ye).definitionProvider.register(s,e)}function rje(s,e){return wt.get(Ye).implementationProvider.register(s,e)}function aje(s,e){return wt.get(Ye).typeDefinitionProvider.register(s,e)}function lje(s,e){return wt.get(Ye).codeLensProvider.register(s,e)}function cje(s,e,t){return wt.get(Ye).codeActionProvider.register(s,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,o,r,a)=>{const c=wt.get(qu).read({resource:n.uri}).filter(d=>A.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function dje(s,e){return wt.get(Ye).documentFormattingEditProvider.register(s,e)}function uje(s,e){return wt.get(Ye).documentRangeFormattingEditProvider.register(s,e)}function hje(s,e){return wt.get(Ye).onTypeFormattingEditProvider.register(s,e)}function fje(s,e){return wt.get(Ye).linkProvider.register(s,e)}function gje(s,e){return wt.get(Ye).completionProvider.register(s,e)}function pje(s,e){return wt.get(Ye).colorProvider.register(s,e)}function mje(s,e){return wt.get(Ye).foldingRangeProvider.register(s,e)}function _je(s,e){return wt.get(Ye).declarationProvider.register(s,e)}function bje(s,e){return wt.get(Ye).selectionRangeProvider.register(s,e)}function vje(s,e){return wt.get(Ye).documentSemanticTokensProvider.register(s,e)}function Cje(s,e){return wt.get(Ye).documentRangeSemanticTokensProvider.register(s,e)}function wje(s,e){return wt.get(Ye).inlineCompletionsProvider.register(s,e)}function yje(s,e){return wt.get(Ye).inlineEditProvider.register(s,e)}function Sje(s,e){return wt.get(Ye).inlayHintsProvider.register(s,e)}function xje(){return{register:Wze,getLanguages:Hze,onLanguage:zze,onLanguageEncountered:jze,getEncodedLanguageId:Vze,setLanguageConfiguration:Uze,setColorMap:Gze,registerTokensProviderFactory:q$,setTokensProvider:Yze,setMonarchTokensProvider:Zze,registerReferenceProvider:Xze,registerRenameProvider:Qze,registerNewSymbolNameProvider:Jze,registerCompletionItemProvider:gje,registerSignatureHelpProvider:eje,registerHoverProvider:tje,registerDocumentSymbolProvider:ije,registerDocumentHighlightProvider:nje,registerLinkedEditingRangeProvider:sje,registerDefinitionProvider:oje,registerImplementationProvider:rje,registerTypeDefinitionProvider:aje,registerCodeLensProvider:lje,registerCodeActionProvider:cje,registerDocumentFormattingEditProvider:dje,registerDocumentRangeFormattingEditProvider:uje,registerOnTypeFormattingEditProvider:hje,registerLinkProvider:fje,registerColorProvider:pje,registerFoldingRangeProvider:mje,registerDeclarationProvider:_je,registerSelectionRangeProvider:bje,registerDocumentSemanticTokensProvider:vje,registerDocumentRangeSemanticTokensProvider:Cje,registerInlineCompletionsProvider:wje,registerInlineEditProvider:yje,registerInlayHintsProvider:Sje,DocumentHighlightKind:N9,CompletionItemKind:S9,CompletionItemTag:x9,CompletionItemInsertTextRule:y9,SymbolKind:r7,SymbolTag:a7,IndentAction:P9,CompletionTriggerKind:L9,SignatureHelpTriggerKind:o7,InlayHintKind:B9,InlineCompletionTriggerKind:W9,InlineEditTriggerKind:H9,CodeActionTriggerType:w9,NewSymbolNameTag:K9,NewSymbolNameTriggerKind:G9,PartialAcceptTriggerKind:X9,HoverVerbosityAction:O9,FoldingRangeKind:bp,SelectedSuggestionInfo:Bae}}const K$=Jt("IEditorCancelService"),Fhe=new He("cancellableOperation",!1,v("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));oi(K$,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=Fhe.bindTo(n.get(vt)),r=new mr;return{key:o,tokens:r}}),this._tokens.set(s,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class Lje extends Pn{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(K$).add(e,this))}dispose(){this._unregister(),super.dispose()}}Fe(new class extends Ms{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:Fhe})}runEditorCommand(s,e){s.get(K$).cancel(e)}});let Bhe=class V6{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?Lb("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof V6))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new V6(e,this.flags))}};class Rp extends Lje{constructor(e,t,i,n){super(e,n),this._listener=new ge,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!A.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!A.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class G$ extends Pn{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Wu(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===iD.ICodeEditor:!1}function Y$(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===iD.IDiffEditor:!1}function kje(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function Whe(s){return Wu(s)?s:Y$(s)?s.getModifiedEditor():kje(s)&&Wu(s.activeCodeEditor)?s.activeCodeEditor:null}class My{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=Rd.capture(e),o=My._handleEolEdits(e,t);o.length===1&&My._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>An.replace(A.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>An.replaceMove(A.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class Jie{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class Dje{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(Jie.toKey(e))}has(e){return this._set.has(Jie.toKey(e))}}function Hhe(s,e,t){const i=[],n=new Dje,o=s.ordered(t);for(const a of o)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}const Ex=class Ex{static setFormatterSelector(e){return{dispose:Ex._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const o=ri.first(Ex._selectors);if(o)return await o(e,t,i,n)}};Ex._selectors=new mr;let jL=Ex;async function Vhe(s,e,t,i,n,o,r){const a=s.get(rt),{documentRangeFormattingEditProvider:l}=s.get(Ye),c=Wu(e)?e.getModel():e,d=l.ordered(c),u=await jL.select(d,c,i,2);u&&(n.report(u),await a.invokeFunction(Eje,u,e,t,o,r))}async function Eje(s,e,t,i,n,o){const r=s.get(Qr),a=s.get(To),l=s.get(Up);let c,d;Wu(t)?(c=t.getModel(),d=new Rp(t,5,void 0,n)):(c=t,d=new G$(t,n));const u=[];let f=0;for(const y of cj(i).sort(A.compareRangesUsingStarts))f>0&&A.areIntersectingOrTouching(u[f-1],y)?u[f-1]=A.fromPositions(u[f-1].getStartPosition(),y.getEndPosition()):f=u.push(y);const p=async y=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,y);const S=await e.provideDocumentRangeFormattingEdits(c,y,c.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,S),S},m=(y,S)=>{if(!y.length||!S.length)return!1;const L=y.reduce((k,N)=>A.plusRange(k,N.range),y[0].range);if(!S.some(k=>A.intersectRanges(L,k.range)))return!1;for(const k of y)for(const N of S)if(A.intersectRanges(k.range,N.range))return!0;return!1},b=[],C=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,u);const y=await e.provideDocumentRangesFormattingEdits(c,u,c.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,y),C.push(y)}else{for(const y of u){if(d.token.isCancellationRequested)return!0;C.push(await p(y))}for(let y=0;y<u.length;++y)for(let S=y+1;S<u.length;++S){if(d.token.isCancellationRequested)return!0;if(m(C[y],C[S])){const L=A.plusRange(u[y],u[S]),k=await p(L);u.splice(S,1),u.splice(y,1),u.push(L),C.splice(S,1),C.splice(y,1),C.push(k),y=0,S=0}}}for(const y of C){if(d.token.isCancellationRequested)return!0;const S=await r.computeMoreMinimalEdits(c.uri,y);S&&b.push(...S)}}finally{d.dispose()}if(b.length===0)return!1;if(Wu(t))My.execute(t,b,!0),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:y}]=b,S=new tt(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn);c.pushEditOperations([S],b.map(L=>({text:L.text,range:A.lift(L.range),forceMoveMarkers:!0})),L=>{for(const{range:k}of L)if(A.areIntersectingOrTouching(k,S))return[new tt(k.startLineNumber,k.startColumn,k.endLineNumber,k.endColumn)];return null})}return l.playSignal(Ka.format,{userGesture:o}),!0}async function Nje(s,e,t,i,n,o){const r=s.get(rt),a=s.get(Ye),l=Wu(e)?e.getModel():e,c=Hhe(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await jL.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(Ije,d,e,t,n,o))}async function Ije(s,e,t,i,n,o){const r=s.get(Qr),a=s.get(Up);let l,c;Wu(t)?(l=t.getModel(),c=new Rp(t,5,void 0,n)):(l=t,c=new G$(t,n));let d;try{const u=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,u),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(Wu(t))My.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:u}]=d,f=new tt(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);l.pushEditOperations([f],d.map(p=>({text:p.text,range:A.lift(p.range),forceMoveMarkers:!0})),p=>{for(const{range:m}of p)if(A.areIntersectingOrTouching(m,f))return[new tt(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)];return null})}return a.playSignal(Ka.format,{userGesture:o}),!0}async function Tje(s,e,t,i,n,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(ns);if(nr(l))return await s.computeMoreMinimalEdits(t.uri,l)}}async function Rje(s,e,t,i,n){const o=Hhe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(ns);if(nr(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function zhe(s,e,t,i,n,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,o,r)).catch(ns).then(l=>s.computeMoreMinimalEdits(t.uri,l))}ai.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;pi(at.isUri(t)),pi(A.isIRange(i));const o=s.get(Yr),r=s.get(Qr),a=s.get(Ye),l=await o.createModelReference(t);try{return Tje(r,a,l.object.textEditorModel,A.lift(i),n,Ot.None)}finally{l.dispose()}});ai.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;pi(at.isUri(t));const n=s.get(Yr),o=s.get(Qr),r=s.get(Ye),a=await n.createModelReference(t);try{return Rje(o,r,a.object.textEditorModel,i,Ot.None)}finally{a.dispose()}});ai.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,o]=e;pi(at.isUri(t)),pi(ne.isIPosition(i)),pi(typeof n=="string");const r=s.get(Yr),a=s.get(Qr),l=s.get(Ye),c=await r.createModelReference(t);try{return zhe(a,l,c.object.textEditorModel,ne.lift(i),n,o,Ot.None)}finally{c.dispose()}});Od.wrappingIndent.defaultValue=0;Od.glyphMargin.defaultValue=!1;Od.autoIndent.defaultValue=3;Od.overviewRulerLanes.defaultValue=2;jL.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const Ir=Wae();Ir.editor=Mze();Ir.languages=xje();const Mje=Ir.CancellationTokenSource,Aje=Ir.Emitter,Oje=Ir.KeyCode,Pje=Ir.KeyMod,Fje=Ir.Position,Bje=Ir.Range,Wje=Ir.Selection,Hje=Ir.SelectionDirection,Vje=Ir.MarkerSeverity,zje=Ir.MarkerTag,jje=Ir.Uri,Uje=Ir.Token,z6=Ir.editor,$je=Ir.languages,qje=globalThis.MonacoEnvironment;(qje?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Ir);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const rD=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Mje,Emitter:Aje,KeyCode:Oje,KeyMod:Pje,MarkerSeverity:Vje,MarkerTag:zje,Position:Fje,Range:Bje,Selection:Wje,SelectionDirection:Hje,Token:Uje,Uri:jje,editor:z6,languages:$je},Symbol.toStringTag,{value:"Module"}));var Kje=Object.defineProperty,Gje=Object.getOwnPropertyDescriptor,Yje=Object.getOwnPropertyNames,Zje=Object.prototype.hasOwnProperty,Xje=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Yje(e))!Zje.call(s,n)&&n!==t&&Kje(s,n,{get:()=>e[n],enumerable:!(i=Gje(e,n))||i.enumerable});return s},Qje=(s,e,t)=>(Xje(s,e,"default"),t),hS={};Qje(hS,rD);var jhe={},X3={},Jje=class Uhe{static getOrCreate(e){return X3[e]||(X3[e]=new Uhe(e)),X3[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,jhe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function gt(s){const e=s.id;jhe[e]=s,hS.languages.register(s);const t=Jje.getOrCreate(e);hS.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),hS.languages.onLanguageEncountered(e,async()=>{const i=await t.load();hS.languages.setLanguageConfiguration(e,i.conf)})}gt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>lt(()=>import("./abap-CRCWOmpq.js"),[])});gt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>lt(()=>import("./apex-DnsZk_dE.js"),[])});gt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>lt(()=>import("./azcli-1IWB1ccx.js"),[])});gt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>lt(()=>import("./bat-DPkNLes8.js"),[])});gt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>lt(()=>import("./bicep-Corcdgou.js"),[])});gt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>lt(()=>import("./cameligo-CGrWLZr3.js"),[])});gt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>lt(()=>import("./clojure-D9WOWImG.js"),[])});gt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>lt(()=>import("./coffee-B7EJu28W.js"),[])});gt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>lt(()=>import("./cpp-SEyurbux.js"),[])});gt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>lt(()=>import("./cpp-SEyurbux.js"),[])});gt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>lt(()=>import("./csharp-BoL64M5l.js"),[])});gt({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>lt(()=>import("./csp-C46ZqvIl.js"),[])});gt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>lt(()=>import("./css-DQU6DXDx.js"),[])});gt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>lt(()=>import("./cypher-D84EuPTj.js"),[])});gt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>lt(()=>import("./dart-D8lhlL1r.js"),[])});gt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>lt(()=>import("./dockerfile-DLk6rpji.js"),[])});gt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>lt(()=>import("./ecl-BO6FnfXk.js"),[])});gt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>lt(()=>import("./elixir-BRjLKONM.js"),[])});gt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>lt(()=>import("./flow9-Cac8vKd7.js"),[])});gt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>lt(()=>import("./fsharp-fd1GTHhf.js"),[])});gt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>lt(()=>import("./freemarker2-qchF6xJx.js"),[]).then(s=>s.TagAutoInterpolationDollar)});gt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>lt(()=>import("./freemarker2-qchF6xJx.js"),[]).then(s=>s.TagAngleInterpolationDollar)});gt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>lt(()=>import("./freemarker2-qchF6xJx.js"),[]).then(s=>s.TagBracketInterpolationDollar)});gt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>lt(()=>import("./freemarker2-qchF6xJx.js"),[]).then(s=>s.TagAngleInterpolationBracket)});gt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>lt(()=>import("./freemarker2-qchF6xJx.js"),[]).then(s=>s.TagBracketInterpolationBracket)});gt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>lt(()=>import("./freemarker2-qchF6xJx.js"),[]).then(s=>s.TagAutoInterpolationDollar)});gt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>lt(()=>import("./freemarker2-qchF6xJx.js"),[]).then(s=>s.TagAutoInterpolationBracket)});gt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>lt(()=>import("./go-O9LJTZXk.js"),[])});gt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>lt(()=>import("./graphql-LQdxqEYJ.js"),[])});gt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>lt(()=>import("./handlebars-YuGUIDI6.js"),[])});gt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>lt(()=>import("./hcl-DxDQ3s82.js"),[])});gt({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>lt(()=>import("./html-Bymr0Pmu.js"),[])});gt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>lt(()=>import("./ini-BvajGCUy.js"),[])});gt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>lt(()=>import("./java-SYsfObOQ.js"),[])});gt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>lt(()=>import("./javascript-DNveax_C.js"),__vite__mapDeps([0,1]))});gt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>lt(()=>import("./julia-DQXNmw_w.js"),[])});gt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>lt(()=>import("./kotlin-qQ0MG-9I.js"),[])});gt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>lt(()=>import("./less-GGFNNJHn.js"),[])});gt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>lt(()=>import("./lexon-Canl7DCW.js"),[])});gt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>lt(()=>import("./lua-D28Ae8-K.js"),[])});gt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>lt(()=>import("./liquid-BJOeA7Xj.js"),[])});gt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>lt(()=>import("./m3-DPitgjJI.js"),[])});gt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>lt(()=>import("./markdown-B811l8j2.js"),[])});gt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>lt(()=>import("./mdx-wQMBXlam.js"),[])});gt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>lt(()=>import("./mips-CdjsipkG.js"),[])});gt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>lt(()=>import("./msdax-CYqgjx_P.js"),[])});gt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>lt(()=>import("./mysql-BHd6q0vd.js"),[])});gt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>lt(()=>import("./objective-c-B1aVtJYH.js"),[])});gt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>lt(()=>import("./pascal-BhNW15KB.js"),[])});gt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>lt(()=>import("./pascaligo-5jv8CcQD.js"),[])});gt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>lt(()=>import("./perl-DlYyT36c.js"),[])});gt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>lt(()=>import("./pgsql-Dy0bjov7.js"),[])});gt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>lt(()=>import("./php-120yhfDK.js"),[])});gt({id:"pla",extensions:[".pla"],loader:()=>lt(()=>import("./pla-CjnFlu4u.js"),[])});gt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>lt(()=>import("./postiats-CQpG440k.js"),[])});gt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>lt(()=>import("./powerquery-DdJtto1Z.js"),[])});gt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>lt(()=>import("./powershell-Bu_VLpJB.js"),[])});gt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>lt(()=>import("./protobuf-IBS6jZEB.js"),[])});gt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>lt(()=>import("./pug-kFxLfcjb.js"),[])});gt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>lt(()=>import("./python-Dm8r6f9J.js"),[])});gt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>lt(()=>import("./qsharp-q7JyzKFN.js"),[])});gt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>lt(()=>import("./r-BIFz-_sK.js"),[])});gt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>lt(()=>import("./razor-DgEdGyIF.js"),[])});gt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>lt(()=>import("./redis-CHOsPHWR.js"),[])});gt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>lt(()=>import("./redshift-CBifECDb.js"),[])});gt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>lt(()=>import("./restructuredtext-CghPJEOS.js"),[])});gt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>lt(()=>import("./ruby-CYWGW-b1.js"),[])});gt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>lt(()=>import("./rust-DMDD0SHb.js"),[])});gt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>lt(()=>import("./sb-BYAiYHFx.js"),[])});gt({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>lt(()=>import("./scala-Bqvq8jcR.js"),[])});gt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>lt(()=>import("./scheme-Dhb-2j9p.js"),[])});gt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>lt(()=>import("./scss-CTwUZ5N7.js"),[])});gt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>lt(()=>import("./shell-CsDZo4DB.js"),[])});gt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>lt(()=>import("./solidity-CME5AdoB.js"),[])});gt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>lt(()=>import("./sophia-RYC1BQQz.js"),[])});gt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>lt(()=>import("./sparql-KEyrF7De.js"),[])});gt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>lt(()=>import("./sql-BdTr02Mf.js"),[])});gt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>lt(()=>import("./st-C7iG7M4S.js"),[])});gt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>lt(()=>import("./swift-D7IUmUK8.js"),[])});gt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>lt(()=>import("./systemverilog-DgMryOEJ.js"),[])});gt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>lt(()=>import("./systemverilog-DgMryOEJ.js"),[])});gt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>lt(()=>import("./tcl-PloMZuKG.js"),[])});gt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>lt(()=>import("./twig-BfRIq3la.js"),[])});gt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>lt(()=>import("./typescript-CJ_h9ueS.js"),[])});gt({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>lt(()=>import("./typespec-CzxlYoT_.js"),[])});gt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>lt(()=>import("./vb-BwAE3J76.js"),[])});gt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>lt(()=>import("./wgsl-B_1kOXbF.js"),[])});gt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>lt(()=>import("./xml-dtW8lexD.js"),[])});gt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>lt(()=>import("./yaml-B6ngX1LG.js"),[])});var eUe=Object.defineProperty,tUe=Object.getOwnPropertyDescriptor,iUe=Object.getOwnPropertyNames,nUe=Object.prototype.hasOwnProperty,sUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of iUe(e))!nUe.call(s,n)&&n!==t&&eUe(s,n,{get:()=>e[n],enumerable:!(i=tUe(e,n))||i.enumerable});return s},oUe=(s,e,t)=>(sUe(s,e,"default"),t),y1={};oUe(y1,rD);var Z$=class{constructor(e,t,i){this._onDidChange=new y1.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},X$={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},Q$={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},$he=new Z$("css",X$,Q$),qhe=new Z$("scss",X$,Q$),Khe=new Z$("less",X$,Q$);y1.languages.css={cssDefaults:$he,lessDefaults:Khe,scssDefaults:qhe};function J$(){return lt(()=>import("./cssMode-DcNi8U1f.js"),[])}y1.languages.onLanguage("less",()=>{J$().then(s=>s.setupMode(Khe))});y1.languages.onLanguage("scss",()=>{J$().then(s=>s.setupMode(qhe))});y1.languages.onLanguage("css",()=>{J$().then(s=>s.setupMode($he))});var rUe=Object.defineProperty,aUe=Object.getOwnPropertyDescriptor,lUe=Object.getOwnPropertyNames,cUe=Object.prototype.hasOwnProperty,dUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of lUe(e))!cUe.call(s,n)&&n!==t&&rUe(s,n,{get:()=>e[n],enumerable:!(i=aUe(e,n))||i.enumerable});return s},uUe=(s,e,t)=>(dUe(s,e,"default"),t),hP={};uUe(hP,rD);var hUe=class{constructor(e,t,i){this._onDidChange=new hP.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},fUe={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},fP={format:fUe,suggest:{},data:{useDefaultDataProvider:!0}};function gP(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===nx,documentFormattingEdits:s===nx,documentRangeFormattingEdits:s===nx}}var nx="html",ene="handlebars",tne="razor",Ghe=pP(nx,fP,gP(nx)),gUe=Ghe.defaults,Yhe=pP(ene,fP,gP(ene)),pUe=Yhe.defaults,Zhe=pP(tne,fP,gP(tne)),mUe=Zhe.defaults;hP.languages.html={htmlDefaults:gUe,razorDefaults:mUe,handlebarDefaults:pUe,htmlLanguageService:Ghe,handlebarLanguageService:Yhe,razorLanguageService:Zhe,registerHTMLLanguageService:pP};function _Ue(){return lt(()=>import("./htmlMode-DBCwqW9X.js"),[])}function pP(s,e=fP,t=gP(s)){const i=new hUe(s,e,t);let n;const o=hP.languages.onLanguage(s,async()=>{n=(await _Ue()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),n?.dispose(),n=void 0}}}var bUe=Object.defineProperty,vUe=Object.getOwnPropertyDescriptor,CUe=Object.getOwnPropertyNames,wUe=Object.prototype.hasOwnProperty,yUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of CUe(e))!wUe.call(s,n)&&n!==t&&bUe(s,n,{get:()=>e[n],enumerable:!(i=vUe(e,n))||i.enumerable});return s},SUe=(s,e,t)=>(yUe(s,e,"default"),t),aD={};SUe(aD,rD);var xUe=class{constructor(e,t,i){this._onDidChange=new aD.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},LUe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},kUe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Xhe=new xUe("json",LUe,kUe),DUe=()=>Qhe().then(s=>s.getWorker());aD.languages.json={jsonDefaults:Xhe,getWorker:DUe};function Qhe(){return lt(()=>import("./jsonMode-FNolO9rf.js"),[])}aD.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});aD.languages.onLanguage("json",()=>{Qhe().then(s=>s.setupMode(Xhe))});var EUe=Object.defineProperty,NUe=Object.getOwnPropertyDescriptor,IUe=Object.getOwnPropertyNames,TUe=Object.prototype.hasOwnProperty,RUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of IUe(e))!TUe.call(s,n)&&n!==t&&EUe(s,n,{get:()=>e[n],enumerable:!(i=NUe(e,n))||i.enumerable});return s},MUe=(s,e,t)=>(RUe(s,e,"default"),t),AUe="5.4.5",Ay={};MUe(Ay,rD);var Jhe=(s=>(s[s.None=0]="None",s[s.CommonJS=1]="CommonJS",s[s.AMD=2]="AMD",s[s.UMD=3]="UMD",s[s.System=4]="System",s[s.ES2015=5]="ES2015",s[s.ESNext=99]="ESNext",s))(Jhe||{}),efe=(s=>(s[s.None=0]="None",s[s.Preserve=1]="Preserve",s[s.React=2]="React",s[s.ReactNative=3]="ReactNative",s[s.ReactJSX=4]="ReactJSX",s[s.ReactJSXDev=5]="ReactJSXDev",s))(efe||{}),tfe=(s=>(s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s))(tfe||{}),ife=(s=>(s[s.ES3=0]="ES3",s[s.ES5=1]="ES5",s[s.ES2015=2]="ES2015",s[s.ES2016=3]="ES2016",s[s.ES2017=4]="ES2017",s[s.ES2018=5]="ES2018",s[s.ES2019=6]="ES2019",s[s.ES2020=7]="ES2020",s[s.ESNext=99]="ESNext",s[s.JSON=100]="JSON",s[s.Latest=99]="Latest",s))(ife||{}),nfe=(s=>(s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs",s))(nfe||{}),sfe=class{constructor(s,e,t,i,n){this._onDidChange=new Ay.Emitter,this._onDidExtraLibsChange=new Ay.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(s),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(s,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===s)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:s,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(s){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),s&&s.length>0)for(const e of s){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(s){this._compilerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(s){this._diagnosticsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(s){this._workerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(s){this._inlayHintsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(s){}setEagerModelSync(s){this._eagerModelSync=s}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(void 0)}},OUe=AUe,ofe={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},rfe=new sfe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},ofe),afe=new sfe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},ofe),PUe=()=>mP().then(s=>s.getTypeScriptWorker()),FUe=()=>mP().then(s=>s.getJavaScriptWorker());Ay.languages.typescript={ModuleKind:Jhe,JsxEmit:efe,NewLineKind:tfe,ScriptTarget:ife,ModuleResolutionKind:nfe,typescriptVersion:OUe,typescriptDefaults:rfe,javascriptDefaults:afe,getTypeScriptWorker:PUe,getJavaScriptWorker:FUe};function mP(){return lt(()=>import("./tsMode-C8gaaWwI.js"),[])}Ay.languages.onLanguage("typescript",()=>mP().then(s=>s.setupTypeScript(rfe)));Ay.languages.onLanguage("javascript",()=>mP().then(s=>s.setupJavaScript(afe)));class BUe extends Er{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Ct("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:ke.map,toggled:pe.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:pe.has("isInDiffEditor"),menu:{when:pe.has("isInDiffEditor"),id:Je.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(zt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class lfe extends Er{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Ct("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:pe.has("isInDiffEditor")})}run(e,...t){const i=e.get(zt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class cfe extends Er{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Ct("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:pe.has("isInDiffEditor")})}run(e,...t){const i=e.get(zt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const lD=Ct("diffEditor","Diff Editor");class WUe extends Pd{constructor(){super({id:"diffEditor.switchSide",title:Ct("switchSide","Switch Side"),icon:ke.arrowSwap,precondition:pe.has("isInDiffEditor"),f1:!0,category:lD})}runEditorCommand(e,t,i){const n=S1(e);if(n instanceof vf){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class HUe extends Pd{constructor(){super({id:"diffEditor.exitCompareMove",title:Ct("exitCompareMove","Exit Compare Move"),icon:ke.close,precondition:V.comparingMovedCode,f1:!1,category:lD,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=S1(e);n instanceof vf&&n.exitCompareMove()}}class VUe extends Pd{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Ct("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:ke.fold,precondition:pe.has("isInDiffEditor"),f1:!0,category:lD})}runEditorCommand(e,t,...i){const n=S1(e);n instanceof vf&&n.collapseAllUnchangedRegions()}}class zUe extends Pd{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Ct("showAllUnchangedRegions","Show All Unchanged Regions"),icon:ke.unfold,precondition:pe.has("isInDiffEditor"),f1:!0,category:lD})}runEditorCommand(e,t,...i){const n=S1(e);n instanceof vf&&n.showAllUnchangedRegions()}}class j6 extends Er{constructor(){super({id:"diffEditor.revert",title:Ct("revert","Revert"),f1:!1,category:lD})}run(e,t){const i=jUe(e,t.originalUri,t.modifiedUri);i instanceof vf&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const dfe=Ct("accessibleDiffViewer","Accessible Diff Viewer"),YA=class YA extends Er{constructor(){super({id:YA.id,title:Ct("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:dfe,precondition:pe.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){S1(e)?.accessibleDiffViewerNext()}};YA.id="editor.action.accessibleDiffViewer.next";let UL=YA;const ZA=class ZA extends Er{constructor(){super({id:ZA.id,title:Ct("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:dfe,precondition:pe.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){S1(e)?.accessibleDiffViewerPrev()}};ZA.id="editor.action.accessibleDiffViewer.prev";let tM=ZA;function jUe(s,e,t){return s.get(mi).listDiffEditors().find(o=>{const r=o.getModifiedEditor(),a=o.getOriginalEditor();return r&&r.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function S1(s){const t=s.get(mi).listDiffEditors(),i=Do();if(i)for(const n of t){const o=n.getContainerDomNode();if(UUe(o,i))return n}return null}function UUe(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}en(BUe);en(lfe);en(cfe);Qs.appendMenuItem(Je.EditorTitle,{command:{id:new cfe().desc.id,title:v("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:pe.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:pe.has("isInDiffEditor")},order:11,group:"1_diff",when:pe.and(V.diffEditorRenderSideBySideInlineBreakpointReached,pe.has("isInDiffEditor"))});Qs.appendMenuItem(Je.EditorTitle,{command:{id:new lfe().desc.id,title:v("showMoves","Show Moved Code Blocks"),icon:ke.move,toggled:o1.create("config.diffEditor.experimental.showMoves",!0),precondition:pe.has("isInDiffEditor")},order:10,group:"1_diff",when:pe.has("isInDiffEditor")});en(j6);for(const s of[{icon:ke.arrowRight,key:V.diffEditorInlineMode.toNegated()},{icon:ke.discard,key:V.diffEditorInlineMode}])Qs.appendMenuItem(Je.DiffEditorHunkToolbar,{command:{id:new j6().desc.id,title:v("revertHunk","Revert Block"),icon:s.icon},when:pe.and(V.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),Qs.appendMenuItem(Je.DiffEditorSelectionToolbar,{command:{id:new j6().desc.id,title:v("revertSelection","Revert Selection"),icon:s.icon},when:pe.and(V.diffEditorModifiedWritable,s.key),order:5,group:"primary"});en(WUe);en(HUe);en(VUe);en(zUe);Qs.appendMenuItem(Je.EditorTitle,{command:{id:UL.id,title:v("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:pe.has("isInDiffEditor")},order:10,group:"2_diff",when:pe.and(V.accessibleDiffViewerVisible.negate(),pe.has("isInDiffEditor"))});ai.registerCommandAlias("editor.action.diffReview.next",UL.id);en(UL);ai.registerCommandAlias("editor.action.diffReview.prev",tM.id);en(tM);var $Ue=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qUe=function(s,e){return function(t,i){e(t,i,s)}},U6;const _P=new He("selectionAnchorSet",!1);var A_;let Mp=(A_=class{static get(e){return e.getContribution(U6.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=_P.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(tt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Bo().appendText(v("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),kr(v("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(tt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},U6=A_,A_.ID="editor.contrib.selectionAnchorController",A_);Mp=U6=$Ue([qUe(1,vt)],Mp);class KUe extends $e{constructor(){super({id:"editor.action.setSelectionAnchor",label:v("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:V.editorTextFocus,primary:ys(2089,2080),weight:100}})}async run(e,t){Mp.get(t)?.setSelectionAnchor()}}class GUe extends $e{constructor(){super({id:"editor.action.goToSelectionAnchor",label:v("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:_P})}async run(e,t){Mp.get(t)?.goToSelectionAnchor()}}class YUe extends $e{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:v("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:_P,kbOpts:{kbExpr:V.editorTextFocus,primary:ys(2089,2089),weight:100}})}async run(e,t){Mp.get(t)?.selectFromAnchorToCursor()}}class ZUe extends $e{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:v("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:_P,kbOpts:{kbExpr:V.editorTextFocus,primary:9,weight:100}})}async run(e,t){Mp.get(t)?.cancelSelectionAnchor()}}di(Mp.ID,Mp,4);we(KUe);we(GUe);we(YUe);we(ZUe);const XUe=z("editorOverviewRuler.bracketMatchForeground","#A0A0A0",v("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class QUe extends $e{constructor(){super({id:"editor.action.jumpToBracket",label:v("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:V.editorTextFocus,primary:3165,weight:100}})}run(e,t){Hb.get(t)?.jumpToBracket()}}class JUe extends $e{constructor(){super({id:"editor.action.selectToBracket",label:v("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Ct("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){let n=!0;i&&i.selectBrackets===!1&&(n=!1),Hb.get(t)?.selectToBracket(n)}}class e$e extends $e{constructor(){super({id:"editor.action.removeBrackets",label:v("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:V.editorTextFocus,primary:2561,weight:100}})}run(e,t){Hb.get(t)?.removeBrackets(this.id)}}class t$e{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const vg=class vg extends oe{static get(e){return e.getContribution(vg.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Pi(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),o=e.bracketPairs.matchBracket(n);let r=null;if(o)o[0].containsPosition(n)&&!o[1].containsPosition(n)?r=o[1].getStartPosition():o[1].containsPosition(n)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new tt(r.lineNumber,r.column,r.lineNumber,r.column):new tt(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const o=n.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(A.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const u=a;a=l,l=u}}a&&l&&i.push(new tt(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let o=t.bracketPairs.matchBracket(n);o||(o=t.bracketPairs.findEnclosingBrackets(n)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const o=[];let r=0;for(let u=0,f=e.length;u<f;u++){const p=e[u];p.isEmpty()&&(o[r++]=p.getStartPosition())}o.length>1&&o.sort(ne.compare);const a=[];let l=0,c=0;const d=n.length;for(let u=0,f=o.length;u<f;u++){const p=o[u];for(;c<d&&n[c].position.isBefore(p);)c++;if(c<d&&n[c].position.equals(p))a[l++]=n[c];else{let m=t.bracketPairs.matchBracket(p,20),b=vg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(p,20),b=vg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new t$e(p,m,b)}}this._lastBracketsData=a,this._lastVersionId=i}};vg.ID="editor.contrib.bracketMatchingController",vg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Et.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Kn(XUe),position:ol.Center}}),vg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Et.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Hb=vg;di(Hb.ID,Hb,1);we(JUe);we(QUe);we(e$e);Qs.appendMenuItem(Je.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:v({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class i$e{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new A(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new A(i,o,i,o),a)}else{const r=new A(i,o,i,o+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new A(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new tt(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new tt(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class ufe extends $e{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const o of n)i.push(new i$e(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class n$e extends ufe{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:v("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:V.writable})}}class s$e extends ufe{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:v("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:V.writable})}}we(n$e);we(s$e);class o$e extends $e{constructor(){super({id:"editor.action.transposeLetters",label:v("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:V.writable,kbOpts:{kbExpr:V.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],o=t.getSelections();for(const r of o){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,c=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&c===2))continue;const d=l===c?r.getPosition():Ei.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),u=Ei.leftPosition(i,d),f=Ei.leftPosition(i,u),p=i.getValueInRange(A.fromPositions(f,u)),m=i.getValueInRange(A.fromPositions(u,d)),b=A.fromPositions(f,d);n.push(new ko(b,m+p))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}we(o$e);const bP=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){s(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,o="";return o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+="-",o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o+=t[e[n++]],o}})();function eq(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function r$e(s,e,t){const i={id:bP(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class hfe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return ri.some(this,([i,n])=>n.asFile())&&t.push("files"),gfe(iM(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return iM(e)}}function iM(s){return s.toLowerCase()}function ffe(s,e){return gfe(iM(s),e.map(iM))}function gfe(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,o]=t;return o==="*"?e.some(r=>r.startsWith(n+"/")):!1}const vP=Object.freeze({create:s=>uf(s.map(e=>e.toString())).join(`\r
|
|
721
721
|
`),split:s=>s.split(`\r
|
|
722
722
|
`),parse:s=>vP.split(s).filter(e=>!e.startsWith("#"))}),ru=class ru{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+ru.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new ru((this.value?[this.value,...e]:e).join(ru.sep))}};ru.sep=".",ru.None=new ru("@@none@@"),ru.Empty=new ru("");let En=ru;const ine={EDITORS:"CodeEditors",FILES:"CodeFiles"};class a$e{}const l$e={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Fn.add(l$e.DragAndDropContribution,new a$e);const Nx=class Nx{constructor(){}static getInstance(){return Nx.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};Nx.INSTANCE=new Nx;let $6=Nx;function pfe(s){const e=new hfe;for(const t of s.items){const i=t.type;if(t.kind==="string"){const n=new Promise(o=>t.getAsString(o));e.append(i,eq(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,c$e(n))}}return e}function c$e(s){const e=s.path?at.parse(s.path):void 0;return r$e(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}const d$e=Object.freeze([ine.EDITORS,ine.FILES,mL.RESOURCES,mL.INTERNAL_URI_LIST]);function mfe(s,e=!1){const t=pfe(s),i=t.get(mL.INTERNAL_URI_LIST);if(i)t.replace(ts.uriList,i);else if(e||!t.has(ts.uriList)){const n=[];for(const o of s.items){const r=o.getAsFile();if(r){const a=r.path;try{a?n.push(at.file(a).toString()):n.push(at.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(ts.uriList,eq(vP.create(n)))}for(const n of d$e)t.delete(n);return t}var tq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$L=function(s,e){return function(t,i){e(t,i,s)}};class iq{async provideDocumentPasteEdits(e,t,i,n,o){const r=await this.getEdit(i,o);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const o=await this.getEdit(i,n);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}}const Ix=class Ix extends iq{constructor(){super(...arguments),this.kind=Ix.kind,this.dropMimeTypes=[ts.text],this.pasteMimeTypes=[ts.text]}async getEdit(e,t){const i=e.get(ts.text);if(!i||e.has(ts.uriList))return;const n=await i.asString();return{handledMimeType:ts.text,title:v("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};Ix.id="text",Ix.kind=new En("text.plain");let Vb=Ix;class _fe extends iq{constructor(){super(...arguments),this.kind=new En("uri.absolute"),this.dropMimeTypes=[ts.uriList],this.pasteMimeTypes=[ts.uriList]}async getEdit(e,t){const i=await bfe(e);if(!i.length||t.isCancellationRequested)return;let n=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Dt.file?a.fsPath:(n++,l)).join(" ");let r;return n>0?r=i.length>1?v("defaultDropProvider.uriList.uris","Insert Uris"):v("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?v("defaultDropProvider.uriList.paths","Insert Paths"):v("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:ts.uriList,insertText:o,title:r,kind:this.kind}}}let nM=class extends iq{constructor(e){super(),this._workspaceContextService=e,this.kind=new En("uri.relative"),this.dropMimeTypes=[ts.uriList],this.pasteMimeTypes=[ts.uriList]}async getEdit(e,t){const i=await bfe(e);if(!i.length||t.isCancellationRequested)return;const n=Ac(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?hPe(r.uri,o):void 0}));if(n.length)return{handledMimeType:ts.uriList,insertText:n.join(" "),title:i.length>1?v("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):v("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};nM=tq([$L(0,Ab)],nM);class u$e{constructor(){this.kind=new En("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:ts.text}]}async provideDocumentPasteEdits(e,t,i,n,o){if(n.triggerKind!==Ux.PasteAs&&!n.only?.contains(this.kind))return;const a=await i.get("text/html")?.asString();if(!(!a||o.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:v("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function bfe(s){const e=s.get(ts.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of vP.parse(t))try{i.push({uri:at.parse(n),originalText:n})}catch{}return i}let q6=class extends oe{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Vb)),this._register(e.documentDropEditProvider.register("*",new _fe)),this._register(e.documentDropEditProvider.register("*",new nM(t)))}};q6=tq([$L(0,Ye),$L(1,Ab)],q6);let K6=class extends oe{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Vb)),this._register(e.documentPasteEditProvider.register("*",new _fe)),this._register(e.documentPasteEditProvider.register("*",new nM(t))),this._register(e.documentPasteEditProvider.register("*",new u$e))}};K6=tq([$L(0,Ye),$L(1,Ab)],K6);const vc=class vc{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=vc._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(vc.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(vc.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(vc.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(vc.isVariableCharacter(i)||vc.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof vc._table[i]>"u"&&!vc.isDigitCharacter(i)&&!vc.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};vc._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let G6=vc;class x1{constructor(){this._children=[]}appendChild(e){return e instanceof pr&&this._children[this._children.length-1]instanceof pr?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,(function r(a,l){for(const c of a)c.parent=l,r(c.children,c)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof cD)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class pr extends x1{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new pr(this.value)}}class vfe extends x1{}class Pl extends vfe{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof L1?this._children[0]:void 0}clone(){const e=new Pl(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class L1 extends x1{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof pr&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new L1;return this.options.forEach(e.appendChild,e),e}}class nq extends x1{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof rd&&!!o.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof rd){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new nq;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class rd extends x1{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new rd(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class qL extends vfe{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new pr(t)],!0):!1}clone(){const e=new qL(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function nne(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class cD extends x1{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Pl&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return nne([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Pl&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof qL&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new cD;return this._children=this.children.map(t=>t.clone()),e}walk(e){nne(this.children,e)}}class zb{constructor(){this._scanner=new G6,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new cD;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,o=[];t.walk(l=>(l instanceof Pl&&(l.isFinalTabstop?n.set(0,void 0):!n.has(l.index)&&l.children.length>0?n.set(l.index,l.children):o.push(l)),!0));const r=(l,c)=>{const d=n.get(l.index);if(!d)return;const u=new Pl(l.index);u.transform=l.transform;for(const f of d){const p=f.clone();u.appendChild(p),p instanceof Pl&&n.has(p.index)&&!c.has(p.index)&&(c.add(p.index),r(p,c),c.delete(p.index))}t.replace(l,[u])},a=new Set;for(const l of o)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Pl(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new pr(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Pl(Number(t)):new qL(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new Pl(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new pr("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new L1;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(r),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new pr(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new qL(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new pr("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new nq;let i="",n="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new pr(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new rd(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new rd(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new rd(Number(n),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new rd(Number(n),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new rd(Number(n),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const r=this._until(4);if(r)return e.appendChild(new rd(Number(n),void 0,o,r)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new rd(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new pr(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function Cfe(s,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new Gg(s,{range:i,text:typeof t.insertText=="string"?zb.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function wfe(s){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of s)for(const a of r.yieldTo??[])for(const l of s)if(l!==r&&e(a,l)){let c=t.get(r);c||(c=[],t.set(r,c)),c.push(l)}if(!t.size)return Array.from(s);const i=new Set,n=[];function o(r){if(!r.length)return[];const a=r[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return o(r.slice(1));let l=[];const c=t.get(a);return c&&(n.push(a),l=o(c),n.pop()),i.add(a),[...l,a,...o(r.slice(1))]}return o(Array.from(s))}var h$e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},f$e=function(s,e){return function(t,i){e(t,i,s)}};const g$e=Et.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Gae,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),XA=class XA extends oe{constructor(e,t,i,n,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=Ee(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Ee("span.icon");this.domNode.append(t),t.classList.add(..._t.asClassNameArray(ke.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(67))&&i()})),this._register(ue(this.domNode,De.CLICK,n=>{this.delegate.cancel()}))}getId(){return XA.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};XA.baseId="editor.widget.inlineProgressWidget";let Y6=XA,sM=class extends oe{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new zs),this._currentWidget=this._register(new zs),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,o){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=yp(()=>{const a=A.fromPositions(e);this._currentDecorations.set([{range:a,options:g$e}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Y6,this.id,this._editor,a,t,n))},o??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};sM=h$e([f$e(2,rt)],sM);var p$e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sne=function(s,e){return function(t,i){e(t,i,s)}},MI,Jg;let wa=(Jg=class{static get(e){return e.getContribution(MI.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new zs,this._messageListeners=new ge,this._mouseOverMessage=!1,this._editor=e,this._visible=MI.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._message?.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){kr(xd(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=xd(e)?WO(e,{actionHandler:{callback:n=>{this.closeMessage(),yU(this._openerService,n,xd(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new one(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Te.debounce(this._editor.onDidBlurEditorText,(n,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Bs(Do(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(ue(this._messageWidget.value.getDomNode(),De.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ue(this._messageWidget.value.getDomNode(),De.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new A(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(one.fadeOut(this._messageWidget.value))}},MI=Jg,Jg.ID="editor.contrib.messageController",Jg.MESSAGE_VISIBLE=new He("messageVisible",!1,v("messageVisible","Whether the editor is currently showing an inline message")),Jg);wa=MI=p$e([sne(1,vt),sne(2,Xr)],wa);const m$e=Ms.bindToContribution(wa.get);Fe(new m$e({id:"leaveEditorMessage",precondition:wa.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:130,primary:9}}));let one=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};di(wa.ID,wa,4);function Q3(s,e){return e&&(s.stack||s.stacktrace)?v("stackTrace.format","{0}: {1}",ane(s),rne(s.stack)||rne(s.stacktrace)):ane(s)}function rne(s){return Array.isArray(s)?s.join(`
|
|
723
723
|
`):s}function ane(s){return s.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${s.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof s.code=="string"&&typeof s.errno=="number"&&typeof s.syscall=="string"?v("nodeExceptionMessage","A system error occurred ({0})",s.message):s.message||v("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function oM(s=null,e=!1){if(!s)return v("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(s)){const t=Ac(s),i=oM(t[0],e);return t.length>1?v("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(zr(s))return s;if(s.detail){const t=s.detail;if(t.error)return Q3(t.error,e);if(t.exception)return Q3(t.exception,e)}return s.stack?Q3(s,e):s.message?s.message:v("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var yfe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$w=function(s,e){return function(t,i){e(t,i,s)}},Z6,O_;let X6=(O_=class extends oe{constructor(e,t,i,n,o,r,a,l,c,d){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=o,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(ot(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(ot((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(u=>{o.containsPosition(u.position)||this.dispose()})),this._register(Te.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=Ee(".post-edit-widget"),this.button=this._register(new uR(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ue(this.domNode,De.CLICK,()=>this.showSelector()))}getId(){return Z6.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=is(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>g_({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},Z6=O_,O_.baseId="editor.widget.postEditWidget",O_);X6=Z6=yfe([$w(7,Ea),$w(8,vt),$w(9,Li)],X6);let rM=class extends oe{constructor(e,t,i,n,o,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=o,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new zs),this._register(Te.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,o){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async C=>{const y=this._editor.getModel();y&&(await y.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:C,allEdits:t.allEdits},i,n,o))},c=(C,y)=>{ec(C)||(this._notificationService.error(y),i&&this.show(e[0],t,l))};let d;try{d=await n(a,o)}catch(C){return c(C,v("resolveError",`Error resolving edit '{0}':
|
|
@@ -787,4 +787,4 @@ ${e.toString()}`}}class kR{constructor(e=new v1,t=!1,i,n=B7e){this._services=e,t
|
|
|
787
787
|
`)].join(`
|
|
788
788
|
`)}function iit(s,e){return["RUN_HANDLE='paste-run-handle-here'",[`curl -sS -X POST ${Wpe(`${s}/runs/$RUN_HANDLE/stop`)}`,` -H ${sw(`Authorization: Bearer ${e}`)}`].join(` \\
|
|
789
789
|
`)].join(`
|
|
790
|
-
`)}function MB({title:s,command:e,onCopy:t}){return x.jsxs("section",{className:"workflow-api-card",children:[x.jsxs("div",{className:"workflow-api-card-title-row",children:[x.jsx("h3",{children:s}),x.jsx("button",{type:"button",onClick:()=>t(e,s),disabled:!e,children:"Copy"})]}),x.jsx("pre",{children:e})]})}function nit(){const{slug:s=""}=Qb(),e=Io(),t=Ss(),i=t.loading?null:t.token,[n,o]=F.useState(!0),[r,a]=F.useState(!1),[l,c]=F.useState(null),[d,u]=F.useState(null),[f,p]=F.useState(null),[m,b]=F.useState(""),[C,y]=F.useState([]);Da("Workflow API");const S=F.useMemo(()=>i?{Authorization:`Bearer ${i}`}:void 0,[i]),L=F.useCallback(async()=>{if(S){o(!0),u(null);try{const[ee,G]=await Promise.all([xt.get(`/api/workflows/${encodeURIComponent(s)}`,{headers:S}),xt.get(`/api/workflows/${encodeURIComponent(s)}/api-keys`,{headers:S})]);p(ee.data.workflow);const te=G.data;b(te.api_base_url),y(te.api_keys)}catch(ee){u(RB(ee,"Failed to load workflow API details"))}finally{o(!1)}}},[S,s]);F.useEffect(()=>{L()},[L]);const k=async()=>{if(S){a(!0);try{const ee=await xt.post(`/api/workflows/${encodeURIComponent(s)}/api-keys`,{},{headers:S});y(G=>[...G,ee.data.api_key]),et.success("API key created")}catch(ee){et.error(RB(ee,"Failed to create API key"))}finally{a(!1)}}},N=async ee=>{if(S){c(ee);try{await xt.delete(`/api/workflows/${encodeURIComponent(s)}/api-keys/${encodeURIComponent(ee)}`,{headers:S}),y(G=>G.filter(te=>te.id!==ee)),et.success("API key removed")}catch(G){et.error(RB(G,"Failed to remove API key"))}finally{c(null)}}},I=(ee,G)=>{ee&&navigator.clipboard.writeText(ee).then(()=>{et.success(`${G} copied`)}).catch(()=>{et.error(`Failed to copy ${G.toLowerCase()}`)})};if(t.loading)return null;const T=C[0]?.api_key??"",O=f?.manifest.inputs??{},M=f&&T?eit(m,T,f.slug,O):"",B=T?tit(m,T):"",W=T?iit(m,T):"",j=JSON.stringify(O,null,2);return x.jsxs("div",{className:"workflow-api-page",children:[x.jsxs("header",{className:"workflow-api-header",children:[x.jsx("button",{className:"workflow-api-back-btn",onClick:()=>e("/?tab=workflows"),children:"Back to Workflows"}),x.jsx("h1",{children:"Workflow API"})]}),n&&x.jsx("div",{className:"workflow-api-state",children:"Loading workflow API details..."}),d&&x.jsx("div",{className:"workflow-api-state error",children:d}),!n&&!d&&f&&x.jsxs("div",{className:"workflow-api-content",children:[x.jsxs("section",{className:"workflow-api-card",children:[x.jsx("h2",{children:f.name||f.slug}),x.jsx("p",{children:"Use this workflow from another backend process with a workflow API key."})]}),x.jsx(MB,{title:"Run Command",command:M,onCopy:I}),x.jsx(MB,{title:"Status Command",command:B,onCopy:I}),x.jsx(MB,{title:"Stop Command",command:W,onCopy:I}),x.jsxs("section",{className:"workflow-api-card",children:[x.jsx("h3",{children:"Input Schema"}),x.jsx("pre",{children:j})]}),x.jsxs("section",{className:"workflow-api-card",children:[x.jsxs("div",{className:"workflow-api-card-title-row",children:[x.jsx("h3",{children:"API Keys"}),x.jsx("button",{type:"button",onClick:()=>{k()},disabled:r,children:r?"Creating...":"Add Key"})]}),x.jsx("div",{className:"workflow-api-key-list",children:C.map(ee=>x.jsxs("div",{className:"workflow-api-key-row",children:[x.jsx("code",{children:ee.api_key}),x.jsx("button",{type:"button",onClick:()=>{N(ee.id)},disabled:l===ee.id||C.length<=1,children:l===ee.id?"Removing...":"Remove"})]},ee.id))})]})]})]})}function sit(s){const e=s.match(/enter code:\s*(.+)$/i);return!e||!e[1]?"":e[1].trim()}function tA(s){const e=s.toLowerCase();return e==="google-vertex"||e.startsWith("google-vertex-")}function oit(s){return s==="azure-openai"||tA(s)}function Kse(s,e){return e==="anthropic"&&s.type==="oauth"?!1:s.type!=="oauth"?!0:!s.label.toLowerCase().includes("browser")}function rit(s,e){const t=e.split("/").slice(1).join("/");return s==="azure-openai"?[{key:"AZURE_API_KEY",value:"abc123xyz",help:"API key for the Azure OpenAI resource."},{key:"AZURE_OPENAI_ENDPOINT",value:"https://my-resource.openai.azure.com/",help:"Base endpoint for the Azure OpenAI resource."},{key:"OPENCODE_MODEL",value:`azure-openai/${t}`,help:"Provider id plus the Azure deployment name."}]:tA(s)?[{key:"GOOGLE_CLOUD_PROJECT",value:"my-gcp-project-id",help:"Google Cloud project ID."},{key:"GOOGLE_APPLICATION_CREDENTIALS",value:"/path/to/service-account.json",help:"Path to a Google Cloud service account JSON key file (readable by this process)."},{key:"VERTEX_LOCATION",value:"global",help:"Vertex AI region or endpoint (for example global or us-central1). Must be set explicitly."},{key:"OPENCODE_MODEL",value:e,help:"OpenCode Vertex provider prefix plus model id (for example google-vertex/... or google-vertex-anthropic/...)."}]:[]}function ait(){const s=Ss(),e=s.loading?null:s.token,t=Io();Da("OpenCode Auth Setup");const[i,n]=F.useState(null),[o,r]=F.useState(null),[a,l]=F.useState(""),[c,d]=F.useState(null),[u,f]=F.useState(""),[p,m]=F.useState(""),[b,C]=F.useState(!0),y=F.useRef(null),S=F.useMemo(()=>i?i.methods.filter(X=>Kse(X,i.provider_id)):[],[i]),L=F.useMemo(()=>e?{Authorization:`Bearer ${e}`}:void 0,[e]);function k(X,re){const J=X instanceof Hi?X.response?.data?.message||X.response?.data||X.message:re;return typeof J=="string"?J:re}const N=F.useMemo(()=>o===null?null:S.find(X=>X.index===o)||null,[S,o]),I=c?.method==="code",T=c?.method==="auto",O=c?sit(c.instructions):"",M=!I&&!!(i&&oit(i.provider_id)),B=i?rit(i.provider_id,i.model):[];function W(){y.current&&(y.current.abort(),y.current=null),d(null),f("")}const j=F.useCallback(async()=>{if(e){C(!0);try{const X=await xt.get("/api/opencode-auth/status",{headers:L}),re=X.data.methods.filter(J=>Kse(J,X.data.provider_id));n({...X.data,methods:re}),m(""),r(J=>J!==null&&re.some(H=>H.index===J)?J:re[0]?.index??null)}catch(X){m(k(X,"Failed to load opencode auth status"))}finally{C(!1)}}},[L,e]);F.useEffect(()=>{j()},[j]),F.useEffect(()=>()=>{y.current&&(y.current.abort(),y.current=null)},[]);const ee=async()=>{if(!(!e||o===null)){if(!a){et.error("API key is required");return}try{await xt.post("/api/opencode-auth/api",{key:a},{headers:L}),l(""),et.success("API key saved"),t("/opencode-auth/complete",{replace:!0})}catch(X){et.error(k(X,"Failed to save API key"))}}},G=async()=>{if(!(!e||o===null))try{const X=await xt.post("/api/opencode-auth/oauth/authorize",{method:o},{headers:L});if(d(X.data),window.open(X.data.url,"_blank","noopener,noreferrer"),X.data.method==="auto"){const re=new AbortController;y.current=re;try{await xt.post("/api/opencode-auth/oauth/callback",{method:o},{headers:L,timeout:12e4,signal:re.signal}),W(),et.success("OAuth connected"),t("/opencode-auth/complete",{replace:!0})}catch(J){if(J instanceof Hi&&J.code==="ERR_CANCELED")return;et.error(k(J,"Failed to complete OAuth flow"))}finally{y.current===re&&(y.current=null)}}}catch(X){et.error(k(X,"Failed to start OAuth flow"))}},te=async()=>{if(!(!e||o===null||!c)){if(c.method==="code"&&!u){et.error("Authorization code is required");return}try{await xt.post("/api/opencode-auth/oauth/callback",{method:o,code:c.method==="code"?u:void 0},{headers:L}),W(),et.success("OAuth connected"),t("/opencode-auth/complete",{replace:!0})}catch(X){et.error(k(X,"Failed to complete OAuth flow"))}}},Z=async X=>{X.key==="Enter"&&(X.preventDefault(),await te())};return b?x.jsx("div",{className:"opencode-auth-page",children:x.jsx("p",{className:"opencode-auth-loading",children:"Checking opencode credentials..."})}):p?x.jsx("div",{className:"opencode-auth-page",children:x.jsxs("section",{className:"opencode-auth-panel",children:[x.jsx("h1",{children:"Model Authentication Setup"}),x.jsx("p",{className:"opencode-auth-error",children:p})]})}):i?T?x.jsx("div",{className:"opencode-auth-page",children:x.jsxs("section",{className:"opencode-auth-panel opencode-auth-panel-minimal",children:[x.jsx("header",{className:"opencode-auth-header opencode-auth-header-minimal",children:x.jsxs("div",{children:[x.jsx("h1",{children:"Model Authentication Setup"}),x.jsx("p",{className:"opencode-auth-subtitle",children:"Enter this device code in the opened OAuth page."})]})}),x.jsxs("div",{className:"opencode-auth-oauth-state",children:[x.jsx("label",{htmlFor:"opencode-device-code",children:"Device Code"}),x.jsx("input",{id:"opencode-device-code",type:"text",value:O,readOnly:!0}),x.jsx("p",{className:"opencode-auth-waiting",children:"Waiting for OAuth completion..."}),x.jsx("button",{type:"button",className:"opencode-auth-secondary",onClick:W,children:"Go back"})]})]})}):x.jsx("div",{className:"opencode-auth-page",children:x.jsxs("section",{className:"opencode-auth-panel",children:[x.jsxs("header",{className:"opencode-auth-header",children:[x.jsxs("div",{children:[x.jsx("h1",{children:"Model Authentication Setup"}),x.jsx("p",{className:"opencode-auth-subtitle",children:M?x.jsxs(x.Fragment,{children:["This model is configured at the service level for ",x.jsx("strong",{children:i.model})]}):x.jsxs(x.Fragment,{children:["Configure credentials for ",x.jsx("strong",{children:i.model})]})}),x.jsxs("p",{className:"opencode-auth-meta",children:["Provider: ",x.jsx("code",{children:i.provider_id})]})]}),x.jsx("div",{className:`opencode-auth-badge ${i.has_credentials?"is-connected":"is-required"}`,children:i.has_credentials?"Connected":M?"Admin Managed":"Setup Required"})]}),I&&x.jsxs("section",{className:"opencode-auth-section",children:[x.jsx("h2",{children:"Enter Authorization Code"}),x.jsxs("div",{className:"opencode-auth-card",children:[x.jsx("label",{htmlFor:"opencode-oauth-code",children:"Authorization Code"}),x.jsx("input",{id:"opencode-oauth-code",type:"text",value:u,onChange:X=>f(X.target.value),onKeyDown:Z,placeholder:"Paste authorization code and press Enter"}),x.jsx("button",{type:"button",onClick:te,children:"Submit code"}),x.jsx("button",{type:"button",className:"opencode-auth-secondary",onClick:W,children:"Go back"})]})]}),!I&&x.jsxs("section",{className:"opencode-auth-section",children:[x.jsx("h2",{children:M?"Service Configuration":"Choose auth method"}),S.length===0&&!M&&x.jsxs("p",{className:"opencode-auth-error",children:["No auth methods are available for provider ",x.jsx("code",{children:i.provider_id}),"."]}),M&&x.jsxs("div",{className:"opencode-auth-card opencode-auth-managed-card",children:[x.jsx("div",{className:"opencode-auth-card-header opencode-auth-managed-header",children:x.jsxs("div",{children:[x.jsx("h3",{children:"Managed By Administrator"}),x.jsx("p",{className:"opencode-auth-help",children:"This provider is read-only in TeamCopilot."})]})}),x.jsxs("div",{className:"opencode-auth-managed-layout",children:[x.jsx("p",{className:"opencode-auth-managed-intro",children:i.provider_id==="azure-openai"?x.jsx(x.Fragment,{children:"Azure OpenAI is configured through service environment variables. To update this model, ask the service administrator to change the values below and restart TeamCopilot."}):tA(i.provider_id)?x.jsx(x.Fragment,{children:"Google Vertex requires GOOGLE_CLOUD_PROJECT, GOOGLE_APPLICATION_CREDENTIALS, VERTEX_LOCATION, and OPENCODE_MODEL set in server environment variables. Ask the administrator to update the values below and restart TeamCopilot."}):x.jsxs(x.Fragment,{children:["This provider is managed through service environment variables. Ask the administrator which values to configure for"," ",x.jsx("code",{children:i.provider_id})," and restart TeamCopilot after they update the deployment."]})}),x.jsxs("div",{className:"opencode-auth-managed-example-block",children:[x.jsxs("div",{className:"opencode-auth-managed-example-header",children:[x.jsx("h4",{children:"Required Values"}),x.jsx("p",{children:i.provider_id==="azure-openai"?"Use your Azure deployment name in OPENCODE_MODEL":tA(i.provider_id)?"Use your OpenCode Vertex model id in OPENCODE_MODEL":`Set OPENCODE_MODEL for provider ${i.provider_id} plus any required service env vars.`})]}),x.jsx("div",{className:"opencode-auth-managed-example-list",children:B.length===0?x.jsx("p",{className:"opencode-auth-help",children:"No env examples are shown for this provider. Ask your administrator which variables apply."}):B.map(X=>x.jsxs("div",{className:"opencode-auth-managed-example-row",children:[x.jsx("div",{className:"opencode-auth-managed-example-copy",children:x.jsxs("code",{children:[X.key,"=",X.value]})}),x.jsx("p",{children:X.help})]},X.key))})]})]})]}),S.length>0&&x.jsx("div",{className:"opencode-auth-method-grid",children:S.map(X=>x.jsxs("button",{type:"button",className:`opencode-auth-method ${o===X.index?"is-selected":""}`,onClick:()=>{r(X.index),d(null),f("")},children:[x.jsx("span",{className:"opencode-auth-method-label",children:X.label}),x.jsx("span",{className:"opencode-auth-method-type",children:X.type.toUpperCase()})]},X.index))})]}),!I&&N?.type==="api"&&x.jsxs("section",{className:"opencode-auth-section",children:[x.jsx("h2",{children:"API key"}),x.jsx("p",{className:"opencode-auth-help",children:"Paste the API key for your selected provider and save it."}),x.jsxs("div",{className:"opencode-auth-card",children:[x.jsx("label",{htmlFor:"opencode-api-key",children:"Provider API Key"}),x.jsx("input",{id:"opencode-api-key",type:"password",value:a,onChange:X=>l(X.target.value),placeholder:"Paste API key"}),x.jsx("button",{type:"button",onClick:ee,children:"Save API Key"})]})]}),!I&&N?.type==="oauth"&&x.jsxs("section",{className:"opencode-auth-section",children:[x.jsx("h2",{children:"OAuth"}),!T&&x.jsx("p",{className:"opencode-auth-help",children:"Use OAuth login for subscription-backed access (for example Pro/Max plans)."}),x.jsx("div",{className:"opencode-auth-card",children:!T&&x.jsx("button",{type:"button",onClick:G,children:"Start OAuth"})})]})]})}):null}function lit(){const s=Io();return Da("OpenCode Auth Complete"),x.jsx("div",{className:"opencode-auth-complete-page",children:x.jsxs("section",{className:"opencode-auth-complete-card",children:[x.jsx("h1",{children:"Authentication Complete"}),x.jsx("p",{children:"Your model credentials are configured successfully."}),x.jsx("button",{type:"button",onClick:()=>s("/"),children:"Continue to dashboard"})]})})}function Gse(s,e){const t=s instanceof Hi?s.response?.data?.message||s.response?.data||s.message:e;return typeof t=="string"?t:e}function cit(){const s=Ss(),e=s.loading?null:s.token,t=Io(),i=!s.loading&&s.user?.role==="Engineer",[n,o]=F.useState(""),[r,a]=F.useState(!0),[l,c]=F.useState(!1),[d,u]=F.useState("");Da("Global AI Instructions");const f=F.useCallback(async()=>{if(!e||!i){a(!1);return}a(!0),u("");try{const m=await xt.get("/api/chat/user-instructions",{headers:{Authorization:`Bearer ${e}`}});o(typeof m.data?.content=="string"?m.data.content:"")}catch(m){u(Gse(m,"Failed to load global AI instructions"))}finally{a(!1)}},[i,e]);F.useEffect(()=>{f()},[f]);const p=async()=>{if(!(!e||!i)){c(!0);try{await xt.put("/api/chat/user-instructions",{content:n},{headers:{Authorization:`Bearer ${e}`}}),u(""),et.success("Global AI instructions saved")}catch(m){et.error(Gse(m,"Failed to save global AI instructions"))}finally{c(!1)}}};return F.useEffect(()=>{const m=b=>{(b.metaKey||b.ctrlKey)&&b.key.toLowerCase()==="s"&&(b.preventDefault(),!r&&!l&&p())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[p,r,l]),s.loading?null:i?x.jsx("div",{className:"user-instructions-page",children:x.jsxs("div",{className:"user-instructions-card",children:[x.jsxs("div",{className:"user-instructions-header",children:[x.jsxs("div",{children:[x.jsx("h1",{children:"Global AI instructions"}),x.jsxs("p",{children:["These are saved to ",x.jsx("code",{children:"USER_INSTRUCTIONS.md"})," at the workspace root and apply immediately."]})]}),x.jsxs("div",{className:"user-instructions-actions",children:[x.jsx("button",{type:"button",className:"secondary",onClick:()=>t("/?tab=ai"),children:"Back to AI chat"}),x.jsx("button",{type:"button",onClick:()=>{p()},disabled:r||l,children:"Save"})]})]}),d?x.jsx("div",{className:"user-instructions-error",children:d}):null,x.jsx("textarea",{className:"user-instructions-editor",value:n,onChange:m=>o(m.target.value),placeholder:r?"Loading...":"Add custom instructions for the AI agent here. You can tell it about your organisation, target audience, team members, anything on how it should behave, or what it should restrict.",disabled:r||l,spellCheck:!1})]})}):x.jsx("div",{className:"user-instructions-page",children:x.jsxs("div",{className:"user-instructions-card",children:[x.jsx("h1",{children:"Global AI instructions"}),x.jsx("p",{children:"Only engineers can modify global AI instructions."}),x.jsx("div",{className:"user-instructions-actions",children:x.jsx("button",{type:"button",className:"secondary",onClick:()=>t("/?tab=ai"),children:"Back to AI chat"})})]})})}function AB(s,e){return s instanceof Hi?String(s.response?.data?.message||s.response?.data||s.message):e}function Yse(s){return[...s].sort((e,t)=>e.key.localeCompare(t.key))}function dit(){const s=Ss(),e=Io(),t=s.loading?null:s.token,i=!s.loading&&s.user?.role==="Engineer",n=F.useMemo(()=>t?{Authorization:`Bearer ${t}`}:void 0,[t]),[o,r]=F.useState(!0),[a,l]=F.useState(null),[c,d]=F.useState([]),[u,f]=F.useState([]),[p,m]=F.useState(""),[b,C]=F.useState(""),[y,S]=F.useState(""),[L,k]=F.useState(""),[N,I]=F.useState(null),[T,O]=F.useState(null);Da("Profile Secrets");const M=F.useCallback(async()=>{if(n){r(!0),l(null);try{const j=xt.get("/api/users/me/secrets",{headers:n}),ee=xt.get("/api/secrets/global",{headers:n}),[G,te]=await Promise.all([j,ee]);d(Yse(G.data.secrets||[])),f(Yse(te.data.secrets||[]))}catch(j){l(AB(j,"Failed to load secrets"))}finally{r(!1)}}},[n,i]);F.useEffect(()=>{M()},[M]);const B=async j=>{if(!n)return;const ee=j==="user"?p:y,G=j==="user"?b:L,te=ee.trim().toUpperCase();if(!te||!G){et.error("Both key and value are required");return}I(j);try{await xt.put(j==="user"?`/api/users/me/secrets/${encodeURIComponent(te)}`:`/api/secrets/global/${encodeURIComponent(te)}`,{value:G},{headers:n}),et.success(j==="user"?"Personal secret saved":"Global secret saved"),j==="user"?(m(""),C("")):(S(""),k("")),await M()}catch(Z){et.error(AB(Z,"Failed to save secret"))}finally{I(null)}},W=async(j,ee)=>{if(n){O(`${j}:${ee}`);try{await xt.delete(j==="user"?`/api/users/me/secrets/${encodeURIComponent(ee)}`:`/api/secrets/global/${encodeURIComponent(ee)}`,{headers:n}),et.success(j==="user"?"Personal secret deleted":"Global secret deleted"),await M()}catch(G){et.error(AB(G,"Failed to delete secret"))}finally{O(null)}}};return s.loading?null:x.jsx("div",{className:"profile-secrets-page",children:x.jsxs("div",{className:"profile-secrets-card",children:[x.jsxs("div",{className:"profile-secrets-header",children:[x.jsxs("div",{children:[x.jsx("h1",{children:"Profile Secrets"}),x.jsx("p",{children:"Workflows and skills can require secret keys. Your personal secrets override engineer-managed global secrets with the same key."})]}),x.jsx("div",{className:"profile-secrets-actions",children:x.jsx("button",{type:"button",className:"secondary",onClick:()=>e("/"),children:"Back Home"})})]}),o&&x.jsx("div",{className:"profile-secrets-state",children:"Loading secrets..."}),a&&x.jsx("div",{className:"profile-secrets-error",children:a}),!o&&!a&&x.jsxs(x.Fragment,{children:[x.jsxs("section",{className:"profile-secrets-section",children:[x.jsx("div",{className:"profile-secrets-section-header",children:x.jsxs("div",{children:[x.jsx("h2",{children:"My Secrets"}),x.jsx("p",{children:"Visible only to you in masked form. Re-saving the same key replaces its value."})]})}),x.jsxs("div",{className:"profile-secrets-form",children:[x.jsx("input",{type:"text",name:"user-secret-key",autoComplete:"off",placeholder:"OPENAI_API_KEY",value:p,onChange:j=>m(j.target.value.toUpperCase())}),x.jsx("input",{type:"password",name:"user-secret-value",autoComplete:"new-password",placeholder:"Secret value",value:b,onChange:j=>C(j.target.value)}),x.jsx("button",{type:"button",onClick:()=>{B("user")},disabled:N!==null,children:N==="user"?"Saving...":"Save Secret"})]}),x.jsx("div",{className:"profile-secrets-list",children:c.length===0?x.jsx("div",{className:"profile-secrets-empty",children:"No personal secrets saved yet."}):c.map(j=>x.jsxs("div",{className:"profile-secrets-item",children:[x.jsxs("div",{children:[x.jsx("div",{className:"profile-secrets-item-key",children:j.key}),x.jsxs("div",{className:"profile-secrets-item-meta",children:[j.value," · Updated ",new Date(j.updated_at).toLocaleString()]})]}),x.jsx("button",{type:"button",className:"danger",onClick:()=>{W("user",j.key)},disabled:T===`user:${j.key}`,children:T===`user:${j.key}`?"Deleting...":"Delete"})]},j.key))})]}),x.jsxs("section",{className:"profile-secrets-section",children:[x.jsx("div",{className:"profile-secrets-section-header",children:x.jsxs("div",{children:[x.jsx("h2",{children:"Global Secrets"}),x.jsxs("p",{children:["Shared fallback secrets managed by engineers. Usable by all users, but personal secrets with the same key override these.",i?"":" You can view these masked values, but only engineers can edit them."]})]})}),i&&x.jsxs("div",{className:"profile-secrets-form",children:[x.jsx("input",{type:"text",name:"global-secret-key",autoComplete:"off",placeholder:"SLACK_BOT_TOKEN",value:y,onChange:j=>S(j.target.value.toUpperCase())}),x.jsx("input",{type:"password",name:"global-secret-value",autoComplete:"new-password",placeholder:"Global secret value",value:L,onChange:j=>k(j.target.value)}),x.jsx("button",{type:"button",onClick:()=>{B("global")},disabled:N!==null,children:N==="global"?"Saving...":"Save Global Secret"})]}),x.jsx("div",{className:"profile-secrets-list",children:u.length===0?x.jsx("div",{className:"profile-secrets-empty",children:"No global secrets saved yet."}):u.map(j=>x.jsxs("div",{className:"profile-secrets-item",children:[x.jsxs("div",{children:[x.jsx("div",{className:"profile-secrets-item-key",children:j.key}),x.jsxs("div",{className:"profile-secrets-item-meta",children:[j.value," · Updated ",new Date(j.updated_at).toLocaleString()]})]}),i&&x.jsx("button",{type:"button",className:"danger",onClick:()=>{W("global",j.key)},disabled:T===`global:${j.key}`,children:T===`global:${j.key}`?"Deleting...":"Delete"})]},j.key))})]})]})]})})}const uit=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}],hit=["UTC","Asia/Calcutta","America/Los_Angeles","America/New_York","Europe/London","Europe/Berlin","Asia/Singapore","Asia/Tokyo","Australia/Sydney"];function Hpe(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function fit(){const s=Intl.supportedValuesOf,e=s?s("timeZone"):hit,t=Hpe();return Array.from(new Set([t,...e])).sort()}function git(s){const[e,t]=s.split(":").map(Number);return e*60+t}function pit(s){const t=Math.floor(9).toString().padStart(2,"0"),i=(540%60).toString().padStart(2,"0");return`${t}:${i}`}function mit(s,e){const t=s===1?e.slice(0,-1):e;return`${s} ${t}`}function _it(s){const e=git(s.time),t=e%60,i=Math.floor(e/60);return s.builderFrequency==="monthly"?`${t} ${i} ${s.day_of_month} * *`:s.builderFrequency==="weekly"?`${t} ${i} * * ${s.days_of_week.join(",")}`:`${t} ${i} * * *`}function Vpe(s=""){return{id:crypto.randomUUID(),content:s}}function bit(){return{name:"",targetMode:"prompt",prompt:"",execution_steps:[],enabled:!0,allow_workflow_runs_without_permission:!0,monitor_timeout_value:2,monitor_timeout_unit:"hours",workflow_slug:"",workflow_inputs:{},scheduleMode:"builder",cron_expression:"0 9 * * *",timezone:Hpe(),builderFrequency:"daily",time:"09:00",days_of_week:[1,2,3,4,5],day_of_month:1}}function vit(s,e={}){const t={};for(const[i,n]of Object.entries(s)){const o=e[i];n.type==="boolean"?t[i]=typeof o=="boolean"?o:n.default===!0:o!=null?t[i]=String(o):n.default!==void 0?t[i]=String(n.default):t[i]=""}return t}function Cit(s,e){const t={};for(const[i,n]of Object.entries(s)){const o=e[i];if(n.type==="boolean"){t[i]=!!o;continue}const a=(typeof o=="string"?o:String(o)).trim();if(a.length===0){if(n.required!==!1&&n.default===void 0)return et.error(`Missing required workflow input: ${i}`),null;continue}if(n.type==="number"){const l=Number(a);if(!Number.isFinite(l))return et.error(`Invalid number for workflow input: ${i}`),null;t[i]=l;continue}t[i]=a}return t}function XN(s,e){if(s instanceof Hi){const t=s.response?.data;return typeof t?.message=="string"?t.message:typeof t=="string"?t:s.message||e}return s instanceof Error?s.message:e}function wit(s){const e=DS.parse(s.prompt);return{name:s.name,targetMode:s.target?.target_type??"prompt",prompt:e.prompt,execution_steps:e.executionSteps.map(t=>Vpe(t)),enabled:s.enabled,allow_workflow_runs_without_permission:s.allow_workflow_runs_without_permission,monitor_timeout_value:s.monitor_timeout_value,monitor_timeout_unit:s.monitor_timeout_unit,workflow_slug:s.target?.workflow_slug??"",workflow_inputs:{},scheduleMode:"cron",cron_expression:s.schedule.cron_expression,timezone:s.schedule.timezone,builderFrequency:"daily",time:pit(),days_of_week:[1,2,3,4,5],day_of_month:1}}function Zse(){const s=Ss(),e=Io(),i=Qb().id??null,n=i!==null,o=s.loading?null:s.token,[r,a]=F.useState(()=>bit()),[l,c]=F.useState(n),[d,u]=F.useState(!1),[f,p]=F.useState(null),[m,b]=F.useState([]),[C,y]=F.useState(null),[S,L]=F.useState(!1),[k,N]=F.useState(null),I=F.useRef({}),T=F.useRef({}),[O,M]=F.useState(()=>new Set);Da(n?"Edit Cronjob":"Create Cronjob");const B=F.useCallback(async()=>{if(!(!o||!i))try{const H=(await xt.get(`/api/cronjobs/${i}`,{headers:{Authorization:`Bearer ${o}`}})).data.cronjob;a(wit(H)),I.current=H.target?.workflow_inputs??{},p(null)}catch(J){p(XN(J,"Failed to load cronjob"))}finally{c(!1)}},[i,o]);if(F.useEffect(()=>{n&&B()},[n,B]),F.useEffect(()=>{if(!o)return;let J=!1;return(async()=>{try{const $=await xt.get("/api/workflows",{headers:{Authorization:`Bearer ${o}`}});J||b($.data.workflows.filter(le=>le.is_approved&&le.can_edit))}catch($){J||N(XN($,"Failed to load workflows"))}})(),()=>{J=!0}},[o]),F.useEffect(()=>{if(!o||r.targetMode!=="workflow"||!r.workflow_slug){y(null);return}let J=!1;return(async()=>{L(!0),N(null);try{const le=(await xt.get(`/api/workflows/${encodeURIComponent(r.workflow_slug)}`,{headers:{Authorization:`Bearer ${o}`}})).data.workflow;if(!J){y(le);const q=I.current;I.current={},a(Ae=>({...Ae,workflow_inputs:vit(le.manifest.inputs??{},q)}))}}catch($){J||N(XN($,"Failed to load workflow details"))}finally{J||L(!1)}})(),()=>{J=!0}},[r.targetMode,r.workflow_slug,o]),s.loading)return null;const W=()=>{const J=r.targetMode==="workflow"?Cit(C?.manifest.inputs??{},r.workflow_inputs):null;return r.targetMode==="workflow"&&J===null?null:{...{name:r.name,target_type:r.targetMode,prompt:r.targetMode==="prompt"?DS.buildWithExecutionSteps(r.prompt,r.execution_steps.map($=>$.content)):null,workflow_slug:r.targetMode==="workflow"?r.workflow_slug:null,workflow_inputs:r.targetMode==="workflow"?J:null,enabled:r.enabled,allow_workflow_runs_without_permission:r.targetMode==="prompt"?r.allow_workflow_runs_without_permission:null,monitor_timeout_value:r.monitor_timeout_value,monitor_timeout_unit:r.monitor_timeout_unit,timezone:r.timezone},cron_expression:r.scheduleMode==="cron"?r.cron_expression:_it(r)}},j=J=>{a(H=>{const $=H.days_of_week.includes(J)?H.days_of_week.filter(le=>le!==J):[...H.days_of_week,J].sort((le,q)=>le-q);return{...H,days_of_week:$.length===0?H.days_of_week:$}})},ee=()=>{a(J=>({...J,execution_steps:[...J.execution_steps,Vpe()]}))},G=(J,H)=>{a($=>({...$,execution_steps:$.execution_steps.map(le=>le.id===J?{...le,content:H}:le)}))},te=J=>{a(H=>({...H,execution_steps:H.execution_steps.filter($=>$.id!==J)}))},Z=J=>{const H=new Map(r.execution_steps.map(le=>[le.id,T.current[le.id]?.getBoundingClientRect().top??null])),$=new Set([r.execution_steps[J]?.id,r.execution_steps[J+1]?.id].filter(le=>!!le));a(le=>{if(J<0||J>=le.execution_steps.length-1)return le;const q=[...le.execution_steps];return[q[J],q[J+1]]=[q[J+1],q[J]],{...le,execution_steps:q}}),requestAnimationFrame(()=>{const le=new Set;for(const q of $){const Ae=T.current[q],Ze=H.get(q);if(!Ae||Ze===null||Ze===void 0)continue;const it=Ae.getBoundingClientRect().top,ut=Ze-it;ut!==0&&(Ae.style.transform=`translateY(${ut}px)`,Ae.style.transition="transform 0s",le.add(q))}le.size!==0&&(M(le),requestAnimationFrame(()=>{for(const q of le){const Ae=T.current[q];Ae&&(Ae.style.transition="transform 0.24s ease",Ae.style.transform="")}window.setTimeout(()=>{for(const q of le){const Ae=T.current[q];Ae&&(Ae.style.transition="")}M(new Set)},260)}))})},X=async J=>{if(J.preventDefault(),!o)return;if(r.targetMode==="prompt"&&r.prompt.includes(DS.LEGACY_TODO_STEP_MARKER)){et.error(`Do not add "${DS.LEGACY_TODO_STEP_MARKER}" in the prompt. Add those items as execution steps instead.`);return}const H=W();if(H!==null){u(!0);try{i?(await xt.patch(`/api/cronjobs/${i}`,H,{headers:{Authorization:`Bearer ${o}`}}),et.success("Cronjob updated")):(await xt.post("/api/cronjobs",H,{headers:{Authorization:`Bearer ${o}`}}),et.success("Cronjob created")),e("/?tab=cronjobs")}catch($){et.error(XN($,"Failed to save cronjob"))}finally{u(!1)}}};if(l)return x.jsx("div",{className:"cronjob-page-state",children:"Loading cronjob..."});if(f)return x.jsx("div",{className:"cronjob-page-state error",children:f});const re=fit();return x.jsxs("main",{className:"cronjob-form-page",children:[x.jsx("button",{className:"cronjob-back-btn",onClick:()=>e("/?tab=cronjobs"),children:"Back to cronjobs"}),x.jsxs("section",{className:"cronjob-builder-shell",children:[x.jsxs("aside",{className:"cronjob-builder-aside",children:[x.jsx("p",{className:"cronjobs-eyebrow",children:"Scheduled agent"}),x.jsx("h1",{children:n?"Edit cronjob":"Create a cronjob"}),x.jsx("p",{children:"Define a prompt or workflow that should run on a schedule. Prompts can invoke workflows or other skills."})]}),x.jsxs("form",{className:"cronjob-builder-form",onSubmit:X,children:[x.jsxs("section",{className:"cronjob-form-panel",children:[x.jsxs("div",{className:"cronjob-panel-heading",children:[x.jsx("span",{children:"01"}),x.jsxs("div",{children:[x.jsx("h2",{children:"What should run?"}),x.jsx("p",{children:"Run either an agent prompt or a specific workflow with fixed inputs."})]})]}),x.jsxs("div",{className:"cronjob-form-grid",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Name"}),x.jsx("input",{value:r.name,onChange:J=>a(H=>({...H,name:J.target.value})),placeholder:"Morning repo check",required:!0})]}),x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Target type"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.targetMode,onChange:J=>a(H=>({...H,targetMode:J.target.value})),children:[x.jsx("option",{value:"prompt",children:"Prompt"}),x.jsx("option",{value:"workflow",children:"Workflow"})]})})]})]}),r.targetMode==="prompt"?x.jsxs("div",{className:"cronjob-prompt-builder",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Prompt"}),x.jsx("textarea",{value:r.prompt,onChange:J=>a(H=>({...H,prompt:J.target.value})),placeholder:"Check the repo health, run the relevant workflow if needed, and mark the cronjob completed with a concise summary.",required:!0})]}),x.jsxs("div",{className:"cronjob-prompt-steps",children:[x.jsxs("div",{className:"cronjob-prompt-steps-header",children:[x.jsxs("div",{children:[x.jsx("span",{children:"Execution steps"}),x.jsx("p",{children:"Optional. These are inserted into the cronjob todo list before the agent starts."})]}),x.jsx("button",{type:"button",className:"cronjob-step-add",onClick:ee,children:"Add step"})]}),r.execution_steps.length===0?x.jsx("div",{className:"cronjob-prompt-steps-empty",children:"Add steps when you want the agent to follow a specific sequence."}):x.jsx("div",{className:"cronjob-step-list",children:r.execution_steps.map((J,H)=>x.jsx("div",{ref:$=>{T.current[J.id]=$},className:`cronjob-step-row-wrap${O.has(J.id)?" is-reordering":""}`,children:x.jsxs("div",{className:"cronjob-step-row",children:[x.jsx("span",{className:"cronjob-step-index",children:H+1}),x.jsx("textarea",{value:J.content,onChange:$=>G(J.id,$.target.value),placeholder:`Step ${H+1}`}),x.jsx("button",{type:"button",className:"cronjob-step-move-down","aria-label":`Move step ${H+1} down`,title:H===r.execution_steps.length-1?"Already last step":`Swap step ${H+1} with step ${H+2}`,disabled:H===r.execution_steps.length-1,onClick:()=>Z(H),children:"↓"}),x.jsx("button",{type:"button",className:"cronjob-step-remove","aria-label":`Remove step ${H+1}`,title:`Remove step ${H+1}`,onClick:()=>te(J.id),children:"×"})]})},J.id))})]})]}):x.jsxs("div",{className:"cronjob-workflow-target",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Workflow"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.workflow_slug,onChange:J=>a(H=>({...H,workflow_slug:J.target.value,workflow_inputs:{}})),required:!0,children:[x.jsx("option",{value:"",children:"Select workflow"}),m.map(J=>x.jsx("option",{value:J.slug,children:J.name||J.slug},J.slug))]})})]}),k&&x.jsx("p",{className:"cronjob-inline-error",children:k}),S&&x.jsx("p",{className:"cronjob-muted-copy",children:"Loading workflow inputs..."}),C&&x.jsxs("div",{className:"cronjob-workflow-inputs",children:[x.jsx("p",{children:C.required_secrets.length>0?`Required secrets: ${C.required_secrets.join(", ")}`:"This workflow does not declare required secrets."}),C.missing_required_secrets.length>0&&x.jsxs("p",{className:"cronjob-inline-error",children:["Missing secrets: ",C.missing_required_secrets.join(", ")]}),Object.keys(C.manifest.inputs??{}).length===0?x.jsx("p",{className:"cronjob-muted-copy",children:"This workflow does not take input arguments."}):x.jsx("div",{className:"cronjob-form-grid",children:Object.entries(C.manifest.inputs).map(([J,H])=>x.jsxs("label",{className:"cronjob-field",children:[x.jsxs("span",{children:[J,H.required!==!1?" *":""]}),H.description&&x.jsx("small",{className:"cronjob-muted-copy",children:H.description}),H.type==="boolean"?x.jsxs("div",{className:"cronjob-day-picker",children:[x.jsx("button",{type:"button",className:r.workflow_inputs[J]===!0?"active":"",onClick:()=>a($=>({...$,workflow_inputs:{...$.workflow_inputs,[J]:!0}})),children:"Yes"}),x.jsx("button",{type:"button",className:r.workflow_inputs[J]!==!0?"active":"",onClick:()=>a($=>({...$,workflow_inputs:{...$.workflow_inputs,[J]:!1}})),children:"No"})]}):x.jsx("input",{type:H.type==="number"?"number":"text",value:String(r.workflow_inputs[J]??""),onChange:$=>a(le=>({...le,workflow_inputs:{...le.workflow_inputs,[J]:$.target.value}})),placeholder:H.default!==void 0?String(H.default):"",required:H.required!==!1&&H.default===void 0})]},J))})]})]})]}),x.jsxs("section",{className:"cronjob-form-panel",children:[x.jsxs("div",{className:"cronjob-panel-heading",children:[x.jsx("span",{children:"02"}),x.jsxs("div",{children:[x.jsx("h2",{children:"When should it run?"}),x.jsx("p",{children:"Use the schedule builder for common schedules or enter raw cron for full control."})]})]}),x.jsxs("div",{className:"cronjob-form-grid",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Schedule type"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.scheduleMode,onChange:J=>a(H=>({...H,scheduleMode:J.target.value})),children:[x.jsx("option",{value:"builder",children:"Schedule builder"}),x.jsx("option",{value:"cron",children:"Cron expression"})]})})]}),r.scheduleMode==="builder"?x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Timezone"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsx("select",{value:r.timezone,onChange:J=>a(H=>({...H,timezone:J.target.value})),children:re.map(J=>x.jsx("option",{value:J,children:J},J))})})]}):x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Cron expression"}),x.jsx("input",{value:r.cron_expression,onChange:J=>a(H=>({...H,cron_expression:J.target.value})),placeholder:"0 9 * * *",required:!0})]})]}),r.scheduleMode==="builder"?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"cronjob-form-grid",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Frequency"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.builderFrequency,onChange:J=>a(H=>({...H,builderFrequency:J.target.value})),children:[x.jsx("option",{value:"daily",children:"Every day"}),x.jsx("option",{value:"weekly",children:"Specific weekdays"}),x.jsx("option",{value:"monthly",children:"Specific day of month"})]})})]}),x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Time of day"}),x.jsx("input",{type:"time",value:r.time,onChange:J=>a(H=>({...H,time:J.target.value})),required:!0})]})]}),r.builderFrequency==="weekly"?x.jsx(x.Fragment,{children:x.jsx("div",{className:"cronjob-day-picker","aria-label":"Days of week",children:uit.map(J=>x.jsx("button",{type:"button",className:r.days_of_week.includes(J.value)?"active":"",onClick:()=>j(J.value),children:J.label},J.value))})}):null,r.builderFrequency==="monthly"?x.jsxs("label",{className:"cronjob-field cronjob-short-field",children:[x.jsx("span",{children:"Day of month"}),x.jsx("input",{type:"number",min:1,max:31,value:r.day_of_month,onChange:J=>a(H=>({...H,day_of_month:Number(J.target.value)})),required:!0})]}):null]}):x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Timezone"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsx("select",{value:r.timezone,onChange:J=>a(H=>({...H,timezone:J.target.value})),children:re.map(J=>x.jsx("option",{value:J,children:J},J))})})]})]}),x.jsxs("section",{className:"cronjob-form-panel",children:[x.jsxs("div",{className:"cronjob-panel-heading",children:[x.jsx("span",{children:"03"}),x.jsxs("div",{children:[x.jsx("h2",{children:"Runtime policy"}),x.jsx("p",{children:r.targetMode==="workflow"?"Workflow cronjobs run directly with the saved inputs.":"Choose how aggressively the cronjob should avoid asking for help."})]})]}),x.jsxs("label",{className:"cronjob-switch-row",children:[x.jsx("input",{type:"checkbox",checked:r.enabled,onChange:J=>a(H=>({...H,enabled:J.target.checked}))}),x.jsxs("span",{children:[x.jsx("strong",{children:"Enabled"}),x.jsx("small",{children:"Schedule this cronjob after saving."})]})]}),r.targetMode==="prompt"?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"cronjob-form-grid",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Job timeout"}),x.jsx("input",{type:"number",min:0,step:"any",value:r.monitor_timeout_value,onChange:J=>a(H=>({...H,monitor_timeout_value:Number(J.target.value)})),required:!0})]}),x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Timeout unit"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.monitor_timeout_unit,onChange:J=>a(H=>({...H,monitor_timeout_unit:J.target.value})),children:[x.jsx("option",{value:"minutes",children:"Minutes"}),x.jsx("option",{value:"hours",children:"Hours"}),x.jsx("option",{value:"days",children:"Days"})]})})]})]}),x.jsxs("p",{className:"cronjob-muted-copy",children:["The job will fail a run if it stays active longer than ",mit(r.monitor_timeout_value,r.monitor_timeout_unit),"."]})]}):null,r.targetMode==="prompt"?x.jsxs("label",{className:"cronjob-switch-row",children:[x.jsx("input",{type:"checkbox",checked:r.allow_workflow_runs_without_permission,onChange:J=>a(H=>({...H,allow_workflow_runs_without_permission:J.target.checked}))}),x.jsxs("span",{children:[x.jsx("strong",{children:"Allow workflow runs without user permission"}),x.jsx("small",{children:"If off, workflow execution can escalate the cronjob into a user-visible chat."})]})]}):x.jsx("div",{className:"cronjob-policy-note",children:"Workflow cronjobs do not request runtime permission."})]}),x.jsxs("div",{className:"cronjob-builder-actions",children:[x.jsx("button",{type:"button",onClick:()=>e("/?tab=cronjobs"),children:"Cancel"}),x.jsx("button",{className:"cronjobs-primary-btn",type:"submit",disabled:d,children:d?"Saving...":n?"Save cronjob":"Create cronjob"})]})]})]})]})}function Xse(s,e){if(s instanceof Hi){const t=s.response?.data;return typeof t?.message=="string"?t.message:typeof t=="string"?t:s.message||e}return s instanceof Error?s.message:e}function Qse(s){return s===null?"Still running":new Date(s).toLocaleString()}function yit(s){return s.replaceAll("_"," ")}function Sit(){const s=Ss(),e=s.loading?null:s.token,t=Io(),n=Qb().id,[o,r]=F.useState(null),[a,l]=F.useState(!0),[c,d]=F.useState(null),[u,f]=F.useState(null);Da("Cronjob Run");const p=F.useCallback(async C=>{if(e)try{C?.showLoading!==!1&&l(!0);const y=await xt.get(`/api/cronjobs/runs/${n}`,{headers:{Authorization:`Bearer ${e}`}});r(y.data.run),f(null)}catch(y){f(Xse(y,"Failed to load cronjob run"))}finally{C?.showLoading!==!1&&l(!1)}},[n,e]);F.useEffect(()=>{p()},[p]),F.useEffect(()=>{if(!o||o.status!=="running")return;const C=window.setInterval(()=>{p({showLoading:!1})},2e3);return()=>window.clearInterval(C)},[p,o]);const m=F.useMemo(()=>!o?.session_id||!o.opencode_session_id?null:{id:o.session_id,opencode_session_id:o.opencode_session_id,title:`Cronjob run ${o.id.slice(0,8)}`,created_at:o.started_at,updated_at:o.completed_at??Date.now(),state:o.status==="running"?"processing":"idle",latest_message_id:null,cronjob_control:o.target_type_snapshot==="prompt"&&["running","paused"].includes(o.status)?{run_id:o.id,status:o.status,can_interrupt:o.status==="running",can_resume:o.status==="paused",can_terminate:!0}:null},[o]),b=async C=>{if(!(!e||!o)){d(C);try{if(await xt.post(`/api/cronjobs/runs/${o.id}/${C}`,{},{headers:{Authorization:`Bearer ${e}`}}),C==="interrupt"){const S=new URLSearchParams({tab:"ai"});o.session_id&&S.set("session",o.session_id),t({pathname:"/",search:S.toString()});return}const y=C==="resume"?"resumed":"terminated";et.success(`Cronjob run ${y}`),await p({showLoading:!1})}catch(y){et.error(Xse(y,`Failed to ${C} cronjob run`))}finally{d(null)}}};return s.loading||a?x.jsx("div",{className:"cronjob-run-state",children:"Loading cronjob run..."}):u||!o?x.jsx("div",{className:"cronjob-run-state error",children:u??"Cronjob run not found"}):x.jsxs("main",{className:"cronjob-run-page",children:[x.jsxs("div",{className:"cronjob-run-topbar",children:[x.jsx("button",{onClick:()=>t("/?tab=cronjobs"),children:"Back to cronjobs"}),x.jsx("button",{onClick:()=>t(`/cronjobs/${o.cronjob_id}/edit`),children:"Edit cronjob"})]}),x.jsxs("section",{className:"cronjob-run-header",children:[x.jsxs("div",{children:[x.jsx("p",{className:"cronjobs-eyebrow",children:o.target_type_snapshot==="workflow"?"Workflow cronjob run":"Cronjob transcript"}),x.jsxs("h1",{children:["Run ",o.id.slice(0,8)]}),x.jsx("p",{children:o.target_type_snapshot==="workflow"?"This scheduled workflow run executes directly with the saved inputs.":"Watch live agent messages while running, or review the same transcript after completion."})]}),x.jsxs("div",{className:"cronjob-run-status-card",children:[x.jsx("span",{children:"Status"}),x.jsx("strong",{children:yit(o.status)}),o.target_type_snapshot==="prompt"&&o.status==="running"&&x.jsx("button",{className:"cronjob-run-stop-btn",onClick:()=>b("interrupt"),disabled:c!==null,children:c==="interrupt"?"Interrupting...":"Interrupt"}),o.target_type_snapshot==="prompt"&&o.status==="paused"&&x.jsx("button",{className:"cronjob-run-ai-btn",onClick:()=>b("resume"),disabled:c!==null,children:c==="resume"?"Resuming...":"Resume"}),(o.target_type_snapshot==="prompt"&&["running","paused"].includes(o.status)||o.target_type_snapshot==="workflow"&&o.status==="running")&&x.jsx("button",{className:"cronjob-run-stop-btn",onClick:()=>b("terminate"),disabled:c!==null,children:c==="terminate"?"Terminating...":"Terminate"})]})]}),x.jsxs("section",{className:"cronjob-run-meta",children:[x.jsxs("div",{children:[x.jsx("span",{children:"Target"}),x.jsx("strong",{children:o.target_type_snapshot==="workflow"?`Workflow: ${o.workflow_slug_snapshot}`:"Prompt"})]}),o.workflow_run_id&&x.jsxs("div",{children:[x.jsx("span",{children:"Workflow run"}),x.jsx("strong",{children:o.workflow_run_id.slice(0,8)})]}),x.jsxs("div",{children:[x.jsx("span",{children:"Started"}),x.jsx("strong",{children:Qse(o.started_at)})]}),x.jsxs("div",{children:[x.jsx("span",{children:"Completed"}),x.jsx("strong",{children:Qse(o.completed_at)})]}),o.summary&&x.jsxs("div",{className:"cronjob-run-meta-wide",children:[x.jsx("span",{children:"Summary"}),x.jsx("strong",{children:o.summary})]}),o.error_message&&x.jsxs("div",{className:"cronjob-run-meta-wide",children:[x.jsx("span",{children:"Error"}),x.jsx("strong",{children:o.error_message})]})]}),m?x.jsx(nae,{initialDraftMessage:null,forceNewChat:!1,onDraftHandled:()=>{},fixedSession:m,readOnly:!0}):x.jsx("div",{className:"cronjob-run-state",children:o.target_type_snapshot==="workflow"?"This workflow cronjob does not have an agent chat transcript. Open the linked workflow run from workflow history for detailed logs.":"This run does not have an agent session transcript."})]})}function qq(s){const[e,t]=F.useState(null),[i,n]=F.useState(!1);return F.useEffect(()=>{s&&xt.get("/api/opencode-auth/status",{headers:{Authorization:`Bearer ${s}`}}).then(o=>{n(o.data.has_credentials),t(s)}).catch(o=>{const r=o instanceof Hi?o.response?.data?.message||o.response?.data||o.message:"Failed to check opencode auth status";console.error(r),n(!1),t(s)})},[s]),s?{loading:e!==s,hasCredentials:i}:{loading:!1,hasCredentials:!1}}function oa({children:s}){const e=Ss();return e.loading?null:e.user?x.jsx(x.Fragment,{children:s}):x.jsx(Ck,{to:"/login",replace:!0})}function Nl({children:s}){const e=Ss(),t=e.loading?null:e.token,{loading:i,hasCredentials:n}=qq(t);return i?null:n?x.jsx(x.Fragment,{children:s}):x.jsx(Ck,{to:"/opencode-auth",replace:!0})}function xit(){const s=Ss(),e=s.loading?null:s.token,{loading:t}=qq(e);return t?null:x.jsx(ait,{})}function Lit(){const s=Ss(),e=s.loading?null:s.token,{loading:t,hasCredentials:i}=qq(e);return t?null:i?x.jsx(lit,{}):x.jsx(Ck,{to:"/opencode-auth",replace:!0})}function kit({children:s}){const e=Ss();return e.loading?null:e.user?x.jsx(Ck,{to:"/",replace:!0}):x.jsx(x.Fragment,{children:s})}function Dit(){const s=Ss(),e=Io(),[t,i]=F.useState(null),[n,o]=F.useState(null),[r,a]=F.useState(!1);return F.useEffect(()=>{xt.get("/api/workspace").then(l=>{i(l.data.workspace_dir),o(null)}).catch(l=>{const c=l instanceof Hi?l.response?.data?.message||l.response?.data||l.message:"Failed to load workspace path";o(c)})},[]),F.useEffect(()=>{const l=()=>{window.innerWidth>720&&a(!1)};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),x.jsxs("div",{className:"app-shell",children:[x.jsxs("header",{className:"app-header",children:[x.jsxs("div",{className:"app-header-top",children:[x.jsxs("div",{className:"app-brand-block",children:[x.jsxs("div",{className:"app-brand-row",children:[x.jsxs("div",{className:"app-brand",children:[x.jsx("img",{src:"/logo.svg",alt:"TeamCopilot logo",className:"app-brand-logo"}),x.jsxs("div",{className:"app-brand-copy",children:[x.jsx("div",{className:"app-brand-text",children:"TeamCopilot"}),x.jsxs("div",{className:"app-version",children:["v","0.4.3"]})]})]}),!s.loading&&s.user&&x.jsxs("button",{type:"button",className:"app-header-menu-toggle","aria-label":r?"Close header menu":"Open header menu","aria-expanded":r,"aria-controls":"app-header-mobile-menu",onClick:()=>a(l=>!l),children:[x.jsx("span",{}),x.jsx("span",{}),x.jsx("span",{})]})]}),x.jsxs("div",{className:"app-workspace",children:[x.jsx("span",{className:"app-workspace-label",children:"Workspace"}),x.jsx("span",{className:"app-workspace-value",children:n??t??"Loading..."})]})]}),x.jsxs("div",{className:"app-header-meta",children:[!s.loading&&s.user&&x.jsx("button",{className:"app-header-link-btn",onClick:()=>e("/profile/secrets"),children:"Profile Secrets"}),!s.loading&&s.user&&x.jsxs("div",{className:"app-user",children:[x.jsx("span",{className:"app-user-name",children:s.user.name}),x.jsx("span",{className:"app-user-email",children:s.user.email})]}),!s.loading&&s.user&&x.jsx("button",{className:"app-signout",onClick:s.logout,children:"Sign Out"})]})]}),!s.loading&&s.user&&x.jsxs("div",{id:"app-header-mobile-menu",className:`app-header-mobile-menu ${r?"open":""}`,children:[x.jsxs("div",{className:"app-header-mobile-section",children:[x.jsx("span",{className:"app-header-mobile-label",children:"Version"}),x.jsxs("span",{className:"app-header-mobile-value",children:["v","0.4.3"]})]}),x.jsxs("div",{className:"app-header-mobile-section",children:[x.jsx("span",{className:"app-header-mobile-label",children:"Workspace"}),x.jsx("span",{className:"app-header-mobile-value app-header-mobile-mono",children:n??t??"Loading..."})]}),x.jsxs("div",{className:"app-header-mobile-section",children:[x.jsx("span",{className:"app-header-mobile-label",children:"Signed In As"}),x.jsx("span",{className:"app-header-mobile-value",children:s.user.name}),x.jsx("span",{className:"app-header-mobile-subvalue",children:s.user.email})]}),x.jsx("button",{className:"app-header-link-btn app-header-link-btn-mobile",onClick:()=>e("/profile/secrets"),children:"Profile Secrets"}),x.jsx("button",{className:"app-signout app-signout-mobile",onClick:s.logout,children:"Sign Out"})]})]}),x.jsxs(ive,{children:[x.jsx(Ko,{path:"/login",element:x.jsx(kit,{children:x.jsx(Xwe,{})})}),x.jsx(Ko,{path:"/opencode-auth",element:x.jsx(oa,{children:x.jsx(xit,{})})}),x.jsx(Ko,{path:"/opencode-auth/complete",element:x.jsx(oa,{children:x.jsx(Lit,{})})}),x.jsx(Ko,{path:"/user-instructions",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(cit,{})})})}),x.jsx(Ko,{path:"/profile/secrets",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(dit,{})})})}),x.jsx(Ko,{path:"/",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(mDe,{})})})}),x.jsx(Ko,{path:"/cronjobs/new",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Zse,{})})})}),x.jsx(Ko,{path:"/cronjobs/:id/edit",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Zse,{})})})}),x.jsx(Ko,{path:"/cronjobs/runs/:id",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Sit,{})})})}),x.jsx(Ko,{path:"/runs/:id",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Ytt,{})})})}),x.jsx(Ko,{path:"/workflows/:slug/manual-run",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Xtt,{})})})}),x.jsx(Ko,{path:"/workflows/:slug/api-run",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(nit,{})})})}),x.jsx(Ko,{path:"/workflows/:slug",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(jtt,{})})})}),x.jsx(Ko,{path:"/skills/:slug",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Utt,{})})})}),x.jsx(Ko,{path:"/workflows/:slug/approval-review",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx($tt,{})})})}),x.jsx(Ko,{path:"/skills/:slug/approval-review",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(qtt,{})})})}),x.jsx(Ko,{path:"*",element:x.jsx(Ck,{to:"/",replace:!0})})]})]})}function Eit(){return x.jsx(Zwe,{children:x.jsx(Dit,{})})}obe.createRoot(document.getElementById("root")).render(x.jsx(F.StrictMode,{children:x.jsxs(Dve,{children:[x.jsx(Eit,{}),x.jsx(bCe,{position:"bottom-right",autoClose:5e3})]})}));export{rD as m,rfe as t};
|
|
790
|
+
`)}function MB({title:s,command:e,onCopy:t}){return x.jsxs("section",{className:"workflow-api-card",children:[x.jsxs("div",{className:"workflow-api-card-title-row",children:[x.jsx("h3",{children:s}),x.jsx("button",{type:"button",onClick:()=>t(e,s),disabled:!e,children:"Copy"})]}),x.jsx("pre",{children:e})]})}function nit(){const{slug:s=""}=Qb(),e=Io(),t=Ss(),i=t.loading?null:t.token,[n,o]=F.useState(!0),[r,a]=F.useState(!1),[l,c]=F.useState(null),[d,u]=F.useState(null),[f,p]=F.useState(null),[m,b]=F.useState(""),[C,y]=F.useState([]);Da("Workflow API");const S=F.useMemo(()=>i?{Authorization:`Bearer ${i}`}:void 0,[i]),L=F.useCallback(async()=>{if(S){o(!0),u(null);try{const[ee,G]=await Promise.all([xt.get(`/api/workflows/${encodeURIComponent(s)}`,{headers:S}),xt.get(`/api/workflows/${encodeURIComponent(s)}/api-keys`,{headers:S})]);p(ee.data.workflow);const te=G.data;b(te.api_base_url),y(te.api_keys)}catch(ee){u(RB(ee,"Failed to load workflow API details"))}finally{o(!1)}}},[S,s]);F.useEffect(()=>{L()},[L]);const k=async()=>{if(S){a(!0);try{const ee=await xt.post(`/api/workflows/${encodeURIComponent(s)}/api-keys`,{},{headers:S});y(G=>[...G,ee.data.api_key]),et.success("API key created")}catch(ee){et.error(RB(ee,"Failed to create API key"))}finally{a(!1)}}},N=async ee=>{if(S){c(ee);try{await xt.delete(`/api/workflows/${encodeURIComponent(s)}/api-keys/${encodeURIComponent(ee)}`,{headers:S}),y(G=>G.filter(te=>te.id!==ee)),et.success("API key removed")}catch(G){et.error(RB(G,"Failed to remove API key"))}finally{c(null)}}},I=(ee,G)=>{ee&&navigator.clipboard.writeText(ee).then(()=>{et.success(`${G} copied`)}).catch(()=>{et.error(`Failed to copy ${G.toLowerCase()}`)})};if(t.loading)return null;const T=C[0]?.api_key??"",O=f?.manifest.inputs??{},M=f&&T?eit(m,T,f.slug,O):"",B=T?tit(m,T):"",W=T?iit(m,T):"",j=JSON.stringify(O,null,2);return x.jsxs("div",{className:"workflow-api-page",children:[x.jsxs("header",{className:"workflow-api-header",children:[x.jsx("button",{className:"workflow-api-back-btn",onClick:()=>e("/?tab=workflows"),children:"Back to Workflows"}),x.jsx("h1",{children:"Workflow API"})]}),n&&x.jsx("div",{className:"workflow-api-state",children:"Loading workflow API details..."}),d&&x.jsx("div",{className:"workflow-api-state error",children:d}),!n&&!d&&f&&x.jsxs("div",{className:"workflow-api-content",children:[x.jsxs("section",{className:"workflow-api-card",children:[x.jsx("h2",{children:f.name||f.slug}),x.jsx("p",{children:"Use this workflow from another backend process with a workflow API key."})]}),x.jsx(MB,{title:"Run Command",command:M,onCopy:I}),x.jsx(MB,{title:"Status Command",command:B,onCopy:I}),x.jsx(MB,{title:"Stop Command",command:W,onCopy:I}),x.jsxs("section",{className:"workflow-api-card",children:[x.jsx("h3",{children:"Input Schema"}),x.jsx("pre",{children:j})]}),x.jsxs("section",{className:"workflow-api-card",children:[x.jsxs("div",{className:"workflow-api-card-title-row",children:[x.jsx("h3",{children:"API Keys"}),x.jsx("button",{type:"button",onClick:()=>{k()},disabled:r,children:r?"Creating...":"Add Key"})]}),x.jsx("div",{className:"workflow-api-key-list",children:C.map(ee=>x.jsxs("div",{className:"workflow-api-key-row",children:[x.jsx("code",{children:ee.api_key}),x.jsx("button",{type:"button",onClick:()=>{N(ee.id)},disabled:l===ee.id||C.length<=1,children:l===ee.id?"Removing...":"Remove"})]},ee.id))})]})]})]})}function sit(s){const e=s.match(/enter code:\s*(.+)$/i);return!e||!e[1]?"":e[1].trim()}function tA(s){const e=s.toLowerCase();return e==="google-vertex"||e.startsWith("google-vertex-")}function oit(s){return s==="azure-openai"||tA(s)}function Kse(s,e){return e==="anthropic"&&s.type==="oauth"?!1:s.type!=="oauth"?!0:!s.label.toLowerCase().includes("browser")}function rit(s,e){const t=e.split("/").slice(1).join("/");return s==="azure-openai"?[{key:"AZURE_API_KEY",value:"abc123xyz",help:"API key for the Azure OpenAI resource."},{key:"AZURE_OPENAI_ENDPOINT",value:"https://my-resource.openai.azure.com/",help:"Base endpoint for the Azure OpenAI resource."},{key:"OPENCODE_MODEL",value:`azure-openai/${t}`,help:"Provider id plus the Azure deployment name."}]:tA(s)?[{key:"GOOGLE_CLOUD_PROJECT",value:"my-gcp-project-id",help:"Google Cloud project ID."},{key:"GOOGLE_APPLICATION_CREDENTIALS",value:"/path/to/service-account.json",help:"Path to a Google Cloud service account JSON key file (readable by this process)."},{key:"VERTEX_LOCATION",value:"global",help:"Vertex AI region or endpoint (for example global or us-central1). Must be set explicitly."},{key:"OPENCODE_MODEL",value:e,help:"OpenCode Vertex provider prefix plus model id (for example google-vertex/... or google-vertex-anthropic/...)."}]:[]}function ait(){const s=Ss(),e=s.loading?null:s.token,t=Io();Da("OpenCode Auth Setup");const[i,n]=F.useState(null),[o,r]=F.useState(null),[a,l]=F.useState(""),[c,d]=F.useState(null),[u,f]=F.useState(""),[p,m]=F.useState(""),[b,C]=F.useState(!0),y=F.useRef(null),S=F.useMemo(()=>i?i.methods.filter(X=>Kse(X,i.provider_id)):[],[i]),L=F.useMemo(()=>e?{Authorization:`Bearer ${e}`}:void 0,[e]);function k(X,re){const J=X instanceof Hi?X.response?.data?.message||X.response?.data||X.message:re;return typeof J=="string"?J:re}const N=F.useMemo(()=>o===null?null:S.find(X=>X.index===o)||null,[S,o]),I=c?.method==="code",T=c?.method==="auto",O=c?sit(c.instructions):"",M=!I&&!!(i&&oit(i.provider_id)),B=i?rit(i.provider_id,i.model):[];function W(){y.current&&(y.current.abort(),y.current=null),d(null),f("")}const j=F.useCallback(async()=>{if(e){C(!0);try{const X=await xt.get("/api/opencode-auth/status",{headers:L}),re=X.data.methods.filter(J=>Kse(J,X.data.provider_id));n({...X.data,methods:re}),m(""),r(J=>J!==null&&re.some(H=>H.index===J)?J:re[0]?.index??null)}catch(X){m(k(X,"Failed to load opencode auth status"))}finally{C(!1)}}},[L,e]);F.useEffect(()=>{j()},[j]),F.useEffect(()=>()=>{y.current&&(y.current.abort(),y.current=null)},[]);const ee=async()=>{if(!(!e||o===null)){if(!a){et.error("API key is required");return}try{await xt.post("/api/opencode-auth/api",{key:a},{headers:L}),l(""),et.success("API key saved"),t("/opencode-auth/complete",{replace:!0})}catch(X){et.error(k(X,"Failed to save API key"))}}},G=async()=>{if(!(!e||o===null))try{const X=await xt.post("/api/opencode-auth/oauth/authorize",{method:o},{headers:L});if(d(X.data),window.open(X.data.url,"_blank","noopener,noreferrer"),X.data.method==="auto"){const re=new AbortController;y.current=re;try{await xt.post("/api/opencode-auth/oauth/callback",{method:o},{headers:L,timeout:12e4,signal:re.signal}),W(),et.success("OAuth connected"),t("/opencode-auth/complete",{replace:!0})}catch(J){if(J instanceof Hi&&J.code==="ERR_CANCELED")return;et.error(k(J,"Failed to complete OAuth flow"))}finally{y.current===re&&(y.current=null)}}}catch(X){et.error(k(X,"Failed to start OAuth flow"))}},te=async()=>{if(!(!e||o===null||!c)){if(c.method==="code"&&!u){et.error("Authorization code is required");return}try{await xt.post("/api/opencode-auth/oauth/callback",{method:o,code:c.method==="code"?u:void 0},{headers:L}),W(),et.success("OAuth connected"),t("/opencode-auth/complete",{replace:!0})}catch(X){et.error(k(X,"Failed to complete OAuth flow"))}}},Z=async X=>{X.key==="Enter"&&(X.preventDefault(),await te())};return b?x.jsx("div",{className:"opencode-auth-page",children:x.jsx("p",{className:"opencode-auth-loading",children:"Checking opencode credentials..."})}):p?x.jsx("div",{className:"opencode-auth-page",children:x.jsxs("section",{className:"opencode-auth-panel",children:[x.jsx("h1",{children:"Model Authentication Setup"}),x.jsx("p",{className:"opencode-auth-error",children:p})]})}):i?T?x.jsx("div",{className:"opencode-auth-page",children:x.jsxs("section",{className:"opencode-auth-panel opencode-auth-panel-minimal",children:[x.jsx("header",{className:"opencode-auth-header opencode-auth-header-minimal",children:x.jsxs("div",{children:[x.jsx("h1",{children:"Model Authentication Setup"}),x.jsx("p",{className:"opencode-auth-subtitle",children:"Enter this device code in the opened OAuth page."})]})}),x.jsxs("div",{className:"opencode-auth-oauth-state",children:[x.jsx("label",{htmlFor:"opencode-device-code",children:"Device Code"}),x.jsx("input",{id:"opencode-device-code",type:"text",value:O,readOnly:!0}),x.jsx("p",{className:"opencode-auth-waiting",children:"Waiting for OAuth completion..."}),x.jsx("button",{type:"button",className:"opencode-auth-secondary",onClick:W,children:"Go back"})]})]})}):x.jsx("div",{className:"opencode-auth-page",children:x.jsxs("section",{className:"opencode-auth-panel",children:[x.jsxs("header",{className:"opencode-auth-header",children:[x.jsxs("div",{children:[x.jsx("h1",{children:"Model Authentication Setup"}),x.jsx("p",{className:"opencode-auth-subtitle",children:M?x.jsxs(x.Fragment,{children:["This model is configured at the service level for ",x.jsx("strong",{children:i.model})]}):x.jsxs(x.Fragment,{children:["Configure credentials for ",x.jsx("strong",{children:i.model})]})}),x.jsxs("p",{className:"opencode-auth-meta",children:["Provider: ",x.jsx("code",{children:i.provider_id})]})]}),x.jsx("div",{className:`opencode-auth-badge ${i.has_credentials?"is-connected":"is-required"}`,children:i.has_credentials?"Connected":M?"Admin Managed":"Setup Required"})]}),I&&x.jsxs("section",{className:"opencode-auth-section",children:[x.jsx("h2",{children:"Enter Authorization Code"}),x.jsxs("div",{className:"opencode-auth-card",children:[x.jsx("label",{htmlFor:"opencode-oauth-code",children:"Authorization Code"}),x.jsx("input",{id:"opencode-oauth-code",type:"text",value:u,onChange:X=>f(X.target.value),onKeyDown:Z,placeholder:"Paste authorization code and press Enter"}),x.jsx("button",{type:"button",onClick:te,children:"Submit code"}),x.jsx("button",{type:"button",className:"opencode-auth-secondary",onClick:W,children:"Go back"})]})]}),!I&&x.jsxs("section",{className:"opencode-auth-section",children:[x.jsx("h2",{children:M?"Service Configuration":"Choose auth method"}),S.length===0&&!M&&x.jsxs("p",{className:"opencode-auth-error",children:["No auth methods are available for provider ",x.jsx("code",{children:i.provider_id}),"."]}),M&&x.jsxs("div",{className:"opencode-auth-card opencode-auth-managed-card",children:[x.jsx("div",{className:"opencode-auth-card-header opencode-auth-managed-header",children:x.jsxs("div",{children:[x.jsx("h3",{children:"Managed By Administrator"}),x.jsx("p",{className:"opencode-auth-help",children:"This provider is read-only in TeamCopilot."})]})}),x.jsxs("div",{className:"opencode-auth-managed-layout",children:[x.jsx("p",{className:"opencode-auth-managed-intro",children:i.provider_id==="azure-openai"?x.jsx(x.Fragment,{children:"Azure OpenAI is configured through service environment variables. To update this model, ask the service administrator to change the values below and restart TeamCopilot."}):tA(i.provider_id)?x.jsx(x.Fragment,{children:"Google Vertex requires GOOGLE_CLOUD_PROJECT, GOOGLE_APPLICATION_CREDENTIALS, VERTEX_LOCATION, and OPENCODE_MODEL set in server environment variables. Ask the administrator to update the values below and restart TeamCopilot."}):x.jsxs(x.Fragment,{children:["This provider is managed through service environment variables. Ask the administrator which values to configure for"," ",x.jsx("code",{children:i.provider_id})," and restart TeamCopilot after they update the deployment."]})}),x.jsxs("div",{className:"opencode-auth-managed-example-block",children:[x.jsxs("div",{className:"opencode-auth-managed-example-header",children:[x.jsx("h4",{children:"Required Values"}),x.jsx("p",{children:i.provider_id==="azure-openai"?"Use your Azure deployment name in OPENCODE_MODEL":tA(i.provider_id)?"Use your OpenCode Vertex model id in OPENCODE_MODEL":`Set OPENCODE_MODEL for provider ${i.provider_id} plus any required service env vars.`})]}),x.jsx("div",{className:"opencode-auth-managed-example-list",children:B.length===0?x.jsx("p",{className:"opencode-auth-help",children:"No env examples are shown for this provider. Ask your administrator which variables apply."}):B.map(X=>x.jsxs("div",{className:"opencode-auth-managed-example-row",children:[x.jsx("div",{className:"opencode-auth-managed-example-copy",children:x.jsxs("code",{children:[X.key,"=",X.value]})}),x.jsx("p",{children:X.help})]},X.key))})]})]})]}),S.length>0&&x.jsx("div",{className:"opencode-auth-method-grid",children:S.map(X=>x.jsxs("button",{type:"button",className:`opencode-auth-method ${o===X.index?"is-selected":""}`,onClick:()=>{r(X.index),d(null),f("")},children:[x.jsx("span",{className:"opencode-auth-method-label",children:X.label}),x.jsx("span",{className:"opencode-auth-method-type",children:X.type.toUpperCase()})]},X.index))})]}),!I&&N?.type==="api"&&x.jsxs("section",{className:"opencode-auth-section",children:[x.jsx("h2",{children:"API key"}),x.jsx("p",{className:"opencode-auth-help",children:"Paste the API key for your selected provider and save it."}),x.jsxs("div",{className:"opencode-auth-card",children:[x.jsx("label",{htmlFor:"opencode-api-key",children:"Provider API Key"}),x.jsx("input",{id:"opencode-api-key",type:"password",value:a,onChange:X=>l(X.target.value),placeholder:"Paste API key"}),x.jsx("button",{type:"button",onClick:ee,children:"Save API Key"})]})]}),!I&&N?.type==="oauth"&&x.jsxs("section",{className:"opencode-auth-section",children:[x.jsx("h2",{children:"OAuth"}),!T&&x.jsx("p",{className:"opencode-auth-help",children:"Use OAuth login for subscription-backed access (for example Pro/Max plans)."}),x.jsx("div",{className:"opencode-auth-card",children:!T&&x.jsx("button",{type:"button",onClick:G,children:"Start OAuth"})})]})]})}):null}function lit(){const s=Io();return Da("OpenCode Auth Complete"),x.jsx("div",{className:"opencode-auth-complete-page",children:x.jsxs("section",{className:"opencode-auth-complete-card",children:[x.jsx("h1",{children:"Authentication Complete"}),x.jsx("p",{children:"Your model credentials are configured successfully."}),x.jsx("button",{type:"button",onClick:()=>s("/"),children:"Continue to dashboard"})]})})}function Gse(s,e){const t=s instanceof Hi?s.response?.data?.message||s.response?.data||s.message:e;return typeof t=="string"?t:e}function cit(){const s=Ss(),e=s.loading?null:s.token,t=Io(),i=!s.loading&&s.user?.role==="Engineer",[n,o]=F.useState(""),[r,a]=F.useState(!0),[l,c]=F.useState(!1),[d,u]=F.useState("");Da("Global AI Instructions");const f=F.useCallback(async()=>{if(!e||!i){a(!1);return}a(!0),u("");try{const m=await xt.get("/api/chat/user-instructions",{headers:{Authorization:`Bearer ${e}`}});o(typeof m.data?.content=="string"?m.data.content:"")}catch(m){u(Gse(m,"Failed to load global AI instructions"))}finally{a(!1)}},[i,e]);F.useEffect(()=>{f()},[f]);const p=async()=>{if(!(!e||!i)){c(!0);try{await xt.put("/api/chat/user-instructions",{content:n},{headers:{Authorization:`Bearer ${e}`}}),u(""),et.success("Global AI instructions saved")}catch(m){et.error(Gse(m,"Failed to save global AI instructions"))}finally{c(!1)}}};return F.useEffect(()=>{const m=b=>{(b.metaKey||b.ctrlKey)&&b.key.toLowerCase()==="s"&&(b.preventDefault(),!r&&!l&&p())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[p,r,l]),s.loading?null:i?x.jsx("div",{className:"user-instructions-page",children:x.jsxs("div",{className:"user-instructions-card",children:[x.jsxs("div",{className:"user-instructions-header",children:[x.jsxs("div",{children:[x.jsx("h1",{children:"Global AI instructions"}),x.jsxs("p",{children:["These are saved to ",x.jsx("code",{children:"USER_INSTRUCTIONS.md"})," at the workspace root and apply immediately."]})]}),x.jsxs("div",{className:"user-instructions-actions",children:[x.jsx("button",{type:"button",className:"secondary",onClick:()=>t("/?tab=ai"),children:"Back to AI chat"}),x.jsx("button",{type:"button",onClick:()=>{p()},disabled:r||l,children:"Save"})]})]}),d?x.jsx("div",{className:"user-instructions-error",children:d}):null,x.jsx("textarea",{className:"user-instructions-editor",value:n,onChange:m=>o(m.target.value),placeholder:r?"Loading...":"Add custom instructions for the AI agent here. You can tell it about your organisation, target audience, team members, anything on how it should behave, or what it should restrict.",disabled:r||l,spellCheck:!1})]})}):x.jsx("div",{className:"user-instructions-page",children:x.jsxs("div",{className:"user-instructions-card",children:[x.jsx("h1",{children:"Global AI instructions"}),x.jsx("p",{children:"Only engineers can modify global AI instructions."}),x.jsx("div",{className:"user-instructions-actions",children:x.jsx("button",{type:"button",className:"secondary",onClick:()=>t("/?tab=ai"),children:"Back to AI chat"})})]})})}function AB(s,e){return s instanceof Hi?String(s.response?.data?.message||s.response?.data||s.message):e}function Yse(s){return[...s].sort((e,t)=>e.key.localeCompare(t.key))}function dit(){const s=Ss(),e=Io(),t=s.loading?null:s.token,i=!s.loading&&s.user?.role==="Engineer",n=F.useMemo(()=>t?{Authorization:`Bearer ${t}`}:void 0,[t]),[o,r]=F.useState(!0),[a,l]=F.useState(null),[c,d]=F.useState([]),[u,f]=F.useState([]),[p,m]=F.useState(""),[b,C]=F.useState(""),[y,S]=F.useState(""),[L,k]=F.useState(""),[N,I]=F.useState(null),[T,O]=F.useState(null);Da("Profile Secrets");const M=F.useCallback(async()=>{if(n){r(!0),l(null);try{const j=xt.get("/api/users/me/secrets",{headers:n}),ee=xt.get("/api/secrets/global",{headers:n}),[G,te]=await Promise.all([j,ee]);d(Yse(G.data.secrets||[])),f(Yse(te.data.secrets||[]))}catch(j){l(AB(j,"Failed to load secrets"))}finally{r(!1)}}},[n,i]);F.useEffect(()=>{M()},[M]);const B=async j=>{if(!n)return;const ee=j==="user"?p:y,G=j==="user"?b:L,te=ee.trim().toUpperCase();if(!te||!G){et.error("Both key and value are required");return}I(j);try{await xt.put(j==="user"?`/api/users/me/secrets/${encodeURIComponent(te)}`:`/api/secrets/global/${encodeURIComponent(te)}`,{value:G},{headers:n}),et.success(j==="user"?"Personal secret saved":"Global secret saved"),j==="user"?(m(""),C("")):(S(""),k("")),await M()}catch(Z){et.error(AB(Z,"Failed to save secret"))}finally{I(null)}},W=async(j,ee)=>{if(n){O(`${j}:${ee}`);try{await xt.delete(j==="user"?`/api/users/me/secrets/${encodeURIComponent(ee)}`:`/api/secrets/global/${encodeURIComponent(ee)}`,{headers:n}),et.success(j==="user"?"Personal secret deleted":"Global secret deleted"),await M()}catch(G){et.error(AB(G,"Failed to delete secret"))}finally{O(null)}}};return s.loading?null:x.jsx("div",{className:"profile-secrets-page",children:x.jsxs("div",{className:"profile-secrets-card",children:[x.jsxs("div",{className:"profile-secrets-header",children:[x.jsxs("div",{children:[x.jsx("h1",{children:"Profile Secrets"}),x.jsx("p",{children:"Workflows and skills can require secret keys. Your personal secrets override engineer-managed global secrets with the same key."})]}),x.jsx("div",{className:"profile-secrets-actions",children:x.jsx("button",{type:"button",className:"secondary",onClick:()=>e("/"),children:"Back Home"})})]}),o&&x.jsx("div",{className:"profile-secrets-state",children:"Loading secrets..."}),a&&x.jsx("div",{className:"profile-secrets-error",children:a}),!o&&!a&&x.jsxs(x.Fragment,{children:[x.jsxs("section",{className:"profile-secrets-section",children:[x.jsx("div",{className:"profile-secrets-section-header",children:x.jsxs("div",{children:[x.jsx("h2",{children:"My Secrets"}),x.jsx("p",{children:"Visible only to you in masked form. Re-saving the same key replaces its value."})]})}),x.jsxs("div",{className:"profile-secrets-form",children:[x.jsx("input",{type:"text",name:"user-secret-key",autoComplete:"off",placeholder:"OPENAI_API_KEY",value:p,onChange:j=>m(j.target.value.toUpperCase())}),x.jsx("input",{type:"password",name:"user-secret-value",autoComplete:"new-password",placeholder:"Secret value",value:b,onChange:j=>C(j.target.value)}),x.jsx("button",{type:"button",onClick:()=>{B("user")},disabled:N!==null,children:N==="user"?"Saving...":"Save Secret"})]}),x.jsx("div",{className:"profile-secrets-list",children:c.length===0?x.jsx("div",{className:"profile-secrets-empty",children:"No personal secrets saved yet."}):c.map(j=>x.jsxs("div",{className:"profile-secrets-item",children:[x.jsxs("div",{children:[x.jsx("div",{className:"profile-secrets-item-key",children:j.key}),x.jsxs("div",{className:"profile-secrets-item-meta",children:[j.value," · Updated ",new Date(j.updated_at).toLocaleString()]})]}),x.jsx("button",{type:"button",className:"danger",onClick:()=>{W("user",j.key)},disabled:T===`user:${j.key}`,children:T===`user:${j.key}`?"Deleting...":"Delete"})]},j.key))})]}),x.jsxs("section",{className:"profile-secrets-section",children:[x.jsx("div",{className:"profile-secrets-section-header",children:x.jsxs("div",{children:[x.jsx("h2",{children:"Global Secrets"}),x.jsxs("p",{children:["Shared fallback secrets managed by engineers. Usable by all users, but personal secrets with the same key override these.",i?"":" You can view these masked values, but only engineers can edit them."]})]})}),i&&x.jsxs("div",{className:"profile-secrets-form",children:[x.jsx("input",{type:"text",name:"global-secret-key",autoComplete:"off",placeholder:"SLACK_BOT_TOKEN",value:y,onChange:j=>S(j.target.value.toUpperCase())}),x.jsx("input",{type:"password",name:"global-secret-value",autoComplete:"new-password",placeholder:"Global secret value",value:L,onChange:j=>k(j.target.value)}),x.jsx("button",{type:"button",onClick:()=>{B("global")},disabled:N!==null,children:N==="global"?"Saving...":"Save Global Secret"})]}),x.jsx("div",{className:"profile-secrets-list",children:u.length===0?x.jsx("div",{className:"profile-secrets-empty",children:"No global secrets saved yet."}):u.map(j=>x.jsxs("div",{className:"profile-secrets-item",children:[x.jsxs("div",{children:[x.jsx("div",{className:"profile-secrets-item-key",children:j.key}),x.jsxs("div",{className:"profile-secrets-item-meta",children:[j.value," · Updated ",new Date(j.updated_at).toLocaleString()]})]}),i&&x.jsx("button",{type:"button",className:"danger",onClick:()=>{W("global",j.key)},disabled:T===`global:${j.key}`,children:T===`global:${j.key}`?"Deleting...":"Delete"})]},j.key))})]})]})]})})}const uit=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}],hit=["UTC","Asia/Calcutta","America/Los_Angeles","America/New_York","Europe/London","Europe/Berlin","Asia/Singapore","Asia/Tokyo","Australia/Sydney"];function Hpe(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}function fit(){const s=Intl.supportedValuesOf,e=s?s("timeZone"):hit,t=Hpe();return Array.from(new Set([t,...e])).sort()}function git(s){const[e,t]=s.split(":").map(Number);return e*60+t}function pit(s){const t=Math.floor(9).toString().padStart(2,"0"),i=(540%60).toString().padStart(2,"0");return`${t}:${i}`}function mit(s,e){const t=s===1?e.slice(0,-1):e;return`${s} ${t}`}function _it(s){const e=git(s.time),t=e%60,i=Math.floor(e/60);return s.builderFrequency==="monthly"?`${t} ${i} ${s.day_of_month} * *`:s.builderFrequency==="weekly"?`${t} ${i} * * ${s.days_of_week.join(",")}`:`${t} ${i} * * *`}function bit(){const s=globalThis.crypto;return s&&typeof s.randomUUID=="function"?s.randomUUID():`step-${Date.now()}-${Math.random().toString(16).slice(2)}`}function Vpe(s=""){return{id:bit(),content:s}}function vit(){return{name:"",targetMode:"prompt",prompt:"",execution_steps:[],enabled:!0,allow_workflow_runs_without_permission:!0,monitor_timeout_value:2,monitor_timeout_unit:"hours",workflow_slug:"",workflow_inputs:{},scheduleMode:"builder",cron_expression:"0 9 * * *",timezone:Hpe(),builderFrequency:"daily",time:"09:00",days_of_week:[1,2,3,4,5],day_of_month:1}}function Cit(s,e={}){const t={};for(const[i,n]of Object.entries(s)){const o=e[i];n.type==="boolean"?t[i]=typeof o=="boolean"?o:n.default===!0:o!=null?t[i]=String(o):n.default!==void 0?t[i]=String(n.default):t[i]=""}return t}function wit(s,e){const t={};for(const[i,n]of Object.entries(s)){const o=e[i];if(n.type==="boolean"){t[i]=!!o;continue}const a=(typeof o=="string"?o:String(o)).trim();if(a.length===0){if(n.required!==!1&&n.default===void 0)return et.error(`Missing required workflow input: ${i}`),null;continue}if(n.type==="number"){const l=Number(a);if(!Number.isFinite(l))return et.error(`Invalid number for workflow input: ${i}`),null;t[i]=l;continue}t[i]=a}return t}function XN(s,e){if(s instanceof Hi){const t=s.response?.data;return typeof t?.message=="string"?t.message:typeof t=="string"?t:s.message||e}return s instanceof Error?s.message:e}function yit(s){const e=DS.parse(s.prompt);return{name:s.name,targetMode:s.target?.target_type??"prompt",prompt:e.prompt,execution_steps:e.executionSteps.map(t=>Vpe(t)),enabled:s.enabled,allow_workflow_runs_without_permission:s.allow_workflow_runs_without_permission,monitor_timeout_value:s.monitor_timeout_value,monitor_timeout_unit:s.monitor_timeout_unit,workflow_slug:s.target?.workflow_slug??"",workflow_inputs:{},scheduleMode:"cron",cron_expression:s.schedule.cron_expression,timezone:s.schedule.timezone,builderFrequency:"daily",time:pit(),days_of_week:[1,2,3,4,5],day_of_month:1}}function Zse(){const s=Ss(),e=Io(),i=Qb().id??null,n=i!==null,o=s.loading?null:s.token,[r,a]=F.useState(()=>vit()),[l,c]=F.useState(n),[d,u]=F.useState(!1),[f,p]=F.useState(null),[m,b]=F.useState([]),[C,y]=F.useState(null),[S,L]=F.useState(!1),[k,N]=F.useState(null),I=F.useRef({}),T=F.useRef({}),[O,M]=F.useState(()=>new Set);Da(n?"Edit Cronjob":"Create Cronjob");const B=F.useCallback(async()=>{if(!(!o||!i))try{const H=(await xt.get(`/api/cronjobs/${i}`,{headers:{Authorization:`Bearer ${o}`}})).data.cronjob;a(yit(H)),I.current=H.target?.workflow_inputs??{},p(null)}catch(J){p(XN(J,"Failed to load cronjob"))}finally{c(!1)}},[i,o]);if(F.useEffect(()=>{n&&B()},[n,B]),F.useEffect(()=>{if(!o)return;let J=!1;return(async()=>{try{const $=await xt.get("/api/workflows",{headers:{Authorization:`Bearer ${o}`}});J||b($.data.workflows.filter(le=>le.is_approved&&le.can_edit))}catch($){J||N(XN($,"Failed to load workflows"))}})(),()=>{J=!0}},[o]),F.useEffect(()=>{if(!o||r.targetMode!=="workflow"||!r.workflow_slug){y(null);return}let J=!1;return(async()=>{L(!0),N(null);try{const le=(await xt.get(`/api/workflows/${encodeURIComponent(r.workflow_slug)}`,{headers:{Authorization:`Bearer ${o}`}})).data.workflow;if(!J){y(le);const q=I.current;I.current={},a(Ae=>({...Ae,workflow_inputs:Cit(le.manifest.inputs??{},q)}))}}catch($){J||N(XN($,"Failed to load workflow details"))}finally{J||L(!1)}})(),()=>{J=!0}},[r.targetMode,r.workflow_slug,o]),s.loading)return null;const W=()=>{const J=r.targetMode==="workflow"?wit(C?.manifest.inputs??{},r.workflow_inputs):null;return r.targetMode==="workflow"&&J===null?null:{...{name:r.name,target_type:r.targetMode,prompt:r.targetMode==="prompt"?DS.buildWithExecutionSteps(r.prompt,r.execution_steps.map($=>$.content)):null,workflow_slug:r.targetMode==="workflow"?r.workflow_slug:null,workflow_inputs:r.targetMode==="workflow"?J:null,enabled:r.enabled,allow_workflow_runs_without_permission:r.targetMode==="prompt"?r.allow_workflow_runs_without_permission:null,monitor_timeout_value:r.monitor_timeout_value,monitor_timeout_unit:r.monitor_timeout_unit,timezone:r.timezone},cron_expression:r.scheduleMode==="cron"?r.cron_expression:_it(r)}},j=J=>{a(H=>{const $=H.days_of_week.includes(J)?H.days_of_week.filter(le=>le!==J):[...H.days_of_week,J].sort((le,q)=>le-q);return{...H,days_of_week:$.length===0?H.days_of_week:$}})},ee=()=>{a(J=>({...J,execution_steps:[...J.execution_steps,Vpe()]}))},G=(J,H)=>{a($=>({...$,execution_steps:$.execution_steps.map(le=>le.id===J?{...le,content:H}:le)}))},te=J=>{a(H=>({...H,execution_steps:H.execution_steps.filter($=>$.id!==J)}))},Z=J=>{const H=new Map(r.execution_steps.map(le=>[le.id,T.current[le.id]?.getBoundingClientRect().top??null])),$=new Set([r.execution_steps[J]?.id,r.execution_steps[J+1]?.id].filter(le=>!!le));a(le=>{if(J<0||J>=le.execution_steps.length-1)return le;const q=[...le.execution_steps];return[q[J],q[J+1]]=[q[J+1],q[J]],{...le,execution_steps:q}}),requestAnimationFrame(()=>{const le=new Set;for(const q of $){const Ae=T.current[q],Ze=H.get(q);if(!Ae||Ze===null||Ze===void 0)continue;const it=Ae.getBoundingClientRect().top,ut=Ze-it;ut!==0&&(Ae.style.transform=`translateY(${ut}px)`,Ae.style.transition="transform 0s",le.add(q))}le.size!==0&&(M(le),requestAnimationFrame(()=>{for(const q of le){const Ae=T.current[q];Ae&&(Ae.style.transition="transform 0.24s ease",Ae.style.transform="")}window.setTimeout(()=>{for(const q of le){const Ae=T.current[q];Ae&&(Ae.style.transition="")}M(new Set)},260)}))})},X=async J=>{if(J.preventDefault(),!o)return;if(r.targetMode==="prompt"&&r.prompt.includes(DS.LEGACY_TODO_STEP_MARKER)){et.error(`Do not add "${DS.LEGACY_TODO_STEP_MARKER}" in the prompt. Add those items as execution steps instead.`);return}const H=W();if(H!==null){u(!0);try{i?(await xt.patch(`/api/cronjobs/${i}`,H,{headers:{Authorization:`Bearer ${o}`}}),et.success("Cronjob updated")):(await xt.post("/api/cronjobs",H,{headers:{Authorization:`Bearer ${o}`}}),et.success("Cronjob created")),e("/?tab=cronjobs")}catch($){et.error(XN($,"Failed to save cronjob"))}finally{u(!1)}}};if(l)return x.jsx("div",{className:"cronjob-page-state",children:"Loading cronjob..."});if(f)return x.jsx("div",{className:"cronjob-page-state error",children:f});const re=fit();return x.jsxs("main",{className:"cronjob-form-page",children:[x.jsx("button",{className:"cronjob-back-btn",onClick:()=>e("/?tab=cronjobs"),children:"Back to cronjobs"}),x.jsxs("section",{className:"cronjob-builder-shell",children:[x.jsxs("aside",{className:"cronjob-builder-aside",children:[x.jsx("p",{className:"cronjobs-eyebrow",children:"Scheduled agent"}),x.jsx("h1",{children:n?"Edit cronjob":"Create a cronjob"}),x.jsx("p",{children:"Define a prompt or workflow that should run on a schedule. Prompts can invoke workflows or other skills."})]}),x.jsxs("form",{className:"cronjob-builder-form",onSubmit:X,children:[x.jsxs("section",{className:"cronjob-form-panel",children:[x.jsxs("div",{className:"cronjob-panel-heading",children:[x.jsx("span",{children:"01"}),x.jsxs("div",{children:[x.jsx("h2",{children:"What should run?"}),x.jsx("p",{children:"Run either an agent prompt or a specific workflow with fixed inputs."})]})]}),x.jsxs("div",{className:"cronjob-form-grid",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Name"}),x.jsx("input",{value:r.name,onChange:J=>a(H=>({...H,name:J.target.value})),placeholder:"Morning repo check",required:!0})]}),x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Target type"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.targetMode,onChange:J=>a(H=>({...H,targetMode:J.target.value})),children:[x.jsx("option",{value:"prompt",children:"Prompt"}),x.jsx("option",{value:"workflow",children:"Workflow"})]})})]})]}),r.targetMode==="prompt"?x.jsxs("div",{className:"cronjob-prompt-builder",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Prompt"}),x.jsx("textarea",{value:r.prompt,onChange:J=>a(H=>({...H,prompt:J.target.value})),placeholder:"Check the repo health, run the relevant workflow if needed, and mark the cronjob completed with a concise summary.",required:!0})]}),x.jsxs("div",{className:"cronjob-prompt-steps",children:[x.jsxs("div",{className:"cronjob-prompt-steps-header",children:[x.jsxs("div",{children:[x.jsx("span",{children:"Execution steps"}),x.jsx("p",{children:"Optional. These are inserted into the cronjob todo list before the agent starts."})]}),x.jsx("button",{type:"button",className:"cronjob-step-add",onClick:ee,children:"Add step"})]}),r.execution_steps.length===0?x.jsx("div",{className:"cronjob-prompt-steps-empty",children:"Add steps when you want the agent to follow a specific sequence."}):x.jsx("div",{className:"cronjob-step-list",children:r.execution_steps.map((J,H)=>x.jsx("div",{ref:$=>{T.current[J.id]=$},className:`cronjob-step-row-wrap${O.has(J.id)?" is-reordering":""}`,children:x.jsxs("div",{className:"cronjob-step-row",children:[x.jsx("span",{className:"cronjob-step-index",children:H+1}),x.jsx("textarea",{value:J.content,onChange:$=>G(J.id,$.target.value),placeholder:`Step ${H+1}`}),x.jsx("button",{type:"button",className:"cronjob-step-move-down","aria-label":`Move step ${H+1} down`,title:H===r.execution_steps.length-1?"Already last step":`Swap step ${H+1} with step ${H+2}`,disabled:H===r.execution_steps.length-1,onClick:()=>Z(H),children:"↓"}),x.jsx("button",{type:"button",className:"cronjob-step-remove","aria-label":`Remove step ${H+1}`,title:`Remove step ${H+1}`,onClick:()=>te(J.id),children:"×"})]})},J.id))})]})]}):x.jsxs("div",{className:"cronjob-workflow-target",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Workflow"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.workflow_slug,onChange:J=>a(H=>({...H,workflow_slug:J.target.value,workflow_inputs:{}})),required:!0,children:[x.jsx("option",{value:"",children:"Select workflow"}),m.map(J=>x.jsx("option",{value:J.slug,children:J.name||J.slug},J.slug))]})})]}),k&&x.jsx("p",{className:"cronjob-inline-error",children:k}),S&&x.jsx("p",{className:"cronjob-muted-copy",children:"Loading workflow inputs..."}),C&&x.jsxs("div",{className:"cronjob-workflow-inputs",children:[x.jsx("p",{children:C.required_secrets.length>0?`Required secrets: ${C.required_secrets.join(", ")}`:"This workflow does not declare required secrets."}),C.missing_required_secrets.length>0&&x.jsxs("p",{className:"cronjob-inline-error",children:["Missing secrets: ",C.missing_required_secrets.join(", ")]}),Object.keys(C.manifest.inputs??{}).length===0?x.jsx("p",{className:"cronjob-muted-copy",children:"This workflow does not take input arguments."}):x.jsx("div",{className:"cronjob-form-grid",children:Object.entries(C.manifest.inputs).map(([J,H])=>x.jsxs("label",{className:"cronjob-field",children:[x.jsxs("span",{children:[J,H.required!==!1?" *":""]}),H.description&&x.jsx("small",{className:"cronjob-muted-copy",children:H.description}),H.type==="boolean"?x.jsxs("div",{className:"cronjob-day-picker",children:[x.jsx("button",{type:"button",className:r.workflow_inputs[J]===!0?"active":"",onClick:()=>a($=>({...$,workflow_inputs:{...$.workflow_inputs,[J]:!0}})),children:"Yes"}),x.jsx("button",{type:"button",className:r.workflow_inputs[J]!==!0?"active":"",onClick:()=>a($=>({...$,workflow_inputs:{...$.workflow_inputs,[J]:!1}})),children:"No"})]}):x.jsx("input",{type:H.type==="number"?"number":"text",value:String(r.workflow_inputs[J]??""),onChange:$=>a(le=>({...le,workflow_inputs:{...le.workflow_inputs,[J]:$.target.value}})),placeholder:H.default!==void 0?String(H.default):"",required:H.required!==!1&&H.default===void 0})]},J))})]})]})]}),x.jsxs("section",{className:"cronjob-form-panel",children:[x.jsxs("div",{className:"cronjob-panel-heading",children:[x.jsx("span",{children:"02"}),x.jsxs("div",{children:[x.jsx("h2",{children:"When should it run?"}),x.jsx("p",{children:"Use the schedule builder for common schedules or enter raw cron for full control."})]})]}),x.jsxs("div",{className:"cronjob-form-grid",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Schedule type"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.scheduleMode,onChange:J=>a(H=>({...H,scheduleMode:J.target.value})),children:[x.jsx("option",{value:"builder",children:"Schedule builder"}),x.jsx("option",{value:"cron",children:"Cron expression"})]})})]}),r.scheduleMode==="builder"?x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Timezone"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsx("select",{value:r.timezone,onChange:J=>a(H=>({...H,timezone:J.target.value})),children:re.map(J=>x.jsx("option",{value:J,children:J},J))})})]}):x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Cron expression"}),x.jsx("input",{value:r.cron_expression,onChange:J=>a(H=>({...H,cron_expression:J.target.value})),placeholder:"0 9 * * *",required:!0})]})]}),r.scheduleMode==="builder"?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"cronjob-form-grid",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Frequency"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.builderFrequency,onChange:J=>a(H=>({...H,builderFrequency:J.target.value})),children:[x.jsx("option",{value:"daily",children:"Every day"}),x.jsx("option",{value:"weekly",children:"Specific weekdays"}),x.jsx("option",{value:"monthly",children:"Specific day of month"})]})})]}),x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Time of day"}),x.jsx("input",{type:"time",value:r.time,onChange:J=>a(H=>({...H,time:J.target.value})),required:!0})]})]}),r.builderFrequency==="weekly"?x.jsx(x.Fragment,{children:x.jsx("div",{className:"cronjob-day-picker","aria-label":"Days of week",children:uit.map(J=>x.jsx("button",{type:"button",className:r.days_of_week.includes(J.value)?"active":"",onClick:()=>j(J.value),children:J.label},J.value))})}):null,r.builderFrequency==="monthly"?x.jsxs("label",{className:"cronjob-field cronjob-short-field",children:[x.jsx("span",{children:"Day of month"}),x.jsx("input",{type:"number",min:1,max:31,value:r.day_of_month,onChange:J=>a(H=>({...H,day_of_month:Number(J.target.value)})),required:!0})]}):null]}):x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Timezone"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsx("select",{value:r.timezone,onChange:J=>a(H=>({...H,timezone:J.target.value})),children:re.map(J=>x.jsx("option",{value:J,children:J},J))})})]})]}),x.jsxs("section",{className:"cronjob-form-panel",children:[x.jsxs("div",{className:"cronjob-panel-heading",children:[x.jsx("span",{children:"03"}),x.jsxs("div",{children:[x.jsx("h2",{children:"Runtime policy"}),x.jsx("p",{children:r.targetMode==="workflow"?"Workflow cronjobs run directly with the saved inputs.":"Choose how aggressively the cronjob should avoid asking for help."})]})]}),x.jsxs("label",{className:"cronjob-switch-row",children:[x.jsx("input",{type:"checkbox",checked:r.enabled,onChange:J=>a(H=>({...H,enabled:J.target.checked}))}),x.jsxs("span",{children:[x.jsx("strong",{children:"Enabled"}),x.jsx("small",{children:"Schedule this cronjob after saving."})]})]}),r.targetMode==="prompt"?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"cronjob-form-grid",children:[x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Job timeout"}),x.jsx("input",{type:"number",min:0,step:"any",value:r.monitor_timeout_value,onChange:J=>a(H=>({...H,monitor_timeout_value:Number(J.target.value)})),required:!0})]}),x.jsxs("label",{className:"cronjob-field",children:[x.jsx("span",{children:"Timeout unit"}),x.jsx("div",{className:"cronjob-select-wrap",children:x.jsxs("select",{value:r.monitor_timeout_unit,onChange:J=>a(H=>({...H,monitor_timeout_unit:J.target.value})),children:[x.jsx("option",{value:"minutes",children:"Minutes"}),x.jsx("option",{value:"hours",children:"Hours"}),x.jsx("option",{value:"days",children:"Days"})]})})]})]}),x.jsxs("p",{className:"cronjob-muted-copy",children:["The job will fail a run if it stays active longer than ",mit(r.monitor_timeout_value,r.monitor_timeout_unit),"."]})]}):null,r.targetMode==="prompt"?x.jsxs("label",{className:"cronjob-switch-row",children:[x.jsx("input",{type:"checkbox",checked:r.allow_workflow_runs_without_permission,onChange:J=>a(H=>({...H,allow_workflow_runs_without_permission:J.target.checked}))}),x.jsxs("span",{children:[x.jsx("strong",{children:"Allow workflow runs without user permission"}),x.jsx("small",{children:"If off, workflow execution can escalate the cronjob into a user-visible chat."})]})]}):x.jsx("div",{className:"cronjob-policy-note",children:"Workflow cronjobs do not request runtime permission."})]}),x.jsxs("div",{className:"cronjob-builder-actions",children:[x.jsx("button",{type:"button",onClick:()=>e("/?tab=cronjobs"),children:"Cancel"}),x.jsx("button",{className:"cronjobs-primary-btn",type:"submit",disabled:d,children:d?"Saving...":n?"Save cronjob":"Create cronjob"})]})]})]})]})}function Xse(s,e){if(s instanceof Hi){const t=s.response?.data;return typeof t?.message=="string"?t.message:typeof t=="string"?t:s.message||e}return s instanceof Error?s.message:e}function Qse(s){return s===null?"Still running":new Date(s).toLocaleString()}function Sit(s){return s.replaceAll("_"," ")}function xit(){const s=Ss(),e=s.loading?null:s.token,t=Io(),n=Qb().id,[o,r]=F.useState(null),[a,l]=F.useState(!0),[c,d]=F.useState(null),[u,f]=F.useState(null);Da("Cronjob Run");const p=F.useCallback(async C=>{if(e)try{C?.showLoading!==!1&&l(!0);const y=await xt.get(`/api/cronjobs/runs/${n}`,{headers:{Authorization:`Bearer ${e}`}});r(y.data.run),f(null)}catch(y){f(Xse(y,"Failed to load cronjob run"))}finally{C?.showLoading!==!1&&l(!1)}},[n,e]);F.useEffect(()=>{p()},[p]),F.useEffect(()=>{if(!o||o.status!=="running")return;const C=window.setInterval(()=>{p({showLoading:!1})},2e3);return()=>window.clearInterval(C)},[p,o]);const m=F.useMemo(()=>!o?.session_id||!o.opencode_session_id?null:{id:o.session_id,opencode_session_id:o.opencode_session_id,title:`Cronjob run ${o.id.slice(0,8)}`,created_at:o.started_at,updated_at:o.completed_at??Date.now(),state:o.status==="running"?"processing":"idle",latest_message_id:null,cronjob_control:o.target_type_snapshot==="prompt"&&["running","paused"].includes(o.status)?{run_id:o.id,status:o.status,can_interrupt:o.status==="running",can_resume:o.status==="paused",can_terminate:!0}:null},[o]),b=async C=>{if(!(!e||!o)){d(C);try{if(await xt.post(`/api/cronjobs/runs/${o.id}/${C}`,{},{headers:{Authorization:`Bearer ${e}`}}),C==="interrupt"){const S=new URLSearchParams({tab:"ai"});o.session_id&&S.set("session",o.session_id),t({pathname:"/",search:S.toString()});return}const y=C==="resume"?"resumed":"terminated";et.success(`Cronjob run ${y}`),await p({showLoading:!1})}catch(y){et.error(Xse(y,`Failed to ${C} cronjob run`))}finally{d(null)}}};return s.loading||a?x.jsx("div",{className:"cronjob-run-state",children:"Loading cronjob run..."}):u||!o?x.jsx("div",{className:"cronjob-run-state error",children:u??"Cronjob run not found"}):x.jsxs("main",{className:"cronjob-run-page",children:[x.jsxs("div",{className:"cronjob-run-topbar",children:[x.jsx("button",{onClick:()=>t("/?tab=cronjobs"),children:"Back to cronjobs"}),x.jsx("button",{onClick:()=>t(`/cronjobs/${o.cronjob_id}/edit`),children:"Edit cronjob"})]}),x.jsxs("section",{className:"cronjob-run-header",children:[x.jsxs("div",{children:[x.jsx("p",{className:"cronjobs-eyebrow",children:o.target_type_snapshot==="workflow"?"Workflow cronjob run":"Cronjob transcript"}),x.jsxs("h1",{children:["Run ",o.id.slice(0,8)]}),x.jsx("p",{children:o.target_type_snapshot==="workflow"?"This scheduled workflow run executes directly with the saved inputs.":"Watch live agent messages while running, or review the same transcript after completion."})]}),x.jsxs("div",{className:"cronjob-run-status-card",children:[x.jsx("span",{children:"Status"}),x.jsx("strong",{children:Sit(o.status)}),o.target_type_snapshot==="prompt"&&o.status==="running"&&x.jsx("button",{className:"cronjob-run-stop-btn",onClick:()=>b("interrupt"),disabled:c!==null,children:c==="interrupt"?"Interrupting...":"Interrupt"}),o.target_type_snapshot==="prompt"&&o.status==="paused"&&x.jsx("button",{className:"cronjob-run-ai-btn",onClick:()=>b("resume"),disabled:c!==null,children:c==="resume"?"Resuming...":"Resume"}),(o.target_type_snapshot==="prompt"&&["running","paused"].includes(o.status)||o.target_type_snapshot==="workflow"&&o.status==="running")&&x.jsx("button",{className:"cronjob-run-stop-btn",onClick:()=>b("terminate"),disabled:c!==null,children:c==="terminate"?"Terminating...":"Terminate"})]})]}),x.jsxs("section",{className:"cronjob-run-meta",children:[x.jsxs("div",{children:[x.jsx("span",{children:"Target"}),x.jsx("strong",{children:o.target_type_snapshot==="workflow"?`Workflow: ${o.workflow_slug_snapshot}`:"Prompt"})]}),o.workflow_run_id&&x.jsxs("div",{children:[x.jsx("span",{children:"Workflow run"}),x.jsx("strong",{children:o.workflow_run_id.slice(0,8)})]}),x.jsxs("div",{children:[x.jsx("span",{children:"Started"}),x.jsx("strong",{children:Qse(o.started_at)})]}),x.jsxs("div",{children:[x.jsx("span",{children:"Completed"}),x.jsx("strong",{children:Qse(o.completed_at)})]}),o.summary&&x.jsxs("div",{className:"cronjob-run-meta-wide",children:[x.jsx("span",{children:"Summary"}),x.jsx("strong",{children:o.summary})]}),o.error_message&&x.jsxs("div",{className:"cronjob-run-meta-wide",children:[x.jsx("span",{children:"Error"}),x.jsx("strong",{children:o.error_message})]})]}),m?x.jsx(nae,{initialDraftMessage:null,forceNewChat:!1,onDraftHandled:()=>{},fixedSession:m,readOnly:!0}):x.jsx("div",{className:"cronjob-run-state",children:o.target_type_snapshot==="workflow"?"This workflow cronjob does not have an agent chat transcript. Open the linked workflow run from workflow history for detailed logs.":"This run does not have an agent session transcript."})]})}function qq(s){const[e,t]=F.useState(null),[i,n]=F.useState(!1);return F.useEffect(()=>{s&&xt.get("/api/opencode-auth/status",{headers:{Authorization:`Bearer ${s}`}}).then(o=>{n(o.data.has_credentials),t(s)}).catch(o=>{const r=o instanceof Hi?o.response?.data?.message||o.response?.data||o.message:"Failed to check opencode auth status";console.error(r),n(!1),t(s)})},[s]),s?{loading:e!==s,hasCredentials:i}:{loading:!1,hasCredentials:!1}}function oa({children:s}){const e=Ss();return e.loading?null:e.user?x.jsx(x.Fragment,{children:s}):x.jsx(Ck,{to:"/login",replace:!0})}function Nl({children:s}){const e=Ss(),t=e.loading?null:e.token,{loading:i,hasCredentials:n}=qq(t);return i?null:n?x.jsx(x.Fragment,{children:s}):x.jsx(Ck,{to:"/opencode-auth",replace:!0})}function Lit(){const s=Ss(),e=s.loading?null:s.token,{loading:t}=qq(e);return t?null:x.jsx(ait,{})}function kit(){const s=Ss(),e=s.loading?null:s.token,{loading:t,hasCredentials:i}=qq(e);return t?null:i?x.jsx(lit,{}):x.jsx(Ck,{to:"/opencode-auth",replace:!0})}function Dit({children:s}){const e=Ss();return e.loading?null:e.user?x.jsx(Ck,{to:"/",replace:!0}):x.jsx(x.Fragment,{children:s})}function Eit(){const s=Ss(),e=Io(),[t,i]=F.useState(null),[n,o]=F.useState(null),[r,a]=F.useState(!1);return F.useEffect(()=>{xt.get("/api/workspace").then(l=>{i(l.data.workspace_dir),o(null)}).catch(l=>{const c=l instanceof Hi?l.response?.data?.message||l.response?.data||l.message:"Failed to load workspace path";o(c)})},[]),F.useEffect(()=>{const l=()=>{window.innerWidth>720&&a(!1)};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),x.jsxs("div",{className:"app-shell",children:[x.jsxs("header",{className:"app-header",children:[x.jsxs("div",{className:"app-header-top",children:[x.jsxs("div",{className:"app-brand-block",children:[x.jsxs("div",{className:"app-brand-row",children:[x.jsxs("div",{className:"app-brand",children:[x.jsx("img",{src:"/logo.svg",alt:"TeamCopilot logo",className:"app-brand-logo"}),x.jsxs("div",{className:"app-brand-copy",children:[x.jsx("div",{className:"app-brand-text",children:"TeamCopilot"}),x.jsxs("div",{className:"app-version",children:["v","0.4.4"]})]})]}),!s.loading&&s.user&&x.jsxs("button",{type:"button",className:"app-header-menu-toggle","aria-label":r?"Close header menu":"Open header menu","aria-expanded":r,"aria-controls":"app-header-mobile-menu",onClick:()=>a(l=>!l),children:[x.jsx("span",{}),x.jsx("span",{}),x.jsx("span",{})]})]}),x.jsxs("div",{className:"app-workspace",children:[x.jsx("span",{className:"app-workspace-label",children:"Workspace"}),x.jsx("span",{className:"app-workspace-value",children:n??t??"Loading..."})]})]}),x.jsxs("div",{className:"app-header-meta",children:[!s.loading&&s.user&&x.jsx("button",{className:"app-header-link-btn",onClick:()=>e("/profile/secrets"),children:"Profile Secrets"}),!s.loading&&s.user&&x.jsxs("div",{className:"app-user",children:[x.jsx("span",{className:"app-user-name",children:s.user.name}),x.jsx("span",{className:"app-user-email",children:s.user.email})]}),!s.loading&&s.user&&x.jsx("button",{className:"app-signout",onClick:s.logout,children:"Sign Out"})]})]}),!s.loading&&s.user&&x.jsxs("div",{id:"app-header-mobile-menu",className:`app-header-mobile-menu ${r?"open":""}`,children:[x.jsxs("div",{className:"app-header-mobile-section",children:[x.jsx("span",{className:"app-header-mobile-label",children:"Version"}),x.jsxs("span",{className:"app-header-mobile-value",children:["v","0.4.4"]})]}),x.jsxs("div",{className:"app-header-mobile-section",children:[x.jsx("span",{className:"app-header-mobile-label",children:"Workspace"}),x.jsx("span",{className:"app-header-mobile-value app-header-mobile-mono",children:n??t??"Loading..."})]}),x.jsxs("div",{className:"app-header-mobile-section",children:[x.jsx("span",{className:"app-header-mobile-label",children:"Signed In As"}),x.jsx("span",{className:"app-header-mobile-value",children:s.user.name}),x.jsx("span",{className:"app-header-mobile-subvalue",children:s.user.email})]}),x.jsx("button",{className:"app-header-link-btn app-header-link-btn-mobile",onClick:()=>e("/profile/secrets"),children:"Profile Secrets"}),x.jsx("button",{className:"app-signout app-signout-mobile",onClick:s.logout,children:"Sign Out"})]})]}),x.jsxs(ive,{children:[x.jsx(Ko,{path:"/login",element:x.jsx(Dit,{children:x.jsx(Xwe,{})})}),x.jsx(Ko,{path:"/opencode-auth",element:x.jsx(oa,{children:x.jsx(Lit,{})})}),x.jsx(Ko,{path:"/opencode-auth/complete",element:x.jsx(oa,{children:x.jsx(kit,{})})}),x.jsx(Ko,{path:"/user-instructions",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(cit,{})})})}),x.jsx(Ko,{path:"/profile/secrets",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(dit,{})})})}),x.jsx(Ko,{path:"/",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(mDe,{})})})}),x.jsx(Ko,{path:"/cronjobs/new",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Zse,{})})})}),x.jsx(Ko,{path:"/cronjobs/:id/edit",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Zse,{})})})}),x.jsx(Ko,{path:"/cronjobs/runs/:id",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(xit,{})})})}),x.jsx(Ko,{path:"/runs/:id",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Ytt,{})})})}),x.jsx(Ko,{path:"/workflows/:slug/manual-run",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Xtt,{})})})}),x.jsx(Ko,{path:"/workflows/:slug/api-run",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(nit,{})})})}),x.jsx(Ko,{path:"/workflows/:slug",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(jtt,{})})})}),x.jsx(Ko,{path:"/skills/:slug",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(Utt,{})})})}),x.jsx(Ko,{path:"/workflows/:slug/approval-review",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx($tt,{})})})}),x.jsx(Ko,{path:"/skills/:slug/approval-review",element:x.jsx(oa,{children:x.jsx(Nl,{children:x.jsx(qtt,{})})})}),x.jsx(Ko,{path:"*",element:x.jsx(Ck,{to:"/",replace:!0})})]})]})}function Nit(){return x.jsx(Zwe,{children:x.jsx(Eit,{})})}obe.createRoot(document.getElementById("root")).render(x.jsx(F.StrictMode,{children:x.jsxs(Dve,{children:[x.jsx(Nit,{}),x.jsx(bCe,{position:"bottom-right",autoClose:5e3})]})}));export{rD as m,rfe as t};
|