teamcopilot 0.0.3 → 0.1.0
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-BBJnYJ3k.js → cssMode-Bsa7tmw2.js} +1 -1
- package/dist/frontend/assets/{freemarker2-D_OsaDj3.js → freemarker2-CrKZYA9-.js} +1 -1
- package/dist/frontend/assets/{handlebars-OZHda73C.js → handlebars-BgBTN99O.js} +1 -1
- package/dist/frontend/assets/{html-CdGHj-sb.js → html-D36ptcmC.js} +1 -1
- package/dist/frontend/assets/{htmlMode-DmOnHDtb.js → htmlMode-CGVK_FcF.js} +1 -1
- package/dist/frontend/assets/{index-DNOGp3R4.js → index-BcB_fBN5.js} +3 -3
- package/dist/frontend/assets/index-Ds8n3J4W.css +1 -0
- package/dist/frontend/assets/{javascript--es-Ez5N.js → javascript-C6sCQzuh.js} +1 -1
- package/dist/frontend/assets/{jsonMode-C3d51Wej.js → jsonMode-Bh2liG7i.js} +1 -1
- package/dist/frontend/assets/{liquid-D2JYL9PO.js → liquid-CvdwL9kp.js} +1 -1
- package/dist/frontend/assets/{mdx-Ch04DugU.js → mdx-CdZzWG3e.js} +1 -1
- package/dist/frontend/assets/{python-D-iNySlZ.js → python-CSUJS9Bk.js} +1 -1
- package/dist/frontend/assets/{razor-Bq45_Fpy.js → razor-ypTGnW2v.js} +1 -1
- package/dist/frontend/assets/{tsMode-CC8kGhhz.js → tsMode-Cr9H7DaY.js} +1 -1
- package/dist/frontend/assets/{typescript-CtgyIznM.js → typescript-wuTifRF-.js} +1 -1
- package/dist/frontend/assets/{xml-D5joow3e.js → xml-DoFtLqDh.js} +1 -1
- package/dist/frontend/assets/{yaml-BsRI11pd.js → yaml-CrPwKSmj.js} +1 -1
- package/dist/frontend/index.html +2 -2
- package/dist/opencode-server.js +3 -0
- package/dist/utils/approval-snapshot-common.js +29 -16
- package/dist/utils/resource-files.js +22 -21
- package/dist/utils/skill.js +39 -9
- package/dist/utils/workspace-sync.js +5 -7
- package/dist/workspace_files/.opencode/opencode.json +4 -1
- package/dist/workspace_files/.opencode/package.json +2 -1
- package/dist/workspace_files/.opencode/plugins/createSkill.ts +38 -7
- package/dist/workspace_files/.opencode/plugins/createWorkflow.ts +34 -3
- package/dist/workspace_files/.opencode/plugins/findSimilarWorkflow.ts +33 -2
- package/dist/workspace_files/.opencode/plugins/findSkill.ts +36 -5
- package/dist/workspace_files/.opencode/plugins/getSkillContent.ts +34 -3
- package/dist/workspace_files/.opencode/plugins/honeytoken-protection.ts +1 -1
- package/dist/workspace_files/.opencode/plugins/listAvailableSkills.ts +33 -2
- package/dist/workspace_files/.opencode/plugins/listAvailableWorkflows.ts +33 -2
- package/dist/workspace_files/.opencode/plugins/runWorkflow.ts +34 -3
- package/dist/workspace_files/.opencode/plugins/skill-command-guard.ts +138 -0
- package/dist/workspace_files/AGENTS.md +3 -3
- package/dist/workspace_files/package-lock.json +2 -1
- package/dist/workspace_files/package.json +3 -1
- package/package.json +1 -1
- package/dist/frontend/assets/index-CnBE4Efj.css +0 -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-C6sCQzuh.js","assets/typescript-wuTifRF-.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 hz(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var OF={exports:{}},u0={};var kZ;function C_e(){if(kZ)return u0;kZ=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 u0.Fragment=e,u0.jsx=t,u0.jsxs=t,u0}var DZ;function w_e(){return DZ||(DZ=1,OF.exports=C_e()),OF.exports}var N=w_e(),PF={exports:{}},Li={};var EZ;function y_e(){if(EZ)return Li;EZ=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(Q){return Q===null||typeof Q!="object"?null:(Q=f&&Q[f]||Q["@@iterator"],typeof Q=="function"?Q:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function y(Q,me,U){this.props=Q,this.context=me,this.refs=w,this.updater=U||m}y.prototype.isReactComponent={},y.prototype.setState=function(Q,me){if(typeof Q!="object"&&typeof Q!="function"&&Q!=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,Q,me,"setState")},y.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function S(){}S.prototype=y.prototype;function x(Q,me,U){this.props=Q,this.context=me,this.refs=w,this.updater=U||m}var L=x.prototype=new S;L.constructor=x,b(L,y.prototype),L.isPureReactComponent=!0;var E=Array.isArray;function I(){}var T={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function P(Q,me,U){var ke=U.ref;return{$$typeof:s,type:Q,key:me,ref:ke!==void 0?ke:null,props:U}}function F(Q,me){return P(Q.type,me,Q.props)}function V(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===s}function Y(Q){var me={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(U){return me[U]})}var se=/\/+/g;function Z(Q,me){return typeof Q=="object"&&Q!==null&&Q.key!=null?Y(""+Q.key):me.toString(36)}function q(Q){switch(Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason;default:switch(typeof Q.status=="string"?Q.then(I,I):(Q.status="pending",Q.then(function(me){Q.status==="pending"&&(Q.status="fulfilled",Q.value=me)},function(me){Q.status==="pending"&&(Q.status="rejected",Q.reason=me)})),Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason}}throw Q}function z(Q,me,U,ke,je){var Xe=typeof Q;(Xe==="undefined"||Xe==="boolean")&&(Q=null);var mt=!1;if(Q===null)mt=!0;else switch(Xe){case"bigint":case"string":case"number":mt=!0;break;case"object":switch(Q.$$typeof){case s:case e:mt=!0;break;case d:return mt=Q._init,z(mt(Q._payload),me,U,ke,je)}}if(mt)return je=je(Q),mt=ke===""?"."+Z(Q,0):ke,E(je)?(U="",mt!=null&&(U=mt.replace(se,"$&/")+"/"),z(je,me,U,"",function(_t){return _t})):je!=null&&(V(je)&&(je=F(je,U+(je.key==null||Q&&Q.key===je.key?"":(""+je.key).replace(se,"$&/")+"/")+mt)),me.push(je)),1;mt=0;var Et=ke===""?".":ke+":";if(E(Q))for(var Me=0;Me<Q.length;Me++)ke=Q[Me],Xe=Et+Z(ke,Me),mt+=z(ke,me,U,Xe,je);else if(Me=p(Q),typeof Me=="function")for(Q=Me.call(Q),Me=0;!(ke=Q.next()).done;)ke=ke.value,Xe=Et+Z(ke,Me++),mt+=z(ke,me,U,Xe,je);else if(Xe==="object"){if(typeof Q.then=="function")return z(q(Q),me,U,ke,je);throw me=String(Q),Error("Objects are not valid as a React child (found: "+(me==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":me)+"). If you meant to render a collection of children, use an array instead.")}return mt}function J(Q,me,U){if(Q==null)return Q;var ke=[],je=0;return z(Q,ke,"","",function(Xe){return me.call(U,Xe,je++)}),ke}function le(Q){if(Q._status===-1){var me=Q._result;me=me(),me.then(function(U){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=U)},function(U){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=U)}),Q._status===-1&&(Q._status=0,Q._result=me)}if(Q._status===1)return Q._result.default;throw Q._result}var ce=typeof reportError=="function"?reportError:function(Q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var me=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Q=="object"&&Q!==null&&typeof Q.message=="string"?String(Q.message):String(Q),error:Q});if(!window.dispatchEvent(me))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Q);return}console.error(Q)},$={map:J,forEach:function(Q,me,U){J(Q,function(){me.apply(this,arguments)},U)},count:function(Q){var me=0;return J(Q,function(){me++}),me},toArray:function(Q){return J(Q,function(me){return me})||[]},only:function(Q){if(!V(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}};return Li.Activity=u,Li.Children=$,Li.Component=y,Li.Fragment=t,Li.Profiler=n,Li.PureComponent=x,Li.StrictMode=i,Li.Suspense=l,Li.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Li.__COMPILER_RUNTIME={__proto__:null,c:function(Q){return T.H.useMemoCache(Q)}},Li.cache=function(Q){return function(){return Q.apply(null,arguments)}},Li.cacheSignal=function(){return null},Li.cloneElement=function(Q,me,U){if(Q==null)throw Error("The argument must be a React element, but you passed "+Q+".");var ke=b({},Q.props),je=Q.key;if(me!=null)for(Xe in me.key!==void 0&&(je=""+me.key),me)!O.call(me,Xe)||Xe==="key"||Xe==="__self"||Xe==="__source"||Xe==="ref"&&me.ref===void 0||(ke[Xe]=me[Xe]);var Xe=arguments.length-2;if(Xe===1)ke.children=U;else if(1<Xe){for(var mt=Array(Xe),Et=0;Et<Xe;Et++)mt[Et]=arguments[Et+2];ke.children=mt}return P(Q.type,je,ke)},Li.createContext=function(Q){return Q={$$typeof:r,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null},Q.Provider=Q,Q.Consumer={$$typeof:o,_context:Q},Q},Li.createElement=function(Q,me,U){var ke,je={},Xe=null;if(me!=null)for(ke in me.key!==void 0&&(Xe=""+me.key),me)O.call(me,ke)&&ke!=="key"&&ke!=="__self"&&ke!=="__source"&&(je[ke]=me[ke]);var mt=arguments.length-2;if(mt===1)je.children=U;else if(1<mt){for(var Et=Array(mt),Me=0;Me<mt;Me++)Et[Me]=arguments[Me+2];je.children=Et}if(Q&&Q.defaultProps)for(ke in mt=Q.defaultProps,mt)je[ke]===void 0&&(je[ke]=mt[ke]);return P(Q,Xe,je)},Li.createRef=function(){return{current:null}},Li.forwardRef=function(Q){return{$$typeof:a,render:Q}},Li.isValidElement=V,Li.lazy=function(Q){return{$$typeof:d,_payload:{_status:-1,_result:Q},_init:le}},Li.memo=function(Q,me){return{$$typeof:c,type:Q,compare:me===void 0?null:me}},Li.startTransition=function(Q){var me=T.T,U={};T.T=U;try{var ke=Q(),je=T.S;je!==null&&je(U,ke),typeof ke=="object"&&ke!==null&&typeof ke.then=="function"&&ke.then(I,ce)}catch(Xe){ce(Xe)}finally{me!==null&&U.types!==null&&(me.types=U.types),T.T=me}},Li.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Li.use=function(Q){return T.H.use(Q)},Li.useActionState=function(Q,me,U){return T.H.useActionState(Q,me,U)},Li.useCallback=function(Q,me){return T.H.useCallback(Q,me)},Li.useContext=function(Q){return T.H.useContext(Q)},Li.useDebugValue=function(){},Li.useDeferredValue=function(Q,me){return T.H.useDeferredValue(Q,me)},Li.useEffect=function(Q,me){return T.H.useEffect(Q,me)},Li.useEffectEvent=function(Q){return T.H.useEffectEvent(Q)},Li.useId=function(){return T.H.useId()},Li.useImperativeHandle=function(Q,me,U){return T.H.useImperativeHandle(Q,me,U)},Li.useInsertionEffect=function(Q,me){return T.H.useInsertionEffect(Q,me)},Li.useLayoutEffect=function(Q,me){return T.H.useLayoutEffect(Q,me)},Li.useMemo=function(Q,me){return T.H.useMemo(Q,me)},Li.useOptimistic=function(Q,me){return T.H.useOptimistic(Q,me)},Li.useReducer=function(Q,me,U){return T.H.useReducer(Q,me,U)},Li.useRef=function(Q){return T.H.useRef(Q)},Li.useState=function(Q){return T.H.useState(Q)},Li.useSyncExternalStore=function(Q,me,U){return T.H.useSyncExternalStore(Q,me,U)},Li.useTransition=function(){return T.H.useTransition()},Li.version="19.2.4",Li}var IZ;function fz(){return IZ||(IZ=1,PF.exports=y_e()),PF.exports}var K=fz();const Cs=hz(K);var FF={exports:{}},h0={},BF={exports:{}},WF={};var NZ;function S_e(){return NZ||(NZ=1,(function(s){function e(z,J){var le=z.length;z.push(J);e:for(;0<le;){var ce=le-1>>>1,$=z[ce];if(0<n($,J))z[ce]=J,z[le]=$,le=ce;else break e}}function t(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var J=z[0],le=z.pop();if(le!==J){z[0]=le;e:for(var ce=0,$=z.length,Q=$>>>1;ce<Q;){var me=2*(ce+1)-1,U=z[me],ke=me+1,je=z[ke];if(0>n(U,le))ke<$&&0>n(je,U)?(z[ce]=je,z[ke]=le,ce=ke):(z[ce]=U,z[me]=le,ce=me);else if(ke<$&&0>n(je,le))z[ce]=je,z[ke]=le,ce=ke;else break e}}return J}function n(z,J){var le=z.sortIndex-J.sortIndex;return le!==0?le:z.id-J.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,w=!1,y=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function L(z){for(var J=t(c);J!==null;){if(J.callback===null)i(c);else if(J.startTime<=z)i(c),J.sortIndex=J.expirationTime,e(l,J);else break;J=t(c)}}function E(z){if(b=!1,L(z),!m)if(t(l)!==null)m=!0,I||(I=!0,Y());else{var J=t(c);J!==null&&q(E,J.startTime-z)}}var I=!1,T=-1,O=5,P=-1;function F(){return w?!0:!(s.unstable_now()-P<O)}function V(){if(w=!1,I){var z=s.unstable_now();P=z;var J=!0;try{e:{m=!1,b&&(b=!1,S(T),T=-1),p=!0;var le=f;try{t:{for(L(z),u=t(l);u!==null&&!(u.expirationTime>z&&F());){var ce=u.callback;if(typeof ce=="function"){u.callback=null,f=u.priorityLevel;var $=ce(u.expirationTime<=z);if(z=s.unstable_now(),typeof $=="function"){u.callback=$,L(z),J=!0;break t}u===t(l)&&i(l),L(z)}else i(l);u=t(l)}if(u!==null)J=!0;else{var Q=t(c);Q!==null&&q(E,Q.startTime-z),J=!1}}break e}finally{u=null,f=le,p=!1}J=void 0}}finally{J?Y():I=!1}}}var Y;if(typeof x=="function")Y=function(){x(V)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,Z=se.port2;se.port1.onmessage=V,Y=function(){Z.postMessage(null)}}else Y=function(){y(V,0)};function q(z,J){T=y(function(){z(s.unstable_now())},J)}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 J=3;break;default:J=f}var le=f;f=J;try{return z()}finally{f=le}},s.unstable_requestPaint=function(){w=!0},s.unstable_runWithPriority=function(z,J){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var le=f;f=z;try{return J()}finally{f=le}},s.unstable_scheduleCallback=function(z,J,le){var ce=s.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?ce+le:ce):le=ce,z){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=le+$,z={id:d++,callback:J,priorityLevel:z,startTime:le,expirationTime:$,sortIndex:-1},le>ce?(z.sortIndex=le,e(c,z),t(l)===null&&z===t(c)&&(b?(S(T),T=-1):b=!0,q(E,le-ce))):(z.sortIndex=$,e(l,z),m||p||(m=!0,I||(I=!0,Y()))),z},s.unstable_shouldYield=F,s.unstable_wrapCallback=function(z){var J=f;return function(){var le=f;f=J;try{return z.apply(this,arguments)}finally{f=le}}}})(WF)),WF}var TZ;function x_e(){return TZ||(TZ=1,BF.exports=S_e()),BF.exports}var HF={exports:{}},Sr={};var RZ;function L_e(){if(RZ)return Sr;RZ=1;var s=fz();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 Sr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Sr.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)},Sr.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()}},Sr.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))},Sr.prefetchDNS=function(l){typeof l=="string"&&i.d.D(l)},Sr.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})}},Sr.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)},Sr.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})}},Sr.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)},Sr.requestFormReset=function(l){i.d.r(l)},Sr.unstable_batchedUpdates=function(l,c){return l(c)},Sr.useFormState=function(l,c,d){return r.H.useFormState(l,c,d)},Sr.useFormStatus=function(){return r.H.useHostTransitionStatus()},Sr.version="19.2.4",Sr}var MZ;function k_e(){if(MZ)return HF.exports;MZ=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(),HF.exports=L_e(),HF.exports}var AZ;function D_e(){if(AZ)return h0;AZ=1;var s=x_e(),e=fz(),t=k_e();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,C=g;;){var k=_.return;if(k===null)break;var D=k.alternate;if(D===null){if(C=k.return,C!==null){_=C;continue}break}if(k.child===D.child){for(D=k.child;D;){if(D===_)return l(k),h;if(D===C)return l(k),g;D=D.sibling}throw Error(i(188))}if(_.return!==C.return)_=k,C=D;else{for(var A=!1,j=k.child;j;){if(j===_){A=!0,_=k,C=D;break}if(j===C){A=!0,C=k,_=D;break}j=j.sibling}if(!A){for(j=D.child;j;){if(j===_){A=!0,_=D,C=k;break}if(j===C){A=!0,C=D,_=k;break}j=j.sibling}if(!A)throw Error(i(189))}}if(_.alternate!==C)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"),w=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),x=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function Y(h){return h===null||typeof h!="object"?null:(h=V&&h[V]||h["@@iterator"],typeof h=="function"?h:null)}var se=Symbol.for("react.client.reference");function Z(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===se?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case b:return"Fragment";case y:return"Profiler";case w:return"StrictMode";case E:return"Suspense";case I:return"SuspenseList";case P:return"Activity"}if(typeof h=="object")switch(h.$$typeof){case m:return"Portal";case x:return h.displayName||"Context";case S:return(h._context.displayName||"Context")+".Consumer";case L: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:Z(h.type)||"Memo";case O:g=h._payload,h=h._init;try{return Z(h(g))}catch{}}return null}var q=Array.isArray,z=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ce=[],$=-1;function Q(h){return{current:h}}function me(h){0>$||(h.current=ce[$],ce[$]=null,$--)}function U(h,g){$++,ce[$]=h.current,h.current=g}var ke=Q(null),je=Q(null),Xe=Q(null),mt=Q(null);function Et(h,g){switch(U(Xe,g),U(je,h),U(ke,null),g.nodeType){case 9:case 11:h=(h=g.documentElement)&&(h=h.namespaceURI)?YY(h):0;break;default:if(h=g.tagName,g=g.namespaceURI)g=YY(g),h=ZY(g,h);else switch(h){case"svg":h=1;break;case"math":h=2;break;default:h=0}}me(ke),U(ke,h)}function Me(){me(ke),me(je),me(Xe)}function _t(h){h.memoizedState!==null&&U(mt,h);var g=ke.current,_=ZY(g,h.type);g!==_&&(U(je,h),U(ke,_))}function Lt(h){je.current===h&&(me(ke),me(je)),mt.current===h&&(me(mt),a0._currentValue=le)}var ni,Ye;function Oe(h){if(ni===void 0)try{throw Error()}catch(_){var g=_.stack.trim().match(/\n( *(at )?)/);ni=g&&g[1]||"",Ye=-1<_.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<_.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+ni+h+Ye}var it=!1;function zt(h,g){if(!h||it)return"";it=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var C={DetermineComponentFrameRoot:function(){try{if(g){var qe=function(){throw Error()};if(Object.defineProperty(qe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(qe,[])}catch(Re){var Ee=Re}Reflect.construct(h,[],qe)}else{try{qe.call()}catch(Re){Ee=Re}h.call(qe.prototype)}}else{try{throw Error()}catch(Re){Ee=Re}(qe=h())&&typeof qe.catch=="function"&&qe.catch(function(){})}}catch(Re){if(Re&&Ee&&typeof Re.stack=="string")return[Re.stack,Ee.stack]}return[null,null]}};C.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(C.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(C.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var D=C.DetermineComponentFrameRoot(),A=D[0],j=D[1];if(A&&j){var re=A.split(`
|
|
@@ -17,7 +17,7 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
|
|
|
17
17
|
`):" "+iX(r[0]):"as no adapter specified";throw new pi("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n}const Coe={getAdapter:fwe,adapters:Lz};function qF(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Ck(null,s)}function nX(s){return qF(s),s.headers=qa.from(s.headers),s.data=$F.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Coe.getAdapter(s.adapter||vk.adapter,s)(s).then(function(i){return qF(s),i.data=$F.call(s,s.transformResponse,i),i.headers=qa.from(i.headers),i},function(i){return poe(i)||(qF(s),i&&i.response&&(i.response.data=$F.call(s,s.transformResponse,i.response),i.response.headers=qa.from(i.response.headers))),Promise.reject(i)})}const woe="1.13.5",PA={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{PA[s]=function(i){return typeof i===s||"a"+(e<1?"n ":" ")+s}});const sX={};PA.transitional=function(e,t,i){function n(o,r){return"[Axios v"+woe+"] Transitional option '"+o+"'"+r+(i?". "+i:"")}return(o,r,a)=>{if(e===!1)throw new pi(n(r," has been removed"+(t?" in "+t:"")),pi.ERR_DEPRECATED);return t&&!sX[r]&&(sX[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}};PA.spelling=function(e){return(t,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function gwe(s,e,t){if(typeof s!="object")throw new pi("options must be an object",pi.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 pi("option "+o+" must be "+l,pi.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new pi("Unknown option "+o,pi.ERR_BAD_OPTION)}}const GI={assertOptions:gwe,validators:PA},tc=GI.validators;let c_=class{constructor(e){this.defaults=e||{},this.interceptors={request:new qZ,response:new qZ}}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
18
|
`+o):i.stack=o}catch{}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=wb(this.defaults,t);const{transitional:i,paramsSerializer:n,headers:o}=t;i!==void 0&&GI.assertOptions(i,{silentJSONParsing:tc.transitional(tc.boolean),forcedJSONParsing:tc.transitional(tc.boolean),clarifyTimeoutError:tc.transitional(tc.boolean),legacyInterceptorReqResOrdering:tc.transitional(tc.boolean)},!1),n!=null&&(Te.isFunction(n)?t.paramsSerializer={serialize:n}:GI.assertOptions(n,{encode:tc.function,serialize:tc.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),GI.assertOptions(t,{baseUrl:tc.spelling("baseURL"),withXsrfToken:tc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&Te.merge(o.common,o[t.method]);o&&Te.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),t.headers=qa.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 w=t.transitional||Sz;w&&w.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=[nX.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(w){b.call(this,w);break}}try{d=nX.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=wb(this.defaults,e);const t=_oe(e.baseURL,e.url,e.allowAbsoluteUrls);return foe(t,e.params,e.paramsSerializer)}};Te.forEach(["delete","get","head","options"],function(e){c_.prototype[e]=function(t,i){return this.request(wb(i||{},{method:e,url:t,data:(i||{}).data}))}});Te.forEach(["post","put","patch"],function(e){function t(i){return function(o,r,a){return this.request(wb(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}c_.prototype[e]=t(),c_.prototype[e+"Form"]=t(!0)});let pwe=class yoe{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 Ck(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 yoe(function(n){e=n}),cancel:e}}};function mwe(s){return function(t){return s.apply(null,t)}}function _we(s){return Te.isObject(s)&&s.isAxiosError===!0}const EB={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(EB).forEach(([s,e])=>{EB[e]=s});function Soe(s){const e=new c_(s),t=ioe(c_.prototype.request,e);return Te.extend(t,c_.prototype,e,{allOwnKeys:!0}),Te.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return Soe(wb(s,n))},t}const qs=Soe(vk);qs.Axios=c_;qs.CanceledError=Ck;qs.CancelToken=pwe;qs.isCancel=poe;qs.VERSION=woe;qs.toFormData=OA;qs.AxiosError=pi;qs.Cancel=qs.CanceledError;qs.all=function(e){return Promise.all(e)};qs.spread=mwe;qs.isAxiosError=_we;qs.mergeConfig=wb;qs.AxiosHeaders=qa;qs.formToJSON=s=>goe(Te.isHTMLForm(s)?new FormData(s):s);qs.getAdapter=Coe.getAdapter;qs.HttpStatusCode=EB;qs.default=qs;const{Axios:gtt,AxiosError:fs,CanceledError:ptt,isCancel:mtt,CancelToken:_tt,VERSION:btt,all:vtt,Cancel:Ctt,isAxiosError:wtt,spread:ytt,toFormData:Stt,AxiosHeaders:xtt,HttpStatusCode:Ltt,formToJSON:ktt,getAdapter:Dtt,mergeConfig:Ett}=qs,wi=qs.create({headers:{"Content-Type":"application/json"}}),xoe=qs.create();function Loe(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&&(Doe(),window.location.href="/login"),Promise.reject(e)})}Loe(wi);Loe(xoe);function bwe(s){if(s==="busy"||s==="retry"||s==="idle")return s;throw new Error(`Invalid session_status from /messages: ${String(s)}`)}function vwe(s){if(Array.isArray(s))return s;throw new Error("Invalid messages payload from /messages")}const koe=K.createContext(null);function oX(s,e){if(s instanceof fs){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 Cwe({children:s}){const[e,t]=K.useState(null),i=localStorage.getItem("token"),[n,o]=K.useState(i),[r,a]=K.useState(!!i);K.useEffect(()=>{n&&(async()=>{try{const f=await wi.get("/api/auth/me",{headers:{Authorization:`Bearer ${n}`}});t(f.data),a(!1)}catch(f){if(f instanceof fs&&f.response?.status===401){localStorage.removeItem("token"),o(null),a(!1);return}a(!0)}})()},[n]);const l=async(f,p)=>{try{const m=await wi.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(oX(m,"Sign in failed"))}},c=async(f,p)=>{try{const m=await wi.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(oX(m,"Password change failed"))}},d=()=>{Doe(),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 N.jsx(koe.Provider,{value:u,children:s})}function Mo(){const s=K.useContext(koe);if(!s)throw new Error("useAuth must be used within AuthProvider");return s}function Doe(){localStorage.removeItem("token")}const rX="TeamCopilot";function Eu(s){K.useEffect(()=>{const e=typeof s=="string"?s.trim():"";document.title=e?`${rX} - ${e}`:rX},[s])}function wwe(){const[s,e]=K.useState("signin"),[t,i]=K.useState(""),[n,o]=K.useState(""),[r,a]=K.useState(""),[l,c]=K.useState(!1),[d,u]=K.useState(!1),[f,p]=K.useState(""),[m,b]=K.useState(""),{login:w,completePasswordChange:y,logout:S}=Mo(),x=Hl();Eu(s==="signin"?"Sign In":"Set New Password");const L=async I=>{I.preventDefault(),b("");try{const T=await w(t,n);if(T.type==="password_change_required"){p(T.challengeToken),e("change-password"),o("");return}x("/")}catch(T){const O=T instanceof Error?T.message:"Sign in failed";b(O),o(""),Dt.error(O)}},E=async I=>{I.preventDefault(),b("");try{await y(f,r),x("/")}catch(T){const O=T instanceof Error?T.message:"Password change failed";b(O),Dt.error(O)}};return N.jsxs("div",{className:"auth-container",children:[N.jsx("h1",{children:s==="signin"?"Sign In":"Set New Password"}),s==="signin"?N.jsxs("form",{onSubmit:L,className:"auth-form",children:[m&&N.jsx("p",{className:"auth-error",children:m}),N.jsx("label",{htmlFor:"email",children:"Email"}),N.jsx("input",{id:"email",name:"email",type:"email",value:t,onChange:I=>i(I.target.value),autoComplete:"username",required:!0}),N.jsx("label",{htmlFor:"password",children:"Password"}),N.jsxs("div",{className:"password-input-row",children:[N.jsx("input",{id:"password",name:"password",type:l?"text":"password",value:n,onChange:I=>o(I.target.value),autoComplete:"current-password",required:!0}),N.jsx("button",{type:"button",className:"password-toggle-button",onClick:()=>c(I=>!I),children:l?"Hide":"Show"})]}),N.jsx("button",{className:"auth-submit-button",type:"submit",children:"Sign In"})]}):N.jsxs("form",{onSubmit:E,className:"auth-form",children:[m&&N.jsx("p",{className:"auth-error",children:m}),N.jsx("p",{children:"You must set a new password before continuing."}),N.jsx("label",{htmlFor:"password-change-email",children:"Email"}),N.jsx("input",{id:"password-change-email",name:"email",type:"email",value:t,autoComplete:"username",readOnly:!0,required:!0}),N.jsx("label",{htmlFor:"new-password",children:"New Password (min 8 characters)"}),N.jsxs("div",{className:"password-input-row",children:[N.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}),N.jsx("button",{type:"button",className:"password-toggle-button",onClick:()=>u(I=>!I),children:d?"Hide":"Show"})]}),N.jsx("button",{className:"auth-submit-button",type:"submit",children:"Save Password"}),N.jsx("button",{className:"auth-submit-button",type:"button",onClick:()=>{S(),e("signin"),p(""),o(""),a(""),x("/login")},children:"Sign Out"})]}),N.jsx("p",{className:"auth-link",children:"Accounts are created by an administrator via CLI."})]})}function ywe({viewLabel:s,onView:e,showRunAction:t,runLabel:i,canRun:n,onRunAi:o,onRunManual:r,deleteVisible:a,deleteLabel:l="Delete",deleting:c=!1,onDelete:d}){const[u,f]=K.useState(!1),p=!!(o&&r);return N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"workflow-card-actions",children:[N.jsx("button",{className:"workflow-card-run-btn",onClick:e,children:s}),t&&N.jsx("button",{className:"workflow-card-run-btn",disabled:!n,onClick:()=>{p&&f(!0)},children:i}),a&&N.jsx("button",{className:"workflow-card-delete-btn",onClick:d,disabled:c,children:c?"Deleting...":l})]}),p&&u&&N.jsx("div",{className:"workflow-run-mode-modal-backdrop",onClick:()=>f(!1),children:N.jsxs("div",{className:"workflow-run-mode-modal",onClick:m=>m.stopPropagation(),children:[N.jsx("button",{type:"button",className:"workflow-run-mode-close-btn","aria-label":"Close",onClick:()=>f(!1)}),N.jsx("h4",{children:"Choose run mode"}),N.jsx("p",{children:"Pick how you want to run this workflow."}),N.jsx("button",{type:"button",className:"workflow-run-mode-ai-btn",onClick:()=>{o&&(o(),f(!1))},children:"AI mode (recommended)"}),N.jsx("button",{type:"button",className:"workflow-run-mode-manual-btn",onClick:()=>{r&&(r(),f(!1))},children:"Manual mode"})]})})]})}function Eoe({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,can_run:f,userRole:p,currentUserId:m,token:b,viewLabel:w,showRunAction:y,runLabel:S,onUpdated:x,onDeleted:L,onOpen:E,onRunAi:I,onRunManual:T}){const[O,P]=K.useState(!1),[F,V]=K.useState(!1),[Y,se]=K.useState(!1),[Z,q]=K.useState(!1),[z,J]=K.useState(null),[le,ce]=K.useState([]),[$,Q]=K.useState("restricted"),[me,U]=K.useState([]),[ke,je]=K.useState(n),[Xe,mt]=K.useState(a),Me=n===m||p==="Engineer"&&(n===null||!o&&!r),_t=l&&c,Lt=s==="workflow"?"Run access":"Access",ni=s==="workflow"?"Manage Run Permissions":"Manage Access Permissions",Ye=s==="workflow"?"workflow":"skill",Oe=s==="workflow"?"Workflow":"Skill",it=`/api/${s==="workflow"?"workflows":"skills"}/${e}`,zt="/api/users",Kt=`/api/${s==="workflow"?"workflows":"skills"}/${e}/permissions`,bi=async()=>{se(!0),J(null);try{const[Ue,Pe]=await Promise.all([wi.get(it,{headers:{Authorization:`Bearer ${b}`}}),wi.get(zt,{headers:{Authorization:`Bearer ${b}`}})]),Ct=s==="workflow"?Ue.data.workflow:Ue.data.skill,_e=Ct.permissions;if(!_e)throw new Error("Missing permissions in response");je(Ct.created_by_user_id),mt(Ct.approved_by_user_id),Q(_e.mode),U(_e.mode==="restricted"?_e.allowed_user_ids:[]),ce(Pe.data.users),V(!0)}catch(Ue){const Pe=Ue instanceof fs?Ue.response?.data?.message||Ue.response?.data||Ue.message:`Failed to load ${Ye} permissions`;J(String(Pe))}finally{se(!1)}},ln=Ue=>{ke!==Ue&&U(Pe=>Pe.includes(Ue)?Pe.filter(Ct=>Ct!==Ue):[...Pe,Ue])},Ii=async()=>{q(!0);try{const Ue=$==="everyone"?{mode:"everyone"}:{mode:"restricted",allowed_user_ids:Array.from(new Set(me))};await wi.patch(Kt,Ue,{headers:{Authorization:`Bearer ${b}`}}),Dt.success(`${Oe} permissions updated`),V(!1),x()}catch(Ue){const Pe=Ue instanceof fs?Ue.response?.data?.message||Ue.response?.data||Ue.message:`Failed to update ${Ye} permissions`;Dt.error(String(Pe))}finally{q(!1)}},_n=()=>{const Ue=s==="workflow"?`/workflows/${encodeURIComponent(e)}/approval-review`:`/skills/${encodeURIComponent(e)}/approval-review`;window.open(Ue,"_blank","noopener,noreferrer")},at=async()=>{if(window.confirm(`Delete ${Ye} "${t||e}"?
|
|
19
19
|
|
|
20
|
-
This will permanently delete the ${Ye} folder${s==="workflow"?" and all past runs":""}. This cannot be undone.`)){P(!0);try{await wi.delete(it,{headers:{Authorization:`Bearer ${b}`}}),Dt.success(`${Oe} deleted successfully`),L()}catch(Pe){const Ct=Pe instanceof fs?Pe.response?.data?.message||Pe.response?.data||Pe.message:`Failed to delete ${Ye}`;Dt.error(String(Ct))}finally{P(!1)}}};return N.jsxs("div",{className:"workflow-card",children:[N.jsxs("div",{className:"workflow-card-header",children:[N.jsx("h3",{className:"workflow-card-title",children:t}),N.jsx("span",{className:`workflow-approval-badge ${l?"approved":"pending"}`,children:l?"Approved":"Pending Approval"})]}),s==="skill"?N.jsx("p",{className:"workflow-card-description",children:i.trim()||"No description available"}):i&&N.jsx("p",{className:"workflow-card-description",children:i}),N.jsxs("p",{className:"workflow-card-meta",children:["Created by: ",o??r??"Unknown User"]}),!l&&N.jsx("div",{className:"workflow-approval-section",children:p==="Engineer"?N.jsx("button",{className:"workflow-approve-btn",onClick:()=>{_n()},children:"Review & Approve"}):N.jsxs("p",{className:"workflow-approval-message",children:["Ask an engineer to approve this ",Ye," before it can be used."]})}),l&&N.jsxs("div",{className:"workflow-approval-section",children:[N.jsx("p",{className:"workflow-approval-message",children:d==="everyone"?`${Lt}: Everyone`:u?`${Lt}: Restricted (locked - no allowed users remain)`:`${Lt}: Restricted`}),z&&!F&&N.jsx("p",{className:"workflow-approval-message",children:z}),Y&&N.jsx("p",{className:"workflow-approval-message",children:"Loading permissions..."}),N.jsx("button",{className:"workflow-approve-btn",onClick:()=>{bi()},disabled:!_t||Y,type:"button",children:"Manage Permissions"}),!_t&&N.jsx("p",{className:"workflow-approval-message",children:u?"No one can modify permissions because no allowed users remain.":`Only users who can use this ${Ye} can change permissions.`}),F&&N.jsxs("div",{className:"permissions-editor",children:[N.jsxs("div",{className:"permissions-editor-header",children:[N.jsx("h4",{className:"permissions-editor-title",children:ni}),N.jsxs("div",{className:"permissions-mode-group",children:[N.jsx("label",{className:"permissions-mode-label",htmlFor:`permission-mode-select-${e}`,children:"Permission Mode"}),N.jsxs("select",{id:`permission-mode-select-${e}`,className:"permissions-mode-select",value:$,onChange:Ue=>Q(Ue.target.value),children:[N.jsx("option",{value:"restricted",children:"Restricted (Specific Users)"}),N.jsx("option",{value:"everyone",children:"Everyone"})]})]})]}),$==="restricted"&&N.jsxs("div",{className:"permissions-users-section",children:[N.jsx("div",{className:"permissions-users-title",children:"Allowed Users"}),N.jsx("div",{className:"permissions-users-list",children:le.map(Ue=>{const Pe=me.includes(Ue.id),Ct=ke===Ue.id,_e=Xe===Ue.id;return N.jsxs("div",{className:`permissions-user-item ${Ct?"permissions-user-item-disabled":""}`,onClick:()=>!Ct&&ln(Ue.id),children:[N.jsx("input",{type:"checkbox",className:"permissions-user-checkbox",checked:Pe,disabled:Ct,onChange:()=>ln(Ue.id),onClick:$e=>$e.stopPropagation()}),N.jsxs("div",{className:"permissions-user-info",children:[N.jsx("div",{className:"permissions-user-name",children:Ue.name}),N.jsx("div",{className:"permissions-user-email",children:Ue.email})]}),(Ct||_e)&&N.jsxs("div",{className:"permissions-user-badges",children:[Ct&&N.jsx("span",{className:"permissions-user-badge permissions-user-badge-owner",children:"Owner"}),_e&&N.jsx("span",{className:"permissions-user-badge permissions-user-badge-approver",children:"Approver"})]})]},Ue.id)})})]}),N.jsxs("div",{className:"permissions-editor-actions",children:[N.jsx("button",{type:"button",className:"permissions-editor-save-btn",onClick:Ii,onMouseDown:Ue=>Ue.stopPropagation(),disabled:Z,children:Z?"Saving...":"Save Permissions"}),N.jsx("button",{type:"button",className:"permissions-editor-cancel-btn",onClick:()=>V(!1),onMouseDown:Ue=>Ue.stopPropagation(),disabled:Z,children:"Cancel"})]})]})]}),N.jsx(ywe,{viewLabel:w,onView:()=>E(e),showRunAction:y,runLabel:S,canRun:f,onRunAi:I,onRunManual:T,deleteVisible:Me,deleting:O,onDelete:()=>{at()}})]})}function Swe(s){return N.jsx(Eoe,{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,can_run:s.is_approved&&s.can_edit,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)})}function aX(s){return s.toLowerCase().trim().replace(/\s+/g,"-").replace(/-+/g,"-")}function xwe(s,e){const t=aX(e);if(!t)return!0;const i=aX(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 Lwe({onRunWorkflow:s}){const e=Hl(),t=Mo(),[i,n]=K.useState([]),[o,r]=K.useState(!0),[a,l]=K.useState(null),[c,d]=K.useState("all"),[u,f]=K.useState("everyone"),[p,m]=K.useState(""),b=t.loading?null:t.token,w=t.loading?null:t.user,y=K.useCallback(async()=>{if(b)try{const x=await wi.get("/api/workflows",{headers:{Authorization:`Bearer ${b}`}});n(x.data.workflows)}catch(x){const L=x instanceof fs?x.response?.data?.message||x.response?.data||x.message:"Failed to load workflows";l(L)}finally{r(!1)}},[b]);if(K.useEffect(()=>{y()},[y]),t.loading)return null;if(o)return N.jsx("div",{className:"section-loading",children:"Loading workflows..."});if(a)return N.jsx("div",{className:"section-error",children:a});if(i.length===0)return N.jsxs("div",{className:"section-empty",children:[N.jsx("h3",{children:"No Workflows Available"}),N.jsx("p",{children:"Create a workflow by talking to the AI Assistant."})]});const S=i.filter(x=>{const L=c==="all"?!0:c==="approved"?x.is_approved:!x.is_approved,E=u==="everyone"?!0:x.created_by_user_id===w?.userId,I=xwe(x.name||x.slug,p);return L&&E&&I});return N.jsxs("div",{className:"workflows-section-content",children:[N.jsxs("div",{className:"workflow-filters",children:[N.jsxs("div",{className:"workflow-filters-title",children:[N.jsx("span",{className:"workflow-filters-heading",children:"Filters"}),N.jsxs("span",{className:"workflow-filters-count",children:[S.length," / ",i.length," shown"]})]}),N.jsxs("div",{className:"workflow-filter-group",children:[N.jsx("label",{htmlFor:"workflow-approval-filter",children:"Approval"}),N.jsx("div",{className:"workflow-filter-select-wrap",children:N.jsxs("select",{id:"workflow-approval-filter",value:c,onChange:x=>d(x.target.value),children:[N.jsx("option",{value:"all",children:"All"}),N.jsx("option",{value:"approved",children:"Approved"}),N.jsx("option",{value:"pending",children:"Pending approval"})]})})]}),N.jsxs("div",{className:"workflow-filter-group",children:[N.jsx("label",{htmlFor:"workflow-ownership-filter",children:"Scope"}),N.jsx("div",{className:"workflow-filter-select-wrap",children:N.jsxs("select",{id:"workflow-ownership-filter",value:u,onChange:x=>f(x.target.value),children:[N.jsx("option",{value:"everyone",children:"Everyone's"}),N.jsx("option",{value:"mine",children:"Only mine"})]})})]}),N.jsxs("div",{className:"workflow-filter-group workflow-filter-group-search",children:[N.jsx("label",{htmlFor:"workflow-title-search",children:"Search title"}),N.jsx("div",{className:"workflow-filter-search-wrap",children:N.jsx("input",{id:"workflow-title-search",type:"search",value:p,onChange:x=>m(x.target.value),placeholder:"Search workflow title..."})})]})]}),S.length===0?N.jsxs("div",{className:"section-empty",children:[N.jsx("h3",{children:"No Workflows Match Filters"}),N.jsx("p",{children:"Try changing the approval or ownership filters."})]}):N.jsx("div",{className:"workflows-grid",children:S.map(x=>N.jsx(Swe,{...x,userRole:w?.role??"User",currentUserId:w?.userId??null,token:b??"",onApproved:y,onDeleted:y,onRunWorkflow:s,onRunWorkflowManual:L=>e(`/workflows/${encodeURIComponent(L)}/manual-run`),onOpenWorkflow:L=>e(`/workflows/${encodeURIComponent(L)}`)},x.slug))})]})}function kwe(s){return new Date(s).toLocaleString()}function Dwe(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 Ewe({status:s}){return N.jsx("span",{className:`status-badge status-${s}`,children:s})}function Iwe(){const s=Mo(),e=Hl(),[t,i]=K.useState([]),[n,o]=K.useState(!0),[r,a]=K.useState(null),l=s.loading?null:s.token;return K.useEffect(()=>{if(!l)return;(async()=>{try{const d=await wi.get("/api/workflows/runs",{headers:{Authorization:`Bearer ${l}`}});i(d.data.runs)}catch(d){const u=d instanceof fs?d.response?.data?.message||d.response?.data||d.message:"Failed to load run history";a(u)}finally{o(!1)}})()},[l]),s.loading?null:n?N.jsx("div",{className:"section-loading",children:"Loading run history..."}):r?N.jsx("div",{className:"section-error",children:r}):t.length===0?N.jsxs("div",{className:"section-empty",children:[N.jsx("h3",{children:"No Run History"}),N.jsx("p",{children:"Workflow runs will appear here once you start running workflows."})]}):N.jsx("div",{className:"run-history-table-container",children:N.jsxs("table",{className:"run-history-table",children:[N.jsx("thead",{children:N.jsxs("tr",{children:[N.jsx("th",{children:"Workflow"}),N.jsx("th",{children:"Status"}),N.jsx("th",{children:"Started"}),N.jsx("th",{children:"Duration"}),N.jsx("th",{children:"User"})]})}),N.jsx("tbody",{children:t.map(c=>N.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:[N.jsx("td",{className:"workflow-name-cell",children:c.workflow_slug}),N.jsx("td",{children:N.jsx(Ewe,{status:c.status})}),N.jsx("td",{children:kwe(c.started_at)}),N.jsx("td",{children:Dwe(c.started_at,c.completed_at)}),N.jsx("td",{children:c.user.name})]},c.id))})]})})}function Nwe({sessions:s,activeSessionId:e,onSelectSession:t,onNewSession:i,loading:n}){const o=r=>{const a=new Date(r),l=new Date;return a.toDateString()===l.toDateString()?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):a.toLocaleDateString([],{month:"short",day:"numeric"})};return N.jsxs("div",{className:"chat-sidebar",children:[N.jsxs("div",{className:"chat-sidebar-header",children:[N.jsx("h3",{children:"Sessions"}),N.jsx("button",{className:"new-session-btn",onClick:i,disabled:n,children:"+ New"})]}),N.jsx("div",{className:"session-list",children:s.length===0?N.jsx("div",{className:"no-sessions",children:n?"Loading...":"No sessions yet"}):s.map(r=>{const a=r.title||"New Chat";return N.jsx("div",{className:`session-item ${r.id===e?"active":""}`,onClick:()=>t(r.id),children:N.jsxs("div",{className:"session-title","data-full-title":a,children:[N.jsx("span",{className:"session-title-text",children:a}),N.jsx("span",{className:"session-updated-at",children:o(Number(r.updated_at))})]})},r.id)})})]})}function Twe(s){return s.role==="user"}function Rwe(s){return s.role==="assistant"}function Mwe(s){return s.type==="text"}function Awe(s){return s.type==="tool"}function Owe(s){return s.type==="reasoning"}function Pwe(s,e){const t={};return(s[s.length-1]===""?[...s,""]:s).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Fwe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bwe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wwe={};function lX(s,e){return(Wwe.jsx?Bwe:Fwe).test(s)}const Hwe=/[ \t\n\f\r]/g;function Vwe(s){return typeof s=="object"?s.type==="text"?cX(s.value):!1:cX(s)}function cX(s){return s.replace(Hwe,"")===""}class wk{constructor(e,t,i){this.normal=t,this.property=e,i&&(this.space=i)}}wk.prototype.normal={};wk.prototype.property={};wk.prototype.space=void 0;function Ioe(s,e){const t={},i={};for(const n of s)Object.assign(t,n.property),Object.assign(i,n.normal);return new wk(t,i,e)}function IB(s){return s.toLowerCase()}class tl{constructor(e,t){this.attribute=t,this.property=e}}tl.prototype.attribute="";tl.prototype.booleanish=!1;tl.prototype.boolean=!1;tl.prototype.commaOrSpaceSeparated=!1;tl.prototype.commaSeparated=!1;tl.prototype.defined=!1;tl.prototype.mustUseProperty=!1;tl.prototype.number=!1;tl.prototype.overloadedBoolean=!1;tl.prototype.property="";tl.prototype.spaceSeparated=!1;tl.prototype.space=void 0;let zwe=0;const Ai=Xb(),po=Xb(),NB=Xb(),rt=Xb(),hs=Xb(),mw=Xb(),ml=Xb();function Xb(){return 2**++zwe}const TB=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ai,booleanish:po,commaOrSpaceSeparated:ml,commaSeparated:mw,number:rt,overloadedBoolean:NB,spaceSeparated:hs},Symbol.toStringTag,{value:"Module"})),KF=Object.keys(TB);class kz extends tl{constructor(e,t,i,n){let o=-1;if(super(e,t),dX(this,"space",n),typeof i=="number")for(;++o<KF.length;){const r=KF[o];dX(this,KF[o],(i&TB[r])===TB[r])}}}kz.prototype.defined=!0;function dX(s,e,t){t&&(s[e]=t)}function G1(s){const e={},t={};for(const[i,n]of Object.entries(s.properties)){const o=new kz(i,s.transform(s.attributes||{},i),n,s.space);s.mustUseProperty&&s.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),e[i]=o,t[IB(i)]=i,t[IB(o.attribute)]=i}return new wk(e,t,s.space)}const Noe=G1({properties:{ariaActiveDescendant:null,ariaAtomic:po,ariaAutoComplete:null,ariaBusy:po,ariaChecked:po,ariaColCount:rt,ariaColIndex:rt,ariaColSpan:rt,ariaControls:hs,ariaCurrent:null,ariaDescribedBy:hs,ariaDetails:null,ariaDisabled:po,ariaDropEffect:hs,ariaErrorMessage:null,ariaExpanded:po,ariaFlowTo:hs,ariaGrabbed:po,ariaHasPopup:null,ariaHidden:po,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:hs,ariaLevel:rt,ariaLive:null,ariaModal:po,ariaMultiLine:po,ariaMultiSelectable:po,ariaOrientation:null,ariaOwns:hs,ariaPlaceholder:null,ariaPosInSet:rt,ariaPressed:po,ariaReadOnly:po,ariaRelevant:null,ariaRequired:po,ariaRoleDescription:hs,ariaRowCount:rt,ariaRowIndex:rt,ariaRowSpan:rt,ariaSelected:po,ariaSetSize:rt,ariaSort:null,ariaValueMax:rt,ariaValueMin:rt,ariaValueNow:rt,ariaValueText:null,role:null},transform(s,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Toe(s,e){return e in s?s[e]:e}function Roe(s,e){return Toe(s,e.toLowerCase())}const Uwe=G1({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mw,acceptCharset:hs,accessKey:hs,action:null,allow:null,allowFullScreen:Ai,allowPaymentRequest:Ai,allowUserMedia:Ai,alt:null,as:null,async:Ai,autoCapitalize:null,autoComplete:hs,autoFocus:Ai,autoPlay:Ai,blocking:hs,capture:null,charSet:null,checked:Ai,cite:null,className:hs,cols:rt,colSpan:null,content:null,contentEditable:po,controls:Ai,controlsList:hs,coords:rt|mw,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ai,defer:Ai,dir:null,dirName:null,disabled:Ai,download:NB,draggable:po,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ai,formTarget:null,headers:hs,height:rt,hidden:NB,high:rt,href:null,hrefLang:null,htmlFor:hs,httpEquiv:hs,id:null,imageSizes:null,imageSrcSet:null,inert:Ai,inputMode:null,integrity:null,is:null,isMap:Ai,itemId:null,itemProp:hs,itemRef:hs,itemScope:Ai,itemType:hs,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ai,low:rt,manifest:null,max:null,maxLength:rt,media:null,method:null,min:null,minLength:rt,multiple:Ai,muted:Ai,name:null,nonce:null,noModule:Ai,noValidate:Ai,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:Ai,optimum:rt,pattern:null,ping:hs,placeholder:null,playsInline:Ai,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ai,referrerPolicy:null,rel:hs,required:Ai,reversed:Ai,rows:rt,rowSpan:rt,sandbox:hs,scope:null,scoped:Ai,seamless:Ai,selected:Ai,shadowRootClonable:Ai,shadowRootDelegatesFocus:Ai,shadowRootMode:null,shape:null,size:rt,sizes:null,slot:null,span:rt,spellCheck:po,src:null,srcDoc:null,srcLang:null,srcSet:null,start:rt,step:null,style:null,tabIndex:rt,target:null,title:null,translate:null,type:null,typeMustMatch:Ai,useMap:null,value:po,width:rt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:hs,axis:null,background:null,bgColor:null,border:rt,borderColor:null,bottomMargin:rt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ai,declare:Ai,event:null,face:null,frame:null,frameBorder:null,hSpace:rt,leftMargin:rt,link:null,longDesc:null,lowSrc:null,marginHeight:rt,marginWidth:rt,noResize:Ai,noHref:Ai,noShade:Ai,noWrap:Ai,object:null,profile:null,prompt:null,rev:null,rightMargin:rt,rules:null,scheme:null,scrolling:po,standby:null,summary:null,text:null,topMargin:rt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:rt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ai,disableRemotePlayback:Ai,prefix:null,property:null,results:rt,security:null,unselectable:null},space:"html",transform:Roe}),jwe=G1({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:ml,accentHeight:rt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:rt,amplitude:rt,arabicForm:null,ascent:rt,attributeName:null,attributeType:null,azimuth:rt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:rt,by:null,calcMode:null,capHeight:rt,className:hs,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:rt,diffuseConstant:rt,direction:null,display:null,dur:null,divisor:rt,dominantBaseline:null,download:Ai,dx:null,dy:null,edgeMode:null,editable:null,elevation:rt,enableBackground:null,end:null,event:null,exponent:rt,externalResourcesRequired:null,fill:null,fillOpacity:rt,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:mw,g2:mw,glyphName:mw,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:rt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:rt,horizOriginX:rt,horizOriginY:rt,id:null,ideographic:rt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:rt,k:rt,k1:rt,k2:rt,k3:rt,k4:rt,kernelMatrix:ml,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:rt,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:rt,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:rt,overlineThickness:rt,paintOrder:null,panose1:null,path:null,pathLength:rt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:hs,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:rt,pointsAtY:rt,pointsAtZ:rt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ml,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ml,rev:ml,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ml,requiredFeatures:ml,requiredFonts:ml,requiredFormats:ml,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:rt,specularExponent:rt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:rt,strikethroughThickness:rt,string:null,stroke:null,strokeDashArray:ml,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:rt,strokeOpacity:rt,strokeWidth:null,style:null,surfaceScale:rt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ml,tabIndex:rt,tableValues:null,target:null,targetX:rt,targetY:rt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ml,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:rt,underlineThickness:rt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:rt,values:null,vAlphabetic:rt,vMathematical:rt,vectorEffect:null,vHanging:rt,vIdeographic:rt,version:null,vertAdvY:rt,vertOriginX:rt,vertOriginY:rt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:rt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Toe}),Moe=G1({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()}}),Aoe=G1({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Roe}),Ooe=G1({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(s,e){return"xml:"+e.slice(3).toLowerCase()}}),$we={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"},qwe=/[A-Z]/g,uX=/-[a-z]/g,Kwe=/^data[-\w.:]+$/i;function Gwe(s,e){const t=IB(e);let i=e,n=tl;if(t in s.normal)return s.property[s.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Kwe.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(uX,Zwe);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!uX.test(o)){let r=o.replace(qwe,Ywe);r.charAt(0)!=="-"&&(r="-"+r),e="data"+r}}n=kz}return new n(i,e)}function Ywe(s){return"-"+s.toLowerCase()}function Zwe(s){return s.charAt(1).toUpperCase()}const Xwe=Ioe([Noe,Uwe,Moe,Aoe,Ooe],"html"),Dz=Ioe([Noe,jwe,Moe,Aoe,Ooe],"svg");function Qwe(s){return s.join(" ").trim()}var Yv={},GF,hX;function Jwe(){if(hX)return GF;hX=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=`
|
|
20
|
+
This will permanently delete the ${Ye} folder${s==="workflow"?" and all past runs":""}. This cannot be undone.`)){P(!0);try{await wi.delete(it,{headers:{Authorization:`Bearer ${b}`}}),Dt.success(`${Oe} deleted successfully`),L()}catch(Pe){const Ct=Pe instanceof fs?Pe.response?.data?.message||Pe.response?.data||Pe.message:`Failed to delete ${Ye}`;Dt.error(String(Ct))}finally{P(!1)}}};return N.jsxs("div",{className:"workflow-card",children:[N.jsxs("div",{className:"workflow-card-header",children:[N.jsx("h3",{className:"workflow-card-title",children:t}),N.jsx("span",{className:`workflow-approval-badge ${l?"approved":"pending"}`,children:l?"Approved":"Pending Approval"})]}),s==="skill"?N.jsx("p",{className:"workflow-card-description workflow-card-description-scrollable",children:i.trim()||"No description available"}):i&&N.jsx("p",{className:"workflow-card-description",children:i}),N.jsxs("p",{className:"workflow-card-meta",children:["Created by: ",o??r??"Unknown User"]}),!l&&N.jsx("div",{className:"workflow-approval-section",children:p==="Engineer"?N.jsx("button",{className:"workflow-approve-btn",onClick:()=>{_n()},children:"Review & Approve"}):N.jsxs("p",{className:"workflow-approval-message",children:["Ask an engineer to approve this ",Ye," before it can be used."]})}),l&&N.jsxs("div",{className:"workflow-approval-section",children:[N.jsx("p",{className:"workflow-approval-message",children:d==="everyone"?`${Lt}: Everyone`:u?`${Lt}: Restricted (locked - no allowed users remain)`:`${Lt}: Restricted`}),z&&!F&&N.jsx("p",{className:"workflow-approval-message",children:z}),Y&&N.jsx("p",{className:"workflow-approval-message",children:"Loading permissions..."}),N.jsx("button",{className:"workflow-approve-btn",onClick:()=>{bi()},disabled:!_t||Y,type:"button",children:"Manage Permissions"}),!_t&&N.jsx("p",{className:"workflow-approval-message",children:u?"No one can modify permissions because no allowed users remain.":`Only users who can use this ${Ye} can change permissions.`}),F&&N.jsxs("div",{className:"permissions-editor",children:[N.jsxs("div",{className:"permissions-editor-header",children:[N.jsx("h4",{className:"permissions-editor-title",children:ni}),N.jsxs("div",{className:"permissions-mode-group",children:[N.jsx("label",{className:"permissions-mode-label",htmlFor:`permission-mode-select-${e}`,children:"Permission Mode"}),N.jsxs("select",{id:`permission-mode-select-${e}`,className:"permissions-mode-select",value:$,onChange:Ue=>Q(Ue.target.value),children:[N.jsx("option",{value:"restricted",children:"Restricted (Specific Users)"}),N.jsx("option",{value:"everyone",children:"Everyone"})]})]})]}),$==="restricted"&&N.jsxs("div",{className:"permissions-users-section",children:[N.jsx("div",{className:"permissions-users-title",children:"Allowed Users"}),N.jsx("div",{className:"permissions-users-list",children:le.map(Ue=>{const Pe=me.includes(Ue.id),Ct=ke===Ue.id,_e=Xe===Ue.id;return N.jsxs("div",{className:`permissions-user-item ${Ct?"permissions-user-item-disabled":""}`,onClick:()=>!Ct&&ln(Ue.id),children:[N.jsx("input",{type:"checkbox",className:"permissions-user-checkbox",checked:Pe,disabled:Ct,onChange:()=>ln(Ue.id),onClick:$e=>$e.stopPropagation()}),N.jsxs("div",{className:"permissions-user-info",children:[N.jsx("div",{className:"permissions-user-name",children:Ue.name}),N.jsx("div",{className:"permissions-user-email",children:Ue.email})]}),(Ct||_e)&&N.jsxs("div",{className:"permissions-user-badges",children:[Ct&&N.jsx("span",{className:"permissions-user-badge permissions-user-badge-owner",children:"Owner"}),_e&&N.jsx("span",{className:"permissions-user-badge permissions-user-badge-approver",children:"Approver"})]})]},Ue.id)})})]}),N.jsxs("div",{className:"permissions-editor-actions",children:[N.jsx("button",{type:"button",className:"permissions-editor-save-btn",onClick:Ii,onMouseDown:Ue=>Ue.stopPropagation(),disabled:Z,children:Z?"Saving...":"Save Permissions"}),N.jsx("button",{type:"button",className:"permissions-editor-cancel-btn",onClick:()=>V(!1),onMouseDown:Ue=>Ue.stopPropagation(),disabled:Z,children:"Cancel"})]})]})]}),N.jsx(ywe,{viewLabel:w,onView:()=>E(e),showRunAction:y,runLabel:S,canRun:f,onRunAi:I,onRunManual:T,deleteVisible:Me,deleting:O,onDelete:()=>{at()}})]})}function Swe(s){return N.jsx(Eoe,{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,can_run:s.is_approved&&s.can_edit,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)})}function aX(s){return s.toLowerCase().trim().replace(/\s+/g,"-").replace(/-+/g,"-")}function xwe(s,e){const t=aX(e);if(!t)return!0;const i=aX(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 Lwe({onRunWorkflow:s}){const e=Hl(),t=Mo(),[i,n]=K.useState([]),[o,r]=K.useState(!0),[a,l]=K.useState(null),[c,d]=K.useState("all"),[u,f]=K.useState("everyone"),[p,m]=K.useState(""),b=t.loading?null:t.token,w=t.loading?null:t.user,y=K.useCallback(async()=>{if(b)try{const x=await wi.get("/api/workflows",{headers:{Authorization:`Bearer ${b}`}});n(x.data.workflows)}catch(x){const L=x instanceof fs?x.response?.data?.message||x.response?.data||x.message:"Failed to load workflows";l(L)}finally{r(!1)}},[b]);if(K.useEffect(()=>{y()},[y]),t.loading)return null;if(o)return N.jsx("div",{className:"section-loading",children:"Loading workflows..."});if(a)return N.jsx("div",{className:"section-error",children:a});if(i.length===0)return N.jsxs("div",{className:"section-empty",children:[N.jsx("h3",{children:"No Workflows Available"}),N.jsx("p",{children:"Create a workflow by talking to the AI Assistant."})]});const S=i.filter(x=>{const L=c==="all"?!0:c==="approved"?x.is_approved:!x.is_approved,E=u==="everyone"?!0:x.created_by_user_id===w?.userId,I=xwe(x.name||x.slug,p);return L&&E&&I});return N.jsxs("div",{className:"workflows-section-content",children:[N.jsxs("div",{className:"workflow-filters",children:[N.jsxs("div",{className:"workflow-filters-title",children:[N.jsx("span",{className:"workflow-filters-heading",children:"Filters"}),N.jsxs("span",{className:"workflow-filters-count",children:[S.length," / ",i.length," shown"]})]}),N.jsxs("div",{className:"workflow-filter-group",children:[N.jsx("label",{htmlFor:"workflow-approval-filter",children:"Approval"}),N.jsx("div",{className:"workflow-filter-select-wrap",children:N.jsxs("select",{id:"workflow-approval-filter",value:c,onChange:x=>d(x.target.value),children:[N.jsx("option",{value:"all",children:"All"}),N.jsx("option",{value:"approved",children:"Approved"}),N.jsx("option",{value:"pending",children:"Pending approval"})]})})]}),N.jsxs("div",{className:"workflow-filter-group",children:[N.jsx("label",{htmlFor:"workflow-ownership-filter",children:"Scope"}),N.jsx("div",{className:"workflow-filter-select-wrap",children:N.jsxs("select",{id:"workflow-ownership-filter",value:u,onChange:x=>f(x.target.value),children:[N.jsx("option",{value:"everyone",children:"Everyone's"}),N.jsx("option",{value:"mine",children:"Only mine"})]})})]}),N.jsxs("div",{className:"workflow-filter-group workflow-filter-group-search",children:[N.jsx("label",{htmlFor:"workflow-title-search",children:"Search title"}),N.jsx("div",{className:"workflow-filter-search-wrap",children:N.jsx("input",{id:"workflow-title-search",type:"search",value:p,onChange:x=>m(x.target.value),placeholder:"Search workflow title..."})})]})]}),S.length===0?N.jsxs("div",{className:"section-empty",children:[N.jsx("h3",{children:"No Workflows Match Filters"}),N.jsx("p",{children:"Try changing the approval or ownership filters."})]}):N.jsx("div",{className:"workflows-grid",children:S.map(x=>N.jsx(Swe,{...x,userRole:w?.role??"User",currentUserId:w?.userId??null,token:b??"",onApproved:y,onDeleted:y,onRunWorkflow:s,onRunWorkflowManual:L=>e(`/workflows/${encodeURIComponent(L)}/manual-run`),onOpenWorkflow:L=>e(`/workflows/${encodeURIComponent(L)}`)},x.slug))})]})}function kwe(s){return new Date(s).toLocaleString()}function Dwe(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 Ewe({status:s}){return N.jsx("span",{className:`status-badge status-${s}`,children:s})}function Iwe(){const s=Mo(),e=Hl(),[t,i]=K.useState([]),[n,o]=K.useState(!0),[r,a]=K.useState(null),l=s.loading?null:s.token;return K.useEffect(()=>{if(!l)return;(async()=>{try{const d=await wi.get("/api/workflows/runs",{headers:{Authorization:`Bearer ${l}`}});i(d.data.runs)}catch(d){const u=d instanceof fs?d.response?.data?.message||d.response?.data||d.message:"Failed to load run history";a(u)}finally{o(!1)}})()},[l]),s.loading?null:n?N.jsx("div",{className:"section-loading",children:"Loading run history..."}):r?N.jsx("div",{className:"section-error",children:r}):t.length===0?N.jsxs("div",{className:"section-empty",children:[N.jsx("h3",{children:"No Run History"}),N.jsx("p",{children:"Workflow runs will appear here once you start running workflows."})]}):N.jsx("div",{className:"run-history-table-container",children:N.jsxs("table",{className:"run-history-table",children:[N.jsx("thead",{children:N.jsxs("tr",{children:[N.jsx("th",{children:"Workflow"}),N.jsx("th",{children:"Status"}),N.jsx("th",{children:"Started"}),N.jsx("th",{children:"Duration"}),N.jsx("th",{children:"User"})]})}),N.jsx("tbody",{children:t.map(c=>N.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:[N.jsx("td",{className:"workflow-name-cell",children:c.workflow_slug}),N.jsx("td",{children:N.jsx(Ewe,{status:c.status})}),N.jsx("td",{children:kwe(c.started_at)}),N.jsx("td",{children:Dwe(c.started_at,c.completed_at)}),N.jsx("td",{children:c.user.name})]},c.id))})]})})}function Nwe({sessions:s,activeSessionId:e,onSelectSession:t,onNewSession:i,loading:n}){const o=r=>{const a=new Date(r),l=new Date;return a.toDateString()===l.toDateString()?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):a.toLocaleDateString([],{month:"short",day:"numeric"})};return N.jsxs("div",{className:"chat-sidebar",children:[N.jsxs("div",{className:"chat-sidebar-header",children:[N.jsx("h3",{children:"Sessions"}),N.jsx("button",{className:"new-session-btn",onClick:i,disabled:n,children:"+ New"})]}),N.jsx("div",{className:"session-list",children:s.length===0?N.jsx("div",{className:"no-sessions",children:n?"Loading...":"No sessions yet"}):s.map(r=>{const a=r.title||"New Chat";return N.jsx("div",{className:`session-item ${r.id===e?"active":""}`,onClick:()=>t(r.id),children:N.jsxs("div",{className:"session-title","data-full-title":a,children:[N.jsx("span",{className:"session-title-text",children:a}),N.jsx("span",{className:"session-updated-at",children:o(Number(r.updated_at))})]})},r.id)})})]})}function Twe(s){return s.role==="user"}function Rwe(s){return s.role==="assistant"}function Mwe(s){return s.type==="text"}function Awe(s){return s.type==="tool"}function Owe(s){return s.type==="reasoning"}function Pwe(s,e){const t={};return(s[s.length-1]===""?[...s,""]:s).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Fwe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bwe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wwe={};function lX(s,e){return(Wwe.jsx?Bwe:Fwe).test(s)}const Hwe=/[ \t\n\f\r]/g;function Vwe(s){return typeof s=="object"?s.type==="text"?cX(s.value):!1:cX(s)}function cX(s){return s.replace(Hwe,"")===""}class wk{constructor(e,t,i){this.normal=t,this.property=e,i&&(this.space=i)}}wk.prototype.normal={};wk.prototype.property={};wk.prototype.space=void 0;function Ioe(s,e){const t={},i={};for(const n of s)Object.assign(t,n.property),Object.assign(i,n.normal);return new wk(t,i,e)}function IB(s){return s.toLowerCase()}class tl{constructor(e,t){this.attribute=t,this.property=e}}tl.prototype.attribute="";tl.prototype.booleanish=!1;tl.prototype.boolean=!1;tl.prototype.commaOrSpaceSeparated=!1;tl.prototype.commaSeparated=!1;tl.prototype.defined=!1;tl.prototype.mustUseProperty=!1;tl.prototype.number=!1;tl.prototype.overloadedBoolean=!1;tl.prototype.property="";tl.prototype.spaceSeparated=!1;tl.prototype.space=void 0;let zwe=0;const Ai=Xb(),po=Xb(),NB=Xb(),rt=Xb(),hs=Xb(),mw=Xb(),ml=Xb();function Xb(){return 2**++zwe}const TB=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ai,booleanish:po,commaOrSpaceSeparated:ml,commaSeparated:mw,number:rt,overloadedBoolean:NB,spaceSeparated:hs},Symbol.toStringTag,{value:"Module"})),KF=Object.keys(TB);class kz extends tl{constructor(e,t,i,n){let o=-1;if(super(e,t),dX(this,"space",n),typeof i=="number")for(;++o<KF.length;){const r=KF[o];dX(this,KF[o],(i&TB[r])===TB[r])}}}kz.prototype.defined=!0;function dX(s,e,t){t&&(s[e]=t)}function G1(s){const e={},t={};for(const[i,n]of Object.entries(s.properties)){const o=new kz(i,s.transform(s.attributes||{},i),n,s.space);s.mustUseProperty&&s.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),e[i]=o,t[IB(i)]=i,t[IB(o.attribute)]=i}return new wk(e,t,s.space)}const Noe=G1({properties:{ariaActiveDescendant:null,ariaAtomic:po,ariaAutoComplete:null,ariaBusy:po,ariaChecked:po,ariaColCount:rt,ariaColIndex:rt,ariaColSpan:rt,ariaControls:hs,ariaCurrent:null,ariaDescribedBy:hs,ariaDetails:null,ariaDisabled:po,ariaDropEffect:hs,ariaErrorMessage:null,ariaExpanded:po,ariaFlowTo:hs,ariaGrabbed:po,ariaHasPopup:null,ariaHidden:po,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:hs,ariaLevel:rt,ariaLive:null,ariaModal:po,ariaMultiLine:po,ariaMultiSelectable:po,ariaOrientation:null,ariaOwns:hs,ariaPlaceholder:null,ariaPosInSet:rt,ariaPressed:po,ariaReadOnly:po,ariaRelevant:null,ariaRequired:po,ariaRoleDescription:hs,ariaRowCount:rt,ariaRowIndex:rt,ariaRowSpan:rt,ariaSelected:po,ariaSetSize:rt,ariaSort:null,ariaValueMax:rt,ariaValueMin:rt,ariaValueNow:rt,ariaValueText:null,role:null},transform(s,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Toe(s,e){return e in s?s[e]:e}function Roe(s,e){return Toe(s,e.toLowerCase())}const Uwe=G1({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mw,acceptCharset:hs,accessKey:hs,action:null,allow:null,allowFullScreen:Ai,allowPaymentRequest:Ai,allowUserMedia:Ai,alt:null,as:null,async:Ai,autoCapitalize:null,autoComplete:hs,autoFocus:Ai,autoPlay:Ai,blocking:hs,capture:null,charSet:null,checked:Ai,cite:null,className:hs,cols:rt,colSpan:null,content:null,contentEditable:po,controls:Ai,controlsList:hs,coords:rt|mw,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ai,defer:Ai,dir:null,dirName:null,disabled:Ai,download:NB,draggable:po,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ai,formTarget:null,headers:hs,height:rt,hidden:NB,high:rt,href:null,hrefLang:null,htmlFor:hs,httpEquiv:hs,id:null,imageSizes:null,imageSrcSet:null,inert:Ai,inputMode:null,integrity:null,is:null,isMap:Ai,itemId:null,itemProp:hs,itemRef:hs,itemScope:Ai,itemType:hs,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ai,low:rt,manifest:null,max:null,maxLength:rt,media:null,method:null,min:null,minLength:rt,multiple:Ai,muted:Ai,name:null,nonce:null,noModule:Ai,noValidate:Ai,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:Ai,optimum:rt,pattern:null,ping:hs,placeholder:null,playsInline:Ai,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ai,referrerPolicy:null,rel:hs,required:Ai,reversed:Ai,rows:rt,rowSpan:rt,sandbox:hs,scope:null,scoped:Ai,seamless:Ai,selected:Ai,shadowRootClonable:Ai,shadowRootDelegatesFocus:Ai,shadowRootMode:null,shape:null,size:rt,sizes:null,slot:null,span:rt,spellCheck:po,src:null,srcDoc:null,srcLang:null,srcSet:null,start:rt,step:null,style:null,tabIndex:rt,target:null,title:null,translate:null,type:null,typeMustMatch:Ai,useMap:null,value:po,width:rt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:hs,axis:null,background:null,bgColor:null,border:rt,borderColor:null,bottomMargin:rt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ai,declare:Ai,event:null,face:null,frame:null,frameBorder:null,hSpace:rt,leftMargin:rt,link:null,longDesc:null,lowSrc:null,marginHeight:rt,marginWidth:rt,noResize:Ai,noHref:Ai,noShade:Ai,noWrap:Ai,object:null,profile:null,prompt:null,rev:null,rightMargin:rt,rules:null,scheme:null,scrolling:po,standby:null,summary:null,text:null,topMargin:rt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:rt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ai,disableRemotePlayback:Ai,prefix:null,property:null,results:rt,security:null,unselectable:null},space:"html",transform:Roe}),jwe=G1({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:ml,accentHeight:rt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:rt,amplitude:rt,arabicForm:null,ascent:rt,attributeName:null,attributeType:null,azimuth:rt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:rt,by:null,calcMode:null,capHeight:rt,className:hs,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:rt,diffuseConstant:rt,direction:null,display:null,dur:null,divisor:rt,dominantBaseline:null,download:Ai,dx:null,dy:null,edgeMode:null,editable:null,elevation:rt,enableBackground:null,end:null,event:null,exponent:rt,externalResourcesRequired:null,fill:null,fillOpacity:rt,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:mw,g2:mw,glyphName:mw,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:rt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:rt,horizOriginX:rt,horizOriginY:rt,id:null,ideographic:rt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:rt,k:rt,k1:rt,k2:rt,k3:rt,k4:rt,kernelMatrix:ml,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:rt,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:rt,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:rt,overlineThickness:rt,paintOrder:null,panose1:null,path:null,pathLength:rt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:hs,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:rt,pointsAtY:rt,pointsAtZ:rt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ml,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ml,rev:ml,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ml,requiredFeatures:ml,requiredFonts:ml,requiredFormats:ml,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:rt,specularExponent:rt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:rt,strikethroughThickness:rt,string:null,stroke:null,strokeDashArray:ml,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:rt,strokeOpacity:rt,strokeWidth:null,style:null,surfaceScale:rt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ml,tabIndex:rt,tableValues:null,target:null,targetX:rt,targetY:rt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ml,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:rt,underlineThickness:rt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:rt,values:null,vAlphabetic:rt,vMathematical:rt,vectorEffect:null,vHanging:rt,vIdeographic:rt,version:null,vertAdvY:rt,vertOriginX:rt,vertOriginY:rt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:rt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Toe}),Moe=G1({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()}}),Aoe=G1({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Roe}),Ooe=G1({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(s,e){return"xml:"+e.slice(3).toLowerCase()}}),$we={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"},qwe=/[A-Z]/g,uX=/-[a-z]/g,Kwe=/^data[-\w.:]+$/i;function Gwe(s,e){const t=IB(e);let i=e,n=tl;if(t in s.normal)return s.property[s.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Kwe.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(uX,Zwe);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!uX.test(o)){let r=o.replace(qwe,Ywe);r.charAt(0)!=="-"&&(r="-"+r),e="data"+r}}n=kz}return new n(i,e)}function Ywe(s){return"-"+s.toLowerCase()}function Zwe(s){return s.charAt(1).toUpperCase()}const Xwe=Ioe([Noe,Uwe,Moe,Aoe,Ooe],"html"),Dz=Ioe([Noe,jwe,Moe,Aoe,Ooe],"svg");function Qwe(s){return s.join(" ").trim()}var Yv={},GF,hX;function Jwe(){if(hX)return GF;hX=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(w,y){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];y=y||{};var S=1,x=1;function L(Z){var q=Z.match(e);q&&(S+=q.length);var z=Z.lastIndexOf(l);x=~z?Z.length-z:x+Z.length}function E(){var Z={line:S,column:x};return function(q){return q.position=new I(Z),P(),q}}function I(Z){this.start=Z,this.end={line:S,column:x},this.source=y.source}I.prototype.content=w;function T(Z){var q=new Error(y.source+":"+S+":"+x+": "+Z);if(q.reason=Z,q.filename=y.source,q.line=S,q.column=x,q.source=w,!y.silent)throw q}function O(Z){var q=Z.exec(w);if(q){var z=q[0];return L(z),w=w.slice(z.length),q}}function P(){O(t)}function F(Z){var q;for(Z=Z||[];q=V();)q!==!1&&Z.push(q);return Z}function V(){var Z=E();if(!(c!=w.charAt(0)||d!=w.charAt(1))){for(var q=2;u!=w.charAt(q)&&(d!=w.charAt(q)||c!=w.charAt(q+1));)++q;if(q+=2,u===w.charAt(q-1))return T("End of comment missing");var z=w.slice(2,q-2);return x+=2,L(z),w=w.slice(q),x+=2,Z({type:f,comment:z})}}function Y(){var Z=E(),q=O(i);if(q){if(V(),!O(n))return T("property missing ':'");var z=O(o),J=Z({type:p,property:b(q[0].replace(s,u)),value:z?b(z[0].replace(s,u)):u});return O(r),J}}function se(){var Z=[];F(Z);for(var q;q=Y();)q!==!1&&(Z.push(q),F(Z));return Z}return P(),se()}function b(w){return w?w.replace(a,u):u}return GF=m,GF}var fX;function e1e(){if(fX)return Yv;fX=1;var s=Yv&&Yv.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Yv,"__esModule",{value:!0}),Yv.default=t;const e=s(Jwe());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 Yv}var p0={},gX;function t1e(){if(gX)return p0;gX=1,Object.defineProperty(p0,"__esModule",{value:!0}),p0.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 p0.camelCase=l,p0}var m0,pX;function i1e(){if(pX)return m0;pX=1;var s=m0&&m0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},e=s(e1e()),t=t1e();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,m0=i,m0}var n1e=i1e();const s1e=hz(n1e),Poe=Foe("end"),Ez=Foe("start");function Foe(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 o1e(s){const e=Ez(s),t=Poe(s);if(e&&t)return{start:e,end:t}}function bS(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?RB(s):""}function RB(s){return _X(s&&s.line)+":"+_X(s&&s.column)}function mX(s){return RB(s&&s.start)+"-"+RB(s&&s.end)}function _X(s){return s&&typeof s=="number"?s:1}class Wr 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=bS(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}}Wr.prototype.file="";Wr.prototype.name="";Wr.prototype.reason="";Wr.prototype.message="";Wr.prototype.stack="";Wr.prototype.column=void 0;Wr.prototype.line=void 0;Wr.prototype.ancestors=void 0;Wr.prototype.cause=void 0;Wr.prototype.fatal=void 0;Wr.prototype.place=void 0;Wr.prototype.ruleId=void 0;Wr.prototype.source=void 0;const Iz={}.hasOwnProperty,r1e=new Map,a1e=/[A-Z]/g,l1e=new Set(["table","tbody","thead","tfoot","tr"]),c1e=new Set(["td","th"]),Boe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function d1e(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=b1e(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=_1e(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"?Dz:Xwe,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},o=Woe(n,s,void 0);return o&&typeof o!="string"?o:n.create(s,n.Fragment,{children:o||void 0},void 0)}function Woe(s,e,t){if(e.type==="element")return u1e(s,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return h1e(s,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return g1e(s,e,t);if(e.type==="mdxjsEsm")return f1e(s,e);if(e.type==="root")return p1e(s,e,t);if(e.type==="text")return m1e(s,e)}function u1e(s,e,t){const i=s.schema;let n=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(n=Dz,s.schema=n),s.ancestors.push(e);const o=Voe(s,e.tagName,!1),r=v1e(s,e);let a=Tz(s,e);return l1e.has(e.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Vwe(l):!0})),Hoe(s,r,o,e),Nz(r,a),s.ancestors.pop(),s.schema=i,s.create(e,o,r,t)}function h1e(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)}Ex(s,e.position)}function f1e(s,e){if(e.data&&e.data.estree&&s.evaluater)return s.evaluater.evaluateProgram(e.data.estree);Ex(s,e.position)}function g1e(s,e,t){const i=s.schema;let n=i;e.name==="svg"&&i.space==="html"&&(n=Dz,s.schema=n),s.ancestors.push(e);const o=e.name===null?s.Fragment:Voe(s,e.name,!0),r=C1e(s,e),a=Tz(s,e);return Hoe(s,r,o,e),Nz(r,a),s.ancestors.pop(),s.schema=i,s.create(e,o,r,t)}function p1e(s,e,t){const i={};return Nz(i,Tz(s,e)),s.create(e,s.Fragment,i,t)}function m1e(s,e){return e.value}function Hoe(s,e,t,i){typeof t!="string"&&t!==s.Fragment&&s.passNode&&(e.node=i)}function Nz(s,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(s.children=t)}}function _1e(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 b1e(s,e){return t;function t(i,n,o,r){const a=Array.isArray(o.children),l=Ez(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 v1e(s,e){const t={};let i,n;for(n in e.properties)if(n!=="children"&&Iz.call(e.properties,n)){const o=w1e(s,n,e.properties[n]);if(o){const[r,a]=o;s.tableCellAlignToStyle&&r==="align"&&typeof a=="string"&&c1e.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 C1e(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 Ex(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 Ex(s,e.position);else o=i.value===null?!0:i.value;t[n]=o}return t}function Tz(s,e){const t=[];let i=-1;const n=s.passKeys?new Map:r1e;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=Woe(s,o,r);a!==void 0&&t.push(a)}return t}function w1e(s,e,t){const i=Gwe(s.schema,e);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=i.commaSeparated?Pwe(t):Qwe(t)),i.property==="style"){let n=typeof t=="object"?t:y1e(s,String(t));return s.stylePropertyNameCase==="css"&&(n=S1e(n)),["style",n]}return[s.elementAttributeNameCase==="react"&&i.space?$we[i.property]||i.property:i.attribute,t]}}function y1e(s,e){try{return s1e(e,{reactCompat:!0})}catch(t){if(s.ignoreInvalidStyle)return{};const i=t,n=new Wr("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=Boe+"#cannot-parse-style-attribute",n}}function Voe(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 Iz.call(s.components,n)?s.components[n]:n}if(s.evaluater)return s.evaluater.evaluateExpression(i);Ex(s)}function Ex(s,e){const t=new Wr("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=Boe+"#cannot-handle-mdx-estrees-without-createevaluater",t}function S1e(s){const e={};let t;for(t in s)Iz.call(s,t)&&(e[x1e(t)]=s[t]);return e}function x1e(s){let e=s.replace(a1e,L1e);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function L1e(s){return"-"+s.toLowerCase()}const YF={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"]},k1e={};function Rz(s,e){const t=k1e,i=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,n=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return zoe(s,i,n)}function zoe(s,e,t){if(D1e(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 bX(s.children,e,t)}return Array.isArray(s)?bX(s,e,t):""}function bX(s,e,t){const i=[];let n=-1;for(;++n<s.length;)i[n]=zoe(s[n],e,t);return i.join("")}function D1e(s){return!!(s&&typeof s=="object")}const vX=document.createElement("i");function Mz(s){const e="&"+s+";";vX.innerHTML=e;const t=vX.textContent;return t.charCodeAt(t.length-1)===59&&s!=="semi"||t===e?!1:t}function El(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 uc(s,e){return s.length>0?(El(s,s.length,0,e),s):e}const CX={}.hasOwnProperty;function Uoe(s){const e={};let t=-1;for(;++t<s.length;)E1e(e,s[t]);return e}function E1e(s,e){let t;for(t in e){const n=(CX.call(s,t)?s[t]:void 0)||(s[t]={}),o=e[t];let r;if(o)for(r in o){CX.call(n,r)||(n[r]=[]);const a=o[r];I1e(n[r],Array.isArray(a)?a:a?[a]:[])}}}function I1e(s,e){let t=-1;const i=[];for(;++t<e.length;)(e[t].add==="after"?s:i).push(e[t]);El(s,0,0,i)}function joe(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 od(s){return s.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ta=Ap(/[A-Za-z]/),Tr=Ap(/[\dA-Za-z]/),N1e=Ap(/[#-'*+\--9=?A-Z^-~]/);function HN(s){return s!==null&&(s<32||s===127)}const MB=Ap(/\d/),T1e=Ap(/[\dA-Fa-f]/),R1e=Ap(/[!-/:-@[-`{-~]/);function si(s){return s!==null&&s<-2}function ds(s){return s!==null&&(s<0||s===32)}function ji(s){return s===-2||s===-1||s===32}const FA=Ap(new RegExp("\\p{P}|\\p{S}","u")),yb=Ap(/\s/);function Ap(s){return e;function e(t){return t!==null&&t>-1&&s.test(String.fromCharCode(t))}}function Y1(s){const e=[];let t=-1,i=0,n=0;for(;++t<s.length;){const o=s.charCodeAt(t);let r="";if(o===37&&Tr(s.charCodeAt(t+1))&&Tr(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 fn(s,e,t,i){const n=i?i-1:Number.POSITIVE_INFINITY;let o=0;return r;function r(l){return ji(l)?(s.enter(t),a(l)):e(l)}function a(l){return ji(l)&&o++<n?(s.consume(l),a):(s.exit(t),e(l))}}const M1e={tokenize:A1e};function A1e(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"),fn(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 si(a)?(s.consume(a),s.exit("chunkText"),o):(s.consume(a),r)}}const O1e={tokenize:P1e},wX={tokenize:F1e};function P1e(s){const e=this,t=[];let i=0,n,o,r;return a;function a(x){if(i<t.length){const L=t[i];return e.containerState=L[1],s.attempt(L[0].continuation,l,c)(x)}return c(x)}function l(x){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,n&&S();const L=e.events.length;let E=L,I;for(;E--;)if(e.events[E][0]==="exit"&&e.events[E][1].type==="chunkFlow"){I=e.events[E][1].end;break}y(i);let T=L;for(;T<e.events.length;)e.events[T][1].end={...I},T++;return El(e.events,E+1,0,e.events.slice(L)),e.events.length=T,c(x)}return a(x)}function c(x){if(i===t.length){if(!n)return f(x);if(n.currentConstruct&&n.currentConstruct.concrete)return m(x);e.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return e.containerState={},s.check(wX,d,u)(x)}function d(x){return n&&S(),y(i),f(x)}function u(x){return e.parser.lazy[e.now().line]=i!==t.length,r=e.now().offset,m(x)}function f(x){return e.containerState={},s.attempt(wX,p,m)(x)}function p(x){return i++,t.push([e.currentConstruct,e.containerState]),f(x)}function m(x){if(x===null){n&&S(),y(0),s.consume(x);return}return n=n||e.parser.flow(e.now()),s.enter("chunkFlow",{_tokenizer:n,contentType:"flow",previous:o}),b(x)}function b(x){if(x===null){w(s.exit("chunkFlow"),!0),y(0),s.consume(x);return}return si(x)?(s.consume(x),w(s.exit("chunkFlow")),i=0,e.interrupt=void 0,a):(s.consume(x),b)}function w(x,L){const E=e.sliceStream(x);if(L&&E.push(null),x.previous=o,o&&(o.next=x),o=x,n.defineSkip(x.start),n.write(E),e.parser.lazy[x.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,P,F;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(P){F=e.events[O][1].end;break}P=!0}for(y(i),I=T;I<e.events.length;)e.events[I][1].end={...F},I++;El(e.events,O+1,0,e.events.slice(T)),e.events.length=I}}function y(x){let L=t.length;for(;L-- >x;){const E=t[L];e.containerState=E[1],E[0].exit.call(e,s)}t.length=x}function S(){n.write([null]),o=void 0,n=void 0,e.containerState._closeFlow=void 0}}function F1e(s,e,t){return fn(s,s.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function i1(s){if(s===null||ds(s)||yb(s))return 1;if(FA(s))return 2}function BA(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 AB={name:"attention",resolveAll:B1e,tokenize:W1e};function B1e(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};yX(u,-l),yX(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=uc(c,[["enter",s[i][1],e],["exit",s[i][1],e]])),c=uc(c,[["enter",n,e],["enter",r,e],["exit",r,e],["enter",o,e]]),c=uc(c,BA(e.parser.constructs.insideSpan.null,s.slice(i+1,t),e)),c=uc(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=uc(c,[["enter",s[t][1],e],["exit",s[t][1],e]])):d=0,El(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 W1e(s,e){const t=this.parser.constructs.attentionMarkers.null,i=this.previous,n=i1(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=i1(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 yX(s,e){s.column+=e,s.offset+=e,s._bufferIndex+=e}const H1e={name:"autolink",tokenize:V1e};function V1e(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 ta(p)?(s.consume(p),r):p===64?t(p):c(p)}function r(p){return p===43||p===45||p===46||Tr(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||Tr(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||HN(p)?t(p):(s.consume(p),l)}function c(p){return p===64?(s.consume(p),d):N1e(p)?(s.consume(p),c):t(p)}function d(p){return Tr(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||Tr(p))&&i++<63){const m=p===45?f:u;return s.consume(p),m}return t(p)}}const yk={partial:!0,tokenize:z1e};function z1e(s,e,t){return i;function i(o){return ji(o)?fn(s,n,"linePrefix")(o):n(o)}function n(o){return o===null||si(o)?e(o):t(o)}}const $oe={continuation:{tokenize:j1e},exit:$1e,name:"blockQuote",tokenize:U1e};function U1e(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 ji(r)?(s.enter("blockQuotePrefixWhitespace"),s.consume(r),s.exit("blockQuotePrefixWhitespace"),s.exit("blockQuotePrefix"),e):(s.exit("blockQuotePrefix"),e(r))}}function j1e(s,e,t){const i=this;return n;function n(r){return ji(r)?fn(s,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(r):o(r)}function o(r){return s.attempt($oe,e,t)(r)}}function $1e(s){s.exit("blockQuote")}const qoe={name:"characterEscape",tokenize:q1e};function q1e(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 R1e(o)?(s.enter("characterEscapeValue"),s.consume(o),s.exit("characterEscapeValue"),s.exit("characterEscape"),e):t(o)}}const Koe={name:"characterReference",tokenize:K1e};function K1e(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=Tr,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=T1e,d):(s.enter("characterReferenceValue"),o=7,r=MB,d(u))}function d(u){if(u===59&&n){const f=s.exit("characterReferenceValue");return r===Tr&&!Mz(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 SX={partial:!0,tokenize:Y1e},xX={concrete:!0,name:"codeFenced",tokenize:G1e};function G1e(s,e,t){const i=this,n={partial:!0,tokenize:E};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"),ji(I)?fn(s,u,"whitespace")(I):u(I))}function u(I){return I===null||si(I)?(s.exit("codeFencedFence"),i.interrupt?e(I):s.check(SX,b,L)(I)):(s.enter("codeFencedFenceInfo"),s.enter("chunkString",{contentType:"string"}),f(I))}function f(I){return I===null||si(I)?(s.exit("chunkString"),s.exit("codeFencedFenceInfo"),u(I)):ji(I)?(s.exit("chunkString"),s.exit("codeFencedFenceInfo"),fn(s,p,"whitespace")(I)):I===96&&I===a?t(I):(s.consume(I),f)}function p(I){return I===null||si(I)?u(I):(s.enter("codeFencedFenceMeta"),s.enter("chunkString",{contentType:"string"}),m(I))}function m(I){return I===null||si(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,L,w)(I)}function w(I){return s.enter("lineEnding"),s.consume(I),s.exit("lineEnding"),y}function y(I){return o>0&&ji(I)?fn(s,S,"linePrefix",o+1)(I):S(I)}function S(I){return I===null||si(I)?s.check(SX,b,L)(I):(s.enter("codeFlowValue"),x(I))}function x(I){return I===null||si(I)?(s.exit("codeFlowValue"),S(I)):(s.consume(I),x)}function L(I){return s.exit("codeFenced"),e(I)}function E(I,T,O){let P=0;return F;function F(q){return I.enter("lineEnding"),I.consume(q),I.exit("lineEnding"),V}function V(q){return I.enter("codeFencedFence"),ji(q)?fn(I,Y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):Y(q)}function Y(q){return q===a?(I.enter("codeFencedFenceSequence"),se(q)):O(q)}function se(q){return q===a?(P++,I.consume(q),se):P>=r?(I.exit("codeFencedFenceSequence"),ji(q)?fn(I,Z,"whitespace")(q):Z(q)):O(q)}function Z(q){return q===null||si(q)?(I.exit("codeFencedFence"),T(q)):O(q)}}}function Y1e(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 ZF={name:"codeIndented",tokenize:X1e},Z1e={partial:!0,tokenize:Q1e};function X1e(s,e,t){const i=this;return n;function n(c){return s.enter("codeIndented"),fn(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):si(c)?s.attempt(Z1e,r,l)(c):(s.enter("codeFlowValue"),a(c))}function a(c){return c===null||si(c)?(s.exit("codeFlowValue"),r(c)):(s.consume(c),a)}function l(c){return s.exit("codeIndented"),e(c)}}function Q1e(s,e,t){const i=this;return n;function n(r){return i.parser.lazy[i.now().line]?t(r):si(r)?(s.enter("lineEnding"),s.consume(r),s.exit("lineEnding"),n):fn(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):si(r)?n(r):t(r)}}const J1e={name:"codeText",previous:tye,resolve:eye,tokenize:iye};function eye(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 tye(s){return s!==96||this.events[this.events.length-1][1].type==="characterEscape"}function iye(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)):si(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||si(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 nye{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&&_0(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),_0(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_0(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);_0(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);_0(this.left,t.reverse())}}}function _0(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 Goe(s){const e={};let t=-1,i,n,o,r,a,l,c;const d=new nye(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,sye(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 El(s,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function sye(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 w=[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,w.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):w.pop(),f=w.length;f--;){const y=a.slice(w[f],w[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 oye={resolve:aye,tokenize:lye},rye={partial:!0,tokenize:cye};function aye(s){return Goe(s),s}function lye(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):si(a)?s.check(rye,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 cye(s,e,t){const i=this;return n;function n(r){return s.exit("chunkContent"),s.enter("lineEnding"),s.consume(r),s.exit("lineEnding"),fn(s,o,"linePrefix")}function o(r){if(r===null||si(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 Yoe(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||HN(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||si(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||ds(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||HN(y)?t(y):(s.consume(y),y===92?w:b)}function w(y){return y===40||y===41||y===92?(s.consume(y),b):b(y)}}function Zoe(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):si(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||si(p)||a++>999?(s.exit("chunkString"),d(p)):(s.consume(p),l||(l=!ji(p)),p===92?f:u)}function f(p){return p===91||p===92||p===93?(s.consume(p),a++,u):u(p)}}function Xoe(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):si(f)?(s.enter("lineEnding"),s.consume(f),s.exit("lineEnding"),fn(s,c,"linePrefix")):(s.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===r||f===null||si(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 vS(s,e){let t;return i;function i(n){return si(n)?(s.enter("lineEnding"),s.consume(n),s.exit("lineEnding"),t=!0,i):ji(n)?fn(s,i,t?"linePrefix":"lineSuffix")(n):e(n)}}const dye={name:"definition",tokenize:hye},uye={partial:!0,tokenize:fye};function hye(s,e,t){const i=this;let n;return o;function o(p){return s.enter("definition"),r(p)}function r(p){return Zoe.call(i,s,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return n=od(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 ds(p)?vS(s,c)(p):c(p)}function c(p){return Yoe(s,d,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return s.attempt(uye,u,u)(p)}function u(p){return ji(p)?fn(s,f,"whitespace")(p):f(p)}function f(p){return p===null||si(p)?(s.exit("definition"),i.parser.defined.push(n),e(p)):t(p)}}function fye(s,e,t){return i;function i(a){return ds(a)?vS(s,n)(a):t(a)}function n(a){return Xoe(s,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ji(a)?fn(s,r,"whitespace")(a):r(a)}function r(a){return a===null||si(a)?e(a):t(a)}}const gye={name:"hardBreakEscape",tokenize:pye};function pye(s,e,t){return i;function i(o){return s.enter("hardBreakEscape"),s.consume(o),n}function n(o){return si(o)?(s.exit("hardBreakEscape"),e(o)):t(o)}}const mye={name:"headingAtx",resolve:_ye,tokenize:bye};function _ye(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"},El(s,i,t-i+1,[["enter",n,e],["enter",o,e],["exit",o,e],["exit",n,e]])),s}function bye(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||ds(d)?(s.exit("atxHeadingSequence"),a(d)):t(d)}function a(d){return d===35?(s.enter("atxHeadingSequence"),l(d)):d===null||si(d)?(s.exit("atxHeading"),e(d)):ji(d)?fn(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||ds(d)?(s.exit("atxHeadingText"),a(d)):(s.consume(d),c)}}const vye=["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"],LX=["pre","script","style","textarea"],Cye={concrete:!0,name:"htmlFlow",resolveTo:Sye,tokenize:xye},wye={partial:!0,tokenize:kye},yye={partial:!0,tokenize:Lye};function Sye(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 xye(s,e,t){const i=this;let n,o,r,a,l;return c;function c(U){return d(U)}function d(U){return s.enter("htmlFlow"),s.enter("htmlFlowData"),s.consume(U),u}function u(U){return U===33?(s.consume(U),f):U===47?(s.consume(U),o=!0,b):U===63?(s.consume(U),n=3,i.interrupt?e:$):ta(U)?(s.consume(U),r=String.fromCharCode(U),w):t(U)}function f(U){return U===45?(s.consume(U),n=2,p):U===91?(s.consume(U),n=5,a=0,m):ta(U)?(s.consume(U),n=4,i.interrupt?e:$):t(U)}function p(U){return U===45?(s.consume(U),i.interrupt?e:$):t(U)}function m(U){const ke="CDATA[";return U===ke.charCodeAt(a++)?(s.consume(U),a===ke.length?i.interrupt?e:Y:m):t(U)}function b(U){return ta(U)?(s.consume(U),r=String.fromCharCode(U),w):t(U)}function w(U){if(U===null||U===47||U===62||ds(U)){const ke=U===47,je=r.toLowerCase();return!ke&&!o&&LX.includes(je)?(n=1,i.interrupt?e(U):Y(U)):vye.includes(r.toLowerCase())?(n=6,ke?(s.consume(U),y):i.interrupt?e(U):Y(U)):(n=7,i.interrupt&&!i.parser.lazy[i.now().line]?t(U):o?S(U):x(U))}return U===45||Tr(U)?(s.consume(U),r+=String.fromCharCode(U),w):t(U)}function y(U){return U===62?(s.consume(U),i.interrupt?e:Y):t(U)}function S(U){return ji(U)?(s.consume(U),S):F(U)}function x(U){return U===47?(s.consume(U),F):U===58||U===95||ta(U)?(s.consume(U),L):ji(U)?(s.consume(U),x):F(U)}function L(U){return U===45||U===46||U===58||U===95||Tr(U)?(s.consume(U),L):E(U)}function E(U){return U===61?(s.consume(U),I):ji(U)?(s.consume(U),E):x(U)}function I(U){return U===null||U===60||U===61||U===62||U===96?t(U):U===34||U===39?(s.consume(U),l=U,T):ji(U)?(s.consume(U),I):O(U)}function T(U){return U===l?(s.consume(U),l=null,P):U===null||si(U)?t(U):(s.consume(U),T)}function O(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||ds(U)?E(U):(s.consume(U),O)}function P(U){return U===47||U===62||ji(U)?x(U):t(U)}function F(U){return U===62?(s.consume(U),V):t(U)}function V(U){return U===null||si(U)?Y(U):ji(U)?(s.consume(U),V):t(U)}function Y(U){return U===45&&n===2?(s.consume(U),z):U===60&&n===1?(s.consume(U),J):U===62&&n===4?(s.consume(U),Q):U===63&&n===3?(s.consume(U),$):U===93&&n===5?(s.consume(U),ce):si(U)&&(n===6||n===7)?(s.exit("htmlFlowData"),s.check(wye,me,se)(U)):U===null||si(U)?(s.exit("htmlFlowData"),se(U)):(s.consume(U),Y)}function se(U){return s.check(yye,Z,me)(U)}function Z(U){return s.enter("lineEnding"),s.consume(U),s.exit("lineEnding"),q}function q(U){return U===null||si(U)?se(U):(s.enter("htmlFlowData"),Y(U))}function z(U){return U===45?(s.consume(U),$):Y(U)}function J(U){return U===47?(s.consume(U),r="",le):Y(U)}function le(U){if(U===62){const ke=r.toLowerCase();return LX.includes(ke)?(s.consume(U),Q):Y(U)}return ta(U)&&r.length<8?(s.consume(U),r+=String.fromCharCode(U),le):Y(U)}function ce(U){return U===93?(s.consume(U),$):Y(U)}function $(U){return U===62?(s.consume(U),Q):U===45&&n===2?(s.consume(U),$):Y(U)}function Q(U){return U===null||si(U)?(s.exit("htmlFlowData"),me(U)):(s.consume(U),Q)}function me(U){return s.exit("htmlFlow"),e(U)}}function Lye(s,e,t){const i=this;return n;function n(r){return si(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 kye(s,e,t){return i;function i(n){return s.enter("lineEnding"),s.consume(n),s.exit("lineEnding"),s.attempt(yk,e,t)}}const Dye={name:"htmlText",tokenize:Eye};function Eye(s,e,t){const i=this;let n,o,r;return a;function a($){return s.enter("htmlText"),s.enter("htmlTextData"),s.consume($),l}function l($){return $===33?(s.consume($),c):$===47?(s.consume($),E):$===63?(s.consume($),x):ta($)?(s.consume($),O):t($)}function c($){return $===45?(s.consume($),d):$===91?(s.consume($),o=0,m):ta($)?(s.consume($),S):t($)}function d($){return $===45?(s.consume($),p):t($)}function u($){return $===null?t($):$===45?(s.consume($),f):si($)?(r=u,J($)):(s.consume($),u)}function f($){return $===45?(s.consume($),p):u($)}function p($){return $===62?z($):$===45?f($):u($)}function m($){const Q="CDATA[";return $===Q.charCodeAt(o++)?(s.consume($),o===Q.length?b:m):t($)}function b($){return $===null?t($):$===93?(s.consume($),w):si($)?(r=b,J($)):(s.consume($),b)}function w($){return $===93?(s.consume($),y):b($)}function y($){return $===62?z($):$===93?(s.consume($),y):b($)}function S($){return $===null||$===62?z($):si($)?(r=S,J($)):(s.consume($),S)}function x($){return $===null?t($):$===63?(s.consume($),L):si($)?(r=x,J($)):(s.consume($),x)}function L($){return $===62?z($):x($)}function E($){return ta($)?(s.consume($),I):t($)}function I($){return $===45||Tr($)?(s.consume($),I):T($)}function T($){return si($)?(r=T,J($)):ji($)?(s.consume($),T):z($)}function O($){return $===45||Tr($)?(s.consume($),O):$===47||$===62||ds($)?P($):t($)}function P($){return $===47?(s.consume($),z):$===58||$===95||ta($)?(s.consume($),F):si($)?(r=P,J($)):ji($)?(s.consume($),P):z($)}function F($){return $===45||$===46||$===58||$===95||Tr($)?(s.consume($),F):V($)}function V($){return $===61?(s.consume($),Y):si($)?(r=V,J($)):ji($)?(s.consume($),V):P($)}function Y($){return $===null||$===60||$===61||$===62||$===96?t($):$===34||$===39?(s.consume($),n=$,se):si($)?(r=Y,J($)):ji($)?(s.consume($),Y):(s.consume($),Z)}function se($){return $===n?(s.consume($),n=void 0,q):$===null?t($):si($)?(r=se,J($)):(s.consume($),se)}function Z($){return $===null||$===34||$===39||$===60||$===61||$===96?t($):$===47||$===62||ds($)?P($):(s.consume($),Z)}function q($){return $===47||$===62||ds($)?P($):t($)}function z($){return $===62?(s.consume($),s.exit("htmlTextData"),s.exit("htmlText"),e):t($)}function J($){return s.exit("htmlTextData"),s.enter("lineEnding"),s.consume($),s.exit("lineEnding"),le}function le($){return ji($)?fn(s,ce,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):ce($)}function ce($){return s.enter("htmlTextData"),r($)}}const Az={name:"labelEnd",resolveAll:Rye,resolveTo:Mye,tokenize:Aye},Iye={tokenize:Oye},Nye={tokenize:Pye},Tye={tokenize:Fye};function Rye(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&&El(s,0,s.length,t),s}function Mye(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=uc(a,s.slice(o+1,o+i+3)),a=uc(a,[["enter",d,e]]),a=uc(a,BA(e.parser.constructs.insideSpan.null,s.slice(o+i+4,r-3),e)),a=uc(a,[["exit",d,e],s[r-2],s[r-1],["exit",c,e]]),a=uc(a,s.slice(r+1)),a=uc(a,[["exit",l,e]]),El(s,o,s.length,a),s}function Aye(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(od(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(Iye,d,r?d:u)(f):f===91?s.attempt(Nye,d,r?c:u)(f):r?d(f):u(f)}function c(f){return s.attempt(Tye,d,u)(f)}function d(f){return e(f)}function u(f){return o._balanced=!0,t(f)}}function Oye(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 ds(u)?vS(s,o)(u):o(u)}function o(u){return u===41?d(u):Yoe(s,r,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function r(u){return ds(u)?vS(s,l)(u):d(u)}function a(u){return t(u)}function l(u){return u===34||u===39||u===40?Xoe(s,c,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return ds(u)?vS(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 Pye(s,e,t){const i=this;return n;function n(a){return Zoe.call(i,s,o,r,"reference","referenceMarker","referenceString")(a)}function o(a){return i.parser.defined.includes(od(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(a):t(a)}function r(a){return t(a)}}function Fye(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 Bye={name:"labelStartImage",resolveAll:Az.resolveAll,tokenize:Wye};function Wye(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 Hye={name:"labelStartLink",resolveAll:Az.resolveAll,tokenize:Vye};function Vye(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 XF={name:"lineEnding",tokenize:zye};function zye(s,e){return t;function t(i){return s.enter("lineEnding"),s.consume(i),s.exit("lineEnding"),fn(s,e,"linePrefix")}}const YI={name:"thematicBreak",tokenize:Uye};function Uye(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||si(c))?(s.exit("thematicBreak"),e(c)):t(c)}function l(c){return c===n?(s.consume(c),i++,l):(s.exit("thematicBreakSequence"),ji(c)?fn(s,a,"whitespace")(c):a(c))}}const Da={continuation:{tokenize:Kye},exit:Yye,name:"list",tokenize:qye},jye={partial:!0,tokenize:Zye},$ye={partial:!0,tokenize:Gye};function qye(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:MB(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(YI,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 MB(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(yk,i.interrupt?t:d,s.attempt(jye,f,u))}function d(p){return i.containerState.initialBlankLine=!0,o++,f(p)}function u(p){return ji(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 Kye(s,e,t){const i=this;return i.containerState._closeFlow=void 0,s.check(yk,n,o);function n(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,fn(s,e,"listItemIndent",i.containerState.size+1)(a)}function o(a){return i.containerState.furtherBlankLines||!ji(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($ye,e,r)(a))}function r(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,fn(s,s.attempt(Da,e,t),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Gye(s,e,t){const i=this;return fn(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 Yye(s){s.exit(this.containerState.type)}function Zye(s,e,t){const i=this;return fn(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!ji(o)&&r&&r[1].type==="listItemPrefixWhitespace"?e(o):t(o)}}const kX={name:"setextUnderline",resolveTo:Xye,tokenize:Qye};function Xye(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 Qye(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"),ji(c)?fn(s,l,"lineSuffix")(c):l(c))}function l(c){return c===null||si(c)?(s.exit("setextHeadingLine"),e(c)):t(c)}}const Jye={tokenize:e0e};function e0e(s){const e=this,t=s.attempt(yk,i,s.attempt(this.parser.constructs.flowInitial,n,fn(s,s.attempt(this.parser.constructs.flow,n,s.attempt(oye,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:Joe()},i0e=Qoe("string"),n0e=Qoe("text");function Qoe(s){return{resolveAll:Joe(s==="text"?s0e: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 Joe(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 s0e(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:Da,43:Da,45:Da,48:Da,49:Da,50:Da,51:Da,52:Da,53:Da,54:Da,55:Da,56:Da,57:Da,62:$oe},r0e={91:dye},a0e={[-2]:ZF,[-1]:ZF,32:ZF},l0e={35:mye,42:YI,45:[kX,YI],60:Cye,61:kX,95:YI,96:xX,126:xX},c0e={38:Koe,92:qoe},d0e={[-5]:XF,[-4]:XF,[-3]:XF,33:Bye,38:Koe,42:AB,60:[H1e,Dye],91:Hye,92:[gye,qoe],93:Az,95:AB,96:J1e},u0e={null:[AB,t0e]},h0e={null:[42,95]},f0e={null:[]},g0e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:h0e,contentInitial:r0e,disable:f0e,document:o0e,flow:l0e,flowInitial:a0e,insideSpan:u0e,string:c0e,text:d0e},Symbol.toStringTag,{value:"Module"}));function p0e(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(E),check:T(I),consume:S,enter:x,exit:L,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(V){return r=uc(r,V),w(),r[r.length-1]!==null?[]:(O(e,0),c.events=BA(o,c.events,c),c.events)}function f(V,Y){return _0e(p(V),Y)}function p(V){return m0e(r,V)}function m(){const{_bufferIndex:V,_index:Y,line:se,column:Z,offset:q}=i;return{_bufferIndex:V,_index:Y,line:se,column:Z,offset:q}}function b(V){n[V.line]=V.column,F()}function w(){let V;for(;i._index<r.length;){const Y=r[i._index];if(typeof Y=="string")for(V=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===V&&i._bufferIndex<Y.length;)y(Y.charCodeAt(i._bufferIndex));else y(Y)}}function y(V){d=d(V)}function S(V){si(V)?(i.line++,i.column=1,i.offset+=V===-3?2:1,F()):V!==-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=V}function x(V,Y){const se=Y||{};return se.type=V,se.start=m(),c.events.push(["enter",se,c]),a.push(se),se}function L(V){const Y=a.pop();return Y.end=m(),c.events.push(["exit",Y,c]),Y}function E(V,Y){O(V,Y.from)}function I(V,Y){Y.restore()}function T(V,Y){return se;function se(Z,q,z){let J,le,ce,$;return Array.isArray(Z)?me(Z):"tokenize"in Z?me([Z]):Q(Z);function Q(Xe){return mt;function mt(Et){const Me=Et!==null&&Xe[Et],_t=Et!==null&&Xe.null,Lt=[...Array.isArray(Me)?Me:Me?[Me]:[],...Array.isArray(_t)?_t:_t?[_t]:[]];return me(Lt)(Et)}}function me(Xe){return J=Xe,le=0,Xe.length===0?z:U(Xe[le])}function U(Xe){return mt;function mt(Et){return $=P(),ce=Xe,Xe.partial||(c.currentConstruct=Xe),Xe.name&&c.parser.constructs.disable.null.includes(Xe.name)?je():Xe.tokenize.call(Y?Object.assign(Object.create(c),Y):c,l,ke,je)(Et)}}function ke(Xe){return V(ce,$),q}function je(Xe){return $.restore(),++le<J.length?U(J[le]):z}}}function O(V,Y){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&El(c.events,Y,c.events.length-Y,V.resolve(c.events.slice(Y),c)),V.resolveTo&&(c.events=V.resolveTo(c.events,c))}function P(){const V=m(),Y=c.previous,se=c.currentConstruct,Z=c.events.length,q=Array.from(a);return{from:Z,restore:z};function z(){i=V,c.previous=Y,c.currentConstruct=se,c.events.length=Z,a=q,F()}}function F(){i.line in n&&i.column<2&&(i.column=n[i.line],i.offset+=n[i.line]-1)}}function m0e(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 _0e(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=`
|
|
22
22
|
`;break}case-3:{r=`\r
|
|
23
23
|
`;break}case-2:{r=e?" ":" ";break}case-1:{if(!e&&n)continue;r=" ";break}default:r=String.fromCharCode(o)}n=o===-2,i.push(r)}return i.join("")}function b0e(s){const i={constructs:Uoe([g0e,...(s||{}).extensions||[]]),content:n(M1e),defined:[],document:n(O1e),flow:n(Jye),lazy:{},string:n(i0e),text:n(n0e)};return i;function n(o){return r;function r(a){return p0e(i,o,a)}}}function v0e(s){for(;!Goe(s););return s}const DX=/[\0\t\n\r]/g;function C0e(){let s=1,e="",t=!0,i;return n;function n(o,r,a){const l=[];let c,d,u,f,p;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(r||void 0).decode(o)),u=0,e="",t&&(o.charCodeAt(0)===65279&&u++,t=void 0);u<o.length;){if(DX.lastIndex=u,c=DX.exec(o),f=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(f),!c){e=o.slice(u);break}if(p===10&&u===f&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),u<f&&(l.push(o.slice(u,f)),s+=f-u),p){case 0:{l.push(65533),s++;break}case 9:{for(d=Math.ceil(s/4)*4,l.push(-2);s++<d;)l.push(-1);break}case 10:{l.push(-4),s=1;break}default:i=!0,s=1}u=f+1}return a&&(i&&l.push(-5),e&&l.push(e),l.push(null)),l}}const w0e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function y0e(s){return s.replace(w0e,S0e)}function S0e(s,e,t){if(e)return e;if(t.charCodeAt(0)===35){const n=t.charCodeAt(1),o=n===120||n===88;return joe(t.slice(o?2:1),o?16:10)}return Mz(t)||s}const ere={}.hasOwnProperty;function x0e(s,e,t){return typeof e!="string"&&(t=e,e=void 0),L0e(t)(v0e(b0e(t).document().write(C0e()(s,e,!0))))}function L0e(s){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ln),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(it),blockQuote:o(_t),characterEscape:P,characterReference:P,codeFenced:o(Lt),codeFencedFenceInfo:r,codeFencedFenceMeta:r,codeIndented:o(Lt,r),codeText:o(ni,r),codeTextData:P,data:P,codeFlowValue:P,definition:o(Ye),definitionDestinationString:r,definitionLabelString:r,definitionTitleString:r,emphasis:o(Oe),hardBreakEscape:o(zt),hardBreakTrailing:o(zt),htmlFlow:o(Kt,r),htmlFlowData:P,htmlText:o(Kt,r),htmlTextData:P,image:o(bi),label:r,link:o(ln),listItem:o(_n),listItemValue:f,listOrdered:o(Ii,u),listUnordered:o(Ii),paragraph:o(at),reference:U,referenceString:r,resourceDestinationString:r,resourceTitleString:r,setextHeading:o(it),strong:o(Ue),thematicBreak:o(Ct)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:Me,autolinkProtocol:Et,blockQuote:l(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:je,characterReferenceMarkerNumeric:je,characterReferenceValue:Xe,characterReference:mt,codeFenced:l(w),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:F,codeIndented:l(y),codeText:l(q),codeTextData:F,data:F,definition:l(),definitionDestinationString:L,definitionLabelString:S,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(Y),hardBreakTrailing:l(Y),htmlFlow:l(se),htmlFlowData:F,htmlText:l(Z),htmlTextData:F,image:l(J),label:ce,labelText:le,lineEnding:V,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ke,resourceDestinationString:$,resourceTitleString:Q,resource:me,setextHeading:l(O),setextHeadingLineSequence:T,setextHeadingText:I,strong:l(),thematicBreak:l()}};tre(e,(s||{}).mdastExtensions||[]);const t={};return i;function i(_e){let $e={type:"root",children:[]};const ht={stack:[$e],tokenStack:[],config:e,enter:a,exit:c,buffer:r,resume:d,data:t},Wt=[];let ci=-1;for(;++ci<_e.length;)if(_e[ci][1].type==="listOrdered"||_e[ci][1].type==="listUnordered")if(_e[ci][0]==="enter")Wt.push(ci);else{const Ki=Wt.pop();ci=n(_e,Ki,ci)}for(ci=-1;++ci<_e.length;){const Ki=e[_e[ci][0]];ere.call(Ki,_e[ci][1].type)&&Ki[_e[ci][1].type].call(Object.assign({sliceSerialize:_e[ci][2].sliceSerialize},ht),_e[ci][1])}if(ht.tokenStack.length>0){const Ki=ht.tokenStack[ht.tokenStack.length-1];(Ki[1]||EX).call(ht,void 0,Ki[0])}for($e.position={start:Qf(_e.length>0?_e[0][1].start:{line:1,column:1,offset:0}),end:Qf(_e.length>0?_e[_e.length-2][1].end:{line:1,column:1,offset:0})},ci=-1;++ci<e.transforms.length;)$e=e.transforms[ci]($e)||$e;return $e}function n(_e,$e,ht){let Wt=$e-1,ci=-1,Ki=!1,On,bn,Ti,ss;for(;++Wt<=ht;){const cn=_e[Wt];switch(cn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{cn[0]==="enter"?ci++:ci--,ss=void 0;break}case"lineEndingBlank":{cn[0]==="enter"&&(On&&!ss&&!ci&&!Ti&&(Ti=Wt),ss=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ss=void 0}if(!ci&&cn[0]==="enter"&&cn[1].type==="listItemPrefix"||ci===-1&&cn[0]==="exit"&&(cn[1].type==="listUnordered"||cn[1].type==="listOrdered")){if(On){let oo=Wt;for(bn=void 0;oo--;){const xi=_e[oo];if(xi[1].type==="lineEnding"||xi[1].type==="lineEndingBlank"){if(xi[0]==="exit")continue;bn&&(_e[bn][1].type="lineEndingBlank",Ki=!0),xi[1].type="lineEnding",bn=oo}else if(!(xi[1].type==="linePrefix"||xi[1].type==="blockQuotePrefix"||xi[1].type==="blockQuotePrefixWhitespace"||xi[1].type==="blockQuoteMarker"||xi[1].type==="listItemIndent"))break}Ti&&(!bn||Ti<bn)&&(On._spread=!0),On.end=Object.assign({},bn?_e[bn][1].start:cn[1].end),_e.splice(bn||Wt,0,["exit",On,cn[2]]),Wt++,ht++}if(cn[1].type==="listItemPrefix"){const oo={type:"listItem",_spread:!1,start:Object.assign({},cn[1].start),end:void 0};On=oo,_e.splice(Wt,0,["enter",oo,cn[2]]),Wt++,ht++,Ti=void 0,ss=!0}}}return _e[$e][1]._spread=Ki,ht}function o(_e,$e){return ht;function ht(Wt){a.call(this,_e(Wt),Wt),$e&&$e.call(this,Wt)}}function r(){this.stack.push({type:"fragment",children:[]})}function a(_e,$e,ht){this.stack[this.stack.length-1].children.push(_e),this.stack.push(_e),this.tokenStack.push([$e,ht||void 0]),_e.position={start:Qf($e.start),end:void 0}}function l(_e){return $e;function $e(ht){_e&&_e.call(this,ht),c.call(this,ht)}}function c(_e,$e){const ht=this.stack.pop(),Wt=this.tokenStack.pop();if(Wt)Wt[0].type!==_e.type&&($e?$e.call(this,_e,Wt[0]):(Wt[1]||EX).call(this,_e,Wt[0]));else throw new Error("Cannot close `"+_e.type+"` ("+bS({start:_e.start,end:_e.end})+"): it’s not open");ht.position.end=Qf(_e.end)}function d(){return Rz(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function f(_e){if(this.data.expectingFirstListItemValue){const $e=this.stack[this.stack.length-2];$e.start=Number.parseInt(this.sliceSerialize(_e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.lang=_e}function m(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.meta=_e}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.value=_e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.value=_e.replace(/(\r?\n|\r)$/g,"")}function S(_e){const $e=this.resume(),ht=this.stack[this.stack.length-1];ht.label=$e,ht.identifier=od(this.sliceSerialize(_e)).toLowerCase()}function x(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.title=_e}function L(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.url=_e}function E(_e){const $e=this.stack[this.stack.length-1];if(!$e.depth){const ht=this.sliceSerialize(_e).length;$e.depth=ht}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function T(_e){const $e=this.stack[this.stack.length-1];$e.depth=this.sliceSerialize(_e).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function P(_e){const ht=this.stack[this.stack.length-1].children;let Wt=ht[ht.length-1];(!Wt||Wt.type!=="text")&&(Wt=Pe(),Wt.position={start:Qf(_e.start),end:void 0},ht.push(Wt)),this.stack.push(Wt)}function F(_e){const $e=this.stack.pop();$e.value+=this.sliceSerialize(_e),$e.position.end=Qf(_e.end)}function V(_e){const $e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ht=$e.children[$e.children.length-1];ht.position.end=Qf(_e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes($e.type)&&(P.call(this,_e),F.call(this,_e))}function Y(){this.data.atHardBreak=!0}function se(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.value=_e}function Z(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.value=_e}function q(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.value=_e}function z(){const _e=this.stack[this.stack.length-1];if(this.data.inReference){const $e=this.data.referenceType||"shortcut";_e.type+="Reference",_e.referenceType=$e,delete _e.url,delete _e.title}else delete _e.identifier,delete _e.label;this.data.referenceType=void 0}function J(){const _e=this.stack[this.stack.length-1];if(this.data.inReference){const $e=this.data.referenceType||"shortcut";_e.type+="Reference",_e.referenceType=$e,delete _e.url,delete _e.title}else delete _e.identifier,delete _e.label;this.data.referenceType=void 0}function le(_e){const $e=this.sliceSerialize(_e),ht=this.stack[this.stack.length-2];ht.label=y0e($e),ht.identifier=od($e).toLowerCase()}function ce(){const _e=this.stack[this.stack.length-1],$e=this.resume(),ht=this.stack[this.stack.length-1];if(this.data.inReference=!0,ht.type==="link"){const Wt=_e.children;ht.children=Wt}else ht.alt=$e}function $(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.url=_e}function Q(){const _e=this.resume(),$e=this.stack[this.stack.length-1];$e.title=_e}function me(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function ke(_e){const $e=this.resume(),ht=this.stack[this.stack.length-1];ht.label=$e,ht.identifier=od(this.sliceSerialize(_e)).toLowerCase(),this.data.referenceType="full"}function je(_e){this.data.characterReferenceType=_e.type}function Xe(_e){const $e=this.sliceSerialize(_e),ht=this.data.characterReferenceType;let Wt;ht?(Wt=joe($e,ht==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Wt=Mz($e);const ci=this.stack[this.stack.length-1];ci.value+=Wt}function mt(_e){const $e=this.stack.pop();$e.position.end=Qf(_e.end)}function Et(_e){F.call(this,_e);const $e=this.stack[this.stack.length-1];$e.url=this.sliceSerialize(_e)}function Me(_e){F.call(this,_e);const $e=this.stack[this.stack.length-1];$e.url="mailto:"+this.sliceSerialize(_e)}function _t(){return{type:"blockquote",children:[]}}function Lt(){return{type:"code",lang:null,meta:null,value:""}}function ni(){return{type:"inlineCode",value:""}}function Ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function it(){return{type:"heading",depth:0,children:[]}}function zt(){return{type:"break"}}function Kt(){return{type:"html",value:""}}function bi(){return{type:"image",title:null,url:"",alt:null}}function ln(){return{type:"link",title:null,url:"",children:[]}}function Ii(_e){return{type:"list",ordered:_e.type==="listOrdered",start:null,spread:_e._spread,children:[]}}function _n(_e){return{type:"listItem",spread:_e._spread,checked:null,children:[]}}function at(){return{type:"paragraph",children:[]}}function Ue(){return{type:"strong",children:[]}}function Pe(){return{type:"text",value:""}}function Ct(){return{type:"thematicBreak"}}}function Qf(s){return{line:s.line,column:s.column,offset:s.offset}}function tre(s,e){let t=-1;for(;++t<e.length;){const i=e[t];Array.isArray(i)?tre(s,i):k0e(s,i)}}function k0e(s,e){let t;for(t in e)if(ere.call(e,t))switch(t){case"canContainEols":{const i=e[t];i&&s[t].push(...i);break}case"transforms":{const i=e[t];i&&s[t].push(...i);break}case"enter":case"exit":{const i=e[t];i&&Object.assign(s[t],i);break}}}function EX(s,e){throw s?new Error("Cannot close `"+s.type+"` ("+bS({start:s.start,end:s.end})+"): a different token (`"+e.type+"`, "+bS({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+bS({start:e.start,end:e.end})+") is still open")}function D0e(s){const e=this;e.parser=t;function t(i){return x0e(i,{...e.data("settings"),...s,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function E0e(s,e){const t={type:"element",tagName:"blockquote",properties:{},children:s.wrap(s.all(e),!0)};return s.patch(e,t),s.applyData(e,t)}function I0e(s,e){const t={type:"element",tagName:"br",properties:{},children:[]};return s.patch(e,t),[s.applyData(e,t),{type:"text",value:`
|
|
@@ -714,7 +714,7 @@ ${e.toString()}`}}class mR{constructor(e=new gy,t=!1,i,n=j9e){this._services=e,t
|
|
|
714
714
|
`:`\r
|
|
715
715
|
`),await this._clipboardService.writeText(x)})),i.getOption(92)||w.push(new la("diff.inline.revertChange",v("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),w},autoSelectFirstItem:!0})};this._register(An(this._diffActions,"mousedown",m=>{if(!m.leftButton)return;const{top:b,height:w}=Kn(this._diffActions),y=Math.floor(d/3);m.preventDefault(),p(m.posx,b+w+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}=Kn(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 _ie=vf("diffEditorWidget",{createHTML:s=>s});function EHe(s,e,t,i){so(i,e.fontInfo);const n=t.length>0,o=new iy(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],w=lr.filter(t,p,1,Number.MAX_SAFE_INTEGER);if(b){let y=0;for(const S of b.breakOffsets){const x=m.sliceAndInflate(y,S,0);r=Math.max(r,bie(a,x,lr.extractWrapped(w,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,bie(a,m,w,n,s.mightContainNonBasicASCII,s.mightContainRTL,e,o)),a++}r+=e.scrollBeyondLastColumn;const c=o.build(),d=_ie?_ie.createHTML(c):c;i.innerHTML=d;const u=r*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:u,viewLineCounts:l}}class IHe{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class L${static fromEditor(e){const t=e.getOptions(),i=t.get(50),n=t.get(146);return new L$(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 bie(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=Ja.isBasicASCII(l,n),d=Ja.containsRTL(l,c,o),u=Zk(new Vp(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!==hp.OFF,null),a);return a.appendString("</div>"),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var NHe=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},vie=function(s,e){return function(t,i){e(t,i,s)}};let dW=class extends ne{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=Ft(this,0),this._originalScrollOffset=Ft(this,0),this._originalScrollOffsetAnimated=hie(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Ft(this,0),this._modifiedScrollOffset=Ft(this,0),this._modifiedScrollOffsetAnimated=hie(this._targetWindow,this._modifiedScrollOffset,this._store);const u=Ft("invalidateAlignmentsState",0),f=this._register(new Oi(()=>{u.set(u.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(x=>{this._canIgnoreViewZoneUpdateEvent()||f.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(x=>{this._canIgnoreViewZoneUpdateEvent()||f.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(x=>{(x.hasChanged(147)||x.hasChanged(67))&&f.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(x=>{(x.hasChanged(147)||x.hasChanged(67))&&f.schedule()}));const p=this._diffModel.map(x=>x?Di(this,x.model.original.onDidChangeTokens,()=>x.model.original.tokenization.backgroundTokenizationState===2):void 0).map((x,L)=>x?.read(L)),m=Qe(x=>{const L=this._diffModel.read(x),E=L?.diff.read(x);if(!L||!E)return null;u.read(x);const T=this._options.renderSideBySide.read(x);return Cie(this._editors.original,this._editors.modified,E.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,T)}),b=Qe(x=>{const L=this._diffModel.read(x)?.movedTextToCompare.read(x);if(!L)return null;u.read(x);const E=L.changes.map(I=>new ehe(I));return Cie(this._editors.original,this._editors.modified,E,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function w(){const x=document.createElement("div");return x.className="diagonal-fill",x}const y=this._register(new he);this.viewZones=Bp(this,(x,L)=>{y.clear();const E=m.read(x)||[],I=[],T=[],O=this._modifiedTopPadding.read(x);O>0&&T.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:O,showInHiddenAreas:!0,suppressMouseDown:!0});const P=this._originalTopPadding.read(x);P>0&&I.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:P,showInHiddenAreas:!0,suppressMouseDown:!0});const F=this._options.renderSideBySide.read(x),V=F?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(V){const ce=this._editors.original.getModel();for(const $ of E)if($.diff)for(let Q=$.originalRange.startLineNumber;Q<$.originalRange.endLineNumberExclusive;Q++){if(Q>ce.getLineCount())return{orig:I,mod:T};V?.addRequest(ce.getLineContent(Q),null,null)}}const Y=V?.finalize()??[];let se=0;const Z=this._editors.modified.getOption(67),q=this._diffModel.read(x)?.movedTextToCompare.read(x),z=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,J=this._editors.original.getModel()?.mightContainRTL()??!1,le=L$.fromEditor(this._editors.modified);for(const ce of E)if(ce.diff&&!F&&(!this._options.useTrueInlineDiffRendering.read(x)||!k$(ce.diff))){if(!ce.originalRange.isEmpty){p.read(x);const Q=document.createElement("div");Q.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const me=this._editors.original.getModel();if(ce.originalRange.endLineNumberExclusive-1>me.getLineCount())return{orig:I,mod:T};const U=new IHe(ce.originalRange.mapToLineArray(Et=>me.tokenization.getLineTokens(Et)),ce.originalRange.mapToLineArray(Et=>Y[se++]),z,J),ke=[];for(const Et of ce.diff.innerChanges||[])ke.push(new HS(Et.originalRange.delta(-(ce.diff.original.startLineNumber-1)),D1.className,0));const je=EHe(U,le,ke,Q),Xe=document.createElement("div");if(Xe.className="inline-deleted-margin-view-zone",so(Xe,le.fontInfo),this._options.renderIndicators.read(x))for(let Et=0;Et<je.heightInLines;Et++){const Me=document.createElement("div");Me.className=`delete-sign ${ut.asClassName(Xue)}`,Me.setAttribute("style",`position:absolute;top:${Et*Z}px;width:${le.lineDecorationsWidth}px;height:${Z}px;right:0;`),Xe.appendChild(Me)}let mt;y.add(new DHe(()=>kg(mt),Xe,this._editors.modified,ce.diff,this._diffEditorWidget,je.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Et=0;Et<je.viewLineCounts.length;Et++){const Me=je.viewLineCounts[Et];Me>1&&I.push({afterLineNumber:ce.originalRange.startLineNumber+Et,domNode:w(),heightInPx:(Me-1)*Z,showInHiddenAreas:!0,suppressMouseDown:!0})}T.push({afterLineNumber:ce.modifiedRange.startLineNumber-1,domNode:Q,heightInPx:je.heightInLines*Z,minWidthInPx:je.minWidthInPx,marginDomNode:Xe,setZoneId(Et){mt=Et},showInHiddenAreas:!0,suppressMouseDown:!0})}const $=document.createElement("div");$.className="gutter-delete",I.push({afterLineNumber:ce.originalRange.endLineNumberExclusive-1,domNode:w(),heightInPx:ce.modifiedHeightInPx,marginDomNode:$,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const $=ce.modifiedHeightInPx-ce.originalHeightInPx;if($>0){if(q?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ce.originalRange.endLineNumberExclusive-1))continue;I.push({afterLineNumber:ce.originalRange.endLineNumberExclusive-1,domNode:w(),heightInPx:$,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Q=function(){const U=document.createElement("div");return U.className="arrow-revert-change "+ut.asClassName(xe.arrowRight),L.add(ae(U,"mousedown",ke=>ke.stopPropagation())),L.add(ae(U,"click",ke=>{ke.stopPropagation(),o.revert(ce.diff)})),De("div",{},U)};if(q?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ce.modifiedRange.endLineNumberExclusive-1))continue;let me;ce.diff&&ce.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(x)&&(me=Q()),T.push({afterLineNumber:ce.modifiedRange.endLineNumberExclusive-1,domNode:w(),heightInPx:-$,marginDomNode:me,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ce of b.read(x)??[]){if(!q?.lineRangeMapping.original.intersect(ce.originalRange)||!q?.lineRangeMapping.modified.intersect(ce.modifiedRange))continue;const $=ce.modifiedHeightInPx-ce.originalHeightInPx;$>0?I.push({afterLineNumber:ce.originalRange.endLineNumberExclusive-1,domNode:w(),heightInPx:$,showInHiddenAreas:!0,suppressMouseDown:!0}):T.push({afterLineNumber:ce.modifiedRange.endLineNumberExclusive-1,domNode:w(),heightInPx:-$,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:I,mod:T}});let S=!1;this._register(this._editors.original.onDidScrollChange(x=>{x.scrollLeftChanged&&!S&&(S=!0,this._editors.modified.setScrollLeft(x.scrollLeft),S=!1)})),this._register(this._editors.modified.onDidScrollChange(x=>{x.scrollLeftChanged&&!S&&(S=!0,this._editors.original.setScrollLeft(x.scrollLeft),S=!1)})),this._originalScrollTop=Di(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Di(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(vt(x=>{const L=this._originalScrollTop.read(x)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(x))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(x));L!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(L,1)})),this._register(vt(x=>{const L=this._modifiedScrollTop.read(x)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(x))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(x));L!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(L,1)})),this._register(vt(x=>{const L=this._diffModel.read(x)?.movedTextToCompare.read(x);let E=0;if(L){const I=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();E=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-I}E>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(E,void 0)):E<0?(this._modifiedTopPadding.set(-E,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()-E,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+E,void 0,!0)}))}};dW=NHe([vie(8,Sf),vie(9,ma)],dW);function Cie(s,e,t,i,n,o){const r=new sf(wie(s,i)),a=new sf(wie(e,n)),l=s.getOption(67),c=e.getOption(67),d=[];let u=0,f=0;function p(m,b){for(;;){let w=r.peek(),y=a.peek();if(w&&w.lineNumber>=m&&(w=void 0),y&&y.lineNumber>=b&&(y=void 0),!w&&!y)break;const S=w?w.lineNumber-u:Number.MAX_VALUE,x=y?y.lineNumber-f:Number.MAX_VALUE;S<x?(r.dequeue(),y={lineNumber:w.lineNumber-u+f,heightInPx:0}):S>x?(a.dequeue(),w={lineNumber:y.lineNumber-f+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:kt.ofLength(w.lineNumber,1),modifiedRange:kt.ofLength(y.lineNumber,1),originalHeightInPx:l+w.heightInPx,modifiedHeightInPx:c+y.heightInPx,diff:void 0})}}for(const m of t){let x=function(L,E,I=!1){if(L<S||E<y)return;if(w)w=!1;else if(!I&&(L===S||E===y))return;const T=new kt(S,L),O=new kt(y,E);if(T.isEmpty&&O.isEmpty)return;const P=r.takeWhile(V=>V.lineNumber<L)?.reduce((V,Y)=>V+Y.heightInPx,0)??0,F=a.takeWhile(V=>V.lineNumber<E)?.reduce((V,Y)=>V+Y.heightInPx,0)??0;d.push({originalRange:T,modifiedRange:O,originalHeightInPx:T.length*l+P,modifiedHeightInPx:O.length*c+F,diff:m.lineRangeMapping}),S=L,y=E};const b=m.lineRangeMapping;p(b.original.startLineNumber,b.modified.startLineNumber);let w=!0,y=b.modified.startLineNumber,S=b.original.startLineNumber;if(o)for(const L of b.innerChanges||[]){L.originalRange.startColumn>1&&L.modifiedRange.startColumn>1&&x(L.originalRange.startLineNumber,L.modifiedRange.startLineNumber);const E=s.getModel(),I=L.originalRange.endLineNumber<=E.getLineCount()?E.getLineMaxColumn(L.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;L.originalRange.endColumn<I&&x(L.originalRange.endLineNumber,L.modifiedRange.endLineNumber)}x(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 wie(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 ee(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return nHe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function k$(s){return s.innerChanges?s.innerChanges.every(e=>yie(e.modifiedRange)&&yie(e.originalRange)||e.originalRange.equalsRange(new M(1,1,1,1))):!1}function yie(s){return s.startLineNumber===s.endLineNumber}const Cx=class Cx extends ne{constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=Di(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Di(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=_o("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Ft(this,0),this._modifiedViewZonesChangedSignal=_o("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=_o("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Bp(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 w=p.map(T=>{function O(J,le){const ce=le.getTopForLineNumber(J.startLineNumber,!0),$=le.getTopForLineNumber(J.endLineNumberExclusive,!0);return(ce+$)/2}const P=O(T.lineRangeMapping.original,this._editors.original),F=this._originalScrollTop.read(d),V=O(T.lineRangeMapping.modified,this._editors.modified),Y=this._modifiedScrollTop.read(d),se=P-F,Z=V-Y,q=Math.min(P,V),z=Math.max(P,V);return{range:new Ht(q,z),from:se,to:Z,fromWithoutScroll:P,toWithoutScroll:V,move:T}});w.sort(Eke(dr(T=>T.fromWithoutScroll>T.toWithoutScroll,Ike),dr(T=>T.fromWithoutScroll>T.toWithoutScroll?T.fromWithoutScroll:-T.toWithoutScroll,vc)));const y=D$.compute(w.map(T=>T.range)),S=10,x=m.verticalScrollbarWidth,L=(y.getTrackCount()-1)*10+S*2,E=x+L+(b.contentLeft-Cx.movedCodeBlockPadding);let I=0;for(const T of w){const O=y.getTrack(I),P=x+S+O*10,F=15,V=15,Y=E,se=b.glyphMarginWidth+b.lineNumbersWidth,Z=18,q=document.createElementNS("http://www.w3.org/2000/svg","rect");q.classList.add("arrow-rectangle"),q.setAttribute("x",`${Y-se}`),q.setAttribute("y",`${T.to-Z/2}`),q.setAttribute("width",`${se}`),q.setAttribute("height",`${Z}`),this._element.appendChild(q);const z=document.createElementNS("http://www.w3.org/2000/svg","g"),J=document.createElementNS("http://www.w3.org/2000/svg","path");J.setAttribute("d",`M 0 ${T.from} L ${P} ${T.from} L ${P} ${T.to} L ${Y-V} ${T.to}`),J.setAttribute("fill","none"),z.appendChild(J);const le=document.createElementNS("http://www.w3.org/2000/svg","polygon");le.classList.add("arrow"),u.add(vt(ce=>{J.classList.toggle("currentMove",T.move===f.activeMovedText.read(ce)),le.classList.toggle("currentMove",T.move===f.activeMovedText.read(ce))})),le.setAttribute("points",`${Y-V},${T.to-F/2} ${Y},${T.to} ${Y-V},${T.to+F/2}`),z.appendChild(le),this._element.appendChild(z),I++}this.width.set(L,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(et(()=>this._element.remove())),this._register(vt(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-Cx.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(dy(this._state));const r=Qe(d=>{const f=this._diffModel.read(d)?.diff.read(d);return f?f.movedTexts.map(p=>({move:p,original:new qC(Dl(p.lineRangeMapping.original.startLineNumber-1),18),modified:new qC(Dl(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(PR(this._editors.original,r.map(d=>d.map(u=>u.original)))),this._register(PR(this._editors.modified,r.map(d=>d.map(u=>u.modified)))),this._register(Ar((d,u)=>{const f=r.read(d);for(const p of f)u.add(new Sie(this._editors.original,p.original,p.move,"original",this._diffModel.get())),u.add(new Sie(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=_o("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=_o("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(zk({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)}))}};Cx.movedCodeBlockPadding=4;let Ww=Cx;class D${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=uRe(t,dr(a=>a.intersectWithRangeLength(n),vc)):(o=t.length,t.push(new DU))),t[o].addRange(n),i.push(o)}return new D$(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class Sie extends _${constructor(e,t,i,n,o){const r=Ut("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=Ut("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Ut("div.text-content@textContent"),Ut("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Di(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(df(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 Ya(this._nodes.actionBar,{highlightToggledItems:!0})),d=new la("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new la("","Compare",ut.asClassName(xe.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(vt(f=>{const p=this._diffModel.movedTextToCompare.read(f)===i;u.checked=p})),c.push(u,{icon:!1,label:!0})}}class THe extends ne{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Qe(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?TL:mie}),m.lineRangeMapping.modified.isEmpty||f.push({range:m.lineRangeMapping.modified.toInclusiveRange(),options:c?BR:pie}),m.lineRangeMapping.modified.isEmpty||m.lineRangeMapping.original.isEmpty)m.lineRangeMapping.original.isEmpty||u.push({range:m.lineRangeMapping.original.toInclusiveRange(),options:y$}),m.lineRangeMapping.modified.isEmpty||f.push({range:m.lineRangeMapping.modified.toInclusiveRange(),options:C$});else{const b=this._options.useTrueInlineDiffRendering.read(o)&&k$(m.lineRangeMapping);for(const w of m.lineRangeMapping.innerChanges||[])if(m.lineRangeMapping.original.contains(w.originalRange.startLineNumber)&&u.push({range:w.originalRange,options:w.originalRange.isEmpty()&&d?S$:D1}),m.lineRangeMapping.modified.contains(w.modifiedRange.startLineNumber)&&f.push({range:w.modifiedRange,options:w.modifiedRange.isEmpty()&&d&&!b?w$:WR}),b){const y=r.model.original.getValueInRange(w.originalRange);f.push({range:w.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?TL:mie});const w=m.modified.toInclusiveRange();w&&f.push({range:w,options:c?BR:pie});for(const y of m.innerChanges||[])u.push({range:y.originalRange,options:D1}),f.push({range:y.modifiedRange,options:WR})}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:[Ww.movedCodeBlockPadding,0,Ww.movedCodeBlockPadding,Ww.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(OR(this._editors.original,this._decorations.map(o=>o?.originalDecorations||[]))),this._register(OR(this._editors.modified,this._decorations.map(o=>o?.modifiedDecorations||[])))}}class RHe{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=Hk(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=Ft(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 the extends ne{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 Do(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(vt(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(vt(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 MHe extends ne{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Di(this,this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Di(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=_o("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=_o("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=cy("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Ut("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{In(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(et(()=>o.disconnect())),this._register(vt(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(vt(r=>this.render(r)))}dispose(){super.dispose(),no(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=Ht.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new kt(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);In(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 w=Ft("item",d),y=this.itemProvider.createView(w,b);u=new AHe(w,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(Ht.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 AHe{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class ihe extends Eb{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class xie extends Cle{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 kc(e-1,t)}}class OHe extends ne{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new JDe),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new he),i.hoverDelegate=i.hoverDelegate??this._register(v1()),this.options=i,this.toggleMenuAction=this._register(new RL(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Ya(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===RL.ID)return this.toggleMenuActionViewItem=new VT(n,n.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:ut.asClassNameArray(i.moreIcon??xe.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 r1){const r=new VT(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 O2=class O2 extends la{constructor(e,t){t=t||v("moreActions","More Actions..."),super(O2.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}};O2.ID="toolbar.toggle.more";let RL=O2;var nhe=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},fc=function(s,e){return function(t,i){e(t,i,s)}};let ML=class extends OHe{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 he);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 ww)||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=GFe(new Set(this._options.overflowBehavior.exempted),ti.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))}}eQ(n),eQ(l),super.setActions(n,As.join(l,o)),(r.length>0||n.length>0)&&this._sessionDisposables.add(ae(this.getElement(),"contextmenu",d=>{const u=new mc(lt(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 ww||f instanceof RL)){const b=!!this._keybindingService.lookupKeybinding(f.id);p.push(Cue(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 w=0;w<r.length;w++)if(r[w].checked){r[w]=f_({id:f.id,label:f.label,checked:!0,enabled:!1,run(){}});break}}if(!b&&(f instanceof ca||f instanceof ww)){if(!f.hideActions)return;p.push(f.hideActions.hide)}else p.push(f_({id:"label",label:v("hide","Hide"),enabled:!1,run(){}}))}const m=As.join(p,r);this._options?.resetMenu&&!i&&(i=[this._options.resetMenu]),c&&i&&(m.push(new As),m.push(f_({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})}))}};ML=nhe([fc(2,il),fc(3,ft),fc(4,ma),fc(5,Si),fc(6,Xi),fc(7,Ao)],ML);let HR=class extends ML{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 ie),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),u=()=>{const f=[],p=[];FO(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 _i("This toolbar is populated from a menu.")}};HR=nhe([fc(3,il),fc(4,ft),fc(5,ma),fc(6,Si),fc(7,Xi),fc(8,Ao)],HR);var she=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},SN=function(s,e){return function(t,i){e(t,i,s)}};const O3=[],vI=35;let uW=class extends ne{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(Ge.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Di(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=Qe(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=Qe(this,d=>this._hasActions.read(d)?vI:0),this.elements=Ut("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:vI+"px"}},[]),this._currentDiff=Qe(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=Qe(this,d=>{const f=this._diffModel.read(d)?.diff.read(d);if(!f)return O3;const p=this._editors.modifiedSelections.read(d);if(p.every(y=>y.isEmpty()))return O3;const m=new Ll(p.map(y=>kt.fromRangeInclusive(y))),w=f.mappings.filter(y=>y.lineRangeMapping.innerChanges&&m.intersects(y.lineRangeMapping.modified)).map(y=>({mapping:y,rangeMappings:y.lineRangeMapping.innerChanges.filter(S=>p.some(x=>M.areIntersecting(S.modifiedRange,x)))}));return w.length===0||w.every(y=>y.rangeMappings.length===0)?O3:w}),this._register(sHe(e,this.elements.root)),this._register(ae(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(df(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),jo(this,d=>this._showSash.read(d)?new the(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,Hk(this,f=>this._sashLayout.sashLeft.read(f)-vI,(f,p)=>this._sashLayout.sashLeft.set(f+vI,p)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new MHe(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 w=Ga.fromRangeMappings(m.flatMap(y=>y.rangeMappings));return[new Lie(w,!0,Ge.DiffEditorSelectionToolbar,void 0,f.model.original.uri,f.model.modified.uri)]}const b=this._currentDiff.read(u);return p.mappings.map(w=>new Lie(w.lineRangeMapping.withInnerChangesFromLineRanges(),w.lineRangeMapping===b?.lineRangeMapping,Ge.DiffEditorHunkToolbar,void 0,f.model.original.uri,f.model.modified.uri))},createView:(d,u)=>this._instantiationService.createInstance(hW,d,u,this)})),this._register(ae(this.elements.gutter,Le.MOUSE_WHEEL,d=>{this._editors.modified.getOption(104).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(d)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new xie(this._editors.modifiedModel.get()),n=new xie(this._editors.original.getModel());return new IU(t.map(a=>a.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};uW=she([SN(6,tt),SN(7,ft),SN(8,il)],uW);class Lie{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 hW=class extends ne{constructor(e,t,i,n){super(),this._item=e,this._elements=Ut("div.gutterItem",{style:{height:"20px",width:"34px"}},[Ut("div.background@background",{},[]),Ut("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=Ft(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(h1,"element",!0,{position:{hoverPosition:1}}));this._register($C(t,this._elements.root)),this._register(vt(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(Ar((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(n.createInstance(HR,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 ihe(()=>{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=Ht.tryCreate(o,t.endExclusive-o-i),l=Ht.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`}};hW=she([SN(3,tt)],hW);function sa(s){return fW.get(s)}const gg=class gg extends ne{static get(e){let t=gg._map.get(e);if(!t){t=new gg(e),gg._map.set(e,t);const i=e.onDidDispose(()=>{const n=gg._map.get(e);n&&(gg._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new ly(()=>{}))}_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=Ft(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Di(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(92)),this._versionId=b8({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=b8({owner:this,equalsFn:p8(BT(Ze.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.isFocused=Di(this,t=>{const i=this.editor.onDidFocusEditorWidget(t),n=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=Hk(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=Qe(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=Ba({owner:this,equalsFn:p8(Ze.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.onDidType=cy(this),this.scrollTop=Di(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Di(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Di(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.contentWidth=Di(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 Di(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e))}setDecorations(e){const t=new he,i=this.editor.createDecorationsCollection();return t.add(Vk({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=vt(o=>{e.position.read(o),e.minContentWidthInPx.read(o),this.editor.layoutOverlayWidget(i)});return et(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}};gg._map=new Map;let fW=gg;function gW(s,e){return s4e({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 PHe(s,e){const t=new he,i=gW(s,(n,o)=>{t.clear(),e(n,o,t)});return{dispose(){i.dispose(),t.dispose()}}}var FHe=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},BHe=function(s,e){return function(t,i){e(t,i,s)}},xN,R_;let VR=(R_=class extends ne{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=xN._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();In(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();In(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=Bp(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 w=0;w<b.length;w++){const y=b[w];if(!y.shouldHideControls(l)&&!(m&&(w===0||w===b.length-1)))if(m){{const S=Qe(this,L=>y.getHiddenOriginalRange(L).startLineNumber-1),x=new qC(S,12);u.push(x),c.add(new kie(this._editors.original,x,y,!p))}{const S=Qe(this,L=>y.getHiddenModifiedRange(L).startLineNumber-1),x=new qC(S,12);f.push(x),c.add(new kie(this._editors.modified,x,y))}}else{{const S=Qe(this,L=>y.getHiddenOriginalRange(L).startLineNumber-1),x=new qC(S,24);u.push(x),c.add(new Die(this._editors.original,x,y,y.originalUnchangedRange,!p,d,L=>this._diffModel.get().ensureModifiedLineIsVisible(L,2,void 0),this._options))}{const S=Qe(this,L=>y.getHiddenModifiedRange(L).startLineNumber-1),x=new qC(S,24);f.push(x),c.add(new Die(this._editors.modified,x,y,y.modifiedUnchangedRange,!1,d,L=>this._diffModel.get().ensureModifiedLineIsVisible(L,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 Io(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(v("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+ut.asClassName(xe.fold),zIndex:10001};this._register(OR(this._editors.original,Qe(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:M.fromPositions(new ee(u.originalLineNumber,1)),options:a});return d}))),this._register(OR(this._editors.modified,Qe(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:kt.ofLength(u.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(vt(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(fu)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(fu))}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()}}))}},xN=R_,R_._breadcrumbsSourceFactory=Ft(xN,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),R_);VR=xN=FHe([BHe(3,tt)],VR);class kie extends _${constructor(e,t,i,n=!1){const o=Ut("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=n,this._nodes=Ut("div.diff-hidden-lines-compact",[Ut("div.line-left",[]),Ut("div.text@text",[]),Ut("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(vt(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,l=v("hiddenLines","{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class Die extends _${constructor(e,t,i,n,o,r,a,l){const c=Ut("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=Ut("div.diff-hidden-lines",[Ut("div.top@top",{title:v("diff.hiddenLines.top","Click or drag to show more above")}),Ut("div.center@content",{style:{display:"flex"}},[Ut("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[De("a",{title:v("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Ug("$(unfold)"))]),Ut("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Ut("div.bottom@bottom",{title:v("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?no(this._nodes.first):this._register(df(this._nodes.first,{width:sa(this._editor).layoutInfoContentLeft})),this._register(vt(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(ae(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=lt(this._nodes.top),w=ae(b,"mousemove",S=>{const L=S.clientY-f;p=p||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),I=Math.max(0,Math.min(m+E,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(I,void 0)}),y=ae(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),w.dispose(),y.dispose()})})),this._register(ae(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=lt(this._nodes.bottom),w=ae(b,"mousemove",S=>{const L=S.clientY-f;p=p||Math.abs(L)>2;const E=Math.round(L/d.getOption(67)),I=Math.max(0,Math.min(m-E,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=ae(b,"mouseup",S=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!p){const x=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(L-x))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),w.dispose(),y.dispose()})})),this._register(vt(u=>{const f=[];if(!this._hide){const p=i.getHiddenModifiedRange(u).length,m=v("hiddenLines","{0} hidden lines",p),b=De("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 w=this._unchangedRegion.getHiddenModifiedRange(u),y=this._modifiedOutlineSource.getBreadcrumbItems(w,u);if(y.length>0){f.push(De("span",void 0," | "));for(let S=0;S<y.length;S++){const x=y[S],L=eT.toIcon(x.kind),E=Ut("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[Tb(L)," ",x.name,...S===y.length-1?[]:[Tb(xe.chevronRight)]]).root;f.push(E),E.onclick=()=>{this._revealModifiedHiddenLine(x.startLineNumber)}}}}no(this._nodes.others,...f)}))}}var WHe=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},HHe=function(s,e){return function(t,i){e(t,i,s)}},Wc,jh;let AL=(jh=class extends ne{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=Wc.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=Di(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=Qe(f=>{const p=l.read(f),m=p.getColor(s2e)||(p.getColor(i2e)||F7).transparent(2),b=p.getColor(o2e)||(p.getColor(n2e)||B7).transparent(2);return{insertColor:m,removeColor:b}}),d=yi(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const u=Ut("div.diffOverview",{style:{position:"absolute",top:"0px",width:Wc.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register($C(u,d.domNode)),this._register(An(u,Le.POINTER_DOWN,f=>{this._editors.modified.delegateVerticalScrollbarPointerDown(f)})),this._register(ae(u,Le.MOUSE_WHEEL,f=>{this._editors.modified.delegateScrollFromMouseWheelEvent(f)},{passive:!1})),this._register($C(this._rootElement,u)),this._register(Ar((f,p)=>{const m=this._diffModel.read(f),b=this._editors.original.createOverviewRuler("original diffOverviewRuler");b&&(p.add(b),p.add($C(u,b.getDomNode())));const w=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(w&&(p.add(w),p.add($C(u,w.getDomNode()))),!b||!w)return;const y=_o("viewZoneChanged",this._editors.original.onDidChangeViewZones),S=_o("viewZoneChanged",this._editors.modified.onDidChangeViewZones),x=_o("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),L=_o("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);p.add(vt(E=>{y.read(E),S.read(E),x.read(E),L.read(E);const I=c.read(E),T=m?.diff.read(E)?.mappings;function O(V,Y,se){const Z=se._getViewModel();return Z?V.filter(q=>q.length>0).map(q=>{const z=Z.coordinatesConverter.convertModelPositionToViewPosition(new ee(q.startLineNumber,1)),J=Z.coordinatesConverter.convertModelPositionToViewPosition(new ee(q.endLineNumberExclusive,1)),le=J.lineNumber-z.lineNumber;return new $ue(z.lineNumber,J.lineNumber,le,Y.toString())}):[]}const P=O((T||[]).map(V=>V.lineRangeMapping.original),I.removeColor,this._editors.original),F=O((T||[]).map(V=>V.lineRangeMapping.modified),I.insertColor,this._editors.modified);b?.setZones(P),w?.setZones(F)})),p.add(vt(E=>{const I=this._rootHeight.read(E),T=this._rootWidth.read(E),O=this._modifiedEditorLayoutInfo.read(E);if(O){const P=Wc.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Wc.ONE_OVERVIEW_WIDTH;b.setLayout({top:0,height:I,right:P+Wc.ONE_OVERVIEW_WIDTH,width:Wc.ONE_OVERVIEW_WIDTH}),w.setLayout({top:0,height:I,right:0,width:Wc.ONE_OVERVIEW_WIDTH});const F=this._editors.modifiedScrollTop.read(E),V=this._editors.modifiedScrollHeight.read(E),Y=this._editors.modified.getOption(104),se=new g1(Y.verticalHasArrows?Y.arrowSize:0,Y.verticalScrollbarSize,0,O.height,V,F);d.setTop(se.getSliderPosition()),d.setHeight(se.getSliderSize())}else d.setTop(0),d.setHeight(0);u.style.height=I+"px",u.style.left=T-Wc.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(Wc.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},Wc=jh,jh.ONE_OVERVIEW_WIDTH=15,jh.ENTIRE_DIFF_OVERVIEW_WIDTH=jh.ONE_OVERVIEW_WIDTH*2,jh);AL=Wc=WHe([HHe(6,ks)],AL);const P3=[];class VHe extends ne{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=Qe(this,o=>{const a=this._diffModel.read(o)?.diff.read(o);if(!a)return P3;const l=this._editors.modifiedSelections.read(o);if(l.every(f=>f.isEmpty()))return P3;const c=new Ll(l.map(f=>kt.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=>M.areIntersecting(p.modifiedRange,m)))}));return u.length===0||u.every(f=>f.rangeMappings.length===0)?P3:u}),this._register(Ar((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 zR(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 zR(f.lineRangeMapping.modified.startLineNumber,this._widget,f.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(p),c.push(p)}r.add(et(()=>{for(const f of c)this._editors.modified.removeGlyphMarginWidget(f)}))}))}}const P2=class P2 extends ne{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${P2.counter++}`,this._domNode=Ut("div.revertButton",{title:this._revertSelection?v("revertSelectedChanges","Revert Selected Changes"):v("revertChange","Revert Change")},[Tb(xe.arrowRight)]).root,this._register(ae(this._domNode,Le.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(ae(this._domNode,Le.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(ae(this._domNode,Le.CLICK,o=>{this._diffs instanceof qo?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Lc.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};P2.counter=0;let zR=P2;function zHe(s,e,t){return r4e({debugName:()=>`Configuration Key "${s}"`},i=>t.onDidChangeConfiguration(n=>{n.affectsConfiguration(s)&&i(n)}),()=>t.getValue(s)??e)}function zc(s,e,t){const i=s.bindTo(e);return Vk({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}var UHe=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},Eie=function(s,e){return function(t,i){e(t,i,s)}};let pW=class extends ne{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 ie),this.modifiedScrollTop=Di(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Di(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=sa(this.modified),this.originalObs=sa(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Di(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Ba({owner:this,equalsFn:ee.equals},l=>this.modifiedSelections.read(l)[0]?.getPosition()??new ee(1,1)),this.originalCursor=Di(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new ee(1,1)),this._argCodeEditorWidgetOptions=null,this._register(zk({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()+AL.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=Sd.revealHorizontalRightPadding.defaultValue+AL.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,""):""}};pW=UHe([Eie(5,tt),Eie(6,Si)],pW);const F2=class F2 extends ne{constructor(){super(...arguments),this._id=++F2.idCounter,this._onDidDispose=this._register(new ie),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)}};F2.idCounter=0;let mW=F2;var jHe=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},$He=function(s,e){return function(t,i){e(t,i,s)}};let _W=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Ft(this,0),this._screenReaderMode=Di(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=Qe(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Qe(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=Qe(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=Qe(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=Qe(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=Qe(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=Qe(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=Qe(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=Qe(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=Qe(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=Qe(this,n=>this._options.read(n).maxComputationTime),this.showMoves=Qe(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=Qe(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=Qe(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=Qe(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=Qe(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=Qe(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=Qe(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=Qe(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Qe(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=Qe(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=Qe(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=Qe(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=Qe(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Qe(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Qe(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Qe(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=Ft(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>d4e(this,o=>{const r=n?.diff.read(o);return r?qHe(r,this.trueInlineDiffRenderingEnabled.read(o)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...Iie(e,uo)};this._options=Ft(this,i)}updateOptions(e){const t=Iie(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)}};_W=jHe([$He(1,_a)],_W);function qHe(s,e){return s.mappings.every(t=>KHe(t.lineRangeMapping)||GHe(t.lineRangeMapping)||e&&k$(t.lineRangeMapping))}function KHe(s){return s.original.length===0}function GHe(s){return s.modified.length===0}function Iie(s,e){return{enableSplitViewResizing:Je(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Zke(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Je(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Je(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:Sm(s.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:Sm(s.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Je(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Je(s.renderIndicators,e.renderIndicators),originalEditable:Je(s.originalEditable,e.originalEditable),diffCodeLens:Je(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Je(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Fn(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Fn(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Je(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Je(s.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:Je(s.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:Je(s.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:Je(s.hideUnchangedRegions?.enabled??s.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:Sm(s.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:Sm(s.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:Sm(s.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Je(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Je(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:Sm(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Je(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:Je(s.renderGutterMenu,e.renderGutterMenu),compactMode:Je(s.compactMode,e.compactMode)}}var YHe=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},V0=function(s,e){return function(t,i){e(t,i,s)}};let uf=class extends mW{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=Ut("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Ut("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Ut("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Ut("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(lL(this,void 0)),this._diffModel=Qe(this,L=>this._diffModelSrc.read(L)?.object),this.onDidChangeModel=Ne.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new gy([ft,this._contextKeyService]))),this._boundarySashes=Ft(this,void 0),this._accessibleDiffViewerShouldBeVisible=Ft(this,!1),this._accessibleDiffViewerVisible=Qe(this,L=>this._options.onlyShowAccessibleDiffViewer.read(L)?!0:this._accessibleDiffViewerShouldBeVisible.read(L)),this._movedBlocksLinesPart=Ft(this,void 0),this._layoutInfo=Qe(this,L=>{const E=this._rootSizeObserver.width.read(L),I=this._rootSizeObserver.height.read(L);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=I+"px";const T=this._sash.read(L),O=this._gutter.read(L),P=O?.width.read(L)??0,F=this._overviewRulerPart.read(L)?.width??0;let V,Y,se,Z,q;if(!!T){const J=T.sashLeft.read(L),le=this._movedBlocksLinesPart.read(L)?.width.read(L)??0;V=0,Y=J-P-le,q=J-P,se=J,Z=E-se-F}else{q=0;const J=this._options.inlineViewHideOriginalLineNumbers.read(L);V=P,J?Y=0:Y=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(L)),se=P+Y,Z=E-se-F}return this.elements.original.style.left=V+"px",this.elements.original.style.width=Y+"px",this._editors.original.layout({width:Y,height:I},!0),O?.layout(q),this.elements.modified.style.left=se+"px",this.elements.modified.style.width=Z+"px",this._editors.modified.layout({width:Z,height:I},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((L,E)=>L?.diff.read(E)),this.onDidUpdateDiff=Ne.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(et(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new Zue(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(_W,t),this._register(vt(L=>{this._options.setWidth(this._rootSizeObserver.width.read(L))})),this._contextKeyService.createKey(B.isEmbeddedDiffEditor.key,!1),this._register(zc(B.isEmbeddedDiffEditor,this._contextKeyService,L=>this._options.isInEmbeddedEditor.read(L))),this._register(zc(B.comparingMovedCode,this._contextKeyService,L=>!!this._diffModel.read(L)?.movedTextToCompare.read(L))),this._register(zc(B.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,L=>this._options.couldShowInlineViewBecauseOfSize.read(L))),this._register(zc(B.diffEditorInlineMode,this._contextKeyService,L=>!this._options.renderSideBySide.read(L))),this._register(zc(B.hasChanges,this._contextKeyService,L=>(this._diffModel.read(L)?.diff.read(L)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(pW,this.elements.original,this.elements.modified,this._options,i,(L,E,I,T)=>this._createInnerEditor(L,E,I,T))),this._register(zc(B.diffEditorOriginalWritable,this._contextKeyService,L=>this._options.originalEditable.read(L))),this._register(zc(B.diffEditorModifiedWritable,this._contextKeyService,L=>!this._options.readOnly.read(L))),this._register(zc(B.diffEditorOriginalUri,this._contextKeyService,L=>this._diffModel.read(L)?.model.original.uri.toString()??"")),this._register(zc(B.diffEditorModifiedUri,this._contextKeyService,L=>this._diffModel.read(L)?.model.modified.uri.toString()??"")),this._overviewRulerPart=jo(this,L=>this._options.renderOverviewRuler.read(L)?this._instantiationService.createInstance(Jr(AL,L),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(E=>E.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((L,E)=>L-(this._overviewRulerPart.read(E)?.width??0))};this._sashLayout=new RHe(this._options,c),this._sash=jo(this,L=>{const E=this._options.renderSideBySide.read(L);return this.elements.root.classList.toggle("side-by-side",E),E?new the(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=jo(this,L=>this._instantiationService.createInstance(Jr(VR,L),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);jo(this,L=>this._instantiationService.createInstance(Jr(THe,L),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const u=new Set,f=new Set;let p=!1;const m=jo(this,L=>this._instantiationService.createInstance(Jr(dW,L),lt(this._domElement),this._editors,this._diffModel,this._options,this,()=>p||d.get().isUpdatingHiddenAreas,u,f)).recomputeInitiallyAndOnChange(this._store),b=Qe(this,L=>{const E=m.read(L).viewZones.read(L).orig,I=d.read(L).viewZones.read(L).origViewZones;return E.concat(I)}),w=Qe(this,L=>{const E=m.read(L).viewZones.read(L).mod,I=d.read(L).viewZones.read(L).modViewZones;return E.concat(I)});this._register(PR(this._editors.original,b,L=>{p=L},u));let y;this._register(PR(this._editors.modified,w,L=>{p=L,p?y=Cd.capture(this._editors.modified):(y?.restore(this._editors.modified),y=void 0)},f)),this._accessibleDiffViewer=jo(this,L=>this._instantiationService.createInstance(Jr(r_,L),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(E,I)=>this._accessibleDiffViewerShouldBeVisible.set(E,I),this._options.onlyShowAccessibleDiffViewer.map(E=>!E),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((E,I)=>E?.diff.read(I)?.mappings.map(T=>T.lineRangeMapping)),new vHe(this._editors))).recomputeInitiallyAndOnChange(this._store);const S=this._accessibleDiffViewerVisible.map(L=>L?"hidden":"visible");this._register(df(this.elements.modified,{visibility:S})),this._register(df(this.elements.original,{visibility:S})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=jo(this,L=>this._options.shouldRenderGutterMenu.read(L)?this._instantiationService.createInstance(Jr(uW,L),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(dy(this._layoutInfo)),jo(this,L=>new(Jr(Ww,L))(this.elements.root,this._diffModel,this._layoutInfo.map(E=>E.originalEditor),this._layoutInfo.map(E=>E.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,L=>{this._movedBlocksLinesPart.set(L,void 0)}),this._register(Ne.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,L=>this._handleCursorPositionChange(L,!0))),this._register(Ne.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,L=>this._handleCursorPositionChange(L,!1)));const x=this._diffModel.map(this,(L,E)=>{if(L)return L.diff.read(E)===void 0&&!L.isDiffUpToDate.read(E)});this._register(Ar((L,E)=>{if(x.read(L)===!0){const I=this._editorProgressService.show(!0,1e3);E.add(et(()=>I.done()))}})),this._register(Ar((L,E)=>{E.add(new(Jr(VHe,L))(this._editors,this._diffModel,this._options,this))})),this._register(Ar((L,E)=>{const I=this._diffModel.read(L);if(I)for(const T of[I.model.original,I.model.modified])E.add(T.onWillDispose(O=>{wt(new _i("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(vt(L=>{this._options.setModel(this._diffModel.read(L))}))}_createInnerEditor(e,t,i,n){return e.createInstance(NL,t,i,n)}_createDiffEditorContributions(){const e=g_.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){wt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return Yk.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(cW,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?FR.create(e).createNewRef(this):FR.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&&Ab(t,n=>{const o=e?.object;Di.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?ZHe(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 ee(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=$x(t,o=>o.lineRangeMapping.modified.startLineNumber<i)??t[t.length-1],this._goTo(n),n.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Oa.diffLineDeleted,{source:"diffEditor.goToDiff"}):n.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Oa.diffLineInserted,{source:"diffEditor.goToDiff"}):n&&this._accessibilitySignalService.playSignal(Oa.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=fie(o.getStartPosition(),r),l=fie(o.getEndPosition(),r);n=M.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&&In(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&In(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(Oa.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Oa.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(Oa.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};uf=YHe([V0(3,ft),V0(4,tt),V0(5,fi),V0(6,Hp),V0(7,Fp)],uf);function ZHe(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 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},en=function(s,e){return function(t,i){e(t,i,s)}};let XHe=0,Nie=!1;function QHe(s){if(!s){if(Nie)return;Nie=!0}tPe(s||Bi.document.body)}let UR=class extends NL{constructor(e,t,i,n,o,r,a,l,c,d,u,f,p){const m={...t};m.ariaLabel=m.ariaLabel||u8.editorViewAccessibleLabel,super(e,m,{},i,n,o,r,c,d,u,f,p),l instanceof x1?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,QHe(m.ariaContainerElement),p4e((b,w)=>i.createInstance(h1,b,w,{})),m4e(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_"+ ++XHe,o=ge.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"),ne.None;const t=e.id,i=e.label,n=ge.and(ge.equals("editorId",this.getId()),ge.deserialize(e.precondition)),o=e.keybindings,r=ge.and(n,ge.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(p,...m)=>Promise.resolve(e.run(this,...m)),d=new he,u=this.getId()+":"+t;if(d.add(ii.registerCommand(u,c)),a){const p={command:{id:u,title:i},when:n,group:a,order:l};d.add(js.appendMenuItem(Ge.EditorContext,p))}if(Array.isArray(o))for(const p of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,p,c,r));const f=new que(u,i,i,void 0,n,(...p)=>Promise.resolve(e.run(this,...p)),this._contextKeyService);return this._actions.set(t,f),d.add(et(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof yT)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};UR=E$([en(2,tt),en(3,fi),en(4,Xi),en(5,ft),en(6,Au),en(7,Si),en(8,ks),en(9,is),en(10,_a),en(11,Rn),en(12,Ke)],UR);let bW=class extends UR{constructor(e,t,i,n,o,r,a,l,c,d,u,f,p,m,b,w){const y={...t};bR(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 x=y.model;delete y.model,super(e,y,i,n,o,r,a,l,c,d,f,b,w),this._configurationService=u,this._standaloneThemeService=c,this._register(S);let L;if(typeof x>"u"){const E=m.getLanguageIdByMimeType(y.language)||y.language||hr;L=ohe(p,m,y.value||"",E,void 0),this._ownsModel=!0}else L=x,this._ownsModel=!1;if(this._attachModel(L),L){const E={oldModelUrl:null,newModelUrl:L.uri};this._onDidChangeModel.fire(E)}}dispose(){super.dispose()}updateOptions(e){bR(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)}};bW=E$([en(2,tt),en(3,fi),en(4,Xi),en(5,ft),en(6,Au),en(7,Si),en(8,rl),en(9,is),en(10,Bt),en(11,_a),en(12,rn),en(13,xn),en(14,Rn),en(15,Ke)],bW);let vW=class extends uf{constructor(e,t,i,n,o,r,a,l,c,d,u,f){const p={...t};bR(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){bR(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(UR,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)}};vW=E$([en(2,tt),en(3,ft),en(4,fi),en(5,rl),en(6,is),en(7,Bt),en(8,ma),en(9,Fp),en(10,Sf),en(11,Hp)],vW);function ohe(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(`
|
|
716
716
|
`);let r=t;return o!==-1&&(r=t.substring(0,o)),Tie(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return Tie(s,t,e.createById(i),n)}function Tie(s,e,t,i){return s.createModel(e,t,i)}var JHe=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},Rie=function(s,e){return function(t,i){e(t,i,s)}};class eVe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let jR=class extends ne{constructor(e,t,i,n,o){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Ft(this,void 0),this._collapsed=Qe(this,l=>this._viewModel.read(l)?.collapsed.read(l)),this._editorContentHeight=Ft(this,500),this.contentHeight=Qe(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Ft(this,0),this._modifiedWidth=Ft(this,0),this._originalContentWidth=Ft(this,0),this._originalWidth=Ft(this,0),this.maxScroll=Qe(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=Ut("div.multiDiffEntry",[Ut("div.header@header",[Ut("div.header-content",[Ut("div.collapse-button@collapseButton"),Ut("div.file-path",[Ut("div.title.modified.show-file-icons@primaryPath",[]),Ut("div.status.deleted@status",["R"]),Ut("div.title.original.show-file-icons@secondaryPath",[])]),Ut("div.actions@actions")])]),Ut("div.editorParent",[Ut("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(uf,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=sa(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=sa(this.editor.getOriginalEditor()).isFocused,this.isFocused=Qe(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 he),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new tR(this._elements.collapseButton,{});this._register(vt(l=>{r.element.className="",r.icon=this._collapsed.read(l)?xe.chevronRight:xe.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(vt(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=>{eS(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(vt(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 gy([ft,this._contextKeyService])));this._register(a.createInstance(HR,this._elements.actions,Ge.MultiDiffEditorFileToolbar,{actionRunner:this._register(new ihe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>Qce(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){eS(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(eS(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)`,eS(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"}};jR=JHe([Rie(3,tt),Rie(4,ft)],jR);class tVe{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 iVe=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},Mie=function(s,e){return function(t,i){e(t,i,s)}};let CW=class extends ne{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=Ut("div.scrollContent",[Ut("div@content",{style:{overflow:"hidden"}}),Ut("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new ry({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>ga(lt(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new xO(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=Ut("div.monaco-component.multiDiffEditor",{},[Ut("div",{},[this._scrollableElement.getDomNode()]),Ut("div.placeholder@placeholder",{},[Ut("div",[v("noChangedFiles","No Changed Files")])])]),this._sizeObserver=this._register(new Zue(this._element,void 0)),this._objectPool=this._register(new tVe(l=>{const c=this._instantiationService.createInstance(jR,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this.scrollTop=Di(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Di(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=Bp(this,(l,c)=>{const d=this._viewModel.read(l);if(!d)return{items:[],getItem:m=>{throw new _i}};const u=d.items.read(l),f=new Map;return{items:u.map(m=>{const b=c.add(new nVe(m,this._objectPool,this.scrollLeft,y=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+y})})),w=this._lastDocStates?.[b.getKey()];return w&&In(y=>{b.setViewState(w,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 gy([ft,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(B.inMultiDiffEditor.key,!0),this._register(Ar((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(et(()=>p.reset()))}}));const a=this._parentContextKeyService.createKey(B.multiDiffEditorAllCollapsed.key,!1);this._register(vt(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(vt(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._register(vt(l=>{const c=this._viewItems.read(l);this._elements.placeholder.classList.toggle("visible",c.length===0)})),this._scrollableElements.content.style.position="relative",this._register(vt(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=EU(p,dr(b=>b.maxScroll.read(l).maxScroll,vc));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(et(()=>{e.replaceChildren()})),this._register(this._register(vt(l=>{eS(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=Ht.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=Ht.ofStartAndLength(n,u),p=Ht.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=Ht.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)`}};CW=iVe([Mie(4,ft),Mie(5,tt)],CW);class nVe extends ne{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(lL(this,void 0)),this.contentHeight=Qe(this,o=>this._templateRef.read(o)?.object.contentHeight?.read(o)??this.viewModel.lastTemplateData.read(o).contentHeight),this.maxScroll=Qe(this,o=>this._templateRef.read(o)?.object.maxScroll.read(o)??{maxScroll:0,scrollWidth:0}),this.template=Qe(this,o=>this._templateRef.read(o)?.object),this._isHidden=Ft(this,!1),this._isFocused=Qe(this,o=>this.template.read(o)?.isFocused.read(o)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(vt(o=>{const r=this._scrollLeft.read(o);this._templateRef.read(o)?.object.setScrollLeft(r)})),this._register(vt(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(Ze.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&&In(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 eVe(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)}}W("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"));W("multiDiffEditor.background",Dc,v("multiDiffEditor.background","The background color of the multi file diff editor"));W("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 sVe=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},oVe=function(s,e){return function(t,i){e(t,i,s)}};let wW=class extends ne{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Ft(this,void 0),this._viewModel=Ft(this,void 0),this._widgetImpl=Bp(this,(n,o)=>(Jr(jR,n),o.add(this._instantiationService.createInstance(Jr(CW,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(dy(this._widgetImpl))}};wW=sVe([oVe(2,tt)],wW);function rVe(s,e,t){return pt.initialize(t||{}).createInstance(bW,s,e)}function aVe(s){return pt.get(fi).onCodeEditorAdd(t=>{s(t)})}function lVe(s){return pt.get(fi).onDiffEditorAdd(t=>{s(t)})}function cVe(){return pt.get(fi).listCodeEditors()}function dVe(){return pt.get(fi).listDiffEditors()}function uVe(s,e,t){return pt.initialize(t||{}).createInstance(vW,s,e)}function hVe(s,e){const t=pt.initialize(e||{});return new wW(s,{},t)}function fVe(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return ii.registerCommand(s.id,s.run)}function gVe(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=ge.deserialize(s.precondition),t=(n,...o)=>Ls.runEditorCommand(n,o,e,(r,a,l)=>Promise.resolve(s.run(a,...l))),i=new he;if(i.add(ii.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(js.appendMenuItem(Ge.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=pt.get(Si);if(!(n instanceof x1))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=ge.and(e,ge.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(r=>({keybinding:r,command:s.id,when:o}))))}}return i}function pVe(s){return rhe([s])}function rhe(s){const e=pt.get(Si);return e instanceof x1?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:ge.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),ne.None)}function mVe(s,e,t){const i=pt.get(xn),n=i.getLanguageIdByMimeType(e)||e;return ohe(pt.get(rn),i,s,n,t)}function _Ve(s,e){const t=pt.get(xn),i=t.getLanguageIdByMimeType(e)||e||hr;s.setLanguage(t.createById(i))}function bVe(s,e,t){s&&pt.get(Ou).changeOne(e,s.uri,t)}function vVe(s){pt.get(Ou).changeAll(s,[])}function CVe(s){return pt.get(Ou).read(s)}function wVe(s){return pt.get(Ou).onMarkerChanged(s)}function yVe(s){return pt.get(rn).getModel(s)}function SVe(){return pt.get(rn).getModels()}function xVe(s){return pt.get(rn).onModelAdded(s)}function LVe(s){return pt.get(rn).onModelRemoved(s)}function kVe(s){return pt.get(rn).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function DVe(s){return d7e(pt.get(rn),s)}function EVe(s,e){const t=pt.get(xn),i=pt.get(rl);return Yj.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function IVe(s,e,t){const i=pt.get(xn);return pt.get(rl).registerEditorContainer(Bi.document.body),Yj.colorize(i,s,e,t)}function NVe(s,e,t=4){return pt.get(rl).registerEditorContainer(Bi.document.body),Yj.colorizeModelLine(s,e,t)}function TVe(s){const e=Bn.get(s);return e||{getInitialState:()=>m1,tokenize:(t,i,n)=>sj(s,n)}}function RVe(s,e){Bn.getOrCreate(e);const t=TVe(e),i=Nu(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 MVe(s,e){pt.get(rl).defineTheme(s,e)}function AVe(s){pt.get(rl).setTheme(s)}function OVe(){l7.clearAllFontInfos()}function PVe(s,e){return ii.registerCommand({id:s,handler:e})}function FVe(s){return pt.get(zr).registerOpener({async open(t){return typeof t=="string"&&(t=nt.parse(t)),s.open(t)}})}function BVe(s){return pt.get(fi).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 WVe(){return{create:rVe,getEditors:cVe,getDiffEditors:dVe,onDidCreateEditor:aVe,onDidCreateDiffEditor:lVe,createDiffEditor:uVe,addCommand:fVe,addEditorAction:gVe,addKeybindingRule:pVe,addKeybindingRules:rhe,createModel:mVe,setModelLanguage:_Ve,setModelMarkers:bVe,getModelMarkers:CVe,removeAllMarkers:vVe,onDidChangeMarkers:wVe,getModels:SVe,getModel:yVe,onDidCreateModel:xVe,onWillDisposeModel:LVe,onDidChangeModelLanguage:kVe,createWebWorker:DVe,colorizeElement:EVe,colorize:IVe,colorizeModelLine:NVe,tokenize:RVe,defineTheme:MVe,setTheme:AVe,remeasureFonts:OVe,registerCommand:PVe,registerLinkOpener:FVe,registerEditorOpener:BVe,AccessibilitySupport:n9,ContentWidgetPositionPreference:c9,CursorChangeReason:d9,DefaultEndOfLine:u9,EditorAutoIndentStrategy:f9,EditorOption:g9,EndOfLinePreference:p9,EndOfLineSequence:m9,MinimapPosition:D9,MinimapSectionHeaderStyle:E9,MouseTargetType:I9,OverlayWidgetPositionPreference:R9,OverviewRulerLane:M9,GlyphMarginLane:_9,RenderLineNumbersType:P9,RenderMinimap:F9,ScrollbarVisibility:W9,ScrollType:B9,TextEditorCursorBlinkingStyle:$9,TextEditorCursorStyle:q9,TrackedRangeStickiness:K9,WrappingIndent:G9,InjectedTextCursorStops:C9,PositionAffinity:O9,ShowLightbulbIconMode:V9,ConfigurationChangedEvent:Yre,BareFontInfo:h_,FontInfo:a7,TextModelResolvedOptions:nN,FindMatch:jx,ApplyUpdateResult:wS,EditorZoom:Sl,createMultiFileDiffEditor:hVe,EditorType:Yk,EditorOptions:Sd}}function HVe(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function CI(s,e){return typeof s=="boolean"?s:e}function Aie(s,e){return typeof s=="string"?s:e}function VVe(s){const e={};for(const t of s)e[t]=!0;return e}function Oie(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=VVe(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 yW(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?un(s,"language definition does not contain attribute '"+a+"', used at: "+e):un(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(I7e(s,e,c),o)),l)}return new RegExp(e,o)}function zVe(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 UVe(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=Oie(l.split("|"),s.ignoreCase);c=function(u){return a==="~"?d(u):!d(u)}}else if(a==="@"||a==="!@"){const d=s[l];if(!d)throw un(s,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!HVe(function(f){return typeof f=="string"},d))throw un(s,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);const u=Oie(d,s.ignoreCase);c=function(f){return a==="@"?u(f):!u(f)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){const d=yW(s,"^"+l+"$",!1);c=function(u){return a==="~"?d.test(u):!d.test(u)}}else c=function(d,u,f,p){return yW(s,"^"+Cg(s,l,u,f,p)+"$",!1).test(d)};else if(l.indexOf("$")<0){const d=Xh(s,l);c=function(u){return a==="=="?u===d:u!==d}}else{const d=Xh(s,l);c=function(u,f,p,m,b){const w=Cg(s,d,f,p,m);return a==="=="?u===w:u!==w}}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=zVe(d,u,f,n);return c(m||"",d,u,f,p)}}}function SW(s,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw un(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 un(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw un(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&&!N7e(s,Cg(s,n,"",[],""))))throw un(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]=SW(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=SW(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(UVe(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 un(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 jVe{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 un(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=yW(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=SW(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:CI(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:CI(e.ignoreCase,!1),unicode:CI(e.unicode,!1),tokenPostfix:Aie(e.tokenPostfix,"."+s),defaultToken:Aie(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 un(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw un(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const u=new jVe(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 un(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 un(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=CI(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw un(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 un(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 un(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+`
|
|
717
|
-
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:Xh(t,a.open),close:Xh(t,a.close)});else throw un(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 $Ve(s){a1.registerLanguage(s)}function qVe(){let s=[];return s=s.concat(a1.getLanguages()),s}function KVe(s){return pt.get(xn).languageIdCodec.encodeLanguageId(s)}function GVe(s,e){return pt.withServices(()=>{const i=pt.get(xn).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function YVe(s,e){return pt.withServices(()=>{const i=pt.get(xn).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function ZVe(s,e){if(!pt.get(xn).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return pt.get(Rn).register(s,e,100)}class XVe{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 OL.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 qA(n.tokens,n.endState)}}class OL{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 Ox(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),r=OL._toClassicTokens(o.tokens,e);let a;return o.endState.equals(n)?a=n:a=o.endState,new nU(r,a)}tokenize(e,t,i){return OL.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 qA(o,r)}}function QVe(s){return typeof s.getInitialState=="function"}function JVe(s){return"tokenizeEncoded"in s}function lhe(s){return s&&typeof s.then=="function"}function eze(s){const e=pt.get(rl);if(s){const t=[null];for(let i=1,n=s.length;i<n;i++)t[i]=pe.fromHex(s[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function che(s,e){return JVe(e)?new XVe(s,e):new OL(s,e,pt.get(xn),pt.get(rl))}function I$(s,e){const t=new IEe(async()=>{const i=await Promise.resolve(e.create());return i?QVe(i)?che(s,i):new SL(pt.get(xn),pt.get(rl),s,ahe(s,i),pt.get(Bt)):null});return Bn.registerFactory(s,t)}function tze(s,e){if(!pt.get(xn).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return lhe(e)?I$(s,{create:()=>e}):Bn.register(s,che(s,e))}function ize(s,e){const t=i=>new SL(pt.get(xn),pt.get(rl),s,ahe(s,i),pt.get(Bt));return lhe(e)?I$(s,{create:()=>e}):Bn.register(s,t(e))}function nze(s,e){return pt.get(Ke).referenceProvider.register(s,e)}function sze(s,e){return pt.get(Ke).renameProvider.register(s,e)}function oze(s,e){return pt.get(Ke).newSymbolNamesProvider.register(s,e)}function rze(s,e){return pt.get(Ke).signatureHelpProvider.register(s,e)}function aze(s,e){return pt.get(Ke).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 M(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new M(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function lze(s,e){return pt.get(Ke).documentSymbolProvider.register(s,e)}function cze(s,e){return pt.get(Ke).documentHighlightProvider.register(s,e)}function dze(s,e){return pt.get(Ke).linkedEditingRangeProvider.register(s,e)}function uze(s,e){return pt.get(Ke).definitionProvider.register(s,e)}function hze(s,e){return pt.get(Ke).implementationProvider.register(s,e)}function fze(s,e){return pt.get(Ke).typeDefinitionProvider.register(s,e)}function gze(s,e){return pt.get(Ke).codeLensProvider.register(s,e)}function pze(s,e,t){return pt.get(Ke).codeActionProvider.register(s,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,o,r,a)=>{const c=pt.get(Ou).read({resource:n.uri}).filter(d=>M.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function mze(s,e){return pt.get(Ke).documentFormattingEditProvider.register(s,e)}function _ze(s,e){return pt.get(Ke).documentRangeFormattingEditProvider.register(s,e)}function bze(s,e){return pt.get(Ke).onTypeFormattingEditProvider.register(s,e)}function vze(s,e){return pt.get(Ke).linkProvider.register(s,e)}function Cze(s,e){return pt.get(Ke).completionProvider.register(s,e)}function wze(s,e){return pt.get(Ke).colorProvider.register(s,e)}function yze(s,e){return pt.get(Ke).foldingRangeProvider.register(s,e)}function Sze(s,e){return pt.get(Ke).declarationProvider.register(s,e)}function xze(s,e){return pt.get(Ke).selectionRangeProvider.register(s,e)}function Lze(s,e){return pt.get(Ke).documentSemanticTokensProvider.register(s,e)}function kze(s,e){return pt.get(Ke).documentRangeSemanticTokensProvider.register(s,e)}function Dze(s,e){return pt.get(Ke).inlineCompletionsProvider.register(s,e)}function Eze(s,e){return pt.get(Ke).inlineEditProvider.register(s,e)}function Ize(s,e){return pt.get(Ke).inlayHintsProvider.register(s,e)}function Nze(){return{register:$Ve,getLanguages:qVe,onLanguage:GVe,onLanguageEncountered:YVe,getEncodedLanguageId:KVe,setLanguageConfiguration:ZVe,setColorMap:eze,registerTokensProviderFactory:I$,setTokensProvider:tze,setMonarchTokensProvider:ize,registerReferenceProvider:nze,registerRenameProvider:sze,registerNewSymbolNameProvider:oze,registerCompletionItemProvider:Cze,registerSignatureHelpProvider:rze,registerHoverProvider:aze,registerDocumentSymbolProvider:lze,registerDocumentHighlightProvider:cze,registerLinkedEditingRangeProvider:dze,registerDefinitionProvider:uze,registerImplementationProvider:hze,registerTypeDefinitionProvider:fze,registerCodeLensProvider:gze,registerCodeActionProvider:pze,registerDocumentFormattingEditProvider:mze,registerDocumentRangeFormattingEditProvider:_ze,registerOnTypeFormattingEditProvider:bze,registerLinkProvider:vze,registerColorProvider:wze,registerFoldingRangeProvider:yze,registerDeclarationProvider:Sze,registerSelectionRangeProvider:xze,registerDocumentSemanticTokensProvider:Lze,registerDocumentRangeSemanticTokensProvider:kze,registerInlineCompletionsProvider:Dze,registerInlineEditProvider:Eze,registerInlayHintsProvider:Ize,DocumentHighlightKind:h9,CompletionItemKind:r9,CompletionItemTag:a9,CompletionItemInsertTextRule:o9,SymbolKind:U9,SymbolTag:j9,IndentAction:v9,CompletionTriggerKind:l9,SignatureHelpTriggerKind:z9,InlayHintKind:w9,InlineCompletionTriggerKind:y9,InlineEditTriggerKind:S9,CodeActionTriggerType:s9,NewSymbolNameTag:N9,NewSymbolNameTriggerKind:T9,PartialAcceptTriggerKind:A9,HoverVerbosityAction:b9,FoldingRangeKind:gp,SelectedSuggestionInfo:uae}}const N$=qt("IEditorCancelService"),dhe=new Be("cancellableOperation",!1,v("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Jt(N$,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=dhe.bindTo(n.get(ft)),r=new rr;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 Tze extends Nn{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(N$).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ae(new class extends Ls{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:dhe})}runEditorCommand(s,e){s.get(N$).cancel(e)}});let uhe=class xW{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?xb("{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 xW))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 xW(e,this.flags))}};class Ep extends Tze{constructor(e,t,i,n){super(e,n),this._listener=new he,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!M.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!M.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 T$ extends Nn{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Du(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===Yk.ICodeEditor:!1}function R$(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===Yk.IDiffEditor:!1}function Rze(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function hhe(s){return Du(s)?s:R$(s)?s.getModifiedEditor():Rze(s)&&Du(s.activeCodeEditor)?s.activeCodeEditor:null}class E1{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=Cd.capture(e),o=E1._handleEolEdits(e,t);o.length===1&&E1._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>En.replace(M.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>En.replaceMove(M.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class Pie{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class Mze{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(Pie.toKey(e))}has(e){return this._set.has(Pie.toKey(e))}}function fhe(s,e,t){const i=[],n=new Mze,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 wx=class wx{static setFormatterSelector(e){return{dispose:wx._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const o=ti.first(wx._selectors);if(o)return await o(e,t,i,n)}};wx._selectors=new rr;let PL=wx;async function ghe(s,e,t,i,n,o,r){const a=s.get(tt),{documentRangeFormattingEditProvider:l}=s.get(Ke),c=Du(e)?e.getModel():e,d=l.ordered(c),u=await PL.select(d,c,i,2);u&&(n.report(u),await a.invokeFunction(Aze,u,e,t,o,r))}async function Aze(s,e,t,i,n,o){const r=s.get(Ur),a=s.get(yo),l=s.get(Hp);let c,d;Du(t)?(c=t.getModel(),d=new Ep(t,5,void 0,n)):(c=t,d=new T$(t,n));const u=[];let f=0;for(const y of qz(i).sort(M.compareRangesUsingStarts))f>0&&M.areIntersectingOrTouching(u[f-1],y)?u[f-1]=M.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 x=y.reduce((L,E)=>M.plusRange(L,E.range),y[0].range);if(!S.some(L=>M.intersectRanges(x,L.range)))return!1;for(const L of y)for(const E of S)if(M.intersectRanges(L.range,E.range))return!0;return!1},b=[],w=[];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),w.push(y)}else{for(const y of u){if(d.token.isCancellationRequested)return!0;w.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(w[y],w[S])){const x=M.plusRange(u[y],u[S]),L=await p(x);u.splice(S,1),u.splice(y,1),u.push(x),w.splice(S,1),w.splice(y,1),w.push(L),y=0,S=0}}}for(const y of w){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(Du(t))E1.execute(t,b,!0),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:y}]=b,S=new Ze(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn);c.pushEditOperations([S],b.map(x=>({text:x.text,range:M.lift(x.range),forceMoveMarkers:!0})),x=>{for(const{range:L}of x)if(M.areIntersectingOrTouching(L,S))return[new Ze(L.startLineNumber,L.startColumn,L.endLineNumber,L.endColumn)];return null})}return l.playSignal(Oa.format,{userGesture:o}),!0}async function Oze(s,e,t,i,n,o){const r=s.get(tt),a=s.get(Ke),l=Du(e)?e.getModel():e,c=fhe(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await PL.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(Pze,d,e,t,n,o))}async function Pze(s,e,t,i,n,o){const r=s.get(Ur),a=s.get(Hp);let l,c;Du(t)?(l=t.getModel(),c=new Ep(t,5,void 0,n)):(l=t,c=new T$(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(Du(t))E1.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:u}]=d,f=new Ze(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);l.pushEditOperations([f],d.map(p=>({text:p.text,range:M.lift(p.range),forceMoveMarkers:!0})),p=>{for(const{range:m}of p)if(M.areIntersectingOrTouching(m,f))return[new Ze(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)];return null})}return a.playSignal(Oa.format,{userGesture:o}),!0}async function Fze(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(Gn);if(Go(l))return await s.computeMoreMinimalEdits(t.uri,l)}}async function Bze(s,e,t,i,n){const o=fhe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(Gn);if(Go(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function phe(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(Gn).then(l=>s.computeMoreMinimalEdits(t.uri,l))}ii.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;hi(nt.isUri(t)),hi(M.isIRange(i));const o=s.get(Hr),r=s.get(Ur),a=s.get(Ke),l=await o.createModelReference(t);try{return Fze(r,a,l.object.textEditorModel,M.lift(i),n,Tt.None)}finally{l.dispose()}});ii.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;hi(nt.isUri(t));const n=s.get(Hr),o=s.get(Ur),r=s.get(Ke),a=await n.createModelReference(t);try{return Bze(o,r,a.object.textEditorModel,i,Tt.None)}finally{a.dispose()}});ii.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,o]=e;hi(nt.isUri(t)),hi(ee.isIPosition(i)),hi(typeof n=="string");const r=s.get(Hr),a=s.get(Ur),l=s.get(Ke),c=await r.createModelReference(t);try{return phe(a,l,c.object.textEditorModel,ee.lift(i),n,o,Tt.None)}finally{c.dispose()}});Sd.wrappingIndent.defaultValue=0;Sd.glyphMargin.defaultValue=!1;Sd.autoIndent.defaultValue=3;Sd.overviewRulerLanes.defaultValue=2;PL.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const Cr=hae();Cr.editor=WVe();Cr.languages=Nze();const Wze=Cr.CancellationTokenSource,Hze=Cr.Emitter,Vze=Cr.KeyCode,zze=Cr.KeyMod,Uze=Cr.Position,jze=Cr.Range,$ze=Cr.Selection,qze=Cr.SelectionDirection,Kze=Cr.MarkerSeverity,Gze=Cr.MarkerTag,Yze=Cr.Uri,Zze=Cr.Token,LW=Cr.editor,Xze=Cr.languages,Qze=globalThis.MonacoEnvironment;(Qze?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Cr);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 Jk=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Wze,Emitter:Hze,KeyCode:Vze,KeyMod:zze,MarkerSeverity:Kze,MarkerTag:Gze,Position:Uze,Range:jze,Selection:$ze,SelectionDirection:qze,Token:Zze,Uri:Yze,editor:LW,languages:Xze},Symbol.toStringTag,{value:"Module"}));var Jze=Object.defineProperty,eUe=Object.getOwnPropertyDescriptor,tUe=Object.getOwnPropertyNames,iUe=Object.prototype.hasOwnProperty,nUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of tUe(e))!iUe.call(s,n)&&n!==t&&Jze(s,n,{get:()=>e[n],enumerable:!(i=eUe(e,n))||i.enumerable});return s},sUe=(s,e,t)=>(nUe(s,e,"default"),t),rS={};sUe(rS,Jk);var mhe={},F3={},oUe=class _he{static getOrCreate(e){return F3[e]||(F3[e]=new _he(e)),F3[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,mhe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function ct(s){const e=s.id;mhe[e]=s,rS.languages.register(s);const t=oUe.getOrCreate(e);rS.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),rS.languages.onLanguageEncountered(e,async()=>{const i=await t.load();rS.languages.setLanguageConfiguration(e,i.conf)})}ct({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>st(()=>import("./abap-CRCWOmpq.js"),[])});ct({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>st(()=>import("./apex-DnsZk_dE.js"),[])});ct({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>st(()=>import("./azcli-1IWB1ccx.js"),[])});ct({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>st(()=>import("./bat-DPkNLes8.js"),[])});ct({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>st(()=>import("./bicep-Corcdgou.js"),[])});ct({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>st(()=>import("./cameligo-CGrWLZr3.js"),[])});ct({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>st(()=>import("./clojure-D9WOWImG.js"),[])});ct({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>st(()=>import("./coffee-B7EJu28W.js"),[])});ct({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>st(()=>import("./cpp-SEyurbux.js"),[])});ct({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>st(()=>import("./cpp-SEyurbux.js"),[])});ct({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>st(()=>import("./csharp-BoL64M5l.js"),[])});ct({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>st(()=>import("./csp-C46ZqvIl.js"),[])});ct({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>st(()=>import("./css-DQU6DXDx.js"),[])});ct({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>st(()=>import("./cypher-D84EuPTj.js"),[])});ct({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>st(()=>import("./dart-D8lhlL1r.js"),[])});ct({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>st(()=>import("./dockerfile-DLk6rpji.js"),[])});ct({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>st(()=>import("./ecl-BO6FnfXk.js"),[])});ct({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>st(()=>import("./elixir-BRjLKONM.js"),[])});ct({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>st(()=>import("./flow9-Cac8vKd7.js"),[])});ct({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>st(()=>import("./fsharp-fd1GTHhf.js"),[])});ct({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>st(()=>import("./freemarker2-D_OsaDj3.js"),[]).then(s=>s.TagAutoInterpolationDollar)});ct({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>st(()=>import("./freemarker2-D_OsaDj3.js"),[]).then(s=>s.TagAngleInterpolationDollar)});ct({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>st(()=>import("./freemarker2-D_OsaDj3.js"),[]).then(s=>s.TagBracketInterpolationDollar)});ct({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>st(()=>import("./freemarker2-D_OsaDj3.js"),[]).then(s=>s.TagAngleInterpolationBracket)});ct({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>st(()=>import("./freemarker2-D_OsaDj3.js"),[]).then(s=>s.TagBracketInterpolationBracket)});ct({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>st(()=>import("./freemarker2-D_OsaDj3.js"),[]).then(s=>s.TagAutoInterpolationDollar)});ct({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>st(()=>import("./freemarker2-D_OsaDj3.js"),[]).then(s=>s.TagAutoInterpolationBracket)});ct({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>st(()=>import("./go-O9LJTZXk.js"),[])});ct({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>st(()=>import("./graphql-LQdxqEYJ.js"),[])});ct({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>st(()=>import("./handlebars-OZHda73C.js"),[])});ct({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>st(()=>import("./hcl-DxDQ3s82.js"),[])});ct({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:()=>st(()=>import("./html-CdGHj-sb.js"),[])});ct({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>st(()=>import("./ini-BvajGCUy.js"),[])});ct({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>st(()=>import("./java-SYsfObOQ.js"),[])});ct({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>st(()=>import("./javascript--es-Ez5N.js"),__vite__mapDeps([0,1]))});ct({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>st(()=>import("./julia-DQXNmw_w.js"),[])});ct({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>st(()=>import("./kotlin-qQ0MG-9I.js"),[])});ct({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>st(()=>import("./less-GGFNNJHn.js"),[])});ct({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>st(()=>import("./lexon-Canl7DCW.js"),[])});ct({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>st(()=>import("./lua-D28Ae8-K.js"),[])});ct({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>st(()=>import("./liquid-D2JYL9PO.js"),[])});ct({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>st(()=>import("./m3-DPitgjJI.js"),[])});ct({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>st(()=>import("./markdown-B811l8j2.js"),[])});ct({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>st(()=>import("./mdx-Ch04DugU.js"),[])});ct({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>st(()=>import("./mips-CdjsipkG.js"),[])});ct({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>st(()=>import("./msdax-CYqgjx_P.js"),[])});ct({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>st(()=>import("./mysql-BHd6q0vd.js"),[])});ct({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>st(()=>import("./objective-c-B1aVtJYH.js"),[])});ct({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>st(()=>import("./pascal-BhNW15KB.js"),[])});ct({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>st(()=>import("./pascaligo-5jv8CcQD.js"),[])});ct({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>st(()=>import("./perl-DlYyT36c.js"),[])});ct({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>st(()=>import("./pgsql-Dy0bjov7.js"),[])});ct({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>st(()=>import("./php-120yhfDK.js"),[])});ct({id:"pla",extensions:[".pla"],loader:()=>st(()=>import("./pla-CjnFlu4u.js"),[])});ct({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>st(()=>import("./postiats-CQpG440k.js"),[])});ct({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>st(()=>import("./powerquery-DdJtto1Z.js"),[])});ct({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>st(()=>import("./powershell-Bu_VLpJB.js"),[])});ct({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>st(()=>import("./protobuf-IBS6jZEB.js"),[])});ct({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>st(()=>import("./pug-kFxLfcjb.js"),[])});ct({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>st(()=>import("./python-D-iNySlZ.js"),[])});ct({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>st(()=>import("./qsharp-q7JyzKFN.js"),[])});ct({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>st(()=>import("./r-BIFz-_sK.js"),[])});ct({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>st(()=>import("./razor-Bq45_Fpy.js"),[])});ct({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>st(()=>import("./redis-CHOsPHWR.js"),[])});ct({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>st(()=>import("./redshift-CBifECDb.js"),[])});ct({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>st(()=>import("./restructuredtext-CghPJEOS.js"),[])});ct({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>st(()=>import("./ruby-CYWGW-b1.js"),[])});ct({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>st(()=>import("./rust-DMDD0SHb.js"),[])});ct({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>st(()=>import("./sb-BYAiYHFx.js"),[])});ct({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:()=>st(()=>import("./scala-Bqvq8jcR.js"),[])});ct({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>st(()=>import("./scheme-Dhb-2j9p.js"),[])});ct({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>st(()=>import("./scss-CTwUZ5N7.js"),[])});ct({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>st(()=>import("./shell-CsDZo4DB.js"),[])});ct({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>st(()=>import("./solidity-CME5AdoB.js"),[])});ct({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>st(()=>import("./sophia-RYC1BQQz.js"),[])});ct({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>st(()=>import("./sparql-KEyrF7De.js"),[])});ct({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>st(()=>import("./sql-BdTr02Mf.js"),[])});ct({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>st(()=>import("./st-C7iG7M4S.js"),[])});ct({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>st(()=>import("./swift-D7IUmUK8.js"),[])});ct({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>st(()=>import("./systemverilog-DgMryOEJ.js"),[])});ct({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>st(()=>import("./systemverilog-DgMryOEJ.js"),[])});ct({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>st(()=>import("./tcl-PloMZuKG.js"),[])});ct({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>st(()=>import("./twig-BfRIq3la.js"),[])});ct({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>st(()=>import("./typescript-CtgyIznM.js"),[])});ct({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>st(()=>import("./typespec-CzxlYoT_.js"),[])});ct({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>st(()=>import("./vb-BwAE3J76.js"),[])});ct({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>st(()=>import("./wgsl-B_1kOXbF.js"),[])});ct({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:()=>st(()=>import("./xml-D5joow3e.js"),[])});ct({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>st(()=>import("./yaml-BsRI11pd.js"),[])});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),_y={};uUe(_y,Jk);var M$=class{constructor(e,t,i){this._onDidChange=new _y.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)}},A$={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}},O$={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},bhe=new M$("css",A$,O$),vhe=new M$("scss",A$,O$),Che=new M$("less",A$,O$);_y.languages.css={cssDefaults:bhe,lessDefaults:Che,scssDefaults:vhe};function P$(){return st(()=>import("./cssMode-BBJnYJ3k.js"),[])}_y.languages.onLanguage("less",()=>{P$().then(s=>s.setupMode(Che))});_y.languages.onLanguage("scss",()=>{P$().then(s=>s.setupMode(vhe))});_y.languages.onLanguage("css",()=>{P$().then(s=>s.setupMode(bhe))});var hUe=Object.defineProperty,fUe=Object.getOwnPropertyDescriptor,gUe=Object.getOwnPropertyNames,pUe=Object.prototype.hasOwnProperty,mUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of gUe(e))!pUe.call(s,n)&&n!==t&&hUe(s,n,{get:()=>e[n],enumerable:!(i=fUe(e,n))||i.enumerable});return s},_Ue=(s,e,t)=>(mUe(s,e,"default"),t),iP={};_Ue(iP,Jk);var bUe=class{constructor(e,t,i){this._onDidChange=new iP.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)}},vUe={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"},nP={format:vUe,suggest:{},data:{useDefaultDataProvider:!0}};function sP(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===ZS,documentFormattingEdits:s===ZS,documentRangeFormattingEdits:s===ZS}}var ZS="html",Fie="handlebars",Bie="razor",whe=oP(ZS,nP,sP(ZS)),CUe=whe.defaults,yhe=oP(Fie,nP,sP(Fie)),wUe=yhe.defaults,She=oP(Bie,nP,sP(Bie)),yUe=She.defaults;iP.languages.html={htmlDefaults:CUe,razorDefaults:yUe,handlebarDefaults:wUe,htmlLanguageService:whe,handlebarLanguageService:yhe,razorLanguageService:She,registerHTMLLanguageService:oP};function SUe(){return st(()=>import("./htmlMode-DmOnHDtb.js"),[])}function oP(s,e=nP,t=sP(s)){const i=new bUe(s,e,t);let n;const o=iP.languages.onLanguage(s,async()=>{n=(await SUe()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),n?.dispose(),n=void 0}}}var xUe=Object.defineProperty,LUe=Object.getOwnPropertyDescriptor,kUe=Object.getOwnPropertyNames,DUe=Object.prototype.hasOwnProperty,EUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of kUe(e))!DUe.call(s,n)&&n!==t&&xUe(s,n,{get:()=>e[n],enumerable:!(i=LUe(e,n))||i.enumerable});return s},IUe=(s,e,t)=>(EUe(s,e,"default"),t),eD={};IUe(eD,Jk);var NUe=class{constructor(e,t,i){this._onDidChange=new eD.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)}},TUe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},RUe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},xhe=new NUe("json",TUe,RUe),MUe=()=>Lhe().then(s=>s.getWorker());eD.languages.json={jsonDefaults:xhe,getWorker:MUe};function Lhe(){return st(()=>import("./jsonMode-C3d51Wej.js"),[])}eD.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});eD.languages.onLanguage("json",()=>{Lhe().then(s=>s.setupMode(xhe))});var AUe=Object.defineProperty,OUe=Object.getOwnPropertyDescriptor,PUe=Object.getOwnPropertyNames,FUe=Object.prototype.hasOwnProperty,BUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of PUe(e))!FUe.call(s,n)&&n!==t&&AUe(s,n,{get:()=>e[n],enumerable:!(i=OUe(e,n))||i.enumerable});return s},WUe=(s,e,t)=>(BUe(s,e,"default"),t),HUe="5.4.5",I1={};WUe(I1,Jk);var khe=(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))(khe||{}),Dhe=(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))(Dhe||{}),Ehe=(s=>(s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s))(Ehe||{}),Ihe=(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))(Ihe||{}),Nhe=(s=>(s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs",s))(Nhe||{}),The=class{constructor(s,e,t,i,n){this._onDidChange=new I1.Emitter,this._onDidExtraLibsChange=new I1.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)}},VUe=HUe,Rhe={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},Mhe=new The({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Rhe),Ahe=new The({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Rhe),zUe=()=>rP().then(s=>s.getTypeScriptWorker()),UUe=()=>rP().then(s=>s.getJavaScriptWorker());I1.languages.typescript={ModuleKind:khe,JsxEmit:Dhe,NewLineKind:Ehe,ScriptTarget:Ihe,ModuleResolutionKind:Nhe,typescriptVersion:VUe,typescriptDefaults:Mhe,javascriptDefaults:Ahe,getTypeScriptWorker:zUe,getJavaScriptWorker:UUe};function rP(){return st(()=>import("./tsMode-CC8kGhhz.js"),[])}I1.languages.onLanguage("typescript",()=>rP().then(s=>s.setupTypeScript(Mhe)));I1.languages.onLanguage("javascript",()=>rP().then(s=>s.setupJavaScript(Ahe)));class jUe extends br{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:gt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:xe.map,toggled:ge.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ge.has("isInDiffEditor"),menu:{when:ge.has("isInDiffEditor"),id:Ge.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Bt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class Ohe extends br{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:gt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Bt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class Phe extends br{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:gt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Bt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const tD=gt("diffEditor","Diff Editor");class $Ue extends xd{constructor(){super({id:"diffEditor.switchSide",title:gt("switchSide","Switch Side"),icon:xe.arrowSwap,precondition:ge.has("isInDiffEditor"),f1:!0,category:tD})}runEditorCommand(e,t,i){const n=by(e);if(n instanceof uf){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class qUe extends xd{constructor(){super({id:"diffEditor.exitCompareMove",title:gt("exitCompareMove","Exit Compare Move"),icon:xe.close,precondition:B.comparingMovedCode,f1:!1,category:tD,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=by(e);n instanceof uf&&n.exitCompareMove()}}class KUe extends xd{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:gt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:xe.fold,precondition:ge.has("isInDiffEditor"),f1:!0,category:tD})}runEditorCommand(e,t,...i){const n=by(e);n instanceof uf&&n.collapseAllUnchangedRegions()}}class GUe extends xd{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:gt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:xe.unfold,precondition:ge.has("isInDiffEditor"),f1:!0,category:tD})}runEditorCommand(e,t,...i){const n=by(e);n instanceof uf&&n.showAllUnchangedRegions()}}class kW extends br{constructor(){super({id:"diffEditor.revert",title:gt("revert","Revert"),f1:!1,category:tD})}run(e,t){const i=YUe(e,t.originalUri,t.modifiedUri);i instanceof uf&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const Fhe=gt("accessibleDiffViewer","Accessible Diff Viewer"),B2=class B2 extends br{constructor(){super({id:B2.id,title:gt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:Fhe,precondition:ge.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){by(e)?.accessibleDiffViewerNext()}};B2.id="editor.action.accessibleDiffViewer.next";let FL=B2;const W2=class W2 extends br{constructor(){super({id:W2.id,title:gt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:Fhe,precondition:ge.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){by(e)?.accessibleDiffViewerPrev()}};W2.id="editor.action.accessibleDiffViewer.prev";let $R=W2;function YUe(s,e,t){return s.get(fi).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 by(s){const t=s.get(fi).listDiffEditors(),i=vo();if(i)for(const n of t){const o=n.getContainerDomNode();if(ZUe(o,i))return n}return null}function ZUe(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}qi(jUe);qi(Ohe);qi(Phe);js.appendMenuItem(Ge.EditorTitle,{command:{id:new Phe().desc.id,title:v("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ge.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ge.has("isInDiffEditor")},order:11,group:"1_diff",when:ge.and(B.diffEditorRenderSideBySideInlineBreakpointReached,ge.has("isInDiffEditor"))});js.appendMenuItem(Ge.EditorTitle,{command:{id:new Ohe().desc.id,title:v("showMoves","Show Moved Code Blocks"),icon:xe.move,toggled:ey.create("config.diffEditor.experimental.showMoves",!0),precondition:ge.has("isInDiffEditor")},order:10,group:"1_diff",when:ge.has("isInDiffEditor")});qi(kW);for(const s of[{icon:xe.arrowRight,key:B.diffEditorInlineMode.toNegated()},{icon:xe.discard,key:B.diffEditorInlineMode}])js.appendMenuItem(Ge.DiffEditorHunkToolbar,{command:{id:new kW().desc.id,title:v("revertHunk","Revert Block"),icon:s.icon},when:ge.and(B.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),js.appendMenuItem(Ge.DiffEditorSelectionToolbar,{command:{id:new kW().desc.id,title:v("revertSelection","Revert Selection"),icon:s.icon},when:ge.and(B.diffEditorModifiedWritable,s.key),order:5,group:"primary"});qi($Ue);qi(qUe);qi(KUe);qi(GUe);js.appendMenuItem(Ge.EditorTitle,{command:{id:FL.id,title:v("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ge.has("isInDiffEditor")},order:10,group:"2_diff",when:ge.and(B.accessibleDiffViewerVisible.negate(),ge.has("isInDiffEditor"))});ii.registerCommandAlias("editor.action.diffReview.next",FL.id);qi(FL);ii.registerCommandAlias("editor.action.diffReview.prev",$R.id);qi($R);var XUe=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)}},DW;const aP=new Be("selectionAnchorSet",!1);var M_;let Ip=(M_=class{static get(e){return e.getContribution(DW.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=aP.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(Ze.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Io().appendText(v("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),mr(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(Ze.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()}},DW=M_,M_.ID="editor.contrib.selectionAnchorController",M_);Ip=DW=XUe([QUe(1,ft)],Ip);class JUe extends Ve{constructor(){super({id:"editor.action.setSelectionAnchor",label:v("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:ps(2089,2080),weight:100}})}async run(e,t){Ip.get(t)?.setSelectionAnchor()}}class eje extends Ve{constructor(){super({id:"editor.action.goToSelectionAnchor",label:v("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:aP})}async run(e,t){Ip.get(t)?.goToSelectionAnchor()}}class tje extends Ve{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:v("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:aP,kbOpts:{kbExpr:B.editorTextFocus,primary:ps(2089,2089),weight:100}})}async run(e,t){Ip.get(t)?.selectFromAnchorToCursor()}}class ije extends Ve{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:v("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:aP,kbOpts:{kbExpr:B.editorTextFocus,primary:9,weight:100}})}async run(e,t){Ip.get(t)?.cancelSelectionAnchor()}}ri(Ip.ID,Ip,4);Ce(JUe);Ce(eje);Ce(tje);Ce(ije);const nje=W("editorOverviewRuler.bracketMatchForeground","#A0A0A0",v("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class sje extends Ve{constructor(){super({id:"editor.action.jumpToBracket",label:v("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:3165,weight:100}})}run(e,t){Wb.get(t)?.jumpToBracket()}}class oje extends Ve{constructor(){super({id:"editor.action.selectToBracket",label:v("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:gt("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),Wb.get(t)?.selectToBracket(n)}}class rje extends Ve{constructor(){super({id:"editor.action.removeBrackets",label:v("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:2561,weight:100}})}run(e,t){Wb.get(t)?.removeBrackets(this.id)}}class aje{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const pg=class pg extends ne{static get(e){return e.getContribution(pg.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Oi(()=>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 Ze(r.lineNumber,r.column,r.lineNumber,r.column):new Ze(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(M.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 Ze(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(ee.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=pg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(p,20),b=pg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new aje(p,m,b)}}this._lastBracketsData=a,this._lastVersionId=i}};pg.ID="editor.contrib.bracketMatchingController",pg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=xt.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Wn(nje),position:Ka.Center}}),pg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=xt.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Wb=pg;ri(Wb.ID,Wb,1);Ce(oje);Ce(sje);Ce(rje);js.appendMenuItem(Ge.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:v({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class lje{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 M(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new M(i,o,i,o),a)}else{const r=new M(i,o,i,o+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new M(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Ze(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Ze(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class Bhe extends Ve{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 lje(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class cje extends Bhe{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:v("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:B.writable})}}class dje extends Bhe{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:v("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:B.writable})}}Ce(cje);Ce(dje);class uje extends Ve{constructor(){super({id:"editor.action.transposeLetters",label:v("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:B.writable,kbOpts:{kbExpr:B.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():ki.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),u=ki.leftPosition(i,d),f=ki.leftPosition(i,u),p=i.getValueInRange(M.fromPositions(f,u)),m=i.getValueInRange(M.fromPositions(u,d)),b=M.fromPositions(f,d);n.push(new bo(b,m+p))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Ce(uje);const lP=(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 F$(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function hje(s,e,t){const i={id:lP(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class Whe{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 ti.some(this,([i,n])=>n.asFile())&&t.push("files"),Vhe(qR(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 qR(e)}}function qR(s){return s.toLowerCase()}function Hhe(s,e){return Vhe(qR(s),e.map(qR))}function Vhe(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 cP=Object.freeze({create:s=>nf(s.map(e=>e.toString())).join(`\r
|
|
717
|
+
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:Xh(t,a.open),close:Xh(t,a.close)});else throw un(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 $Ve(s){a1.registerLanguage(s)}function qVe(){let s=[];return s=s.concat(a1.getLanguages()),s}function KVe(s){return pt.get(xn).languageIdCodec.encodeLanguageId(s)}function GVe(s,e){return pt.withServices(()=>{const i=pt.get(xn).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function YVe(s,e){return pt.withServices(()=>{const i=pt.get(xn).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function ZVe(s,e){if(!pt.get(xn).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return pt.get(Rn).register(s,e,100)}class XVe{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 OL.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 qA(n.tokens,n.endState)}}class OL{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 Ox(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),r=OL._toClassicTokens(o.tokens,e);let a;return o.endState.equals(n)?a=n:a=o.endState,new nU(r,a)}tokenize(e,t,i){return OL.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 qA(o,r)}}function QVe(s){return typeof s.getInitialState=="function"}function JVe(s){return"tokenizeEncoded"in s}function lhe(s){return s&&typeof s.then=="function"}function eze(s){const e=pt.get(rl);if(s){const t=[null];for(let i=1,n=s.length;i<n;i++)t[i]=pe.fromHex(s[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function che(s,e){return JVe(e)?new XVe(s,e):new OL(s,e,pt.get(xn),pt.get(rl))}function I$(s,e){const t=new IEe(async()=>{const i=await Promise.resolve(e.create());return i?QVe(i)?che(s,i):new SL(pt.get(xn),pt.get(rl),s,ahe(s,i),pt.get(Bt)):null});return Bn.registerFactory(s,t)}function tze(s,e){if(!pt.get(xn).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return lhe(e)?I$(s,{create:()=>e}):Bn.register(s,che(s,e))}function ize(s,e){const t=i=>new SL(pt.get(xn),pt.get(rl),s,ahe(s,i),pt.get(Bt));return lhe(e)?I$(s,{create:()=>e}):Bn.register(s,t(e))}function nze(s,e){return pt.get(Ke).referenceProvider.register(s,e)}function sze(s,e){return pt.get(Ke).renameProvider.register(s,e)}function oze(s,e){return pt.get(Ke).newSymbolNamesProvider.register(s,e)}function rze(s,e){return pt.get(Ke).signatureHelpProvider.register(s,e)}function aze(s,e){return pt.get(Ke).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 M(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new M(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function lze(s,e){return pt.get(Ke).documentSymbolProvider.register(s,e)}function cze(s,e){return pt.get(Ke).documentHighlightProvider.register(s,e)}function dze(s,e){return pt.get(Ke).linkedEditingRangeProvider.register(s,e)}function uze(s,e){return pt.get(Ke).definitionProvider.register(s,e)}function hze(s,e){return pt.get(Ke).implementationProvider.register(s,e)}function fze(s,e){return pt.get(Ke).typeDefinitionProvider.register(s,e)}function gze(s,e){return pt.get(Ke).codeLensProvider.register(s,e)}function pze(s,e,t){return pt.get(Ke).codeActionProvider.register(s,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,o,r,a)=>{const c=pt.get(Ou).read({resource:n.uri}).filter(d=>M.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function mze(s,e){return pt.get(Ke).documentFormattingEditProvider.register(s,e)}function _ze(s,e){return pt.get(Ke).documentRangeFormattingEditProvider.register(s,e)}function bze(s,e){return pt.get(Ke).onTypeFormattingEditProvider.register(s,e)}function vze(s,e){return pt.get(Ke).linkProvider.register(s,e)}function Cze(s,e){return pt.get(Ke).completionProvider.register(s,e)}function wze(s,e){return pt.get(Ke).colorProvider.register(s,e)}function yze(s,e){return pt.get(Ke).foldingRangeProvider.register(s,e)}function Sze(s,e){return pt.get(Ke).declarationProvider.register(s,e)}function xze(s,e){return pt.get(Ke).selectionRangeProvider.register(s,e)}function Lze(s,e){return pt.get(Ke).documentSemanticTokensProvider.register(s,e)}function kze(s,e){return pt.get(Ke).documentRangeSemanticTokensProvider.register(s,e)}function Dze(s,e){return pt.get(Ke).inlineCompletionsProvider.register(s,e)}function Eze(s,e){return pt.get(Ke).inlineEditProvider.register(s,e)}function Ize(s,e){return pt.get(Ke).inlayHintsProvider.register(s,e)}function Nze(){return{register:$Ve,getLanguages:qVe,onLanguage:GVe,onLanguageEncountered:YVe,getEncodedLanguageId:KVe,setLanguageConfiguration:ZVe,setColorMap:eze,registerTokensProviderFactory:I$,setTokensProvider:tze,setMonarchTokensProvider:ize,registerReferenceProvider:nze,registerRenameProvider:sze,registerNewSymbolNameProvider:oze,registerCompletionItemProvider:Cze,registerSignatureHelpProvider:rze,registerHoverProvider:aze,registerDocumentSymbolProvider:lze,registerDocumentHighlightProvider:cze,registerLinkedEditingRangeProvider:dze,registerDefinitionProvider:uze,registerImplementationProvider:hze,registerTypeDefinitionProvider:fze,registerCodeLensProvider:gze,registerCodeActionProvider:pze,registerDocumentFormattingEditProvider:mze,registerDocumentRangeFormattingEditProvider:_ze,registerOnTypeFormattingEditProvider:bze,registerLinkProvider:vze,registerColorProvider:wze,registerFoldingRangeProvider:yze,registerDeclarationProvider:Sze,registerSelectionRangeProvider:xze,registerDocumentSemanticTokensProvider:Lze,registerDocumentRangeSemanticTokensProvider:kze,registerInlineCompletionsProvider:Dze,registerInlineEditProvider:Eze,registerInlayHintsProvider:Ize,DocumentHighlightKind:h9,CompletionItemKind:r9,CompletionItemTag:a9,CompletionItemInsertTextRule:o9,SymbolKind:U9,SymbolTag:j9,IndentAction:v9,CompletionTriggerKind:l9,SignatureHelpTriggerKind:z9,InlayHintKind:w9,InlineCompletionTriggerKind:y9,InlineEditTriggerKind:S9,CodeActionTriggerType:s9,NewSymbolNameTag:N9,NewSymbolNameTriggerKind:T9,PartialAcceptTriggerKind:A9,HoverVerbosityAction:b9,FoldingRangeKind:gp,SelectedSuggestionInfo:uae}}const N$=qt("IEditorCancelService"),dhe=new Be("cancellableOperation",!1,v("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Jt(N$,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=dhe.bindTo(n.get(ft)),r=new rr;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 Tze extends Nn{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(N$).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ae(new class extends Ls{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:dhe})}runEditorCommand(s,e){s.get(N$).cancel(e)}});let uhe=class xW{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?xb("{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 xW))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 xW(e,this.flags))}};class Ep extends Tze{constructor(e,t,i,n){super(e,n),this._listener=new he,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!M.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!M.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 T$ extends Nn{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Du(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===Yk.ICodeEditor:!1}function R$(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===Yk.IDiffEditor:!1}function Rze(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function hhe(s){return Du(s)?s:R$(s)?s.getModifiedEditor():Rze(s)&&Du(s.activeCodeEditor)?s.activeCodeEditor:null}class E1{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=Cd.capture(e),o=E1._handleEolEdits(e,t);o.length===1&&E1._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>En.replace(M.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>En.replaceMove(M.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class Pie{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class Mze{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(Pie.toKey(e))}has(e){return this._set.has(Pie.toKey(e))}}function fhe(s,e,t){const i=[],n=new Mze,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 wx=class wx{static setFormatterSelector(e){return{dispose:wx._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const o=ti.first(wx._selectors);if(o)return await o(e,t,i,n)}};wx._selectors=new rr;let PL=wx;async function ghe(s,e,t,i,n,o,r){const a=s.get(tt),{documentRangeFormattingEditProvider:l}=s.get(Ke),c=Du(e)?e.getModel():e,d=l.ordered(c),u=await PL.select(d,c,i,2);u&&(n.report(u),await a.invokeFunction(Aze,u,e,t,o,r))}async function Aze(s,e,t,i,n,o){const r=s.get(Ur),a=s.get(yo),l=s.get(Hp);let c,d;Du(t)?(c=t.getModel(),d=new Ep(t,5,void 0,n)):(c=t,d=new T$(t,n));const u=[];let f=0;for(const y of qz(i).sort(M.compareRangesUsingStarts))f>0&&M.areIntersectingOrTouching(u[f-1],y)?u[f-1]=M.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 x=y.reduce((L,E)=>M.plusRange(L,E.range),y[0].range);if(!S.some(L=>M.intersectRanges(x,L.range)))return!1;for(const L of y)for(const E of S)if(M.intersectRanges(L.range,E.range))return!0;return!1},b=[],w=[];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),w.push(y)}else{for(const y of u){if(d.token.isCancellationRequested)return!0;w.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(w[y],w[S])){const x=M.plusRange(u[y],u[S]),L=await p(x);u.splice(S,1),u.splice(y,1),u.push(x),w.splice(S,1),w.splice(y,1),w.push(L),y=0,S=0}}}for(const y of w){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(Du(t))E1.execute(t,b,!0),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:y}]=b,S=new Ze(y.startLineNumber,y.startColumn,y.endLineNumber,y.endColumn);c.pushEditOperations([S],b.map(x=>({text:x.text,range:M.lift(x.range),forceMoveMarkers:!0})),x=>{for(const{range:L}of x)if(M.areIntersectingOrTouching(L,S))return[new Ze(L.startLineNumber,L.startColumn,L.endLineNumber,L.endColumn)];return null})}return l.playSignal(Oa.format,{userGesture:o}),!0}async function Oze(s,e,t,i,n,o){const r=s.get(tt),a=s.get(Ke),l=Du(e)?e.getModel():e,c=fhe(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await PL.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(Pze,d,e,t,n,o))}async function Pze(s,e,t,i,n,o){const r=s.get(Ur),a=s.get(Hp);let l,c;Du(t)?(l=t.getModel(),c=new Ep(t,5,void 0,n)):(l=t,c=new T$(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(Du(t))E1.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:u}]=d,f=new Ze(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);l.pushEditOperations([f],d.map(p=>({text:p.text,range:M.lift(p.range),forceMoveMarkers:!0})),p=>{for(const{range:m}of p)if(M.areIntersectingOrTouching(m,f))return[new Ze(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)];return null})}return a.playSignal(Oa.format,{userGesture:o}),!0}async function Fze(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(Gn);if(Go(l))return await s.computeMoreMinimalEdits(t.uri,l)}}async function Bze(s,e,t,i,n){const o=fhe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(Gn);if(Go(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function phe(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(Gn).then(l=>s.computeMoreMinimalEdits(t.uri,l))}ii.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;hi(nt.isUri(t)),hi(M.isIRange(i));const o=s.get(Hr),r=s.get(Ur),a=s.get(Ke),l=await o.createModelReference(t);try{return Fze(r,a,l.object.textEditorModel,M.lift(i),n,Tt.None)}finally{l.dispose()}});ii.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;hi(nt.isUri(t));const n=s.get(Hr),o=s.get(Ur),r=s.get(Ke),a=await n.createModelReference(t);try{return Bze(o,r,a.object.textEditorModel,i,Tt.None)}finally{a.dispose()}});ii.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,o]=e;hi(nt.isUri(t)),hi(ee.isIPosition(i)),hi(typeof n=="string");const r=s.get(Hr),a=s.get(Ur),l=s.get(Ke),c=await r.createModelReference(t);try{return phe(a,l,c.object.textEditorModel,ee.lift(i),n,o,Tt.None)}finally{c.dispose()}});Sd.wrappingIndent.defaultValue=0;Sd.glyphMargin.defaultValue=!1;Sd.autoIndent.defaultValue=3;Sd.overviewRulerLanes.defaultValue=2;PL.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const Cr=hae();Cr.editor=WVe();Cr.languages=Nze();const Wze=Cr.CancellationTokenSource,Hze=Cr.Emitter,Vze=Cr.KeyCode,zze=Cr.KeyMod,Uze=Cr.Position,jze=Cr.Range,$ze=Cr.Selection,qze=Cr.SelectionDirection,Kze=Cr.MarkerSeverity,Gze=Cr.MarkerTag,Yze=Cr.Uri,Zze=Cr.Token,LW=Cr.editor,Xze=Cr.languages,Qze=globalThis.MonacoEnvironment;(Qze?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Cr);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 Jk=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:Wze,Emitter:Hze,KeyCode:Vze,KeyMod:zze,MarkerSeverity:Kze,MarkerTag:Gze,Position:Uze,Range:jze,Selection:$ze,SelectionDirection:qze,Token:Zze,Uri:Yze,editor:LW,languages:Xze},Symbol.toStringTag,{value:"Module"}));var Jze=Object.defineProperty,eUe=Object.getOwnPropertyDescriptor,tUe=Object.getOwnPropertyNames,iUe=Object.prototype.hasOwnProperty,nUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of tUe(e))!iUe.call(s,n)&&n!==t&&Jze(s,n,{get:()=>e[n],enumerable:!(i=eUe(e,n))||i.enumerable});return s},sUe=(s,e,t)=>(nUe(s,e,"default"),t),rS={};sUe(rS,Jk);var mhe={},F3={},oUe=class _he{static getOrCreate(e){return F3[e]||(F3[e]=new _he(e)),F3[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,mhe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function ct(s){const e=s.id;mhe[e]=s,rS.languages.register(s);const t=oUe.getOrCreate(e);rS.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),rS.languages.onLanguageEncountered(e,async()=>{const i=await t.load();rS.languages.setLanguageConfiguration(e,i.conf)})}ct({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>st(()=>import("./abap-CRCWOmpq.js"),[])});ct({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>st(()=>import("./apex-DnsZk_dE.js"),[])});ct({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>st(()=>import("./azcli-1IWB1ccx.js"),[])});ct({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>st(()=>import("./bat-DPkNLes8.js"),[])});ct({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>st(()=>import("./bicep-Corcdgou.js"),[])});ct({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>st(()=>import("./cameligo-CGrWLZr3.js"),[])});ct({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>st(()=>import("./clojure-D9WOWImG.js"),[])});ct({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>st(()=>import("./coffee-B7EJu28W.js"),[])});ct({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>st(()=>import("./cpp-SEyurbux.js"),[])});ct({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>st(()=>import("./cpp-SEyurbux.js"),[])});ct({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>st(()=>import("./csharp-BoL64M5l.js"),[])});ct({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>st(()=>import("./csp-C46ZqvIl.js"),[])});ct({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>st(()=>import("./css-DQU6DXDx.js"),[])});ct({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>st(()=>import("./cypher-D84EuPTj.js"),[])});ct({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>st(()=>import("./dart-D8lhlL1r.js"),[])});ct({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>st(()=>import("./dockerfile-DLk6rpji.js"),[])});ct({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>st(()=>import("./ecl-BO6FnfXk.js"),[])});ct({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>st(()=>import("./elixir-BRjLKONM.js"),[])});ct({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>st(()=>import("./flow9-Cac8vKd7.js"),[])});ct({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>st(()=>import("./fsharp-fd1GTHhf.js"),[])});ct({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>st(()=>import("./freemarker2-CrKZYA9-.js"),[]).then(s=>s.TagAutoInterpolationDollar)});ct({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>st(()=>import("./freemarker2-CrKZYA9-.js"),[]).then(s=>s.TagAngleInterpolationDollar)});ct({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>st(()=>import("./freemarker2-CrKZYA9-.js"),[]).then(s=>s.TagBracketInterpolationDollar)});ct({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>st(()=>import("./freemarker2-CrKZYA9-.js"),[]).then(s=>s.TagAngleInterpolationBracket)});ct({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>st(()=>import("./freemarker2-CrKZYA9-.js"),[]).then(s=>s.TagBracketInterpolationBracket)});ct({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>st(()=>import("./freemarker2-CrKZYA9-.js"),[]).then(s=>s.TagAutoInterpolationDollar)});ct({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>st(()=>import("./freemarker2-CrKZYA9-.js"),[]).then(s=>s.TagAutoInterpolationBracket)});ct({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>st(()=>import("./go-O9LJTZXk.js"),[])});ct({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>st(()=>import("./graphql-LQdxqEYJ.js"),[])});ct({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>st(()=>import("./handlebars-BgBTN99O.js"),[])});ct({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>st(()=>import("./hcl-DxDQ3s82.js"),[])});ct({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:()=>st(()=>import("./html-D36ptcmC.js"),[])});ct({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>st(()=>import("./ini-BvajGCUy.js"),[])});ct({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>st(()=>import("./java-SYsfObOQ.js"),[])});ct({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>st(()=>import("./javascript-C6sCQzuh.js"),__vite__mapDeps([0,1]))});ct({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>st(()=>import("./julia-DQXNmw_w.js"),[])});ct({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>st(()=>import("./kotlin-qQ0MG-9I.js"),[])});ct({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>st(()=>import("./less-GGFNNJHn.js"),[])});ct({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>st(()=>import("./lexon-Canl7DCW.js"),[])});ct({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>st(()=>import("./lua-D28Ae8-K.js"),[])});ct({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>st(()=>import("./liquid-CvdwL9kp.js"),[])});ct({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>st(()=>import("./m3-DPitgjJI.js"),[])});ct({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>st(()=>import("./markdown-B811l8j2.js"),[])});ct({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>st(()=>import("./mdx-CdZzWG3e.js"),[])});ct({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>st(()=>import("./mips-CdjsipkG.js"),[])});ct({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>st(()=>import("./msdax-CYqgjx_P.js"),[])});ct({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>st(()=>import("./mysql-BHd6q0vd.js"),[])});ct({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>st(()=>import("./objective-c-B1aVtJYH.js"),[])});ct({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>st(()=>import("./pascal-BhNW15KB.js"),[])});ct({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>st(()=>import("./pascaligo-5jv8CcQD.js"),[])});ct({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>st(()=>import("./perl-DlYyT36c.js"),[])});ct({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>st(()=>import("./pgsql-Dy0bjov7.js"),[])});ct({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>st(()=>import("./php-120yhfDK.js"),[])});ct({id:"pla",extensions:[".pla"],loader:()=>st(()=>import("./pla-CjnFlu4u.js"),[])});ct({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>st(()=>import("./postiats-CQpG440k.js"),[])});ct({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>st(()=>import("./powerquery-DdJtto1Z.js"),[])});ct({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>st(()=>import("./powershell-Bu_VLpJB.js"),[])});ct({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>st(()=>import("./protobuf-IBS6jZEB.js"),[])});ct({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>st(()=>import("./pug-kFxLfcjb.js"),[])});ct({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>st(()=>import("./python-CSUJS9Bk.js"),[])});ct({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>st(()=>import("./qsharp-q7JyzKFN.js"),[])});ct({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>st(()=>import("./r-BIFz-_sK.js"),[])});ct({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>st(()=>import("./razor-ypTGnW2v.js"),[])});ct({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>st(()=>import("./redis-CHOsPHWR.js"),[])});ct({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>st(()=>import("./redshift-CBifECDb.js"),[])});ct({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>st(()=>import("./restructuredtext-CghPJEOS.js"),[])});ct({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>st(()=>import("./ruby-CYWGW-b1.js"),[])});ct({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>st(()=>import("./rust-DMDD0SHb.js"),[])});ct({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>st(()=>import("./sb-BYAiYHFx.js"),[])});ct({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:()=>st(()=>import("./scala-Bqvq8jcR.js"),[])});ct({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>st(()=>import("./scheme-Dhb-2j9p.js"),[])});ct({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>st(()=>import("./scss-CTwUZ5N7.js"),[])});ct({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>st(()=>import("./shell-CsDZo4DB.js"),[])});ct({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>st(()=>import("./solidity-CME5AdoB.js"),[])});ct({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>st(()=>import("./sophia-RYC1BQQz.js"),[])});ct({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>st(()=>import("./sparql-KEyrF7De.js"),[])});ct({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>st(()=>import("./sql-BdTr02Mf.js"),[])});ct({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>st(()=>import("./st-C7iG7M4S.js"),[])});ct({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>st(()=>import("./swift-D7IUmUK8.js"),[])});ct({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>st(()=>import("./systemverilog-DgMryOEJ.js"),[])});ct({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>st(()=>import("./systemverilog-DgMryOEJ.js"),[])});ct({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>st(()=>import("./tcl-PloMZuKG.js"),[])});ct({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>st(()=>import("./twig-BfRIq3la.js"),[])});ct({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>st(()=>import("./typescript-wuTifRF-.js"),[])});ct({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>st(()=>import("./typespec-CzxlYoT_.js"),[])});ct({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>st(()=>import("./vb-BwAE3J76.js"),[])});ct({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>st(()=>import("./wgsl-B_1kOXbF.js"),[])});ct({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:()=>st(()=>import("./xml-DoFtLqDh.js"),[])});ct({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>st(()=>import("./yaml-CrPwKSmj.js"),[])});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),_y={};uUe(_y,Jk);var M$=class{constructor(e,t,i){this._onDidChange=new _y.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)}},A$={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}},O$={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},bhe=new M$("css",A$,O$),vhe=new M$("scss",A$,O$),Che=new M$("less",A$,O$);_y.languages.css={cssDefaults:bhe,lessDefaults:Che,scssDefaults:vhe};function P$(){return st(()=>import("./cssMode-Bsa7tmw2.js"),[])}_y.languages.onLanguage("less",()=>{P$().then(s=>s.setupMode(Che))});_y.languages.onLanguage("scss",()=>{P$().then(s=>s.setupMode(vhe))});_y.languages.onLanguage("css",()=>{P$().then(s=>s.setupMode(bhe))});var hUe=Object.defineProperty,fUe=Object.getOwnPropertyDescriptor,gUe=Object.getOwnPropertyNames,pUe=Object.prototype.hasOwnProperty,mUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of gUe(e))!pUe.call(s,n)&&n!==t&&hUe(s,n,{get:()=>e[n],enumerable:!(i=fUe(e,n))||i.enumerable});return s},_Ue=(s,e,t)=>(mUe(s,e,"default"),t),iP={};_Ue(iP,Jk);var bUe=class{constructor(e,t,i){this._onDidChange=new iP.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)}},vUe={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"},nP={format:vUe,suggest:{},data:{useDefaultDataProvider:!0}};function sP(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===ZS,documentFormattingEdits:s===ZS,documentRangeFormattingEdits:s===ZS}}var ZS="html",Fie="handlebars",Bie="razor",whe=oP(ZS,nP,sP(ZS)),CUe=whe.defaults,yhe=oP(Fie,nP,sP(Fie)),wUe=yhe.defaults,She=oP(Bie,nP,sP(Bie)),yUe=She.defaults;iP.languages.html={htmlDefaults:CUe,razorDefaults:yUe,handlebarDefaults:wUe,htmlLanguageService:whe,handlebarLanguageService:yhe,razorLanguageService:She,registerHTMLLanguageService:oP};function SUe(){return st(()=>import("./htmlMode-CGVK_FcF.js"),[])}function oP(s,e=nP,t=sP(s)){const i=new bUe(s,e,t);let n;const o=iP.languages.onLanguage(s,async()=>{n=(await SUe()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),n?.dispose(),n=void 0}}}var xUe=Object.defineProperty,LUe=Object.getOwnPropertyDescriptor,kUe=Object.getOwnPropertyNames,DUe=Object.prototype.hasOwnProperty,EUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of kUe(e))!DUe.call(s,n)&&n!==t&&xUe(s,n,{get:()=>e[n],enumerable:!(i=LUe(e,n))||i.enumerable});return s},IUe=(s,e,t)=>(EUe(s,e,"default"),t),eD={};IUe(eD,Jk);var NUe=class{constructor(e,t,i){this._onDidChange=new eD.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)}},TUe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},RUe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},xhe=new NUe("json",TUe,RUe),MUe=()=>Lhe().then(s=>s.getWorker());eD.languages.json={jsonDefaults:xhe,getWorker:MUe};function Lhe(){return st(()=>import("./jsonMode-Bh2liG7i.js"),[])}eD.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});eD.languages.onLanguage("json",()=>{Lhe().then(s=>s.setupMode(xhe))});var AUe=Object.defineProperty,OUe=Object.getOwnPropertyDescriptor,PUe=Object.getOwnPropertyNames,FUe=Object.prototype.hasOwnProperty,BUe=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of PUe(e))!FUe.call(s,n)&&n!==t&&AUe(s,n,{get:()=>e[n],enumerable:!(i=OUe(e,n))||i.enumerable});return s},WUe=(s,e,t)=>(BUe(s,e,"default"),t),HUe="5.4.5",I1={};WUe(I1,Jk);var khe=(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))(khe||{}),Dhe=(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))(Dhe||{}),Ehe=(s=>(s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s))(Ehe||{}),Ihe=(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))(Ihe||{}),Nhe=(s=>(s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs",s))(Nhe||{}),The=class{constructor(s,e,t,i,n){this._onDidChange=new I1.Emitter,this._onDidExtraLibsChange=new I1.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)}},VUe=HUe,Rhe={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},Mhe=new The({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Rhe),Ahe=new The({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Rhe),zUe=()=>rP().then(s=>s.getTypeScriptWorker()),UUe=()=>rP().then(s=>s.getJavaScriptWorker());I1.languages.typescript={ModuleKind:khe,JsxEmit:Dhe,NewLineKind:Ehe,ScriptTarget:Ihe,ModuleResolutionKind:Nhe,typescriptVersion:VUe,typescriptDefaults:Mhe,javascriptDefaults:Ahe,getTypeScriptWorker:zUe,getJavaScriptWorker:UUe};function rP(){return st(()=>import("./tsMode-Cr9H7DaY.js"),[])}I1.languages.onLanguage("typescript",()=>rP().then(s=>s.setupTypeScript(Mhe)));I1.languages.onLanguage("javascript",()=>rP().then(s=>s.setupJavaScript(Ahe)));class jUe extends br{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:gt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:xe.map,toggled:ge.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ge.has("isInDiffEditor"),menu:{when:ge.has("isInDiffEditor"),id:Ge.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Bt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class Ohe extends br{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:gt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Bt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class Phe extends br{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:gt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ge.has("isInDiffEditor")})}run(e,...t){const i=e.get(Bt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const tD=gt("diffEditor","Diff Editor");class $Ue extends xd{constructor(){super({id:"diffEditor.switchSide",title:gt("switchSide","Switch Side"),icon:xe.arrowSwap,precondition:ge.has("isInDiffEditor"),f1:!0,category:tD})}runEditorCommand(e,t,i){const n=by(e);if(n instanceof uf){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class qUe extends xd{constructor(){super({id:"diffEditor.exitCompareMove",title:gt("exitCompareMove","Exit Compare Move"),icon:xe.close,precondition:B.comparingMovedCode,f1:!1,category:tD,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=by(e);n instanceof uf&&n.exitCompareMove()}}class KUe extends xd{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:gt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:xe.fold,precondition:ge.has("isInDiffEditor"),f1:!0,category:tD})}runEditorCommand(e,t,...i){const n=by(e);n instanceof uf&&n.collapseAllUnchangedRegions()}}class GUe extends xd{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:gt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:xe.unfold,precondition:ge.has("isInDiffEditor"),f1:!0,category:tD})}runEditorCommand(e,t,...i){const n=by(e);n instanceof uf&&n.showAllUnchangedRegions()}}class kW extends br{constructor(){super({id:"diffEditor.revert",title:gt("revert","Revert"),f1:!1,category:tD})}run(e,t){const i=YUe(e,t.originalUri,t.modifiedUri);i instanceof uf&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const Fhe=gt("accessibleDiffViewer","Accessible Diff Viewer"),B2=class B2 extends br{constructor(){super({id:B2.id,title:gt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:Fhe,precondition:ge.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){by(e)?.accessibleDiffViewerNext()}};B2.id="editor.action.accessibleDiffViewer.next";let FL=B2;const W2=class W2 extends br{constructor(){super({id:W2.id,title:gt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:Fhe,precondition:ge.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){by(e)?.accessibleDiffViewerPrev()}};W2.id="editor.action.accessibleDiffViewer.prev";let $R=W2;function YUe(s,e,t){return s.get(fi).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 by(s){const t=s.get(fi).listDiffEditors(),i=vo();if(i)for(const n of t){const o=n.getContainerDomNode();if(ZUe(o,i))return n}return null}function ZUe(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}qi(jUe);qi(Ohe);qi(Phe);js.appendMenuItem(Ge.EditorTitle,{command:{id:new Phe().desc.id,title:v("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ge.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ge.has("isInDiffEditor")},order:11,group:"1_diff",when:ge.and(B.diffEditorRenderSideBySideInlineBreakpointReached,ge.has("isInDiffEditor"))});js.appendMenuItem(Ge.EditorTitle,{command:{id:new Ohe().desc.id,title:v("showMoves","Show Moved Code Blocks"),icon:xe.move,toggled:ey.create("config.diffEditor.experimental.showMoves",!0),precondition:ge.has("isInDiffEditor")},order:10,group:"1_diff",when:ge.has("isInDiffEditor")});qi(kW);for(const s of[{icon:xe.arrowRight,key:B.diffEditorInlineMode.toNegated()},{icon:xe.discard,key:B.diffEditorInlineMode}])js.appendMenuItem(Ge.DiffEditorHunkToolbar,{command:{id:new kW().desc.id,title:v("revertHunk","Revert Block"),icon:s.icon},when:ge.and(B.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),js.appendMenuItem(Ge.DiffEditorSelectionToolbar,{command:{id:new kW().desc.id,title:v("revertSelection","Revert Selection"),icon:s.icon},when:ge.and(B.diffEditorModifiedWritable,s.key),order:5,group:"primary"});qi($Ue);qi(qUe);qi(KUe);qi(GUe);js.appendMenuItem(Ge.EditorTitle,{command:{id:FL.id,title:v("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ge.has("isInDiffEditor")},order:10,group:"2_diff",when:ge.and(B.accessibleDiffViewerVisible.negate(),ge.has("isInDiffEditor"))});ii.registerCommandAlias("editor.action.diffReview.next",FL.id);qi(FL);ii.registerCommandAlias("editor.action.diffReview.prev",$R.id);qi($R);var XUe=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)}},DW;const aP=new Be("selectionAnchorSet",!1);var M_;let Ip=(M_=class{static get(e){return e.getContribution(DW.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=aP.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(Ze.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Io().appendText(v("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),mr(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(Ze.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()}},DW=M_,M_.ID="editor.contrib.selectionAnchorController",M_);Ip=DW=XUe([QUe(1,ft)],Ip);class JUe extends Ve{constructor(){super({id:"editor.action.setSelectionAnchor",label:v("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:ps(2089,2080),weight:100}})}async run(e,t){Ip.get(t)?.setSelectionAnchor()}}class eje extends Ve{constructor(){super({id:"editor.action.goToSelectionAnchor",label:v("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:aP})}async run(e,t){Ip.get(t)?.goToSelectionAnchor()}}class tje extends Ve{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:v("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:aP,kbOpts:{kbExpr:B.editorTextFocus,primary:ps(2089,2089),weight:100}})}async run(e,t){Ip.get(t)?.selectFromAnchorToCursor()}}class ije extends Ve{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:v("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:aP,kbOpts:{kbExpr:B.editorTextFocus,primary:9,weight:100}})}async run(e,t){Ip.get(t)?.cancelSelectionAnchor()}}ri(Ip.ID,Ip,4);Ce(JUe);Ce(eje);Ce(tje);Ce(ije);const nje=W("editorOverviewRuler.bracketMatchForeground","#A0A0A0",v("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class sje extends Ve{constructor(){super({id:"editor.action.jumpToBracket",label:v("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:3165,weight:100}})}run(e,t){Wb.get(t)?.jumpToBracket()}}class oje extends Ve{constructor(){super({id:"editor.action.selectToBracket",label:v("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:gt("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),Wb.get(t)?.selectToBracket(n)}}class rje extends Ve{constructor(){super({id:"editor.action.removeBrackets",label:v("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:2561,weight:100}})}run(e,t){Wb.get(t)?.removeBrackets(this.id)}}class aje{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const pg=class pg extends ne{static get(e){return e.getContribution(pg.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Oi(()=>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 Ze(r.lineNumber,r.column,r.lineNumber,r.column):new Ze(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(M.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 Ze(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(ee.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=pg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(p,20),b=pg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new aje(p,m,b)}}this._lastBracketsData=a,this._lastVersionId=i}};pg.ID="editor.contrib.bracketMatchingController",pg._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=xt.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Wn(nje),position:Ka.Center}}),pg._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=xt.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Wb=pg;ri(Wb.ID,Wb,1);Ce(oje);Ce(sje);Ce(rje);js.appendMenuItem(Ge.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:v({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class lje{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 M(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new M(i,o,i,o),a)}else{const r=new M(i,o,i,o+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new M(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Ze(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Ze(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class Bhe extends Ve{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 lje(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class cje extends Bhe{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:v("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:B.writable})}}class dje extends Bhe{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:v("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:B.writable})}}Ce(cje);Ce(dje);class uje extends Ve{constructor(){super({id:"editor.action.transposeLetters",label:v("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:B.writable,kbOpts:{kbExpr:B.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():ki.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),u=ki.leftPosition(i,d),f=ki.leftPosition(i,u),p=i.getValueInRange(M.fromPositions(f,u)),m=i.getValueInRange(M.fromPositions(u,d)),b=M.fromPositions(f,d);n.push(new bo(b,m+p))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Ce(uje);const lP=(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 F$(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function hje(s,e,t){const i={id:lP(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class Whe{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 ti.some(this,([i,n])=>n.asFile())&&t.push("files"),Vhe(qR(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 qR(e)}}function qR(s){return s.toLowerCase()}function Hhe(s,e){return Vhe(qR(s),e.map(qR))}function Vhe(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 cP=Object.freeze({create:s=>nf(s.map(e=>e.toString())).join(`\r
|
|
718
718
|
`),split:s=>s.split(`\r
|
|
719
719
|
`),parse:s=>cP.split(s).filter(e=>!e.startsWith("#"))}),Gd=class Gd{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+Gd.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Gd((this.value?[this.value,...e]:e).join(Gd.sep))}};Gd.sep=".",Gd.None=new Gd("@@none@@"),Gd.Empty=new Gd("");let yn=Gd;const Wie={EDITORS:"CodeEditors",FILES:"CodeFiles"};class fje{}const gje={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Tn.add(gje.DragAndDropContribution,new fje);const yx=class yx{constructor(){}static getInstance(){return yx.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};yx.INSTANCE=new yx;let EW=yx;function zhe(s){const e=new Whe;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,F$(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,pje(n))}}return e}function pje(s){const e=s.path?nt.parse(s.path):void 0;return hje(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}const mje=Object.freeze([Wie.EDITORS,Wie.FILES,cL.RESOURCES,cL.INTERNAL_URI_LIST]);function Uhe(s,e=!1){const t=zhe(s),i=t.get(cL.INTERNAL_URI_LIST);if(i)t.replace(qn.uriList,i);else if(e||!t.has(qn.uriList)){const n=[];for(const o of s.items){const r=o.getAsFile();if(r){const a=r.path;try{a?n.push(nt.file(a).toString()):n.push(nt.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(qn.uriList,F$(cP.create(n)))}for(const n of mje)t.delete(n);return t}var B$=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},BL=function(s,e){return function(t,i){e(t,i,s)}};class W${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 Sx=class Sx extends W${constructor(){super(...arguments),this.kind=Sx.kind,this.dropMimeTypes=[qn.text],this.pasteMimeTypes=[qn.text]}async getEdit(e,t){const i=e.get(qn.text);if(!i||e.has(qn.uriList))return;const n=await i.asString();return{handledMimeType:qn.text,title:v("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};Sx.id="text",Sx.kind=new yn("text.plain");let Hb=Sx;class jhe extends W${constructor(){super(...arguments),this.kind=new yn("uri.absolute"),this.dropMimeTypes=[qn.uriList],this.pasteMimeTypes=[qn.uriList]}async getEdit(e,t){const i=await $he(e);if(!i.length||t.isCancellationRequested)return;let n=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===St.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:qn.uriList,insertText:o,title:r,kind:this.kind}}}let KR=class extends W${constructor(e){super(),this._workspaceContextService=e,this.kind=new yn("uri.relative"),this.dropMimeTypes=[qn.uriList],this.pasteMimeTypes=[qn.uriList]}async getEdit(e,t){const i=await $he(e);if(!i.length||t.isCancellationRequested)return;const n=yc(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?bOe(r.uri,o):void 0}));if(n.length)return{handledMimeType:qn.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}}};KR=B$([BL(0,Mb)],KR);class _je{constructor(){this.kind=new yn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:qn.text}]}async provideDocumentPasteEdits(e,t,i,n,o){if(n.triggerKind!==Fx.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 $he(s){const e=s.get(qn.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of cP.parse(t))try{i.push({uri:nt.parse(n),originalText:n})}catch{}return i}let IW=class extends ne{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Hb)),this._register(e.documentDropEditProvider.register("*",new jhe)),this._register(e.documentDropEditProvider.register("*",new KR(t)))}};IW=B$([BL(0,Ke),BL(1,Mb)],IW);let NW=class extends ne{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Hb)),this._register(e.documentPasteEditProvider.register("*",new jhe)),this._register(e.documentPasteEditProvider.register("*",new KR(t))),this._register(e.documentPasteEditProvider.register("*",new _je))}};NW=B$([BL(0,Ke),BL(1,Mb)],NW);const ac=class ac{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=ac._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(ac.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(ac.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(ac.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(ac.isVariableCharacter(i)||ac.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 ac._table[i]>"u"&&!ac.isDigitCharacter(i)&&!ac.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};ac._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let TW=ac;class vy{constructor(){this._children=[]}appendChild(e){return e instanceof or&&this._children[this._children.length-1]instanceof or?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 iD)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class or extends vy{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new or(this.value)}}class qhe extends vy{}class yl extends qhe{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 Cy?this._children[0]:void 0}clone(){const e=new yl(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Cy extends vy{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof or&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Cy;return this.options.forEach(e.appendChild,e),e}}class H$ extends vy{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 Gc&&!!o.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Gc){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new H$;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 Gc extends vy{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 Gc(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class WL extends qhe{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 or(t)],!0):!1}clone(){const e=new WL(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Hie(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class iD extends vy{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof yl&&(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 Hie([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof yl&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof WL&&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 iD;return this._children=this.children.map(t=>t.clone()),e}walk(e){Hie(this.children,e)}}class Vb{constructor(){this._scanner=new TW,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 iD;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 yl&&(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 yl(l.index);u.transform=l.transform;for(const f of d){const p=f.clone();u.appendChild(p),p instanceof yl&&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 yl(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 or(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 yl(Number(t)):new WL(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 yl(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new or("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new Cy;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 or(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 WL(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new or("${"+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 H$;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 or(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 Gc(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Gc(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 Gc(Number(n),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Gc(Number(n),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Gc(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 Gc(Number(n),void 0,o,r)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Gc(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new or(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function Khe(s,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new jg(s,{range:i,text:typeof t.insertText=="string"?Vb.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function Ghe(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 bje=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},vje=function(s,e){return function(t,i){e(t,i,s)}};const Cje=xt.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:wae,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),H2=class H2 extends ne{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=De(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=De("span.icon");this.domNode.append(t),t.classList.add(...ut.asClassNameArray(xe.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(ae(this.domNode,Le.CLICK,n=>{this.delegate.cancel()}))}getId(){return H2.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)}};H2.baseId="editor.widget.inlineProgressWidget";let RW=H2,GR=class extends ne{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Os),this._currentWidget=this._register(new Os),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=bp(()=>{const a=M.fromPositions(e);this._currentDecorations.set([{range:a,options:Cje}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(RW,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()}};GR=bje([vje(2,tt)],GR);var wje=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},Vie=function(s,e){return function(t,i){e(t,i,s)}},LN,Yg;let da=(Yg=class{static get(e){return e.getContribution(LN.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Os,this._messageListeners=new he,this._mouseOverMessage=!1,this._editor=e,this._visible=LN.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._message?.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){mr(hd(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=hd(e)?IO(e,{actionHandler:{callback:n=>{this.closeMessage(),oj(this._openerService,n,hd(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new zie(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Ne.debounce(this._editor.onDidBlurEditorText,(n,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Ts(vo(),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(ae(this._messageWidget.value.getDomNode(),Le.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ae(this._messageWidget.value.getDomNode(),Le.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 M(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(zie.fadeOut(this._messageWidget.value))}},LN=Yg,Yg.ID="editor.contrib.messageController",Yg.MESSAGE_VISIBLE=new Be("messageVisible",!1,v("messageVisible","Whether the editor is currently showing an inline message")),Yg);da=LN=wje([Vie(1,ft),Vie(2,zr)],da);const yje=Ls.bindToContribution(da.get);Ae(new yje({id:"leaveEditorMessage",precondition:da.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:130,primary:9}}));let zie=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)}};ri(da.ID,da,4);function B3(s,e){return e&&(s.stack||s.stacktrace)?v("stackTrace.format","{0}: {1}",jie(s),Uie(s.stack)||Uie(s.stacktrace)):jie(s)}function Uie(s){return Array.isArray(s)?s.join(`
|
|
720
720
|
`):s}function jie(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 YR(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=yc(s),i=YR(t[0],e);return t.length>1?v("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Mr(s))return s;if(s.detail){const t=s.detail;if(t.error)return B3(t.error,e);if(t.exception)return B3(t.exception,e)}return s.stack?B3(s,e):s.message?s.message:v("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var Yhe=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},Hw=function(s,e){return function(t,i){e(t,i,s)}},MW,A_;let AW=(A_=class extends ne{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(et(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(et((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(u=>{o.containsPosition(u.position)||this.dispose()})),this._register(Ne.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=De(".post-edit-widget"),this.button=this._register(new tR(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ae(this.domNode,Le.CLICK,()=>this.showSelector()))}getId(){return MW.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Kn(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>f_({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},MW=A_,A_.baseId="editor.widget.postEditWidget",A_);AW=MW=Yhe([Hw(7,ma),Hw(8,ft),Hw(9,Si)],AW);let ZR=class extends ne{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 Os),this._register(Ne.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 w=>{const y=this._editor.getModel();y&&(await y.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:w,allEdits:t.allEdits},i,n,o))},c=(w,y)=>{Vl(w)||(this._notificationService.error(y),i&&this.show(e[0],t,l))};let d;try{d=await n(a,o)}catch(w){return c(w,v("resolveError",`Error resolving edit '{0}':
|