desy-html 7.4.0 → 8.0.1

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.
@@ -6,29 +6,6 @@
6
6
  "classes": "lg:mt-48"
7
7
  }) }}
8
8
 
9
- <script src="js/prism/prism.min.js"></script>
10
- <script src="js/prism/prism-toolbar.min.js"></script>
11
- <script src="js/prism/clipboard.min.js"></script>
12
- <script src="js/prism/prism-copy-to-clipboard.min.js"></script>
13
- <script src="js/prism/prism-normalize-whitespace.min.js"></script>
14
- <script src="js/prism/prism-yaml.min.js"></script>
15
- <script src="js/prism/prism-twig.min.js"></script>
16
- <script>
17
- // Optional
18
- Prism.plugins.NormalizeWhitespace.setDefaults({
19
- 'remove-trailing': true,
20
- 'remove-indent': true,
21
- 'left-trim': true,
22
- 'right-trim': true,
23
- /*'break-lines': 80,
24
- 'indent': 2,
25
- 'remove-initial-line-feed': false,
26
- 'tabs-to-spaces': 4,
27
- 'spaces-to-tabs': 4*/
28
- });
29
- </script>
30
-
31
-
32
9
  <script src="js/popper.min.js"></script>
33
10
  <script src="js/tippy-bundle.umd.min.js"></script>
34
11
  <script type="module" src="js/index.js"></script>
@@ -11,336 +11,18 @@
11
11
  <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" rel="stylesheet">
12
12
  <link rel="stylesheet" href="css/styles.css">
13
13
  <style>
14
- /* PrismJS 1.15.0
15
- https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+java+kotlin+markdown+swift&plugins=toolbar+show-language+copy-to-clipboard */
16
- /**
17
- * prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
18
- * Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
19
- * @author Tim Shedor
20
- */
21
-
22
-
23
- code[class*="language-"],
24
- pre[class*="language-"] {
25
- color: black;
26
- background: none;
27
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
28
- text-align: left;
29
- white-space: pre;
30
- word-spacing: normal;
31
- word-break: normal;
32
- word-wrap: normal;
33
- line-height: 1.5;
34
- -moz-tab-size: 4;
35
- -o-tab-size: 4;
36
- tab-size: 4;
37
- -webkit-hyphens: none;
38
- -ms-hyphens: none;
39
- hyphens: none; }
40
-
41
- /* Code blocks */
42
- pre[class*="language-"] {
43
- position: relative;
44
- margin: .5em 0;
45
- overflow: visible;
46
- padding: 0; }
47
-
48
- pre[class*="language-"] > code {
49
- position: relative;
50
- border-left: 10px solid #358ccb;
51
- -webkit-box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf;
52
- box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf;
53
- background-color: #fdfdfd;
54
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(50%, transparent), color-stop(50%, rgba(69, 142, 209, 0.04)));
55
- background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
56
- background-size: 3em 3em;
57
- background-origin: content-box;
58
- background-attachment: local; }
59
-
60
- code[class*="language"] {
61
- max-height: inherit;
62
- height: inherit;
63
- padding: 0 1em;
64
- display: block;
65
- overflow: auto; }
66
-
67
- /* Margin bottom to accommodate shadow */
68
- :not(pre) > code[class*="language-"],
69
- pre[class*="language-"] {
70
- background-color: #fdfdfd;
71
- -webkit-box-sizing: border-box;
72
- box-sizing: border-box;
73
- margin-bottom: 1em; }
74
-
75
- /* Inline code */
76
- :not(pre) > code[class*="language-"] {
77
- position: relative;
78
- padding: .2em;
79
- border-radius: 0.3em;
80
- color: #c92c2c;
81
- border: 1px solid rgba(0, 0, 0, 0.1);
82
- display: inline;
83
- white-space: normal; }
84
-
85
- pre[class*="language-"]:before,
86
- pre[class*="language-"]:after {
87
- content: '';
88
- z-index: -2;
89
- display: block;
90
- position: absolute;
91
- bottom: 0.75em;
92
- left: 0.18em;
93
- width: 40%;
94
- height: 20%;
95
- max-height: 13em;
96
- -webkit-box-shadow: 0px 13px 8px #979797;
97
- box-shadow: 0px 13px 8px #979797;
98
- -webkit-transform: rotate(-2deg);
99
- transform: rotate(-2deg); }
100
-
101
- :not(pre) > code[class*="language-"]:after,
102
- pre[class*="language-"]:after {
103
- right: 0.75em;
104
- left: auto;
105
- -webkit-transform: rotate(2deg);
106
- transform: rotate(2deg); }
107
-
108
- .token.comment,
109
- .token.block-comment,
110
- .token.prolog,
111
- .token.doctype,
112
- .token.cdata {
113
- color: #7D8B99; }
114
-
115
- .token.punctuation {
116
- color: #5F6364; }
117
-
118
- .token.property,
119
- .token.tag,
120
- .token.boolean,
121
- .token.number,
122
- .token.function-name,
123
- .token.constant,
124
- .token.symbol,
125
- .token.deleted {
126
- color: #c92c2c; }
127
-
128
- .token.selector,
129
- .token.attr-name,
130
- .token.string,
131
- .token.char,
132
- .token.function,
133
- .token.builtin,
134
- .token.inserted {
135
- color: #2f9c0a; }
136
-
137
- .token.operator,
138
- .token.entity,
139
- .token.url,
140
- .token.variable {
141
- color: #a67f59;
142
- background: rgba(255, 255, 255, 0.5); }
143
-
144
- .token.atrule,
145
- .token.attr-value,
146
- .token.keyword,
147
- .token.class-name {
148
- color: #1990b8; }
149
-
150
- .token.regex,
151
- .token.important {
152
- color: #e90; }
153
-
154
- .language-css .token.string,
155
- .style .token.string {
156
- color: #a67f59; }
157
-
158
- .token.important {
159
- font-weight: normal; }
160
-
161
- .token.bold {
162
- font-weight: bold; }
163
-
164
- .token.italic {
165
- font-style: italic; }
166
-
167
- .token.entity {
168
- cursor: help; }
169
-
170
- .namespace {
171
- opacity: .7; }
172
-
173
- @media screen and (max-width: 767px) {
174
- pre[class*="language-"]:before,
175
- pre[class*="language-"]:after {
176
- bottom: 14px;
177
- -webkit-box-shadow: none;
178
- box-shadow: none; } }
179
-
180
- /* Plugin styles */
181
- .token.tab:not(:empty):before,
182
- .token.cr:before,
183
- .token.lf:before {
184
- color: #e0d7d1; }
185
-
186
- /* Plugin styles: Line Numbers */
187
- pre[class*="language-"].line-numbers.line-numbers {
188
- padding-left: 0; }
189
-
190
- pre[class*="language-"].line-numbers.line-numbers code {
191
- padding-left: 3.8em; }
192
-
193
- pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows {
194
- left: 0; }
195
-
196
- /* Plugin styles: Line Highlight */
197
- pre[class*="language-"][data-line] {
198
- padding-top: 0;
199
- padding-bottom: 0;
200
- padding-left: 0; }
201
-
202
- pre[data-line] code {
203
- position: relative;
204
- padding-left: 4em; }
205
-
206
- pre .line-highlight {
207
- margin-top: 0; }
208
-
209
- div.code-toolbar {
210
- position: relative; }
211
-
212
- div.code-toolbar > .toolbar {
213
- position: absolute;
214
- top: .3em;
215
- right: .2em;
216
- -webkit-transition: opacity 0.3s ease-in-out;
217
- transition: opacity 0.3s ease-in-out;
218
- opacity: 0; }
219
-
220
- div.code-toolbar:hover > .toolbar {
221
- opacity: 1; }
222
-
223
- div.code-toolbar > .toolbar .toolbar-item {
224
- display: inline-block; }
225
-
226
- div.code-toolbar > .toolbar a {
227
- cursor: pointer; }
228
-
229
- div.code-toolbar > .toolbar button {
230
- background: none;
231
- border: 0;
232
- color: inherit;
233
- font: inherit;
234
- line-height: normal;
235
- overflow: visible;
236
- padding: 0;
237
- -webkit-user-select: none;
238
- /* for button */
239
- -moz-user-select: none;
240
- -ms-user-select: none; }
241
-
242
- div.code-toolbar > .toolbar a,
243
- div.code-toolbar > .toolbar button,
244
- div.code-toolbar > .toolbar span {
245
- /* color: #bbb;
246
- font-size: .8em;
247
- padding: 0 .5em;
248
- background: #f5f2f0;
249
- background: rgba(224, 224, 224, 0.2);
250
- box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
251
- border-radius: .5em; */ }
252
-
253
- div.code-toolbar > .toolbar a:hover,
254
- div.code-toolbar > .toolbar a:focus,
255
- div.code-toolbar > .toolbar button:hover,
256
- div.code-toolbar > .toolbar button:focus,
257
- div.code-toolbar > .toolbar span:hover,
258
- div.code-toolbar > .toolbar span:focus {
259
- text-decoration: none; }
260
-
261
- pre[class*="language-"] > code {
262
- margin: 0 0 1rem;
263
- padding: 1.5rem;
264
- border-left: 0;
265
- border-radius: 4px;
266
- background: #f6f6f5;
267
- -webkit-box-shadow: 0 0 0 1px #dfdfdf;
268
- box-shadow: 0 0 0 1px #dfdfdf; }
269
-
270
- code[class*="language-"],
271
- pre[class*="language-"] {
272
- position: relative;
273
- color: #5c5c5c;
274
- font-family: Inconsolata, "Roboto Mono", Consolas, Menlo, Monaco, "Ubuntu Mono", "DejaVu Sans Mono", monospace;
275
- font-weight: normal; }
276
-
277
- :not(pre) > code[class*="language-"],
278
- pre[class*="language-"] {
279
- margin-top: 0;
280
- margin-bottom: 0; }
281
-
282
- pre[class*="language-"]::before,
283
- pre[class*="language-"]::after {
284
- display: none; }
285
-
286
- pre[class*="language-"] > code {
287
- margin: 0 0 2rem;
288
- padding-top: 3rem;
289
- border-left: 0;
290
- background-image: none;
291
- -webkit-box-shadow: none;
292
- box-shadow: none; }
293
-
294
- .prism-show-language {
295
- margin-bottom: 0.75rem;
296
- font-size: 0.889rem; }
297
-
298
- .clipboard-copy {
299
- display: none; }
300
-
301
- div.code-toolbar > .toolbar {
302
- position: absolute;
303
- top: 0rem;
304
- width: 100%;
305
- font-family: "Open Sans", "Gill Sans MT", "Gill Sans", Corbel, Arial, sans-serif;
306
- font-size: 1rem;
307
- opacity: 1;
308
- z-index: 1; }
309
- div.code-toolbar > .toolbar a {
310
- padding: 0.375rem 0.625rem;
311
- text-decoration: none; }
312
- div.code-toolbar > .toolbar .toolbar-item:first-of-type {
313
- position: absolute;
314
- top: 0.75rem;
315
- left: 1.75rem;
316
- color: #8f8f8f;
317
- font-size: .875em;
318
- letter-spacing: .08em;
319
- text-transform: uppercase;
320
- -webkit-box-shadow: none;
321
- box-shadow: none; }
322
- div.code-toolbar > .toolbar .toolbar-item:nth-of-type(2) {
323
- display: none;
324
- position: absolute;
325
- top: 0.5rem;
326
- right: 0.5rem;
327
- padding: .2em;
328
- -webkit-transition: opacity 0.08s ease;
329
- transition: opacity 0.08s ease;
330
- border-radius: 3px;
331
- background: #fff;
332
- font-size: .8em;
333
- -webkit-box-shadow: 0 2px 0 0 #b9c4ca;
334
- box-shadow: 0 2px 0 0 #b9c4ca;
335
- opacity: .6; }
336
- @media screen and (min-width: 1024px) {
337
- div.code-toolbar > .toolbar .toolbar-item:nth-of-type(2) {
338
- display: block; } }
339
- div.code-toolbar > .toolbar .toolbar-item:nth-of-type(2):hover {
340
- opacity: 1; }
341
-
342
- .language-name {
343
- display: none; }
344
-
14
+ pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
15
+ Theme: StackOverflow Light
16
+ Description: Light theme as used on stackoverflow.com
17
+ Author: stackoverflow.com
18
+ Maintainer: @Hirse
19
+ Website: https://github.com/StackExchange/Stacks
20
+ License: MIT
21
+ Updated: 2021-05-15
22
+
23
+ Updated for @stackoverflow/stacks v0.64.0
24
+ Code Blocks: /blob/v0.64.0/lib/css/components/_stacks-code-blocks.less
25
+ Colors: /blob/v0.64.0/lib/css/exports/_stacks-constants-colors.less
26
+ */.hljs{color:#2f3337;background:#f6f6f6}.hljs-subst{color:#2f3337}.hljs-comment{color:#656e77}.hljs-attr,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-section,.hljs-selector-tag{color:#015692}.hljs-attribute{color:#803378}.hljs-name,.hljs-number,.hljs-quote,.hljs-selector-id,.hljs-template-tag,.hljs-type{color:#b75501}.hljs-selector-class{color:#015692}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-string,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#54790d}.hljs-meta,.hljs-selector-pseudo{color:#015692}.hljs-built_in,.hljs-literal,.hljs-title{color:#b75501}.hljs-bullet,.hljs-code{color:#535a60}.hljs-meta .hljs-string{color:#54790d}.hljs-deletion{color:#c02d2e}.hljs-addition{color:#2f6f44}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
345
27
  </style>
346
28
  </head>
@@ -1,5 +1,3 @@
1
- {% from "_macro.load-component-template.njk" import loadComponentTemplate %}
2
-
3
1
  {% from "components/accordion/_macro.accordion.njk"
4
2
  import componentAccordion %}
5
3
  {% from "components/accordion-history/_macro.accordion-history.njk"
@@ -126,8 +124,10 @@ import componentTree %}
126
124
  <div class="py-base">
127
125
  <h2 class="mb-sm font-bold">Parámetros del componente</h2>
128
126
  {% from "_macro.load-component-params.njk" import loadComponentParams %}
129
- {% set componentYaml %}{{ loadComponentParams(exampleComponent) }}{% endset %}
130
- <pre><code class="language-yaml text-sm">{{ componentYaml | e }}</code></pre>
127
+ <pre>
128
+ <code class="language-yaml hljs text-sm">{{ loadComponentParams(exampleComponent) | highlight("yaml") | safe }}
129
+ </code>
130
+ </pre>
131
131
  </div>
132
132
  </div>
133
133
  {% endcall %}
@@ -255,19 +255,44 @@ import componentTree %}
255
255
  {% set nunjucksContent %}
256
256
  {% if example.data.caller %}
257
257
  {% from "_macro.render-caller.njk" import renderCaller %}
258
- {% set callerHtml %}{{ renderCaller(example.data.caller | safe) }}{% endset %}
259
- <pre><code class="language-twig text-sm">{% raw %}{# {% endraw %}Borra el parámetro "caller" y la coma de la línea precedente y usa sólamente el código entre el "call" y el "endcall"{% raw %} #} {% endraw %}
258
+ {% set callerHtml %}{{ renderCaller(example.data.caller) }}{% endset %}
259
+ {% set callerNunjucks %}
260
260
  {% raw %}{%{% endraw %} from "components/{{ exampleComponent }}/_macro.{{ exampleComponent }}.njk" import component{{ exampleComponent | replace("-", " ") | title | replace(" ","") }}{% raw %} %}{% endraw %}
261
- {% raw %}{% {% endraw %}call component{{ exampleComponent | replace("-", " ") | title | replace(" ","") }}({{ example.data | dump(2) }}) {% raw %} %}{% endraw %}
262
- {{ callerHtml | e }}{% raw %}{% {% endraw %}endcall{% raw %} %}{% endraw %}</code></pre>
261
+ {% raw %}{% {% endraw %}call component{{ exampleComponent | replace("-", " ") | title | replace(" ","") }} {% endset %}
262
+ {{ componentButton({
263
+ "text": "Copiar código",
264
+ "classes": "c-button--sm c-button--transparent mb-sm",
265
+ "attributes": {
266
+ "data-module": "c-button-copy"
267
+ }
268
+ }) }}
269
+ <pre><code class="language-js hljs text-sm">
270
+ {{ callerNunjucks | highlight("js") | safe }}({{ example.data | filtercaller | dump(2) | highlight("js") | safe }}){% raw %} %}{% endraw %}
271
+ {{ callerHtml | highlight("html") | safe }}
272
+ {% raw %}{%{% endraw %} endcall {% raw %} %}{% endraw %}</code></pre>
263
273
  {% else %}
264
- <pre><code class="language-twig text-sm">{% raw %}{%{% endraw %} from "components/{{ exampleComponent }}/_macro.{{ exampleComponent }}.njk" import component{{ exampleComponent | replace("-", " ") | title | replace(" ","") }}{% raw %} %}{% endraw %}
265
- {% raw %}{{ {% endraw %}component{{ exampleComponent | replace("-", " ") | title | replace(" ","") }}({{ example.data | dump(2) }}) {% raw %} }}{% endraw %}</code></pre>
274
+ {{ componentButton({
275
+ "text": "Copiar código",
276
+ "classes": "c-button--sm c-button--transparent mb-sm",
277
+ "attributes": {
278
+ "data-module": "c-button-copy"
279
+ }
280
+ }) }}
281
+ <pre class="hljs"><code class="language-js hljs text-sm">{{- getNunjucksCodeFromExample(exampleComponent, example.data, 'component') | highlight("twig") | safe -}}</code></pre>
266
282
  {% endif %}
267
283
  {% endset %}
268
284
  {% set htmlContent %}
269
- {% set componentHtml %}{{ loadComponentTemplate(exampleComponent, example.data) }}{% endset %}
270
- <pre><code class="language-markup text-sm">{{ componentHtml | e }}</code></pre>
285
+ {{ componentButton({
286
+ "text": "Copiar código",
287
+ "classes": "c-button--sm c-button--transparent mb-sm",
288
+ "attributes": {
289
+ "data-module": "c-button-copy"
290
+ }
291
+ }) }}
292
+ <pre class="hljs"><code class="language-html hljs text-sm">
293
+ {{- getHTMLCodeFromExample(exampleComponent, example.data, 'component') | highlight("html") | safe -}}
294
+ </code>
295
+ </pre>
271
296
  {% endset %}
272
297
  {% call componentDetails({
273
298
  "summary": {
@@ -283,13 +308,13 @@ import componentTree %}
283
308
  {
284
309
  "text": "Nunjucks macro",
285
310
  "panel": {
286
- "html": nunjucksContent | trim | safe
311
+ "html": nunjucksContent | trim
287
312
  }
288
313
  },
289
314
  {
290
315
  "text": "HTML",
291
316
  "panel": {
292
- "html": htmlContent | trim | safe
317
+ "html": htmlContent | trim
293
318
  }
294
319
  }
295
320
  ]
@@ -1,3 +1,3 @@
1
1
  {% macro renderCaller(params) %}
2
- {{ params | safe | indent(4) }}
3
- {% endmacro %}
2
+ {{ params | safe }}
3
+ {% endmacro %}
@@ -0,0 +1,57 @@
1
+ {% from "components/button/_macro.button.njk"
2
+ import componentButton %}
3
+ {% from "components/details/_macro.details.njk"
4
+ import componentDetails %}
5
+ {% from "components/tabs/_macro.tabs.njk"
6
+ import componentTabs %}
7
+
8
+ {% macro showCodeFromFile(filePath) %}
9
+ {% set nunjucksContent %}
10
+ {{ componentButton({
11
+ "html": 'Copiar código<span class="sr-only">Nunjucks del ejemplo: ' + filePath + '</span>',
12
+ "classes": "c-button--sm c-button--transparent mb-sm",
13
+ "attributes": {
14
+ "data-module": "c-button-copy"
15
+ }
16
+ }) }}
17
+ <pre class="hljs"><code class="language-js hljs text-sm">{{- getNunjucksCodeFromFile(filePath) | highlight("twig") | safe -}}</code></pre>
18
+ {% endset %}
19
+ {% set htmlContent %}
20
+ {{ componentButton({
21
+ "html": 'Copiar código<span class="sr-only">HTML del ejemplo: ' + filePath + '</span>',
22
+ "classes": "c-button--sm c-button--transparent mb-sm",
23
+ "attributes": {
24
+ "data-module": "c-button-copy"
25
+ }
26
+ }) }}
27
+ <pre class="hljs"><code class="language-html hljs text-sm">
28
+ {{- getHTMLCodeFromFile(filePath) | highlight("html") | safe -}}
29
+ </code></pre>
30
+ {% endset %}
31
+ {% call componentDetails({
32
+ "summary": {
33
+ "html": 'Mostrar código<span class="sr-only">del ejemplo: ' + filePath + '</span>',
34
+ "classes": "c-link text-sm"
35
+ }
36
+ }) %}
37
+ {{ componentTabs({
38
+ "tablistAriaLabel": "Tab example",
39
+ "idPrefix": "tab-" + filePath | replace("/", "-") | replace("_", "") | replace(".", "-"),
40
+ "classes": "c-tabs--scroll",
41
+ "items": [
42
+ {
43
+ "text": "Nunjucks macro",
44
+ "panel": {
45
+ "html": nunjucksContent | trim
46
+ }
47
+ },
48
+ {
49
+ "text": "HTML",
50
+ "panel": {
51
+ "html": htmlContent | trim
52
+ }
53
+ }
54
+ ]
55
+ }) }}
56
+ {% endcall %}
57
+ {% endmacro %}
@@ -7,7 +7,7 @@
7
7
  {% endblock %}
8
8
  {% from "_macro.example-render.njk" import exampleRender %}
9
9
  {{ exampleRender({
10
- data: exampleData
10
+ data: exampleData
11
11
  }) }}
12
12
  </main>
13
13
  {% include "_global.foot.njk" %}
package/docs/estilos.html CHANGED
@@ -1,17 +1,18 @@
1
1
  {% set title = "Estilos: colores, espaciado, retícula y tipografía. Documentación de desy-html. Gobierno de Aragón" %}
2
2
  {% extends "_template.default.njk" %}
3
+
3
4
  {% block contentBlock %}
4
- <div class="pb-lg"></div>
5
- <div class="c-h1">Estilos</div>
6
- <div class="pb-lg"></div>
7
- {% include "ds/_ds.section.color.njk" %}
8
- <div class="pb-2xl"></div>
9
- {% include "ds/_ds.section.espaciado.njk" %}
10
- <div class="pb-2xl"></div>
11
- {% include "ds/_ds.section.layout.njk" %}
12
- <div class="pb-2xl"></div>
13
- {% include "ds/_ds.section.textos.njk" %}
14
- <div class="pb-2xl"></div>
15
- {% include "ds/_ds.section.typography.njk" %}
16
- <div class="pb-2xl"></div>
17
- {% endblock %}
5
+ <div class="pb-lg"></div>
6
+ <div class="c-h1">Estilos</div>
7
+ <div class="pb-lg"></div>
8
+ {% include "ds/_ds.section.color.njk" %}
9
+ <div class="pb-2xl"></div>
10
+ {% include "ds/_ds.section.espaciado.njk" %}
11
+ <div class="pb-2xl"></div>
12
+ {% include "ds/_ds.section.layout.njk" %}
13
+ <div class="pb-2xl"></div>
14
+ {% include "ds/_ds.section.textos.njk" %}
15
+ <div class="pb-2xl"></div>
16
+ {% include "ds/_ds.section.typography.njk" %}
17
+ <div class="pb-2xl"></div>
18
+ {% endblock %}
package/docs/index.html CHANGED
@@ -38,6 +38,18 @@
38
38
 
39
39
  <h2>Changelog (English)</h2>
40
40
  <p>What's new in the latest version of desy-html</p>
41
+ <h3>v.8.0.1</h3>
42
+ <ul class="text-sm">
43
+ <li>Fixed a bug in examples Nunjucks code.</li>
44
+ </ul>
45
+ <h3>v.8.0.0</h3>
46
+ <ul class="text-sm">
47
+ <li>Improved indentation in examples.</li>
48
+ <li>Added functions to show source code in Nunjucks and HTML.</li>
49
+ <li>Removed Prism.</li>
50
+ <li>Fixed a bug in telephone link in footer.</li>
51
+ <li>Fixed an example of Searchbar with button breaking line.</li>
52
+ </ul>
41
53
  <h3>v.7.4.0</h3>
42
54
  <ul class="text-sm">
43
55
  <li>Translated examples to español.</li>
package/gulpfile.js CHANGED
@@ -19,14 +19,28 @@ const SOURCE_HTML_DIR = './docs/**.html';
19
19
  const SOURCE_NUNJUCKS_PATHS = ['./src/templates/','./docs/'];
20
20
  const SOURCE_NUNJUCKS_FILES = ['./src/templates/**/*','./docs/**/*'];
21
21
  const SOURCE_NUNJUCKS_DIR = './docs/**/*.html';
22
- const SOURCE_JS_DIR = './src/**/**.js';
22
+ const SOURCE_JS_FILES = ['./src/**/**.js','!./src/js/globals/**', '!./src/js/filters/**'];
23
23
  const SOURCE_STYLESHEET = './src/css/styles.css';
24
24
  const SOURCE_STYLESHEET_DIR = './src/**/*.css';
25
+ const SOURCE_NUNJUCKS_GLOBALS = require('./src/js/globals/index.js');
26
+ const SOURCE_NUNJUCKS_FILTERS = require('./src/js/filters/index.js');
25
27
  const DESTINATION_HTML_DIR = './dist/';
26
28
  const DESTINATION_JS_DIR = './dist/';
27
29
  const DESTINATION_STYLESHEET = './dist/css/';
28
30
 
29
31
 
32
+ const manageEnvironment = function(environment) {
33
+ // Custom globals
34
+ for (const key in SOURCE_NUNJUCKS_GLOBALS) {
35
+ environment.addGlobal(key, SOURCE_NUNJUCKS_GLOBALS[key])
36
+ }
37
+
38
+ // Custom filters
39
+ for (const key in SOURCE_NUNJUCKS_FILTERS) {
40
+ environment.addFilter(key, SOURCE_NUNJUCKS_FILTERS[key])
41
+ }
42
+ }
43
+
30
44
  function bs(cb) {
31
45
  browserSync.init({
32
46
  server: {
@@ -40,7 +54,7 @@ function bs(cb) {
40
54
 
41
55
 
42
56
  function watchFiles(cb) {
43
- gulp.watch([TAILWIND_CONFIG, SOURCE_STYLESHEET_DIR, SOURCE_HTML_DIR, SOURCE_JS_DIR, SOURCE_NUNJUCKS_DIR, ...SOURCE_NUNJUCKS_FILES], gulp.series(html, nunjucks, js, css, reload));
57
+ gulp.watch([TAILWIND_CONFIG, SOURCE_STYLESHEET_DIR, SOURCE_HTML_DIR, ...SOURCE_JS_FILES, SOURCE_NUNJUCKS_DIR, ...SOURCE_NUNJUCKS_FILES], gulp.series(html, nunjucks, js, css, reload));
44
58
  cb();
45
59
  }
46
60
 
@@ -82,6 +96,7 @@ function nunjucks() {
82
96
  lstripBlocks: true,
83
97
  noCache: true
84
98
  },
99
+ manageEnv: manageEnvironment,
85
100
  path: SOURCE_NUNJUCKS_PATHS // String or Array
86
101
  }))
87
102
  .pipe(gulp.dest(DESTINATION_HTML_DIR));
@@ -89,7 +104,7 @@ function nunjucks() {
89
104
 
90
105
 
91
106
  function js() {
92
- return gulp.src(SOURCE_JS_DIR)
107
+ return gulp.src(SOURCE_JS_FILES)
93
108
  .pipe(gulp.dest(DESTINATION_JS_DIR));
94
109
  }
95
110
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desy-html",
3
- "version": "7.4.0",
3
+ "version": "8.0.1",
4
4
  "description": "desy-html contains the code you need to start building a user interface for Gobierno de Aragón government webapps.",
5
5
  "author": {
6
6
  "name": "Desy (SDA Servicios Digitales de Aragón)",
@@ -37,6 +37,7 @@
37
37
  "@tailwindcss/typography": "^0.5.7",
38
38
  "autoprefixer": "^10.0.2",
39
39
  "hex-rgb": "^5.0.0",
40
+ "highlight.js": "^11.7.0",
40
41
  "npm-run-all": "^4.1.5",
41
42
  "postcss": "^8.2.15",
42
43
  "postcss-cli": "^10.0.0",
@@ -51,7 +52,9 @@
51
52
  "gulp-footer": "^2.0.2",
52
53
  "gulp-nunjucks-render": "^2.2.3",
53
54
  "gulp-postcss": "^9.0.1",
54
- "gulp-strip-css-comments": "^2.0.0"
55
+ "gulp-strip-css-comments": "^2.0.0",
56
+ "js-beautify": "^1.14.7",
57
+ "outdent": "^0.8.0"
55
58
  },
56
59
  "optionalDependencies": {
57
60
  "win-node-env": "^0.6.1"
@@ -42,4 +42,4 @@
42
42
  @import "./component.headroom.css";
43
43
 
44
44
  /* Framework utilities */
45
- @import "tailwindcss/utilities";
45
+ @import "tailwindcss/utilities";
@@ -0,0 +1,6 @@
1
+ function filterCaller (params) {
2
+ delete params.caller;
3
+ return params
4
+ }
5
+
6
+ module.exports = filterCaller
@@ -0,0 +1,14 @@
1
+ const hljs = require('highlight.js')
2
+
3
+ /**
4
+ * Format code with syntax highlighting
5
+ *
6
+ * @param {string} code - Code in plain text
7
+ * @param {string} [language] - Code programming language
8
+ * @returns {string} Code with syntax highlighting
9
+ */
10
+ function highlight (code, language) {
11
+ return hljs.highlight(code.trim(), { language: language || 'plaintext' }).value
12
+ }
13
+
14
+ module.exports = highlight
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Nunjucks filters
3
+ */
4
+ const highlight = require('./highlight')
5
+ const filtercaller = require('./filter-caller')
6
+
7
+ module.exports = {
8
+ highlight,
9
+ filtercaller
10
+ }
@@ -0,0 +1,29 @@
1
+ const beautify = require('js-beautify')
2
+ /**
3
+ * Component HTML code (formatted)
4
+ *
5
+ * @param {string} componentName - Component name
6
+ * @param {unknown} params - Component macro params
7
+ * @param {unknown} pathName - path name
8
+ */
9
+ function getHTMLCodeFromExample (componentName, params, pathName) {
10
+ const templatePath = `${pathName}s/${componentName}/_template.${componentName}.njk`;
11
+
12
+ // Render to HTML
13
+ const html = this.env.render(templatePath, { params }).trim()
14
+
15
+ // Default beautify options
16
+ const options = beautify.html.defaultOptions()
17
+
18
+ return beautify.html(html, {
19
+ indent_size: 2,
20
+ // Ensure nested labels in headings are indented properly
21
+ inline: options.inline.filter((tag) => !['label'].includes(tag)),
22
+ // Remove blank lines
23
+ max_preserve_newlines: 0,
24
+ // Ensure attribute wrapping in header SVG is preserved
25
+ wrap_attributes: 'preserve'
26
+ })
27
+ }
28
+
29
+ module.exports = getHTMLCodeFromExample
@@ -0,0 +1,26 @@
1
+ const beautify = require('js-beautify')
2
+ /**
3
+ * Component HTML code (formatted)
4
+ *
5
+ * @param {string} templatePath - Path to nunjucks file. Eg: `includes/_loremipsum-large.njk`;
6
+ */
7
+ function getHTMLCodeFromFile (templatePath) {
8
+
9
+ // Render to HTML
10
+ const html = this.env.render(templatePath).trim()
11
+
12
+ // Default beautify options
13
+ const options = beautify.html.defaultOptions()
14
+
15
+ return beautify.html(html, {
16
+ indent_size: 2,
17
+ // Ensure nested labels in headings are indented properly
18
+ inline: options.inline.filter((tag) => !['label'].includes(tag)),
19
+ // Remove blank lines
20
+ max_preserve_newlines: 0,
21
+ // Ensure attribute wrapping in header SVG is preserved
22
+ wrap_attributes: 'preserve'
23
+ })
24
+ }
25
+
26
+ module.exports = getHTMLCodeFromFile
@@ -0,0 +1,32 @@
1
+ const { outdent } = require('outdent')
2
+
3
+
4
+ /**
5
+ * Component Nunjucks code (formatted)
6
+ *
7
+ * @param {string} componentName - Component name
8
+ * @param {unknown} params - Component macro params
9
+ * @returns {string} Nunjucks code
10
+ */
11
+ function getNunjucksCodeFromExample (componentName, params, pathName) {
12
+ const macroName = kebabCaseToPascalCase(componentName)
13
+
14
+ return outdent`
15
+ {% from "${pathName}s/${componentName}/_macro.${componentName}.njk" import ${pathName}${macroName} %}
16
+
17
+ {{ ${pathName}${macroName}(${
18
+ JSON.stringify(params, undefined, 2)
19
+ }) }}
20
+ `
21
+ }
22
+
23
+ function kebabCaseToPascalCase (value) {
24
+ return value
25
+ .toLowerCase()
26
+ .split('-')
27
+ // capitalize each 'word'
28
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
29
+ .join('')
30
+ }
31
+
32
+ module.exports = getNunjucksCodeFromExample
@@ -0,0 +1,24 @@
1
+ const { outdent } = require('outdent')
2
+
3
+ /**
4
+ * Component Nunjucks code (formatted)
5
+ * Uses node.js to read the content of a file, display it as code.
6
+ * @param {string} templatePath - Path to nunjucks file. Eg: `includes/_loremipsum-large.njk`;
7
+ * @returns {string} Nunjucks code
8
+ */
9
+ function getNunjucksCodeFromFile (templatePath) {
10
+ const fs = require('fs');
11
+ let codeFromFile
12
+
13
+ try {
14
+ codeFromFile = fs.readFileSync(`src/templates/${templatePath}`, 'utf8');
15
+ } catch (err) {
16
+ console.error(err);
17
+ }
18
+
19
+ return outdent`
20
+ ${codeFromFile}
21
+ `
22
+ }
23
+
24
+ module.exports = getNunjucksCodeFromFile
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Nunjucks globals
3
+ */
4
+ const getHTMLCodeFromExample = require('./get-html-code-from-example.js')
5
+ const getNunjucksCodeFromExample = require('./get-nunjucks-code-from-example.js')
6
+ const getHTMLCodeFromFile = require('./get-html-code-from-file.js')
7
+ const getNunjucksCodeFromFile = require('./get-nunjucks-code-from-file.js')
8
+
9
+ module.exports = {
10
+ getNunjucksCodeFromExample,
11
+ getHTMLCodeFromExample,
12
+ getNunjucksCodeFromFile,
13
+ getHTMLCodeFromFile
14
+ }
package/src/js/index.js CHANGED
@@ -41,3 +41,24 @@ notificationComponent(aria);
41
41
  radioButtonComponent(aria);
42
42
  checkBoxComponent(aria);
43
43
 
44
+
45
+ //Using the browser API to copy code to the clipboard
46
+ const copyButtons = document.querySelectorAll('[data-module = "c-button-copy"]');
47
+ copyButtons.forEach(button => {
48
+ button.addEventListener("click", async (event) => {
49
+ await copyCode(button);
50
+ });
51
+ });
52
+
53
+ async function copyCode(button) {
54
+ const code = button.nextElementSibling.innerText;
55
+ await navigator.clipboard.writeText(code);
56
+ setTimeout(() => {
57
+ button.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" class="self-center mr-2" aria-hidden="true" width="1em" height="1em"><path d="M13.714 42.857A6.857 6.857 0 0 1 8.4 40.183L.857 31.646a3.429 3.429 0 0 1 .309-4.869A3.429 3.429 0 0 1 6 27.12l7.063 7.989a.72.72 0 0 0 .617.308.789.789 0 0 0 .617-.274L42.103 6.206a3.429 3.429 0 0 1 4.937 4.731L18.926 40.526a6.651 6.651 0 0 1-5.212 2.331Z" fill="currentColor"></path></svg> Copiado';
58
+ },100)
59
+
60
+ setTimeout(() => {
61
+ button.innerHTML = "Copiar código";
62
+ },2500)
63
+
64
+ }
@@ -73,7 +73,7 @@ text-neutral-dark {{ params.classes if params.classes }}"
73
73
  <a
74
74
  class="c-link c-link--neutral"
75
75
  href="https://www.aragon.es/"
76
- >Gobierno de Aragón</a>. Edificio Pignatelli. <abbr title="Paseo">Pº</abbr> María Agustín, 36. 50004 - Zaragoza - <abbr title="Teléfono">Tel.</abbr> <a href="tel:+976714000" class="c-link c-link--neutral">976 714 000</a>
76
+ >Gobierno de Aragón</a>. Edificio Pignatelli. <abbr title="Paseo">Pº</abbr> María Agustín, 36. 50004 - Zaragoza - <abbr title="Teléfono">Tel.</abbr> <a href="tel:+34976714000" class="c-link c-link--neutral">976 714 000</a>
77
77
  </p>
78
78
  </div>
79
79
  {% endif %}
@@ -148,7 +148,8 @@
148
148
  }
149
149
  },
150
150
  {
151
- "name": "with pattern attribute",
151
+ "name": "con al atributo pattern",
152
+ "description": 'Usa el atributo <code>pattern</code> para elegir un patrón de entrada de datos nativo del navegador.',
152
153
  "data": {
153
154
  "label": {
154
155
  "text": "Solo números"
@@ -77,7 +77,7 @@
77
77
  "type": "submit",
78
78
  "classes": "c-button--primary ml-sm"
79
79
  },
80
- "classes": "flex-1"
80
+ "classes": "flex-1 pr-sm"
81
81
  }
82
82
  },
83
83
  {
@@ -93,7 +93,7 @@
93
93
  "type": "submit",
94
94
  "classes": "c-button--sm ml-sm"
95
95
  },
96
- "classes": "flex-1 c-input--sm"
96
+ "classes": "flex-1 pr-sm c-input--sm"
97
97
  }
98
98
  }
99
99
  ] %}
@@ -1,7 +0,0 @@
1
- /*!
2
- * clipboard.js v2.0.4
3
- * https://zenorocha.github.io/clipboard.js
4
- *
5
- * Licensed MIT © Zeno Rocha
6
- */
7
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=o(n(1)),c=o(n(3)),u=o(n(4));function o(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return n.resolveOptions(e),n.listenClick(t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,c.default),i(o,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===r(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,u.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return s("action",t)}},{key:"defaultTarget",value:function(t){var e=s("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return s("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),o}();function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=l},function(t,e,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=n(2),c=(o=a)&&o.__esModule?o:{default:o};var u=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return i(e,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,c.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,c.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();t.exports=u},function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var d=n(5),h=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!d.string(e))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(t))return s=e,f=n,(l=t).addEventListener(s,f),{destroy:function(){l.removeEventListener(s,f)}};if(d.nodeList(t))return a=t,c=e,u=n,Array.prototype.forEach.call(a,function(t){t.addEventListener(c,u)}),{destroy:function(){Array.prototype.forEach.call(a,function(t){t.removeEventListener(c,u)})}};if(d.string(t))return o=t,r=e,i=n,h(document.body,o,r,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,a,c,u,l,s,f}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(7);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])});
@@ -1 +0,0 @@
1
- !function(){if("undefined"!=typeof self&&self.Prism&&self.document)if(Prism.plugins.toolbar){var r=window.ClipboardJS||void 0;r||"function"!=typeof require||(r=require("clipboard"));var i=[];if(!r){var o=document.createElement("script"),e=document.querySelector("head");o.onload=function(){if(r=window.ClipboardJS)for(;i.length;)i.pop()()},o.src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js",e.appendChild(o)}Prism.plugins.toolbar.registerButton("copy-to-clipboard",function(e){var t=document.createElement("button");return t.textContent="Copy",r?o():i.push(o),t;function o(){var o=new r(t,{text:function(){return e.code}});o.on("success",function(){t.textContent="Copied!",n()}),o.on("error",function(){t.textContent="Press Ctrl+C to copy",n()})}function n(){setTimeout(function(){t.textContent="Copy"},5e3)}})}else console.warn("Copy to Clipboard plugin loaded before Toolbar plugin.")}();
@@ -1 +0,0 @@
1
- !function(){var i=Object.assign||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e};function e(e){this.defaults=i({},e)}function l(e){for(var n=0,t=0;t<e.length;++t)e.charCodeAt(t)=="\t".charCodeAt(0)&&(n+=3);return e.length+n}e.prototype={setDefaults:function(e){this.defaults=i(this.defaults,e)},normalize:function(e,n){for(var t in n=i(this.defaults,n)){var r=t.replace(/-(\w)/g,function(e,n){return n.toUpperCase()});"normalize"!==t&&"setDefaults"!==r&&n[t]&&this[r]&&(e=this[r].call(this,e,n[t]))}return e},leftTrim:function(e){return e.replace(/^\s+/,"")},rightTrim:function(e){return e.replace(/\s+$/,"")},tabsToSpaces:function(e,n){return n=0|n||4,e.replace(/\t/g,new Array(++n).join(" "))},spacesToTabs:function(e,n){return n=0|n||4,e.replace(RegExp(" {"+n+"}","g"),"\t")},removeTrailing:function(e){return e.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(e){return e.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(e){var n=e.match(/^[^\S\n\r]*(?=\S)/gm);return n&&n[0].length?(n.sort(function(e,n){return e.length-n.length}),n[0].length?e.replace(RegExp("^"+n[0],"gm"),""):e):e},indent:function(e,n){return e.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++n).join("\t")+"$&")},breakLines:function(e,n){n=!0===n?80:0|n||80;for(var t=e.split("\n"),r=0;r<t.length;++r)if(!(l(t[r])<=n)){for(var i=t[r].split(/(\s+)/g),o=0,a=0;a<i.length;++a){var s=l(i[a]);n<(o+=s)&&(i[a]="\n"+i[a],o=s)}t[r]=i.join("")}return t.join("\n")}},"undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"!=typeof Prism&&(Prism.plugins.NormalizeWhitespace=new e({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(e){var n=Prism.plugins.NormalizeWhitespace;if(!e.settings||!1!==e.settings["whitespace-normalization"])if(e.element&&e.element.parentNode||!e.code){var t=e.element.parentNode,r=/(?:^|\s)no-whitespace-normalization(?:\s|$)/;if(e.code&&t&&"pre"===t.nodeName.toLowerCase()&&!r.test(t.className)&&!r.test(e.element.className)){for(var i=t.childNodes,o="",a="",s=!1,l=0;l<i.length;++l){var c=i[l];c==e.element?s=!0:"#text"===c.nodeName&&(s?a+=c.nodeValue:o+=c.nodeValue,t.removeChild(c),--l)}if(e.element.children.length&&Prism.plugins.KeepMarkup){var u=o+e.element.innerHTML+a;e.element.innerHTML=n.normalize(u,e.settings),e.code=e.element.textContent}else e.code=o+e.code+a,e.code=n.normalize(e.code,e.settings)}}else e.code=n.normalize(e.code,e.settings)}))}();
@@ -1 +0,0 @@
1
- !function(){if("undefined"!=typeof self&&self.Prism&&self.document){var i=[],l={},c=function(){};Prism.plugins.toolbar={};var e=Prism.plugins.toolbar.registerButton=function(e,n){var t;t="function"==typeof n?n:function(e){var t;return"function"==typeof n.onClick?((t=document.createElement("button")).type="button",t.addEventListener("click",function(){n.onClick.call(this,e)})):"string"==typeof n.url?(t=document.createElement("a")).href=n.url:t=document.createElement("span"),n.className&&t.classList.add(n.className),t.textContent=n.text,t},e in l?console.warn('There is a button with the key "'+e+'" registered already.'):i.push(l[e]=t)},t=Prism.plugins.toolbar.hook=function(a){var e=a.element.parentNode;if(e&&/pre/i.test(e.nodeName)&&!e.parentNode.classList.contains("code-toolbar")){var t=document.createElement("div");t.classList.add("code-toolbar"),e.parentNode.insertBefore(t,e),t.appendChild(e);var r=document.createElement("div");r.classList.add("toolbar");var n=i,o=function(e){for(;e;){var t=e.getAttribute("data-toolbar-order");if(null!=t)return(t=t.trim()).length?t.split(/\s*,\s*/g):[];e=e.parentElement}}(a.element);o&&(n=o.map(function(e){return l[e]||c})),n.forEach(function(e){var t=e(a);if(t){var n=document.createElement("div");n.classList.add("toolbar-item"),n.appendChild(t),r.appendChild(n)}}),t.appendChild(r)}};e("label",function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-label")){var n,a,r=t.getAttribute("data-label");try{a=document.querySelector("template#"+r)}catch(e){}return a?n=a.content:(t.hasAttribute("data-url")?(n=document.createElement("a")).href=t.getAttribute("data-url"):n=document.createElement("span"),n.textContent=r),n}}),Prism.hooks.add("complete",t)}}();
@@ -1 +0,0 @@
1
- Prism.languages.twig={comment:/\{#[\s\S]*?#\}/,tag:{pattern:/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/,inside:{ld:{pattern:/^(?:\{\{-?|\{%-?\s*\w+)/,inside:{punctuation:/^(?:\{\{|\{%)-?/,keyword:/\w+/}},rd:{pattern:/-?(?:%\}|\}\})$/,inside:{punctuation:/.+/}},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,inside:{punctuation:/^['"]|['"]$/}},keyword:/\b(?:even|if|odd)\b/,boolean:/\b(?:true|false|null)\b/,number:/\b0x[\dA-Fa-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][-+]?\d+)?/,operator:[{pattern:/(\s)(?:and|b-and|b-xor|b-or|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,lookbehind:!0},/[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/],property:/\b[a-zA-Z_]\w*\b/,punctuation:/[()\[\]{}:.,]/}},other:{pattern:/\S(?:[\s\S]*\S)?/,inside:Prism.languages.markup}};
@@ -1 +0,0 @@
1
- !function(n){var t=/[*&][^\s[\]{},]+/,e=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+e.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+e.source+")?)";function a(n,t){t=(t||"").replace(/m/g,"")+"m";var e="([:\\-,[{]\\s*(?:\\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|]|}|\\s*#))".replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return n});return RegExp(e,t)}n.languages.yaml={scalar:{pattern:RegExp("([\\-:]\\s*(?:\\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\\2[^\r\n]+)*)".replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp("((?:^|[:\\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)[^\r\n{[\\]},#\\s]+?(?=\\s*:\\s)".replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:a("\\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*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:a("true|false","i"),lookbehind:!0,alias:"important"},null:{pattern:a("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:a("(\"|')(?:(?!\\2)[^\\\\\r\n]|\\\\.)*\\2"),lookbehind:!0,greedy:!0},number:{pattern:a("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+\\.?\\d*|\\.?\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:e,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml}(Prism);
@@ -1 +0,0 @@
1
- var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,t=0,C={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof N?new N(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function n(e,a){var r,t,s=C.util.type(e);switch(a=a||{},s){case"Object":if(t=C.util.objId(e),a[t])return a[t];for(var i in r={},a[t]=r,e)e.hasOwnProperty(i)&&(r[i]=n(e[i],a));return r;case"Array":return(t=C.util.objId(e),a[t])?a[t]:(r=[],a[t]=r,e.forEach(function(e,t){r[t]=n(e,a)}),r);default:return e}},getLanguage:function(e){for(;e&&!c.test(e.className);)e=e.parentElement;return e?(e.className.match(c)||[,"none"])[1].toLowerCase():"none"},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(e){var t=(/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(e.stack)||[])[1];if(t){var n=document.getElementsByTagName("script");for(var a in n)if(n[a].src==t)return n[a]}return null}}},languages:{extend:function(e,t){var n=C.util.clone(C.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(n,e,t,a){var r=(a=a||C.languages)[n],s={};for(var i in r)if(r.hasOwnProperty(i)){if(i==e)for(var l in t)t.hasOwnProperty(l)&&(s[l]=t[l]);t.hasOwnProperty(i)||(s[i]=r[i])}var o=a[n];return a[n]=s,C.languages.DFS(C.languages,function(e,t){t===o&&e!=n&&(this[e]=s)}),s},DFS:function e(t,n,a,r){r=r||{};var s=C.util.objId;for(var i in t)if(t.hasOwnProperty(i)){n.call(t,i,t[i],a||i);var l=t[i],o=C.util.type(l);"Object"!==o||r[s(l)]?"Array"!==o||r[s(l)]||(r[s(l)]=!0,e(l,n,i,r)):(r[s(l)]=!0,e(l,n,null,r))}}},plugins:{},highlightAll:function(e,t){C.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var a={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};C.hooks.run("before-highlightall",a),a.elements=Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)),C.hooks.run("before-all-elements-highlight",a);for(var r,s=0;r=a.elements[s++];)C.highlightElement(r,!0===t,a.callback)},highlightElement:function(e,t,n){var a=C.util.getLanguage(e),r=C.languages[a];e.className=e.className.replace(c,"").replace(/\s+/g," ")+" language-"+a;var s=e.parentNode;s&&"pre"===s.nodeName.toLowerCase()&&(s.className=s.className.replace(c,"").replace(/\s+/g," ")+" language-"+a);var i={element:e,language:a,grammar:r,code:e.textContent};function l(e){i.highlightedCode=e,C.hooks.run("before-insert",i),i.element.innerHTML=i.highlightedCode,C.hooks.run("after-highlight",i),C.hooks.run("complete",i),n&&n.call(i.element)}if(C.hooks.run("before-sanity-check",i),!i.code)return C.hooks.run("complete",i),void(n&&n.call(i.element));if(C.hooks.run("before-highlight",i),i.grammar)if(t&&u.Worker){var o=new Worker(C.filename);o.onmessage=function(e){l(e.data)},o.postMessage(JSON.stringify({language:i.language,code:i.code,immediateClose:!0}))}else l(C.highlight(i.code,i.grammar,i.language));else l(C.util.encode(i.code))},highlight:function(e,t,n){var a={code:e,grammar:t,language:n};return C.hooks.run("before-tokenize",a),a.tokens=C.tokenize(a.code,a.grammar),C.hooks.run("after-tokenize",a),N.stringify(C.util.encode(a.tokens),a.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var a in n)t[a]=n[a];delete t.rest}var r=new s;return O(r,r.head,e),function e(t,n,a,r,s,i,l){for(var o in a)if(a.hasOwnProperty(o)&&a[o]){var u=a[o];u=Array.isArray(u)?u:[u];for(var c=0;c<u.length;++c){if(l&&l==o+","+c)return;var g=u[c],d=g.inside,p=!!g.lookbehind,f=!!g.greedy,m=0,h=g.alias;if(f&&!g.pattern.global){var v=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,v+"g")}g=g.pattern||g;for(var y=r.next,b=s;y!==n.tail;b+=y.value.length,y=y.next){var F=y.value;if(n.length>t.length)return;if(!(F instanceof N)){var k=1;if(f&&y!=n.tail.prev){g.lastIndex=b;var x=g.exec(t);if(!x)break;var w=x.index+(p&&x[1]?x[1].length:0),A=x.index+x[0].length,P=b;for(P+=y.value.length;P<=w;)y=y.next,P+=y.value.length;if(P-=y.value.length,b=P,y.value instanceof N)continue;for(var S=y;S!==n.tail&&(P<A||"string"==typeof S.value&&!S.prev.value.greedy);S=S.next)k++,P+=S.value.length;k--,F=t.slice(b,P),x.index-=b}else{g.lastIndex=0;var x=g.exec(F)}if(x){p&&(m=x[1]?x[1].length:0);var w=x.index+m,x=x[0].slice(m),A=w+x.length,$=F.slice(0,w),_=F.slice(A),j=y.prev;$&&(j=O(n,j,$),b+=$.length),z(n,j,k);var E=new N(o,d?C.tokenize(x,d):x,h,x,f);if(y=O(n,j,E),_&&O(n,y,_),1<k&&e(t,n,a,y.prev,b,!0,o+","+c),i)break}else if(i)break}}}}}(e,r,t,r.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(r)},hooks:{all:{},add:function(e,t){var n=C.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=C.hooks.all[e];if(n&&n.length)for(var a,r=0;a=n[r++];)a(t)}},Token:N};function N(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length,this.greedy=!!r}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function O(e,t,n){var a=t.next,r={value:n,prev:t,next:a};return t.next=r,a.prev=r,e.length++,r}function z(e,t,n){for(var a=t.next,r=0;r<n&&a!==e.tail;r++)a=a.next;(t.next=a).prev=t,e.length-=r}if(u.Prism=C,N.stringify=function t(e,n){if("string"==typeof e)return e;if(Array.isArray(e)){var a="";return e.forEach(function(e){a+=t(e,n)}),a}var r={type:e.type,content:t(e.content,n),tag:"span",classes:["token",e.type],attributes:{},language:n},s=e.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(r.classes,s):r.classes.push(s)),C.hooks.run("wrap",r);var i="";for(var l in r.attributes)i+=" "+l+'="'+(r.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+i+">"+r.content+"</"+r.tag+">"},!u.document)return u.addEventListener&&(C.disableWorkerMessageHandler||u.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,a=t.code,r=t.immediateClose;u.postMessage(C.highlight(a,C.languages[n],n)),r&&u.close()},!1)),C;var e=C.util.currentScript();function n(){C.manual||C.highlightAll()}if(e&&(C.filename=e.src,e.hasAttribute("data-manual")&&(C.manual=!0)),!C.manual){var a=document.readyState;"loading"===a||"interactive"===a&&e&&e.defer?document.addEventListener("DOMContentLoaded",n):window.requestAnimationFrame?window.requestAnimationFrame(n):window.setTimeout(n,16)}return C}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism),Prism.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!<!--)[^"'\]]|"[^"]*"|'[^']*'|<!--[\s\S]*?-->)*\]\s*)?>/i,greedy:!0},cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};a["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var r={};r[e]={pattern:RegExp(/(<__[\s\S]*?>)(?:<!\[CDATA\[[\s\S]*?\]\]>\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:a},Prism.languages.insertBefore("markup","cdata",r)}}),Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/,lookbehind:!0,alias:"selector"}}},url:{pattern:RegExp("url\\((?:"+t.source+"|[^\n\r()]*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+t.source+")*?(?=\\s*\\{)"),string:{pattern:t,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:n.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:e.languages.css}},alias:"language-css"}},n.tag))}(Prism),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|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)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{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]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript,"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&(self.Prism.fileHighlight=function(e){e=e||document;var o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"};Array.prototype.slice.call(e.querySelectorAll("pre[data-src]")).forEach(function(e){if(!e.hasAttribute("data-src-loaded")){for(var t,n=e.getAttribute("data-src"),a=e,r=/\blang(?:uage)?-([\w-]+)\b/i;a&&!r.test(a.className);)a=a.parentNode;if(a&&(t=(e.className.match(r)||[,""])[1]),!t){var s=(n.match(/\.(\w+)$/)||[,""])[1];t=o[s]||s}var i=document.createElement("code");i.className="language-"+t,e.textContent="",i.textContent="Loading…",e.appendChild(i);var l=new XMLHttpRequest;l.open("GET",n,!0),l.onreadystatechange=function(){4==l.readyState&&(l.status<400&&l.responseText?(i.textContent=l.responseText,Prism.highlightElement(i),e.setAttribute("data-src-loaded","")):400<=l.status?i.textContent="✖ Error "+l.status+" while fetching file: "+l.statusText:i.textContent="✖ Error: File does not exist or is empty")},l.send(null)}})},document.addEventListener("DOMContentLoaded",function(){self.Prism.fileHighlight()}));