razor-FUFY3VPD.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. import {
  2. editor_api_exports
  3. } from "./chunk-5Q5BEFT4.js";
  4. import "./chunk-FBUDSZGC.js";
  5. import "./chunk-2LSFTFF7.js";
  6. // node_modules/.pnpm/monaco-editor@0.38.0/node_modules/monaco-editor/esm/vs/basic-languages/razor/razor.js
  7. var __defProp = Object.defineProperty;
  8. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  9. var __getOwnPropNames = Object.getOwnPropertyNames;
  10. var __hasOwnProp = Object.prototype.hasOwnProperty;
  11. var __copyProps = (to, from, except, desc) => {
  12. if (from && typeof from === "object" || typeof from === "function") {
  13. for (let key of __getOwnPropNames(from))
  14. if (!__hasOwnProp.call(to, key) && key !== except)
  15. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  16. }
  17. return to;
  18. };
  19. var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
  20. var monaco_editor_core_exports = {};
  21. __reExport(monaco_editor_core_exports, editor_api_exports);
  22. var EMPTY_ELEMENTS = [
  23. "area",
  24. "base",
  25. "br",
  26. "col",
  27. "embed",
  28. "hr",
  29. "img",
  30. "input",
  31. "keygen",
  32. "link",
  33. "menuitem",
  34. "meta",
  35. "param",
  36. "source",
  37. "track",
  38. "wbr"
  39. ];
  40. var conf = {
  41. wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
  42. comments: {
  43. blockComment: ["<!--", "-->"]
  44. },
  45. brackets: [
  46. ["<!--", "-->"],
  47. ["<", ">"],
  48. ["{", "}"],
  49. ["(", ")"]
  50. ],
  51. autoClosingPairs: [
  52. { open: "{", close: "}" },
  53. { open: "[", close: "]" },
  54. { open: "(", close: ")" },
  55. { open: '"', close: '"' },
  56. { open: "'", close: "'" }
  57. ],
  58. surroundingPairs: [
  59. { open: '"', close: '"' },
  60. { open: "'", close: "'" },
  61. { open: "<", close: ">" }
  62. ],
  63. onEnterRules: [
  64. {
  65. beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
  66. afterText: /^<\/(\w[\w\d]*)\s*>$/i,
  67. action: {
  68. indentAction: monaco_editor_core_exports.languages.IndentAction.IndentOutdent
  69. }
  70. },
  71. {
  72. beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
  73. action: { indentAction: monaco_editor_core_exports.languages.IndentAction.Indent }
  74. }
  75. ]
  76. };
  77. var language = {
  78. defaultToken: "",
  79. tokenPostfix: "",
  80. tokenizer: {
  81. root: [
  82. [/@@@@/],
  83. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.root" }],
  84. [/<!DOCTYPE/, "metatag.html", "@doctype"],
  85. [/<!--/, "comment.html", "@comment"],
  86. [/(<)([\w\-]+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  87. [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
  88. [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
  89. [/(<)([:\w\-]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
  90. [/(<\/)([\w\-]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
  91. [/</, "delimiter.html"],
  92. [/[ \t\r\n]+/],
  93. [/[^<@]+/]
  94. ],
  95. doctype: [
  96. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.comment" }],
  97. [/[^>]+/, "metatag.content.html"],
  98. [/>/, "metatag.html", "@pop"]
  99. ],
  100. comment: [
  101. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.comment" }],
  102. [/-->/, "comment.html", "@pop"],
  103. [/[^-]+/, "comment.content.html"],
  104. [/./, "comment.content.html"]
  105. ],
  106. otherTag: [
  107. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.otherTag" }],
  108. [/\/?>/, "delimiter.html", "@pop"],
  109. [/"([^"]*)"/, "attribute.value"],
  110. [/'([^']*)'/, "attribute.value"],
  111. [/[\w\-]+/, "attribute.name"],
  112. [/=/, "delimiter"],
  113. [/[ \t\r\n]+/]
  114. ],
  115. script: [
  116. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.script" }],
  117. [/type/, "attribute.name", "@scriptAfterType"],
  118. [/"([^"]*)"/, "attribute.value"],
  119. [/'([^']*)'/, "attribute.value"],
  120. [/[\w\-]+/, "attribute.name"],
  121. [/=/, "delimiter"],
  122. [
  123. />/,
  124. {
  125. token: "delimiter.html",
  126. next: "@scriptEmbedded.text/javascript",
  127. nextEmbedded: "text/javascript"
  128. }
  129. ],
  130. [/[ \t\r\n]+/],
  131. [
  132. /(<\/)(script\s*)(>)/,
  133. ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
  134. ]
  135. ],
  136. scriptAfterType: [
  137. [
  138. /@[^@]/,
  139. {
  140. token: "@rematch",
  141. switchTo: "@razorInSimpleState.scriptAfterType"
  142. }
  143. ],
  144. [/=/, "delimiter", "@scriptAfterTypeEquals"],
  145. [
  146. />/,
  147. {
  148. token: "delimiter.html",
  149. next: "@scriptEmbedded.text/javascript",
  150. nextEmbedded: "text/javascript"
  151. }
  152. ],
  153. [/[ \t\r\n]+/],
  154. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  155. ],
  156. scriptAfterTypeEquals: [
  157. [
  158. /@[^@]/,
  159. {
  160. token: "@rematch",
  161. switchTo: "@razorInSimpleState.scriptAfterTypeEquals"
  162. }
  163. ],
  164. [
  165. /"([^"]*)"/,
  166. {
  167. token: "attribute.value",
  168. switchTo: "@scriptWithCustomType.$1"
  169. }
  170. ],
  171. [
  172. /'([^']*)'/,
  173. {
  174. token: "attribute.value",
  175. switchTo: "@scriptWithCustomType.$1"
  176. }
  177. ],
  178. [
  179. />/,
  180. {
  181. token: "delimiter.html",
  182. next: "@scriptEmbedded.text/javascript",
  183. nextEmbedded: "text/javascript"
  184. }
  185. ],
  186. [/[ \t\r\n]+/],
  187. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  188. ],
  189. scriptWithCustomType: [
  190. [
  191. /@[^@]/,
  192. {
  193. token: "@rematch",
  194. switchTo: "@razorInSimpleState.scriptWithCustomType.$S2"
  195. }
  196. ],
  197. [
  198. />/,
  199. {
  200. token: "delimiter.html",
  201. next: "@scriptEmbedded.$S2",
  202. nextEmbedded: "$S2"
  203. }
  204. ],
  205. [/"([^"]*)"/, "attribute.value"],
  206. [/'([^']*)'/, "attribute.value"],
  207. [/[\w\-]+/, "attribute.name"],
  208. [/=/, "delimiter"],
  209. [/[ \t\r\n]+/],
  210. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  211. ],
  212. scriptEmbedded: [
  213. [
  214. /@[^@]/,
  215. {
  216. token: "@rematch",
  217. switchTo: "@razorInEmbeddedState.scriptEmbedded.$S2",
  218. nextEmbedded: "@pop"
  219. }
  220. ],
  221. [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
  222. ],
  223. style: [
  224. [/@[^@]/, { token: "@rematch", switchTo: "@razorInSimpleState.style" }],
  225. [/type/, "attribute.name", "@styleAfterType"],
  226. [/"([^"]*)"/, "attribute.value"],
  227. [/'([^']*)'/, "attribute.value"],
  228. [/[\w\-]+/, "attribute.name"],
  229. [/=/, "delimiter"],
  230. [
  231. />/,
  232. {
  233. token: "delimiter.html",
  234. next: "@styleEmbedded.text/css",
  235. nextEmbedded: "text/css"
  236. }
  237. ],
  238. [/[ \t\r\n]+/],
  239. [
  240. /(<\/)(style\s*)(>)/,
  241. ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
  242. ]
  243. ],
  244. styleAfterType: [
  245. [
  246. /@[^@]/,
  247. {
  248. token: "@rematch",
  249. switchTo: "@razorInSimpleState.styleAfterType"
  250. }
  251. ],
  252. [/=/, "delimiter", "@styleAfterTypeEquals"],
  253. [
  254. />/,
  255. {
  256. token: "delimiter.html",
  257. next: "@styleEmbedded.text/css",
  258. nextEmbedded: "text/css"
  259. }
  260. ],
  261. [/[ \t\r\n]+/],
  262. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  263. ],
  264. styleAfterTypeEquals: [
  265. [
  266. /@[^@]/,
  267. {
  268. token: "@rematch",
  269. switchTo: "@razorInSimpleState.styleAfterTypeEquals"
  270. }
  271. ],
  272. [
  273. /"([^"]*)"/,
  274. {
  275. token: "attribute.value",
  276. switchTo: "@styleWithCustomType.$1"
  277. }
  278. ],
  279. [
  280. /'([^']*)'/,
  281. {
  282. token: "attribute.value",
  283. switchTo: "@styleWithCustomType.$1"
  284. }
  285. ],
  286. [
  287. />/,
  288. {
  289. token: "delimiter.html",
  290. next: "@styleEmbedded.text/css",
  291. nextEmbedded: "text/css"
  292. }
  293. ],
  294. [/[ \t\r\n]+/],
  295. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  296. ],
  297. styleWithCustomType: [
  298. [
  299. /@[^@]/,
  300. {
  301. token: "@rematch",
  302. switchTo: "@razorInSimpleState.styleWithCustomType.$S2"
  303. }
  304. ],
  305. [
  306. />/,
  307. {
  308. token: "delimiter.html",
  309. next: "@styleEmbedded.$S2",
  310. nextEmbedded: "$S2"
  311. }
  312. ],
  313. [/"([^"]*)"/, "attribute.value"],
  314. [/'([^']*)'/, "attribute.value"],
  315. [/[\w\-]+/, "attribute.name"],
  316. [/=/, "delimiter"],
  317. [/[ \t\r\n]+/],
  318. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  319. ],
  320. styleEmbedded: [
  321. [
  322. /@[^@]/,
  323. {
  324. token: "@rematch",
  325. switchTo: "@razorInEmbeddedState.styleEmbedded.$S2",
  326. nextEmbedded: "@pop"
  327. }
  328. ],
  329. [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
  330. ],
  331. razorInSimpleState: [
  332. [/@\*/, "comment.cs", "@razorBlockCommentTopLevel"],
  333. [/@[{(]/, "metatag.cs", "@razorRootTopLevel"],
  334. [/(@)(\s*[\w]+)/, ["metatag.cs", { token: "identifier.cs", switchTo: "@$S2.$S3" }]],
  335. [/[})]/, { token: "metatag.cs", switchTo: "@$S2.$S3" }],
  336. [/\*@/, { token: "comment.cs", switchTo: "@$S2.$S3" }]
  337. ],
  338. razorInEmbeddedState: [
  339. [/@\*/, "comment.cs", "@razorBlockCommentTopLevel"],
  340. [/@[{(]/, "metatag.cs", "@razorRootTopLevel"],
  341. [
  342. /(@)(\s*[\w]+)/,
  343. [
  344. "metatag.cs",
  345. {
  346. token: "identifier.cs",
  347. switchTo: "@$S2.$S3",
  348. nextEmbedded: "$S3"
  349. }
  350. ]
  351. ],
  352. [
  353. /[})]/,
  354. {
  355. token: "metatag.cs",
  356. switchTo: "@$S2.$S3",
  357. nextEmbedded: "$S3"
  358. }
  359. ],
  360. [
  361. /\*@/,
  362. {
  363. token: "comment.cs",
  364. switchTo: "@$S2.$S3",
  365. nextEmbedded: "$S3"
  366. }
  367. ]
  368. ],
  369. razorBlockCommentTopLevel: [
  370. [/\*@/, "@rematch", "@pop"],
  371. [/[^*]+/, "comment.cs"],
  372. [/./, "comment.cs"]
  373. ],
  374. razorBlockComment: [
  375. [/\*@/, "comment.cs", "@pop"],
  376. [/[^*]+/, "comment.cs"],
  377. [/./, "comment.cs"]
  378. ],
  379. razorRootTopLevel: [
  380. [/\{/, "delimiter.bracket.cs", "@razorRoot"],
  381. [/\(/, "delimiter.parenthesis.cs", "@razorRoot"],
  382. [/[})]/, "@rematch", "@pop"],
  383. { include: "razorCommon" }
  384. ],
  385. razorRoot: [
  386. [/\{/, "delimiter.bracket.cs", "@razorRoot"],
  387. [/\(/, "delimiter.parenthesis.cs", "@razorRoot"],
  388. [/\}/, "delimiter.bracket.cs", "@pop"],
  389. [/\)/, "delimiter.parenthesis.cs", "@pop"],
  390. { include: "razorCommon" }
  391. ],
  392. razorCommon: [
  393. [
  394. /[a-zA-Z_]\w*/,
  395. {
  396. cases: {
  397. "@razorKeywords": { token: "keyword.cs" },
  398. "@default": "identifier.cs"
  399. }
  400. }
  401. ],
  402. [/[\[\]]/, "delimiter.array.cs"],
  403. [/[ \t\r\n]+/],
  404. [/\/\/.*$/, "comment.cs"],
  405. [/@\*/, "comment.cs", "@razorBlockComment"],
  406. [/"([^"]*)"/, "string.cs"],
  407. [/'([^']*)'/, "string.cs"],
  408. [/(<)([\w\-]+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  409. [/(<)([\w\-]+)(>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  410. [/(<\/)([\w\-]+)(>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  411. [/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,]/, "delimiter.cs"],
  412. [/\d*\d+[eE]([\-+]?\d+)?/, "number.float.cs"],
  413. [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float.cs"],
  414. [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex.cs"],
  415. [/0[0-7']*[0-7]/, "number.octal.cs"],
  416. [/0[bB][0-1']*[0-1]/, "number.binary.cs"],
  417. [/\d[\d']*/, "number.cs"],
  418. [/\d/, "number.cs"]
  419. ]
  420. },
  421. razorKeywords: [
  422. "abstract",
  423. "as",
  424. "async",
  425. "await",
  426. "base",
  427. "bool",
  428. "break",
  429. "by",
  430. "byte",
  431. "case",
  432. "catch",
  433. "char",
  434. "checked",
  435. "class",
  436. "const",
  437. "continue",
  438. "decimal",
  439. "default",
  440. "delegate",
  441. "do",
  442. "double",
  443. "descending",
  444. "explicit",
  445. "event",
  446. "extern",
  447. "else",
  448. "enum",
  449. "false",
  450. "finally",
  451. "fixed",
  452. "float",
  453. "for",
  454. "foreach",
  455. "from",
  456. "goto",
  457. "group",
  458. "if",
  459. "implicit",
  460. "in",
  461. "int",
  462. "interface",
  463. "internal",
  464. "into",
  465. "is",
  466. "lock",
  467. "long",
  468. "nameof",
  469. "new",
  470. "null",
  471. "namespace",
  472. "object",
  473. "operator",
  474. "out",
  475. "override",
  476. "orderby",
  477. "params",
  478. "private",
  479. "protected",
  480. "public",
  481. "readonly",
  482. "ref",
  483. "return",
  484. "switch",
  485. "struct",
  486. "sbyte",
  487. "sealed",
  488. "short",
  489. "sizeof",
  490. "stackalloc",
  491. "static",
  492. "string",
  493. "select",
  494. "this",
  495. "throw",
  496. "true",
  497. "try",
  498. "typeof",
  499. "uint",
  500. "ulong",
  501. "unchecked",
  502. "unsafe",
  503. "ushort",
  504. "using",
  505. "var",
  506. "virtual",
  507. "volatile",
  508. "void",
  509. "when",
  510. "while",
  511. "where",
  512. "yield",
  513. "model",
  514. "inject"
  515. ],
  516. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/
  517. };
  518. export {
  519. conf,
  520. language
  521. };
  522. /*! Bundled license information:
  523. monaco-editor/esm/vs/basic-languages/razor/razor.js:
  524. (*!-----------------------------------------------------------------------------
  525. * Copyright (c) Microsoft Corporation. All rights reserved.
  526. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  527. * Released under the MIT license
  528. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  529. *-----------------------------------------------------------------------------*)
  530. */
  531. //# sourceMappingURL=razor-FUFY3VPD.js.map