@pasko70/pibo 1.12.0 → 1.13.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.
Files changed (59) hide show
  1. package/dist/apps/chat/chat-trace-helpers.js +59 -2
  2. package/dist/apps/chat/data/timeline-query-service.js +1 -1
  3. package/dist/apps/chat/loop-api.js +5 -0
  4. package/dist/apps/chat/web-app.js +16 -8
  5. package/dist/apps/chat-ui/assets/{dist-D1U9ck8z.js → dist-B_8EcoB6.js} +1 -1
  6. package/dist/apps/{context-files-ui/assets/dist-CT-91DFe.js → chat-ui/assets/dist-CELRUR8b.js} +1 -1
  7. package/dist/apps/{context-files-ui/assets/dist-Bdudyq9I.js → chat-ui/assets/dist-CVLKu7NV.js} +1 -1
  8. package/dist/apps/chat-ui/assets/{dist-DYdgxFZX.js → dist-CVmpu9FK.js} +1 -1
  9. package/dist/apps/{context-files-ui/assets/dist-f2E1-leP.js → chat-ui/assets/dist-CnX234jg.js} +1 -1
  10. package/dist/apps/chat-ui/assets/{dist-D4qbF8wy.js → dist-DVPXynJE.js} +1 -1
  11. package/dist/apps/chat-ui/assets/{dist-B2Pozq2c.js → dist-DugRsLaG.js} +1 -1
  12. package/dist/apps/chat-ui/assets/{dist-DxJWicji.js → dist-KOXty1JB.js} +1 -1
  13. package/dist/apps/chat-ui/assets/{dist-Bgv5Fm3v.js → dist-UYBI2F8E.js} +1 -1
  14. package/dist/apps/chat-ui/assets/{dist-la7ZfDGk.js → dist-XmG4qG-A.js} +1 -1
  15. package/dist/apps/chat-ui/assets/index-DhFQ1th-.js +237 -0
  16. package/dist/apps/chat-ui/assets/index-hjygk9Ol.css +1 -0
  17. package/dist/apps/chat-ui/index.html +2 -2
  18. package/dist/apps/chat-vscode-web/assets/index-1wWonouX.js +41 -0
  19. package/dist/apps/chat-vscode-web/index.html +1 -1
  20. package/dist/apps/{chat-ui/assets/dist-Ci4lft6y.js → context-files-ui/assets/dist-B5mpygOZ.js} +1 -1
  21. package/dist/apps/context-files-ui/assets/{dist-BYcsFgKp.js → dist-BFRDpzcv.js} +1 -1
  22. package/dist/apps/context-files-ui/assets/{dist-DcsDivye.js → dist-BLI6sQZG.js} +1 -1
  23. package/dist/apps/{chat-ui/assets/dist-CkLit_da.js → context-files-ui/assets/dist-B_zXPNMb.js} +1 -1
  24. package/dist/apps/context-files-ui/assets/{dist-uFphVGi8.js → dist-CLrlJjPP.js} +1 -1
  25. package/dist/apps/context-files-ui/assets/{dist-BvIW3V94.js → dist-D6pYe6d_.js} +1 -1
  26. package/dist/apps/{chat-ui/assets/dist-DiPvo4rq.js → context-files-ui/assets/dist-D8ppb7gk.js} +1 -1
  27. package/dist/apps/context-files-ui/assets/{dist-sus90AFR.js → dist-DM6yvMZv.js} +1 -1
  28. package/dist/apps/context-files-ui/assets/{dist-DeozI4lc.js → dist-Em3LWmNi.js} +1 -1
  29. package/dist/apps/context-files-ui/assets/{dist-CSLUWBzz.js → dist-SEP88Pg7.js} +1 -1
  30. package/dist/apps/context-files-ui/assets/{index-CQ25ablG.js → index-C7X2UvWe.js} +3 -3
  31. package/dist/apps/context-files-ui/assets/{index-CukPnd6A.css → index-Cs4XQITe.css} +1 -1
  32. package/dist/apps/context-files-ui/index.html +2 -2
  33. package/dist/apps/vscode-artifacts/latest.vsix +0 -0
  34. package/dist/apps/vscode-artifacts/pibo-vscode-ext-1.13.0.vsix +0 -0
  35. package/dist/core/gateway-resource-guard.js +46 -15
  36. package/dist/core/routed-session.js +40 -1
  37. package/dist/core/runtime.js +2 -0
  38. package/dist/core/session-errors.js +3 -0
  39. package/dist/core/session-router.js +25 -2
  40. package/dist/core/transcript-integrity.js +431 -0
  41. package/dist/data/pibo-store.js +2 -0
  42. package/dist/data/telemetry.js +148 -0
  43. package/dist/debug/index.js +11 -0
  44. package/dist/gateway/server.js +1 -0
  45. package/dist/reliability/store.js +11 -6
  46. package/dist/runs/registry.js +38 -1
  47. package/dist/runs/resource-isolation.js +437 -0
  48. package/dist/runs/tools.js +6 -3
  49. package/dist/sessions/pibo-data-store.js +114 -0
  50. package/dist/shared/trace-engine.js +3 -3
  51. package/dist/shared/trace-event-projection.js +165 -36
  52. package/dist/shared/trace-nodes.js +6 -4
  53. package/dist/shared/trace-page-merge.js +106 -2
  54. package/dist/shared/trace-transcript.js +194 -36
  55. package/package.json +1 -1
  56. package/dist/apps/chat-ui/assets/index-BJoo_GJP.css +0 -1
  57. package/dist/apps/chat-ui/assets/index-CYxPvrxL.js +0 -237
  58. package/dist/apps/chat-vscode-web/assets/index-CFSHKXsQ.js +0 -41
  59. package/dist/apps/vscode-artifacts/pibo-vscode-ext-1.12.0.vsix +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-BYcsFgKp.js","assets/dist-D1KyNDg5.js","assets/dist-QQuDy4KA.js","assets/dist-DcsDivye.js","assets/dist-DKoyMSNr.js","assets/dist-uFphVGi8.js","assets/dist-DotDq_kD.js","assets/dist-CT-91DFe.js","assets/dist-f2E1-leP.js","assets/dist-CSLUWBzz.js","assets/dist-DeozI4lc.js","assets/dist-B5ZAfwf5.js","assets/dist-Bdudyq9I.js","assets/dist-DLMjd26T.js","assets/dist-BkUONE3N.js","assets/dist-B5PTVnox.js","assets/dockerfile-CJb2sekW.js","assets/simple-mode-DnMbQuKW.js","assets/factor-B2EMQZkP.js","assets/nsis-DOo3SJmd.js","assets/pug-QU72BPAa.js","assets/javascript-C5pDVaoP.js","assets/dist-BvIW3V94.js","assets/dist-sus90AFR.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-BFRDpzcv.js","assets/dist-D1KyNDg5.js","assets/dist-QQuDy4KA.js","assets/dist-BLI6sQZG.js","assets/dist-DKoyMSNr.js","assets/dist-CLrlJjPP.js","assets/dist-DotDq_kD.js","assets/dist-B_zXPNMb.js","assets/dist-B5mpygOZ.js","assets/dist-SEP88Pg7.js","assets/dist-Em3LWmNi.js","assets/dist-B5ZAfwf5.js","assets/dist-D8ppb7gk.js","assets/dist-DLMjd26T.js","assets/dist-BkUONE3N.js","assets/dist-B5PTVnox.js","assets/dockerfile-CJb2sekW.js","assets/simple-mode-DnMbQuKW.js","assets/factor-B2EMQZkP.js","assets/nsis-DOo3SJmd.js","assets/pug-QU72BPAa.js","assets/javascript-C5pDVaoP.js","assets/dist-D6pYe6d_.js","assets/dist-DM6yvMZv.js"])))=>i.map(i=>d[i]);
2
2
  import{$ as e,A as t,At as n,B as r,Bt as i,C as a,Ct as o,D as s,Dt as c,E as l,Et as u,F as d,Ft as f,G as p,H as m,I as h,It as g,J as _,K as v,L as y,Lt as b,M as x,Mt as S,N as C,Nt as w,O as T,Ot as E,P as ee,Pt as D,Q as O,R as k,Rt as A,S as j,St as M,T as N,Tt as te,U as ne,V as re,Vt as ie,W as ae,X as oe,Y as P,Z as se,_ as ce,_t as le,a as ue,at as de,b as fe,bt as pe,c as me,ct as he,d as ge,dt as _e,et as ve,f as ye,ft as be,g as xe,gt as Se,h as Ce,ht as we,i as Te,it as Ee,j as De,jt as Oe,k as ke,kt as Ae,l as F,lt as je,m as Me,mt as Ne,n as Pe,nt as Fe,o as Ie,ot as Le,p as Re,pt as ze,q as Be,r as Ve,rt as He,s as Ue,st as We,t as Ge,tt as Ke,u as qe,ut as Je,v as Ye,vt as Xe,w as Ze,wt as I,x as Qe,xt as $e,y as et,yt as tt,z as nt,zt as rt}from"./dist-D1KyNDg5.js";var it=Object.create,at=Object.defineProperty,ot=Object.getOwnPropertyDescriptor,st=Object.getOwnPropertyNames,ct=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty,ut=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),dt=(e,t)=>{let n={};for(var r in e)at(n,r,{get:e[r],enumerable:!0});return t||at(n,Symbol.toStringTag,{value:`Module`}),n},ft=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=st(t),a=0,o=i.length,s;a<o;a++)s=i[a],!lt.call(e,s)&&s!==n&&at(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ot(t,s))||r.enumerable});return e},pt=(e,t,n)=>(n=e==null?{}:it(ct(e)),ft(t||!e||!e.__esModule?at(n,`default`,{value:e,enumerable:!0}):n,e));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var mt=ut((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ne=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},re={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=re,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),ht=ut(((e,t)=>{t.exports=mt()})),gt=ut((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=ee,D=function(){k.postMessage(null)}}else D=function(){_(ee,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),_t=ut(((e,t)=>{t.exports=gt()})),vt=ut((e=>{var t=ht();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),yt=ut(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=vt()})),bt=ut((e=>{var t=_t(),n=ht(),r=yt();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),D=Symbol.iterator;function O(e){return typeof e!=`object`||!e?null:(e=D&&e[D]||e[`@@iterator`],typeof e==`function`?e:null)}var k=Symbol.for(`react.client.reference`);function A(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?A(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return A(e(t))}catch{}}return null}var j=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function oe(e,t){re++,ne[re]=e.current,e.current=t}var P=ie(null),se=ie(null),ce=ie(null),le=ie(null);function ue(e,t){switch(oe(ce,t),oe(se,e),oe(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jd(t),e=Yd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(P),oe(P,e)}function de(){ae(P),ae(se),ae(ce)}function fe(e){e.memoizedState!==null&&oe(le,e);var t=P.current,n=Yd(t,e.type);t!==n&&(oe(se,e),oe(P,n))}function pe(e){se.current===e&&(ae(P),ae(se)),le.current===e&&(ae(le),ip._currentValue=te)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -183,7 +183,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
183
183
  \${}
184
184
  }`,{label:`interface`,detail:`definition`,type:`keyword`}),AG("type ${name} = ${type}",{label:`type`,detail:`definition`,type:`keyword`}),AG(`enum \${name} {
185
185
  \${}
186
- }`,{label:`enum`,detail:`definition`,type:`keyword`})]),SZ=new ne,CZ=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function wZ(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var TZ=[`FunctionDeclaration`],EZ={FunctionDeclaration:wZ(`function`),ClassDeclaration:wZ(`class`),ClassExpression:()=>!0,EnumDeclaration:wZ(`constant`),TypeAliasDeclaration:wZ(`type`),NamespaceDeclaration:wZ(`namespace`),VariableDefinition(e,t){e.matchContext(TZ)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function DZ(e,t){let n=SZ.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(nt.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=EZ[t.name];if(e&&e(t,a)||CZ.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of DZ(e,t.node))r.push(n);return!1}}),SZ.set(t,r),r}var OZ=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,kZ=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function AZ(e){let t=d(e.state).resolveInner(e.pos,-1);if(kZ.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&OZ.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)CZ.has(n.name)&&(r=r.concat(DZ(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:OZ}}var jZ=Ue.define({name:`javascript`,parser:vZ.configure({props:[s.add({IfStatement:Ce({except:/^\s*({|else\b)/}),TryStatement:Ce({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:et,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Ye({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ce({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),a.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Qe,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),MZ={test:e=>/^JSX/.test(e.name),facet:ce({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},NZ=jZ.configure({dialect:`ts`},`typescript`),PZ=jZ.configure({dialect:`jsx`,props:[C.add(e=>e.isTop?[MZ]:void 0)]}),FZ=jZ.configure({dialect:`jsx ts`,props:[C.add(e=>e.isTop?[MZ]:void 0)]},`typescript`),IZ=e=>({label:e,type:`keyword`}),LZ=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(IZ),RZ=LZ.concat([`declare`,`implements`,`private`,`protected`,`public`].map(IZ));function zZ(e={}){let t=e.jsx?e.typescript?FZ:PZ:e.typescript?NZ:jZ,n=e.typescript?xZ.concat(RZ):bZ.concat(LZ);return new qe(t,[jZ.data.of({autocomplete:bW(kZ,yW(n))}),jZ.data.of({autocomplete:AZ}),e.jsx?UZ:[]])}function BZ(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function VZ(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var HZ=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),UZ=P.inputHandler.of((e,t,n,r,i)=>{if((HZ?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!jZ.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=d(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=VZ(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:I.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=BZ(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=VZ(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),WZ=dt({autoCloseTags:()=>xQ,html:()=>yQ,htmlCompletionSource:()=>fQ,htmlCompletionSourceWith:()=>pQ,htmlLanguage:()=>vQ}),GZ=[`_blank`,`_self`,`_top`,`_parent`],KZ=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],qZ=[`get`,`post`,`put`,`delete`],JZ=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],YZ=[`true`,`false`],XZ={},ZZ={a:{attrs:{href:null,ping:null,type:null,media:null,target:GZ,hreflang:null}},abbr:XZ,address:XZ,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:XZ,aside:XZ,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:XZ,base:{attrs:{href:null,target:GZ}},bdi:XZ,bdo:XZ,blockquote:{attrs:{cite:null}},body:XZ,br:XZ,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:JZ,formmethod:qZ,formnovalidate:[`novalidate`],formtarget:GZ,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:XZ,center:XZ,cite:XZ,code:XZ,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:XZ,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:XZ,div:XZ,dl:XZ,dt:XZ,em:XZ,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:XZ,figure:XZ,footer:XZ,form:{attrs:{action:null,name:null,"accept-charset":KZ,autocomplete:[`on`,`off`],enctype:JZ,method:qZ,novalidate:[`novalidate`],target:GZ}},h1:XZ,h2:XZ,h3:XZ,h4:XZ,h5:XZ,h6:XZ,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:XZ,hgroup:XZ,hr:XZ,html:{attrs:{manifest:null}},i:XZ,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:JZ,formmethod:qZ,formnovalidate:[`novalidate`],formtarget:GZ,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:XZ,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:XZ,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:XZ,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:KZ,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:XZ,noscript:XZ,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:XZ,param:{attrs:{name:null,value:null}},pre:XZ,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:XZ,rt:XZ,ruby:XZ,samp:XZ,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:KZ}},section:XZ,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:XZ,source:{attrs:{src:null,type:null,media:null}},span:XZ,strong:XZ,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:XZ,summary:XZ,sup:XZ,table:XZ,tbody:XZ,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:XZ,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:XZ,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:XZ,time:{attrs:{datetime:null}},title:XZ,tr:XZ,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:XZ,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:XZ},QZ={accesskey:null,class:null,contenteditable:YZ,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:YZ,autocorrect:YZ,autocapitalize:YZ,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":YZ,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":YZ,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":YZ,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":YZ,"aria-hidden":YZ,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":YZ,"aria-multiselectable":YZ,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":YZ,"aria-relevant":null,"aria-required":YZ,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},$Z=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of $Z)QZ[e]=null;var eQ=class{constructor(e,t){this.tags={...ZZ,...e},this.globalAttrs={...QZ,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};eQ.default=new eQ;function tQ(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function nQ(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function rQ(e,t,n){return n.tags[tQ(e,nQ(t))]?.children||n.allTags}function iQ(e,t){let n=[];for(let r=nQ(t);r&&!r.type.isTop;r=nQ(r.parent)){let i=tQ(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var aQ=/^[:\-\.\w\u00b7-\uffff]*$/;function oQ(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=nQ(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:rQ(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(iQ(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function sQ(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:iQ(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:aQ}}function cQ(e,t,n,r){let i=[],a=0;for(let r of rQ(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of iQ(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function lQ(e,t,n,r,i){let a=nQ(n),o=a?t.tags[tQ(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:aQ}}function uQ(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=nQ(n),i=r?t.tags[tQ(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function dQ(e,t){let{state:n,pos:r}=t,i=d(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?sQ(n,i,i.from,r):oQ(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?oQ(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?sQ(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?lQ(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?uQ(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?cQ(n,e,i,r):null}function fQ(e){return dQ(eQ.default,e)}function pQ(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new eQ(t,n):eQ.default;return e=>dQ(r,e)}var mQ=jZ.parser.configure({top:`SingleExpression`}),hQ=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:NZ.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:PZ.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:FZ.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:mQ},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:jZ.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:TY.parser}],gQ=[{name:`style`,parser:TY.parser.configure({top:`Styles`})}].concat($Z.map(e=>({name:e,parser:jZ.parser}))),_Q=Ue.define({name:`html`,parser:MX.configure({props:[s.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),a.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),Me.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),vQ=_Q.configure({wrap:IX(hQ,gQ)});function yQ(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=IX((e.nestedLanguages||[]).concat(hQ),(e.nestedAttributes||[]).concat(gQ))),new qe(n?_Q.configure({wrap:n,dialect:t}):t?vQ.configure({dialect:t}):vQ,[vQ.data.of({autocomplete:pQ(e)}),e.autoCloseTags===!1?[]:xQ,zZ().support,EY().support])}var bQ=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),xQ=P.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!vQ.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=d(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=tQ(o.doc,t.parent,n))&&!bQ.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=tQ(o.doc,e,n))&&!bQ.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:I.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)});function SQ(e,t,n,r){let i=xn(kb),a=Cn(yx),o=L.useRef(null),{lexicalNode:s}=nW(),c=L.useRef(!1),l=L.useRef(!1),u=L.useCallback(()=>{a({editorType:t,rootNode:s,editorRef:o.current})},[t,s,a]),d=L.useCallback(t=>{if(t.key===`ArrowDown`){let t=o.current?.getCodemirror()?.state;t&&t.doc.length===t.selection.ranges[0].to&&(c.current?(i?.update(()=>{var t;let n=mc(e);n.getNextSibling()?((t=o.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectNext()):n.insertAfter(zs())}),c.current=!1):c.current=!0)}else if(t.key===`ArrowUp`){let t=o.current?.getCodemirror()?.state;t&&t.selection.ranges[0].from===0&&(l.current?(i?.update(()=>{var t;let n=mc(e);n.getPreviousSibling()&&((t=o.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectPrevious())}),l.current=!1):l.current=!0)}else t.key===`Enter`?t.stopPropagation():(t.key===`Backspace`||t.key===`Delete`)&&(o.current?.getCodemirror()?.state)?.doc.length===0&&i?.update(()=>{mc(e).remove()})},[i,e]);return L.useEffect(()=>{let e=o.current;return setTimeout(()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.addEventListener(`focus`,u),(n=e?.getCodemirror())==null||n.contentDOM.addEventListener(`keydown`,d)},300),()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.removeEventListener(`focus`,u),(n=e?.getCodemirror())==null||n.contentDOM.removeEventListener(`keydown`,d)}},[o,u,d,n]),L.useEffect(()=>{r.subscribe(()=>{var e;(e=o.current?.getCodemirror())==null||e.focus(),u()})},[r,o,e,u]),o}function Q(e){return new qe(ye.define(e))}function CQ(e){return Z(()=>import(`./dist-BYcsFgKp.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1]))}var wQ=[F.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return Z(()=>import(`./dist-QQuDy4KA.js`).then(e=>e.cpp()),__vite__mapDeps([2,1]))}}),F.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return Z(()=>import(`./dist-QQuDy4KA.js`).then(e=>e.cpp()),__vite__mapDeps([2,1]))}}),F.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return CQ(`Cassandra`)}}),F.of({name:`CSS`,extensions:[`css`],load(){return Z(()=>Promise.resolve().then(()=>lY).then(e=>e.css()),void 0)}}),F.of({name:`Go`,extensions:[`go`],load(){return Z(()=>import(`./dist-DcsDivye.js`).then(e=>e.go()),__vite__mapDeps([3,1]))}}),F.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return Z(()=>Promise.resolve().then(()=>WZ).then(e=>e.html()),void 0)}}),F.of({name:`Java`,extensions:[`java`],load(){return Z(()=>import(`./dist-DKoyMSNr.js`).then(e=>e.java()),__vite__mapDeps([4,1]))}}),F.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return Z(()=>Promise.resolve().then(()=>yZ).then(e=>e.javascript()),void 0)}}),F.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return Z(()=>import(`./dist-uFphVGi8.js`).then(e=>e.jinja()),__vite__mapDeps([5,1]))}}),F.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return Z(()=>import(`./dist-DotDq_kD.js`).then(e=>e.json()),__vite__mapDeps([6,1]))}}),F.of({name:`JSX`,extensions:[`jsx`],load(){return Z(()=>Promise.resolve().then(()=>yZ).then(e=>e.javascript({jsx:!0})),void 0)}}),F.of({name:`LESS`,extensions:[`less`],load(){return Z(()=>import(`./dist-CT-91DFe.js`).then(e=>e.less()),__vite__mapDeps([7,1]))}}),F.of({name:`Liquid`,extensions:[`liquid`],load(){return Z(()=>import(`./dist-f2E1-leP.js`).then(e=>e.liquid()),__vite__mapDeps([8,1]))}}),F.of({name:`MariaDB SQL`,load(){return CQ(`MariaSQL`)}}),F.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return Z(()=>Promise.resolve().then(()=>B8).then(e=>e.markdown()),void 0)}}),F.of({name:`MS SQL`,load(){return CQ(`MSSQL`)}}),F.of({name:`MySQL`,load(){return CQ(`MySQL`)}}),F.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return Z(()=>import(`./dist-CSLUWBzz.js`).then(e=>e.php()),__vite__mapDeps([9,1]))}}),F.of({name:`PLSQL`,extensions:[`pls`],load(){return CQ(`PLSQL`)}}),F.of({name:`PostgreSQL`,load(){return CQ(`PostgreSQL`)}}),F.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return Z(()=>import(`./dist-DeozI4lc.js`).then(e=>e.python()),__vite__mapDeps([10,1]))}}),F.of({name:`Rust`,extensions:[`rs`],load(){return Z(()=>import(`./dist-B5ZAfwf5.js`).then(e=>e.rust()),__vite__mapDeps([11,1]))}}),F.of({name:`Sass`,extensions:[`sass`],load(){return Z(()=>import(`./dist-Bdudyq9I.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([12,1]))}}),F.of({name:`SCSS`,extensions:[`scss`],load(){return Z(()=>import(`./dist-Bdudyq9I.js`).then(e=>e.sass()),__vite__mapDeps([12,1]))}}),F.of({name:`SQL`,extensions:[`sql`],load(){return CQ(`StandardSQL`)}}),F.of({name:`SQLite`,load(){return CQ(`SQLite`)}}),F.of({name:`TSX`,extensions:[`tsx`],load(){return Z(()=>Promise.resolve().then(()=>yZ).then(e=>e.javascript({jsx:!0,typescript:!0})),void 0)}}),F.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return Z(()=>Promise.resolve().then(()=>yZ).then(e=>e.javascript({typescript:!0})),void 0)}}),F.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return Z(()=>import(`./dist-DLMjd26T.js`).then(e=>e.wast()),__vite__mapDeps([13,1]))}}),F.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return Z(()=>import(`./dist-BkUONE3N.js`).then(e=>e.xml()),__vite__mapDeps([14,1]))}}),F.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return Z(()=>import(`./dist-B5PTVnox.js`).then(e=>e.yaml()),__vite__mapDeps([15,1]))}}),F.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return Z(()=>import(`./apl-14BqhLYK.js`).then(e=>Q(e.apl)),[])}}),F.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return Z(()=>import(`./asciiarmor-WLvjqI7d.js`).then(e=>Q(e.asciiArmor)),[])}}),F.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return Z(()=>import(`./asn1-Bg4FbdCg.js`).then(e=>Q(e.asn1({}))),[])}}),F.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return Z(()=>import(`./asterisk-B2MO-X4d.js`).then(e=>Q(e.asterisk)),[])}}),F.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return Z(()=>import(`./brainfuck-CV9kufud.js`).then(e=>Q(e.brainfuck)),[])}}),F.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return Z(()=>import(`./cobol-BwO6DF08.js`).then(e=>Q(e.cobol)),[])}}),F.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.csharp)),[])}}),F.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return Z(()=>import(`./clojure-De3QGfx6.js`).then(e=>Q(e.clojure)),[])}}),F.of({name:`ClojureScript`,extensions:[`cljs`],load(){return Z(()=>import(`./clojure-De3QGfx6.js`).then(e=>Q(e.clojure)),[])}}),F.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return Z(()=>import(`./css-CbMZAQ1W.js`).then(e=>Q(e.gss)),[])}}),F.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return Z(()=>import(`./cmake-i2VDNaRq.js`).then(e=>Q(e.cmake)),[])}}),F.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return Z(()=>import(`./coffeescript-BtivDvRz.js`).then(e=>Q(e.coffeeScript)),[])}}),F.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return Z(()=>import(`./commonlisp-DFkEQdLP.js`).then(e=>Q(e.commonLisp)),[])}}),F.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return Z(()=>import(`./cypher-Dke5QOzv.js`).then(e=>Q(e.cypher)),[])}}),F.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return Z(()=>import(`./python-Cs7sNzy_.js`).then(e=>Q(e.cython)),[])}}),F.of({name:`Crystal`,extensions:[`cr`],load(){return Z(()=>import(`./crystal-CU0NkcVL.js`).then(e=>Q(e.crystal)),[])}}),F.of({name:`D`,extensions:[`d`],load(){return Z(()=>import(`./d-TPqSVaHM.js`).then(e=>Q(e.d)),[])}}),F.of({name:`Dart`,extensions:[`dart`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.dart)),[])}}),F.of({name:`diff`,extensions:[`diff`,`patch`],load(){return Z(()=>import(`./diff-B365LSoZ.js`).then(e=>Q(e.diff)),[])}}),F.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return Z(()=>import(`./dockerfile-CJb2sekW.js`).then(e=>Q(e.dockerFile)),__vite__mapDeps([16,17]))}}),F.of({name:`DTD`,extensions:[`dtd`],load(){return Z(()=>import(`./dtd-CBMymJ7O.js`).then(e=>Q(e.dtd)),[])}}),F.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return Z(()=>import(`./dylan-08Azy1NK.js`).then(e=>Q(e.dylan)),[])}}),F.of({name:`EBNF`,load(){return Z(()=>import(`./ebnf-Dkum_1J8.js`).then(e=>Q(e.ebnf)),[])}}),F.of({name:`ECL`,extensions:[`ecl`],load(){return Z(()=>import(`./ecl-dhxjHL8y.js`).then(e=>Q(e.ecl)),[])}}),F.of({name:`edn`,extensions:[`edn`],load(){return Z(()=>import(`./clojure-De3QGfx6.js`).then(e=>Q(e.clojure)),[])}}),F.of({name:`Eiffel`,extensions:[`e`],load(){return Z(()=>import(`./eiffel-C446m6dI.js`).then(e=>Q(e.eiffel)),[])}}),F.of({name:`Elm`,extensions:[`elm`],load(){return Z(()=>import(`./elm-po1E9de0.js`).then(e=>Q(e.elm)),[])}}),F.of({name:`Erlang`,extensions:[`erl`],load(){return Z(()=>import(`./erlang-BD5LkVkR.js`).then(e=>Q(e.erlang)),[])}}),F.of({name:`Esper`,load(){return Z(()=>import(`./sql-DYI2GwJR.js`).then(e=>Q(e.esper)),[])}}),F.of({name:`Factor`,extensions:[`factor`],load(){return Z(()=>import(`./factor-B2EMQZkP.js`).then(e=>Q(e.factor)),__vite__mapDeps([18,17]))}}),F.of({name:`FCL`,load(){return Z(()=>import(`./fcl-DkEOamHd.js`).then(e=>Q(e.fcl)),[])}}),F.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return Z(()=>import(`./forth-dCg2_HVB.js`).then(e=>Q(e.forth)),[])}}),F.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return Z(()=>import(`./fortran-3ZpXLFh1.js`).then(e=>Q(e.fortran)),[])}}),F.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return Z(()=>import(`./mllike-Cw3Iccsb.js`).then(e=>Q(e.fSharp)),[])}}),F.of({name:`Gas`,extensions:[`s`],load(){return Z(()=>import(`./gas-DMmxLZRI.js`).then(e=>Q(e.gas)),[])}}),F.of({name:`Gherkin`,extensions:[`feature`],load(){return Z(()=>import(`./gherkin-DUSFg2R6.js`).then(e=>Q(e.gherkin)),[])}}),F.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return Z(()=>import(`./groovy-Cmduloe1.js`).then(e=>Q(e.groovy)),[])}}),F.of({name:`Haskell`,extensions:[`hs`],load(){return Z(()=>import(`./haskell-Cyr255R9.js`).then(e=>Q(e.haskell)),[])}}),F.of({name:`Haxe`,extensions:[`hx`],load(){return Z(()=>import(`./haxe-BJVKtprM.js`).then(e=>Q(e.haxe)),[])}}),F.of({name:`HXML`,extensions:[`hxml`],load(){return Z(()=>import(`./haxe-BJVKtprM.js`).then(e=>Q(e.hxml)),[])}}),F.of({name:`HTTP`,load(){return Z(()=>import(`./http-DszHFpc-.js`).then(e=>Q(e.http)),[])}}),F.of({name:`IDL`,extensions:[`pro`],load(){return Z(()=>import(`./idl-Cati9Nrv.js`).then(e=>Q(e.idl)),[])}}),F.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return Z(()=>import(`./javascript-C5pDVaoP.js`).then(e=>Q(e.jsonld)),[])}}),F.of({name:`Julia`,extensions:[`jl`],load(){return Z(()=>import(`./julia-DlqY1cTU.js`).then(e=>Q(e.julia)),[])}}),F.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.kotlin)),[])}}),F.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return Z(()=>import(`./livescript-C6p8-2W1.js`).then(e=>Q(e.liveScript)),[])}}),F.of({name:`Lua`,extensions:[`lua`],load(){return Z(()=>import(`./lua-BxuTHaF7.js`).then(e=>Q(e.lua)),[])}}),F.of({name:`mIRC`,extensions:[`mrc`],load(){return Z(()=>import(`./mirc-CCA0FRfl.js`).then(e=>Q(e.mirc)),[])}}),F.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return Z(()=>import(`./mathematica-nDHZUMJT.js`).then(e=>Q(e.mathematica)),[])}}),F.of({name:`Modelica`,extensions:[`mo`],load(){return Z(()=>import(`./modelica-Czx80fNR.js`).then(e=>Q(e.modelica)),[])}}),F.of({name:`MUMPS`,extensions:[`mps`],load(){return Z(()=>import(`./mumps-Ds_ZaumL.js`).then(e=>Q(e.mumps)),[])}}),F.of({name:`Mbox`,extensions:[`mbox`],load(){return Z(()=>import(`./mbox-DAaR0Hcz.js`).then(e=>Q(e.mbox)),[])}}),F.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return Z(()=>import(`./nginx-D9M2PQ4U.js`).then(e=>Q(e.nginx)),[])}}),F.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return Z(()=>import(`./nsis-DOo3SJmd.js`).then(e=>Q(e.nsis)),__vite__mapDeps([19,17]))}}),F.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return Z(()=>import(`./ntriples-DLHGTvHs.js`).then(e=>Q(e.ntriples)),[])}}),F.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.objectiveC)),[])}}),F.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.objectiveCpp)),[])}}),F.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return Z(()=>import(`./mllike-Cw3Iccsb.js`).then(e=>Q(e.oCaml)),[])}}),F.of({name:`Octave`,extensions:[`m`],load(){return Z(()=>import(`./octave-8jj96JiC.js`).then(e=>Q(e.octave)),[])}}),F.of({name:`Oz`,extensions:[`oz`],load(){return Z(()=>import(`./oz-BmMq7iC4.js`).then(e=>Q(e.oz)),[])}}),F.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return Z(()=>import(`./pascal-BgMr6XpT.js`).then(e=>Q(e.pascal)),[])}}),F.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return Z(()=>import(`./perl-D6YJObi_.js`).then(e=>Q(e.perl)),[])}}),F.of({name:`Pig`,extensions:[`pig`],load(){return Z(()=>import(`./pig-nx7uchs8.js`).then(e=>Q(e.pig)),[])}}),F.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return Z(()=>import(`./powershell-B4IPkVxR.js`).then(e=>Q(e.powerShell)),[])}}),F.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return Z(()=>import(`./properties-CoavQdLC.js`).then(e=>Q(e.properties)),[])}}),F.of({name:`ProtoBuf`,extensions:[`proto`],load(){return Z(()=>import(`./protobuf-D5EWhcmc.js`).then(e=>Q(e.protobuf)),[])}}),F.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return Z(()=>import(`./pug-QU72BPAa.js`).then(e=>Q(e.pug)),__vite__mapDeps([20,21]))}}),F.of({name:`Puppet`,extensions:[`pp`],load(){return Z(()=>import(`./puppet-B_0GFuyD.js`).then(e=>Q(e.puppet)),[])}}),F.of({name:`Q`,extensions:[`q`],load(){return Z(()=>import(`./q-BIB9pPtI.js`).then(e=>Q(e.q)),[])}}),F.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return Z(()=>import(`./r-CN5s4f3o.js`).then(e=>Q(e.r)),[])}}),F.of({name:`RPM Changes`,load(){return Z(()=>import(`./rpm-Ct_Ck8mQ.js`).then(e=>Q(e.rpmChanges)),[])}}),F.of({name:`RPM Spec`,extensions:[`spec`],load(){return Z(()=>import(`./rpm-Ct_Ck8mQ.js`).then(e=>Q(e.rpmSpec)),[])}}),F.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return Z(()=>import(`./ruby-BVPradRk.js`).then(e=>Q(e.ruby)),[])}}),F.of({name:`SAS`,extensions:[`sas`],load(){return Z(()=>import(`./sas-DN4j74IF.js`).then(e=>Q(e.sas)),[])}}),F.of({name:`Scala`,extensions:[`scala`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.scala)),[])}}),F.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return Z(()=>import(`./scheme-CvNgHAnh.js`).then(e=>Q(e.scheme)),[])}}),F.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return Z(()=>import(`./shell-BjiMLAaM.js`).then(e=>Q(e.shell)),[])}}),F.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return Z(()=>import(`./sieve-C2U1O5Z4.js`).then(e=>Q(e.sieve)),[])}}),F.of({name:`Smalltalk`,extensions:[`st`],load(){return Z(()=>import(`./smalltalk-DkYwYufV.js`).then(e=>Q(e.smalltalk)),[])}}),F.of({name:`Solr`,load(){return Z(()=>import(`./solr-BopnSD-v.js`).then(e=>Q(e.solr)),[])}}),F.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return Z(()=>import(`./mllike-Cw3Iccsb.js`).then(e=>Q(e.sml)),[])}}),F.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return Z(()=>import(`./sparql-Cpg3YQfd.js`).then(e=>Q(e.sparql)),[])}}),F.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return Z(()=>import(`./spreadsheet-kRxtVt9J.js`).then(e=>Q(e.spreadsheet)),[])}}),F.of({name:`Squirrel`,extensions:[`nut`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.squirrel)),[])}}),F.of({name:`Stylus`,extensions:[`styl`],load(){return Z(()=>import(`./stylus-CARoeVE9.js`).then(e=>Q(e.stylus)),[])}}),F.of({name:`Swift`,extensions:[`swift`],load(){return Z(()=>import(`./swift-DKNaLAK6.js`).then(e=>Q(e.swift)),[])}}),F.of({name:`sTeX`,load(){return Z(()=>import(`./stex-BCRT8IJ3.js`).then(e=>Q(e.stex)),[])}}),F.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return Z(()=>import(`./stex-BCRT8IJ3.js`).then(e=>Q(e.stex)),[])}}),F.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return Z(()=>import(`./verilog-DVCHmufx.js`).then(e=>Q(e.verilog)),[])}}),F.of({name:`Tcl`,extensions:[`tcl`],load(){return Z(()=>import(`./tcl-CQyXkgMH.js`).then(e=>Q(e.tcl)),[])}}),F.of({name:`Textile`,extensions:[`textile`],load(){return Z(()=>import(`./textile-Yg_UWn-t.js`).then(e=>Q(e.textile)),[])}}),F.of({name:`TiddlyWiki`,load(){return Z(()=>import(`./tiddlywiki-dqVbkfX4.js`).then(e=>Q(e.tiddlyWiki)),[])}}),F.of({name:`Tiki wiki`,load(){return Z(()=>import(`./tiki-CC_ic8g0.js`).then(e=>Q(e.tiki)),[])}}),F.of({name:`TOML`,extensions:[`toml`],load(){return Z(()=>import(`./toml-B7gGzVkJ.js`).then(e=>Q(e.toml)),[])}}),F.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return Z(()=>import(`./troff-Bq3z6oAu.js`).then(e=>Q(e.troff)),[])}}),F.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return Z(()=>import(`./ttcn-GvRgs2AT.js`).then(e=>Q(e.ttcn)),[])}}),F.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return Z(()=>import(`./ttcn-cfg-CGCXz7Vo.js`).then(e=>Q(e.ttcnCfg)),[])}}),F.of({name:`Turtle`,extensions:[`ttl`],load(){return Z(()=>import(`./turtle-CwIpz2yy.js`).then(e=>Q(e.turtle)),[])}}),F.of({name:`Web IDL`,extensions:[`webidl`],load(){return Z(()=>import(`./webidl-egXQEWlC.js`).then(e=>Q(e.webIDL)),[])}}),F.of({name:`VB.NET`,extensions:[`vb`],load(){return Z(()=>import(`./vb-BmcHUM2C.js`).then(e=>Q(e.vb)),[])}}),F.of({name:`VBScript`,extensions:[`vbs`],load(){return Z(()=>import(`./vbscript-Cs9dylre.js`).then(e=>Q(e.vbScript)),[])}}),F.of({name:`Velocity`,extensions:[`vtl`],load(){return Z(()=>import(`./velocity-CBWU0VCy.js`).then(e=>Q(e.velocity)),[])}}),F.of({name:`Verilog`,extensions:[`v`],load(){return Z(()=>import(`./verilog-DVCHmufx.js`).then(e=>Q(e.verilog)),[])}}),F.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return Z(()=>import(`./vhdl-BGDk4f1d.js`).then(e=>Q(e.vhdl)),[])}}),F.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return Z(()=>import(`./xquery-5f0hn7cg.js`).then(e=>Q(e.xQuery)),[])}}),F.of({name:`Yacas`,extensions:[`ys`],load(){return Z(()=>import(`./yacas-DNs9XkmQ.js`).then(e=>Q(e.yacas)),[])}}),F.of({name:`Z80`,extensions:[`z80`],load(){return Z(()=>import(`./z80-B7Dfb4UO.js`).then(e=>Q(e.z80)),[])}}),F.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return Z(()=>import(`./mscgen-BmfuTbzG.js`).then(e=>Q(e.mscgen)),[])}}),F.of({name:`Xù`,extensions:[`xu`],load(){return Z(()=>import(`./mscgen-BmfuTbzG.js`).then(e=>Q(e.xu)),[])}}),F.of({name:`MsGenny`,extensions:[`msgenny`],load(){return Z(()=>import(`./mscgen-BmfuTbzG.js`).then(e=>Q(e.msgenny)),[])}}),F.of({name:`Vue`,extensions:[`vue`],load(){return Z(()=>import(`./dist-BvIW3V94.js`).then(e=>e.vue()),__vite__mapDeps([22,1]))}}),F.of({name:`Angular Template`,load(){return Z(()=>import(`./dist-sus90AFR.js`).then(e=>e.angular()),__vite__mapDeps([23,1]))}})],TQ=`#2e3440`,EQ=`#3b4252`,DQ=`#434c5e`,OQ=`#4c566a`,kQ=`#e5e9f0`,AQ=`#eceff4`,jQ=`#8fbcbb`,MQ=`#88c0d0`,NQ=`#81a1c1`,PQ=`#5e81ac`,FQ=`#bf616a`,IQ=`#d08770`,LQ=`#ebcb8b`,RQ=`#a3be8c`,zQ=`#b48ead`,BQ=`#d30102`,VQ=AQ,HQ=VQ,UQ=`#ffffff`,WQ=EQ,GQ=VQ,KQ=EQ,qQ=[P.theme({"&":{color:TQ,backgroundColor:UQ},".cm-content":{caretColor:KQ},".cm-cursor, .cm-dropCursor":{borderLeftColor:KQ},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:GQ},".cm-panels":{backgroundColor:VQ,color:OQ},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid ${OQ}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:kQ},".cm-activeLine":{backgroundColor:HQ},".cm-selectionMatch":{backgroundColor:kQ},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${OQ}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:AQ},".cm-gutters":{backgroundColor:AQ,color:TQ,border:`none`},".cm-activeLineGutter":{backgroundColor:HQ},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:WQ},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:WQ,borderBottomColor:WQ},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:HQ,color:OQ}}},{dark:!1}),ee(ue.define([{tag:k.keyword,color:PQ},{tag:[k.name,k.deleted,k.character,k.propertyName,k.macroName],color:IQ},{tag:[k.variableName],color:IQ},{tag:[k.function(k.variableName)],color:PQ},{tag:[k.labelName],color:NQ},{tag:[k.color,k.constant(k.name),k.standard(k.name)],color:PQ},{tag:[k.definition(k.name),k.separator],color:RQ},{tag:[k.brace],color:jQ},{tag:[k.annotation],color:BQ},{tag:[k.number,k.changed,k.annotation,k.modifier,k.self,k.namespace],color:MQ},{tag:[k.typeName,k.className],color:LQ},{tag:[k.operator,k.operatorKeyword],color:RQ},{tag:[k.tagName],color:zQ},{tag:[k.squareBracket],color:FQ},{tag:[k.angleBracket],color:IQ},{tag:[k.attributeName],color:LQ},{tag:[k.regexp],color:PQ},{tag:[k.quote],color:EQ},{tag:[k.string],color:IQ},{tag:k.link,color:jQ,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[k.url,k.escape,k.special(k.string)],color:IQ},{tag:[k.meta],color:MQ},{tag:[k.comment],color:DQ,fontStyle:`italic`},{tag:k.strong,fontWeight:`bold`,color:PQ},{tag:k.emphasis,fontStyle:`italic`,color:PQ},{tag:k.strikethrough,textDecoration:`line-through`},{tag:k.heading,fontWeight:`bold`,color:PQ},{tag:k.special(k.heading1),fontWeight:`bold`,color:PQ},{tag:k.heading1,fontWeight:`bold`,color:PQ},{tag:[k.heading2,k.heading3,k.heading4],fontWeight:`bold`,color:PQ},{tag:[k.heading5,k.heading6],color:PQ},{tag:[k.atom,k.bool,k.special(k.variableName)],color:IQ},{tag:[k.processingInstruction,k.inserted],color:jQ},{tag:[k.contentSeparator],color:LQ},{tag:k.invalid,color:DQ,borderBottom:`1px dotted ${BQ}`}]))],JQ=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,YQ=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(JQ(e)):JQ,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return g(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ie(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=b(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(YQ.prototype[Symbol.iterator]=function(){return this});var XQ={from:-1,to:-1,match:/.*/.exec(``),precise:!0},ZQ=`gm`+(/x/.unicode==null?``:`u`),QQ=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=XQ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new t$(e,t,n,r,i);this.re=new RegExp(t,ZQ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=r$(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=r$(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},$Q=new WeakMap,e$=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=$Q.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return $Q.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),$Q.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},t$=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=XQ,this.matchPos=r$(e,r),this.re=new RegExp(t,ZQ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=e$.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=r$(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=e$.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(QQ.prototype[Symbol.iterator]=t$.prototype[Symbol.iterator]=function(){return this});function n$(e){try{return new RegExp(e,ZQ),!0}catch{return!1}}function r$(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var i$=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=Ne(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=I.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,P.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},a$={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},o$=u.define({combine(e){return A(e,a$,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function s$(e){let t=[p$,f$];return e&&t.push(o$.of(e)),t}var c$=Be.mark({class:`cm-selectionMatch`}),l$=Be.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function u$(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=M.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=M.Word)}function d$(e,t,n,r){return e(t.sliceDoc(n,n+1))==M.Word&&e(t.sliceDoc(r-1,r))==M.Word}var f$=se.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(o$),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Be.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Be.none;let e=n.wordAt(i.head);if(!e)return Be.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Be.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(u$(o,n,i.from,i.to)&&d$(o,n,i.from,i.to)))return Be.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Be.none}let s=[];for(let r of e.visibleRanges){let e=new YQ(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||u$(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(l$.range(r,a)):(r>=i.to||a<=i.from)&&s.push(c$.range(r,a)),s.length>t.maxMatches))return Be.none}}return Be.set(s)}},{decorations:e=>e.decorations}),p$=P.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),m$=({state:e,dispatch:t})=>{let{selection:n}=e,r=I.create(n.ranges.map(t=>e.wordAt(t.head)||I.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function h$(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new YQ(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new YQ(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var g$=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return m$({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=h$(e,r);return i?(t(e.update({selection:e.selection.addRange(I.range(i.from,i.to),!1),effects:P.scrollIntoView(i.to)})),!0):!1},_$=u.define({combine(e){return A(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Z$(e),scrollToMatch:e=>P.scrollIntoView(e)})}}),v$=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||n$(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
186
+ }`,{label:`enum`,detail:`definition`,type:`keyword`})]),SZ=new ne,CZ=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function wZ(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var TZ=[`FunctionDeclaration`],EZ={FunctionDeclaration:wZ(`function`),ClassDeclaration:wZ(`class`),ClassExpression:()=>!0,EnumDeclaration:wZ(`constant`),TypeAliasDeclaration:wZ(`type`),NamespaceDeclaration:wZ(`namespace`),VariableDefinition(e,t){e.matchContext(TZ)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function DZ(e,t){let n=SZ.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(nt.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=EZ[t.name];if(e&&e(t,a)||CZ.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of DZ(e,t.node))r.push(n);return!1}}),SZ.set(t,r),r}var OZ=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,kZ=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function AZ(e){let t=d(e.state).resolveInner(e.pos,-1);if(kZ.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&OZ.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)CZ.has(n.name)&&(r=r.concat(DZ(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:OZ}}var jZ=Ue.define({name:`javascript`,parser:vZ.configure({props:[s.add({IfStatement:Ce({except:/^\s*({|else\b)/}),TryStatement:Ce({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:et,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Ye({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ce({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),a.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Qe,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),MZ={test:e=>/^JSX/.test(e.name),facet:ce({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},NZ=jZ.configure({dialect:`ts`},`typescript`),PZ=jZ.configure({dialect:`jsx`,props:[C.add(e=>e.isTop?[MZ]:void 0)]}),FZ=jZ.configure({dialect:`jsx ts`,props:[C.add(e=>e.isTop?[MZ]:void 0)]},`typescript`),IZ=e=>({label:e,type:`keyword`}),LZ=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(IZ),RZ=LZ.concat([`declare`,`implements`,`private`,`protected`,`public`].map(IZ));function zZ(e={}){let t=e.jsx?e.typescript?FZ:PZ:e.typescript?NZ:jZ,n=e.typescript?xZ.concat(RZ):bZ.concat(LZ);return new qe(t,[jZ.data.of({autocomplete:bW(kZ,yW(n))}),jZ.data.of({autocomplete:AZ}),e.jsx?UZ:[]])}function BZ(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function VZ(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var HZ=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),UZ=P.inputHandler.of((e,t,n,r,i)=>{if((HZ?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!jZ.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=d(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=VZ(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:I.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=BZ(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=VZ(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),WZ=dt({autoCloseTags:()=>xQ,html:()=>yQ,htmlCompletionSource:()=>fQ,htmlCompletionSourceWith:()=>pQ,htmlLanguage:()=>vQ}),GZ=[`_blank`,`_self`,`_top`,`_parent`],KZ=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],qZ=[`get`,`post`,`put`,`delete`],JZ=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],YZ=[`true`,`false`],XZ={},ZZ={a:{attrs:{href:null,ping:null,type:null,media:null,target:GZ,hreflang:null}},abbr:XZ,address:XZ,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:XZ,aside:XZ,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:XZ,base:{attrs:{href:null,target:GZ}},bdi:XZ,bdo:XZ,blockquote:{attrs:{cite:null}},body:XZ,br:XZ,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:JZ,formmethod:qZ,formnovalidate:[`novalidate`],formtarget:GZ,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:XZ,center:XZ,cite:XZ,code:XZ,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:XZ,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:XZ,div:XZ,dl:XZ,dt:XZ,em:XZ,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:XZ,figure:XZ,footer:XZ,form:{attrs:{action:null,name:null,"accept-charset":KZ,autocomplete:[`on`,`off`],enctype:JZ,method:qZ,novalidate:[`novalidate`],target:GZ}},h1:XZ,h2:XZ,h3:XZ,h4:XZ,h5:XZ,h6:XZ,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:XZ,hgroup:XZ,hr:XZ,html:{attrs:{manifest:null}},i:XZ,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:JZ,formmethod:qZ,formnovalidate:[`novalidate`],formtarget:GZ,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:XZ,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:XZ,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:XZ,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:KZ,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:XZ,noscript:XZ,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:XZ,param:{attrs:{name:null,value:null}},pre:XZ,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:XZ,rt:XZ,ruby:XZ,samp:XZ,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:KZ}},section:XZ,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:XZ,source:{attrs:{src:null,type:null,media:null}},span:XZ,strong:XZ,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:XZ,summary:XZ,sup:XZ,table:XZ,tbody:XZ,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:XZ,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:XZ,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:XZ,time:{attrs:{datetime:null}},title:XZ,tr:XZ,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:XZ,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:XZ},QZ={accesskey:null,class:null,contenteditable:YZ,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:YZ,autocorrect:YZ,autocapitalize:YZ,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":YZ,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":YZ,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":YZ,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":YZ,"aria-hidden":YZ,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":YZ,"aria-multiselectable":YZ,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":YZ,"aria-relevant":null,"aria-required":YZ,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},$Z=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of $Z)QZ[e]=null;var eQ=class{constructor(e,t){this.tags={...ZZ,...e},this.globalAttrs={...QZ,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};eQ.default=new eQ;function tQ(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function nQ(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function rQ(e,t,n){return n.tags[tQ(e,nQ(t))]?.children||n.allTags}function iQ(e,t){let n=[];for(let r=nQ(t);r&&!r.type.isTop;r=nQ(r.parent)){let i=tQ(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var aQ=/^[:\-\.\w\u00b7-\uffff]*$/;function oQ(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=nQ(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:rQ(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(iQ(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function sQ(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:iQ(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:aQ}}function cQ(e,t,n,r){let i=[],a=0;for(let r of rQ(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of iQ(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function lQ(e,t,n,r,i){let a=nQ(n),o=a?t.tags[tQ(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:aQ}}function uQ(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=nQ(n),i=r?t.tags[tQ(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function dQ(e,t){let{state:n,pos:r}=t,i=d(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?sQ(n,i,i.from,r):oQ(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?oQ(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?sQ(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?lQ(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?uQ(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?cQ(n,e,i,r):null}function fQ(e){return dQ(eQ.default,e)}function pQ(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new eQ(t,n):eQ.default;return e=>dQ(r,e)}var mQ=jZ.parser.configure({top:`SingleExpression`}),hQ=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:NZ.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:PZ.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:FZ.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:mQ},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:jZ.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:TY.parser}],gQ=[{name:`style`,parser:TY.parser.configure({top:`Styles`})}].concat($Z.map(e=>({name:e,parser:jZ.parser}))),_Q=Ue.define({name:`html`,parser:MX.configure({props:[s.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),a.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),Me.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),vQ=_Q.configure({wrap:IX(hQ,gQ)});function yQ(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=IX((e.nestedLanguages||[]).concat(hQ),(e.nestedAttributes||[]).concat(gQ))),new qe(n?_Q.configure({wrap:n,dialect:t}):t?vQ.configure({dialect:t}):vQ,[vQ.data.of({autocomplete:pQ(e)}),e.autoCloseTags===!1?[]:xQ,zZ().support,EY().support])}var bQ=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),xQ=P.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!vQ.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=d(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=tQ(o.doc,t.parent,n))&&!bQ.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=tQ(o.doc,e,n))&&!bQ.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:I.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)});function SQ(e,t,n,r){let i=xn(kb),a=Cn(yx),o=L.useRef(null),{lexicalNode:s}=nW(),c=L.useRef(!1),l=L.useRef(!1),u=L.useCallback(()=>{a({editorType:t,rootNode:s,editorRef:o.current})},[t,s,a]),d=L.useCallback(t=>{if(t.key===`ArrowDown`){let t=o.current?.getCodemirror()?.state;t&&t.doc.length===t.selection.ranges[0].to&&(c.current?(i?.update(()=>{var t;let n=mc(e);n.getNextSibling()?((t=o.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectNext()):n.insertAfter(zs())}),c.current=!1):c.current=!0)}else if(t.key===`ArrowUp`){let t=o.current?.getCodemirror()?.state;t&&t.selection.ranges[0].from===0&&(l.current?(i?.update(()=>{var t;let n=mc(e);n.getPreviousSibling()&&((t=o.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectPrevious())}),l.current=!1):l.current=!0)}else t.key===`Enter`?t.stopPropagation():(t.key===`Backspace`||t.key===`Delete`)&&(o.current?.getCodemirror()?.state)?.doc.length===0&&i?.update(()=>{mc(e).remove()})},[i,e]);return L.useEffect(()=>{let e=o.current;return setTimeout(()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.addEventListener(`focus`,u),(n=e?.getCodemirror())==null||n.contentDOM.addEventListener(`keydown`,d)},300),()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.removeEventListener(`focus`,u),(n=e?.getCodemirror())==null||n.contentDOM.removeEventListener(`keydown`,d)}},[o,u,d,n]),L.useEffect(()=>{r.subscribe(()=>{var e;(e=o.current?.getCodemirror())==null||e.focus(),u()})},[r,o,e,u]),o}function Q(e){return new qe(ye.define(e))}function CQ(e){return Z(()=>import(`./dist-BFRDpzcv.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1]))}var wQ=[F.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return Z(()=>import(`./dist-QQuDy4KA.js`).then(e=>e.cpp()),__vite__mapDeps([2,1]))}}),F.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return Z(()=>import(`./dist-QQuDy4KA.js`).then(e=>e.cpp()),__vite__mapDeps([2,1]))}}),F.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return CQ(`Cassandra`)}}),F.of({name:`CSS`,extensions:[`css`],load(){return Z(()=>Promise.resolve().then(()=>lY).then(e=>e.css()),void 0)}}),F.of({name:`Go`,extensions:[`go`],load(){return Z(()=>import(`./dist-BLI6sQZG.js`).then(e=>e.go()),__vite__mapDeps([3,1]))}}),F.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return Z(()=>Promise.resolve().then(()=>WZ).then(e=>e.html()),void 0)}}),F.of({name:`Java`,extensions:[`java`],load(){return Z(()=>import(`./dist-DKoyMSNr.js`).then(e=>e.java()),__vite__mapDeps([4,1]))}}),F.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return Z(()=>Promise.resolve().then(()=>yZ).then(e=>e.javascript()),void 0)}}),F.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return Z(()=>import(`./dist-CLrlJjPP.js`).then(e=>e.jinja()),__vite__mapDeps([5,1]))}}),F.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return Z(()=>import(`./dist-DotDq_kD.js`).then(e=>e.json()),__vite__mapDeps([6,1]))}}),F.of({name:`JSX`,extensions:[`jsx`],load(){return Z(()=>Promise.resolve().then(()=>yZ).then(e=>e.javascript({jsx:!0})),void 0)}}),F.of({name:`LESS`,extensions:[`less`],load(){return Z(()=>import(`./dist-B_zXPNMb.js`).then(e=>e.less()),__vite__mapDeps([7,1]))}}),F.of({name:`Liquid`,extensions:[`liquid`],load(){return Z(()=>import(`./dist-B5mpygOZ.js`).then(e=>e.liquid()),__vite__mapDeps([8,1]))}}),F.of({name:`MariaDB SQL`,load(){return CQ(`MariaSQL`)}}),F.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return Z(()=>Promise.resolve().then(()=>B8).then(e=>e.markdown()),void 0)}}),F.of({name:`MS SQL`,load(){return CQ(`MSSQL`)}}),F.of({name:`MySQL`,load(){return CQ(`MySQL`)}}),F.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return Z(()=>import(`./dist-SEP88Pg7.js`).then(e=>e.php()),__vite__mapDeps([9,1]))}}),F.of({name:`PLSQL`,extensions:[`pls`],load(){return CQ(`PLSQL`)}}),F.of({name:`PostgreSQL`,load(){return CQ(`PostgreSQL`)}}),F.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return Z(()=>import(`./dist-Em3LWmNi.js`).then(e=>e.python()),__vite__mapDeps([10,1]))}}),F.of({name:`Rust`,extensions:[`rs`],load(){return Z(()=>import(`./dist-B5ZAfwf5.js`).then(e=>e.rust()),__vite__mapDeps([11,1]))}}),F.of({name:`Sass`,extensions:[`sass`],load(){return Z(()=>import(`./dist-D8ppb7gk.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([12,1]))}}),F.of({name:`SCSS`,extensions:[`scss`],load(){return Z(()=>import(`./dist-D8ppb7gk.js`).then(e=>e.sass()),__vite__mapDeps([12,1]))}}),F.of({name:`SQL`,extensions:[`sql`],load(){return CQ(`StandardSQL`)}}),F.of({name:`SQLite`,load(){return CQ(`SQLite`)}}),F.of({name:`TSX`,extensions:[`tsx`],load(){return Z(()=>Promise.resolve().then(()=>yZ).then(e=>e.javascript({jsx:!0,typescript:!0})),void 0)}}),F.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return Z(()=>Promise.resolve().then(()=>yZ).then(e=>e.javascript({typescript:!0})),void 0)}}),F.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return Z(()=>import(`./dist-DLMjd26T.js`).then(e=>e.wast()),__vite__mapDeps([13,1]))}}),F.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return Z(()=>import(`./dist-BkUONE3N.js`).then(e=>e.xml()),__vite__mapDeps([14,1]))}}),F.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return Z(()=>import(`./dist-B5PTVnox.js`).then(e=>e.yaml()),__vite__mapDeps([15,1]))}}),F.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return Z(()=>import(`./apl-14BqhLYK.js`).then(e=>Q(e.apl)),[])}}),F.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return Z(()=>import(`./asciiarmor-WLvjqI7d.js`).then(e=>Q(e.asciiArmor)),[])}}),F.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return Z(()=>import(`./asn1-Bg4FbdCg.js`).then(e=>Q(e.asn1({}))),[])}}),F.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return Z(()=>import(`./asterisk-B2MO-X4d.js`).then(e=>Q(e.asterisk)),[])}}),F.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return Z(()=>import(`./brainfuck-CV9kufud.js`).then(e=>Q(e.brainfuck)),[])}}),F.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return Z(()=>import(`./cobol-BwO6DF08.js`).then(e=>Q(e.cobol)),[])}}),F.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.csharp)),[])}}),F.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return Z(()=>import(`./clojure-De3QGfx6.js`).then(e=>Q(e.clojure)),[])}}),F.of({name:`ClojureScript`,extensions:[`cljs`],load(){return Z(()=>import(`./clojure-De3QGfx6.js`).then(e=>Q(e.clojure)),[])}}),F.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return Z(()=>import(`./css-CbMZAQ1W.js`).then(e=>Q(e.gss)),[])}}),F.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return Z(()=>import(`./cmake-i2VDNaRq.js`).then(e=>Q(e.cmake)),[])}}),F.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return Z(()=>import(`./coffeescript-BtivDvRz.js`).then(e=>Q(e.coffeeScript)),[])}}),F.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return Z(()=>import(`./commonlisp-DFkEQdLP.js`).then(e=>Q(e.commonLisp)),[])}}),F.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return Z(()=>import(`./cypher-Dke5QOzv.js`).then(e=>Q(e.cypher)),[])}}),F.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return Z(()=>import(`./python-Cs7sNzy_.js`).then(e=>Q(e.cython)),[])}}),F.of({name:`Crystal`,extensions:[`cr`],load(){return Z(()=>import(`./crystal-CU0NkcVL.js`).then(e=>Q(e.crystal)),[])}}),F.of({name:`D`,extensions:[`d`],load(){return Z(()=>import(`./d-TPqSVaHM.js`).then(e=>Q(e.d)),[])}}),F.of({name:`Dart`,extensions:[`dart`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.dart)),[])}}),F.of({name:`diff`,extensions:[`diff`,`patch`],load(){return Z(()=>import(`./diff-B365LSoZ.js`).then(e=>Q(e.diff)),[])}}),F.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return Z(()=>import(`./dockerfile-CJb2sekW.js`).then(e=>Q(e.dockerFile)),__vite__mapDeps([16,17]))}}),F.of({name:`DTD`,extensions:[`dtd`],load(){return Z(()=>import(`./dtd-CBMymJ7O.js`).then(e=>Q(e.dtd)),[])}}),F.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return Z(()=>import(`./dylan-08Azy1NK.js`).then(e=>Q(e.dylan)),[])}}),F.of({name:`EBNF`,load(){return Z(()=>import(`./ebnf-Dkum_1J8.js`).then(e=>Q(e.ebnf)),[])}}),F.of({name:`ECL`,extensions:[`ecl`],load(){return Z(()=>import(`./ecl-dhxjHL8y.js`).then(e=>Q(e.ecl)),[])}}),F.of({name:`edn`,extensions:[`edn`],load(){return Z(()=>import(`./clojure-De3QGfx6.js`).then(e=>Q(e.clojure)),[])}}),F.of({name:`Eiffel`,extensions:[`e`],load(){return Z(()=>import(`./eiffel-C446m6dI.js`).then(e=>Q(e.eiffel)),[])}}),F.of({name:`Elm`,extensions:[`elm`],load(){return Z(()=>import(`./elm-po1E9de0.js`).then(e=>Q(e.elm)),[])}}),F.of({name:`Erlang`,extensions:[`erl`],load(){return Z(()=>import(`./erlang-BD5LkVkR.js`).then(e=>Q(e.erlang)),[])}}),F.of({name:`Esper`,load(){return Z(()=>import(`./sql-DYI2GwJR.js`).then(e=>Q(e.esper)),[])}}),F.of({name:`Factor`,extensions:[`factor`],load(){return Z(()=>import(`./factor-B2EMQZkP.js`).then(e=>Q(e.factor)),__vite__mapDeps([18,17]))}}),F.of({name:`FCL`,load(){return Z(()=>import(`./fcl-DkEOamHd.js`).then(e=>Q(e.fcl)),[])}}),F.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return Z(()=>import(`./forth-dCg2_HVB.js`).then(e=>Q(e.forth)),[])}}),F.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return Z(()=>import(`./fortran-3ZpXLFh1.js`).then(e=>Q(e.fortran)),[])}}),F.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return Z(()=>import(`./mllike-Cw3Iccsb.js`).then(e=>Q(e.fSharp)),[])}}),F.of({name:`Gas`,extensions:[`s`],load(){return Z(()=>import(`./gas-DMmxLZRI.js`).then(e=>Q(e.gas)),[])}}),F.of({name:`Gherkin`,extensions:[`feature`],load(){return Z(()=>import(`./gherkin-DUSFg2R6.js`).then(e=>Q(e.gherkin)),[])}}),F.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return Z(()=>import(`./groovy-Cmduloe1.js`).then(e=>Q(e.groovy)),[])}}),F.of({name:`Haskell`,extensions:[`hs`],load(){return Z(()=>import(`./haskell-Cyr255R9.js`).then(e=>Q(e.haskell)),[])}}),F.of({name:`Haxe`,extensions:[`hx`],load(){return Z(()=>import(`./haxe-BJVKtprM.js`).then(e=>Q(e.haxe)),[])}}),F.of({name:`HXML`,extensions:[`hxml`],load(){return Z(()=>import(`./haxe-BJVKtprM.js`).then(e=>Q(e.hxml)),[])}}),F.of({name:`HTTP`,load(){return Z(()=>import(`./http-DszHFpc-.js`).then(e=>Q(e.http)),[])}}),F.of({name:`IDL`,extensions:[`pro`],load(){return Z(()=>import(`./idl-Cati9Nrv.js`).then(e=>Q(e.idl)),[])}}),F.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return Z(()=>import(`./javascript-C5pDVaoP.js`).then(e=>Q(e.jsonld)),[])}}),F.of({name:`Julia`,extensions:[`jl`],load(){return Z(()=>import(`./julia-DlqY1cTU.js`).then(e=>Q(e.julia)),[])}}),F.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.kotlin)),[])}}),F.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return Z(()=>import(`./livescript-C6p8-2W1.js`).then(e=>Q(e.liveScript)),[])}}),F.of({name:`Lua`,extensions:[`lua`],load(){return Z(()=>import(`./lua-BxuTHaF7.js`).then(e=>Q(e.lua)),[])}}),F.of({name:`mIRC`,extensions:[`mrc`],load(){return Z(()=>import(`./mirc-CCA0FRfl.js`).then(e=>Q(e.mirc)),[])}}),F.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return Z(()=>import(`./mathematica-nDHZUMJT.js`).then(e=>Q(e.mathematica)),[])}}),F.of({name:`Modelica`,extensions:[`mo`],load(){return Z(()=>import(`./modelica-Czx80fNR.js`).then(e=>Q(e.modelica)),[])}}),F.of({name:`MUMPS`,extensions:[`mps`],load(){return Z(()=>import(`./mumps-Ds_ZaumL.js`).then(e=>Q(e.mumps)),[])}}),F.of({name:`Mbox`,extensions:[`mbox`],load(){return Z(()=>import(`./mbox-DAaR0Hcz.js`).then(e=>Q(e.mbox)),[])}}),F.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return Z(()=>import(`./nginx-D9M2PQ4U.js`).then(e=>Q(e.nginx)),[])}}),F.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return Z(()=>import(`./nsis-DOo3SJmd.js`).then(e=>Q(e.nsis)),__vite__mapDeps([19,17]))}}),F.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return Z(()=>import(`./ntriples-DLHGTvHs.js`).then(e=>Q(e.ntriples)),[])}}),F.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.objectiveC)),[])}}),F.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.objectiveCpp)),[])}}),F.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return Z(()=>import(`./mllike-Cw3Iccsb.js`).then(e=>Q(e.oCaml)),[])}}),F.of({name:`Octave`,extensions:[`m`],load(){return Z(()=>import(`./octave-8jj96JiC.js`).then(e=>Q(e.octave)),[])}}),F.of({name:`Oz`,extensions:[`oz`],load(){return Z(()=>import(`./oz-BmMq7iC4.js`).then(e=>Q(e.oz)),[])}}),F.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return Z(()=>import(`./pascal-BgMr6XpT.js`).then(e=>Q(e.pascal)),[])}}),F.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return Z(()=>import(`./perl-D6YJObi_.js`).then(e=>Q(e.perl)),[])}}),F.of({name:`Pig`,extensions:[`pig`],load(){return Z(()=>import(`./pig-nx7uchs8.js`).then(e=>Q(e.pig)),[])}}),F.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return Z(()=>import(`./powershell-B4IPkVxR.js`).then(e=>Q(e.powerShell)),[])}}),F.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return Z(()=>import(`./properties-CoavQdLC.js`).then(e=>Q(e.properties)),[])}}),F.of({name:`ProtoBuf`,extensions:[`proto`],load(){return Z(()=>import(`./protobuf-D5EWhcmc.js`).then(e=>Q(e.protobuf)),[])}}),F.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return Z(()=>import(`./pug-QU72BPAa.js`).then(e=>Q(e.pug)),__vite__mapDeps([20,21]))}}),F.of({name:`Puppet`,extensions:[`pp`],load(){return Z(()=>import(`./puppet-B_0GFuyD.js`).then(e=>Q(e.puppet)),[])}}),F.of({name:`Q`,extensions:[`q`],load(){return Z(()=>import(`./q-BIB9pPtI.js`).then(e=>Q(e.q)),[])}}),F.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return Z(()=>import(`./r-CN5s4f3o.js`).then(e=>Q(e.r)),[])}}),F.of({name:`RPM Changes`,load(){return Z(()=>import(`./rpm-Ct_Ck8mQ.js`).then(e=>Q(e.rpmChanges)),[])}}),F.of({name:`RPM Spec`,extensions:[`spec`],load(){return Z(()=>import(`./rpm-Ct_Ck8mQ.js`).then(e=>Q(e.rpmSpec)),[])}}),F.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return Z(()=>import(`./ruby-BVPradRk.js`).then(e=>Q(e.ruby)),[])}}),F.of({name:`SAS`,extensions:[`sas`],load(){return Z(()=>import(`./sas-DN4j74IF.js`).then(e=>Q(e.sas)),[])}}),F.of({name:`Scala`,extensions:[`scala`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.scala)),[])}}),F.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return Z(()=>import(`./scheme-CvNgHAnh.js`).then(e=>Q(e.scheme)),[])}}),F.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return Z(()=>import(`./shell-BjiMLAaM.js`).then(e=>Q(e.shell)),[])}}),F.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return Z(()=>import(`./sieve-C2U1O5Z4.js`).then(e=>Q(e.sieve)),[])}}),F.of({name:`Smalltalk`,extensions:[`st`],load(){return Z(()=>import(`./smalltalk-DkYwYufV.js`).then(e=>Q(e.smalltalk)),[])}}),F.of({name:`Solr`,load(){return Z(()=>import(`./solr-BopnSD-v.js`).then(e=>Q(e.solr)),[])}}),F.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return Z(()=>import(`./mllike-Cw3Iccsb.js`).then(e=>Q(e.sml)),[])}}),F.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return Z(()=>import(`./sparql-Cpg3YQfd.js`).then(e=>Q(e.sparql)),[])}}),F.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return Z(()=>import(`./spreadsheet-kRxtVt9J.js`).then(e=>Q(e.spreadsheet)),[])}}),F.of({name:`Squirrel`,extensions:[`nut`],load(){return Z(()=>import(`./clike-CjmcUpt6.js`).then(e=>Q(e.squirrel)),[])}}),F.of({name:`Stylus`,extensions:[`styl`],load(){return Z(()=>import(`./stylus-CARoeVE9.js`).then(e=>Q(e.stylus)),[])}}),F.of({name:`Swift`,extensions:[`swift`],load(){return Z(()=>import(`./swift-DKNaLAK6.js`).then(e=>Q(e.swift)),[])}}),F.of({name:`sTeX`,load(){return Z(()=>import(`./stex-BCRT8IJ3.js`).then(e=>Q(e.stex)),[])}}),F.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return Z(()=>import(`./stex-BCRT8IJ3.js`).then(e=>Q(e.stex)),[])}}),F.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return Z(()=>import(`./verilog-DVCHmufx.js`).then(e=>Q(e.verilog)),[])}}),F.of({name:`Tcl`,extensions:[`tcl`],load(){return Z(()=>import(`./tcl-CQyXkgMH.js`).then(e=>Q(e.tcl)),[])}}),F.of({name:`Textile`,extensions:[`textile`],load(){return Z(()=>import(`./textile-Yg_UWn-t.js`).then(e=>Q(e.textile)),[])}}),F.of({name:`TiddlyWiki`,load(){return Z(()=>import(`./tiddlywiki-dqVbkfX4.js`).then(e=>Q(e.tiddlyWiki)),[])}}),F.of({name:`Tiki wiki`,load(){return Z(()=>import(`./tiki-CC_ic8g0.js`).then(e=>Q(e.tiki)),[])}}),F.of({name:`TOML`,extensions:[`toml`],load(){return Z(()=>import(`./toml-B7gGzVkJ.js`).then(e=>Q(e.toml)),[])}}),F.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return Z(()=>import(`./troff-Bq3z6oAu.js`).then(e=>Q(e.troff)),[])}}),F.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return Z(()=>import(`./ttcn-GvRgs2AT.js`).then(e=>Q(e.ttcn)),[])}}),F.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return Z(()=>import(`./ttcn-cfg-CGCXz7Vo.js`).then(e=>Q(e.ttcnCfg)),[])}}),F.of({name:`Turtle`,extensions:[`ttl`],load(){return Z(()=>import(`./turtle-CwIpz2yy.js`).then(e=>Q(e.turtle)),[])}}),F.of({name:`Web IDL`,extensions:[`webidl`],load(){return Z(()=>import(`./webidl-egXQEWlC.js`).then(e=>Q(e.webIDL)),[])}}),F.of({name:`VB.NET`,extensions:[`vb`],load(){return Z(()=>import(`./vb-BmcHUM2C.js`).then(e=>Q(e.vb)),[])}}),F.of({name:`VBScript`,extensions:[`vbs`],load(){return Z(()=>import(`./vbscript-Cs9dylre.js`).then(e=>Q(e.vbScript)),[])}}),F.of({name:`Velocity`,extensions:[`vtl`],load(){return Z(()=>import(`./velocity-CBWU0VCy.js`).then(e=>Q(e.velocity)),[])}}),F.of({name:`Verilog`,extensions:[`v`],load(){return Z(()=>import(`./verilog-DVCHmufx.js`).then(e=>Q(e.verilog)),[])}}),F.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return Z(()=>import(`./vhdl-BGDk4f1d.js`).then(e=>Q(e.vhdl)),[])}}),F.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return Z(()=>import(`./xquery-5f0hn7cg.js`).then(e=>Q(e.xQuery)),[])}}),F.of({name:`Yacas`,extensions:[`ys`],load(){return Z(()=>import(`./yacas-DNs9XkmQ.js`).then(e=>Q(e.yacas)),[])}}),F.of({name:`Z80`,extensions:[`z80`],load(){return Z(()=>import(`./z80-B7Dfb4UO.js`).then(e=>Q(e.z80)),[])}}),F.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return Z(()=>import(`./mscgen-BmfuTbzG.js`).then(e=>Q(e.mscgen)),[])}}),F.of({name:`Xù`,extensions:[`xu`],load(){return Z(()=>import(`./mscgen-BmfuTbzG.js`).then(e=>Q(e.xu)),[])}}),F.of({name:`MsGenny`,extensions:[`msgenny`],load(){return Z(()=>import(`./mscgen-BmfuTbzG.js`).then(e=>Q(e.msgenny)),[])}}),F.of({name:`Vue`,extensions:[`vue`],load(){return Z(()=>import(`./dist-D6pYe6d_.js`).then(e=>e.vue()),__vite__mapDeps([22,1]))}}),F.of({name:`Angular Template`,load(){return Z(()=>import(`./dist-DM6yvMZv.js`).then(e=>e.angular()),__vite__mapDeps([23,1]))}})],TQ=`#2e3440`,EQ=`#3b4252`,DQ=`#434c5e`,OQ=`#4c566a`,kQ=`#e5e9f0`,AQ=`#eceff4`,jQ=`#8fbcbb`,MQ=`#88c0d0`,NQ=`#81a1c1`,PQ=`#5e81ac`,FQ=`#bf616a`,IQ=`#d08770`,LQ=`#ebcb8b`,RQ=`#a3be8c`,zQ=`#b48ead`,BQ=`#d30102`,VQ=AQ,HQ=VQ,UQ=`#ffffff`,WQ=EQ,GQ=VQ,KQ=EQ,qQ=[P.theme({"&":{color:TQ,backgroundColor:UQ},".cm-content":{caretColor:KQ},".cm-cursor, .cm-dropCursor":{borderLeftColor:KQ},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:GQ},".cm-panels":{backgroundColor:VQ,color:OQ},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid ${OQ}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:kQ},".cm-activeLine":{backgroundColor:HQ},".cm-selectionMatch":{backgroundColor:kQ},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${OQ}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:AQ},".cm-gutters":{backgroundColor:AQ,color:TQ,border:`none`},".cm-activeLineGutter":{backgroundColor:HQ},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:WQ},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:WQ,borderBottomColor:WQ},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:HQ,color:OQ}}},{dark:!1}),ee(ue.define([{tag:k.keyword,color:PQ},{tag:[k.name,k.deleted,k.character,k.propertyName,k.macroName],color:IQ},{tag:[k.variableName],color:IQ},{tag:[k.function(k.variableName)],color:PQ},{tag:[k.labelName],color:NQ},{tag:[k.color,k.constant(k.name),k.standard(k.name)],color:PQ},{tag:[k.definition(k.name),k.separator],color:RQ},{tag:[k.brace],color:jQ},{tag:[k.annotation],color:BQ},{tag:[k.number,k.changed,k.annotation,k.modifier,k.self,k.namespace],color:MQ},{tag:[k.typeName,k.className],color:LQ},{tag:[k.operator,k.operatorKeyword],color:RQ},{tag:[k.tagName],color:zQ},{tag:[k.squareBracket],color:FQ},{tag:[k.angleBracket],color:IQ},{tag:[k.attributeName],color:LQ},{tag:[k.regexp],color:PQ},{tag:[k.quote],color:EQ},{tag:[k.string],color:IQ},{tag:k.link,color:jQ,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[k.url,k.escape,k.special(k.string)],color:IQ},{tag:[k.meta],color:MQ},{tag:[k.comment],color:DQ,fontStyle:`italic`},{tag:k.strong,fontWeight:`bold`,color:PQ},{tag:k.emphasis,fontStyle:`italic`,color:PQ},{tag:k.strikethrough,textDecoration:`line-through`},{tag:k.heading,fontWeight:`bold`,color:PQ},{tag:k.special(k.heading1),fontWeight:`bold`,color:PQ},{tag:k.heading1,fontWeight:`bold`,color:PQ},{tag:[k.heading2,k.heading3,k.heading4],fontWeight:`bold`,color:PQ},{tag:[k.heading5,k.heading6],color:PQ},{tag:[k.atom,k.bool,k.special(k.variableName)],color:IQ},{tag:[k.processingInstruction,k.inserted],color:jQ},{tag:[k.contentSeparator],color:LQ},{tag:k.invalid,color:DQ,borderBottom:`1px dotted ${BQ}`}]))],JQ=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,YQ=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(JQ(e)):JQ,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return g(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ie(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=b(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(YQ.prototype[Symbol.iterator]=function(){return this});var XQ={from:-1,to:-1,match:/.*/.exec(``),precise:!0},ZQ=`gm`+(/x/.unicode==null?``:`u`),QQ=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=XQ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new t$(e,t,n,r,i);this.re=new RegExp(t,ZQ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=r$(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=r$(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},$Q=new WeakMap,e$=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=$Q.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return $Q.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),$Q.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},t$=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=XQ,this.matchPos=r$(e,r),this.re=new RegExp(t,ZQ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=e$.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=r$(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=e$.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(QQ.prototype[Symbol.iterator]=t$.prototype[Symbol.iterator]=function(){return this});function n$(e){try{return new RegExp(e,ZQ),!0}catch{return!1}}function r$(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var i$=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=Ne(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=I.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,P.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},a$={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},o$=u.define({combine(e){return A(e,a$,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function s$(e){let t=[p$,f$];return e&&t.push(o$.of(e)),t}var c$=Be.mark({class:`cm-selectionMatch`}),l$=Be.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function u$(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=M.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=M.Word)}function d$(e,t,n,r){return e(t.sliceDoc(n,n+1))==M.Word&&e(t.sliceDoc(r-1,r))==M.Word}var f$=se.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(o$),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Be.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Be.none;let e=n.wordAt(i.head);if(!e)return Be.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Be.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(u$(o,n,i.from,i.to)&&d$(o,n,i.from,i.to)))return Be.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Be.none}let s=[];for(let r of e.visibleRanges){let e=new YQ(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||u$(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(l$.range(r,a)):(r>=i.to||a<=i.from)&&s.push(c$.range(r,a)),s.length>t.maxMatches))return Be.none}}return Be.set(s)}},{decorations:e=>e.decorations}),p$=P.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),m$=({state:e,dispatch:t})=>{let{selection:n}=e,r=I.create(n.ranges.map(t=>e.wordAt(t.head)||I.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function h$(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new YQ(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new YQ(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var g$=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return m$({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=h$(e,r);return i?(t(e.update({selection:e.selection.addRange(I.range(i.from,i.to),!1),effects:P.scrollIntoView(i.to)})),!0):!1},_$=u.define({combine(e){return A(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Z$(e),scrollToMatch:e=>P.scrollIntoView(e)})}}),v$=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||n$(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
187
187
  `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new k$(this):new C$(this)}getCursor(e,t=0,n){let r=e.doc?e:te.create({doc:e});return n??=r.doc.length,this.regexp?T$(this,r,t,n):x$(this,r,t,n)}},y$=class{constructor(e){this.spec=e}};function b$(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function x$(e,t,n,r){let i;return e.wholeWord&&(i=S$(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=b$(e.test,t,i)),new YQ(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function S$(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(E$(i,n-a))!=M.Word||t(D$(i,n-a))!=M.Word)&&(t(D$(i,r-a))!=M.Word||t(E$(i,r-a))!=M.Word))}var C$=class extends y${constructor(e){super(e)}nextMatch(e,t,n){let r=x$(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=x$(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=x$(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=x$(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=x$(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function w$(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function T$(e,t,n,r){let i;return e.wholeWord&&(i=O$(t.charCategorizer(t.selection.main.head))),e.test&&(i=w$(e.test,t,i)),new QQ(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function E$(e,t){return e.slice(i(e,t,!1),t)}function D$(e,t){return e.slice(t,i(e,t))}function O$(e){return(t,n,r)=>!r[0].length||(e(E$(r.input,r.index))!=M.Word||e(D$(r.input,r.index))!=M.Word)&&(e(D$(r.input,r.index+r[0].length))!=M.Word||e(E$(r.input,r.index+r[0].length))!=M.Word)}var k$=class extends y${nextMatch(e,t,n){let r=T$(this.spec,e,n,e.doc.length).next();return r.done&&(r=T$(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=T$(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=T$(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=T$(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},A$=S.define(),j$=S.define(),M$=w.define({create(e){return new N$(G$(e).create(),null)},update(e,t){for(let n of t.effects)n.is(A$)?e=new N$(n.value.create(),e.panel):n.is(j$)&&(e=new N$(e.query,n.value?W$:null));return e},provide:e=>we.from(e,e=>e.panel)}),N$=class{constructor(e,t){this.query=e,this.panel=t}},P$=Be.mark({class:`cm-searchMatch`}),F$=Be.mark({class:`cm-searchMatch cm-searchMatch-selected`}),I$=se.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(M$))}update(e){let t=e.state.field(M$);(t!=e.startState.field(M$)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Be.none;let{view:r}=this,i=new n;for(let t=0,n=r.visibleRanges,a=n.length;t<a;t++){let{from:o,to:s}=n[t];for(;t<a-1&&s>n[t+1].from-500;)s=n[++t].to;e.highlight(r.state,o,s,(e,t)=>{let n=r.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,n?F$:P$)})}return i.finish()}},{decorations:e=>e.decorations});function L$(e){return t=>{let n=t.state.field(M$,!1);return n&&n.query.spec.valid?e(t,n):J$(t)}}var R$=L$((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=I.single(r.from,r.to),a=e.state.facet(_$);return e.dispatch({selection:i,effects:[t1(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),q$(e),!0}),z$=L$((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=I.single(i.from,i.to),o=e.state.facet(_$);return e.dispatch({selection:a,effects:[t1(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),q$(e),!0}),B$=L$((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:I.create(n.map(e=>I.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),V$=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new YQ(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(I.range(t.value.from,t.value.to))}return t(e.update({selection:I.create(a,o),userEvent:`select.search.matches`})),!0},H$=L$((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),u.push(P.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=I.single(o.from,o.to).map(d),u.push(t1(e,o)),u.push(n.facet(_$).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),U$=L$((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:P.announce.of(r),userEvent:`input.replace.all`}),!0});function W$(e){return e.state.facet(_$).createPanel(e)}function G$(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(_$);return new v$({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function K$(e){let t=Fe(e,W$);return t&&t.dom.querySelector(`[main-field]`)}function q$(e){let t=K$(e);t&&t==e.root.activeElement&&t.select()}var J$=e=>{let t=e.state.field(M$,!1);if(t&&t.panel){let n=K$(e);if(n&&n!=e.root.activeElement){let r=G$(e.state,t.query.spec);r.valid&&e.dispatch({effects:A$.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[j$.of(!0),t?A$.of(G$(e.state,t.query.spec)):S.appendConfig.of(r1)]});return!0},Y$=e=>{let t=e.state.field(M$,!1);if(!t||!t.panel)return!1;let n=Fe(e,W$);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:j$.of(!1)}),!0},X$=[{key:`Mod-f`,run:J$,scope:`editor search-panel`},{key:`F3`,run:R$,shift:z$,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:R$,shift:z$,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:Y$,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:V$},{key:`Mod-Alt-g`,run:i$},{key:`Mod-d`,run:g$,preventDefault:!0}],Z$=class{constructor(e){this.view=e;let t=this.query=e.state.field(M$).query.spec;this.commit=this.commit.bind(this),this.searchField=le(`input`,{value:t.search,placeholder:Q$(e,`Find`),"aria-label":Q$(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=le(`input`,{value:t.replace,placeholder:Q$(e,`Replace`),"aria-label":Q$(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=le(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=le(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=le(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return le(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=le(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>R$(e),[Q$(e,`next`)]),n(`prev`,()=>z$(e),[Q$(e,`previous`)]),n(`select`,()=>B$(e),[Q$(e,`all`)]),le(`label`,null,[this.caseField,Q$(e,`match case`)]),le(`label`,null,[this.reField,Q$(e,`regexp`)]),le(`label`,null,[this.wordField,Q$(e,`by word`)]),...e.state.readOnly?[]:[le(`br`),this.replaceField,n(`replace`,()=>H$(e),[Q$(e,`replace`)]),n(`replaceAll`,()=>U$(e),[Q$(e,`replace all`)])],le(`button`,{name:`close`,onclick:()=>Y$(e),"aria-label":Q$(e,`close`),type:`button`},[`×`])])}commit(){let e=new v$({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:A$.of(e)}))}keydown(e){ze(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?z$:R$)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),H$(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(A$)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(_$).top}};function Q$(e,t){return e.state.phrase(t)}var $$=30,e1=/[\s\.,:;?!]/;function t1(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-$$),o=Math.min(i,n+$$),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<$$;e++)if(!e1.test(s[e+1])&&e1.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-$$;e--)if(!e1.test(s[e-1])&&e1.test(s[e])){s=s.slice(0,e);break}}return P.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var n1=P.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),r1=[M$,E.low(I$),n1],i1=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},a1=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,r,i){let a=i.facet(y1).markerFilter;a&&(t=a(t,i));let o=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),s=new n,c=[],l=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let e=0;;){let t=e==o.length?null:o[e];if(!t&&!c.length)break;let n,r;if(c.length)n=l,r=c.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>f)break;r=t.to,c.push(t),e++}for(;e<o.length;){let t=o[e];if(t.from==n&&(t.to>t.from||t.to==n))c.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,f);let i=!1;if(c.some(e=>e.from==n&&(e.to==r||r==f))&&(i=n==r,!i&&r-n<10)){let e=n-(d+u.value.length);e>0&&(u.next(e),d=n);for(let e=n;;){if(e>=r){i=!0;break}if(!u.lineBreak&&d+u.value.length>e)break;e=d+u.value.length,d+=u.value.length,u.next()}}let a=A1(c);if(i)s.add(n,n,Be.widget({widget:new C1(a),diagnostics:c.slice()}));else{let e=c.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);s.add(n,r,Be.mark({class:`cm-lintRange cm-lintRange-`+a+e,diagnostics:c.slice(),inclusiveEnd:c.some(e=>e.to>r)}))}if(l=r,l==f)break;for(let e=0;e<c.length;e++)c[e].to<=l&&c.splice(e--,1)}let p=s.finish();return new e(p,r,o1(p))}};function o1(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new i1(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new i1(r.from,n,r.diagnostic)}),r}function s1(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(y1).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(l1))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function c1(e,t){return e.field(f1,!1)?t:t.concat(S.appendConfig.of(j1))}var l1=S.define(),u1=S.define(),d1=S.define(),f1=w.define({create(){return new a1(Be.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=o1(n,e.selected.diagnostic,i)||o1(n,null,i)}!n.size&&i&&t.state.facet(y1).autoPanel&&(i=null),e=new a1(n,i,r)}for(let n of t.effects)if(n.is(l1)){let r=t.state.facet(y1).autoPanel?n.value.length?T1.open:null:e.panel;e=a1.init(n.value,r,t.state)}else n.is(u1)?e=new a1(e.diagnostics,n.value?T1.open:null,e.selected):n.is(d1)&&(e=new a1(e.diagnostics,e.panel,n.value));return e},provide:e=>[we.from(e,e=>e.panel),P.decorations.from(e,e=>e.diagnostics)]}),p1=Be.mark({class:`cm-lintRange cm-lintRange-active`});function m1(e,t,n){let{diagnostics:r}=e.state.field(f1),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(y1).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:h1(e,i)}}}:null}function h1(e,t){return le(`ul`,{class:`cm-tooltip-lint`},t.map(t=>S1(e,t,!1)))}var g1=e=>{let t=e.state.field(f1,!1);(!t||!t.panel)&&e.dispatch({effects:c1(e.state,[u1.of(!0)])});let n=Fe(e,T1.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},_1=e=>{let t=e.state.field(f1,!1);return!t||!t.panel?!1:(e.dispatch({effects:u1.of(!1)}),!0)},v1=[{key:`Mod-Shift-m`,run:g1,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(f1,!1);if(!t)return!1;let n=e.state.selection.main,r=o1(t.diagnostics,null,n.to+1);return!r&&(r=o1(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],y1=u.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...A(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:b1,tooltipFilter:b1,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function b1(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function x1(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function S1(e,t,n){let r=n?x1(t.actions):[];return le(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},le(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=o1(e.state.field(f1).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),le(`u`,s.slice(c,c+1)),s.slice(c+1)];return le(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&le(`div`,{class:`cm-diagnosticSource`},t.source))}var C1=class extends O{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return le(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},w1=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=S1(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},T1=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)_1(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=x1(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=o1(this.view.state.field(f1).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=le(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=le(`div`,{class:`cm-panel-lint`},this.list,le(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>_1(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(f1).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(f1),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new w1(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new w1(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=o1(this.view.state.field(f1).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:d1.of(t)})}static open(t){return new e(t)}};function E1(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function D1(e){return E1(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var O1=P.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:D1(`#d11`)},".cm-lintRange-warning":{backgroundImage:D1(`orange`)},".cm-lintRange-info":{backgroundImage:D1(`#999`)},".cm-lintRange-hint":{backgroundImage:D1(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function k1(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function A1(e){let t=`hint`,n=1;for(let r of e){let e=k1(r.severity);e>n&&(n=e,t=r.severity)}return t}var j1=[f1,P.decorations.compute([f1],e=>{let{selected:t,panel:n}=e.field(f1);return!t||!n||t.from==t.to?Be.none:Be.set([p1.range(t.from,t.to)])}),he(m1,{hideOn:s1}),O1],M1=[Je(),Le(),We(),vK(),fe(),ve(),Ke(),te.allowMultipleSelections.of(!0),T(),ee(xe,{fallback:!0}),Re(),IG(),$G(),be(),e(),de(),s$(),je.of([...HG,...TJ,...X$,...LK,...j,...eK,...v1])];We(),vK(),ve(),ee(xe,{fallback:!0}),je.of([...TJ,...LK]);function N1(e,[t,n]){return Math.min(n,Math.max(t,e))}function P1(e){let t=L.useRef({value:e,previous:e});return L.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var F1=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),I1=`VisuallyHidden`,L1=L.forwardRef((e,t)=>(0,R.jsx)(xT.span,{...e,ref:t,style:{...F1,...e.style}}));L1.displayName=I1;var R1=L1,z1=[` `,`Enter`,`ArrowUp`,`ArrowDown`],B1=[` `,`Enter`],V1=`Select`,[H1,U1,W1]=ZA(V1),[G1,K1]=fT(V1,[W1,TO]),q1=TO(),[J1,Y1]=G1(V1),[X1,Z1]=G1(V1),Q1=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=q1(t),[g,_]=L.useState(null),[v,y]=L.useState(null),[b,x]=L.useState(!1),S=$A(l),[C,w]=$O({prop:r,defaultProp:i??!1,onChange:a,caller:V1}),[T,E]=$O({prop:o,defaultProp:s,onChange:c,caller:V1}),ee=L.useRef(null),D=g?m||!!g.closest(`form`):!0,[O,k]=L.useState(new Set),A=Array.from(O).map(e=>e.props.value).join(`;`);return(0,R.jsx)(VO,{...h,children:(0,R.jsxs)(J1,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:oE(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:ee,disabled:f,children:[(0,R.jsx)(H1.Provider,{scope:t,children:(0,R.jsx)(X1,{scope:e.__scopeSelect,onNativeOptionAdd:L.useCallback(e=>{k(t=>new Set(t).add(e))},[]),onNativeOptionRemove:L.useCallback(e=>{k(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),D?(0,R.jsxs)(q0,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,R.jsx)(`option`,{value:``}):null,Array.from(O)]},A):null]})})};Q1.displayName=V1;var $1=`SelectTrigger`,e0=L.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=q1(n),o=Y1($1,n),s=o.disabled||r,c=uT(t,o.onTriggerChange),l=U1(n),u=L.useRef(`touch`),[d,f,p]=Y0(e=>{let t=l().filter(e=>!e.disabled),n=X0(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,R.jsx)(HO,{asChild:!0,...a,children:(0,R.jsx)(xT.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":J0(o.value)?``:void 0,...i,ref:c,onClick:sT(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:sT(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:sT(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&z1.includes(e.key)&&(m(),e.preventDefault())})})})});e0.displayName=$1;var t0=`SelectValue`,n0=L.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Y1(t0,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=uT(t,c.onValueNodeChange);return rE(()=>{l(u)},[l,u]),(0,R.jsx)(xT.span,{...s,ref:d,style:{pointerEvents:`none`},children:J0(c.value)?(0,R.jsx)(R.Fragment,{children:o}):a})});n0.displayName=t0;var r0=`SelectIcon`,i0=L.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,R.jsx)(xT.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});i0.displayName=r0;var a0=`SelectPortal`,o0=e=>(0,R.jsx)(KO,{asChild:!0,...e});o0.displayName=a0;var s0=`SelectContent`,c0=L.forwardRef((e,t)=>{let n=Y1(s0,e.__scopeSelect),[r,i]=L.useState();if(rE(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?gS.createPortal((0,R.jsx)(u0,{scope:e.__scopeSelect,children:(0,R.jsx)(H1.Slot,{scope:e.__scopeSelect,children:(0,R.jsx)(`div`,{children:e.children})})}),t):null}return(0,R.jsx)(m0,{...e,ref:t})});c0.displayName=s0;var l0=10,[u0,d0]=G1(s0),f0=`SelectContentImpl`,p0=mT(`SelectContent.RemoveScroll`),m0=L.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=Y1(s0,n),[y,b]=L.useState(null),[x,S]=L.useState(null),C=uT(t,e=>b(e)),[w,T]=L.useState(null),[E,ee]=L.useState(null),D=U1(n),[O,k]=L.useState(!1),A=L.useRef(!1);L.useEffect(()=>{if(y)return uk(y)},[y]),zT();let j=L.useCallback(e=>{let[t,...n]=D().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[D,x]),M=L.useCallback(()=>j([w,y]),[j,w,y]);L.useEffect(()=>{O&&M()},[O,M]);let{onOpenChange:N,triggerPointerDownPosRef:te}=v;L.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(te.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(te.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||N(!1),document.removeEventListener(`pointermove`,t),te.current=null};return te.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,N,te]),L.useEffect(()=>{let e=()=>N(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[N]);let[ne,re]=Y0(e=>{let t=D().filter(e=>!e.disabled),n=X0(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ie=L.useCallback((e,t,n)=>{let r=!A.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(A.current=!0))},[v.value]),ae=L.useCallback(()=>y?.focus(),[y]),oe=L.useCallback((e,t,n)=>{let r=!A.current&&!n;(v.value!==void 0&&v.value===t||r)&&ee(e)},[v.value]),P=r===`popper`?v0:g0,se=P===v0?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,R.jsx)(u0,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ie,selectedItem:w,onItemLeave:ae,itemTextRefCallback:oe,focusSelectedItem:M,selectedItemText:E,position:r,isPositioned:O,searchRef:ne,children:(0,R.jsx)(yA,{as:p0,allowPinchZoom:!0,children:(0,R.jsx)(GT,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:sT(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,R.jsx)(jT,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,R.jsx)(P,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...se,onPlaced:()=>k(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:sT(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=D().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>j(t)),e.preventDefault()}})})})})})})});m0.displayName=f0;var h0=`SelectItemAlignedPosition`,g0=L.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Y1(s0,n),o=d0(s0,n),[s,c]=L.useState(null),[l,u]=L.useState(null),d=uT(t,e=>u(e)),f=U1(n),p=L.useRef(!1),m=L.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=L.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-l0,d=N1(a,[l0,Math.max(l0,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-l0,d=N1(a,[l0,Math.max(l0,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-l0*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-l0,ee=c-E,D=g.offsetHeight/2,O=g.offsetTop+D,k=m+v+O,A=x-k;if(k<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=k+Math.max(ee,D+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+D)+A;s.style.height=t+`px`,h.scrollTop=k-E+h.offsetTop}s.style.margin=`${l0}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);rE(()=>y(),[y]);let[b,x]=L.useState();return rE(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,R.jsx)(y0,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:L.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,R.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,R.jsx)(xT.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});g0.displayName=h0;var _0=`SelectPopperPosition`,v0=L.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=l0,...a}=e,o=q1(n);return(0,R.jsx)(UO,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});v0.displayName=_0;var[y0,b0]=G1(s0,{}),x0=`SelectViewport`,S0=L.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=d0(x0,n),o=b0(x0,n),s=uT(t,a.onViewportChange),c=L.useRef(0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,R.jsx)(H1.Slot,{scope:n,children:(0,R.jsx)(xT.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:sT(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-l0*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});S0.displayName=x0;var C0=`SelectGroup`,[w0,T0]=G1(C0),E0=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=oE();return(0,R.jsx)(w0,{scope:n,id:i,children:(0,R.jsx)(xT.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});E0.displayName=C0;var D0=`SelectLabel`,O0=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=T0(D0,n);return(0,R.jsx)(xT.div,{id:i.id,...r,ref:t})});O0.displayName=D0;var k0=`SelectItem`,[A0,j0]=G1(k0),M0=L.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Y1(k0,n),c=d0(k0,n),l=s.value===r,[u,d]=L.useState(a??``),[f,p]=L.useState(!1),m=uT(t,e=>c.itemRefCallback?.(e,r,i)),h=oE(),g=L.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,R.jsx)(A0,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:L.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,R.jsx)(H1.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,R.jsx)(xT.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:sT(o.onFocus,()=>p(!0)),onBlur:sT(o.onBlur,()=>p(!1)),onClick:sT(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:sT(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:sT(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:sT(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:sT(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:sT(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(B1.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});M0.displayName=k0;var N0=`SelectItemText`,P0=L.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Y1(N0,n),s=d0(N0,n),c=j0(N0,n),l=Z1(N0,n),[u,d]=L.useState(null),f=uT(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=L.useMemo(()=>(0,R.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return rE(()=>(h(m),()=>g(m)),[h,g,m]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(xT.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?gS.createPortal(a.children,o.valueNode):null]})});P0.displayName=N0;var F0=`SelectItemIndicator`,I0=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return j0(F0,n).isSelected?(0,R.jsx)(xT.span,{"aria-hidden":!0,...r,ref:t}):null});I0.displayName=F0;var L0=`SelectScrollUpButton`,R0=L.forwardRef((e,t)=>{let n=d0(L0,e.__scopeSelect),r=b0(L0,e.__scopeSelect),[i,a]=L.useState(!1),o=uT(t,r.onScrollButtonChange);return rE(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(V0,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});R0.displayName=L0;var z0=`SelectScrollDownButton`,B0=L.forwardRef((e,t)=>{let n=d0(z0,e.__scopeSelect),r=b0(z0,e.__scopeSelect),[i,a]=L.useState(!1),o=uT(t,r.onScrollButtonChange);return rE(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(V0,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});B0.displayName=z0;var V0=L.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=d0(`SelectScrollButton`,n),o=L.useRef(null),s=U1(n),c=L.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return L.useEffect(()=>()=>c(),[c]),rE(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,R.jsx)(xT.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:sT(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:sT(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:sT(i.onPointerLeave,()=>{c()})})}),H0=`SelectSeparator`,U0=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,R.jsx)(xT.div,{"aria-hidden":!0,...r,ref:t})});U0.displayName=H0;var W0=`SelectArrow`,G0=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=q1(n),a=Y1(W0,n),o=d0(W0,n);return a.open&&o.position===`popper`?(0,R.jsx)(WO,{...i,...r,ref:t}):null});G0.displayName=W0;var K0=`SelectBubbleInput`,q0=L.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=L.useRef(null),a=uT(r,i),o=P1(t);return L.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,R.jsx)(xT.select,{...n,style:{...F1,...n.style},ref:a,defaultValue:t})});q0.displayName=K0;function J0(e){return e===``||e===void 0}function Y0(e){let t=CT(e),n=L.useRef(``),r=L.useRef(0),i=L.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=L.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return L.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function X0(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Z0(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Z0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q0=Q1,$0=e0,e2=n0,t2=i0,n2=o0,r2=c0,i2=S0,a2=M0,o2=P0,s2=U0,[c2,l2]=fT(`Tooltip`,[TO]),u2=TO(),d2=`TooltipProvider`,f2=700,p2=`tooltip.open`,[m2,h2]=c2(d2),g2=e=>{let{__scopeTooltip:t,delayDuration:n=f2,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=L.useRef(!0),s=L.useRef(!1),c=L.useRef(0);return L.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,R.jsx)(m2,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:L.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:L.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:L.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};g2.displayName=d2;var _2=`Tooltip`,[v2,y2]=c2(_2),b2=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=h2(_2,e.__scopeTooltip),l=u2(t),[u,d]=L.useState(null),f=oE(),p=L.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=L.useRef(!1),[_,v]=$O({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(p2))):c.onClose(),a?.(e)},caller:_2}),y=L.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=L.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=L.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=L.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return L.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,R.jsx)(VO,{...l,children:(0,R.jsx)(v2,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:L.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:L.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};b2.displayName=_2;var x2=`TooltipTrigger`,S2=L.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=y2(x2,n),a=h2(x2,n),o=u2(n),s=uT(t,L.useRef(null),i.onTriggerChange),c=L.useRef(!1),l=L.useRef(!1),u=L.useCallback(()=>c.current=!1,[]);return L.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,R.jsx)(HO,{asChild:!0,...o,children:(0,R.jsx)(xT.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:sT(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:sT(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:sT(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:sT(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:sT(e.onBlur,i.onClose),onClick:sT(e.onClick,i.onClose)})})});S2.displayName=x2;var C2=`TooltipPortal`,[w2,T2]=c2(C2,{forceMount:void 0}),E2=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=y2(C2,t);return(0,R.jsx)(w2,{scope:t,forceMount:n,children:(0,R.jsx)(JO,{present:n||a.open,children:(0,R.jsx)(KO,{asChild:!0,container:i,children:r})})})};E2.displayName=C2;var D2=`TooltipContent`,O2=L.forwardRef((e,t)=>{let n=T2(D2,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=y2(D2,e.__scopeTooltip);return(0,R.jsx)(JO,{present:r||o.open,children:o.disableHoverableContent?(0,R.jsx)(N2,{side:i,...a,ref:t}):(0,R.jsx)(k2,{side:i,...a,ref:t})})}),k2=L.forwardRef((e,t)=>{let n=y2(D2,e.__scopeTooltip),r=h2(D2,e.__scopeTooltip),i=L.useRef(null),a=uT(t,i),[o,s]=L.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=L.useCallback(()=>{s(null),d(!1)},[d]),p=L.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=L2(r,I2(r,n.getBoundingClientRect())),a=R2(t.getBoundingClientRect());s(B2([...i,...a])),d(!0)},[d]);return L.useEffect(()=>()=>f(),[f]),L.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),L.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!z2(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,R.jsx)(N2,{...e,ref:a})}),[A2,j2]=c2(_2,{isInside:!1}),M2=_T(`TooltipContent`),N2=L.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=y2(D2,n),l=u2(n),{onClose:u}=c;return L.useEffect(()=>(document.addEventListener(p2,u),()=>document.removeEventListener(p2,u)),[u]),L.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,R.jsx)(jT,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,R.jsxs)(UO,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,R.jsx)(M2,{children:r}),(0,R.jsx)(A2,{scope:n,isInside:!0,children:(0,R.jsx)(R1,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});O2.displayName=D2;var P2=`TooltipArrow`,F2=L.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=u2(n);return j2(P2,n).isInside?null:(0,R.jsx)(WO,{...i,...r,ref:t})});F2.displayName=P2;function I2(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function L2(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function R2(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function z2(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function B2(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),V2(t)}function V2(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var H2=g2,U2=b2,W2=S2,G2=E2,K2=O2,q2=F2,J2=L.forwardRef(({title:e,children:t},n)=>{let r=xn(rx);return L.createElement(H2,{delayDuration:100},L.createElement(U2,null,L.createElement(W2,{ref:n,asChild:!0},L.createElement(`span`,{className:J.tooltipTrigger},t)),L.createElement(G2,{container:r?.current},L.createElement(K2,{className:(0,jC.default)(J.tooltipContent),sideOffset:10},e))))}),Y2=L.forwardRef(({children:e,className:t,...n},r)=>L.createElement(a2,{...n,ref:r,className:(0,jC.default)(t,J.selectItem)},L.createElement(o2,null,e))),X2=({title:e,placeholder:t,className:n})=>{let[r,i]=Sn(Mb,xx);return L.createElement(J2,{title:e},L.createElement($0,{"aria-label":t,className:(0,jC.default)(J.selectTrigger,n),"data-toolbar-item":!0,disabled:r},L.createElement(e2,{placeholder:t}),L.createElement(t2,{className:J.selectDropdownArrow},i(`arrow_drop_down`))))},Z2=({children:e,className:t=J.selectContainer})=>{let n=xn(rx);return L.createElement(n2,{container:n?.current},L.createElement(r2,{className:(0,jC.default)(t,`mdxeditor-select-content`),onCloseAutoFocus:e=>{e.preventDefault()},position:`popper`},L.createElement(i2,{"data-editor-dropdown":!0,style:{maxHeight:`var(--radix-select-content-available-height)`}},e)))},Q2=e=>L.createElement(Q0,{value:e.value||``,onValueChange:e.onChange,disabled:e.disabled},L.createElement(X2,{title:e.triggerTitle,placeholder:e.placeholder}),L.createElement(Z2,null,e.items.map((e,t)=>e===`separator`?L.createElement(s2,{key:t}):L.createElement(Y2,{key:t,value:e.value},e.label)))),$2=({language:e,nodeKey:t,code:n,focusEmitter:r})=>{let i=Xx(),{parentEditor:a,lexicalNode:o}=nW(),[s,c,l,u,d]=Sn(Mb,a4,o4,xx,r4),f=SQ(t,`codeblock`,e,r),{setCode:p}=nW(),m=L.useRef(null),h=L.useRef(null),{value:g,items:_}=L.useMemo(()=>n4(d,e),[d,e]),v=L.useRef(p);return v.current=p,f.current={getCodemirror:()=>m.current},L.useEffect(()=>{let t=h.current;return(async()=>{let r=[...c,M1,qQ,Je(),je.of([EJ]),P.lineWrapping,P.updateListener.of(({state:e})=>{v.current(e.doc.toString())}),P.domEventHandlers({focus:()=>{a.update(()=>{Sc(null)})}})];if(s&&r.push(te.readOnly.of(!0)),e!==``){let t=d.keyMap[e]??e,n=d.supportMap[t];if(n)r.push(n.extension);else if(l){let t=wQ.find(t=>t.name===e||t.alias.includes(e)||t.extensions.includes(e));if(t)try{let e=await t.load();r.push(e.extension)}catch{console.warn(`failed to load language support for`,e)}}}t.innerHTML=``,m.current=new P({parent:t,state:te.create({doc:n,extensions:r})}),t.addEventListener(`keydown`,e4)})(),()=>{var e;(e=m.current)==null||e.destroy(),m.current=null,t.removeEventListener(`keydown`,e4)}},[s,e,...c]),L.createElement(`div`,{className:J.codeMirrorWrapper},L.createElement(`div`,{className:J.codeMirrorToolbar},L.createElement(Q2,{disabled:s,value:g,onChange:e=>{a.update(()=>{o.setLanguage(e===`__EMPTY_VALUE__`?``:e),setTimeout(()=>{a.update(()=>{o.getLatest().select()})})})},triggerTitle:i(`codeBlock.selectLanguage`,`Select code block language`),placeholder:i(`codeBlock.inlineLanguage`,`Language`),items:_}),L.createElement(`button`,{className:J.iconButton,type:`button`,disabled:s,title:i(`codeblock.delete`,`Delete code block`),onClick:e=>{e.preventDefault(),a.update(()=>{o.remove()})}},u(`delete_small`))),L.createElement(`div`,{ref:h}))};function e4(e){e.stopPropagation()}function t4(e){let t=[],n={},r={};if(Array.isArray(e))for(let i of e){let e=i.alias?.[0]??i.name.toLowerCase(),a=e||`__EMPTY_VALUE__`;if(t.push({value:a,label:i.name}),n[e]=a,i.alias)for(let e of i.alias)n[e]=a;if(i.extensions)for(let e of i.extensions)n[e]=a;n[i.name.toLowerCase()]=a,i.support&&(r[a]=i.support)}else{let r={};for(let[i,a]of Object.entries(e))a in r||(r[a]=i,t.push({value:i||`__EMPTY_VALUE__`,label:a})),n[i]=r[a]||`__EMPTY_VALUE__`}return{items:t,keyMap:n,supportMap:r}}function n4(e,t){let n=e.keyMap[t]??t;return!n||e.items.some(e=>e.value===n)?{value:n,items:e.items}:{value:n,items:[...e.items,{value:n,label:t}]}}var r4=z(t4({js:`JavaScript`,ts:`TypeScript`,tsx:`TypeScript (React)`,jsx:`JavaScript (React)`,css:`CSS`})),i4=_n(e=>{e.link(e.pipe(i4,wn(({language:e,code:t})=>({code:t,language:e,meta:``}))),uW)}),a4=z([]),o4=z(!0),s4=jn({update(e,t){e.pubIn({[r4]:t4(t?.codeBlockLanguages??{}),[a4]:t?.codeMirrorExtensions??[],[o4]:t?.autoLoadLanguageSupport??!0})},init(e,t){let n=t4(t?.codeBlockLanguages??{});e.pubIn({[r4]:n,[a4]:t?.codeMirrorExtensions??[],[dW]:c4(),[o4]:t?.autoLoadLanguageSupport??!0})}});function c4(e){return{match(e,t){return!t},priority:1,Editor:$2}}function l4({url:e,title:t,text:n,onSubmit:r,onCancel:i,linkAutocompleteSuggestions:a,showLinkTitleField:o,showAnchorTextField:s}){let{register:c,handleSubmit:l,control:u,setValue:d,reset:f}=IF({values:{url:e,title:t,text:n}}),p=Xx();return L.createElement(`form`,{onSubmit:e=>{l(r)(e),e.stopPropagation(),e.preventDefault()},onReset:e=>{e.stopPropagation(),i()},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),i())},className:(0,jC.default)(J.multiFieldForm,J.linkDialogEditForm)},L.createElement(`div`,{className:J.formField},L.createElement(`label`,{htmlFor:`link-url`},p(`createLink.url`,`URL`)),L.createElement(DR,{register:c,initialInputValue:e,inputName:`url`,suggestions:a,setValue:d,control:u,placeholder:p(`createLink.urlPlaceholder`,`Select or paste an URL`),autofocus:!0})),s?L.createElement(`div`,{className:J.formField},L.createElement(`label`,{htmlFor:`link-text`,title:p(`createLink.textTooltip`,`The text to be displayed for the link`)},p(`createLink.text`,`Anchor text`)),L.createElement(`input`,{id:`link-text`,className:J.textInput,size:40,...c(`text`)})):null,o?L.createElement(`div`,{className:J.formField},L.createElement(`label`,{htmlFor:`link-title`,title:p(`createLink.titleTooltip`,`The link's title attribute, shown on hover`)},p(`createLink.title`,`Link title`)),L.createElement(`input`,{id:`link-title`,className:J.textInput,size:40,...c(`title`)})):null,L.createElement(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`var(--spacing-2)`}},L.createElement(`button`,{type:`submit`,title:p(`createLink.saveTooltip`,`Set URL`),"aria-label":p(`createLink.saveTooltip`,`Set URL`),className:(0,jC.default)(J.primaryButton)},p(`dialogControls.save`,`Save`)),L.createElement(`button`,{type:`reset`,title:p(`createLink.cancelTooltip`,`Cancel change`),"aria-label":p(`createLink.cancelTooltip`,`Cancel change`),className:(0,jC.default)(J.secondaryButton)},p(`dialogControls.cancel`,`Cancel`))))}var u4=()=>{let[e,t,n,r,i,a,o]=Sn(rx,kb,xx,m4,b4,x4,w4),s=Cn(p4),c=Cn(h4),l=Cn(g4),u=Cn(_4),d=Cn(v4);L.useEffect(()=>{let e=()=>{t?.getEditorState().read(()=>{s(!0)})};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e)}},[t,s]);let[f,p]=L.useState(!1),m=Xx();if(r.type===`inactive`)return null;let h=r.rectangle,g=r.type===`preview`&&r.url.startsWith(`http`);return L.createElement(KA,{open:!0},L.createElement(qA,{"data-visible":r.type===`edit`,className:J.linkDialogAnchor,style:{top:`${h.top}px`,left:`${h.left}px`,width:`${h.width}px`,height:`${h.height}px`}}),L.createElement(JA,{container:e?.current},L.createElement(YA,{className:(0,jC.default)(J.linkDialogPopoverContent),sideOffset:5,onOpenAutoFocus:e=>{e.preventDefault()},key:r.linkNodeKey},r.type===`edit`&&L.createElement(l4,{url:r.url,title:r.title,text:r.text,onSubmit:c,onCancel:l.bind(null),linkAutocompleteSuggestions:i,showLinkTitleField:o,showAnchorTextField:r.withAnchorText}),r.type===`preview`&&L.createElement(L.Fragment,null,L.createElement(`a`,{className:J.linkDialogPreviewAnchor,href:r.url,...g?{target:`_blank`,rel:`noreferrer`}:{},onClick:e=>{a!==null&&(e.preventDefault(),a(r.url))},title:g?m(`linkPreview.open`,`Open {{url}} in new window`,{url:r.url}):r.url},L.createElement(`span`,null,r.url),g&&n(`open_in_new`)),L.createElement(d4,{onClick:()=>{u()},title:m(`linkPreview.edit`,`Edit link URL`),"aria-label":m(`linkPreview.edit`,`Edit link URL`)},n(`edit`)),L.createElement(H2,null,L.createElement(U2,{open:f},L.createElement(W2,{asChild:!0},L.createElement(d4,{title:m(`linkPreview.copyToClipboard`,`Copy to clipboard`),"aria-label":m(`linkPreview.copyToClipboard`,`Copy to clipboard`),onClick:()=>{window.navigator.clipboard.writeText(r.url).then(()=>{p(!0),setTimeout(()=>{p(!1)},1e3)})}},n(f?`check`:`content_copy`))),L.createElement(G2,{container:e?.current},L.createElement(K2,{className:(0,jC.default)(J.tooltipContent),sideOffset:5},m(`linkPreview.copied`,`Copied!`),L.createElement(q2,null))))),L.createElement(d4,{title:m(`linkPreview.remove`,`Remove link`),"aria-label":m(`linkPreview.remove`,`Remove link`),onClick:()=>{d()}},n(`link_off`))),L.createElement(XA,{className:J.popoverArrow}))))},d4=L.forwardRef(({className:e,...t},n)=>L.createElement(`button`,{className:(0,jC.default)(J.actionButton,e),ref:n,...t}));function f4(e){if(!e)return null;let t=TC(e);if(t===null)return null;let n=t.getParent();return DS(n)?n:DS(t)?t:null}var p4=_n(),m4=z({type:`inactive`},e=>{e.pub(Tx,t=>t.registerCommand(Yi,()=>e.getValue(m4).type===`preview`?(e.pub(m4,{type:`inactive`}),!0):!1,1)),e.sub(e.pipe(Ux),t=>{t!==`rich-text`&&e.pub(m4,{type:`inactive`})}),e.pub(Tx,t=>t.registerCommand(zi,t=>t.key===`k`&&(HC?t.metaKey:t.ctrlKey)&&!e.getValue(Mb)&&U(W())?(e.pub(y4),t.stopPropagation(),t.preventDefault(),!0):!1,3)),e.sub(e.pipe(_4,Tn(m4,kb)),([,t,n])=>{if(t.type===`preview`)setTimeout(()=>{n?.getEditorState().read(()=>{let n=mc(t.linkNodeKey),r=DS(n)?n.getTextContent().length>0&&n.getChildrenSize()<=1:!1,i=r&&n?n.getTextContent():``;e.pub(m4,{type:`edit`,initialUrl:t.url,url:t.url,title:t.title,text:i,withAnchorText:r,linkNodeKey:t.linkNodeKey,rectangle:t.rectangle})})});else throw Error(`Cannot switch to edit mode when not in preview mode`)}),e.sub(e.pipe(h4,Tn(kb,m4,Bb)),([t,n,r,i])=>{let a=t.text?.trim()??``,o=t.url?.trim()??``,s=t.title?.trim()??``;if(o!==``){if(i?.isCollapsed()){let e=a||s||o;n?.update(()=>{let t=f4(i);if(!t){let t=ES(o,{title:s});t.append(ho(e)),Jo([t]),t.select()}else if(AS(t)){let e=ES(o,{title:s});e.append(ho(a)),t.replace(e),e.select()}else t.setURL(o),t.setTitle(s),C4(t.getFirstChild(),a)},{discrete:!0})}else n?.update(()=>{C4(i?.anchor.getNode(),a)}),n?.dispatchCommand(jS,{url:o,title:s});e.pub(m4,{type:`preview`,linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:s,url:o})}else r.type===`edit`&&r.initialUrl!==``&&n?.dispatchCommand(jS,null),e.pub(m4,{type:`inactive`})}),e.link(e.pipe(g4,Tn(m4,kb),wn(([,e,t])=>{if(e.type===`edit`)return t?.focus(),e.initialUrl===``?{type:`inactive`}:{type:`preview`,url:e.initialUrl,linkNodeKey:e.linkNodeKey,rectangle:e.rectangle};throw Error(`Cannot cancel edit when not in edit mode`)})),m4),e.link(e.pipe(e.combine(Bb,p4),Tn(kb,m4,Mb),wn(([[e],t,n,r])=>{if(U(e)&&t&&!r){let n=f4(e);if(!e.isCollapsed())return{type:`inactive`};if(n){let e=kC(t);return e?{type:`preview`,url:n.getURL(),linkNodeKey:n.getKey(),title:n.getTitle(),rectangle:e}:{type:`inactive`}}else return{type:`inactive`}}else return{type:`inactive`}})),m4)}),h4=_n(),g4=vn();vn();var _4=vn(),v4=vn(e=>{e.sub(e.pipe(v4,Tn(kb)),([,e])=>{e?.dispatchCommand(jS,null)})}),y4=vn(e=>{e.sub(e.pipe(y4,Tn(Bb,kb),Dn(([,e])=>U(e))),([,t,n])=>{n?.focus(()=>{setTimeout(()=>{n.getEditorState().read(()=>{let r=f4(t),i=kC(n),a=r?.getURL()??``,o=r?.getURL()??``,s=r?.getTitle()??``,c=r?.getKey()??``,l=r?r.getTextContent().length>0&&r.getChildrenSize()<=1:!!t?.isCollapsed(),u=l&&r?r.getTextContent():``;e.pub(m4,{type:`edit`,initialUrl:a,url:o,title:s,text:u,withAnchorText:l,linkNodeKey:c,rectangle:i})})})})})}),b4=z([]),x4=z(null),S4=z(null,e=>{e.pub(Tx,t=>{function n(n){let[r,i]=e.getValues([Mb,S4]);!r||i===null||t.update(()=>{let e=_c(n.target);if(e!==null){let t=ed(e,e=>e instanceof wS);t!==null&&i(n,t,t.getURL())}})}return t.registerRootListener((e,t)=>{e&&e.addEventListener(`click`,n),t&&t.removeEventListener(`click`,n)})})});function C4(e,t){H(e)&&t&&(e.setTextContent(t),e.selectStart())}var w4=z(!0),T4=jn({init(e,t){e.pub(Ox,t?.LinkDialog??u4),e.pub(x4,t?.onClickLinkCallback??null),e.pub(S4,t?.onReadOnlyClickLinkCallback??null),e.pub(w4,t?.showLinkTitleField??!0)},update(e,t={}){e.pub(b4,t.linkAutocompleteSuggestions??[])}});function E4(e,t){return L.forwardRef((n,r)=>{let i=(0,jC.default)(t.className,n.className);return L.createElement(e,{...t,...n,className:i,ref:r})})}function D4(e){return({title:t,children:n,...r})=>L.createElement(e,{"aria-label":t,...r},L.createElement(J2,{title:t},n))}var O4=({readOnly:e,children:t,className:n})=>L.createElement(uM,{className:(0,jC.default)(`mdxeditor-toolbar`,J.toolbarRoot,{[J.readOnlyToolbarRoot]:e},n),...e?{tabIndex:-1}:{}},t),k4=D4(E4(fM,{className:J.toolbarButton,"data-toolbar-item":!0})),A4=E4(mM,{className:J.toolbarToggleItem,"data-toolbar-item":!0});E4(pM,{type:`single`,className:J.toolbarToggleSingleGroup});var j4=L.forwardRef(({on:e,title:t,children:n,disabled:r,...i},a)=>L.createElement(pM,{type:`single`,className:J.toolbarToggleSingleGroup,...i,value:e?`on`:`off`,ref:a},L.createElement(A4,{"aria-label":t,value:`on`,disabled:r},L.createElement(J2,{title:t},n)))),M4=({items:e})=>L.createElement(`div`,{className:J.toolbarGroupOfGroups},e.map((e,t)=>L.createElement(j4,{key:t,title:e.title,on:e.active,onValueChange:t=>{e.onChange(t===`on`)},disabled:e.disabled},e.contents))),N4=({value:e,onChange:t,className:n,ggClassName:r,items:i,disabled:a})=>{let o=Xx();return L.createElement(`div`,{className:(0,jC.default)(J.toolbarGroupOfGroups,r)},L.createElement(pM,{"aria-label":o(`toolbar.toggleGroup`,`toggle group`),type:`single`,className:(0,jC.default)(J.toolbarToggleSingleGroup,n),onValueChange:t,value:e||``,disabled:a,onFocus:e=>{e.preventDefault()}},i.map((e,t)=>L.createElement(A4,{key:t,"aria-label":e.title,value:e.value},L.createElement(J2,{title:e.title},e.contents)))))};function P4(e){return Object.hasOwn(e,`when`)}var F4=({options:e})=>{let t=xn(yx),n=L.useMemo(()=>{let n=e.find(e=>{if(P4(e)){if(e.when(t))return!0}else return!0});return n?P4(n)?n.contents():n.fallback():null},[e,t]);return L.createElement(`div`,{style:{display:`flex`}},n)},I4=dM,L4=z(()=>null),R4=z(``),z4=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",B4=jn({init(e,t){let n=t?.toolbarPosition===`bottom`?Mx:Ax;e.pubIn({[L4]:t?.toolbarContents??z4,[R4]:t?.toolbarClassName??``,[n]:()=>{let[e,t,n]=Sn(L4,Mb,R4);return L.createElement(O4,{className:n,readOnly:t},e())}})},update(e,t){e.pub(L4,t?.toolbarContents??z4),e.pub(R4,t?.toolbarClassName??``)}}),V4=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(t,n=t){return new e(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}};function H4(e,t,n,r,i,a){if(e==r)return[];let o=Q4(e,t,n,r,i,a),s=$4(e,t+o,n,r,i+o,a);t+=o,n-=s,i+=o,a-=s;let c=n-t,l=a-i;if(!c||!l)return[new V4(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new V4(t,t+o,i,i),new V4(t+o+l,n,a,a)]}else if(l>c){let o=r.slice(i,a).indexOf(e.slice(t,n));if(o>-1)return[new V4(t,t,i,i+o),new V4(n,n,i+o+c,a)]}if(c==1||l==1)return[new V4(t,n,i,a)];let u=t3(e,t,n,r,i,a);if(u){let[o,s,c]=u;return H4(e,t,o,r,i,s).concat(H4(e,o+c,n,r,s+c,a))}return K4(e,t,n,r,i,a)}var U4=1e9,W4=0,G4=!1;function K4(e,t,n,r,i,a){let o=n-t,s=a-i;if(U4<1e9&&Math.min(o,s)>U4*16||W4>0&&Date.now()>W4)return Math.min(o,s)>U4*64?[new V4(t,n,i,a)]:n3(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);J4.reset(c),Y4.reset(c);let l=(n,a)=>e.charCodeAt(t+n)==r.charCodeAt(i+a),u=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(a-i-1),d=(o-s)%2==0?null:Y4,f=d?null:J4;for(let p=0;p<c;p++){if(p>U4||W4>0&&!(p&63)&&Date.now()>W4)return n3(e,t,n,r,i,a);let m=J4.advance(p,o,s,c,d,!1,l)||Y4.advance(p,o,s,c,f,!0,u);if(m)return X4(e,t,n,t+m[0],r,i,a,i+m[1])}return[new V4(t,n,i,a)]}var q4=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,a,o){for(let s=-e+this.start;s<=e-this.end;s+=2){let c=r+s,l=s==-e||s!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=l-s;for(;l<t&&u<n&&o(l,u);)l++,u++;if(this.vec[c]=l,l>t)this.end+=2;else if(u>n)this.start+=2;else if(i){let e=r+(t-n)-s;if(e>=0&&e<this.len&&i.vec[e]!=-1)if(a){let n=i.vec[e];if(n>=t-l)return[n,r+n-e]}else{let n=t-i.vec[e];if(l>=n)return[l,u]}}}return null}},J4=new q4,Y4=new q4;function X4(e,t,n,r,i,a,o,s){let c=!1;return!_3(e,r)&&++r==n&&(c=!0),!_3(i,s)&&++s==o&&(c=!0),c?[new V4(t,n,a,o)]:H4(e,t,r,i,a,s).concat(H4(e,r,n,i,s,o))}function Z4(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function Q4(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=Z4(n-t,a-i);for(let s=t,c=i;;){let i=s+o,l=c+o;if(i>n||l>a||e.slice(s,i)!=r.slice(c,l)){if(o==1)return s-t-+!_3(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function $4(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=Z4(n-t,a-i);for(let s=n,c=a;;){let a=s-o,l=c-o;if(a<t||l<i||e.slice(a,s)!=r.slice(l,c)){if(o==1)return n-s-+!_3(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function e3(e,t,n,r,i,a,o,s){let c=r.slice(i,a),l=null;for(;;){if(l||o<s)return l;for(let s=t+o;;){_3(e,s)||s++;let u=s+o;if(_3(e,u)||(u+=u==s+1?1:-1),u>=n)break;let d=e.slice(s,u),f=-1;for(;(f=c.indexOf(d,f+1))!=-1;){let o=Q4(e,u,n,r,i+f+d.length,a),c=$4(e,t,s,r,i,i+f),p=d.length+o+c;(!l||l[2]<p)&&(l=[s-c,i+f-c,p])}s=u}if(s<0)return l;o>>=1}}function t3(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=t3(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:e3(e,t,n,r,i,a,Math.floor(o/4),-1)}function n3(e,t,n,r,i,a){G4=!0;let o=n-t,s=a-i,c;if(o<s){let s=e3(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=e3(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new V4(t,n,i,a)];let[l,u,d]=c;return H4(e,t,l,r,i,u).concat(H4(e,l+d,n,r,u+d,a))}function r3(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new V4(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function i3(e,t,n){for(;;){r3(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=Q4(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new V4(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=$4(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new V4(a.fromA,a.toA-s,a.fromB,a.toB-s));let c=a.toA-a.fromA,l=a.toB-a.fromB;if(c&&l)continue;let u=a.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-a.toA;if(!u||!d)continue;let f=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=f.length&&e.slice(a.fromA-u,a.fromA)==f.slice(f.length-u)?(n[i]=new V4(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),r=!0):d<=f.length&&e.slice(a.toA,a.toA+d)==f.slice(0,d)&&(n[i]=new V4(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function a3(e,t,n){for(let r=0,i=0;i<e.length;i++){let a=e[i],o=a.toA-a.fromA,s=a.toB-a.fromB;if(o&&s||o>3||s>3){let c=i==e.length-1?t.length:e[i+1].fromA,l=a.fromA-r,u=c-a.toA,d=f3(t,a.fromA,l),f=d3(t,a.toA,u),p=a.fromA-d,m=f-a.toA;if((!o||!s)&&p&&m){let l=Math.max(o,s),[u,h,g]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];l>p&&t.slice(d,a.fromA)==u.slice(g-p,g)?(a=e[i]=new V4(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=d3(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new V4(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=f3(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new V4(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=m3(n,a.fromB,a.toB),r,o=t<0?-1:p3(n,a.toB,a.fromB);t>-1&&(r=t-a.fromB)<=u&&n.slice(a.fromB,t)==n.slice(a.toB,a.toB+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toB-o)<=l&&n.slice(a.fromB-r,a.fromB)==n.slice(o,a.toB)&&(a=e[i]=a.offset(-r))}else if(!s){let n=m3(t,a.fromA,a.toA),r,o=n<0?-1:p3(t,a.toA,a.fromA);n>-1&&(r=n-a.fromA)<=u&&t.slice(a.fromA,n)==t.slice(a.toA,a.toA+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toA-o)<=l&&t.slice(a.fromA-r,a.fromA)==t.slice(o,a.toA)&&(a=e[i]=a.offset(-r))}}r=a.toA}return r3(e,3),e}var o3;try{o3=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function s3(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function c3(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!s3(n):o3?!h3(n)||t==e.length-1?+!!o3.test(String.fromCharCode(n)):o3.test(e.slice(t,t+2))?2:0:0}function l3(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!s3(n):o3?!g3(n)||t==1?+!!o3.test(String.fromCharCode(n)):o3.test(e.slice(t-2,t))?2:0:0}var u3=8;function d3(e,t,n){if(t==e.length||!l3(e,t))return t;for(let r=t,i=t+n,a=0;a<u3;a++){let t=c3(e,r);if(!t||r+t>i)return r;r+=t}return t}function f3(e,t,n){if(!t||!c3(e,t))return t;for(let r=t,i=t-n,a=0;a<u3;a++){let t=l3(e,r);if(!t||r-t<i)return r;r-=t}return t}function p3(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function m3(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var h3=e=>e>=55296&&e<=56319,g3=e=>e>=56320&&e<=57343;function _3(e,t){return!t||t==e.length||!h3(e.charCodeAt(t-1))||!g3(e.charCodeAt(t))}function v3(e,t,n){let r=n?.override;return r?r(e,t):(U4=(n?.scanLimit??1e9)>>1,W4=n?.timeout?Date.now()+n.timeout:0,G4=!1,i3(e,t,H4(e,0,e.length,t,0,t.length)))}function y3(){return!G4}function b3(e,t,n){return a3(v3(e,t,n),e,t)}var x3=u.define({combine:e=>e[0]}),S3=S.define(),C3=u.define(),w3=w.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(S3)&&(e=n.value);for(let n of t.state.facet(C3))e=n(e,t);return e}}),T3=class e{constructor(e,t,n,r,i,a=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=a}offset(t,n){return t||n?new e(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return O3(b3(e.toString(),t.toString(),n),e,t,0,0,y3())}static updateA(e,t,n,r,i){return M3(j3(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return M3(j3(e,r,!1,t.length),e,t,n,i)}};function E3(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,a.from]}function D3(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.from==e&&a.from==t?[e,t]:[i.to+1,a.to+1]}function O3(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=E3(c.fromA+r,c.fromB+i,t,n),[d,f]=D3(c.toA+r,c.toB+i,t,n),p=[c.offset(-l+r,-u+i)];for(;s<e.length-1;){let a=e[s+1],[o,c]=E3(a.fromA+r,a.fromB+i,t,n);if(o>d+1&&c>f+1)break;p.push(a.offset(-l+r,-u+i)),[d,f]=D3(a.toA+r,a.toB+i,t,n),s++}o.push(new T3(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var k3=1e3;function A3(e,t,n,r){let i=0,a=e.length;for(;;){if(i==a){let r=0,a=0;i&&({toA:r,toB:a}=e[i-1]);let o=t-(n?r:a);return[r+o,a+o]}let o=i+a>>1,s=e[o],[c,l]=n?[s.fromA,s.toA]:[s.fromB,s.toB];if(c>t)a=o;else if(l<=t)i=o+1;else return r?[s.fromA,s.fromB]:[s.toA,s.toB]}}function j3(e,t,n,r){let i=[];return t.iterChangedRanges((a,o,s,c)=>{let l=0,u=n?t.length:r,d=0,f=n?r:t.length;a>k3&&([l,d]=A3(e,a-k3,n,!0)),o<t.length-k3&&([u,f]=A3(e,o+k3,n,!1));let p=c-s-(o-a),m,[h,g]=n?[p,0]:[0,p];i.length&&(m=i[i.length-1]).toA>=l?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:f,diffA:m.diffA+h,diffB:m.diffB+g}:i.push({fromA:l,toA:u,fromB:d,toB:f,diffA:h,diffB:g})}),i}function M3(e,t,n,r,i){if(!e.length)return t;let a=[];for(let o=0,s=0,c=0,l=0;;o++){let u=o==e.length?null:e[o],d=u?u.fromA+s:n.length,f=u?u.fromB+c:r.length;for(;l<t.length;){let e=t[l];if(u&&(e.toA+s>d||e.toB+c>f))break;a.push(e.offset(s,c)),l++}if(!u)break;let p=u.toA+s+u.diffA,m=u.toB+c+u.diffB,h=b3(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of O3(h,n,r,d,f,y3()))a.push(e);for(s+=u.diffA,c+=u.diffB;l<t.length;){let e=t[l];if(e.fromA+s>p&&e.fromB+c>m)break;l++}}return a}var N3={scanLimit:500},P3=se.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=W3(e))}update(e){(e.docChanged||e.viewportChanged||I3(e.startState,e.state)||L3(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=W3(e.view))}},{decorations:e=>e.deco}),F3=E.low(Ee({class:`cm-changeGutter`,markers:e=>e.plugin(P3)?.gutter||Ae.empty}));function I3(e,t){return e.field(w3,!1)!=t.field(w3,!1)}function L3(e,t){return e.facet(x3)!=t.facet(x3)}var R3=Be.line({class:`cm-changedLine`}),z3=Be.mark({class:`cm-changedText`}),B3=Be.mark({tagName:`ins`,class:`cm-insertedLine`}),V3=Be.mark({tagName:`del`,class:`cm-deletedLine`}),H3=new class extends oe{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function U3(e,t,n,r,i,a){let o=n?e.fromA:e.fromB,s=n?e.toA:e.toB,c=0;if(o!=s){i.add(o,o,R3),i.add(o,s,n?V3:B3),a&&a.add(o,o,H3);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,R3),a&&a.add(u,u,H3);continue}let t=u+l.value.length;if(r)for(;c<e.changes.length;){let r=e.changes[c],a=o+(n?r.fromA:r.fromB),s=o+(n?r.toA:r.toB),l=Math.max(u,a),d=Math.min(t,s);if(l<d&&i.add(l,d,z3),s<t)c++;else break}u=t}}}function W3(e){let t=e.state.field(w3),{side:r,highlightChanges:i,markGutter:a,overrideChunk:o}=e.state.facet(x3),s=r==`a`,c=new n,l=a?new n:null,{from:u,to:d}=e.viewport;for(let n of t){if((s?n.fromA:n.fromB)>=d)break;(s?n.toA:n.toB)>u&&(!o||!o(e.state,n,c,l))&&U3(n,e.state.doc,s,i,c,l)}return{deco:c.finish(),gutter:l&&l.finish()}}var G3=class extends O{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement(`div`);return e.className=`cm-mergeSpacer`,e.style.height=this.height+`px`,e}updateDOM(e){return e.style.height=this.height+`px`,!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},K3=S.define({map:(e,t)=>e.map(t)}),q3=w.define({create:()=>Be.none,update:(e,t)=>{for(let e of t.effects)if(e.is(K3))return e.value;return e.map(t.changes)},provide:e=>P.decorations.from(e)}),J3=.01;function Y3(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function X3(e,t,r){let i=new n,a=new n,o=e.state.field(q3).iter(),s=t.state.field(q3).iter(),c=0,l=0,u=0,d=0,f=e.viewport,p=t.viewport;for(let n=0;;n++){let m=n<r.length?r[n]:null,h=m?m.fromA:e.state.doc.length,g=m?m.fromB:t.state.doc.length;if(c<h){let n=e.lineBlockAt(c).top+u-(t.lineBlockAt(l).top+d);n<-J3?(u-=n,i.add(c,c,Be.widget({widget:new G3(-n),block:!0,side:-1}))):n>J3&&(d+=n,a.add(l,l,Be.widget({widget:new G3(n),block:!0,side:-1})))}if(h>c+1e3&&c<f.from&&h>f.from&&l<p.from&&g>p.from){let e=Math.min(f.from-c,p.from-l);c+=e,l+=e,n--}else if(m)c=m.toA,l=m.toB;else break;for(;o.value&&o.from<c;)u-=o.value.spec.widget.height,o.next();for(;s.value&&s.from<l;)d-=s.value.spec.widget.height,s.next()}for(;o.value;)u-=o.value.spec.widget.height,o.next();for(;s.value;)d-=s.value.spec.widget.height,s.next();let m=e.contentHeight+u-(t.contentHeight+d);m<J3?i.add(e.state.doc.length,e.state.doc.length,Be.widget({widget:new G3(-m),block:!0,side:1})):m>J3&&a.add(t.state.doc.length,t.state.doc.length,Be.widget({widget:new G3(m),block:!0,side:1}));let h=i.finish(),g=a.finish();Y3(h,e.state.field(q3))||e.dispatch({effects:K3.of(h)}),Y3(g,t.state.field(q3))||t.dispatch({effects:K3.of(g)})}var Z3=S.define({map:(e,t)=>t.mapPos(e)}),Q3=class extends O{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement(`div`);return t.className=`cm-collapsedLines`,t.textContent=e.state.phrase(`$ unchanged lines`,this.lines),t.addEventListener(`click`,t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:Z3.of(n)});let{side:r,sibling:i}=e.state.facet(x3);i&&i().dispatch({effects:Z3.of($3(n,e.state.field(w3),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function $3(e,t,n){let r=0,i=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return i+(e-r);[r,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}var e6=w.define({create(e){return Be.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(Z3)&&(e=e.update({filter:e=>e!=n.value}));return e},provide:e=>P.decorations.from(e)});function t6({margin:e=3,minSize:t=4}){return e6.init(n=>n6(n,e,t))}function n6(e,t,r){let i=new n,a=e.facet(x3).side==`a`,o=e.field(w3),s=1;for(let n=0;;n++){let c=n<o.length?o[n]:null,l=n?s+t:1,u=c?e.doc.lineAt(a?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-l+1;if(d>=r&&i.add(e.doc.line(l).from,e.doc.line(u).to,Be.replace({widget:new Q3(d),block:!0})),!c)break;s=e.doc.lineAt(Math.min(e.doc.length,a?c.toA:c.toB)).number}return i.finish()}var r6=P.styleModule.of(new Xe({".cm-mergeView":{overflowY:`auto`},".cm-mergeViewEditors":{display:`flex`,alignItems:`stretch`},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:`hidden`},".cm-merge-revert":{width:`1.6em`,flexGrow:0,flexShrink:0,position:`relative`},".cm-merge-revert button":{position:`absolute`,display:`block`,width:`100%`,boxSizing:`border-box`,textAlign:`center`,background:`none`,border:`none`,font:`inherit`,cursor:`pointer`}})),i6=P.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:`auto !important`,overflowY:`visible !important`},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:`rgba(160, 128, 100, .08)`},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:`rgba(100, 160, 128, .08)`},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat`},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat`},"&light.cm-merge-b .cm-changedText":{background:`linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat`},"&dark.cm-merge-b .cm-changedText":{background:`linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat`},"&.cm-merge-b .cm-deletedText":{background:`#ff000033`},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:`none`},".cm-deletedChunk":{paddingLeft:`6px`,"& .cm-chunkButtons":{position:`absolute`,insetInlineEnd:`5px`},"& button":{border:`none`,cursor:`pointer`,color:`white`,margin:`0 2px`,borderRadius:`3px`,"&[name=accept]":{background:`#2a2`},"&[name=reject]":{background:`#d43`}}},".cm-collapsedLines":{padding:`5px 5px 5px 10px`,cursor:`pointer`,"&:before":{content:`"⦚"`,marginInlineEnd:`7px`},"&:after":{content:`"⦚"`,marginInlineStart:`7px`}},"&light .cm-collapsedLines":{color:`#444`,background:`linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)`},"&dark .cm-collapsedLines":{color:`#ddd`,background:`linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)`},".cm-changeGutter":{width:`3px`,paddingLeft:`1px`},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:`#e43`},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:`#fa9`},"&light.cm-merge-b .cm-changedLineGutter":{background:`#2b2`},"&dark.cm-merge-b .cm-changedLineGutter":{background:`#8f8`},".cm-inlineChangedLineGutter":{background:`#75d`}}),a6=new o,o6=new o,s6=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||N3;let t=[E.low(P3),i6,r6,q3,P.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(K3)))&&this.measure()})],n=[x3.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(F3);let r=te.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],P.editorAttributes.of({class:`cm-merge-a`}),o6.of(n),t]}),i=[x3.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(F3);let a=te.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],P.editorAttributes.of({class:`cm-merge-b`}),o6.of(i),t]});this.chunks=T3.build(r.doc,a.doc,this.diffConf);let o=[w3.init(()=>this.chunks),a6.of(e.collapseUnchanged?t6(e.collapseUnchanged):[])];r=r.update({effects:S.appendConfig.of(o)}).state,a=a.update({effects:S.appendConfig.of(o)}).state,this.dom=document.createElement(`div`),this.dom.className=`cm-mergeView`,this.editorDOM=this.dom.appendChild(document.createElement(`div`)),this.editorDOM.className=`cm-mergeViewEditors`;let s=e.orientation||`a-b`,c=document.createElement(`div`);c.className=`cm-mergeViewEditor`;let l=document.createElement(`div`);l.className=`cm-mergeViewEditor`,this.editorDOM.appendChild(s==`a-b`?c:l),this.editorDOM.appendChild(s==`a-b`?l:c),this.a=new P({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new P({state:a,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls==`b-to-a`,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),$e.empty(e[0].startState.doc.length));this.chunks=t==this.a?T3.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):T3.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:S3.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:S3.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if(`diffConfig`in e&&(this.diffConf=e.diffConfig),`orientation`in e){let t=e.orientation!=`b-a`;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent=``)}}if(`revertControls`in e||`renderRevertControl`in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;`revertControls`in e&&(t=!!e.revertControls,n=e.revertControls==`b-to-a`),`renderRevertControl`in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t=`highlightChanges`in e,n=`gutter`in e,r=`collapseUnchanged`in e;if(t||n||r){let i=[],a=[];if(t||n){let r=this.a.state.facet(x3),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(o6.reconfigure([x3.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?F3:[]])),a.push(o6.reconfigure([x3.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?F3:[]]))}if(r){let t=a6.reconfigure(e.collapseUnchanged?t6(e.collapseUnchanged):[]);i.push(t),a.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement(`div`),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener(`mousedown`,e=>this.revertClicked(e)),this.revertDOM.className=`cm-merge-revert`):this.revertDOM&&(this.revertDOM.textContent=``)}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){X3(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let a=this.chunks[i];if(a.fromA>n.to||a.fromB>r.to)break;if(a.fromA<n.from||a.fromB<r.from)continue;let o=this.a.lineBlockAt(a.fromA).top+`px`;for(;t&&+t.dataset.chunk<i;)t=c6(t);t&&t.dataset.chunk==String(i)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,i),t)}for(;t;)t=c6(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement(`button`);let e=this.a.state.phrase(`Revert this chunk`);n.setAttribute(`aria-label`,e),n.setAttribute(`title`,e),n.textContent=this.revertToLeft?`⇜`:`⇝`}return n.style.top=e,n.setAttribute(`data-chunk`,String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,a,o,s]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],c=t.state.sliceDoc(i,Math.max(i,a-1));i!=a&&s<=r.state.doc.length&&(c+=t.state.lineBreak),r.dispatch({changes:{from:o,to:Math.min(r.state.doc.length,s),insert:c},userEvent:`revert`}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function c6(e){let t=e.nextSibling;return e.remove(),t}var l6=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,i,a,o,s){this.type=e,this.value=t,this.from=n,this.hash=i,this.end=a,this.children=o,this.positions=s,this.hashProp=[[r.contextHash,i]]}addChild(e,t){e.prop(r.contextHash)!=this.hash&&(e=new p(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new p(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new p(m.none,e,t,n,this.hashProp)})}},$;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})($||={});var u6=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},d6=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return h6(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function f6(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==$.OrderedList?S6:x6)(n,t,!1);return r>0&&(e.type!=$.BulletList||y6(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var p6={[$.Blockquote](e,t,n){return n.next==62?(n.markers.push(X6($.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(m6(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[$.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[$.OrderedList]:f6,[$.BulletList]:f6,[$.Document](){return!0}};function m6(e){return e==32||e==9||e==10||e==13}function h6(e,t=0){for(;t<e.length&&m6(e.charCodeAt(t));)t++;return t}function g6(e,t,n){for(;t>n&&m6(e.charCodeAt(t-1));)t--;return t}function _6(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function v6(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function y6(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!m6(n))return-1}return n&&e.next==45&&w6(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(I6.SetextHeading)>-1||r<3?-1:1}function b6(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function x6(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||m6(e.text.charCodeAt(e.pos+1)))&&(!n||b6(t,$.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function S6(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!m6(e.text.charCodeAt(r+1))||n&&!b6(t,$.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function C6(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function w6(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&m6(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var T6=/^[ \t]*$/,E6=/-->/,D6=/\?>/,O6=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,E6],[/^\s*<\?/,D6],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,T6],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,T6]];function k6(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=O6.length-+!!n;e<t;e++)if(O6[e][0].test(r))return e;return-1}function A6(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function j6(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==$.CodeText?e[r].to=n:e.push(X6($.CodeText,t,n))}var M6={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(j6(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){j6(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==$.CodeText?j6(o,e.from,e.to):o.push(e);s=[]}j6(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&j6(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=$.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish($.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=_6(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=g6(t.text,t.text.length,o),c=[X6($.CodeMark,r,r+a)];o<s&&c.push(X6($.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&j6(c,e.lineStart-1,e.lineStart),c.push(X6($.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(j6(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(j6(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish($.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=v6(t);return n<0?!1:(e.startContext($.Blockquote,t.pos),e.addNode($.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(y6(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode($.HorizontalRule,n),!0},BulletList(e,t){let n=x6(t,e,!1);if(n<0)return!1;e.block.type!=$.BulletList&&e.startContext($.BulletList,t.basePos,t.next);let r=A6(t,t.pos+1);return e.startContext($.ListItem,t.basePos,r-t.baseIndent),e.addNode($.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=S6(t,e,!1);if(n<0)return!1;e.block.type!=$.OrderedList&&e.startContext($.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=A6(t,t.pos+n);return e.startContext($.ListItem,t.basePos,r-t.baseIndent),e.addNode($.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=C6(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=g6(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!m6(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write($.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write($.HeaderMark,o-r,a-r);let c=s.finish($.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=k6(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=O6[n][1],a=[],o=i!=T6;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==E6?$.CommentBlock:i==D6?$.ProcessingInstructionBlock:$.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},N6=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
188
188
  `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&h6(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,X6($.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(c8(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(X6($.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(o8(e,h6(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=h6(e,this.pos),n=0;if(t>this.pos){let r=s8(e,t,this.start);if(r){let t=P6(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=P6(e,this.pos),n>0&&n<e.length?n:-1}else return P6(e,this.pos)}};function P6(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!m6(n))return-1}return t}var F6=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:w6(t),i=t.next;if(r<0)return!1;let a=X6($.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,X6(i==61?$.SetextHeading1:$.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},I6={LinkReference(e,t){return t.content.charCodeAt(0)==91?new N6(t):null},SetextHeading(){return new F6}},L6=[(e,t)=>C6(t)>=0,(e,t)=>_6(t)>=0,(e,t)=>v6(t)>=0,(e,t)=>x6(t,e,!0)>=0,(e,t)=>S6(t,e,!0)>=0,(e,t)=>y6(t,e,!0)>=0,(e,t)=>k6(t,e,!0)>=0],R6={text:``,end:0},z6=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new d6,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=l6.create($.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new f8(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new u6(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
189
189
  `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=p8(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=R6;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+$[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
@@ -198,5 +198,5 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
198
198
  `),r=[];for(let e of n)r.push(`> `+e);return r.join(`
199
199
  `)},regExp:i7,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if($d(n))return n.splice(n.getChildrenSize(),0,[Xa(),...t]),void e.remove()}let i=Qd();i.append(...t),e.replace(i),r||i.select(0,0)},type:`element`},f7={dependencies:[j5],export:e=>{if(!N5(e))return null;let t=e.getTextContent();return"```"+(e.getLanguage()||``)+(t?`
200
200
  `+t:``)+"\n```"},regExpEnd:{optional:!0,regExp:o7},regExpStart:a7,replace:(e,t,n,r,i,a)=>{let o,s;if(!t&&i){if(i.length===1)r?(o=M5(),s=n[1]+i[0]):(o=M5(n[1]),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{if(o=M5(n[1]),i[0].trim().length===0)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(` `)?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();s=i.join(`
201
- `)}let t=ho(s);o.append(t),e.append(o)}else t&&s7((e=>M5(e?e[1]:void 0)))(e,t,n,a)},type:`multiline-element`},p7={dependencies:[aC,eC],export:(e,t)=>dC(e)?l7(e,t,0):null,regExp:t7,replace:c7(`bullet`),type:`element`},m7={dependencies:[aC,eC],export:(e,t)=>dC(e)?l7(e,t,0):null,regExp:n7,replace:c7(`check`),type:`element`},h7={dependencies:[aC,eC],export:(e,t)=>dC(e)?l7(e,t,0):null,regExp:e7,replace:c7(`number`),type:`element`},g7={format:[`code`],tag:"`",type:`text-format`},_7={format:[`highlight`],tag:`==`,type:`text-format`},v7={format:[`bold`,`italic`],tag:`***`,type:`text-format`},y7={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},b7={format:[`bold`],tag:`**`,type:`text-format`},x7={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},S7={format:[`strikethrough`],tag:`~~`,type:`text-format`},C7={format:[`italic`],tag:`*`,type:`text-format`},w7={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`},T7={dependencies:[wS],export:(e,t,n)=>{if(!DS(e)||AS(e))return null;let r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{let[,n,r,i]=t,a=ES(r,{title:i}),o=n.split(`[`).length-1,s=n.split(`]`).length-1,c=n,l=``;if(o<s)return;if(o>s){let e=n.split(`[`);l=`[`+e[0],c=e.slice(1).join(`[`)}let u=ho(c);return u.setFormat(e.getFormat()),a.append(u),e.replace(a),l&&a.insertBefore(ho(l)),u},trigger:`)`,type:`text-match`},E7=[u7,d7,p7,h7],D7=[f7],O7=[g7,v7,y7,b7,x7,_7,C7,w7,S7],k7=[T7],A7=[...E7,...D7,...O7,...k7],j7=[{dependencies:[tw],export:e=>iw(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=rw();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},...A7];function M7({transformers:e=j7}){let[t]=Fn();return(0,L.useEffect)((()=>$5(t,e)),[t,e]),null}var N7=jn({init(e){let t=e.getValue(Gx),n=L7(t,t.includes(`headings`)?e.getValue(YC):[]),r=n.filter(e=>!I7.has(e));e.pubIn({[Ox]:()=>L.createElement(M7,{transformers:n}),[Fx]:()=>L.createElement(M7,{transformers:n}),[Lx]:()=>L.createElement(M7,{transformers:r})})}}),P7=e=>(t,n,r)=>{let i=e(r);i.append(...n),t.replace(i),i.select(0,0)},F7={dependencies:[tw],export:e=>iw(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=rw();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},I7=new Set([h7,p7,m7]);function L7(e,t){let n=[v7,y7,b7,x7,g7,C7,w7];if(e.includes(`headings`)){let e=Math.min(...t),r=Math.max(...t),i=RegExp(`^(#{${e},${r}})\\s`),a={dependencies:[ef],export:(e,t)=>{if(!of(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:i,replace:P7(e=>af(`h${e[1].length}`)),type:`element`};n.push(a)}if(e.includes(`thematicBreak`)&&n.push(F7),e.includes(`quote`)&&n.push(d7),e.includes(`link`)&&n.push(T7),e.includes(`lists`)&&n.push(h7,p7,m7),e.includes(`codeblock`)){let e={...f7,dependencies:[$U],replace:(e,t,n)=>{let r=iW({code:``,language:n[1]??``,meta:``});e.selectPrevious(),e.replace(r),setTimeout(()=>{r.select()},80)}};n.push(e)}return n}var R7=()=>{let e=Cn(Vx),t=xn(Bx),n=xn(Gx),r=n.includes(`quote`),i=n.includes(`headings`),a=Xx();if(!r&&!i)return null;let o=[{label:a(`toolbar.blockTypes.paragraph`,`Paragraph`),value:`paragraph`}];if(r&&o.push({label:a(`toolbar.blockTypes.quote`,`Quote`),value:`quote`}),i){let e=xn(YC);o.push(...e.map(e=>({label:a(`toolbar.blockTypes.heading`,`Heading {{level}}`,{level:e}),value:`h${e}`})))}return L.createElement(Q2,{value:t,onChange:t=>{switch(t){case`quote`:e(()=>Qd());break;case`paragraph`:e(()=>zs());break;case``:break;default:if(t.startsWith(`h`))e(()=>af(t));else throw Error(`Unknown block type: ${t}`)}},triggerTitle:a(`toolbar.blockTypeSelect.selectBlockTypeTooltip`,`Select block type`),placeholder:a(`toolbar.blockTypeSelect.placeholder`,`Block type`),items:o})},z7=({format:e,addTitle:t,removeTitle:n,icon:r,formatName:i})=>{let[a,o]=Sn(Ib,xx),s=Cn(zb),c=(a&e)!==0;return L.createElement(j4,{title:c?n:t,on:c,onValueChange:()=>{s(i)}},o(r))},B7=({options:e})=>{let t=Xx(),n=e===void 0;return L.createElement(`div`,{className:J.toolbarGroupOfGroups},n||e.includes(`Bold`)?L.createElement(z7,{format:1,addTitle:t(`toolbar.bold`,`Bold`),removeTitle:t(`toolbar.removeBold`,`Remove bold`),icon:`format_bold`,formatName:`bold`}):null,n||e.includes(`Italic`)?L.createElement(z7,{format:2,addTitle:t(`toolbar.italic`,`Italic`),removeTitle:t(`toolbar.removeItalic`,`Remove italic`),icon:`format_italic`,formatName:`italic`}):null,n||e.includes(`Underline`)?L.createElement(z7,{format:8,addTitle:t(`toolbar.underline`,`Underline`),removeTitle:t(`toolbar.removeUnderline`,`Remove underline`),icon:`format_underlined`,formatName:`underline`}):null)},V7=({options:e})=>{let t=Xx(),n=e===void 0;return L.createElement(`div`,{className:J.toolbarGroupOfGroups},n||e.includes(`Strikethrough`)?L.createElement(z7,{format:4,addTitle:t(`toolbar.strikethrough`,`Strikethrough`),removeTitle:t(`toolbar.removeStrikethrough`,`Remove strikethrough`),icon:`strikeThrough`,formatName:`strikethrough`}):null,n||e.includes(`Sup`)?L.createElement(z7,{format:64,addTitle:t(`toolbar.superscript`,`Superscript`),removeTitle:t(`toolbar.removeSuperscript`,`Remove superscript`),icon:`superscript`,formatName:`superscript`}):null,n||e.includes(`Sub`)?L.createElement(z7,{format:32,addTitle:t(`toolbar.subscript`,`Subscript`),removeTitle:t(`toolbar.removeSubscript`,`Remove subscript`),icon:`subscript`,formatName:`subscript`}):null)},H7=()=>{let[e,t,n]=Sn(yx,kb,r4),r=aW(e.rootNode)?e.rootNode:null,i=Xx();if(!r)return null;let{value:a,items:o}=n4(n,r.getLanguage());return L.createElement(`div`,{className:J.selectWithLabel},L.createElement(`label`,null,i(`codeBlock.language`,`Code block language`)),L.createElement(Q2,{value:a||`__EMPTY_VALUE__`,onChange:e=>{t?.update(()=>{r.setLanguage(e===`__EMPTY_VALUE__`?``:e),setTimeout(()=>{t.update(()=>{r.getLatest().select()})})})},triggerTitle:i(`codeBlock.selectLanguage`,`Select code block language`),placeholder:i(`codeBlock.language`,`Code block language`),items:o}))},U7=()=>{let[e,t]=Sn(Ib,xx),n=Cn(zb),r=Xx(),i=(e&16)!=0,a=i?r(`toolbar.removeInlineCode`,`Remove code format`):r(`toolbar.inlineCode`,`Inline code format`);return L.createElement(M4,{items:[{title:a,contents:t(`code`),active:i,onChange:n.bind(null,`code`)}]})},W7=()=>{let e=Cn(y4),t=xn(xx),n=Xx();return L.createElement(k4,{"aria-label":n(`toolbar.link`,`Create link`),title:n(`toolbar.link`,`Create link`),onClick:t=>{e()}},t(`link`))},G7=({children:e,SourceToolbar:t,options:n=[`rich-text`,`diff`,`source`]})=>{let[r,i]=Sn(Ux,xx),a=Cn(Ux),o=Xx(),s=[];return n.includes(`rich-text`)&&s.push({title:o(`toolbar.richText`,`Rich text`),contents:i(`rich_text`),value:`rich-text`}),n.includes(`diff`)&&s.push({title:o(`toolbar.diffMode`,`Diff mode`),contents:i(`difference`),value:`diff`}),n.includes(`source`)&&s.push({title:o(`toolbar.source`,`Source mode`),contents:i(`markdown`),value:`source`}),L.createElement(L.Fragment,null,r===`rich-text`?e:r===`diff`?L.createElement(`span`,{className:J.toolbarTitleMode},o(`toolbar.diffMode`,`Diff mode`)):t??L.createElement(`span`,{className:J.toolbarTitleMode},o(`toolbar.source`,`Source mode`)),L.createElement(`div`,{className:J.diffSourceToggleWrapper},L.createElement(N4,{className:J.diffSourceToggle,ggClassName:J.ggDiffSourceToggle,value:r,items:s,onChange:e=>{a(e===``?`rich-text`:e)}})))},K7=()=>{let e=Cn(uW),t=xn(xx),n=Xx();return L.createElement(k4,{title:n(`toolbar.codeBlock`,`Insert Code Block`),onClick:()=>{e({})}},t(`frame_source`))},q7=()=>{let e=Cn(HU),[t,n]=Sn(WU,xx),r=Xx();return L.createElement(k4,{title:t?r(`toolbar.editFrontmatter`,`Edit frontmatter`):r(`toolbar.insertFrontmatter`,`Insert frontmatter`),className:(0,jC.default)({[J.activeToolbarButton]:t}),onClick:()=>{e()}},n(`frontmatter`))},J7=L.forwardRef((e,t)=>{let n=Cn(iz),[r,i]=Sn(Mb,xx),a=Xx();return L.createElement(fM,{"aria-label":a(`toolbar.image`,`Insert image`),className:J.toolbarButton,ref:t,disabled:r,onClick:()=>{n()}},L.createElement(J2,{title:a(`toolbar.image`,`Insert image`)},i(`add_photo`)))}),Y7=()=>{let e=xn(xx),t=Cn(IM),n=Xx(),r=xn(Rx);return L.createElement(k4,{title:n(`toolbar.table`,`Insert Table`),onClick:()=>{t({rows:3,columns:3})},...r?{"aria-disabled":!0,"data-disabled":!0,disabled:!0}:{}},e(`table`))},X7=()=>{let e=Cn(cw),t=xn(xx),n=Xx();return L.createElement(k4,{title:n(`toolbar.thematicBreak`,`Insert thematic break`),onClick:()=>{e()}},t(`horizontal_rule`))},Z7={bullet:`format_list_bulleted`,number:`format_list_numbered`,check:`format_list_checked`},Q7=({options:e=[`bullet`,`number`,`check`]})=>{let[t,n,r]=Sn(Ow,xx,Rx),i=Cn(kw),a=Xx(),o={bullet:a(`toolbar.bulletedList`,`Bulleted list`),number:a(`toolbar.numberedList`,`Numbered list`),check:a(`toolbar.checkList`,`Check list`)},s=e.map(e=>({value:e,title:o[e],contents:n(Z7[e])}));return L.createElement(N4,{value:t||``,items:s,onChange:i,disabled:r})},$7=()=>{let[e,t]=Sn(xx,kb),[n,r]=L.useState(!1),[i,a]=L.useState(!1),o=Xx();return L.useEffect(()=>{if(t)return Ku(t.registerCommand(fa,e=>(r(e),!1),4),t.registerCommand(da,e=>(a(e),!1),4))},[t]),L.createElement(M4,{items:[{title:o(`toolbar.undo`,`Undo {{shortcut}}`,{shortcut:HC?`⌘Z`:`Ctrl+Z`}),disabled:!n,contents:e(`undo`),active:!1,onChange:()=>t?.dispatchCommand(Li,void 0)},{title:o(`toolbar.redo`,`Redo {{shortcut}}`,{shortcut:HC?`⌘Y`:`Ctrl+Y`}),disabled:!i,contents:e(`redo`),active:!1,onChange:()=>t?.dispatchCommand(Ri,void 0)}]})},e9=900,t9={txt:`Text`,text:`Text`,plaintext:`Plain Text`,md:`Markdown`,tsx:`TSX`,ts:`TypeScript`,js:`JavaScript`,json:`JSON`,css:`CSS`,bash:`Bash`,sh:`Shell`,shell:`Shell`,yaml:`YAML`,yml:`YAML`,toml:`TOML`,cron:`Cron`};function n9(e){let t=e,n=!1;for(;;){let e=t.getParent();if(e===null||el(e))return null;let r=t.getNextSibling();if(r!==null)return!n&&H(r)?null:{parent:e,offset:t.getIndexWithinParent()+1};if(!e.isInline())return{parent:e,offset:t.getIndexWithinParent()+1};t=e,n=!0}}var r9=jn({init(e){e.pub(wx,e=>e.registerCommand(Bi,t=>{let n=t;if(n.shiftKey||n.altKey||n.ctrlKey||n.metaKey)return!1;let r=!1;return e.update(()=>{let e=W();if(!U(e)||!e.isCollapsed()||e.anchor.type!==`text`)return;let t=e.anchor.getNode();if(!H(t)||!(t.getFormat()&16)||e.anchor.offset!==t.getTextContentSize())return;let n=n9(t);n&&(e.anchor.set(n.parent.getKey(),n.offset,`element`),e.focus.set(n.parent.getKey(),n.offset,`element`),e.setFormat(e.format&-17),r=!0)}),r?(n.preventDefault(),!0):!1},3))}});function i9(){return(0,R.jsx)(F4,{options:[{when:e=>e?.editorType===`codeblock`,contents:()=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(H7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(K7,{})]})},{fallback:()=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(B7,{options:[`Bold`,`Italic`]}),(0,R.jsx)(V7,{options:[`Strikethrough`]}),(0,R.jsx)(U7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(R7,{}),(0,R.jsx)(Q7,{}),(0,R.jsx)(W7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(J7,{}),(0,R.jsx)(Y7,{}),(0,R.jsx)(X7,{}),(0,R.jsx)(K7,{}),(0,R.jsx)(q7,{})]})}]})}var a9=(0,L.memo)((0,L.forwardRef)(function({documentKey:e,initialMarkdown:t,onPersist:n,onSaveStateChange:r,readOnly:i=!1,ariaLabel:a=`Markdown editor`},o){let s=(0,L.useRef)(null),c=(0,L.useRef)(null),l=(0,L.useRef)(e),u=(0,L.useRef)(t),d=(0,L.useRef)(t),f=(0,L.useRef)(null),p=(0,L.useRef)(null),m=(0,L.useRef)(null),[h,g]=(0,L.useState)(`rich`),[_,v]=(0,L.useState)(t),[y,b]=(0,L.useState)(0),[x,S]=(0,L.useState)(!1),[C,w]=(0,L.useState)(null),T=(0,L.useCallback)(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),E=(0,L.useCallback)(async()=>{if(i){r(`saved`);return}p.current&&await p.current;let e=u.current;if(e===d.current){r(`saved`);return}r(`saving`),f.current=e;let t=(async()=>{await n(e),d.current=e})();p.current=t;try{if(await t,u.current===d.current){r(`saved`);return}await E()}catch(e){throw r(`error`),e instanceof Error?e:Error(`Autosave failed`)}finally{p.current===t&&(p.current=null,f.current=null)}},[n,r,i]),ee=(0,L.useCallback)(()=>{i||(T(),m.current=window.setTimeout(()=>{m.current=null,E().catch(()=>void 0)},e9))},[T,E,i]),D=(0,L.useCallback)((e,t)=>{if(u.current=e,v(e),t){d.current=e,r(`saved`);return}if(i){r(`saved`);return}if(e===d.current){T(),r(`saved`);return}r(`idle`),ee()},[T,r,i,ee]),O=(0,L.useMemo)(()=>[XC(),Aw(),JU(),lw(),aN(),T4(),fz(),LM(),fW({defaultCodeBlockLanguage:`txt`,codeBlockEditorDescriptors:[{priority:-10,match:()=>!0,Editor:$2}]}),s4({codeBlockLanguages:t9}),GU(),E5({viewMode:`rich-text`}),N7(),r9(),B4({toolbarContents:()=>(0,R.jsx)(G7,{options:[`rich-text`,`source`],children:(0,R.jsx)(i9,{})})})],[]);(0,L.useImperativeHandle)(o,()=>({flushSave:async()=>{T(),await E()},getMarkdown:()=>u.current})),(0,L.useEffect)(()=>()=>T(),[T]),(0,L.useEffect)(()=>{let n=l.current!==e,i=t!==d.current,a=!n&&p.current!==null&&t===f.current;!n&&!i||a||(l.current=e,T(),p.current=null,f.current=null,u.current=t,d.current=t,v(t),g(`rich`),n||b(e=>e+1),r(`saved`))},[e,t,r,T]),(0,L.useEffect)(()=>{if(!x)return;let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let t=e=>{e.key===`Escape`&&(e.preventDefault(),S(!1))};window.addEventListener(`keydown`,t);let n=window.requestAnimationFrame(()=>{h===`plain`||i?c.current?.focus({preventScroll:!0}):s.current?.focus(void 0,{preventScroll:!0})});return()=>{window.cancelAnimationFrame(n),window.removeEventListener(`keydown`,t),document.body.style.overflow=e}},[h,x,i]);let k=h===`plain`||i?(0,R.jsxs)(`div`,{className:`markdown-editor__plain-fallback`,children:[(0,R.jsx)(`p`,{className:`markdown-editor__plain-notice`,children:i?`This document is read-only. Create a managed copy to edit it.`:`The rich editor could not safely load this document. You are editing raw Markdown.`}),(0,R.jsx)(`textarea`,{ref:c,className:`markdown-editor__plain-textarea`,"aria-label":`${a} source`,value:i?t:_,readOnly:i,onChange:e=>{if(i)return;let t=e.currentTarget.value;if(v(t),u.current=t,t===d.current){T(),r(`saved`);return}r(`idle`),ee()},spellCheck:!1})]}):(0,R.jsx)(BC,{ref:s,className:`markdown-editor__mdx`,markdown:t,onChange:D,onError:e=>{console.error(`MDXEditor error`,e.error);let t=e.source||u.current;u.current=t,v(t),g(`plain`)},contentEditableClassName:`markdown-editor__content`,placeholder:(0,R.jsx)(`span`,{children:`Start writing Markdown…`}),overlayContainer:C,plugins:O},`${e}:${y}`);return(0,R.jsxs)(R.Fragment,{children:[x?(0,R.jsx)(`button`,{type:`button`,className:`markdown-editor__backdrop`,"aria-label":`Exit focused Markdown editor`,onClick:()=>S(!1)}):null,(0,R.jsxs)(`div`,{ref:w,className:`markdown-editor-shell${x?` markdown-editor-shell--expanded`:``}`,"aria-label":a,"data-expanded":x?`true`:`false`,"data-read-only":i?`true`:`false`,children:[(0,R.jsxs)(`div`,{className:`markdown-editor__utility-bar`,children:[(0,R.jsxs)(`div`,{className:`markdown-editor__identity`,children:[(0,R.jsx)(jt,{size:14,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:`Markdown`}),(0,R.jsx)(`span`,{className:`markdown-editor__mode-label`,children:i?`Read only`:h===`plain`?`Source fallback`:`Rich + source`})]}),(0,R.jsxs)(`button`,{type:`button`,className:`markdown-editor__expand-button`,"aria-label":x?`Exit focused editor`:`Open focused editor`,"aria-pressed":x,title:x?`Exit focused editor (Esc)`:`Open focused editor`,onClick:()=>S(e=>!e),children:[x?(0,R.jsx)(Pt,{size:16,"aria-hidden":`true`}):(0,R.jsx)(Nt,{size:16,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:x?`Exit focus`:`Focus`})]})]}),k]})]})}));function o9(){let e=(0,L.useRef)(null),t=(0,L.useRef)(`saved`),[n,r]=(0,L.useState)([]),[i,a]=(0,L.useState)(null),[o,s]=(0,L.useState)(null),[c,l]=(0,L.useState)([]),[u,d]=(0,L.useState)(null),[f,p]=(0,L.useState)(`saved`),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)(!0),[b,x]=(0,L.useState)(!1),[S,C]=(0,L.useState)(``),[w,T]=(0,L.useState)(`global`),[E,ee]=(0,L.useState)(``),[D,O]=(0,L.useState)(``);(0,L.useEffect)(()=>{t.current=f},[f]);let k=(0,L.useCallback)(async e=>{if(s(e),a(e.key),h(null),_(null),!e.managed){l([]),d(null);return}let[t,n]=await Promise.all([qt(e.key),e.sourceRef?Jt(e.key).catch(()=>null):Promise.resolve(null)]);l(t.revisions),d(n)},[]),A=(0,L.useCallback)(async()=>{let e=await Bt();r(e),a(t=>t??e[0]?.key??null)},[]),j=(0,L.useCallback)(async e=>{await k(await Vt(e))},[k]);(0,L.useEffect)(()=>{A().catch(e=>_(e instanceof Error?e.message:String(e))).finally(()=>y(!1))},[A]),(0,L.useEffect)(()=>{if(!i){s(null);return}j(i).catch(e=>_(e instanceof Error?e.message:String(e)))},[i,j]),(0,L.useEffect)(()=>{let e=new EventSource(`/api/context-files/events`);return e.addEventListener(`pibo-product`,e=>{let n=d9(e);if(!n?.type.startsWith(`context-file.`))return;A().catch(e=>_(e instanceof Error?e.message:String(e)));let r=n.payload?.key;if(!(!r||r!==i)&&n.source!==`web`){if(t.current===`idle`||t.current===`saving`){h(`This file changed on disk while you had local edits. Review before saving again.`);return}j(r).catch(e=>_(e instanceof Error?e.message:String(e)))}}),e.onerror=()=>{_(`Live context-file updates disconnected.`)},()=>e.close()},[j,A,i]);let M=(0,L.useMemo)(()=>n.find(e=>e.key===i)??null,[n,i]);(0,L.useEffect)(()=>{O(o?.agentProfileName??``)},[o?.agentProfileName,o?.key]);let N=(0,L.useCallback)(async t=>{try{await e.current?.flushSave(),a(t)}catch(e){_(e instanceof Error?e.message:String(e))}},[]),te=(0,L.useCallback)(async()=>{try{let e=await Ht({label:S,scope:w,agentProfileName:w===`agent`?E:void 0,markdown:``});C(``),ee(``),await A(),await k(e),_(null)}catch(e){_(e instanceof Error?e.message:String(e))}},[E,S,w,k,A]),ne=(0,L.useCallback)(async e=>{if(o)try{await k(await Wt(o.key,{markdown:e,expectedVersion:o.version})),h(null),await A()}catch(e){throw f9(e)&&(await k(e.data.file),h(`The file changed before save. The editor reloaded the latest disk version.`)),e}},[o,k,A]),re=(0,L.useCallback)(async()=>{i&&(await j(i),await A())},[j,A,i]),ie=(0,L.useCallback)(async()=>{if(M?.removable)try{await Kt(M.key,!0),a(null),s(null),await A(),_(null)}catch(e){_(e instanceof Error?e.message:String(e))}},[A,M]),ae=(0,L.useCallback)(async e=>{if(o?.managed)try{await k(await Gt(o.key,{scope:e,agentProfileName:e===`agent`?D:void 0})),await A(),_(null)}catch(e){_(e instanceof Error?e.message:String(e))}},[o,k,D,A]),oe=(0,L.useCallback)(async()=>{if(!(!M||M.source!==`plugin`)){x(!0);try{let e=await Ut(M.key);await A(),await k(e),_(null)}catch(e){_(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[k,A,M]),P=(0,L.useCallback)(async()=>{if(!(!o?.managed||!o.sourceRef)){x(!0);try{let e=await Yt(o.key);await A(),await k(e)}catch(e){_(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[o,k,A]),se=(0,L.useCallback)(async()=>{if(!(!o?.managed||o.linkState!==`linked-stale`)){x(!0);try{let e=await Xt(o.key);await A(),await k(e)}catch(e){_(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[o,k,A]),ce=(0,L.useCallback)(async e=>{if(o?.managed){x(!0);try{let t=await Zt(o.key,e);await A(),await k(t)}catch(e){_(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[o,k,A]);return(0,R.jsxs)(`div`,{className:`app-shell`,children:[(0,R.jsxs)(`aside`,{className:`sidebar`,children:[(0,R.jsxs)(`div`,{className:`sidebar-header`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`eyebrow`,children:`Pibo`}),(0,R.jsx)(`h1`,{children:`Context Files`})]}),(0,R.jsx)(`a`,{className:`chat-link`,href:`/apps/chat`,children:`Chat`})]}),(0,R.jsxs)(`section`,{className:`tool-panel`,children:[(0,R.jsxs)(`div`,{className:`segmented`,children:[(0,R.jsxs)(`button`,{className:w===`global`?`active`:``,type:`button`,onClick:()=>T(`global`),children:[(0,R.jsx)(At,{size:15}),`Global`]}),(0,R.jsxs)(`button`,{className:w===`agent`?`active`:``,type:`button`,onClick:()=>T(`agent`),children:[(0,R.jsx)(Mt,{size:15}),`Agent`]})]}),(0,R.jsx)(`input`,{value:S,onChange:e=>C(e.currentTarget.value),placeholder:`Context file name`}),w===`agent`?(0,R.jsx)(`input`,{value:E,onChange:e=>ee(e.currentTarget.value),placeholder:`agent-profile-name`}):null,(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:!S.trim()||w===`agent`&&!E.trim(),onClick:()=>void te(),children:`Create File`})]}),(0,R.jsxs)(`section`,{className:`file-list`,"aria-label":`Context files`,children:[(0,R.jsxs)(`div`,{className:`list-title`,children:[(0,R.jsx)(Mt,{size:15}),(0,R.jsxs)(`span`,{children:[n.length,` files`]})]}),v?(0,R.jsx)(`div`,{className:`empty`,children:`Loading`}):null,n.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:e.key===i?`file-row selected`:`file-row`,onClick:()=>void N(e.key),children:[(0,R.jsx)(`span`,{className:`file-name`,children:e.label||e.key}),(0,R.jsx)(`span`,{className:`file-path`,children:e.path}),(0,R.jsx)(`span`,{className:`scope-badge scope-badge--${e.scope}`,children:l9(e)}),(0,R.jsx)(`span`,{className:`scope-badge scope-badge--${e.scope}`,children:u9(e.linkState)}),e.exists?null:(0,R.jsx)(`span`,{className:`missing`,children:`missing`})]},e.key)),!v&&n.length===0?(0,R.jsx)(`div`,{className:`empty`,children:`No context files registered`}):null]})]}),(0,R.jsxs)(`main`,{className:`editor-pane`,children:[(0,R.jsxs)(`header`,{className:`editor-header`,children:[(0,R.jsxs)(`div`,{className:`editor-title`,children:[(0,R.jsx)(`p`,{className:`eyebrow`,children:M?l9(M):`Context File`}),(0,R.jsx)(`h2`,{children:o?.label||o?.key||`No file selected`}),o?(0,R.jsx)(`p`,{className:`path-line`,children:o.path}):null]}),(0,R.jsxs)(`div`,{className:`editor-actions`,children:[(0,R.jsxs)(`span`,{className:`save-pill save-pill--${f}`,children:[(0,R.jsx)(It,{size:15}),c9(f)]}),(0,R.jsx)(`button`,{className:`icon-button`,type:`button`,title:`Reload`,onClick:()=>void re(),children:(0,R.jsx)(Ft,{size:16})}),(0,R.jsx)(`button`,{className:`icon-button danger`,type:`button`,title:`Remove managed file`,disabled:!M?.removable,onClick:()=>void ie(),children:(0,R.jsx)(Lt,{size:16})})]})]}),g?(0,R.jsx)(s9,{tone:`error`,text:g}):null,m?(0,R.jsx)(s9,{tone:`warning`,text:m}):null,o?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsxs)(`div`,{children:[`State: `,(0,R.jsx)(`strong`,{children:u9(o.linkState)})]}),o.sourceRef?(0,R.jsxs)(`div`,{children:[`Source: `,(0,R.jsx)(`code`,{children:o.sourceRef})]}):null,o.sourceHash?(0,R.jsxs)(`div`,{children:[`Hash: `,(0,R.jsx)(`code`,{children:o.sourceHash})]}):null]}):null,o?.source===`plugin`?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsx)(`div`,{children:`This is a plugin-owned source file. Create a managed copy before editing.`}),(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:b,onClick:()=>void oe(),children:`Create Managed Copy`})]}):null,o?.managed?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsxs)(`div`,{className:`segmented`,children:[(0,R.jsx)(`button`,{type:`button`,className:o.scope===`global`?`active`:``,onClick:()=>void ae(`global`),children:`Global`}),(0,R.jsx)(`button`,{type:`button`,className:o.scope===`agent`?`active`:``,onClick:()=>void ae(`agent`),disabled:!D.trim(),children:`Agent`})]}),(0,R.jsx)(`input`,{value:D,onChange:e=>O(e.currentTarget.value),placeholder:`agent-profile-name`}),o.sourceRef?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:b,onClick:()=>void P(),children:`Reset To Source`}),o.linkState===`linked-stale`?(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:b,onClick:()=>void se(),children:`Adopt Source`}):null]}):null]}):null,o?.exists?(0,R.jsx)(`div`,{className:`editor-frame`,children:(0,R.jsx)(a9,{ref:e,documentKey:o.key,initialMarkdown:o.markdown,onPersist:ne,onSaveStateChange:p,readOnly:!o.editable,ariaLabel:o.label?`${o.label} Markdown editor`:`Context file Markdown editor`})}):(0,R.jsxs)(`div`,{className:`empty-editor`,children:[(0,R.jsx)(Rt,{size:20}),o?`The selected file is missing on disk.`:`Select or create a context file.`]}),o?.managed&&c.length>0?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsx)(`h3`,{children:`Revisions`}),(0,R.jsx)(`div`,{className:`file-list`,children:c.map(e=>(0,R.jsxs)(`div`,{className:`file-row`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`strong`,{children:e.kind}),` `,e.active?`(active)`:``]}),(0,R.jsx)(`div`,{children:e.note??e.id}),(0,R.jsx)(`div`,{children:e.createdAt}),e.active?null:(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:b,onClick:()=>void ce(e.id),children:`Restore`})]},e.id))})]}):null,o?.managed&&u?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsx)(`h3`,{children:`Diff`}),(0,R.jsx)(`div`,{className:`file-list`,children:u.chunks.map((e,t)=>(0,R.jsx)(`pre`,{className:`file-row`,children:e.lines.map(t=>`${e.type===`add`?`+`:e.type===`remove`?`-`:` `} ${t}`).join(`
201
+ `)}let t=ho(s);o.append(t),e.append(o)}else t&&s7((e=>M5(e?e[1]:void 0)))(e,t,n,a)},type:`multiline-element`},p7={dependencies:[aC,eC],export:(e,t)=>dC(e)?l7(e,t,0):null,regExp:t7,replace:c7(`bullet`),type:`element`},m7={dependencies:[aC,eC],export:(e,t)=>dC(e)?l7(e,t,0):null,regExp:n7,replace:c7(`check`),type:`element`},h7={dependencies:[aC,eC],export:(e,t)=>dC(e)?l7(e,t,0):null,regExp:e7,replace:c7(`number`),type:`element`},g7={format:[`code`],tag:"`",type:`text-format`},_7={format:[`highlight`],tag:`==`,type:`text-format`},v7={format:[`bold`,`italic`],tag:`***`,type:`text-format`},y7={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},b7={format:[`bold`],tag:`**`,type:`text-format`},x7={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},S7={format:[`strikethrough`],tag:`~~`,type:`text-format`},C7={format:[`italic`],tag:`*`,type:`text-format`},w7={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`},T7={dependencies:[wS],export:(e,t,n)=>{if(!DS(e)||AS(e))return null;let r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.*?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{let[,n,r,i]=t,a=ES(r,{title:i}),o=n.split(`[`).length-1,s=n.split(`]`).length-1,c=n,l=``;if(o<s)return;if(o>s){let e=n.split(`[`);l=`[`+e[0],c=e.slice(1).join(`[`)}let u=ho(c);return u.setFormat(e.getFormat()),a.append(u),e.replace(a),l&&a.insertBefore(ho(l)),u},trigger:`)`,type:`text-match`},E7=[u7,d7,p7,h7],D7=[f7],O7=[g7,v7,y7,b7,x7,_7,C7,w7,S7],k7=[T7],A7=[...E7,...D7,...O7,...k7],j7=[{dependencies:[tw],export:e=>iw(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=rw();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},...A7];function M7({transformers:e=j7}){let[t]=Fn();return(0,L.useEffect)((()=>$5(t,e)),[t,e]),null}var N7=jn({init(e){let t=e.getValue(Gx),n=L7(t,t.includes(`headings`)?e.getValue(YC):[]),r=n.filter(e=>!I7.has(e));e.pubIn({[Ox]:()=>L.createElement(M7,{transformers:n}),[Fx]:()=>L.createElement(M7,{transformers:n}),[Lx]:()=>L.createElement(M7,{transformers:r})})}}),P7=e=>(t,n,r)=>{let i=e(r);i.append(...n),t.replace(i),i.select(0,0)},F7={dependencies:[tw],export:e=>iw(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=rw();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},I7=new Set([h7,p7,m7]);function L7(e,t){let n=[v7,y7,b7,x7,g7,C7,w7];if(e.includes(`headings`)){let e=Math.min(...t),r=Math.max(...t),i=RegExp(`^(#{${e},${r}})\\s`),a={dependencies:[ef],export:(e,t)=>{if(!of(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:i,replace:P7(e=>af(`h${e[1].length}`)),type:`element`};n.push(a)}if(e.includes(`thematicBreak`)&&n.push(F7),e.includes(`quote`)&&n.push(d7),e.includes(`link`)&&n.push(T7),e.includes(`lists`)&&n.push(h7,p7,m7),e.includes(`codeblock`)){let e={...f7,dependencies:[$U],replace:(e,t,n)=>{let r=iW({code:``,language:n[1]??``,meta:``});e.selectPrevious(),e.replace(r),setTimeout(()=>{r.select()},80)}};n.push(e)}return n}var R7=()=>{let e=Cn(Vx),t=xn(Bx),n=xn(Gx),r=n.includes(`quote`),i=n.includes(`headings`),a=Xx();if(!r&&!i)return null;let o=[{label:a(`toolbar.blockTypes.paragraph`,`Paragraph`),value:`paragraph`}];if(r&&o.push({label:a(`toolbar.blockTypes.quote`,`Quote`),value:`quote`}),i){let e=xn(YC);o.push(...e.map(e=>({label:a(`toolbar.blockTypes.heading`,`Heading {{level}}`,{level:e}),value:`h${e}`})))}return L.createElement(Q2,{value:t,onChange:t=>{switch(t){case`quote`:e(()=>Qd());break;case`paragraph`:e(()=>zs());break;case``:break;default:if(t.startsWith(`h`))e(()=>af(t));else throw Error(`Unknown block type: ${t}`)}},triggerTitle:a(`toolbar.blockTypeSelect.selectBlockTypeTooltip`,`Select block type`),placeholder:a(`toolbar.blockTypeSelect.placeholder`,`Block type`),items:o})},z7=({format:e,addTitle:t,removeTitle:n,icon:r,formatName:i})=>{let[a,o]=Sn(Ib,xx),s=Cn(zb),c=(a&e)!==0;return L.createElement(j4,{title:c?n:t,on:c,onValueChange:()=>{s(i)}},o(r))},B7=({options:e})=>{let t=Xx(),n=e===void 0;return L.createElement(`div`,{className:J.toolbarGroupOfGroups},n||e.includes(`Bold`)?L.createElement(z7,{format:1,addTitle:t(`toolbar.bold`,`Bold`),removeTitle:t(`toolbar.removeBold`,`Remove bold`),icon:`format_bold`,formatName:`bold`}):null,n||e.includes(`Italic`)?L.createElement(z7,{format:2,addTitle:t(`toolbar.italic`,`Italic`),removeTitle:t(`toolbar.removeItalic`,`Remove italic`),icon:`format_italic`,formatName:`italic`}):null,n||e.includes(`Underline`)?L.createElement(z7,{format:8,addTitle:t(`toolbar.underline`,`Underline`),removeTitle:t(`toolbar.removeUnderline`,`Remove underline`),icon:`format_underlined`,formatName:`underline`}):null)},V7=({options:e})=>{let t=Xx(),n=e===void 0;return L.createElement(`div`,{className:J.toolbarGroupOfGroups},n||e.includes(`Strikethrough`)?L.createElement(z7,{format:4,addTitle:t(`toolbar.strikethrough`,`Strikethrough`),removeTitle:t(`toolbar.removeStrikethrough`,`Remove strikethrough`),icon:`strikeThrough`,formatName:`strikethrough`}):null,n||e.includes(`Sup`)?L.createElement(z7,{format:64,addTitle:t(`toolbar.superscript`,`Superscript`),removeTitle:t(`toolbar.removeSuperscript`,`Remove superscript`),icon:`superscript`,formatName:`superscript`}):null,n||e.includes(`Sub`)?L.createElement(z7,{format:32,addTitle:t(`toolbar.subscript`,`Subscript`),removeTitle:t(`toolbar.removeSubscript`,`Remove subscript`),icon:`subscript`,formatName:`subscript`}):null)},H7=()=>{let[e,t,n]=Sn(yx,kb,r4),r=aW(e.rootNode)?e.rootNode:null,i=Xx();if(!r)return null;let{value:a,items:o}=n4(n,r.getLanguage());return L.createElement(`div`,{className:J.selectWithLabel},L.createElement(`label`,null,i(`codeBlock.language`,`Code block language`)),L.createElement(Q2,{value:a||`__EMPTY_VALUE__`,onChange:e=>{t?.update(()=>{r.setLanguage(e===`__EMPTY_VALUE__`?``:e),setTimeout(()=>{t.update(()=>{r.getLatest().select()})})})},triggerTitle:i(`codeBlock.selectLanguage`,`Select code block language`),placeholder:i(`codeBlock.language`,`Code block language`),items:o}))},U7=()=>{let[e,t]=Sn(Ib,xx),n=Cn(zb),r=Xx(),i=(e&16)!=0,a=i?r(`toolbar.removeInlineCode`,`Remove code format`):r(`toolbar.inlineCode`,`Inline code format`);return L.createElement(M4,{items:[{title:a,contents:t(`code`),active:i,onChange:n.bind(null,`code`)}]})},W7=()=>{let e=Cn(y4),t=xn(xx),n=Xx();return L.createElement(k4,{"aria-label":n(`toolbar.link`,`Create link`),title:n(`toolbar.link`,`Create link`),onClick:t=>{e()}},t(`link`))},G7=({children:e,SourceToolbar:t,options:n=[`rich-text`,`diff`,`source`]})=>{let[r,i]=Sn(Ux,xx),a=Cn(Ux),o=Xx(),s=[];return n.includes(`rich-text`)&&s.push({title:o(`toolbar.richText`,`Rich text`),contents:i(`rich_text`),value:`rich-text`}),n.includes(`diff`)&&s.push({title:o(`toolbar.diffMode`,`Diff mode`),contents:i(`difference`),value:`diff`}),n.includes(`source`)&&s.push({title:o(`toolbar.source`,`Source mode`),contents:i(`markdown`),value:`source`}),L.createElement(L.Fragment,null,r===`rich-text`?e:r===`diff`?L.createElement(`span`,{className:J.toolbarTitleMode},o(`toolbar.diffMode`,`Diff mode`)):t??L.createElement(`span`,{className:J.toolbarTitleMode},o(`toolbar.source`,`Source mode`)),L.createElement(`div`,{className:J.diffSourceToggleWrapper},L.createElement(N4,{className:J.diffSourceToggle,ggClassName:J.ggDiffSourceToggle,value:r,items:s,onChange:e=>{a(e===``?`rich-text`:e)}})))},K7=()=>{let e=Cn(uW),t=xn(xx),n=Xx();return L.createElement(k4,{title:n(`toolbar.codeBlock`,`Insert Code Block`),onClick:()=>{e({})}},t(`frame_source`))},q7=()=>{let e=Cn(HU),[t,n]=Sn(WU,xx),r=Xx();return L.createElement(k4,{title:t?r(`toolbar.editFrontmatter`,`Edit frontmatter`):r(`toolbar.insertFrontmatter`,`Insert frontmatter`),className:(0,jC.default)({[J.activeToolbarButton]:t}),onClick:()=>{e()}},n(`frontmatter`))},J7=L.forwardRef((e,t)=>{let n=Cn(iz),[r,i]=Sn(Mb,xx),a=Xx();return L.createElement(fM,{"aria-label":a(`toolbar.image`,`Insert image`),className:J.toolbarButton,ref:t,disabled:r,onClick:()=>{n()}},L.createElement(J2,{title:a(`toolbar.image`,`Insert image`)},i(`add_photo`)))}),Y7=()=>{let e=xn(xx),t=Cn(IM),n=Xx(),r=xn(Rx);return L.createElement(k4,{title:n(`toolbar.table`,`Insert Table`),onClick:()=>{t({rows:3,columns:3})},...r?{"aria-disabled":!0,"data-disabled":!0,disabled:!0}:{}},e(`table`))},X7=()=>{let e=Cn(cw),t=xn(xx),n=Xx();return L.createElement(k4,{title:n(`toolbar.thematicBreak`,`Insert thematic break`),onClick:()=>{e()}},t(`horizontal_rule`))},Z7={bullet:`format_list_bulleted`,number:`format_list_numbered`,check:`format_list_checked`},Q7=({options:e=[`bullet`,`number`,`check`]})=>{let[t,n,r]=Sn(Ow,xx,Rx),i=Cn(kw),a=Xx(),o={bullet:a(`toolbar.bulletedList`,`Bulleted list`),number:a(`toolbar.numberedList`,`Numbered list`),check:a(`toolbar.checkList`,`Check list`)},s=e.map(e=>({value:e,title:o[e],contents:n(Z7[e])}));return L.createElement(N4,{value:t||``,items:s,onChange:i,disabled:r})},$7=()=>{let[e,t]=Sn(xx,kb),[n,r]=L.useState(!1),[i,a]=L.useState(!1),o=Xx();return L.useEffect(()=>{if(t)return Ku(t.registerCommand(fa,e=>(r(e),!1),4),t.registerCommand(da,e=>(a(e),!1),4))},[t]),L.createElement(M4,{items:[{title:o(`toolbar.undo`,`Undo {{shortcut}}`,{shortcut:HC?`⌘Z`:`Ctrl+Z`}),disabled:!n,contents:e(`undo`),active:!1,onChange:()=>t?.dispatchCommand(Li,void 0)},{title:o(`toolbar.redo`,`Redo {{shortcut}}`,{shortcut:HC?`⌘Y`:`Ctrl+Y`}),disabled:!i,contents:e(`redo`),active:!1,onChange:()=>t?.dispatchCommand(Ri,void 0)}]})},e9=900,t9={txt:`Text`,text:`Text`,plaintext:`Plain Text`,md:`Markdown`,tsx:`TSX`,ts:`TypeScript`,js:`JavaScript`,json:`JSON`,css:`CSS`,bash:`Bash`,sh:`Shell`,shell:`Shell`,yaml:`YAML`,yml:`YAML`,toml:`TOML`,cron:`Cron`};function n9(e){let t=e,n=!1;for(;;){let e=t.getParent();if(e===null||el(e))return null;let r=t.getNextSibling();if(r!==null)return!n&&H(r)?null:{parent:e,offset:t.getIndexWithinParent()+1};if(!e.isInline())return{parent:e,offset:t.getIndexWithinParent()+1};t=e,n=!0}}var r9=jn({init(e){e.pub(wx,e=>e.registerCommand(Bi,t=>{let n=t;if(n.shiftKey||n.altKey||n.ctrlKey||n.metaKey)return!1;let r=!1;return e.update(()=>{let e=W();if(!U(e)||!e.isCollapsed()||e.anchor.type!==`text`)return;let t=e.anchor.getNode();if(!H(t)||!(t.getFormat()&16)||e.anchor.offset!==t.getTextContentSize())return;let n=n9(t);n&&(e.anchor.set(n.parent.getKey(),n.offset,`element`),e.focus.set(n.parent.getKey(),n.offset,`element`),e.setFormat(e.format&-17),r=!0)}),r?(n.preventDefault(),!0):!1},3))}});function i9(){return(0,R.jsx)(F4,{options:[{when:e=>e?.editorType===`codeblock`,contents:()=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(H7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(K7,{})]})},{fallback:()=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(B7,{options:[`Bold`,`Italic`]}),(0,R.jsx)(V7,{options:[`Strikethrough`]}),(0,R.jsx)(U7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(R7,{}),(0,R.jsx)(Q7,{}),(0,R.jsx)(W7,{}),(0,R.jsx)(I4,{}),(0,R.jsx)(J7,{}),(0,R.jsx)(Y7,{}),(0,R.jsx)(X7,{}),(0,R.jsx)(K7,{}),(0,R.jsx)(q7,{})]})}]})}var a9=(0,L.memo)((0,L.forwardRef)(function({documentKey:e,initialMarkdown:t,onPersist:n,onSaveStateChange:r,readOnly:i=!1,ariaLabel:a=`Markdown editor`},o){let s=(0,L.useRef)(null),c=(0,L.useRef)(null),l=(0,L.useRef)(e),u=(0,L.useRef)(t),d=(0,L.useRef)(t),f=(0,L.useRef)(null),p=(0,L.useRef)(null),m=(0,L.useRef)(null),[h,g]=(0,L.useState)(`rich`),[_,v]=(0,L.useState)(t),[y,b]=(0,L.useState)(0),[x,S]=(0,L.useState)(!1),[C,w]=(0,L.useState)(null),T=(0,L.useCallback)(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),E=(0,L.useCallback)(async()=>{if(i){r(`saved`);return}p.current&&await p.current;let e=u.current;if(e===d.current){r(`saved`);return}r(`saving`),f.current=e;let t=(async()=>{await n(e),d.current=e})();p.current=t;try{if(await t,u.current===d.current){r(`saved`);return}await E()}catch(e){throw r(`error`),e instanceof Error?e:Error(`Autosave failed`)}finally{p.current===t&&(p.current=null,f.current=null)}},[n,r,i]),ee=(0,L.useCallback)(()=>{i||(T(),m.current=window.setTimeout(()=>{m.current=null,E().catch(()=>void 0)},e9))},[T,E,i]),D=(0,L.useCallback)((e,t)=>{if(u.current=e,v(e),t){d.current=e,r(`saved`);return}if(i){r(`saved`);return}if(e===d.current){T(),r(`saved`);return}r(`idle`),ee()},[T,r,i,ee]),O=(0,L.useMemo)(()=>[XC(),Aw(),JU(),lw(),aN(),T4(),fz(),LM(),fW({defaultCodeBlockLanguage:`txt`,codeBlockEditorDescriptors:[{priority:-10,match:()=>!0,Editor:$2}]}),s4({codeBlockLanguages:t9}),GU(),E5({viewMode:`rich-text`}),N7(),r9(),B4({toolbarContents:()=>(0,R.jsx)(G7,{options:[`rich-text`,`source`],children:(0,R.jsx)(i9,{})})})],[]);(0,L.useImperativeHandle)(o,()=>({flushSave:async()=>{T(),await E()},getMarkdown:()=>u.current})),(0,L.useEffect)(()=>()=>T(),[T]),(0,L.useEffect)(()=>{let n=l.current!==e,i=t!==d.current,a=!n&&p.current!==null&&t===f.current;!n&&!i||a||(l.current=e,T(),p.current=null,f.current=null,u.current=t,d.current=t,v(t),g(`rich`),n||b(e=>e+1),r(`saved`))},[e,t,r,T]),(0,L.useEffect)(()=>{if(!x)return;let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let t=e=>{e.key===`Escape`&&(e.preventDefault(),S(!1))};window.addEventListener(`keydown`,t);let n=window.requestAnimationFrame(()=>{h===`plain`||i?c.current?.focus({preventScroll:!0}):s.current?.focus(void 0,{preventScroll:!0})});return()=>{window.cancelAnimationFrame(n),window.removeEventListener(`keydown`,t),document.body.style.overflow=e}},[h,x,i]);let k=h===`plain`||i?(0,R.jsxs)(`div`,{className:`markdown-editor__plain-fallback`,children:[(0,R.jsx)(`p`,{className:`markdown-editor__plain-notice`,children:i?`This document is read-only. Create a managed copy to edit it.`:`The rich editor could not safely load this document. You are editing raw Markdown.`}),(0,R.jsx)(`textarea`,{ref:c,className:`markdown-editor__plain-textarea`,"aria-label":`${a} source`,value:i?t:_,readOnly:i,onChange:e=>{if(i)return;let t=e.currentTarget.value;if(v(t),u.current=t,t===d.current){T(),r(`saved`);return}r(`idle`),ee()},spellCheck:!1})]}):(0,R.jsx)(BC,{ref:s,className:`markdown-editor__mdx`,markdown:t,onChange:D,onError:e=>{console.error(`MDXEditor error`,e.error);let t=e.source||u.current;u.current=t,v(t),g(`plain`)},contentEditableClassName:`markdown-editor__content`,placeholder:(0,R.jsx)(`span`,{children:`Type # + Space for a heading or - + Space for a list…`}),overlayContainer:C,plugins:O},`${e}:${y}`);return(0,R.jsxs)(R.Fragment,{children:[x?(0,R.jsx)(`button`,{type:`button`,className:`markdown-editor__backdrop`,"aria-label":`Exit focused Markdown editor`,onClick:()=>S(!1)}):null,(0,R.jsxs)(`div`,{ref:w,className:`markdown-editor-shell${x?` markdown-editor-shell--expanded`:``}`,"aria-label":a,"data-expanded":x?`true`:`false`,"data-read-only":i?`true`:`false`,children:[(0,R.jsxs)(`div`,{className:`markdown-editor__utility-bar`,children:[(0,R.jsxs)(`div`,{className:`markdown-editor__identity`,children:[(0,R.jsx)(jt,{size:14,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:`Markdown`}),(0,R.jsx)(`span`,{className:`markdown-editor__mode-label`,children:i?`Read only`:h===`plain`?`Source fallback`:`Rich + source`})]}),(0,R.jsxs)(`button`,{type:`button`,className:`markdown-editor__expand-button`,"aria-label":x?`Exit focused editor`:`Open focused editor`,"aria-pressed":x,title:x?`Exit focused editor (Esc)`:`Open focused editor`,onClick:()=>S(e=>!e),children:[x?(0,R.jsx)(Pt,{size:16,"aria-hidden":`true`}):(0,R.jsx)(Nt,{size:16,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:x?`Exit focus`:`Focus`})]})]}),k]})]})}));function o9(){let e=(0,L.useRef)(null),t=(0,L.useRef)(`saved`),[n,r]=(0,L.useState)([]),[i,a]=(0,L.useState)(null),[o,s]=(0,L.useState)(null),[c,l]=(0,L.useState)([]),[u,d]=(0,L.useState)(null),[f,p]=(0,L.useState)(`saved`),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)(!0),[b,x]=(0,L.useState)(!1),[S,C]=(0,L.useState)(``),[w,T]=(0,L.useState)(`global`),[E,ee]=(0,L.useState)(``),[D,O]=(0,L.useState)(``);(0,L.useEffect)(()=>{t.current=f},[f]);let k=(0,L.useCallback)(async e=>{if(s(e),a(e.key),h(null),_(null),!e.managed){l([]),d(null);return}let[t,n]=await Promise.all([qt(e.key),e.sourceRef?Jt(e.key).catch(()=>null):Promise.resolve(null)]);l(t.revisions),d(n)},[]),A=(0,L.useCallback)(async()=>{let e=await Bt();r(e),a(t=>t??e[0]?.key??null)},[]),j=(0,L.useCallback)(async e=>{await k(await Vt(e))},[k]);(0,L.useEffect)(()=>{A().catch(e=>_(e instanceof Error?e.message:String(e))).finally(()=>y(!1))},[A]),(0,L.useEffect)(()=>{if(!i){s(null);return}j(i).catch(e=>_(e instanceof Error?e.message:String(e)))},[i,j]),(0,L.useEffect)(()=>{let e=new EventSource(`/api/context-files/events`);return e.addEventListener(`pibo-product`,e=>{let n=d9(e);if(!n?.type.startsWith(`context-file.`))return;A().catch(e=>_(e instanceof Error?e.message:String(e)));let r=n.payload?.key;if(!(!r||r!==i)&&n.source!==`web`){if(t.current===`idle`||t.current===`saving`){h(`This file changed on disk while you had local edits. Review before saving again.`);return}j(r).catch(e=>_(e instanceof Error?e.message:String(e)))}}),e.onerror=()=>{_(`Live context-file updates disconnected.`)},()=>e.close()},[j,A,i]);let M=(0,L.useMemo)(()=>n.find(e=>e.key===i)??null,[n,i]);(0,L.useEffect)(()=>{O(o?.agentProfileName??``)},[o?.agentProfileName,o?.key]);let N=(0,L.useCallback)(async t=>{try{await e.current?.flushSave(),a(t)}catch(e){_(e instanceof Error?e.message:String(e))}},[]),te=(0,L.useCallback)(async()=>{try{await e.current?.flushSave();let t=await Ht({label:S,scope:w,agentProfileName:w===`agent`?E:void 0,markdown:``});C(``),ee(``),await A(),await k(t),_(null)}catch(e){_(e instanceof Error?e.message:String(e))}},[E,S,w,k,A]),ne=(0,L.useCallback)(async e=>{if(o)try{await k(await Wt(o.key,{markdown:e,expectedVersion:o.version})),h(null),await A()}catch(e){throw f9(e)&&(await k(e.data.file),h(`The file changed before save. The editor reloaded the latest disk version.`)),e}},[o,k,A]),re=(0,L.useCallback)(async()=>{i&&(await j(i),await A())},[j,A,i]),ie=(0,L.useCallback)(async()=>{if(M?.removable)try{await Kt(M.key,!0),a(null),s(null),await A(),_(null)}catch(e){_(e instanceof Error?e.message:String(e))}},[A,M]),ae=(0,L.useCallback)(async e=>{if(o?.managed)try{await k(await Gt(o.key,{scope:e,agentProfileName:e===`agent`?D:void 0})),await A(),_(null)}catch(e){_(e instanceof Error?e.message:String(e))}},[o,k,D,A]),oe=(0,L.useCallback)(async()=>{if(!(!M||M.source!==`plugin`)){x(!0);try{let e=await Ut(M.key);await A(),await k(e),_(null)}catch(e){_(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[k,A,M]),P=(0,L.useCallback)(async()=>{if(!(!o?.managed||!o.sourceRef)){x(!0);try{let e=await Yt(o.key);await A(),await k(e)}catch(e){_(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[o,k,A]),se=(0,L.useCallback)(async()=>{if(!(!o?.managed||o.linkState!==`linked-stale`)){x(!0);try{let e=await Xt(o.key);await A(),await k(e)}catch(e){_(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[o,k,A]),ce=(0,L.useCallback)(async e=>{if(o?.managed){x(!0);try{let t=await Zt(o.key,e);await A(),await k(t)}catch(e){_(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[o,k,A]);return(0,R.jsxs)(`div`,{className:`app-shell`,children:[(0,R.jsxs)(`aside`,{className:`sidebar`,children:[(0,R.jsxs)(`div`,{className:`sidebar-header`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`eyebrow`,children:`Pibo`}),(0,R.jsx)(`h1`,{children:`Context Files`})]}),(0,R.jsx)(`a`,{className:`chat-link`,href:`/apps/chat`,children:`Chat`})]}),(0,R.jsxs)(`section`,{className:`tool-panel`,children:[(0,R.jsxs)(`div`,{className:`segmented`,children:[(0,R.jsxs)(`button`,{className:w===`global`?`active`:``,type:`button`,onClick:()=>T(`global`),children:[(0,R.jsx)(At,{size:15}),`Global`]}),(0,R.jsxs)(`button`,{className:w===`agent`?`active`:``,type:`button`,onClick:()=>T(`agent`),children:[(0,R.jsx)(Mt,{size:15}),`Agent`]})]}),(0,R.jsx)(`input`,{value:S,onChange:e=>C(e.currentTarget.value),placeholder:`Context file name`}),w===`agent`?(0,R.jsx)(`input`,{value:E,onChange:e=>ee(e.currentTarget.value),placeholder:`agent-profile-name`}):null,(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:!S.trim()||w===`agent`&&!E.trim(),onClick:()=>void te(),children:`Create File`})]}),(0,R.jsxs)(`section`,{className:`file-list`,"aria-label":`Context files`,children:[(0,R.jsxs)(`div`,{className:`list-title`,children:[(0,R.jsx)(Mt,{size:15}),(0,R.jsxs)(`span`,{children:[n.length,` files`]})]}),v?(0,R.jsx)(`div`,{className:`empty`,children:`Loading`}):null,n.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:e.key===i?`file-row selected`:`file-row`,onClick:()=>void N(e.key),children:[(0,R.jsx)(`span`,{className:`file-name`,children:e.label||e.key}),(0,R.jsx)(`span`,{className:`file-path`,children:e.path}),(0,R.jsx)(`span`,{className:`scope-badge scope-badge--${e.scope}`,children:l9(e)}),(0,R.jsx)(`span`,{className:`scope-badge scope-badge--${e.scope}`,children:u9(e.linkState)}),e.exists?null:(0,R.jsx)(`span`,{className:`missing`,children:`missing`})]},e.key)),!v&&n.length===0?(0,R.jsx)(`div`,{className:`empty`,children:`No context files registered`}):null]})]}),(0,R.jsxs)(`main`,{className:`editor-pane`,children:[(0,R.jsxs)(`header`,{className:`editor-header`,children:[(0,R.jsxs)(`div`,{className:`editor-title`,children:[(0,R.jsx)(`p`,{className:`eyebrow`,children:M?l9(M):`Context File`}),(0,R.jsx)(`h2`,{children:o?.label||o?.key||`No file selected`}),o?(0,R.jsx)(`p`,{className:`path-line`,children:o.path}):null]}),(0,R.jsxs)(`div`,{className:`editor-actions`,children:[(0,R.jsxs)(`span`,{className:`save-pill save-pill--${f}`,children:[(0,R.jsx)(It,{size:15}),c9(f)]}),(0,R.jsx)(`button`,{className:`icon-button`,type:`button`,title:`Reload`,onClick:()=>void re(),children:(0,R.jsx)(Ft,{size:16})}),(0,R.jsx)(`button`,{className:`icon-button danger`,type:`button`,title:`Remove managed file`,disabled:!M?.removable,onClick:()=>void ie(),children:(0,R.jsx)(Lt,{size:16})})]})]}),g?(0,R.jsx)(s9,{tone:`error`,text:g}):null,m?(0,R.jsx)(s9,{tone:`warning`,text:m}):null,o?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsxs)(`div`,{children:[`State: `,(0,R.jsx)(`strong`,{children:u9(o.linkState)})]}),o.sourceRef?(0,R.jsxs)(`div`,{children:[`Source: `,(0,R.jsx)(`code`,{children:o.sourceRef})]}):null,o.sourceHash?(0,R.jsxs)(`div`,{children:[`Hash: `,(0,R.jsx)(`code`,{children:o.sourceHash})]}):null]}):null,o?.source===`plugin`?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsx)(`div`,{children:`This is a plugin-owned source file. Create a managed copy before editing.`}),(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:b,onClick:()=>void oe(),children:`Create Managed Copy`})]}):null,o?.managed?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsxs)(`div`,{className:`segmented`,children:[(0,R.jsx)(`button`,{type:`button`,className:o.scope===`global`?`active`:``,onClick:()=>void ae(`global`),children:`Global`}),(0,R.jsx)(`button`,{type:`button`,className:o.scope===`agent`?`active`:``,onClick:()=>void ae(`agent`),disabled:!D.trim(),children:`Agent`})]}),(0,R.jsx)(`input`,{value:D,onChange:e=>O(e.currentTarget.value),placeholder:`agent-profile-name`}),o.sourceRef?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:b,onClick:()=>void P(),children:`Reset To Source`}),o.linkState===`linked-stale`?(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:b,onClick:()=>void se(),children:`Adopt Source`}):null]}):null]}):null,o?.exists?(0,R.jsx)(`div`,{className:`editor-frame`,children:(0,R.jsx)(a9,{ref:e,documentKey:o.key,initialMarkdown:o.markdown,onPersist:ne,onSaveStateChange:p,readOnly:!o.editable,ariaLabel:o.label?`${o.label} Markdown editor`:`Context file Markdown editor`})}):(0,R.jsxs)(`div`,{className:`empty-editor`,children:[(0,R.jsx)(Rt,{size:20}),o?`The selected file is missing on disk.`:`Select or create a context file.`]}),o?.managed&&c.length>0?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsx)(`h3`,{children:`Revisions`}),(0,R.jsx)(`div`,{className:`file-list`,children:c.map(e=>(0,R.jsxs)(`div`,{className:`file-row`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`strong`,{children:e.kind}),` `,e.active?`(active)`:``]}),(0,R.jsx)(`div`,{children:e.note??e.id}),(0,R.jsx)(`div`,{children:e.createdAt}),e.active?null:(0,R.jsx)(`button`,{className:`primary-action`,type:`button`,disabled:b,onClick:()=>void ce(e.id),children:`Restore`})]},e.id))})]}):null,o?.managed&&u?(0,R.jsxs)(`div`,{className:`scope-controls`,children:[(0,R.jsx)(`h3`,{children:`Diff`}),(0,R.jsx)(`div`,{className:`file-list`,children:u.chunks.map((e,t)=>(0,R.jsx)(`pre`,{className:`file-row`,children:e.lines.map(t=>`${e.type===`add`?`+`:e.type===`remove`?`-`:` `} ${t}`).join(`
202
202
  `)},`${e.type}-${t}`))})]}):null]})]})}function s9({tone:e,text:t}){return(0,R.jsx)(`div`,{className:`status-banner status-banner--${e}`,children:t})}function c9(e){return e===`saving`?`Saving`:e===`saved`?`Saved`:e===`error`?`Error`:`Unsaved`}function l9(e){return e.source===`plugin`?`Plugin Global`:e.scope===`agent`?e.agentProfileName?`Agent ${e.agentProfileName}`:`Agent Local`:`Global`}function u9(e){return e===`plugin-only`?`Plugin Only`:e===`linked-clean`?`Linked Clean`:e===`linked-dirty`?`Linked Dirty`:e===`linked-stale`?`Linked Stale`:e===`orphaned`?`Orphaned`:`Managed Unlinked`}function d9(e){try{let t=JSON.parse(e.data);return t&&typeof t.type==`string`?t:void 0}catch{return}}function f9(e){return typeof e==`object`&&!!e&&`status`in e&&e.status===409&&`data`in e&&typeof e.data==`object`&&e.data?.file!==void 0}(0,zt.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(o9,{})}));export{bW as a,yW as i,jZ as n,AG as o,CY as r,yQ as t};