collabmd 0.1.31 → 0.1.32

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 (93) hide show
  1. package/dist/client/assets/{drawio-editor-B4sHHwWJ.js → drawio-editor-Br4qyh3r.js} +1 -1
  2. package/dist/client/assets/drawioEditor-ClmnTx5J.js +2 -0
  3. package/dist/client/assets/{editor-session-BKHEYkbY.js → editor-session-Cf-iV5-3.js} +2 -2
  4. package/dist/client/assets/embedded-editor-base-CgEkjNYn.css +1 -0
  5. package/dist/client/assets/{excalidraw-editor-CHbeNZu6.js → excalidraw-editor-CXAxVhlw.js} +2 -2
  6. package/dist/client/assets/{excalidrawEditor-BhaTX2Ko.js → excalidrawEditor-DoH_kMdu.js} +2 -2
  7. package/dist/client/assets/exportDocument-9wTrBZNS.css +1 -0
  8. package/dist/client/assets/{index-kPgEYvEX.js → index-C8QZYHvV.js} +2 -2
  9. package/dist/client/assets/index-CxSbUTs2.css +1 -0
  10. package/dist/client/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  11. package/dist/client/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  12. package/dist/client/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  13. package/dist/client/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  14. package/dist/client/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  15. package/dist/client/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  16. package/dist/client/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  17. package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  18. package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
  19. package/dist/client/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
  20. package/dist/client/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  21. package/dist/client/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  22. package/dist/client/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  23. package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  24. package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
  25. package/dist/client/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
  26. package/dist/client/assets/main-BjHHMlv0.js +1249 -0
  27. package/dist/client/assets/vault-api-client-Bf9tB_GW.js +1 -0
  28. package/dist/client/assets/vault-api-client-D7Ck0CvR.css +1 -0
  29. package/dist/client/drawio-editor.html +1 -1
  30. package/dist/client/excalidraw-editor.html +1 -1
  31. package/dist/client/export-document.html +2 -2
  32. package/dist/client/index.html +2 -2
  33. package/package.json +4 -1
  34. package/src/client/app/main-entry.js +2 -0
  35. package/src/client/application/app-shell/git-feature.js +28 -36
  36. package/src/client/application/app-shell/presence-feature.js +3 -1
  37. package/src/client/application/diagram-preview-hydrator.js +24 -15
  38. package/src/client/application/mermaid-preview-hydrator.js +121 -4
  39. package/src/client/application/plantuml-preview-hydrator.js +6 -16
  40. package/src/client/application/preview-renderer.js +11 -2
  41. package/src/client/bootstrap/collabmd-app-shell.js +176 -50
  42. package/src/client/domain/excalidraw-document-switch.js +3 -0
  43. package/src/client/excalidraw-editor.js +187 -84
  44. package/src/client/infrastructure/auth-client.js +4 -4
  45. package/src/client/infrastructure/backlinks-api-client.js +18 -0
  46. package/src/client/infrastructure/comment-thread-store.js +4 -0
  47. package/src/client/infrastructure/editor-session.js +2 -0
  48. package/src/client/infrastructure/git-api-client.js +134 -0
  49. package/src/client/infrastructure/plantuml-api-client.js +21 -0
  50. package/src/client/infrastructure/vault-api-client.js +67 -0
  51. package/src/client/presentation/backlinks-panel.js +6 -9
  52. package/src/client/presentation/bases-preview-controller.js +26 -7
  53. package/src/client/presentation/excalidraw-embed-controller.js +251 -15
  54. package/src/client/presentation/excalidraw-embed-reconciler.js +0 -1
  55. package/src/client/presentation/file-action-controller.js +97 -0
  56. package/src/client/presentation/file-explorer-controller.js +2 -0
  57. package/src/client/presentation/file-explorer-view.js +368 -0
  58. package/src/client/presentation/file-history-view-controller.js +41 -40
  59. package/src/client/presentation/git-diff-view-controller.js +70 -53
  60. package/src/client/presentation/git-panel-controller.js +12 -30
  61. package/src/client/styles/export-document.css +45 -2
  62. package/src/client/styles/features/auth-gate.css +13 -24
  63. package/src/client/styles/features/comment-card.css +6 -0
  64. package/src/client/styles/features/comments-drawer.css +38 -18
  65. package/src/client/styles/features/diagram-preview.css +33 -0
  66. package/src/client/styles/features/embedded-preview.css +37 -11
  67. package/src/client/styles/features/preview-markdown.css +103 -28
  68. package/src/client/styles/foundation/themes.css +4 -0
  69. package/src/client/styles/foundation/tokens.css +4 -3
  70. package/src/client/styles/layout/sidebar.css +72 -0
  71. package/src/server/auth/auth-common.js +224 -0
  72. package/src/server/auth/auth-constants.js +30 -0
  73. package/src/server/auth/auth-strategies.js +320 -0
  74. package/src/server/auth/create-auth-service.js +24 -545
  75. package/src/server/domain/bases/base-definition.js +255 -0
  76. package/src/server/domain/bases/base-expression-runtime.js +1159 -0
  77. package/src/server/domain/bases/base-index-snapshot-store.js +418 -0
  78. package/src/server/domain/bases/base-query-results.js +205 -0
  79. package/src/server/domain/bases/base-query-service.js +68 -1965
  80. package/src/server/domain/collaboration/collaboration-room.js +36 -1
  81. package/src/server/domain/collaboration/room-client-state-store.js +1 -0
  82. package/src/server/domain/collaboration/room-persistence-controller.js +1 -1
  83. package/src/server/infrastructure/http/create-vault-api-query-handler.js +109 -1
  84. package/src/server/infrastructure/http/http-response.js +56 -0
  85. package/src/server/infrastructure/persistence/vault-file-store.js +110 -0
  86. package/dist/client/assets/drawioEditor-DGpo2hcx.js +0 -2
  87. package/dist/client/assets/embedded-editor-base-DgmRcsR8.css +0 -1
  88. package/dist/client/assets/exportDocument-DmV7Gngb.css +0 -1
  89. package/dist/client/assets/index-D69HOZHr.css +0 -1
  90. package/dist/client/assets/main-DSxNTtD-.js +0 -1243
  91. package/dist/client/assets/vault-api-client-BzHQseMN.js +0 -1
  92. package/dist/client/assets/vault-api-client-De7kMvrE.css +0 -1
  93. /package/dist/client/assets/{exportDocument-CtZKWE2c.js → exportDocument-Bia2hI25.js} +0 -0
@@ -1,4 +1,4 @@
1
- /* empty css */import{n as e,t}from"./vault-api-client-BzHQseMN.js";import{f as n,n as r}from"./runtime-config-CqhchMC4.js";import{n as i,r as a,t as o}from"./yjs-provider-reset-guard-CtERLBID.js";import{n as ee,t as te}from"./drawio-room-DEivFyNV.js";var ne=4e3;function s(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}var c=class{constructor({clearIntervalFn:e=e=>window.clearInterval(e),filePath:t=``,heartbeatIntervalMs:r=te,now:o=()=>Date.now(),onStateChange:s=()=>{},resolveWsBaseUrlFn:c=n,roomName:l=``,setIntervalFn:u=(e,t)=>window.setInterval(e,t),setTimeoutFn:d=(e,t)=>window.setTimeout(e,t),staleLeaseMs:f=ee,syncTimeoutMs:p=ne,websocketProviderFactory:m=(e,t,n,r)=>new i(e,t,n,r),ydocFactory:h=()=>new a}){this.clearIntervalFn=e,this.filePath=t,this.heartbeatIntervalMs=r,this.now=o,this.onStateChange=s,this.resolveWsBaseUrlFn=c,this.roomName=l,this.setIntervalFn=u,this.setTimeoutFn=d,this.staleLeaseMs=f,this.syncTimeoutMs=p,this.websocketProviderFactory=m,this.ydocFactory=h,this.ydoc=null,this.provider=null,this.awareness=null,this.leaseMap=null,this.statusMap=null,this.localUser=null,this.localMode=`viewer`,this.heartbeatTimer=null,this.currentState=this.createState(),this.handleLeaseChange=()=>this.emitState(),this.handleStatusChange=()=>this.emitState(),this.handleAwarenessChange=()=>this.emitState()}createState(e={}){return{acquiredAt:0,canClaim:!1,hasHealthyHolder:!1,heartbeatAt:0,holderClientId:``,holderName:``,holderPeerId:``,isEditor:!1,isStale:!0,mode:`viewer`,savedAt:0,savedVersion:0,...e}}async connect({initialUser:e=null,requestedMode:t=`edit`}={}){return this.localUser=e??null,this.localMode=`viewer`,this.roomName?(this.ydoc=this.ydocFactory(),this.provider=this.websocketProviderFactory(this.resolveWsBaseUrlFn(),this.roomName,this.ydoc,{disableBc:!0,maxBackoffTime:5e3}),o(this.provider),this.awareness=this.provider.awareness,this.leaseMap=this.ydoc.getMap(`lease`),this.statusMap=this.ydoc.getMap(`status`),this.setLocalAwareness({mode:`viewer`}),this.leaseMap.observe(this.handleLeaseChange),this.statusMap.observe(this.handleStatusChange),this.awareness.on(`change`,this.handleAwarenessChange),await this.waitForSync(),t===`edit`?this.tryAcquireLease():this.emitState(),this.currentState):(this.currentState=this.createState(),this.onStateChange(this.currentState),this.currentState)}waitForSync(){return this.provider?new Promise(e=>{let t=!1,n=this.setTimeoutFn(()=>{t||(t=!0,this.provider.off?.(`sync`,r),e(!1))},this.syncTimeoutMs),r=i=>{!i||t||(t=!0,clearTimeout(n),this.provider.off?.(`sync`,r),e(!0))};this.provider.on?.(`sync`,r)}):Promise.resolve(!1)}setLocalUser(e=null){return this.localUser=e??null,this.setLocalAwareness({mode:this.currentState.isEditor?`editor`:`viewer`}),this.localUser}setLocalAwareness({mode:e=`viewer`}={}){this.localMode=e,this.awareness&&this.awareness.setLocalStateField(`drawio`,{filePath:this.filePath,mode:e,name:this.localUser?.name||``,peerId:this.localUser?.peerId||``})}getLocalClientId(){return this.ydoc?String(this.ydoc.clientID):``}getLeaseSnapshot(){return{acquiredAt:s(this.leaseMap?.get(`acquiredAt`)),heartbeatAt:s(this.leaseMap?.get(`heartbeatAt`)),holderClientId:String(this.leaseMap?.get(`holderClientId`)||``),holderName:String(this.leaseMap?.get(`holderName`)||``),holderPeerId:String(this.leaseMap?.get(`holderPeerId`)||``)}}findHolderAwarenessState(e){if(!e||!this.awareness)return null;for(let[t,n]of this.awareness.getStates())if(String(t)===String(e)&&n?.drawio?.filePath===this.filePath)return n.drawio;return null}isLeaseStale(e=this.getLeaseSnapshot()){return!e.holderClientId||!this.findHolderAwarenessState(e.holderClientId)?!0:this.now()-e.heartbeatAt>this.staleLeaseMs}isLeaseHeldByLocal(e=this.getLeaseSnapshot()){return!!e.holderClientId&&e.holderClientId===this.getLocalClientId()}tryAcquireLease(){if(!this.leaseMap)return!1;let e=this.getLeaseSnapshot();if(e.holderClientId&&!this.isLeaseStale(e)&&!this.isLeaseHeldByLocal(e))return this.emitState(),!1;let t=this.now();return this.ydoc.transact(()=>{this.leaseMap.set(`holderClientId`,this.getLocalClientId()),this.leaseMap.set(`holderName`,this.localUser?.name||``),this.leaseMap.set(`holderPeerId`,this.localUser?.peerId||``),this.leaseMap.set(`acquiredAt`,t),this.leaseMap.set(`heartbeatAt`,t)},`drawio-lease-acquire`),this.emitState(),this.currentState.isEditor}renewLeaseHeartbeat(){return!this.leaseMap||!this.isLeaseHeldByLocal()?!1:(this.leaseMap.set(`heartbeatAt`,this.now()),!0)}startHeartbeat(){this.heartbeatTimer||=this.setIntervalFn(()=>{this.renewLeaseHeartbeat()},this.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&=(this.clearIntervalFn(this.heartbeatTimer),null)}releaseLease(){return!this.leaseMap||!this.isLeaseHeldByLocal()?!1:(this.stopHeartbeat(),this.ydoc.transact(()=>{this.leaseMap.delete(`holderClientId`),this.leaseMap.delete(`holderName`),this.leaseMap.delete(`holderPeerId`),this.leaseMap.delete(`acquiredAt`),this.leaseMap.delete(`heartbeatAt`)},`drawio-lease-release`),this.setLocalAwareness({mode:`viewer`}),this.emitState(),!0)}publishSave(){if(!this.statusMap)return 0;let e=s(this.statusMap.get(`savedVersion`))+1,t=this.now();return this.ydoc.transact(()=>{this.statusMap.set(`savedVersion`,e),this.statusMap.set(`savedAt`,t)},`drawio-save-status`),this.emitState(),e}emitState(){let e=this.getLeaseSnapshot(),t=this.isLeaseStale(e),n=this.isLeaseHeldByLocal(e),r=this.createState({acquiredAt:e.acquiredAt,canClaim:!n&&t,hasHealthyHolder:!!e.holderClientId&&!t,heartbeatAt:e.heartbeatAt,holderClientId:e.holderClientId,holderName:e.holderName,holderPeerId:e.holderPeerId,isEditor:n,isStale:t,mode:n?`editor`:`viewer`,savedAt:s(this.statusMap?.get(`savedAt`)),savedVersion:s(this.statusMap?.get(`savedVersion`))});return n?(this.startHeartbeat(),this.setLocalAwareness({mode:`editor`})):(this.stopHeartbeat(),this.setLocalAwareness({mode:`viewer`})),this.currentState=r,this.onStateChange(r),r}destroy(){this.releaseLease(),this.stopHeartbeat(),this.leaseMap?.unobserve?.(this.handleLeaseChange),this.statusMap?.unobserve?.(this.handleStatusChange),this.awareness?.off?.(`change`,this.handleAwarenessChange),this.provider?.destroy?.(),this.ydoc?.destroy?.(),this.provider=null,this.ydoc=null,this.awareness=null,this.leaseMap=null,this.statusMap=null}},l=1e3,u=15e3,d=window.location.origin,f=new URLSearchParams(window.location.search),p=f.get(`file`)||``,m=f.get(`leaseRoom`)||``,h=f.get(`mode`)===`view`?`view`:`edit`,g=f.get(`hostMode`)||``,_=f.get(`instanceId`)||``,v=f.get(`theme`)===`light`?`light`:`dark`,y=g===`export-image`,b=Number.parseInt(f.get(`previewWidth`)||``,10),x=r(),S=``,C=v,w=null,T=null,E=!1,D=null,O=null,k=null,A=null,j=0,M=!1,N=!1,P=document.getElementById(`loadingState`),F=document.getElementById(`root`),I={bannerText:``,canClaim:!1,isEditor:!1},L=document.createElement(`div`);L.className=`drawio-shell`;var R=document.createElement(`div`);R.className=`drawio-banner`,R.innerHTML=`
1
+ /* empty css */import{n as e,t}from"./vault-api-client-Bf9tB_GW.js";import{f as n,n as r}from"./runtime-config-CqhchMC4.js";import{n as i,r as a,t as o}from"./yjs-provider-reset-guard-CtERLBID.js";import{n as ee,t as te}from"./drawio-room-DEivFyNV.js";var ne=4e3;function s(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}var c=class{constructor({clearIntervalFn:e=e=>window.clearInterval(e),filePath:t=``,heartbeatIntervalMs:r=te,now:o=()=>Date.now(),onStateChange:s=()=>{},resolveWsBaseUrlFn:c=n,roomName:l=``,setIntervalFn:u=(e,t)=>window.setInterval(e,t),setTimeoutFn:d=(e,t)=>window.setTimeout(e,t),staleLeaseMs:f=ee,syncTimeoutMs:p=ne,websocketProviderFactory:m=(e,t,n,r)=>new i(e,t,n,r),ydocFactory:h=()=>new a}){this.clearIntervalFn=e,this.filePath=t,this.heartbeatIntervalMs=r,this.now=o,this.onStateChange=s,this.resolveWsBaseUrlFn=c,this.roomName=l,this.setIntervalFn=u,this.setTimeoutFn=d,this.staleLeaseMs=f,this.syncTimeoutMs=p,this.websocketProviderFactory=m,this.ydocFactory=h,this.ydoc=null,this.provider=null,this.awareness=null,this.leaseMap=null,this.statusMap=null,this.localUser=null,this.localMode=`viewer`,this.heartbeatTimer=null,this.currentState=this.createState(),this.handleLeaseChange=()=>this.emitState(),this.handleStatusChange=()=>this.emitState(),this.handleAwarenessChange=()=>this.emitState()}createState(e={}){return{acquiredAt:0,canClaim:!1,hasHealthyHolder:!1,heartbeatAt:0,holderClientId:``,holderName:``,holderPeerId:``,isEditor:!1,isStale:!0,mode:`viewer`,savedAt:0,savedVersion:0,...e}}async connect({initialUser:e=null,requestedMode:t=`edit`}={}){return this.localUser=e??null,this.localMode=`viewer`,this.roomName?(this.ydoc=this.ydocFactory(),this.provider=this.websocketProviderFactory(this.resolveWsBaseUrlFn(),this.roomName,this.ydoc,{disableBc:!0,maxBackoffTime:5e3}),o(this.provider),this.awareness=this.provider.awareness,this.leaseMap=this.ydoc.getMap(`lease`),this.statusMap=this.ydoc.getMap(`status`),this.setLocalAwareness({mode:`viewer`}),this.leaseMap.observe(this.handleLeaseChange),this.statusMap.observe(this.handleStatusChange),this.awareness.on(`change`,this.handleAwarenessChange),await this.waitForSync(),t===`edit`?this.tryAcquireLease():this.emitState(),this.currentState):(this.currentState=this.createState(),this.onStateChange(this.currentState),this.currentState)}waitForSync(){return this.provider?new Promise(e=>{let t=!1,n=this.setTimeoutFn(()=>{t||(t=!0,this.provider.off?.(`sync`,r),e(!1))},this.syncTimeoutMs),r=i=>{!i||t||(t=!0,clearTimeout(n),this.provider.off?.(`sync`,r),e(!0))};this.provider.on?.(`sync`,r)}):Promise.resolve(!1)}setLocalUser(e=null){return this.localUser=e??null,this.setLocalAwareness({mode:this.currentState.isEditor?`editor`:`viewer`}),this.localUser}setLocalAwareness({mode:e=`viewer`}={}){this.localMode=e,this.awareness&&this.awareness.setLocalStateField(`drawio`,{filePath:this.filePath,mode:e,name:this.localUser?.name||``,peerId:this.localUser?.peerId||``})}getLocalClientId(){return this.ydoc?String(this.ydoc.clientID):``}getLeaseSnapshot(){return{acquiredAt:s(this.leaseMap?.get(`acquiredAt`)),heartbeatAt:s(this.leaseMap?.get(`heartbeatAt`)),holderClientId:String(this.leaseMap?.get(`holderClientId`)||``),holderName:String(this.leaseMap?.get(`holderName`)||``),holderPeerId:String(this.leaseMap?.get(`holderPeerId`)||``)}}findHolderAwarenessState(e){if(!e||!this.awareness)return null;for(let[t,n]of this.awareness.getStates())if(String(t)===String(e)&&n?.drawio?.filePath===this.filePath)return n.drawio;return null}isLeaseStale(e=this.getLeaseSnapshot()){return!e.holderClientId||!this.findHolderAwarenessState(e.holderClientId)?!0:this.now()-e.heartbeatAt>this.staleLeaseMs}isLeaseHeldByLocal(e=this.getLeaseSnapshot()){return!!e.holderClientId&&e.holderClientId===this.getLocalClientId()}tryAcquireLease(){if(!this.leaseMap)return!1;let e=this.getLeaseSnapshot();if(e.holderClientId&&!this.isLeaseStale(e)&&!this.isLeaseHeldByLocal(e))return this.emitState(),!1;let t=this.now();return this.ydoc.transact(()=>{this.leaseMap.set(`holderClientId`,this.getLocalClientId()),this.leaseMap.set(`holderName`,this.localUser?.name||``),this.leaseMap.set(`holderPeerId`,this.localUser?.peerId||``),this.leaseMap.set(`acquiredAt`,t),this.leaseMap.set(`heartbeatAt`,t)},`drawio-lease-acquire`),this.emitState(),this.currentState.isEditor}renewLeaseHeartbeat(){return!this.leaseMap||!this.isLeaseHeldByLocal()?!1:(this.leaseMap.set(`heartbeatAt`,this.now()),!0)}startHeartbeat(){this.heartbeatTimer||=this.setIntervalFn(()=>{this.renewLeaseHeartbeat()},this.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&=(this.clearIntervalFn(this.heartbeatTimer),null)}releaseLease(){return!this.leaseMap||!this.isLeaseHeldByLocal()?!1:(this.stopHeartbeat(),this.ydoc.transact(()=>{this.leaseMap.delete(`holderClientId`),this.leaseMap.delete(`holderName`),this.leaseMap.delete(`holderPeerId`),this.leaseMap.delete(`acquiredAt`),this.leaseMap.delete(`heartbeatAt`)},`drawio-lease-release`),this.setLocalAwareness({mode:`viewer`}),this.emitState(),!0)}publishSave(){if(!this.statusMap)return 0;let e=s(this.statusMap.get(`savedVersion`))+1,t=this.now();return this.ydoc.transact(()=>{this.statusMap.set(`savedVersion`,e),this.statusMap.set(`savedAt`,t)},`drawio-save-status`),this.emitState(),e}emitState(){let e=this.getLeaseSnapshot(),t=this.isLeaseStale(e),n=this.isLeaseHeldByLocal(e),r=this.createState({acquiredAt:e.acquiredAt,canClaim:!n&&t,hasHealthyHolder:!!e.holderClientId&&!t,heartbeatAt:e.heartbeatAt,holderClientId:e.holderClientId,holderName:e.holderName,holderPeerId:e.holderPeerId,isEditor:n,isStale:t,mode:n?`editor`:`viewer`,savedAt:s(this.statusMap?.get(`savedAt`)),savedVersion:s(this.statusMap?.get(`savedVersion`))});return n?(this.startHeartbeat(),this.setLocalAwareness({mode:`editor`})):(this.stopHeartbeat(),this.setLocalAwareness({mode:`viewer`})),this.currentState=r,this.onStateChange(r),r}destroy(){this.releaseLease(),this.stopHeartbeat(),this.leaseMap?.unobserve?.(this.handleLeaseChange),this.statusMap?.unobserve?.(this.handleStatusChange),this.awareness?.off?.(`change`,this.handleAwarenessChange),this.provider?.destroy?.(),this.ydoc?.destroy?.(),this.provider=null,this.ydoc=null,this.awareness=null,this.leaseMap=null,this.statusMap=null}},l=1e3,u=15e3,d=window.location.origin,f=new URLSearchParams(window.location.search),p=f.get(`file`)||``,m=f.get(`leaseRoom`)||``,h=f.get(`mode`)===`view`?`view`:`edit`,g=f.get(`hostMode`)||``,_=f.get(`instanceId`)||``,v=f.get(`theme`)===`light`?`light`:`dark`,y=g===`export-image`,b=Number.parseInt(f.get(`previewWidth`)||``,10),x=r(),S=``,C=v,w=null,T=null,E=!1,D=null,O=null,k=null,A=null,j=0,M=!1,N=!1,P=document.getElementById(`loadingState`),F=document.getElementById(`root`),I={bannerText:``,canClaim:!1,isEditor:!1},L=document.createElement(`div`);L.className=`drawio-shell`;var R=document.createElement(`div`);R.className=`drawio-banner`,R.innerHTML=`
2
2
  <div class="drawio-banner-status">
3
3
  <span class="drawio-banner-pill" id="drawioModePill">Loading</span>
4
4
  <span class="drawio-banner-copy" id="drawioBannerText">Connecting…</span>
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./drawio-editor-Br4qyh3r.js","./yjs-provider-reset-guard-CtERLBID.js","./runtime-config-CqhchMC4.js","./vault-api-client-Bf9tB_GW.js","./vault-api-client-D7Ck0CvR.css","./drawio-room-DEivFyNV.js","./drawio-editor-UQQ8XHou.css","./embedded-editor-base-CgEkjNYn.css"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./runtime-config-loader-_D2KZKn-.js";import{t}from"./preload-helper-Bo9GmnuQ.js";await e(),await t(()=>import(`./drawio-editor-Br4qyh3r.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-BtnXjRx0.js","./dist-DIi0uqLJ.js","./dist-DWJL3_bF.js","./dist-O1z0Ayg0.js","./dist-Dyt7n5Ui.js","./dist-DJ16N7ol.js","./dist-B-02vKOA.js","./dist-CjII8VDS.js","./dist-BVB8rn7o.js","./dist-CxfohGIV.js","./dist-E_jPb93e.js","./dist-BzpfHRaE.js","./dist-OQE68wIX.js","./dist-k47-Io7D.js","./dist-CXpKYW9s.js","./dist-Bc2ND6i3.js","./dist-CL-jjdvG.js","./dist-3bQB_we3.js","./dist-D5QOYy7y.js","./dist-DUvaQ-Bj.js","./dist-CGV1S_as.js","./dist-lDhnP-K1.js","./dist-BLAlZer_.js","./dist-rMhng5DK.js","./dist-BzbYwa8m.js","./dist-8Igu3Ee_2.js","./dist-B4uQVR_X.js","./dockerfile-D8_6_FRV.js","./simple-mode-pOKc0mfx.js","./factor-Cz-hzBGH.js","./javascript-UJe68_xi.js","./javascript-CdiVhQeA.js","./nsis-QPGhLAeY.js","./pug-DkUcLYWt.js","./dist-3uAMa5w5.js","./dist-DsL7sqZR.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-Bo9GmnuQ.js";import{$ as t,A as n,B as r,F as i,G as a,H as o,J as s,K as c,L as l,P as u,Q as d,R as f,St as p,Tt as m,V as h,W as g,Z as _,_t as ee,a as v,bt as te,c as ne,ct as y,et as re,f as ie,ft as ae,g as oe,gt as b,l as se,lt as x,mt as ce,nt as S,o as le,ot as C,pt as ue,q as de,rt as fe,st as pe,t as me,ut as w,v as he,w as ge,wt as _e,xt as ve,z as ye}from"./dist-DWJL3_bF.js";import{i as be,n as xe,r as Se}from"./dist-DIi0uqLJ.js";import{a as Ce,s as we}from"./dist-D5QOYy7y.js";import{t as Te}from"./dist-B4uQVR_X.js";import{a as Ee,c as De,i as Oe,n as ke,o as Ae,r as je,s as Me,t as Ne}from"./dist-BU8uusJX.js";import{d as Pe,i as Fe}from"./file-kind-DBptLlF_.js";import{f as Ie}from"./runtime-config-CqhchMC4.js";import{a as Le,c as T,d as E,f as Re,g as ze,h as Be,i as Ve,l as D,m as O,n as He,o as k,p as A,r as Ue,s as We,t as Ge,u as j}from"./yjs-provider-reset-guard-CtERLBID.js";import{a as Ke,c as qe,d as Je,i as Ye,n as Xe,o as Ze,s as Qe,t as $e,u as et}from"./room-yJaBAoEU.js";function tt({body:e,user:t}){return{body:e,createdAt:Date.now(),id:Ye(`comment`),peerId:t?.peerId??``,reactions:[],userColor:t?.color??``,userName:t?.name??`Anonymous`}}function nt(e,t){return e instanceof k?e.get(t):e?.[t]}function rt(e=[]){return Array.isArray(e)?e.map(e=>({emoji:typeof e?.emoji==`string`?e.emoji:``,users:Array.isArray(e?.users)?e.users.map(e=>({reactedAt:Number.isFinite(e?.reactedAt)?e.reactedAt:Date.now(),userColor:typeof e?.userColor==`string`?e.userColor:``,userId:typeof e?.userId==`string`?e.userId:``,userName:typeof e?.userName==`string`&&e.userName?e.userName:`Anonymous`})).filter(e=>e.userId):[]})).filter(e=>e.emoji&&e.users.length>0):[]}function it(e,t){let n=t?.doc;if(!n)return null;let r=e?.anchor??e,i=r?.anchorKind===`text`?`text`:`line`,a=n.lines,o=Math.min(Math.max(Math.round(r?.startLine??1),1),a),s=Math.min(Math.max(Math.round(r?.endLine??o),o),a),c=n.line(o).from,l=n.line(s).to,u=Math.min(Math.max(Math.round(r?.startIndex??c),0),n.length),d=Math.min(Math.max(Math.round(r?.endIndex??l),u),n.length);return{anchorEndLine:s,anchorKind:i,anchorQuote:qe(r?.anchorQuote||n.sliceString(u,d)),anchorStartLine:o,endIndex:d,startIndex:u}}var at=class{constructor({getDoc:e,getEditorState:t,getLocalUser:n,onCommentsChange:r=null}){this.getDoc=e,this.getEditorState=t,this.getLocalUser=n,this.onCommentsChange=r,this.commentThreads=null,this.ydoc=null,this.ytext=null,this.handleCommentThreadsChange=null,this.handleTextChange=null}bind({commentThreads:e,ydoc:t,ytext:n}){this.unbind(),this.commentThreads=e,this.ydoc=t,this.ytext=n,this.handleCommentThreadsChange=()=>{this.emitCommentsChange()},this.handleTextChange=()=>{this.emitCommentsChange()},this.commentThreads.observeDeep(this.handleCommentThreadsChange),this.ytext?.observe?.(this.handleTextChange),this.emitCommentsChange()}unbind(){this.commentThreads&&this.handleCommentThreadsChange&&this.commentThreads.unobserveDeep(this.handleCommentThreadsChange),this.ytext&&this.handleTextChange&&this.ytext.unobserve(this.handleTextChange),this.commentThreads=null,this.ydoc=null,this.ytext=null,this.handleCommentThreadsChange=null,this.handleTextChange=null}emitCommentsChange(){this.onCommentsChange?.(this.getCommentThreads())}getCommentThreads(){return this.commentThreads?et(this.commentThreads).map(e=>this.resolveCommentThread(e)).filter(Boolean):[]}createCommentThread({anchor:e,body:t}){let n=this.getEditorState();if(!n||!this.commentThreads||!this.ytext||!this.ydoc)return null;let r=Qe(t),i=it(e,n);if(!r||!i)return null;let a=Ke({anchorEnd:E(j(this.ytext,i.endIndex)),anchorEndLine:i.anchorEndLine,anchorKind:i.anchorKind,anchorQuote:i.anchorQuote,anchorStart:E(j(this.ytext,i.startIndex)),anchorStartLine:i.anchorStartLine,createdAt:Date.now(),createdByColor:this.getLocalUser()?.color??``,createdByName:this.getLocalUser()?.name??`Anonymous`,createdByPeerId:this.getLocalUser()?.peerId??``,id:Ye(`thread`),messages:[tt({body:r,user:this.getLocalUser()})]});return a?(this.ydoc.transact(()=>{this.commentThreads.push([a])},`comment-thread-create`),a.get(`id`)):null}replyToCommentThread(e,t){let n=Qe(t);if(!n||!this.ydoc)return null;let r=this.findSharedCommentThread(e)?.get(`messages`);if(!(r instanceof Le))return null;let i=tt({body:n,user:this.getLocalUser()});return this.ydoc.transact(()=>{r.push([i])},`comment-thread-reply`),i.id}toggleCommentReaction(e,t,n){if(!this.ydoc||!e||!t||typeof n!=`string`||!n.trim())return!1;let r=this.getLocalUser?.(),i=typeof r?.userId==`string`?r.userId:``;if(!i)return!1;let a=this.findSharedCommentThread(e)?.get(`messages`);if(!(a instanceof Le))return!1;let o=a.toArray(),s=o.findIndex(e=>nt(e,`id`)===t);if(s<0)return!1;let c=o[s]instanceof k?o[s].toJSON():{...o[s]},l=rt(c.reactions),u=l.findIndex(e=>e.emoji===n);if(u>=0){let e=l[u].users.filter(e=>e.userId!==i);e.length===l[u].users.length&&e.push({reactedAt:Date.now(),userColor:r?.color??``,userId:i,userName:r?.name??`Anonymous`}),e.length===0?l.splice(u,1):l[u]={...l[u],users:e}}else l.push({emoji:n,users:[{reactedAt:Date.now(),userColor:r?.color??``,userId:i,userName:r?.name??`Anonymous`}]});let d={...c,reactions:l};return this.ydoc.transact(()=>{a.delete(s,1),a.insert(s,[d])},`comment-reaction-toggle`),!0}deleteCommentThread(e){if(!this.commentThreads||!this.ydoc)return!1;let t=this.findSharedCommentThreadIndex(e);return t<0?!1:(this.ydoc.transact(()=>{this.commentThreads.delete(t,1)},`comment-thread-resolve`),!0)}findSharedCommentThread(e){return this.commentThreads?this.commentThreads.toArray().find(t=>t instanceof k&&t.get(`id`)===e)??null:null}findSharedCommentThreadIndex(e){return this.commentThreads?this.commentThreads.toArray().findIndex(t=>t instanceof k&&t.get(`id`)===e):-1}resolveCommentThread(e){let t=this.getEditorState();if(!e||!t||!this.ydoc)return null;let n=Ze(e);if(!n)return null;let r=this.resolveCommentPosition(n.anchorStart),i=this.resolveCommentPosition(n.anchorEnd),a=r?.index??t.doc.line(n.anchorStartLine).from,o=Math.min(Math.max(n.anchorEndLine??n.anchorStartLine,n.anchorStartLine),t.doc.lines),s=i?.index??t.doc.line(o).to,c=t.doc.lineAt(a).number,l=Math.min(Math.max(s,a),t.doc.length),u=t.doc.lineAt(l).number,d=Je(t.doc.sliceString(a,n.anchorKind===`text`?Math.max(s,a):t.doc.line(u).to))||n.anchorQuote;return{...e,anchor:{endIndex:s,endLine:u,excerpt:d,quote:n.anchorQuote,startIndex:a,startLine:c,kind:n.anchorKind},anchorEnd:n.anchorEnd,anchorEndLine:n.anchorEndLine,anchorKind:n.anchorKind,anchorQuote:n.anchorQuote,anchorStart:n.anchorStart,anchorStartLine:n.anchorStartLine}}resolveCommentPosition(e){if(!e||!this.ydoc||!this.ytext)return null;try{let t=T(D(e),this.ydoc);return!t||t.type!==this.ytext?null:t}catch{return null}}},ot=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(e){this.wsBaseUrl=Ie(),this.ydoc=new Ue,this.ytext=this.ydoc.getText(`codemirror`),this.commentThreads=this.ydoc.getArray(`comments`);let t=new Ve(this.ytext),n=new He(this.wsBaseUrl,e,this.ydoc,{disableBc:!0,maxBackoffTime:5e3});Ge(n);let r=n.awareness,i=this.providedLocalUser??$e(this.preferredUserName);this.provider=n,this.awareness=r,this.localUser=i,this.initialSyncComplete=!1,this.initialSyncPromise=new Promise(e=>{this.resolveInitialSync=e}),r.setLocalStateField(`user`,i),r.on(`change`,()=>{this.onAwarenessChange?.(this.collectUsers(this.resolveAwarenessCursor))}),this.trackConnectionStatus();let a=!1;return n.on(`sync`,e=>{!e||a||(a=!0,this.initialSyncComplete=!0,this.resolveInitialSync?.(),this.resolveInitialSync=null,this.onInitialSync?.())}),{awareness:r,commentThreads:this.commentThreads,localUser:this.localUser,undoManager:t,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=Xe(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 M(e){return new le(ne.define(e))}function N(t){return e(()=>import(`./dist-BtnXjRx0.js`).then(e=>e.sql({dialect:e[t]})),__vite__mapDeps([0,1,2,3]),import.meta.url)}var st=[v.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return e(()=>import(`./dist-Dyt7n5Ui.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]),import.meta.url)}}),v.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return e(()=>import(`./dist-Dyt7n5Ui.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]),import.meta.url)}}),v.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return N(`Cassandra`)}}),v.of({name:`CSS`,extensions:[`css`],load(){return e(()=>import(`./dist-DJ16N7ol.js`).then(e=>e.css()),__vite__mapDeps([5,6,2,3]),import.meta.url)}}),v.of({name:`Go`,extensions:[`go`],load(){return e(()=>import(`./dist-CjII8VDS.js`).then(e=>e.go()),__vite__mapDeps([7,1,2,3]),import.meta.url)}}),v.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return e(()=>import(`./dist-BVB8rn7o.js`).then(e=>e.html()),__vite__mapDeps([8,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`Java`,extensions:[`java`],load(){return e(()=>import(`./dist-BzpfHRaE.js`).then(e=>e.java()),__vite__mapDeps([11,2,3]),import.meta.url)}}),v.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript()),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return e(()=>import(`./dist-k47-Io7D.js`).then(e=>e.jinja()),__vite__mapDeps([13,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return e(()=>import(`./dist-CXpKYW9s.js`).then(e=>e.json()),__vite__mapDeps([14,2,3]),import.meta.url)}}),v.of({name:`JSX`,extensions:[`jsx`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`LESS`,extensions:[`less`],load(){return e(()=>import(`./dist-Bc2ND6i3.js`).then(e=>e.less()),__vite__mapDeps([15,6,2,3]),import.meta.url)}}),v.of({name:`Liquid`,extensions:[`liquid`],load(){return e(()=>import(`./dist-CL-jjdvG.js`).then(e=>e.liquid()),__vite__mapDeps([16,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`MariaDB SQL`,load(){return N(`MariaSQL`)}}),v.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return e(()=>import(`./dist-3bQB_we3.js`).then(e=>e.markdown()),__vite__mapDeps([17,18,1,2,9,6,3,10]),import.meta.url)}}),v.of({name:`MS SQL`,load(){return N(`MSSQL`)}}),v.of({name:`MySQL`,load(){return N(`MySQL`)}}),v.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return e(()=>import(`./dist-DUvaQ-Bj.js`).then(e=>e.php()),__vite__mapDeps([19,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`PLSQL`,extensions:[`pls`],load(){return N(`PLSQL`)}}),v.of({name:`PostgreSQL`,load(){return N(`PostgreSQL`)}}),v.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return e(()=>import(`./dist-CGV1S_as.js`).then(e=>e.python()),__vite__mapDeps([20,1,2,3]),import.meta.url)}}),v.of({name:`Rust`,extensions:[`rs`],load(){return e(()=>import(`./dist-lDhnP-K1.js`).then(e=>e.rust()),__vite__mapDeps([21,2,3]),import.meta.url)}}),v.of({name:`Sass`,extensions:[`sass`],load(){return e(()=>import(`./dist-BLAlZer_.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([22,6,2,3]),import.meta.url)}}),v.of({name:`SCSS`,extensions:[`scss`],load(){return e(()=>import(`./dist-BLAlZer_.js`).then(e=>e.sass()),__vite__mapDeps([22,6,2,3]),import.meta.url)}}),v.of({name:`SQL`,extensions:[`sql`],load(){return N(`StandardSQL`)}}),v.of({name:`SQLite`,load(){return N(`SQLite`)}}),v.of({name:`TSX`,extensions:[`tsx`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return e(()=>import(`./dist-rMhng5DK.js`).then(e=>e.wast()),__vite__mapDeps([23,2,3]),import.meta.url)}}),v.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return e(()=>import(`./dist-BzbYwa8m.js`).then(e=>e.xml()),__vite__mapDeps([24,2,3]),import.meta.url)}}),v.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return e(()=>import(`./dist-8Igu3Ee_2.js`).then(e=>e.yaml()),__vite__mapDeps([25,26,2,3]),import.meta.url)}}),v.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return e(()=>import(`./apl-C1JYSI8J.js`).then(e=>M(e.apl)),[],import.meta.url)}}),v.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return e(()=>import(`./asciiarmor-DHW75j1s.js`).then(e=>M(e.asciiArmor)),[],import.meta.url)}}),v.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return e(()=>import(`./asn1-CQiG40kG.js`).then(e=>M(e.asn1({}))),[],import.meta.url)}}),v.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return e(()=>import(`./asterisk-BWExh0n4.js`).then(e=>M(e.asterisk)),[],import.meta.url)}}),v.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return e(()=>import(`./brainfuck-CTNFyOLg.js`).then(e=>M(e.brainfuck)),[],import.meta.url)}}),v.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return e(()=>import(`./cobol-DP4QggbL.js`).then(e=>M(e.cobol)),[],import.meta.url)}}),v.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.csharp)),[],import.meta.url)}}),v.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`ClojureScript`,extensions:[`cljs`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return e(()=>import(`./css-CmhPNxBE.js`).then(e=>M(e.gss)),[],import.meta.url)}}),v.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return e(()=>import(`./cmake-DtGL-Unu.js`).then(e=>M(e.cmake)),[],import.meta.url)}}),v.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return e(()=>import(`./coffeescript-B_7eyHAa.js`).then(e=>M(e.coffeeScript)),[],import.meta.url)}}),v.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return e(()=>import(`./commonlisp-COlJYiQT.js`).then(e=>M(e.commonLisp)),[],import.meta.url)}}),v.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return e(()=>import(`./cypher-DE6I2lIA.js`).then(e=>M(e.cypher)),[],import.meta.url)}}),v.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return e(()=>import(`./python-CZtTmYkS.js`).then(e=>M(e.cython)),[],import.meta.url)}}),v.of({name:`Crystal`,extensions:[`cr`],load(){return e(()=>import(`./crystal-I_dE9xG-.js`).then(e=>M(e.crystal)),[],import.meta.url)}}),v.of({name:`D`,extensions:[`d`],load(){return e(()=>import(`./d-BNkKjn0o.js`).then(e=>M(e.d)),[],import.meta.url)}}),v.of({name:`Dart`,extensions:[`dart`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.dart)),[],import.meta.url)}}),v.of({name:`diff`,extensions:[`diff`,`patch`],load(){return e(()=>import(`./diff-BWuPUsEo.js`).then(e=>M(e.diff)),[],import.meta.url)}}),v.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return e(()=>import(`./dockerfile-D8_6_FRV.js`).then(e=>M(e.dockerFile)),__vite__mapDeps([27,28]),import.meta.url)}}),v.of({name:`DTD`,extensions:[`dtd`],load(){return e(()=>import(`./dtd-C6brJFPg.js`).then(e=>M(e.dtd)),[],import.meta.url)}}),v.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return e(()=>import(`./dylan-Bft86ZSB.js`).then(e=>M(e.dylan)),[],import.meta.url)}}),v.of({name:`EBNF`,load(){return e(()=>import(`./ebnf-D6ifG44A.js`).then(e=>M(e.ebnf)),[],import.meta.url)}}),v.of({name:`ECL`,extensions:[`ecl`],load(){return e(()=>import(`./ecl-M7Iek4lq.js`).then(e=>M(e.ecl)),[],import.meta.url)}}),v.of({name:`edn`,extensions:[`edn`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`Eiffel`,extensions:[`e`],load(){return e(()=>import(`./eiffel-DwxtewZF.js`).then(e=>M(e.eiffel)),[],import.meta.url)}}),v.of({name:`Elm`,extensions:[`elm`],load(){return e(()=>import(`./elm-B1TncobV.js`).then(e=>M(e.elm)),[],import.meta.url)}}),v.of({name:`Erlang`,extensions:[`erl`],load(){return e(()=>import(`./erlang-BDJZNtt8.js`).then(e=>M(e.erlang)),[],import.meta.url)}}),v.of({name:`Esper`,load(){return e(()=>import(`./sql-DDFeQNTK.js`).then(e=>M(e.esper)),[],import.meta.url)}}),v.of({name:`Factor`,extensions:[`factor`],load(){return e(()=>import(`./factor-Cz-hzBGH.js`).then(e=>M(e.factor)),__vite__mapDeps([29,28]),import.meta.url)}}),v.of({name:`FCL`,load(){return e(()=>import(`./fcl-BWKK0S4-.js`).then(e=>M(e.fcl)),[],import.meta.url)}}),v.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return e(()=>import(`./forth-nvhcMz63.js`).then(e=>M(e.forth)),[],import.meta.url)}}),v.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return e(()=>import(`./fortran-BZID-z10.js`).then(e=>M(e.fortran)),[],import.meta.url)}}),v.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.fSharp)),[],import.meta.url)}}),v.of({name:`Gas`,extensions:[`s`],load(){return e(()=>import(`./gas-DjQsZDGE.js`).then(e=>M(e.gas)),[],import.meta.url)}}),v.of({name:`Gherkin`,extensions:[`feature`],load(){return e(()=>import(`./gherkin-S0kHlzux.js`).then(e=>M(e.gherkin)),[],import.meta.url)}}),v.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return e(()=>import(`./groovy-BEKazBrO.js`).then(e=>M(e.groovy)),[],import.meta.url)}}),v.of({name:`Haskell`,extensions:[`hs`],load(){return e(()=>import(`./haskell-C6qH3-aI.js`).then(e=>M(e.haskell)),[],import.meta.url)}}),v.of({name:`Haxe`,extensions:[`hx`],load(){return e(()=>import(`./haxe-BY9d_5nB.js`).then(e=>M(e.haxe)),[],import.meta.url)}}),v.of({name:`HXML`,extensions:[`hxml`],load(){return e(()=>import(`./haxe-BY9d_5nB.js`).then(e=>M(e.hxml)),[],import.meta.url)}}),v.of({name:`HTTP`,load(){return e(()=>import(`./http-DG1Y9fpK.js`).then(e=>M(e.http)),[],import.meta.url)}}),v.of({name:`IDL`,extensions:[`pro`],load(){return e(()=>import(`./idl-B64p3NTJ.js`).then(e=>M(e.idl)),[],import.meta.url)}}),v.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return e(()=>import(`./javascript-UJe68_xi.js`).then(e=>M(e.jsonld)),__vite__mapDeps([30,31]),import.meta.url)}}),v.of({name:`Julia`,extensions:[`jl`],load(){return e(()=>import(`./julia-B22G9Bym.js`).then(e=>M(e.julia)),[],import.meta.url)}}),v.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.kotlin)),[],import.meta.url)}}),v.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return e(()=>import(`./livescript-CkcuHqeS.js`).then(e=>M(e.liveScript)),[],import.meta.url)}}),v.of({name:`Lua`,extensions:[`lua`],load(){return e(()=>import(`./lua-kutgyRGY.js`).then(e=>M(e.lua)),[],import.meta.url)}}),v.of({name:`mIRC`,extensions:[`mrc`],load(){return e(()=>import(`./mirc-BVG2S5rO.js`).then(e=>M(e.mirc)),[],import.meta.url)}}),v.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return e(()=>import(`./mathematica-CKVhKnoY.js`).then(e=>M(e.mathematica)),[],import.meta.url)}}),v.of({name:`Modelica`,extensions:[`mo`],load(){return e(()=>import(`./modelica-vJ-Qa9jV.js`).then(e=>M(e.modelica)),[],import.meta.url)}}),v.of({name:`MUMPS`,extensions:[`mps`],load(){return e(()=>import(`./mumps-D0KfUTSd.js`).then(e=>M(e.mumps)),[],import.meta.url)}}),v.of({name:`Mbox`,extensions:[`mbox`],load(){return e(()=>import(`./mbox-DANyzFJ2.js`).then(e=>M(e.mbox)),[],import.meta.url)}}),v.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return e(()=>import(`./nginx-DkVceJrH.js`).then(e=>M(e.nginx)),[],import.meta.url)}}),v.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return e(()=>import(`./nsis-QPGhLAeY.js`).then(e=>M(e.nsis)),__vite__mapDeps([32,28]),import.meta.url)}}),v.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return e(()=>import(`./ntriples-BBuCIfS0.js`).then(e=>M(e.ntriples)),[],import.meta.url)}}),v.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.objectiveC)),[],import.meta.url)}}),v.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.objectiveCpp)),[],import.meta.url)}}),v.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.oCaml)),[],import.meta.url)}}),v.of({name:`Octave`,extensions:[`m`],load(){return e(()=>import(`./octave-BTv2CqSQ.js`).then(e=>M(e.octave)),[],import.meta.url)}}),v.of({name:`Oz`,extensions:[`oz`],load(){return e(()=>import(`./oz-D8SjVDNU.js`).then(e=>M(e.oz)),[],import.meta.url)}}),v.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return e(()=>import(`./pascal-T-tfhVyx.js`).then(e=>M(e.pascal)),[],import.meta.url)}}),v.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return e(()=>import(`./perl-BDrCkHRd.js`).then(e=>M(e.perl)),[],import.meta.url)}}),v.of({name:`Pig`,extensions:[`pig`],load(){return e(()=>import(`./pig-BEyI4fPq.js`).then(e=>M(e.pig)),[],import.meta.url)}}),v.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return e(()=>import(`./powershell-DtnFc6GG.js`).then(e=>M(e.powerShell)),[],import.meta.url)}}),v.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return e(()=>import(`./properties-DWUvbxV9.js`).then(e=>M(e.properties)),[],import.meta.url)}}),v.of({name:`ProtoBuf`,extensions:[`proto`],load(){return e(()=>import(`./protobuf-CQGoYyfE.js`).then(e=>M(e.protobuf)),[],import.meta.url)}}),v.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return e(()=>import(`./pug-DkUcLYWt.js`).then(e=>M(e.pug)),__vite__mapDeps([33,31]),import.meta.url)}}),v.of({name:`Puppet`,extensions:[`pp`],load(){return e(()=>import(`./puppet-Dd-qWO3p.js`).then(e=>M(e.puppet)),[],import.meta.url)}}),v.of({name:`Q`,extensions:[`q`],load(){return e(()=>import(`./q-I27iQntV.js`).then(e=>M(e.q)),[],import.meta.url)}}),v.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return e(()=>import(`./r-DN_EydfL.js`).then(e=>M(e.r)),[],import.meta.url)}}),v.of({name:`RPM Changes`,load(){return e(()=>import(`./rpm-CjWxLM68.js`).then(e=>M(e.rpmChanges)),[],import.meta.url)}}),v.of({name:`RPM Spec`,extensions:[`spec`],load(){return e(()=>import(`./rpm-CjWxLM68.js`).then(e=>M(e.rpmSpec)),[],import.meta.url)}}),v.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return e(()=>import(`./ruby-CB34f2Gf.js`).then(e=>M(e.ruby)),[],import.meta.url)}}),v.of({name:`SAS`,extensions:[`sas`],load(){return e(()=>import(`./sas-Bji4HDQq.js`).then(e=>M(e.sas)),[],import.meta.url)}}),v.of({name:`Scala`,extensions:[`scala`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.scala)),[],import.meta.url)}}),v.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return e(()=>import(`./scheme-C3elI80V.js`).then(e=>M(e.scheme)),[],import.meta.url)}}),v.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return e(()=>import(`./shell-DUveK2Hb.js`).then(e=>M(e.shell)),[],import.meta.url)}}),v.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return e(()=>import(`./sieve-2ogwMVx4.js`).then(e=>M(e.sieve)),[],import.meta.url)}}),v.of({name:`Smalltalk`,extensions:[`st`],load(){return e(()=>import(`./smalltalk-BuGhc6lW.js`).then(e=>M(e.smalltalk)),[],import.meta.url)}}),v.of({name:`Solr`,load(){return e(()=>import(`./solr-DTxshpm8.js`).then(e=>M(e.solr)),[],import.meta.url)}}),v.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.sml)),[],import.meta.url)}}),v.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return e(()=>import(`./sparql-BOvq0dv7.js`).then(e=>M(e.sparql)),[],import.meta.url)}}),v.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return e(()=>import(`./spreadsheet-C6Vbtl9-.js`).then(e=>M(e.spreadsheet)),[],import.meta.url)}}),v.of({name:`Squirrel`,extensions:[`nut`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.squirrel)),[],import.meta.url)}}),v.of({name:`Stylus`,extensions:[`styl`],load(){return e(()=>import(`./stylus-D1SZIMDs.js`).then(e=>M(e.stylus)),[],import.meta.url)}}),v.of({name:`Swift`,extensions:[`swift`],load(){return e(()=>import(`./swift-BCxe4-cw.js`).then(e=>M(e.swift)),[],import.meta.url)}}),v.of({name:`sTeX`,load(){return e(()=>import(`./stex-CEwW0Q_0.js`).then(e=>M(e.stex)),[],import.meta.url)}}),v.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return e(()=>import(`./stex-CEwW0Q_0.js`).then(e=>M(e.stex)),[],import.meta.url)}}),v.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return e(()=>import(`./verilog-C4wTycyo.js`).then(e=>M(e.verilog)),[],import.meta.url)}}),v.of({name:`Tcl`,extensions:[`tcl`],load(){return e(()=>import(`./tcl-SPk7uiDB.js`).then(e=>M(e.tcl)),[],import.meta.url)}}),v.of({name:`Textile`,extensions:[`textile`],load(){return e(()=>import(`./textile-C48beRus.js`).then(e=>M(e.textile)),[],import.meta.url)}}),v.of({name:`TiddlyWiki`,load(){return e(()=>import(`./tiddlywiki-CiImjFLN.js`).then(e=>M(e.tiddlyWiki)),[],import.meta.url)}}),v.of({name:`Tiki wiki`,load(){return e(()=>import(`./tiki-HkXZ4BIW.js`).then(e=>M(e.tiki)),[],import.meta.url)}}),v.of({name:`TOML`,extensions:[`toml`],load(){return e(()=>import(`./toml-BmfpMy1_.js`).then(e=>M(e.toml)),[],import.meta.url)}}),v.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return e(()=>import(`./troff-BjbEOT5E.js`).then(e=>M(e.troff)),[],import.meta.url)}}),v.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return e(()=>import(`./ttcn-NA-V4KnY.js`).then(e=>M(e.ttcn)),[],import.meta.url)}}),v.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return e(()=>import(`./ttcn-cfg-TPHncdGN.js`).then(e=>M(e.ttcnCfg)),[],import.meta.url)}}),v.of({name:`Turtle`,extensions:[`ttl`],load(){return e(()=>import(`./turtle-GBz_E4RG.js`).then(e=>M(e.turtle)),[],import.meta.url)}}),v.of({name:`Web IDL`,extensions:[`webidl`],load(){return e(()=>import(`./webidl-DttrYZRT.js`).then(e=>M(e.webIDL)),[],import.meta.url)}}),v.of({name:`VB.NET`,extensions:[`vb`],load(){return e(()=>import(`./vb-C19AQWqO.js`).then(e=>M(e.vb)),[],import.meta.url)}}),v.of({name:`VBScript`,extensions:[`vbs`],load(){return e(()=>import(`./vbscript-CHJk3s95.js`).then(e=>M(e.vbScript)),[],import.meta.url)}}),v.of({name:`Velocity`,extensions:[`vtl`],load(){return e(()=>import(`./velocity-Ya0P4sQU.js`).then(e=>M(e.velocity)),[],import.meta.url)}}),v.of({name:`Verilog`,extensions:[`v`],load(){return e(()=>import(`./verilog-C4wTycyo.js`).then(e=>M(e.verilog)),[],import.meta.url)}}),v.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return e(()=>import(`./vhdl-Bwndeg44.js`).then(e=>M(e.vhdl)),[],import.meta.url)}}),v.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return e(()=>import(`./xquery-CEDTd8qs.js`).then(e=>M(e.xQuery)),[],import.meta.url)}}),v.of({name:`Yacas`,extensions:[`ys`],load(){return e(()=>import(`./yacas-C7dxlPB0.js`).then(e=>M(e.yacas)),[],import.meta.url)}}),v.of({name:`Z80`,extensions:[`z80`],load(){return e(()=>import(`./z80-BqEfFSnA.js`).then(e=>M(e.z80)),[],import.meta.url)}}),v.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.mscgen)),[],import.meta.url)}}),v.of({name:`Xù`,extensions:[`xu`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.xu)),[],import.meta.url)}}),v.of({name:`MsGenny`,extensions:[`msgenny`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.msgenny)),[],import.meta.url)}}),v.of({name:`Vue`,extensions:[`vue`],load(){return e(()=>import(`./dist-3uAMa5w5.js`).then(e=>e.vue()),__vite__mapDeps([34,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`Angular Template`,load(){return e(()=>import(`./dist-DsL7sqZR.js`).then(e=>e.angular()),__vite__mapDeps([35,9,6,2,3,10,1]),import.meta.url)}})],ct=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,P=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(ct(e)):ct,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=m(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ve(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(P.prototype[Symbol.iterator]=function(){return this});var lt={from:-1,to:-1,match:/.*/.exec(``)},ut=`gm`+(/x/.unicode==null?``:`u`),dt=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=lt,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new mt(e,t,n,r,i);this.re=new RegExp(t,ut+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=F(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=F(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},ft=new WeakMap,pt=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=ft.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return ft.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),ft.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},mt=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=lt,this.matchPos=F(e,r),this.re=new RegExp(t,ut+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=pt.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=F(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(dt.prototype[Symbol.iterator]=mt.prototype[Symbol.iterator]=function(){return this});function ht(e){try{return new RegExp(e,ut),!0}catch{return!1}}function F(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var gt=e=>{let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=t(e,{label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,u]=r,d=c?+c.slice(1):0,f=s?+s:a.number;if(s&&u){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),f=Math.round(n.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=n.doc.line(Math.max(1,Math.min(n.doc.lines,f))),m=y.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[i,l.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},_t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},vt=w.define({combine(e){return p(e,_t,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function yt(e){let t=[Tt,wt];return e&&t.push(vt.of(e)),t}var bt=i.mark({class:`cm-selectionMatch`}),xt=i.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function St(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=C.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=C.Word)}function Ct(e,t,n,r){return e(t.sliceDoc(n,n+1))==C.Word&&e(t.sliceDoc(r-1,r))==C.Word}var wt=f.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(vt),{state:n}=e,r=n.selection;if(r.ranges.length>1)return i.none;let a=r.main,o,s=null;if(a.empty){if(!t.highlightWordAroundCursor)return i.none;let e=n.wordAt(a.head);if(!e)return i.none;s=n.charCategorizer(a.head),o=n.sliceDoc(e.from,e.to)}else{let e=a.to-a.from;if(e<t.minSelectionLength||e>200)return i.none;if(t.wholeWords){if(o=n.sliceDoc(a.from,a.to),s=n.charCategorizer(a.head),!(St(s,n,a.from,a.to)&&Ct(s,n,a.from,a.to)))return i.none}else if(o=n.sliceDoc(a.from,a.to),!o)return i.none}let c=[];for(let r of e.visibleRanges){let e=new P(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!s||St(s,n,r,o))&&(a.empty&&r<=a.from&&o>=a.to?c.push(xt.range(r,o)):(r>=a.to||o<=a.from)&&c.push(bt.range(r,o)),c.length>t.maxMatches))return i.none}}return i.set(c)}},{decorations:e=>e.decorations}),Tt=l.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Et=({state:e,dispatch:t})=>{let{selection:n}=e,r=y.create(n.ranges.map(t=>e.wordAt(t.head)||y.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Dt(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new P(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new P(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Ot=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Et({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Dt(e,r);return i?(t(e.update({selection:e.selection.addRange(y.range(i.from,i.to),!1),effects:l.scrollIntoView(i.to)})),!0):!1},I=w.define({combine(e){return p(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new $t(e),scrollToMatch:e=>l.scrollIntoView(e)})}}),kt=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||ht(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
2
+ import{t as e}from"./preload-helper-Bo9GmnuQ.js";import{$ as t,A as n,B as r,F as i,G as a,H as o,J as s,K as c,L as l,P as u,Q as d,R as f,St as p,Tt as m,V as h,W as g,Z as _,_t as ee,a as v,bt as te,c as ne,ct as y,et as re,f as ie,ft as ae,g as oe,gt as b,l as se,lt as x,mt as ce,nt as S,o as le,ot as C,pt as ue,q as de,rt as fe,st as pe,t as me,ut as w,v as he,w as ge,wt as _e,xt as ve,z as ye}from"./dist-DWJL3_bF.js";import{i as be,n as xe,r as Se}from"./dist-DIi0uqLJ.js";import{a as Ce,s as we}from"./dist-D5QOYy7y.js";import{t as Te}from"./dist-B4uQVR_X.js";import{a as Ee,c as De,i as Oe,n as ke,o as Ae,r as je,s as Me,t as Ne}from"./dist-BU8uusJX.js";import{d as Pe,i as Fe}from"./file-kind-DBptLlF_.js";import{f as Ie}from"./runtime-config-CqhchMC4.js";import{a as Le,c as T,d as E,f as Re,g as ze,h as Be,i as Ve,l as D,m as O,n as He,o as k,p as A,r as Ue,s as We,t as Ge,u as j}from"./yjs-provider-reset-guard-CtERLBID.js";import{a as Ke,c as qe,d as Je,i as Ye,n as Xe,o as Ze,s as Qe,t as $e,u as et}from"./room-yJaBAoEU.js";function tt({body:e,user:t}){return{body:e,createdAt:Date.now(),id:Ye(`comment`),peerId:t?.peerId??``,reactions:[],userColor:t?.color??``,userName:t?.name??`Anonymous`}}function nt(e,t){return e instanceof k?e.get(t):e?.[t]}function rt(e=[]){return Array.isArray(e)?e.map(e=>({emoji:typeof e?.emoji==`string`?e.emoji:``,users:Array.isArray(e?.users)?e.users.map(e=>({reactedAt:Number.isFinite(e?.reactedAt)?e.reactedAt:Date.now(),userColor:typeof e?.userColor==`string`?e.userColor:``,userId:typeof e?.userId==`string`?e.userId:``,userName:typeof e?.userName==`string`&&e.userName?e.userName:`Anonymous`})).filter(e=>e.userId):[]})).filter(e=>e.emoji&&e.users.length>0):[]}function it(e,t){let n=t?.doc;if(!n)return null;let r=e?.anchor??e,i=r?.anchorKind===`text`?`text`:`line`,a=n.lines,o=Math.min(Math.max(Math.round(r?.startLine??1),1),a),s=Math.min(Math.max(Math.round(r?.endLine??o),o),a),c=n.line(o).from,l=n.line(s).to,u=Math.min(Math.max(Math.round(r?.startIndex??c),0),n.length),d=Math.min(Math.max(Math.round(r?.endIndex??l),u),n.length);return{anchorEndLine:s,anchorKind:i,anchorQuote:qe(r?.anchorQuote||n.sliceString(u,d)),anchorStartLine:o,endIndex:d,startIndex:u}}var at=class{constructor({getDoc:e,getEditorState:t,getLocalUser:n,onCommentsChange:r=null}){this.getDoc=e,this.getEditorState=t,this.getLocalUser=n,this.onCommentsChange=r,this.commentThreads=null,this.ydoc=null,this.ytext=null,this.handleCommentThreadsChange=null,this.handleTextChange=null}bind({commentThreads:e,ydoc:t,ytext:n}){this.unbind(),this.commentThreads=e,this.ydoc=t,this.ytext=n,this.handleCommentThreadsChange=()=>{this.emitCommentsChange()},this.handleTextChange=()=>{this.emitCommentsChange()},this.commentThreads.observeDeep(this.handleCommentThreadsChange),this.ytext?.observe?.(this.handleTextChange),this.emitCommentsChange()}unbind(){this.commentThreads&&this.handleCommentThreadsChange&&this.commentThreads.unobserveDeep(this.handleCommentThreadsChange),this.ytext&&this.handleTextChange&&this.ytext.unobserve(this.handleTextChange),this.commentThreads=null,this.ydoc=null,this.ytext=null,this.handleCommentThreadsChange=null,this.handleTextChange=null}emitCommentsChange(){this.onCommentsChange?.(this.getCommentThreads())}refreshComments(){this.emitCommentsChange()}getCommentThreads(){return this.commentThreads?et(this.commentThreads).map(e=>this.resolveCommentThread(e)).filter(Boolean):[]}createCommentThread({anchor:e,body:t}){let n=this.getEditorState();if(!n||!this.commentThreads||!this.ytext||!this.ydoc)return null;let r=Qe(t),i=it(e,n);if(!r||!i)return null;let a=Ke({anchorEnd:E(j(this.ytext,i.endIndex)),anchorEndLine:i.anchorEndLine,anchorKind:i.anchorKind,anchorQuote:i.anchorQuote,anchorStart:E(j(this.ytext,i.startIndex)),anchorStartLine:i.anchorStartLine,createdAt:Date.now(),createdByColor:this.getLocalUser()?.color??``,createdByName:this.getLocalUser()?.name??`Anonymous`,createdByPeerId:this.getLocalUser()?.peerId??``,id:Ye(`thread`),messages:[tt({body:r,user:this.getLocalUser()})]});return a?(this.ydoc.transact(()=>{this.commentThreads.push([a])},`comment-thread-create`),a.get(`id`)):null}replyToCommentThread(e,t){let n=Qe(t);if(!n||!this.ydoc)return null;let r=this.findSharedCommentThread(e)?.get(`messages`);if(!(r instanceof Le))return null;let i=tt({body:n,user:this.getLocalUser()});return this.ydoc.transact(()=>{r.push([i])},`comment-thread-reply`),i.id}toggleCommentReaction(e,t,n){if(!this.ydoc||!e||!t||typeof n!=`string`||!n.trim())return!1;let r=this.getLocalUser?.(),i=typeof r?.userId==`string`?r.userId:``;if(!i)return!1;let a=this.findSharedCommentThread(e)?.get(`messages`);if(!(a instanceof Le))return!1;let o=a.toArray(),s=o.findIndex(e=>nt(e,`id`)===t);if(s<0)return!1;let c=o[s]instanceof k?o[s].toJSON():{...o[s]},l=rt(c.reactions),u=l.findIndex(e=>e.emoji===n);if(u>=0){let e=l[u].users.filter(e=>e.userId!==i);e.length===l[u].users.length&&e.push({reactedAt:Date.now(),userColor:r?.color??``,userId:i,userName:r?.name??`Anonymous`}),e.length===0?l.splice(u,1):l[u]={...l[u],users:e}}else l.push({emoji:n,users:[{reactedAt:Date.now(),userColor:r?.color??``,userId:i,userName:r?.name??`Anonymous`}]});let d={...c,reactions:l};return this.ydoc.transact(()=>{a.delete(s,1),a.insert(s,[d])},`comment-reaction-toggle`),!0}deleteCommentThread(e){if(!this.commentThreads||!this.ydoc)return!1;let t=this.findSharedCommentThreadIndex(e);return t<0?!1:(this.ydoc.transact(()=>{this.commentThreads.delete(t,1)},`comment-thread-resolve`),!0)}findSharedCommentThread(e){return this.commentThreads?this.commentThreads.toArray().find(t=>t instanceof k&&t.get(`id`)===e)??null:null}findSharedCommentThreadIndex(e){return this.commentThreads?this.commentThreads.toArray().findIndex(t=>t instanceof k&&t.get(`id`)===e):-1}resolveCommentThread(e){let t=this.getEditorState();if(!e||!t||!this.ydoc)return null;let n=Ze(e);if(!n)return null;let r=this.resolveCommentPosition(n.anchorStart),i=this.resolveCommentPosition(n.anchorEnd),a=r?.index??t.doc.line(n.anchorStartLine).from,o=Math.min(Math.max(n.anchorEndLine??n.anchorStartLine,n.anchorStartLine),t.doc.lines),s=i?.index??t.doc.line(o).to,c=t.doc.lineAt(a).number,l=Math.min(Math.max(s,a),t.doc.length),u=t.doc.lineAt(l).number,d=Je(t.doc.sliceString(a,n.anchorKind===`text`?Math.max(s,a):t.doc.line(u).to))||n.anchorQuote;return{...e,anchor:{endIndex:s,endLine:u,excerpt:d,quote:n.anchorQuote,startIndex:a,startLine:c,kind:n.anchorKind},anchorEnd:n.anchorEnd,anchorEndLine:n.anchorEndLine,anchorKind:n.anchorKind,anchorQuote:n.anchorQuote,anchorStart:n.anchorStart,anchorStartLine:n.anchorStartLine}}resolveCommentPosition(e){if(!e||!this.ydoc||!this.ytext)return null;try{let t=T(D(e),this.ydoc);return!t||t.type!==this.ytext?null:t}catch{return null}}},ot=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(e){this.wsBaseUrl=Ie(),this.ydoc=new Ue,this.ytext=this.ydoc.getText(`codemirror`),this.commentThreads=this.ydoc.getArray(`comments`);let t=new Ve(this.ytext),n=new He(this.wsBaseUrl,e,this.ydoc,{disableBc:!0,maxBackoffTime:5e3});Ge(n);let r=n.awareness,i=this.providedLocalUser??$e(this.preferredUserName);this.provider=n,this.awareness=r,this.localUser=i,this.initialSyncComplete=!1,this.initialSyncPromise=new Promise(e=>{this.resolveInitialSync=e}),r.setLocalStateField(`user`,i),r.on(`change`,()=>{this.onAwarenessChange?.(this.collectUsers(this.resolveAwarenessCursor))}),this.trackConnectionStatus();let a=!1;return n.on(`sync`,e=>{!e||a||(a=!0,this.initialSyncComplete=!0,this.resolveInitialSync?.(),this.resolveInitialSync=null,this.onInitialSync?.())}),{awareness:r,commentThreads:this.commentThreads,localUser:this.localUser,undoManager:t,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=Xe(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 M(e){return new le(ne.define(e))}function N(t){return e(()=>import(`./dist-BtnXjRx0.js`).then(e=>e.sql({dialect:e[t]})),__vite__mapDeps([0,1,2,3]),import.meta.url)}var st=[v.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return e(()=>import(`./dist-Dyt7n5Ui.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]),import.meta.url)}}),v.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return e(()=>import(`./dist-Dyt7n5Ui.js`).then(e=>e.cpp()),__vite__mapDeps([4,2,3]),import.meta.url)}}),v.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return N(`Cassandra`)}}),v.of({name:`CSS`,extensions:[`css`],load(){return e(()=>import(`./dist-DJ16N7ol.js`).then(e=>e.css()),__vite__mapDeps([5,6,2,3]),import.meta.url)}}),v.of({name:`Go`,extensions:[`go`],load(){return e(()=>import(`./dist-CjII8VDS.js`).then(e=>e.go()),__vite__mapDeps([7,1,2,3]),import.meta.url)}}),v.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return e(()=>import(`./dist-BVB8rn7o.js`).then(e=>e.html()),__vite__mapDeps([8,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`Java`,extensions:[`java`],load(){return e(()=>import(`./dist-BzpfHRaE.js`).then(e=>e.java()),__vite__mapDeps([11,2,3]),import.meta.url)}}),v.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript()),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return e(()=>import(`./dist-k47-Io7D.js`).then(e=>e.jinja()),__vite__mapDeps([13,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return e(()=>import(`./dist-CXpKYW9s.js`).then(e=>e.json()),__vite__mapDeps([14,2,3]),import.meta.url)}}),v.of({name:`JSX`,extensions:[`jsx`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`LESS`,extensions:[`less`],load(){return e(()=>import(`./dist-Bc2ND6i3.js`).then(e=>e.less()),__vite__mapDeps([15,6,2,3]),import.meta.url)}}),v.of({name:`Liquid`,extensions:[`liquid`],load(){return e(()=>import(`./dist-CL-jjdvG.js`).then(e=>e.liquid()),__vite__mapDeps([16,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`MariaDB SQL`,load(){return N(`MariaSQL`)}}),v.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return e(()=>import(`./dist-3bQB_we3.js`).then(e=>e.markdown()),__vite__mapDeps([17,18,1,2,9,6,3,10]),import.meta.url)}}),v.of({name:`MS SQL`,load(){return N(`MSSQL`)}}),v.of({name:`MySQL`,load(){return N(`MySQL`)}}),v.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return e(()=>import(`./dist-DUvaQ-Bj.js`).then(e=>e.php()),__vite__mapDeps([19,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`PLSQL`,extensions:[`pls`],load(){return N(`PLSQL`)}}),v.of({name:`PostgreSQL`,load(){return N(`PostgreSQL`)}}),v.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return e(()=>import(`./dist-CGV1S_as.js`).then(e=>e.python()),__vite__mapDeps([20,1,2,3]),import.meta.url)}}),v.of({name:`Rust`,extensions:[`rs`],load(){return e(()=>import(`./dist-lDhnP-K1.js`).then(e=>e.rust()),__vite__mapDeps([21,2,3]),import.meta.url)}}),v.of({name:`Sass`,extensions:[`sass`],load(){return e(()=>import(`./dist-BLAlZer_.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([22,6,2,3]),import.meta.url)}}),v.of({name:`SCSS`,extensions:[`scss`],load(){return e(()=>import(`./dist-BLAlZer_.js`).then(e=>e.sass()),__vite__mapDeps([22,6,2,3]),import.meta.url)}}),v.of({name:`SQL`,extensions:[`sql`],load(){return N(`StandardSQL`)}}),v.of({name:`SQLite`,load(){return N(`SQLite`)}}),v.of({name:`TSX`,extensions:[`tsx`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return e(()=>import(`./dist-OQE68wIX.js`).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([12,10,1,2,3]),import.meta.url)}}),v.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return e(()=>import(`./dist-rMhng5DK.js`).then(e=>e.wast()),__vite__mapDeps([23,2,3]),import.meta.url)}}),v.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return e(()=>import(`./dist-BzbYwa8m.js`).then(e=>e.xml()),__vite__mapDeps([24,2,3]),import.meta.url)}}),v.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return e(()=>import(`./dist-8Igu3Ee_2.js`).then(e=>e.yaml()),__vite__mapDeps([25,26,2,3]),import.meta.url)}}),v.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return e(()=>import(`./apl-C1JYSI8J.js`).then(e=>M(e.apl)),[],import.meta.url)}}),v.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return e(()=>import(`./asciiarmor-DHW75j1s.js`).then(e=>M(e.asciiArmor)),[],import.meta.url)}}),v.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return e(()=>import(`./asn1-CQiG40kG.js`).then(e=>M(e.asn1({}))),[],import.meta.url)}}),v.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return e(()=>import(`./asterisk-BWExh0n4.js`).then(e=>M(e.asterisk)),[],import.meta.url)}}),v.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return e(()=>import(`./brainfuck-CTNFyOLg.js`).then(e=>M(e.brainfuck)),[],import.meta.url)}}),v.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return e(()=>import(`./cobol-DP4QggbL.js`).then(e=>M(e.cobol)),[],import.meta.url)}}),v.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.csharp)),[],import.meta.url)}}),v.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`ClojureScript`,extensions:[`cljs`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return e(()=>import(`./css-CmhPNxBE.js`).then(e=>M(e.gss)),[],import.meta.url)}}),v.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return e(()=>import(`./cmake-DtGL-Unu.js`).then(e=>M(e.cmake)),[],import.meta.url)}}),v.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return e(()=>import(`./coffeescript-B_7eyHAa.js`).then(e=>M(e.coffeeScript)),[],import.meta.url)}}),v.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return e(()=>import(`./commonlisp-COlJYiQT.js`).then(e=>M(e.commonLisp)),[],import.meta.url)}}),v.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return e(()=>import(`./cypher-DE6I2lIA.js`).then(e=>M(e.cypher)),[],import.meta.url)}}),v.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return e(()=>import(`./python-CZtTmYkS.js`).then(e=>M(e.cython)),[],import.meta.url)}}),v.of({name:`Crystal`,extensions:[`cr`],load(){return e(()=>import(`./crystal-I_dE9xG-.js`).then(e=>M(e.crystal)),[],import.meta.url)}}),v.of({name:`D`,extensions:[`d`],load(){return e(()=>import(`./d-BNkKjn0o.js`).then(e=>M(e.d)),[],import.meta.url)}}),v.of({name:`Dart`,extensions:[`dart`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.dart)),[],import.meta.url)}}),v.of({name:`diff`,extensions:[`diff`,`patch`],load(){return e(()=>import(`./diff-BWuPUsEo.js`).then(e=>M(e.diff)),[],import.meta.url)}}),v.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return e(()=>import(`./dockerfile-D8_6_FRV.js`).then(e=>M(e.dockerFile)),__vite__mapDeps([27,28]),import.meta.url)}}),v.of({name:`DTD`,extensions:[`dtd`],load(){return e(()=>import(`./dtd-C6brJFPg.js`).then(e=>M(e.dtd)),[],import.meta.url)}}),v.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return e(()=>import(`./dylan-Bft86ZSB.js`).then(e=>M(e.dylan)),[],import.meta.url)}}),v.of({name:`EBNF`,load(){return e(()=>import(`./ebnf-D6ifG44A.js`).then(e=>M(e.ebnf)),[],import.meta.url)}}),v.of({name:`ECL`,extensions:[`ecl`],load(){return e(()=>import(`./ecl-M7Iek4lq.js`).then(e=>M(e.ecl)),[],import.meta.url)}}),v.of({name:`edn`,extensions:[`edn`],load(){return e(()=>import(`./clojure-D-DYVqu7.js`).then(e=>M(e.clojure)),[],import.meta.url)}}),v.of({name:`Eiffel`,extensions:[`e`],load(){return e(()=>import(`./eiffel-DwxtewZF.js`).then(e=>M(e.eiffel)),[],import.meta.url)}}),v.of({name:`Elm`,extensions:[`elm`],load(){return e(()=>import(`./elm-B1TncobV.js`).then(e=>M(e.elm)),[],import.meta.url)}}),v.of({name:`Erlang`,extensions:[`erl`],load(){return e(()=>import(`./erlang-BDJZNtt8.js`).then(e=>M(e.erlang)),[],import.meta.url)}}),v.of({name:`Esper`,load(){return e(()=>import(`./sql-DDFeQNTK.js`).then(e=>M(e.esper)),[],import.meta.url)}}),v.of({name:`Factor`,extensions:[`factor`],load(){return e(()=>import(`./factor-Cz-hzBGH.js`).then(e=>M(e.factor)),__vite__mapDeps([29,28]),import.meta.url)}}),v.of({name:`FCL`,load(){return e(()=>import(`./fcl-BWKK0S4-.js`).then(e=>M(e.fcl)),[],import.meta.url)}}),v.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return e(()=>import(`./forth-nvhcMz63.js`).then(e=>M(e.forth)),[],import.meta.url)}}),v.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return e(()=>import(`./fortran-BZID-z10.js`).then(e=>M(e.fortran)),[],import.meta.url)}}),v.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.fSharp)),[],import.meta.url)}}),v.of({name:`Gas`,extensions:[`s`],load(){return e(()=>import(`./gas-DjQsZDGE.js`).then(e=>M(e.gas)),[],import.meta.url)}}),v.of({name:`Gherkin`,extensions:[`feature`],load(){return e(()=>import(`./gherkin-S0kHlzux.js`).then(e=>M(e.gherkin)),[],import.meta.url)}}),v.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return e(()=>import(`./groovy-BEKazBrO.js`).then(e=>M(e.groovy)),[],import.meta.url)}}),v.of({name:`Haskell`,extensions:[`hs`],load(){return e(()=>import(`./haskell-C6qH3-aI.js`).then(e=>M(e.haskell)),[],import.meta.url)}}),v.of({name:`Haxe`,extensions:[`hx`],load(){return e(()=>import(`./haxe-BY9d_5nB.js`).then(e=>M(e.haxe)),[],import.meta.url)}}),v.of({name:`HXML`,extensions:[`hxml`],load(){return e(()=>import(`./haxe-BY9d_5nB.js`).then(e=>M(e.hxml)),[],import.meta.url)}}),v.of({name:`HTTP`,load(){return e(()=>import(`./http-DG1Y9fpK.js`).then(e=>M(e.http)),[],import.meta.url)}}),v.of({name:`IDL`,extensions:[`pro`],load(){return e(()=>import(`./idl-B64p3NTJ.js`).then(e=>M(e.idl)),[],import.meta.url)}}),v.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return e(()=>import(`./javascript-UJe68_xi.js`).then(e=>M(e.jsonld)),__vite__mapDeps([30,31]),import.meta.url)}}),v.of({name:`Julia`,extensions:[`jl`],load(){return e(()=>import(`./julia-B22G9Bym.js`).then(e=>M(e.julia)),[],import.meta.url)}}),v.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.kotlin)),[],import.meta.url)}}),v.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return e(()=>import(`./livescript-CkcuHqeS.js`).then(e=>M(e.liveScript)),[],import.meta.url)}}),v.of({name:`Lua`,extensions:[`lua`],load(){return e(()=>import(`./lua-kutgyRGY.js`).then(e=>M(e.lua)),[],import.meta.url)}}),v.of({name:`mIRC`,extensions:[`mrc`],load(){return e(()=>import(`./mirc-BVG2S5rO.js`).then(e=>M(e.mirc)),[],import.meta.url)}}),v.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return e(()=>import(`./mathematica-CKVhKnoY.js`).then(e=>M(e.mathematica)),[],import.meta.url)}}),v.of({name:`Modelica`,extensions:[`mo`],load(){return e(()=>import(`./modelica-vJ-Qa9jV.js`).then(e=>M(e.modelica)),[],import.meta.url)}}),v.of({name:`MUMPS`,extensions:[`mps`],load(){return e(()=>import(`./mumps-D0KfUTSd.js`).then(e=>M(e.mumps)),[],import.meta.url)}}),v.of({name:`Mbox`,extensions:[`mbox`],load(){return e(()=>import(`./mbox-DANyzFJ2.js`).then(e=>M(e.mbox)),[],import.meta.url)}}),v.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return e(()=>import(`./nginx-DkVceJrH.js`).then(e=>M(e.nginx)),[],import.meta.url)}}),v.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return e(()=>import(`./nsis-QPGhLAeY.js`).then(e=>M(e.nsis)),__vite__mapDeps([32,28]),import.meta.url)}}),v.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return e(()=>import(`./ntriples-BBuCIfS0.js`).then(e=>M(e.ntriples)),[],import.meta.url)}}),v.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.objectiveC)),[],import.meta.url)}}),v.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.objectiveCpp)),[],import.meta.url)}}),v.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.oCaml)),[],import.meta.url)}}),v.of({name:`Octave`,extensions:[`m`],load(){return e(()=>import(`./octave-BTv2CqSQ.js`).then(e=>M(e.octave)),[],import.meta.url)}}),v.of({name:`Oz`,extensions:[`oz`],load(){return e(()=>import(`./oz-D8SjVDNU.js`).then(e=>M(e.oz)),[],import.meta.url)}}),v.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return e(()=>import(`./pascal-T-tfhVyx.js`).then(e=>M(e.pascal)),[],import.meta.url)}}),v.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return e(()=>import(`./perl-BDrCkHRd.js`).then(e=>M(e.perl)),[],import.meta.url)}}),v.of({name:`Pig`,extensions:[`pig`],load(){return e(()=>import(`./pig-BEyI4fPq.js`).then(e=>M(e.pig)),[],import.meta.url)}}),v.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return e(()=>import(`./powershell-DtnFc6GG.js`).then(e=>M(e.powerShell)),[],import.meta.url)}}),v.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return e(()=>import(`./properties-DWUvbxV9.js`).then(e=>M(e.properties)),[],import.meta.url)}}),v.of({name:`ProtoBuf`,extensions:[`proto`],load(){return e(()=>import(`./protobuf-CQGoYyfE.js`).then(e=>M(e.protobuf)),[],import.meta.url)}}),v.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return e(()=>import(`./pug-DkUcLYWt.js`).then(e=>M(e.pug)),__vite__mapDeps([33,31]),import.meta.url)}}),v.of({name:`Puppet`,extensions:[`pp`],load(){return e(()=>import(`./puppet-Dd-qWO3p.js`).then(e=>M(e.puppet)),[],import.meta.url)}}),v.of({name:`Q`,extensions:[`q`],load(){return e(()=>import(`./q-I27iQntV.js`).then(e=>M(e.q)),[],import.meta.url)}}),v.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return e(()=>import(`./r-DN_EydfL.js`).then(e=>M(e.r)),[],import.meta.url)}}),v.of({name:`RPM Changes`,load(){return e(()=>import(`./rpm-CjWxLM68.js`).then(e=>M(e.rpmChanges)),[],import.meta.url)}}),v.of({name:`RPM Spec`,extensions:[`spec`],load(){return e(()=>import(`./rpm-CjWxLM68.js`).then(e=>M(e.rpmSpec)),[],import.meta.url)}}),v.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return e(()=>import(`./ruby-CB34f2Gf.js`).then(e=>M(e.ruby)),[],import.meta.url)}}),v.of({name:`SAS`,extensions:[`sas`],load(){return e(()=>import(`./sas-Bji4HDQq.js`).then(e=>M(e.sas)),[],import.meta.url)}}),v.of({name:`Scala`,extensions:[`scala`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.scala)),[],import.meta.url)}}),v.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return e(()=>import(`./scheme-C3elI80V.js`).then(e=>M(e.scheme)),[],import.meta.url)}}),v.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return e(()=>import(`./shell-DUveK2Hb.js`).then(e=>M(e.shell)),[],import.meta.url)}}),v.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return e(()=>import(`./sieve-2ogwMVx4.js`).then(e=>M(e.sieve)),[],import.meta.url)}}),v.of({name:`Smalltalk`,extensions:[`st`],load(){return e(()=>import(`./smalltalk-BuGhc6lW.js`).then(e=>M(e.smalltalk)),[],import.meta.url)}}),v.of({name:`Solr`,load(){return e(()=>import(`./solr-DTxshpm8.js`).then(e=>M(e.solr)),[],import.meta.url)}}),v.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return e(()=>import(`./mllike-C0p7lv48.js`).then(e=>M(e.sml)),[],import.meta.url)}}),v.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return e(()=>import(`./sparql-BOvq0dv7.js`).then(e=>M(e.sparql)),[],import.meta.url)}}),v.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return e(()=>import(`./spreadsheet-C6Vbtl9-.js`).then(e=>M(e.spreadsheet)),[],import.meta.url)}}),v.of({name:`Squirrel`,extensions:[`nut`],load(){return e(()=>import(`./clike-1_ZsiVV8.js`).then(e=>M(e.squirrel)),[],import.meta.url)}}),v.of({name:`Stylus`,extensions:[`styl`],load(){return e(()=>import(`./stylus-D1SZIMDs.js`).then(e=>M(e.stylus)),[],import.meta.url)}}),v.of({name:`Swift`,extensions:[`swift`],load(){return e(()=>import(`./swift-BCxe4-cw.js`).then(e=>M(e.swift)),[],import.meta.url)}}),v.of({name:`sTeX`,load(){return e(()=>import(`./stex-CEwW0Q_0.js`).then(e=>M(e.stex)),[],import.meta.url)}}),v.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return e(()=>import(`./stex-CEwW0Q_0.js`).then(e=>M(e.stex)),[],import.meta.url)}}),v.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return e(()=>import(`./verilog-C4wTycyo.js`).then(e=>M(e.verilog)),[],import.meta.url)}}),v.of({name:`Tcl`,extensions:[`tcl`],load(){return e(()=>import(`./tcl-SPk7uiDB.js`).then(e=>M(e.tcl)),[],import.meta.url)}}),v.of({name:`Textile`,extensions:[`textile`],load(){return e(()=>import(`./textile-C48beRus.js`).then(e=>M(e.textile)),[],import.meta.url)}}),v.of({name:`TiddlyWiki`,load(){return e(()=>import(`./tiddlywiki-CiImjFLN.js`).then(e=>M(e.tiddlyWiki)),[],import.meta.url)}}),v.of({name:`Tiki wiki`,load(){return e(()=>import(`./tiki-HkXZ4BIW.js`).then(e=>M(e.tiki)),[],import.meta.url)}}),v.of({name:`TOML`,extensions:[`toml`],load(){return e(()=>import(`./toml-BmfpMy1_.js`).then(e=>M(e.toml)),[],import.meta.url)}}),v.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return e(()=>import(`./troff-BjbEOT5E.js`).then(e=>M(e.troff)),[],import.meta.url)}}),v.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return e(()=>import(`./ttcn-NA-V4KnY.js`).then(e=>M(e.ttcn)),[],import.meta.url)}}),v.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return e(()=>import(`./ttcn-cfg-TPHncdGN.js`).then(e=>M(e.ttcnCfg)),[],import.meta.url)}}),v.of({name:`Turtle`,extensions:[`ttl`],load(){return e(()=>import(`./turtle-GBz_E4RG.js`).then(e=>M(e.turtle)),[],import.meta.url)}}),v.of({name:`Web IDL`,extensions:[`webidl`],load(){return e(()=>import(`./webidl-DttrYZRT.js`).then(e=>M(e.webIDL)),[],import.meta.url)}}),v.of({name:`VB.NET`,extensions:[`vb`],load(){return e(()=>import(`./vb-C19AQWqO.js`).then(e=>M(e.vb)),[],import.meta.url)}}),v.of({name:`VBScript`,extensions:[`vbs`],load(){return e(()=>import(`./vbscript-CHJk3s95.js`).then(e=>M(e.vbScript)),[],import.meta.url)}}),v.of({name:`Velocity`,extensions:[`vtl`],load(){return e(()=>import(`./velocity-Ya0P4sQU.js`).then(e=>M(e.velocity)),[],import.meta.url)}}),v.of({name:`Verilog`,extensions:[`v`],load(){return e(()=>import(`./verilog-C4wTycyo.js`).then(e=>M(e.verilog)),[],import.meta.url)}}),v.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return e(()=>import(`./vhdl-Bwndeg44.js`).then(e=>M(e.vhdl)),[],import.meta.url)}}),v.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return e(()=>import(`./xquery-CEDTd8qs.js`).then(e=>M(e.xQuery)),[],import.meta.url)}}),v.of({name:`Yacas`,extensions:[`ys`],load(){return e(()=>import(`./yacas-C7dxlPB0.js`).then(e=>M(e.yacas)),[],import.meta.url)}}),v.of({name:`Z80`,extensions:[`z80`],load(){return e(()=>import(`./z80-BqEfFSnA.js`).then(e=>M(e.z80)),[],import.meta.url)}}),v.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.mscgen)),[],import.meta.url)}}),v.of({name:`Xù`,extensions:[`xu`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.xu)),[],import.meta.url)}}),v.of({name:`MsGenny`,extensions:[`msgenny`],load(){return e(()=>import(`./mscgen-vUD-SWGJ.js`).then(e=>M(e.msgenny)),[],import.meta.url)}}),v.of({name:`Vue`,extensions:[`vue`],load(){return e(()=>import(`./dist-3uAMa5w5.js`).then(e=>e.vue()),__vite__mapDeps([34,9,6,2,3,10,1]),import.meta.url)}}),v.of({name:`Angular Template`,load(){return e(()=>import(`./dist-DsL7sqZR.js`).then(e=>e.angular()),__vite__mapDeps([35,9,6,2,3,10,1]),import.meta.url)}})],ct=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,P=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(ct(e)):ct,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=m(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ve(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(P.prototype[Symbol.iterator]=function(){return this});var lt={from:-1,to:-1,match:/.*/.exec(``)},ut=`gm`+(/x/.unicode==null?``:`u`),dt=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=lt,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new mt(e,t,n,r,i);this.re=new RegExp(t,ut+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=F(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=F(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},ft=new WeakMap,pt=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=ft.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return ft.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),ft.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},mt=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=lt,this.matchPos=F(e,r),this.re=new RegExp(t,ut+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=pt.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=F(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(dt.prototype[Symbol.iterator]=mt.prototype[Symbol.iterator]=function(){return this});function ht(e){try{return new RegExp(e,ut),!0}catch{return!1}}function F(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var gt=e=>{let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=t(e,{label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,u]=r,d=c?+c.slice(1):0,f=s?+s:a.number;if(s&&u){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),f=Math.round(n.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=n.doc.line(Math.max(1,Math.min(n.doc.lines,f))),m=y.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[i,l.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},_t={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},vt=w.define({combine(e){return p(e,_t,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function yt(e){let t=[Tt,wt];return e&&t.push(vt.of(e)),t}var bt=i.mark({class:`cm-selectionMatch`}),xt=i.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function St(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=C.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=C.Word)}function Ct(e,t,n,r){return e(t.sliceDoc(n,n+1))==C.Word&&e(t.sliceDoc(r-1,r))==C.Word}var wt=f.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(vt),{state:n}=e,r=n.selection;if(r.ranges.length>1)return i.none;let a=r.main,o,s=null;if(a.empty){if(!t.highlightWordAroundCursor)return i.none;let e=n.wordAt(a.head);if(!e)return i.none;s=n.charCategorizer(a.head),o=n.sliceDoc(e.from,e.to)}else{let e=a.to-a.from;if(e<t.minSelectionLength||e>200)return i.none;if(t.wholeWords){if(o=n.sliceDoc(a.from,a.to),s=n.charCategorizer(a.head),!(St(s,n,a.from,a.to)&&Ct(s,n,a.from,a.to)))return i.none}else if(o=n.sliceDoc(a.from,a.to),!o)return i.none}let c=[];for(let r of e.visibleRanges){let e=new P(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!s||St(s,n,r,o))&&(a.empty&&r<=a.from&&o>=a.to?c.push(xt.range(r,o)):(r>=a.to||o<=a.from)&&c.push(bt.range(r,o)),c.length>t.maxMatches))return i.none}}return i.set(c)}},{decorations:e=>e.decorations}),Tt=l.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Et=({state:e,dispatch:t})=>{let{selection:n}=e,r=y.create(n.ranges.map(t=>e.wordAt(t.head)||y.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Dt(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new P(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new P(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Ot=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Et({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Dt(e,r);return i?(t(e.update({selection:e.selection.addRange(y.range(i.from,i.to),!1),effects:l.scrollIntoView(i.to)})),!0):!1},I=w.define({combine(e){return p(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new $t(e),scrollToMatch:e=>l.scrollIntoView(e)})}}),kt=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||ht(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
3
3
  `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new It(this):new Nt(this)}getCursor(e,t=0,n){let r=e.doc?e:x.create({doc:e});return n??=r.doc.length,this.regexp?R(this,r,t,n):L(this,r,t,n)}},At=class{constructor(e){this.spec=e}};function jt(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function L(e,t,n,r){let i;return e.wholeWord&&(i=Mt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=jt(e.test,t,i)),new P(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Mt(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(z(i,n-a))!=C.Word||t(B(i,n-a))!=C.Word)&&(t(B(i,r-a))!=C.Word||t(z(i,r-a))!=C.Word))}var Nt=class extends At{constructor(e){super(e)}nextMatch(e,t,n){let r=L(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=L(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=L(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=L(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=L(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function Pt(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function R(e,t,n,r){let i;return e.wholeWord&&(i=Ft(t.charCategorizer(t.selection.main.head))),e.test&&(i=Pt(e.test,t,i)),new dt(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function z(e,t){return e.slice(_e(e,t,!1),t)}function B(e,t){return e.slice(t,_e(e,t))}function Ft(e){return(t,n,r)=>!r[0].length||(e(z(r.input,r.index))!=C.Word||e(B(r.input,r.index))!=C.Word)&&(e(B(r.input,r.index+r[0].length))!=C.Word||e(z(r.input,r.index+r[0].length))!=C.Word)}var It=class extends At{nextMatch(e,t,n){let r=R(this.spec,e,n,e.doc.length).next();return r.done&&(r=R(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=R(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=R(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=R(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},V=b.define(),Lt=b.define(),H=ee.define({create(e){return new Rt(qt(e).create(),null)},update(e,t){for(let n of t.effects)n.is(V)?e=new Rt(n.value.create(),e.panel):n.is(Lt)&&(e=new Rt(e.query,n.value?Kt:null));return e},provide:e=>re.from(e,e=>e.panel)}),Rt=class{constructor(e,t){this.query=e,this.panel=t}},zt=i.mark({class:`cm-searchMatch`}),Bt=i.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Vt=f.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(H))}update(e){let t=e.state.field(H);(t!=e.startState.field(H)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return i.none;let{view:n}=this,r=new ce;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Bt:zt)})}return r.finish()}},{decorations:e=>e.decorations});function U(e){return t=>{let n=t.state.field(H,!1);return n&&n.query.spec.valid?e(t,n):Xt(t)}}var W=U((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=y.single(r.from,r.to),a=e.state.facet(I);return e.dispatch({selection:i,effects:[en(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),Yt(e),!0}),G=U((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=y.single(i.from,i.to),o=e.state.facet(I);return e.dispatch({selection:a,effects:[en(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),Yt(e),!0}),Ht=U((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:y.create(n.map(e=>y.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),Ut=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new P(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(y.range(t.value.from,t.value.to))}return t(e.update({selection:y.create(a,o),userEvent:`select.search.matches`})),!0},Wt=U((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,u,d=[];o.from==r&&o.to==i&&(u=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(l.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let f=e.state.changes(s);return o&&(c=y.single(o.from,o.to).map(f),d.push(en(e,o)),d.push(n.facet(I).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:`input.replace`}),!0}),Gt=U((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:l.announce.of(r),userEvent:`input.replace.all`}),!0});function Kt(e){return e.state.facet(I).createPanel(e)}function qt(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(I);return new kt({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function Jt(e){let t=o(e,Kt);return t&&t.dom.querySelector(`[main-field]`)}function Yt(e){let t=Jt(e);t&&t==e.root.activeElement&&t.select()}var Xt=e=>{let t=e.state.field(H,!1);if(t&&t.panel){let n=Jt(e);if(n&&n!=e.root.activeElement){let r=qt(e.state,t.query.spec);r.valid&&e.dispatch({effects:V.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Lt.of(!0),t?V.of(qt(e.state,t.query.spec)):b.appendConfig.of(nn)]});return!0},Zt=e=>{let t=e.state.field(H,!1);if(!t||!t.panel)return!1;let n=o(e,Kt);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Lt.of(!1)}),!0},Qt=[{key:`Mod-f`,run:Xt,scope:`editor search-panel`},{key:`F3`,run:W,shift:G,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:W,shift:G,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:Zt,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:Ut},{key:`Mod-Alt-g`,run:gt},{key:`Mod-d`,run:Ot,preventDefault:!0}],$t=class{constructor(e){this.view=e;let t=this.query=e.state.field(H).query.spec;this.commit=this.commit.bind(this),this.searchField=S(`input`,{value:t.search,placeholder:K(e,`Find`),"aria-label":K(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=S(`input`,{value:t.replace,placeholder:K(e,`Replace`),"aria-label":K(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=S(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=S(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=S(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return S(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=S(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>W(e),[K(e,`next`)]),n(`prev`,()=>G(e),[K(e,`previous`)]),n(`select`,()=>Ht(e),[K(e,`all`)]),S(`label`,null,[this.caseField,K(e,`match case`)]),S(`label`,null,[this.reField,K(e,`regexp`)]),S(`label`,null,[this.wordField,K(e,`by word`)]),...e.state.readOnly?[]:[S(`br`),this.replaceField,n(`replace`,()=>Wt(e),[K(e,`replace`)]),n(`replaceAll`,()=>Gt(e),[K(e,`replace all`)])],S(`button`,{name:`close`,onclick:()=>Zt(e),"aria-label":K(e,`close`),type:`button`},[`×`])])}commit(){let e=new kt({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:V.of(e)}))}keydown(e){d(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?G:W)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Wt(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(V)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(I).top}};function K(e,t){return e.state.phrase(t)}var q=30,J=/[\s\.,:;?!]/;function en(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-q),o=Math.min(i,n+q),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<q;e++)if(!J.test(s[e+1])&&J.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-q;e--)if(!J.test(s[e-1])&&J.test(s[e])){s=s.slice(0,e);break}}return l.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var tn=l.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),nn=[H,ae.low(Vt),tn],rn=`#e5c07b`,an=`#e06c75`,on=`#56b6c2`,sn=`#ffffff`,Y=`#abb2bf`,cn=`#7d8799`,ln=`#61afef`,un=`#98c379`,dn=`#d19a66`,fn=`#c678dd`,pn=`#21252b`,mn=`#2c313a`,hn=`#282c34`,gn=`#353a42`,_n=`#3E4451`,vn=`#528bff`,yn=[l.theme({"&":{color:Y,backgroundColor:hn},".cm-content":{caretColor:vn},".cm-cursor, .cm-dropCursor":{borderLeftColor:vn},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:_n},".cm-panels":{backgroundColor:pn,color:Y},".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:hn,color:cn,border:`none`},".cm-activeLineGutter":{backgroundColor:mn},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:gn},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:gn,borderBottomColor:gn},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:mn,color:Y}}},{dark:!0}),n(me.define([{tag:u.keyword,color:fn},{tag:[u.name,u.deleted,u.character,u.propertyName,u.macroName],color:an},{tag:[u.function(u.variableName),u.labelName],color:ln},{tag:[u.color,u.constant(u.name),u.standard(u.name)],color:dn},{tag:[u.definition(u.name),u.separator],color:Y},{tag:[u.typeName,u.className,u.number,u.changed,u.annotation,u.modifier,u.self,u.namespace],color:rn},{tag:[u.operator,u.operatorKeyword,u.url,u.escape,u.regexp,u.link,u.special(u.string)],color:on},{tag:[u.meta,u.comment],color:cn},{tag:u.strong,fontWeight:`bold`},{tag:u.emphasis,fontStyle:`italic`},{tag:u.strikethrough,textDecoration:`line-through`},{tag:u.link,color:cn,textDecoration:`underline`},{tag:u.heading,fontWeight:`bold`,color:an},{tag:[u.atom,u.bool,u.special(u.variableName)],color:dn},{tag:[u.processingInstruction,u.string,u.inserted],color:un},{tag:u.invalid,color:sn}]))],bn=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:E(this.yanchor),yhead:E(this.yhead)}}static fromJSON(t){return new e(D(t.yanchor),D(t.yhead))}},xn=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new Ve(e)}toYPos(e,t=0){return j(this.ytext,e,t)}fromYPos(e){let t=T(D(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 bn(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?y.cursor(n.pos,n.assoc):y.range(t.pos,n.pos)}},X=w.define({combine(e){return e[e.length-1]}}),Sn=fe.define(),Cn=class{constructor(e){this.view=e,this.conf=e.state.facet(X),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:[Sn.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(Sn)===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,`
4
4
  `);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)}},wn=f.fromClass(Cn),Tn=l.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`}}),En=fe.define(),Dn=class extends ye{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return Re(`span`,[O(`class`,`cm-ySelectionCaret`),O(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[A(`⁠`),Re(`div`,[O(`class`,`cm-ySelectionCaretDot`)]),A(`⁠`),Re(`div`,[O(`class`,`cm-ySelectionInfo`)],[A(this.name)]),A(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},On=class{constructor(e){this.conf=e.state.facet(X),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:[En.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=ue.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,n=t.doc,r=this.conf.awareness,a=[],o=this.conf.awareness.getLocalState();if(o!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=n?e.state.selection.main:null,a=o.cursor==null?null:D(o.cursor.anchor),s=o.cursor==null?null:D(o.cursor.head);if(i!=null){let e=j(t,i.anchor),n=j(t,i.head);(o.cursor==null||!We(a,e)||!We(s,n))&&r.setLocalStateField(`cursor`,{anchor:e,head:n})}else o.cursor!=null&&n&&r.setLocalStateField(`cursor`,null)}r.getStates().forEach((o,s)=>{if(s===r.doc.clientID)return;let c=o.cursor;if(c==null||c.anchor==null||c.head==null)return;let l=T(c.anchor,n),u=T(c.head,n);if(l==null||u==null||l.type!==t||u.type!==t)return;let{color:d=`#30bced`,name:f=`Anonymous`}=o.user||{},p=o.user&&o.user.colorLight||d+`33`,m=ze(l.index,u.index),h=Be(l.index,u.index),g=e.view.state.doc.lineAt(m),_=e.view.state.doc.lineAt(h);if(g.number===_.number)a.push({from:m,to:h,value:i.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})});else{a.push({from:m,to:g.from+g.length,value:i.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})}),a.push({from:_.from,to:h,value:i.mark({attributes:{style:`background-color: ${p}`},class:`cm-ySelection`})});for(let t=g.number+1;t<_.number;t++){let n=e.view.state.doc.line(t).from;a.push({from:n,to:n,value:i.line({attributes:{style:`background-color: ${p}`,class:`cm-yLineSelection`}})})}}a.push({from:u.index,to:u.index,value:i.widget({side:u.index-l.index>0?-1:1,block:!1,widget:new Dn(d,f)})})}),this.decorations=i.set(a,!0)}},kn=f.fromClass(On,{decorations:e=>e.decorations}),An=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},jn=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}},Mn=w.define({combine(e){return e[e.length-1]}});fe.define();var Nn=class{constructor(e){this.view=e,this.conf=e.state.facet(Mn),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(X),this._beforeChangeSelection=null,this._mux=An(),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:[l.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(Sn)!==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)}},Pn=f.fromClass(Nn),Fn=({state:e,dispatch:t})=>e.facet(Mn).undo()||!0,In=({state:e,dispatch:t})=>e.facet(Mn).redo()||!0,Ln=(e,t,{undoManager:n=new Ve(e)}={})=>{let r=new xn(e,t),i=[X.of(r),wn];return t&&i.push(Tn,kn),n!==!1&&i.push(Mn.of(new jn(n)),Pn,l.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?Fn(t):e.inputType===`historyRedo`?In(t):!1}})),i},Rn=Object.freeze({bold:`bold text`,code:`code`,italic:`emphasis`,strikethrough:`struck text`}),zn=`link text`,Bn=`https://`,Vn=`alt text`,Hn=`https://`,Un=`Video`,Wn=`https://`,Gn=`code`,Kn=Object.freeze([`Column 1`,`Column 2`]),qn=`Value`,Z=Object.freeze({heading:/^#{1,6}\s+/,quote:/^>\s+/,bulletList:/^[-*+]\s+/,numberedList:/^\d+\.\s+/,taskList:/^-\s\[(?: |x|X)\]\s+/});function Jn(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 Yn(e,t){return t===0||e[t-1]===`
5
5
  `}function Xn(e,t){if(t<=0)return 0;let n=e.lastIndexOf(`
@@ -13,4 +13,4 @@ import{t as e}from"./preload-helper-Bo9GmnuQ.js";import{$ as t,A as n,B as r,F a
13
13
  `,s=a?`
14
14
  `:``,c=`${s}${n}${o?`
15
15
  `:``}`,l=t.from+s.length+r;return{anchor:l,from:t.from,head:l+i,insert:c,to:t.to}}function hr(e=``){let t=e.trim()||qn;return[`| ${Kn.join(` | `)} |`,`| --- | --- |`,`| ${t} | ${qn} |`].join(`
16
- `)}function gr(e,t){return mr(e,t,hr(e.slice(t.from,t.to)),2,Kn[0].length)}function _r(e,t){return mr(e,t,`---`,4,0)}function vr(e,t,n){let r=String(e??``),i=Jn(t,r.length),a;switch(n){case`bold`:a=$n(r,i,`**`,Rn.bold);break;case`italic`:a=$n(r,i,`_`,Rn.italic);break;case`strikethrough`:a=$n(r,i,`~~`,Rn.strikethrough);break;case`code`:a=$n(r,i,"`",Rn.code);break;case`link`:a=tr(r,i);break;case`image`:a=nr(r,i);break;case`video`:a=rr(r,i);break;case`paragraph`:a=dr(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=cr(r,i);break;case`bullet-list`:a=sr(r,i);break;case`numbered-list`:a=ur(r,i);break;case`task-list`:a=lr(r,i);break;case`code-block`:a=pr(r,i);break;case`table`:a=gr(r,i);break;case`horizontal-rule`:a=_r(r,i);break;default:return null}return a?r.slice(a.from,a.to)===a.insert?null:a:null}function yr(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.toLowerCase(),s=n.from+i+2,c=e().map(e=>{let t=e.replace(/\.md$/i,``);return{filePath:e,label:t,fileName:t.split(`/`).pop()}}).filter(({label:e,fileName:t})=>e.toLowerCase().includes(o)||t.toLowerCase().includes(o)).map(({label:e,fileName:t})=>({label:e,detail:e.includes(`/`)?` ${t}`:void 0,apply:(e,t,n,r)=>{let i=e.state.doc.toString(),a=r;i.slice(r,r+2)===`]]`&&(a=r+2),e.dispatch({changes:{from:n,to:a,insert:`${t.label}]]`},selection:{anchor:n+t.label.length+2}})},type:`text`,boost:e.toLowerCase().startsWith(o)?1:0}));return c.length===0?null:{from:s,options:c,filter:!1}}}var br=new Set([`@startuml`,`@enduml`,`@startmindmap`,`@endmindmap`,`@startwbs`,`@endwbs`,`@startgantt`,`@endgantt`,`@startjson`,`@endjson`,`@startyaml`,`@endyaml`,`@startsalt`,`@endsalt`]),xr=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(`.`)),Sr=new Set([`false`,`no`,`off`,`on`,`true`,`yes`]);function Cr(e){let t=e.match(/[@!A-Za-z_][\w.-]*/u,!1);return t?(e.match(/[@!A-Za-z_][\w.-]*/u),t[0]):``}var wr=new le(ne.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=Cr(e);if(r){let e=r.toLowerCase();return e.startsWith(`!`)||br.has(e)?`meta`:xr.has(e)?`keyword`:Sr.has(e)?`bool`:/^[A-Z][A-Z0-9_]*$/u.test(r)?`typeName`:`variableName`}return e.next(),null}})),Tr=v.of({alias:[`plantuml`,`puml`],extensions:[`plantuml`,`puml`],name:`PlantUML`,support:wr});function Er(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 Dr(e,t){let n=Er(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 Or=[...st,Tr],kr=i.mark({class:`cm-matchingBracket cm-matchingBracket-paired`}),Ar=i.mark({class:`cm-nonmatchingBracket`}),jr=i.mark({class:`cm-remoteUpdateFlash`}),Mr=1350,Nr=160,Pr=900,Fr=/^(\s*(?:>\s*)*(?:[-+*]|\d+[.)])\s+\[)( |x|X)(\])(\s.*)?$/,Ir=Object.freeze({indentLess:Oe,indentMore:Ee,openSearch:Xt,redo:Me,undo:De}),Lr=class extends ye{toDOM(){let e=document.createElement(`span`);return e.className=`cm-remoteUpdateCaretWidget`,e.setAttribute(`aria-hidden`,`true`),e}ignoreEvent(){return!0}},Rr=b.define(),zr=b.define(),Br=ee.define({create:()=>i.none,update(e,t){let n=e.map(t.changes);return t.effects.forEach(e=>{if(e.is(zr)){n=i.none;return}if(e.is(Rr)){let{from:t,showCaret:r,to:a}=e.value,o=[];a>t&&o.push(jr.range(t,a)),r&&o.push(i.widget({side:-1,widget:new Lr}).range(t)),n=o.length>0?i.set(o,!0):i.none}}),n},provide:e=>l.decorations.from(e)});function Vr(e,t){return t.selection.ranges.some(t=>t.empty&&e.to===t.head)}function Hr(e,t){let n=[];if(!e.matched)return n.push(Ar.range(e.start.from,e.start.to)),e.end&&n.push(Ar.range(e.end.from,e.end.to)),n;let r=Vr(e.start,t),i=e.end?Vr(e.end,t):!1;return r||n.push(kr.range(e.start.from,e.start.to)),e.end&&!i&&n.push(kr.range(e.end.from,e.end.to)),n}function Ur(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`?`oklch(from var(--color-primary) l c h / 0.65)`:`oklch(from var(--color-primary) l c h / 0.5)`,a=e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`,o=e===`dark`?`oklch(from var(--color-primary) l c h / 0.2)`:`oklch(from var(--color-primary) l c h / 0.12)`,s=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)`,c=e===`dark`?`oklch(from var(--color-error) l c h / 0.12)`:`oklch(from var(--color-error) l c h / 0.1)`,u=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 l.theme({"&":{backgroundColor:`var(--color-bg)`,color:`var(--color-text)`},".cm-content":{caretColor:a,fontFamily:`var(--font-mono)`,padding:`16px 0`},".cm-cursor, .cm-dropCursor":{borderLeftColor:a,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}`},".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:o,outline:`1px solid ${s}`},".cm-nonmatchingBracket":{backgroundColor:c,outline:`1px solid ${u}`,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},"&.cm-focused .cm-selectionLayer .cm-selectionBackground":{border:`1px solid ${i}`,borderRadius:`2px`},"@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 Wr(e){return Pe(e)?wr:Fe(e)?Te():Ce({base:we,codeLanguages:Or})}function Gr(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 Kr=class{constructor({editorContainer:e,getFileList:t,initialTheme:n,lineInfoElement:r,lineWrappingEnabled:i=!0,onDocChanged:a=null,onImagePaste:o=null,onSelectionChanged:s=null,onViewportChanged:c=null}){this.editorContainer=e,this.getFileList=t??(()=>[]),this.initialTheme=n,this.lineInfoElement=r,this.lineWrappingEnabled=i,this.onDocChanged=a,this.onImagePaste=o,this.onSelectionChanged=s,this.onViewportChanged=c,this.editorView=null,this.themeCompartment=new pe,this.syntaxThemeCompartment=new pe,this.lineWrappingCompartment=new pe,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 l.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 i=[s(),a(),c(),ke(),oe(),h(),x.allowMultipleSelections.of(!0),ge(),n(ie,{fallback:!0}),se({renderMatch:Hr}),Se(),xe({override:[yr(this.getFileList)]}),_(),r(),g(),yt(),de.of([...be,...Ne,...je,...Qt,...he,Ae]),l.contentAttributes.of({"aria-label":`Markdown editor`}),Wr(e),this.themeCompartment.of(Ur(this.initialTheme)),this.syntaxThemeCompartment.of(this.initialTheme===`dark`?yn:[]),this.lineWrappingCompartment.of(this.lineWrappingEnabled?l.lineWrapping:[]),Br,this.createUpdateListener()];return t?(i.push(x.readOnly.of(!0)),i.push(l.editable.of(!1)),i):(i.splice(13,0,ae.highest(l.domEventHandlers({paste:e=>Dr(e,this.onImagePaste)}))),i)}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 l({parent:this.editorContainer,state:e}),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(),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,a=x.create({doc:r.toString(),extensions:[...this.getBaseExtensions(t),Ln(r,e,{undoManager:n})]});this.mountEditor(a,{editorMode:`collaborative`,preserveScrollTop:i})}initializeProvisional({content:e=``,filePath:t}){let n=this.editorView?.scrollDOM?.scrollTop??0,r=x.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.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(Ur(e)),this.syntaxThemeCompartment.reconfigure(e===`dark`?yn:[])]})}isLineWrappingEnabled(){return this.lineWrappingEnabled}setLineWrapping(e){return this.lineWrappingEnabled=!!e,this.editorView&&this.editorView.dispatch({effects:this.lineWrappingCompartment.reconfigure(this.lineWrappingEnabled?l.lineWrapping:[])}),this.lineWrappingEnabled}requestMeasure(){this.editorView?.requestMeasure()}runEditorCommand(e){if(!this.editorView)return!1;let t=Ir[String(e??``)];if(typeof t!=`function`)return!1;let n=t(this.editorView);return n&&e!==`openSearch`&&this.editorView.focus(),n}flashRemoteRange({from:e=0,to:t=0}={},n=Mr){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)<=Nr&&Date.now()-this.lastLocalInputAt>Pr;return this.editorView.dispatch({effects:Rr.of({from:i,showCaret:o,to:a})}),this.remoteUpdateFlashTimer&&clearTimeout(this.remoteUpdateFlashTimer),this.remoteUpdateFlashTimer=window.setTimeout(()=>{this.remoteUpdateFlashTimer=0,this.editorView?.dispatch({effects:zr.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}=Gr(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}=Gr(n);if(r===i){let e=t.lineAt(r);return{anchorKind:`line`,anchorQuote:qe(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:qe(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}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=vr(n,t,e);return i?(r=!0,{changes:{from:i.from,insert:i.insert,to:i.to},range:y.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}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=Fr.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())}},qr=class{constructor({editorContainer:e,lineWrappingEnabled:t=!0,initialTheme:n,lineInfoElement:r,onAwarenessChange:i,onConnectionChange:a,onCommentsChange:o,onContentChange:s,onImagePaste:c,onSelectionChange:l,preferredUserName:u,localUser:d,getFileList:f}){this.onAwarenessChange=i,this.onCommentsChange=o,this.onContentChange=s,this.onSelectionChange=l,this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient=new ot({localUser:d,onAwarenessChange:e=>this.onAwarenessChange?.(e),onConnectionChange:a,onInitialSync:()=>this.emitContentChange(),preferredUserName:u,resolveAwarenessCursor:e=>this.resolveAwarenessCursor(e)}),this.viewAdapter=new Kr({editorContainer:e,getFileList:f||(()=>[]),initialTheme:n,lineInfoElement:r,lineWrappingEnabled:t,onDocChanged:()=>{this.emitContentChange()},onImagePaste:c,onViewportChanged:e=>{this.collaborationClient.setLocalViewport(e)},onSelectionChanged:()=>{this.onSelectionChange?.(this.getCurrentSelectionCommentAnchor())}}),this.commentThreadStore=new at({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.pendingCollaborativeBindings=null,this.bootstrapContent=null,!0):!1}showBootstrapContent({content:e=``,filePath:t=this.activeFilePath}={}){return this.collaborationClient.initialSyncComplete?!1:(this.activeFilePath=t,this.bootstrapContent=String(e??``),this.viewAdapter.initializeProvisional({content:this.bootstrapContent,filePath:this.activeFilePath}),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}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()}setLineWrapping(e){return this.viewAdapter.setLineWrapping(e)}scrollToLine(e,t=0){return this.viewAdapter.scrollToLine(e,t)}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()}runEditorCommand(e){return this.viewAdapter.runEditorCommand(e)}applyMarkdownToolbarAction(e){return this.viewAdapter.applyMarkdownToolbarAction(e)}insertText(e){return this.viewAdapter.insertText(e)}toggleTaskListItem(e){return this.collaborationClient.initialSyncComplete?this.viewAdapter.toggleTaskListItem(e):!1}flashExternalUpdate(e){return this.viewAdapter.flashRemoteRange(e)}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=T(e.anchor,t),a=T(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{qr as EditorSession};
16
+ `)}function gr(e,t){return mr(e,t,hr(e.slice(t.from,t.to)),2,Kn[0].length)}function _r(e,t){return mr(e,t,`---`,4,0)}function vr(e,t,n){let r=String(e??``),i=Jn(t,r.length),a;switch(n){case`bold`:a=$n(r,i,`**`,Rn.bold);break;case`italic`:a=$n(r,i,`_`,Rn.italic);break;case`strikethrough`:a=$n(r,i,`~~`,Rn.strikethrough);break;case`code`:a=$n(r,i,"`",Rn.code);break;case`link`:a=tr(r,i);break;case`image`:a=nr(r,i);break;case`video`:a=rr(r,i);break;case`paragraph`:a=dr(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=cr(r,i);break;case`bullet-list`:a=sr(r,i);break;case`numbered-list`:a=ur(r,i);break;case`task-list`:a=lr(r,i);break;case`code-block`:a=pr(r,i);break;case`table`:a=gr(r,i);break;case`horizontal-rule`:a=_r(r,i);break;default:return null}return a?r.slice(a.from,a.to)===a.insert?null:a:null}function yr(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.toLowerCase(),s=n.from+i+2,c=e().map(e=>{let t=e.replace(/\.md$/i,``);return{filePath:e,label:t,fileName:t.split(`/`).pop()}}).filter(({label:e,fileName:t})=>e.toLowerCase().includes(o)||t.toLowerCase().includes(o)).map(({label:e,fileName:t})=>({label:e,detail:e.includes(`/`)?` ${t}`:void 0,apply:(e,t,n,r)=>{let i=e.state.doc.toString(),a=r;i.slice(r,r+2)===`]]`&&(a=r+2),e.dispatch({changes:{from:n,to:a,insert:`${t.label}]]`},selection:{anchor:n+t.label.length+2}})},type:`text`,boost:e.toLowerCase().startsWith(o)?1:0}));return c.length===0?null:{from:s,options:c,filter:!1}}}var br=new Set([`@startuml`,`@enduml`,`@startmindmap`,`@endmindmap`,`@startwbs`,`@endwbs`,`@startgantt`,`@endgantt`,`@startjson`,`@endjson`,`@startyaml`,`@endyaml`,`@startsalt`,`@endsalt`]),xr=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(`.`)),Sr=new Set([`false`,`no`,`off`,`on`,`true`,`yes`]);function Cr(e){let t=e.match(/[@!A-Za-z_][\w.-]*/u,!1);return t?(e.match(/[@!A-Za-z_][\w.-]*/u),t[0]):``}var wr=new le(ne.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=Cr(e);if(r){let e=r.toLowerCase();return e.startsWith(`!`)||br.has(e)?`meta`:xr.has(e)?`keyword`:Sr.has(e)?`bool`:/^[A-Z][A-Z0-9_]*$/u.test(r)?`typeName`:`variableName`}return e.next(),null}})),Tr=v.of({alias:[`plantuml`,`puml`],extensions:[`plantuml`,`puml`],name:`PlantUML`,support:wr});function Er(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 Dr(e,t){let n=Er(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 Or=[...st,Tr],kr=i.mark({class:`cm-matchingBracket cm-matchingBracket-paired`}),Ar=i.mark({class:`cm-nonmatchingBracket`}),jr=i.mark({class:`cm-remoteUpdateFlash`}),Mr=1350,Nr=160,Pr=900,Fr=/^(\s*(?:>\s*)*(?:[-+*]|\d+[.)])\s+\[)( |x|X)(\])(\s.*)?$/,Ir=Object.freeze({indentLess:Oe,indentMore:Ee,openSearch:Xt,redo:Me,undo:De}),Lr=class extends ye{toDOM(){let e=document.createElement(`span`);return e.className=`cm-remoteUpdateCaretWidget`,e.setAttribute(`aria-hidden`,`true`),e}ignoreEvent(){return!0}},Rr=b.define(),zr=b.define(),Br=ee.define({create:()=>i.none,update(e,t){let n=e.map(t.changes);return t.effects.forEach(e=>{if(e.is(zr)){n=i.none;return}if(e.is(Rr)){let{from:t,showCaret:r,to:a}=e.value,o=[];a>t&&o.push(jr.range(t,a)),r&&o.push(i.widget({side:-1,widget:new Lr}).range(t)),n=o.length>0?i.set(o,!0):i.none}}),n},provide:e=>l.decorations.from(e)});function Vr(e,t){return t.selection.ranges.some(t=>t.empty&&e.to===t.head)}function Hr(e,t){let n=[];if(!e.matched)return n.push(Ar.range(e.start.from,e.start.to)),e.end&&n.push(Ar.range(e.end.from,e.end.to)),n;let r=Vr(e.start,t),i=e.end?Vr(e.end,t):!1;return r||n.push(kr.range(e.start.from,e.start.to)),e.end&&!i&&n.push(kr.range(e.end.from,e.end.to)),n}function Ur(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`?`oklch(from var(--color-primary) l c h / 0.65)`:`oklch(from var(--color-primary) l c h / 0.5)`,a=e===`dark`?`color-mix(in oklab, var(--color-primary) 78%, white)`:`color-mix(in oklab, var(--color-primary) 84%, black)`,o=e===`dark`?`oklch(from var(--color-primary) l c h / 0.2)`:`oklch(from var(--color-primary) l c h / 0.12)`,s=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)`,c=e===`dark`?`oklch(from var(--color-error) l c h / 0.12)`:`oklch(from var(--color-error) l c h / 0.1)`,u=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 l.theme({"&":{backgroundColor:`var(--color-bg)`,color:`var(--color-text)`},".cm-content":{caretColor:a,fontFamily:`var(--font-mono)`,padding:`16px 0`},".cm-cursor, .cm-dropCursor":{borderLeftColor:a,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}`},".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:o,outline:`1px solid ${s}`},".cm-nonmatchingBracket":{backgroundColor:c,outline:`1px solid ${u}`,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},"&.cm-focused .cm-selectionLayer .cm-selectionBackground":{border:`1px solid ${i}`,borderRadius:`2px`},"@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 Wr(e){return Pe(e)?wr:Fe(e)?Te():Ce({base:we,codeLanguages:Or})}function Gr(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 Kr=class{constructor({editorContainer:e,getFileList:t,initialTheme:n,lineInfoElement:r,lineWrappingEnabled:i=!0,onDocChanged:a=null,onImagePaste:o=null,onSelectionChanged:s=null,onViewportChanged:c=null}){this.editorContainer=e,this.getFileList=t??(()=>[]),this.initialTheme=n,this.lineInfoElement=r,this.lineWrappingEnabled=i,this.onDocChanged=a,this.onImagePaste=o,this.onSelectionChanged=s,this.onViewportChanged=c,this.editorView=null,this.themeCompartment=new pe,this.syntaxThemeCompartment=new pe,this.lineWrappingCompartment=new pe,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 l.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 i=[s(),a(),c(),ke(),oe(),h(),x.allowMultipleSelections.of(!0),ge(),n(ie,{fallback:!0}),se({renderMatch:Hr}),Se(),xe({override:[yr(this.getFileList)]}),_(),r(),g(),yt(),de.of([...be,...Ne,...je,...Qt,...he,Ae]),l.contentAttributes.of({"aria-label":`Markdown editor`}),Wr(e),this.themeCompartment.of(Ur(this.initialTheme)),this.syntaxThemeCompartment.of(this.initialTheme===`dark`?yn:[]),this.lineWrappingCompartment.of(this.lineWrappingEnabled?l.lineWrapping:[]),Br,this.createUpdateListener()];return t?(i.push(x.readOnly.of(!0)),i.push(l.editable.of(!1)),i):(i.splice(13,0,ae.highest(l.domEventHandlers({paste:e=>Dr(e,this.onImagePaste)}))),i)}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 l({parent:this.editorContainer,state:e}),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(),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,a=x.create({doc:r.toString(),extensions:[...this.getBaseExtensions(t),Ln(r,e,{undoManager:n})]});this.mountEditor(a,{editorMode:`collaborative`,preserveScrollTop:i})}initializeProvisional({content:e=``,filePath:t}){let n=this.editorView?.scrollDOM?.scrollTop??0,r=x.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.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(Ur(e)),this.syntaxThemeCompartment.reconfigure(e===`dark`?yn:[])]})}isLineWrappingEnabled(){return this.lineWrappingEnabled}setLineWrapping(e){return this.lineWrappingEnabled=!!e,this.editorView&&this.editorView.dispatch({effects:this.lineWrappingCompartment.reconfigure(this.lineWrappingEnabled?l.lineWrapping:[])}),this.lineWrappingEnabled}requestMeasure(){this.editorView?.requestMeasure()}runEditorCommand(e){if(!this.editorView)return!1;let t=Ir[String(e??``)];if(typeof t!=`function`)return!1;let n=t(this.editorView);return n&&e!==`openSearch`&&this.editorView.focus(),n}flashRemoteRange({from:e=0,to:t=0}={},n=Mr){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)<=Nr&&Date.now()-this.lastLocalInputAt>Pr;return this.editorView.dispatch({effects:Rr.of({from:i,showCaret:o,to:a})}),this.remoteUpdateFlashTimer&&clearTimeout(this.remoteUpdateFlashTimer),this.remoteUpdateFlashTimer=window.setTimeout(()=>{this.remoteUpdateFlashTimer=0,this.editorView?.dispatch({effects:zr.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}=Gr(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}=Gr(n);if(r===i){let e=t.lineAt(r);return{anchorKind:`line`,anchorQuote:qe(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:qe(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}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=vr(n,t,e);return i?(r=!0,{changes:{from:i.from,insert:i.insert,to:i.to},range:y.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}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=Fr.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())}},qr=class{constructor({editorContainer:e,lineWrappingEnabled:t=!0,initialTheme:n,lineInfoElement:r,onAwarenessChange:i,onConnectionChange:a,onCommentsChange:o,onContentChange:s,onImagePaste:c,onSelectionChange:l,preferredUserName:u,localUser:d,getFileList:f}){this.onAwarenessChange=i,this.onCommentsChange=o,this.onContentChange=s,this.onSelectionChange=l,this.activeFilePath=``,this.bootstrapContent=null,this.pendingCollaborativeBindings=null,this.hasDeliveredContent=!1,this.lastDeliveredContent=null,this.collaborationClient=new ot({localUser:d,onAwarenessChange:e=>this.onAwarenessChange?.(e),onConnectionChange:a,onInitialSync:()=>this.emitContentChange(),preferredUserName:u,resolveAwarenessCursor:e=>this.resolveAwarenessCursor(e)}),this.viewAdapter=new Kr({editorContainer:e,getFileList:f||(()=>[]),initialTheme:n,lineInfoElement:r,lineWrappingEnabled:t,onDocChanged:()=>{this.emitContentChange()},onImagePaste:c,onViewportChanged:e=>{this.collaborationClient.setLocalViewport(e)},onSelectionChanged:()=>{this.onSelectionChange?.(this.getCurrentSelectionCommentAnchor())}}),this.commentThreadStore=new at({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?!1:(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}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()}setLineWrapping(e){return this.viewAdapter.setLineWrapping(e)}scrollToLine(e,t=0){return this.viewAdapter.scrollToLine(e,t)}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()}runEditorCommand(e){return this.viewAdapter.runEditorCommand(e)}applyMarkdownToolbarAction(e){return this.viewAdapter.applyMarkdownToolbarAction(e)}insertText(e){return this.viewAdapter.insertText(e)}toggleTaskListItem(e){return this.collaborationClient.initialSyncComplete?this.viewAdapter.toggleTaskListItem(e):!1}flashExternalUpdate(e){return this.viewAdapter.flashRemoteRange(e)}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=T(e.anchor,t),a=T(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{qr as EditorSession};
@@ -0,0 +1 @@
1
+ :root{--text-xs:clamp(.75rem, .7rem + .25vw, .875rem);--text-sm:clamp(.875rem, .8rem + .35vw, 1rem);--text-base:clamp(1rem, .9rem + .5vw, 1.125rem);--text-lg:clamp(1.125rem, .95rem + .85vw, 1.5rem);--text-xl:clamp(1.5rem, 1rem + 1.5vw, 2.25rem);--text-2xl:clamp(2rem, 1.2rem + 2.5vw, 3.5rem);--text-label:12px;--text-meta:11px;--text-caption:10px;--text-micro:9px;--text-code-sm:11.5px;--text-ui-sm:13px;--text-ui-md:14px;--text-title-sm:15px;--text-title-md:18px;--font-body:"Inter Variable", "Inter", system-ui, sans-serif;--font-display:"Inter Variable", "Inter", system-ui, sans-serif;--font-prose:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:"JetBrains Mono", ui-monospace, "SFMono-Regular", "SF Mono", monospace;--space-1:.25rem;--space-2:.5rem;--space-3:.75rem;--space-4:1rem;--space-5:1.25rem;--space-6:1.5rem;--space-8:2rem;--space-10:2.5rem;--space-12:3rem;--space-16:4rem;--space-20:5rem;--space-24:6rem;--space-32:8rem;--radius-sm:.375rem;--radius-md:.5rem;--radius-lg:.75rem;--radius-xl:1rem;--radius-2xs:2px;--radius-xs:4px;--radius-lg-plus:10px;--radius-xl-plus:18px;--radius-full:9999px;--transition-interactive:.18s cubic-bezier(.16, 1, .3, 1);--content-narrow:640px;--content-default:960px;--content-wide:1200px;--preview-content-width:720px;--panel-comments-width:min(300px, 34vw);--panel-comments-min-width:240px;--panel-outline-width:220px;--toolbar-h:48px;--control-h-xs:28px;--control-h-sm:30px;--control-h-md:36px;--control-h-lg:44px;--control-icon-sm:14px;--control-icon-md:16px;--panel-border-width:1px}:root,[data-theme=light]{--color-bg:#f5f5f7;--color-surface:#fff;--color-surface-2:#fafafe;--color-surface-offset:#eeeef2;--color-surface-offset-2:#e6e6eb;--color-surface-dynamic:#dddde3;--color-surface-raised:#fff;--color-surface-ink:#0f1117;--color-divider:#d1d1d8;--color-border:#c4c4ce;--color-text:#1a1a2e;--color-text-muted:#6b6b80;--color-text-faint:#a0a0b0;--color-text-inverse:#f5f5f7;--color-primary:#4f46e5;--color-primary-hover:#4338ca;--color-primary-active:#3730a3;--color-primary-contrast:#f5f5f7;--color-primary-highlight:#e0e0ff;--color-comment:#4f46e5;--color-comment-soft:#4f46e514;--color-comment-strong:#4f46e524;--color-comment-text:#3730a3;--color-error:#dc2626;--color-danger:#dc2626;--color-error-highlight:#fce8e8;--color-success:#16a34a;--color-success-highlight:#dcfce7;--color-warning:#d97706;--color-warning-highlight:#fef3c7;--diff-add-bg:#16a34a0f;--diff-add-line-bg:#16a34a24;--diff-add-text:#16a34a;--diff-del-bg:#dc26260f;--diff-del-line-bg:#dc262624;--diff-del-text:#dc2626;--diff-hunk-bg:#4f46e514;--diff-hunk-text:#4f46e5;--diff-gutter:#a0a0b0;--surface-fill-subtle:color-mix(in oklab, var(--color-surface) 92%, var(--color-surface-offset) 8%);--surface-fill-strong:color-mix(in oklab, var(--color-surface-offset) 72%, var(--color-surface-offset-2) 28%);--surface-overlay:color-mix(in srgb, var(--color-surface) 84%, var(--color-surface-offset) 16%);--surface-overlay-soft:color-mix(in srgb, var(--color-surface) 88%, var(--color-surface-offset) 12%);--surface-overlay-strong:color-mix(in srgb, var(--color-surface) 90%, var(--color-surface-offset) 10%);--surface-overlay-raised:color-mix(in oklab, var(--color-surface) 94%, transparent);--surface-overlay-header:color-mix(in srgb, var(--color-surface-offset) 76%, var(--color-bg) 24%);--surface-overlay-offset:color-mix(in oklab, var(--color-surface-offset) 82%, transparent);--surface-scrim:oklch(10% 0 0/.42);--surface-scrim-strong:oklch(8% .01 260/.82);--surface-inverse-glass:oklch(18% .02 260/.68);--surface-inverse-glass-hover:oklch(24% .02 260/.82);--surface-media-canvas:#000;--surface-embed-canvas:#fff;--surface-avatar-muted:#ffffff38;--surface-avatar-label:#0f1117d6;--surface-accent-subtle:color-mix(in oklab, var(--color-primary) 8%, var(--color-surface));--surface-accent-soft:color-mix(in oklab, var(--color-primary) 16%, transparent);--surface-accent-strong:color-mix(in oklab, var(--color-primary) 22%, transparent);--surface-success-soft:color-mix(in oklab, var(--color-success) 14%, transparent);--surface-warning-soft:color-mix(in oklab, var(--color-warning) 14%, transparent);--surface-danger-soft:color-mix(in oklab, var(--color-error) 14%, transparent);--surface-comment-shell:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .035), transparent 120px), color-mix(in srgb, var(--color-surface) 96%, var(--color-comment) 4%);--surface-comment-shell-header:color-mix(in srgb, var(--color-surface) 97%, var(--color-comment) 3%);--surface-comment-record:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .028), transparent 70%), color-mix(in srgb, var(--color-surface-2) 95%, var(--color-comment) 5%);--surface-comment-record-hover:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .042), transparent 70%), color-mix(in srgb, var(--color-surface-2) 92%, var(--color-comment) 8%);--surface-comment-record-active:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .055), transparent 72%), color-mix(in srgb, var(--color-surface-2) 90%, var(--color-comment) 10%);--surface-comment-subtle:color-mix(in srgb, var(--color-surface-2) 95%, var(--color-comment) 5%);--surface-comment-subtle-strong:color-mix(in srgb, var(--color-surface-2) 92%, var(--color-comment) 8%);--surface-comment-card:color-mix(in srgb, var(--color-surface) 94%, var(--color-comment) 6%);--surface-comment-elevated:color-mix(in srgb, var(--color-surface) 96%, var(--color-comment) 4%);--surface-comment-offset:color-mix(in srgb, var(--color-surface-offset) 90%, var(--color-comment) 10%);--surface-comment-offset-soft:color-mix(in srgb, var(--color-surface-offset) 88%, var(--color-comment) 12%);--surface-comment-offset-strong:color-mix(in srgb, var(--color-surface-offset) 84%, var(--color-comment) 16%);--surface-comment-offset-active:color-mix(in srgb, var(--color-surface-offset) 72%, var(--color-comment) 28%);--surface-comment-highlight-hover:color-mix(in srgb, var(--color-comment-soft) 74%, var(--color-comment) 26%);--surface-comment-highlight-active:color-mix(in srgb, var(--color-comment-soft) 62%, var(--color-comment) 38%);--surface-comment-selection:color-mix(in srgb, var(--color-surface) 25%, var(--color-comment) 75%);--surface-comment-preview-fade:linear-gradient(180deg, oklch(0% 0 0/0), color-mix(in srgb, var(--color-surface-2) 95%, var(--color-comment) 5%));--border-comment-soft:color-mix(in srgb, var(--color-divider) 90%, var(--color-comment) 10%);--border-comment-muted:color-mix(in srgb, var(--color-divider) 88%, var(--color-comment) 12%);--border-comment-strong:color-mix(in srgb, var(--color-border) 82%, var(--color-comment) 18%);--border-comment-active:color-mix(in srgb, var(--color-border) 78%, var(--color-comment) 22%);--shadow-comment-outline:0 0 0 1px oklch(from var(--color-comment) l c h / .14);--surface-warning-toast:linear-gradient(135deg, oklab(94.9166% -.0018052 .0644112), oklab(99.8777% .00026585 .000908241) 42%), #fff8e7;--border-warning-toast:oklab(73.4461% .062398 .147608);--text-warning-toast:#422006;--shadow-warning-toast:0 16px 30px #542e0a2e, 0 0 0 1px #f59e0b1f;--border-accent-soft:color-mix(in oklab, var(--color-primary) 22%, transparent);--border-accent-muted:color-mix(in oklab, var(--color-primary) 24%, var(--color-border));--border-accent-strong:color-mix(in oklab, var(--color-primary) 34%, var(--color-border));--border-accent-stronger:color-mix(in oklab, var(--color-primary) 40%, var(--color-border));--shadow-accent-inset:inset 0 0 0 1px color-mix(in oklab, var(--color-primary) 14%, transparent);--shadow-accent-outline:0 0 0 1px color-mix(in oklab, var(--color-primary) 16%, transparent);--shadow-accent-halo:0 0 0 3px oklch(from var(--color-primary) l c h / .16);--shadow-accent-ring:0 0 0 2px var(--color-surface), 0 0 0 4px oklch(from var(--color-primary) l c h / .18);--shadow-accent-ring-strong:0 0 0 2px var(--color-bg), 0 0 0 4px oklch(from var(--color-primary) l c h / .45);--shadow-accent-ring-solid:0 0 0 2px var(--color-primary), 0 0 0 4px oklch(from var(--color-primary) l c h / .2);--shadow-elevated-soft:0 10px 24px color-mix(in oklab, var(--color-surface-ink) 10%, transparent);--shadow-floating-soft:0 14px 34px oklch(0% 0 0/.18);--shadow-floating-hover:0 18px 40px oklch(0% 0 0/.2);--shadow-media-soft:0 16px 40px oklch(0% 0 0/.24);--shadow-media-stage:0 28px 80px oklch(0% 0 0/.28);--shadow-media-modal:0 10px 40px #00000059;--shadow-card-strong:0 20px 56px oklch(0% 0 0/.24);--shadow-sheet-inset:inset 0 1px 0 color-mix(in oklab, var(--color-text) 4%, transparent);--shadow-focus:0 0 0 3px oklch(from var(--color-primary) l c h / .15);--shadow-focus-compact:0 0 0 2px oklch(from var(--color-primary) l c h / .45);--interactive-border:color-mix(in oklab, var(--color-primary) 22%, transparent);--interactive-surface:color-mix(in oklab, var(--color-primary) 14%, transparent);--color-text-on-dark:#fff;--shadow-sm:0 1px 2px oklch(20% .02 260/.06);--shadow-md:0 4px 12px oklch(20% .02 260/.08);--shadow-lg:0 12px 32px oklch(20% .02 260/.12)}[data-theme=dark]{--color-bg:#0f1117;--color-surface:#161822;--color-surface-2:#1c1e2c;--color-surface-offset:#1a1c28;--color-surface-offset-2:#22243a;--color-surface-dynamic:#2a2c3e;--color-surface-raised:#202330;--color-surface-ink:#050608;--color-divider:#2e3044;--color-border:#383a50;--color-text:#e2e2ea;--color-text-muted:#8b8ba0;--color-text-faint:#5a5a70;--color-text-inverse:#0f1117;--color-primary:#818cf8;--color-primary-hover:#6366f1;--color-primary-active:#4f46e5;--color-primary-contrast:#0f1117;--color-primary-highlight:#1e1e3a;--color-comment:#818cf8;--color-comment-soft:#818cf81a;--color-comment-strong:#818cf829;--color-comment-text:#c7d2fe;--color-error:#f87171;--color-danger:#f87171;--color-error-highlight:#2a1a1a;--color-success:#4ade80;--color-success-highlight:#1a2a1a;--color-warning:#fbbf24;--color-warning-highlight:#2a261a;--diff-add-bg:#4ade8014;--diff-add-line-bg:#4ade8026;--diff-add-text:#4ade80;--diff-del-bg:#f8717114;--diff-del-line-bg:#f8717126;--diff-del-text:#f87171;--diff-hunk-bg:#818cf81a;--diff-hunk-text:#818cf8;--diff-gutter:#5a5a70;--surface-fill-subtle:color-mix(in oklab, var(--color-surface) 88%, var(--color-surface-offset) 12%);--surface-fill-strong:color-mix(in oklab, var(--color-surface-offset) 60%, var(--color-surface-offset-2) 40%);--surface-overlay:color-mix(in srgb, var(--color-surface) 84%, var(--color-surface-offset) 16%);--surface-overlay-soft:color-mix(in srgb, var(--color-surface) 88%, var(--color-surface-offset) 12%);--surface-overlay-strong:color-mix(in srgb, var(--color-surface) 90%, var(--color-surface-offset) 10%);--surface-overlay-raised:color-mix(in oklab, var(--color-surface) 94%, transparent);--surface-overlay-header:color-mix(in srgb, var(--color-surface-offset) 76%, var(--color-bg) 24%);--surface-overlay-offset:color-mix(in oklab, var(--color-surface-offset) 82%, transparent);--surface-scrim:oklch(10% 0 0/.42);--surface-scrim-strong:oklch(8% .01 260/.82);--surface-inverse-glass:oklch(18% .02 260/.68);--surface-inverse-glass-hover:oklch(24% .02 260/.82);--surface-media-canvas:#000;--surface-embed-canvas:#121212;--surface-avatar-muted:#ffffff38;--surface-avatar-label:#0f1117d6;--surface-accent-subtle:color-mix(in oklab, var(--color-primary) 8%, var(--color-surface));--surface-accent-soft:color-mix(in oklab, var(--color-primary) 16%, transparent);--surface-accent-strong:color-mix(in oklab, var(--color-primary) 22%, transparent);--surface-success-soft:color-mix(in oklab, var(--color-success) 14%, transparent);--surface-warning-soft:color-mix(in oklab, var(--color-warning) 14%, transparent);--surface-danger-soft:color-mix(in oklab, var(--color-error) 14%, transparent);--surface-comment-shell:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .035), transparent 120px), color-mix(in srgb, var(--color-surface) 96%, var(--color-comment) 4%);--surface-comment-shell-header:color-mix(in srgb, var(--color-surface) 97%, var(--color-comment) 3%);--surface-comment-record:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .028), transparent 70%), color-mix(in srgb, var(--color-surface-2) 95%, var(--color-comment) 5%);--surface-comment-record-hover:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .042), transparent 70%), color-mix(in srgb, var(--color-surface-2) 92%, var(--color-comment) 8%);--surface-comment-record-active:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .055), transparent 72%), color-mix(in srgb, var(--color-surface-2) 90%, var(--color-comment) 10%);--surface-comment-subtle:color-mix(in srgb, var(--color-surface-2) 95%, var(--color-comment) 5%);--surface-comment-subtle-strong:color-mix(in srgb, var(--color-surface-2) 92%, var(--color-comment) 8%);--surface-comment-card:color-mix(in srgb, var(--color-surface) 94%, var(--color-comment) 6%);--surface-comment-elevated:color-mix(in srgb, var(--color-surface) 96%, var(--color-comment) 4%);--surface-comment-offset:color-mix(in srgb, var(--color-surface-offset) 90%, var(--color-comment) 10%);--surface-comment-offset-soft:color-mix(in srgb, var(--color-surface-offset) 88%, var(--color-comment) 12%);--surface-comment-offset-strong:color-mix(in srgb, var(--color-surface-offset) 84%, var(--color-comment) 16%);--surface-comment-offset-active:color-mix(in srgb, var(--color-surface-offset) 72%, var(--color-comment) 28%);--surface-comment-highlight-hover:color-mix(in srgb, var(--color-comment-soft) 74%, var(--color-comment) 26%);--surface-comment-highlight-active:color-mix(in srgb, var(--color-comment-soft) 62%, var(--color-comment) 38%);--surface-comment-selection:color-mix(in srgb, var(--color-surface) 25%, var(--color-comment) 75%);--surface-comment-preview-fade:linear-gradient(180deg, oklch(0% 0 0/0), color-mix(in srgb, var(--color-surface-2) 95%, var(--color-comment) 5%));--border-comment-soft:color-mix(in srgb, var(--color-divider) 90%, var(--color-comment) 10%);--border-comment-muted:color-mix(in srgb, var(--color-divider) 88%, var(--color-comment) 12%);--border-comment-strong:color-mix(in srgb, var(--color-border) 82%, var(--color-comment) 18%);--border-comment-active:color-mix(in srgb, var(--color-border) 78%, var(--color-comment) 22%);--shadow-comment-outline:0 0 0 1px oklch(from var(--color-comment) l c h / .14);--surface-warning-toast:linear-gradient(135deg, oklab(76.8591% .0560995 .154808/.32), color-mix(in oklab, var(--color-surface) 86%, #0b1022 14%) 42%), color-mix(in oklab, var(--color-surface) 74%, #1b1320 26%);--border-warning-toast:oklab(79.4887% .0497246 .137216/.88);--text-warning-toast:oklab(99.6952% -.000454402 .00461993);--shadow-warning-toast:0 18px 34px #00000061, 0 0 0 1px oklab(76.8591% .0560995 .154808/.18);--border-accent-soft:color-mix(in oklab, var(--color-primary) 22%, transparent);--border-accent-muted:color-mix(in oklab, var(--color-primary) 24%, var(--color-border));--border-accent-strong:color-mix(in oklab, var(--color-primary) 34%, var(--color-border));--border-accent-stronger:color-mix(in oklab, var(--color-primary) 40%, var(--color-border));--shadow-accent-inset:inset 0 0 0 1px color-mix(in oklab, var(--color-primary) 14%, transparent);--shadow-accent-outline:0 0 0 1px color-mix(in oklab, var(--color-primary) 16%, transparent);--shadow-accent-halo:0 0 0 3px oklch(from var(--color-primary) l c h / .16);--shadow-accent-ring:0 0 0 2px var(--color-surface), 0 0 0 4px oklch(from var(--color-primary) l c h / .18);--shadow-accent-ring-strong:0 0 0 2px var(--color-bg), 0 0 0 4px oklch(from var(--color-primary) l c h / .45);--shadow-accent-ring-solid:0 0 0 2px var(--color-primary), 0 0 0 4px oklch(from var(--color-primary) l c h / .2);--shadow-elevated-soft:0 10px 24px color-mix(in oklab, var(--color-surface-ink) 10%, transparent);--shadow-floating-soft:0 14px 34px oklch(0% 0 0/.18);--shadow-floating-hover:0 18px 40px oklch(0% 0 0/.2);--shadow-media-soft:0 16px 40px oklch(0% 0 0/.24);--shadow-media-stage:0 28px 80px oklch(0% 0 0/.28);--shadow-media-modal:0 16px 48px #0009;--shadow-card-strong:0 20px 56px oklch(0% 0 0/.24);--shadow-sheet-inset:inset 0 1px 0 color-mix(in oklab, var(--color-text) 4%, transparent);--shadow-focus:0 0 0 3px oklch(from var(--color-primary) l c h / .15);--shadow-focus-compact:0 0 0 2px oklch(from var(--color-primary) l c h / .45);--interactive-border:color-mix(in oklab, var(--color-primary) 32%, transparent);--interactive-surface:color-mix(in oklab, var(--color-primary) 18%, transparent);--color-text-on-dark:#fff;--shadow-sm:0 1px 2px oklch(0% 0 0/.25);--shadow-md:0 4px 12px oklch(0% 0 0/.35);--shadow-lg:0 12px 32px oklch(0% 0 0/.5)}@media (prefers-color-scheme:dark){:root:not([data-theme]){--color-bg:#0f1117;--color-surface:#161822;--color-surface-2:#1c1e2c;--color-surface-offset:#1a1c28;--color-surface-offset-2:#22243a;--color-surface-dynamic:#2a2c3e;--color-surface-raised:#202330;--color-surface-ink:#050608;--color-divider:#2e3044;--color-border:#383a50;--color-text:#e2e2ea;--color-text-muted:#8b8ba0;--color-text-faint:#5a5a70;--color-text-inverse:#0f1117;--color-primary:#818cf8;--color-primary-hover:#6366f1;--color-primary-active:#4f46e5;--color-primary-highlight:#1e1e3a;--color-comment:#818cf8;--color-comment-soft:#818cf81a;--color-comment-strong:#818cf829;--color-comment-text:#c7d2fe;--color-error:#f87171;--color-error-highlight:#2a1a1a;--color-success:#4ade80;--color-success-highlight:#1a2a1a;--color-warning:#fbbf24;--color-warning-highlight:#2a261a;--surface-fill-subtle:color-mix(in oklab, var(--color-surface) 88%, var(--color-surface-offset) 12%);--surface-fill-strong:color-mix(in oklab, var(--color-surface-offset) 60%, var(--color-surface-offset-2) 40%);--surface-overlay:color-mix(in srgb, var(--color-surface) 84%, var(--color-surface-offset) 16%);--surface-overlay-soft:color-mix(in srgb, var(--color-surface) 88%, var(--color-surface-offset) 12%);--surface-overlay-strong:color-mix(in srgb, var(--color-surface) 90%, var(--color-surface-offset) 10%);--surface-overlay-raised:color-mix(in oklab, var(--color-surface) 94%, transparent);--surface-overlay-header:color-mix(in srgb, var(--color-surface-offset) 76%, var(--color-bg) 24%);--surface-overlay-offset:color-mix(in oklab, var(--color-surface-offset) 82%, transparent);--surface-scrim:oklch(10% 0 0/.42);--surface-scrim-strong:oklch(8% .01 260/.82);--surface-inverse-glass:oklch(18% .02 260/.68);--surface-inverse-glass-hover:oklch(24% .02 260/.82);--surface-media-canvas:#000;--surface-embed-canvas:#121212;--surface-avatar-muted:#ffffff38;--surface-avatar-label:#0f1117d6;--surface-accent-subtle:color-mix(in oklab, var(--color-primary) 8%, var(--color-surface));--surface-accent-soft:color-mix(in oklab, var(--color-primary) 16%, transparent);--surface-accent-strong:color-mix(in oklab, var(--color-primary) 22%, transparent);--surface-success-soft:color-mix(in oklab, var(--color-success) 14%, transparent);--surface-warning-soft:color-mix(in oklab, var(--color-warning) 14%, transparent);--surface-danger-soft:color-mix(in oklab, var(--color-error) 14%, transparent);--surface-comment-shell:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .035), transparent 120px), color-mix(in srgb, var(--color-surface) 96%, var(--color-comment) 4%);--surface-comment-shell-header:color-mix(in srgb, var(--color-surface) 97%, var(--color-comment) 3%);--surface-comment-record:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .028), transparent 70%), color-mix(in srgb, var(--color-surface-2) 95%, var(--color-comment) 5%);--surface-comment-record-hover:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .042), transparent 70%), color-mix(in srgb, var(--color-surface-2) 92%, var(--color-comment) 8%);--surface-comment-record-active:linear-gradient(180deg, oklch(from var(--color-comment) l c h / .055), transparent 72%), color-mix(in srgb, var(--color-surface-2) 90%, var(--color-comment) 10%);--surface-comment-subtle:color-mix(in srgb, var(--color-surface-2) 95%, var(--color-comment) 5%);--surface-comment-subtle-strong:color-mix(in srgb, var(--color-surface-2) 92%, var(--color-comment) 8%);--surface-comment-card:color-mix(in srgb, var(--color-surface) 94%, var(--color-comment) 6%);--surface-comment-elevated:color-mix(in srgb, var(--color-surface) 96%, var(--color-comment) 4%);--surface-comment-offset:color-mix(in srgb, var(--color-surface-offset) 90%, var(--color-comment) 10%);--surface-comment-offset-soft:color-mix(in srgb, var(--color-surface-offset) 88%, var(--color-comment) 12%);--surface-comment-offset-strong:color-mix(in srgb, var(--color-surface-offset) 84%, var(--color-comment) 16%);--surface-comment-offset-active:color-mix(in srgb, var(--color-surface-offset) 72%, var(--color-comment) 28%);--surface-comment-highlight-hover:color-mix(in srgb, var(--color-comment-soft) 74%, var(--color-comment) 26%);--surface-comment-highlight-active:color-mix(in srgb, var(--color-comment-soft) 62%, var(--color-comment) 38%);--surface-comment-selection:color-mix(in srgb, var(--color-surface) 25%, var(--color-comment) 75%);--surface-comment-preview-fade:linear-gradient(180deg, oklch(0% 0 0/0), color-mix(in srgb, var(--color-surface-2) 95%, var(--color-comment) 5%));--border-comment-soft:color-mix(in srgb, var(--color-divider) 90%, var(--color-comment) 10%);--border-comment-muted:color-mix(in srgb, var(--color-divider) 88%, var(--color-comment) 12%);--border-comment-strong:color-mix(in srgb, var(--color-border) 82%, var(--color-comment) 18%);--border-comment-active:color-mix(in srgb, var(--color-border) 78%, var(--color-comment) 22%);--shadow-comment-outline:0 0 0 1px oklch(from var(--color-comment) l c h / .14);--surface-warning-toast:linear-gradient(135deg, oklab(76.8591% .0560995 .154808/.32), color-mix(in oklab, var(--color-surface) 86%, #0b1022 14%) 42%), color-mix(in oklab, var(--color-surface) 74%, #1b1320 26%);--border-warning-toast:oklab(79.4887% .0497246 .137216/.88);--text-warning-toast:oklab(99.6952% -.000454402 .00461993);--shadow-warning-toast:0 18px 34px #00000061, 0 0 0 1px oklab(76.8591% .0560995 .154808/.18);--border-accent-soft:color-mix(in oklab, var(--color-primary) 22%, transparent);--border-accent-muted:color-mix(in oklab, var(--color-primary) 24%, var(--color-border));--border-accent-strong:color-mix(in oklab, var(--color-primary) 34%, var(--color-border));--border-accent-stronger:color-mix(in oklab, var(--color-primary) 40%, var(--color-border));--shadow-accent-inset:inset 0 0 0 1px color-mix(in oklab, var(--color-primary) 14%, transparent);--shadow-accent-outline:0 0 0 1px color-mix(in oklab, var(--color-primary) 16%, transparent);--shadow-accent-halo:0 0 0 3px oklch(from var(--color-primary) l c h / .16);--shadow-accent-ring:0 0 0 2px var(--color-surface), 0 0 0 4px oklch(from var(--color-primary) l c h / .18);--shadow-accent-ring-strong:0 0 0 2px var(--color-bg), 0 0 0 4px oklch(from var(--color-primary) l c h / .45);--shadow-accent-ring-solid:0 0 0 2px var(--color-primary), 0 0 0 4px oklch(from var(--color-primary) l c h / .2);--shadow-elevated-soft:0 10px 24px color-mix(in oklab, var(--color-surface-ink) 10%, transparent);--shadow-floating-soft:0 14px 34px oklch(0% 0 0/.18);--shadow-floating-hover:0 18px 40px oklch(0% 0 0/.2);--shadow-media-soft:0 16px 40px oklch(0% 0 0/.24);--shadow-media-stage:0 28px 80px oklch(0% 0 0/.28);--shadow-media-modal:0 16px 48px #0009;--shadow-card-strong:0 20px 56px oklch(0% 0 0/.24);--shadow-sheet-inset:inset 0 1px 0 color-mix(in oklab, var(--color-text) 4%, transparent);--shadow-focus:0 0 0 3px oklch(from var(--color-primary) l c h / .15);--shadow-focus-compact:0 0 0 2px oklch(from var(--color-primary) l c h / .45);--interactive-border:color-mix(in oklab, var(--color-primary) 32%, transparent);--interactive-surface:color-mix(in oklab, var(--color-primary) 18%, transparent);--color-text-on-dark:#fff;--shadow-sm:0 1px 2px oklch(0% 0 0/.25);--shadow-md:0 4px 12px oklch(0% 0 0/.35);--shadow-lg:0 12px 32px oklch(0% 0 0/.5)}}*,:before,:after{box-sizing:border-box;margin:0;padding:0}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;scroll-behavior:smooth;hanging-punctuation:first last;scroll-padding-top:var(--space-16);overscroll-behavior:none;height:100%;overflow:hidden}body{height:100%;min-height:100dvh;line-height:1.6;font-family:var(--font-body,sans-serif);font-size:var(--text-sm);color:var(--color-text);background-color:var(--color-bg);overflow:hidden}img,picture,video,canvas,svg{max-width:100%;height:auto;display:block}ul[role=list],ol[role=list]{list-style:none}input,button,textarea,select{font:inherit;color:inherit}h1,h2,h3,h4,h5,h6{font-family:var(--font-display,inherit);text-wrap:balance;line-height:1.15}p,li,figcaption{text-wrap:pretty;max-width:72ch}::selection{background:oklch(from var(--color-primary) l c h / .25);color:var(--color-text)}:focus-visible{outline:2px solid var(--color-primary);outline-offset:3px;border-radius:var(--radius-sm)}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}button{cursor:pointer;background:0 0;border:none}table{border-collapse:collapse;width:100%}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}html,body{width:100%;height:100%;margin:0;overflow:hidden}body[data-surface]{font-family:var(--font-body);font-size:var(--text-ui-sm);color:var(--color-text);background:var(--color-bg)}#root{width:100%;height:100%}