collabmd 0.1.52 → 0.1.54

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 (105) hide show
  1. package/bin/collabmd.js +3 -2
  2. package/dist/client/assets/{CodeMirrorEditor-UCMRAMCV-BEz2BKN1.js → CodeMirrorEditor-UCMRAMCV-kJfwukbn.js} +1 -1
  3. package/dist/client/assets/{browser-BKLM0ThC-IxjwuOIz-C0mP17s1.js → browser-BKLM0ThC-BCLQGPD6-K2seJgRL.js} +1 -1
  4. package/dist/client/assets/{browser-utils-vlHL9goC.js → browser-utils-S4QYY31r.js} +1 -1
  5. package/dist/client/assets/{chunk-RUX4WMZV-BGnd3s_C.js → chunk-ISPTBLVO-BMsDq9Ha.js} +2 -2
  6. package/dist/client/assets/{chunk-4SOEAONT-C3fufoVl.js → chunk-T5WUORNS-DD7KlyY6.js} +9 -9
  7. package/dist/client/assets/{direct-engine-DdrQKpgq-4QysbH_V.js → direct-engine-DVLMOJWp-C-YL5NFb.js} +1 -1
  8. package/dist/client/assets/{dist-CXOUa90Q.js → dist-9Eodxf4G.js} +1 -1
  9. package/dist/client/assets/{dist-jVKfryIL.js → dist-B2ZNQifU.js} +1 -1
  10. package/dist/client/assets/dist-B6QCMNze.js +1 -0
  11. package/dist/client/assets/dist-BIAv19LO.js +1 -0
  12. package/dist/client/assets/{dist-Bog8M5U3.js → dist-BKYp1-dl.js} +4 -4
  13. package/dist/client/assets/{dist-DI6c02Da.js → dist-BSAZ-Hek.js} +1 -1
  14. package/dist/client/assets/{dist-DNONgI1P.js → dist-BSTbcioM.js} +1 -1
  15. package/dist/client/assets/{dist-BfpAc922.js → dist-BT9gJXCb.js} +1 -1
  16. package/dist/client/assets/{dist-CAG5sIOj.js → dist-BTVg1m-V.js} +1 -1
  17. package/dist/client/assets/{dist-GTGhtpyW.js → dist-Bi9ZIYXq.js} +1 -1
  18. package/dist/client/assets/{dist-CvVoyTRF.js → dist-BpAUe9sL.js} +1 -1
  19. package/dist/client/assets/{dist-B7fBbwrO.js → dist-Bqo-XRVG.js} +1 -1
  20. package/dist/client/assets/{dist-CUsXdnU4.js → dist-BrKhPlc9.js} +1 -1
  21. package/dist/client/assets/{dist-CYMCikZo.js → dist-CBsvKPcT.js} +1 -1
  22. package/dist/client/assets/{dist-W0FoeIxk.js → dist-CJBYh9Wy.js} +1 -1
  23. package/dist/client/assets/{dist-Ck-B8onw.js → dist-CRwfjtwz.js} +1 -1
  24. package/dist/client/assets/{dist-Dx37MHWs.js → dist-CX7Kc61C.js} +1 -1
  25. package/dist/client/assets/{dist-zHDLm1oE.js → dist-CoXN2D3R.js} +1 -1
  26. package/dist/client/assets/{dist-D4kDR0g8.js → dist-CucpLxUY.js} +1 -1
  27. package/dist/client/assets/{dist-Cu5Ze2cs.js → dist-DHBMeCxC.js} +1 -1
  28. package/dist/client/assets/dist-DLEg9d4u.js +1 -0
  29. package/dist/client/assets/{dist-Y6zYRI-A.js → dist-DOHWxIty.js} +1 -1
  30. package/dist/client/assets/{dist-DVBYH83t.js → dist-DYFBD-wW.js} +1 -1
  31. package/dist/client/assets/{dist-CsQTfQFi.js → dist-DeCV9FU4.js} +1 -1
  32. package/dist/client/assets/dist-DugWGOjQ.js +1 -0
  33. package/dist/client/assets/{dist-BVCNc-Es.js → dist-KrdpB_GB.js} +1 -1
  34. package/dist/client/assets/{dist-B_1hMrc6.js → dist-NNrRnB-f.js} +1 -1
  35. package/dist/client/assets/{dist-Da-jLrCf.js → dist-PUxZqhFe.js} +1 -1
  36. package/dist/client/assets/dist-cYiJMWHJ.js +1 -0
  37. package/dist/client/assets/dist-iKC7go4m.js +1 -0
  38. package/dist/client/assets/{dist-CKf7LlAo.js → dist-lw5TGjI6.js} +1 -1
  39. package/dist/client/assets/{dist-DGa-2MNX.js → dist-uk11ih8u.js} +1 -1
  40. package/dist/client/assets/{document-formatter-gO8qM2qY.js → document-formatter-6I63vstk.js} +1 -1
  41. package/dist/client/assets/{drawioEditor-DCkWweiy.js → drawioEditor-DNTjsjzJ.js} +1 -1
  42. package/dist/client/assets/{editor-session-DxRyr4EM.js → editor-session-D8GGkJak.js} +3 -3
  43. package/dist/client/assets/{embedpdf-DyOonRvx.js → embedpdf-TkbBYowM.js} +1 -1
  44. package/dist/client/assets/{embedpdf-DA4bA119-DsoNiPlQ.js → embedpdf-cl9qiF45-itpgqvGY.js} +2 -2
  45. package/dist/client/assets/{en-GNC3RJIS-CEy_oGTd.js → en-JTHJ2SIP-DBz9bRq4.js} +1 -1
  46. package/dist/client/assets/{estree-DCT3Jm65.js → estree-DGmLqopC.js} +17 -17
  47. package/dist/client/assets/{excalidraw-element-link-CGZ5934B.js → excalidraw-element-link-BRZOTIeI.js} +2 -2
  48. package/dist/client/assets/{excalidrawEditor-BVfSxjSO.js → excalidrawEditor-D0orhhku.js} +3 -3
  49. package/dist/client/assets/{export-page-BCo_e15t.js → export-page-CVJNMERq.js} +3 -3
  50. package/dist/client/assets/{exportDocument-DP6oE_or.js → exportDocument-DSshnmnZ.js} +2 -2
  51. package/dist/client/assets/{file-search-3hYF4cYa.js → file-search-BA8o_gs0.js} +1 -1
  52. package/dist/client/assets/{html-CBXMuS97.js → html-BryNQ_yx.js} +6 -6
  53. package/dist/client/assets/image-I42VHMUI-B2-c_ifV.js +1 -0
  54. package/dist/client/assets/index-BCgNcVNs.css +1 -0
  55. package/dist/client/assets/index-BpmR5Qqk.js +1140 -0
  56. package/dist/client/assets/{lobby-presence-Cz5jGOPg.js → lobby-presence-KJrYhMdN.js} +1 -1
  57. package/dist/client/assets/{markdown-Bo71X2X2.js → markdown-CZ1tYEW8.js} +17 -17
  58. package/dist/client/assets/{pdfium-RAgkpwfK.wasm → pdfium-BJ2Yip8Q.wasm} +0 -0
  59. package/dist/client/assets/{preview-render-compiler-ktU0SXxY.js → preview-render-compiler-BmWQStaL.js} +1 -1
  60. package/dist/client/assets/{preview-render-worker-BI2bFVqM.js → preview-render-worker-BA4VK_GY.js} +2 -2
  61. package/dist/client/assets/prod-CA0ie9yD.js +145 -0
  62. package/dist/client/assets/prod-yKJZ3E4s.js +1 -0
  63. package/dist/client/assets/{quick-switcher-controller-DSlOwOsU.js → quick-switcher-controller-B5vT9Vj5.js} +1 -1
  64. package/dist/client/assets/runtime-config-CvrkHb0n.js +1 -0
  65. package/dist/client/assets/runtime-paths-qQGhzNx4.js +1 -0
  66. package/dist/client/assets/{standalone-6z5x8CWe.js → standalone-DbyFjvTU.js} +1 -1
  67. package/dist/client/assets/{vault-api-client-BQxLVPeF.js → vault-api-client-NS_EVHJ3.js} +2 -2
  68. package/dist/client/assets/{worker-engine-m0rlHn8R-5h66k403.js → worker-engine-BCCrxWYm-CX0qJ_cG.js} +1 -1
  69. package/dist/client/assets/{workspace-sync-client-C2pdaQUN.js → workspace-sync-client-BrMtf6zN.js} +1 -1
  70. package/dist/client/drawio-editor.html +5 -5
  71. package/dist/client/excalidraw-editor.html +9 -9
  72. package/dist/client/export-document.html +1 -1
  73. package/dist/client/index.html +13 -2
  74. package/package.json +14 -14
  75. package/src/client/app/index.html +11 -0
  76. package/src/client/app/main-entry.js +30 -4
  77. package/src/client/bootstrap/collabmd-app-shell.js +3 -1
  78. package/src/client/browser-utils.js +21 -0
  79. package/src/client/domain/file-search.js +1 -1
  80. package/src/client/domain/runtime-paths.js +4 -0
  81. package/src/client/infrastructure/runtime-config.js +14 -0
  82. package/src/client/presentation/drawio-embed-controller.js +3 -1
  83. package/src/client/presentation/excalidraw-embed-controller.js +3 -1
  84. package/src/client/presentation/file-action-controller.js +21 -1
  85. package/src/client/presentation/file-explorer-view.js +24 -6
  86. package/src/client/presentation/vault-dashboard.js +63 -0
  87. package/src/client/styles/foundation/utilities.css +2 -0
  88. package/src/client/styles/layout/overlays.css +5 -0
  89. package/src/client/styles/layout/shell.css +152 -0
  90. package/src/server/config/env.js +39 -6
  91. package/src/server/infrastructure/http/create-static-handler.js +3 -1
  92. package/src/server/infrastructure/http/create-vault-api-query-handler.js +1 -1
  93. package/dist/client/assets/dist-BYBF4LtZ.js +0 -1
  94. package/dist/client/assets/dist-BnVaoRgZ.js +0 -1
  95. package/dist/client/assets/dist-CrkYYcOU.js +0 -1
  96. package/dist/client/assets/dist-D8LnhZzy.js +0 -1
  97. package/dist/client/assets/dist-DX6qtdxv.js +0 -1
  98. package/dist/client/assets/dist-DofvCYzJ.js +0 -1
  99. package/dist/client/assets/image-EJJKRVD3-BQfi5nWJ.js +0 -1
  100. package/dist/client/assets/index-BxAuGDoN.css +0 -1
  101. package/dist/client/assets/index-uw9O0z1c.js +0 -1112
  102. package/dist/client/assets/prod-DU-0VfI7.js +0 -145
  103. package/dist/client/assets/prod-cXUNdmYV.js +0 -1
  104. package/dist/client/assets/runtime-config-BFVdhnJu.js +0 -1
  105. package/dist/client/assets/runtime-paths-Cn0snt_9.js +0 -1
@@ -1,5 +1,5 @@
1
- import"./runtime-config-BFVdhnJu.js";import{o as e}from"./runtime-paths-Cn0snt_9.js";import{t}from"./preload-helper-BAlEavIC.js";import{L as n,R as r,c as i,f as a,h as o,l as s,m as c,n as l,o as u,p as d,s as f,t as p}from"./yjs-B41tM6Sz.js";import{n as m,t as h}from"./yjs-provider-reset-guard-DpntzUDR.js";import{a as g,f as _,h as v,l as y,m as ee}from"./file-kind-BwMIcZbi.js";import{n as te,t as ne}from"./comment-thread-store-CHvy8GF8.js";import{i as re,t as ie}from"./room-DX7lIfnu.js";import{o as ae}from"./comment-threads-nJhK1yfc.js";import{n as oe}from"./document-formatter-gO8qM2qY.js";import{$ as se,Ct as ce,G as le,H as b,O as ue,P as x,Q as de,R as S,St as fe,U as pe,V as C,W as me,X as he,Z as ge,a as w,c as T,et as _e,gt as ve,ht as E,lt as D,mt as O,o as k,p as ye,pt as A,rt as be,t as xe,u as Se,vt as Ce,w as we,x as Te,y as Ee,yt as De,z as j}from"./dist-Bog8M5U3.js";import{n as Oe}from"./dist-B_1hMrc6.js";import{i as ke,n as Ae,r as je}from"./dist-B7fBbwrO.js";import{a as Me,s as Ne}from"./dist-Cu5Ze2cs.js";import{t as Pe}from"./dist-zHDLm1oE.js";import{a as Fe,c as Ie,d as Le,l as Re}from"./dist-BYBF4LtZ.js";import{a as ze,c as M,i as N,o as P,r as Be,s as Ve}from"./dist-Ck-B8onw.js";import{n as He,t as Ue}from"./file-search-3hYF4cYa.js";var We=class{constructor({localUser:e=null,onAwarenessChange:t=null,onConnectionChange:n=null,onInitialSync:r=null,preferredUserName:i,resolveAwarenessCursor:a=null}){this.onAwarenessChange=t,this.onConnectionChange=n,this.onInitialSync=r,this.preferredUserName=i,this.providedLocalUser=e,this.resolveAwarenessCursor=a??(()=>null),this.provider=null,this.awareness=null,this.localUser=null,this.ydoc=null,this.ytext=null,this.commentThreads=null,this.wsBaseUrl=``,this.initialSyncComplete=!1,this.initialSyncPromise=Promise.resolve(),this.resolveInitialSync=null}normalizeViewport(e){if(!e||typeof e!=`object`)return null;let t=Number(e.topLine),n=Number(e.viewportRatio);return!Number.isFinite(t)||t<1?null:{topLine:Math.max(1,Math.round(t)),viewportRatio:Number.isFinite(n)?Math.min(Math.max(n,0),1):.35}}async initialize(t){this.wsBaseUrl=e(),this.ydoc=new p,this.ytext=this.ydoc.getText(`codemirror`),this.commentThreads=this.ydoc.getArray(`comments`);let n=new l(this.ytext),r=new m(this.wsBaseUrl,t,this.ydoc,{disableBc:!0,maxBackoffTime:5e3});h(r);let i=r.awareness,a=this.providedLocalUser??ie(this.preferredUserName);this.provider=r,this.awareness=i,this.localUser=a,this.initialSyncComplete=!1,this.initialSyncPromise=new Promise(e=>{this.resolveInitialSync=e}),i.setLocalStateField(`user`,a),i.on(`change`,()=>{this.onAwarenessChange?.(this.collectUsers(this.resolveAwarenessCursor))}),this.trackConnectionStatus();let o=!1;return r.on(`sync`,e=>{e&&!o&&(o=!0,this.initialSyncComplete=!0,this.resolveInitialSync?.(),this.resolveInitialSync=null,this.onInitialSync?.())}),{awareness:i,commentThreads:this.commentThreads,localUser:this.localUser,undoManager:n,ydoc:this.ydoc,ytext:this.ytext}}destroy(){this.resolveInitialSync?.(),this.resolveInitialSync=null,this.initialSyncComplete=!1,this.initialSyncPromise=Promise.resolve(),this.provider?.disconnect(),this.provider?.destroy(),this.provider=null,this.awareness=null,this.localUser=null,this.ydoc?.destroy(),this.ydoc=null,this.ytext=null,this.commentThreads=null}waitForInitialSync(e=1500){return this.initialSyncComplete?Promise.resolve():e==null||e===!1?this.initialSyncPromise:Promise.race([this.initialSyncPromise,new Promise(t=>{window.setTimeout(t,e)})])}getText(){return this.ytext?.toString()??``}getLocalUser(){return this.localUser}setUserName(e){let t=re(e);return!t||!this.awareness||!this.localUser?null:(this.localUser={...this.localUser,name:t},this.awareness.setLocalStateField(`user`,this.localUser),t)}getUserCursor(e,t){return this.awareness?t(this.awareness.getStates().get(e)?.cursor):null}getUserViewport(e){if(!this.awareness)return null;let t=this.awareness.getStates().get(e);return this.normalizeViewport(t?.viewport)}setLocalViewport(e){if(!this.awareness)return null;let t=this.normalizeViewport(e);return this.awareness.setLocalStateField(`viewport`,t),t}collectUsers(e=()=>null){if(!this.awareness)return[];let t=[];return this.awareness.getStates().forEach((n,r)=>{if(!n.user)return;let i=e(n.cursor);t.push({...i??{},...n.user,clientId:r,hasCursor:!!i,isLocal:r===this.awareness.clientID,viewport:this.normalizeViewport(n.viewport)})}),t}trackConnectionStatus(){if(!this.provider)return;let e=0,t=!1;this.provider.on(`status`,({status:n})=>{n===`connecting`&&(e+=1);let r=n===`connected`&&!t;n===`connected`&&(e=0,t=!0),this.onConnectionChange?.({attempts:e,firstConnection:r,hasEverConnected:t,status:n,unreachable:!t&&e>=3,wsBaseUrl:this.wsBaseUrl})})}};function F(e){return new k(T.define(e))}function I(e){return t(()=>import(`./dist-DGa-2MNX.js`).then(t=>t.sql({dialect:t[e]})),[],import.meta.url)}var Ge=[w.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return t(()=>import(`./dist-Y6zYRI-A.js`).then(e=>e.cpp()),[],import.meta.url)}}),w.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return t(()=>import(`./dist-Y6zYRI-A.js`).then(e=>e.cpp()),[],import.meta.url)}}),w.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return I(`Cassandra`)}}),w.of({name:`CSS`,extensions:[`css`],load(){return t(()=>import(`./dist-CrkYYcOU.js`).then(e=>e.css()),[],import.meta.url)}}),w.of({name:`Go`,extensions:[`go`],load(){return t(()=>import(`./dist-DNONgI1P.js`).then(e=>e.go()),[],import.meta.url)}}),w.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return t(()=>import(`./dist-DofvCYzJ.js`).then(e=>e.html()),[],import.meta.url)}}),w.of({name:`Java`,extensions:[`java`],load(){return t(()=>import(`./dist-CKf7LlAo.js`).then(e=>e.java()),[],import.meta.url)}}),w.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return t(()=>import(`./dist-D8LnhZzy.js`).then(e=>e.javascript()),[],import.meta.url)}}),w.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return t(()=>import(`./dist-Da-jLrCf.js`).then(e=>e.jinja()),[],import.meta.url)}}),w.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return t(()=>import(`./dist-CvVoyTRF.js`).then(e=>e.json()),[],import.meta.url)}}),w.of({name:`JSX`,extensions:[`jsx`],load(){return t(()=>import(`./dist-D8LnhZzy.js`).then(e=>e.javascript({jsx:!0})),[],import.meta.url)}}),w.of({name:`LESS`,extensions:[`less`],load(){return t(()=>import(`./dist-BfpAc922.js`).then(e=>e.less()),[],import.meta.url)}}),w.of({name:`Liquid`,extensions:[`liquid`],load(){return t(()=>import(`./dist-D4kDR0g8.js`).then(e=>e.liquid()),[],import.meta.url)}}),w.of({name:`MariaDB SQL`,load(){return I(`MariaSQL`)}}),w.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return t(()=>import(`./dist-BnVaoRgZ.js`).then(e=>e.markdown()),[],import.meta.url)}}),w.of({name:`MS SQL`,load(){return I(`MSSQL`)}}),w.of({name:`MySQL`,load(){return I(`MySQL`)}}),w.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return t(()=>import(`./dist-CYMCikZo.js`).then(e=>e.php()),[],import.meta.url)}}),w.of({name:`PLSQL`,extensions:[`pls`],load(){return I(`PLSQL`)}}),w.of({name:`PostgreSQL`,load(){return I(`PostgreSQL`)}}),w.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return t(()=>import(`./dist-GTGhtpyW.js`).then(e=>e.python()),[],import.meta.url)}}),w.of({name:`Rust`,extensions:[`rs`],load(){return t(()=>import(`./dist-CUsXdnU4.js`).then(e=>e.rust()),[],import.meta.url)}}),w.of({name:`Sass`,extensions:[`sass`],load(){return t(()=>import(`./dist-BVCNc-Es.js`).then(e=>e.sass({indented:!0})),[],import.meta.url)}}),w.of({name:`SCSS`,extensions:[`scss`],load(){return t(()=>import(`./dist-BVCNc-Es.js`).then(e=>e.sass()),[],import.meta.url)}}),w.of({name:`SQL`,extensions:[`sql`],load(){return I(`StandardSQL`)}}),w.of({name:`SQLite`,load(){return I(`SQLite`)}}),w.of({name:`TSX`,extensions:[`tsx`],load(){return t(()=>import(`./dist-D8LnhZzy.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),[],import.meta.url)}}),w.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return t(()=>import(`./dist-D8LnhZzy.js`).then(e=>e.javascript({typescript:!0})),[],import.meta.url)}}),w.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return t(()=>import(`./dist-CXOUa90Q.js`).then(e=>e.wast()),[],import.meta.url)}}),w.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return t(()=>import(`./dist-CsQTfQFi.js`).then(e=>e.xml()),[],import.meta.url)}}),w.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return t(()=>import(`./dist-DX6qtdxv.js`).then(e=>e.yaml()),[],import.meta.url)}}),w.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return t(()=>import(`./apl-gfMMiTNf.js`).then(e=>F(e.apl)),[],import.meta.url)}}),w.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return t(()=>import(`./asciiarmor-C_eisQCp.js`).then(e=>F(e.asciiArmor)),[],import.meta.url)}}),w.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return t(()=>import(`./asn1-DCl_8MCW.js`).then(e=>F(e.asn1({}))),[],import.meta.url)}}),w.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return t(()=>import(`./asterisk-BEn0Cwpx.js`).then(e=>F(e.asterisk)),[],import.meta.url)}}),w.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return t(()=>import(`./brainfuck-D5EjA2JK.js`).then(e=>F(e.brainfuck)),[],import.meta.url)}}),w.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return t(()=>import(`./cobol-DHLQUbN7.js`).then(e=>F(e.cobol)),[],import.meta.url)}}),w.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.csharp)),[],import.meta.url)}}),w.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return t(()=>import(`./clojure-BflJGmDX.js`).then(e=>F(e.clojure)),[],import.meta.url)}}),w.of({name:`ClojureScript`,extensions:[`cljs`],load(){return t(()=>import(`./clojure-BflJGmDX.js`).then(e=>F(e.clojure)),[],import.meta.url)}}),w.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return t(()=>import(`./css-CnaYoQib.js`).then(e=>F(e.gss)),[],import.meta.url)}}),w.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return t(()=>import(`./cmake-84nbDH0I.js`).then(e=>F(e.cmake)),[],import.meta.url)}}),w.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return t(()=>import(`./coffeescript-De_zI4J0.js`).then(e=>F(e.coffeeScript)),[],import.meta.url)}}),w.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return t(()=>import(`./commonlisp-DgAKBe0r.js`).then(e=>F(e.commonLisp)),[],import.meta.url)}}),w.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return t(()=>import(`./cypher-p9eYesGn.js`).then(e=>F(e.cypher)),[],import.meta.url)}}),w.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return t(()=>import(`./python-B_1Jd8HM.js`).then(e=>F(e.cython)),[],import.meta.url)}}),w.of({name:`Crystal`,extensions:[`cr`],load(){return t(()=>import(`./crystal-Bsdphhtm.js`).then(e=>F(e.crystal)),[],import.meta.url)}}),w.of({name:`D`,extensions:[`d`],load(){return t(()=>import(`./d-DWkQyNnU.js`).then(e=>F(e.d)),[],import.meta.url)}}),w.of({name:`Dart`,extensions:[`dart`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.dart)),[],import.meta.url)}}),w.of({name:`diff`,extensions:[`diff`,`patch`],load(){return t(()=>import(`./diff-ChtP43wD.js`).then(e=>F(e.diff)),[],import.meta.url)}}),w.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return t(()=>import(`./dockerfile-DJkHQgkl.js`).then(e=>F(e.dockerFile)),[],import.meta.url)}}),w.of({name:`DTD`,extensions:[`dtd`],load(){return t(()=>import(`./dtd-DTF72YNO.js`).then(e=>F(e.dtd)),[],import.meta.url)}}),w.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return t(()=>import(`./dylan-BCDoL_-p.js`).then(e=>F(e.dylan)),[],import.meta.url)}}),w.of({name:`EBNF`,load(){return t(()=>import(`./ebnf-D4c0_ac3.js`).then(e=>F(e.ebnf)),[],import.meta.url)}}),w.of({name:`ECL`,extensions:[`ecl`],load(){return t(()=>import(`./ecl-BVIeWmwY.js`).then(e=>F(e.ecl)),[],import.meta.url)}}),w.of({name:`edn`,extensions:[`edn`],load(){return t(()=>import(`./clojure-BflJGmDX.js`).then(e=>F(e.clojure)),[],import.meta.url)}}),w.of({name:`Eiffel`,extensions:[`e`],load(){return t(()=>import(`./eiffel-BEjRio4Q.js`).then(e=>F(e.eiffel)),[],import.meta.url)}}),w.of({name:`Elm`,extensions:[`elm`],load(){return t(()=>import(`./elm-Cshzl8qu.js`).then(e=>F(e.elm)),[],import.meta.url)}}),w.of({name:`Erlang`,extensions:[`erl`],load(){return t(()=>import(`./erlang-BV0c4Hdn.js`).then(e=>F(e.erlang)),[],import.meta.url)}}),w.of({name:`Esper`,load(){return t(()=>import(`./sql-DuQMFDvy.js`).then(e=>F(e.esper)),[],import.meta.url)}}),w.of({name:`Factor`,extensions:[`factor`],load(){return t(()=>import(`./factor-LKH5gN8L.js`).then(e=>F(e.factor)),[],import.meta.url)}}),w.of({name:`FCL`,load(){return t(()=>import(`./fcl-ClOhbFR7.js`).then(e=>F(e.fcl)),[],import.meta.url)}}),w.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return t(()=>import(`./forth-D6RzAl64.js`).then(e=>F(e.forth)),[],import.meta.url)}}),w.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return t(()=>import(`./fortran-Bt6PBEDR.js`).then(e=>F(e.fortran)),[],import.meta.url)}}),w.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return t(()=>import(`./mllike-B45xgp2S.js`).then(e=>F(e.fSharp)),[],import.meta.url)}}),w.of({name:`Gas`,extensions:[`s`],load(){return t(()=>import(`./gas-BHEdbvp9.js`).then(e=>F(e.gas)),[],import.meta.url)}}),w.of({name:`Gherkin`,extensions:[`feature`],load(){return t(()=>import(`./gherkin-oBAE_ms0.js`).then(e=>F(e.gherkin)),[],import.meta.url)}}),w.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return t(()=>import(`./groovy-CUpZ7dEl.js`).then(e=>F(e.groovy)),[],import.meta.url)}}),w.of({name:`Haskell`,extensions:[`hs`],load(){return t(()=>import(`./haskell-BRsoo5mP.js`).then(e=>F(e.haskell)),[],import.meta.url)}}),w.of({name:`Haxe`,extensions:[`hx`],load(){return t(()=>import(`./haxe-DjVOVvNP.js`).then(e=>F(e.haxe)),[],import.meta.url)}}),w.of({name:`HXML`,extensions:[`hxml`],load(){return t(()=>import(`./haxe-DjVOVvNP.js`).then(e=>F(e.hxml)),[],import.meta.url)}}),w.of({name:`HTTP`,load(){return t(()=>import(`./http-CLVgA2GD.js`).then(e=>F(e.http)),[],import.meta.url)}}),w.of({name:`IDL`,extensions:[`pro`],load(){return t(()=>import(`./idl-BUZw3wgd.js`).then(e=>F(e.idl)),[],import.meta.url)}}),w.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return t(()=>import(`./javascript-DctB8BJo.js`).then(e=>F(e.jsonld)),[],import.meta.url)}}),w.of({name:`Julia`,extensions:[`jl`],load(){return t(()=>import(`./julia-CQfgDRfP.js`).then(e=>F(e.julia)),[],import.meta.url)}}),w.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.kotlin)),[],import.meta.url)}}),w.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return t(()=>import(`./livescript-BXxG0Yva.js`).then(e=>F(e.liveScript)),[],import.meta.url)}}),w.of({name:`Lua`,extensions:[`lua`],load(){return t(()=>import(`./lua-zbJo2mq3.js`).then(e=>F(e.lua)),[],import.meta.url)}}),w.of({name:`mIRC`,extensions:[`mrc`],load(){return t(()=>import(`./mirc-C9zpzAZU.js`).then(e=>F(e.mirc)),[],import.meta.url)}}),w.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return t(()=>import(`./mathematica-u8YMmbU0.js`).then(e=>F(e.mathematica)),[],import.meta.url)}}),w.of({name:`Modelica`,extensions:[`mo`],load(){return t(()=>import(`./modelica-CqHI_q-D.js`).then(e=>F(e.modelica)),[],import.meta.url)}}),w.of({name:`MUMPS`,extensions:[`mps`],load(){return t(()=>import(`./mumps-BSzj6Xyz.js`).then(e=>F(e.mumps)),[],import.meta.url)}}),w.of({name:`Mbox`,extensions:[`mbox`],load(){return t(()=>import(`./mbox-BEMVcqjs.js`).then(e=>F(e.mbox)),[],import.meta.url)}}),w.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return t(()=>import(`./nginx-8H7HVH4w.js`).then(e=>F(e.nginx)),[],import.meta.url)}}),w.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return t(()=>import(`./nsis-CfSuhXs5.js`).then(e=>F(e.nsis)),[],import.meta.url)}}),w.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return t(()=>import(`./ntriples-B9h1VB_g.js`).then(e=>F(e.ntriples)),[],import.meta.url)}}),w.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.objectiveC)),[],import.meta.url)}}),w.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.objectiveCpp)),[],import.meta.url)}}),w.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return t(()=>import(`./mllike-B45xgp2S.js`).then(e=>F(e.oCaml)),[],import.meta.url)}}),w.of({name:`Octave`,extensions:[`m`],load(){return t(()=>import(`./octave-D2Q8cUp1.js`).then(e=>F(e.octave)),[],import.meta.url)}}),w.of({name:`Oz`,extensions:[`oz`],load(){return t(()=>import(`./oz-BwTct_5T.js`).then(e=>F(e.oz)),[],import.meta.url)}}),w.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return t(()=>import(`./pascal-Dp_KdFgX.js`).then(e=>F(e.pascal)),[],import.meta.url)}}),w.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return t(()=>import(`./perl-BkSkiI9m.js`).then(e=>F(e.perl)),[],import.meta.url)}}),w.of({name:`Pig`,extensions:[`pig`],load(){return t(()=>import(`./pig-AF4Hwhju.js`).then(e=>F(e.pig)),[],import.meta.url)}}),w.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return t(()=>import(`./powershell-BcIto6Sf.js`).then(e=>F(e.powerShell)),[],import.meta.url)}}),w.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return t(()=>import(`./properties-C357ku5U.js`).then(e=>F(e.properties)),[],import.meta.url)}}),w.of({name:`ProtoBuf`,extensions:[`proto`],load(){return t(()=>import(`./protobuf-D1ij_kNL.js`).then(e=>F(e.protobuf)),[],import.meta.url)}}),w.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return t(()=>import(`./pug-CqqUmdG7.js`).then(e=>F(e.pug)),[],import.meta.url)}}),w.of({name:`Puppet`,extensions:[`pp`],load(){return t(()=>import(`./puppet-BZyAS7I4.js`).then(e=>F(e.puppet)),[],import.meta.url)}}),w.of({name:`Q`,extensions:[`q`],load(){return t(()=>import(`./q-B9NhS7L_.js`).then(e=>F(e.q)),[],import.meta.url)}}),w.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return t(()=>import(`./r-CxDmU1I4.js`).then(e=>F(e.r)),[],import.meta.url)}}),w.of({name:`RPM Changes`,load(){return t(()=>import(`./rpm-gpDK5sbt.js`).then(e=>F(e.rpmChanges)),[],import.meta.url)}}),w.of({name:`RPM Spec`,extensions:[`spec`],load(){return t(()=>import(`./rpm-gpDK5sbt.js`).then(e=>F(e.rpmSpec)),[],import.meta.url)}}),w.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return t(()=>import(`./ruby-BjXV7-Qa.js`).then(e=>F(e.ruby)),[],import.meta.url)}}),w.of({name:`SAS`,extensions:[`sas`],load(){return t(()=>import(`./sas-C2OyD2Y6.js`).then(e=>F(e.sas)),[],import.meta.url)}}),w.of({name:`Scala`,extensions:[`scala`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.scala)),[],import.meta.url)}}),w.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return t(()=>import(`./scheme-D9qYN0V5.js`).then(e=>F(e.scheme)),[],import.meta.url)}}),w.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return t(()=>import(`./shell-DwuoZtxw.js`).then(e=>F(e.shell)),[],import.meta.url)}}),w.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return t(()=>import(`./sieve-tLWDfEkZ.js`).then(e=>F(e.sieve)),[],import.meta.url)}}),w.of({name:`Smalltalk`,extensions:[`st`],load(){return t(()=>import(`./smalltalk-BLp5-jwC.js`).then(e=>F(e.smalltalk)),[],import.meta.url)}}),w.of({name:`Solr`,load(){return t(()=>import(`./solr-B78wSQJQ.js`).then(e=>F(e.solr)),[],import.meta.url)}}),w.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return t(()=>import(`./mllike-B45xgp2S.js`).then(e=>F(e.sml)),[],import.meta.url)}}),w.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return t(()=>import(`./sparql-Dz-mlCAC.js`).then(e=>F(e.sparql)),[],import.meta.url)}}),w.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return t(()=>import(`./spreadsheet-CTIncYxj.js`).then(e=>F(e.spreadsheet)),[],import.meta.url)}}),w.of({name:`Squirrel`,extensions:[`nut`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.squirrel)),[],import.meta.url)}}),w.of({name:`Stylus`,extensions:[`styl`],load(){return t(()=>import(`./stylus-BOVgKnng.js`).then(e=>F(e.stylus)),[],import.meta.url)}}),w.of({name:`Swift`,extensions:[`swift`],load(){return t(()=>import(`./swift-DKB6_1j6.js`).then(e=>F(e.swift)),[],import.meta.url)}}),w.of({name:`sTeX`,load(){return t(()=>import(`./stex-DNzd62Q_.js`).then(e=>F(e.stex)),[],import.meta.url)}}),w.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return t(()=>import(`./stex-DNzd62Q_.js`).then(e=>F(e.stex)),[],import.meta.url)}}),w.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return t(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>F(e.verilog)),[],import.meta.url)}}),w.of({name:`Tcl`,extensions:[`tcl`],load(){return t(()=>import(`./tcl-BGfruO1u.js`).then(e=>F(e.tcl)),[],import.meta.url)}}),w.of({name:`Textile`,extensions:[`textile`],load(){return t(()=>import(`./textile-C4jVoHG1.js`).then(e=>F(e.textile)),[],import.meta.url)}}),w.of({name:`TiddlyWiki`,load(){return t(()=>import(`./tiddlywiki-VlUiK86J.js`).then(e=>F(e.tiddlyWiki)),[],import.meta.url)}}),w.of({name:`Tiki wiki`,load(){return t(()=>import(`./tiki-AK6FwT8q.js`).then(e=>F(e.tiki)),[],import.meta.url)}}),w.of({name:`TOML`,extensions:[`toml`],load(){return t(()=>import(`./toml-BPTmHmyx.js`).then(e=>F(e.toml)),[],import.meta.url)}}),w.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return t(()=>import(`./troff-C2dAgh7P.js`).then(e=>F(e.troff)),[],import.meta.url)}}),w.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return t(()=>import(`./ttcn-PPSTk1ow.js`).then(e=>F(e.ttcn)),[],import.meta.url)}}),w.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return t(()=>import(`./ttcn-cfg-2b4Gb5sE.js`).then(e=>F(e.ttcnCfg)),[],import.meta.url)}}),w.of({name:`Turtle`,extensions:[`ttl`],load(){return t(()=>import(`./turtle-Cx3rYX2g.js`).then(e=>F(e.turtle)),[],import.meta.url)}}),w.of({name:`Web IDL`,extensions:[`webidl`],load(){return t(()=>import(`./webidl-D5jiJvOU.js`).then(e=>F(e.webIDL)),[],import.meta.url)}}),w.of({name:`VB.NET`,extensions:[`vb`],load(){return t(()=>import(`./vb-BthdM_4N.js`).then(e=>F(e.vb)),[],import.meta.url)}}),w.of({name:`VBScript`,extensions:[`vbs`],load(){return t(()=>import(`./vbscript-D9f6rSsU.js`).then(e=>F(e.vbScript)),[],import.meta.url)}}),w.of({name:`Velocity`,extensions:[`vtl`],load(){return t(()=>import(`./velocity-CqftRsjg.js`).then(e=>F(e.velocity)),[],import.meta.url)}}),w.of({name:`Verilog`,extensions:[`v`],load(){return t(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>F(e.verilog)),[],import.meta.url)}}),w.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return t(()=>import(`./vhdl-kS471soi.js`).then(e=>F(e.vhdl)),[],import.meta.url)}}),w.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return t(()=>import(`./xquery-BKJx4mf9.js`).then(e=>F(e.xQuery)),[],import.meta.url)}}),w.of({name:`Yacas`,extensions:[`ys`],load(){return t(()=>import(`./yacas-CXXgtw0p.js`).then(e=>F(e.yacas)),[],import.meta.url)}}),w.of({name:`Z80`,extensions:[`z80`],load(){return t(()=>import(`./z80-Co3PbHdE.js`).then(e=>F(e.z80)),[],import.meta.url)}}),w.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return t(()=>import(`./mscgen-qgSLujhx.js`).then(e=>F(e.mscgen)),[],import.meta.url)}}),w.of({name:`Xù`,extensions:[`xu`],load(){return t(()=>import(`./mscgen-qgSLujhx.js`).then(e=>F(e.xu)),[],import.meta.url)}}),w.of({name:`MsGenny`,extensions:[`msgenny`],load(){return t(()=>import(`./mscgen-qgSLujhx.js`).then(e=>F(e.msgenny)),[],import.meta.url)}}),w.of({name:`Vue`,extensions:[`vue`],load(){return t(()=>import(`./dist-CAG5sIOj.js`).then(e=>e.vue()),[],import.meta.url)}}),w.of({name:`Angular Template`,load(){return t(()=>import(`./dist-DVBYH83t.js`).then(e=>e.angular()),[],import.meta.url)}})],Ke=`#e5c07b`,L=`#e06c75`,qe=`#56b6c2`,Je=`#ffffff`,R=`#abb2bf`,z=`#7d8799`,Ye=`#61afef`,Xe=`#98c379`,B=`#d19a66`,Ze=`#c678dd`,Qe=`#21252b`,$e=`#2c313a`,et=`#282c34`,V=`#353a42`,tt=`#3E4451`,nt=`#528bff`,rt=C.theme({"&":{color:R,backgroundColor:et},".cm-content":{caretColor:nt},".cm-cursor, .cm-dropCursor":{borderLeftColor:nt},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:tt},".cm-panels":{backgroundColor:Qe,color:R},".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 #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:et,color:z,border:`none`},".cm-activeLineGutter":{backgroundColor:$e},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:V},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:V,borderBottomColor:V},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$e,color:R}}},{dark:!0}),it=xe.define([{tag:S.keyword,color:Ze},{tag:[S.name,S.deleted,S.character,S.propertyName,S.macroName],color:L},{tag:[S.function(S.variableName),S.labelName],color:Ye},{tag:[S.color,S.constant(S.name),S.standard(S.name)],color:B},{tag:[S.definition(S.name),S.separator],color:R},{tag:[S.typeName,S.className,S.number,S.changed,S.annotation,S.modifier,S.self,S.namespace],color:Ke},{tag:[S.operator,S.operatorKeyword,S.url,S.escape,S.regexp,S.link,S.special(S.string)],color:qe},{tag:[S.meta,S.comment],color:z},{tag:S.strong,fontWeight:`bold`},{tag:S.emphasis,fontStyle:`italic`},{tag:S.strikethrough,textDecoration:`line-through`},{tag:S.link,color:z,textDecoration:`underline`},{tag:S.heading,fontWeight:`bold`,color:L},{tag:[S.atom,S.bool,S.special(S.variableName)],color:B},{tag:[S.processingInstruction,S.string,S.inserted],color:Xe},{tag:S.invalid,color:Je}]),at=[rt,x(it)],ot=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:a(this.yanchor),yhead:a(this.yhead)}}static fromJSON(t){return new e(i(t.yanchor),i(t.yhead))}},st=class{constructor(e,t){this.ytext=e,this.awareness=t}toYPos(e,t=0){return s(this.ytext,e,t)}fromYPos(e){let t=f(i(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new ot(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?O.cursor(n.pos,n.assoc):O.range(t.pos,n.pos)}},H=ve.define({combine(e){return e[e.length-1]}}),U=D.define(),ct=class{constructor(e){this.view=e,this.conf=e.state.facet(H),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[U.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(U)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
- `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},lt=b.fromClass(ct),ut=C.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),dt=D.define(),ft=class extends pe{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return d(`span`,[o(`class`,`cm-ySelectionCaret`),o(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[c(`⁠`),d(`div`,[o(`class`,`cm-ySelectionCaretDot`)]),c(`⁠`),d(`div`,[o(`class`,`cm-ySelectionInfo`)],[c(this.name)]),c(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},pt=class{constructor(e){this.conf=e.state.facet(H),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[dt.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=De.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,a=t.doc,o=this.conf.awareness,c=[],l=this.conf.awareness.getLocalState();if(l!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),r=n?e.state.selection.main:null,a=l.cursor==null?null:i(l.cursor.anchor),c=l.cursor==null?null:i(l.cursor.head);if(r!=null){let e=s(t,r.anchor),n=s(t,r.head);(l.cursor==null||!u(a,e)||!u(c,n))&&o.setLocalStateField(`cursor`,{anchor:e,head:n})}else l.cursor!=null&&n&&o.setLocalStateField(`cursor`,null)}o.getStates().forEach((i,s)=>{if(s===o.doc.clientID)return;let l=i.cursor;if(l==null||l.anchor==null||l.head==null)return;let u=f(l.anchor,a),d=f(l.head,a);if(u==null||d==null||u.type!==t||d.type!==t)return;let{color:p=`#30bced`,name:m=`Anonymous`}=i.user||{},h=i.user&&i.user.colorLight||p+`33`,g=r(u.index,d.index),_=n(u.index,d.index),v=e.view.state.doc.lineAt(g),y=e.view.state.doc.lineAt(_);if(v.number===y.number)c.push({from:g,to:_,value:j.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});else{c.push({from:g,to:v.from+v.length,value:j.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})}),c.push({from:y.from,to:_,value:j.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});for(let t=v.number+1;t<y.number;t++){let n=e.view.state.doc.line(t).from;c.push({from:n,to:n,value:j.line({attributes:{style:`background-color: ${h}`,class:`cm-yLineSelection`}})})}}c.push({from:d.index,to:d.index,value:j.widget({side:d.index-u.index>0?-1:1,block:!1,widget:new ft(p,m)})})}),this.decorations=j.set(c,!0)}},mt=b.fromClass(pt,{decorations:e=>e.decorations}),ht=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},W=ve.define({combine(e){return e[e.length-1]}});D.define();var gt=class{constructor(e){this.view=e,this.conf=e.state.facet(W),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(H),this._beforeChangeSelection=null,this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:t})=>{let n=t.meta.get(this);if(n){let t=this.syncConf.fromYRange(n);e.dispatch(e.state.update({selection:t,effects:[C.scrollIntoView(t)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(U)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},_t=b.fromClass(gt),vt=({state:e,dispatch:t})=>e.facet(W).undo()||!0,G=({state:e,dispatch:t})=>e.facet(W).redo()||!0,yt=[{key:`Mod-z`,run:vt,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:G,preventDefault:!0},{key:`Mod-Shift-z`,run:G,preventDefault:!0}],bt=(e,t,{undoManager:n=new l(e)}={})=>{let r=new st(e,t),i=[H.of(r),lt];return t&&i.push(ut,mt),n!==!1&&i.push(W.of(new ht(n)),_t,C.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?vt(t):e.inputType===`historyRedo`&&G(t)}})),i};function K(e,t){let n=Error(t);return n.code=e,n}function xt(e,{maxCharacters:t=1/0,maxReplacements:n=1/0}={}){if(!Array.isArray(e)||e.length===0)throw K(`EXACT_EDIT_REQUIRED`,`At least one text replacement is required`);if(e.length>n)throw K(`EXACT_EDIT_LIMIT`,`At most ${n} text replacements are allowed`);let r=0;for(let t of e){if(!t||typeof t.oldText!=`string`||t.oldText.length===0||typeof t.newText!=`string`)throw K(`EXACT_EDIT_INVALID`,`Each replacement requires non-empty oldText and string newText`);if(t.oldText===t.newText)throw K(`EXACT_EDIT_UNCHANGED`,`A replacement must change the document`);r+=t.oldText.length+t.newText.length}if(r>t)throw K(`EXACT_EDIT_LIMIT`,`Text replacements may contain at most ${t} characters`);return e}function St(e,t,n={}){let r=String(e??``),i=xt(t,n).map(({newText:e,oldText:t})=>{let n=r.indexOf(t);if(n<0)throw K(`EXACT_EDIT_MISMATCH`,`A requested text replacement no longer matches the document`);if(r.includes(t,n+1))throw K(`EXACT_EDIT_NOT_UNIQUE`,`A requested text replacement is not unique in the document`);return{from:n,insert:e,to:n+t.length}}).sort((e,t)=>e.from-t.from);for(let e=1;e<i.length;e+=1)if(i[e].from<i[e-1].to)throw K(`EXACT_EDIT_OVERLAP`,`Requested text replacements overlap`);return i}var q=Object.freeze({bold:`bold text`,code:`code`,italic:`emphasis`,strikethrough:`struck text`}),J=`link text`,Ct=`https://`,wt=`alt text`,Tt=`https://`,Et=`Video`,Dt=`https://`,Ot=`code`,kt=Object.freeze([`Column 1`,`Column 2`]),At=`Value`,Y=Object.freeze({heading:/^#{1,6}\s+/,quote:/^>\s+/,bulletList:/^[-*+]\s+/,numberedList:/^\d+\.\s+/,taskList:/^-\s\[(?: |x|X)\]\s+/});function jt(e,t){return{from:Math.max(0,Math.min(e.from,e.to,t)),to:Math.max(0,Math.min(Math.max(e.from,e.to),t))}}function Mt(e,t){return t===0||e[t-1]===`
1
+ import"./runtime-config-CvrkHb0n.js";import{o as e}from"./runtime-paths-qQGhzNx4.js";import{t}from"./preload-helper-BAlEavIC.js";import{L as n,R as r,c as i,f as a,h as o,l as s,m as c,n as l,o as u,p as d,s as f,t as p}from"./yjs-B41tM6Sz.js";import{n as m,t as h}from"./yjs-provider-reset-guard-DpntzUDR.js";import{a as g,f as _,h as v,l as y,m as ee}from"./file-kind-BwMIcZbi.js";import{n as te,t as ne}from"./comment-thread-store-CHvy8GF8.js";import{i as re,t as ie}from"./room-DX7lIfnu.js";import{o as ae}from"./comment-threads-nJhK1yfc.js";import{n as oe}from"./document-formatter-6I63vstk.js";import{n as se,t as ce}from"./file-search-BA8o_gs0.js";import{$ as b,Ct as le,G as ue,H as x,O as de,P as fe,Q as pe,R as S,St as me,U as he,V as C,W as ge,X as _e,Z as ve,a as w,c as T,et as ye,gt as be,ht as E,lt as D,mt as O,o as k,p as xe,pt as A,rt as Se,t as Ce,u as we,vt as Te,w as Ee,x as De,y as Oe,yt as ke,z as j}from"./dist-BKYp1-dl.js";import{n as Ae}from"./dist-NNrRnB-f.js";import{i as je,n as Me,r as Ne}from"./dist-Bqo-XRVG.js";import{a as Pe,s as Fe}from"./dist-DHBMeCxC.js";import{t as Ie}from"./dist-CoXN2D3R.js";import{a as Le,c as Re,d as ze,l as Be}from"./dist-DLEg9d4u.js";import{a as Ve,c as M,i as N,o as P,r as He,s as Ue}from"./dist-CRwfjtwz.js";var We=class{constructor({localUser:e=null,onAwarenessChange:t=null,onConnectionChange:n=null,onInitialSync:r=null,preferredUserName:i,resolveAwarenessCursor:a=null}){this.onAwarenessChange=t,this.onConnectionChange=n,this.onInitialSync=r,this.preferredUserName=i,this.providedLocalUser=e,this.resolveAwarenessCursor=a??(()=>null),this.provider=null,this.awareness=null,this.localUser=null,this.ydoc=null,this.ytext=null,this.commentThreads=null,this.wsBaseUrl=``,this.initialSyncComplete=!1,this.initialSyncPromise=Promise.resolve(),this.resolveInitialSync=null}normalizeViewport(e){if(!e||typeof e!=`object`)return null;let t=Number(e.topLine),n=Number(e.viewportRatio);return!Number.isFinite(t)||t<1?null:{topLine:Math.max(1,Math.round(t)),viewportRatio:Number.isFinite(n)?Math.min(Math.max(n,0),1):.35}}async initialize(t){this.wsBaseUrl=e(),this.ydoc=new p,this.ytext=this.ydoc.getText(`codemirror`),this.commentThreads=this.ydoc.getArray(`comments`);let n=new l(this.ytext),r=new m(this.wsBaseUrl,t,this.ydoc,{disableBc:!0,maxBackoffTime:5e3});h(r);let i=r.awareness,a=this.providedLocalUser??ie(this.preferredUserName);this.provider=r,this.awareness=i,this.localUser=a,this.initialSyncComplete=!1,this.initialSyncPromise=new Promise(e=>{this.resolveInitialSync=e}),i.setLocalStateField(`user`,a),i.on(`change`,()=>{this.onAwarenessChange?.(this.collectUsers(this.resolveAwarenessCursor))}),this.trackConnectionStatus();let o=!1;return r.on(`sync`,e=>{e&&!o&&(o=!0,this.initialSyncComplete=!0,this.resolveInitialSync?.(),this.resolveInitialSync=null,this.onInitialSync?.())}),{awareness:i,commentThreads:this.commentThreads,localUser:this.localUser,undoManager:n,ydoc:this.ydoc,ytext:this.ytext}}destroy(){this.resolveInitialSync?.(),this.resolveInitialSync=null,this.initialSyncComplete=!1,this.initialSyncPromise=Promise.resolve(),this.provider?.disconnect(),this.provider?.destroy(),this.provider=null,this.awareness=null,this.localUser=null,this.ydoc?.destroy(),this.ydoc=null,this.ytext=null,this.commentThreads=null}waitForInitialSync(e=1500){return this.initialSyncComplete?Promise.resolve():e==null||e===!1?this.initialSyncPromise:Promise.race([this.initialSyncPromise,new Promise(t=>{window.setTimeout(t,e)})])}getText(){return this.ytext?.toString()??``}getLocalUser(){return this.localUser}setUserName(e){let t=re(e);return!t||!this.awareness||!this.localUser?null:(this.localUser={...this.localUser,name:t},this.awareness.setLocalStateField(`user`,this.localUser),t)}getUserCursor(e,t){return this.awareness?t(this.awareness.getStates().get(e)?.cursor):null}getUserViewport(e){if(!this.awareness)return null;let t=this.awareness.getStates().get(e);return this.normalizeViewport(t?.viewport)}setLocalViewport(e){if(!this.awareness)return null;let t=this.normalizeViewport(e);return this.awareness.setLocalStateField(`viewport`,t),t}collectUsers(e=()=>null){if(!this.awareness)return[];let t=[];return this.awareness.getStates().forEach((n,r)=>{if(!n.user)return;let i=e(n.cursor);t.push({...i??{},...n.user,clientId:r,hasCursor:!!i,isLocal:r===this.awareness.clientID,viewport:this.normalizeViewport(n.viewport)})}),t}trackConnectionStatus(){if(!this.provider)return;let e=0,t=!1;this.provider.on(`status`,({status:n})=>{n===`connecting`&&(e+=1);let r=n===`connected`&&!t;n===`connected`&&(e=0,t=!0),this.onConnectionChange?.({attempts:e,firstConnection:r,hasEverConnected:t,status:n,unreachable:!t&&e>=3,wsBaseUrl:this.wsBaseUrl})})}};function F(e){return new k(T.define(e))}function I(e){return t(()=>import(`./dist-uk11ih8u.js`).then(t=>t.sql({dialect:t[e]})),[],import.meta.url)}var Ge=[w.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return t(()=>import(`./dist-DOHWxIty.js`).then(e=>e.cpp()),[],import.meta.url)}}),w.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return t(()=>import(`./dist-DOHWxIty.js`).then(e=>e.cpp()),[],import.meta.url)}}),w.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return I(`Cassandra`)}}),w.of({name:`CSS`,extensions:[`css`],load(){return t(()=>import(`./dist-cYiJMWHJ.js`).then(e=>e.css()),[],import.meta.url)}}),w.of({name:`Go`,extensions:[`go`],load(){return t(()=>import(`./dist-BSTbcioM.js`).then(e=>e.go()),[],import.meta.url)}}),w.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return t(()=>import(`./dist-iKC7go4m.js`).then(e=>e.html()),[],import.meta.url)}}),w.of({name:`Java`,extensions:[`java`],load(){return t(()=>import(`./dist-lw5TGjI6.js`).then(e=>e.java()),[],import.meta.url)}}),w.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return t(()=>import(`./dist-BIAv19LO.js`).then(e=>e.javascript()),[],import.meta.url)}}),w.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return t(()=>import(`./dist-PUxZqhFe.js`).then(e=>e.jinja()),[],import.meta.url)}}),w.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return t(()=>import(`./dist-BpAUe9sL.js`).then(e=>e.json()),[],import.meta.url)}}),w.of({name:`JSX`,extensions:[`jsx`],load(){return t(()=>import(`./dist-BIAv19LO.js`).then(e=>e.javascript({jsx:!0})),[],import.meta.url)}}),w.of({name:`LESS`,extensions:[`less`],load(){return t(()=>import(`./dist-BT9gJXCb.js`).then(e=>e.less()),[],import.meta.url)}}),w.of({name:`Liquid`,extensions:[`liquid`],load(){return t(()=>import(`./dist-CucpLxUY.js`).then(e=>e.liquid()),[],import.meta.url)}}),w.of({name:`MariaDB SQL`,load(){return I(`MariaSQL`)}}),w.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return t(()=>import(`./dist-DugWGOjQ.js`).then(e=>e.markdown()),[],import.meta.url)}}),w.of({name:`MS SQL`,load(){return I(`MSSQL`)}}),w.of({name:`MySQL`,load(){return I(`MySQL`)}}),w.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return t(()=>import(`./dist-CBsvKPcT.js`).then(e=>e.php()),[],import.meta.url)}}),w.of({name:`PLSQL`,extensions:[`pls`],load(){return I(`PLSQL`)}}),w.of({name:`PostgreSQL`,load(){return I(`PostgreSQL`)}}),w.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return t(()=>import(`./dist-Bi9ZIYXq.js`).then(e=>e.python()),[],import.meta.url)}}),w.of({name:`Rust`,extensions:[`rs`],load(){return t(()=>import(`./dist-BrKhPlc9.js`).then(e=>e.rust()),[],import.meta.url)}}),w.of({name:`Sass`,extensions:[`sass`],load(){return t(()=>import(`./dist-KrdpB_GB.js`).then(e=>e.sass({indented:!0})),[],import.meta.url)}}),w.of({name:`SCSS`,extensions:[`scss`],load(){return t(()=>import(`./dist-KrdpB_GB.js`).then(e=>e.sass()),[],import.meta.url)}}),w.of({name:`SQL`,extensions:[`sql`],load(){return I(`StandardSQL`)}}),w.of({name:`SQLite`,load(){return I(`SQLite`)}}),w.of({name:`TSX`,extensions:[`tsx`],load(){return t(()=>import(`./dist-BIAv19LO.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),[],import.meta.url)}}),w.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return t(()=>import(`./dist-BIAv19LO.js`).then(e=>e.javascript({typescript:!0})),[],import.meta.url)}}),w.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return t(()=>import(`./dist-9Eodxf4G.js`).then(e=>e.wast()),[],import.meta.url)}}),w.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return t(()=>import(`./dist-DeCV9FU4.js`).then(e=>e.xml()),[],import.meta.url)}}),w.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return t(()=>import(`./dist-B6QCMNze.js`).then(e=>e.yaml()),[],import.meta.url)}}),w.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return t(()=>import(`./apl-gfMMiTNf.js`).then(e=>F(e.apl)),[],import.meta.url)}}),w.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return t(()=>import(`./asciiarmor-C_eisQCp.js`).then(e=>F(e.asciiArmor)),[],import.meta.url)}}),w.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return t(()=>import(`./asn1-DCl_8MCW.js`).then(e=>F(e.asn1({}))),[],import.meta.url)}}),w.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return t(()=>import(`./asterisk-BEn0Cwpx.js`).then(e=>F(e.asterisk)),[],import.meta.url)}}),w.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return t(()=>import(`./brainfuck-D5EjA2JK.js`).then(e=>F(e.brainfuck)),[],import.meta.url)}}),w.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return t(()=>import(`./cobol-DHLQUbN7.js`).then(e=>F(e.cobol)),[],import.meta.url)}}),w.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.csharp)),[],import.meta.url)}}),w.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return t(()=>import(`./clojure-BflJGmDX.js`).then(e=>F(e.clojure)),[],import.meta.url)}}),w.of({name:`ClojureScript`,extensions:[`cljs`],load(){return t(()=>import(`./clojure-BflJGmDX.js`).then(e=>F(e.clojure)),[],import.meta.url)}}),w.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return t(()=>import(`./css-CnaYoQib.js`).then(e=>F(e.gss)),[],import.meta.url)}}),w.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return t(()=>import(`./cmake-84nbDH0I.js`).then(e=>F(e.cmake)),[],import.meta.url)}}),w.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return t(()=>import(`./coffeescript-De_zI4J0.js`).then(e=>F(e.coffeeScript)),[],import.meta.url)}}),w.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return t(()=>import(`./commonlisp-DgAKBe0r.js`).then(e=>F(e.commonLisp)),[],import.meta.url)}}),w.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return t(()=>import(`./cypher-p9eYesGn.js`).then(e=>F(e.cypher)),[],import.meta.url)}}),w.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return t(()=>import(`./python-B_1Jd8HM.js`).then(e=>F(e.cython)),[],import.meta.url)}}),w.of({name:`Crystal`,extensions:[`cr`],load(){return t(()=>import(`./crystal-Bsdphhtm.js`).then(e=>F(e.crystal)),[],import.meta.url)}}),w.of({name:`D`,extensions:[`d`],load(){return t(()=>import(`./d-DWkQyNnU.js`).then(e=>F(e.d)),[],import.meta.url)}}),w.of({name:`Dart`,extensions:[`dart`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.dart)),[],import.meta.url)}}),w.of({name:`diff`,extensions:[`diff`,`patch`],load(){return t(()=>import(`./diff-ChtP43wD.js`).then(e=>F(e.diff)),[],import.meta.url)}}),w.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return t(()=>import(`./dockerfile-DJkHQgkl.js`).then(e=>F(e.dockerFile)),[],import.meta.url)}}),w.of({name:`DTD`,extensions:[`dtd`],load(){return t(()=>import(`./dtd-DTF72YNO.js`).then(e=>F(e.dtd)),[],import.meta.url)}}),w.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return t(()=>import(`./dylan-BCDoL_-p.js`).then(e=>F(e.dylan)),[],import.meta.url)}}),w.of({name:`EBNF`,load(){return t(()=>import(`./ebnf-D4c0_ac3.js`).then(e=>F(e.ebnf)),[],import.meta.url)}}),w.of({name:`ECL`,extensions:[`ecl`],load(){return t(()=>import(`./ecl-BVIeWmwY.js`).then(e=>F(e.ecl)),[],import.meta.url)}}),w.of({name:`edn`,extensions:[`edn`],load(){return t(()=>import(`./clojure-BflJGmDX.js`).then(e=>F(e.clojure)),[],import.meta.url)}}),w.of({name:`Eiffel`,extensions:[`e`],load(){return t(()=>import(`./eiffel-BEjRio4Q.js`).then(e=>F(e.eiffel)),[],import.meta.url)}}),w.of({name:`Elm`,extensions:[`elm`],load(){return t(()=>import(`./elm-Cshzl8qu.js`).then(e=>F(e.elm)),[],import.meta.url)}}),w.of({name:`Erlang`,extensions:[`erl`],load(){return t(()=>import(`./erlang-BV0c4Hdn.js`).then(e=>F(e.erlang)),[],import.meta.url)}}),w.of({name:`Esper`,load(){return t(()=>import(`./sql-DuQMFDvy.js`).then(e=>F(e.esper)),[],import.meta.url)}}),w.of({name:`Factor`,extensions:[`factor`],load(){return t(()=>import(`./factor-LKH5gN8L.js`).then(e=>F(e.factor)),[],import.meta.url)}}),w.of({name:`FCL`,load(){return t(()=>import(`./fcl-ClOhbFR7.js`).then(e=>F(e.fcl)),[],import.meta.url)}}),w.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return t(()=>import(`./forth-D6RzAl64.js`).then(e=>F(e.forth)),[],import.meta.url)}}),w.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return t(()=>import(`./fortran-Bt6PBEDR.js`).then(e=>F(e.fortran)),[],import.meta.url)}}),w.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return t(()=>import(`./mllike-B45xgp2S.js`).then(e=>F(e.fSharp)),[],import.meta.url)}}),w.of({name:`Gas`,extensions:[`s`],load(){return t(()=>import(`./gas-BHEdbvp9.js`).then(e=>F(e.gas)),[],import.meta.url)}}),w.of({name:`Gherkin`,extensions:[`feature`],load(){return t(()=>import(`./gherkin-oBAE_ms0.js`).then(e=>F(e.gherkin)),[],import.meta.url)}}),w.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return t(()=>import(`./groovy-CUpZ7dEl.js`).then(e=>F(e.groovy)),[],import.meta.url)}}),w.of({name:`Haskell`,extensions:[`hs`],load(){return t(()=>import(`./haskell-BRsoo5mP.js`).then(e=>F(e.haskell)),[],import.meta.url)}}),w.of({name:`Haxe`,extensions:[`hx`],load(){return t(()=>import(`./haxe-DjVOVvNP.js`).then(e=>F(e.haxe)),[],import.meta.url)}}),w.of({name:`HXML`,extensions:[`hxml`],load(){return t(()=>import(`./haxe-DjVOVvNP.js`).then(e=>F(e.hxml)),[],import.meta.url)}}),w.of({name:`HTTP`,load(){return t(()=>import(`./http-CLVgA2GD.js`).then(e=>F(e.http)),[],import.meta.url)}}),w.of({name:`IDL`,extensions:[`pro`],load(){return t(()=>import(`./idl-BUZw3wgd.js`).then(e=>F(e.idl)),[],import.meta.url)}}),w.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return t(()=>import(`./javascript-DctB8BJo.js`).then(e=>F(e.jsonld)),[],import.meta.url)}}),w.of({name:`Julia`,extensions:[`jl`],load(){return t(()=>import(`./julia-CQfgDRfP.js`).then(e=>F(e.julia)),[],import.meta.url)}}),w.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.kotlin)),[],import.meta.url)}}),w.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return t(()=>import(`./livescript-BXxG0Yva.js`).then(e=>F(e.liveScript)),[],import.meta.url)}}),w.of({name:`Lua`,extensions:[`lua`],load(){return t(()=>import(`./lua-zbJo2mq3.js`).then(e=>F(e.lua)),[],import.meta.url)}}),w.of({name:`mIRC`,extensions:[`mrc`],load(){return t(()=>import(`./mirc-C9zpzAZU.js`).then(e=>F(e.mirc)),[],import.meta.url)}}),w.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return t(()=>import(`./mathematica-u8YMmbU0.js`).then(e=>F(e.mathematica)),[],import.meta.url)}}),w.of({name:`Modelica`,extensions:[`mo`],load(){return t(()=>import(`./modelica-CqHI_q-D.js`).then(e=>F(e.modelica)),[],import.meta.url)}}),w.of({name:`MUMPS`,extensions:[`mps`],load(){return t(()=>import(`./mumps-BSzj6Xyz.js`).then(e=>F(e.mumps)),[],import.meta.url)}}),w.of({name:`Mbox`,extensions:[`mbox`],load(){return t(()=>import(`./mbox-BEMVcqjs.js`).then(e=>F(e.mbox)),[],import.meta.url)}}),w.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return t(()=>import(`./nginx-8H7HVH4w.js`).then(e=>F(e.nginx)),[],import.meta.url)}}),w.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return t(()=>import(`./nsis-CfSuhXs5.js`).then(e=>F(e.nsis)),[],import.meta.url)}}),w.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return t(()=>import(`./ntriples-B9h1VB_g.js`).then(e=>F(e.ntriples)),[],import.meta.url)}}),w.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.objectiveC)),[],import.meta.url)}}),w.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.objectiveCpp)),[],import.meta.url)}}),w.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return t(()=>import(`./mllike-B45xgp2S.js`).then(e=>F(e.oCaml)),[],import.meta.url)}}),w.of({name:`Octave`,extensions:[`m`],load(){return t(()=>import(`./octave-D2Q8cUp1.js`).then(e=>F(e.octave)),[],import.meta.url)}}),w.of({name:`Oz`,extensions:[`oz`],load(){return t(()=>import(`./oz-BwTct_5T.js`).then(e=>F(e.oz)),[],import.meta.url)}}),w.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return t(()=>import(`./pascal-Dp_KdFgX.js`).then(e=>F(e.pascal)),[],import.meta.url)}}),w.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return t(()=>import(`./perl-BkSkiI9m.js`).then(e=>F(e.perl)),[],import.meta.url)}}),w.of({name:`Pig`,extensions:[`pig`],load(){return t(()=>import(`./pig-AF4Hwhju.js`).then(e=>F(e.pig)),[],import.meta.url)}}),w.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return t(()=>import(`./powershell-BcIto6Sf.js`).then(e=>F(e.powerShell)),[],import.meta.url)}}),w.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return t(()=>import(`./properties-C357ku5U.js`).then(e=>F(e.properties)),[],import.meta.url)}}),w.of({name:`ProtoBuf`,extensions:[`proto`],load(){return t(()=>import(`./protobuf-D1ij_kNL.js`).then(e=>F(e.protobuf)),[],import.meta.url)}}),w.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return t(()=>import(`./pug-CqqUmdG7.js`).then(e=>F(e.pug)),[],import.meta.url)}}),w.of({name:`Puppet`,extensions:[`pp`],load(){return t(()=>import(`./puppet-BZyAS7I4.js`).then(e=>F(e.puppet)),[],import.meta.url)}}),w.of({name:`Q`,extensions:[`q`],load(){return t(()=>import(`./q-B9NhS7L_.js`).then(e=>F(e.q)),[],import.meta.url)}}),w.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return t(()=>import(`./r-CxDmU1I4.js`).then(e=>F(e.r)),[],import.meta.url)}}),w.of({name:`RPM Changes`,load(){return t(()=>import(`./rpm-gpDK5sbt.js`).then(e=>F(e.rpmChanges)),[],import.meta.url)}}),w.of({name:`RPM Spec`,extensions:[`spec`],load(){return t(()=>import(`./rpm-gpDK5sbt.js`).then(e=>F(e.rpmSpec)),[],import.meta.url)}}),w.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return t(()=>import(`./ruby-BjXV7-Qa.js`).then(e=>F(e.ruby)),[],import.meta.url)}}),w.of({name:`SAS`,extensions:[`sas`],load(){return t(()=>import(`./sas-C2OyD2Y6.js`).then(e=>F(e.sas)),[],import.meta.url)}}),w.of({name:`Scala`,extensions:[`scala`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.scala)),[],import.meta.url)}}),w.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return t(()=>import(`./scheme-D9qYN0V5.js`).then(e=>F(e.scheme)),[],import.meta.url)}}),w.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return t(()=>import(`./shell-DwuoZtxw.js`).then(e=>F(e.shell)),[],import.meta.url)}}),w.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return t(()=>import(`./sieve-tLWDfEkZ.js`).then(e=>F(e.sieve)),[],import.meta.url)}}),w.of({name:`Smalltalk`,extensions:[`st`],load(){return t(()=>import(`./smalltalk-BLp5-jwC.js`).then(e=>F(e.smalltalk)),[],import.meta.url)}}),w.of({name:`Solr`,load(){return t(()=>import(`./solr-B78wSQJQ.js`).then(e=>F(e.solr)),[],import.meta.url)}}),w.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return t(()=>import(`./mllike-B45xgp2S.js`).then(e=>F(e.sml)),[],import.meta.url)}}),w.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return t(()=>import(`./sparql-Dz-mlCAC.js`).then(e=>F(e.sparql)),[],import.meta.url)}}),w.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return t(()=>import(`./spreadsheet-CTIncYxj.js`).then(e=>F(e.spreadsheet)),[],import.meta.url)}}),w.of({name:`Squirrel`,extensions:[`nut`],load(){return t(()=>import(`./clike-D_6L3tnO.js`).then(e=>F(e.squirrel)),[],import.meta.url)}}),w.of({name:`Stylus`,extensions:[`styl`],load(){return t(()=>import(`./stylus-BOVgKnng.js`).then(e=>F(e.stylus)),[],import.meta.url)}}),w.of({name:`Swift`,extensions:[`swift`],load(){return t(()=>import(`./swift-DKB6_1j6.js`).then(e=>F(e.swift)),[],import.meta.url)}}),w.of({name:`sTeX`,load(){return t(()=>import(`./stex-DNzd62Q_.js`).then(e=>F(e.stex)),[],import.meta.url)}}),w.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return t(()=>import(`./stex-DNzd62Q_.js`).then(e=>F(e.stex)),[],import.meta.url)}}),w.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return t(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>F(e.verilog)),[],import.meta.url)}}),w.of({name:`Tcl`,extensions:[`tcl`],load(){return t(()=>import(`./tcl-BGfruO1u.js`).then(e=>F(e.tcl)),[],import.meta.url)}}),w.of({name:`Textile`,extensions:[`textile`],load(){return t(()=>import(`./textile-C4jVoHG1.js`).then(e=>F(e.textile)),[],import.meta.url)}}),w.of({name:`TiddlyWiki`,load(){return t(()=>import(`./tiddlywiki-VlUiK86J.js`).then(e=>F(e.tiddlyWiki)),[],import.meta.url)}}),w.of({name:`Tiki wiki`,load(){return t(()=>import(`./tiki-AK6FwT8q.js`).then(e=>F(e.tiki)),[],import.meta.url)}}),w.of({name:`TOML`,extensions:[`toml`],load(){return t(()=>import(`./toml-BPTmHmyx.js`).then(e=>F(e.toml)),[],import.meta.url)}}),w.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return t(()=>import(`./troff-C2dAgh7P.js`).then(e=>F(e.troff)),[],import.meta.url)}}),w.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return t(()=>import(`./ttcn-PPSTk1ow.js`).then(e=>F(e.ttcn)),[],import.meta.url)}}),w.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return t(()=>import(`./ttcn-cfg-2b4Gb5sE.js`).then(e=>F(e.ttcnCfg)),[],import.meta.url)}}),w.of({name:`Turtle`,extensions:[`ttl`],load(){return t(()=>import(`./turtle-Cx3rYX2g.js`).then(e=>F(e.turtle)),[],import.meta.url)}}),w.of({name:`Web IDL`,extensions:[`webidl`],load(){return t(()=>import(`./webidl-D5jiJvOU.js`).then(e=>F(e.webIDL)),[],import.meta.url)}}),w.of({name:`VB.NET`,extensions:[`vb`],load(){return t(()=>import(`./vb-BthdM_4N.js`).then(e=>F(e.vb)),[],import.meta.url)}}),w.of({name:`VBScript`,extensions:[`vbs`],load(){return t(()=>import(`./vbscript-D9f6rSsU.js`).then(e=>F(e.vbScript)),[],import.meta.url)}}),w.of({name:`Velocity`,extensions:[`vtl`],load(){return t(()=>import(`./velocity-CqftRsjg.js`).then(e=>F(e.velocity)),[],import.meta.url)}}),w.of({name:`Verilog`,extensions:[`v`],load(){return t(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>F(e.verilog)),[],import.meta.url)}}),w.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return t(()=>import(`./vhdl-kS471soi.js`).then(e=>F(e.vhdl)),[],import.meta.url)}}),w.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return t(()=>import(`./xquery-BKJx4mf9.js`).then(e=>F(e.xQuery)),[],import.meta.url)}}),w.of({name:`Yacas`,extensions:[`ys`],load(){return t(()=>import(`./yacas-CXXgtw0p.js`).then(e=>F(e.yacas)),[],import.meta.url)}}),w.of({name:`Z80`,extensions:[`z80`],load(){return t(()=>import(`./z80-Co3PbHdE.js`).then(e=>F(e.z80)),[],import.meta.url)}}),w.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return t(()=>import(`./mscgen-qgSLujhx.js`).then(e=>F(e.mscgen)),[],import.meta.url)}}),w.of({name:`Xù`,extensions:[`xu`],load(){return t(()=>import(`./mscgen-qgSLujhx.js`).then(e=>F(e.xu)),[],import.meta.url)}}),w.of({name:`MsGenny`,extensions:[`msgenny`],load(){return t(()=>import(`./mscgen-qgSLujhx.js`).then(e=>F(e.msgenny)),[],import.meta.url)}}),w.of({name:`Vue`,extensions:[`vue`],load(){return t(()=>import(`./dist-BTVg1m-V.js`).then(e=>e.vue()),[],import.meta.url)}}),w.of({name:`Angular Template`,load(){return t(()=>import(`./dist-DYFBD-wW.js`).then(e=>e.angular()),[],import.meta.url)}})],Ke=`#e5c07b`,L=`#e06c75`,qe=`#56b6c2`,Je=`#ffffff`,R=`#abb2bf`,z=`#7d8799`,Ye=`#61afef`,Xe=`#98c379`,B=`#d19a66`,Ze=`#c678dd`,Qe=`#21252b`,$e=`#2c313a`,et=`#282c34`,V=`#353a42`,tt=`#3E4451`,nt=`#528bff`,rt=C.theme({"&":{color:R,backgroundColor:et},".cm-content":{caretColor:nt},".cm-cursor, .cm-dropCursor":{borderLeftColor:nt},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:tt},".cm-panels":{backgroundColor:Qe,color:R},".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 #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:et,color:z,border:`none`},".cm-activeLineGutter":{backgroundColor:$e},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:V},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:V,borderBottomColor:V},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$e,color:R}}},{dark:!0}),it=Ce.define([{tag:S.keyword,color:Ze},{tag:[S.name,S.deleted,S.character,S.propertyName,S.macroName],color:L},{tag:[S.function(S.variableName),S.labelName],color:Ye},{tag:[S.color,S.constant(S.name),S.standard(S.name)],color:B},{tag:[S.definition(S.name),S.separator],color:R},{tag:[S.typeName,S.className,S.number,S.changed,S.annotation,S.modifier,S.self,S.namespace],color:Ke},{tag:[S.operator,S.operatorKeyword,S.url,S.escape,S.regexp,S.link,S.special(S.string)],color:qe},{tag:[S.meta,S.comment],color:z},{tag:S.strong,fontWeight:`bold`},{tag:S.emphasis,fontStyle:`italic`},{tag:S.strikethrough,textDecoration:`line-through`},{tag:S.link,color:z,textDecoration:`underline`},{tag:S.heading,fontWeight:`bold`,color:L},{tag:[S.atom,S.bool,S.special(S.variableName)],color:B},{tag:[S.processingInstruction,S.string,S.inserted],color:Xe},{tag:S.invalid,color:Je}]),at=[rt,fe(it)],ot=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:a(this.yanchor),yhead:a(this.yhead)}}static fromJSON(t){return new e(i(t.yanchor),i(t.yhead))}},st=class{constructor(e,t){this.ytext=e,this.awareness=t}toYPos(e,t=0){return s(this.ytext,e,t)}fromYPos(e){let t=f(i(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new ot(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?O.cursor(n.pos,n.assoc):O.range(t.pos,n.pos)}},H=be.define({combine(e){return e[e.length-1]}}),U=D.define(),ct=class{constructor(e){this.view=e,this.conf=e.state.facet(H),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[U.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(U)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
+ `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},lt=x.fromClass(ct),ut=C.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),dt=D.define(),ft=class extends he{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return d(`span`,[o(`class`,`cm-ySelectionCaret`),o(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[c(`⁠`),d(`div`,[o(`class`,`cm-ySelectionCaretDot`)]),c(`⁠`),d(`div`,[o(`class`,`cm-ySelectionInfo`)],[c(this.name)]),c(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},pt=class{constructor(e){this.conf=e.state.facet(H),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[dt.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=ke.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,a=t.doc,o=this.conf.awareness,c=[],l=this.conf.awareness.getLocalState();if(l!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),r=n?e.state.selection.main:null,a=l.cursor==null?null:i(l.cursor.anchor),c=l.cursor==null?null:i(l.cursor.head);if(r!=null){let e=s(t,r.anchor),n=s(t,r.head);(l.cursor==null||!u(a,e)||!u(c,n))&&o.setLocalStateField(`cursor`,{anchor:e,head:n})}else l.cursor!=null&&n&&o.setLocalStateField(`cursor`,null)}o.getStates().forEach((i,s)=>{if(s===o.doc.clientID)return;let l=i.cursor;if(l==null||l.anchor==null||l.head==null)return;let u=f(l.anchor,a),d=f(l.head,a);if(u==null||d==null||u.type!==t||d.type!==t)return;let{color:p=`#30bced`,name:m=`Anonymous`}=i.user||{},h=i.user&&i.user.colorLight||p+`33`,g=r(u.index,d.index),_=n(u.index,d.index),v=e.view.state.doc.lineAt(g),y=e.view.state.doc.lineAt(_);if(v.number===y.number)c.push({from:g,to:_,value:j.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});else{c.push({from:g,to:v.from+v.length,value:j.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})}),c.push({from:y.from,to:_,value:j.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});for(let t=v.number+1;t<y.number;t++){let n=e.view.state.doc.line(t).from;c.push({from:n,to:n,value:j.line({attributes:{style:`background-color: ${h}`,class:`cm-yLineSelection`}})})}}c.push({from:d.index,to:d.index,value:j.widget({side:d.index-u.index>0?-1:1,block:!1,widget:new ft(p,m)})})}),this.decorations=j.set(c,!0)}},mt=x.fromClass(pt,{decorations:e=>e.decorations}),ht=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},W=be.define({combine(e){return e[e.length-1]}});D.define();var gt=class{constructor(e){this.view=e,this.conf=e.state.facet(W),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(H),this._beforeChangeSelection=null,this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:t})=>{let n=t.meta.get(this);if(n){let t=this.syncConf.fromYRange(n);e.dispatch(e.state.update({selection:t,effects:[C.scrollIntoView(t)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(U)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},_t=x.fromClass(gt),vt=({state:e,dispatch:t})=>e.facet(W).undo()||!0,G=({state:e,dispatch:t})=>e.facet(W).redo()||!0,yt=[{key:`Mod-z`,run:vt,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:G,preventDefault:!0},{key:`Mod-Shift-z`,run:G,preventDefault:!0}],bt=(e,t,{undoManager:n=new l(e)}={})=>{let r=new st(e,t),i=[H.of(r),lt];return t&&i.push(ut,mt),n!==!1&&i.push(W.of(new ht(n)),_t,C.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?vt(t):e.inputType===`historyRedo`&&G(t)}})),i};function K(e,t){let n=Error(t);return n.code=e,n}function xt(e,{maxCharacters:t=1/0,maxReplacements:n=1/0}={}){if(!Array.isArray(e)||e.length===0)throw K(`EXACT_EDIT_REQUIRED`,`At least one text replacement is required`);if(e.length>n)throw K(`EXACT_EDIT_LIMIT`,`At most ${n} text replacements are allowed`);let r=0;for(let t of e){if(!t||typeof t.oldText!=`string`||t.oldText.length===0||typeof t.newText!=`string`)throw K(`EXACT_EDIT_INVALID`,`Each replacement requires non-empty oldText and string newText`);if(t.oldText===t.newText)throw K(`EXACT_EDIT_UNCHANGED`,`A replacement must change the document`);r+=t.oldText.length+t.newText.length}if(r>t)throw K(`EXACT_EDIT_LIMIT`,`Text replacements may contain at most ${t} characters`);return e}function St(e,t,n={}){let r=String(e??``),i=xt(t,n).map(({newText:e,oldText:t})=>{let n=r.indexOf(t);if(n<0)throw K(`EXACT_EDIT_MISMATCH`,`A requested text replacement no longer matches the document`);if(r.includes(t,n+1))throw K(`EXACT_EDIT_NOT_UNIQUE`,`A requested text replacement is not unique in the document`);return{from:n,insert:e,to:n+t.length}}).sort((e,t)=>e.from-t.from);for(let e=1;e<i.length;e+=1)if(i[e].from<i[e-1].to)throw K(`EXACT_EDIT_OVERLAP`,`Requested text replacements overlap`);return i}var q=Object.freeze({bold:`bold text`,code:`code`,italic:`emphasis`,strikethrough:`struck text`}),J=`link text`,Ct=`https://`,wt=`alt text`,Tt=`https://`,Et=`Video`,Dt=`https://`,Ot=`code`,kt=Object.freeze([`Column 1`,`Column 2`]),At=`Value`,Y=Object.freeze({heading:/^#{1,6}\s+/,quote:/^>\s+/,bulletList:/^[-*+]\s+/,numberedList:/^\d+\.\s+/,taskList:/^-\s\[(?: |x|X)\]\s+/});function jt(e,t){return{from:Math.max(0,Math.min(e.from,e.to,t)),to:Math.max(0,Math.min(Math.max(e.from,e.to),t))}}function Mt(e,t){return t===0||e[t-1]===`
3
3
  `}function Nt(e,t){if(t<=0)return 0;let n=e.lastIndexOf(`
4
4
  `,t-1);return n<0?0:n+1}function Pt(e,t){let n=e.indexOf(`
5
5
  `,t);return n<0?e.length:n}function Ft(e,t){let{from:n}=t,{to:r}=t;return r>n&&Mt(e,r)&&--r,{from:Nt(e,n),to:Pt(e,Math.max(n,r))}}function X(e,t,n,r){let i=e.slice(t.from,t.to);if(i.length>n.length*2&&i.startsWith(n)&&i.endsWith(n)){let e=i.slice(n.length,i.length-n.length);return{anchor:t.from,from:t.from,head:t.from+e.length,insert:e,to:t.to}}return i.length>0?{anchor:t.from+n.length,from:t.from,head:t.from+n.length+i.length,insert:`${n}${i}${n}`,to:t.to}:{anchor:t.from+n.length,from:t.from,head:t.from+n.length+r.length,insert:`${n}${r}${n}`,to:t.to}}function Z(e){return/^https?:\/\//i.test(e.trim())}function It(e,t){let n=e.slice(t.from,t.to);if(n.length>0&&Z(n))return{anchor:t.from+1,from:t.from,head:t.from+1+9,insert:`[${J}](${n})`,to:t.to};if(n.length>0){let e=`[${n}](`;return{anchor:t.from+e.length,from:t.from,head:t.from+e.length+8,insert:`${e}${Ct})`,to:t.to}}return{anchor:t.from+1,from:t.from,head:t.from+1+9,insert:`[${J}](${Ct})`,to:t.to}}function Lt(e,t){let n=e.slice(t.from,t.to);if(n.length>0&&Z(n))return{anchor:t.from+2,from:t.from,head:t.from+2+8,insert:`![${wt}](${n})`,to:t.to};if(n.length>0){let e=`![${n}](`;return{anchor:t.from+e.length,from:t.from,head:t.from+e.length+8,insert:`${e}${Tt})`,to:t.to}}return{anchor:t.from+2,from:t.from,head:t.from+2+8,insert:`![${wt}](${Tt})`,to:t.to}}function Rt(e,t){let n=e.slice(t.from,t.to);if(n.length>0&&Z(n))return{anchor:t.from+2,from:t.from,head:t.from+2+5,insert:`![${Et}](${n})`,to:t.to};if(n.length>0){let e=`![${n}](`;return{anchor:t.from+e.length,from:t.from,head:t.from+e.length+8,insert:`${e}${Dt})`,to:t.to}}return{anchor:t.from+2,from:t.from,head:t.from+2+5,insert:`![${Et}](${Dt})`,to:t.to}}function zt(e){return Y.taskList.test(e)?e.replace(Y.taskList,``):Y.numberedList.test(e)?e.replace(Y.numberedList,``):Y.bulletList.test(e)?e.replace(Y.bulletList,``):Y.quote.test(e)?e.replace(Y.quote,``):Y.heading.test(e)?e.replace(Y.heading,``):e}function Bt(e,t){switch(t){case`paragraph`:return!(Y.taskList.test(e)||Y.numberedList.test(e)||Y.bulletList.test(e)||Y.quote.test(e)||Y.heading.test(e));case`heading-1`:return/^#\s+/.test(e);case`heading-2`:return/^##\s+/.test(e);case`heading-3`:return/^###\s+/.test(e);case`heading-4`:return/^####\s+/.test(e);case`heading-5`:return/^#####\s+/.test(e);case`heading-6`:return/^######\s+/.test(e);case`quote`:return Y.quote.test(e);case`bullet-list`:return Y.bulletList.test(e)&&!Y.taskList.test(e);case`numbered-list`:return Y.numberedList.test(e);case`task-list`:return Y.taskList.test(e);default:return!1}}function Vt(e,t){switch(e){case`heading-1`:return`# `;case`heading-2`:return`## `;case`heading-3`:return`### `;case`heading-4`:return`#### `;case`heading-5`:return`##### `;case`heading-6`:return`###### `;case`quote`:return`> `;case`bullet-list`:return`- `;case`numbered-list`:return`${t+1}. `;case`task-list`:return`- [ ] `;default:return``}}function Q(e,t,n){let r=Ft(e,t),i=e.slice(r.from,r.to).split(`
@@ -11,4 +11,4 @@ import"./runtime-config-BFVdhnJu.js";import{o as e}from"./runtime-paths-Cn0snt_9
11
11
  `,s=a?`
12
12
  `:``,c=`${s}${n}${o?`
13
13
  `:``}`,l=t.from+s.length+r;return{anchor:l,from:t.from,head:l+i,insert:c,to:t.to}}function Xt(e=``){let t=e.trim()||At;return[`| ${kt.join(` | `)} |`,`| --- | --- |`,`| ${t} | ${At} |`].join(`
14
- `)}function Zt(e,t){return Yt(e,t,Xt(e.slice(t.from,t.to)),2,kt[0].length)}function Qt(e,t){return Yt(e,t,`---`,4,0)}function $t(e,t,n){let r=String(e??``),i=jt(t,r.length),a;switch(n){case`bold`:a=X(r,i,`**`,q.bold);break;case`italic`:a=X(r,i,`_`,q.italic);break;case`strikethrough`:a=X(r,i,`~~`,q.strikethrough);break;case`code`:a=X(r,i,"`",q.code);break;case`link`:a=It(r,i);break;case`image`:a=Lt(r,i);break;case`video`:a=Rt(r,i);break;case`paragraph`:a=Kt(r,i);break;case`heading`:a=$(r,i,2);break;case`heading-1`:a=$(r,i,1);break;case`heading-2`:a=$(r,i,2);break;case`heading-3`:a=$(r,i,3);break;case`heading-4`:a=$(r,i,4);break;case`heading-5`:a=$(r,i,5);break;case`heading-6`:a=$(r,i,6);break;case`quote`:a=Ut(r,i);break;case`bullet-list`:a=Ht(r,i);break;case`numbered-list`:a=Gt(r,i);break;case`task-list`:a=Wt(r,i);break;case`code-block`:a=Jt(r,i);break;case`table`:a=Zt(r,i);break;case`horizontal-rule`:a=Qt(r,i);break;default:return null}return a?r.slice(a.from,a.to)===a.insert?null:a:null}var en=new Set([`block-beta`,`classdiagram`,`erdiagram`,`flowchart`,`gantt`,`gitgraph`,`graph`,`journey`,`mindmap`,`pie`,`quadrantchart`,`sankey-beta`,`sequencediagram`,`statediagram`,`statediagram-v2`,`timeline`,`xychart-beta`]),tn=new Set(`accdescr.acctitle.actor.alt.and.autonumber.break.callback.class.classdef.click.critical.dateformat.direction.else.end.exclude.include.interpolate.link.linkstyle.loop.note.opt.par.participant.rect.section.state.style.subgraph.theme.title`.split(`.`)),nn=new Set([`false`,`no`,`off`,`on`,`true`,`yes`]),rn=new Set([`bt`,`lr`,`rl`,`tb`,`td`]);function an(e){let t=e.match(/[A-Za-z_][\w.]*(?:-[A-Za-z0-9_][\w.]*)*/u,!1);return t?(e.match(/[A-Za-z_][\w.]*(?:-[A-Za-z0-9_][\w.]*)*/u),t[0]):``}function on(e){return e.match(`%%{`)?(e.skipTo(`}%%`)?e.match(`}%%`):e.skipToEnd(),!0):!1}var sn=T.define({languageData:{commentTokens:{line:`%%`}},token(e){if(e.eatSpace())return null;if(on(e))return`meta`;if(e.match(`%%`))return e.skipToEnd(),`comment`;if(e.match(/"(?:[^"\\]|\\.)*"?/u)||e.match(/'(?:[^'\\]|\\.)*'?/u))return`string`;if(e.match(/#[0-9a-f]{3,8}\b/iu)||e.match(/#[A-Za-z][\w-]*/u))return`atom`;if(e.match(/\b\d+(?:\.\d+)?%?\b/u))return`number`;if(e.match(/[ox*+<#]?[-=.\\/]+(?:left|right|up|down)?[-=.\\/]*[ox*+>#]?/iu))return`operator`;if(e.match(/[{}[\]():,;|]/u))return`punctuation`;let t=an(e);if(t){let e=t.toLowerCase();return en.has(e)?`meta`:tn.has(e)?`keyword`:nn.has(e)?`bool`:rn.has(e)?`atom`:/^[A-Z][A-Z0-9_]*$/u.test(t)?`typeName`:`variableName`}return e.next(),null}}),cn=new k(sn),ln=w.of({alias:[`mermaid`,`mmd`],extensions:[`mermaid`,`mmd`],name:`Mermaid`,support:cn}),un=30;function dn(e){return t=>{let n=t.state.doc.lineAt(t.pos),r=n.text.slice(0,t.pos-n.from),i=r.lastIndexOf(`[[`);if(i===-1)return null;let a=r.slice(i+2);if(a.includes(`]]`))return null;let o=a.trim().toLowerCase().replace(/\s+/gu,` `),s=n.from+i+2,c=e().map(e=>Ue(e)),l=(o?c.map(e=>({entry:e,match:He(e,o)})).filter(({match:e})=>e).sort((e,t)=>t.match.score-e.match.score||e.entry.lowerPath.localeCompare(t.entry.lowerPath)):c.map(e=>({entry:e,match:null}))).slice(0,un).map(({entry:e})=>({label:e.filePath,displayLabel:e.filePath.split(`/`).pop(),detail:e.displayName.slice(0,-e.fileName.length-1)||void 0,apply:(e,t,n,r)=>{let i=r;e.state.sliceDoc(r,r+2)===`]]`&&(i=r+2),e.dispatch({changes:{from:n,to:i,insert:`${t.label}]]`},selection:{anchor:n+t.label.length+2}})},type:`text`}));return l.length===0?null:{from:s,options:l,filter:!1}}}var fn=new Set([`@startuml`,`@enduml`,`@startmindmap`,`@endmindmap`,`@startwbs`,`@endwbs`,`@startgantt`,`@endgantt`,`@startjson`,`@endjson`,`@startyaml`,`@endyaml`,`@startsalt`,`@endsalt`]),pn=new Set(`activate.actor.agent.allowmixing.alt.annotation.artifact.as.autonumber.boundary.box.break.caption.card.case.circle.class.cloud.collections.component.control.create.critical.database.deactivate.destroy.detach.else.elseif.end.endlegend.endif.endwhile.entity.enum.exception.file.folder.footer.fork.frame.group.header.hide.hnote.if.interface.json.kill.label.legend.loop.map.namespace.newpage.node.note.object.of.opt.order.over.package.page.par.participant.partition.person.port.protocol.queue.rectangle.ref.repeat.return.rnote.show.skinparam.split.stack.start.state.stop.storage.struct.switch.then.title.usecase.while`.split(`.`)),mn=new Set([`false`,`no`,`off`,`on`,`true`,`yes`]);function hn(e){let t=e.match(/[@!A-Za-z_][\w.-]*/u,!1);return t?(e.match(/[@!A-Za-z_][\w.-]*/u),t[0]):``}var gn=T.define({languageData:{commentTokens:{block:{close:`'/`,open:`/'`},line:`'`}},startState(){return{inBlockComment:!1}},token(e,t){if(t.inBlockComment)return e.skipTo(`'/`)?(e.match(`'/`),t.inBlockComment=!1):e.skipToEnd(),`comment`;if(e.eatSpace())return null;if(e.match(`/'`))return t.inBlockComment=!0,`comment`;let n=e.pos===0?` `:e.string.charAt(e.pos-1);if(e.peek()===`'`&&(e.sol()||/\s/u.test(n)))return e.skipToEnd(),`comment`;if(e.match(/"(?:[^"\\]|\\.)*"?/u))return`string`;if(e.match(/#[0-9a-f]{3,8}\b/iu)||e.match(/#[A-Za-z][\w-]*/u))return`atom`;if(e.match(/\b\d+(?:\.\d+)?\b/u))return`number`;if(e.match(/[<>{}[\]():,]/u))return`punctuation`;if(e.match(/[ox*+<#]?[-=.\\/]+(?:left|right|up|down)?[-=.\\/]*[ox*+>#]?/iu))return`operator`;let r=hn(e);if(r){let e=r.toLowerCase();return e.startsWith(`!`)||fn.has(e)?`meta`:pn.has(e)?`keyword`:mn.has(e)?`bool`:/^[A-Z][A-Z0-9_]*$/u.test(r)?`typeName`:`variableName`}return e.next(),null}}),_n=new k(gn),vn=w.of({alias:[`plantuml`,`puml`],extensions:[`plantuml`,`puml`],name:`PlantUML`,support:_n}),yn=new Set(`animation.autoLayout.component.configuration.container.custom.decisions.deployment.description.dynamic.element.filtered.group.include.image.model.person.perspectives.properties.relationship.relationships.styles.systemContext.systemLandscape.system.theme.views.workspace`.split(`.`));function bn(e){let t=e.match(/[A-Za-z_][\w.-]*/u,!1);return t?(e.match(/[A-Za-z_][\w.-]*/u),t[0]):``}var xn=T.define({languageData:{commentTokens:{line:`//`}},token(e){if(e.eatSpace())return null;if(e.match(`//`))return e.skipToEnd(),`comment`;if(e.match(/!\w+/u))return`meta`;if(e.match(/"(?:[^"\\]|\\.)*"?/u))return`string`;if(e.match(/\b\d+(?:\.\d+)?\b/u))return`number`;if(e.match(/[-=]?>|[{}[\]():,=]/u))return`operator`;let t=bn(e);return t?yn.has(t)?`keyword`:/^[A-Z][A-Z0-9_]*$/u.test(t)?`typeName`:`variableName`:(e.next(),null)}}),Sn=new k(xn),Cn=w.of({alias:[`structurizr`,`structurizr-dsl`],extensions:[`dsl`],name:`Structurizr DSL`,support:Sn});function wn(e){let t=Array.from(e?.clipboardData?.files??[]);for(let e of t)if(e?.type?.startsWith?.(`image/`))return e;let n=Array.from(e?.clipboardData?.items??[]);for(let e of n){if(e.kind!==`file`||!e.type?.startsWith?.(`image/`))continue;let t=e.getAsFile?.();if(t)return t}return null}function Tn(e,t){let n=wn(e);return n?typeof t==`function`?(console.debug(`[editor] Detected pasted image.`,{name:n.name??``,size:n.size??null,type:n.type??``}),e.preventDefault?.(),Promise.resolve(t(n)).catch(e=>{console.error(`[editor] Failed to process pasted image:`,e)}),!0):(console.warn(`[editor] Ignoring pasted image because no image paste handler is registered.`),!1):!1}var En=new Set(`bash.c.c++.cpp.css.diff.html.java.javascript.js.json.jsx.markdown.md.python.py.rust.sh.shell.sql.ts.tsx.typescript.xml.yaml.yml`.split(`.`));function Dn(e){return[e.name,...e.alias||[]].map(e=>String(e).toLowerCase()).some(e=>En.has(e))}var On=[...Ge.filter(Dn),ln,vn,Cn],kn=j.mark({class:`cm-matchingBracket cm-matchingBracket-paired`}),An=j.mark({class:`cm-nonmatchingBracket`}),jn=j.mark({class:`cm-remoteUpdateFlash`}),Mn=1350,Nn=160,Pn=900,Fn=/^(\s*(?:>\s*)*(?:[-+*]|\d+[.)])\s+\[)( |x|X)(\])(\s.*)?$/;function In(e){let t=e.scrollDOM.scrollTop,n=e.state.selection,r=P(e);return r&&requestAnimationFrame(()=>{e.dom.isConnected&&e.state.selection.eq(n)&&(e.scrollDOM.scrollTop=t)}),r}function Ln(e){return JSON.stringify([e.search,e.caseSensitive,e.regexp,e.wholeWord])}function Rn(){let e=``,t=!1,n=0;return C.updateListener.of(r=>{let i=M(r.state),a=N(r.state),o=Ln(a),s=i&&a.valid&&(!t||o!==e);t=i,e=o,s&&(n&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{if(n=0,!r.view.dom.isConnected)return;let e=N(r.view.state);if(!M(r.view.state)||!e.valid||Ln(e)!==o)return;let t=r.view.dom.querySelector(`.cm-search input[name="search"]`),i=t===r.view.root.activeElement&&t?{end:t.selectionEnd,start:t.selectionStart}:null;Be(r.view),i&&t?.setSelectionRange&&t.setSelectionRange(i.start,i.end)}))})}var zn=Object.freeze({indentLess:Ie,indentMore:Re,openSearch:In}),Bn=class extends pe{toDOM(){let e=document.createElement(`span`);return e.className=`cm-remoteUpdateCaretWidget`,e.setAttribute(`aria-hidden`,`true`),e}ignoreEvent(){return!0}},Vn=fe.define(),Hn=fe.define(),Un=ce.define({create:()=>j.none,update(e,t){let n=e.map(t.changes);return t.effects.forEach(e=>{if(e.is(Hn)){n=j.none;return}if(e.is(Vn)){let{from:t,showCaret:r,to:i}=e.value,a=[];i>t&&a.push(jn.range(t,i)),r&&a.push(j.widget({side:-1,widget:new Bn}).range(t)),n=a.length>0?j.set(a,!0):j.none}}),n},provide:e=>C.decorations.from(e)});function Wn(e,t){return t.selection.ranges.some(t=>t.empty&&e.to===t.head)}function Gn(e,t){let n=[];if(!e.matched)return n.push(An.range(e.start.from,e.start.to)),e.end&&n.push(An.range(e.end.from,e.end.to)),n;let r=Wn(e.start,t),i=e.end?Wn(e.end,t):!1;return r||n.push(kn.range(e.start.from,e.start.to)),e.end&&!i&&n.push(kn.range(e.end.from,e.end.to)),n}function Kn(e){let t=e===`dark`?`oklch(from var(--color-surface-offset) l c h / 0.55)`:`oklch(from var(--color-surface-offset) l c h / 0.75)`,n=e===`dark`?`oklch(from var(--color-primary) l c h / 0.28)`:`oklch(from var(--color-primary) l c h / 0.18)`,r=e===`dark`?`oklch(from var(--color-primary) l c h / 0.4)`:`oklch(from var(--color-primary) l c h / 0.26)`,i=e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`,a=e===`dark`?`oklch(from var(--color-primary) l c h / 0.2)`:`oklch(from var(--color-primary) l c h / 0.12)`,o=e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0.85)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.7)`,s=e===`dark`?`oklch(from var(--color-error) l c h / 0.12)`:`oklch(from var(--color-error) l c h / 0.1)`,c=e===`dark`?`oklch(from var(--color-error) calc(l + 0.08) c h / 0.8)`:`oklch(from var(--color-error) calc(l - 0.04) c h / 0.7)`;return C.theme({"&":{backgroundColor:`var(--color-bg)`,color:`var(--color-text)`},".cm-content":{caretColor:i,fontFamily:`var(--font-mono)`,padding:`16px 0`},".cm-cursor, .cm-dropCursor":{borderLeftColor:i,borderLeftWidth:`3px`,marginLeft:`-1px`},".cm-foldPlaceholder":{backgroundColor:`var(--color-surface-dynamic)`,border:`none`,color:`var(--color-text-muted)`},".cm-gutters":{backgroundColor:`var(--color-surface)`,borderRight:`1px solid var(--color-divider)`,color:`var(--color-text-muted)`,minWidth:`44px`},".cm-line":{padding:`0 16px`},".cm-activeLine":{backgroundColor:t,boxShadow:`inset 3px 0 0 ${n}`},"&:has(.cm-selectionBackground) .cm-activeLine":{backgroundColor:`transparent`,boxShadow:`none`},".cm-activeLineGutter":{backgroundColor:t,boxShadow:`inset 3px 0 0 ${n}`,color:`var(--color-text-muted)`},".cm-matchingBracket":{borderRadius:`2px`,color:`inherit`},".cm-matchingBracket.cm-matchingBracket-paired":{backgroundColor:a,outline:`1px solid ${o}`},".cm-nonmatchingBracket":{backgroundColor:s,outline:`1px solid ${c}`,borderRadius:`2px`},".cm-selectionMatch":{backgroundColor:`var(--color-primary-highlight)`},".cm-remoteUpdateFlash":{animation:`collabmd-remote-update-flash 1.35s ease-out`,backgroundColor:e===`dark`?`oklch(from var(--color-primary) l c h / 0.22)`:`oklch(from var(--color-primary) l c h / 0.16)`,borderRadius:`3px`,boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.05) c h / 0.26)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.2)`}`},".cm-remoteUpdateCaretWidget":{animation:`collabmd-remote-update-caret 1s ease-out`,backgroundColor:`transparent`,borderLeft:`2px solid ${e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`}`,borderRadius:`999px`,boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.06) c h / 0.22)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.16)`}`,display:`inline-block`,height:`1.2em`,marginLeft:`-1px`,marginRight:`-1px`,pointerEvents:`none`,transformOrigin:`center bottom`,verticalAlign:`text-bottom`,width:`0`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:r},"@keyframes collabmd-remote-update-flash":{"0%":{backgroundColor:e===`dark`?`oklch(from var(--color-primary) l c h / 0.34)`:`oklch(from var(--color-primary) l c h / 0.26)`},"100%":{backgroundColor:`oklch(from var(--color-primary) l c h / 0)`}},"@keyframes collabmd-remote-update-caret":{"0%":{boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0.34)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.24)`}`,opacity:`0`,transform:`translateY(0.2em) scaleY(0.7)`},"18%":{opacity:`1`,transform:`translateY(0) scaleY(1)`},"72%":{opacity:`1`,transform:`translateY(0) scaleY(1)`},"100%":{boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0)`}`,opacity:`0`,transform:`translateY(-0.05em) scaleY(0.9)`}}},{dark:e===`dark`})}function qn(e){return y(e)?Oe():_(e)?cn:ee(e)?_n:v(e)?Sn:g(e)?Pe():Me({base:Ne,codeLanguages:On})}function Jn(e){return{from:Math.min(...e.ranges.map(e=>Math.min(e.from,e.to))),to:Math.max(...e.ranges.map(e=>Math.max(e.from,e.to)))}}var Yn=class{constructor({editorContainer:e,getFileList:t,initialTheme:n,lineInfoElement:r,lineWrappingEnabled:i=!0,vimModeEnabled:a=!1,onDocChanged:o=null,onImagePaste:s=null,onSelectionChanged:c=null,onViewportChanged:l=null}){this.editorContainer=e,this.getFileList=t??(()=>[]),this.initialTheme=n,this.lineInfoElement=r,this.lineWrappingEnabled=i,this.vimModeEnabled=!!a,this.onDocChanged=o,this.onImagePaste=s,this.onSelectionChanged=c,this.onViewportChanged=l,this.editorView=null,this.undoManager=null,this.themeCompartment=new A,this.syntaxThemeCompartment=new A,this.lineWrappingCompartment=new A,this.vimModeCompartment=new A,this.viewportFrame=0,this.remoteUpdateFlashTimer=0,this.lastLocalInputAt=0,this.handleScroll=()=>{this.viewportFrame||=requestAnimationFrame(()=>{this.viewportFrame=0,this.emitViewportChange()})},this.handleLocalInputActivity=()=>{this.lastLocalInputAt=Date.now()}}createUpdateListener(){return C.updateListener.of(e=>{e.docChanged&&this.onDocChanged?.(),(e.selectionSet||e.docChanged)&&(this.updateCursorInfo(e.state),this.onSelectionChanged?.(e.state))})}getBaseExtensions(e,{readOnly:t=!1}={}){let n=dn(this.getFileList),r=[_e(),ge(),de(),Ee(),le(),E.allowMultipleSelections.of(!0),ue(),x(ye,{fallback:!0}),Se({renderMatch:Gn}),je(),Ae(),E.languageData.of(()=>[{autocomplete:n}]),be(),me(),he(),ze(),Rn(),this.vimModeCompartment.of([]),se.of([...ke,...Fe,...Ve.map(e=>e.run===P?{...e,run:In}:e),...Te,Le]),C.contentAttributes.of({"aria-label":`Markdown editor`}),qn(e),this.themeCompartment.of(Kn(this.initialTheme)),this.syntaxThemeCompartment.of(this.initialTheme===`dark`?at:[]),this.lineWrappingCompartment.of(this.lineWrappingEnabled?C.lineWrapping:[]),Un,this.createUpdateListener()];return t?(r.push(E.readOnly.of(!0)),r.push(C.editable.of(!1)),r):(r.splice(13,0,Ce.highest(C.domEventHandlers({paste:e=>Tn(e,this.onImagePaste)}))),r)}clearEditorDom({preserveLoadingIndicator:e=!0}={}){if(!this.editorContainer)return;let t=e?this.editorContainer.querySelector(`#editorLoading`):null;Array.from(this.editorContainer.children).forEach(e=>{e!==t&&e.remove()})}teardownEditorView({clearContainer:e=!1}={}){this.editorView?.contentDOM?.removeEventListener(`beforeinput`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`keydown`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`paste`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`compositionstart`,this.handleLocalInputActivity),this.editorView?.scrollDOM?.removeEventListener(`scroll`,this.handleScroll),this.editorView?.destroy(),this.editorView=null,e&&this.editorContainer&&(this.editorContainer.innerHTML=``,delete this.editorContainer.dataset.editorMode)}mountEditor(e,{editorMode:t=`collaborative`,preserveScrollTop:n=0}={}){this.clearEditorDom({preserveLoadingIndicator:!0}),this.teardownEditorView(),this.editorView=new C({parent:this.editorContainer,state:e}),we(this.editorView,e.doc.length,50),this.editorContainer.dataset.editorMode=t,this.editorView.scrollDOM.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.editorView.contentDOM.addEventListener(`beforeinput`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`keydown`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`paste`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`compositionstart`,this.handleLocalInputActivity),this.updateCursorInfo(this.editorView.state),this.onSelectionChanged?.(this.editorView.state),this.emitViewportChange(),this.vimModeEnabled&&t!==`provisional`&&this.applyVimExtension(),n>0&&requestAnimationFrame(()=>{this.editorView?.scrollDOM&&(this.editorView.scrollDOM.scrollTop=n)})}initialize({awareness:e,filePath:t,undoManager:n,ytext:r}){let i=this.editorView?.scrollDOM?.scrollTop??0;this.undoManager=n;let a=E.create({doc:r.toString(),extensions:[...this.getBaseExtensions(t),se.of(yt),bt(r,e,{undoManager:n})]});this.mountEditor(a,{editorMode:`collaborative`,preserveScrollTop:i})}initializeProvisional({content:e=``,filePath:t}){let n=this.editorView?.scrollDOM?.scrollTop??0;this.undoManager=null;let r=E.create({doc:String(e??``),extensions:this.getBaseExtensions(t,{readOnly:!0})});this.mountEditor(r,{editorMode:`provisional`,preserveScrollTop:n})}destroy(){this.viewportFrame&&=(cancelAnimationFrame(this.viewportFrame),0),this.remoteUpdateFlashTimer&&=(clearTimeout(this.remoteUpdateFlashTimer),0),this.undoManager=null,this.teardownEditorView({clearContainer:!0})}getText(){return this.editorView?.state.doc.toString()??``}getDoc(){return this.editorView?.state.doc??null}getState(){return this.editorView?.state??null}getScrollContainer(){return this.editorView?.scrollDOM??null}applyTheme(e){this.editorView&&this.editorView.dispatch({effects:[this.themeCompartment.reconfigure(Kn(e)),this.syntaxThemeCompartment.reconfigure(e===`dark`?at:[])]})}isLineWrappingEnabled(){return this.lineWrappingEnabled}isVimModeEnabled(){return this.vimModeEnabled}async applyVimExtension(){if(!this.vimModeEnabled||!this.editorView||this.editorView.state.readOnly)return;let{vim:e}=await t(async()=>{let{vim:e}=await import(`./dist-DI6c02Da.js`);return{vim:e}},[],import.meta.url);this.vimModeEnabled&&this.editorView&&!this.editorView.state.readOnly&&this.editorView.dispatch({effects:this.vimModeCompartment.reconfigure(e({status:!0}))})}setVimMode(e){let t=!!e;return t===this.vimModeEnabled||(this.vimModeEnabled=t,!this.editorView||this.editorView.state.readOnly)?t:t?(this.applyVimExtension().then(()=>{this.editorView?.focus()}),t):(this.editorView.dispatch({effects:this.vimModeCompartment.reconfigure([])}),this.editorView.focus(),t)}setLineWrapping(e){return this.lineWrappingEnabled=!!e,this.editorView&&this.editorView.dispatch({effects:this.lineWrappingCompartment.reconfigure(this.lineWrappingEnabled?C.lineWrapping:[])}),this.lineWrappingEnabled}requestMeasure(){this.editorView?.requestMeasure()}async formatDocument(e){let t=this.editorView;if(!t||t.state.readOnly)return`unsupported`;let n=t.state.doc.toString(),r=await oe(e,n);if(r==null)return`unsupported`;if(this.editorView!==t||t.state.doc.toString()!==n)return`changed`;if(r===n)return`unchanged`;let i=O.create(t.state.selection.ranges.map(({anchor:e,head:t})=>O.range(Math.min(e,r.length),Math.min(t,r.length))));return t.dispatch({changes:{from:0,to:n.length,insert:r},selection:i,scrollIntoView:!0,userEvent:`input.format`}),t.focus(),`formatted`}runEditorCommand(e){if(!this.editorView)return!1;let t=String(e??``);if((t===`undo`||t===`redo`)&&this.undoManager){let e=this.undoManager[t]()!=null;return e&&this.editorView.focus(),e}let n=zn[t];if(typeof n!=`function`)return!1;let r=n(this.editorView);return r&&t!==`openSearch`&&this.editorView.focus(),r}flashRemoteRange({from:e=0,to:t=0}={},n=Mn){let r=this.editorView?.state;if(!r||r.doc.length===0)return!1;let i=Math.min(Math.max(Math.round(e),0),r.doc.length),a=Math.min(Math.max(Math.round(t),0),r.doc.length);if(a<=i){if(i<r.doc.length)a=i+1;else if(i>0)--i,a=i+1;else return!1}let o=Math.max(a-i,0)<=Nn&&Date.now()-this.lastLocalInputAt>Pn;return this.editorView.dispatch({effects:Vn.of({from:i,showCaret:o,to:a})}),this.remoteUpdateFlashTimer&&clearTimeout(this.remoteUpdateFlashTimer),this.remoteUpdateFlashTimer=window.setTimeout(()=>{this.remoteUpdateFlashTimer=0,this.editorView?.dispatch({effects:Hn.of(null)})},n),!0}getViewportState(e=.35){return{topLine:this.getTopVisibleLineNumber(e),viewportRatio:e}}getTopVisibleLineNumber(e=0){if(!this.editorView)return 1;let t=this.editorView.scrollDOM.getBoundingClientRect(),n=Math.max(t.height*e,8),r=this.editorView.lineBlockAtHeight(t.top+n-this.editorView.documentTop);return r?this.editorView.state.doc.lineAt(r.from).number:1}getCurrentSelectionLineRange(){let e=this.editorView?.state;if(!e)return null;let{doc:t,selection:n}=e,{from:r,to:i}=Jn(n),a=t.lineAt(r).number,o=Math.min(Math.max(i,r),t.length);return o>r&&t.lineAt(o).from===o&&--o,{endLine:t.lineAt(o).number,startLine:a}}getCurrentSelectionCommentAnchor(){let e=this.editorView?.state;if(!e)return null;let{doc:t,selection:n}=e,{from:r,to:i}=Jn(n);if(r===i){let e=t.lineAt(r);return{anchorKind:`line`,anchorQuote:ae(e.text),endIndex:e.to,endLine:e.number,startIndex:e.from,startLine:e.number}}let a=Math.min(Math.max(i,r),t.length);return a>r&&t.lineAt(a).from===a&&--a,{anchorKind:`text`,anchorQuote:ae(t.sliceString(r,i)),endIndex:i,endLine:t.lineAt(a).number,startIndex:r,startLine:t.lineAt(r).number}}normalizeLineRange({endLine:e,startLine:t}){let n=this.editorView?.state;if(!n)return{endLine:1,startLine:1};let r=n.doc.lines,i=Math.min(Math.max(Math.round(t??1),1),r);return{endLine:Math.min(Math.max(Math.round(e??i),i),r),startLine:i}}getLineInfoAt(e){let t=this.editorView?.state;if(!t)return null;let n=Math.min(Math.max(e,0),t.doc.length),r=t.doc.lineAt(n);return{line:r,lineNumber:r.number}}getAnchorClientRect(e){let t=this.editorView?.state,n=this.editorView;if(!t||!n||!e)return null;let r=e.anchorKind||e.kind||`line`,i=Math.min(Math.max(Math.round(e.startIndex??0),0),t.doc.length),a=Math.min(Math.max(Math.round(e.endIndex??i),i),t.doc.length);if(r===`text`&&a>i){let e=n.coordsAtPos(i),t=n.coordsAtPos(Math.max(a-1,i));if(e&&t)return{bottom:Math.max(e.bottom,t.bottom),height:Math.max(e.bottom,t.bottom)-Math.min(e.top,t.top),left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),width:Math.max(e.right,t.right)-Math.min(e.left,t.left)}}let o=t.doc.line(Math.min(Math.max(Math.round(e.startLine??1),1),t.doc.lines)),s=n.lineBlockAt(o.from),c=n.scrollDOM.getBoundingClientRect(),l=n.scrollDOM.scrollTop,u=n.contentDOM.getBoundingClientRect(),d=u.left,f=Math.max(u.right,c.right-8),p=c.top+s.top-l;return{bottom:p+s.height,height:s.height,left:d,right:f,top:p,width:Math.max(f-d,0)}}getSelectionChipClientRect(e){let t=this.editorView?.state,n=this.editorView;if(!t||!n||!e)return null;let r=Math.min(Math.max(Math.round(e.startIndex??0),0),t.doc.length),i=t.doc.lineAt(r),a=n.lineBlockAt(i.from),o=n.scrollDOM.getBoundingClientRect(),s=n.scrollDOM.scrollTop,c=n.contentDOM.getBoundingClientRect(),l=Math.max(c.right,o.right-8),u=o.top+a.top-s;return{bottom:u+a.height,height:a.height,left:c.left,right:l,top:u,width:Math.max(l-c.left,0)}}scrollToLine(e,t=0){let n=this.editorView?.state,r=this.editorView?.scrollDOM;if(!n||!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(e),1),n.doc.lines),a=n.doc.line(i),o=this.editorView.lineBlockAt(a.from),s=Math.max(r.scrollHeight-r.clientHeight,0),c=t>0?r.clientHeight*t:8,l=Math.min(Math.max(o.top-c,0),s);return r.scrollTo({top:l}),!0}revealSearchMatch({column:e=1,length:t=0,line:n=1}={}){let r=this.editorView?.state;if(!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(Number(n)||1),1),r.doc.lines),a=r.doc.line(i),o=Math.min(Math.max(Math.round(Number(e)||1)-1,0),a.length),s=a.from+o,c=Math.min(s+Math.max(Math.round(Number(t)||0),0),a.to);return this.editorView.dispatch({scrollIntoView:!0,selection:O.range(s,Math.max(c,s))}),this.editorView.focus(),this.scrollToLine(i,.2),!0}scrollToPosition(e,t=`center`){let n=this.editorView?.state,r=this.editorView?.scrollDOM;if(!n||!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(e),0),n.doc.length),a=this.editorView.lineBlockAt(i),o=Math.max(r.scrollHeight-r.clientHeight,0),s=a.top;return t===`center`&&(s=a.top-(r.clientHeight-a.height)/2),r.scrollTo({top:Math.min(Math.max(s,0),o)}),!0}applyMarkdownToolbarAction(e){if(!this.editorView)return!1;let{state:t}=this.editorView,n=t.doc.toString(),r=!1,i=t.changeByRange(t=>{let i=$t(n,t,e);return i?(r=!0,{changes:{from:i.from,insert:i.insert,to:i.to},range:O.range(i.anchor,i.head)}):{range:t}});return r?(this.editorView.dispatch(t.update(i,{scrollIntoView:!0,userEvent:`input`})),this.editorView.focus(),!0):!1}insertText(e){if(!this.editorView)return!1;let t=String(e??``),{state:n}=this.editorView,r=n.selection.main,i=r.from+t.length;return this.editorView.dispatch({changes:{from:r.from,insert:t,to:r.to},scrollIntoView:!0,selection:{anchor:i,head:i},userEvent:`input`}),this.editorView.focus(),!0}applyTextReplacements(e){if(!this.editorView)throw Error(`The editor is not available`);let{state:t}=this.editorView,n=St(t.doc.toString(),e);return this.editorView.dispatch({changes:n,userEvent:`input`}),n.length}replaceText(e){if(!this.editorView)return!1;let t=String(e??``),{state:n}=this.editorView;return this.editorView.dispatch({changes:{from:0,insert:t,to:n.doc.length},selection:{anchor:0,head:0},userEvent:`input`}),this.editorView.focus(),!0}toggleTaskListItem(e){let t=this.editorView?.state;if(!this.editorView||!t)return!1;let n=Number.parseInt(String(e??``),10);if(!Number.isFinite(n))return!1;let r=Math.min(Math.max(n,1),t.doc.lines),i=t.doc.line(r),a=Fn.exec(i.text);if(!a)return!1;let[,o,s]=a,c=i.from+o.length,l=s===` `?`x`:` `;return this.editorView.dispatch({changes:{from:c,insert:l,to:c+1},userEvent:`input`}),!0}updateCursorInfo(e){if(!this.lineInfoElement)return;let t=e.selection.main.head,n=e.doc.lineAt(t),r=t-n.from+1;this.lineInfoElement.textContent=`Ln ${n.number}, Col ${r}`}emitViewportChange(){this.onViewportChanged?.(this.getViewportState())}},Xn=class{constructor({editorContainer:e,lineWrappingEnabled:t=!0,vimModeEnabled:n=!1,initialTheme:r,lineInfoElement:i,onAwarenessChange:a,onConnectionChange:o,onCommentsChange:s,onContentChange:c,onImagePaste:l,onSelectionChange:u,preferredUserName:d,localUser:f,getFileList:p}){this.onAwarenessChange=a,this.onCommentsChange=s,this.onContentChange=c,this.onSelectionChange=u,this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient=new We({localUser:f,onAwarenessChange:e=>this.onAwarenessChange?.(e),onConnectionChange:o,onInitialSync:()=>this.emitContentChange(),preferredUserName:d,resolveAwarenessCursor:e=>this.resolveAwarenessCursor(e)}),this.viewAdapter=new Yn({editorContainer:e,getFileList:p||(()=>[]),initialTheme:r,lineInfoElement:i,lineWrappingEnabled:t,vimModeEnabled:n,onDocChanged:()=>{this.emitContentChange()},onImagePaste:l,onViewportChanged:e=>{this.collaborationClient.setLocalViewport(e)},onSelectionChanged:()=>{this.onSelectionChange?.(this.getCurrentSelectionCommentAnchor())}}),this.commentThreadStore=new ne({getDoc:()=>this.collaborationClient.ydoc,getEditorState:()=>this.viewAdapter.getState(),getLocalUser:()=>this.collaborationClient.getLocalUser(),onCommentsChange:e=>this.onCommentsChange?.(e)})}async initialize(e){this.activeFilePath=e,this.hasDeliveredContent=!1,this.lastDeliveredContent=null;let t=await this.collaborationClient.initialize(e);this.commentThreadStore.bind({commentThreads:t.commentThreads,ydoc:t.ydoc,ytext:t.ytext}),this.pendingCollaborativeBindings=t,this.collaborationClient.initialSyncComplete&&this.activateCollaborativeView(),this.onAwarenessChange?.(this.collaborationClient.collectUsers(e=>this.resolveAwarenessCursor(e)))}activateCollaborativeView(){return this.pendingCollaborativeBindings?(this.viewAdapter.initialize({awareness:this.pendingCollaborativeBindings.awareness,filePath:this.activeFilePath,undoManager:this.pendingCollaborativeBindings.undoManager,ytext:this.pendingCollaborativeBindings.ytext}),this.commentThreadStore.refreshComments(),this.pendingCollaborativeBindings=null,this.bootstrapContent=null,!0):!1}showBootstrapContent({content:e=``,filePath:t=this.activeFilePath}={}){return!this.collaborationClient.initialSyncComplete&&(this.activeFilePath=t,this.bootstrapContent=String(e??``),this.viewAdapter.initializeProvisional({content:this.bootstrapContent,filePath:this.activeFilePath}),this.commentThreadStore.refreshComments(),this.emitContentChange())}hasBootstrapContent(){return this.bootstrapContent!==null}emitContentChange({force:e=!1}={}){let t=this.getText();return!e&&this.hasDeliveredContent&&t===this.lastDeliveredContent?!1:(this.hasDeliveredContent=!0,this.lastDeliveredContent=t,this.onContentChange?.(),!0)}ensureInitialContent(){return this.emitContentChange()}applyTheme(e){this.viewAdapter.applyTheme(e)}getText(){return this.collaborationClient.getText()||this.viewAdapter.getText()}getScrollContainer(){return this.viewAdapter.getScrollContainer()}getTopVisibleLineNumber(e=0){return this.viewAdapter.getTopVisibleLineNumber(e)}getLocalUser(){return this.collaborationClient.getLocalUser()}get awareness(){return this.collaborationClient.awareness}get provider(){return this.collaborationClient.provider}get ydoc(){return this.collaborationClient.ydoc}get ytext(){return this.collaborationClient.ytext}async getAgentContext(){let e=this.viewAdapter.getState();if(!this.isInitialSyncComplete()||!e||e.doc.length>1e6)return null;let{from:t,to:n}=e.selection.main,r=n>t?n-1:n;return{localRevision:await te(e.doc.toString()),selection:{endLine:e.doc.lineAt(r).number,from:t,startLine:e.doc.lineAt(t).number,text:e.doc.sliceString(t,Math.min(n,t+2e3)),to:n,truncated:n-t>2e3}}}getCurrentSelectionLineRange(){return this.viewAdapter.getCurrentSelectionLineRange()}getCurrentSelectionCommentAnchor(){return this.viewAdapter.getCurrentSelectionCommentAnchor()}getCommentAnchorClientRect(e){return this.viewAdapter.getAnchorClientRect(e)}getSelectionChipClientRect(e){return this.viewAdapter.getSelectionChipClientRect(e)}getCommentThreads(){return this.commentThreadStore.getCommentThreads()}createCommentThread(e){return this.commentThreadStore.createCommentThread(e)}replyToCommentThread(e,t){return this.commentThreadStore.replyToCommentThread(e,t)}toggleCommentReaction(e,t,n){return this.commentThreadStore.toggleCommentReaction(e,t,n)}deleteCommentThread(e){return this.commentThreadStore.deleteCommentThread(e)}isLineWrappingEnabled(){return this.viewAdapter.isLineWrappingEnabled()}isVimModeEnabled(){return this.viewAdapter.isVimModeEnabled()}setVimMode(e){return this.viewAdapter.setVimMode(e)}setLineWrapping(e){return this.viewAdapter.setLineWrapping(e)}scrollToLine(e,t=0){return this.viewAdapter.scrollToLine(e,t)}revealSearchMatch(e){return this.viewAdapter.revealSearchMatch(e)}getUserCursor(e){return this.collaborationClient.getUserCursor(e,e=>this.resolveAwarenessCursor(e))}getUserViewport(e){return this.collaborationClient.getUserViewport(e)}scrollToPosition(e,t=`center`){return this.viewAdapter.scrollToPosition(e,t)}scrollToUserViewport(e){let t=this.getUserViewport(e);return t?this.scrollToLine(t.topLine,t.viewportRatio):!1}scrollToUserCursor(e,t=`center`){let n=this.getUserCursor(e);return n?this.scrollToPosition(n.cursorHead,t)||this.scrollToLine(n.cursorLine):!1}setUserName(e){return this.collaborationClient.setUserName(e)}requestMeasure(){this.viewAdapter.requestMeasure()}formatDocument(e){return this.viewAdapter.formatDocument(e)}runEditorCommand(e){return this.viewAdapter.runEditorCommand(e)}applyMarkdownToolbarAction(e){return this.viewAdapter.applyMarkdownToolbarAction(e)}insertText(e){return this.viewAdapter.insertText(e)}applyTextReplacements(e){if(!this.collaborationClient.initialSyncComplete)throw Error(`The collaborative document is not synchronized`);return this.viewAdapter.applyTextReplacements(e)}replaceText(e){return this.viewAdapter.replaceText(e)}toggleTaskListItem(e){return this.collaborationClient.initialSyncComplete?this.viewAdapter.toggleTaskListItem(e):!1}flashExternalUpdate(e){return this.viewAdapter.flashRemoteRange(e)}isInitialSyncComplete(){return this.collaborationClient.initialSyncComplete}waitForInitialSync(e=1500){return this.collaborationClient.waitForInitialSync(e)}destroy(){this.commentThreadStore.unbind(),this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient.destroy(),this.viewAdapter.destroy()}resolveAwarenessCursor(e){let t=this.collaborationClient.ydoc,n=this.collaborationClient.ytext,r=this.viewAdapter.getState();if(!e?.anchor||!e?.head||!t||!r||!n)return null;let i=f(e.anchor,t),a=f(e.head,t);if(!i||!a||i.type!==n||a.type!==n)return null;let o=r.doc.lineAt(a.index);return{cursorAnchor:i.index,cursorHead:a.index,cursorLine:o.number}}};export{Xn as EditorSession};
14
+ `)}function Zt(e,t){return Yt(e,t,Xt(e.slice(t.from,t.to)),2,kt[0].length)}function Qt(e,t){return Yt(e,t,`---`,4,0)}function $t(e,t,n){let r=String(e??``),i=jt(t,r.length),a;switch(n){case`bold`:a=X(r,i,`**`,q.bold);break;case`italic`:a=X(r,i,`_`,q.italic);break;case`strikethrough`:a=X(r,i,`~~`,q.strikethrough);break;case`code`:a=X(r,i,"`",q.code);break;case`link`:a=It(r,i);break;case`image`:a=Lt(r,i);break;case`video`:a=Rt(r,i);break;case`paragraph`:a=Kt(r,i);break;case`heading`:a=$(r,i,2);break;case`heading-1`:a=$(r,i,1);break;case`heading-2`:a=$(r,i,2);break;case`heading-3`:a=$(r,i,3);break;case`heading-4`:a=$(r,i,4);break;case`heading-5`:a=$(r,i,5);break;case`heading-6`:a=$(r,i,6);break;case`quote`:a=Ut(r,i);break;case`bullet-list`:a=Ht(r,i);break;case`numbered-list`:a=Gt(r,i);break;case`task-list`:a=Wt(r,i);break;case`code-block`:a=Jt(r,i);break;case`table`:a=Zt(r,i);break;case`horizontal-rule`:a=Qt(r,i);break;default:return null}return a?r.slice(a.from,a.to)===a.insert?null:a:null}var en=new Set([`block-beta`,`classdiagram`,`erdiagram`,`flowchart`,`gantt`,`gitgraph`,`graph`,`journey`,`mindmap`,`pie`,`quadrantchart`,`sankey-beta`,`sequencediagram`,`statediagram`,`statediagram-v2`,`timeline`,`xychart-beta`]),tn=new Set(`accdescr.acctitle.actor.alt.and.autonumber.break.callback.class.classdef.click.critical.dateformat.direction.else.end.exclude.include.interpolate.link.linkstyle.loop.note.opt.par.participant.rect.section.state.style.subgraph.theme.title`.split(`.`)),nn=new Set([`false`,`no`,`off`,`on`,`true`,`yes`]),rn=new Set([`bt`,`lr`,`rl`,`tb`,`td`]);function an(e){let t=e.match(/[A-Za-z_][\w.]*(?:-[A-Za-z0-9_][\w.]*)*/u,!1);return t?(e.match(/[A-Za-z_][\w.]*(?:-[A-Za-z0-9_][\w.]*)*/u),t[0]):``}function on(e){return e.match(`%%{`)?(e.skipTo(`}%%`)?e.match(`}%%`):e.skipToEnd(),!0):!1}var sn=T.define({languageData:{commentTokens:{line:`%%`}},token(e){if(e.eatSpace())return null;if(on(e))return`meta`;if(e.match(`%%`))return e.skipToEnd(),`comment`;if(e.match(/"(?:[^"\\]|\\.)*"?/u)||e.match(/'(?:[^'\\]|\\.)*'?/u))return`string`;if(e.match(/#[0-9a-f]{3,8}\b/iu)||e.match(/#[A-Za-z][\w-]*/u))return`atom`;if(e.match(/\b\d+(?:\.\d+)?%?\b/u))return`number`;if(e.match(/[ox*+<#]?[-=.\\/]+(?:left|right|up|down)?[-=.\\/]*[ox*+>#]?/iu))return`operator`;if(e.match(/[{}[\]():,;|]/u))return`punctuation`;let t=an(e);if(t){let e=t.toLowerCase();return en.has(e)?`meta`:tn.has(e)?`keyword`:nn.has(e)?`bool`:rn.has(e)?`atom`:/^[A-Z][A-Z0-9_]*$/u.test(t)?`typeName`:`variableName`}return e.next(),null}}),cn=new k(sn),ln=w.of({alias:[`mermaid`,`mmd`],extensions:[`mermaid`,`mmd`],name:`Mermaid`,support:cn}),un=30;function dn(e){return t=>{let n=t.state.doc.lineAt(t.pos),r=n.text.slice(0,t.pos-n.from),i=r.lastIndexOf(`[[`);if(i===-1)return null;let a=r.slice(i+2);if(a.includes(`]]`))return null;let o=a.trim().toLowerCase().replace(/\s+/gu,` `),s=n.from+i+2,c=e().map(e=>ce(e)),l=(o?c.map(e=>({entry:e,match:se(e,o)})).filter(({match:e})=>e).sort((e,t)=>t.match.score-e.match.score||e.entry.lowerPath.localeCompare(t.entry.lowerPath)):c.map(e=>({entry:e,match:null}))).slice(0,un).map(({entry:e})=>({label:e.filePath,displayLabel:e.filePath.split(`/`).pop(),detail:e.displayName.slice(0,-e.fileName.length-1)||void 0,apply:(e,t,n,r)=>{let i=r;e.state.sliceDoc(r,r+2)===`]]`&&(i=r+2),e.dispatch({changes:{from:n,to:i,insert:`${t.label}]]`},selection:{anchor:n+t.label.length+2}})},type:`text`}));return l.length===0?null:{from:s,options:l,filter:!1}}}var fn=new Set([`@startuml`,`@enduml`,`@startmindmap`,`@endmindmap`,`@startwbs`,`@endwbs`,`@startgantt`,`@endgantt`,`@startjson`,`@endjson`,`@startyaml`,`@endyaml`,`@startsalt`,`@endsalt`]),pn=new Set(`activate.actor.agent.allowmixing.alt.annotation.artifact.as.autonumber.boundary.box.break.caption.card.case.circle.class.cloud.collections.component.control.create.critical.database.deactivate.destroy.detach.else.elseif.end.endlegend.endif.endwhile.entity.enum.exception.file.folder.footer.fork.frame.group.header.hide.hnote.if.interface.json.kill.label.legend.loop.map.namespace.newpage.node.note.object.of.opt.order.over.package.page.par.participant.partition.person.port.protocol.queue.rectangle.ref.repeat.return.rnote.show.skinparam.split.stack.start.state.stop.storage.struct.switch.then.title.usecase.while`.split(`.`)),mn=new Set([`false`,`no`,`off`,`on`,`true`,`yes`]);function hn(e){let t=e.match(/[@!A-Za-z_][\w.-]*/u,!1);return t?(e.match(/[@!A-Za-z_][\w.-]*/u),t[0]):``}var gn=T.define({languageData:{commentTokens:{block:{close:`'/`,open:`/'`},line:`'`}},startState(){return{inBlockComment:!1}},token(e,t){if(t.inBlockComment)return e.skipTo(`'/`)?(e.match(`'/`),t.inBlockComment=!1):e.skipToEnd(),`comment`;if(e.eatSpace())return null;if(e.match(`/'`))return t.inBlockComment=!0,`comment`;let n=e.pos===0?` `:e.string.charAt(e.pos-1);if(e.peek()===`'`&&(e.sol()||/\s/u.test(n)))return e.skipToEnd(),`comment`;if(e.match(/"(?:[^"\\]|\\.)*"?/u))return`string`;if(e.match(/#[0-9a-f]{3,8}\b/iu)||e.match(/#[A-Za-z][\w-]*/u))return`atom`;if(e.match(/\b\d+(?:\.\d+)?\b/u))return`number`;if(e.match(/[<>{}[\]():,]/u))return`punctuation`;if(e.match(/[ox*+<#]?[-=.\\/]+(?:left|right|up|down)?[-=.\\/]*[ox*+>#]?/iu))return`operator`;let r=hn(e);if(r){let e=r.toLowerCase();return e.startsWith(`!`)||fn.has(e)?`meta`:pn.has(e)?`keyword`:mn.has(e)?`bool`:/^[A-Z][A-Z0-9_]*$/u.test(r)?`typeName`:`variableName`}return e.next(),null}}),_n=new k(gn),vn=w.of({alias:[`plantuml`,`puml`],extensions:[`plantuml`,`puml`],name:`PlantUML`,support:_n}),yn=new Set(`animation.autoLayout.component.configuration.container.custom.decisions.deployment.description.dynamic.element.filtered.group.include.image.model.person.perspectives.properties.relationship.relationships.styles.systemContext.systemLandscape.system.theme.views.workspace`.split(`.`));function bn(e){let t=e.match(/[A-Za-z_][\w.-]*/u,!1);return t?(e.match(/[A-Za-z_][\w.-]*/u),t[0]):``}var xn=T.define({languageData:{commentTokens:{line:`//`}},token(e){if(e.eatSpace())return null;if(e.match(`//`))return e.skipToEnd(),`comment`;if(e.match(/!\w+/u))return`meta`;if(e.match(/"(?:[^"\\]|\\.)*"?/u))return`string`;if(e.match(/\b\d+(?:\.\d+)?\b/u))return`number`;if(e.match(/[-=]?>|[{}[\]():,=]/u))return`operator`;let t=bn(e);return t?yn.has(t)?`keyword`:/^[A-Z][A-Z0-9_]*$/u.test(t)?`typeName`:`variableName`:(e.next(),null)}}),Sn=new k(xn),Cn=w.of({alias:[`structurizr`,`structurizr-dsl`],extensions:[`dsl`],name:`Structurizr DSL`,support:Sn});function wn(e){let t=Array.from(e?.clipboardData?.files??[]);for(let e of t)if(e?.type?.startsWith?.(`image/`))return e;let n=Array.from(e?.clipboardData?.items??[]);for(let e of n){if(e.kind!==`file`||!e.type?.startsWith?.(`image/`))continue;let t=e.getAsFile?.();if(t)return t}return null}function Tn(e,t){let n=wn(e);return n?typeof t==`function`?(console.debug(`[editor] Detected pasted image.`,{name:n.name??``,size:n.size??null,type:n.type??``}),e.preventDefault?.(),Promise.resolve(t(n)).catch(e=>{console.error(`[editor] Failed to process pasted image:`,e)}),!0):(console.warn(`[editor] Ignoring pasted image because no image paste handler is registered.`),!1):!1}var En=new Set(`bash.c.c++.cpp.css.diff.html.java.javascript.js.json.jsx.markdown.md.python.py.rust.sh.shell.sql.ts.tsx.typescript.xml.yaml.yml`.split(`.`));function Dn(e){return[e.name,...e.alias||[]].map(e=>String(e).toLowerCase()).some(e=>En.has(e))}var On=[...Ge.filter(Dn),ln,vn,Cn],kn=j.mark({class:`cm-matchingBracket cm-matchingBracket-paired`}),An=j.mark({class:`cm-nonmatchingBracket`}),jn=j.mark({class:`cm-remoteUpdateFlash`}),Mn=1350,Nn=160,Pn=900,Fn=/^(\s*(?:>\s*)*(?:[-+*]|\d+[.)])\s+\[)( |x|X)(\])(\s.*)?$/;function In(e){let t=e.scrollDOM.scrollTop,n=e.state.selection,r=P(e);return r&&requestAnimationFrame(()=>{e.dom.isConnected&&e.state.selection.eq(n)&&(e.scrollDOM.scrollTop=t)}),r}function Ln(e){return JSON.stringify([e.search,e.caseSensitive,e.regexp,e.wholeWord])}function Rn(){let e=``,t=!1,n=0;return C.updateListener.of(r=>{let i=M(r.state),a=N(r.state),o=Ln(a),s=i&&a.valid&&(!t||o!==e);t=i,e=o,s&&(n&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{if(n=0,!r.view.dom.isConnected)return;let e=N(r.view.state);if(!M(r.view.state)||!e.valid||Ln(e)!==o)return;let t=r.view.dom.querySelector(`.cm-search input[name="search"]`),i=t===r.view.root.activeElement&&t?{end:t.selectionEnd,start:t.selectionStart}:null;He(r.view),i&&t?.setSelectionRange&&t.setSelectionRange(i.start,i.end)}))})}var zn=Object.freeze({indentLess:Re,indentMore:Be,openSearch:In}),Bn=class extends he{toDOM(){let e=document.createElement(`span`);return e.className=`cm-remoteUpdateCaretWidget`,e.setAttribute(`aria-hidden`,`true`),e}ignoreEvent(){return!0}},Vn=me.define(),Hn=me.define(),Un=le.define({create:()=>j.none,update(e,t){let n=e.map(t.changes);return t.effects.forEach(e=>{if(e.is(Hn)){n=j.none;return}if(e.is(Vn)){let{from:t,showCaret:r,to:i}=e.value,a=[];i>t&&a.push(jn.range(t,i)),r&&a.push(j.widget({side:-1,widget:new Bn}).range(t)),n=a.length>0?j.set(a,!0):j.none}}),n},provide:e=>C.decorations.from(e)});function Wn(e,t){return t.selection.ranges.some(t=>t.empty&&e.to===t.head)}function Gn(e,t){let n=[];if(!e.matched)return n.push(An.range(e.start.from,e.start.to)),e.end&&n.push(An.range(e.end.from,e.end.to)),n;let r=Wn(e.start,t),i=e.end?Wn(e.end,t):!1;return r||n.push(kn.range(e.start.from,e.start.to)),e.end&&!i&&n.push(kn.range(e.end.from,e.end.to)),n}function Kn(e){let t=e===`dark`?`oklch(from var(--color-surface-offset) l c h / 0.55)`:`oklch(from var(--color-surface-offset) l c h / 0.75)`,n=e===`dark`?`oklch(from var(--color-primary) l c h / 0.28)`:`oklch(from var(--color-primary) l c h / 0.18)`,r=e===`dark`?`oklch(from var(--color-primary) l c h / 0.4)`:`oklch(from var(--color-primary) l c h / 0.26)`,i=e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`,a=e===`dark`?`oklch(from var(--color-primary) l c h / 0.2)`:`oklch(from var(--color-primary) l c h / 0.12)`,o=e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0.85)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.7)`,s=e===`dark`?`oklch(from var(--color-error) l c h / 0.12)`:`oklch(from var(--color-error) l c h / 0.1)`,c=e===`dark`?`oklch(from var(--color-error) calc(l + 0.08) c h / 0.8)`:`oklch(from var(--color-error) calc(l - 0.04) c h / 0.7)`;return C.theme({"&":{backgroundColor:`var(--color-bg)`,color:`var(--color-text)`},".cm-content":{caretColor:i,fontFamily:`var(--font-mono)`,padding:`16px 0`},".cm-cursor, .cm-dropCursor":{borderLeftColor:i,borderLeftWidth:`3px`,marginLeft:`-1px`},".cm-foldPlaceholder":{backgroundColor:`var(--color-surface-dynamic)`,border:`none`,color:`var(--color-text-muted)`},".cm-gutters":{backgroundColor:`var(--color-surface)`,borderRight:`1px solid var(--color-divider)`,color:`var(--color-text-muted)`,minWidth:`44px`},".cm-line":{padding:`0 16px`},".cm-activeLine":{backgroundColor:t,boxShadow:`inset 3px 0 0 ${n}`},"&:has(.cm-selectionBackground) .cm-activeLine":{backgroundColor:`transparent`,boxShadow:`none`},".cm-activeLineGutter":{backgroundColor:t,boxShadow:`inset 3px 0 0 ${n}`,color:`var(--color-text-muted)`},".cm-matchingBracket":{borderRadius:`2px`,color:`inherit`},".cm-matchingBracket.cm-matchingBracket-paired":{backgroundColor:a,outline:`1px solid ${o}`},".cm-nonmatchingBracket":{backgroundColor:s,outline:`1px solid ${c}`,borderRadius:`2px`},".cm-selectionMatch":{backgroundColor:`var(--color-primary-highlight)`},".cm-remoteUpdateFlash":{animation:`collabmd-remote-update-flash 1.35s ease-out`,backgroundColor:e===`dark`?`oklch(from var(--color-primary) l c h / 0.22)`:`oklch(from var(--color-primary) l c h / 0.16)`,borderRadius:`3px`,boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.05) c h / 0.26)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.2)`}`},".cm-remoteUpdateCaretWidget":{animation:`collabmd-remote-update-caret 1s ease-out`,backgroundColor:`transparent`,borderLeft:`2px solid ${e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`}`,borderRadius:`999px`,boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.06) c h / 0.22)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.16)`}`,display:`inline-block`,height:`1.2em`,marginLeft:`-1px`,marginRight:`-1px`,pointerEvents:`none`,transformOrigin:`center bottom`,verticalAlign:`text-bottom`,width:`0`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:r},"@keyframes collabmd-remote-update-flash":{"0%":{backgroundColor:e===`dark`?`oklch(from var(--color-primary) l c h / 0.34)`:`oklch(from var(--color-primary) l c h / 0.26)`},"100%":{backgroundColor:`oklch(from var(--color-primary) l c h / 0)`}},"@keyframes collabmd-remote-update-caret":{"0%":{boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0.34)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0.24)`}`,opacity:`0`,transform:`translateY(0.2em) scaleY(0.7)`},"18%":{opacity:`1`,transform:`translateY(0) scaleY(1)`},"72%":{opacity:`1`,transform:`translateY(0) scaleY(1)`},"100%":{boxShadow:`0 0 0 1px ${e===`dark`?`oklch(from var(--color-primary) calc(l + 0.08) c h / 0)`:`oklch(from var(--color-primary) calc(l - 0.04) c h / 0)`}`,opacity:`0`,transform:`translateY(-0.05em) scaleY(0.9)`}}},{dark:e===`dark`})}function qn(e){return y(e)?Ae():_(e)?cn:ee(e)?_n:v(e)?Sn:g(e)?Ie():Pe({base:Fe,codeLanguages:On})}function Jn(e){return{from:Math.min(...e.ranges.map(e=>Math.min(e.from,e.to))),to:Math.max(...e.ranges.map(e=>Math.max(e.from,e.to)))}}var Yn=class{constructor({editorContainer:e,getFileList:t,initialTheme:n,lineInfoElement:r,lineWrappingEnabled:i=!0,vimModeEnabled:a=!1,onDocChanged:o=null,onImagePaste:s=null,onSelectionChanged:c=null,onViewportChanged:l=null}){this.editorContainer=e,this.getFileList=t??(()=>[]),this.initialTheme=n,this.lineInfoElement=r,this.lineWrappingEnabled=i,this.vimModeEnabled=!!a,this.onDocChanged=o,this.onImagePaste=s,this.onSelectionChanged=c,this.onViewportChanged=l,this.editorView=null,this.undoManager=null,this.themeCompartment=new A,this.syntaxThemeCompartment=new A,this.lineWrappingCompartment=new A,this.vimModeCompartment=new A,this.viewportFrame=0,this.remoteUpdateFlashTimer=0,this.lastLocalInputAt=0,this.handleScroll=()=>{this.viewportFrame||=requestAnimationFrame(()=>{this.viewportFrame=0,this.emitViewportChange()})},this.handleLocalInputActivity=()=>{this.lastLocalInputAt=Date.now()}}createUpdateListener(){return C.updateListener.of(e=>{e.docChanged&&this.onDocChanged?.(),(e.selectionSet||e.docChanged)&&(this.updateCursorInfo(e.state),this.onSelectionChanged?.(e.state))})}getBaseExtensions(e,{readOnly:t=!1}={}){let n=dn(this.getFileList),r=[ye(),ve(),pe(),Oe(),ue(),E.allowMultipleSelections.of(!0),de(),fe(xe,{fallback:!0}),we({renderMatch:Gn}),Ne(),Me(),E.languageData.of(()=>[{autocomplete:n}]),Se(),ge(),_e(),Ve(),Rn(),this.vimModeCompartment.of([]),b.of([...je,...Le,...Ue.map(e=>e.run===P?{...e,run:In}:e),...De,ze]),C.contentAttributes.of({"aria-label":`Markdown editor`}),qn(e),this.themeCompartment.of(Kn(this.initialTheme)),this.syntaxThemeCompartment.of(this.initialTheme===`dark`?at:[]),this.lineWrappingCompartment.of(this.lineWrappingEnabled?C.lineWrapping:[]),Un,this.createUpdateListener()];return t?(r.push(E.readOnly.of(!0)),r.push(C.editable.of(!1)),r):(r.splice(13,0,Te.highest(C.domEventHandlers({paste:e=>Tn(e,this.onImagePaste)}))),r)}clearEditorDom({preserveLoadingIndicator:e=!0}={}){if(!this.editorContainer)return;let t=e?this.editorContainer.querySelector(`#editorLoading`):null;Array.from(this.editorContainer.children).forEach(e=>{e!==t&&e.remove()})}teardownEditorView({clearContainer:e=!1}={}){this.editorView?.contentDOM?.removeEventListener(`beforeinput`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`keydown`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`paste`,this.handleLocalInputActivity),this.editorView?.contentDOM?.removeEventListener(`compositionstart`,this.handleLocalInputActivity),this.editorView?.scrollDOM?.removeEventListener(`scroll`,this.handleScroll),this.editorView?.destroy(),this.editorView=null,e&&this.editorContainer&&(this.editorContainer.innerHTML=``,delete this.editorContainer.dataset.editorMode)}mountEditor(e,{editorMode:t=`collaborative`,preserveScrollTop:n=0}={}){this.clearEditorDom({preserveLoadingIndicator:!0}),this.teardownEditorView(),this.editorView=new C({parent:this.editorContainer,state:e}),Ee(this.editorView,e.doc.length,50),this.editorContainer.dataset.editorMode=t,this.editorView.scrollDOM.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.editorView.contentDOM.addEventListener(`beforeinput`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`keydown`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`paste`,this.handleLocalInputActivity),this.editorView.contentDOM.addEventListener(`compositionstart`,this.handleLocalInputActivity),this.updateCursorInfo(this.editorView.state),this.onSelectionChanged?.(this.editorView.state),this.emitViewportChange(),this.vimModeEnabled&&t!==`provisional`&&this.applyVimExtension(),n>0&&requestAnimationFrame(()=>{this.editorView?.scrollDOM&&(this.editorView.scrollDOM.scrollTop=n)})}initialize({awareness:e,filePath:t,undoManager:n,ytext:r}){let i=this.editorView?.scrollDOM?.scrollTop??0;this.undoManager=n;let a=E.create({doc:r.toString(),extensions:[...this.getBaseExtensions(t),b.of(yt),bt(r,e,{undoManager:n})]});this.mountEditor(a,{editorMode:`collaborative`,preserveScrollTop:i})}initializeProvisional({content:e=``,filePath:t}){let n=this.editorView?.scrollDOM?.scrollTop??0;this.undoManager=null;let r=E.create({doc:String(e??``),extensions:this.getBaseExtensions(t,{readOnly:!0})});this.mountEditor(r,{editorMode:`provisional`,preserveScrollTop:n})}destroy(){this.viewportFrame&&=(cancelAnimationFrame(this.viewportFrame),0),this.remoteUpdateFlashTimer&&=(clearTimeout(this.remoteUpdateFlashTimer),0),this.undoManager=null,this.teardownEditorView({clearContainer:!0})}getText(){return this.editorView?.state.doc.toString()??``}getDoc(){return this.editorView?.state.doc??null}getState(){return this.editorView?.state??null}getScrollContainer(){return this.editorView?.scrollDOM??null}applyTheme(e){this.editorView&&this.editorView.dispatch({effects:[this.themeCompartment.reconfigure(Kn(e)),this.syntaxThemeCompartment.reconfigure(e===`dark`?at:[])]})}isLineWrappingEnabled(){return this.lineWrappingEnabled}isVimModeEnabled(){return this.vimModeEnabled}async applyVimExtension(){if(!this.vimModeEnabled||!this.editorView||this.editorView.state.readOnly)return;let{vim:e}=await t(async()=>{let{vim:e}=await import(`./dist-BSAZ-Hek.js`);return{vim:e}},[],import.meta.url);this.vimModeEnabled&&this.editorView&&!this.editorView.state.readOnly&&this.editorView.dispatch({effects:this.vimModeCompartment.reconfigure(e({status:!0}))})}setVimMode(e){let t=!!e;return t===this.vimModeEnabled||(this.vimModeEnabled=t,!this.editorView||this.editorView.state.readOnly)?t:t?(this.applyVimExtension().then(()=>{this.editorView?.focus()}),t):(this.editorView.dispatch({effects:this.vimModeCompartment.reconfigure([])}),this.editorView.focus(),t)}setLineWrapping(e){return this.lineWrappingEnabled=!!e,this.editorView&&this.editorView.dispatch({effects:this.lineWrappingCompartment.reconfigure(this.lineWrappingEnabled?C.lineWrapping:[])}),this.lineWrappingEnabled}requestMeasure(){this.editorView?.requestMeasure()}async formatDocument(e){let t=this.editorView;if(!t||t.state.readOnly)return`unsupported`;let n=t.state.doc.toString(),r=await oe(e,n);if(r==null)return`unsupported`;if(this.editorView!==t||t.state.doc.toString()!==n)return`changed`;if(r===n)return`unchanged`;let i=O.create(t.state.selection.ranges.map(({anchor:e,head:t})=>O.range(Math.min(e,r.length),Math.min(t,r.length))));return t.dispatch({changes:{from:0,to:n.length,insert:r},selection:i,scrollIntoView:!0,userEvent:`input.format`}),t.focus(),`formatted`}runEditorCommand(e){if(!this.editorView)return!1;let t=String(e??``);if((t===`undo`||t===`redo`)&&this.undoManager){let e=this.undoManager[t]()!=null;return e&&this.editorView.focus(),e}let n=zn[t];if(typeof n!=`function`)return!1;let r=n(this.editorView);return r&&t!==`openSearch`&&this.editorView.focus(),r}flashRemoteRange({from:e=0,to:t=0}={},n=Mn){let r=this.editorView?.state;if(!r||r.doc.length===0)return!1;let i=Math.min(Math.max(Math.round(e),0),r.doc.length),a=Math.min(Math.max(Math.round(t),0),r.doc.length);if(a<=i){if(i<r.doc.length)a=i+1;else if(i>0)--i,a=i+1;else return!1}let o=Math.max(a-i,0)<=Nn&&Date.now()-this.lastLocalInputAt>Pn;return this.editorView.dispatch({effects:Vn.of({from:i,showCaret:o,to:a})}),this.remoteUpdateFlashTimer&&clearTimeout(this.remoteUpdateFlashTimer),this.remoteUpdateFlashTimer=window.setTimeout(()=>{this.remoteUpdateFlashTimer=0,this.editorView?.dispatch({effects:Hn.of(null)})},n),!0}getViewportState(e=.35){return{topLine:this.getTopVisibleLineNumber(e),viewportRatio:e}}getTopVisibleLineNumber(e=0){if(!this.editorView)return 1;let t=this.editorView.scrollDOM.getBoundingClientRect(),n=Math.max(t.height*e,8),r=this.editorView.lineBlockAtHeight(t.top+n-this.editorView.documentTop);return r?this.editorView.state.doc.lineAt(r.from).number:1}getCurrentSelectionLineRange(){let e=this.editorView?.state;if(!e)return null;let{doc:t,selection:n}=e,{from:r,to:i}=Jn(n),a=t.lineAt(r).number,o=Math.min(Math.max(i,r),t.length);return o>r&&t.lineAt(o).from===o&&--o,{endLine:t.lineAt(o).number,startLine:a}}getCurrentSelectionCommentAnchor(){let e=this.editorView?.state;if(!e)return null;let{doc:t,selection:n}=e,{from:r,to:i}=Jn(n);if(r===i){let e=t.lineAt(r);return{anchorKind:`line`,anchorQuote:ae(e.text),endIndex:e.to,endLine:e.number,startIndex:e.from,startLine:e.number}}let a=Math.min(Math.max(i,r),t.length);return a>r&&t.lineAt(a).from===a&&--a,{anchorKind:`text`,anchorQuote:ae(t.sliceString(r,i)),endIndex:i,endLine:t.lineAt(a).number,startIndex:r,startLine:t.lineAt(r).number}}normalizeLineRange({endLine:e,startLine:t}){let n=this.editorView?.state;if(!n)return{endLine:1,startLine:1};let r=n.doc.lines,i=Math.min(Math.max(Math.round(t??1),1),r);return{endLine:Math.min(Math.max(Math.round(e??i),i),r),startLine:i}}getLineInfoAt(e){let t=this.editorView?.state;if(!t)return null;let n=Math.min(Math.max(e,0),t.doc.length),r=t.doc.lineAt(n);return{line:r,lineNumber:r.number}}getAnchorClientRect(e){let t=this.editorView?.state,n=this.editorView;if(!t||!n||!e)return null;let r=e.anchorKind||e.kind||`line`,i=Math.min(Math.max(Math.round(e.startIndex??0),0),t.doc.length),a=Math.min(Math.max(Math.round(e.endIndex??i),i),t.doc.length);if(r===`text`&&a>i){let e=n.coordsAtPos(i),t=n.coordsAtPos(Math.max(a-1,i));if(e&&t)return{bottom:Math.max(e.bottom,t.bottom),height:Math.max(e.bottom,t.bottom)-Math.min(e.top,t.top),left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),width:Math.max(e.right,t.right)-Math.min(e.left,t.left)}}let o=t.doc.line(Math.min(Math.max(Math.round(e.startLine??1),1),t.doc.lines)),s=n.lineBlockAt(o.from),c=n.scrollDOM.getBoundingClientRect(),l=n.scrollDOM.scrollTop,u=n.contentDOM.getBoundingClientRect(),d=u.left,f=Math.max(u.right,c.right-8),p=c.top+s.top-l;return{bottom:p+s.height,height:s.height,left:d,right:f,top:p,width:Math.max(f-d,0)}}getSelectionChipClientRect(e){let t=this.editorView?.state,n=this.editorView;if(!t||!n||!e)return null;let r=Math.min(Math.max(Math.round(e.startIndex??0),0),t.doc.length),i=t.doc.lineAt(r),a=n.lineBlockAt(i.from),o=n.scrollDOM.getBoundingClientRect(),s=n.scrollDOM.scrollTop,c=n.contentDOM.getBoundingClientRect(),l=Math.max(c.right,o.right-8),u=o.top+a.top-s;return{bottom:u+a.height,height:a.height,left:c.left,right:l,top:u,width:Math.max(l-c.left,0)}}scrollToLine(e,t=0){let n=this.editorView?.state,r=this.editorView?.scrollDOM;if(!n||!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(e),1),n.doc.lines),a=n.doc.line(i),o=this.editorView.lineBlockAt(a.from),s=Math.max(r.scrollHeight-r.clientHeight,0),c=t>0?r.clientHeight*t:8,l=Math.min(Math.max(o.top-c,0),s);return r.scrollTo({top:l}),!0}revealSearchMatch({column:e=1,length:t=0,line:n=1}={}){let r=this.editorView?.state;if(!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(Number(n)||1),1),r.doc.lines),a=r.doc.line(i),o=Math.min(Math.max(Math.round(Number(e)||1)-1,0),a.length),s=a.from+o,c=Math.min(s+Math.max(Math.round(Number(t)||0),0),a.to);return this.editorView.dispatch({scrollIntoView:!0,selection:O.range(s,Math.max(c,s))}),this.editorView.focus(),this.scrollToLine(i,.2),!0}scrollToPosition(e,t=`center`){let n=this.editorView?.state,r=this.editorView?.scrollDOM;if(!n||!r||!this.editorView)return!1;let i=Math.min(Math.max(Math.round(e),0),n.doc.length),a=this.editorView.lineBlockAt(i),o=Math.max(r.scrollHeight-r.clientHeight,0),s=a.top;return t===`center`&&(s=a.top-(r.clientHeight-a.height)/2),r.scrollTo({top:Math.min(Math.max(s,0),o)}),!0}applyMarkdownToolbarAction(e){if(!this.editorView)return!1;let{state:t}=this.editorView,n=t.doc.toString(),r=!1,i=t.changeByRange(t=>{let i=$t(n,t,e);return i?(r=!0,{changes:{from:i.from,insert:i.insert,to:i.to},range:O.range(i.anchor,i.head)}):{range:t}});return r?(this.editorView.dispatch(t.update(i,{scrollIntoView:!0,userEvent:`input`})),this.editorView.focus(),!0):!1}insertText(e){if(!this.editorView)return!1;let t=String(e??``),{state:n}=this.editorView,r=n.selection.main,i=r.from+t.length;return this.editorView.dispatch({changes:{from:r.from,insert:t,to:r.to},scrollIntoView:!0,selection:{anchor:i,head:i},userEvent:`input`}),this.editorView.focus(),!0}applyTextReplacements(e){if(!this.editorView)throw Error(`The editor is not available`);let{state:t}=this.editorView,n=St(t.doc.toString(),e);return this.editorView.dispatch({changes:n,userEvent:`input`}),n.length}replaceText(e){if(!this.editorView)return!1;let t=String(e??``),{state:n}=this.editorView;return this.editorView.dispatch({changes:{from:0,insert:t,to:n.doc.length},selection:{anchor:0,head:0},userEvent:`input`}),this.editorView.focus(),!0}toggleTaskListItem(e){let t=this.editorView?.state;if(!this.editorView||!t)return!1;let n=Number.parseInt(String(e??``),10);if(!Number.isFinite(n))return!1;let r=Math.min(Math.max(n,1),t.doc.lines),i=t.doc.line(r),a=Fn.exec(i.text);if(!a)return!1;let[,o,s]=a,c=i.from+o.length,l=s===` `?`x`:` `;return this.editorView.dispatch({changes:{from:c,insert:l,to:c+1},userEvent:`input`}),!0}updateCursorInfo(e){if(!this.lineInfoElement)return;let t=e.selection.main.head,n=e.doc.lineAt(t),r=t-n.from+1;this.lineInfoElement.textContent=`Ln ${n.number}, Col ${r}`}emitViewportChange(){this.onViewportChanged?.(this.getViewportState())}},Xn=class{constructor({editorContainer:e,lineWrappingEnabled:t=!0,vimModeEnabled:n=!1,initialTheme:r,lineInfoElement:i,onAwarenessChange:a,onConnectionChange:o,onCommentsChange:s,onContentChange:c,onImagePaste:l,onSelectionChange:u,preferredUserName:d,localUser:f,getFileList:p}){this.onAwarenessChange=a,this.onCommentsChange=s,this.onContentChange=c,this.onSelectionChange=u,this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient=new We({localUser:f,onAwarenessChange:e=>this.onAwarenessChange?.(e),onConnectionChange:o,onInitialSync:()=>this.emitContentChange(),preferredUserName:d,resolveAwarenessCursor:e=>this.resolveAwarenessCursor(e)}),this.viewAdapter=new Yn({editorContainer:e,getFileList:p||(()=>[]),initialTheme:r,lineInfoElement:i,lineWrappingEnabled:t,vimModeEnabled:n,onDocChanged:()=>{this.emitContentChange()},onImagePaste:l,onViewportChanged:e=>{this.collaborationClient.setLocalViewport(e)},onSelectionChanged:()=>{this.onSelectionChange?.(this.getCurrentSelectionCommentAnchor())}}),this.commentThreadStore=new ne({getDoc:()=>this.collaborationClient.ydoc,getEditorState:()=>this.viewAdapter.getState(),getLocalUser:()=>this.collaborationClient.getLocalUser(),onCommentsChange:e=>this.onCommentsChange?.(e)})}async initialize(e){this.activeFilePath=e,this.hasDeliveredContent=!1,this.lastDeliveredContent=null;let t=await this.collaborationClient.initialize(e);this.commentThreadStore.bind({commentThreads:t.commentThreads,ydoc:t.ydoc,ytext:t.ytext}),this.pendingCollaborativeBindings=t,this.collaborationClient.initialSyncComplete&&this.activateCollaborativeView(),this.onAwarenessChange?.(this.collaborationClient.collectUsers(e=>this.resolveAwarenessCursor(e)))}activateCollaborativeView(){return this.pendingCollaborativeBindings?(this.viewAdapter.initialize({awareness:this.pendingCollaborativeBindings.awareness,filePath:this.activeFilePath,undoManager:this.pendingCollaborativeBindings.undoManager,ytext:this.pendingCollaborativeBindings.ytext}),this.commentThreadStore.refreshComments(),this.pendingCollaborativeBindings=null,this.bootstrapContent=null,!0):!1}showBootstrapContent({content:e=``,filePath:t=this.activeFilePath}={}){return!this.collaborationClient.initialSyncComplete&&(this.activeFilePath=t,this.bootstrapContent=String(e??``),this.viewAdapter.initializeProvisional({content:this.bootstrapContent,filePath:this.activeFilePath}),this.commentThreadStore.refreshComments(),this.emitContentChange())}hasBootstrapContent(){return this.bootstrapContent!==null}emitContentChange({force:e=!1}={}){let t=this.getText();return!e&&this.hasDeliveredContent&&t===this.lastDeliveredContent?!1:(this.hasDeliveredContent=!0,this.lastDeliveredContent=t,this.onContentChange?.(),!0)}ensureInitialContent(){return this.emitContentChange()}applyTheme(e){this.viewAdapter.applyTheme(e)}getText(){return this.collaborationClient.getText()||this.viewAdapter.getText()}getScrollContainer(){return this.viewAdapter.getScrollContainer()}getTopVisibleLineNumber(e=0){return this.viewAdapter.getTopVisibleLineNumber(e)}getLocalUser(){return this.collaborationClient.getLocalUser()}get awareness(){return this.collaborationClient.awareness}get provider(){return this.collaborationClient.provider}get ydoc(){return this.collaborationClient.ydoc}get ytext(){return this.collaborationClient.ytext}async getAgentContext(){let e=this.viewAdapter.getState();if(!this.isInitialSyncComplete()||!e||e.doc.length>1e6)return null;let{from:t,to:n}=e.selection.main,r=n>t?n-1:n;return{localRevision:await te(e.doc.toString()),selection:{endLine:e.doc.lineAt(r).number,from:t,startLine:e.doc.lineAt(t).number,text:e.doc.sliceString(t,Math.min(n,t+2e3)),to:n,truncated:n-t>2e3}}}getCurrentSelectionLineRange(){return this.viewAdapter.getCurrentSelectionLineRange()}getCurrentSelectionCommentAnchor(){return this.viewAdapter.getCurrentSelectionCommentAnchor()}getCommentAnchorClientRect(e){return this.viewAdapter.getAnchorClientRect(e)}getSelectionChipClientRect(e){return this.viewAdapter.getSelectionChipClientRect(e)}getCommentThreads(){return this.commentThreadStore.getCommentThreads()}createCommentThread(e){return this.commentThreadStore.createCommentThread(e)}replyToCommentThread(e,t){return this.commentThreadStore.replyToCommentThread(e,t)}toggleCommentReaction(e,t,n){return this.commentThreadStore.toggleCommentReaction(e,t,n)}deleteCommentThread(e){return this.commentThreadStore.deleteCommentThread(e)}isLineWrappingEnabled(){return this.viewAdapter.isLineWrappingEnabled()}isVimModeEnabled(){return this.viewAdapter.isVimModeEnabled()}setVimMode(e){return this.viewAdapter.setVimMode(e)}setLineWrapping(e){return this.viewAdapter.setLineWrapping(e)}scrollToLine(e,t=0){return this.viewAdapter.scrollToLine(e,t)}revealSearchMatch(e){return this.viewAdapter.revealSearchMatch(e)}getUserCursor(e){return this.collaborationClient.getUserCursor(e,e=>this.resolveAwarenessCursor(e))}getUserViewport(e){return this.collaborationClient.getUserViewport(e)}scrollToPosition(e,t=`center`){return this.viewAdapter.scrollToPosition(e,t)}scrollToUserViewport(e){let t=this.getUserViewport(e);return t?this.scrollToLine(t.topLine,t.viewportRatio):!1}scrollToUserCursor(e,t=`center`){let n=this.getUserCursor(e);return n?this.scrollToPosition(n.cursorHead,t)||this.scrollToLine(n.cursorLine):!1}setUserName(e){return this.collaborationClient.setUserName(e)}requestMeasure(){this.viewAdapter.requestMeasure()}formatDocument(e){return this.viewAdapter.formatDocument(e)}runEditorCommand(e){return this.viewAdapter.runEditorCommand(e)}applyMarkdownToolbarAction(e){return this.viewAdapter.applyMarkdownToolbarAction(e)}insertText(e){return this.viewAdapter.insertText(e)}applyTextReplacements(e){if(!this.collaborationClient.initialSyncComplete)throw Error(`The collaborative document is not synchronized`);return this.viewAdapter.applyTextReplacements(e)}replaceText(e){return this.viewAdapter.replaceText(e)}toggleTaskListItem(e){return this.collaborationClient.initialSyncComplete?this.viewAdapter.toggleTaskListItem(e):!1}flashExternalUpdate(e){return this.viewAdapter.flashRemoteRange(e)}isInitialSyncComplete(){return this.collaborationClient.initialSyncComplete}waitForInitialSync(e=1500){return this.collaborationClient.waitForInitialSync(e)}destroy(){this.commentThreadStore.unbind(),this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient.destroy(),this.viewAdapter.destroy()}resolveAwarenessCursor(e){let t=this.collaborationClient.ydoc,n=this.collaborationClient.ytext,r=this.viewAdapter.getState();if(!e?.anchor||!e?.head||!t||!r||!n)return null;let i=f(e.anchor,t),a=f(e.head,t);if(!i||!a||i.type!==n||a.type!==n)return null;let o=r.doc.lineAt(a.index);return{cursorAnchor:i.index,cursorHead:a.index,cursorLine:o.number}}};export{Xn as EditorSession};
@@ -1 +1 @@
1
- import{At as e,C as t,Dt as n,Et as r,Ft as i,G as a,H as o,I as s,K as c,L as l,M as u,N as d,Nt as f,O as p,P as m,Pt as h,Q as g,R as _,Rt as v,S as y,T as b,V as x,W as S,X as C,Y as w,Z as T,a as E,bt as D,d as O,dt as k,et as A,f as j,g as M,h as N,ht as P,i as F,j as I,kt as L,m as R,mt as z,n as B,nt as V,o as H,pt as U,r as W,rt as G,s as K,st as q,t as J,tt as Y,u as X,v as Z,vt as Q,w as $,wt as ee,x as te,xt as ne,yt as re,z as ie,zt as ae}from"./embedpdf-DA4bA119-DsoNiPlQ.js";export{M as AnnotationPlugin,s as AppearanceMode,G as AttachmentPlugin,U as BookmarkPlugin,n as CapturePlugin,J as CommandsPlugin,H as DocumentManagerPlugin,ee as EmbedPdfContainer,S as ExportPlugin,d as FormPlugin,v as FullscreenPlugin,e as HistoryPlugin,w as I18nPlugin,P as InteractionManagerPlugin,ne as LockModeType,A as PanPlugin,Y as PdfAnnotationBorderStyle,g as PdfAnnotationFlags,X as PdfAnnotationIcon,r as PdfAnnotationLineEnding,R as PdfAnnotationName,z as PdfAnnotationObjectStatus,te as PdfAnnotationReplyType,E as PdfAnnotationState,a as PdfAnnotationStateModel,W as PdfAnnotationSubtype,ae as PdfBlendMode,t as PdfStampFit,F as PrintPlugin,h as RedactionMode,O as RedactionPlugin,f as RenderPlugin,m as RotatePlugin,o as Rotation,V as ScrollPlugin,b as ScrollStrategy,T as SearchPlugin,B as SelectionPlugin,Z as SignatureMode,l as SignaturePlugin,j as SpreadMode,C as SpreadPlugin,I as ThumbnailPlugin,q as TilingPlugin,Q as UIPlugin,i as ViewportPlugin,L as ZoomMode,k as ZoomPlugin,$ as createTheme,u as darkTheme,c as default,x as deserializeEntries,re as flagsToNames,ie as ignore,N as lightTheme,D as namesToFlags,p as registerIcon,K as registerIcons,y as serializeEntries,_ as version};
1
+ import{At as e,C as t,Dt as n,Et as r,Ft as i,G as a,H as o,I as s,K as c,L as l,M as u,N as d,Nt as f,O as p,P as m,Pt as h,Q as g,R as _,Rt as v,S as y,T as b,V as x,W as S,X as C,Y as w,Z as T,a as E,bt as D,d as O,dt as k,et as A,f as j,g as M,h as N,ht as P,i as F,j as I,kt as L,m as R,mt as z,n as B,nt as V,o as H,pt as U,r as W,rt as G,s as K,st as q,t as J,tt as Y,u as X,v as Z,vt as Q,w as $,wt as ee,x as te,xt as ne,yt as re,z as ie,zt as ae}from"./embedpdf-cl9qiF45-itpgqvGY.js";export{M as AnnotationPlugin,s as AppearanceMode,G as AttachmentPlugin,U as BookmarkPlugin,n as CapturePlugin,J as CommandsPlugin,H as DocumentManagerPlugin,ee as EmbedPdfContainer,S as ExportPlugin,d as FormPlugin,v as FullscreenPlugin,e as HistoryPlugin,w as I18nPlugin,P as InteractionManagerPlugin,ne as LockModeType,A as PanPlugin,Y as PdfAnnotationBorderStyle,g as PdfAnnotationFlags,X as PdfAnnotationIcon,r as PdfAnnotationLineEnding,R as PdfAnnotationName,z as PdfAnnotationObjectStatus,te as PdfAnnotationReplyType,E as PdfAnnotationState,a as PdfAnnotationStateModel,W as PdfAnnotationSubtype,ae as PdfBlendMode,t as PdfStampFit,F as PrintPlugin,h as RedactionMode,O as RedactionPlugin,f as RenderPlugin,m as RotatePlugin,o as Rotation,V as ScrollPlugin,b as ScrollStrategy,T as SearchPlugin,B as SelectionPlugin,Z as SignatureMode,l as SignaturePlugin,j as SpreadMode,C as SpreadPlugin,I as ThumbnailPlugin,q as TilingPlugin,Q as UIPlugin,i as ViewportPlugin,L as ZoomMode,k as ZoomPlugin,$ as createTheme,u as darkTheme,c as default,x as deserializeEntries,re as flagsToNames,ie as ignore,N as lightTheme,D as namesToFlags,p as registerIcon,K as registerIcons,y as serializeEntries,_ as version};