handlebars-GJAW5MA6.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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/handlebars/handlebars.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. ],
  52. autoClosingPairs: [
  53. { open: "{", close: "}" },
  54. { open: "[", close: "]" },
  55. { open: "(", close: ")" },
  56. { open: '"', close: '"' },
  57. { open: "'", close: "'" }
  58. ],
  59. surroundingPairs: [
  60. { open: "<", close: ">" },
  61. { open: '"', close: '"' },
  62. { open: "'", close: "'" }
  63. ],
  64. onEnterRules: [
  65. {
  66. beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
  67. afterText: /^<\/(\w[\w\d]*)\s*>$/i,
  68. action: {
  69. indentAction: monaco_editor_core_exports.languages.IndentAction.IndentOutdent
  70. }
  71. },
  72. {
  73. beforeText: new RegExp(`<(?!(?:${EMPTY_ELEMENTS.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, "i"),
  74. action: { indentAction: monaco_editor_core_exports.languages.IndentAction.Indent }
  75. }
  76. ]
  77. };
  78. var language = {
  79. defaultToken: "",
  80. tokenPostfix: "",
  81. tokenizer: {
  82. root: [
  83. [/\{\{!--/, "comment.block.start.handlebars", "@commentBlock"],
  84. [/\{\{!/, "comment.start.handlebars", "@comment"],
  85. [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.root" }],
  86. [/<!DOCTYPE/, "metatag.html", "@doctype"],
  87. [/<!--/, "comment.html", "@commentHtml"],
  88. [/(<)(\w+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
  89. [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
  90. [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
  91. [/(<)([:\w]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
  92. [/(<\/)(\w+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
  93. [/</, "delimiter.html"],
  94. [/\{/, "delimiter.html"],
  95. [/[^<{]+/]
  96. ],
  97. doctype: [
  98. [
  99. /\{\{/,
  100. {
  101. token: "@rematch",
  102. switchTo: "@handlebarsInSimpleState.comment"
  103. }
  104. ],
  105. [/[^>]+/, "metatag.content.html"],
  106. [/>/, "metatag.html", "@pop"]
  107. ],
  108. comment: [
  109. [/\}\}/, "comment.end.handlebars", "@pop"],
  110. [/./, "comment.content.handlebars"]
  111. ],
  112. commentBlock: [
  113. [/--\}\}/, "comment.block.end.handlebars", "@pop"],
  114. [/./, "comment.content.handlebars"]
  115. ],
  116. commentHtml: [
  117. [
  118. /\{\{/,
  119. {
  120. token: "@rematch",
  121. switchTo: "@handlebarsInSimpleState.comment"
  122. }
  123. ],
  124. [/-->/, "comment.html", "@pop"],
  125. [/[^-]+/, "comment.content.html"],
  126. [/./, "comment.content.html"]
  127. ],
  128. otherTag: [
  129. [
  130. /\{\{/,
  131. {
  132. token: "@rematch",
  133. switchTo: "@handlebarsInSimpleState.otherTag"
  134. }
  135. ],
  136. [/\/?>/, "delimiter.html", "@pop"],
  137. [/"([^"]*)"/, "attribute.value"],
  138. [/'([^']*)'/, "attribute.value"],
  139. [/[\w\-]+/, "attribute.name"],
  140. [/=/, "delimiter"],
  141. [/[ \t\r\n]+/]
  142. ],
  143. script: [
  144. [
  145. /\{\{/,
  146. {
  147. token: "@rematch",
  148. switchTo: "@handlebarsInSimpleState.script"
  149. }
  150. ],
  151. [/type/, "attribute.name", "@scriptAfterType"],
  152. [/"([^"]*)"/, "attribute.value"],
  153. [/'([^']*)'/, "attribute.value"],
  154. [/[\w\-]+/, "attribute.name"],
  155. [/=/, "delimiter"],
  156. [
  157. />/,
  158. {
  159. token: "delimiter.html",
  160. next: "@scriptEmbedded.text/javascript",
  161. nextEmbedded: "text/javascript"
  162. }
  163. ],
  164. [/[ \t\r\n]+/],
  165. [
  166. /(<\/)(script\s*)(>)/,
  167. ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
  168. ]
  169. ],
  170. scriptAfterType: [
  171. [
  172. /\{\{/,
  173. {
  174. token: "@rematch",
  175. switchTo: "@handlebarsInSimpleState.scriptAfterType"
  176. }
  177. ],
  178. [/=/, "delimiter", "@scriptAfterTypeEquals"],
  179. [
  180. />/,
  181. {
  182. token: "delimiter.html",
  183. next: "@scriptEmbedded.text/javascript",
  184. nextEmbedded: "text/javascript"
  185. }
  186. ],
  187. [/[ \t\r\n]+/],
  188. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  189. ],
  190. scriptAfterTypeEquals: [
  191. [
  192. /\{\{/,
  193. {
  194. token: "@rematch",
  195. switchTo: "@handlebarsInSimpleState.scriptAfterTypeEquals"
  196. }
  197. ],
  198. [
  199. /"([^"]*)"/,
  200. {
  201. token: "attribute.value",
  202. switchTo: "@scriptWithCustomType.$1"
  203. }
  204. ],
  205. [
  206. /'([^']*)'/,
  207. {
  208. token: "attribute.value",
  209. switchTo: "@scriptWithCustomType.$1"
  210. }
  211. ],
  212. [
  213. />/,
  214. {
  215. token: "delimiter.html",
  216. next: "@scriptEmbedded.text/javascript",
  217. nextEmbedded: "text/javascript"
  218. }
  219. ],
  220. [/[ \t\r\n]+/],
  221. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  222. ],
  223. scriptWithCustomType: [
  224. [
  225. /\{\{/,
  226. {
  227. token: "@rematch",
  228. switchTo: "@handlebarsInSimpleState.scriptWithCustomType.$S2"
  229. }
  230. ],
  231. [
  232. />/,
  233. {
  234. token: "delimiter.html",
  235. next: "@scriptEmbedded.$S2",
  236. nextEmbedded: "$S2"
  237. }
  238. ],
  239. [/"([^"]*)"/, "attribute.value"],
  240. [/'([^']*)'/, "attribute.value"],
  241. [/[\w\-]+/, "attribute.name"],
  242. [/=/, "delimiter"],
  243. [/[ \t\r\n]+/],
  244. [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
  245. ],
  246. scriptEmbedded: [
  247. [
  248. /\{\{/,
  249. {
  250. token: "@rematch",
  251. switchTo: "@handlebarsInEmbeddedState.scriptEmbedded.$S2",
  252. nextEmbedded: "@pop"
  253. }
  254. ],
  255. [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
  256. ],
  257. style: [
  258. [
  259. /\{\{/,
  260. {
  261. token: "@rematch",
  262. switchTo: "@handlebarsInSimpleState.style"
  263. }
  264. ],
  265. [/type/, "attribute.name", "@styleAfterType"],
  266. [/"([^"]*)"/, "attribute.value"],
  267. [/'([^']*)'/, "attribute.value"],
  268. [/[\w\-]+/, "attribute.name"],
  269. [/=/, "delimiter"],
  270. [
  271. />/,
  272. {
  273. token: "delimiter.html",
  274. next: "@styleEmbedded.text/css",
  275. nextEmbedded: "text/css"
  276. }
  277. ],
  278. [/[ \t\r\n]+/],
  279. [
  280. /(<\/)(style\s*)(>)/,
  281. ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
  282. ]
  283. ],
  284. styleAfterType: [
  285. [
  286. /\{\{/,
  287. {
  288. token: "@rematch",
  289. switchTo: "@handlebarsInSimpleState.styleAfterType"
  290. }
  291. ],
  292. [/=/, "delimiter", "@styleAfterTypeEquals"],
  293. [
  294. />/,
  295. {
  296. token: "delimiter.html",
  297. next: "@styleEmbedded.text/css",
  298. nextEmbedded: "text/css"
  299. }
  300. ],
  301. [/[ \t\r\n]+/],
  302. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  303. ],
  304. styleAfterTypeEquals: [
  305. [
  306. /\{\{/,
  307. {
  308. token: "@rematch",
  309. switchTo: "@handlebarsInSimpleState.styleAfterTypeEquals"
  310. }
  311. ],
  312. [
  313. /"([^"]*)"/,
  314. {
  315. token: "attribute.value",
  316. switchTo: "@styleWithCustomType.$1"
  317. }
  318. ],
  319. [
  320. /'([^']*)'/,
  321. {
  322. token: "attribute.value",
  323. switchTo: "@styleWithCustomType.$1"
  324. }
  325. ],
  326. [
  327. />/,
  328. {
  329. token: "delimiter.html",
  330. next: "@styleEmbedded.text/css",
  331. nextEmbedded: "text/css"
  332. }
  333. ],
  334. [/[ \t\r\n]+/],
  335. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  336. ],
  337. styleWithCustomType: [
  338. [
  339. /\{\{/,
  340. {
  341. token: "@rematch",
  342. switchTo: "@handlebarsInSimpleState.styleWithCustomType.$S2"
  343. }
  344. ],
  345. [
  346. />/,
  347. {
  348. token: "delimiter.html",
  349. next: "@styleEmbedded.$S2",
  350. nextEmbedded: "$S2"
  351. }
  352. ],
  353. [/"([^"]*)"/, "attribute.value"],
  354. [/'([^']*)'/, "attribute.value"],
  355. [/[\w\-]+/, "attribute.name"],
  356. [/=/, "delimiter"],
  357. [/[ \t\r\n]+/],
  358. [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
  359. ],
  360. styleEmbedded: [
  361. [
  362. /\{\{/,
  363. {
  364. token: "@rematch",
  365. switchTo: "@handlebarsInEmbeddedState.styleEmbedded.$S2",
  366. nextEmbedded: "@pop"
  367. }
  368. ],
  369. [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
  370. ],
  371. handlebarsInSimpleState: [
  372. [/\{\{\{?/, "delimiter.handlebars"],
  373. [/\}\}\}?/, { token: "delimiter.handlebars", switchTo: "@$S2.$S3" }],
  374. { include: "handlebarsRoot" }
  375. ],
  376. handlebarsInEmbeddedState: [
  377. [/\{\{\{?/, "delimiter.handlebars"],
  378. [
  379. /\}\}\}?/,
  380. {
  381. token: "delimiter.handlebars",
  382. switchTo: "@$S2.$S3",
  383. nextEmbedded: "$S3"
  384. }
  385. ],
  386. { include: "handlebarsRoot" }
  387. ],
  388. handlebarsRoot: [
  389. [/"[^"]*"/, "string.handlebars"],
  390. [/[#/][^\s}]+/, "keyword.helper.handlebars"],
  391. [/else\b/, "keyword.helper.handlebars"],
  392. [/[\s]+/],
  393. [/[^}]/, "variable.parameter.handlebars"]
  394. ]
  395. }
  396. };
  397. export {
  398. conf,
  399. language
  400. };
  401. /*! Bundled license information:
  402. monaco-editor/esm/vs/basic-languages/handlebars/handlebars.js:
  403. (*!-----------------------------------------------------------------------------
  404. * Copyright (c) Microsoft Corporation. All rights reserved.
  405. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  406. * Released under the MIT license
  407. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  408. *-----------------------------------------------------------------------------*)
  409. */
  410. //# sourceMappingURL=handlebars-GJAW5MA6.js.map