texlite 0.9.4 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -40
- package/README.zh-CN.md +56 -34
- package/dist/client/assets/{AdminUsers-B12FJUMy.js → AdminUsers-C7oU_1Y_.js} +1 -1
- package/dist/client/assets/{CitationLibraryDialog-BTmnCP4V.js → CitationLibraryDialog-CU2b0xtm.js} +1 -1
- package/dist/client/assets/{Dashboard-JA5_M3TK.js → Dashboard-BB4RO4x2.js} +2 -2
- package/dist/client/assets/{GitDialog--MoUIW0n.js → GitDialog-C2Np1i8v.js} +1 -1
- package/dist/client/assets/{HistoryDialog-LgKbjsTZ.js → HistoryDialog-CdoYeLyX.js} +1 -1
- package/dist/client/assets/{LatexEditor-Dj2zIaQm.js → LatexEditor-Dmy6_gqt.js} +1 -1
- package/dist/client/assets/{PdfPreview-C_W7w360.js → PdfPreview-fDxKh6hP.js} +1 -1
- package/dist/client/assets/{ProjectIconPickerDialog-GzRuM0oQ.js → ProjectIconPickerDialog-CsjMKq7h.js} +1 -1
- package/dist/client/assets/{ProjectNavigationDialogs-BiArHmQ9.js → ProjectNavigationDialogs-_JY0yVob.js} +1 -1
- package/dist/client/assets/{ProjectSettings-DgJohWUv.js → ProjectSettings-DXGA-lmB.js} +1 -1
- package/dist/client/assets/{ProjectWorkspace-C6sYiBF2.js → ProjectWorkspace-mCYjyc6e.js} +20 -20
- package/dist/client/assets/{SelectionHistoryDialog-Bpv6nvrC.js → SelectionHistoryDialog-D8CeqjLD.js} +1 -1
- package/dist/client/assets/{SystemMetricsDialog-hJQATmd4.js → SystemMetricsDialog-BZx7ZMQt.js} +1 -1
- package/dist/client/assets/{TagManagementDialog-BHC8qULq.js → TagManagementDialog-4R1Gs43j.js} +1 -1
- package/dist/client/assets/{WordCountDialog-DZhhO94k.js → WordCountDialog-C-MCscAu.js} +1 -1
- package/dist/client/assets/check-Jf8WBxDX.js +1 -0
- package/dist/client/assets/{hard-drive-BWZnOgnm.js → hard-drive-Bsk-RETn.js} +1 -1
- package/dist/client/assets/{index-p1NHkGGG.js → index-B6rP7QsM.js} +2 -2
- package/dist/client/assets/{index-kTamGfTl.js → index-Csp5J5aI.js} +1 -1
- package/dist/client/assets/index-DGZNAyxW.css +1 -0
- package/dist/client/assets/{key-round-CoDwyVJc.js → key-round-DqptHHKC.js} +1 -1
- package/dist/client/assets/{minimize-2-D100opW2.js → minimize-2-92UqFWI9.js} +1 -1
- package/dist/client/assets/{minus-DDTYB-Oz.js → minus-bx4ZLZnb.js} +1 -1
- package/dist/client/assets/{plus-BVXOlQXP.js → plus-DQg_bV50.js} +1 -1
- package/dist/client/assets/{refresh-cw-LtwnqlWh.js → refresh-cw-BoMEkk5J.js} +1 -1
- package/dist/client/assets/{search-DXo_aAp0.js → search-UZspmceH.js} +1 -1
- package/dist/client/assets/{sigma-BgvHGPto.js → sigma-C0IvFdKV.js} +1 -1
- package/dist/client/assets/{spellCheck-BtRppKcC.js → spellCheck-DyKIHf5C.js} +1 -1
- package/dist/client/assets/{tags-m9kppdi0.js → tags-BTUtvaAc.js} +1 -1
- package/dist/client/assets/{type-YO4aprqE.js → type-XvvfEJRs.js} +1 -1
- package/dist/client/assets/{user-plus-MRmKeDtX.js → user-plus-Chr9T97G.js} +1 -1
- package/dist/client/assets/{x-eisRQJv_.js → x-DlFXD9Vl.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/check-C1db8iNn.js +0 -1
- package/dist/client/assets/index-BiwJj0Np.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./katex-D9PXdmFF.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{u as To,r as Y,j as Ve}from"./react-BVUjbTTn.js";import{s as Hr,E as pe,V as dt,D as J,a as ln,R as Ro,P as Wr,S as Ct,b as Le,f as Ao,M as Zr,m as ur,i as Po,c as No,d as Do,e as Bo,g as Fo,h as Io,j as fr,k as wn,l as It,n as $o,o as Vo,p as _o,q as Qo,r as jo,t as Ko,u as qo,v as zo,w as Uo,x as Xo,y as ut,F as $t,A as Sn,z as cn,W as Yr,B as Gr,L as Ho,C as Wo,G as Zo,H as Yo,I as ft,J as Go,K as ae,N as Jo,O as Vt,Q as Jr,T as ie,U as ea,X as ei,Y as Xe,Z as ta,_ as Bt,$ as ti,a0 as na,a1 as ra,a2 as At,a3 as ia,a4 as oa,a5 as aa,a6 as sa,a7 as la,a8 as dr,a9 as ca,aa as ua,ab as fa,ac as da,ad as ha,ae as pa,af as ma,ag as ga,ah as va,ai as ya,aj as ba,ak as ka,al as Oa,am as Ca,an as wa,ao as Sa,ap as xa,aq as Ma}from"./editor-B9HNwtsd.js";import{r as hr,a as bt,U as ni,b as un,d as fn,e as pr,m as Ea,f as La,g as tn,t as Pt,h as Nt,i as xn,l as Mn,j as _t,k as En,n as ri,o as ii,p as Ft,q as Ln,u as Ta,v as dn,w as oi,x as nn,y as Ra,z as Aa}from"./ProjectWorkspace-C6sYiBF2.js";import{_ as mr}from"./index-p1NHkGGG.js";import"./check-C1db8iNn.js";import"./x-eisRQJv_.js";import"./search-DXo_aAp0.js";import"./user-plus-MRmKeDtX.js";import"./refresh-cw-LtwnqlWh.js";function Pa(t){var n=t.Pos;function o(e,r,i){if(r.line===i.line&&r.ch>=i.ch-1){var a=e.getLine(r.line),l=a.charCodeAt(r.ch);55296<=l&&l<=55551&&(i.ch+=1)}return{start:r,end:i}}var s=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"gc",type:"operator",operator:"toggleComment",isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],c=Object.create(null),f=s.length,m=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"put",shortName:"pu"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],g=ue("");function b(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),t.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",ir),qe(e),t.on(e.getInputField(),"paste",M(e))}function S(e){e.setOption("disableInput",!1),e.off("cursorActivity",ir),t.off(e.getInputField(),"paste",M(e)),e.state.vim=null,vt&&clearTimeout(vt)}function M(e){var r=e.state.vim;return r.onPasteFn||(r.onPasteFn=function(){r.insertMode||(e.setCursor(de(e.getCursor(),0,1)),rt.enterInsertMode(e,{},r))}),r.onPasteFn}var A=/[\d]/,P=[t.isWordChar,function(e){return e&&!t.isWordChar(e)&&!/\s/.test(e)}],E=[function(e){return/\S/.test(e)}],T=["<",">"],R=["-",'"',".",":","_","/","+"],_=/^\w$/,U=/^[A-Z]$/;try{U=new RegExp("^[\\p{Lu}]$","u")}catch{}function ee(e,r){return r>=e.firstLine()&&r<=e.lastLine()}function te(e){return/^[a-z]$/.test(e)}function q(e){return"()[]{}".indexOf(e)!=-1}function le(e){return A.test(e)}function Oe(e){return U.test(e)}function H(e){return/^\s*$/.test(e)}function je(e){return".?!".indexOf(e)!=-1}function et(e,r){for(var i=0;i<r.length;i++)if(r[i]==e)return!0;return!1}var Te={};function Ke(e,r,i,a,l){if(r===void 0&&!l)throw Error("defaultValue is required unless callback is provided");if(i||(i="string"),Te[e]={type:i,defaultValue:r,callback:l},a)for(var u=0;u<a.length;u++)Te[a[u]]=Te[e];r&&tt(e,r)}function tt(e,r,i,a){var l=Te[e];a=a||{};var u=a.scope;if(!l)return new Error("Unknown option: "+e);if(l.type=="boolean"){if(r&&r!==!0)return new Error("Invalid argument: "+e+"="+r);r!==!1&&(r=!0)}l.callback?(u!=="local"&&l.callback(r,void 0),u!=="global"&&i&&l.callback(r,i)):(u!=="local"&&(l.value=l.type=="boolean"?!!r:r),u!=="global"&&i&&(i.state.vim.options[e]={value:r}))}function be(e,r,i){var a=Te[e];i=i||{};var l=i.scope;if(!a)return new Error("Unknown option: "+e);if(a.callback){let u=r&&a.callback(void 0,r);return l!=="global"&&u!==void 0?u:l!=="local"?a.callback():void 0}else return(l!=="global"&&r&&r.state.vim.options[e]||l!=="local"&&a||{}).value}Ke("filetype",void 0,"string",["ft"],function(e,r){if(r!==void 0)if(e===void 0){let i=r.getOption("mode");return i=="null"?"":i}else{let i=e==""?"null":e;r.setOption("mode",i)}}),Ke("textwidth",80,"number",["tw"],function(e,r){if(r!==void 0)if(e===void 0){var i=r.getOption("textwidth");return i}else{var a=Math.round(e);a>1&&r.setOption("textwidth",a)}});var xt=function(){var e=100,r=-1,i=0,a=0,l=new Array(e);function u(p,v,y){var O=r%e,C=l[O];function w(x){var L=++r%e,F=l[L];F&&F.clear(),l[L]=p.setBookmark(x)}if(C){var k=C.find();k&&!Ae(k,v)&&w(v)}else w(v);w(y),i=r,a=r-e+1,a<0&&(a=0)}function d(p,v){r+=v,r>i?r=i:r<a&&(r=a);var y=l[(e+r)%e];if(y&&!y.find()){var O=v>0?1:-1,C,w=p.getCursor();do if(r+=O,y=l[(e+r)%e],y&&(C=y.find())&&!Ae(w,C))break;while(r<i&&r>a)}return y}function h(p,v){var y=r,O=d(p,v);return r=y,O&&O.find()}return{cachedCursor:void 0,add:u,find:h,move:d}},ht=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class Mt{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ht()}exitMacroRecordMode(){var r=N.macroModeState;r.onRecordingDone&&r.onRecordingDone(),r.onRecordingDone=void 0,r.isRecording=!1}enterMacroRecordMode(r,i){var a=N.registerController.getRegister(i);if(a){if(a.clear(),this.latestRegister=i,r.openDialog){var l=De("span",{class:"cm-vim-message"},"recording @"+i);this.onRecordingDone=r.openDialog(l,function(){},{bottom:!0})}this.isRecording=!0}}}function qe(e){return e.state.vim||(e.state.vim={inputState:new fe,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new n(0,0),head:new n(0,0)},options:{},expectLiteralNext:!1,status:""}),e.state.vim}var N;function pt(){N={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:xt(),macroModeState:new Mt,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new Et({}),searchHistoryController:new Dn,exCommandHistoryController:new Dn};for(var e in Te){var r=Te[e];r.value=r.defaultValue}}class st{constructor(r,i){this.keyName=r,this.key=i.key,this.ctrlKey=i.ctrlKey,this.altKey=i.altKey,this.metaKey=i.metaKey,this.shiftKey=i.shiftKey}}var He,me={enterVimMode:b,leaveVimMode:S,buildKeyMap:function(){},getRegisterController:function(){return N.registerController},resetVimGlobalState_:pt,getVimGlobalState_:function(){return N},maybeInitVimState_:qe,suppressErrorLogging:!1,InsertModeKey:st,map:function(e,r,i){Se.map(e,r,i)},unmap:function(e,r){return Se.unmap(e,r)},noremap:function(e,r,i){Se.map(e,r,i,!0)},mapclear:function(e){var r=s.length,i=f,a=s.slice(0,r-i);if(s=s.slice(r-i),e)for(var l=a.length-1;l>=0;l--){var u=a[l];if(e!==u.context)if(u.context)this._mapCommand(u);else{var d=["normal","insert","visual"];for(var h in d)if(d[h]!==e){var p=Object.assign({},u);p.context=d[h],this._mapCommand(p)}}}},langmap:Q,vimKeyFromEvent:ce,setOption:tt,getOption:be,defineOption:Ke,defineEx:function(e,r,i){if(!r)r=e;else if(e.indexOf(r)!==0)throw new Error('(Vim.defineEx) "'+r+'" is not a prefix of "'+e+'", command not registered');nr[e]=i,Se.commandMap_[r]={name:e,shortName:r,type:"api"}},handleKey:function(e,r,i){var a=this.findKey(e,r,i);if(typeof a=="function")return a()},multiSelectHandleKey:Lo,findKey:function(e,r,i){var a=qe(e),l=e;function u(){var y=N.macroModeState;if(y.isRecording){if(r=="q")return y.exitMacroRecordMode(),oe(l),!0;i!="mapping"&&xo(y,r)}}function d(){if(r=="<Esc>"){if(a.visualMode)Ie(l);else if(a.insertMode)Je(l);else return;return oe(l),!0}}function h(){if(d())return!0;a.inputState.keyBuffer.push(r);var y=a.inputState.keyBuffer.join(""),O=r.length==1,C=nt.matchCommand(y,s,a.inputState,"insert"),w=a.inputState.changeQueue;if(C.type=="none")return oe(l),!1;if(C.type=="partial"){if(C.expectLiteralNext&&(a.expectLiteralNext=!0),He&&window.clearTimeout(He),He=O&&window.setTimeout(function(){a.insertMode&&a.inputState.keyBuffer.length&&oe(l)},be("insertModeEscKeysTimeout")),O){var k=l.listSelections();(!w||w.removed.length!=k.length)&&(w=a.inputState.changeQueue=new mt),w.inserted+=r;for(var x=0;x<k.length;x++){var L=we(k[x].anchor,k[x].head),F=Ge(k[x].anchor,k[x].head),D=l.getRange(L,l.state.overwrite?de(F,0,1):F);w.removed[x]=(w.removed[x]||"")+D}}return!O}else C.type=="full"&&(a.inputState.keyBuffer.length=0);if(a.expectLiteralNext=!1,He&&window.clearTimeout(He),C.command&&w){for(var k=l.listSelections(),x=0;x<k.length;x++){var B=k[x].head;l.replaceRange(w.removed[x]||"",de(B,0,-w.inserted.length),B,"+input")}N.macroModeState.lastInsertModeChanges.changes.pop()}return C.command||oe(l),C.command}function p(){if(u()||d())return!0;a.inputState.keyBuffer.push(r);var y=a.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(y))return!0;var O=/^(\d*)(.*)$/.exec(y);if(!O)return oe(l),!1;var C=a.visualMode?"visual":"normal",w=O[2]||O[1];a.inputState.operatorShortcut&&a.inputState.operatorShortcut.slice(-1)==w&&(w=a.inputState.operatorShortcut);var k=nt.matchCommand(w,s,a.inputState,C);return k.type=="none"?(oe(l),!1):k.type=="partial"?(k.expectLiteralNext&&(a.expectLiteralNext=!0),!0):k.type=="clear"?(oe(l),!0):(a.expectLiteralNext=!1,a.inputState.keyBuffer.length=0,O=/^(\d*)(.*)$/.exec(y),O&&O[1]&&O[1]!="0"&&a.inputState.pushRepeatDigit(O[1]),k.command)}var v=a.insertMode?h():p();if(v===!1)return!a.insertMode&&(r.length===1||t.isMac&&/<A-.>/.test(r))?function(){return!0}:void 0;if(v===!0)return function(){return!0};if(v)return function(){return l.operation(function(){l.curOp.isVimOp=!0;try{if(typeof v!="object")return;v.type=="keyToKey"?Ye(l,v.toKeys,v):nt.processCommand(l,a,v)}catch(y){throw l.state.vim=void 0,qe(l),me.suppressErrorLogging||console.log(y),y}return!0})}},handleEx:function(e,r){Se.processCommand(e,r)},defineMotion:Vi,defineAction:Qi,defineOperator:_i,mapCommand:wo,_mapCommand:Yt,defineRegister:Kt,exitVisualMode:Ie,exitInsertMode:Je},We=[],Ze=!1,W;function ze(e){if(!W)throw new Error("No prompt to send key to");if(e[0]=="<"){var r=e.toLowerCase().slice(1,-1),i=r.split("-");if(r=i.pop()||"",r=="lt")e="<";else if(r=="space")e=" ";else if(r=="cr")e=`
|
|
2
|
+
import{u as To,r as Y,j as Ve}from"./react-BVUjbTTn.js";import{s as Hr,E as pe,V as dt,D as J,a as ln,R as Ro,P as Wr,S as Ct,b as Le,f as Ao,M as Zr,m as ur,i as Po,c as No,d as Do,e as Bo,g as Fo,h as Io,j as fr,k as wn,l as It,n as $o,o as Vo,p as _o,q as Qo,r as jo,t as Ko,u as qo,v as zo,w as Uo,x as Xo,y as ut,F as $t,A as Sn,z as cn,W as Yr,B as Gr,L as Ho,C as Wo,G as Zo,H as Yo,I as ft,J as Go,K as ae,N as Jo,O as Vt,Q as Jr,T as ie,U as ea,X as ei,Y as Xe,Z as ta,_ as Bt,$ as ti,a0 as na,a1 as ra,a2 as At,a3 as ia,a4 as oa,a5 as aa,a6 as sa,a7 as la,a8 as dr,a9 as ca,aa as ua,ab as fa,ac as da,ad as ha,ae as pa,af as ma,ag as ga,ah as va,ai as ya,aj as ba,ak as ka,al as Oa,am as Ca,an as wa,ao as Sa,ap as xa,aq as Ma}from"./editor-B9HNwtsd.js";import{r as hr,a as bt,U as ni,b as un,d as fn,e as pr,m as Ea,f as La,g as tn,t as Pt,h as Nt,i as xn,l as Mn,j as _t,k as En,n as ri,o as ii,p as Ft,q as Ln,u as Ta,v as dn,w as oi,x as nn,y as Ra,z as Aa}from"./ProjectWorkspace-mCYjyc6e.js";import{_ as mr}from"./index-B6rP7QsM.js";import"./check-Jf8WBxDX.js";import"./x-DlFXD9Vl.js";import"./search-UZspmceH.js";import"./user-plus-Chr9T97G.js";import"./refresh-cw-BoMEkk5J.js";function Pa(t){var n=t.Pos;function o(e,r,i){if(r.line===i.line&&r.ch>=i.ch-1){var a=e.getLine(r.line),l=a.charCodeAt(r.ch);55296<=l&&l<=55551&&(i.ch+=1)}return{start:r,end:i}}var s=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"gc",type:"operator",operator:"toggleComment",isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],c=Object.create(null),f=s.length,m=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"put",shortName:"pu"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],g=ue("");function b(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),t.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",ir),qe(e),t.on(e.getInputField(),"paste",M(e))}function S(e){e.setOption("disableInput",!1),e.off("cursorActivity",ir),t.off(e.getInputField(),"paste",M(e)),e.state.vim=null,vt&&clearTimeout(vt)}function M(e){var r=e.state.vim;return r.onPasteFn||(r.onPasteFn=function(){r.insertMode||(e.setCursor(de(e.getCursor(),0,1)),rt.enterInsertMode(e,{},r))}),r.onPasteFn}var A=/[\d]/,P=[t.isWordChar,function(e){return e&&!t.isWordChar(e)&&!/\s/.test(e)}],E=[function(e){return/\S/.test(e)}],T=["<",">"],R=["-",'"',".",":","_","/","+"],_=/^\w$/,U=/^[A-Z]$/;try{U=new RegExp("^[\\p{Lu}]$","u")}catch{}function ee(e,r){return r>=e.firstLine()&&r<=e.lastLine()}function te(e){return/^[a-z]$/.test(e)}function q(e){return"()[]{}".indexOf(e)!=-1}function le(e){return A.test(e)}function Oe(e){return U.test(e)}function H(e){return/^\s*$/.test(e)}function je(e){return".?!".indexOf(e)!=-1}function et(e,r){for(var i=0;i<r.length;i++)if(r[i]==e)return!0;return!1}var Te={};function Ke(e,r,i,a,l){if(r===void 0&&!l)throw Error("defaultValue is required unless callback is provided");if(i||(i="string"),Te[e]={type:i,defaultValue:r,callback:l},a)for(var u=0;u<a.length;u++)Te[a[u]]=Te[e];r&&tt(e,r)}function tt(e,r,i,a){var l=Te[e];a=a||{};var u=a.scope;if(!l)return new Error("Unknown option: "+e);if(l.type=="boolean"){if(r&&r!==!0)return new Error("Invalid argument: "+e+"="+r);r!==!1&&(r=!0)}l.callback?(u!=="local"&&l.callback(r,void 0),u!=="global"&&i&&l.callback(r,i)):(u!=="local"&&(l.value=l.type=="boolean"?!!r:r),u!=="global"&&i&&(i.state.vim.options[e]={value:r}))}function be(e,r,i){var a=Te[e];i=i||{};var l=i.scope;if(!a)return new Error("Unknown option: "+e);if(a.callback){let u=r&&a.callback(void 0,r);return l!=="global"&&u!==void 0?u:l!=="local"?a.callback():void 0}else return(l!=="global"&&r&&r.state.vim.options[e]||l!=="local"&&a||{}).value}Ke("filetype",void 0,"string",["ft"],function(e,r){if(r!==void 0)if(e===void 0){let i=r.getOption("mode");return i=="null"?"":i}else{let i=e==""?"null":e;r.setOption("mode",i)}}),Ke("textwidth",80,"number",["tw"],function(e,r){if(r!==void 0)if(e===void 0){var i=r.getOption("textwidth");return i}else{var a=Math.round(e);a>1&&r.setOption("textwidth",a)}});var xt=function(){var e=100,r=-1,i=0,a=0,l=new Array(e);function u(p,v,y){var O=r%e,C=l[O];function w(x){var L=++r%e,F=l[L];F&&F.clear(),l[L]=p.setBookmark(x)}if(C){var k=C.find();k&&!Ae(k,v)&&w(v)}else w(v);w(y),i=r,a=r-e+1,a<0&&(a=0)}function d(p,v){r+=v,r>i?r=i:r<a&&(r=a);var y=l[(e+r)%e];if(y&&!y.find()){var O=v>0?1:-1,C,w=p.getCursor();do if(r+=O,y=l[(e+r)%e],y&&(C=y.find())&&!Ae(w,C))break;while(r<i&&r>a)}return y}function h(p,v){var y=r,O=d(p,v);return r=y,O&&O.find()}return{cachedCursor:void 0,add:u,find:h,move:d}},ht=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class Mt{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ht()}exitMacroRecordMode(){var r=N.macroModeState;r.onRecordingDone&&r.onRecordingDone(),r.onRecordingDone=void 0,r.isRecording=!1}enterMacroRecordMode(r,i){var a=N.registerController.getRegister(i);if(a){if(a.clear(),this.latestRegister=i,r.openDialog){var l=De("span",{class:"cm-vim-message"},"recording @"+i);this.onRecordingDone=r.openDialog(l,function(){},{bottom:!0})}this.isRecording=!0}}}function qe(e){return e.state.vim||(e.state.vim={inputState:new fe,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new n(0,0),head:new n(0,0)},options:{},expectLiteralNext:!1,status:""}),e.state.vim}var N;function pt(){N={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:xt(),macroModeState:new Mt,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new Et({}),searchHistoryController:new Dn,exCommandHistoryController:new Dn};for(var e in Te){var r=Te[e];r.value=r.defaultValue}}class st{constructor(r,i){this.keyName=r,this.key=i.key,this.ctrlKey=i.ctrlKey,this.altKey=i.altKey,this.metaKey=i.metaKey,this.shiftKey=i.shiftKey}}var He,me={enterVimMode:b,leaveVimMode:S,buildKeyMap:function(){},getRegisterController:function(){return N.registerController},resetVimGlobalState_:pt,getVimGlobalState_:function(){return N},maybeInitVimState_:qe,suppressErrorLogging:!1,InsertModeKey:st,map:function(e,r,i){Se.map(e,r,i)},unmap:function(e,r){return Se.unmap(e,r)},noremap:function(e,r,i){Se.map(e,r,i,!0)},mapclear:function(e){var r=s.length,i=f,a=s.slice(0,r-i);if(s=s.slice(r-i),e)for(var l=a.length-1;l>=0;l--){var u=a[l];if(e!==u.context)if(u.context)this._mapCommand(u);else{var d=["normal","insert","visual"];for(var h in d)if(d[h]!==e){var p=Object.assign({},u);p.context=d[h],this._mapCommand(p)}}}},langmap:Q,vimKeyFromEvent:ce,setOption:tt,getOption:be,defineOption:Ke,defineEx:function(e,r,i){if(!r)r=e;else if(e.indexOf(r)!==0)throw new Error('(Vim.defineEx) "'+r+'" is not a prefix of "'+e+'", command not registered');nr[e]=i,Se.commandMap_[r]={name:e,shortName:r,type:"api"}},handleKey:function(e,r,i){var a=this.findKey(e,r,i);if(typeof a=="function")return a()},multiSelectHandleKey:Lo,findKey:function(e,r,i){var a=qe(e),l=e;function u(){var y=N.macroModeState;if(y.isRecording){if(r=="q")return y.exitMacroRecordMode(),oe(l),!0;i!="mapping"&&xo(y,r)}}function d(){if(r=="<Esc>"){if(a.visualMode)Ie(l);else if(a.insertMode)Je(l);else return;return oe(l),!0}}function h(){if(d())return!0;a.inputState.keyBuffer.push(r);var y=a.inputState.keyBuffer.join(""),O=r.length==1,C=nt.matchCommand(y,s,a.inputState,"insert"),w=a.inputState.changeQueue;if(C.type=="none")return oe(l),!1;if(C.type=="partial"){if(C.expectLiteralNext&&(a.expectLiteralNext=!0),He&&window.clearTimeout(He),He=O&&window.setTimeout(function(){a.insertMode&&a.inputState.keyBuffer.length&&oe(l)},be("insertModeEscKeysTimeout")),O){var k=l.listSelections();(!w||w.removed.length!=k.length)&&(w=a.inputState.changeQueue=new mt),w.inserted+=r;for(var x=0;x<k.length;x++){var L=we(k[x].anchor,k[x].head),F=Ge(k[x].anchor,k[x].head),D=l.getRange(L,l.state.overwrite?de(F,0,1):F);w.removed[x]=(w.removed[x]||"")+D}}return!O}else C.type=="full"&&(a.inputState.keyBuffer.length=0);if(a.expectLiteralNext=!1,He&&window.clearTimeout(He),C.command&&w){for(var k=l.listSelections(),x=0;x<k.length;x++){var B=k[x].head;l.replaceRange(w.removed[x]||"",de(B,0,-w.inserted.length),B,"+input")}N.macroModeState.lastInsertModeChanges.changes.pop()}return C.command||oe(l),C.command}function p(){if(u()||d())return!0;a.inputState.keyBuffer.push(r);var y=a.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(y))return!0;var O=/^(\d*)(.*)$/.exec(y);if(!O)return oe(l),!1;var C=a.visualMode?"visual":"normal",w=O[2]||O[1];a.inputState.operatorShortcut&&a.inputState.operatorShortcut.slice(-1)==w&&(w=a.inputState.operatorShortcut);var k=nt.matchCommand(w,s,a.inputState,C);return k.type=="none"?(oe(l),!1):k.type=="partial"?(k.expectLiteralNext&&(a.expectLiteralNext=!0),!0):k.type=="clear"?(oe(l),!0):(a.expectLiteralNext=!1,a.inputState.keyBuffer.length=0,O=/^(\d*)(.*)$/.exec(y),O&&O[1]&&O[1]!="0"&&a.inputState.pushRepeatDigit(O[1]),k.command)}var v=a.insertMode?h():p();if(v===!1)return!a.insertMode&&(r.length===1||t.isMac&&/<A-.>/.test(r))?function(){return!0}:void 0;if(v===!0)return function(){return!0};if(v)return function(){return l.operation(function(){l.curOp.isVimOp=!0;try{if(typeof v!="object")return;v.type=="keyToKey"?Ye(l,v.toKeys,v):nt.processCommand(l,a,v)}catch(y){throw l.state.vim=void 0,qe(l),me.suppressErrorLogging||console.log(y),y}return!0})}},handleEx:function(e,r){Se.processCommand(e,r)},defineMotion:Vi,defineAction:Qi,defineOperator:_i,mapCommand:wo,_mapCommand:Yt,defineRegister:Kt,exitVisualMode:Ie,exitInsertMode:Je},We=[],Ze=!1,W;function ze(e){if(!W)throw new Error("No prompt to send key to");if(e[0]=="<"){var r=e.toLowerCase().slice(1,-1),i=r.split("-");if(r=i.pop()||"",r=="lt")e="<";else if(r=="space")e=" ";else if(r=="cr")e=`
|
|
3
3
|
`;else if(Z[r]){var a=W.value||"",l={key:Z[r],target:{value:a,selectionEnd:a.length,selectionStart:a.length}};W.onKeyDown&&W.onKeyDown(l,W.value,d),W&&W.onKeyUp&&W.onKeyUp(l,W.value,d);return}}if(e==`
|
|
4
4
|
`){var u=W;W=null,u.onClose&&u.onClose(u.value)}else W.value=(W.value||"")+e;function d(h){W&&(typeof h=="string"?W.value=h:W=null)}}function Ye(e,r,i){var a=Ze;if(i){if(We.indexOf(i)!=-1)return;We.push(i),Ze=i.noremap!=!1}try{for(var l=qe(e),u=/<(?:[CSMA]-)*\w+>|./gi,d;d=u.exec(r);){var h=d[0],p=l.insertMode;if(W){ze(h);continue}var v=me.handleKey(e,h,"mapping");if(!v&&p&&l.insertMode){if(h[0]=="<"){var y=h.toLowerCase().slice(1,-1),O=y.split("-");if(y=O.pop()||"",y=="lt")h="<";else if(y=="space")h=" ";else if(y=="cr")h=`
|
|
5
5
|
`;else if(Z.hasOwnProperty(y)){h=Z[y],lr(e,h);continue}else h=h[0],u.lastIndex=d.index+1}e.replaceSelection(h)}}}finally{if(We.pop(),Ze=We.length?a:!1,!We.length&&W){var C=W;W=null,Tt(e,C)}}}var I={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},G={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},Z={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(I)).forEach(function(e){Z[(I[e]||"").toLowerCase()]=Z[e.toLowerCase()]=e});function ce(e,r){var i=e.key;if(!G[i]){i.length>1&&i[0]=="n"&&(i=i.replace("Numpad","")),i=I[i]||i;var a="";if(e.ctrlKey&&(a+="C-"),e.altKey&&(a+="A-"),e.metaKey&&(a+="M-"),t.isMac&&a=="A-"&&i.length==1&&(a=a.slice(2)),(a||i.length>1)&&e.shiftKey&&(a+="S-"),r&&!r.expectLiteralNext&&i.length==1){if(g.keymap&&i in g.keymap)(g.remapCtrl!=!1||!a)&&(i=g.keymap[i]);else if(i.charCodeAt(0)>128&&!c[i]){var l=e.code?.slice(-1)||"";e.shiftKey||(l=l.toLowerCase()),l&&(i=l,!a&&e.altKey&&(a="A-"))}}return a+=i,a.length>1&&(a="<"+a+">"),a}}function Q(e,r){g.string!==e&&(g=ue(e)),g.remapCtrl=r}function ue(e){let r={};if(!e)return{keymap:r,string:""};function i(a){return a.split(/\\?(.)/).filter(Boolean)}return e.split(/((?:[^\\,]|\\.)+),/).map(a=>{if(!a)return;const l=a.split(/((?:[^\\;]|\\.)+);/);if(l.length==3){const u=i(l[1]),d=i(l[2]);if(u.length!==d.length)return;for(let h=0;h<u.length;++h)r[u[h]]=d[h]}else if(l.length==1){const u=i(a);if(u.length%2!==0)return;for(let d=0;d<u.length;d+=2)r[u[d]]=u[d+1]}}),{keymap:r,string:e}}Ke("langmap",void 0,"string",["lmap"],function(e,r){if(e===void 0)return g.string;Q(e)});class fe{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(r){this.operator?this.motionRepeat=this.motionRepeat.concat(r):this.prefixRepeat=this.prefixRepeat.concat(r)}getRepeat(){var r=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(r=1,this.prefixRepeat.length>0&&(r*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(r*=parseInt(this.motionRepeat.join(""),10))),r}}function oe(e,r){e.state.vim.inputState=new fe,e.state.vim.expectLiteralNext=!1,t.signal(e,"vim-command-done",r)}function mt(){this.removed=[],this.inserted=""}class Re{constructor(r,i,a){this.clear(),this.keyBuffer=[r||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!i,this.blockwise=!!a}setText(r,i,a){this.keyBuffer=[r||""],this.linewise=!!i,this.blockwise=!!a}pushText(r,i){i&&(this.linewise||this.keyBuffer.push(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as X,r as s,j as i}from"./react-BVUjbTTn.js";import{P as K,g as J,w as Q,G as ee}from"./pdf-DUYcbPMK.js";import{M as te,a as ne}from"./minus-
|
|
1
|
+
import{u as X,r as s,j as i}from"./react-BVUjbTTn.js";import{P as K,g as J,w as Q,G as ee}from"./pdf-DUYcbPMK.js";import{M as te,a as ne}from"./minus-bx4ZLZnb.js";import{P as re}from"./plus-DQg_bV50.js";import{d as V}from"./index-B6rP7QsM.js";ee.workerSrc=Q;const Y=new K,O=2,R=new Map;async function fe(){await Y.promise}function _(a,r){const o=`${r}:${a}`,f=R.get(o);if(f)return f.lastUsed=Date.now(),f;const u=J({url:a,worker:Y,disableRange:r==="full"}),c={task:u,promise:u.promise,consumers:0,settled:!1,lastUsed:Date.now()};return R.set(o,c),c.promise.then(()=>{c.settled=!0,q()},()=>{c.settled=!0,R.get(o)===c&&R.delete(o)}),c}function q(){if(R.size<=O)return;const a=[...R.entries()].filter(([,r])=>r.consumers===0&&r.settled).sort((r,o)=>r[1].lastUsed-o[1].lastUsed);for(;R.size>O&&a.length;){const[r,o]=a.shift();R.get(r)===o&&(R.delete(r),o.task.destroy())}}function he(a,r){if(!a)return;_(a,r).promise.catch(()=>{})}function se(a,r){const o=_(a,r);o.consumers+=1,o.lastUsed=Date.now();let f=!1;return{promise:o.promise,release:()=>{f||(f=!0,o.consumers=Math.max(0,o.consumers-1),o.lastUsed=Date.now(),q())}}}function me({url:a,loadingMode:r,target:o,compiling:f=!1,onViewportLocation:u,onDoubleClickLocation:c}){const{t:h}=X(),x=s.useRef(null),[m,D]=s.useState(null),[g,p]=s.useState(0),[d,E]=s.useState(100),[v,N]=s.useState(""),b=s.useRef(new Map),w=s.useRef(null),k=s.useRef(u);k.current=u;const M=s.useCallback((t,e)=>{e?b.current.set(t,e):b.current.delete(t)},[]),C=async t=>{if(!m||t==null)return;let e=t;if(typeof t=="string"&&(e=await m.getDestination(t).catch(()=>null)),!Array.isArray(e)||e.length===0)return;const l=e[0];let n=null;if(typeof l=="number"&&Number.isInteger(l))n=l;else if(l!=null)try{n=await m.getPageIndex(l)}catch{return}n==null||n<0||n>=m.numPages||b.current.get(n+1)?.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},y=s.useCallback(()=>{w.current=null;const t=x.current;if(!t)return;const e=t.getBoundingClientRect(),l=e.left+e.width/2,n=e.top+e.height/2,P=[...t.querySelectorAll(".pdf-page")],S=P.find(F=>{const I=F.getBoundingClientRect();return n>=I.top&&n<=I.bottom})??P.reduce((F,I)=>{if(!F)return I;const H=Math.abs(I.getBoundingClientRect().top-n),G=Math.abs(F.getBoundingClientRect().top-n);return H<G?I:F},null);if(!S)return;const j=S.getBoundingClientRect(),U=Number(S.dataset.scale)||1,T=Number(S.dataset.page),$=Math.max(0,Math.min(j.width,l-j.left))/U,B=Math.max(0,Math.min(j.height,n-j.top))/U;T&&k.current(T,$,B)},[]),A=s.useCallback(()=>{w.current===null&&(w.current=window.requestAnimationFrame(y))},[y]);s.useEffect(()=>()=>{w.current!==null&&window.cancelAnimationFrame(w.current),w.current=null},[]),s.useEffect(()=>{const t=x.current;if(!t)return;const e=()=>p(t.clientWidth);e();const l=new ResizeObserver(e);return l.observe(t),()=>l.disconnect()},[]),s.useEffect(()=>{let t=!1;D(null),N("");const e=se(a,r);return e.promise.then(l=>{t||D(l)}).catch(()=>{t||N(h("editor.pdfLoadFailed"))}),()=>{t=!0,e.release()}},[a,r]),s.useEffect(()=>{d>100||!x.current||(x.current.scrollLeft=0)},[d,g,m]);const z=t=>E(e=>Math.min(200,Math.max(50,e+t))),W=()=>{x.current&&(x.current.scrollLeft=0),E(100)},L=t=>{!t.shiftKey||Math.abs(t.deltaX)>Math.abs(t.deltaY)||(t.preventDefault(),t.currentTarget.scrollLeft+=t.deltaY,A())};return i.jsxs("div",{className:"pdf-viewer",children:[i.jsxs("div",{className:"pdf-toolbar",role:"toolbar","aria-label":h("editor.pdfZoomControls"),children:[i.jsx("button",{disabled:d<=50,title:h("editor.pdfZoomOut"),"aria-label":h("editor.pdfZoomOut"),onClick:()=>z(-10),children:i.jsx(te,{size:14})}),i.jsxs("span",{className:"pdf-zoom-value","aria-live":"polite",children:[d,"%"]}),i.jsx("button",{disabled:d>=200,title:h("editor.pdfZoomIn"),"aria-label":h("editor.pdfZoomIn"),onClick:()=>z(10),children:i.jsx(re,{size:14})}),i.jsxs("button",{className:"pdf-fit-width",title:h("editor.pdfFitWidth"),onClick:W,children:[i.jsx(ne,{size:13}),h("editor.pdfFitWidth")]})]}),f&&i.jsxs("div",{className:"pdf-compiling-overlay",role:"status","aria-live":"polite",children:[i.jsx(V,{className:"spin",size:20}),i.jsx("span",{children:h("editor.compiling")})]}),i.jsx("div",{className:"pdf-document",ref:x,onScroll:A,onWheel:L,children:i.jsxs("div",{className:"pdf-pages",style:{width:`${Math.max(1,g-28)*Math.max(1,d/100)}px`},children:[!m&&!v&&i.jsxs("div",{className:"pdf-loading",role:"status","aria-live":"polite",children:[i.jsx(V,{className:"spin",size:24}),i.jsx("span",{children:h("editor.loadingPdf")})]}),v&&i.jsx("div",{className:"preview-empty",children:i.jsx("strong",{children:v})}),m&&g>0&&Array.from({length:m.numPages},(t,e)=>i.jsx(ie,{document:m,pageNumber:e+1,availableWidth:g-28,zoom:d/100,target:o?.page===e+1?o:null,onReady:A,onPageElement:M,onInternalLink:C,onDoubleClickLocation:c},e+1))]})})]})}function ie({document:a,pageNumber:r,availableWidth:o,zoom:f,target:u,onReady:c,onPageElement:h,onInternalLink:x,onDoubleClickLocation:m}){const D=s.useRef(null),g=s.useRef(null),p=s.useRef(null),[d,E]=s.useState(1),[v,N]=s.useState({width:0,height:0}),[b,w]=s.useState(r===1),[k,M]=s.useState(!1),[C,y]=s.useState(null),[A,z]=s.useState([]);s.useEffect(()=>{const e=D.current;if(!e||b)return;if(!("IntersectionObserver"in window)){w(!0);return}const l=new IntersectionObserver(n=>{n.some(P=>P.isIntersecting)&&(w(!0),l.disconnect())},{rootMargin:"900px 0px"});return l.observe(e),()=>l.disconnect()},[b]),s.useEffect(()=>{u&&w(!0)},[u?.nonce]),s.useEffect(()=>{if(!b)return;let e=!1,l=null;return M(!1),y(null),z([]),a.getPage(r).then(n=>{if(e)return;const P=n.getViewport({scale:1}),S=o/P.width,j=Math.min(3.3,Math.max(.175,S*f)),U=n.getViewport({scale:j});if(E(j),N({width:U.width,height:U.height}),y(U),n.getAnnotations({intent:"display"}).then(B=>{e||z(B)}).catch(()=>{e||z([])}),!g.current)return;const T=Math.max(1,window.devicePixelRatio||1),$=n.getViewport({scale:j*T});return g.current.width=Math.floor($.width),g.current.height=Math.floor($.height),l=n.render({canvas:g.current,viewport:$}),l.promise.then(()=>{e||(M(!0),window.requestAnimationFrame(c))})}).catch(()=>{}),()=>{e=!0,l?.cancel()}},[a,r,o,f,b]),s.useEffect(()=>{!u||!p.current||p.current.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},[u?.nonce,d]);const W=e=>{if(!m||!k||e.target instanceof HTMLElement&&e.target.closest("a"))return;const l=g.current;if(!l)return;const n=l.getBoundingClientRect();if(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)return;const P=d||1,S=Math.max(0,Math.min(n.width,e.clientX-n.left))/P,j=Math.max(0,Math.min(n.height,e.clientY-n.top))/P;m(r,S,j)},L=Math.max(1,o*f),t=L*(792/612);return i.jsxs("figure",{ref:e=>{D.current=e,h(r,e)},onDoubleClick:W,className:`pdf-page${k?" rendered":" loading"}`,"data-page":r,"data-scale":d,style:{width:`${v.width||L}px`,minHeight:`${v.height||t}px`},children:[i.jsx("canvas",{ref:g,style:{width:`${v.width||L}px`,height:`${v.height||t}px`}}),k&&C&&i.jsx(oe,{annotations:A,viewport:C,onInternalLink:x}),u&&i.jsx("span",{ref:p,className:"pdf-sync-marker",style:{left:u.x*d,top:u.y*d}}),i.jsx("figcaption",{children:r})]})}function oe({annotations:a,viewport:r,onInternalLink:o}){const{t:f}=X(),u=f("editor.pdfLink");return i.jsx("div",{className:"pdf-annotation-layer","aria-label":f("editor.pdfLinks"),children:a.filter(c=>c.subtype==="Link"&&Array.isArray(c.rect)&&c.rect.length>=4).map((c,h)=>{const[x,m]=r.convertToViewportPoint(c.rect[0],c.rect[1]),[D,g]=r.convertToViewportPoint(c.rect[2],c.rect[3]),p=[x,m,D,g],d=Math.min(p[0],p[2]),E=Math.min(p[1],p[3]),v=Math.abs(p[2]-p[0]),N=Math.abs(p[3]-p[1]),b=typeof c.title=="string"?c.title.trim():"",w=typeof c.unsafeUrl=="string"?c.unsafeUrl.trim():"",k=typeof c.url=="string"?c.url.trim():"",M=Z(k)?k:Z(w)?w:"",C=c.dest;if(!M&&C==null)return null;const y=!!M;return i.jsx("a",{className:"pdf-annotation-link",href:M||"#",target:y?"_blank":void 0,rel:y?"noreferrer":void 0,title:b||(y?M:u),"aria-label":b||(y?M:u),style:{left:d,top:E,width:v,height:N},onClick:y?void 0:A=>{A.preventDefault(),o(C)}},`${h}-${d}-${E}`)})})}function Z(a){return/^(?:https?|mailto|ftp):/i.test(a)}export{me as PdfPreview,he as preloadPdf,fe as preloadPdfRuntime};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as E,r as t,j as e}from"./react-BVUjbTTn.js";import{M as $,h as M}from"./index-
|
|
1
|
+
import{u as E,r as t,j as e}from"./react-BVUjbTTn.js";import{M as $,h as M}from"./index-B6rP7QsM.js";import{i as z,p as b,P as h,a as L,n as F}from"./Dashboard-BB4RO4x2.js";import{S as q}from"./search-UZspmceH.js";import"./hard-drive-Bsk-RETn.js";import"./x-DlFXD9Vl.js";import"./sigma-C0IvFdKV.js";import"./tags-BTUtvaAc.js";function y(o){return o.trim().toLocaleLowerCase()}function H({project:o,open:l,onOpenChange:d,onSave:g}){const{t:s,i18n:k}=E(),[i,x]=t.useState(""),[n,p]=t.useState(null),[I,u]=t.useState(""),[r,j]=t.useState(!1),[f,m]=t.useState("");t.useEffect(()=>{l&&(x(""),p(o?.icon??null),u(o?.icon&&!z(o.icon)?o.icon:""),j(!1),m(""))},[l,o?.id,o?.icon]);const v=t.useMemo(()=>{const c=y(i);return c?b.filter(({name:a})=>[a,s(`projectIcons.icons.${a}.name`),s(`projectIcons.icons.${a}.keywords`)].some(P=>y(P).includes(c))):b},[k.resolvedLanguage,i,s]),C=async()=>{if(!(!o||r)){j(!0),m("");try{await g(o.id,n),d(!1)}catch(c){m(M(c))}finally{j(!1)}}},S=n!==(o?.icon??null),N=c=>{p(c),u("")},w=c=>{u(c);const a=c.trim();p(a?F(a)??a:null)};return e.jsx($,{open:l,wide:!0,className:"project-icon-picker-modal",title:s("projectIcons.title"),description:o?s("projectIcons.description",{project:o.name}):void 0,onOpenChange:c=>{r||d(c)},footer:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",disabled:r,onClick:()=>d(!1),children:s("common.cancel")}),e.jsx("button",{type:"button",className:"primary",disabled:r||!S,"aria-busy":r,onClick:()=>{C()},children:s("projectIcons.save")})]}),children:e.jsxs("div",{className:"project-icon-picker",children:[f&&e.jsx("p",{className:"error dialog-error",role:"alert",children:f}),e.jsxs("label",{className:"project-icon-search",children:[e.jsx(q,{"aria-hidden":"true",size:16}),e.jsx("span",{className:"sr-only",children:s("projectIcons.search")}),e.jsx("input",{autoFocus:!0,value:i,placeholder:s("projectIcons.search"),onChange:c=>x(c.target.value)})]}),e.jsxs("div",{className:"project-icon-options","aria-label":s("projectIcons.title"),children:[e.jsxs("button",{type:"button","aria-pressed":n===null,className:`project-icon-option project-icon-reset${n===null?" selected":""}`,title:s("projectIcons.useInitial"),onClick:()=>N(null),children:[e.jsx("span",{className:"project-icon-option-glyph",children:e.jsx(h,{fallback:L(o?.name??"")})}),e.jsx("span",{children:s("projectIcons.useInitial")})]}),v.map(({name:c})=>e.jsxs("button",{type:"button","aria-pressed":n===c,className:`project-icon-option${n===c?" selected":""}`,title:s(`projectIcons.icons.${c}.name`),onClick:()=>N(c),children:[e.jsx("span",{className:"project-icon-option-glyph",children:e.jsx(h,{icon:c,fallback:"?"})}),e.jsx("span",{children:s(`projectIcons.icons.${c}.name`)})]},c))]}),v.length===0&&e.jsx("p",{className:"project-icon-picker-empty",children:s("projectIcons.noMatches",{query:i})}),e.jsxs("div",{className:"project-icon-advanced",children:[e.jsx("label",{htmlFor:"project-icon-advanced-name",children:s("projectIcons.advancedName")}),e.jsxs("div",{className:"project-icon-advanced-input",children:[e.jsx("input",{id:"project-icon-advanced-name",value:I,placeholder:s("projectIcons.advancedNamePlaceholder"),onChange:c=>w(c.target.value),spellCheck:!1,autoCapitalize:"off",autoCorrect:"off"}),I.trim()&&e.jsx("span",{className:"project-icon-advanced-preview","aria-label":s("projectIcons.advancedPreview"),children:e.jsx(h,{icon:n,fallback:"?"})})]}),e.jsxs("p",{children:[s("projectIcons.advancedNameDescription")," ",e.jsx("a",{href:"https://icon-sets.iconify.design/lucide/",target:"_blank",rel:"noreferrer",children:s("projectIcons.browse")})]})]})]})})}export{H as ProjectIconPickerDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as A,r,j as e}from"./react-BVUjbTTn.js";import{c as U,g as q,M as F,d as V,C as B}from"./index-
|
|
1
|
+
import{u as A,r,j as e}from"./react-BVUjbTTn.js";import{c as U,g as q,M as F,d as V,C as B}from"./index-B6rP7QsM.js";import{S as $}from"./search-UZspmceH.js";import{F as J,e as K}from"./x-DlFXD9Vl.js";import{C as G}from"./check-Jf8WBxDX.js";const T=U("Replace",[["path",{d:"M14 4a2 2 0 0 1 2-2",key:"1w2hp7"}],["path",{d:"M16 10a2 2 0 0 1-2-2",key:"shjach"}],["path",{d:"M20 2a2 2 0 0 1 2 2",key:"188mtx"}],["path",{d:"M22 8a2 2 0 0 1-2 2",key:"ddf4tu"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a3 3 0 0 1 3-3h1",key:"3y3t5z"}],["rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",key:"4rksxw"}]]);function te({open:c,files:h,onOpenChange:u,onOpenFile:p}){const{t:a}=A(),[n,f]=r.useState(""),[d,o]=r.useState(0),m=r.useRef(null),y=r.useRef(null),l=r.useMemo(()=>h.filter(s=>s.type==="file").map(s=>({entry:s,score:H(s.path,n)})).filter(s=>s.score>=0).sort((s,i)=>i.score-s.score||s.entry.path.localeCompare(i.entry.path)).slice(0,100),[h,n]);r.useEffect(()=>{c&&(f(""),o(0),window.setTimeout(()=>m.current?.focus(),0))},[c]),r.useEffect(()=>o(s=>Math.min(s,Math.max(0,l.length-1))),[l.length]),r.useEffect(()=>{c&&y.current?.scrollIntoView({block:"nearest"})},[c,d]);const S=s=>{p(s),u(!1)};return e.jsx(F,{open:c,wide:!0,title:a("navigation.quickOpen"),description:a("navigation.quickOpenDescription"),onOpenChange:u,children:e.jsxs("div",{className:"quick-open-dialog",children:[e.jsxs("label",{children:[e.jsx($,{size:16}),e.jsx("input",{ref:m,value:n,placeholder:a("navigation.filePlaceholder"),onChange:s=>{f(s.target.value),o(0)},onKeyDown:s=>{s.key==="ArrowDown"&&(s.preventDefault(),o(i=>Math.min(l.length-1,i+1))),s.key==="ArrowUp"&&(s.preventDefault(),o(i=>Math.max(0,i-1))),s.key==="Enter"&&l[d]&&(s.preventDefault(),S(l[d].entry.path))}})]}),e.jsxs("div",{className:"quick-open-results",children:[l.map(({entry:s},i)=>e.jsxs("button",{ref:i===d?y:void 0,className:i===d?"active":"",onMouseEnter:()=>o(i),onClick:()=>S(s.path),children:[e.jsx(K,{size:14}),e.jsx("span",{children:s.path}),i===d&&e.jsx(G,{size:13})]},s.path)),l.length===0&&e.jsx("p",{className:"muted padded",children:a("navigation.noFiles")})]})]})})}function se({open:c,project:h,onOpenChange:u,onJump:p}){const{t:a}=A(),[n,f]=r.useState(""),[d,o]=r.useState(""),[m,y]=r.useState(!1),[l,S]=r.useState(!1),[s,i]=r.useState([]),[g,C]=r.useState(0),[P,D]=r.useState(!1),[b,k]=r.useState(!1),[W,N]=r.useState(!1),[R,M]=r.useState(""),[z,w]=r.useState(""),[O,Q]=r.useState(0),v=r.useRef(null);r.useEffect(()=>{if(!c){v.current?.abort();return}if(M(""),w(""),!n.trim()){i([]),C(0),D(!1);return}const t=window.setTimeout(()=>{v.current?.abort();const x=new AbortController;v.current=x,k(!0);const E=new URLSearchParams({q:n});m&&E.set("caseSensitive","1"),l&&E.set("wholeWord","1"),q(`/api/projects/${h.id}/search?${E}`,{signal:x.signal}).then(j=>{i(j.matches),C(j.total),D(j.truncated)}).catch(j=>{j instanceof DOMException&&j.name==="AbortError"||w(L(j))}).finally(()=>{v.current===x&&(v.current=null,k(!1))})},250);return()=>window.clearTimeout(t)},[c,h.id,n,m,l,O]);const I=async()=>{N(!1),k(!0),w(""),M("");try{const t=await q(`/api/projects/${h.id}/search/replace`,{method:"POST",body:JSON.stringify({query:n,replacement:d,caseSensitive:m,wholeWord:l})});M(a("navigation.replaced",{count:t.replacements,files:t.files.length})),i([]),C(0),Q(x=>x+1)}catch(t){w(L(t))}finally{k(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(F,{open:c,extraWide:!0,title:a("navigation.projectSearch"),description:a("navigation.projectSearchDescription"),onOpenChange:u,footer:e.jsx("button",{onClick:()=>u(!1),children:a("common.close")}),children:e.jsxs("div",{className:"project-search-dialog",children:[z&&e.jsx("p",{className:"error",children:z}),R&&e.jsx("p",{className:"success",children:R}),e.jsxs("div",{className:"project-search-form",children:[e.jsxs("label",{className:"project-search-query",children:[e.jsx($,{size:16}),e.jsx("input",{autoFocus:!0,value:n,placeholder:a("navigation.searchPlaceholder"),onChange:t=>f(t.target.value)})]}),h.permission!=="read"&&e.jsxs("label",{className:"project-search-query",children:[e.jsx(T,{size:16}),e.jsx("input",{value:d,placeholder:a("navigation.replacePlaceholder"),onChange:t=>o(t.target.value)})]}),e.jsxs("div",{className:"project-search-options",children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:m,onChange:t=>y(t.target.checked)}),a("editor.search.matchCase")]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:l,onChange:t=>S(t.target.checked)}),a("editor.search.wholeWord")]}),h.permission!=="read"&&e.jsxs("button",{className:"danger-text",disabled:!n.trim()||g===0||b,onClick:()=>N(!0),children:[e.jsx(T,{size:13}),a("navigation.replaceAll",{count:g})]})]})]}),e.jsxs("div",{className:"project-search-summary",children:[e.jsx("span",{children:b?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"spin",size:13}),a("common.loading")]}):a("navigation.matchSummary",{count:g})}),P&&e.jsx("small",{children:a("navigation.truncated",{count:s.length})})]}),e.jsxs("div",{className:"project-search-results",children:[s.map((t,x)=>e.jsxs("button",{onClick:()=>{p(t.path,t.line,t.column),u(!1)},children:[e.jsx(J,{size:14}),e.jsxs("span",{children:[e.jsxs("strong",{children:[t.path,e.jsxs("small",{children:[":",t.line,":",t.column]})]}),e.jsxs("code",{children:[t.preview.slice(0,t.matchStart),e.jsx("mark",{children:t.preview.slice(t.matchStart,t.matchEnd)}),t.preview.slice(t.matchEnd)]})]})]},`${t.path}-${t.line}-${t.column}-${x}`)),!b&&n.trim()&&s.length===0&&e.jsx("p",{className:"muted padded",children:a("editor.search.noMatches")})]})]})}),e.jsx(B,{open:W,title:a("navigation.replaceConfirmTitle"),description:a("navigation.replaceConfirmDescription",{count:g}),confirmLabel:a("navigation.replaceAll",{count:g}),danger:!0,onCancel:()=>N(!1),onConfirm:()=>{I()}})]})}function H(c,h){const u=c.toLocaleLowerCase(),p=h.trim().toLocaleLowerCase();if(!p)return 1;const a=u.indexOf(p);if(a>=0)return 1e4-a-u.length;let n=0,f=0;for(const d of p){const o=u.indexOf(d,n);if(o<0)return-1;f+=o===n?5:1,n=o+1}return f-u.length/100}function L(c){return c instanceof Error?c.message:String(c)}export{se as ProjectSearchDialog,te as QuickOpenDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as oe,r,j as e}from"./react-BVUjbTTn.js";import{c as m,g as j,h as S,d as le}from"./index-p1NHkGGG.js";import{D as y,E as pe,S as E,G as U,I as de,J as he,A as xe,K as me}from"./ProjectWorkspace-C6sYiBF2.js";import{X as V,i as je,C as ge,d as ue}from"./x-eisRQJv_.js";import{T as B}from"./type-YO4aprqE.js";import{S as be}from"./sigma-BgvHGPto.js";import{R as Q}from"./refresh-cw-LtwnqlWh.js";import"./check-C1db8iNn.js";import"./search-DXo_aAp0.js";import"./user-plus-MRmKeDtX.js";const ve=m("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);const Se=m("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);const ye=m("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const fe=m("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const ke=m("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);const Ne=m("SpellCheck2",[["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M4 21c1.1 0 1.1-1 2.3-1s1.1 1 2.3 1c1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1",key:"8mdmtu"}]]);const Ce=m("WrapText",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["polyline",{points:"16 16 14 18 16 20",key:"1jznyi"}],["line",{x1:"3",x2:"10",y1:"18",y2:"18",key:"1h33wv"}]]);function we({name:f,state:n,label:c,reloadLabel:d,onReload:k,compact:N=!1}){const g=n.status==="loading"?e.jsx(le,{className:"spin",size:14}):n.status==="working"?e.jsx(xe,{size:14}):e.jsx(ye,{size:14}),u=e.jsxs(e.Fragment,{children:[g,e.jsx("strong",{children:f}),e.jsx("span",{children:c}),n.status==="error"&&e.jsxs("button",{type:"button",className:"browser-tool-reload",title:d,"aria-label":d,onClick:k,children:[e.jsx(Q,{size:12}),d]})]});return N?e.jsxs("span",{className:`browser-tool-status compact ${n.status}`,role:"status","aria-live":"polite","aria-label":`${f}: ${c}`,title:n.error||void 0,children:[g,e.jsx("span",{children:c}),n.status==="error"&&e.jsx("button",{type:"button",className:"browser-tool-reload",title:d,"aria-label":d,onClick:k,children:e.jsx(Q,{size:12})})]}):e.jsx("div",{className:`browser-tool-status ${n.status}`,title:n.error||void 0,children:u})}function He({onClose:f,project:n,projectId:c,site:d,files:k,dictionaryWords:N,onDictionaryChange:g,editorPreferences:u,onEditorPreferences:G,spellCheckCount:l,spellCheckUniqueCount:X,spellCheckIndex:h,onSpellCheckNavigate:C,onProject:Z}){const{t:s}=oe(),[O,Y]=r.useState(n.engine),[T,F]=r.useState(""),[D,I]=r.useState(n.name),[b,ee]=r.useState(n.mainFile),[v,$]=r.useState(null),[P,z]=r.useState(""),[M,A]=r.useState(""),[H,w]=r.useState(""),[p,L]=r.useState("appearance"),[i,o]=r.useState(u),R=r.useSyncExternalStore(y.subscribe,y.getSnapshot,y.getSnapshot),x=n.permission==="owner",W=n.permission!=="read",q=n.permission!=="read";r.useEffect(()=>o(u),[u]),r.useEffect(()=>{pe().catch(y.failed)},[c]);const te=()=>{me().catch(y.failed)};r.useEffect(()=>{if(!n.latexmkrc)return F("");j(`/api/projects/${c}/file?path=${encodeURIComponent(n.latexmkrc)}`).then(({content:t})=>F(t)).catch(t=>z(S(t)))},[n.latexmkrc]),r.useEffect(()=>{if(p!=="compiler")return;const t=new AbortController;return $(null),j(`/api/projects/${c}/main-files`,{signal:t.signal}).then(a=>$(a.mainFiles)).catch(a=>{a instanceof Error&&a.name==="AbortError"||z(S(a))}),()=>t.abort()},[c,k,p]);const se=v??[n.mainFile],ie=v!==null&&!v.includes(b),J=async()=>{try{const t=T.trim()&&d.allowProjectLatexmkrc!==!1?".latexmkrc":null;t&&await j(`/api/projects/${c}/file`,{method:"PUT",body:JSON.stringify({path:t,content:T})});const a=await j(`/api/projects/${c}`,{method:"PATCH",body:JSON.stringify({name:D,mainFile:b,engine:O,latexmkrc:t})});Z(a.project)}catch(t){z(S(t))}},_=()=>G(i),ne=()=>{if(p==="appearance")return _();x&&J()},ae=s(p==="appearance"?"projectSettings.saveAppearance":"projectSettings.saveCompiler"),re=p==="appearance"||x,K=async()=>{const t=M.trim();if(t)try{const a=await j(`/api/projects/${c}/dictionary`,{method:"POST",body:JSON.stringify({word:t})});g(a.words),A(""),w("")}catch(a){w(S(a))}},ce=async t=>{try{const a=await j(`/api/projects/${c}/dictionary/${encodeURIComponent(t)}`,{method:"DELETE"});g(a.words),w("")}catch(a){w(S(a))}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"drawer-title settings-drawer-title",children:[e.jsx("strong",{children:s("editor.projectSettings")}),e.jsxs("div",{className:"drawer-title-actions",children:[re&&e.jsxs("button",{type:"button",className:"drawer-settings-save",onClick:ne,children:[e.jsx(E,{size:14}),e.jsx("span",{children:ae})]}),e.jsx("button",{type:"button","aria-label":s("common.close"),onClick:f,children:e.jsx(V,{size:17})})]})]}),e.jsxs("div",{className:"settings padded",children:[P&&e.jsx("p",{className:"error",children:P}),e.jsxs("div",{className:"settings-tabs",role:"tablist","aria-label":s("common.settings"),children:[e.jsxs("button",{id:"settings-tab-appearance",type:"button",role:"tab","aria-selected":p==="appearance","aria-controls":"settings-panel-appearance",className:`settings-tab${p==="appearance"?" active":""}`,onClick:()=>L("appearance"),children:[e.jsx(B,{size:15}),s("projectSettings.editorTab")]}),e.jsxs("button",{id:"settings-tab-compiler",type:"button",role:"tab","aria-selected":p==="compiler","aria-controls":"settings-panel-compiler",className:`settings-tab${p==="compiler"?" active":""}`,onClick:()=>L("compiler"),children:[e.jsx(U,{size:15}),s("projectSettings.compilerTab")]})]}),p==="appearance"?e.jsxs("section",{id:"settings-panel-appearance",role:"tabpanel","aria-labelledby":"settings-tab-appearance",children:[e.jsxs("div",{className:"settings-section-title",children:[e.jsx(B,{size:15}),e.jsx("strong",{children:s("projectSettings.editorAppearance")})]}),e.jsx("p",{className:"settings-description appearance-description",children:s("projectSettings.editorAppearanceDescription")}),e.jsxs("label",{children:[s("projectSettings.fontFamily"),e.jsx("select",{value:i.font,onChange:t=>o({...i,font:t.target.value}),children:de.map(t=>e.jsx("option",{value:t.id,children:s(t.labelKey)},t.id))})]}),e.jsxs("label",{children:[s("projectSettings.fontSize"),e.jsx("select",{value:i.fontSize,onChange:t=>o({...i,fontSize:Number(t.target.value)}),children:[12,13,14,15,16,18,20].map(t=>e.jsxs("option",{value:t,children:[t," px"]},t))})]}),e.jsxs("label",{children:[s("projectSettings.lineHeight"),e.jsxs("select",{value:i.lineHeight,onChange:t=>o({...i,lineHeight:Number(t.target.value)}),children:[e.jsx("option",{value:1.45,children:s("projectSettings.lineHeightCompact")}),e.jsx("option",{value:1.65,children:s("projectSettings.lineHeightNormal")}),e.jsx("option",{value:1.85,children:s("projectSettings.lineHeightRelaxed")})]})]}),e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.lineWrapping,onChange:t=>o({...i,lineWrapping:t.target.checked})}),e.jsx(Ce,{size:15}),e.jsx("span",{children:s("projectSettings.lineWrapping")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.showTooltips,onChange:t=>o({...i,showTooltips:t.target.checked})}),e.jsx(fe,{size:15}),e.jsx("span",{children:s("projectSettings.showTooltips")})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.showTooltipsDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.mathPreviewOnHover,onChange:t=>o({...i,mathPreviewOnHover:t.target.checked})}),e.jsx(be,{size:15}),e.jsx("span",{children:s("projectSettings.mathPreviewOnHover")})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.mathPreviewOnHoverDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.spellCheck,onChange:t=>o({...i,spellCheck:t.target.checked})}),e.jsx("span",{children:s("projectSettings.spellCheck")})]}),e.jsxs("p",{className:"field-hint",children:[s("projectSettings.writingCheckDescription")," ",e.jsx("a",{href:"https://writewithharper.com/docs/integrations/language-server",target:"_blank",rel:"noreferrer",children:"Harper"})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.vimMode,onChange:t=>o({...i,vimMode:t.target.checked})}),e.jsx("span",{children:s("projectSettings.vimMode")})]}),e.jsxs("p",{className:"field-hint",children:[s("projectSettings.vimModeDescription")," ",e.jsx("a",{href:"https://replit-codemirror-vim.mintlify.app/",target:"_blank",rel:"noreferrer",children:s("projectSettings.vimHelp")})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.openFilesInTabs,onChange:t=>o({...i,openFilesInTabs:t.target.checked})}),e.jsx(ke,{size:15}),e.jsx("span",{children:s("projectSettings.openFilesInTabs")})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.openFilesInTabsDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",disabled:!W,checked:i.formatOnCompile,onChange:t=>o({...i,formatOnCompile:t.target.checked})}),e.jsx(he,{size:15}),e.jsx("span",{children:s("projectSettings.formatOnCompile")})]}),e.jsxs("p",{className:"field-hint",children:[s(W?"projectSettings.formatOnCompileDescription":"projectSettings.formatRequiresWrite")," ",s("projectSettings.formatterDescription")," ",e.jsx("a",{href:"https://www.npmjs.com/package/tex-fmt",target:"_blank",rel:"noreferrer",children:s("projectSettings.formatterInstall")})," · ",e.jsx("a",{href:"https://github.com/FlamingTempura/bibtex-tidy",target:"_blank",rel:"noreferrer",children:s("projectSettings.bibtexTidyInstall")})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"tex-fmt-options-field",children:[e.jsxs("span",{className:"tex-fmt-options-heading",children:[e.jsx("span",{children:s("projectSettings.texFmtOptions")}),e.jsx(we,{compact:!0,name:"tex-fmt",state:R,label:s(`projectSettings.toolStatus.${R.status}`),reloadLabel:s("projectSettings.reloadTool"),onReload:te})]}),e.jsx("textarea",{className:"tex-fmt-options-editor",rows:6,maxLength:16*1024,spellCheck:!1,value:i.texFmtConfig,placeholder:s("projectSettings.texFmtOptionsPlaceholder"),onChange:t=>o({...i,texFmtConfig:t.target.value})})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.texFmtOptionsDescription")})]}),l!==null&&e.jsxs("div",{className:`spell-check-result${l?" has-issues":""}`,role:"status","aria-live":"polite",children:[e.jsx(Ne,{size:14}),e.jsx("span",{children:l?s("projectSettings.writingIssues",{count:l,uniqueCount:X??0}):s("projectSettings.noWritingIssues")}),l>0&&e.jsxs("span",{className:"spell-check-controls",children:[e.jsx("button",{type:"button",title:s("projectSettings.spellCheckFirst"),"aria-label":s("projectSettings.spellCheckFirst"),disabled:h<=0,onClick:()=>C(0),children:e.jsx(ve,{size:14})}),e.jsx("button",{type:"button",title:s("projectSettings.spellCheckPrevious"),"aria-label":s("projectSettings.spellCheckPrevious"),disabled:h<=0,onClick:()=>C(h-1),children:e.jsx(je,{size:14})}),e.jsx("span",{className:"spell-check-position",children:s("projectSettings.spellCheckPosition",{current:Math.min(h+1,l),total:l})}),e.jsx("button",{type:"button",title:s("projectSettings.spellCheckNext"),"aria-label":s("projectSettings.spellCheckNext"),disabled:h>=l-1,onClick:()=>C(h+1),children:e.jsx(ge,{size:14})}),e.jsx("button",{type:"button",title:s("projectSettings.spellCheckLast"),"aria-label":s("projectSettings.spellCheckLast"),disabled:h>=l-1,onClick:()=>C(l-1),children:e.jsx(Se,{size:14})})]})]}),e.jsxs("div",{className:"settings-section-title",children:[e.jsx(ue,{size:15}),e.jsx("strong",{children:s("projectSettings.dictionary")})]}),e.jsx("p",{className:"settings-description",children:s("projectSettings.dictionaryDescription")}),H&&e.jsx("p",{className:"error dictionary-error",children:H}),q&&e.jsxs("div",{className:"dictionary-add",children:[e.jsx("input",{value:M,placeholder:s("projectSettings.dictionaryPlaceholder"),onChange:t=>A(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),K())}}),e.jsx("button",{type:"button",disabled:!M.trim(),onClick:()=>{K()},children:s("projectSettings.addWord")})]}),e.jsxs("div",{className:"dictionary-words",children:[N.map(t=>e.jsxs("span",{className:"dictionary-word",children:[e.jsx("code",{children:t}),q&&e.jsx("button",{type:"button",title:s("common.delete"),"aria-label":`${s("common.delete")} ${t}`,onClick:()=>{ce(t)},children:e.jsx(V,{size:13})})]},t)),N.length===0&&e.jsx("span",{className:"dictionary-empty",children:s("projectSettings.dictionaryEmpty")})]}),e.jsx("div",{className:"settings-actions",children:e.jsxs("button",{className:"settings-save",onClick:_,children:[e.jsx(E,{size:15}),s("projectSettings.saveAppearance")]})})]}):e.jsxs("section",{id:"settings-panel-compiler",role:"tabpanel","aria-labelledby":"settings-tab-compiler",children:[e.jsxs("div",{className:"settings-section-title",children:[e.jsx(U,{size:15}),e.jsx("strong",{children:s("projectSettings.compilerTab")})]}),e.jsx("p",{className:"settings-description compiler-description",children:s("projectSettings.compilerDescription")}),e.jsxs("label",{children:[s("projects.name"),e.jsx("input",{disabled:!x,value:D,onChange:t=>I(t.target.value)})]}),e.jsxs("label",{children:[s("projectSettings.mainFile"),e.jsxs("select",{disabled:!x||v===null||v.length===0,value:b,onChange:t=>ee(t.target.value),children:[ie&&e.jsx("option",{value:b,disabled:!0,children:s("projectSettings.invalidMainFileOption",{path:b})}),se.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("label",{children:[s("projectSettings.engine"),e.jsx("select",{disabled:!x,value:O,onChange:t=>Y(t.target.value),children:(d.allowedEngines??["pdflatex","xelatex","lualatex"]).map(t=>e.jsx("option",{children:t},t))})]}),e.jsxs("label",{children:[s("projectSettings.latexmkrc"),e.jsx("textarea",{className:"latexmkrc-editor",rows:10,spellCheck:!1,disabled:!x||d.allowProjectLatexmkrc===!1,value:T,placeholder:s("projectSettings.latexmkrcPlaceholder"),onChange:t=>F(t.target.value)})]}),e.jsx("div",{className:"settings-actions",children:x&&e.jsxs("button",{className:"settings-save",onClick:()=>{J()},children:[e.jsx(E,{size:15}),s("projectSettings.saveCompiler")]})})]})]})]})}export{He as ProjectSettings};
|
|
1
|
+
import{u as oe,r,j as e}from"./react-BVUjbTTn.js";import{c as m,g as j,h as S,d as le}from"./index-B6rP7QsM.js";import{D as y,E as pe,S as E,G as U,I as de,J as he,A as xe,K as me}from"./ProjectWorkspace-mCYjyc6e.js";import{X as V,i as je,C as ge,d as ue}from"./x-DlFXD9Vl.js";import{T as B}from"./type-XvvfEJRs.js";import{S as be}from"./sigma-C0IvFdKV.js";import{R as Q}from"./refresh-cw-BoMEkk5J.js";import"./check-Jf8WBxDX.js";import"./search-UZspmceH.js";import"./user-plus-Chr9T97G.js";const ve=m("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);const Se=m("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);const ye=m("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const fe=m("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const ke=m("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);const Ne=m("SpellCheck2",[["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M4 21c1.1 0 1.1-1 2.3-1s1.1 1 2.3 1c1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1",key:"8mdmtu"}]]);const Ce=m("WrapText",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["polyline",{points:"16 16 14 18 16 20",key:"1jznyi"}],["line",{x1:"3",x2:"10",y1:"18",y2:"18",key:"1h33wv"}]]);function we({name:f,state:n,label:c,reloadLabel:d,onReload:k,compact:N=!1}){const g=n.status==="loading"?e.jsx(le,{className:"spin",size:14}):n.status==="working"?e.jsx(xe,{size:14}):e.jsx(ye,{size:14}),u=e.jsxs(e.Fragment,{children:[g,e.jsx("strong",{children:f}),e.jsx("span",{children:c}),n.status==="error"&&e.jsxs("button",{type:"button",className:"browser-tool-reload",title:d,"aria-label":d,onClick:k,children:[e.jsx(Q,{size:12}),d]})]});return N?e.jsxs("span",{className:`browser-tool-status compact ${n.status}`,role:"status","aria-live":"polite","aria-label":`${f}: ${c}`,title:n.error||void 0,children:[g,e.jsx("span",{children:c}),n.status==="error"&&e.jsx("button",{type:"button",className:"browser-tool-reload",title:d,"aria-label":d,onClick:k,children:e.jsx(Q,{size:12})})]}):e.jsx("div",{className:`browser-tool-status ${n.status}`,title:n.error||void 0,children:u})}function He({onClose:f,project:n,projectId:c,site:d,files:k,dictionaryWords:N,onDictionaryChange:g,editorPreferences:u,onEditorPreferences:G,spellCheckCount:l,spellCheckUniqueCount:X,spellCheckIndex:h,onSpellCheckNavigate:C,onProject:Z}){const{t:s}=oe(),[O,Y]=r.useState(n.engine),[T,F]=r.useState(""),[D,I]=r.useState(n.name),[b,ee]=r.useState(n.mainFile),[v,$]=r.useState(null),[P,z]=r.useState(""),[M,A]=r.useState(""),[H,w]=r.useState(""),[p,L]=r.useState("appearance"),[i,o]=r.useState(u),R=r.useSyncExternalStore(y.subscribe,y.getSnapshot,y.getSnapshot),x=n.permission==="owner",W=n.permission!=="read",q=n.permission!=="read";r.useEffect(()=>o(u),[u]),r.useEffect(()=>{pe().catch(y.failed)},[c]);const te=()=>{me().catch(y.failed)};r.useEffect(()=>{if(!n.latexmkrc)return F("");j(`/api/projects/${c}/file?path=${encodeURIComponent(n.latexmkrc)}`).then(({content:t})=>F(t)).catch(t=>z(S(t)))},[n.latexmkrc]),r.useEffect(()=>{if(p!=="compiler")return;const t=new AbortController;return $(null),j(`/api/projects/${c}/main-files`,{signal:t.signal}).then(a=>$(a.mainFiles)).catch(a=>{a instanceof Error&&a.name==="AbortError"||z(S(a))}),()=>t.abort()},[c,k,p]);const se=v??[n.mainFile],ie=v!==null&&!v.includes(b),J=async()=>{try{const t=T.trim()&&d.allowProjectLatexmkrc!==!1?".latexmkrc":null;t&&await j(`/api/projects/${c}/file`,{method:"PUT",body:JSON.stringify({path:t,content:T})});const a=await j(`/api/projects/${c}`,{method:"PATCH",body:JSON.stringify({name:D,mainFile:b,engine:O,latexmkrc:t})});Z(a.project)}catch(t){z(S(t))}},_=()=>G(i),ne=()=>{if(p==="appearance")return _();x&&J()},ae=s(p==="appearance"?"projectSettings.saveAppearance":"projectSettings.saveCompiler"),re=p==="appearance"||x,K=async()=>{const t=M.trim();if(t)try{const a=await j(`/api/projects/${c}/dictionary`,{method:"POST",body:JSON.stringify({word:t})});g(a.words),A(""),w("")}catch(a){w(S(a))}},ce=async t=>{try{const a=await j(`/api/projects/${c}/dictionary/${encodeURIComponent(t)}`,{method:"DELETE"});g(a.words),w("")}catch(a){w(S(a))}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"drawer-title settings-drawer-title",children:[e.jsx("strong",{children:s("editor.projectSettings")}),e.jsxs("div",{className:"drawer-title-actions",children:[re&&e.jsxs("button",{type:"button",className:"drawer-settings-save",onClick:ne,children:[e.jsx(E,{size:14}),e.jsx("span",{children:ae})]}),e.jsx("button",{type:"button","aria-label":s("common.close"),onClick:f,children:e.jsx(V,{size:17})})]})]}),e.jsxs("div",{className:"settings padded",children:[P&&e.jsx("p",{className:"error",children:P}),e.jsxs("div",{className:"settings-tabs",role:"tablist","aria-label":s("common.settings"),children:[e.jsxs("button",{id:"settings-tab-appearance",type:"button",role:"tab","aria-selected":p==="appearance","aria-controls":"settings-panel-appearance",className:`settings-tab${p==="appearance"?" active":""}`,onClick:()=>L("appearance"),children:[e.jsx(B,{size:15}),s("projectSettings.editorTab")]}),e.jsxs("button",{id:"settings-tab-compiler",type:"button",role:"tab","aria-selected":p==="compiler","aria-controls":"settings-panel-compiler",className:`settings-tab${p==="compiler"?" active":""}`,onClick:()=>L("compiler"),children:[e.jsx(U,{size:15}),s("projectSettings.compilerTab")]})]}),p==="appearance"?e.jsxs("section",{id:"settings-panel-appearance",role:"tabpanel","aria-labelledby":"settings-tab-appearance",children:[e.jsxs("div",{className:"settings-section-title",children:[e.jsx(B,{size:15}),e.jsx("strong",{children:s("projectSettings.editorAppearance")})]}),e.jsx("p",{className:"settings-description appearance-description",children:s("projectSettings.editorAppearanceDescription")}),e.jsxs("label",{children:[s("projectSettings.fontFamily"),e.jsx("select",{value:i.font,onChange:t=>o({...i,font:t.target.value}),children:de.map(t=>e.jsx("option",{value:t.id,children:s(t.labelKey)},t.id))})]}),e.jsxs("label",{children:[s("projectSettings.fontSize"),e.jsx("select",{value:i.fontSize,onChange:t=>o({...i,fontSize:Number(t.target.value)}),children:[12,13,14,15,16,18,20].map(t=>e.jsxs("option",{value:t,children:[t," px"]},t))})]}),e.jsxs("label",{children:[s("projectSettings.lineHeight"),e.jsxs("select",{value:i.lineHeight,onChange:t=>o({...i,lineHeight:Number(t.target.value)}),children:[e.jsx("option",{value:1.45,children:s("projectSettings.lineHeightCompact")}),e.jsx("option",{value:1.65,children:s("projectSettings.lineHeightNormal")}),e.jsx("option",{value:1.85,children:s("projectSettings.lineHeightRelaxed")})]})]}),e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.lineWrapping,onChange:t=>o({...i,lineWrapping:t.target.checked})}),e.jsx(Ce,{size:15}),e.jsx("span",{children:s("projectSettings.lineWrapping")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.showTooltips,onChange:t=>o({...i,showTooltips:t.target.checked})}),e.jsx(fe,{size:15}),e.jsx("span",{children:s("projectSettings.showTooltips")})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.showTooltipsDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.mathPreviewOnHover,onChange:t=>o({...i,mathPreviewOnHover:t.target.checked})}),e.jsx(be,{size:15}),e.jsx("span",{children:s("projectSettings.mathPreviewOnHover")})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.mathPreviewOnHoverDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.spellCheck,onChange:t=>o({...i,spellCheck:t.target.checked})}),e.jsx("span",{children:s("projectSettings.spellCheck")})]}),e.jsxs("p",{className:"field-hint",children:[s("projectSettings.writingCheckDescription")," ",e.jsx("a",{href:"https://writewithharper.com/docs/integrations/language-server",target:"_blank",rel:"noreferrer",children:"Harper"})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.vimMode,onChange:t=>o({...i,vimMode:t.target.checked})}),e.jsx("span",{children:s("projectSettings.vimMode")})]}),e.jsxs("p",{className:"field-hint",children:[s("projectSettings.vimModeDescription")," ",e.jsx("a",{href:"https://replit-codemirror-vim.mintlify.app/",target:"_blank",rel:"noreferrer",children:s("projectSettings.vimHelp")})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",checked:i.openFilesInTabs,onChange:t=>o({...i,openFilesInTabs:t.target.checked})}),e.jsx(ke,{size:15}),e.jsx("span",{children:s("projectSettings.openFilesInTabs")})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.openFilesInTabsDescription")})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"editor-checkbox",children:[e.jsx("input",{type:"checkbox",disabled:!W,checked:i.formatOnCompile,onChange:t=>o({...i,formatOnCompile:t.target.checked})}),e.jsx(he,{size:15}),e.jsx("span",{children:s("projectSettings.formatOnCompile")})]}),e.jsxs("p",{className:"field-hint",children:[s(W?"projectSettings.formatOnCompileDescription":"projectSettings.formatRequiresWrite")," ",s("projectSettings.formatterDescription")," ",e.jsx("a",{href:"https://www.npmjs.com/package/tex-fmt",target:"_blank",rel:"noreferrer",children:s("projectSettings.formatterInstall")})," · ",e.jsx("a",{href:"https://github.com/FlamingTempura/bibtex-tidy",target:"_blank",rel:"noreferrer",children:s("projectSettings.bibtexTidyInstall")})]})]}),e.jsxs("div",{className:"editor-preference",children:[e.jsxs("label",{className:"tex-fmt-options-field",children:[e.jsxs("span",{className:"tex-fmt-options-heading",children:[e.jsx("span",{children:s("projectSettings.texFmtOptions")}),e.jsx(we,{compact:!0,name:"tex-fmt",state:R,label:s(`projectSettings.toolStatus.${R.status}`),reloadLabel:s("projectSettings.reloadTool"),onReload:te})]}),e.jsx("textarea",{className:"tex-fmt-options-editor",rows:6,maxLength:16*1024,spellCheck:!1,value:i.texFmtConfig,placeholder:s("projectSettings.texFmtOptionsPlaceholder"),onChange:t=>o({...i,texFmtConfig:t.target.value})})]}),e.jsx("p",{className:"field-hint",children:s("projectSettings.texFmtOptionsDescription")})]}),l!==null&&e.jsxs("div",{className:`spell-check-result${l?" has-issues":""}`,role:"status","aria-live":"polite",children:[e.jsx(Ne,{size:14}),e.jsx("span",{children:l?s("projectSettings.writingIssues",{count:l,uniqueCount:X??0}):s("projectSettings.noWritingIssues")}),l>0&&e.jsxs("span",{className:"spell-check-controls",children:[e.jsx("button",{type:"button",title:s("projectSettings.spellCheckFirst"),"aria-label":s("projectSettings.spellCheckFirst"),disabled:h<=0,onClick:()=>C(0),children:e.jsx(ve,{size:14})}),e.jsx("button",{type:"button",title:s("projectSettings.spellCheckPrevious"),"aria-label":s("projectSettings.spellCheckPrevious"),disabled:h<=0,onClick:()=>C(h-1),children:e.jsx(je,{size:14})}),e.jsx("span",{className:"spell-check-position",children:s("projectSettings.spellCheckPosition",{current:Math.min(h+1,l),total:l})}),e.jsx("button",{type:"button",title:s("projectSettings.spellCheckNext"),"aria-label":s("projectSettings.spellCheckNext"),disabled:h>=l-1,onClick:()=>C(h+1),children:e.jsx(ge,{size:14})}),e.jsx("button",{type:"button",title:s("projectSettings.spellCheckLast"),"aria-label":s("projectSettings.spellCheckLast"),disabled:h>=l-1,onClick:()=>C(l-1),children:e.jsx(Se,{size:14})})]})]}),e.jsxs("div",{className:"settings-section-title",children:[e.jsx(ue,{size:15}),e.jsx("strong",{children:s("projectSettings.dictionary")})]}),e.jsx("p",{className:"settings-description",children:s("projectSettings.dictionaryDescription")}),H&&e.jsx("p",{className:"error dictionary-error",children:H}),q&&e.jsxs("div",{className:"dictionary-add",children:[e.jsx("input",{value:M,placeholder:s("projectSettings.dictionaryPlaceholder"),onChange:t=>A(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),K())}}),e.jsx("button",{type:"button",disabled:!M.trim(),onClick:()=>{K()},children:s("projectSettings.addWord")})]}),e.jsxs("div",{className:"dictionary-words",children:[N.map(t=>e.jsxs("span",{className:"dictionary-word",children:[e.jsx("code",{children:t}),q&&e.jsx("button",{type:"button",title:s("common.delete"),"aria-label":`${s("common.delete")} ${t}`,onClick:()=>{ce(t)},children:e.jsx(V,{size:13})})]},t)),N.length===0&&e.jsx("span",{className:"dictionary-empty",children:s("projectSettings.dictionaryEmpty")})]}),e.jsx("div",{className:"settings-actions",children:e.jsxs("button",{className:"settings-save",onClick:_,children:[e.jsx(E,{size:15}),s("projectSettings.saveAppearance")]})})]}):e.jsxs("section",{id:"settings-panel-compiler",role:"tabpanel","aria-labelledby":"settings-tab-compiler",children:[e.jsxs("div",{className:"settings-section-title",children:[e.jsx(U,{size:15}),e.jsx("strong",{children:s("projectSettings.compilerTab")})]}),e.jsx("p",{className:"settings-description compiler-description",children:s("projectSettings.compilerDescription")}),e.jsxs("label",{children:[s("projects.name"),e.jsx("input",{disabled:!x,value:D,onChange:t=>I(t.target.value)})]}),e.jsxs("label",{children:[s("projectSettings.mainFile"),e.jsxs("select",{disabled:!x||v===null||v.length===0,value:b,onChange:t=>ee(t.target.value),children:[ie&&e.jsx("option",{value:b,disabled:!0,children:s("projectSettings.invalidMainFileOption",{path:b})}),se.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsxs("label",{children:[s("projectSettings.engine"),e.jsx("select",{disabled:!x,value:O,onChange:t=>Y(t.target.value),children:(d.allowedEngines??["pdflatex","xelatex","lualatex"]).map(t=>e.jsx("option",{children:t},t))})]}),e.jsxs("label",{children:[s("projectSettings.latexmkrc"),e.jsx("textarea",{className:"latexmkrc-editor",rows:10,spellCheck:!1,disabled:!x||d.allowProjectLatexmkrc===!1,value:T,placeholder:s("projectSettings.latexmkrcPlaceholder"),onChange:t=>F(t.target.value)})]}),e.jsx("div",{className:"settings-actions",children:x&&e.jsxs("button",{className:"settings-save",onClick:()=>{J()},children:[e.jsx(E,{size:15}),s("projectSettings.saveCompiler")]})})]})]})]})}export{He as ProjectSettings};
|