@clepit/core 0.6.0 → 0.7.0-beta.440

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/dist/code.js +1 -1
  3. package/dist/code.mjs +1 -1
  4. package/dist/core/editor/index.d.ts +5 -0
  5. package/dist/core/editor/showing-locale.d.ts +8 -0
  6. package/dist/core/editor/views/json.d.ts +1 -0
  7. package/dist/core/element/index.d.ts +5 -4
  8. package/dist/core/errors.d.ts +6 -0
  9. package/dist/core/i18n/index.d.ts +5 -0
  10. package/dist/core/managers/block/css.d.ts +1 -1
  11. package/dist/core/renderer/page.d.ts +14 -0
  12. package/dist/core/upload-refusal.d.ts +6 -0
  13. package/dist/highlight-CJeA_s9m.mjs +2 -0
  14. package/dist/highlight-ZIUsGHah.js +2 -0
  15. package/dist/index.d.ts +5 -2
  16. package/dist/index.js +1 -1
  17. package/dist/index.mjs +1 -1
  18. package/dist/tools/block/code/css.d.ts +1 -1
  19. package/dist/tools/block/code/theme-css.d.ts +3 -1
  20. package/dist/tools/block/collection/css.d.ts +3 -3
  21. package/dist/tools/block/doc-card/css.d.ts +3 -3
  22. package/dist/tools/block/embed/css.d.ts +3 -3
  23. package/dist/tools/block/file/css.d.ts +3 -3
  24. package/dist/tools/block/glance/css.d.ts +1 -1
  25. package/dist/tools/block/image/input.d.ts +3 -0
  26. package/dist/tools/block/issues/css.d.ts +2 -2
  27. package/dist/tools/block/openapi/css.d.ts +2 -2
  28. package/dist/tools/block/quote/css.d.ts +1 -1
  29. package/dist/tools/block/sketch/css.d.ts +3 -3
  30. package/dist/tools/block/table/css.d.ts +1 -1
  31. package/dist/tools/block/typeset/css.d.ts +3 -3
  32. package/dist/tools/block/typeset/latex/model.d.ts +6 -9
  33. package/dist/tools/block/typeset/latex/parse.d.ts +7 -0
  34. package/dist/tools/block/typeset/latex/symbols.d.ts +2 -2
  35. package/dist/tools/block/typeset/mermaid/model.d.ts +8 -12
  36. package/dist/tools/block/updates/css.d.ts +3 -3
  37. package/dist/tools/inline/issue/css.d.ts +3 -3
  38. package/dist/tools/inline/mention/css.d.ts +1 -1
  39. package/dist/types.d.ts +12 -3
  40. package/dist/utils/detect-language.d.ts +8 -0
  41. package/dist/utils/platform.d.ts +0 -30
  42. package/dist/utils/safe-href.d.ts +8 -0
  43. package/dist/utils/url.d.ts +0 -33
  44. package/package.json +3 -3
  45. package/dist/highlight-C4NcTcIm.mjs +0 -2
  46. package/dist/highlight-eQD0I7eW.js +0 -2
package/dist/types.d.ts CHANGED
@@ -279,7 +279,7 @@ export type EmbedLabel = (typeof EMBED_LABELS)[number];
279
279
  /** What the fix beside a reason asks the host to do. `retry` the core handles
280
280
  * itself; `connectGoogle` only the host can, since it owns the routes. */
281
281
  export type EmbedAction = 'connectGoogle' | 'retry';
282
- /** Points are a FLAT x,y list — a sketch is thousands of points and the flat
282
+ /** Points are a FLAT x,y list: a sketch is thousands of points and the flat
283
283
  * form roughly halves the stored JSON. */
284
284
  export type SketchStroke = {
285
285
  points: number[];
@@ -293,7 +293,7 @@ export type SketchData = {
293
293
  * renderer later improves every document that already exists. */
294
294
  export type TypesetData = {
295
295
  source: string;
296
- /** Describes what the diagram or formula IS, not that it's a diagram — shown
296
+ /** Describes what the diagram or formula IS, not that it's a diagram. Shown
297
297
  * in place of the bare language name when present. */
298
298
  title?: string;
299
299
  };
@@ -923,6 +923,15 @@ export interface BlockTune {
923
923
  save: (element: HTMLElement) => BlockTuneData;
924
924
  }
925
925
  export type UploadFunction = (file: File) => Promise<string>;
926
+ export type UploadNotice = {
927
+ action?: {
928
+ href: string;
929
+ label: string;
930
+ };
931
+ body: string;
932
+ remove: string;
933
+ title: string;
934
+ };
926
935
  /**
927
936
  * One tune's value.
928
937
  *
@@ -1020,7 +1029,7 @@ export type EditorConfig = {
1020
1029
  };
1021
1030
  export declare const BLOCK_TOOLBAR_OPERATIONS: readonly ["convert", "moveUp", "moveDown", "delete"];
1022
1031
  export type BlockToolbarOperation = (typeof BLOCK_TOOLBAR_OPERATIONS)[number];
1023
- export declare const BLOCK_MENU_LABELS: readonly ["searchBlocks", "searchOperations", "searchConvertOptions", "searchLanguages", "searchThemes", "noBlockTypesFound", "noOperationsFound", "noConvertOptionsFound", "alignLeft", "alignCenter", "alignRight", "codeLanguage", "codeTheme", "headingH1", "headingH2", "headingH3", "headingH4", "headingH5", "headingH6", "listUnordered", "listOrdered", "variantInfo", "variantWarning", "variantError", "variantSuccess", "variantPlain", "delimiterLine", "delimiterStars", "embedShowLive", "embedShowCard", "embedShowLink", "embedCopyLink", "embedShowChip", "alertTextHint", "checklistItemHint", "codeHint", "collapsibleTitleHint", "glanceLabelHint", "glanceValueHint", "headerHint", "listItemHint", "mediaCaptionHint", "openApiSourceHint", "quoteAuthorHint", "quoteBodyHint", "tableCaptionHint", "tableCellHint", "tableHeaderHint", "diagramTitleHint", "formulaTitleHint"];
1032
+ export declare const BLOCK_MENU_LABELS: readonly ["searchBlocks", "searchOperations", "searchConvertOptions", "searchLanguages", "searchThemes", "noBlockTypesFound", "noOperationsFound", "noConvertOptionsFound", "alignLeft", "alignCenter", "alignRight", "codeLanguage", "codeTheme", "headingH1", "headingH2", "headingH3", "headingH4", "headingH5", "headingH6", "listUnordered", "listOrdered", "variantInfo", "variantWarning", "variantError", "variantSuccess", "variantPlain", "delimiterLine", "delimiterStars", "embedShowLive", "embedShowCard", "embedShowLink", "embedCopyLink", "embedShowChip", "alertTextHint", "checklistItemHint", "codeHint", "collapsibleTitleHint", "glanceLabelHint", "glanceValueHint", "headerHint", "listItemHint", "mediaCaptionHint", "openApiSourceHint", "quoteAuthorHint", "quoteBodyHint", "tableCaptionHint", "tableCellHint", "tableHeaderHint", "tableInsertAbove", "tableInsertBelow", "tableInsertLeft", "tableInsertRight", "tableMoveLeft", "tableMoveRight", "tableRowActions", "tableColumnActions", "diagramTitleHint", "formulaTitleHint", "imageDropTitle", "imageDropAction", "imageDropFormats", "imageUploading", "imageUploadFailed", "imageInvalidType"];
1024
1033
  export type BlockMenuLabel = (typeof BLOCK_MENU_LABELS)[number];
1025
1034
  export declare const CONTROL_LABELS: readonly ["editView", "previewView", "jsonView", "copyJson", "downloadJson", "clearEditor"];
1026
1035
  export type ControlLabel = (typeof CONTROL_LABELS)[number];
@@ -0,0 +1,8 @@
1
+ export declare const MIN_WORDS = 8;
2
+ export declare const MIN_SCRIPT_LETTERS = 8;
3
+ export declare const MARGIN = 5;
4
+ export declare const SCRIPTS: Record<string, readonly (readonly [number, number])[]>;
5
+ export declare const STOPWORDS: Record<string, readonly string[]>;
6
+ export declare const VIETNAMESE_MARKS = "\u0103\u00E2\u0111\u00EA\u00F4\u01A1\u01B0\u1EA1\u1EA3\u00E3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u0129\u1ECB\u1ECF\u1ECD\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE7\u0169\u1EE5\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF7\u1EF9\u1EF5";
7
+ export declare const detectLanguage: (text: string) => string | null;
8
+ //# sourceMappingURL=detect-language.d.ts.map
@@ -1,47 +1,17 @@
1
- /**
2
- * Platform detection and keyboard symbol utilities
3
- */
4
1
  export type Platform = 'mac' | 'windows' | 'linux' | 'unknown';
5
- /**
6
- * Detect the user's operating system
7
- */
8
2
  export declare function detectPlatform(): Platform;
9
- /**
10
- * Get the command/control key symbol for the current platform
11
- */
12
3
  export declare function getCmdSymbol(): string;
13
- /**
14
- * Get the shift key symbol for the current platform
15
- */
16
4
  export declare function getShiftSymbol(): string;
17
- /**
18
- * Get the option/alt key symbol for the current platform
19
- */
20
5
  export declare function getOptionSymbol(): string;
21
- /**
22
- * Get the backspace key symbol for the current platform
23
- */
24
6
  export declare function getBackspaceSymbol(): string;
25
- /**
26
- * Get the delete key symbol for the current platform
27
- */
28
7
  export declare function getDeleteSymbol(): string;
29
- /**
30
- * Get the arrow key symbols
31
- */
32
8
  export declare function getArrowSymbols(): {
33
9
  down: string;
34
10
  left: string;
35
11
  right: string;
36
12
  up: string;
37
13
  };
38
- /**
39
- * Format a keyboard shortcut for display
40
- */
41
14
  export declare function formatShortcut(keys: string[]): string;
42
- /**
43
- * Common shortcut builders
44
- */
45
15
  export declare const Shortcuts: {
46
16
  cmd: (key: string) => string;
47
17
  cmdA: () => string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `javascript:` and friends in an `href` are the one attribute value that turns
3
+ * allowed markup into an execution vector, so the value is checked rather than
4
+ * only the attribute name.
5
+ */
6
+ export declare const isSafeHref: (value: string) => boolean;
7
+ export declare const isWebUrl: (value: string) => boolean;
8
+ //# sourceMappingURL=safe-href.d.ts.map
@@ -1,6 +1,3 @@
1
- /**
2
- * URL detection and validation utilities for the editor
3
- */
4
1
  export interface URLInfo {
5
2
  isUrl: boolean;
6
3
  isImage: boolean;
@@ -9,44 +6,14 @@ export interface URLInfo {
9
6
  isVimeo: boolean;
10
7
  url: string;
11
8
  }
12
- /**
13
- * Check if a string is a valid URL
14
- */
15
9
  export declare function isValidUrl(text: string): boolean;
16
- /**
17
- * Check if a URL is an image based on file extension
18
- */
19
10
  export declare function isImageUrl(url: string): boolean;
20
- /**
21
- * Check if a URL is a video based on file extension
22
- */
23
11
  export declare function isVideoUrl(url: string): boolean;
24
- /**
25
- * Check if a URL is a YouTube video
26
- */
27
12
  export declare function isYouTubeUrl(url: string): boolean;
28
- /**
29
- * Check if a URL is a Vimeo video
30
- */
31
13
  export declare function isVimeoUrl(url: string): boolean;
32
- /**
33
- * Extract YouTube video ID from URL
34
- */
35
14
  export declare function extractYouTubeId(url: string): string | null;
36
- /**
37
- * Extract Vimeo video ID from URL
38
- */
39
15
  export declare function extractVimeoId(url: string): string | null;
40
- /**
41
- * Convert YouTube URL to embed URL
42
- */
43
16
  export declare function convertYouTubeToEmbed(url: string): string | null;
44
- /**
45
- * Convert Vimeo URL to embed URL
46
- */
47
17
  export declare function convertVimeoToEmbed(url: string): string | null;
48
- /**
49
- * Analyze a text string to determine if it's a URL and what type
50
- */
51
18
  export declare function analyzeUrl(text: string): URLInfo;
52
19
  //# sourceMappingURL=url.d.ts.map
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  "@types/bun": "^1.4.2",
10
10
  "terser": "^5.51.2",
11
11
  "typescript": "^6.0.3",
12
- "vite": "^8.3.0",
13
- "vite-plugin-dts": "^5.1.0"
12
+ "vite": "^8.3.2",
13
+ "vite-plugin-dts": "^5.1.1"
14
14
  },
15
15
  "exports": {
16
16
  ".": {
@@ -53,5 +53,5 @@
53
53
  },
54
54
  "sideEffects": false,
55
55
  "types": "dist/index.d.ts",
56
- "version": "0.6.0"
56
+ "version": "0.7.0-beta.440"
57
57
  }
@@ -1,2 +0,0 @@
1
- var e=()=>({background:"var(--clepit-code-bg)",comment:"var(--clepit-code-comment)",function:"var(--clepit-code-function)",gutter:"var(--clepit-code-gutter)",keyword:"var(--clepit-code-keyword)",number:"var(--clepit-code-number)",punctuation:"var(--clepit-code-punctuation)",selection:"var(--clepit-code-selection-bg)",string:"var(--clepit-code-string)",text:"var(--clepit-code-text)",type:"var(--clepit-code-type)"}),t={dark:{background:"#1c2128",comment:"rgba(240, 246, 252, 0.42)",function:"#d2a8ff",gutter:"rgba(240, 246, 252, 0.42)",keyword:"#ff7b72",number:"#79c0ff",punctuation:"rgba(240, 246, 252, 0.62)",selection:"rgba(124, 124, 255, 0.24)",string:"#7ee787",text:"rgba(240, 246, 252, 0.92)",type:"#ffa657"},dracula:{background:"#282a36",comment:"#6272a4",function:"#50fa7b",gutter:"#6272a4",keyword:"#ff79c6",number:"#bd93f9",punctuation:"#f8f8f2",selection:"rgba(68, 71, 90, 0.8)",string:"#f1fa8c",text:"#f8f8f2",type:"#8be9fd"},github:{background:"#ffffff",comment:"#6e7781",function:"#8250df",gutter:"#8c959f",keyword:"#cf222e",number:"#0550ae",punctuation:"#24292f",selection:"rgba(84, 174, 255, 0.24)",string:"#0a3069",text:"#24292f",type:"#953800"},"github-dark":{background:"#0d1117",comment:"#8b949e",function:"#d2a8ff",gutter:"#6e7681",keyword:"#ff7b72",number:"#79c0ff",punctuation:"#c9d1d9",selection:"rgba(56, 139, 253, 0.24)",string:"#a5d6ff",text:"#c9d1d9",type:"#ffa657"},light:{background:"#fdfdfd",comment:"#868f9c",function:"#6f42c1",gutter:"#868f9c",keyword:"#cf222e",number:"#0550ae",punctuation:"#525866",selection:"rgba(91, 91, 255, 0.14)",string:"#0a7c3e",text:"#0a0a0a",type:"#953800"},monokai:{background:"#272822",comment:"#75715e",function:"#a6e22e",gutter:"#75715e",keyword:"#f92672",number:"#ae81ff",punctuation:"#f8f8f2",selection:"rgba(73, 72, 62, 0.9)",string:"#e6db74",text:"#f8f8f2",type:"#66d9ef"},solarized:{background:"#fdf6e3",comment:"#93a1a1",function:"#268bd2",gutter:"#93a1a1",keyword:"#859900",number:"#d33682",punctuation:"#657b83",selection:"rgba(238, 232, 213, 0.9)",string:"#2aa198",text:"#657b83",type:"#b58900"},"solarized-dark":{background:"#002b36",comment:"#586e75",function:"#268bd2",gutter:"#586e75",keyword:"#859900",number:"#d33682",punctuation:"#839496",selection:"rgba(7, 54, 66, 0.9)",string:"#2aa198",text:"#839496",type:"#b58900"},tomorrow:{background:"#fafafa",comment:"#8e908c",function:"#4271ae",gutter:"#8e908c",keyword:"#8959a8",number:"#f5871f",punctuation:"#4d4d4c",selection:"rgba(214, 214, 214, 0.9)",string:"#718c00",text:"#4d4d4c",type:"#c82829"}},n=["keyword","string","number","comment","function","type","punctuation","text"],i=Object.fromEntries(n.map(e=>[e,`clepit-code-${e}`])),s=e=>e>="0"&&e<="9",r=e=>" "===e||"\t"===e||"\n"===e||"\r"===e||"\f"===e||"\v"===e,o=e=>e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e||e.charCodeAt(0)>127,a=e=>(e.lineComments?.length??0)>0||(e.blockComments?.length??0)>0||(e.strings?.length??0)>0||(e.keywords?.length??0)>0||(e.types?.length??0)>0||(e.constants?.length??0)>0||(e.builtins?.length??0)>0,l=(e,t)=>new Set((e??[]).map(e=>t?e.toLowerCase():e)),c=(e,t)=>{let n=t;for(;n<e.length&&(" "===e[n]||"\t"===e[n]);)n++;return e[n]??""},u=(e,t,n)=>{const i=n.close??n.open;let s=t+n.open.length;for(;s<e.length;)if(n.escape&&e[s]===n.escape)s+=2;else{if(!n.multiline&&"\n"===e[s])return s;if(e.startsWith(i,s))return s+i.length;s++}return e.length},f=(e,t)=>{let n=t;if("0"===e[n]&&/[xXbBoO]/.test(e[n+1]??"")){for(n+=2;n<e.length&&/[0-9a-fA-F_]/.test(e[n]);)n++;return n}for(;n<e.length&&/[0-9_]/.test(e[n]);)n++;if("."===e[n]&&s(e[n+1]??""))for(n++;n<e.length&&/[0-9_]/.test(e[n]);)n++;if(/[eE]/.test(e[n]??"")&&(s(e[n+1]??"")||/[+-]/.test(e[n+1]??"")&&s(e[n+2]??"")))for(n+=2;n<e.length&&s(e[n]);)n++;for(;n<e.length&&o(e[n])&&!s(e[n])&&/[a-zA-Z]/.test(e[n])&&n-t<32&&/[nlLfFdDuUmM]/.test(e[n]);)n++;return n},d=[{escape:"\\",open:'"'},{escape:"\\",open:"'"}],p={blockComments:[["/*","*/"]],lineComments:["//"]},m=e=>({...p,functionCalls:!0,strings:d,...e}),g=e=>({functionCalls:!0,lineComments:["#"],strings:d,...e}),y=["as","async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","from","function","get","if","import","in","instanceof","let","new","of","return","set","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"],b=[...y,"abstract","declare","enum","implements","infer","interface","is","keyof","namespace","override","private","protected","public","readonly","satisfies","type"],h=m({constants:["false","null","true","undefined","NaN","Infinity"],identifierExtra:"$",keywords:y,strings:[...d,{escape:"\\",multiline:!0,open:"`"}],types:["Array","Boolean","Date","Error","Map","Number","Object","Promise","RegExp","Set","String","Symbol"]}),w={...h,keywords:b,types:[...h.types??[],"any","bigint","boolean","never","number","object","string","symbol","unknown","void"]},k=g({constants:["False","None","True"],keywords:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"],strings:[{escape:"\\",multiline:!0,open:'"""'},{escape:"\\",multiline:!0,open:"'''"},...d],types:["bool","bytes","dict","float","frozenset","int","list","set","str","tuple"]}),v={blockComments:[["\x3c!--","--\x3e"]],strings:d,types:[]},x={assembly:{constants:[],keywords:["add","call","cmp","jmp","jne","je","lea","mov","pop","push","ret","sub","xor"],lineComments:[";","#"],strings:d,types:["byte","dword","qword","word"]},bash:g({builtins:["cd","echo","exit","export","printf","read","source"],constants:["false","true"],identifierExtra:"$",keywords:["case","do","done","elif","else","esac","fi","for","function","if","in","local","return","select","then","until","while"],strings:[{escape:"\\",multiline:!0,open:'"'},{multiline:!0,open:"'"}]}),clojure:{constants:["false","nil","true"],identifierExtra:"-*?!<>=/",keywords:["def","defmacro","defn","do","fn","if","let","loop","ns","quote","recur","require","var","when"],lineComments:[";"],strings:[{escape:"\\",multiline:!0,open:'"'}]},cobol:{caseInsensitive:!0,keywords:["accept","add","call","compute","display","division","else","end","goback","identification","if","move","perform","procedure","program-id","section","stop","to","until","working-storage"],lineComments:["*"],strings:d,types:["pic","picture"]},cpp:m({constants:["false","nullptr","true"],keywords:["auto","break","case","catch","class","const","constexpr","continue","default","delete","do","else","enum","explicit","export","extern","for","friend","goto","if","inline","mutable","namespace","new","noexcept","operator","private","protected","public","return","sizeof","static","struct","switch","template","this","throw","try","typedef","typename","union","using","virtual","volatile","while"],types:["bool","char","double","float","int","long","short","signed","size_t","unsigned","void","wchar_t"]}),csharp:m({constants:["false","null","true"],keywords:["abstract","as","async","await","base","break","case","catch","class","const","continue","default","delegate","do","else","enum","event","explicit","extern","finally","fixed","for","foreach","get","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","set","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unsafe","using","var","virtual","void","while","yield"],types:["bool","byte","char","decimal","double","float","int","long","object","sbyte","short","string","uint","ulong","ushort"]}),css:{blockComments:[["/*","*/"]],functionCalls:!0,keywords:["and","from","important","not","only","to"],strings:d,types:["@container","@import","@keyframes","@layer","@media","@property","@supports"]},dart:m({constants:["false","null","true"],keywords:["abstract","as","assert","async","await","break","case","catch","class","const","continue","covariant","default","deferred","do","else","enum","export","extends","extension","external","factory","final","finally","for","get","if","implements","import","in","is","late","library","mixin","new","on","operator","part","required","rethrow","return","sealed","set","show","static","super","switch","sync","this","throw","try","typedef","var","while","with","yield"],types:["bool","double","dynamic","int","List","Map","num","Object","Set","String","void"]}),diff:{lineComments:["diff ","index ","--- ","+++ "],strings:[]},dockerfile:g({caseInsensitive:!0,keywords:["add","arg","cmd","copy","entrypoint","env","expose","from","healthcheck","label","run","shell","stopsignal","user","volume","workdir"]}),erlang:{constants:["false","true","undefined"],functionCalls:!0,keywords:["after","begin","case","catch","cond","end","fun","if","let","of","receive","try","when"],lineComments:["%"],strings:d},fortran:{caseInsensitive:!0,keywords:["allocate","call","contains","do","else","end","function","if","implicit","module","program","return","subroutine","then","use","while"],lineComments:["!"],strings:d,types:["character","complex","integer","logical","real"]},go:m({builtins:["append","cap","copy","delete","len","make","new","panic","recover"],constants:["false","iota","nil","true"],keywords:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],strings:[...d,{multiline:!0,open:"`"}],types:["bool","byte","complex128","complex64","error","float32","float64","int","int16","int32","int64","int8","rune","string","uint","uint16","uint32","uint64","uint8","uintptr"]}),graphql:g({keywords:["directive","enum","extend","fragment","implements","input","interface","mutation","on","query","scalar","schema","subscription","type","union"],types:["Boolean","Float","ID","Int","String"]}),groovy:m({constants:["false","null","true"],keywords:["abstract","as","assert","break","case","catch","class","const","continue","def","default","do","else","enum","extends","final","finally","for","if","implements","import","in","instanceof","interface","new","package","private","protected","public","return","static","super","switch","this","throw","throws","trait","try","while"],types:["BigDecimal","Boolean","Integer","List","Map","String","boolean","double","int","long","void"]}),haskell:{blockComments:[["{-","-}"]],constants:["False","Nothing","True"],functionCalls:!0,keywords:["case","class","data","deriving","do","else","if","import","in","infixl","infixr","instance","let","module","newtype","of","then","type","where"],lineComments:["--"],strings:[{escape:"\\",open:'"'}],types:["Bool","Char","Double","Either","Int","Integer","IO","Maybe","String"]},html:v,java:m({constants:["false","null","true"],keywords:["abstract","assert","break","case","catch","class","const","continue","default","do","else","enum","extends","final","finally","for","goto","if","implements","import","instanceof","interface","native","new","package","private","protected","public","record","return","sealed","static","strictfp","super","switch","synchronized","this","throw","throws","transient","try","var","volatile","while","yield"],types:["Boolean","Double","Integer","List","Long","Map","Object","String","boolean","byte","char","double","float","int","long","short","void"]}),javascript:h,json:{constants:["false","null","true"],strings:[{escape:"\\",open:'"'}]},jsx:h,julia:g({blockComments:[["#=","=#"]],constants:["false","nothing","true"],keywords:["abstract","baremodule","begin","break","catch","const","continue","do","else","elseif","end","export","finally","for","function","global","if","import","let","local","macro","module","mutable","primitive","quote","return","struct","try","using","while"],types:["Array","Bool","Char","Dict","Float64","Int","Int64","String"]}),kotlin:m({constants:["false","null","true"],keywords:["as","break","by","class","companion","const","constructor","continue","crossinline","data","do","else","enum","external","final","finally","for","fun","get","if","import","in","infix","init","inline","interface","internal","is","lateinit","object","open","operator","out","override","package","private","protected","public","reified","return","sealed","set","super","suspend","this","throw","try","typealias","val","var","vararg","when","while"],strings:[{escape:"\\",multiline:!0,open:'"""'},...d],types:["Any","Array","Boolean","Char","Double","Float","Int","List","Long","Map","Nothing","Set","String","Unit"]}),lua:{blockComments:[["--[[","]]"]],constants:["false","nil","true"],functionCalls:!0,keywords:["and","break","do","else","elseif","end","for","function","goto","if","in","local","not","or","repeat","return","then","until","while"],lineComments:["--"],strings:[{close:"]]",multiline:!0,open:"[["},...d]},markdown:{lineComments:[],strings:[{open:"`"}]},nginx:g({keywords:["access_log","error_log","events","http","include","index","listen","location","proxy_pass","return","root","server","server_name","ssl_certificate","upstream"]}),objectivec:m({constants:["NO","YES","nil"],identifierExtra:"@",keywords:["@class","@end","@implementation","@interface","@property","@protocol","@selector","@synthesize","break","case","const","continue","default","do","else","enum","extern","for","if","return","sizeof","static","struct","switch","typedef","union","void","while"],types:["BOOL","CGFloat","NSArray","NSDictionary","NSInteger","NSObject","NSString","char","double","float","id","int","long","short"]}),pascal:{blockComments:[["{","}"],["(*","*)"]],caseInsensitive:!0,constants:["false","nil","true"],functionCalls:!0,keywords:["and","array","begin","case","const","div","do","downto","else","end","for","function","goto","if","implementation","interface","mod","not","of","or","procedure","program","record","repeat","then","to","type","unit","until","uses","var","while","with"],lineComments:["//"],strings:[{open:"'"}],types:["boolean","byte","char","integer","real","string"]},perl:g({constants:["undef"],identifierExtra:"$@%",keywords:["do","else","elsif","foreach","for","if","last","local","my","next","our","package","return","sub","unless","until","use","while"]}),php:m({constants:["false","null","true"],identifierExtra:"$",keywords:["abstract","as","break","case","catch","class","clone","const","continue","declare","default","do","echo","else","elseif","enum","extends","final","finally","fn","for","foreach","function","global","if","implements","include","instanceof","interface","match","namespace","new","print","private","protected","public","readonly","require","return","static","switch","throw","trait","try","use","var","while","yield"],lineComments:["//","#"],types:["array","bool","callable","float","int","iterable","mixed","object","string","void"]}),plaintext:{},powershell:g({blockComments:[["<#","#>"]],caseInsensitive:!0,constants:["$false","$null","$true"],identifierExtra:"$-",keywords:["begin","break","catch","continue","do","else","elseif","end","finally","for","foreach","function","if","in","param","process","return","switch","throw","try","until","while"]}),protobuf:m({constants:["false","true"],keywords:["enum","extend","import","map","message","oneof","option","optional","package","repeated","required","reserved","returns","rpc","service","syntax"],types:["bool","bytes","double","fixed32","fixed64","float","int32","int64","sint32","sint64","string","uint32","uint64"]}),python:k,r:g({constants:["FALSE","Inf","NA","NULL","NaN","TRUE"],identifierExtra:".",keywords:["break","else","for","function","if","in","next","repeat","return","while"],types:["character","data.frame","factor","integer","list","logical","matrix","numeric","vector"]}),ruby:g({blockComments:[["=begin","=end"]],constants:["false","nil","true"],identifierExtra:"?!@$",keywords:["alias","and","begin","break","case","class","def","defined?","do","else","elsif","end","ensure","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","undef","unless","until","when","while","yield"],types:["Array","Float","Hash","Integer","String","Symbol"]}),rust:m({constants:["false","None","Some","true"],keywords:["as","async","await","break","const","continue","crate","dyn","else","enum","extern","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","static","struct","super","trait","type","unsafe","use","where","while"],types:["String","Vec","bool","char","f32","f64","i128","i16","i32","i64","i8","isize","str","u128","u16","u32","u64","u8","usize"]}),scala:m({constants:["false","null","true"],keywords:["abstract","case","catch","class","def","do","else","extends","final","finally","for","given","if","implicit","import","lazy","match","new","object","override","package","private","protected","return","sealed","super","this","throw","trait","try","type","val","var","while","with","yield"],types:["Any","Boolean","Double","Float","Int","List","Long","Map","Option","Seq","String","Unit"]}),scheme:{constants:["#f","#t"],identifierExtra:"-*?!<>=/",keywords:["begin","cond","define","do","else","if","lambda","let","let*","letrec","quote","set!"],lineComments:[";"],strings:[{escape:"\\",open:'"'}]},shell:g({builtins:["cd","echo","exit","export","printf","read","source"],identifierExtra:"$",keywords:["case","do","done","elif","else","esac","fi","for","function","if","in","return","then","until","while"],strings:[{escape:"\\",multiline:!0,open:'"'},{multiline:!0,open:"'"}]}),sql:{blockComments:[["/*","*/"]],caseInsensitive:!0,constants:["false","true"],functionCalls:!0,keywords:["add","all","alter","and","as","asc","begin","between","by","case","cast","column","commit","create","cross","delete","desc","distinct","drop","else","end","exists","from","full","group","having","in","index","inner","insert","into","is","join","left","like","limit","not","null","offset","on","or","order","outer","primary","references","returning","right","rollback","select","set","table","then","union","unique","update","values","view","when","where","with"],lineComments:["--"],strings:[{open:"'"},{open:'"'}],types:["bigint","boolean","bytea","date","decimal","integer","jsonb","numeric","serial","text","timestamp","uuid","varchar"]},swift:m({constants:["false","nil","true"],keywords:["actor","as","associatedtype","async","await","break","case","catch","class","continue","default","defer","deinit","do","else","enum","extension","fallthrough","fileprivate","final","for","func","guard","if","import","in","init","inout","internal","is","lazy","let","mutating","open","operator","private","protocol","public","repeat","return","self","static","struct","subscript","super","switch","throw","throws","try","typealias","var","where","while"],types:["Any","Array","Bool","Character","Dictionary","Double","Float","Int","Optional","Set","String","UInt","Void"]}),toml:g({constants:["false","true"],functionCalls:!1}),tsx:w,typescript:w,vb:{caseInsensitive:!0,constants:["False","Nothing","True"],functionCalls:!0,keywords:["as","byval","case","catch","class","dim","do","each","else","elseif","end","finally","for","function","if","imports","in","loop","module","namespace","new","next","private","public","return","select","set","sub","then","throw","try","while"],lineComments:["'"],strings:[{open:'"'}],types:["Boolean","Date","Double","Integer","Long","Object","String"]},verilog:m({keywords:["always","assign","begin","case","else","end","endcase","endmodule","for","if","initial","input","module","output","parameter","posedge","negedge"],types:["integer","logic","reg","wire"]}),vhdl:{caseInsensitive:!0,constants:["false","true"],functionCalls:!0,keywords:["architecture","begin","case","component","else","elsif","end","entity","for","function","if","is","library","loop","of","port","process","signal","then","use","when","while"],lineComments:["--"],strings:[{open:'"'}],types:["bit","boolean","integer","natural","std_logic","std_logic_vector"]},xml:v,yaml:g({constants:["false","no","null","true","yes"],functionCalls:!1})},C=(e,t)=>((e,t)=>{if(0===e.length)return[];if(!a(t))return[{classes:"",text:e}];const n=[],d=l(t.keywords,t.caseInsensitive),p=l(t.types,t.caseInsensitive),m=l(t.constants,t.caseInsensitive),g=l(t.builtins,t.caseInsensitive),y=e=>o(e)||s(e)||(t.identifierExtra?.includes(e)??!1);let b=0,h="";const w=()=>{0!==h.length&&(n.push({classes:"",text:h}),h="")},k=(e,t)=>{w(),n.push({classes:t,text:e})};for(;b<e.length;){const n=e.slice(b),a=e[b],l=(t.blockComments??[]).find(([e])=>n.startsWith(e));if(l){const[t,n]=l,s=e.indexOf(n,b+t.length),r=-1===s?e.length:s+n.length;k(e.slice(b,r),i.comment),b=r;continue}if(void 0!==(t.lineComments??[]).find(e=>n.startsWith(e))){const t=e.indexOf("\n",b),n=-1===t?e.length:t;k(e.slice(b,n),i.comment),b=n;continue}const w=(t.strings??[]).find(e=>n.startsWith(e.open));if(w){const t=u(e,b,w);k(e.slice(b,t),i.string),b=t;continue}if(s(a)&&!(b>0&&y(e[b-1]))){const t=f(e,b);k(e.slice(b,t),i.number),b=t;continue}if(o(a)||t.identifierExtra?.includes(a)){let n=b+1;for(;n<e.length&&y(e[n]);)n++;const s=e.slice(b,n),r=t.caseInsensitive?s.toLowerCase():s;d.has(r)?k(s,i.keyword):p.has(r)?k(s,i.type):m.has(r)?k(s,i.number):g.has(r)||t.functionCalls&&"("===c(e,n)?k(s,i.function):h+=s,b=n;continue}r(a)?(h+=a,b++):(k(a,i.punctuation),b++)}return w(),n})(e,x[t]??{});export{e as a,n as i,x as n,t as r,C as t};
2
- //# sourceMappingURL=highlight-C4NcTcIm.mjs.map
@@ -1,2 +0,0 @@
1
- var e=()=>({background:"var(--clepit-code-bg)",comment:"var(--clepit-code-comment)",function:"var(--clepit-code-function)",gutter:"var(--clepit-code-gutter)",keyword:"var(--clepit-code-keyword)",number:"var(--clepit-code-number)",punctuation:"var(--clepit-code-punctuation)",selection:"var(--clepit-code-selection-bg)",string:"var(--clepit-code-string)",text:"var(--clepit-code-text)",type:"var(--clepit-code-type)"}),t={dark:{background:"#1c2128",comment:"rgba(240, 246, 252, 0.42)",function:"#d2a8ff",gutter:"rgba(240, 246, 252, 0.42)",keyword:"#ff7b72",number:"#79c0ff",punctuation:"rgba(240, 246, 252, 0.62)",selection:"rgba(124, 124, 255, 0.24)",string:"#7ee787",text:"rgba(240, 246, 252, 0.92)",type:"#ffa657"},dracula:{background:"#282a36",comment:"#6272a4",function:"#50fa7b",gutter:"#6272a4",keyword:"#ff79c6",number:"#bd93f9",punctuation:"#f8f8f2",selection:"rgba(68, 71, 90, 0.8)",string:"#f1fa8c",text:"#f8f8f2",type:"#8be9fd"},github:{background:"#ffffff",comment:"#6e7781",function:"#8250df",gutter:"#8c959f",keyword:"#cf222e",number:"#0550ae",punctuation:"#24292f",selection:"rgba(84, 174, 255, 0.24)",string:"#0a3069",text:"#24292f",type:"#953800"},"github-dark":{background:"#0d1117",comment:"#8b949e",function:"#d2a8ff",gutter:"#6e7681",keyword:"#ff7b72",number:"#79c0ff",punctuation:"#c9d1d9",selection:"rgba(56, 139, 253, 0.24)",string:"#a5d6ff",text:"#c9d1d9",type:"#ffa657"},light:{background:"#fdfdfd",comment:"#868f9c",function:"#6f42c1",gutter:"#868f9c",keyword:"#cf222e",number:"#0550ae",punctuation:"#525866",selection:"rgba(91, 91, 255, 0.14)",string:"#0a7c3e",text:"#0a0a0a",type:"#953800"},monokai:{background:"#272822",comment:"#75715e",function:"#a6e22e",gutter:"#75715e",keyword:"#f92672",number:"#ae81ff",punctuation:"#f8f8f2",selection:"rgba(73, 72, 62, 0.9)",string:"#e6db74",text:"#f8f8f2",type:"#66d9ef"},solarized:{background:"#fdf6e3",comment:"#93a1a1",function:"#268bd2",gutter:"#93a1a1",keyword:"#859900",number:"#d33682",punctuation:"#657b83",selection:"rgba(238, 232, 213, 0.9)",string:"#2aa198",text:"#657b83",type:"#b58900"},"solarized-dark":{background:"#002b36",comment:"#586e75",function:"#268bd2",gutter:"#586e75",keyword:"#859900",number:"#d33682",punctuation:"#839496",selection:"rgba(7, 54, 66, 0.9)",string:"#2aa198",text:"#839496",type:"#b58900"},tomorrow:{background:"#fafafa",comment:"#8e908c",function:"#4271ae",gutter:"#8e908c",keyword:"#8959a8",number:"#f5871f",punctuation:"#4d4d4c",selection:"rgba(214, 214, 214, 0.9)",string:"#718c00",text:"#4d4d4c",type:"#c82829"}},n=["keyword","string","number","comment","function","type","punctuation","text"],i=Object.fromEntries(n.map(e=>[e,`clepit-code-${e}`])),r=e=>e>="0"&&e<="9",s=e=>" "===e||"\t"===e||"\n"===e||"\r"===e||"\f"===e||"\v"===e,o=e=>e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e||e.charCodeAt(0)>127,a=e=>(e.lineComments?.length??0)>0||(e.blockComments?.length??0)>0||(e.strings?.length??0)>0||(e.keywords?.length??0)>0||(e.types?.length??0)>0||(e.constants?.length??0)>0||(e.builtins?.length??0)>0,l=(e,t)=>new Set((e??[]).map(e=>t?e.toLowerCase():e)),c=(e,t)=>{let n=t;for(;n<e.length&&(" "===e[n]||"\t"===e[n]);)n++;return e[n]??""},u=(e,t,n)=>{const i=n.close??n.open;let r=t+n.open.length;for(;r<e.length;)if(n.escape&&e[r]===n.escape)r+=2;else{if(!n.multiline&&"\n"===e[r])return r;if(e.startsWith(i,r))return r+i.length;r++}return e.length},f=(e,t)=>{let n=t;if("0"===e[n]&&/[xXbBoO]/.test(e[n+1]??"")){for(n+=2;n<e.length&&/[0-9a-fA-F_]/.test(e[n]);)n++;return n}for(;n<e.length&&/[0-9_]/.test(e[n]);)n++;if("."===e[n]&&r(e[n+1]??""))for(n++;n<e.length&&/[0-9_]/.test(e[n]);)n++;if(/[eE]/.test(e[n]??"")&&(r(e[n+1]??"")||/[+-]/.test(e[n+1]??"")&&r(e[n+2]??"")))for(n+=2;n<e.length&&r(e[n]);)n++;for(;n<e.length&&o(e[n])&&!r(e[n])&&/[a-zA-Z]/.test(e[n])&&n-t<32&&/[nlLfFdDuUmM]/.test(e[n]);)n++;return n},d=[{escape:"\\",open:'"'},{escape:"\\",open:"'"}],p={blockComments:[["/*","*/"]],lineComments:["//"]},m=e=>({...p,functionCalls:!0,strings:d,...e}),g=e=>({functionCalls:!0,lineComments:["#"],strings:d,...e}),y=["as","async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","from","function","get","if","import","in","instanceof","let","new","of","return","set","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"],b=[...y,"abstract","declare","enum","implements","infer","interface","is","keyof","namespace","override","private","protected","public","readonly","satisfies","type"],h=m({constants:["false","null","true","undefined","NaN","Infinity"],identifierExtra:"$",keywords:y,strings:[...d,{escape:"\\",multiline:!0,open:"`"}],types:["Array","Boolean","Date","Error","Map","Number","Object","Promise","RegExp","Set","String","Symbol"]}),w={...h,keywords:b,types:[...h.types??[],"any","bigint","boolean","never","number","object","string","symbol","unknown","void"]},k=g({constants:["False","None","True"],keywords:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"],strings:[{escape:"\\",multiline:!0,open:'"""'},{escape:"\\",multiline:!0,open:"'''"},...d],types:["bool","bytes","dict","float","frozenset","int","list","set","str","tuple"]}),v={blockComments:[["\x3c!--","--\x3e"]],strings:d,types:[]},x={assembly:{constants:[],keywords:["add","call","cmp","jmp","jne","je","lea","mov","pop","push","ret","sub","xor"],lineComments:[";","#"],strings:d,types:["byte","dword","qword","word"]},bash:g({builtins:["cd","echo","exit","export","printf","read","source"],constants:["false","true"],identifierExtra:"$",keywords:["case","do","done","elif","else","esac","fi","for","function","if","in","local","return","select","then","until","while"],strings:[{escape:"\\",multiline:!0,open:'"'},{multiline:!0,open:"'"}]}),clojure:{constants:["false","nil","true"],identifierExtra:"-*?!<>=/",keywords:["def","defmacro","defn","do","fn","if","let","loop","ns","quote","recur","require","var","when"],lineComments:[";"],strings:[{escape:"\\",multiline:!0,open:'"'}]},cobol:{caseInsensitive:!0,keywords:["accept","add","call","compute","display","division","else","end","goback","identification","if","move","perform","procedure","program-id","section","stop","to","until","working-storage"],lineComments:["*"],strings:d,types:["pic","picture"]},cpp:m({constants:["false","nullptr","true"],keywords:["auto","break","case","catch","class","const","constexpr","continue","default","delete","do","else","enum","explicit","export","extern","for","friend","goto","if","inline","mutable","namespace","new","noexcept","operator","private","protected","public","return","sizeof","static","struct","switch","template","this","throw","try","typedef","typename","union","using","virtual","volatile","while"],types:["bool","char","double","float","int","long","short","signed","size_t","unsigned","void","wchar_t"]}),csharp:m({constants:["false","null","true"],keywords:["abstract","as","async","await","base","break","case","catch","class","const","continue","default","delegate","do","else","enum","event","explicit","extern","finally","fixed","for","foreach","get","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","set","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unsafe","using","var","virtual","void","while","yield"],types:["bool","byte","char","decimal","double","float","int","long","object","sbyte","short","string","uint","ulong","ushort"]}),css:{blockComments:[["/*","*/"]],functionCalls:!0,keywords:["and","from","important","not","only","to"],strings:d,types:["@container","@import","@keyframes","@layer","@media","@property","@supports"]},dart:m({constants:["false","null","true"],keywords:["abstract","as","assert","async","await","break","case","catch","class","const","continue","covariant","default","deferred","do","else","enum","export","extends","extension","external","factory","final","finally","for","get","if","implements","import","in","is","late","library","mixin","new","on","operator","part","required","rethrow","return","sealed","set","show","static","super","switch","sync","this","throw","try","typedef","var","while","with","yield"],types:["bool","double","dynamic","int","List","Map","num","Object","Set","String","void"]}),diff:{lineComments:["diff ","index ","--- ","+++ "],strings:[]},dockerfile:g({caseInsensitive:!0,keywords:["add","arg","cmd","copy","entrypoint","env","expose","from","healthcheck","label","run","shell","stopsignal","user","volume","workdir"]}),erlang:{constants:["false","true","undefined"],functionCalls:!0,keywords:["after","begin","case","catch","cond","end","fun","if","let","of","receive","try","when"],lineComments:["%"],strings:d},fortran:{caseInsensitive:!0,keywords:["allocate","call","contains","do","else","end","function","if","implicit","module","program","return","subroutine","then","use","while"],lineComments:["!"],strings:d,types:["character","complex","integer","logical","real"]},go:m({builtins:["append","cap","copy","delete","len","make","new","panic","recover"],constants:["false","iota","nil","true"],keywords:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],strings:[...d,{multiline:!0,open:"`"}],types:["bool","byte","complex128","complex64","error","float32","float64","int","int16","int32","int64","int8","rune","string","uint","uint16","uint32","uint64","uint8","uintptr"]}),graphql:g({keywords:["directive","enum","extend","fragment","implements","input","interface","mutation","on","query","scalar","schema","subscription","type","union"],types:["Boolean","Float","ID","Int","String"]}),groovy:m({constants:["false","null","true"],keywords:["abstract","as","assert","break","case","catch","class","const","continue","def","default","do","else","enum","extends","final","finally","for","if","implements","import","in","instanceof","interface","new","package","private","protected","public","return","static","super","switch","this","throw","throws","trait","try","while"],types:["BigDecimal","Boolean","Integer","List","Map","String","boolean","double","int","long","void"]}),haskell:{blockComments:[["{-","-}"]],constants:["False","Nothing","True"],functionCalls:!0,keywords:["case","class","data","deriving","do","else","if","import","in","infixl","infixr","instance","let","module","newtype","of","then","type","where"],lineComments:["--"],strings:[{escape:"\\",open:'"'}],types:["Bool","Char","Double","Either","Int","Integer","IO","Maybe","String"]},html:v,java:m({constants:["false","null","true"],keywords:["abstract","assert","break","case","catch","class","const","continue","default","do","else","enum","extends","final","finally","for","goto","if","implements","import","instanceof","interface","native","new","package","private","protected","public","record","return","sealed","static","strictfp","super","switch","synchronized","this","throw","throws","transient","try","var","volatile","while","yield"],types:["Boolean","Double","Integer","List","Long","Map","Object","String","boolean","byte","char","double","float","int","long","short","void"]}),javascript:h,json:{constants:["false","null","true"],strings:[{escape:"\\",open:'"'}]},jsx:h,julia:g({blockComments:[["#=","=#"]],constants:["false","nothing","true"],keywords:["abstract","baremodule","begin","break","catch","const","continue","do","else","elseif","end","export","finally","for","function","global","if","import","let","local","macro","module","mutable","primitive","quote","return","struct","try","using","while"],types:["Array","Bool","Char","Dict","Float64","Int","Int64","String"]}),kotlin:m({constants:["false","null","true"],keywords:["as","break","by","class","companion","const","constructor","continue","crossinline","data","do","else","enum","external","final","finally","for","fun","get","if","import","in","infix","init","inline","interface","internal","is","lateinit","object","open","operator","out","override","package","private","protected","public","reified","return","sealed","set","super","suspend","this","throw","try","typealias","val","var","vararg","when","while"],strings:[{escape:"\\",multiline:!0,open:'"""'},...d],types:["Any","Array","Boolean","Char","Double","Float","Int","List","Long","Map","Nothing","Set","String","Unit"]}),lua:{blockComments:[["--[[","]]"]],constants:["false","nil","true"],functionCalls:!0,keywords:["and","break","do","else","elseif","end","for","function","goto","if","in","local","not","or","repeat","return","then","until","while"],lineComments:["--"],strings:[{close:"]]",multiline:!0,open:"[["},...d]},markdown:{lineComments:[],strings:[{open:"`"}]},nginx:g({keywords:["access_log","error_log","events","http","include","index","listen","location","proxy_pass","return","root","server","server_name","ssl_certificate","upstream"]}),objectivec:m({constants:["NO","YES","nil"],identifierExtra:"@",keywords:["@class","@end","@implementation","@interface","@property","@protocol","@selector","@synthesize","break","case","const","continue","default","do","else","enum","extern","for","if","return","sizeof","static","struct","switch","typedef","union","void","while"],types:["BOOL","CGFloat","NSArray","NSDictionary","NSInteger","NSObject","NSString","char","double","float","id","int","long","short"]}),pascal:{blockComments:[["{","}"],["(*","*)"]],caseInsensitive:!0,constants:["false","nil","true"],functionCalls:!0,keywords:["and","array","begin","case","const","div","do","downto","else","end","for","function","goto","if","implementation","interface","mod","not","of","or","procedure","program","record","repeat","then","to","type","unit","until","uses","var","while","with"],lineComments:["//"],strings:[{open:"'"}],types:["boolean","byte","char","integer","real","string"]},perl:g({constants:["undef"],identifierExtra:"$@%",keywords:["do","else","elsif","foreach","for","if","last","local","my","next","our","package","return","sub","unless","until","use","while"]}),php:m({constants:["false","null","true"],identifierExtra:"$",keywords:["abstract","as","break","case","catch","class","clone","const","continue","declare","default","do","echo","else","elseif","enum","extends","final","finally","fn","for","foreach","function","global","if","implements","include","instanceof","interface","match","namespace","new","print","private","protected","public","readonly","require","return","static","switch","throw","trait","try","use","var","while","yield"],lineComments:["//","#"],types:["array","bool","callable","float","int","iterable","mixed","object","string","void"]}),plaintext:{},powershell:g({blockComments:[["<#","#>"]],caseInsensitive:!0,constants:["$false","$null","$true"],identifierExtra:"$-",keywords:["begin","break","catch","continue","do","else","elseif","end","finally","for","foreach","function","if","in","param","process","return","switch","throw","try","until","while"]}),protobuf:m({constants:["false","true"],keywords:["enum","extend","import","map","message","oneof","option","optional","package","repeated","required","reserved","returns","rpc","service","syntax"],types:["bool","bytes","double","fixed32","fixed64","float","int32","int64","sint32","sint64","string","uint32","uint64"]}),python:k,r:g({constants:["FALSE","Inf","NA","NULL","NaN","TRUE"],identifierExtra:".",keywords:["break","else","for","function","if","in","next","repeat","return","while"],types:["character","data.frame","factor","integer","list","logical","matrix","numeric","vector"]}),ruby:g({blockComments:[["=begin","=end"]],constants:["false","nil","true"],identifierExtra:"?!@$",keywords:["alias","and","begin","break","case","class","def","defined?","do","else","elsif","end","ensure","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","undef","unless","until","when","while","yield"],types:["Array","Float","Hash","Integer","String","Symbol"]}),rust:m({constants:["false","None","Some","true"],keywords:["as","async","await","break","const","continue","crate","dyn","else","enum","extern","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","static","struct","super","trait","type","unsafe","use","where","while"],types:["String","Vec","bool","char","f32","f64","i128","i16","i32","i64","i8","isize","str","u128","u16","u32","u64","u8","usize"]}),scala:m({constants:["false","null","true"],keywords:["abstract","case","catch","class","def","do","else","extends","final","finally","for","given","if","implicit","import","lazy","match","new","object","override","package","private","protected","return","sealed","super","this","throw","trait","try","type","val","var","while","with","yield"],types:["Any","Boolean","Double","Float","Int","List","Long","Map","Option","Seq","String","Unit"]}),scheme:{constants:["#f","#t"],identifierExtra:"-*?!<>=/",keywords:["begin","cond","define","do","else","if","lambda","let","let*","letrec","quote","set!"],lineComments:[";"],strings:[{escape:"\\",open:'"'}]},shell:g({builtins:["cd","echo","exit","export","printf","read","source"],identifierExtra:"$",keywords:["case","do","done","elif","else","esac","fi","for","function","if","in","return","then","until","while"],strings:[{escape:"\\",multiline:!0,open:'"'},{multiline:!0,open:"'"}]}),sql:{blockComments:[["/*","*/"]],caseInsensitive:!0,constants:["false","true"],functionCalls:!0,keywords:["add","all","alter","and","as","asc","begin","between","by","case","cast","column","commit","create","cross","delete","desc","distinct","drop","else","end","exists","from","full","group","having","in","index","inner","insert","into","is","join","left","like","limit","not","null","offset","on","or","order","outer","primary","references","returning","right","rollback","select","set","table","then","union","unique","update","values","view","when","where","with"],lineComments:["--"],strings:[{open:"'"},{open:'"'}],types:["bigint","boolean","bytea","date","decimal","integer","jsonb","numeric","serial","text","timestamp","uuid","varchar"]},swift:m({constants:["false","nil","true"],keywords:["actor","as","associatedtype","async","await","break","case","catch","class","continue","default","defer","deinit","do","else","enum","extension","fallthrough","fileprivate","final","for","func","guard","if","import","in","init","inout","internal","is","lazy","let","mutating","open","operator","private","protocol","public","repeat","return","self","static","struct","subscript","super","switch","throw","throws","try","typealias","var","where","while"],types:["Any","Array","Bool","Character","Dictionary","Double","Float","Int","Optional","Set","String","UInt","Void"]}),toml:g({constants:["false","true"],functionCalls:!1}),tsx:w,typescript:w,vb:{caseInsensitive:!0,constants:["False","Nothing","True"],functionCalls:!0,keywords:["as","byval","case","catch","class","dim","do","each","else","elseif","end","finally","for","function","if","imports","in","loop","module","namespace","new","next","private","public","return","select","set","sub","then","throw","try","while"],lineComments:["'"],strings:[{open:'"'}],types:["Boolean","Date","Double","Integer","Long","Object","String"]},verilog:m({keywords:["always","assign","begin","case","else","end","endcase","endmodule","for","if","initial","input","module","output","parameter","posedge","negedge"],types:["integer","logic","reg","wire"]}),vhdl:{caseInsensitive:!0,constants:["false","true"],functionCalls:!0,keywords:["architecture","begin","case","component","else","elsif","end","entity","for","function","if","is","library","loop","of","port","process","signal","then","use","when","while"],lineComments:["--"],strings:[{open:'"'}],types:["bit","boolean","integer","natural","std_logic","std_logic_vector"]},xml:v,yaml:g({constants:["false","no","null","true","yes"],functionCalls:!1})},C=(e,t)=>((e,t)=>{if(0===e.length)return[];if(!a(t))return[{classes:"",text:e}];const n=[],d=l(t.keywords,t.caseInsensitive),p=l(t.types,t.caseInsensitive),m=l(t.constants,t.caseInsensitive),g=l(t.builtins,t.caseInsensitive),y=e=>o(e)||r(e)||(t.identifierExtra?.includes(e)??!1);let b=0,h="";const w=()=>{0!==h.length&&(n.push({classes:"",text:h}),h="")},k=(e,t)=>{w(),n.push({classes:t,text:e})};for(;b<e.length;){const n=e.slice(b),a=e[b],l=(t.blockComments??[]).find(([e])=>n.startsWith(e));if(l){const[t,n]=l,r=e.indexOf(n,b+t.length),s=-1===r?e.length:r+n.length;k(e.slice(b,s),i.comment),b=s;continue}if(void 0!==(t.lineComments??[]).find(e=>n.startsWith(e))){const t=e.indexOf("\n",b),n=-1===t?e.length:t;k(e.slice(b,n),i.comment),b=n;continue}const w=(t.strings??[]).find(e=>n.startsWith(e.open));if(w){const t=u(e,b,w);k(e.slice(b,t),i.string),b=t;continue}if(r(a)&&!(b>0&&y(e[b-1]))){const t=f(e,b);k(e.slice(b,t),i.number),b=t;continue}if(o(a)||t.identifierExtra?.includes(a)){let n=b+1;for(;n<e.length&&y(e[n]);)n++;const r=e.slice(b,n),s=t.caseInsensitive?r.toLowerCase():r;d.has(s)?k(r,i.keyword):p.has(s)?k(r,i.type):m.has(s)?k(r,i.number):g.has(s)||t.functionCalls&&"("===c(e,n)?k(r,i.function):h+=r,b=n;continue}s(a)?(h+=a,b++):(k(a,i.punctuation),b++)}return w(),n})(e,x[t]??{});Object.defineProperty(exports,"CODE_THEME_TOKENS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"CODE_TOKEN_GROUPS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"GRAMMARS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"resolveAutoTokens",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"tokenizeCode",{enumerable:!0,get:function(){return C}});
2
- //# sourceMappingURL=highlight-eQD0I7eW.js.map