@pitchfork-ui/react 0.1.9 → 0.6.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.
Files changed (154) hide show
  1. package/README.md +20 -5
  2. package/dist/components/Accordion/Accordion.css +85 -0
  3. package/dist/components/Accordion/Accordion2.js +96 -0
  4. package/dist/components/Alert/Alert.css +111 -0
  5. package/dist/{index8.js → components/Alert/Alert2.js} +7 -5
  6. package/dist/components/Avatar/Avatar.css +97 -0
  7. package/dist/{index10.js → components/Avatar/Avatar2.js} +2 -2
  8. package/dist/components/Badge/Badge.css +26 -0
  9. package/dist/{index23.js → components/Badge/Badge2.js} +2 -2
  10. package/dist/components/BadgeGroup/BadgeGroup.css +115 -0
  11. package/dist/{index14.js → components/BadgeGroup/BadgeGroup2.js} +2 -2
  12. package/dist/components/Breadcrumbs/Breadcrumbs.css +45 -0
  13. package/dist/{index18.js → components/Breadcrumbs/Breadcrumbs2.js} +2 -2
  14. package/dist/components/Button/Button.css +93 -0
  15. package/dist/{index12.js → components/Button/Button2.js} +2 -2
  16. package/dist/components/ButtonGroup/ButtonGroup.css +107 -0
  17. package/dist/{index16.js → components/ButtonGroup/ButtonGroup2.js} +2 -2
  18. package/dist/components/Calendar/Calendar.css +144 -0
  19. package/dist/{index40.js → components/Calendar/Calendar2.js} +4 -4
  20. package/dist/components/Card/Card.css +23 -0
  21. package/dist/{index25.js → components/Card/Card2.js} +2 -2
  22. package/dist/components/Carousel/Carousel.css +124 -0
  23. package/dist/components/Carousel/Carousel2.js +147 -0
  24. package/dist/components/Checkbox/Checkbox.css +62 -0
  25. package/dist/{index29.js → components/Checkbox/Checkbox2.js} +2 -2
  26. package/dist/components/CodeSnippet/CodeSnippet.css +155 -0
  27. package/dist/{index46.js → components/CodeSnippet/CodeSnippet2.js} +6 -6
  28. package/dist/components/ContentDivider/ContentDivider.css +38 -0
  29. package/dist/{index48.js → components/ContentDivider/ContentDivider2.js} +2 -2
  30. package/dist/components/CreditCard/CreditCard.css +139 -0
  31. package/dist/{index27.js → components/CreditCard/CreditCard2.js} +2 -2
  32. package/dist/components/DatePicker/DatePicker.css +91 -0
  33. package/dist/{index50.js → components/DatePicker/DatePicker2.js} +9 -9
  34. package/dist/components/Dropdown/Dropdown.css +149 -0
  35. package/dist/{index38.js → components/Dropdown/Dropdown2.js} +8 -9
  36. package/dist/components/EmptyState/EmptyState.css +72 -0
  37. package/dist/{index52.js → components/EmptyState/EmptyState2.js} +3 -3
  38. package/dist/components/FileUploader/FileUploader.css +135 -0
  39. package/dist/{index54.js → components/FileUploader/FileUploader2.js} +4 -4
  40. package/dist/components/GaugeChart/GaugeChart.css +63 -0
  41. package/dist/components/GaugeChart/GaugeChart2.js +74 -0
  42. package/dist/components/HeaderNavigation/HeaderNavigation.css +87 -0
  43. package/dist/{index56.js → components/HeaderNavigation/HeaderNavigation2.js} +2 -2
  44. package/dist/components/Heatmap/Heatmap.css +100 -0
  45. package/dist/components/Heatmap/Heatmap2.js +160 -0
  46. package/dist/components/Icon/Icon.css +6 -0
  47. package/dist/{index6.js → components/Icon/Icon2.js} +2 -2
  48. package/dist/components/InlineCTA/InlineCTA.css +144 -0
  49. package/dist/{index58.js → components/InlineCTA/InlineCTA2.js} +17 -5
  50. package/dist/components/Input/Input.css +75 -0
  51. package/dist/{index21.js → components/Input/Input2.js} +3 -3
  52. package/dist/components/LineBarCharts/LineBarChart.css +122 -0
  53. package/dist/{index60.js → components/LineBarCharts/LineBarChart2.js} +11 -3
  54. package/dist/components/LoadingIndicators/LoadingIndicators.css +107 -0
  55. package/dist/{index62.js → components/LoadingIndicators/LoadingIndicators2.js} +2 -2
  56. package/dist/components/Metrics/Metrics.css +106 -0
  57. package/dist/{index64.js → components/Metrics/Metrics2.js} +3 -3
  58. package/dist/components/Modal/Modal.css +198 -0
  59. package/dist/{index66.js → components/Modal/Modal2.js} +11 -9
  60. package/dist/components/MultiSelect/MultiSelect.css +174 -0
  61. package/dist/{index68.js → components/MultiSelect/MultiSelect2.js} +11 -12
  62. package/dist/components/Notification/Notification.css +242 -0
  63. package/dist/{index70.js → components/Notification/Notification2.js} +7 -5
  64. package/dist/components/PageHeader/PageHeader.css +85 -0
  65. package/dist/{index72.js → components/PageHeader/PageHeader2.js} +3 -3
  66. package/dist/components/Pagination/Pagination.css +101 -0
  67. package/dist/{index74.js → components/Pagination/Pagination2.js} +2 -2
  68. package/dist/components/PieChart/PieChart.css +115 -0
  69. package/dist/{index76.js → components/PieChart/PieChart2.js} +3 -3
  70. package/dist/components/ProgressIndicators/ProgressIndicators.css +95 -0
  71. package/dist/{index78.js → components/ProgressIndicators/ProgressIndicators2.js} +6 -3
  72. package/dist/components/ProgressSteps/ProgressSteps.css +175 -0
  73. package/dist/{index80.js → components/ProgressSteps/ProgressSteps2.js} +2 -2
  74. package/dist/components/RadarChart/RadarChart.css +119 -0
  75. package/dist/{index82.js → components/RadarChart/RadarChart2.js} +21 -15
  76. package/dist/components/RadioButton/RadioButton.css +21 -0
  77. package/dist/{index84.js → components/RadioButton/RadioButton2.js} +2 -2
  78. package/dist/components/RadioGroup/RadioGroup.css +64 -0
  79. package/dist/{index86.js → components/RadioGroup/RadioGroup2.js} +2 -2
  80. package/dist/components/Rating/Rating.css +91 -0
  81. package/dist/{index88.js → components/Rating/Rating2.js} +3 -3
  82. package/dist/components/RichTextEditor/RichTextEditor.css +94 -0
  83. package/dist/{index90.js → components/RichTextEditor/RichTextEditor2.js} +4 -4
  84. package/dist/components/SectionFooter/SectionFooter.css +59 -0
  85. package/dist/{index92.js → components/SectionFooter/SectionFooter2.js} +2 -2
  86. package/dist/components/SectionHeader/SectionHeader.css +78 -0
  87. package/dist/{index94.js → components/SectionHeader/SectionHeader2.js} +2 -2
  88. package/dist/components/Select/Select.css +156 -0
  89. package/dist/{index102.js → components/Select/Select2.js} +11 -12
  90. package/dist/components/SidebarNavigation/SidebarNavigation.css +116 -0
  91. package/dist/{index96.js → components/SidebarNavigation/SidebarNavigation2.js} +2 -2
  92. package/dist/components/SlideoutMenu/SlideoutMenu.css +161 -0
  93. package/dist/{index98.js → components/SlideoutMenu/SlideoutMenu2.js} +3 -3
  94. package/dist/components/Slider/Slider.css +106 -0
  95. package/dist/{index104.js → components/Slider/Slider2.js} +2 -2
  96. package/dist/components/Sparkline/Sparkline.css +65 -0
  97. package/dist/components/Sparkline/Sparkline2.js +100 -0
  98. package/dist/components/Switch/Switch.css +59 -0
  99. package/dist/{index100.js → components/Switch/Switch2.js} +2 -2
  100. package/dist/components/Table/Table.css +126 -0
  101. package/dist/{index108.js → components/Table/Table2.js} +2 -2
  102. package/dist/components/Tabs/Tabs.css +138 -0
  103. package/dist/{index110.js → components/Tabs/Tabs2.js} +53 -6
  104. package/dist/components/Tag/Tag.css +64 -0
  105. package/dist/{index106.js → components/Tag/Tag2.js} +3 -3
  106. package/dist/components/Textarea/Textarea.css +52 -0
  107. package/dist/{index112.js → components/Textarea/Textarea2.js} +3 -3
  108. package/dist/components/Tooltip/Tooltip.css +61 -0
  109. package/dist/{index114.js → components/Tooltip/Tooltip2.js} +6 -6
  110. package/dist/components/TreeView/TreeView.css +109 -0
  111. package/dist/{index116.js → components/TreeView/TreeView2.js} +2 -2
  112. package/dist/components/UtilityButton/UtilityButton.css +90 -0
  113. package/dist/{index118.js → components/UtilityButton/UtilityButton2.js} +2 -2
  114. package/dist/components/VideoPlayer/VideoPlayer.css +41 -0
  115. package/dist/{index120.js → components/VideoPlayer/VideoPlayer2.js} +2 -2
  116. package/dist/{index33.js → hooks/useDisclosure.js} +1 -1
  117. package/dist/hooks/useExitAnimation.js +25 -0
  118. package/dist/{index34.js → hooks/useFocusTrap.js} +1 -1
  119. package/dist/hooks/usePresence.js +31 -0
  120. package/dist/index.cjs +1030 -4720
  121. package/dist/index.js +69 -63
  122. package/dist/src/components/Accordion/Accordion.d.ts +20 -0
  123. package/dist/src/components/Accordion/Accordion.test.d.ts +1 -0
  124. package/dist/src/components/Accordion/index.d.ts +1 -0
  125. package/dist/src/components/GaugeChart/GaugeChart.d.ts +17 -0
  126. package/dist/src/components/GaugeChart/GaugeChart.test.d.ts +1 -0
  127. package/dist/src/components/GaugeChart/index.d.ts +1 -0
  128. package/dist/src/components/Heatmap/Heatmap.d.ts +28 -0
  129. package/dist/src/components/Heatmap/Heatmap.test.d.ts +1 -0
  130. package/dist/src/components/Heatmap/index.d.ts +1 -0
  131. package/dist/src/components/InlineCTA/InlineCTA.d.ts +2 -0
  132. package/dist/src/components/LineBarCharts/LineBarChart.d.ts +2 -0
  133. package/dist/src/components/Sparkline/Sparkline.d.ts +17 -0
  134. package/dist/src/components/Sparkline/Sparkline.test.d.ts +1 -0
  135. package/dist/src/components/Sparkline/index.d.ts +1 -0
  136. package/dist/src/hooks/index.d.ts +2 -0
  137. package/dist/src/hooks/useExitAnimation.d.ts +18 -0
  138. package/dist/src/hooks/usePresence.d.ts +13 -0
  139. package/dist/src/index.d.ts +4 -0
  140. package/dist/styles/theme.css +813 -0
  141. package/dist/styles.css +881 -68
  142. package/dist/{index19.js → utils/FieldWrapper.js} +1 -1
  143. package/package.json +8 -4
  144. package/theme.starter.css +58 -0
  145. package/dist/index42.js +0 -134
  146. package/dist/index43.js +0 -16
  147. package/dist/index44.js +0 -4232
  148. /package/dist/{index3.js → a11y/index.js} +0 -0
  149. /package/dist/{index30.js → hooks/useAnchoredPosition.js} +0 -0
  150. /package/dist/{index31.js → hooks/useComposedRefs.js} +0 -0
  151. /package/dist/{index32.js → hooks/useControllableState.js} +0 -0
  152. /package/dist/{index35.js → hooks/useListNavigation.js} +0 -0
  153. /package/dist/{index36.js → hooks/useOutsideInteraction.js} +0 -0
  154. /package/dist/{index4.js → utils/cx.js} +0 -0
package/dist/index44.js DELETED
@@ -1,4232 +0,0 @@
1
- import clsx from "./index43.js";
2
- import { createElement, useCallback, useMemo } from "react";
3
- //#region ../../node_modules/prism-react-renderer/dist/index.mjs
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __defProps = Object.defineProperties;
7
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
9
- var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
11
- var __getProtoOf = Object.getPrototypeOf;
12
- var __hasOwnProp = Object.prototype.hasOwnProperty;
13
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
14
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
15
- enumerable: true,
16
- configurable: true,
17
- writable: true,
18
- value
19
- }) : obj[key] = value;
20
- var __spreadValues = (a, b) => {
21
- for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
22
- if (__getOwnPropSymbols) {
23
- for (var prop of __getOwnPropSymbols(b)) if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
24
- }
25
- return a;
26
- };
27
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
- var __objRest = (source, exclude) => {
29
- var target = {};
30
- for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
31
- if (source != null && __getOwnPropSymbols) {
32
- for (var prop of __getOwnPropSymbols(source)) if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop];
33
- }
34
- return target;
35
- };
36
- var __commonJS = (cb, mod) => function __require() {
37
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
38
- };
39
- var __export = (target, all) => {
40
- for (var name in all) __defProp(target, name, {
41
- get: all[name],
42
- enumerable: true
43
- });
44
- };
45
- var __copyProps = (to, from, except, desc) => {
46
- if (from && typeof from === "object" || typeof from === "function") {
47
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
48
- get: () => from[key],
49
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
50
- });
51
- }
52
- return to;
53
- };
54
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
55
- value: mod,
56
- enumerable: true
57
- }) : target, mod));
58
- var Prism = __toESM(__commonJS({ "../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(exports, module) {
59
- var Prism2 = function() {
60
- var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
61
- var uniqueId = 0;
62
- var plainTextGrammar = {};
63
- var _ = {
64
- /**
65
- * A namespace for utility methods.
66
- *
67
- * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
68
- * change or disappear at any time.
69
- *
70
- * @namespace
71
- * @memberof Prism
72
- */
73
- util: {
74
- encode: function encode(tokens) {
75
- if (tokens instanceof Token) return new Token(tokens.type, encode(tokens.content), tokens.alias);
76
- else if (Array.isArray(tokens)) return tokens.map(encode);
77
- else return tokens.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
78
- },
79
- /**
80
- * Returns the name of the type of the given value.
81
- *
82
- * @param {any} o
83
- * @returns {string}
84
- * @example
85
- * type(null) === 'Null'
86
- * type(undefined) === 'Undefined'
87
- * type(123) === 'Number'
88
- * type('foo') === 'String'
89
- * type(true) === 'Boolean'
90
- * type([1, 2]) === 'Array'
91
- * type({}) === 'Object'
92
- * type(String) === 'Function'
93
- * type(/abc+/) === 'RegExp'
94
- */
95
- type: function(o) {
96
- return Object.prototype.toString.call(o).slice(8, -1);
97
- },
98
- /**
99
- * Returns a unique number for the given object. Later calls will still return the same number.
100
- *
101
- * @param {Object} obj
102
- * @returns {number}
103
- */
104
- objId: function(obj) {
105
- if (!obj["__id"]) Object.defineProperty(obj, "__id", { value: ++uniqueId });
106
- return obj["__id"];
107
- },
108
- /**
109
- * Creates a deep clone of the given object.
110
- *
111
- * The main intended use of this function is to clone language definitions.
112
- *
113
- * @param {T} o
114
- * @param {Record<number, any>} [visited]
115
- * @returns {T}
116
- * @template T
117
- */
118
- clone: function deepClone(o, visited) {
119
- visited = visited || {};
120
- var clone;
121
- var id;
122
- switch (_.util.type(o)) {
123
- case "Object":
124
- id = _.util.objId(o);
125
- if (visited[id]) return visited[id];
126
- clone = {};
127
- visited[id] = clone;
128
- for (var key in o) if (o.hasOwnProperty(key)) clone[key] = deepClone(o[key], visited);
129
- return clone;
130
- case "Array":
131
- id = _.util.objId(o);
132
- if (visited[id]) return visited[id];
133
- clone = [];
134
- visited[id] = clone;
135
- /** @type {Array} */
136
- /** @type {any} */
137
- o.forEach(function(v, i) {
138
- clone[i] = deepClone(v, visited);
139
- });
140
- return clone;
141
- default: return o;
142
- }
143
- },
144
- /**
145
- * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
146
- *
147
- * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
148
- *
149
- * @param {Element} element
150
- * @returns {string}
151
- */
152
- getLanguage: function(element) {
153
- while (element) {
154
- var m = lang.exec(element.className);
155
- if (m) return m[1].toLowerCase();
156
- element = element.parentElement;
157
- }
158
- return "none";
159
- },
160
- /**
161
- * Sets the Prism `language-xxxx` class of the given element.
162
- *
163
- * @param {Element} element
164
- * @param {string} language
165
- * @returns {void}
166
- */
167
- setLanguage: function(element, language) {
168
- element.className = element.className.replace(RegExp(lang, "gi"), "");
169
- element.classList.add("language-" + language);
170
- },
171
- /**
172
- * Returns whether a given class is active for `element`.
173
- *
174
- * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
175
- * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
176
- * given class is just the given class with a `no-` prefix.
177
- *
178
- * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
179
- * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
180
- * ancestors have the given class or the negated version of it, then the default activation will be returned.
181
- *
182
- * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
183
- * version of it, the class is considered active.
184
- *
185
- * @param {Element} element
186
- * @param {string} className
187
- * @param {boolean} [defaultActivation=false]
188
- * @returns {boolean}
189
- */
190
- isActive: function(element, className, defaultActivation) {
191
- var no = "no-" + className;
192
- while (element) {
193
- var classList = element.classList;
194
- if (classList.contains(className)) return true;
195
- if (classList.contains(no)) return false;
196
- element = element.parentElement;
197
- }
198
- return !!defaultActivation;
199
- }
200
- },
201
- /**
202
- * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
203
- *
204
- * @namespace
205
- * @memberof Prism
206
- * @public
207
- */
208
- languages: {
209
- /**
210
- * The grammar for plain, unformatted text.
211
- */
212
- plain: plainTextGrammar,
213
- plaintext: plainTextGrammar,
214
- text: plainTextGrammar,
215
- txt: plainTextGrammar,
216
- /**
217
- * Creates a deep copy of the language with the given id and appends the given tokens.
218
- *
219
- * If a token in `redef` also appears in the copied language, then the existing token in the copied language
220
- * will be overwritten at its original position.
221
- *
222
- * ## Best practices
223
- *
224
- * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
225
- * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
226
- * understand the language definition because, normally, the order of tokens matters in Prism grammars.
227
- *
228
- * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
229
- * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
230
- *
231
- * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
232
- * @param {Grammar} redef The new tokens to append.
233
- * @returns {Grammar} The new language created.
234
- * @public
235
- * @example
236
- * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
237
- * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
238
- * // at its original position
239
- * 'comment': { ... },
240
- * // CSS doesn't have a 'color' token, so this token will be appended
241
- * 'color': /\b(?:red|green|blue)\b/
242
- * });
243
- */
244
- extend: function(id, redef) {
245
- var lang2 = _.util.clone(_.languages[id]);
246
- for (var key in redef) lang2[key] = redef[key];
247
- return lang2;
248
- },
249
- /**
250
- * Inserts tokens _before_ another token in a language definition or any other grammar.
251
- *
252
- * ## Usage
253
- *
254
- * This helper method makes it easy to modify existing languages. For example, the CSS language definition
255
- * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
256
- * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
257
- * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
258
- * this:
259
- *
260
- * ```js
261
- * Prism.languages.markup.style = {
262
- * // token
263
- * };
264
- * ```
265
- *
266
- * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
267
- * before existing tokens. For the CSS example above, you would use it like this:
268
- *
269
- * ```js
270
- * Prism.languages.insertBefore('markup', 'cdata', {
271
- * 'style': {
272
- * // token
273
- * }
274
- * });
275
- * ```
276
- *
277
- * ## Special cases
278
- *
279
- * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
280
- * will be ignored.
281
- *
282
- * This behavior can be used to insert tokens after `before`:
283
- *
284
- * ```js
285
- * Prism.languages.insertBefore('markup', 'comment', {
286
- * 'comment': Prism.languages.markup.comment,
287
- * // tokens after 'comment'
288
- * });
289
- * ```
290
- *
291
- * ## Limitations
292
- *
293
- * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
294
- * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
295
- * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
296
- * deleting properties which is necessary to insert at arbitrary positions.
297
- *
298
- * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
299
- * Instead, it will create a new object and replace all references to the target object with the new one. This
300
- * can be done without temporarily deleting properties, so the iteration order is well-defined.
301
- *
302
- * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
303
- * you hold the target object in a variable, then the value of the variable will not change.
304
- *
305
- * ```js
306
- * var oldMarkup = Prism.languages.markup;
307
- * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
308
- *
309
- * assert(oldMarkup !== Prism.languages.markup);
310
- * assert(newMarkup === Prism.languages.markup);
311
- * ```
312
- *
313
- * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
314
- * object to be modified.
315
- * @param {string} before The key to insert before.
316
- * @param {Grammar} insert An object containing the key-value pairs to be inserted.
317
- * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
318
- * object to be modified.
319
- *
320
- * Defaults to `Prism.languages`.
321
- * @returns {Grammar} The new grammar object.
322
- * @public
323
- */
324
- insertBefore: function(inside, before, insert, root) {
325
- root = root || _.languages;
326
- var grammar = root[inside];
327
- var ret = {};
328
- for (var token in grammar) if (grammar.hasOwnProperty(token)) {
329
- if (token == before) {
330
- for (var newToken in insert) if (insert.hasOwnProperty(newToken)) ret[newToken] = insert[newToken];
331
- }
332
- if (!insert.hasOwnProperty(token)) ret[token] = grammar[token];
333
- }
334
- var old = root[inside];
335
- root[inside] = ret;
336
- _.languages.DFS(_.languages, function(key, value) {
337
- if (value === old && key != inside) this[key] = ret;
338
- });
339
- return ret;
340
- },
341
- DFS: function DFS(o, callback, type, visited) {
342
- visited = visited || {};
343
- var objId = _.util.objId;
344
- for (var i in o) if (o.hasOwnProperty(i)) {
345
- callback.call(o, i, o[i], type || i);
346
- var property = o[i];
347
- var propertyType = _.util.type(property);
348
- if (propertyType === "Object" && !visited[objId(property)]) {
349
- visited[objId(property)] = true;
350
- DFS(property, callback, null, visited);
351
- } else if (propertyType === "Array" && !visited[objId(property)]) {
352
- visited[objId(property)] = true;
353
- DFS(property, callback, i, visited);
354
- }
355
- }
356
- }
357
- },
358
- plugins: {},
359
- /**
360
- * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
361
- * and the language definitions to use, and returns a string with the HTML produced.
362
- *
363
- * The following hooks will be run:
364
- * 1. `before-tokenize`
365
- * 2. `after-tokenize`
366
- * 3. `wrap`: On each {@link Token}.
367
- *
368
- * @param {string} text A string with the code to be highlighted.
369
- * @param {Grammar} grammar An object containing the tokens to use.
370
- *
371
- * Usually a language definition like `Prism.languages.markup`.
372
- * @param {string} language The name of the language definition passed to `grammar`.
373
- * @returns {string} The highlighted HTML.
374
- * @memberof Prism
375
- * @public
376
- * @example
377
- * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
378
- */
379
- highlight: function(text, grammar, language) {
380
- var env = {
381
- code: text,
382
- grammar,
383
- language
384
- };
385
- _.hooks.run("before-tokenize", env);
386
- if (!env.grammar) throw new Error("The language \"" + env.language + "\" has no grammar.");
387
- env.tokens = _.tokenize(env.code, env.grammar);
388
- _.hooks.run("after-tokenize", env);
389
- return Token.stringify(_.util.encode(env.tokens), env.language);
390
- },
391
- /**
392
- * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
393
- * and the language definitions to use, and returns an array with the tokenized code.
394
- *
395
- * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
396
- *
397
- * This method could be useful in other contexts as well, as a very crude parser.
398
- *
399
- * @param {string} text A string with the code to be highlighted.
400
- * @param {Grammar} grammar An object containing the tokens to use.
401
- *
402
- * Usually a language definition like `Prism.languages.markup`.
403
- * @returns {TokenStream} An array of strings and tokens, a token stream.
404
- * @memberof Prism
405
- * @public
406
- * @example
407
- * let code = `var foo = 0;`;
408
- * let tokens = Prism.tokenize(code, Prism.languages.javascript);
409
- * tokens.forEach(token => {
410
- * if (token instanceof Prism.Token && token.type === 'number') {
411
- * console.log(`Found numeric literal: ${token.content}`);
412
- * }
413
- * });
414
- */
415
- tokenize: function(text, grammar) {
416
- var rest = grammar.rest;
417
- if (rest) {
418
- for (var token in rest) grammar[token] = rest[token];
419
- delete grammar.rest;
420
- }
421
- var tokenList = new LinkedList();
422
- addAfter(tokenList, tokenList.head, text);
423
- matchGrammar(text, tokenList, grammar, tokenList.head, 0);
424
- return toArray(tokenList);
425
- },
426
- /**
427
- * @namespace
428
- * @memberof Prism
429
- * @public
430
- */
431
- hooks: {
432
- all: {},
433
- /**
434
- * Adds the given callback to the list of callbacks for the given hook.
435
- *
436
- * The callback will be invoked when the hook it is registered for is run.
437
- * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
438
- *
439
- * One callback function can be registered to multiple hooks and the same hook multiple times.
440
- *
441
- * @param {string} name The name of the hook.
442
- * @param {HookCallback} callback The callback function which is given environment variables.
443
- * @public
444
- */
445
- add: function(name, callback) {
446
- var hooks2 = _.hooks.all;
447
- hooks2[name] = hooks2[name] || [];
448
- hooks2[name].push(callback);
449
- },
450
- /**
451
- * Runs a hook invoking all registered callbacks with the given environment variables.
452
- *
453
- * Callbacks will be invoked synchronously and in the order in which they were registered.
454
- *
455
- * @param {string} name The name of the hook.
456
- * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
457
- * @public
458
- */
459
- run: function(name, env) {
460
- var callbacks = _.hooks.all[name];
461
- if (!callbacks || !callbacks.length) return;
462
- for (var i = 0, callback; callback = callbacks[i++];) callback(env);
463
- }
464
- },
465
- Token
466
- };
467
- function Token(type, content, alias, matchedStr) {
468
- this.type = type;
469
- this.content = content;
470
- this.alias = alias;
471
- this.length = (matchedStr || "").length | 0;
472
- }
473
- Token.stringify = function stringify(o, language) {
474
- if (typeof o == "string") return o;
475
- if (Array.isArray(o)) {
476
- var s = "";
477
- o.forEach(function(e) {
478
- s += stringify(e, language);
479
- });
480
- return s;
481
- }
482
- var env = {
483
- type: o.type,
484
- content: stringify(o.content, language),
485
- tag: "span",
486
- classes: ["token", o.type],
487
- attributes: {},
488
- language
489
- };
490
- var aliases = o.alias;
491
- if (aliases) if (Array.isArray(aliases)) Array.prototype.push.apply(env.classes, aliases);
492
- else env.classes.push(aliases);
493
- _.hooks.run("wrap", env);
494
- var attributes = "";
495
- for (var name in env.attributes) attributes += " " + name + "=\"" + (env.attributes[name] || "").replace(/"/g, "&quot;") + "\"";
496
- return "<" + env.tag + " class=\"" + env.classes.join(" ") + "\"" + attributes + ">" + env.content + "</" + env.tag + ">";
497
- };
498
- function matchPattern(pattern, pos, text, lookbehind) {
499
- pattern.lastIndex = pos;
500
- var match = pattern.exec(text);
501
- if (match && lookbehind && match[1]) {
502
- var lookbehindLength = match[1].length;
503
- match.index += lookbehindLength;
504
- match[0] = match[0].slice(lookbehindLength);
505
- }
506
- return match;
507
- }
508
- function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
509
- for (var token in grammar) {
510
- if (!grammar.hasOwnProperty(token) || !grammar[token]) continue;
511
- var patterns = grammar[token];
512
- patterns = Array.isArray(patterns) ? patterns : [patterns];
513
- for (var j = 0; j < patterns.length; ++j) {
514
- if (rematch && rematch.cause == token + "," + j) return;
515
- var patternObj = patterns[j];
516
- var inside = patternObj.inside;
517
- var lookbehind = !!patternObj.lookbehind;
518
- var greedy = !!patternObj.greedy;
519
- var alias = patternObj.alias;
520
- if (greedy && !patternObj.pattern.global) {
521
- var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
522
- patternObj.pattern = RegExp(patternObj.pattern.source, flags + "g");
523
- }
524
- var pattern = patternObj.pattern || patternObj;
525
- for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) {
526
- if (rematch && pos >= rematch.reach) break;
527
- var str = currentNode.value;
528
- if (tokenList.length > text.length) return;
529
- if (str instanceof Token) continue;
530
- var removeCount = 1;
531
- var match;
532
- if (greedy) {
533
- match = matchPattern(pattern, pos, text, lookbehind);
534
- if (!match || match.index >= text.length) break;
535
- var from = match.index;
536
- var to = match.index + match[0].length;
537
- var p = pos;
538
- p += currentNode.value.length;
539
- while (from >= p) {
540
- currentNode = currentNode.next;
541
- p += currentNode.value.length;
542
- }
543
- p -= currentNode.value.length;
544
- pos = p;
545
- if (currentNode.value instanceof Token) continue;
546
- for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === "string"); k = k.next) {
547
- removeCount++;
548
- p += k.value.length;
549
- }
550
- removeCount--;
551
- str = text.slice(pos, p);
552
- match.index -= pos;
553
- } else {
554
- match = matchPattern(pattern, 0, str, lookbehind);
555
- if (!match) continue;
556
- }
557
- var from = match.index;
558
- var matchStr = match[0];
559
- var before = str.slice(0, from);
560
- var after = str.slice(from + matchStr.length);
561
- var reach = pos + str.length;
562
- if (rematch && reach > rematch.reach) rematch.reach = reach;
563
- var removeFrom = currentNode.prev;
564
- if (before) {
565
- removeFrom = addAfter(tokenList, removeFrom, before);
566
- pos += before.length;
567
- }
568
- removeRange(tokenList, removeFrom, removeCount);
569
- var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
570
- currentNode = addAfter(tokenList, removeFrom, wrapped);
571
- if (after) addAfter(tokenList, currentNode, after);
572
- if (removeCount > 1) {
573
- var nestedRematch = {
574
- cause: token + "," + j,
575
- reach
576
- };
577
- matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
578
- if (rematch && nestedRematch.reach > rematch.reach) rematch.reach = nestedRematch.reach;
579
- }
580
- }
581
- }
582
- }
583
- }
584
- function LinkedList() {
585
- var head = {
586
- value: null,
587
- prev: null,
588
- next: null
589
- };
590
- var tail = {
591
- value: null,
592
- prev: head,
593
- next: null
594
- };
595
- head.next = tail;
596
- this.head = head;
597
- this.tail = tail;
598
- this.length = 0;
599
- }
600
- function addAfter(list, node, value) {
601
- var next = node.next;
602
- var newNode = {
603
- value,
604
- prev: node,
605
- next
606
- };
607
- node.next = newNode;
608
- next.prev = newNode;
609
- list.length++;
610
- return newNode;
611
- }
612
- function removeRange(list, node, count) {
613
- var next = node.next;
614
- for (var i = 0; i < count && next !== list.tail; i++) next = next.next;
615
- node.next = next;
616
- next.prev = node;
617
- list.length -= i;
618
- }
619
- function toArray(list) {
620
- var array = [];
621
- var node = list.head.next;
622
- while (node !== list.tail) {
623
- array.push(node.value);
624
- node = node.next;
625
- }
626
- return array;
627
- }
628
- return _;
629
- }();
630
- module.exports = Prism2;
631
- Prism2.default = Prism2;
632
- } })());
633
- Prism.languages.markup = {
634
- comment: {
635
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
636
- greedy: true
637
- },
638
- prolog: {
639
- pattern: /<\?[\s\S]+?\?>/,
640
- greedy: true
641
- },
642
- doctype: {
643
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
644
- greedy: true,
645
- inside: {
646
- "internal-subset": {
647
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
648
- lookbehind: true,
649
- greedy: true,
650
- inside: null
651
- },
652
- string: {
653
- pattern: /"[^"]*"|'[^']*'/,
654
- greedy: true
655
- },
656
- punctuation: /^<!|>$|[[\]]/,
657
- "doctype-tag": /^DOCTYPE/i,
658
- name: /[^\s<>'"]+/
659
- }
660
- },
661
- cdata: {
662
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
663
- greedy: true
664
- },
665
- tag: {
666
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
667
- greedy: true,
668
- inside: {
669
- tag: {
670
- pattern: /^<\/?[^\s>\/]+/,
671
- inside: {
672
- punctuation: /^<\/?/,
673
- namespace: /^[^\s>\/:]+:/
674
- }
675
- },
676
- "special-attr": [],
677
- "attr-value": {
678
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
679
- inside: { punctuation: [{
680
- pattern: /^=/,
681
- alias: "attr-equals"
682
- }, {
683
- pattern: /^(\s*)["']|["']$/,
684
- lookbehind: true
685
- }] }
686
- },
687
- punctuation: /\/?>/,
688
- "attr-name": {
689
- pattern: /[^\s>\/]+/,
690
- inside: { namespace: /^[^\s>\/:]+:/ }
691
- }
692
- }
693
- },
694
- entity: [{
695
- pattern: /&[\da-z]{1,8};/i,
696
- alias: "named-entity"
697
- }, /&#x?[\da-f]{1,8};/i]
698
- }, Prism.languages.markup.tag.inside["attr-value"].inside.entity = Prism.languages.markup.entity, Prism.languages.markup.doctype.inside["internal-subset"].inside = Prism.languages.markup, Prism.hooks.add("wrap", function(e) {
699
- "entity" === e.type && (e.attributes.title = e.content.replace(/&amp;/, "&"));
700
- }), Object.defineProperty(Prism.languages.markup.tag, "addInlined", { value: function(e, n) {
701
- var t = {}, t = (t["language-" + n] = {
702
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
703
- lookbehind: true,
704
- inside: Prism.languages[n]
705
- }, t.cdata = /^<!\[CDATA\[|\]\]>$/i, { "included-cdata": {
706
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
707
- inside: t
708
- } }), n = (t["language-" + n] = {
709
- pattern: /[\s\S]+/,
710
- inside: Prism.languages[n]
711
- }, {});
712
- n[e] = {
713
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
714
- return e;
715
- }), "i"),
716
- lookbehind: true,
717
- greedy: true,
718
- inside: t
719
- }, Prism.languages.insertBefore("markup", "cdata", n);
720
- } }), Object.defineProperty(Prism.languages.markup.tag, "addAttribute", { value: function(e, n) {
721
- Prism.languages.markup.tag.inside["special-attr"].push({
722
- pattern: RegExp(/(^|["'\s])/.source + "(?:" + e + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"),
723
- lookbehind: true,
724
- inside: {
725
- "attr-name": /^[^\s=]+/,
726
- "attr-value": {
727
- pattern: /=[\s\S]+/,
728
- inside: {
729
- value: {
730
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
731
- lookbehind: true,
732
- alias: [n, "language-" + n],
733
- inside: Prism.languages[n]
734
- },
735
- punctuation: [{
736
- pattern: /^=/,
737
- alias: "attr-equals"
738
- }, /"|'/]
739
- }
740
- }
741
- }
742
- });
743
- } }), Prism.languages.html = Prism.languages.markup, Prism.languages.mathml = Prism.languages.markup, Prism.languages.svg = Prism.languages.markup, Prism.languages.xml = Prism.languages.extend("markup", {}), Prism.languages.ssml = Prism.languages.xml, Prism.languages.atom = Prism.languages.xml, Prism.languages.rss = Prism.languages.xml, function(e) {
744
- var n = {
745
- pattern: /\\[\\(){}[\]^$+*?|.]/,
746
- alias: "escape"
747
- }, t = /\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/, a = "(?:[^\\\\-]|" + t.source + ")", a = RegExp(a + "-" + a), r = {
748
- pattern: /(<|')[^<>']+(?=[>']$)/,
749
- lookbehind: true,
750
- alias: "variable"
751
- };
752
- e.languages.regex = {
753
- "char-class": {
754
- pattern: /((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,
755
- lookbehind: true,
756
- inside: {
757
- "char-class-negation": {
758
- pattern: /(^\[)\^/,
759
- lookbehind: true,
760
- alias: "operator"
761
- },
762
- "char-class-punctuation": {
763
- pattern: /^\[|\]$/,
764
- alias: "punctuation"
765
- },
766
- range: {
767
- pattern: a,
768
- inside: {
769
- escape: t,
770
- "range-punctuation": {
771
- pattern: /-/,
772
- alias: "operator"
773
- }
774
- }
775
- },
776
- "special-escape": n,
777
- "char-set": {
778
- pattern: /\\[wsd]|\\p\{[^{}]+\}/i,
779
- alias: "class-name"
780
- },
781
- escape: t
782
- }
783
- },
784
- "special-escape": n,
785
- "char-set": {
786
- pattern: /\.|\\[wsd]|\\p\{[^{}]+\}/i,
787
- alias: "class-name"
788
- },
789
- backreference: [{
790
- pattern: /\\(?![123][0-7]{2})[1-9]/,
791
- alias: "keyword"
792
- }, {
793
- pattern: /\\k<[^<>']+>/,
794
- alias: "keyword",
795
- inside: { "group-name": r }
796
- }],
797
- anchor: {
798
- pattern: /[$^]|\\[ABbGZz]/,
799
- alias: "function"
800
- },
801
- escape: t,
802
- group: [{
803
- pattern: /\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,
804
- alias: "punctuation",
805
- inside: { "group-name": r }
806
- }, {
807
- pattern: /\)/,
808
- alias: "punctuation"
809
- }],
810
- quantifier: {
811
- pattern: /(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,
812
- alias: "number"
813
- },
814
- alternation: {
815
- pattern: /\|/,
816
- alias: "keyword"
817
- }
818
- };
819
- }(Prism), Prism.languages.clike = {
820
- comment: [{
821
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
822
- lookbehind: true,
823
- greedy: true
824
- }, {
825
- pattern: /(^|[^\\:])\/\/.*/,
826
- lookbehind: true,
827
- greedy: true
828
- }],
829
- string: {
830
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
831
- greedy: true
832
- },
833
- "class-name": {
834
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
835
- lookbehind: true,
836
- inside: { punctuation: /[.\\]/ }
837
- },
838
- keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
839
- boolean: /\b(?:false|true)\b/,
840
- function: /\b\w+(?=\()/,
841
- number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
842
- operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
843
- punctuation: /[{}[\];(),.:]/
844
- }, Prism.languages.javascript = Prism.languages.extend("clike", {
845
- "class-name": [Prism.languages.clike["class-name"], {
846
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
847
- lookbehind: true
848
- }],
849
- keyword: [{
850
- pattern: /((?:^|\})\s*)catch\b/,
851
- lookbehind: true
852
- }, {
853
- pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
854
- lookbehind: true
855
- }],
856
- function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
857
- number: {
858
- pattern: RegExp(/(^|[^\w$])/.source + "(?:" + /NaN|Infinity/.source + "|" + /0[bB][01]+(?:_[01]+)*n?/.source + "|" + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + /\d+(?:_\d+)*n/.source + "|" + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source + ")" + /(?![\w$])/.source),
859
- lookbehind: true
860
- },
861
- operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
862
- }), Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, Prism.languages.insertBefore("javascript", "keyword", {
863
- regex: {
864
- pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),
865
- lookbehind: true,
866
- greedy: true,
867
- inside: {
868
- "regex-source": {
869
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
870
- lookbehind: true,
871
- alias: "language-regex",
872
- inside: Prism.languages.regex
873
- },
874
- "regex-delimiter": /^\/|\/$/,
875
- "regex-flags": /^[a-z]+$/
876
- }
877
- },
878
- "function-variable": {
879
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
880
- alias: "function"
881
- },
882
- parameter: [
883
- {
884
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
885
- lookbehind: true,
886
- inside: Prism.languages.javascript
887
- },
888
- {
889
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
890
- lookbehind: true,
891
- inside: Prism.languages.javascript
892
- },
893
- {
894
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
895
- lookbehind: true,
896
- inside: Prism.languages.javascript
897
- },
898
- {
899
- pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
900
- lookbehind: true,
901
- inside: Prism.languages.javascript
902
- }
903
- ],
904
- constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
905
- }), Prism.languages.insertBefore("javascript", "string", {
906
- hashbang: {
907
- pattern: /^#!.*/,
908
- greedy: true,
909
- alias: "comment"
910
- },
911
- "template-string": {
912
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
913
- greedy: true,
914
- inside: {
915
- "template-punctuation": {
916
- pattern: /^`|`$/,
917
- alias: "string"
918
- },
919
- interpolation: {
920
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
921
- lookbehind: true,
922
- inside: {
923
- "interpolation-punctuation": {
924
- pattern: /^\$\{|\}$/,
925
- alias: "punctuation"
926
- },
927
- rest: Prism.languages.javascript
928
- }
929
- },
930
- string: /[\s\S]+/
931
- }
932
- },
933
- "string-property": {
934
- pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
935
- lookbehind: true,
936
- greedy: true,
937
- alias: "property"
938
- }
939
- }), Prism.languages.insertBefore("javascript", "operator", { "literal-property": {
940
- pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
941
- lookbehind: true,
942
- alias: "property"
943
- } }), Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, "javascript")), Prism.languages.js = Prism.languages.javascript, Prism.languages.actionscript = Prism.languages.extend("javascript", {
944
- keyword: /\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,
945
- operator: /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
946
- }), Prism.languages.actionscript["class-name"].alias = "function", delete Prism.languages.actionscript.parameter, delete Prism.languages.actionscript["literal-property"], Prism.languages.markup && Prism.languages.insertBefore("actionscript", "string", { xml: {
947
- pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,
948
- lookbehind: true,
949
- inside: Prism.languages.markup
950
- } }), function(e) {
951
- var n = /#(?!\{).+/, t = {
952
- pattern: /#\{[^}]+\}/,
953
- alias: "variable"
954
- };
955
- e.languages.coffeescript = e.languages.extend("javascript", {
956
- comment: n,
957
- string: [{
958
- pattern: /'(?:\\[\s\S]|[^\\'])*'/,
959
- greedy: true
960
- }, {
961
- pattern: /"(?:\\[\s\S]|[^\\"])*"/,
962
- greedy: true,
963
- inside: { interpolation: t }
964
- }],
965
- keyword: /\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,
966
- "class-member": {
967
- pattern: /@(?!\d)\w+/,
968
- alias: "variable"
969
- }
970
- }), e.languages.insertBefore("coffeescript", "comment", {
971
- "multiline-comment": {
972
- pattern: /###[\s\S]+?###/,
973
- alias: "comment"
974
- },
975
- "block-regex": {
976
- pattern: /\/{3}[\s\S]*?\/{3}/,
977
- alias: "regex",
978
- inside: {
979
- comment: n,
980
- interpolation: t
981
- }
982
- }
983
- }), e.languages.insertBefore("coffeescript", "string", {
984
- "inline-javascript": {
985
- pattern: /`(?:\\[\s\S]|[^\\`])*`/,
986
- inside: {
987
- delimiter: {
988
- pattern: /^`|`$/,
989
- alias: "punctuation"
990
- },
991
- script: {
992
- pattern: /[\s\S]+/,
993
- alias: "language-javascript",
994
- inside: e.languages.javascript
995
- }
996
- }
997
- },
998
- "multiline-string": [{
999
- pattern: /'''[\s\S]*?'''/,
1000
- greedy: true,
1001
- alias: "string"
1002
- }, {
1003
- pattern: /"""[\s\S]*?"""/,
1004
- greedy: true,
1005
- alias: "string",
1006
- inside: { interpolation: t }
1007
- }]
1008
- }), e.languages.insertBefore("coffeescript", "keyword", { property: /(?!\d)\w+(?=\s*:(?!:))/ }), delete e.languages.coffeescript["template-string"], e.languages.coffee = e.languages.coffeescript;
1009
- }(Prism), function(l) {
1010
- var e = l.languages.javadoclike = {
1011
- parameter: {
1012
- pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,
1013
- lookbehind: true
1014
- },
1015
- keyword: {
1016
- pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,
1017
- lookbehind: true
1018
- },
1019
- punctuation: /[{}]/
1020
- };
1021
- Object.defineProperty(e, "addSupport", { value: function(e2, o) {
1022
- (e2 = "string" == typeof e2 ? [e2] : e2).forEach(function(e3) {
1023
- var n = function(e4) {
1024
- e4.inside || (e4.inside = {}), e4.inside.rest = o;
1025
- }, t = "doc-comment";
1026
- if (a = l.languages[e3]) {
1027
- var a, r = a[t];
1028
- if ((r = r ? r : (a = l.languages.insertBefore(e3, "comment", { "doc-comment": {
1029
- pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,
1030
- lookbehind: true,
1031
- alias: "comment"
1032
- } }))[t]) instanceof RegExp && (r = a[t] = { pattern: r }), Array.isArray(r)) for (var s = 0, i = r.length; s < i; s++) r[s] instanceof RegExp && (r[s] = { pattern: r[s] }), n(r[s]);
1033
- else n(r);
1034
- }
1035
- });
1036
- } }), e.addSupport([
1037
- "java",
1038
- "javascript",
1039
- "php"
1040
- ], e);
1041
- }(Prism), function(e) {
1042
- var n = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/, n = (e.languages.css = {
1043
- comment: /\/\*[\s\S]*?\*\//,
1044
- atrule: {
1045
- pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + n.source + ")*?" + /(?:;|(?=\s*\{))/.source),
1046
- inside: {
1047
- rule: /^@[\w-]+/,
1048
- "selector-function-argument": {
1049
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1050
- lookbehind: true,
1051
- alias: "selector"
1052
- },
1053
- keyword: {
1054
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1055
- lookbehind: true
1056
- }
1057
- }
1058
- },
1059
- url: {
1060
- pattern: RegExp("\\burl\\((?:" + n.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1061
- greedy: true,
1062
- inside: {
1063
- function: /^url/i,
1064
- punctuation: /^\(|\)$/,
1065
- string: {
1066
- pattern: RegExp("^" + n.source + "$"),
1067
- alias: "url"
1068
- }
1069
- }
1070
- },
1071
- selector: {
1072
- pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + n.source + ")*(?=\\s*\\{)"),
1073
- lookbehind: true
1074
- },
1075
- string: {
1076
- pattern: n,
1077
- greedy: true
1078
- },
1079
- property: {
1080
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1081
- lookbehind: true
1082
- },
1083
- important: /!important\b/i,
1084
- function: {
1085
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1086
- lookbehind: true
1087
- },
1088
- punctuation: /[(){};:,]/
1089
- }, e.languages.css.atrule.inside.rest = e.languages.css, e.languages.markup);
1090
- n && (n.tag.addInlined("style", "css"), n.tag.addAttribute("style", "css"));
1091
- }(Prism), function(e) {
1092
- var n = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, n = (e.languages.css.selector = {
1093
- pattern: e.languages.css.selector.pattern,
1094
- lookbehind: true,
1095
- inside: n = {
1096
- "pseudo-element": /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
1097
- "pseudo-class": /:[-\w]+/,
1098
- class: /\.[-\w]+/,
1099
- id: /#[-\w]+/,
1100
- attribute: {
1101
- pattern: RegExp(`\\[(?:[^[\\]"']|` + n.source + ")*\\]"),
1102
- greedy: true,
1103
- inside: {
1104
- punctuation: /^\[|\]$/,
1105
- "case-sensitivity": {
1106
- pattern: /(\s)[si]$/i,
1107
- lookbehind: true,
1108
- alias: "keyword"
1109
- },
1110
- namespace: {
1111
- pattern: /^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,
1112
- lookbehind: true,
1113
- inside: { punctuation: /\|$/ }
1114
- },
1115
- "attr-name": {
1116
- pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,
1117
- lookbehind: true
1118
- },
1119
- "attr-value": [n, {
1120
- pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,
1121
- lookbehind: true
1122
- }],
1123
- operator: /[|~*^$]?=/
1124
- }
1125
- },
1126
- "n-th": [{
1127
- pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,
1128
- lookbehind: true,
1129
- inside: {
1130
- number: /[\dn]+/,
1131
- operator: /[+-]/
1132
- }
1133
- }, {
1134
- pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i,
1135
- lookbehind: true
1136
- }],
1137
- combinator: />|\+|~|\|\|/,
1138
- punctuation: /[(),]/
1139
- }
1140
- }, e.languages.css.atrule.inside["selector-function-argument"].inside = n, e.languages.insertBefore("css", "property", { variable: {
1141
- pattern: /(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,
1142
- lookbehind: true
1143
- } }), {
1144
- pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/,
1145
- lookbehind: true
1146
- }), t = {
1147
- pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,
1148
- lookbehind: true
1149
- };
1150
- e.languages.insertBefore("css", "function", {
1151
- operator: {
1152
- pattern: /(\s)[+\-*\/](?=\s)/,
1153
- lookbehind: true
1154
- },
1155
- hexcode: {
1156
- pattern: /\B#[\da-f]{3,8}\b/i,
1157
- alias: "color"
1158
- },
1159
- color: [{
1160
- pattern: /(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,
1161
- lookbehind: true
1162
- }, {
1163
- pattern: /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,
1164
- inside: {
1165
- unit: n,
1166
- number: t,
1167
- function: /[\w-]+(?=\()/,
1168
- punctuation: /[(),]/
1169
- }
1170
- }],
1171
- entity: /\\[\da-f]{1,8}/i,
1172
- unit: n,
1173
- number: t
1174
- });
1175
- }(Prism), function(e) {
1176
- var n = /[*&][^\s[\]{},]+/, t = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, a = "(?:" + t.source + "(?:[ ]+" + n.source + ")?|" + n.source + "(?:[ ]+" + t.source + ")?)", r = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, function() {
1177
- return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
1178
- }), s = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
1179
- function i(e2, n2) {
1180
- n2 = (n2 || "").replace(/m/g, "") + "m";
1181
- var t2 = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
1182
- return a;
1183
- }).replace(/<<value>>/g, function() {
1184
- return e2;
1185
- });
1186
- return RegExp(t2, n2);
1187
- }
1188
- e.languages.yaml = {
1189
- scalar: {
1190
- pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g, function() {
1191
- return a;
1192
- })),
1193
- lookbehind: true,
1194
- alias: "string"
1195
- },
1196
- comment: /#.*/,
1197
- key: {
1198
- pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, function() {
1199
- return a;
1200
- }).replace(/<<key>>/g, function() {
1201
- return "(?:" + r + "|" + s + ")";
1202
- })),
1203
- lookbehind: true,
1204
- greedy: true,
1205
- alias: "atrule"
1206
- },
1207
- directive: {
1208
- pattern: /(^[ \t]*)%.+/m,
1209
- lookbehind: true,
1210
- alias: "important"
1211
- },
1212
- datetime: {
1213
- pattern: i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
1214
- lookbehind: true,
1215
- alias: "number"
1216
- },
1217
- boolean: {
1218
- pattern: i(/false|true/.source, "i"),
1219
- lookbehind: true,
1220
- alias: "important"
1221
- },
1222
- null: {
1223
- pattern: i(/null|~/.source, "i"),
1224
- lookbehind: true,
1225
- alias: "important"
1226
- },
1227
- string: {
1228
- pattern: i(s),
1229
- lookbehind: true,
1230
- greedy: true
1231
- },
1232
- number: {
1233
- pattern: i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
1234
- lookbehind: true
1235
- },
1236
- tag: t,
1237
- important: n,
1238
- punctuation: /---|[:[\]{}\-,|>?]|\.\.\./
1239
- }, e.languages.yml = e.languages.yaml;
1240
- }(Prism), function(o) {
1241
- var n = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
1242
- function e(e2) {
1243
- return e2 = e2.replace(/<inner>/g, function() {
1244
- return n;
1245
- }), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + e2 + ")");
1246
- }
1247
- var t = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, a = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() {
1248
- return t;
1249
- }), r = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source, l = (o.languages.markdown = o.languages.extend("markup", {}), o.languages.insertBefore("markdown", "prolog", {
1250
- "front-matter-block": {
1251
- pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
1252
- lookbehind: true,
1253
- greedy: true,
1254
- inside: {
1255
- punctuation: /^---|---$/,
1256
- "front-matter": {
1257
- pattern: /\S+(?:\s+\S+)*/,
1258
- alias: ["yaml", "language-yaml"],
1259
- inside: o.languages.yaml
1260
- }
1261
- }
1262
- },
1263
- blockquote: {
1264
- pattern: /^>(?:[\t ]*>)*/m,
1265
- alias: "punctuation"
1266
- },
1267
- table: {
1268
- pattern: RegExp("^" + a + r + "(?:" + a + ")*", "m"),
1269
- inside: {
1270
- "table-data-rows": {
1271
- pattern: RegExp("^(" + a + r + ")(?:" + a + ")*$"),
1272
- lookbehind: true,
1273
- inside: {
1274
- "table-data": {
1275
- pattern: RegExp(t),
1276
- inside: o.languages.markdown
1277
- },
1278
- punctuation: /\|/
1279
- }
1280
- },
1281
- "table-line": {
1282
- pattern: RegExp("^(" + a + ")" + r + "$"),
1283
- lookbehind: true,
1284
- inside: { punctuation: /\||:?-{3,}:?/ }
1285
- },
1286
- "table-header-row": {
1287
- pattern: RegExp("^" + a + "$"),
1288
- inside: {
1289
- "table-header": {
1290
- pattern: RegExp(t),
1291
- alias: "important",
1292
- inside: o.languages.markdown
1293
- },
1294
- punctuation: /\|/
1295
- }
1296
- }
1297
- }
1298
- },
1299
- code: [{
1300
- pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
1301
- lookbehind: true,
1302
- alias: "keyword"
1303
- }, {
1304
- pattern: /^```[\s\S]*?^```$/m,
1305
- greedy: true,
1306
- inside: {
1307
- "code-block": {
1308
- pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
1309
- lookbehind: true
1310
- },
1311
- "code-language": {
1312
- pattern: /^(```).+/,
1313
- lookbehind: true
1314
- },
1315
- punctuation: /```/
1316
- }
1317
- }],
1318
- title: [{
1319
- pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
1320
- alias: "important",
1321
- inside: { punctuation: /==+$|--+$/ }
1322
- }, {
1323
- pattern: /(^\s*)#.+/m,
1324
- lookbehind: true,
1325
- alias: "important",
1326
- inside: { punctuation: /^#+|#+$/ }
1327
- }],
1328
- hr: {
1329
- pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
1330
- lookbehind: true,
1331
- alias: "punctuation"
1332
- },
1333
- list: {
1334
- pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
1335
- lookbehind: true,
1336
- alias: "punctuation"
1337
- },
1338
- "url-reference": {
1339
- pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
1340
- inside: {
1341
- variable: {
1342
- pattern: /^(!?\[)[^\]]+/,
1343
- lookbehind: true
1344
- },
1345
- string: /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
1346
- punctuation: /^[\[\]!:]|[<>]/
1347
- },
1348
- alias: "url"
1349
- },
1350
- bold: {
1351
- pattern: e(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),
1352
- lookbehind: true,
1353
- greedy: true,
1354
- inside: {
1355
- content: {
1356
- pattern: /(^..)[\s\S]+(?=..$)/,
1357
- lookbehind: true,
1358
- inside: {}
1359
- },
1360
- punctuation: /\*\*|__/
1361
- }
1362
- },
1363
- italic: {
1364
- pattern: e(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),
1365
- lookbehind: true,
1366
- greedy: true,
1367
- inside: {
1368
- content: {
1369
- pattern: /(^.)[\s\S]+(?=.$)/,
1370
- lookbehind: true,
1371
- inside: {}
1372
- },
1373
- punctuation: /[*_]/
1374
- }
1375
- },
1376
- strike: {
1377
- pattern: e(/(~~?)(?:(?!~)<inner>)+\2/.source),
1378
- lookbehind: true,
1379
- greedy: true,
1380
- inside: {
1381
- content: {
1382
- pattern: /(^~~?)[\s\S]+(?=\1$)/,
1383
- lookbehind: true,
1384
- inside: {}
1385
- },
1386
- punctuation: /~~?/
1387
- }
1388
- },
1389
- "code-snippet": {
1390
- pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
1391
- lookbehind: true,
1392
- greedy: true,
1393
- alias: ["code", "keyword"]
1394
- },
1395
- url: {
1396
- pattern: e(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),
1397
- lookbehind: true,
1398
- greedy: true,
1399
- inside: {
1400
- operator: /^!/,
1401
- content: {
1402
- pattern: /(^\[)[^\]]+(?=\])/,
1403
- lookbehind: true,
1404
- inside: {}
1405
- },
1406
- variable: {
1407
- pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/,
1408
- lookbehind: true
1409
- },
1410
- url: {
1411
- pattern: /(^\]\()[^\s)]+/,
1412
- lookbehind: true
1413
- },
1414
- string: {
1415
- pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
1416
- lookbehind: true
1417
- }
1418
- }
1419
- }
1420
- }), [
1421
- "url",
1422
- "bold",
1423
- "italic",
1424
- "strike"
1425
- ].forEach(function(n2) {
1426
- [
1427
- "url",
1428
- "bold",
1429
- "italic",
1430
- "strike",
1431
- "code-snippet"
1432
- ].forEach(function(e2) {
1433
- n2 !== e2 && (o.languages.markdown[n2].inside.content.inside[e2] = o.languages.markdown[e2]);
1434
- });
1435
- }), o.hooks.add("after-tokenize", function(e2) {
1436
- "markdown" !== e2.language && "md" !== e2.language || function e3(n2) {
1437
- if (n2 && "string" != typeof n2) for (var t2 = 0, a2 = n2.length; t2 < a2; t2++) {
1438
- var r2, s = n2[t2];
1439
- "code" !== s.type ? e3(s.content) : (r2 = s.content[1], s = s.content[3], r2 && s && "code-language" === r2.type && "code-block" === s.type && "string" == typeof r2.content && (r2 = r2.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp"), r2 = "language-" + (r2 = (/[a-z][\w-]*/i.exec(r2) || [""])[0].toLowerCase()), s.alias ? "string" == typeof s.alias ? s.alias = [s.alias, r2] : s.alias.push(r2) : s.alias = [r2]));
1440
- }
1441
- }(e2.tokens);
1442
- }), o.hooks.add("wrap", function(e2) {
1443
- if ("code-block" === e2.type) {
1444
- for (var n2 = "", t2 = 0, a2 = e2.classes.length; t2 < a2; t2++) {
1445
- var r2 = e2.classes[t2], r2 = /language-(.+)/.exec(r2);
1446
- if (r2) {
1447
- n2 = r2[1];
1448
- break;
1449
- }
1450
- }
1451
- var s, i = o.languages[n2];
1452
- i ? e2.content = o.highlight(function(e3) {
1453
- e3 = e3.replace(l, "");
1454
- return e3 = e3.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(e4, n3) {
1455
- var t3;
1456
- return "#" === (n3 = n3.toLowerCase())[0] ? (t3 = "x" === n3[1] ? parseInt(n3.slice(2), 16) : Number(n3.slice(1)), c(t3)) : u[n3] || e4;
1457
- });
1458
- }(e2.content), i, n2) : n2 && "none" !== n2 && o.plugins.autoloader && (s = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(0x2386f26fc10000 * Math.random()), e2.attributes.id = s, o.plugins.autoloader.loadLanguages(n2, function() {
1459
- var e3 = document.getElementById(s);
1460
- e3 && (e3.innerHTML = o.highlight(e3.textContent, o.languages[n2], n2));
1461
- }));
1462
- }
1463
- }), RegExp(o.languages.markup.tag.pattern.source, "gi")), u = {
1464
- amp: "&",
1465
- lt: "<",
1466
- gt: ">",
1467
- quot: "\""
1468
- }, c = String.fromCodePoint || String.fromCharCode;
1469
- o.languages.md = o.languages.markdown;
1470
- }(Prism), Prism.languages.graphql = {
1471
- comment: /#.*/,
1472
- description: {
1473
- pattern: /(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,
1474
- greedy: true,
1475
- alias: "string",
1476
- inside: { "language-markdown": {
1477
- pattern: /(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,
1478
- lookbehind: true,
1479
- inside: Prism.languages.markdown
1480
- } }
1481
- },
1482
- string: {
1483
- pattern: /"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,
1484
- greedy: true
1485
- },
1486
- number: /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
1487
- boolean: /\b(?:false|true)\b/,
1488
- variable: /\$[a-z_]\w*/i,
1489
- directive: {
1490
- pattern: /@[a-z_]\w*/i,
1491
- alias: "function"
1492
- },
1493
- "attr-name": {
1494
- pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,
1495
- greedy: true
1496
- },
1497
- "atom-input": {
1498
- pattern: /\b[A-Z]\w*Input\b/,
1499
- alias: "class-name"
1500
- },
1501
- scalar: /\b(?:Boolean|Float|ID|Int|String)\b/,
1502
- constant: /\b[A-Z][A-Z_\d]*\b/,
1503
- "class-name": {
1504
- pattern: /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,
1505
- lookbehind: true
1506
- },
1507
- fragment: {
1508
- pattern: /(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,
1509
- lookbehind: true,
1510
- alias: "function"
1511
- },
1512
- "definition-mutation": {
1513
- pattern: /(\bmutation\s+)[a-zA-Z_]\w*/,
1514
- lookbehind: true,
1515
- alias: "function"
1516
- },
1517
- "definition-query": {
1518
- pattern: /(\bquery\s+)[a-zA-Z_]\w*/,
1519
- lookbehind: true,
1520
- alias: "function"
1521
- },
1522
- keyword: /\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,
1523
- operator: /[!=|&]|\.{3}/,
1524
- "property-query": /\w+(?=\s*\()/,
1525
- object: /\w+(?=\s*\{)/,
1526
- punctuation: /[!(){}\[\]:=,]/,
1527
- property: /\w+/
1528
- }, Prism.hooks.add("after-tokenize", function(e) {
1529
- if ("graphql" === e.language) for (var i = e.tokens.filter(function(e2) {
1530
- return "string" != typeof e2 && "comment" !== e2.type && "scalar" !== e2.type;
1531
- }), o = 0; o < i.length;) {
1532
- var n = i[o++];
1533
- if ("keyword" === n.type && "mutation" === n.content) {
1534
- var t = [];
1535
- if (p(["definition-mutation", "punctuation"]) && "(" === c(1).content) {
1536
- o += 2;
1537
- var a = d(/^\($/, /^\)$/);
1538
- if (-1 === a) continue;
1539
- for (; o < a; o++) {
1540
- var r = c(0);
1541
- "variable" === r.type && (g(r, "variable-input"), t.push(r.content));
1542
- }
1543
- o = a + 1;
1544
- }
1545
- if (p(["punctuation", "property-query"]) && "{" === c(0).content && (o++, g(c(0), "property-mutation"), 0 < t.length)) {
1546
- var s = d(/^\{$/, /^\}$/);
1547
- if (-1 !== s) for (var l = o; l < s; l++) {
1548
- var u = i[l];
1549
- "variable" === u.type && 0 <= t.indexOf(u.content) && g(u, "variable-input");
1550
- }
1551
- }
1552
- }
1553
- }
1554
- function c(e2) {
1555
- return i[o + e2];
1556
- }
1557
- function p(e2, n2) {
1558
- n2 = n2 || 0;
1559
- for (var t2 = 0; t2 < e2.length; t2++) {
1560
- var a2 = c(t2 + n2);
1561
- if (!a2 || a2.type !== e2[t2]) return;
1562
- }
1563
- return 1;
1564
- }
1565
- function d(e2, n2) {
1566
- for (var t2 = 1, a2 = o; a2 < i.length; a2++) {
1567
- var r2 = i[a2], s2 = r2.content;
1568
- if ("punctuation" === r2.type && "string" == typeof s2) {
1569
- if (e2.test(s2)) t2++;
1570
- else if (n2.test(s2) && 0 === --t2) return a2;
1571
- }
1572
- }
1573
- return -1;
1574
- }
1575
- function g(e2, n2) {
1576
- var t2 = e2.alias;
1577
- t2 ? Array.isArray(t2) || (e2.alias = t2 = [t2]) : e2.alias = t2 = [], t2.push(n2);
1578
- }
1579
- }), Prism.languages.sql = {
1580
- comment: {
1581
- pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
1582
- lookbehind: true
1583
- },
1584
- variable: [{
1585
- pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,
1586
- greedy: true
1587
- }, /@[\w.$]+/],
1588
- string: {
1589
- pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,
1590
- greedy: true,
1591
- lookbehind: true
1592
- },
1593
- identifier: {
1594
- pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,
1595
- greedy: true,
1596
- lookbehind: true,
1597
- inside: { punctuation: /^`|`$/ }
1598
- },
1599
- function: /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,
1600
- keyword: /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,
1601
- boolean: /\b(?:FALSE|NULL|TRUE)\b/i,
1602
- number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,
1603
- operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
1604
- punctuation: /[;[\]()`,.]/
1605
- }, function(b) {
1606
- var e = b.languages.javascript["template-string"], t = e.pattern.source, m = e.inside.interpolation, f = m.inside["interpolation-punctuation"], s = m.pattern.source;
1607
- function n(e2, n2) {
1608
- if (b.languages[e2]) return {
1609
- pattern: RegExp("((?:" + n2 + ")\\s*)" + t),
1610
- lookbehind: true,
1611
- greedy: true,
1612
- inside: {
1613
- "template-punctuation": {
1614
- pattern: /^`|`$/,
1615
- alias: "string"
1616
- },
1617
- "embedded-code": {
1618
- pattern: /[\s\S]+/,
1619
- alias: e2
1620
- }
1621
- }
1622
- };
1623
- }
1624
- function h(e2, n2, t2) {
1625
- e2 = {
1626
- code: e2,
1627
- grammar: n2,
1628
- language: t2
1629
- };
1630
- return b.hooks.run("before-tokenize", e2), e2.tokens = b.tokenize(e2.code, e2.grammar), b.hooks.run("after-tokenize", e2), e2.tokens;
1631
- }
1632
- function l(a2, e2, r) {
1633
- var n2 = b.tokenize(a2, { interpolation: {
1634
- pattern: RegExp(s),
1635
- lookbehind: true
1636
- } }), p = 0, d = {}, n2 = h(n2.map(function(e3) {
1637
- if ("string" == typeof e3) return e3;
1638
- for (var n3, t2, e3 = e3.content; -1 !== a2.indexOf((t2 = p++, n3 = "___" + r.toUpperCase() + "_" + t2 + "___")););
1639
- return d[n3] = e3, n3;
1640
- }).join(""), e2, r), g = Object.keys(d);
1641
- return p = 0, function e3(n3) {
1642
- for (var t2 = 0; t2 < n3.length; t2++) {
1643
- if (p >= g.length) return;
1644
- var a3, r2, s2, i, o, l2, u2, c = n3[t2];
1645
- "string" == typeof c || "string" == typeof c.content ? (a3 = g[p], -1 !== (u2 = (l2 = "string" == typeof c ? c : c.content).indexOf(a3)) && (++p, r2 = l2.substring(0, u2), o = d[a3], s2 = void 0, (i = {})["interpolation-punctuation"] = f, 3 === (i = b.tokenize(o, i)).length && ((s2 = [1, 1]).push.apply(s2, h(i[1], b.languages.javascript, "javascript")), i.splice.apply(i, s2)), s2 = new b.Token("interpolation", i, m.alias, o), i = l2.substring(u2 + a3.length), o = [], r2 && o.push(r2), o.push(s2), i && (e3(l2 = [i]), o.push.apply(o, l2)), "string" == typeof c ? (n3.splice.apply(n3, [t2, 1].concat(o)), t2 += o.length - 1) : c.content = o)) : (u2 = c.content, Array.isArray(u2) ? e3(u2) : e3([u2]));
1646
- }
1647
- }(n2), new b.Token(r, n2, "language-" + r, a2);
1648
- }
1649
- b.languages.javascript["template-string"] = [
1650
- n("css", /\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),
1651
- n("html", /\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),
1652
- n("svg", /\bsvg/.source),
1653
- n("markdown", /\b(?:markdown|md)/.source),
1654
- n("graphql", /\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),
1655
- n("sql", /\bsql/.source),
1656
- e
1657
- ].filter(Boolean);
1658
- var a = {
1659
- javascript: true,
1660
- js: true,
1661
- typescript: true,
1662
- ts: true,
1663
- jsx: true,
1664
- tsx: true
1665
- };
1666
- function u(e2) {
1667
- return "string" == typeof e2 ? e2 : Array.isArray(e2) ? e2.map(u).join("") : u(e2.content);
1668
- }
1669
- b.hooks.add("after-tokenize", function(e2) {
1670
- e2.language in a && function e3(n2) {
1671
- for (var t2 = 0, a2 = n2.length; t2 < a2; t2++) {
1672
- var r, s2, i, o = n2[t2];
1673
- "string" != typeof o && (r = o.content, Array.isArray(r) ? "template-string" === o.type ? (o = r[1], 3 === r.length && "string" != typeof o && "embedded-code" === o.type && (s2 = u(o), o = o.alias, o = Array.isArray(o) ? o[0] : o, i = b.languages[o]) && (r[1] = l(s2, i, o))) : e3(r) : "string" != typeof r && e3([r]));
1674
- }
1675
- }(e2.tokens);
1676
- });
1677
- }(Prism), function(e) {
1678
- e.languages.typescript = e.languages.extend("javascript", {
1679
- "class-name": {
1680
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
1681
- lookbehind: true,
1682
- greedy: true,
1683
- inside: null
1684
- },
1685
- builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/
1686
- }), e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/, /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/, /\btype\b(?=\s*(?:[\{*]|$))/), delete e.languages.typescript.parameter, delete e.languages.typescript["literal-property"];
1687
- var n = e.languages.extend("typescript", {});
1688
- delete n["class-name"], e.languages.typescript["class-name"].inside = n, e.languages.insertBefore("typescript", "function", {
1689
- decorator: {
1690
- pattern: /@[$\w\xA0-\uFFFF]+/,
1691
- inside: {
1692
- at: {
1693
- pattern: /^@/,
1694
- alias: "operator"
1695
- },
1696
- function: /^[\s\S]+/
1697
- }
1698
- },
1699
- "generic-function": {
1700
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
1701
- greedy: true,
1702
- inside: {
1703
- function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
1704
- generic: {
1705
- pattern: /<[\s\S]+/,
1706
- alias: "class-name",
1707
- inside: n
1708
- }
1709
- }
1710
- }
1711
- }), e.languages.ts = e.languages.typescript;
1712
- }(Prism), function(e) {
1713
- var n = e.languages.javascript, t = /\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source, a = "(@(?:arg|argument|param|property)\\s+(?:" + t + "\\s+)?)";
1714
- e.languages.jsdoc = e.languages.extend("javadoclike", { parameter: {
1715
- pattern: RegExp(a + /(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),
1716
- lookbehind: true,
1717
- inside: { punctuation: /\./ }
1718
- } }), e.languages.insertBefore("jsdoc", "keyword", {
1719
- "optional-parameter": {
1720
- pattern: RegExp(a + /\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),
1721
- lookbehind: true,
1722
- inside: {
1723
- parameter: {
1724
- pattern: /(^\[)[$\w\xA0-\uFFFF\.]+/,
1725
- lookbehind: true,
1726
- inside: { punctuation: /\./ }
1727
- },
1728
- code: {
1729
- pattern: /(=)[\s\S]*(?=\]$)/,
1730
- lookbehind: true,
1731
- inside: n,
1732
- alias: "language-javascript"
1733
- },
1734
- punctuation: /[=[\]]/
1735
- }
1736
- },
1737
- "class-name": [{
1738
- pattern: RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g, function() {
1739
- return t;
1740
- })),
1741
- lookbehind: true,
1742
- inside: { punctuation: /\./ }
1743
- }, {
1744
- pattern: RegExp("(@[a-z]+\\s+)" + t),
1745
- lookbehind: true,
1746
- inside: {
1747
- string: n.string,
1748
- number: n.number,
1749
- boolean: n.boolean,
1750
- keyword: e.languages.typescript.keyword,
1751
- operator: /=>|\.\.\.|[&|?:*]/,
1752
- punctuation: /[.,;=<>{}()[\]]/
1753
- }
1754
- }],
1755
- example: {
1756
- pattern: /(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,
1757
- lookbehind: true,
1758
- inside: { code: {
1759
- pattern: /^([\t ]*(?:\*\s*)?)\S.*$/m,
1760
- lookbehind: true,
1761
- inside: n,
1762
- alias: "language-javascript"
1763
- } }
1764
- }
1765
- }), e.languages.javadoclike.addSupport("javascript", e.languages.jsdoc);
1766
- }(Prism), function(e) {
1767
- e.languages.flow = e.languages.extend("javascript", {}), e.languages.insertBefore("flow", "keyword", { type: [{
1768
- pattern: /\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,
1769
- alias: "class-name"
1770
- }] }), e.languages.flow["function-variable"].pattern = /(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i, delete e.languages.flow.parameter, e.languages.insertBefore("flow", "operator", { "flow-punctuation": {
1771
- pattern: /\{\||\|\}/,
1772
- alias: "punctuation"
1773
- } }), Array.isArray(e.languages.flow.keyword) || (e.languages.flow.keyword = [e.languages.flow.keyword]), e.languages.flow.keyword.unshift({
1774
- pattern: /(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,
1775
- lookbehind: true
1776
- }, {
1777
- pattern: /(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,
1778
- lookbehind: true
1779
- });
1780
- }(Prism), Prism.languages.n4js = Prism.languages.extend("javascript", { keyword: /\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/ }), Prism.languages.insertBefore("n4js", "constant", { annotation: {
1781
- pattern: /@+\w+/,
1782
- alias: "operator"
1783
- } }), Prism.languages.n4jsd = Prism.languages.n4js, function(e) {
1784
- function n(e2, n2) {
1785
- return RegExp(e2.replace(/<ID>/g, function() {
1786
- return /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source;
1787
- }), n2);
1788
- }
1789
- e.languages.insertBefore("javascript", "function-variable", { "method-variable": {
1790
- pattern: RegExp("(\\.\\s*)" + e.languages.javascript["function-variable"].pattern.source),
1791
- lookbehind: true,
1792
- alias: [
1793
- "function-variable",
1794
- "method",
1795
- "function",
1796
- "property-access"
1797
- ]
1798
- } }), e.languages.insertBefore("javascript", "function", { method: {
1799
- pattern: RegExp("(\\.\\s*)" + e.languages.javascript.function.source),
1800
- lookbehind: true,
1801
- alias: ["function", "property-access"]
1802
- } }), e.languages.insertBefore("javascript", "constant", { "known-class-name": [{
1803
- pattern: /\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,
1804
- alias: "class-name"
1805
- }, {
1806
- pattern: /\b(?:[A-Z]\w*)Error\b/,
1807
- alias: "class-name"
1808
- }] }), e.languages.insertBefore("javascript", "keyword", {
1809
- imports: {
1810
- pattern: n(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),
1811
- lookbehind: true,
1812
- inside: e.languages.javascript
1813
- },
1814
- exports: {
1815
- pattern: n(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),
1816
- lookbehind: true,
1817
- inside: e.languages.javascript
1818
- }
1819
- }), e.languages.javascript.keyword.unshift({
1820
- pattern: /\b(?:as|default|export|from|import)\b/,
1821
- alias: "module"
1822
- }, {
1823
- pattern: /\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,
1824
- alias: "control-flow"
1825
- }, {
1826
- pattern: /\bnull\b/,
1827
- alias: ["null", "nil"]
1828
- }, {
1829
- pattern: /\bundefined\b/,
1830
- alias: "nil"
1831
- }), e.languages.insertBefore("javascript", "operator", {
1832
- spread: {
1833
- pattern: /\.{3}/,
1834
- alias: "operator"
1835
- },
1836
- arrow: {
1837
- pattern: /=>/,
1838
- alias: "operator"
1839
- }
1840
- }), e.languages.insertBefore("javascript", "punctuation", {
1841
- "property-access": {
1842
- pattern: n(/(\.\s*)#?<ID>/.source),
1843
- lookbehind: true
1844
- },
1845
- "maybe-class-name": {
1846
- pattern: /(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,
1847
- lookbehind: true
1848
- },
1849
- dom: {
1850
- pattern: /\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,
1851
- alias: "variable"
1852
- },
1853
- console: {
1854
- pattern: /\bconsole(?=\s*\.)/,
1855
- alias: "class-name"
1856
- }
1857
- });
1858
- for (var t = [
1859
- "function",
1860
- "function-variable",
1861
- "method",
1862
- "method-variable",
1863
- "property-access"
1864
- ], a = 0; a < t.length; a++) {
1865
- var r = t[a], s = e.languages.javascript[r], r = (s = "RegExp" === e.util.type(s) ? e.languages.javascript[r] = { pattern: s } : s).inside || {};
1866
- (s.inside = r)["maybe-class-name"] = /^[A-Z][\s\S]*/;
1867
- }
1868
- }(Prism), function(s) {
1869
- var e = s.util.clone(s.languages.javascript), t = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source, a = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source, r = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
1870
- function n(e2, n2) {
1871
- return e2 = e2.replace(/<S>/g, function() {
1872
- return t;
1873
- }).replace(/<BRACES>/g, function() {
1874
- return a;
1875
- }).replace(/<SPREAD>/g, function() {
1876
- return r;
1877
- }), RegExp(e2, n2);
1878
- }
1879
- r = n(r).source, s.languages.jsx = s.languages.extend("markup", e), s.languages.jsx.tag.pattern = n(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source), s.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/, s.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/, s.languages.jsx.tag.inside.tag.inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/, s.languages.jsx.tag.inside.comment = e.comment, s.languages.insertBefore("inside", "attr-name", { spread: {
1880
- pattern: n(/<SPREAD>/.source),
1881
- inside: s.languages.jsx
1882
- } }, s.languages.jsx.tag), s.languages.insertBefore("inside", "special-attr", { script: {
1883
- pattern: n(/=<BRACES>/.source),
1884
- alias: "language-javascript",
1885
- inside: {
1886
- "script-punctuation": {
1887
- pattern: /^=(?=\{)/,
1888
- alias: "punctuation"
1889
- },
1890
- rest: s.languages.jsx
1891
- }
1892
- } }, s.languages.jsx.tag);
1893
- function i(e2) {
1894
- for (var n2 = [], t2 = 0; t2 < e2.length; t2++) {
1895
- var a2 = e2[t2], r2 = false;
1896
- "string" != typeof a2 && ("tag" === a2.type && a2.content[0] && "tag" === a2.content[0].type ? "</" === a2.content[0].content[0].content ? 0 < n2.length && n2[n2.length - 1].tagName === o(a2.content[0].content[1]) && n2.pop() : "/>" !== a2.content[a2.content.length - 1].content && n2.push({
1897
- tagName: o(a2.content[0].content[1]),
1898
- openedBraces: 0
1899
- }) : 0 < n2.length && "punctuation" === a2.type && "{" === a2.content ? n2[n2.length - 1].openedBraces++ : 0 < n2.length && 0 < n2[n2.length - 1].openedBraces && "punctuation" === a2.type && "}" === a2.content ? n2[n2.length - 1].openedBraces-- : r2 = true), (r2 || "string" == typeof a2) && 0 < n2.length && 0 === n2[n2.length - 1].openedBraces && (r2 = o(a2), t2 < e2.length - 1 && ("string" == typeof e2[t2 + 1] || "plain-text" === e2[t2 + 1].type) && (r2 += o(e2[t2 + 1]), e2.splice(t2 + 1, 1)), 0 < t2 && ("string" == typeof e2[t2 - 1] || "plain-text" === e2[t2 - 1].type) && (r2 = o(e2[t2 - 1]) + r2, e2.splice(t2 - 1, 1), t2--), e2[t2] = new s.Token("plain-text", r2, null, r2)), a2.content && "string" != typeof a2.content && i(a2.content);
1900
- }
1901
- }
1902
- var o = function(e2) {
1903
- return e2 ? "string" == typeof e2 ? e2 : "string" == typeof e2.content ? e2.content : e2.content.map(o).join("") : "";
1904
- };
1905
- s.hooks.add("after-tokenize", function(e2) {
1906
- "jsx" !== e2.language && "tsx" !== e2.language || i(e2.tokens);
1907
- });
1908
- }(Prism), function(e) {
1909
- var n = e.util.clone(e.languages.typescript), n = (e.languages.tsx = e.languages.extend("jsx", n), delete e.languages.tsx.parameter, delete e.languages.tsx["literal-property"], e.languages.tsx.tag);
1910
- n.pattern = RegExp(/(^|[^\w$]|(?=<\/))/.source + "(?:" + n.pattern.source + ")", n.pattern.flags), n.lookbehind = true;
1911
- }(Prism), Prism.languages.swift = {
1912
- comment: {
1913
- pattern: /(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,
1914
- lookbehind: true,
1915
- greedy: true
1916
- },
1917
- "string-literal": [{
1918
- pattern: RegExp(/(^|[^"#])/.source + "(?:" + /"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source + "|" + /"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source + ")" + /(?!["#])/.source),
1919
- lookbehind: true,
1920
- greedy: true,
1921
- inside: {
1922
- interpolation: {
1923
- pattern: /(\\\()(?:[^()]|\([^()]*\))*(?=\))/,
1924
- lookbehind: true,
1925
- inside: null
1926
- },
1927
- "interpolation-punctuation": {
1928
- pattern: /^\)|\\\($/,
1929
- alias: "punctuation"
1930
- },
1931
- punctuation: /\\(?=[\r\n])/,
1932
- string: /[\s\S]+/
1933
- }
1934
- }, {
1935
- pattern: RegExp(/(^|[^"#])(#+)/.source + "(?:" + /"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source + "|" + /"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source + ")\\2"),
1936
- lookbehind: true,
1937
- greedy: true,
1938
- inside: {
1939
- interpolation: {
1940
- pattern: /(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,
1941
- lookbehind: true,
1942
- inside: null
1943
- },
1944
- "interpolation-punctuation": {
1945
- pattern: /^\)|\\#+\($/,
1946
- alias: "punctuation"
1947
- },
1948
- string: /[\s\S]+/
1949
- }
1950
- }],
1951
- directive: {
1952
- pattern: RegExp(/#/.source + "(?:" + /(?:elseif|if)\b/.source + "(?:[ ]*" + /(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source + ")+|" + /(?:else|endif)\b/.source + ")"),
1953
- alias: "property",
1954
- inside: {
1955
- "directive-name": /^#\w+/,
1956
- boolean: /\b(?:false|true)\b/,
1957
- number: /\b\d+(?:\.\d+)*\b/,
1958
- operator: /!|&&|\|\||[<>]=?/,
1959
- punctuation: /[(),]/
1960
- }
1961
- },
1962
- literal: {
1963
- pattern: /#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,
1964
- alias: "constant"
1965
- },
1966
- "other-directive": {
1967
- pattern: /#\w+\b/,
1968
- alias: "property"
1969
- },
1970
- attribute: {
1971
- pattern: /@\w+/,
1972
- alias: "atrule"
1973
- },
1974
- "function-definition": {
1975
- pattern: /(\bfunc\s+)\w+/,
1976
- lookbehind: true,
1977
- alias: "function"
1978
- },
1979
- label: {
1980
- pattern: /\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,
1981
- lookbehind: true,
1982
- alias: "important"
1983
- },
1984
- keyword: /\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,
1985
- boolean: /\b(?:false|true)\b/,
1986
- nil: {
1987
- pattern: /\bnil\b/,
1988
- alias: "constant"
1989
- },
1990
- "short-argument": /\$\d+\b/,
1991
- omit: {
1992
- pattern: /\b_\b/,
1993
- alias: "keyword"
1994
- },
1995
- number: /\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,
1996
- "class-name": /\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,
1997
- function: /\b[a-z_]\w*(?=\s*\()/i,
1998
- constant: /\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,
1999
- operator: /[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,
2000
- punctuation: /[{}[\]();,.:\\]/
2001
- }, Prism.languages.swift["string-literal"].forEach(function(e) {
2002
- e.inside.interpolation.inside = Prism.languages.swift;
2003
- }), function(e) {
2004
- e.languages.kotlin = e.languages.extend("clike", {
2005
- keyword: {
2006
- pattern: /(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,
2007
- lookbehind: true
2008
- },
2009
- function: [{
2010
- pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,
2011
- greedy: true
2012
- }, {
2013
- pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,
2014
- lookbehind: true,
2015
- greedy: true
2016
- }],
2017
- number: /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,
2018
- operator: /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/
2019
- }), delete e.languages.kotlin["class-name"];
2020
- var n = {
2021
- "interpolation-punctuation": {
2022
- pattern: /^\$\{?|\}$/,
2023
- alias: "punctuation"
2024
- },
2025
- expression: {
2026
- pattern: /[\s\S]+/,
2027
- inside: e.languages.kotlin
2028
- }
2029
- };
2030
- e.languages.insertBefore("kotlin", "string", {
2031
- "string-literal": [{
2032
- pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,
2033
- alias: "multiline",
2034
- inside: {
2035
- interpolation: {
2036
- pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i,
2037
- inside: n
2038
- },
2039
- string: /[\s\S]+/
2040
- }
2041
- }, {
2042
- pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,
2043
- alias: "singleline",
2044
- inside: {
2045
- interpolation: {
2046
- pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,
2047
- lookbehind: true,
2048
- inside: n
2049
- },
2050
- string: /[\s\S]+/
2051
- }
2052
- }],
2053
- char: {
2054
- pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,
2055
- greedy: true
2056
- }
2057
- }), delete e.languages.kotlin.string, e.languages.insertBefore("kotlin", "keyword", { annotation: {
2058
- pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,
2059
- alias: "builtin"
2060
- } }), e.languages.insertBefore("kotlin", "function", { label: {
2061
- pattern: /\b\w+@|@\w+\b/,
2062
- alias: "symbol"
2063
- } }), e.languages.kt = e.languages.kotlin, e.languages.kts = e.languages.kotlin;
2064
- }(Prism), Prism.languages.c = Prism.languages.extend("clike", {
2065
- comment: {
2066
- pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
2067
- greedy: true
2068
- },
2069
- string: {
2070
- pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
2071
- greedy: true
2072
- },
2073
- "class-name": {
2074
- pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
2075
- lookbehind: true
2076
- },
2077
- keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
2078
- function: /\b[a-z_]\w*(?=\s*\()/i,
2079
- number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
2080
- operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
2081
- }), Prism.languages.insertBefore("c", "string", { char: {
2082
- pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
2083
- greedy: true
2084
- } }), Prism.languages.insertBefore("c", "string", { macro: {
2085
- pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
2086
- lookbehind: true,
2087
- greedy: true,
2088
- alias: "property",
2089
- inside: {
2090
- string: [{
2091
- pattern: /^(#\s*include\s*)<[^>]+>/,
2092
- lookbehind: true
2093
- }, Prism.languages.c.string],
2094
- char: Prism.languages.c.char,
2095
- comment: Prism.languages.c.comment,
2096
- "macro-name": [{
2097
- pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
2098
- lookbehind: true
2099
- }, {
2100
- pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
2101
- lookbehind: true,
2102
- alias: "function"
2103
- }],
2104
- directive: {
2105
- pattern: /^(#\s*)[a-z]+/,
2106
- lookbehind: true,
2107
- alias: "keyword"
2108
- },
2109
- "directive-hash": /^#/,
2110
- punctuation: /##|\\(?=[\r\n])/,
2111
- expression: {
2112
- pattern: /\S[\s\S]*/,
2113
- inside: Prism.languages.c
2114
- }
2115
- }
2116
- } }), Prism.languages.insertBefore("c", "function", { constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/ }), delete Prism.languages.c.boolean, Prism.languages.objectivec = Prism.languages.extend("c", {
2117
- string: {
2118
- pattern: /@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
2119
- greedy: true
2120
- },
2121
- keyword: /\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,
2122
- operator: /-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/
2123
- }), delete Prism.languages.objectivec["class-name"], Prism.languages.objc = Prism.languages.objectivec, Prism.languages.reason = Prism.languages.extend("clike", {
2124
- string: {
2125
- pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
2126
- greedy: true
2127
- },
2128
- "class-name": /\b[A-Z]\w*/,
2129
- keyword: /\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,
2130
- operator: /\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/
2131
- }), Prism.languages.insertBefore("reason", "class-name", {
2132
- char: {
2133
- pattern: /'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,
2134
- greedy: true
2135
- },
2136
- constructor: /\b[A-Z]\w*\b(?!\s*\.)/,
2137
- label: {
2138
- pattern: /\b[a-z]\w*(?=::)/,
2139
- alias: "symbol"
2140
- }
2141
- }), delete Prism.languages.reason.function, function(e) {
2142
- for (var n = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, t = 0; t < 2; t++) n = n.replace(/<self>/g, function() {
2143
- return n;
2144
- });
2145
- n = n.replace(/<self>/g, function() {
2146
- return /[^\s\S]/.source;
2147
- }), e.languages.rust = {
2148
- comment: [{
2149
- pattern: RegExp(/(^|[^\\])/.source + n),
2150
- lookbehind: true,
2151
- greedy: true
2152
- }, {
2153
- pattern: /(^|[^\\:])\/\/.*/,
2154
- lookbehind: true,
2155
- greedy: true
2156
- }],
2157
- string: {
2158
- pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,
2159
- greedy: true
2160
- },
2161
- char: {
2162
- pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,
2163
- greedy: true
2164
- },
2165
- attribute: {
2166
- pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,
2167
- greedy: true,
2168
- alias: "attr-name",
2169
- inside: { string: null }
2170
- },
2171
- "closure-params": {
2172
- pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,
2173
- lookbehind: true,
2174
- greedy: true,
2175
- inside: {
2176
- "closure-punctuation": {
2177
- pattern: /^\||\|$/,
2178
- alias: "punctuation"
2179
- },
2180
- rest: null
2181
- }
2182
- },
2183
- "lifetime-annotation": {
2184
- pattern: /'\w+/,
2185
- alias: "symbol"
2186
- },
2187
- "fragment-specifier": {
2188
- pattern: /(\$\w+:)[a-z]+/,
2189
- lookbehind: true,
2190
- alias: "punctuation"
2191
- },
2192
- variable: /\$\w+/,
2193
- "function-definition": {
2194
- pattern: /(\bfn\s+)\w+/,
2195
- lookbehind: true,
2196
- alias: "function"
2197
- },
2198
- "type-definition": {
2199
- pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/,
2200
- lookbehind: true,
2201
- alias: "class-name"
2202
- },
2203
- "module-declaration": [{
2204
- pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,
2205
- lookbehind: true,
2206
- alias: "namespace"
2207
- }, {
2208
- pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,
2209
- lookbehind: true,
2210
- alias: "namespace",
2211
- inside: { punctuation: /::/ }
2212
- }],
2213
- keyword: [/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/, /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],
2214
- function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,
2215
- macro: {
2216
- pattern: /\b\w+!/,
2217
- alias: "property"
2218
- },
2219
- constant: /\b[A-Z_][A-Z_\d]+\b/,
2220
- "class-name": /\b[A-Z]\w*\b/,
2221
- namespace: {
2222
- pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,
2223
- inside: { punctuation: /::/ }
2224
- },
2225
- number: /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,
2226
- boolean: /\b(?:false|true)\b/,
2227
- punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
2228
- operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
2229
- }, e.languages.rust["closure-params"].inside.rest = e.languages.rust, e.languages.rust.attribute.inside.string = e.languages.rust.string;
2230
- }(Prism), Prism.languages.go = Prism.languages.extend("clike", {
2231
- string: {
2232
- pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
2233
- lookbehind: true,
2234
- greedy: true
2235
- },
2236
- keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
2237
- boolean: /\b(?:_|false|iota|nil|true)\b/,
2238
- number: [
2239
- /\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
2240
- /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
2241
- /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
2242
- ],
2243
- operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
2244
- builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
2245
- }), Prism.languages.insertBefore("go", "string", { char: {
2246
- pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
2247
- greedy: true
2248
- } }), delete Prism.languages.go["class-name"], function(e) {
2249
- var n = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, t = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function() {
2250
- return n.source;
2251
- });
2252
- e.languages.cpp = e.languages.extend("c", {
2253
- "class-name": [
2254
- {
2255
- pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g, function() {
2256
- return n.source;
2257
- })),
2258
- lookbehind: true
2259
- },
2260
- /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
2261
- /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
2262
- /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
2263
- ],
2264
- keyword: n,
2265
- number: {
2266
- pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
2267
- greedy: true
2268
- },
2269
- operator: />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
2270
- boolean: /\b(?:false|true)\b/
2271
- }), e.languages.insertBefore("cpp", "string", {
2272
- module: {
2273
- pattern: RegExp(/(\b(?:import|module)\s+)/.source + "(?:" + /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + "|" + /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function() {
2274
- return t;
2275
- }) + ")"),
2276
- lookbehind: true,
2277
- greedy: true,
2278
- inside: {
2279
- string: /^[<"][\s\S]+/,
2280
- operator: /:/,
2281
- punctuation: /\./
2282
- }
2283
- },
2284
- "raw-string": {
2285
- pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
2286
- alias: "string",
2287
- greedy: true
2288
- }
2289
- }), e.languages.insertBefore("cpp", "keyword", { "generic-function": {
2290
- pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
2291
- inside: {
2292
- function: /^\w+/,
2293
- generic: {
2294
- pattern: /<[\s\S]+/,
2295
- alias: "class-name",
2296
- inside: e.languages.cpp
2297
- }
2298
- }
2299
- } }), e.languages.insertBefore("cpp", "operator", { "double-colon": {
2300
- pattern: /::/,
2301
- alias: "punctuation"
2302
- } }), e.languages.insertBefore("cpp", "class-name", { "base-clause": {
2303
- pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
2304
- lookbehind: true,
2305
- greedy: true,
2306
- inside: e.languages.extend("cpp", {})
2307
- } }), e.languages.insertBefore("inside", "double-colon", { "class-name": /\b[a-z_]\w*\b(?!\s*::)/i }, e.languages.cpp["base-clause"]);
2308
- }(Prism), Prism.languages.python = {
2309
- comment: {
2310
- pattern: /(^|[^\\])#.*/,
2311
- lookbehind: true,
2312
- greedy: true
2313
- },
2314
- "string-interpolation": {
2315
- pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
2316
- greedy: true,
2317
- inside: {
2318
- interpolation: {
2319
- pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
2320
- lookbehind: true,
2321
- inside: {
2322
- "format-spec": {
2323
- pattern: /(:)[^:(){}]+(?=\}$)/,
2324
- lookbehind: true
2325
- },
2326
- "conversion-option": {
2327
- pattern: /![sra](?=[:}]$)/,
2328
- alias: "punctuation"
2329
- },
2330
- rest: null
2331
- }
2332
- },
2333
- string: /[\s\S]+/
2334
- }
2335
- },
2336
- "triple-quoted-string": {
2337
- pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
2338
- greedy: true,
2339
- alias: "string"
2340
- },
2341
- string: {
2342
- pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
2343
- greedy: true
2344
- },
2345
- function: {
2346
- pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
2347
- lookbehind: true
2348
- },
2349
- "class-name": {
2350
- pattern: /(\bclass\s+)\w+/i,
2351
- lookbehind: true
2352
- },
2353
- decorator: {
2354
- pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
2355
- lookbehind: true,
2356
- alias: ["annotation", "punctuation"],
2357
- inside: { punctuation: /\./ }
2358
- },
2359
- keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
2360
- builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
2361
- boolean: /\b(?:False|None|True)\b/,
2362
- number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
2363
- operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
2364
- punctuation: /[{}[\];(),.:]/
2365
- }, Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python, Prism.languages.py = Prism.languages.python, Prism.languages.json = {
2366
- property: {
2367
- pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
2368
- lookbehind: true,
2369
- greedy: true
2370
- },
2371
- string: {
2372
- pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
2373
- lookbehind: true,
2374
- greedy: true
2375
- },
2376
- comment: {
2377
- pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
2378
- greedy: true
2379
- },
2380
- number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
2381
- punctuation: /[{}[\],]/,
2382
- operator: /:/,
2383
- boolean: /\b(?:false|true)\b/,
2384
- null: {
2385
- pattern: /\bnull\b/,
2386
- alias: "keyword"
2387
- }
2388
- }, Prism.languages.webmanifest = Prism.languages.json;
2389
- var themes_exports = {};
2390
- __export(themes_exports, {
2391
- dracula: () => dracula_default,
2392
- duotoneDark: () => duotoneDark_default,
2393
- duotoneLight: () => duotoneLight_default,
2394
- github: () => github_default,
2395
- gruvboxMaterialDark: () => gruvboxMaterialDark_default,
2396
- gruvboxMaterialLight: () => gruvboxMaterialLight_default,
2397
- jettwaveDark: () => jettwaveDark_default,
2398
- jettwaveLight: () => jettwaveLight_default,
2399
- nightOwl: () => nightOwl_default,
2400
- nightOwlLight: () => nightOwlLight_default,
2401
- oceanicNext: () => oceanicNext_default,
2402
- okaidia: () => okaidia_default,
2403
- oneDark: () => oneDark_default,
2404
- oneLight: () => oneLight_default,
2405
- palenight: () => palenight_default,
2406
- shadesOfPurple: () => shadesOfPurple_default,
2407
- synthwave84: () => synthwave84_default,
2408
- ultramin: () => ultramin_default,
2409
- vsDark: () => vsDark_default,
2410
- vsLight: () => vsLight_default
2411
- });
2412
- var dracula_default = {
2413
- plain: {
2414
- color: "#F8F8F2",
2415
- backgroundColor: "#282A36"
2416
- },
2417
- styles: [
2418
- {
2419
- types: [
2420
- "prolog",
2421
- "constant",
2422
- "builtin"
2423
- ],
2424
- style: { color: "rgb(189, 147, 249)" }
2425
- },
2426
- {
2427
- types: ["inserted", "function"],
2428
- style: { color: "rgb(80, 250, 123)" }
2429
- },
2430
- {
2431
- types: ["deleted"],
2432
- style: { color: "rgb(255, 85, 85)" }
2433
- },
2434
- {
2435
- types: ["changed"],
2436
- style: { color: "rgb(255, 184, 108)" }
2437
- },
2438
- {
2439
- types: ["punctuation", "symbol"],
2440
- style: { color: "rgb(248, 248, 242)" }
2441
- },
2442
- {
2443
- types: [
2444
- "string",
2445
- "char",
2446
- "tag",
2447
- "selector"
2448
- ],
2449
- style: { color: "rgb(255, 121, 198)" }
2450
- },
2451
- {
2452
- types: ["keyword", "variable"],
2453
- style: {
2454
- color: "rgb(189, 147, 249)",
2455
- fontStyle: "italic"
2456
- }
2457
- },
2458
- {
2459
- types: ["comment"],
2460
- style: { color: "rgb(98, 114, 164)" }
2461
- },
2462
- {
2463
- types: ["attr-name"],
2464
- style: { color: "rgb(241, 250, 140)" }
2465
- }
2466
- ]
2467
- };
2468
- var duotoneDark_default = {
2469
- plain: {
2470
- backgroundColor: "#2a2734",
2471
- color: "#9a86fd"
2472
- },
2473
- styles: [
2474
- {
2475
- types: [
2476
- "comment",
2477
- "prolog",
2478
- "doctype",
2479
- "cdata",
2480
- "punctuation"
2481
- ],
2482
- style: { color: "#6c6783" }
2483
- },
2484
- {
2485
- types: ["namespace"],
2486
- style: { opacity: .7 }
2487
- },
2488
- {
2489
- types: [
2490
- "tag",
2491
- "operator",
2492
- "number"
2493
- ],
2494
- style: { color: "#e09142" }
2495
- },
2496
- {
2497
- types: ["property", "function"],
2498
- style: { color: "#9a86fd" }
2499
- },
2500
- {
2501
- types: [
2502
- "tag-id",
2503
- "selector",
2504
- "atrule-id"
2505
- ],
2506
- style: { color: "#eeebff" }
2507
- },
2508
- {
2509
- types: ["attr-name"],
2510
- style: { color: "#c4b9fe" }
2511
- },
2512
- {
2513
- types: [
2514
- "boolean",
2515
- "string",
2516
- "entity",
2517
- "url",
2518
- "attr-value",
2519
- "keyword",
2520
- "control",
2521
- "directive",
2522
- "unit",
2523
- "statement",
2524
- "regex",
2525
- "atrule",
2526
- "placeholder",
2527
- "variable"
2528
- ],
2529
- style: { color: "#ffcc99" }
2530
- },
2531
- {
2532
- types: ["deleted"],
2533
- style: { textDecorationLine: "line-through" }
2534
- },
2535
- {
2536
- types: ["inserted"],
2537
- style: { textDecorationLine: "underline" }
2538
- },
2539
- {
2540
- types: ["italic"],
2541
- style: { fontStyle: "italic" }
2542
- },
2543
- {
2544
- types: ["important", "bold"],
2545
- style: { fontWeight: "bold" }
2546
- },
2547
- {
2548
- types: ["important"],
2549
- style: { color: "#c4b9fe" }
2550
- }
2551
- ]
2552
- };
2553
- var duotoneLight_default = {
2554
- plain: {
2555
- backgroundColor: "#faf8f5",
2556
- color: "#728fcb"
2557
- },
2558
- styles: [
2559
- {
2560
- types: [
2561
- "comment",
2562
- "prolog",
2563
- "doctype",
2564
- "cdata",
2565
- "punctuation"
2566
- ],
2567
- style: { color: "#b6ad9a" }
2568
- },
2569
- {
2570
- types: ["namespace"],
2571
- style: { opacity: .7 }
2572
- },
2573
- {
2574
- types: [
2575
- "tag",
2576
- "operator",
2577
- "number"
2578
- ],
2579
- style: { color: "#063289" }
2580
- },
2581
- {
2582
- types: ["property", "function"],
2583
- style: { color: "#b29762" }
2584
- },
2585
- {
2586
- types: [
2587
- "tag-id",
2588
- "selector",
2589
- "atrule-id"
2590
- ],
2591
- style: { color: "#2d2006" }
2592
- },
2593
- {
2594
- types: ["attr-name"],
2595
- style: { color: "#896724" }
2596
- },
2597
- {
2598
- types: [
2599
- "boolean",
2600
- "string",
2601
- "entity",
2602
- "url",
2603
- "attr-value",
2604
- "keyword",
2605
- "control",
2606
- "directive",
2607
- "unit",
2608
- "statement",
2609
- "regex",
2610
- "atrule"
2611
- ],
2612
- style: { color: "#728fcb" }
2613
- },
2614
- {
2615
- types: ["placeholder", "variable"],
2616
- style: { color: "#93abdc" }
2617
- },
2618
- {
2619
- types: ["deleted"],
2620
- style: { textDecorationLine: "line-through" }
2621
- },
2622
- {
2623
- types: ["inserted"],
2624
- style: { textDecorationLine: "underline" }
2625
- },
2626
- {
2627
- types: ["italic"],
2628
- style: { fontStyle: "italic" }
2629
- },
2630
- {
2631
- types: ["important", "bold"],
2632
- style: { fontWeight: "bold" }
2633
- },
2634
- {
2635
- types: ["important"],
2636
- style: { color: "#896724" }
2637
- }
2638
- ]
2639
- };
2640
- var github_default = {
2641
- plain: {
2642
- color: "#393A34",
2643
- backgroundColor: "#f6f8fa"
2644
- },
2645
- styles: [
2646
- {
2647
- types: [
2648
- "comment",
2649
- "prolog",
2650
- "doctype",
2651
- "cdata"
2652
- ],
2653
- style: {
2654
- color: "#999988",
2655
- fontStyle: "italic"
2656
- }
2657
- },
2658
- {
2659
- types: ["namespace"],
2660
- style: { opacity: .7 }
2661
- },
2662
- {
2663
- types: ["string", "attr-value"],
2664
- style: { color: "#e3116c" }
2665
- },
2666
- {
2667
- types: ["punctuation", "operator"],
2668
- style: { color: "#393A34" }
2669
- },
2670
- {
2671
- types: [
2672
- "entity",
2673
- "url",
2674
- "symbol",
2675
- "number",
2676
- "boolean",
2677
- "variable",
2678
- "constant",
2679
- "property",
2680
- "regex",
2681
- "inserted"
2682
- ],
2683
- style: { color: "#36acaa" }
2684
- },
2685
- {
2686
- types: [
2687
- "atrule",
2688
- "keyword",
2689
- "attr-name",
2690
- "selector"
2691
- ],
2692
- style: { color: "#00a4db" }
2693
- },
2694
- {
2695
- types: [
2696
- "function",
2697
- "deleted",
2698
- "tag"
2699
- ],
2700
- style: { color: "#d73a49" }
2701
- },
2702
- {
2703
- types: ["function-variable"],
2704
- style: { color: "#6f42c1" }
2705
- },
2706
- {
2707
- types: [
2708
- "tag",
2709
- "selector",
2710
- "keyword"
2711
- ],
2712
- style: { color: "#00009f" }
2713
- }
2714
- ]
2715
- };
2716
- var nightOwl_default = {
2717
- plain: {
2718
- color: "#d6deeb",
2719
- backgroundColor: "#011627"
2720
- },
2721
- styles: [
2722
- {
2723
- types: ["changed"],
2724
- style: {
2725
- color: "rgb(162, 191, 252)",
2726
- fontStyle: "italic"
2727
- }
2728
- },
2729
- {
2730
- types: ["deleted"],
2731
- style: {
2732
- color: "rgba(239, 83, 80, 0.56)",
2733
- fontStyle: "italic"
2734
- }
2735
- },
2736
- {
2737
- types: ["inserted", "attr-name"],
2738
- style: {
2739
- color: "rgb(173, 219, 103)",
2740
- fontStyle: "italic"
2741
- }
2742
- },
2743
- {
2744
- types: ["comment"],
2745
- style: {
2746
- color: "rgb(99, 119, 119)",
2747
- fontStyle: "italic"
2748
- }
2749
- },
2750
- {
2751
- types: ["string", "url"],
2752
- style: { color: "rgb(173, 219, 103)" }
2753
- },
2754
- {
2755
- types: ["variable"],
2756
- style: { color: "rgb(214, 222, 235)" }
2757
- },
2758
- {
2759
- types: ["number"],
2760
- style: { color: "rgb(247, 140, 108)" }
2761
- },
2762
- {
2763
- types: [
2764
- "builtin",
2765
- "char",
2766
- "constant",
2767
- "function"
2768
- ],
2769
- style: { color: "rgb(130, 170, 255)" }
2770
- },
2771
- {
2772
- types: ["punctuation"],
2773
- style: { color: "rgb(199, 146, 234)" }
2774
- },
2775
- {
2776
- types: ["selector", "doctype"],
2777
- style: {
2778
- color: "rgb(199, 146, 234)",
2779
- fontStyle: "italic"
2780
- }
2781
- },
2782
- {
2783
- types: ["class-name"],
2784
- style: { color: "rgb(255, 203, 139)" }
2785
- },
2786
- {
2787
- types: [
2788
- "tag",
2789
- "operator",
2790
- "keyword"
2791
- ],
2792
- style: { color: "rgb(127, 219, 202)" }
2793
- },
2794
- {
2795
- types: ["boolean"],
2796
- style: { color: "rgb(255, 88, 116)" }
2797
- },
2798
- {
2799
- types: ["property"],
2800
- style: { color: "rgb(128, 203, 196)" }
2801
- },
2802
- {
2803
- types: ["namespace"],
2804
- style: { color: "rgb(178, 204, 214)" }
2805
- }
2806
- ]
2807
- };
2808
- var nightOwlLight_default = {
2809
- plain: {
2810
- color: "#403f53",
2811
- backgroundColor: "#FBFBFB"
2812
- },
2813
- styles: [
2814
- {
2815
- types: ["changed"],
2816
- style: {
2817
- color: "rgb(162, 191, 252)",
2818
- fontStyle: "italic"
2819
- }
2820
- },
2821
- {
2822
- types: ["deleted"],
2823
- style: {
2824
- color: "rgba(239, 83, 80, 0.56)",
2825
- fontStyle: "italic"
2826
- }
2827
- },
2828
- {
2829
- types: ["inserted", "attr-name"],
2830
- style: {
2831
- color: "rgb(72, 118, 214)",
2832
- fontStyle: "italic"
2833
- }
2834
- },
2835
- {
2836
- types: ["comment"],
2837
- style: {
2838
- color: "rgb(152, 159, 177)",
2839
- fontStyle: "italic"
2840
- }
2841
- },
2842
- {
2843
- types: [
2844
- "string",
2845
- "builtin",
2846
- "char",
2847
- "constant",
2848
- "url"
2849
- ],
2850
- style: { color: "rgb(72, 118, 214)" }
2851
- },
2852
- {
2853
- types: ["variable"],
2854
- style: { color: "rgb(201, 103, 101)" }
2855
- },
2856
- {
2857
- types: ["number"],
2858
- style: { color: "rgb(170, 9, 130)" }
2859
- },
2860
- {
2861
- types: ["punctuation"],
2862
- style: { color: "rgb(153, 76, 195)" }
2863
- },
2864
- {
2865
- types: [
2866
- "function",
2867
- "selector",
2868
- "doctype"
2869
- ],
2870
- style: {
2871
- color: "rgb(153, 76, 195)",
2872
- fontStyle: "italic"
2873
- }
2874
- },
2875
- {
2876
- types: ["class-name"],
2877
- style: { color: "rgb(17, 17, 17)" }
2878
- },
2879
- {
2880
- types: ["tag"],
2881
- style: { color: "rgb(153, 76, 195)" }
2882
- },
2883
- {
2884
- types: [
2885
- "operator",
2886
- "property",
2887
- "keyword",
2888
- "namespace"
2889
- ],
2890
- style: { color: "rgb(12, 150, 155)" }
2891
- },
2892
- {
2893
- types: ["boolean"],
2894
- style: { color: "rgb(188, 84, 84)" }
2895
- }
2896
- ]
2897
- };
2898
- var colors = {
2899
- char: "#D8DEE9",
2900
- comment: "#999999",
2901
- keyword: "#c5a5c5",
2902
- primitive: "#5a9bcf",
2903
- string: "#8dc891",
2904
- variable: "#d7deea",
2905
- boolean: "#ff8b50",
2906
- punctuation: "#5FB3B3",
2907
- tag: "#fc929e",
2908
- function: "#79b6f2",
2909
- className: "#FAC863",
2910
- method: "#6699CC",
2911
- operator: "#fc929e"
2912
- };
2913
- var oceanicNext_default = {
2914
- plain: {
2915
- backgroundColor: "#282c34",
2916
- color: "#ffffff"
2917
- },
2918
- styles: [
2919
- {
2920
- types: ["attr-name"],
2921
- style: { color: colors.keyword }
2922
- },
2923
- {
2924
- types: ["attr-value"],
2925
- style: { color: colors.string }
2926
- },
2927
- {
2928
- types: [
2929
- "comment",
2930
- "block-comment",
2931
- "prolog",
2932
- "doctype",
2933
- "cdata",
2934
- "shebang"
2935
- ],
2936
- style: { color: colors.comment }
2937
- },
2938
- {
2939
- types: [
2940
- "property",
2941
- "number",
2942
- "function-name",
2943
- "constant",
2944
- "symbol",
2945
- "deleted"
2946
- ],
2947
- style: { color: colors.primitive }
2948
- },
2949
- {
2950
- types: ["boolean"],
2951
- style: { color: colors.boolean }
2952
- },
2953
- {
2954
- types: ["tag"],
2955
- style: { color: colors.tag }
2956
- },
2957
- {
2958
- types: ["string"],
2959
- style: { color: colors.string }
2960
- },
2961
- {
2962
- types: ["punctuation"],
2963
- style: { color: colors.string }
2964
- },
2965
- {
2966
- types: [
2967
- "selector",
2968
- "char",
2969
- "builtin",
2970
- "inserted"
2971
- ],
2972
- style: { color: colors.char }
2973
- },
2974
- {
2975
- types: ["function"],
2976
- style: { color: colors.function }
2977
- },
2978
- {
2979
- types: [
2980
- "operator",
2981
- "entity",
2982
- "url",
2983
- "variable"
2984
- ],
2985
- style: { color: colors.variable }
2986
- },
2987
- {
2988
- types: ["keyword"],
2989
- style: { color: colors.keyword }
2990
- },
2991
- {
2992
- types: ["atrule", "class-name"],
2993
- style: { color: colors.className }
2994
- },
2995
- {
2996
- types: ["important"],
2997
- style: { fontWeight: "400" }
2998
- },
2999
- {
3000
- types: ["bold"],
3001
- style: { fontWeight: "bold" }
3002
- },
3003
- {
3004
- types: ["italic"],
3005
- style: { fontStyle: "italic" }
3006
- },
3007
- {
3008
- types: ["namespace"],
3009
- style: { opacity: .7 }
3010
- }
3011
- ]
3012
- };
3013
- var okaidia_default = {
3014
- plain: {
3015
- color: "#f8f8f2",
3016
- backgroundColor: "#272822"
3017
- },
3018
- styles: [
3019
- {
3020
- types: ["changed"],
3021
- style: {
3022
- color: "rgb(162, 191, 252)",
3023
- fontStyle: "italic"
3024
- }
3025
- },
3026
- {
3027
- types: ["deleted"],
3028
- style: {
3029
- color: "#f92672",
3030
- fontStyle: "italic"
3031
- }
3032
- },
3033
- {
3034
- types: ["inserted"],
3035
- style: {
3036
- color: "rgb(173, 219, 103)",
3037
- fontStyle: "italic"
3038
- }
3039
- },
3040
- {
3041
- types: ["comment"],
3042
- style: {
3043
- color: "#8292a2",
3044
- fontStyle: "italic"
3045
- }
3046
- },
3047
- {
3048
- types: ["string", "url"],
3049
- style: { color: "#a6e22e" }
3050
- },
3051
- {
3052
- types: ["variable"],
3053
- style: { color: "#f8f8f2" }
3054
- },
3055
- {
3056
- types: ["number"],
3057
- style: { color: "#ae81ff" }
3058
- },
3059
- {
3060
- types: [
3061
- "builtin",
3062
- "char",
3063
- "constant",
3064
- "function",
3065
- "class-name"
3066
- ],
3067
- style: { color: "#e6db74" }
3068
- },
3069
- {
3070
- types: ["punctuation"],
3071
- style: { color: "#f8f8f2" }
3072
- },
3073
- {
3074
- types: ["selector", "doctype"],
3075
- style: {
3076
- color: "#a6e22e",
3077
- fontStyle: "italic"
3078
- }
3079
- },
3080
- {
3081
- types: [
3082
- "tag",
3083
- "operator",
3084
- "keyword"
3085
- ],
3086
- style: { color: "#66d9ef" }
3087
- },
3088
- {
3089
- types: ["boolean"],
3090
- style: { color: "#ae81ff" }
3091
- },
3092
- {
3093
- types: ["namespace"],
3094
- style: {
3095
- color: "rgb(178, 204, 214)",
3096
- opacity: .7
3097
- }
3098
- },
3099
- {
3100
- types: ["tag", "property"],
3101
- style: { color: "#f92672" }
3102
- },
3103
- {
3104
- types: ["attr-name"],
3105
- style: { color: "#a6e22e !important" }
3106
- },
3107
- {
3108
- types: ["doctype"],
3109
- style: { color: "#8292a2" }
3110
- },
3111
- {
3112
- types: ["rule"],
3113
- style: { color: "#e6db74" }
3114
- }
3115
- ]
3116
- };
3117
- var palenight_default = {
3118
- plain: {
3119
- color: "#bfc7d5",
3120
- backgroundColor: "#292d3e"
3121
- },
3122
- styles: [
3123
- {
3124
- types: ["comment"],
3125
- style: {
3126
- color: "rgb(105, 112, 152)",
3127
- fontStyle: "italic"
3128
- }
3129
- },
3130
- {
3131
- types: ["string", "inserted"],
3132
- style: { color: "rgb(195, 232, 141)" }
3133
- },
3134
- {
3135
- types: ["number"],
3136
- style: { color: "rgb(247, 140, 108)" }
3137
- },
3138
- {
3139
- types: [
3140
- "builtin",
3141
- "char",
3142
- "constant",
3143
- "function"
3144
- ],
3145
- style: { color: "rgb(130, 170, 255)" }
3146
- },
3147
- {
3148
- types: ["punctuation", "selector"],
3149
- style: { color: "rgb(199, 146, 234)" }
3150
- },
3151
- {
3152
- types: ["variable"],
3153
- style: { color: "rgb(191, 199, 213)" }
3154
- },
3155
- {
3156
- types: ["class-name", "attr-name"],
3157
- style: { color: "rgb(255, 203, 107)" }
3158
- },
3159
- {
3160
- types: ["tag", "deleted"],
3161
- style: { color: "rgb(255, 85, 114)" }
3162
- },
3163
- {
3164
- types: ["operator"],
3165
- style: { color: "rgb(137, 221, 255)" }
3166
- },
3167
- {
3168
- types: ["boolean"],
3169
- style: { color: "rgb(255, 88, 116)" }
3170
- },
3171
- {
3172
- types: ["keyword"],
3173
- style: { fontStyle: "italic" }
3174
- },
3175
- {
3176
- types: ["doctype"],
3177
- style: {
3178
- color: "rgb(199, 146, 234)",
3179
- fontStyle: "italic"
3180
- }
3181
- },
3182
- {
3183
- types: ["namespace"],
3184
- style: { color: "rgb(178, 204, 214)" }
3185
- },
3186
- {
3187
- types: ["url"],
3188
- style: { color: "rgb(221, 221, 221)" }
3189
- }
3190
- ]
3191
- };
3192
- var shadesOfPurple_default = {
3193
- plain: {
3194
- color: "#9EFEFF",
3195
- backgroundColor: "#2D2A55"
3196
- },
3197
- styles: [
3198
- {
3199
- types: ["changed"],
3200
- style: { color: "rgb(255, 238, 128)" }
3201
- },
3202
- {
3203
- types: ["deleted"],
3204
- style: { color: "rgba(239, 83, 80, 0.56)" }
3205
- },
3206
- {
3207
- types: ["inserted"],
3208
- style: { color: "rgb(173, 219, 103)" }
3209
- },
3210
- {
3211
- types: ["comment"],
3212
- style: {
3213
- color: "rgb(179, 98, 255)",
3214
- fontStyle: "italic"
3215
- }
3216
- },
3217
- {
3218
- types: ["punctuation"],
3219
- style: { color: "rgb(255, 255, 255)" }
3220
- },
3221
- {
3222
- types: ["constant"],
3223
- style: { color: "rgb(255, 98, 140)" }
3224
- },
3225
- {
3226
- types: ["string", "url"],
3227
- style: { color: "rgb(165, 255, 144)" }
3228
- },
3229
- {
3230
- types: ["variable"],
3231
- style: { color: "rgb(255, 238, 128)" }
3232
- },
3233
- {
3234
- types: ["number", "boolean"],
3235
- style: { color: "rgb(255, 98, 140)" }
3236
- },
3237
- {
3238
- types: ["attr-name"],
3239
- style: { color: "rgb(255, 180, 84)" }
3240
- },
3241
- {
3242
- types: [
3243
- "keyword",
3244
- "operator",
3245
- "property",
3246
- "namespace",
3247
- "tag",
3248
- "selector",
3249
- "doctype"
3250
- ],
3251
- style: { color: "rgb(255, 157, 0)" }
3252
- },
3253
- {
3254
- types: [
3255
- "builtin",
3256
- "char",
3257
- "constant",
3258
- "function",
3259
- "class-name"
3260
- ],
3261
- style: { color: "rgb(250, 208, 0)" }
3262
- }
3263
- ]
3264
- };
3265
- var synthwave84_default = {
3266
- plain: {
3267
- backgroundColor: "linear-gradient(to bottom, #2a2139 75%, #34294f)",
3268
- backgroundImage: "#34294f",
3269
- color: "#f92aad",
3270
- textShadow: "0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"
3271
- },
3272
- styles: [
3273
- {
3274
- types: [
3275
- "comment",
3276
- "block-comment",
3277
- "prolog",
3278
- "doctype",
3279
- "cdata"
3280
- ],
3281
- style: {
3282
- color: "#495495",
3283
- fontStyle: "italic"
3284
- }
3285
- },
3286
- {
3287
- types: ["punctuation"],
3288
- style: { color: "#ccc" }
3289
- },
3290
- {
3291
- types: [
3292
- "tag",
3293
- "attr-name",
3294
- "namespace",
3295
- "number",
3296
- "unit",
3297
- "hexcode",
3298
- "deleted"
3299
- ],
3300
- style: { color: "#e2777a" }
3301
- },
3302
- {
3303
- types: ["property", "selector"],
3304
- style: {
3305
- color: "#72f1b8",
3306
- textShadow: "0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"
3307
- }
3308
- },
3309
- {
3310
- types: ["function-name"],
3311
- style: { color: "#6196cc" }
3312
- },
3313
- {
3314
- types: [
3315
- "boolean",
3316
- "selector-id",
3317
- "function"
3318
- ],
3319
- style: {
3320
- color: "#fdfdfd",
3321
- textShadow: "0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"
3322
- }
3323
- },
3324
- {
3325
- types: [
3326
- "class-name",
3327
- "maybe-class-name",
3328
- "builtin"
3329
- ],
3330
- style: {
3331
- color: "#fff5f6",
3332
- textShadow: "0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"
3333
- }
3334
- },
3335
- {
3336
- types: ["constant", "symbol"],
3337
- style: {
3338
- color: "#f92aad",
3339
- textShadow: "0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"
3340
- }
3341
- },
3342
- {
3343
- types: [
3344
- "important",
3345
- "atrule",
3346
- "keyword",
3347
- "selector-class"
3348
- ],
3349
- style: {
3350
- color: "#f4eee4",
3351
- textShadow: "0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"
3352
- }
3353
- },
3354
- {
3355
- types: [
3356
- "string",
3357
- "char",
3358
- "attr-value",
3359
- "regex",
3360
- "variable"
3361
- ],
3362
- style: { color: "#f87c32" }
3363
- },
3364
- {
3365
- types: ["parameter"],
3366
- style: { fontStyle: "italic" }
3367
- },
3368
- {
3369
- types: ["entity", "url"],
3370
- style: { color: "#67cdcc" }
3371
- },
3372
- {
3373
- types: ["operator"],
3374
- style: { color: "ffffffee" }
3375
- },
3376
- {
3377
- types: ["important", "bold"],
3378
- style: { fontWeight: "bold" }
3379
- },
3380
- {
3381
- types: ["italic"],
3382
- style: { fontStyle: "italic" }
3383
- },
3384
- {
3385
- types: ["entity"],
3386
- style: { cursor: "help" }
3387
- },
3388
- {
3389
- types: ["inserted"],
3390
- style: { color: "green" }
3391
- }
3392
- ]
3393
- };
3394
- var ultramin_default = {
3395
- plain: {
3396
- color: "#282a2e",
3397
- backgroundColor: "#ffffff"
3398
- },
3399
- styles: [
3400
- {
3401
- types: ["comment"],
3402
- style: { color: "rgb(197, 200, 198)" }
3403
- },
3404
- {
3405
- types: [
3406
- "string",
3407
- "number",
3408
- "builtin",
3409
- "variable"
3410
- ],
3411
- style: { color: "rgb(150, 152, 150)" }
3412
- },
3413
- {
3414
- types: [
3415
- "class-name",
3416
- "function",
3417
- "tag",
3418
- "attr-name"
3419
- ],
3420
- style: { color: "rgb(40, 42, 46)" }
3421
- }
3422
- ]
3423
- };
3424
- var vsDark_default = {
3425
- plain: {
3426
- color: "#9CDCFE",
3427
- backgroundColor: "#1E1E1E"
3428
- },
3429
- styles: [
3430
- {
3431
- types: ["prolog"],
3432
- style: { color: "rgb(0, 0, 128)" }
3433
- },
3434
- {
3435
- types: ["comment"],
3436
- style: { color: "rgb(106, 153, 85)" }
3437
- },
3438
- {
3439
- types: [
3440
- "builtin",
3441
- "changed",
3442
- "keyword",
3443
- "interpolation-punctuation"
3444
- ],
3445
- style: { color: "rgb(86, 156, 214)" }
3446
- },
3447
- {
3448
- types: ["number", "inserted"],
3449
- style: { color: "rgb(181, 206, 168)" }
3450
- },
3451
- {
3452
- types: ["constant"],
3453
- style: { color: "rgb(100, 102, 149)" }
3454
- },
3455
- {
3456
- types: ["attr-name", "variable"],
3457
- style: { color: "rgb(156, 220, 254)" }
3458
- },
3459
- {
3460
- types: [
3461
- "deleted",
3462
- "string",
3463
- "attr-value",
3464
- "template-punctuation"
3465
- ],
3466
- style: { color: "rgb(206, 145, 120)" }
3467
- },
3468
- {
3469
- types: ["selector"],
3470
- style: { color: "rgb(215, 186, 125)" }
3471
- },
3472
- {
3473
- types: ["tag"],
3474
- style: { color: "rgb(78, 201, 176)" }
3475
- },
3476
- {
3477
- types: ["tag"],
3478
- languages: ["markup"],
3479
- style: { color: "rgb(86, 156, 214)" }
3480
- },
3481
- {
3482
- types: ["punctuation", "operator"],
3483
- style: { color: "rgb(212, 212, 212)" }
3484
- },
3485
- {
3486
- types: ["punctuation"],
3487
- languages: ["markup"],
3488
- style: { color: "#808080" }
3489
- },
3490
- {
3491
- types: ["function"],
3492
- style: { color: "rgb(220, 220, 170)" }
3493
- },
3494
- {
3495
- types: ["class-name"],
3496
- style: { color: "rgb(78, 201, 176)" }
3497
- },
3498
- {
3499
- types: ["char"],
3500
- style: { color: "rgb(209, 105, 105)" }
3501
- }
3502
- ]
3503
- };
3504
- var vsLight_default = {
3505
- plain: {
3506
- color: "#000000",
3507
- backgroundColor: "#ffffff"
3508
- },
3509
- styles: [
3510
- {
3511
- types: ["comment"],
3512
- style: { color: "rgb(0, 128, 0)" }
3513
- },
3514
- {
3515
- types: ["builtin"],
3516
- style: { color: "rgb(0, 112, 193)" }
3517
- },
3518
- {
3519
- types: [
3520
- "number",
3521
- "variable",
3522
- "inserted"
3523
- ],
3524
- style: { color: "rgb(9, 134, 88)" }
3525
- },
3526
- {
3527
- types: ["operator"],
3528
- style: { color: "rgb(0, 0, 0)" }
3529
- },
3530
- {
3531
- types: ["constant", "char"],
3532
- style: { color: "rgb(129, 31, 63)" }
3533
- },
3534
- {
3535
- types: ["tag"],
3536
- style: { color: "rgb(128, 0, 0)" }
3537
- },
3538
- {
3539
- types: ["attr-name"],
3540
- style: { color: "rgb(255, 0, 0)" }
3541
- },
3542
- {
3543
- types: ["deleted", "string"],
3544
- style: { color: "rgb(163, 21, 21)" }
3545
- },
3546
- {
3547
- types: ["changed", "punctuation"],
3548
- style: { color: "rgb(4, 81, 165)" }
3549
- },
3550
- {
3551
- types: ["function", "keyword"],
3552
- style: { color: "rgb(0, 0, 255)" }
3553
- },
3554
- {
3555
- types: ["class-name"],
3556
- style: { color: "rgb(38, 127, 153)" }
3557
- }
3558
- ]
3559
- };
3560
- var jettwaveDark_default = {
3561
- plain: {
3562
- color: "#f8fafc",
3563
- backgroundColor: "#011627"
3564
- },
3565
- styles: [
3566
- {
3567
- types: ["prolog"],
3568
- style: { color: "#000080" }
3569
- },
3570
- {
3571
- types: ["comment"],
3572
- style: { color: "#6A9955" }
3573
- },
3574
- {
3575
- types: [
3576
- "builtin",
3577
- "changed",
3578
- "keyword",
3579
- "interpolation-punctuation"
3580
- ],
3581
- style: { color: "#569CD6" }
3582
- },
3583
- {
3584
- types: ["number", "inserted"],
3585
- style: { color: "#B5CEA8" }
3586
- },
3587
- {
3588
- types: ["constant"],
3589
- style: { color: "#f8fafc" }
3590
- },
3591
- {
3592
- types: ["attr-name", "variable"],
3593
- style: { color: "#9CDCFE" }
3594
- },
3595
- {
3596
- types: [
3597
- "deleted",
3598
- "string",
3599
- "attr-value",
3600
- "template-punctuation"
3601
- ],
3602
- style: { color: "#cbd5e1" }
3603
- },
3604
- {
3605
- types: ["selector"],
3606
- style: { color: "#D7BA7D" }
3607
- },
3608
- {
3609
- types: ["tag"],
3610
- style: { color: "#0ea5e9" }
3611
- },
3612
- {
3613
- types: ["tag"],
3614
- languages: ["markup"],
3615
- style: { color: "#0ea5e9" }
3616
- },
3617
- {
3618
- types: ["punctuation", "operator"],
3619
- style: { color: "#D4D4D4" }
3620
- },
3621
- {
3622
- types: ["punctuation"],
3623
- languages: ["markup"],
3624
- style: { color: "#808080" }
3625
- },
3626
- {
3627
- types: ["function"],
3628
- style: { color: "#7dd3fc" }
3629
- },
3630
- {
3631
- types: ["class-name"],
3632
- style: { color: "#0ea5e9" }
3633
- },
3634
- {
3635
- types: ["char"],
3636
- style: { color: "#D16969" }
3637
- }
3638
- ]
3639
- };
3640
- var jettwaveLight_default = {
3641
- plain: {
3642
- color: "#0f172a",
3643
- backgroundColor: "#f1f5f9"
3644
- },
3645
- styles: [
3646
- {
3647
- types: ["prolog"],
3648
- style: { color: "#000080" }
3649
- },
3650
- {
3651
- types: ["comment"],
3652
- style: { color: "#6A9955" }
3653
- },
3654
- {
3655
- types: [
3656
- "builtin",
3657
- "changed",
3658
- "keyword",
3659
- "interpolation-punctuation"
3660
- ],
3661
- style: { color: "#0c4a6e" }
3662
- },
3663
- {
3664
- types: ["number", "inserted"],
3665
- style: { color: "#B5CEA8" }
3666
- },
3667
- {
3668
- types: ["constant"],
3669
- style: { color: "#0f172a" }
3670
- },
3671
- {
3672
- types: ["attr-name", "variable"],
3673
- style: { color: "#0c4a6e" }
3674
- },
3675
- {
3676
- types: [
3677
- "deleted",
3678
- "string",
3679
- "attr-value",
3680
- "template-punctuation"
3681
- ],
3682
- style: { color: "#64748b" }
3683
- },
3684
- {
3685
- types: ["selector"],
3686
- style: { color: "#D7BA7D" }
3687
- },
3688
- {
3689
- types: ["tag"],
3690
- style: { color: "#0ea5e9" }
3691
- },
3692
- {
3693
- types: ["tag"],
3694
- languages: ["markup"],
3695
- style: { color: "#0ea5e9" }
3696
- },
3697
- {
3698
- types: ["punctuation", "operator"],
3699
- style: { color: "#475569" }
3700
- },
3701
- {
3702
- types: ["punctuation"],
3703
- languages: ["markup"],
3704
- style: { color: "#808080" }
3705
- },
3706
- {
3707
- types: ["function"],
3708
- style: { color: "#0e7490" }
3709
- },
3710
- {
3711
- types: ["class-name"],
3712
- style: { color: "#0ea5e9" }
3713
- },
3714
- {
3715
- types: ["char"],
3716
- style: { color: "#D16969" }
3717
- }
3718
- ]
3719
- };
3720
- var oneDark_default = {
3721
- plain: {
3722
- backgroundColor: "hsl(220, 13%, 18%)",
3723
- color: "hsl(220, 14%, 71%)",
3724
- textShadow: "0 1px rgba(0, 0, 0, 0.3)"
3725
- },
3726
- styles: [
3727
- {
3728
- types: [
3729
- "comment",
3730
- "prolog",
3731
- "cdata"
3732
- ],
3733
- style: { color: "hsl(220, 10%, 40%)" }
3734
- },
3735
- {
3736
- types: [
3737
- "doctype",
3738
- "punctuation",
3739
- "entity"
3740
- ],
3741
- style: { color: "hsl(220, 14%, 71%)" }
3742
- },
3743
- {
3744
- types: [
3745
- "attr-name",
3746
- "class-name",
3747
- "maybe-class-name",
3748
- "boolean",
3749
- "constant",
3750
- "number",
3751
- "atrule"
3752
- ],
3753
- style: { color: "hsl(29, 54%, 61%)" }
3754
- },
3755
- {
3756
- types: ["keyword"],
3757
- style: { color: "hsl(286, 60%, 67%)" }
3758
- },
3759
- {
3760
- types: [
3761
- "property",
3762
- "tag",
3763
- "symbol",
3764
- "deleted",
3765
- "important"
3766
- ],
3767
- style: { color: "hsl(355, 65%, 65%)" }
3768
- },
3769
- {
3770
- types: [
3771
- "selector",
3772
- "string",
3773
- "char",
3774
- "builtin",
3775
- "inserted",
3776
- "regex",
3777
- "attr-value"
3778
- ],
3779
- style: { color: "hsl(95, 38%, 62%)" }
3780
- },
3781
- {
3782
- types: [
3783
- "variable",
3784
- "operator",
3785
- "function"
3786
- ],
3787
- style: { color: "hsl(207, 82%, 66%)" }
3788
- },
3789
- {
3790
- types: ["url"],
3791
- style: { color: "hsl(187, 47%, 55%)" }
3792
- },
3793
- {
3794
- types: ["deleted"],
3795
- style: { textDecorationLine: "line-through" }
3796
- },
3797
- {
3798
- types: ["inserted"],
3799
- style: { textDecorationLine: "underline" }
3800
- },
3801
- {
3802
- types: ["italic"],
3803
- style: { fontStyle: "italic" }
3804
- },
3805
- {
3806
- types: ["important", "bold"],
3807
- style: { fontWeight: "bold" }
3808
- },
3809
- {
3810
- types: ["important"],
3811
- style: { color: "hsl(220, 14%, 71%)" }
3812
- }
3813
- ]
3814
- };
3815
- var oneLight_default = {
3816
- plain: {
3817
- backgroundColor: "hsl(230, 1%, 98%)",
3818
- color: "hsl(230, 8%, 24%)"
3819
- },
3820
- styles: [
3821
- {
3822
- types: [
3823
- "comment",
3824
- "prolog",
3825
- "cdata"
3826
- ],
3827
- style: { color: "hsl(230, 4%, 64%)" }
3828
- },
3829
- {
3830
- types: [
3831
- "doctype",
3832
- "punctuation",
3833
- "entity"
3834
- ],
3835
- style: { color: "hsl(230, 8%, 24%)" }
3836
- },
3837
- {
3838
- types: [
3839
- "attr-name",
3840
- "class-name",
3841
- "boolean",
3842
- "constant",
3843
- "number",
3844
- "atrule"
3845
- ],
3846
- style: { color: "hsl(35, 99%, 36%)" }
3847
- },
3848
- {
3849
- types: ["keyword"],
3850
- style: { color: "hsl(301, 63%, 40%)" }
3851
- },
3852
- {
3853
- types: [
3854
- "property",
3855
- "tag",
3856
- "symbol",
3857
- "deleted",
3858
- "important"
3859
- ],
3860
- style: { color: "hsl(5, 74%, 59%)" }
3861
- },
3862
- {
3863
- types: [
3864
- "selector",
3865
- "string",
3866
- "char",
3867
- "builtin",
3868
- "inserted",
3869
- "regex",
3870
- "attr-value",
3871
- "punctuation"
3872
- ],
3873
- style: { color: "hsl(119, 34%, 47%)" }
3874
- },
3875
- {
3876
- types: [
3877
- "variable",
3878
- "operator",
3879
- "function"
3880
- ],
3881
- style: { color: "hsl(221, 87%, 60%)" }
3882
- },
3883
- {
3884
- types: ["url"],
3885
- style: { color: "hsl(198, 99%, 37%)" }
3886
- },
3887
- {
3888
- types: ["deleted"],
3889
- style: { textDecorationLine: "line-through" }
3890
- },
3891
- {
3892
- types: ["inserted"],
3893
- style: { textDecorationLine: "underline" }
3894
- },
3895
- {
3896
- types: ["italic"],
3897
- style: { fontStyle: "italic" }
3898
- },
3899
- {
3900
- types: ["important", "bold"],
3901
- style: { fontWeight: "bold" }
3902
- },
3903
- {
3904
- types: ["important"],
3905
- style: { color: "hsl(230, 8%, 24%)" }
3906
- }
3907
- ]
3908
- };
3909
- var gruvboxMaterialDark_default = {
3910
- plain: {
3911
- color: "#ebdbb2",
3912
- backgroundColor: "#292828"
3913
- },
3914
- styles: [
3915
- {
3916
- types: [
3917
- "imports",
3918
- "class-name",
3919
- "maybe-class-name",
3920
- "constant",
3921
- "doctype",
3922
- "builtin",
3923
- "function"
3924
- ],
3925
- style: { color: "#d8a657" }
3926
- },
3927
- {
3928
- types: ["property-access"],
3929
- style: { color: "#7daea3" }
3930
- },
3931
- {
3932
- types: ["tag"],
3933
- style: { color: "#e78a4e" }
3934
- },
3935
- {
3936
- types: [
3937
- "attr-name",
3938
- "char",
3939
- "url",
3940
- "regex"
3941
- ],
3942
- style: { color: "#a9b665" }
3943
- },
3944
- {
3945
- types: ["attr-value", "string"],
3946
- style: { color: "#89b482" }
3947
- },
3948
- {
3949
- types: [
3950
- "comment",
3951
- "prolog",
3952
- "cdata",
3953
- "operator",
3954
- "inserted"
3955
- ],
3956
- style: { color: "#a89984" }
3957
- },
3958
- {
3959
- types: [
3960
- "delimiter",
3961
- "boolean",
3962
- "keyword",
3963
- "selector",
3964
- "important",
3965
- "atrule",
3966
- "property",
3967
- "variable",
3968
- "deleted"
3969
- ],
3970
- style: { color: "#ea6962" }
3971
- },
3972
- {
3973
- types: [
3974
- "entity",
3975
- "number",
3976
- "symbol"
3977
- ],
3978
- style: { color: "#d3869b" }
3979
- }
3980
- ]
3981
- };
3982
- var gruvboxMaterialLight_default = {
3983
- plain: {
3984
- color: "#654735",
3985
- backgroundColor: "#f9f5d7"
3986
- },
3987
- styles: [
3988
- {
3989
- types: [
3990
- "delimiter",
3991
- "boolean",
3992
- "keyword",
3993
- "selector",
3994
- "important",
3995
- "atrule",
3996
- "property",
3997
- "variable",
3998
- "deleted"
3999
- ],
4000
- style: { color: "#af2528" }
4001
- },
4002
- {
4003
- types: [
4004
- "imports",
4005
- "class-name",
4006
- "maybe-class-name",
4007
- "constant",
4008
- "doctype",
4009
- "builtin"
4010
- ],
4011
- style: { color: "#b4730e" }
4012
- },
4013
- {
4014
- types: ["string", "attr-value"],
4015
- style: { color: "#477a5b" }
4016
- },
4017
- {
4018
- types: ["property-access"],
4019
- style: { color: "#266b79" }
4020
- },
4021
- {
4022
- types: [
4023
- "function",
4024
- "attr-name",
4025
- "char",
4026
- "url"
4027
- ],
4028
- style: { color: "#72761e" }
4029
- },
4030
- {
4031
- types: ["tag"],
4032
- style: { color: "#b94c07" }
4033
- },
4034
- {
4035
- types: [
4036
- "comment",
4037
- "prolog",
4038
- "cdata",
4039
- "operator",
4040
- "inserted"
4041
- ],
4042
- style: { color: "#a89984" }
4043
- },
4044
- {
4045
- types: [
4046
- "entity",
4047
- "number",
4048
- "symbol"
4049
- ],
4050
- style: { color: "#924f79" }
4051
- }
4052
- ]
4053
- };
4054
- var useGetLineProps = (themeDictionary) => useCallback((_a) => {
4055
- var _b = _a, { className, style, line } = _b;
4056
- const output = __spreadProps(__spreadValues({}, __objRest(_b, [
4057
- "className",
4058
- "style",
4059
- "line"
4060
- ])), { className: clsx("token-line", className) });
4061
- if (typeof themeDictionary === "object" && "plain" in themeDictionary) output.style = themeDictionary.plain;
4062
- if (typeof style === "object") output.style = __spreadValues(__spreadValues({}, output.style || {}), style);
4063
- return output;
4064
- }, [themeDictionary]);
4065
- var useGetTokenProps = (themeDictionary) => {
4066
- const styleForToken = useCallback(({ types, empty }) => {
4067
- if (themeDictionary == null) return void 0;
4068
- else if (types.length === 1 && types[0] === "plain") return empty != null ? { display: "inline-block" } : void 0;
4069
- else if (types.length === 1 && empty != null) return themeDictionary[types[0]];
4070
- return Object.assign(empty != null ? { display: "inline-block" } : {}, ...types.map((type) => themeDictionary[type]));
4071
- }, [themeDictionary]);
4072
- return useCallback((_a) => {
4073
- var _b = _a, { token, className, style } = _b;
4074
- const output = __spreadProps(__spreadValues({}, __objRest(_b, [
4075
- "token",
4076
- "className",
4077
- "style"
4078
- ])), {
4079
- className: clsx("token", ...token.types, className),
4080
- children: token.content,
4081
- style: styleForToken(token)
4082
- });
4083
- if (style != null) output.style = __spreadValues(__spreadValues({}, output.style || {}), style);
4084
- return output;
4085
- }, [styleForToken]);
4086
- };
4087
- var newlineRe = /\r\n|\r|\n/;
4088
- var normalizeEmptyLines = (line) => {
4089
- if (line.length === 0) line.push({
4090
- types: ["plain"],
4091
- content: "\n",
4092
- empty: true
4093
- });
4094
- else if (line.length === 1 && line[0].content === "") {
4095
- line[0].content = "\n";
4096
- line[0].empty = true;
4097
- }
4098
- };
4099
- var appendTypes = (types, add) => {
4100
- const typesSize = types.length;
4101
- if (typesSize > 0 && types[typesSize - 1] === add) return types;
4102
- return types.concat(add);
4103
- };
4104
- var normalizeTokens = (tokens) => {
4105
- const typeArrStack = [[]];
4106
- const tokenArrStack = [tokens];
4107
- const tokenArrIndexStack = [0];
4108
- const tokenArrSizeStack = [tokens.length];
4109
- let i = 0;
4110
- let stackIndex = 0;
4111
- let currentLine = [];
4112
- const acc = [currentLine];
4113
- while (stackIndex > -1) {
4114
- while ((i = tokenArrIndexStack[stackIndex]++) < tokenArrSizeStack[stackIndex]) {
4115
- let content;
4116
- let types = typeArrStack[stackIndex];
4117
- const token = tokenArrStack[stackIndex][i];
4118
- if (typeof token === "string") {
4119
- types = stackIndex > 0 ? types : ["plain"];
4120
- content = token;
4121
- } else {
4122
- types = appendTypes(types, token.type);
4123
- if (token.alias) types = appendTypes(types, token.alias);
4124
- content = token.content;
4125
- }
4126
- if (typeof content !== "string") {
4127
- stackIndex++;
4128
- typeArrStack.push(types);
4129
- tokenArrStack.push(content);
4130
- tokenArrIndexStack.push(0);
4131
- tokenArrSizeStack.push(content.length);
4132
- continue;
4133
- }
4134
- const splitByNewlines = content.split(newlineRe);
4135
- const newlineCount = splitByNewlines.length;
4136
- currentLine.push({
4137
- types,
4138
- content: splitByNewlines[0]
4139
- });
4140
- for (let i2 = 1; i2 < newlineCount; i2++) {
4141
- normalizeEmptyLines(currentLine);
4142
- acc.push(currentLine = []);
4143
- currentLine.push({
4144
- types,
4145
- content: splitByNewlines[i2]
4146
- });
4147
- }
4148
- }
4149
- stackIndex--;
4150
- typeArrStack.pop();
4151
- tokenArrStack.pop();
4152
- tokenArrIndexStack.pop();
4153
- tokenArrSizeStack.pop();
4154
- }
4155
- normalizeEmptyLines(currentLine);
4156
- return acc;
4157
- };
4158
- var normalizeTokens_default = normalizeTokens;
4159
- var useTokenize = ({ prism, code, grammar, language }) => {
4160
- return useMemo(() => {
4161
- if (grammar == null) return normalizeTokens_default([code]);
4162
- const prismConfig = {
4163
- code,
4164
- grammar,
4165
- language,
4166
- tokens: []
4167
- };
4168
- prism.hooks.run("before-tokenize", prismConfig);
4169
- prismConfig.tokens = prism.tokenize(code, grammar);
4170
- prism.hooks.run("after-tokenize", prismConfig);
4171
- return normalizeTokens_default(prismConfig.tokens);
4172
- }, [
4173
- code,
4174
- grammar,
4175
- language,
4176
- prism
4177
- ]);
4178
- };
4179
- var themeToDict = (theme21, language) => {
4180
- const { plain } = theme21;
4181
- const themeDict = theme21.styles.reduce((acc, themeEntry) => {
4182
- const { languages: languages2, style } = themeEntry;
4183
- if (languages2 && !languages2.includes(language)) return acc;
4184
- themeEntry.types.forEach((type) => {
4185
- acc[type] = __spreadValues(__spreadValues({}, acc[type]), style);
4186
- });
4187
- return acc;
4188
- }, {});
4189
- themeDict.root = plain;
4190
- themeDict.plain = __spreadProps(__spreadValues({}, plain), { backgroundColor: void 0 });
4191
- return themeDict;
4192
- };
4193
- var themeToDict_default = themeToDict;
4194
- var Highlight = ({ children, language: _language, code, theme: theme21, prism }) => {
4195
- const language = _language.toLowerCase();
4196
- const themeDictionary = themeToDict_default(theme21, language);
4197
- const getLineProps = useGetLineProps(themeDictionary);
4198
- const getTokenProps = useGetTokenProps(themeDictionary);
4199
- const grammar = prism.languages[language];
4200
- return children({
4201
- tokens: useTokenize({
4202
- prism,
4203
- language,
4204
- code,
4205
- grammar
4206
- }),
4207
- className: `prism-code language-${language}`,
4208
- style: themeDictionary != null ? themeDictionary.root : {},
4209
- getLineProps,
4210
- getTokenProps
4211
- });
4212
- };
4213
- var Highlight2 = (props) => createElement(Highlight, __spreadProps(__spreadValues({}, props), {
4214
- prism: props.prism || Prism,
4215
- theme: props.theme || vsDark_default,
4216
- code: props.code,
4217
- language: props.language
4218
- }));
4219
- /*! Bundled license information:
4220
-
4221
- prismjs/prism.js:
4222
- (**
4223
- * Prism: Lightweight, robust, elegant syntax highlighting
4224
- *
4225
- * @license MIT <https://opensource.org/licenses/MIT>
4226
- * @author Lea Verou <https://lea.verou.me>
4227
- * @namespace
4228
- * @public
4229
- *)
4230
- */
4231
- //#endregion
4232
- export { Highlight2, themes_exports };