PluginProbe
Gutenberg / 23.3.2
Gutenberg v23.3.2
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / build / scripts / blocks / index.js

index.js in Gutenberg 23.3.2, at build/scripts/blocks/index.js

10,547 lines 384.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";
2 var wp;
3 (wp ||= {}).blocks = (() => {
4 var __create = Object.create;
5 var __defProp = Object.defineProperty;
6 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7 var __getOwnPropNames = Object.getOwnPropertyNames;
8 var __getProtoOf = Object.getPrototypeOf;
9 var __hasOwnProp = Object.prototype.hasOwnProperty;
10 var __commonJS = (cb, mod) => function __require() {
11 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12 };
13 var __export = (target, all) => {
14 for (var name in all)
15 __defProp(target, name, { get: all[name], enumerable: true });
16 };
17 var __copyProps = (to, from, except, desc) => {
18 if (from && typeof from === "object" || typeof from === "function") {
19 for (let key of __getOwnPropNames(from))
20 if (!__hasOwnProp.call(to, key) && key !== except)
21 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22 }
23 return to;
24 };
25 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26 // If the importer is in node compatibility mode or this is not an ESM
27 // file that has been converted to a CommonJS file using a Babel-
28 // compatible transform (i.e. "__esModule" has not been set), then set
29 // "default" to the CommonJS "module.exports" for node compatibility.
30 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31 mod
32 ));
33 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
35 // package-external:@wordpress/data
36 var require_data = __commonJS({
37 "package-external:@wordpress/data"(exports, module) {
38 module.exports = window.wp.data;
39 }
40 });
41
42 // package-external:@wordpress/i18n
43 var require_i18n = __commonJS({
44 "package-external:@wordpress/i18n"(exports, module) {
45 module.exports = window.wp.i18n;
46 }
47 });
48
49 // package-external:@wordpress/element
50 var require_element = __commonJS({
51 "package-external:@wordpress/element"(exports, module) {
52 module.exports = window.wp.element;
53 }
54 });
55
56 // package-external:@wordpress/dom
57 var require_dom = __commonJS({
58 "package-external:@wordpress/dom"(exports, module) {
59 module.exports = window.wp.dom;
60 }
61 });
62
63 // package-external:@wordpress/rich-text
64 var require_rich_text = __commonJS({
65 "package-external:@wordpress/rich-text"(exports, module) {
66 module.exports = window.wp.richText;
67 }
68 });
69
70 // package-external:@wordpress/deprecated
71 var require_deprecated = __commonJS({
72 "package-external:@wordpress/deprecated"(exports, module) {
73 module.exports = window.wp.deprecated;
74 }
75 });
76
77 // package-external:@wordpress/warning
78 var require_warning = __commonJS({
79 "package-external:@wordpress/warning"(exports, module) {
80 module.exports = window.wp.warning;
81 }
82 });
83
84 // package-external:@wordpress/private-apis
85 var require_private_apis = __commonJS({
86 "package-external:@wordpress/private-apis"(exports, module) {
87 module.exports = window.wp.privateApis;
88 }
89 });
90
91 // node_modules/remove-accents/index.js
92 var require_remove_accents = __commonJS({
93 "node_modules/remove-accents/index.js"(exports, module) {
94 var characterMap = {
95 "\xC0": "A",
96 "\xC1": "A",
97 "\xC2": "A",
98 "\xC3": "A",
99 "\xC4": "A",
100 "\xC5": "A",
101 "\u1EA4": "A",
102 "\u1EAE": "A",
103 "\u1EB2": "A",
104 "\u1EB4": "A",
105 "\u1EB6": "A",
106 "\xC6": "AE",
107 "\u1EA6": "A",
108 "\u1EB0": "A",
109 "\u0202": "A",
110 "\u1EA2": "A",
111 "\u1EA0": "A",
112 "\u1EA8": "A",
113 "\u1EAA": "A",
114 "\u1EAC": "A",
115 "\xC7": "C",
116 "\u1E08": "C",
117 "\xC8": "E",
118 "\xC9": "E",
119 "\xCA": "E",
120 "\xCB": "E",
121 "\u1EBE": "E",
122 "\u1E16": "E",
123 "\u1EC0": "E",
124 "\u1E14": "E",
125 "\u1E1C": "E",
126 "\u0206": "E",
127 "\u1EBA": "E",
128 "\u1EBC": "E",
129 "\u1EB8": "E",
130 "\u1EC2": "E",
131 "\u1EC4": "E",
132 "\u1EC6": "E",
133 "\xCC": "I",
134 "\xCD": "I",
135 "\xCE": "I",
136 "\xCF": "I",
137 "\u1E2E": "I",
138 "\u020A": "I",
139 "\u1EC8": "I",
140 "\u1ECA": "I",
141 "\xD0": "D",
142 "\xD1": "N",
143 "\xD2": "O",
144 "\xD3": "O",
145 "\xD4": "O",
146 "\xD5": "O",
147 "\xD6": "O",
148 "\xD8": "O",
149 "\u1ED0": "O",
150 "\u1E4C": "O",
151 "\u1E52": "O",
152 "\u020E": "O",
153 "\u1ECE": "O",
154 "\u1ECC": "O",
155 "\u1ED4": "O",
156 "\u1ED6": "O",
157 "\u1ED8": "O",
158 "\u1EDC": "O",
159 "\u1EDE": "O",
160 "\u1EE0": "O",
161 "\u1EDA": "O",
162 "\u1EE2": "O",
163 "\xD9": "U",
164 "\xDA": "U",
165 "\xDB": "U",
166 "\xDC": "U",
167 "\u1EE6": "U",
168 "\u1EE4": "U",
169 "\u1EEC": "U",
170 "\u1EEE": "U",
171 "\u1EF0": "U",
172 "\xDD": "Y",
173 "\xE0": "a",
174 "\xE1": "a",
175 "\xE2": "a",
176 "\xE3": "a",
177 "\xE4": "a",
178 "\xE5": "a",
179 "\u1EA5": "a",
180 "\u1EAF": "a",
181 "\u1EB3": "a",
182 "\u1EB5": "a",
183 "\u1EB7": "a",
184 "\xE6": "ae",
185 "\u1EA7": "a",
186 "\u1EB1": "a",
187 "\u0203": "a",
188 "\u1EA3": "a",
189 "\u1EA1": "a",
190 "\u1EA9": "a",
191 "\u1EAB": "a",
192 "\u1EAD": "a",
193 "\xE7": "c",
194 "\u1E09": "c",
195 "\xE8": "e",
196 "\xE9": "e",
197 "\xEA": "e",
198 "\xEB": "e",
199 "\u1EBF": "e",
200 "\u1E17": "e",
201 "\u1EC1": "e",
202 "\u1E15": "e",
203 "\u1E1D": "e",
204 "\u0207": "e",
205 "\u1EBB": "e",
206 "\u1EBD": "e",
207 "\u1EB9": "e",
208 "\u1EC3": "e",
209 "\u1EC5": "e",
210 "\u1EC7": "e",
211 "\xEC": "i",
212 "\xED": "i",
213 "\xEE": "i",
214 "\xEF": "i",
215 "\u1E2F": "i",
216 "\u020B": "i",
217 "\u1EC9": "i",
218 "\u1ECB": "i",
219 "\xF0": "d",
220 "\xF1": "n",
221 "\xF2": "o",
222 "\xF3": "o",
223 "\xF4": "o",
224 "\xF5": "o",
225 "\xF6": "o",
226 "\xF8": "o",
227 "\u1ED1": "o",
228 "\u1E4D": "o",
229 "\u1E53": "o",
230 "\u020F": "o",
231 "\u1ECF": "o",
232 "\u1ECD": "o",
233 "\u1ED5": "o",
234 "\u1ED7": "o",
235 "\u1ED9": "o",
236 "\u1EDD": "o",
237 "\u1EDF": "o",
238 "\u1EE1": "o",
239 "\u1EDB": "o",
240 "\u1EE3": "o",
241 "\xF9": "u",
242 "\xFA": "u",
243 "\xFB": "u",
244 "\xFC": "u",
245 "\u1EE7": "u",
246 "\u1EE5": "u",
247 "\u1EED": "u",
248 "\u1EEF": "u",
249 "\u1EF1": "u",
250 "\xFD": "y",
251 "\xFF": "y",
252 "\u0100": "A",
253 "\u0101": "a",
254 "\u0102": "A",
255 "\u0103": "a",
256 "\u0104": "A",
257 "\u0105": "a",
258 "\u0106": "C",
259 "\u0107": "c",
260 "\u0108": "C",
261 "\u0109": "c",
262 "\u010A": "C",
263 "\u010B": "c",
264 "\u010C": "C",
265 "\u010D": "c",
266 "C\u0306": "C",
267 "c\u0306": "c",
268 "\u010E": "D",
269 "\u010F": "d",
270 "\u0110": "D",
271 "\u0111": "d",
272 "\u0112": "E",
273 "\u0113": "e",
274 "\u0114": "E",
275 "\u0115": "e",
276 "\u0116": "E",
277 "\u0117": "e",
278 "\u0118": "E",
279 "\u0119": "e",
280 "\u011A": "E",
281 "\u011B": "e",
282 "\u011C": "G",
283 "\u01F4": "G",
284 "\u011D": "g",
285 "\u01F5": "g",
286 "\u011E": "G",
287 "\u011F": "g",
288 "\u0120": "G",
289 "\u0121": "g",
290 "\u0122": "G",
291 "\u0123": "g",
292 "\u0124": "H",
293 "\u0125": "h",
294 "\u0126": "H",
295 "\u0127": "h",
296 "\u1E2A": "H",
297 "\u1E2B": "h",
298 "\u0128": "I",
299 "\u0129": "i",
300 "\u012A": "I",
301 "\u012B": "i",
302 "\u012C": "I",
303 "\u012D": "i",
304 "\u012E": "I",
305 "\u012F": "i",
306 "\u0130": "I",
307 "\u0131": "i",
308 "\u0132": "IJ",
309 "\u0133": "ij",
310 "\u0134": "J",
311 "\u0135": "j",
312 "\u0136": "K",
313 "\u0137": "k",
314 "\u1E30": "K",
315 "\u1E31": "k",
316 "K\u0306": "K",
317 "k\u0306": "k",
318 "\u0139": "L",
319 "\u013A": "l",
320 "\u013B": "L",
321 "\u013C": "l",
322 "\u013D": "L",
323 "\u013E": "l",
324 "\u013F": "L",
325 "\u0140": "l",
326 "\u0141": "l",
327 "\u0142": "l",
328 "\u1E3E": "M",
329 "\u1E3F": "m",
330 "M\u0306": "M",
331 "m\u0306": "m",
332 "\u0143": "N",
333 "\u0144": "n",
334 "\u0145": "N",
335 "\u0146": "n",
336 "\u0147": "N",
337 "\u0148": "n",
338 "\u0149": "n",
339 "N\u0306": "N",
340 "n\u0306": "n",
341 "\u014C": "O",
342 "\u014D": "o",
343 "\u014E": "O",
344 "\u014F": "o",
345 "\u0150": "O",
346 "\u0151": "o",
347 "\u0152": "OE",
348 "\u0153": "oe",
349 "P\u0306": "P",
350 "p\u0306": "p",
351 "\u0154": "R",
352 "\u0155": "r",
353 "\u0156": "R",
354 "\u0157": "r",
355 "\u0158": "R",
356 "\u0159": "r",
357 "R\u0306": "R",
358 "r\u0306": "r",
359 "\u0212": "R",
360 "\u0213": "r",
361 "\u015A": "S",
362 "\u015B": "s",
363 "\u015C": "S",
364 "\u015D": "s",
365 "\u015E": "S",
366 "\u0218": "S",
367 "\u0219": "s",
368 "\u015F": "s",
369 "\u0160": "S",
370 "\u0161": "s",
371 "\u0162": "T",
372 "\u0163": "t",
373 "\u021B": "t",
374 "\u021A": "T",
375 "\u0164": "T",
376 "\u0165": "t",
377 "\u0166": "T",
378 "\u0167": "t",
379 "T\u0306": "T",
380 "t\u0306": "t",
381 "\u0168": "U",
382 "\u0169": "u",
383 "\u016A": "U",
384 "\u016B": "u",
385 "\u016C": "U",
386 "\u016D": "u",
387 "\u016E": "U",
388 "\u016F": "u",
389 "\u0170": "U",
390 "\u0171": "u",
391 "\u0172": "U",
392 "\u0173": "u",
393 "\u0216": "U",
394 "\u0217": "u",
395 "V\u0306": "V",
396 "v\u0306": "v",
397 "\u0174": "W",
398 "\u0175": "w",
399 "\u1E82": "W",
400 "\u1E83": "w",
401 "X\u0306": "X",
402 "x\u0306": "x",
403 "\u0176": "Y",
404 "\u0177": "y",
405 "\u0178": "Y",
406 "Y\u0306": "Y",
407 "y\u0306": "y",
408 "\u0179": "Z",
409 "\u017A": "z",
410 "\u017B": "Z",
411 "\u017C": "z",
412 "\u017D": "Z",
413 "\u017E": "z",
414 "\u017F": "s",
415 "\u0192": "f",
416 "\u01A0": "O",
417 "\u01A1": "o",
418 "\u01AF": "U",
419 "\u01B0": "u",
420 "\u01CD": "A",
421 "\u01CE": "a",
422 "\u01CF": "I",
423 "\u01D0": "i",
424 "\u01D1": "O",
425 "\u01D2": "o",
426 "\u01D3": "U",
427 "\u01D4": "u",
428 "\u01D5": "U",
429 "\u01D6": "u",
430 "\u01D7": "U",
431 "\u01D8": "u",
432 "\u01D9": "U",
433 "\u01DA": "u",
434 "\u01DB": "U",
435 "\u01DC": "u",
436 "\u1EE8": "U",
437 "\u1EE9": "u",
438 "\u1E78": "U",
439 "\u1E79": "u",
440 "\u01FA": "A",
441 "\u01FB": "a",
442 "\u01FC": "AE",
443 "\u01FD": "ae",
444 "\u01FE": "O",
445 "\u01FF": "o",
446 "\xDE": "TH",
447 "\xFE": "th",
448 "\u1E54": "P",
449 "\u1E55": "p",
450 "\u1E64": "S",
451 "\u1E65": "s",
452 "X\u0301": "X",
453 "x\u0301": "x",
454 "\u0403": "\u0413",
455 "\u0453": "\u0433",
456 "\u040C": "\u041A",
457 "\u045C": "\u043A",
458 "A\u030B": "A",
459 "a\u030B": "a",
460 "E\u030B": "E",
461 "e\u030B": "e",
462 "I\u030B": "I",
463 "i\u030B": "i",
464 "\u01F8": "N",
465 "\u01F9": "n",
466 "\u1ED2": "O",
467 "\u1ED3": "o",
468 "\u1E50": "O",
469 "\u1E51": "o",
470 "\u1EEA": "U",
471 "\u1EEB": "u",
472 "\u1E80": "W",
473 "\u1E81": "w",
474 "\u1EF2": "Y",
475 "\u1EF3": "y",
476 "\u0200": "A",
477 "\u0201": "a",
478 "\u0204": "E",
479 "\u0205": "e",
480 "\u0208": "I",
481 "\u0209": "i",
482 "\u020C": "O",
483 "\u020D": "o",
484 "\u0210": "R",
485 "\u0211": "r",
486 "\u0214": "U",
487 "\u0215": "u",
488 "B\u030C": "B",
489 "b\u030C": "b",
490 "\u010C\u0323": "C",
491 "\u010D\u0323": "c",
492 "\xCA\u030C": "E",
493 "\xEA\u030C": "e",
494 "F\u030C": "F",
495 "f\u030C": "f",
496 "\u01E6": "G",
497 "\u01E7": "g",
498 "\u021E": "H",
499 "\u021F": "h",
500 "J\u030C": "J",
501 "\u01F0": "j",
502 "\u01E8": "K",
503 "\u01E9": "k",
504 "M\u030C": "M",
505 "m\u030C": "m",
506 "P\u030C": "P",
507 "p\u030C": "p",
508 "Q\u030C": "Q",
509 "q\u030C": "q",
510 "\u0158\u0329": "R",
511 "\u0159\u0329": "r",
512 "\u1E66": "S",
513 "\u1E67": "s",
514 "V\u030C": "V",
515 "v\u030C": "v",
516 "W\u030C": "W",
517 "w\u030C": "w",
518 "X\u030C": "X",
519 "x\u030C": "x",
520 "Y\u030C": "Y",
521 "y\u030C": "y",
522 "A\u0327": "A",
523 "a\u0327": "a",
524 "B\u0327": "B",
525 "b\u0327": "b",
526 "\u1E10": "D",
527 "\u1E11": "d",
528 "\u0228": "E",
529 "\u0229": "e",
530 "\u0190\u0327": "E",
531 "\u025B\u0327": "e",
532 "\u1E28": "H",
533 "\u1E29": "h",
534 "I\u0327": "I",
535 "i\u0327": "i",
536 "\u0197\u0327": "I",
537 "\u0268\u0327": "i",
538 "M\u0327": "M",
539 "m\u0327": "m",
540 "O\u0327": "O",
541 "o\u0327": "o",
542 "Q\u0327": "Q",
543 "q\u0327": "q",
544 "U\u0327": "U",
545 "u\u0327": "u",
546 "X\u0327": "X",
547 "x\u0327": "x",
548 "Z\u0327": "Z",
549 "z\u0327": "z",
550 "\u0439": "\u0438",
551 "\u0419": "\u0418",
552 "\u0451": "\u0435",
553 "\u0401": "\u0415"
554 };
555 var chars = Object.keys(characterMap).join("|");
556 var allAccents = new RegExp(chars, "g");
557 var firstAccent = new RegExp(chars, "");
558 function matcher3(match) {
559 return characterMap[match];
560 }
561 var removeAccents2 = function(string) {
562 return string.replace(allAccents, matcher3);
563 };
564 var hasAccents = function(string) {
565 return !!string.match(firstAccent);
566 };
567 module.exports = removeAccents2;
568 module.exports.has = hasAccents;
569 module.exports.remove = removeAccents2;
570 }
571 });
572
573 // packages/blocks/node_modules/react-is/cjs/react-is.development.js
574 var require_react_is_development = __commonJS({
575 "packages/blocks/node_modules/react-is/cjs/react-is.development.js"(exports) {
576 "use strict";
577 if (true) {
578 (function() {
579 "use strict";
580 var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
581 var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
582 var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
583 var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
584 var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
585 var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider");
586 var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
587 var REACT_SERVER_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.server_context");
588 var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
589 var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
590 var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list");
591 var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
592 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
593 var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen");
594 var enableScopeAPI = false;
595 var enableCacheElement = false;
596 var enableTransitionTracing = false;
597 var enableLegacyHidden = false;
598 var enableDebugTracing = false;
599 var REACT_MODULE_REFERENCE;
600 {
601 REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference");
602 }
603 function isValidElementType2(type) {
604 if (typeof type === "string" || typeof type === "function") {
605 return true;
606 }
607 if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
608 return true;
609 }
610 if (typeof type === "object" && type !== null) {
611 if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
612 // types supported by any Flight configuration anywhere since
613 // we don't know which Flight build this will end up being used
614 // with.
615 type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
616 return true;
617 }
618 }
619 return false;
620 }
621 function typeOf(object) {
622 if (typeof object === "object" && object !== null) {
623 var $$typeof = object.$$typeof;
624 switch ($$typeof) {
625 case REACT_ELEMENT_TYPE:
626 var type = object.type;
627 switch (type) {
628 case REACT_FRAGMENT_TYPE:
629 case REACT_PROFILER_TYPE:
630 case REACT_STRICT_MODE_TYPE:
631 case REACT_SUSPENSE_TYPE:
632 case REACT_SUSPENSE_LIST_TYPE:
633 return type;
634 default:
635 var $$typeofType = type && type.$$typeof;
636 switch ($$typeofType) {
637 case REACT_SERVER_CONTEXT_TYPE:
638 case REACT_CONTEXT_TYPE:
639 case REACT_FORWARD_REF_TYPE:
640 case REACT_LAZY_TYPE:
641 case REACT_MEMO_TYPE:
642 case REACT_PROVIDER_TYPE:
643 return $$typeofType;
644 default:
645 return $$typeof;
646 }
647 }
648 case REACT_PORTAL_TYPE:
649 return $$typeof;
650 }
651 }
652 return void 0;
653 }
654 var ContextConsumer = REACT_CONTEXT_TYPE;
655 var ContextProvider = REACT_PROVIDER_TYPE;
656 var Element = REACT_ELEMENT_TYPE;
657 var ForwardRef = REACT_FORWARD_REF_TYPE;
658 var Fragment = REACT_FRAGMENT_TYPE;
659 var Lazy = REACT_LAZY_TYPE;
660 var Memo = REACT_MEMO_TYPE;
661 var Portal = REACT_PORTAL_TYPE;
662 var Profiler = REACT_PROFILER_TYPE;
663 var StrictMode = REACT_STRICT_MODE_TYPE;
664 var Suspense = REACT_SUSPENSE_TYPE;
665 var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
666 var hasWarnedAboutDeprecatedIsAsyncMode = false;
667 var hasWarnedAboutDeprecatedIsConcurrentMode = false;
668 function isAsyncMode(object) {
669 {
670 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
671 hasWarnedAboutDeprecatedIsAsyncMode = true;
672 console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
673 }
674 }
675 return false;
676 }
677 function isConcurrentMode(object) {
678 {
679 if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
680 hasWarnedAboutDeprecatedIsConcurrentMode = true;
681 console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
682 }
683 }
684 return false;
685 }
686 function isContextConsumer(object) {
687 return typeOf(object) === REACT_CONTEXT_TYPE;
688 }
689 function isContextProvider(object) {
690 return typeOf(object) === REACT_PROVIDER_TYPE;
691 }
692 function isElement(object) {
693 return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
694 }
695 function isForwardRef(object) {
696 return typeOf(object) === REACT_FORWARD_REF_TYPE;
697 }
698 function isFragment(object) {
699 return typeOf(object) === REACT_FRAGMENT_TYPE;
700 }
701 function isLazy(object) {
702 return typeOf(object) === REACT_LAZY_TYPE;
703 }
704 function isMemo(object) {
705 return typeOf(object) === REACT_MEMO_TYPE;
706 }
707 function isPortal(object) {
708 return typeOf(object) === REACT_PORTAL_TYPE;
709 }
710 function isProfiler(object) {
711 return typeOf(object) === REACT_PROFILER_TYPE;
712 }
713 function isStrictMode(object) {
714 return typeOf(object) === REACT_STRICT_MODE_TYPE;
715 }
716 function isSuspense(object) {
717 return typeOf(object) === REACT_SUSPENSE_TYPE;
718 }
719 function isSuspenseList(object) {
720 return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
721 }
722 exports.ContextConsumer = ContextConsumer;
723 exports.ContextProvider = ContextProvider;
724 exports.Element = Element;
725 exports.ForwardRef = ForwardRef;
726 exports.Fragment = Fragment;
727 exports.Lazy = Lazy;
728 exports.Memo = Memo;
729 exports.Portal = Portal;
730 exports.Profiler = Profiler;
731 exports.StrictMode = StrictMode;
732 exports.Suspense = Suspense;
733 exports.SuspenseList = SuspenseList;
734 exports.isAsyncMode = isAsyncMode;
735 exports.isConcurrentMode = isConcurrentMode;
736 exports.isContextConsumer = isContextConsumer;
737 exports.isContextProvider = isContextProvider;
738 exports.isElement = isElement;
739 exports.isForwardRef = isForwardRef;
740 exports.isFragment = isFragment;
741 exports.isLazy = isLazy;
742 exports.isMemo = isMemo;
743 exports.isPortal = isPortal;
744 exports.isProfiler = isProfiler;
745 exports.isStrictMode = isStrictMode;
746 exports.isSuspense = isSuspense;
747 exports.isSuspenseList = isSuspenseList;
748 exports.isValidElementType = isValidElementType2;
749 exports.typeOf = typeOf;
750 })();
751 }
752 }
753 });
754
755 // packages/blocks/node_modules/react-is/index.js
756 var require_react_is = __commonJS({
757 "packages/blocks/node_modules/react-is/index.js"(exports, module) {
758 "use strict";
759 if (false) {
760 module.exports = null;
761 } else {
762 module.exports = require_react_is_development();
763 }
764 }
765 });
766
767 // package-external:@wordpress/hooks
768 var require_hooks = __commonJS({
769 "package-external:@wordpress/hooks"(exports, module) {
770 module.exports = window.wp.hooks;
771 }
772 });
773
774 // package-external:@wordpress/block-serialization-default-parser
775 var require_block_serialization_default_parser = __commonJS({
776 "package-external:@wordpress/block-serialization-default-parser"(exports, module) {
777 module.exports = window.wp.blockSerializationDefaultParser;
778 }
779 });
780
781 // package-external:@wordpress/autop
782 var require_autop = __commonJS({
783 "package-external:@wordpress/autop"(exports, module) {
784 module.exports = window.wp.autop;
785 }
786 });
787
788 // package-external:@wordpress/is-shallow-equal
789 var require_is_shallow_equal = __commonJS({
790 "package-external:@wordpress/is-shallow-equal"(exports, module) {
791 module.exports = window.wp.isShallowEqual;
792 }
793 });
794
795 // vendor-external:react/jsx-runtime
796 var require_jsx_runtime = __commonJS({
797 "vendor-external:react/jsx-runtime"(exports, module) {
798 module.exports = window.ReactJSXRuntime;
799 }
800 });
801
802 // node_modules/fast-deep-equal/es6/index.js
803 var require_es6 = __commonJS({
804 "node_modules/fast-deep-equal/es6/index.js"(exports, module) {
805 "use strict";
806 module.exports = function equal(a2, b2) {
807 if (a2 === b2) return true;
808 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
809 if (a2.constructor !== b2.constructor) return false;
810 var length, i2, keys;
811 if (Array.isArray(a2)) {
812 length = a2.length;
813 if (length != b2.length) return false;
814 for (i2 = length; i2-- !== 0; )
815 if (!equal(a2[i2], b2[i2])) return false;
816 return true;
817 }
818 if (a2 instanceof Map && b2 instanceof Map) {
819 if (a2.size !== b2.size) return false;
820 for (i2 of a2.entries())
821 if (!b2.has(i2[0])) return false;
822 for (i2 of a2.entries())
823 if (!equal(i2[1], b2.get(i2[0]))) return false;
824 return true;
825 }
826 if (a2 instanceof Set && b2 instanceof Set) {
827 if (a2.size !== b2.size) return false;
828 for (i2 of a2.entries())
829 if (!b2.has(i2[0])) return false;
830 return true;
831 }
832 if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
833 length = a2.length;
834 if (length != b2.length) return false;
835 for (i2 = length; i2-- !== 0; )
836 if (a2[i2] !== b2[i2]) return false;
837 return true;
838 }
839 if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags;
840 if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf();
841 if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString();
842 keys = Object.keys(a2);
843 length = keys.length;
844 if (length !== Object.keys(b2).length) return false;
845 for (i2 = length; i2-- !== 0; )
846 if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false;
847 for (i2 = length; i2-- !== 0; ) {
848 var key = keys[i2];
849 if (!equal(a2[key], b2[key])) return false;
850 }
851 return true;
852 }
853 return a2 !== a2 && b2 !== b2;
854 };
855 }
856 });
857
858 // package-external:@wordpress/html-entities
859 var require_html_entities = __commonJS({
860 "package-external:@wordpress/html-entities"(exports, module) {
861 module.exports = window.wp.htmlEntities;
862 }
863 });
864
865 // package-external:@wordpress/shortcode
866 var require_shortcode = __commonJS({
867 "package-external:@wordpress/shortcode"(exports, module) {
868 module.exports = window.wp.shortcode;
869 }
870 });
871
872 // package-external:@wordpress/blob
873 var require_blob = __commonJS({
874 "package-external:@wordpress/blob"(exports, module) {
875 module.exports = window.wp.blob;
876 }
877 });
878
879 // node_modules/showdown/dist/showdown.js
880 var require_showdown = __commonJS({
881 "node_modules/showdown/dist/showdown.js"(exports, module) {
882 (function() {
883 function getDefaultOpts(simple) {
884 "use strict";
885 var defaultOptions = {
886 omitExtraWLInCodeBlocks: {
887 defaultValue: false,
888 describe: "Omit the default extra whiteline added to code blocks",
889 type: "boolean"
890 },
891 noHeaderId: {
892 defaultValue: false,
893 describe: "Turn on/off generated header id",
894 type: "boolean"
895 },
896 prefixHeaderId: {
897 defaultValue: false,
898 describe: "Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",
899 type: "string"
900 },
901 rawPrefixHeaderId: {
902 defaultValue: false,
903 describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
904 type: "boolean"
905 },
906 ghCompatibleHeaderId: {
907 defaultValue: false,
908 describe: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",
909 type: "boolean"
910 },
911 rawHeaderId: {
912 defaultValue: false,
913 describe: `Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,
914 type: "boolean"
915 },
916 headerLevelStart: {
917 defaultValue: false,
918 describe: "The header blocks level start",
919 type: "integer"
920 },
921 parseImgDimensions: {
922 defaultValue: false,
923 describe: "Turn on/off image dimension parsing",
924 type: "boolean"
925 },
926 simplifiedAutoLink: {
927 defaultValue: false,
928 describe: "Turn on/off GFM autolink style",
929 type: "boolean"
930 },
931 excludeTrailingPunctuationFromURLs: {
932 defaultValue: false,
933 describe: "Excludes trailing punctuation from links generated with autoLinking",
934 type: "boolean"
935 },
936 literalMidWordUnderscores: {
937 defaultValue: false,
938 describe: "Parse midword underscores as literal underscores",
939 type: "boolean"
940 },
941 literalMidWordAsterisks: {
942 defaultValue: false,
943 describe: "Parse midword asterisks as literal asterisks",
944 type: "boolean"
945 },
946 strikethrough: {
947 defaultValue: false,
948 describe: "Turn on/off strikethrough support",
949 type: "boolean"
950 },
951 tables: {
952 defaultValue: false,
953 describe: "Turn on/off tables support",
954 type: "boolean"
955 },
956 tablesHeaderId: {
957 defaultValue: false,
958 describe: "Add an id to table headers",
959 type: "boolean"
960 },
961 ghCodeBlocks: {
962 defaultValue: true,
963 describe: "Turn on/off GFM fenced code blocks support",
964 type: "boolean"
965 },
966 tasklists: {
967 defaultValue: false,
968 describe: "Turn on/off GFM tasklist support",
969 type: "boolean"
970 },
971 smoothLivePreview: {
972 defaultValue: false,
973 describe: "Prevents weird effects in live previews due to incomplete input",
974 type: "boolean"
975 },
976 smartIndentationFix: {
977 defaultValue: false,
978 description: "Tries to smartly fix indentation in es6 strings",
979 type: "boolean"
980 },
981 disableForced4SpacesIndentedSublists: {
982 defaultValue: false,
983 description: "Disables the requirement of indenting nested sublists by 4 spaces",
984 type: "boolean"
985 },
986 simpleLineBreaks: {
987 defaultValue: false,
988 description: "Parses simple line breaks as <br> (GFM Style)",
989 type: "boolean"
990 },
991 requireSpaceBeforeHeadingText: {
992 defaultValue: false,
993 description: "Makes adding a space between `#` and the header text mandatory (GFM Style)",
994 type: "boolean"
995 },
996 ghMentions: {
997 defaultValue: false,
998 description: "Enables github @mentions",
999 type: "boolean"
1000 },
1001 ghMentionsLink: {
1002 defaultValue: "https://github.com/{u}",
1003 description: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",
1004 type: "string"
1005 },
1006 encodeEmails: {
1007 defaultValue: true,
1008 description: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",
1009 type: "boolean"
1010 },
1011 openLinksInNewWindow: {
1012 defaultValue: false,
1013 description: "Open all links in new windows",
1014 type: "boolean"
1015 },
1016 backslashEscapesHTMLTags: {
1017 defaultValue: false,
1018 description: "Support for HTML Tag escaping. ex: <div>foo</div>",
1019 type: "boolean"
1020 },
1021 emoji: {
1022 defaultValue: false,
1023 description: "Enable emoji support. Ex: `this is a :smile: emoji`",
1024 type: "boolean"
1025 },
1026 underline: {
1027 defaultValue: false,
1028 description: "Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",
1029 type: "boolean"
1030 },
1031 completeHTMLDocument: {
1032 defaultValue: false,
1033 description: "Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",
1034 type: "boolean"
1035 },
1036 metadata: {
1037 defaultValue: false,
1038 description: "Enable support for document metadata (defined at the top of the document between `\xAB\xAB\xAB` and `\xBB\xBB\xBB` or between `---` and `---`).",
1039 type: "boolean"
1040 },
1041 splitAdjacentBlockquotes: {
1042 defaultValue: false,
1043 description: "Split adjacent blockquote blocks",
1044 type: "boolean"
1045 }
1046 };
1047 if (simple === false) {
1048 return JSON.parse(JSON.stringify(defaultOptions));
1049 }
1050 var ret = {};
1051 for (var opt in defaultOptions) {
1052 if (defaultOptions.hasOwnProperty(opt)) {
1053 ret[opt] = defaultOptions[opt].defaultValue;
1054 }
1055 }
1056 return ret;
1057 }
1058 function allOptionsOn() {
1059 "use strict";
1060 var options = getDefaultOpts(true), ret = {};
1061 for (var opt in options) {
1062 if (options.hasOwnProperty(opt)) {
1063 ret[opt] = true;
1064 }
1065 }
1066 return ret;
1067 }
1068 var showdown2 = {}, parsers = {}, extensions = {}, globalOptions = getDefaultOpts(true), setFlavor = "vanilla", flavor = {
1069 github: {
1070 omitExtraWLInCodeBlocks: true,
1071 simplifiedAutoLink: true,
1072 excludeTrailingPunctuationFromURLs: true,
1073 literalMidWordUnderscores: true,
1074 strikethrough: true,
1075 tables: true,
1076 tablesHeaderId: true,
1077 ghCodeBlocks: true,
1078 tasklists: true,
1079 disableForced4SpacesIndentedSublists: true,
1080 simpleLineBreaks: true,
1081 requireSpaceBeforeHeadingText: true,
1082 ghCompatibleHeaderId: true,
1083 ghMentions: true,
1084 backslashEscapesHTMLTags: true,
1085 emoji: true,
1086 splitAdjacentBlockquotes: true
1087 },
1088 original: {
1089 noHeaderId: true,
1090 ghCodeBlocks: false
1091 },
1092 ghost: {
1093 omitExtraWLInCodeBlocks: true,
1094 parseImgDimensions: true,
1095 simplifiedAutoLink: true,
1096 excludeTrailingPunctuationFromURLs: true,
1097 literalMidWordUnderscores: true,
1098 strikethrough: true,
1099 tables: true,
1100 tablesHeaderId: true,
1101 ghCodeBlocks: true,
1102 tasklists: true,
1103 smoothLivePreview: true,
1104 simpleLineBreaks: true,
1105 requireSpaceBeforeHeadingText: true,
1106 ghMentions: false,
1107 encodeEmails: true
1108 },
1109 vanilla: getDefaultOpts(true),
1110 allOn: allOptionsOn()
1111 };
1112 showdown2.helper = {};
1113 showdown2.extensions = {};
1114 showdown2.setOption = function(key, value) {
1115 "use strict";
1116 globalOptions[key] = value;
1117 return this;
1118 };
1119 showdown2.getOption = function(key) {
1120 "use strict";
1121 return globalOptions[key];
1122 };
1123 showdown2.getOptions = function() {
1124 "use strict";
1125 return globalOptions;
1126 };
1127 showdown2.resetOptions = function() {
1128 "use strict";
1129 globalOptions = getDefaultOpts(true);
1130 };
1131 showdown2.setFlavor = function(name) {
1132 "use strict";
1133 if (!flavor.hasOwnProperty(name)) {
1134 throw Error(name + " flavor was not found");
1135 }
1136 showdown2.resetOptions();
1137 var preset = flavor[name];
1138 setFlavor = name;
1139 for (var option in preset) {
1140 if (preset.hasOwnProperty(option)) {
1141 globalOptions[option] = preset[option];
1142 }
1143 }
1144 };
1145 showdown2.getFlavor = function() {
1146 "use strict";
1147 return setFlavor;
1148 };
1149 showdown2.getFlavorOptions = function(name) {
1150 "use strict";
1151 if (flavor.hasOwnProperty(name)) {
1152 return flavor[name];
1153 }
1154 };
1155 showdown2.getDefaultOptions = function(simple) {
1156 "use strict";
1157 return getDefaultOpts(simple);
1158 };
1159 showdown2.subParser = function(name, func) {
1160 "use strict";
1161 if (showdown2.helper.isString(name)) {
1162 if (typeof func !== "undefined") {
1163 parsers[name] = func;
1164 } else {
1165 if (parsers.hasOwnProperty(name)) {
1166 return parsers[name];
1167 } else {
1168 throw Error("SubParser named " + name + " not registered!");
1169 }
1170 }
1171 }
1172 };
1173 showdown2.extension = function(name, ext) {
1174 "use strict";
1175 if (!showdown2.helper.isString(name)) {
1176 throw Error("Extension 'name' must be a string");
1177 }
1178 name = showdown2.helper.stdExtName(name);
1179 if (showdown2.helper.isUndefined(ext)) {
1180 if (!extensions.hasOwnProperty(name)) {
1181 throw Error("Extension named " + name + " is not registered!");
1182 }
1183 return extensions[name];
1184 } else {
1185 if (typeof ext === "function") {
1186 ext = ext();
1187 }
1188 if (!showdown2.helper.isArray(ext)) {
1189 ext = [ext];
1190 }
1191 var validExtension = validate(ext, name);
1192 if (validExtension.valid) {
1193 extensions[name] = ext;
1194 } else {
1195 throw Error(validExtension.error);
1196 }
1197 }
1198 };
1199 showdown2.getAllExtensions = function() {
1200 "use strict";
1201 return extensions;
1202 };
1203 showdown2.removeExtension = function(name) {
1204 "use strict";
1205 delete extensions[name];
1206 };
1207 showdown2.resetExtensions = function() {
1208 "use strict";
1209 extensions = {};
1210 };
1211 function validate(extension, name) {
1212 "use strict";
1213 var errMsg = name ? "Error in " + name + " extension->" : "Error in unnamed extension", ret = {
1214 valid: true,
1215 error: ""
1216 };
1217 if (!showdown2.helper.isArray(extension)) {
1218 extension = [extension];
1219 }
1220 for (var i2 = 0; i2 < extension.length; ++i2) {
1221 var baseMsg = errMsg + " sub-extension " + i2 + ": ", ext = extension[i2];
1222 if (typeof ext !== "object") {
1223 ret.valid = false;
1224 ret.error = baseMsg + "must be an object, but " + typeof ext + " given";
1225 return ret;
1226 }
1227 if (!showdown2.helper.isString(ext.type)) {
1228 ret.valid = false;
1229 ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + " given";
1230 return ret;
1231 }
1232 var type = ext.type = ext.type.toLowerCase();
1233 if (type === "language") {
1234 type = ext.type = "lang";
1235 }
1236 if (type === "html") {
1237 type = ext.type = "output";
1238 }
1239 if (type !== "lang" && type !== "output" && type !== "listener") {
1240 ret.valid = false;
1241 ret.error = baseMsg + "type " + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
1242 return ret;
1243 }
1244 if (type === "listener") {
1245 if (showdown2.helper.isUndefined(ext.listeners)) {
1246 ret.valid = false;
1247 ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
1248 return ret;
1249 }
1250 } else {
1251 if (showdown2.helper.isUndefined(ext.filter) && showdown2.helper.isUndefined(ext.regex)) {
1252 ret.valid = false;
1253 ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method';
1254 return ret;
1255 }
1256 }
1257 if (ext.listeners) {
1258 if (typeof ext.listeners !== "object") {
1259 ret.valid = false;
1260 ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + " given";
1261 return ret;
1262 }
1263 for (var ln in ext.listeners) {
1264 if (ext.listeners.hasOwnProperty(ln)) {
1265 if (typeof ext.listeners[ln] !== "function") {
1266 ret.valid = false;
1267 ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln + " must be a function but " + typeof ext.listeners[ln] + " given";
1268 return ret;
1269 }
1270 }
1271 }
1272 }
1273 if (ext.filter) {
1274 if (typeof ext.filter !== "function") {
1275 ret.valid = false;
1276 ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + " given";
1277 return ret;
1278 }
1279 } else if (ext.regex) {
1280 if (showdown2.helper.isString(ext.regex)) {
1281 ext.regex = new RegExp(ext.regex, "g");
1282 }
1283 if (!(ext.regex instanceof RegExp)) {
1284 ret.valid = false;
1285 ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + " given";
1286 return ret;
1287 }
1288 if (showdown2.helper.isUndefined(ext.replace)) {
1289 ret.valid = false;
1290 ret.error = baseMsg + '"regex" extensions must implement a replace string or function';
1291 return ret;
1292 }
1293 }
1294 }
1295 return ret;
1296 }
1297 showdown2.validateExtension = function(ext) {
1298 "use strict";
1299 var validateExtension = validate(ext, null);
1300 if (!validateExtension.valid) {
1301 console.warn(validateExtension.error);
1302 return false;
1303 }
1304 return true;
1305 };
1306 if (!showdown2.hasOwnProperty("helper")) {
1307 showdown2.helper = {};
1308 }
1309 showdown2.helper.isString = function(a2) {
1310 "use strict";
1311 return typeof a2 === "string" || a2 instanceof String;
1312 };
1313 showdown2.helper.isFunction = function(a2) {
1314 "use strict";
1315 var getType = {};
1316 return a2 && getType.toString.call(a2) === "[object Function]";
1317 };
1318 showdown2.helper.isArray = function(a2) {
1319 "use strict";
1320 return Array.isArray(a2);
1321 };
1322 showdown2.helper.isUndefined = function(value) {
1323 "use strict";
1324 return typeof value === "undefined";
1325 };
1326 showdown2.helper.forEach = function(obj, callback) {
1327 "use strict";
1328 if (showdown2.helper.isUndefined(obj)) {
1329 throw new Error("obj param is required");
1330 }
1331 if (showdown2.helper.isUndefined(callback)) {
1332 throw new Error("callback param is required");
1333 }
1334 if (!showdown2.helper.isFunction(callback)) {
1335 throw new Error("callback param must be a function/closure");
1336 }
1337 if (typeof obj.forEach === "function") {
1338 obj.forEach(callback);
1339 } else if (showdown2.helper.isArray(obj)) {
1340 for (var i2 = 0; i2 < obj.length; i2++) {
1341 callback(obj[i2], i2, obj);
1342 }
1343 } else if (typeof obj === "object") {
1344 for (var prop2 in obj) {
1345 if (obj.hasOwnProperty(prop2)) {
1346 callback(obj[prop2], prop2, obj);
1347 }
1348 }
1349 } else {
1350 throw new Error("obj does not seem to be an array or an iterable object");
1351 }
1352 };
1353 showdown2.helper.stdExtName = function(s2) {
1354 "use strict";
1355 return s2.replace(/[_?*+\/\\.^-]/g, "").replace(/\s/g, "").toLowerCase();
1356 };
1357 function escapeCharactersCallback(wholeMatch, m1) {
1358 "use strict";
1359 var charCodeToEscape = m1.charCodeAt(0);
1360 return "\xA8E" + charCodeToEscape + "E";
1361 }
1362 showdown2.helper.escapeCharactersCallback = escapeCharactersCallback;
1363 showdown2.helper.escapeCharacters = function(text2, charsToEscape, afterBackslash) {
1364 "use strict";
1365 var regexString = "([" + charsToEscape.replace(/([\[\]\\])/g, "\\$1") + "])";
1366 if (afterBackslash) {
1367 regexString = "\\\\" + regexString;
1368 }
1369 var regex = new RegExp(regexString, "g");
1370 text2 = text2.replace(regex, escapeCharactersCallback);
1371 return text2;
1372 };
1373 showdown2.helper.unescapeHTMLEntities = function(txt) {
1374 "use strict";
1375 return txt.replace(/&quot;/g, '"').replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1376 };
1377 var rgxFindMatchPos = function(str, left, right, flags) {
1378 "use strict";
1379 var f2 = flags || "", g2 = f2.indexOf("g") > -1, x2 = new RegExp(left + "|" + right, "g" + f2.replace(/g/g, "")), l2 = new RegExp(left, f2.replace(/g/g, "")), pos = [], t3, s2, m2, start, end;
1380 do {
1381 t3 = 0;
1382 while (m2 = x2.exec(str)) {
1383 if (l2.test(m2[0])) {
1384 if (!t3++) {
1385 s2 = x2.lastIndex;
1386 start = s2 - m2[0].length;
1387 }
1388 } else if (t3) {
1389 if (!--t3) {
1390 end = m2.index + m2[0].length;
1391 var obj = {
1392 left: { start, end: s2 },
1393 match: { start: s2, end: m2.index },
1394 right: { start: m2.index, end },
1395 wholeMatch: { start, end }
1396 };
1397 pos.push(obj);
1398 if (!g2) {
1399 return pos;
1400 }
1401 }
1402 }
1403 }
1404 } while (t3 && (x2.lastIndex = s2));
1405 return pos;
1406 };
1407 showdown2.helper.matchRecursiveRegExp = function(str, left, right, flags) {
1408 "use strict";
1409 var matchPos = rgxFindMatchPos(str, left, right, flags), results = [];
1410 for (var i2 = 0; i2 < matchPos.length; ++i2) {
1411 results.push([
1412 str.slice(matchPos[i2].wholeMatch.start, matchPos[i2].wholeMatch.end),
1413 str.slice(matchPos[i2].match.start, matchPos[i2].match.end),
1414 str.slice(matchPos[i2].left.start, matchPos[i2].left.end),
1415 str.slice(matchPos[i2].right.start, matchPos[i2].right.end)
1416 ]);
1417 }
1418 return results;
1419 };
1420 showdown2.helper.replaceRecursiveRegExp = function(str, replacement, left, right, flags) {
1421 "use strict";
1422 if (!showdown2.helper.isFunction(replacement)) {
1423 var repStr = replacement;
1424 replacement = function() {
1425 return repStr;
1426 };
1427 }
1428 var matchPos = rgxFindMatchPos(str, left, right, flags), finalStr = str, lng = matchPos.length;
1429 if (lng > 0) {
1430 var bits = [];
1431 if (matchPos[0].wholeMatch.start !== 0) {
1432 bits.push(str.slice(0, matchPos[0].wholeMatch.start));
1433 }
1434 for (var i2 = 0; i2 < lng; ++i2) {
1435 bits.push(
1436 replacement(
1437 str.slice(matchPos[i2].wholeMatch.start, matchPos[i2].wholeMatch.end),
1438 str.slice(matchPos[i2].match.start, matchPos[i2].match.end),
1439 str.slice(matchPos[i2].left.start, matchPos[i2].left.end),
1440 str.slice(matchPos[i2].right.start, matchPos[i2].right.end)
1441 )
1442 );
1443 if (i2 < lng - 1) {
1444 bits.push(str.slice(matchPos[i2].wholeMatch.end, matchPos[i2 + 1].wholeMatch.start));
1445 }
1446 }
1447 if (matchPos[lng - 1].wholeMatch.end < str.length) {
1448 bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));
1449 }
1450 finalStr = bits.join("");
1451 }
1452 return finalStr;
1453 };
1454 showdown2.helper.regexIndexOf = function(str, regex, fromIndex) {
1455 "use strict";
1456 if (!showdown2.helper.isString(str)) {
1457 throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
1458 }
1459 if (regex instanceof RegExp === false) {
1460 throw "InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";
1461 }
1462 var indexOf = str.substring(fromIndex || 0).search(regex);
1463 return indexOf >= 0 ? indexOf + (fromIndex || 0) : indexOf;
1464 };
1465 showdown2.helper.splitAtIndex = function(str, index) {
1466 "use strict";
1467 if (!showdown2.helper.isString(str)) {
1468 throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
1469 }
1470 return [str.substring(0, index), str.substring(index)];
1471 };
1472 showdown2.helper.encodeEmailAddress = function(mail) {
1473 "use strict";
1474 var encode = [
1475 function(ch) {
1476 return "&#" + ch.charCodeAt(0) + ";";
1477 },
1478 function(ch) {
1479 return "&#x" + ch.charCodeAt(0).toString(16) + ";";
1480 },
1481 function(ch) {
1482 return ch;
1483 }
1484 ];
1485 mail = mail.replace(/./g, function(ch) {
1486 if (ch === "@") {
1487 ch = encode[Math.floor(Math.random() * 2)](ch);
1488 } else {
1489 var r2 = Math.random();
1490 ch = r2 > 0.9 ? encode[2](ch) : r2 > 0.45 ? encode[1](ch) : encode[0](ch);
1491 }
1492 return ch;
1493 });
1494 return mail;
1495 };
1496 showdown2.helper.padEnd = function padEnd(str, targetLength, padString) {
1497 "use strict";
1498 targetLength = targetLength >> 0;
1499 padString = String(padString || " ");
1500 if (str.length > targetLength) {
1501 return String(str);
1502 } else {
1503 targetLength = targetLength - str.length;
1504 if (targetLength > padString.length) {
1505 padString += padString.repeat(targetLength / padString.length);
1506 }
1507 return String(str) + padString.slice(0, targetLength);
1508 }
1509 };
1510 if (typeof console === "undefined") {
1511 console = {
1512 warn: function(msg) {
1513 "use strict";
1514 alert(msg);
1515 },
1516 log: function(msg) {
1517 "use strict";
1518 alert(msg);
1519 },
1520 error: function(msg) {
1521 "use strict";
1522 throw msg;
1523 }
1524 };
1525 }
1526 showdown2.helper.regexes = {
1527 asteriskDashAndColon: /([*_:~])/g
1528 };
1529 showdown2.helper.emojis = {
1530 "+1": "\u{1F44D}",
1531 "-1": "\u{1F44E}",
1532 "100": "\u{1F4AF}",
1533 "1234": "\u{1F522}",
1534 "1st_place_medal": "\u{1F947}",
1535 "2nd_place_medal": "\u{1F948}",
1536 "3rd_place_medal": "\u{1F949}",
1537 "8ball": "\u{1F3B1}",
1538 "a": "\u{1F170}\uFE0F",
1539 "ab": "\u{1F18E}",
1540 "abc": "\u{1F524}",
1541 "abcd": "\u{1F521}",
1542 "accept": "\u{1F251}",
1543 "aerial_tramway": "\u{1F6A1}",
1544 "airplane": "\u2708\uFE0F",
1545 "alarm_clock": "\u23F0",
1546 "alembic": "\u2697\uFE0F",
1547 "alien": "\u{1F47D}",
1548 "ambulance": "\u{1F691}",
1549 "amphora": "\u{1F3FA}",
1550 "anchor": "\u2693\uFE0F",
1551 "angel": "\u{1F47C}",
1552 "anger": "\u{1F4A2}",
1553 "angry": "\u{1F620}",
1554 "anguished": "\u{1F627}",
1555 "ant": "\u{1F41C}",
1556 "apple": "\u{1F34E}",
1557 "aquarius": "\u2652\uFE0F",
1558 "aries": "\u2648\uFE0F",
1559 "arrow_backward": "\u25C0\uFE0F",
1560 "arrow_double_down": "\u23EC",
1561 "arrow_double_up": "\u23EB",
1562 "arrow_down": "\u2B07\uFE0F",
1563 "arrow_down_small": "\u{1F53D}",
1564 "arrow_forward": "\u25B6\uFE0F",
1565 "arrow_heading_down": "\u2935\uFE0F",
1566 "arrow_heading_up": "\u2934\uFE0F",
1567 "arrow_left": "\u2B05\uFE0F",
1568 "arrow_lower_left": "\u2199\uFE0F",
1569 "arrow_lower_right": "\u2198\uFE0F",
1570 "arrow_right": "\u27A1\uFE0F",
1571 "arrow_right_hook": "\u21AA\uFE0F",
1572 "arrow_up": "\u2B06\uFE0F",
1573 "arrow_up_down": "\u2195\uFE0F",
1574 "arrow_up_small": "\u{1F53C}",
1575 "arrow_upper_left": "\u2196\uFE0F",
1576 "arrow_upper_right": "\u2197\uFE0F",
1577 "arrows_clockwise": "\u{1F503}",
1578 "arrows_counterclockwise": "\u{1F504}",
1579 "art": "\u{1F3A8}",
1580 "articulated_lorry": "\u{1F69B}",
1581 "artificial_satellite": "\u{1F6F0}",
1582 "astonished": "\u{1F632}",
1583 "athletic_shoe": "\u{1F45F}",
1584 "atm": "\u{1F3E7}",
1585 "atom_symbol": "\u269B\uFE0F",
1586 "avocado": "\u{1F951}",
1587 "b": "\u{1F171}\uFE0F",
1588 "baby": "\u{1F476}",
1589 "baby_bottle": "\u{1F37C}",
1590 "baby_chick": "\u{1F424}",
1591 "baby_symbol": "\u{1F6BC}",
1592 "back": "\u{1F519}",
1593 "bacon": "\u{1F953}",
1594 "badminton": "\u{1F3F8}",
1595 "baggage_claim": "\u{1F6C4}",
1596 "baguette_bread": "\u{1F956}",
1597 "balance_scale": "\u2696\uFE0F",
1598 "balloon": "\u{1F388}",
1599 "ballot_box": "\u{1F5F3}",
1600 "ballot_box_with_check": "\u2611\uFE0F",
1601 "bamboo": "\u{1F38D}",
1602 "banana": "\u{1F34C}",
1603 "bangbang": "\u203C\uFE0F",
1604 "bank": "\u{1F3E6}",
1605 "bar_chart": "\u{1F4CA}",
1606 "barber": "\u{1F488}",
1607 "baseball": "\u26BE\uFE0F",
1608 "basketball": "\u{1F3C0}",
1609 "basketball_man": "\u26F9\uFE0F",
1610 "basketball_woman": "\u26F9\uFE0F&zwj;\u2640\uFE0F",
1611 "bat": "\u{1F987}",
1612 "bath": "\u{1F6C0}",
1613 "bathtub": "\u{1F6C1}",
1614 "battery": "\u{1F50B}",
1615 "beach_umbrella": "\u{1F3D6}",
1616 "bear": "\u{1F43B}",
1617 "bed": "\u{1F6CF}",
1618 "bee": "\u{1F41D}",
1619 "beer": "\u{1F37A}",
1620 "beers": "\u{1F37B}",
1621 "beetle": "\u{1F41E}",
1622 "beginner": "\u{1F530}",
1623 "bell": "\u{1F514}",
1624 "bellhop_bell": "\u{1F6CE}",
1625 "bento": "\u{1F371}",
1626 "biking_man": "\u{1F6B4}",
1627 "bike": "\u{1F6B2}",
1628 "biking_woman": "\u{1F6B4}&zwj;\u2640\uFE0F",
1629 "bikini": "\u{1F459}",
1630 "biohazard": "\u2623\uFE0F",
1631 "bird": "\u{1F426}",
1632 "birthday": "\u{1F382}",
1633 "black_circle": "\u26AB\uFE0F",
1634 "black_flag": "\u{1F3F4}",
1635 "black_heart": "\u{1F5A4}",
1636 "black_joker": "\u{1F0CF}",
1637 "black_large_square": "\u2B1B\uFE0F",
1638 "black_medium_small_square": "\u25FE\uFE0F",
1639 "black_medium_square": "\u25FC\uFE0F",
1640 "black_nib": "\u2712\uFE0F",
1641 "black_small_square": "\u25AA\uFE0F",
1642 "black_square_button": "\u{1F532}",
1643 "blonde_man": "\u{1F471}",
1644 "blonde_woman": "\u{1F471}&zwj;\u2640\uFE0F",
1645 "blossom": "\u{1F33C}",
1646 "blowfish": "\u{1F421}",
1647 "blue_book": "\u{1F4D8}",
1648 "blue_car": "\u{1F699}",
1649 "blue_heart": "\u{1F499}",
1650 "blush": "\u{1F60A}",
1651 "boar": "\u{1F417}",
1652 "boat": "\u26F5\uFE0F",
1653 "bomb": "\u{1F4A3}",
1654 "book": "\u{1F4D6}",
1655 "bookmark": "\u{1F516}",
1656 "bookmark_tabs": "\u{1F4D1}",
1657 "books": "\u{1F4DA}",
1658 "boom": "\u{1F4A5}",
1659 "boot": "\u{1F462}",
1660 "bouquet": "\u{1F490}",
1661 "bowing_man": "\u{1F647}",
1662 "bow_and_arrow": "\u{1F3F9}",
1663 "bowing_woman": "\u{1F647}&zwj;\u2640\uFE0F",
1664 "bowling": "\u{1F3B3}",
1665 "boxing_glove": "\u{1F94A}",
1666 "boy": "\u{1F466}",
1667 "bread": "\u{1F35E}",
1668 "bride_with_veil": "\u{1F470}",
1669 "bridge_at_night": "\u{1F309}",
1670 "briefcase": "\u{1F4BC}",
1671 "broken_heart": "\u{1F494}",
1672 "bug": "\u{1F41B}",
1673 "building_construction": "\u{1F3D7}",
1674 "bulb": "\u{1F4A1}",
1675 "bullettrain_front": "\u{1F685}",
1676 "bullettrain_side": "\u{1F684}",
1677 "burrito": "\u{1F32F}",
1678 "bus": "\u{1F68C}",
1679 "business_suit_levitating": "\u{1F574}",
1680 "busstop": "\u{1F68F}",
1681 "bust_in_silhouette": "\u{1F464}",
1682 "busts_in_silhouette": "\u{1F465}",
1683 "butterfly": "\u{1F98B}",
1684 "cactus": "\u{1F335}",
1685 "cake": "\u{1F370}",
1686 "calendar": "\u{1F4C6}",
1687 "call_me_hand": "\u{1F919}",
1688 "calling": "\u{1F4F2}",
1689 "camel": "\u{1F42B}",
1690 "camera": "\u{1F4F7}",
1691 "camera_flash": "\u{1F4F8}",
1692 "camping": "\u{1F3D5}",
1693 "cancer": "\u264B\uFE0F",
1694 "candle": "\u{1F56F}",
1695 "candy": "\u{1F36C}",
1696 "canoe": "\u{1F6F6}",
1697 "capital_abcd": "\u{1F520}",
1698 "capricorn": "\u2651\uFE0F",
1699 "car": "\u{1F697}",
1700 "card_file_box": "\u{1F5C3}",
1701 "card_index": "\u{1F4C7}",
1702 "card_index_dividers": "\u{1F5C2}",
1703 "carousel_horse": "\u{1F3A0}",
1704 "carrot": "\u{1F955}",
1705 "cat": "\u{1F431}",
1706 "cat2": "\u{1F408}",
1707 "cd": "\u{1F4BF}",
1708 "chains": "\u26D3",
1709 "champagne": "\u{1F37E}",
1710 "chart": "\u{1F4B9}",
1711 "chart_with_downwards_trend": "\u{1F4C9}",
1712 "chart_with_upwards_trend": "\u{1F4C8}",
1713 "checkered_flag": "\u{1F3C1}",
1714 "cheese": "\u{1F9C0}",
1715 "cherries": "\u{1F352}",
1716 "cherry_blossom": "\u{1F338}",
1717 "chestnut": "\u{1F330}",
1718 "chicken": "\u{1F414}",
1719 "children_crossing": "\u{1F6B8}",
1720 "chipmunk": "\u{1F43F}",
1721 "chocolate_bar": "\u{1F36B}",
1722 "christmas_tree": "\u{1F384}",
1723 "church": "\u26EA\uFE0F",
1724 "cinema": "\u{1F3A6}",
1725 "circus_tent": "\u{1F3AA}",
1726 "city_sunrise": "\u{1F307}",
1727 "city_sunset": "\u{1F306}",
1728 "cityscape": "\u{1F3D9}",
1729 "cl": "\u{1F191}",
1730 "clamp": "\u{1F5DC}",
1731 "clap": "\u{1F44F}",
1732 "clapper": "\u{1F3AC}",
1733 "classical_building": "\u{1F3DB}",
1734 "clinking_glasses": "\u{1F942}",
1735 "clipboard": "\u{1F4CB}",
1736 "clock1": "\u{1F550}",
1737 "clock10": "\u{1F559}",
1738 "clock1030": "\u{1F565}",
1739 "clock11": "\u{1F55A}",
1740 "clock1130": "\u{1F566}",
1741 "clock12": "\u{1F55B}",
1742 "clock1230": "\u{1F567}",
1743 "clock130": "\u{1F55C}",
1744 "clock2": "\u{1F551}",
1745 "clock230": "\u{1F55D}",
1746 "clock3": "\u{1F552}",
1747 "clock330": "\u{1F55E}",
1748 "clock4": "\u{1F553}",
1749 "clock430": "\u{1F55F}",
1750 "clock5": "\u{1F554}",
1751 "clock530": "\u{1F560}",
1752 "clock6": "\u{1F555}",
1753 "clock630": "\u{1F561}",
1754 "clock7": "\u{1F556}",
1755 "clock730": "\u{1F562}",
1756 "clock8": "\u{1F557}",
1757 "clock830": "\u{1F563}",
1758 "clock9": "\u{1F558}",
1759 "clock930": "\u{1F564}",
1760 "closed_book": "\u{1F4D5}",
1761 "closed_lock_with_key": "\u{1F510}",
1762 "closed_umbrella": "\u{1F302}",
1763 "cloud": "\u2601\uFE0F",
1764 "cloud_with_lightning": "\u{1F329}",
1765 "cloud_with_lightning_and_rain": "\u26C8",
1766 "cloud_with_rain": "\u{1F327}",
1767 "cloud_with_snow": "\u{1F328}",
1768 "clown_face": "\u{1F921}",
1769 "clubs": "\u2663\uFE0F",
1770 "cocktail": "\u{1F378}",
1771 "coffee": "\u2615\uFE0F",
1772 "coffin": "\u26B0\uFE0F",
1773 "cold_sweat": "\u{1F630}",
1774 "comet": "\u2604\uFE0F",
1775 "computer": "\u{1F4BB}",
1776 "computer_mouse": "\u{1F5B1}",
1777 "confetti_ball": "\u{1F38A}",
1778 "confounded": "\u{1F616}",
1779 "confused": "\u{1F615}",
1780 "congratulations": "\u3297\uFE0F",
1781 "construction": "\u{1F6A7}",
1782 "construction_worker_man": "\u{1F477}",
1783 "construction_worker_woman": "\u{1F477}&zwj;\u2640\uFE0F",
1784 "control_knobs": "\u{1F39B}",
1785 "convenience_store": "\u{1F3EA}",
1786 "cookie": "\u{1F36A}",
1787 "cool": "\u{1F192}",
1788 "policeman": "\u{1F46E}",
1789 "copyright": "\xA9\uFE0F",
1790 "corn": "\u{1F33D}",
1791 "couch_and_lamp": "\u{1F6CB}",
1792 "couple": "\u{1F46B}",
1793 "couple_with_heart_woman_man": "\u{1F491}",
1794 "couple_with_heart_man_man": "\u{1F468}&zwj;\u2764\uFE0F&zwj;\u{1F468}",
1795 "couple_with_heart_woman_woman": "\u{1F469}&zwj;\u2764\uFE0F&zwj;\u{1F469}",
1796 "couplekiss_man_man": "\u{1F468}&zwj;\u2764\uFE0F&zwj;\u{1F48B}&zwj;\u{1F468}",
1797 "couplekiss_man_woman": "\u{1F48F}",
1798 "couplekiss_woman_woman": "\u{1F469}&zwj;\u2764\uFE0F&zwj;\u{1F48B}&zwj;\u{1F469}",
1799 "cow": "\u{1F42E}",
1800 "cow2": "\u{1F404}",
1801 "cowboy_hat_face": "\u{1F920}",
1802 "crab": "\u{1F980}",
1803 "crayon": "\u{1F58D}",
1804 "credit_card": "\u{1F4B3}",
1805 "crescent_moon": "\u{1F319}",
1806 "cricket": "\u{1F3CF}",
1807 "crocodile": "\u{1F40A}",
1808 "croissant": "\u{1F950}",
1809 "crossed_fingers": "\u{1F91E}",
1810 "crossed_flags": "\u{1F38C}",
1811 "crossed_swords": "\u2694\uFE0F",
1812 "crown": "\u{1F451}",
1813 "cry": "\u{1F622}",
1814 "crying_cat_face": "\u{1F63F}",
1815 "crystal_ball": "\u{1F52E}",
1816 "cucumber": "\u{1F952}",
1817 "cupid": "\u{1F498}",
1818 "curly_loop": "\u27B0",
1819 "currency_exchange": "\u{1F4B1}",
1820 "curry": "\u{1F35B}",
1821 "custard": "\u{1F36E}",
1822 "customs": "\u{1F6C3}",
1823 "cyclone": "\u{1F300}",
1824 "dagger": "\u{1F5E1}",
1825 "dancer": "\u{1F483}",
1826 "dancing_women": "\u{1F46F}",
1827 "dancing_men": "\u{1F46F}&zwj;\u2642\uFE0F",
1828 "dango": "\u{1F361}",
1829 "dark_sunglasses": "\u{1F576}",
1830 "dart": "\u{1F3AF}",
1831 "dash": "\u{1F4A8}",
1832 "date": "\u{1F4C5}",
1833 "deciduous_tree": "\u{1F333}",
1834 "deer": "\u{1F98C}",
1835 "department_store": "\u{1F3EC}",
1836 "derelict_house": "\u{1F3DA}",
1837 "desert": "\u{1F3DC}",
1838 "desert_island": "\u{1F3DD}",
1839 "desktop_computer": "\u{1F5A5}",
1840 "male_detective": "\u{1F575}\uFE0F",
1841 "diamond_shape_with_a_dot_inside": "\u{1F4A0}",
1842 "diamonds": "\u2666\uFE0F",
1843 "disappointed": "\u{1F61E}",
1844 "disappointed_relieved": "\u{1F625}",
1845 "dizzy": "\u{1F4AB}",
1846 "dizzy_face": "\u{1F635}",
1847 "do_not_litter": "\u{1F6AF}",
1848 "dog": "\u{1F436}",
1849 "dog2": "\u{1F415}",
1850 "dollar": "\u{1F4B5}",
1851 "dolls": "\u{1F38E}",
1852 "dolphin": "\u{1F42C}",
1853 "door": "\u{1F6AA}",
1854 "doughnut": "\u{1F369}",
1855 "dove": "\u{1F54A}",
1856 "dragon": "\u{1F409}",
1857 "dragon_face": "\u{1F432}",
1858 "dress": "\u{1F457}",
1859 "dromedary_camel": "\u{1F42A}",
1860 "drooling_face": "\u{1F924}",
1861 "droplet": "\u{1F4A7}",
1862 "drum": "\u{1F941}",
1863 "duck": "\u{1F986}",
1864 "dvd": "\u{1F4C0}",
1865 "e-mail": "\u{1F4E7}",
1866 "eagle": "\u{1F985}",
1867 "ear": "\u{1F442}",
1868 "ear_of_rice": "\u{1F33E}",
1869 "earth_africa": "\u{1F30D}",
1870 "earth_americas": "\u{1F30E}",
1871 "earth_asia": "\u{1F30F}",
1872 "egg": "\u{1F95A}",
1873 "eggplant": "\u{1F346}",
1874 "eight_pointed_black_star": "\u2734\uFE0F",
1875 "eight_spoked_asterisk": "\u2733\uFE0F",
1876 "electric_plug": "\u{1F50C}",
1877 "elephant": "\u{1F418}",
1878 "email": "\u2709\uFE0F",
1879 "end": "\u{1F51A}",
1880 "envelope_with_arrow": "\u{1F4E9}",
1881 "euro": "\u{1F4B6}",
1882 "european_castle": "\u{1F3F0}",
1883 "european_post_office": "\u{1F3E4}",
1884 "evergreen_tree": "\u{1F332}",
1885 "exclamation": "\u2757\uFE0F",
1886 "expressionless": "\u{1F611}",
1887 "eye": "\u{1F441}",
1888 "eye_speech_bubble": "\u{1F441}&zwj;\u{1F5E8}",
1889 "eyeglasses": "\u{1F453}",
1890 "eyes": "\u{1F440}",
1891 "face_with_head_bandage": "\u{1F915}",
1892 "face_with_thermometer": "\u{1F912}",
1893 "fist_oncoming": "\u{1F44A}",
1894 "factory": "\u{1F3ED}",
1895 "fallen_leaf": "\u{1F342}",
1896 "family_man_woman_boy": "\u{1F46A}",
1897 "family_man_boy": "\u{1F468}&zwj;\u{1F466}",
1898 "family_man_boy_boy": "\u{1F468}&zwj;\u{1F466}&zwj;\u{1F466}",
1899 "family_man_girl": "\u{1F468}&zwj;\u{1F467}",
1900 "family_man_girl_boy": "\u{1F468}&zwj;\u{1F467}&zwj;\u{1F466}",
1901 "family_man_girl_girl": "\u{1F468}&zwj;\u{1F467}&zwj;\u{1F467}",
1902 "family_man_man_boy": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F466}",
1903 "family_man_man_boy_boy": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F466}&zwj;\u{1F466}",
1904 "family_man_man_girl": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F467}",
1905 "family_man_man_girl_boy": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F467}&zwj;\u{1F466}",
1906 "family_man_man_girl_girl": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F467}&zwj;\u{1F467}",
1907 "family_man_woman_boy_boy": "\u{1F468}&zwj;\u{1F469}&zwj;\u{1F466}&zwj;\u{1F466}",
1908 "family_man_woman_girl": "\u{1F468}&zwj;\u{1F469}&zwj;\u{1F467}",
1909 "family_man_woman_girl_boy": "\u{1F468}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F466}",
1910 "family_man_woman_girl_girl": "\u{1F468}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F467}",
1911 "family_woman_boy": "\u{1F469}&zwj;\u{1F466}",
1912 "family_woman_boy_boy": "\u{1F469}&zwj;\u{1F466}&zwj;\u{1F466}",
1913 "family_woman_girl": "\u{1F469}&zwj;\u{1F467}",
1914 "family_woman_girl_boy": "\u{1F469}&zwj;\u{1F467}&zwj;\u{1F466}",
1915 "family_woman_girl_girl": "\u{1F469}&zwj;\u{1F467}&zwj;\u{1F467}",
1916 "family_woman_woman_boy": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F466}",
1917 "family_woman_woman_boy_boy": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F466}&zwj;\u{1F466}",
1918 "family_woman_woman_girl": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F467}",
1919 "family_woman_woman_girl_boy": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F466}",
1920 "family_woman_woman_girl_girl": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F467}",
1921 "fast_forward": "\u23E9",
1922 "fax": "\u{1F4E0}",
1923 "fearful": "\u{1F628}",
1924 "feet": "\u{1F43E}",
1925 "female_detective": "\u{1F575}\uFE0F&zwj;\u2640\uFE0F",
1926 "ferris_wheel": "\u{1F3A1}",
1927 "ferry": "\u26F4",
1928 "field_hockey": "\u{1F3D1}",
1929 "file_cabinet": "\u{1F5C4}",
1930 "file_folder": "\u{1F4C1}",
1931 "film_projector": "\u{1F4FD}",
1932 "film_strip": "\u{1F39E}",
1933 "fire": "\u{1F525}",
1934 "fire_engine": "\u{1F692}",
1935 "fireworks": "\u{1F386}",
1936 "first_quarter_moon": "\u{1F313}",
1937 "first_quarter_moon_with_face": "\u{1F31B}",
1938 "fish": "\u{1F41F}",
1939 "fish_cake": "\u{1F365}",
1940 "fishing_pole_and_fish": "\u{1F3A3}",
1941 "fist_raised": "\u270A",
1942 "fist_left": "\u{1F91B}",
1943 "fist_right": "\u{1F91C}",
1944 "flags": "\u{1F38F}",
1945 "flashlight": "\u{1F526}",
1946 "fleur_de_lis": "\u269C\uFE0F",
1947 "flight_arrival": "\u{1F6EC}",
1948 "flight_departure": "\u{1F6EB}",
1949 "floppy_disk": "\u{1F4BE}",
1950 "flower_playing_cards": "\u{1F3B4}",
1951 "flushed": "\u{1F633}",
1952 "fog": "\u{1F32B}",
1953 "foggy": "\u{1F301}",
1954 "football": "\u{1F3C8}",
1955 "footprints": "\u{1F463}",
1956 "fork_and_knife": "\u{1F374}",
1957 "fountain": "\u26F2\uFE0F",
1958 "fountain_pen": "\u{1F58B}",
1959 "four_leaf_clover": "\u{1F340}",
1960 "fox_face": "\u{1F98A}",
1961 "framed_picture": "\u{1F5BC}",
1962 "free": "\u{1F193}",
1963 "fried_egg": "\u{1F373}",
1964 "fried_shrimp": "\u{1F364}",
1965 "fries": "\u{1F35F}",
1966 "frog": "\u{1F438}",
1967 "frowning": "\u{1F626}",
1968 "frowning_face": "\u2639\uFE0F",
1969 "frowning_man": "\u{1F64D}&zwj;\u2642\uFE0F",
1970 "frowning_woman": "\u{1F64D}",
1971 "middle_finger": "\u{1F595}",
1972 "fuelpump": "\u26FD\uFE0F",
1973 "full_moon": "\u{1F315}",
1974 "full_moon_with_face": "\u{1F31D}",
1975 "funeral_urn": "\u26B1\uFE0F",
1976 "game_die": "\u{1F3B2}",
1977 "gear": "\u2699\uFE0F",
1978 "gem": "\u{1F48E}",
1979 "gemini": "\u264A\uFE0F",
1980 "ghost": "\u{1F47B}",
1981 "gift": "\u{1F381}",
1982 "gift_heart": "\u{1F49D}",
1983 "girl": "\u{1F467}",
1984 "globe_with_meridians": "\u{1F310}",
1985 "goal_net": "\u{1F945}",
1986 "goat": "\u{1F410}",
1987 "golf": "\u26F3\uFE0F",
1988 "golfing_man": "\u{1F3CC}\uFE0F",
1989 "golfing_woman": "\u{1F3CC}\uFE0F&zwj;\u2640\uFE0F",
1990 "gorilla": "\u{1F98D}",
1991 "grapes": "\u{1F347}",
1992 "green_apple": "\u{1F34F}",
1993 "green_book": "\u{1F4D7}",
1994 "green_heart": "\u{1F49A}",
1995 "green_salad": "\u{1F957}",
1996 "grey_exclamation": "\u2755",
1997 "grey_question": "\u2754",
1998 "grimacing": "\u{1F62C}",
1999 "grin": "\u{1F601}",
2000 "grinning": "\u{1F600}",
2001 "guardsman": "\u{1F482}",
2002 "guardswoman": "\u{1F482}&zwj;\u2640\uFE0F",
2003 "guitar": "\u{1F3B8}",
2004 "gun": "\u{1F52B}",
2005 "haircut_woman": "\u{1F487}",
2006 "haircut_man": "\u{1F487}&zwj;\u2642\uFE0F",
2007 "hamburger": "\u{1F354}",
2008 "hammer": "\u{1F528}",
2009 "hammer_and_pick": "\u2692",
2010 "hammer_and_wrench": "\u{1F6E0}",
2011 "hamster": "\u{1F439}",
2012 "hand": "\u270B",
2013 "handbag": "\u{1F45C}",
2014 "handshake": "\u{1F91D}",
2015 "hankey": "\u{1F4A9}",
2016 "hatched_chick": "\u{1F425}",
2017 "hatching_chick": "\u{1F423}",
2018 "headphones": "\u{1F3A7}",
2019 "hear_no_evil": "\u{1F649}",
2020 "heart": "\u2764\uFE0F",
2021 "heart_decoration": "\u{1F49F}",
2022 "heart_eyes": "\u{1F60D}",
2023 "heart_eyes_cat": "\u{1F63B}",
2024 "heartbeat": "\u{1F493}",
2025 "heartpulse": "\u{1F497}",
2026 "hearts": "\u2665\uFE0F",
2027 "heavy_check_mark": "\u2714\uFE0F",
2028 "heavy_division_sign": "\u2797",
2029 "heavy_dollar_sign": "\u{1F4B2}",
2030 "heavy_heart_exclamation": "\u2763\uFE0F",
2031 "heavy_minus_sign": "\u2796",
2032 "heavy_multiplication_x": "\u2716\uFE0F",
2033 "heavy_plus_sign": "\u2795",
2034 "helicopter": "\u{1F681}",
2035 "herb": "\u{1F33F}",
2036 "hibiscus": "\u{1F33A}",
2037 "high_brightness": "\u{1F506}",
2038 "high_heel": "\u{1F460}",
2039 "hocho": "\u{1F52A}",
2040 "hole": "\u{1F573}",
2041 "honey_pot": "\u{1F36F}",
2042 "horse": "\u{1F434}",
2043 "horse_racing": "\u{1F3C7}",
2044 "hospital": "\u{1F3E5}",
2045 "hot_pepper": "\u{1F336}",
2046 "hotdog": "\u{1F32D}",
2047 "hotel": "\u{1F3E8}",
2048 "hotsprings": "\u2668\uFE0F",
2049 "hourglass": "\u231B\uFE0F",
2050 "hourglass_flowing_sand": "\u23F3",
2051 "house": "\u{1F3E0}",
2052 "house_with_garden": "\u{1F3E1}",
2053 "houses": "\u{1F3D8}",
2054 "hugs": "\u{1F917}",
2055 "hushed": "\u{1F62F}",
2056 "ice_cream": "\u{1F368}",
2057 "ice_hockey": "\u{1F3D2}",
2058 "ice_skate": "\u26F8",
2059 "icecream": "\u{1F366}",
2060 "id": "\u{1F194}",
2061 "ideograph_advantage": "\u{1F250}",
2062 "imp": "\u{1F47F}",
2063 "inbox_tray": "\u{1F4E5}",
2064 "incoming_envelope": "\u{1F4E8}",
2065 "tipping_hand_woman": "\u{1F481}",
2066 "information_source": "\u2139\uFE0F",
2067 "innocent": "\u{1F607}",
2068 "interrobang": "\u2049\uFE0F",
2069 "iphone": "\u{1F4F1}",
2070 "izakaya_lantern": "\u{1F3EE}",
2071 "jack_o_lantern": "\u{1F383}",
2072 "japan": "\u{1F5FE}",
2073 "japanese_castle": "\u{1F3EF}",
2074 "japanese_goblin": "\u{1F47A}",
2075 "japanese_ogre": "\u{1F479}",
2076 "jeans": "\u{1F456}",
2077 "joy": "\u{1F602}",
2078 "joy_cat": "\u{1F639}",
2079 "joystick": "\u{1F579}",
2080 "kaaba": "\u{1F54B}",
2081 "key": "\u{1F511}",
2082 "keyboard": "\u2328\uFE0F",
2083 "keycap_ten": "\u{1F51F}",
2084 "kick_scooter": "\u{1F6F4}",
2085 "kimono": "\u{1F458}",
2086 "kiss": "\u{1F48B}",
2087 "kissing": "\u{1F617}",
2088 "kissing_cat": "\u{1F63D}",
2089 "kissing_closed_eyes": "\u{1F61A}",
2090 "kissing_heart": "\u{1F618}",
2091 "kissing_smiling_eyes": "\u{1F619}",
2092 "kiwi_fruit": "\u{1F95D}",
2093 "koala": "\u{1F428}",
2094 "koko": "\u{1F201}",
2095 "label": "\u{1F3F7}",
2096 "large_blue_circle": "\u{1F535}",
2097 "large_blue_diamond": "\u{1F537}",
2098 "large_orange_diamond": "\u{1F536}",
2099 "last_quarter_moon": "\u{1F317}",
2100 "last_quarter_moon_with_face": "\u{1F31C}",
2101 "latin_cross": "\u271D\uFE0F",
2102 "laughing": "\u{1F606}",
2103 "leaves": "\u{1F343}",
2104 "ledger": "\u{1F4D2}",
2105 "left_luggage": "\u{1F6C5}",
2106 "left_right_arrow": "\u2194\uFE0F",
2107 "leftwards_arrow_with_hook": "\u21A9\uFE0F",
2108 "lemon": "\u{1F34B}",
2109 "leo": "\u264C\uFE0F",
2110 "leopard": "\u{1F406}",
2111 "level_slider": "\u{1F39A}",
2112 "libra": "\u264E\uFE0F",
2113 "light_rail": "\u{1F688}",
2114 "link": "\u{1F517}",
2115 "lion": "\u{1F981}",
2116 "lips": "\u{1F444}",
2117 "lipstick": "\u{1F484}",
2118 "lizard": "\u{1F98E}",
2119 "lock": "\u{1F512}",
2120 "lock_with_ink_pen": "\u{1F50F}",
2121 "lollipop": "\u{1F36D}",
2122 "loop": "\u27BF",
2123 "loud_sound": "\u{1F50A}",
2124 "loudspeaker": "\u{1F4E2}",
2125 "love_hotel": "\u{1F3E9}",
2126 "love_letter": "\u{1F48C}",
2127 "low_brightness": "\u{1F505}",
2128 "lying_face": "\u{1F925}",
2129 "m": "\u24C2\uFE0F",
2130 "mag": "\u{1F50D}",
2131 "mag_right": "\u{1F50E}",
2132 "mahjong": "\u{1F004}\uFE0F",
2133 "mailbox": "\u{1F4EB}",
2134 "mailbox_closed": "\u{1F4EA}",
2135 "mailbox_with_mail": "\u{1F4EC}",
2136 "mailbox_with_no_mail": "\u{1F4ED}",
2137 "man": "\u{1F468}",
2138 "man_artist": "\u{1F468}&zwj;\u{1F3A8}",
2139 "man_astronaut": "\u{1F468}&zwj;\u{1F680}",
2140 "man_cartwheeling": "\u{1F938}&zwj;\u2642\uFE0F",
2141 "man_cook": "\u{1F468}&zwj;\u{1F373}",
2142 "man_dancing": "\u{1F57A}",
2143 "man_facepalming": "\u{1F926}&zwj;\u2642\uFE0F",
2144 "man_factory_worker": "\u{1F468}&zwj;\u{1F3ED}",
2145 "man_farmer": "\u{1F468}&zwj;\u{1F33E}",
2146 "man_firefighter": "\u{1F468}&zwj;\u{1F692}",
2147 "man_health_worker": "\u{1F468}&zwj;\u2695\uFE0F",
2148 "man_in_tuxedo": "\u{1F935}",
2149 "man_judge": "\u{1F468}&zwj;\u2696\uFE0F",
2150 "man_juggling": "\u{1F939}&zwj;\u2642\uFE0F",
2151 "man_mechanic": "\u{1F468}&zwj;\u{1F527}",
2152 "man_office_worker": "\u{1F468}&zwj;\u{1F4BC}",
2153 "man_pilot": "\u{1F468}&zwj;\u2708\uFE0F",
2154 "man_playing_handball": "\u{1F93E}&zwj;\u2642\uFE0F",
2155 "man_playing_water_polo": "\u{1F93D}&zwj;\u2642\uFE0F",
2156 "man_scientist": "\u{1F468}&zwj;\u{1F52C}",
2157 "man_shrugging": "\u{1F937}&zwj;\u2642\uFE0F",
2158 "man_singer": "\u{1F468}&zwj;\u{1F3A4}",
2159 "man_student": "\u{1F468}&zwj;\u{1F393}",
2160 "man_teacher": "\u{1F468}&zwj;\u{1F3EB}",
2161 "man_technologist": "\u{1F468}&zwj;\u{1F4BB}",
2162 "man_with_gua_pi_mao": "\u{1F472}",
2163 "man_with_turban": "\u{1F473}",
2164 "tangerine": "\u{1F34A}",
2165 "mans_shoe": "\u{1F45E}",
2166 "mantelpiece_clock": "\u{1F570}",
2167 "maple_leaf": "\u{1F341}",
2168 "martial_arts_uniform": "\u{1F94B}",
2169 "mask": "\u{1F637}",
2170 "massage_woman": "\u{1F486}",
2171 "massage_man": "\u{1F486}&zwj;\u2642\uFE0F",
2172 "meat_on_bone": "\u{1F356}",
2173 "medal_military": "\u{1F396}",
2174 "medal_sports": "\u{1F3C5}",
2175 "mega": "\u{1F4E3}",
2176 "melon": "\u{1F348}",
2177 "memo": "\u{1F4DD}",
2178 "men_wrestling": "\u{1F93C}&zwj;\u2642\uFE0F",
2179 "menorah": "\u{1F54E}",
2180 "mens": "\u{1F6B9}",
2181 "metal": "\u{1F918}",
2182 "metro": "\u{1F687}",
2183 "microphone": "\u{1F3A4}",
2184 "microscope": "\u{1F52C}",
2185 "milk_glass": "\u{1F95B}",
2186 "milky_way": "\u{1F30C}",
2187 "minibus": "\u{1F690}",
2188 "minidisc": "\u{1F4BD}",
2189 "mobile_phone_off": "\u{1F4F4}",
2190 "money_mouth_face": "\u{1F911}",
2191 "money_with_wings": "\u{1F4B8}",
2192 "moneybag": "\u{1F4B0}",
2193 "monkey": "\u{1F412}",
2194 "monkey_face": "\u{1F435}",
2195 "monorail": "\u{1F69D}",
2196 "moon": "\u{1F314}",
2197 "mortar_board": "\u{1F393}",
2198 "mosque": "\u{1F54C}",
2199 "motor_boat": "\u{1F6E5}",
2200 "motor_scooter": "\u{1F6F5}",
2201 "motorcycle": "\u{1F3CD}",
2202 "motorway": "\u{1F6E3}",
2203 "mount_fuji": "\u{1F5FB}",
2204 "mountain": "\u26F0",
2205 "mountain_biking_man": "\u{1F6B5}",
2206 "mountain_biking_woman": "\u{1F6B5}&zwj;\u2640\uFE0F",
2207 "mountain_cableway": "\u{1F6A0}",
2208 "mountain_railway": "\u{1F69E}",
2209 "mountain_snow": "\u{1F3D4}",
2210 "mouse": "\u{1F42D}",
2211 "mouse2": "\u{1F401}",
2212 "movie_camera": "\u{1F3A5}",
2213 "moyai": "\u{1F5FF}",
2214 "mrs_claus": "\u{1F936}",
2215 "muscle": "\u{1F4AA}",
2216 "mushroom": "\u{1F344}",
2217 "musical_keyboard": "\u{1F3B9}",
2218 "musical_note": "\u{1F3B5}",
2219 "musical_score": "\u{1F3BC}",
2220 "mute": "\u{1F507}",
2221 "nail_care": "\u{1F485}",
2222 "name_badge": "\u{1F4DB}",
2223 "national_park": "\u{1F3DE}",
2224 "nauseated_face": "\u{1F922}",
2225 "necktie": "\u{1F454}",
2226 "negative_squared_cross_mark": "\u274E",
2227 "nerd_face": "\u{1F913}",
2228 "neutral_face": "\u{1F610}",
2229 "new": "\u{1F195}",
2230 "new_moon": "\u{1F311}",
2231 "new_moon_with_face": "\u{1F31A}",
2232 "newspaper": "\u{1F4F0}",
2233 "newspaper_roll": "\u{1F5DE}",
2234 "next_track_button": "\u23ED",
2235 "ng": "\u{1F196}",
2236 "no_good_man": "\u{1F645}&zwj;\u2642\uFE0F",
2237 "no_good_woman": "\u{1F645}",
2238 "night_with_stars": "\u{1F303}",
2239 "no_bell": "\u{1F515}",
2240 "no_bicycles": "\u{1F6B3}",
2241 "no_entry": "\u26D4\uFE0F",
2242 "no_entry_sign": "\u{1F6AB}",
2243 "no_mobile_phones": "\u{1F4F5}",
2244 "no_mouth": "\u{1F636}",
2245 "no_pedestrians": "\u{1F6B7}",
2246 "no_smoking": "\u{1F6AD}",
2247 "non-potable_water": "\u{1F6B1}",
2248 "nose": "\u{1F443}",
2249 "notebook": "\u{1F4D3}",
2250 "notebook_with_decorative_cover": "\u{1F4D4}",
2251 "notes": "\u{1F3B6}",
2252 "nut_and_bolt": "\u{1F529}",
2253 "o": "\u2B55\uFE0F",
2254 "o2": "\u{1F17E}\uFE0F",
2255 "ocean": "\u{1F30A}",
2256 "octopus": "\u{1F419}",
2257 "oden": "\u{1F362}",
2258 "office": "\u{1F3E2}",
2259 "oil_drum": "\u{1F6E2}",
2260 "ok": "\u{1F197}",
2261 "ok_hand": "\u{1F44C}",
2262 "ok_man": "\u{1F646}&zwj;\u2642\uFE0F",
2263 "ok_woman": "\u{1F646}",
2264 "old_key": "\u{1F5DD}",
2265 "older_man": "\u{1F474}",
2266 "older_woman": "\u{1F475}",
2267 "om": "\u{1F549}",
2268 "on": "\u{1F51B}",
2269 "oncoming_automobile": "\u{1F698}",
2270 "oncoming_bus": "\u{1F68D}",
2271 "oncoming_police_car": "\u{1F694}",
2272 "oncoming_taxi": "\u{1F696}",
2273 "open_file_folder": "\u{1F4C2}",
2274 "open_hands": "\u{1F450}",
2275 "open_mouth": "\u{1F62E}",
2276 "open_umbrella": "\u2602\uFE0F",
2277 "ophiuchus": "\u26CE",
2278 "orange_book": "\u{1F4D9}",
2279 "orthodox_cross": "\u2626\uFE0F",
2280 "outbox_tray": "\u{1F4E4}",
2281 "owl": "\u{1F989}",
2282 "ox": "\u{1F402}",
2283 "package": "\u{1F4E6}",
2284 "page_facing_up": "\u{1F4C4}",
2285 "page_with_curl": "\u{1F4C3}",
2286 "pager": "\u{1F4DF}",
2287 "paintbrush": "\u{1F58C}",
2288 "palm_tree": "\u{1F334}",
2289 "pancakes": "\u{1F95E}",
2290 "panda_face": "\u{1F43C}",
2291 "paperclip": "\u{1F4CE}",
2292 "paperclips": "\u{1F587}",
2293 "parasol_on_ground": "\u26F1",
2294 "parking": "\u{1F17F}\uFE0F",
2295 "part_alternation_mark": "\u303D\uFE0F",
2296 "partly_sunny": "\u26C5\uFE0F",
2297 "passenger_ship": "\u{1F6F3}",
2298 "passport_control": "\u{1F6C2}",
2299 "pause_button": "\u23F8",
2300 "peace_symbol": "\u262E\uFE0F",
2301 "peach": "\u{1F351}",
2302 "peanuts": "\u{1F95C}",
2303 "pear": "\u{1F350}",
2304 "pen": "\u{1F58A}",
2305 "pencil2": "\u270F\uFE0F",
2306 "penguin": "\u{1F427}",
2307 "pensive": "\u{1F614}",
2308 "performing_arts": "\u{1F3AD}",
2309 "persevere": "\u{1F623}",
2310 "person_fencing": "\u{1F93A}",
2311 "pouting_woman": "\u{1F64E}",
2312 "phone": "\u260E\uFE0F",
2313 "pick": "\u26CF",
2314 "pig": "\u{1F437}",
2315 "pig2": "\u{1F416}",
2316 "pig_nose": "\u{1F43D}",
2317 "pill": "\u{1F48A}",
2318 "pineapple": "\u{1F34D}",
2319 "ping_pong": "\u{1F3D3}",
2320 "pisces": "\u2653\uFE0F",
2321 "pizza": "\u{1F355}",
2322 "place_of_worship": "\u{1F6D0}",
2323 "plate_with_cutlery": "\u{1F37D}",
2324 "play_or_pause_button": "\u23EF",
2325 "point_down": "\u{1F447}",
2326 "point_left": "\u{1F448}",
2327 "point_right": "\u{1F449}",
2328 "point_up": "\u261D\uFE0F",
2329 "point_up_2": "\u{1F446}",
2330 "police_car": "\u{1F693}",
2331 "policewoman": "\u{1F46E}&zwj;\u2640\uFE0F",
2332 "poodle": "\u{1F429}",
2333 "popcorn": "\u{1F37F}",
2334 "post_office": "\u{1F3E3}",
2335 "postal_horn": "\u{1F4EF}",
2336 "postbox": "\u{1F4EE}",
2337 "potable_water": "\u{1F6B0}",
2338 "potato": "\u{1F954}",
2339 "pouch": "\u{1F45D}",
2340 "poultry_leg": "\u{1F357}",
2341 "pound": "\u{1F4B7}",
2342 "rage": "\u{1F621}",
2343 "pouting_cat": "\u{1F63E}",
2344 "pouting_man": "\u{1F64E}&zwj;\u2642\uFE0F",
2345 "pray": "\u{1F64F}",
2346 "prayer_beads": "\u{1F4FF}",
2347 "pregnant_woman": "\u{1F930}",
2348 "previous_track_button": "\u23EE",
2349 "prince": "\u{1F934}",
2350 "princess": "\u{1F478}",
2351 "printer": "\u{1F5A8}",
2352 "purple_heart": "\u{1F49C}",
2353 "purse": "\u{1F45B}",
2354 "pushpin": "\u{1F4CC}",
2355 "put_litter_in_its_place": "\u{1F6AE}",
2356 "question": "\u2753",
2357 "rabbit": "\u{1F430}",
2358 "rabbit2": "\u{1F407}",
2359 "racehorse": "\u{1F40E}",
2360 "racing_car": "\u{1F3CE}",
2361 "radio": "\u{1F4FB}",
2362 "radio_button": "\u{1F518}",
2363 "radioactive": "\u2622\uFE0F",
2364 "railway_car": "\u{1F683}",
2365 "railway_track": "\u{1F6E4}",
2366 "rainbow": "\u{1F308}",
2367 "rainbow_flag": "\u{1F3F3}\uFE0F&zwj;\u{1F308}",
2368 "raised_back_of_hand": "\u{1F91A}",
2369 "raised_hand_with_fingers_splayed": "\u{1F590}",
2370 "raised_hands": "\u{1F64C}",
2371 "raising_hand_woman": "\u{1F64B}",
2372 "raising_hand_man": "\u{1F64B}&zwj;\u2642\uFE0F",
2373 "ram": "\u{1F40F}",
2374 "ramen": "\u{1F35C}",
2375 "rat": "\u{1F400}",
2376 "record_button": "\u23FA",
2377 "recycle": "\u267B\uFE0F",
2378 "red_circle": "\u{1F534}",
2379 "registered": "\xAE\uFE0F",
2380 "relaxed": "\u263A\uFE0F",
2381 "relieved": "\u{1F60C}",
2382 "reminder_ribbon": "\u{1F397}",
2383 "repeat": "\u{1F501}",
2384 "repeat_one": "\u{1F502}",
2385 "rescue_worker_helmet": "\u26D1",
2386 "restroom": "\u{1F6BB}",
2387 "revolving_hearts": "\u{1F49E}",
2388 "rewind": "\u23EA",
2389 "rhinoceros": "\u{1F98F}",
2390 "ribbon": "\u{1F380}",
2391 "rice": "\u{1F35A}",
2392 "rice_ball": "\u{1F359}",
2393 "rice_cracker": "\u{1F358}",
2394 "rice_scene": "\u{1F391}",
2395 "right_anger_bubble": "\u{1F5EF}",
2396 "ring": "\u{1F48D}",
2397 "robot": "\u{1F916}",
2398 "rocket": "\u{1F680}",
2399 "rofl": "\u{1F923}",
2400 "roll_eyes": "\u{1F644}",
2401 "roller_coaster": "\u{1F3A2}",
2402 "rooster": "\u{1F413}",
2403 "rose": "\u{1F339}",
2404 "rosette": "\u{1F3F5}",
2405 "rotating_light": "\u{1F6A8}",
2406 "round_pushpin": "\u{1F4CD}",
2407 "rowing_man": "\u{1F6A3}",
2408 "rowing_woman": "\u{1F6A3}&zwj;\u2640\uFE0F",
2409 "rugby_football": "\u{1F3C9}",
2410 "running_man": "\u{1F3C3}",
2411 "running_shirt_with_sash": "\u{1F3BD}",
2412 "running_woman": "\u{1F3C3}&zwj;\u2640\uFE0F",
2413 "sa": "\u{1F202}\uFE0F",
2414 "sagittarius": "\u2650\uFE0F",
2415 "sake": "\u{1F376}",
2416 "sandal": "\u{1F461}",
2417 "santa": "\u{1F385}",
2418 "satellite": "\u{1F4E1}",
2419 "saxophone": "\u{1F3B7}",
2420 "school": "\u{1F3EB}",
2421 "school_satchel": "\u{1F392}",
2422 "scissors": "\u2702\uFE0F",
2423 "scorpion": "\u{1F982}",
2424 "scorpius": "\u264F\uFE0F",
2425 "scream": "\u{1F631}",
2426 "scream_cat": "\u{1F640}",
2427 "scroll": "\u{1F4DC}",
2428 "seat": "\u{1F4BA}",
2429 "secret": "\u3299\uFE0F",
2430 "see_no_evil": "\u{1F648}",
2431 "seedling": "\u{1F331}",
2432 "selfie": "\u{1F933}",
2433 "shallow_pan_of_food": "\u{1F958}",
2434 "shamrock": "\u2618\uFE0F",
2435 "shark": "\u{1F988}",
2436 "shaved_ice": "\u{1F367}",
2437 "sheep": "\u{1F411}",
2438 "shell": "\u{1F41A}",
2439 "shield": "\u{1F6E1}",
2440 "shinto_shrine": "\u26E9",
2441 "ship": "\u{1F6A2}",
2442 "shirt": "\u{1F455}",
2443 "shopping": "\u{1F6CD}",
2444 "shopping_cart": "\u{1F6D2}",
2445 "shower": "\u{1F6BF}",
2446 "shrimp": "\u{1F990}",
2447 "signal_strength": "\u{1F4F6}",
2448 "six_pointed_star": "\u{1F52F}",
2449 "ski": "\u{1F3BF}",
2450 "skier": "\u26F7",
2451 "skull": "\u{1F480}",
2452 "skull_and_crossbones": "\u2620\uFE0F",
2453 "sleeping": "\u{1F634}",
2454 "sleeping_bed": "\u{1F6CC}",
2455 "sleepy": "\u{1F62A}",
2456 "slightly_frowning_face": "\u{1F641}",
2457 "slightly_smiling_face": "\u{1F642}",
2458 "slot_machine": "\u{1F3B0}",
2459 "small_airplane": "\u{1F6E9}",
2460 "small_blue_diamond": "\u{1F539}",
2461 "small_orange_diamond": "\u{1F538}",
2462 "small_red_triangle": "\u{1F53A}",
2463 "small_red_triangle_down": "\u{1F53B}",
2464 "smile": "\u{1F604}",
2465 "smile_cat": "\u{1F638}",
2466 "smiley": "\u{1F603}",
2467 "smiley_cat": "\u{1F63A}",
2468 "smiling_imp": "\u{1F608}",
2469 "smirk": "\u{1F60F}",
2470 "smirk_cat": "\u{1F63C}",
2471 "smoking": "\u{1F6AC}",
2472 "snail": "\u{1F40C}",
2473 "snake": "\u{1F40D}",
2474 "sneezing_face": "\u{1F927}",
2475 "snowboarder": "\u{1F3C2}",
2476 "snowflake": "\u2744\uFE0F",
2477 "snowman": "\u26C4\uFE0F",
2478 "snowman_with_snow": "\u2603\uFE0F",
2479 "sob": "\u{1F62D}",
2480 "soccer": "\u26BD\uFE0F",
2481 "soon": "\u{1F51C}",
2482 "sos": "\u{1F198}",
2483 "sound": "\u{1F509}",
2484 "space_invader": "\u{1F47E}",
2485 "spades": "\u2660\uFE0F",
2486 "spaghetti": "\u{1F35D}",
2487 "sparkle": "\u2747\uFE0F",
2488 "sparkler": "\u{1F387}",
2489 "sparkles": "\u2728",
2490 "sparkling_heart": "\u{1F496}",
2491 "speak_no_evil": "\u{1F64A}",
2492 "speaker": "\u{1F508}",
2493 "speaking_head": "\u{1F5E3}",
2494 "speech_balloon": "\u{1F4AC}",
2495 "speedboat": "\u{1F6A4}",
2496 "spider": "\u{1F577}",
2497 "spider_web": "\u{1F578}",
2498 "spiral_calendar": "\u{1F5D3}",
2499 "spiral_notepad": "\u{1F5D2}",
2500 "spoon": "\u{1F944}",
2501 "squid": "\u{1F991}",
2502 "stadium": "\u{1F3DF}",
2503 "star": "\u2B50\uFE0F",
2504 "star2": "\u{1F31F}",
2505 "star_and_crescent": "\u262A\uFE0F",
2506 "star_of_david": "\u2721\uFE0F",
2507 "stars": "\u{1F320}",
2508 "station": "\u{1F689}",
2509 "statue_of_liberty": "\u{1F5FD}",
2510 "steam_locomotive": "\u{1F682}",
2511 "stew": "\u{1F372}",
2512 "stop_button": "\u23F9",
2513 "stop_sign": "\u{1F6D1}",
2514 "stopwatch": "\u23F1",
2515 "straight_ruler": "\u{1F4CF}",
2516 "strawberry": "\u{1F353}",
2517 "stuck_out_tongue": "\u{1F61B}",
2518 "stuck_out_tongue_closed_eyes": "\u{1F61D}",
2519 "stuck_out_tongue_winking_eye": "\u{1F61C}",
2520 "studio_microphone": "\u{1F399}",
2521 "stuffed_flatbread": "\u{1F959}",
2522 "sun_behind_large_cloud": "\u{1F325}",
2523 "sun_behind_rain_cloud": "\u{1F326}",
2524 "sun_behind_small_cloud": "\u{1F324}",
2525 "sun_with_face": "\u{1F31E}",
2526 "sunflower": "\u{1F33B}",
2527 "sunglasses": "\u{1F60E}",
2528 "sunny": "\u2600\uFE0F",
2529 "sunrise": "\u{1F305}",
2530 "sunrise_over_mountains": "\u{1F304}",
2531 "surfing_man": "\u{1F3C4}",
2532 "surfing_woman": "\u{1F3C4}&zwj;\u2640\uFE0F",
2533 "sushi": "\u{1F363}",
2534 "suspension_railway": "\u{1F69F}",
2535 "sweat": "\u{1F613}",
2536 "sweat_drops": "\u{1F4A6}",
2537 "sweat_smile": "\u{1F605}",
2538 "sweet_potato": "\u{1F360}",
2539 "swimming_man": "\u{1F3CA}",
2540 "swimming_woman": "\u{1F3CA}&zwj;\u2640\uFE0F",
2541 "symbols": "\u{1F523}",
2542 "synagogue": "\u{1F54D}",
2543 "syringe": "\u{1F489}",
2544 "taco": "\u{1F32E}",
2545 "tada": "\u{1F389}",
2546 "tanabata_tree": "\u{1F38B}",
2547 "taurus": "\u2649\uFE0F",
2548 "taxi": "\u{1F695}",
2549 "tea": "\u{1F375}",
2550 "telephone_receiver": "\u{1F4DE}",
2551 "telescope": "\u{1F52D}",
2552 "tennis": "\u{1F3BE}",
2553 "tent": "\u26FA\uFE0F",
2554 "thermometer": "\u{1F321}",
2555 "thinking": "\u{1F914}",
2556 "thought_balloon": "\u{1F4AD}",
2557 "ticket": "\u{1F3AB}",
2558 "tickets": "\u{1F39F}",
2559 "tiger": "\u{1F42F}",
2560 "tiger2": "\u{1F405}",
2561 "timer_clock": "\u23F2",
2562 "tipping_hand_man": "\u{1F481}&zwj;\u2642\uFE0F",
2563 "tired_face": "\u{1F62B}",
2564 "tm": "\u2122\uFE0F",
2565 "toilet": "\u{1F6BD}",
2566 "tokyo_tower": "\u{1F5FC}",
2567 "tomato": "\u{1F345}",
2568 "tongue": "\u{1F445}",
2569 "top": "\u{1F51D}",
2570 "tophat": "\u{1F3A9}",
2571 "tornado": "\u{1F32A}",
2572 "trackball": "\u{1F5B2}",
2573 "tractor": "\u{1F69C}",
2574 "traffic_light": "\u{1F6A5}",
2575 "train": "\u{1F68B}",
2576 "train2": "\u{1F686}",
2577 "tram": "\u{1F68A}",
2578 "triangular_flag_on_post": "\u{1F6A9}",
2579 "triangular_ruler": "\u{1F4D0}",
2580 "trident": "\u{1F531}",
2581 "triumph": "\u{1F624}",
2582 "trolleybus": "\u{1F68E}",
2583 "trophy": "\u{1F3C6}",
2584 "tropical_drink": "\u{1F379}",
2585 "tropical_fish": "\u{1F420}",
2586 "truck": "\u{1F69A}",
2587 "trumpet": "\u{1F3BA}",
2588 "tulip": "\u{1F337}",
2589 "tumbler_glass": "\u{1F943}",
2590 "turkey": "\u{1F983}",
2591 "turtle": "\u{1F422}",
2592 "tv": "\u{1F4FA}",
2593 "twisted_rightwards_arrows": "\u{1F500}",
2594 "two_hearts": "\u{1F495}",
2595 "two_men_holding_hands": "\u{1F46C}",
2596 "two_women_holding_hands": "\u{1F46D}",
2597 "u5272": "\u{1F239}",
2598 "u5408": "\u{1F234}",
2599 "u55b6": "\u{1F23A}",
2600 "u6307": "\u{1F22F}\uFE0F",
2601 "u6708": "\u{1F237}\uFE0F",
2602 "u6709": "\u{1F236}",
2603 "u6e80": "\u{1F235}",
2604 "u7121": "\u{1F21A}\uFE0F",
2605 "u7533": "\u{1F238}",
2606 "u7981": "\u{1F232}",
2607 "u7a7a": "\u{1F233}",
2608 "umbrella": "\u2614\uFE0F",
2609 "unamused": "\u{1F612}",
2610 "underage": "\u{1F51E}",
2611 "unicorn": "\u{1F984}",
2612 "unlock": "\u{1F513}",
2613 "up": "\u{1F199}",
2614 "upside_down_face": "\u{1F643}",
2615 "v": "\u270C\uFE0F",
2616 "vertical_traffic_light": "\u{1F6A6}",
2617 "vhs": "\u{1F4FC}",
2618 "vibration_mode": "\u{1F4F3}",
2619 "video_camera": "\u{1F4F9}",
2620 "video_game": "\u{1F3AE}",
2621 "violin": "\u{1F3BB}",
2622 "virgo": "\u264D\uFE0F",
2623 "volcano": "\u{1F30B}",
2624 "volleyball": "\u{1F3D0}",
2625 "vs": "\u{1F19A}",
2626 "vulcan_salute": "\u{1F596}",
2627 "walking_man": "\u{1F6B6}",
2628 "walking_woman": "\u{1F6B6}&zwj;\u2640\uFE0F",
2629 "waning_crescent_moon": "\u{1F318}",
2630 "waning_gibbous_moon": "\u{1F316}",
2631 "warning": "\u26A0\uFE0F",
2632 "wastebasket": "\u{1F5D1}",
2633 "watch": "\u231A\uFE0F",
2634 "water_buffalo": "\u{1F403}",
2635 "watermelon": "\u{1F349}",
2636 "wave": "\u{1F44B}",
2637 "wavy_dash": "\u3030\uFE0F",
2638 "waxing_crescent_moon": "\u{1F312}",
2639 "wc": "\u{1F6BE}",
2640 "weary": "\u{1F629}",
2641 "wedding": "\u{1F492}",
2642 "weight_lifting_man": "\u{1F3CB}\uFE0F",
2643 "weight_lifting_woman": "\u{1F3CB}\uFE0F&zwj;\u2640\uFE0F",
2644 "whale": "\u{1F433}",
2645 "whale2": "\u{1F40B}",
2646 "wheel_of_dharma": "\u2638\uFE0F",
2647 "wheelchair": "\u267F\uFE0F",
2648 "white_check_mark": "\u2705",
2649 "white_circle": "\u26AA\uFE0F",
2650 "white_flag": "\u{1F3F3}\uFE0F",
2651 "white_flower": "\u{1F4AE}",
2652 "white_large_square": "\u2B1C\uFE0F",
2653 "white_medium_small_square": "\u25FD\uFE0F",
2654 "white_medium_square": "\u25FB\uFE0F",
2655 "white_small_square": "\u25AB\uFE0F",
2656 "white_square_button": "\u{1F533}",
2657 "wilted_flower": "\u{1F940}",
2658 "wind_chime": "\u{1F390}",
2659 "wind_face": "\u{1F32C}",
2660 "wine_glass": "\u{1F377}",
2661 "wink": "\u{1F609}",
2662 "wolf": "\u{1F43A}",
2663 "woman": "\u{1F469}",
2664 "woman_artist": "\u{1F469}&zwj;\u{1F3A8}",
2665 "woman_astronaut": "\u{1F469}&zwj;\u{1F680}",
2666 "woman_cartwheeling": "\u{1F938}&zwj;\u2640\uFE0F",
2667 "woman_cook": "\u{1F469}&zwj;\u{1F373}",
2668 "woman_facepalming": "\u{1F926}&zwj;\u2640\uFE0F",
2669 "woman_factory_worker": "\u{1F469}&zwj;\u{1F3ED}",
2670 "woman_farmer": "\u{1F469}&zwj;\u{1F33E}",
2671 "woman_firefighter": "\u{1F469}&zwj;\u{1F692}",
2672 "woman_health_worker": "\u{1F469}&zwj;\u2695\uFE0F",
2673 "woman_judge": "\u{1F469}&zwj;\u2696\uFE0F",
2674 "woman_juggling": "\u{1F939}&zwj;\u2640\uFE0F",
2675 "woman_mechanic": "\u{1F469}&zwj;\u{1F527}",
2676 "woman_office_worker": "\u{1F469}&zwj;\u{1F4BC}",
2677 "woman_pilot": "\u{1F469}&zwj;\u2708\uFE0F",
2678 "woman_playing_handball": "\u{1F93E}&zwj;\u2640\uFE0F",
2679 "woman_playing_water_polo": "\u{1F93D}&zwj;\u2640\uFE0F",
2680 "woman_scientist": "\u{1F469}&zwj;\u{1F52C}",
2681 "woman_shrugging": "\u{1F937}&zwj;\u2640\uFE0F",
2682 "woman_singer": "\u{1F469}&zwj;\u{1F3A4}",
2683 "woman_student": "\u{1F469}&zwj;\u{1F393}",
2684 "woman_teacher": "\u{1F469}&zwj;\u{1F3EB}",
2685 "woman_technologist": "\u{1F469}&zwj;\u{1F4BB}",
2686 "woman_with_turban": "\u{1F473}&zwj;\u2640\uFE0F",
2687 "womans_clothes": "\u{1F45A}",
2688 "womans_hat": "\u{1F452}",
2689 "women_wrestling": "\u{1F93C}&zwj;\u2640\uFE0F",
2690 "womens": "\u{1F6BA}",
2691 "world_map": "\u{1F5FA}",
2692 "worried": "\u{1F61F}",
2693 "wrench": "\u{1F527}",
2694 "writing_hand": "\u270D\uFE0F",
2695 "x": "\u274C",
2696 "yellow_heart": "\u{1F49B}",
2697 "yen": "\u{1F4B4}",
2698 "yin_yang": "\u262F\uFE0F",
2699 "yum": "\u{1F60B}",
2700 "zap": "\u26A1\uFE0F",
2701 "zipper_mouth_face": "\u{1F910}",
2702 "zzz": "\u{1F4A4}",
2703 /* special emojis :P */
2704 "octocat": '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
2705 "showdown": `<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>`
2706 };
2707 showdown2.Converter = function(converterOptions) {
2708 "use strict";
2709 var options = {}, langExtensions = [], outputModifiers = [], listeners = {}, setConvFlavor = setFlavor, metadata = {
2710 parsed: {},
2711 raw: "",
2712 format: ""
2713 };
2714 _constructor();
2715 function _constructor() {
2716 converterOptions = converterOptions || {};
2717 for (var gOpt in globalOptions) {
2718 if (globalOptions.hasOwnProperty(gOpt)) {
2719 options[gOpt] = globalOptions[gOpt];
2720 }
2721 }
2722 if (typeof converterOptions === "object") {
2723 for (var opt in converterOptions) {
2724 if (converterOptions.hasOwnProperty(opt)) {
2725 options[opt] = converterOptions[opt];
2726 }
2727 }
2728 } else {
2729 throw Error("Converter expects the passed parameter to be an object, but " + typeof converterOptions + " was passed instead.");
2730 }
2731 if (options.extensions) {
2732 showdown2.helper.forEach(options.extensions, _parseExtension);
2733 }
2734 }
2735 function _parseExtension(ext, name) {
2736 name = name || null;
2737 if (showdown2.helper.isString(ext)) {
2738 ext = showdown2.helper.stdExtName(ext);
2739 name = ext;
2740 if (showdown2.extensions[ext]) {
2741 console.warn("DEPRECATION WARNING: " + ext + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!");
2742 legacyExtensionLoading(showdown2.extensions[ext], ext);
2743 return;
2744 } else if (!showdown2.helper.isUndefined(extensions[ext])) {
2745 ext = extensions[ext];
2746 } else {
2747 throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.');
2748 }
2749 }
2750 if (typeof ext === "function") {
2751 ext = ext();
2752 }
2753 if (!showdown2.helper.isArray(ext)) {
2754 ext = [ext];
2755 }
2756 var validExt = validate(ext, name);
2757 if (!validExt.valid) {
2758 throw Error(validExt.error);
2759 }
2760 for (var i2 = 0; i2 < ext.length; ++i2) {
2761 switch (ext[i2].type) {
2762 case "lang":
2763 langExtensions.push(ext[i2]);
2764 break;
2765 case "output":
2766 outputModifiers.push(ext[i2]);
2767 break;
2768 }
2769 if (ext[i2].hasOwnProperty("listeners")) {
2770 for (var ln in ext[i2].listeners) {
2771 if (ext[i2].listeners.hasOwnProperty(ln)) {
2772 listen(ln, ext[i2].listeners[ln]);
2773 }
2774 }
2775 }
2776 }
2777 }
2778 function legacyExtensionLoading(ext, name) {
2779 if (typeof ext === "function") {
2780 ext = ext(new showdown2.Converter());
2781 }
2782 if (!showdown2.helper.isArray(ext)) {
2783 ext = [ext];
2784 }
2785 var valid = validate(ext, name);
2786 if (!valid.valid) {
2787 throw Error(valid.error);
2788 }
2789 for (var i2 = 0; i2 < ext.length; ++i2) {
2790 switch (ext[i2].type) {
2791 case "lang":
2792 langExtensions.push(ext[i2]);
2793 break;
2794 case "output":
2795 outputModifiers.push(ext[i2]);
2796 break;
2797 default:
2798 throw Error("Extension loader error: Type unrecognized!!!");
2799 }
2800 }
2801 }
2802 function listen(name, callback) {
2803 if (!showdown2.helper.isString(name)) {
2804 throw Error("Invalid argument in converter.listen() method: name must be a string, but " + typeof name + " given");
2805 }
2806 if (typeof callback !== "function") {
2807 throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + typeof callback + " given");
2808 }
2809 if (!listeners.hasOwnProperty(name)) {
2810 listeners[name] = [];
2811 }
2812 listeners[name].push(callback);
2813 }
2814 function rTrimInputText(text2) {
2815 var rsp = text2.match(/^\s*/)[0].length, rgx = new RegExp("^\\s{0," + rsp + "}", "gm");
2816 return text2.replace(rgx, "");
2817 }
2818 this._dispatch = function dispatch3(evtName, text2, options2, globals) {
2819 if (listeners.hasOwnProperty(evtName)) {
2820 for (var ei = 0; ei < listeners[evtName].length; ++ei) {
2821 var nText = listeners[evtName][ei](evtName, text2, this, options2, globals);
2822 if (nText && typeof nText !== "undefined") {
2823 text2 = nText;
2824 }
2825 }
2826 }
2827 return text2;
2828 };
2829 this.listen = function(name, callback) {
2830 listen(name, callback);
2831 return this;
2832 };
2833 this.makeHtml = function(text2) {
2834 if (!text2) {
2835 return text2;
2836 }
2837 var globals = {
2838 gHtmlBlocks: [],
2839 gHtmlMdBlocks: [],
2840 gHtmlSpans: [],
2841 gUrls: {},
2842 gTitles: {},
2843 gDimensions: {},
2844 gListLevel: 0,
2845 hashLinkCounts: {},
2846 langExtensions,
2847 outputModifiers,
2848 converter: this,
2849 ghCodeBlocks: [],
2850 metadata: {
2851 parsed: {},
2852 raw: "",
2853 format: ""
2854 }
2855 };
2856 text2 = text2.replace(/¨/g, "\xA8T");
2857 text2 = text2.replace(/\$/g, "\xA8D");
2858 text2 = text2.replace(/\r\n/g, "\n");
2859 text2 = text2.replace(/\r/g, "\n");
2860 text2 = text2.replace(/\u00A0/g, "&nbsp;");
2861 if (options.smartIndentationFix) {
2862 text2 = rTrimInputText(text2);
2863 }
2864 text2 = "\n\n" + text2 + "\n\n";
2865 text2 = showdown2.subParser("detab")(text2, options, globals);
2866 text2 = text2.replace(/^[ \t]+$/mg, "");
2867 showdown2.helper.forEach(langExtensions, function(ext) {
2868 text2 = showdown2.subParser("runExtension")(ext, text2, options, globals);
2869 });
2870 text2 = showdown2.subParser("metadata")(text2, options, globals);
2871 text2 = showdown2.subParser("hashPreCodeTags")(text2, options, globals);
2872 text2 = showdown2.subParser("githubCodeBlocks")(text2, options, globals);
2873 text2 = showdown2.subParser("hashHTMLBlocks")(text2, options, globals);
2874 text2 = showdown2.subParser("hashCodeTags")(text2, options, globals);
2875 text2 = showdown2.subParser("stripLinkDefinitions")(text2, options, globals);
2876 text2 = showdown2.subParser("blockGamut")(text2, options, globals);
2877 text2 = showdown2.subParser("unhashHTMLSpans")(text2, options, globals);
2878 text2 = showdown2.subParser("unescapeSpecialChars")(text2, options, globals);
2879 text2 = text2.replace(/¨D/g, "$$");
2880 text2 = text2.replace(/¨T/g, "\xA8");
2881 text2 = showdown2.subParser("completeHTMLDocument")(text2, options, globals);
2882 showdown2.helper.forEach(outputModifiers, function(ext) {
2883 text2 = showdown2.subParser("runExtension")(ext, text2, options, globals);
2884 });
2885 metadata = globals.metadata;
2886 return text2;
2887 };
2888 this.makeMarkdown = this.makeMd = function(src, HTMLParser) {
2889 src = src.replace(/\r\n/g, "\n");
2890 src = src.replace(/\r/g, "\n");
2891 src = src.replace(/>[ \t]+</, ">\xA8NBSP;<");
2892 if (!HTMLParser) {
2893 if (window && window.document) {
2894 HTMLParser = window.document;
2895 } else {
2896 throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");
2897 }
2898 }
2899 var doc = HTMLParser.createElement("div");
2900 doc.innerHTML = src;
2901 var globals = {
2902 preList: substitutePreCodeTags(doc)
2903 };
2904 clean(doc);
2905 var nodes = doc.childNodes, mdDoc = "";
2906 for (var i2 = 0; i2 < nodes.length; i2++) {
2907 mdDoc += showdown2.subParser("makeMarkdown.node")(nodes[i2], globals);
2908 }
2909 function clean(node) {
2910 for (var n2 = 0; n2 < node.childNodes.length; ++n2) {
2911 var child = node.childNodes[n2];
2912 if (child.nodeType === 3) {
2913 if (!/\S/.test(child.nodeValue)) {
2914 node.removeChild(child);
2915 --n2;
2916 } else {
2917 child.nodeValue = child.nodeValue.split("\n").join(" ");
2918 child.nodeValue = child.nodeValue.replace(/(\s)+/g, "$1");
2919 }
2920 } else if (child.nodeType === 1) {
2921 clean(child);
2922 }
2923 }
2924 }
2925 function substitutePreCodeTags(doc2) {
2926 var pres = doc2.querySelectorAll("pre"), presPH = [];
2927 for (var i3 = 0; i3 < pres.length; ++i3) {
2928 if (pres[i3].childElementCount === 1 && pres[i3].firstChild.tagName.toLowerCase() === "code") {
2929 var content = pres[i3].firstChild.innerHTML.trim(), language = pres[i3].firstChild.getAttribute("data-language") || "";
2930 if (language === "") {
2931 var classes = pres[i3].firstChild.className.split(" ");
2932 for (var c2 = 0; c2 < classes.length; ++c2) {
2933 var matches = classes[c2].match(/^language-(.+)$/);
2934 if (matches !== null) {
2935 language = matches[1];
2936 break;
2937 }
2938 }
2939 }
2940 content = showdown2.helper.unescapeHTMLEntities(content);
2941 presPH.push(content);
2942 pres[i3].outerHTML = '<precode language="' + language + '" precodenum="' + i3.toString() + '"></precode>';
2943 } else {
2944 presPH.push(pres[i3].innerHTML);
2945 pres[i3].innerHTML = "";
2946 pres[i3].setAttribute("prenum", i3.toString());
2947 }
2948 }
2949 return presPH;
2950 }
2951 return mdDoc;
2952 };
2953 this.setOption = function(key, value) {
2954 options[key] = value;
2955 };
2956 this.getOption = function(key) {
2957 return options[key];
2958 };
2959 this.getOptions = function() {
2960 return options;
2961 };
2962 this.addExtension = function(extension, name) {
2963 name = name || null;
2964 _parseExtension(extension, name);
2965 };
2966 this.useExtension = function(extensionName) {
2967 _parseExtension(extensionName);
2968 };
2969 this.setFlavor = function(name) {
2970 if (!flavor.hasOwnProperty(name)) {
2971 throw Error(name + " flavor was not found");
2972 }
2973 var preset = flavor[name];
2974 setConvFlavor = name;
2975 for (var option in preset) {
2976 if (preset.hasOwnProperty(option)) {
2977 options[option] = preset[option];
2978 }
2979 }
2980 };
2981 this.getFlavor = function() {
2982 return setConvFlavor;
2983 };
2984 this.removeExtension = function(extension) {
2985 if (!showdown2.helper.isArray(extension)) {
2986 extension = [extension];
2987 }
2988 for (var a2 = 0; a2 < extension.length; ++a2) {
2989 var ext = extension[a2];
2990 for (var i2 = 0; i2 < langExtensions.length; ++i2) {
2991 if (langExtensions[i2] === ext) {
2992 langExtensions[i2].splice(i2, 1);
2993 }
2994 }
2995 for (var ii = 0; ii < outputModifiers.length; ++i2) {
2996 if (outputModifiers[ii] === ext) {
2997 outputModifiers[ii].splice(i2, 1);
2998 }
2999 }
3000 }
3001 };
3002 this.getAllExtensions = function() {
3003 return {
3004 language: langExtensions,
3005 output: outputModifiers
3006 };
3007 };
3008 this.getMetadata = function(raw) {
3009 if (raw) {
3010 return metadata.raw;
3011 } else {
3012 return metadata.parsed;
3013 }
3014 };
3015 this.getMetadataFormat = function() {
3016 return metadata.format;
3017 };
3018 this._setMetadataPair = function(key, value) {
3019 metadata.parsed[key] = value;
3020 };
3021 this._setMetadataFormat = function(format) {
3022 metadata.format = format;
3023 };
3024 this._setMetadataRaw = function(raw) {
3025 metadata.raw = raw;
3026 };
3027 };
3028 showdown2.subParser("anchors", function(text2, options, globals) {
3029 "use strict";
3030 text2 = globals.converter._dispatch("anchors.before", text2, options, globals);
3031 var writeAnchorTag = function(wholeMatch, linkText, linkId, url, m5, m6, title) {
3032 if (showdown2.helper.isUndefined(title)) {
3033 title = "";
3034 }
3035 linkId = linkId.toLowerCase();
3036 if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
3037 url = "";
3038 } else if (!url) {
3039 if (!linkId) {
3040 linkId = linkText.toLowerCase().replace(/ ?\n/g, " ");
3041 }
3042 url = "#" + linkId;
3043 if (!showdown2.helper.isUndefined(globals.gUrls[linkId])) {
3044 url = globals.gUrls[linkId];
3045 if (!showdown2.helper.isUndefined(globals.gTitles[linkId])) {
3046 title = globals.gTitles[linkId];
3047 }
3048 } else {
3049 return wholeMatch;
3050 }
3051 }
3052 url = url.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3053 var result = '<a href="' + url + '"';
3054 if (title !== "" && title !== null) {
3055 title = title.replace(/"/g, "&quot;");
3056 title = title.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3057 result += ' title="' + title + '"';
3058 }
3059 if (options.openLinksInNewWindow && !/^#/.test(url)) {
3060 result += ' rel="noopener noreferrer" target="\xA8E95Eblank"';
3061 }
3062 result += ">" + linkText + "</a>";
3063 return result;
3064 };
3065 text2 = text2.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag);
3066 text2 = text2.replace(
3067 /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3068 writeAnchorTag
3069 );
3070 text2 = text2.replace(
3071 /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3072 writeAnchorTag
3073 );
3074 text2 = text2.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag);
3075 if (options.ghMentions) {
3076 text2 = text2.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function(wm, st, escape, mentions, username) {
3077 if (escape === "\\") {
3078 return st + mentions;
3079 }
3080 if (!showdown2.helper.isString(options.ghMentionsLink)) {
3081 throw new Error("ghMentionsLink option must be a string");
3082 }
3083 var lnk = options.ghMentionsLink.replace(/\{u}/g, username), target = "";
3084 if (options.openLinksInNewWindow) {
3085 target = ' rel="noopener noreferrer" target="\xA8E95Eblank"';
3086 }
3087 return st + '<a href="' + lnk + '"' + target + ">" + mentions + "</a>";
3088 });
3089 }
3090 text2 = globals.converter._dispatch("anchors.after", text2, options, globals);
3091 return text2;
3092 });
3093 var simpleURLRegex = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi, simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi, delimUrlRegex = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi, simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi, delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, replaceLink = function(options) {
3094 "use strict";
3095 return function(wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {
3096 link = link.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3097 var lnkTxt = link, append = "", target = "", lmc = leadingMagicChars || "", tmc = trailingMagicChars || "";
3098 if (/^www\./i.test(link)) {
3099 link = link.replace(/^www\./i, "http://www.");
3100 }
3101 if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {
3102 append = trailingPunctuation;
3103 }
3104 if (options.openLinksInNewWindow) {
3105 target = ' rel="noopener noreferrer" target="\xA8E95Eblank"';
3106 }
3107 return lmc + '<a href="' + link + '"' + target + ">" + lnkTxt + "</a>" + append + tmc;
3108 };
3109 }, replaceMail = function(options, globals) {
3110 "use strict";
3111 return function(wholeMatch, b2, mail) {
3112 var href = "mailto:";
3113 b2 = b2 || "";
3114 mail = showdown2.subParser("unescapeSpecialChars")(mail, options, globals);
3115 if (options.encodeEmails) {
3116 href = showdown2.helper.encodeEmailAddress(href + mail);
3117 mail = showdown2.helper.encodeEmailAddress(mail);
3118 } else {
3119 href = href + mail;
3120 }
3121 return b2 + '<a href="' + href + '">' + mail + "</a>";
3122 };
3123 };
3124 showdown2.subParser("autoLinks", function(text2, options, globals) {
3125 "use strict";
3126 text2 = globals.converter._dispatch("autoLinks.before", text2, options, globals);
3127 text2 = text2.replace(delimUrlRegex, replaceLink(options));
3128 text2 = text2.replace(delimMailRegex, replaceMail(options, globals));
3129 text2 = globals.converter._dispatch("autoLinks.after", text2, options, globals);
3130 return text2;
3131 });
3132 showdown2.subParser("simplifiedAutoLinks", function(text2, options, globals) {
3133 "use strict";
3134 if (!options.simplifiedAutoLink) {
3135 return text2;
3136 }
3137 text2 = globals.converter._dispatch("simplifiedAutoLinks.before", text2, options, globals);
3138 if (options.excludeTrailingPunctuationFromURLs) {
3139 text2 = text2.replace(simpleURLRegex2, replaceLink(options));
3140 } else {
3141 text2 = text2.replace(simpleURLRegex, replaceLink(options));
3142 }
3143 text2 = text2.replace(simpleMailRegex, replaceMail(options, globals));
3144 text2 = globals.converter._dispatch("simplifiedAutoLinks.after", text2, options, globals);
3145 return text2;
3146 });
3147 showdown2.subParser("blockGamut", function(text2, options, globals) {
3148 "use strict";
3149 text2 = globals.converter._dispatch("blockGamut.before", text2, options, globals);
3150 text2 = showdown2.subParser("blockQuotes")(text2, options, globals);
3151 text2 = showdown2.subParser("headers")(text2, options, globals);
3152 text2 = showdown2.subParser("horizontalRule")(text2, options, globals);
3153 text2 = showdown2.subParser("lists")(text2, options, globals);
3154 text2 = showdown2.subParser("codeBlocks")(text2, options, globals);
3155 text2 = showdown2.subParser("tables")(text2, options, globals);
3156 text2 = showdown2.subParser("hashHTMLBlocks")(text2, options, globals);
3157 text2 = showdown2.subParser("paragraphs")(text2, options, globals);
3158 text2 = globals.converter._dispatch("blockGamut.after", text2, options, globals);
3159 return text2;
3160 });
3161 showdown2.subParser("blockQuotes", function(text2, options, globals) {
3162 "use strict";
3163 text2 = globals.converter._dispatch("blockQuotes.before", text2, options, globals);
3164 text2 = text2 + "\n\n";
3165 var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
3166 if (options.splitAdjacentBlockquotes) {
3167 rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm;
3168 }
3169 text2 = text2.replace(rgx, function(bq) {
3170 bq = bq.replace(/^[ \t]*>[ \t]?/gm, "");
3171 bq = bq.replace(/¨0/g, "");
3172 bq = bq.replace(/^[ \t]+$/gm, "");
3173 bq = showdown2.subParser("githubCodeBlocks")(bq, options, globals);
3174 bq = showdown2.subParser("blockGamut")(bq, options, globals);
3175 bq = bq.replace(/(^|\n)/g, "$1 ");
3176 bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(wholeMatch, m1) {
3177 var pre = m1;
3178 pre = pre.replace(/^ /mg, "\xA80");
3179 pre = pre.replace(/¨0/g, "");
3180 return pre;
3181 });
3182 return showdown2.subParser("hashBlock")("<blockquote>\n" + bq + "\n</blockquote>", options, globals);
3183 });
3184 text2 = globals.converter._dispatch("blockQuotes.after", text2, options, globals);
3185 return text2;
3186 });
3187 showdown2.subParser("codeBlocks", function(text2, options, globals) {
3188 "use strict";
3189 text2 = globals.converter._dispatch("codeBlocks.before", text2, options, globals);
3190 text2 += "\xA80";
3191 var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
3192 text2 = text2.replace(pattern, function(wholeMatch, m1, m2) {
3193 var codeblock = m1, nextChar = m2, end = "\n";
3194 codeblock = showdown2.subParser("outdent")(codeblock, options, globals);
3195 codeblock = showdown2.subParser("encodeCode")(codeblock, options, globals);
3196 codeblock = showdown2.subParser("detab")(codeblock, options, globals);
3197 codeblock = codeblock.replace(/^\n+/g, "");
3198 codeblock = codeblock.replace(/\n+$/g, "");
3199 if (options.omitExtraWLInCodeBlocks) {
3200 end = "";
3201 }
3202 codeblock = "<pre><code>" + codeblock + end + "</code></pre>";
3203 return showdown2.subParser("hashBlock")(codeblock, options, globals) + nextChar;
3204 });
3205 text2 = text2.replace(/¨0/, "");
3206 text2 = globals.converter._dispatch("codeBlocks.after", text2, options, globals);
3207 return text2;
3208 });
3209 showdown2.subParser("codeSpans", function(text2, options, globals) {
3210 "use strict";
3211 text2 = globals.converter._dispatch("codeSpans.before", text2, options, globals);
3212 if (typeof text2 === "undefined") {
3213 text2 = "";
3214 }
3215 text2 = text2.replace(
3216 /(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
3217 function(wholeMatch, m1, m2, m3) {
3218 var c2 = m3;
3219 c2 = c2.replace(/^([ \t]*)/g, "");
3220 c2 = c2.replace(/[ \t]*$/g, "");
3221 c2 = showdown2.subParser("encodeCode")(c2, options, globals);
3222 c2 = m1 + "<code>" + c2 + "</code>";
3223 c2 = showdown2.subParser("hashHTMLSpans")(c2, options, globals);
3224 return c2;
3225 }
3226 );
3227 text2 = globals.converter._dispatch("codeSpans.after", text2, options, globals);
3228 return text2;
3229 });
3230 showdown2.subParser("completeHTMLDocument", function(text2, options, globals) {
3231 "use strict";
3232 if (!options.completeHTMLDocument) {
3233 return text2;
3234 }
3235 text2 = globals.converter._dispatch("completeHTMLDocument.before", text2, options, globals);
3236 var doctype = "html", doctypeParsed = "<!DOCTYPE HTML>\n", title = "", charset = '<meta charset="utf-8">\n', lang = "", metadata = "";
3237 if (typeof globals.metadata.parsed.doctype !== "undefined") {
3238 doctypeParsed = "<!DOCTYPE " + globals.metadata.parsed.doctype + ">\n";
3239 doctype = globals.metadata.parsed.doctype.toString().toLowerCase();
3240 if (doctype === "html" || doctype === "html5") {
3241 charset = '<meta charset="utf-8">';
3242 }
3243 }
3244 for (var meta in globals.metadata.parsed) {
3245 if (globals.metadata.parsed.hasOwnProperty(meta)) {
3246 switch (meta.toLowerCase()) {
3247 case "doctype":
3248 break;
3249 case "title":
3250 title = "<title>" + globals.metadata.parsed.title + "</title>\n";
3251 break;
3252 case "charset":
3253 if (doctype === "html" || doctype === "html5") {
3254 charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n';
3255 } else {
3256 charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n';
3257 }
3258 break;
3259 case "language":
3260 case "lang":
3261 lang = ' lang="' + globals.metadata.parsed[meta] + '"';
3262 metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3263 break;
3264 default:
3265 metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3266 }
3267 }
3268 }
3269 text2 = doctypeParsed + "<html" + lang + ">\n<head>\n" + title + charset + metadata + "</head>\n<body>\n" + text2.trim() + "\n</body>\n</html>";
3270 text2 = globals.converter._dispatch("completeHTMLDocument.after", text2, options, globals);
3271 return text2;
3272 });
3273 showdown2.subParser("detab", function(text2, options, globals) {
3274 "use strict";
3275 text2 = globals.converter._dispatch("detab.before", text2, options, globals);
3276 text2 = text2.replace(/\t(?=\t)/g, " ");
3277 text2 = text2.replace(/\t/g, "\xA8A\xA8B");
3278 text2 = text2.replace(/¨B(.+?)¨A/g, function(wholeMatch, m1) {
3279 var leadingText = m1, numSpaces = 4 - leadingText.length % 4;
3280 for (var i2 = 0; i2 < numSpaces; i2++) {
3281 leadingText += " ";
3282 }
3283 return leadingText;
3284 });
3285 text2 = text2.replace(/¨A/g, " ");
3286 text2 = text2.replace(/¨B/g, "");
3287 text2 = globals.converter._dispatch("detab.after", text2, options, globals);
3288 return text2;
3289 });
3290 showdown2.subParser("ellipsis", function(text2, options, globals) {
3291 "use strict";
3292 text2 = globals.converter._dispatch("ellipsis.before", text2, options, globals);
3293 text2 = text2.replace(/\.\.\./g, "\u2026");
3294 text2 = globals.converter._dispatch("ellipsis.after", text2, options, globals);
3295 return text2;
3296 });
3297 showdown2.subParser("emoji", function(text2, options, globals) {
3298 "use strict";
3299 if (!options.emoji) {
3300 return text2;
3301 }
3302 text2 = globals.converter._dispatch("emoji.before", text2, options, globals);
3303 var emojiRgx = /:([\S]+?):/g;
3304 text2 = text2.replace(emojiRgx, function(wm, emojiCode) {
3305 if (showdown2.helper.emojis.hasOwnProperty(emojiCode)) {
3306 return showdown2.helper.emojis[emojiCode];
3307 }
3308 return wm;
3309 });
3310 text2 = globals.converter._dispatch("emoji.after", text2, options, globals);
3311 return text2;
3312 });
3313 showdown2.subParser("encodeAmpsAndAngles", function(text2, options, globals) {
3314 "use strict";
3315 text2 = globals.converter._dispatch("encodeAmpsAndAngles.before", text2, options, globals);
3316 text2 = text2.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&amp;");
3317 text2 = text2.replace(/<(?![a-z\/?$!])/gi, "&lt;");
3318 text2 = text2.replace(/</g, "&lt;");
3319 text2 = text2.replace(/>/g, "&gt;");
3320 text2 = globals.converter._dispatch("encodeAmpsAndAngles.after", text2, options, globals);
3321 return text2;
3322 });
3323 showdown2.subParser("encodeBackslashEscapes", function(text2, options, globals) {
3324 "use strict";
3325 text2 = globals.converter._dispatch("encodeBackslashEscapes.before", text2, options, globals);
3326 text2 = text2.replace(/\\(\\)/g, showdown2.helper.escapeCharactersCallback);
3327 text2 = text2.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown2.helper.escapeCharactersCallback);
3328 text2 = globals.converter._dispatch("encodeBackslashEscapes.after", text2, options, globals);
3329 return text2;
3330 });
3331 showdown2.subParser("encodeCode", function(text2, options, globals) {
3332 "use strict";
3333 text2 = globals.converter._dispatch("encodeCode.before", text2, options, globals);
3334 text2 = text2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/([*_{}\[\]\\=~-])/g, showdown2.helper.escapeCharactersCallback);
3335 text2 = globals.converter._dispatch("encodeCode.after", text2, options, globals);
3336 return text2;
3337 });
3338 showdown2.subParser("escapeSpecialCharsWithinTagAttributes", function(text2, options, globals) {
3339 "use strict";
3340 text2 = globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before", text2, options, globals);
3341 var tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;
3342 text2 = text2.replace(tags, function(wholeMatch) {
3343 return wholeMatch.replace(/(.)<\/?code>(?=.)/g, "$1`").replace(/([\\`*_~=|])/g, showdown2.helper.escapeCharactersCallback);
3344 });
3345 text2 = text2.replace(comments, function(wholeMatch) {
3346 return wholeMatch.replace(/([\\`*_~=|])/g, showdown2.helper.escapeCharactersCallback);
3347 });
3348 text2 = globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after", text2, options, globals);
3349 return text2;
3350 });
3351 showdown2.subParser("githubCodeBlocks", function(text2, options, globals) {
3352 "use strict";
3353 if (!options.ghCodeBlocks) {
3354 return text2;
3355 }
3356 text2 = globals.converter._dispatch("githubCodeBlocks.before", text2, options, globals);
3357 text2 += "\xA80";
3358 text2 = text2.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function(wholeMatch, delim, language, codeblock) {
3359 var end = options.omitExtraWLInCodeBlocks ? "" : "\n";
3360 codeblock = showdown2.subParser("encodeCode")(codeblock, options, globals);
3361 codeblock = showdown2.subParser("detab")(codeblock, options, globals);
3362 codeblock = codeblock.replace(/^\n+/g, "");
3363 codeblock = codeblock.replace(/\n+$/g, "");
3364 codeblock = "<pre><code" + (language ? ' class="' + language + " language-" + language + '"' : "") + ">" + codeblock + end + "</code></pre>";
3365 codeblock = showdown2.subParser("hashBlock")(codeblock, options, globals);
3366 return "\n\n\xA8G" + (globals.ghCodeBlocks.push({ text: wholeMatch, codeblock }) - 1) + "G\n\n";
3367 });
3368 text2 = text2.replace(/¨0/, "");
3369 return globals.converter._dispatch("githubCodeBlocks.after", text2, options, globals);
3370 });
3371 showdown2.subParser("hashBlock", function(text2, options, globals) {
3372 "use strict";
3373 text2 = globals.converter._dispatch("hashBlock.before", text2, options, globals);
3374 text2 = text2.replace(/(^\n+|\n+$)/g, "");
3375 text2 = "\n\n\xA8K" + (globals.gHtmlBlocks.push(text2) - 1) + "K\n\n";
3376 text2 = globals.converter._dispatch("hashBlock.after", text2, options, globals);
3377 return text2;
3378 });
3379 showdown2.subParser("hashCodeTags", function(text2, options, globals) {
3380 "use strict";
3381 text2 = globals.converter._dispatch("hashCodeTags.before", text2, options, globals);
3382 var repFunc = function(wholeMatch, match, left, right) {
3383 var codeblock = left + showdown2.subParser("encodeCode")(match, options, globals) + right;
3384 return "\xA8C" + (globals.gHtmlSpans.push(codeblock) - 1) + "C";
3385 };
3386 text2 = showdown2.helper.replaceRecursiveRegExp(text2, repFunc, "<code\\b[^>]*>", "</code>", "gim");
3387 text2 = globals.converter._dispatch("hashCodeTags.after", text2, options, globals);
3388 return text2;
3389 });
3390 showdown2.subParser("hashElement", function(text2, options, globals) {
3391 "use strict";
3392 return function(wholeMatch, m1) {
3393 var blockText = m1;
3394 blockText = blockText.replace(/\n\n/g, "\n");
3395 blockText = blockText.replace(/^\n/, "");
3396 blockText = blockText.replace(/\n+$/g, "");
3397 blockText = "\n\n\xA8K" + (globals.gHtmlBlocks.push(blockText) - 1) + "K\n\n";
3398 return blockText;
3399 };
3400 });
3401 showdown2.subParser("hashHTMLBlocks", function(text2, options, globals) {
3402 "use strict";
3403 text2 = globals.converter._dispatch("hashHTMLBlocks.before", text2, options, globals);
3404 var blockTags = [
3405 "pre",
3406 "div",
3407 "h1",
3408 "h2",
3409 "h3",
3410 "h4",
3411 "h5",
3412 "h6",
3413 "blockquote",
3414 "table",
3415 "dl",
3416 "ol",
3417 "ul",
3418 "script",
3419 "noscript",
3420 "form",
3421 "fieldset",
3422 "iframe",
3423 "math",
3424 "style",
3425 "section",
3426 "header",
3427 "footer",
3428 "nav",
3429 "article",
3430 "aside",
3431 "address",
3432 "audio",
3433 "canvas",
3434 "figure",
3435 "hgroup",
3436 "output",
3437 "video",
3438 "p"
3439 ], repFunc = function(wholeMatch, match, left, right) {
3440 var txt = wholeMatch;
3441 if (left.search(/\bmarkdown\b/) !== -1) {
3442 txt = left + globals.converter.makeHtml(match) + right;
3443 }
3444 return "\n\n\xA8K" + (globals.gHtmlBlocks.push(txt) - 1) + "K\n\n";
3445 };
3446 if (options.backslashEscapesHTMLTags) {
3447 text2 = text2.replace(/\\<(\/?[^>]+?)>/g, function(wm, inside) {
3448 return "&lt;" + inside + "&gt;";
3449 });
3450 }
3451 for (var i2 = 0; i2 < blockTags.length; ++i2) {
3452 var opTagPos, rgx1 = new RegExp("^ {0,3}(<" + blockTags[i2] + "\\b[^>]*>)", "im"), patLeft = "<" + blockTags[i2] + "\\b[^>]*>", patRight = "</" + blockTags[i2] + ">";
3453 while ((opTagPos = showdown2.helper.regexIndexOf(text2, rgx1)) !== -1) {
3454 var subTexts = showdown2.helper.splitAtIndex(text2, opTagPos), newSubText1 = showdown2.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, "im");
3455 if (newSubText1 === subTexts[1]) {
3456 break;
3457 }
3458 text2 = subTexts[0].concat(newSubText1);
3459 }
3460 }
3461 text2 = text2.replace(
3462 /(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
3463 showdown2.subParser("hashElement")(text2, options, globals)
3464 );
3465 text2 = showdown2.helper.replaceRecursiveRegExp(text2, function(txt) {
3466 return "\n\n\xA8K" + (globals.gHtmlBlocks.push(txt) - 1) + "K\n\n";
3467 }, "^ {0,3}<!--", "-->", "gm");
3468 text2 = text2.replace(
3469 /(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
3470 showdown2.subParser("hashElement")(text2, options, globals)
3471 );
3472 text2 = globals.converter._dispatch("hashHTMLBlocks.after", text2, options, globals);
3473 return text2;
3474 });
3475 showdown2.subParser("hashHTMLSpans", function(text2, options, globals) {
3476 "use strict";
3477 text2 = globals.converter._dispatch("hashHTMLSpans.before", text2, options, globals);
3478 function hashHTMLSpan(html2) {
3479 return "\xA8C" + (globals.gHtmlSpans.push(html2) - 1) + "C";
3480 }
3481 text2 = text2.replace(/<[^>]+?\/>/gi, function(wm) {
3482 return hashHTMLSpan(wm);
3483 });
3484 text2 = text2.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function(wm) {
3485 return hashHTMLSpan(wm);
3486 });
3487 text2 = text2.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function(wm) {
3488 return hashHTMLSpan(wm);
3489 });
3490 text2 = text2.replace(/<[^>]+?>/gi, function(wm) {
3491 return hashHTMLSpan(wm);
3492 });
3493 text2 = globals.converter._dispatch("hashHTMLSpans.after", text2, options, globals);
3494 return text2;
3495 });
3496 showdown2.subParser("unhashHTMLSpans", function(text2, options, globals) {
3497 "use strict";
3498 text2 = globals.converter._dispatch("unhashHTMLSpans.before", text2, options, globals);
3499 for (var i2 = 0; i2 < globals.gHtmlSpans.length; ++i2) {
3500 var repText = globals.gHtmlSpans[i2], limit = 0;
3501 while (/¨C(\d+)C/.test(repText)) {
3502 var num = RegExp.$1;
3503 repText = repText.replace("\xA8C" + num + "C", globals.gHtmlSpans[num]);
3504 if (limit === 10) {
3505 console.error("maximum nesting of 10 spans reached!!!");
3506 break;
3507 }
3508 ++limit;
3509 }
3510 text2 = text2.replace("\xA8C" + i2 + "C", repText);
3511 }
3512 text2 = globals.converter._dispatch("unhashHTMLSpans.after", text2, options, globals);
3513 return text2;
3514 });
3515 showdown2.subParser("hashPreCodeTags", function(text2, options, globals) {
3516 "use strict";
3517 text2 = globals.converter._dispatch("hashPreCodeTags.before", text2, options, globals);
3518 var repFunc = function(wholeMatch, match, left, right) {
3519 var codeblock = left + showdown2.subParser("encodeCode")(match, options, globals) + right;
3520 return "\n\n\xA8G" + (globals.ghCodeBlocks.push({ text: wholeMatch, codeblock }) - 1) + "G\n\n";
3521 };
3522 text2 = showdown2.helper.replaceRecursiveRegExp(text2, repFunc, "^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>", "^ {0,3}</code>\\s*</pre>", "gim");
3523 text2 = globals.converter._dispatch("hashPreCodeTags.after", text2, options, globals);
3524 return text2;
3525 });
3526 showdown2.subParser("headers", function(text2, options, globals) {
3527 "use strict";
3528 text2 = globals.converter._dispatch("headers.before", text2, options, globals);
3529 var headerLevelStart = isNaN(parseInt(options.headerLevelStart)) ? 1 : parseInt(options.headerLevelStart), setextRegexH1 = options.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, setextRegexH2 = options.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
3530 text2 = text2.replace(setextRegexH1, function(wholeMatch, m1) {
3531 var spanGamut = showdown2.subParser("spanGamut")(m1, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m1) + '"', hLevel = headerLevelStart, hashBlock = "<h" + hLevel + hID + ">" + spanGamut + "</h" + hLevel + ">";
3532 return showdown2.subParser("hashBlock")(hashBlock, options, globals);
3533 });
3534 text2 = text2.replace(setextRegexH2, function(matchFound, m1) {
3535 var spanGamut = showdown2.subParser("spanGamut")(m1, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m1) + '"', hLevel = headerLevelStart + 1, hashBlock = "<h" + hLevel + hID + ">" + spanGamut + "</h" + hLevel + ">";
3536 return showdown2.subParser("hashBlock")(hashBlock, options, globals);
3537 });
3538 var atxStyle = options.requireSpaceBeforeHeadingText ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;
3539 text2 = text2.replace(atxStyle, function(wholeMatch, m1, m2) {
3540 var hText = m2;
3541 if (options.customizedHeaderId) {
3542 hText = m2.replace(/\s?\{([^{]+?)}\s*$/, "");
3543 }
3544 var span = showdown2.subParser("spanGamut")(hText, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m2) + '"', hLevel = headerLevelStart - 1 + m1.length, header = "<h" + hLevel + hID + ">" + span + "</h" + hLevel + ">";
3545 return showdown2.subParser("hashBlock")(header, options, globals);
3546 });
3547 function headerId(m2) {
3548 var title, prefix;
3549 if (options.customizedHeaderId) {
3550 var match = m2.match(/\{([^{]+?)}\s*$/);
3551 if (match && match[1]) {
3552 m2 = match[1];
3553 }
3554 }
3555 title = m2;
3556 if (showdown2.helper.isString(options.prefixHeaderId)) {
3557 prefix = options.prefixHeaderId;
3558 } else if (options.prefixHeaderId === true) {
3559 prefix = "section-";
3560 } else {
3561 prefix = "";
3562 }
3563 if (!options.rawPrefixHeaderId) {
3564 title = prefix + title;
3565 }
3566 if (options.ghCompatibleHeaderId) {
3567 title = title.replace(/ /g, "-").replace(/&amp;/g, "").replace(/¨T/g, "").replace(/¨D/g, "").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, "").toLowerCase();
3568 } else if (options.rawHeaderId) {
3569 title = title.replace(/ /g, "-").replace(/&amp;/g, "&").replace(/¨T/g, "\xA8").replace(/¨D/g, "$").replace(/["']/g, "-").toLowerCase();
3570 } else {
3571 title = title.replace(/[^\w]/g, "").toLowerCase();
3572 }
3573 if (options.rawPrefixHeaderId) {
3574 title = prefix + title;
3575 }
3576 if (globals.hashLinkCounts[title]) {
3577 title = title + "-" + globals.hashLinkCounts[title]++;
3578 } else {
3579 globals.hashLinkCounts[title] = 1;
3580 }
3581 return title;
3582 }
3583 text2 = globals.converter._dispatch("headers.after", text2, options, globals);
3584 return text2;
3585 });
3586 showdown2.subParser("horizontalRule", function(text2, options, globals) {
3587 "use strict";
3588 text2 = globals.converter._dispatch("horizontalRule.before", text2, options, globals);
3589 var key = showdown2.subParser("hashBlock")("<hr />", options, globals);
3590 text2 = text2.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
3591 text2 = text2.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
3592 text2 = text2.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
3593 text2 = globals.converter._dispatch("horizontalRule.after", text2, options, globals);
3594 return text2;
3595 });
3596 showdown2.subParser("images", function(text2, options, globals) {
3597 "use strict";
3598 text2 = globals.converter._dispatch("images.before", text2, options, globals);
3599 var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, base64RegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
3600 function writeImageTagBase64(wholeMatch, altText, linkId, url, width, height, m5, title) {
3601 url = url.replace(/\s/g, "");
3602 return writeImageTag(wholeMatch, altText, linkId, url, width, height, m5, title);
3603 }
3604 function writeImageTag(wholeMatch, altText, linkId, url, width, height, m5, title) {
3605 var gUrls = globals.gUrls, gTitles = globals.gTitles, gDims = globals.gDimensions;
3606 linkId = linkId.toLowerCase();
3607 if (!title) {
3608 title = "";
3609 }
3610 if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
3611 url = "";
3612 } else if (url === "" || url === null) {
3613 if (linkId === "" || linkId === null) {
3614 linkId = altText.toLowerCase().replace(/ ?\n/g, " ");
3615 }
3616 url = "#" + linkId;
3617 if (!showdown2.helper.isUndefined(gUrls[linkId])) {
3618 url = gUrls[linkId];
3619 if (!showdown2.helper.isUndefined(gTitles[linkId])) {
3620 title = gTitles[linkId];
3621 }
3622 if (!showdown2.helper.isUndefined(gDims[linkId])) {
3623 width = gDims[linkId].width;
3624 height = gDims[linkId].height;
3625 }
3626 } else {
3627 return wholeMatch;
3628 }
3629 }
3630 altText = altText.replace(/"/g, "&quot;").replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3631 url = url.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3632 var result = '<img src="' + url + '" alt="' + altText + '"';
3633 if (title && showdown2.helper.isString(title)) {
3634 title = title.replace(/"/g, "&quot;").replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3635 result += ' title="' + title + '"';
3636 }
3637 if (width && height) {
3638 width = width === "*" ? "auto" : width;
3639 height = height === "*" ? "auto" : height;
3640 result += ' width="' + width + '"';
3641 result += ' height="' + height + '"';
3642 }
3643 result += " />";
3644 return result;
3645 }
3646 text2 = text2.replace(referenceRegExp, writeImageTag);
3647 text2 = text2.replace(base64RegExp, writeImageTagBase64);
3648 text2 = text2.replace(crazyRegExp, writeImageTag);
3649 text2 = text2.replace(inlineRegExp, writeImageTag);
3650 text2 = text2.replace(refShortcutRegExp, writeImageTag);
3651 text2 = globals.converter._dispatch("images.after", text2, options, globals);
3652 return text2;
3653 });
3654 showdown2.subParser("italicsAndBold", function(text2, options, globals) {
3655 "use strict";
3656 text2 = globals.converter._dispatch("italicsAndBold.before", text2, options, globals);
3657 function parseInside(txt, left, right) {
3658 return left + txt + right;
3659 }
3660 if (options.literalMidWordUnderscores) {
3661 text2 = text2.replace(/\b___(\S[\s\S]*?)___\b/g, function(wm, txt) {
3662 return parseInside(txt, "<strong><em>", "</em></strong>");
3663 });
3664 text2 = text2.replace(/\b__(\S[\s\S]*?)__\b/g, function(wm, txt) {
3665 return parseInside(txt, "<strong>", "</strong>");
3666 });
3667 text2 = text2.replace(/\b_(\S[\s\S]*?)_\b/g, function(wm, txt) {
3668 return parseInside(txt, "<em>", "</em>");
3669 });
3670 } else {
3671 text2 = text2.replace(/___(\S[\s\S]*?)___/g, function(wm, m2) {
3672 return /\S$/.test(m2) ? parseInside(m2, "<strong><em>", "</em></strong>") : wm;
3673 });
3674 text2 = text2.replace(/__(\S[\s\S]*?)__/g, function(wm, m2) {
3675 return /\S$/.test(m2) ? parseInside(m2, "<strong>", "</strong>") : wm;
3676 });
3677 text2 = text2.replace(/_([^\s_][\s\S]*?)_/g, function(wm, m2) {
3678 return /\S$/.test(m2) ? parseInside(m2, "<em>", "</em>") : wm;
3679 });
3680 }
3681 if (options.literalMidWordAsterisks) {
3682 text2 = text2.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function(wm, lead, txt) {
3683 return parseInside(txt, lead + "<strong><em>", "</em></strong>");
3684 });
3685 text2 = text2.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function(wm, lead, txt) {
3686 return parseInside(txt, lead + "<strong>", "</strong>");
3687 });
3688 text2 = text2.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function(wm, lead, txt) {
3689 return parseInside(txt, lead + "<em>", "</em>");
3690 });
3691 } else {
3692 text2 = text2.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function(wm, m2) {
3693 return /\S$/.test(m2) ? parseInside(m2, "<strong><em>", "</em></strong>") : wm;
3694 });
3695 text2 = text2.replace(/\*\*(\S[\s\S]*?)\*\*/g, function(wm, m2) {
3696 return /\S$/.test(m2) ? parseInside(m2, "<strong>", "</strong>") : wm;
3697 });
3698 text2 = text2.replace(/\*([^\s*][\s\S]*?)\*/g, function(wm, m2) {
3699 return /\S$/.test(m2) ? parseInside(m2, "<em>", "</em>") : wm;
3700 });
3701 }
3702 text2 = globals.converter._dispatch("italicsAndBold.after", text2, options, globals);
3703 return text2;
3704 });
3705 showdown2.subParser("lists", function(text2, options, globals) {
3706 "use strict";
3707 function processListItems(listStr, trimTrailing) {
3708 globals.gListLevel++;
3709 listStr = listStr.replace(/\n{2,}$/, "\n");
3710 listStr += "\xA80";
3711 var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, isParagraphed = /\n[ \t]*\n(?!¨0)/.test(listStr);
3712 if (options.disableForced4SpacesIndentedSublists) {
3713 rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm;
3714 }
3715 listStr = listStr.replace(rgx, function(wholeMatch, m1, m2, m3, m4, taskbtn, checked) {
3716 checked = checked && checked.trim() !== "";
3717 var item = showdown2.subParser("outdent")(m4, options, globals), bulletStyle = "";
3718 if (taskbtn && options.tasklists) {
3719 bulletStyle = ' class="task-list-item" style="list-style-type: none;"';
3720 item = item.replace(/^[ \t]*\[(x|X| )?]/m, function() {
3721 var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
3722 if (checked) {
3723 otp += " checked";
3724 }
3725 otp += ">";
3726 return otp;
3727 });
3728 }
3729 item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function(wm2) {
3730 return "\xA8A" + wm2;
3731 });
3732 if (m1 || item.search(/\n{2,}/) > -1) {
3733 item = showdown2.subParser("githubCodeBlocks")(item, options, globals);
3734 item = showdown2.subParser("blockGamut")(item, options, globals);
3735 } else {
3736 item = showdown2.subParser("lists")(item, options, globals);
3737 item = item.replace(/\n$/, "");
3738 item = showdown2.subParser("hashHTMLBlocks")(item, options, globals);
3739 item = item.replace(/\n\n+/g, "\n\n");
3740 if (isParagraphed) {
3741 item = showdown2.subParser("paragraphs")(item, options, globals);
3742 } else {
3743 item = showdown2.subParser("spanGamut")(item, options, globals);
3744 }
3745 }
3746 item = item.replace("\xA8A", "");
3747 item = "<li" + bulletStyle + ">" + item + "</li>\n";
3748 return item;
3749 });
3750 listStr = listStr.replace(/¨0/g, "");
3751 globals.gListLevel--;
3752 if (trimTrailing) {
3753 listStr = listStr.replace(/\s+$/, "");
3754 }
3755 return listStr;
3756 }
3757 function styleStartNumber(list, listType) {
3758 if (listType === "ol") {
3759 var res = list.match(/^ *(\d+)\./);
3760 if (res && res[1] !== "1") {
3761 return ' start="' + res[1] + '"';
3762 }
3763 }
3764 return "";
3765 }
3766 function parseConsecutiveLists(list, listType, trimTrailing) {
3767 var olRgx = options.disableForced4SpacesIndentedSublists ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm, ulRgx = options.disableForced4SpacesIndentedSublists ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm, counterRxg = listType === "ul" ? olRgx : ulRgx, result = "";
3768 if (list.search(counterRxg) !== -1) {
3769 (function parseCL(txt) {
3770 var pos = txt.search(counterRxg), style2 = styleStartNumber(list, listType);
3771 if (pos !== -1) {
3772 result += "\n\n<" + listType + style2 + ">\n" + processListItems(txt.slice(0, pos), !!trimTrailing) + "</" + listType + ">\n";
3773 listType = listType === "ul" ? "ol" : "ul";
3774 counterRxg = listType === "ul" ? olRgx : ulRgx;
3775 parseCL(txt.slice(pos));
3776 } else {
3777 result += "\n\n<" + listType + style2 + ">\n" + processListItems(txt, !!trimTrailing) + "</" + listType + ">\n";
3778 }
3779 })(list);
3780 } else {
3781 var style = styleStartNumber(list, listType);
3782 result = "\n\n<" + listType + style + ">\n" + processListItems(list, !!trimTrailing) + "</" + listType + ">\n";
3783 }
3784 return result;
3785 }
3786 text2 = globals.converter._dispatch("lists.before", text2, options, globals);
3787 text2 += "\xA80";
3788 if (globals.gListLevel) {
3789 text2 = text2.replace(
3790 /^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
3791 function(wholeMatch, list, m2) {
3792 var listType = m2.search(/[*+-]/g) > -1 ? "ul" : "ol";
3793 return parseConsecutiveLists(list, listType, true);
3794 }
3795 );
3796 } else {
3797 text2 = text2.replace(
3798 /(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
3799 function(wholeMatch, m1, list, m3) {
3800 var listType = m3.search(/[*+-]/g) > -1 ? "ul" : "ol";
3801 return parseConsecutiveLists(list, listType, false);
3802 }
3803 );
3804 }
3805 text2 = text2.replace(/¨0/, "");
3806 text2 = globals.converter._dispatch("lists.after", text2, options, globals);
3807 return text2;
3808 });
3809 showdown2.subParser("metadata", function(text2, options, globals) {
3810 "use strict";
3811 if (!options.metadata) {
3812 return text2;
3813 }
3814 text2 = globals.converter._dispatch("metadata.before", text2, options, globals);
3815 function parseMetadataContents(content) {
3816 globals.metadata.raw = content;
3817 content = content.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
3818 content = content.replace(/\n {4}/g, " ");
3819 content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function(wm, key, value) {
3820 globals.metadata.parsed[key] = value;
3821 return "";
3822 });
3823 }
3824 text2 = text2.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function(wholematch, format, content) {
3825 parseMetadataContents(content);
3826 return "\xA8M";
3827 });
3828 text2 = text2.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function(wholematch, format, content) {
3829 if (format) {
3830 globals.metadata.format = format;
3831 }
3832 parseMetadataContents(content);
3833 return "\xA8M";
3834 });
3835 text2 = text2.replace(/¨M/g, "");
3836 text2 = globals.converter._dispatch("metadata.after", text2, options, globals);
3837 return text2;
3838 });
3839 showdown2.subParser("outdent", function(text2, options, globals) {
3840 "use strict";
3841 text2 = globals.converter._dispatch("outdent.before", text2, options, globals);
3842 text2 = text2.replace(/^(\t|[ ]{1,4})/gm, "\xA80");
3843 text2 = text2.replace(/¨0/g, "");
3844 text2 = globals.converter._dispatch("outdent.after", text2, options, globals);
3845 return text2;
3846 });
3847 showdown2.subParser("paragraphs", function(text2, options, globals) {
3848 "use strict";
3849 text2 = globals.converter._dispatch("paragraphs.before", text2, options, globals);
3850 text2 = text2.replace(/^\n+/g, "");
3851 text2 = text2.replace(/\n+$/g, "");
3852 var grafs = text2.split(/\n{2,}/g), grafsOut = [], end = grafs.length;
3853 for (var i2 = 0; i2 < end; i2++) {
3854 var str = grafs[i2];
3855 if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
3856 grafsOut.push(str);
3857 } else if (str.search(/\S/) >= 0) {
3858 str = showdown2.subParser("spanGamut")(str, options, globals);
3859 str = str.replace(/^([ \t]*)/g, "<p>");
3860 str += "</p>";
3861 grafsOut.push(str);
3862 }
3863 }
3864 end = grafsOut.length;
3865 for (i2 = 0; i2 < end; i2++) {
3866 var blockText = "", grafsOutIt = grafsOut[i2], codeFlag = false;
3867 while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) {
3868 var delim = RegExp.$1, num = RegExp.$2;
3869 if (delim === "K") {
3870 blockText = globals.gHtmlBlocks[num];
3871 } else {
3872 if (codeFlag) {
3873 blockText = showdown2.subParser("encodeCode")(globals.ghCodeBlocks[num].text, options, globals);
3874 } else {
3875 blockText = globals.ghCodeBlocks[num].codeblock;
3876 }
3877 }
3878 blockText = blockText.replace(/\$/g, "$$$$");
3879 grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText);
3880 if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) {
3881 codeFlag = true;
3882 }
3883 }
3884 grafsOut[i2] = grafsOutIt;
3885 }
3886 text2 = grafsOut.join("\n");
3887 text2 = text2.replace(/^\n+/g, "");
3888 text2 = text2.replace(/\n+$/g, "");
3889 return globals.converter._dispatch("paragraphs.after", text2, options, globals);
3890 });
3891 showdown2.subParser("runExtension", function(ext, text2, options, globals) {
3892 "use strict";
3893 if (ext.filter) {
3894 text2 = ext.filter(text2, globals.converter, options);
3895 } else if (ext.regex) {
3896 var re = ext.regex;
3897 if (!(re instanceof RegExp)) {
3898 re = new RegExp(re, "g");
3899 }
3900 text2 = text2.replace(re, ext.replace);
3901 }
3902 return text2;
3903 });
3904 showdown2.subParser("spanGamut", function(text2, options, globals) {
3905 "use strict";
3906 text2 = globals.converter._dispatch("spanGamut.before", text2, options, globals);
3907 text2 = showdown2.subParser("codeSpans")(text2, options, globals);
3908 text2 = showdown2.subParser("escapeSpecialCharsWithinTagAttributes")(text2, options, globals);
3909 text2 = showdown2.subParser("encodeBackslashEscapes")(text2, options, globals);
3910 text2 = showdown2.subParser("images")(text2, options, globals);
3911 text2 = showdown2.subParser("anchors")(text2, options, globals);
3912 text2 = showdown2.subParser("autoLinks")(text2, options, globals);
3913 text2 = showdown2.subParser("simplifiedAutoLinks")(text2, options, globals);
3914 text2 = showdown2.subParser("emoji")(text2, options, globals);
3915 text2 = showdown2.subParser("underline")(text2, options, globals);
3916 text2 = showdown2.subParser("italicsAndBold")(text2, options, globals);
3917 text2 = showdown2.subParser("strikethrough")(text2, options, globals);
3918 text2 = showdown2.subParser("ellipsis")(text2, options, globals);
3919 text2 = showdown2.subParser("hashHTMLSpans")(text2, options, globals);
3920 text2 = showdown2.subParser("encodeAmpsAndAngles")(text2, options, globals);
3921 if (options.simpleLineBreaks) {
3922 if (!/\n\n¨K/.test(text2)) {
3923 text2 = text2.replace(/\n+/g, "<br />\n");
3924 }
3925 } else {
3926 text2 = text2.replace(/ +\n/g, "<br />\n");
3927 }
3928 text2 = globals.converter._dispatch("spanGamut.after", text2, options, globals);
3929 return text2;
3930 });
3931 showdown2.subParser("strikethrough", function(text2, options, globals) {
3932 "use strict";
3933 function parseInside(txt) {
3934 if (options.simplifiedAutoLink) {
3935 txt = showdown2.subParser("simplifiedAutoLinks")(txt, options, globals);
3936 }
3937 return "<del>" + txt + "</del>";
3938 }
3939 if (options.strikethrough) {
3940 text2 = globals.converter._dispatch("strikethrough.before", text2, options, globals);
3941 text2 = text2.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function(wm, txt) {
3942 return parseInside(txt);
3943 });
3944 text2 = globals.converter._dispatch("strikethrough.after", text2, options, globals);
3945 }
3946 return text2;
3947 });
3948 showdown2.subParser("stripLinkDefinitions", function(text2, options, globals) {
3949 "use strict";
3950 var regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm, base64Regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;
3951 text2 += "\xA80";
3952 var replaceFunc = function(wholeMatch, linkId, url, width, height, blankLines, title) {
3953 linkId = linkId.toLowerCase();
3954 if (url.match(/^data:.+?\/.+?;base64,/)) {
3955 globals.gUrls[linkId] = url.replace(/\s/g, "");
3956 } else {
3957 globals.gUrls[linkId] = showdown2.subParser("encodeAmpsAndAngles")(url, options, globals);
3958 }
3959 if (blankLines) {
3960 return blankLines + title;
3961 } else {
3962 if (title) {
3963 globals.gTitles[linkId] = title.replace(/"|'/g, "&quot;");
3964 }
3965 if (options.parseImgDimensions && width && height) {
3966 globals.gDimensions[linkId] = {
3967 width,
3968 height
3969 };
3970 }
3971 }
3972 return "";
3973 };
3974 text2 = text2.replace(base64Regex, replaceFunc);
3975 text2 = text2.replace(regex, replaceFunc);
3976 text2 = text2.replace(/¨0/, "");
3977 return text2;
3978 });
3979 showdown2.subParser("tables", function(text2, options, globals) {
3980 "use strict";
3981 if (!options.tables) {
3982 return text2;
3983 }
3984 var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
3985 function parseStyles(sLine) {
3986 if (/^:[ \t]*--*$/.test(sLine)) {
3987 return ' style="text-align:left;"';
3988 } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
3989 return ' style="text-align:right;"';
3990 } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
3991 return ' style="text-align:center;"';
3992 } else {
3993 return "";
3994 }
3995 }
3996 function parseHeaders(header, style) {
3997 var id = "";
3998 header = header.trim();
3999 if (options.tablesHeaderId || options.tableHeaderId) {
4000 id = ' id="' + header.replace(/ /g, "_").toLowerCase() + '"';
4001 }
4002 header = showdown2.subParser("spanGamut")(header, options, globals);
4003 return "<th" + id + style + ">" + header + "</th>\n";
4004 }
4005 function parseCells(cell, style) {
4006 var subText = showdown2.subParser("spanGamut")(cell, options, globals);
4007 return "<td" + style + ">" + subText + "</td>\n";
4008 }
4009 function buildTable(headers, cells) {
4010 var tb = "<table>\n<thead>\n<tr>\n", tblLgn = headers.length;
4011 for (var i2 = 0; i2 < tblLgn; ++i2) {
4012 tb += headers[i2];
4013 }
4014 tb += "</tr>\n</thead>\n<tbody>\n";
4015 for (i2 = 0; i2 < cells.length; ++i2) {
4016 tb += "<tr>\n";
4017 for (var ii = 0; ii < tblLgn; ++ii) {
4018 tb += cells[i2][ii];
4019 }
4020 tb += "</tr>\n";
4021 }
4022 tb += "</tbody>\n</table>\n";
4023 return tb;
4024 }
4025 function parseTable(rawTable) {
4026 var i2, tableLines = rawTable.split("\n");
4027 for (i2 = 0; i2 < tableLines.length; ++i2) {
4028 if (/^ {0,3}\|/.test(tableLines[i2])) {
4029 tableLines[i2] = tableLines[i2].replace(/^ {0,3}\|/, "");
4030 }
4031 if (/\|[ \t]*$/.test(tableLines[i2])) {
4032 tableLines[i2] = tableLines[i2].replace(/\|[ \t]*$/, "");
4033 }
4034 tableLines[i2] = showdown2.subParser("codeSpans")(tableLines[i2], options, globals);
4035 }
4036 var rawHeaders = tableLines[0].split("|").map(function(s2) {
4037 return s2.trim();
4038 }), rawStyles = tableLines[1].split("|").map(function(s2) {
4039 return s2.trim();
4040 }), rawCells = [], headers = [], styles = [], cells = [];
4041 tableLines.shift();
4042 tableLines.shift();
4043 for (i2 = 0; i2 < tableLines.length; ++i2) {
4044 if (tableLines[i2].trim() === "") {
4045 continue;
4046 }
4047 rawCells.push(
4048 tableLines[i2].split("|").map(function(s2) {
4049 return s2.trim();
4050 })
4051 );
4052 }
4053 if (rawHeaders.length < rawStyles.length) {
4054 return rawTable;
4055 }
4056 for (i2 = 0; i2 < rawStyles.length; ++i2) {
4057 styles.push(parseStyles(rawStyles[i2]));
4058 }
4059 for (i2 = 0; i2 < rawHeaders.length; ++i2) {
4060 if (showdown2.helper.isUndefined(styles[i2])) {
4061 styles[i2] = "";
4062 }
4063 headers.push(parseHeaders(rawHeaders[i2], styles[i2]));
4064 }
4065 for (i2 = 0; i2 < rawCells.length; ++i2) {
4066 var row = [];
4067 for (var ii = 0; ii < headers.length; ++ii) {
4068 if (showdown2.helper.isUndefined(rawCells[i2][ii])) {
4069 }
4070 row.push(parseCells(rawCells[i2][ii], styles[ii]));
4071 }
4072 cells.push(row);
4073 }
4074 return buildTable(headers, cells);
4075 }
4076 text2 = globals.converter._dispatch("tables.before", text2, options, globals);
4077 text2 = text2.replace(/\\(\|)/g, showdown2.helper.escapeCharactersCallback);
4078 text2 = text2.replace(tableRgx, parseTable);
4079 text2 = text2.replace(singeColTblRgx, parseTable);
4080 text2 = globals.converter._dispatch("tables.after", text2, options, globals);
4081 return text2;
4082 });
4083 showdown2.subParser("underline", function(text2, options, globals) {
4084 "use strict";
4085 if (!options.underline) {
4086 return text2;
4087 }
4088 text2 = globals.converter._dispatch("underline.before", text2, options, globals);
4089 if (options.literalMidWordUnderscores) {
4090 text2 = text2.replace(/\b___(\S[\s\S]*?)___\b/g, function(wm, txt) {
4091 return "<u>" + txt + "</u>";
4092 });
4093 text2 = text2.replace(/\b__(\S[\s\S]*?)__\b/g, function(wm, txt) {
4094 return "<u>" + txt + "</u>";
4095 });
4096 } else {
4097 text2 = text2.replace(/___(\S[\s\S]*?)___/g, function(wm, m2) {
4098 return /\S$/.test(m2) ? "<u>" + m2 + "</u>" : wm;
4099 });
4100 text2 = text2.replace(/__(\S[\s\S]*?)__/g, function(wm, m2) {
4101 return /\S$/.test(m2) ? "<u>" + m2 + "</u>" : wm;
4102 });
4103 }
4104 text2 = text2.replace(/(_)/g, showdown2.helper.escapeCharactersCallback);
4105 text2 = globals.converter._dispatch("underline.after", text2, options, globals);
4106 return text2;
4107 });
4108 showdown2.subParser("unescapeSpecialChars", function(text2, options, globals) {
4109 "use strict";
4110 text2 = globals.converter._dispatch("unescapeSpecialChars.before", text2, options, globals);
4111 text2 = text2.replace(/¨E(\d+)E/g, function(wholeMatch, m1) {
4112 var charCodeToReplace = parseInt(m1);
4113 return String.fromCharCode(charCodeToReplace);
4114 });
4115 text2 = globals.converter._dispatch("unescapeSpecialChars.after", text2, options, globals);
4116 return text2;
4117 });
4118 showdown2.subParser("makeMarkdown.blockquote", function(node, globals) {
4119 "use strict";
4120 var txt = "";
4121 if (node.hasChildNodes()) {
4122 var children = node.childNodes, childrenLength = children.length;
4123 for (var i2 = 0; i2 < childrenLength; ++i2) {
4124 var innerTxt = showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4125 if (innerTxt === "") {
4126 continue;
4127 }
4128 txt += innerTxt;
4129 }
4130 }
4131 txt = txt.trim();
4132 txt = "> " + txt.split("\n").join("\n> ");
4133 return txt;
4134 });
4135 showdown2.subParser("makeMarkdown.codeBlock", function(node, globals) {
4136 "use strict";
4137 var lang = node.getAttribute("language"), num = node.getAttribute("precodenum");
4138 return "```" + lang + "\n" + globals.preList[num] + "\n```";
4139 });
4140 showdown2.subParser("makeMarkdown.codeSpan", function(node) {
4141 "use strict";
4142 return "`" + node.innerHTML + "`";
4143 });
4144 showdown2.subParser("makeMarkdown.emphasis", function(node, globals) {
4145 "use strict";
4146 var txt = "";
4147 if (node.hasChildNodes()) {
4148 txt += "*";
4149 var children = node.childNodes, childrenLength = children.length;
4150 for (var i2 = 0; i2 < childrenLength; ++i2) {
4151 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4152 }
4153 txt += "*";
4154 }
4155 return txt;
4156 });
4157 showdown2.subParser("makeMarkdown.header", function(node, globals, headerLevel) {
4158 "use strict";
4159 var headerMark = new Array(headerLevel + 1).join("#"), txt = "";
4160 if (node.hasChildNodes()) {
4161 txt = headerMark + " ";
4162 var children = node.childNodes, childrenLength = children.length;
4163 for (var i2 = 0; i2 < childrenLength; ++i2) {
4164 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4165 }
4166 }
4167 return txt;
4168 });
4169 showdown2.subParser("makeMarkdown.hr", function() {
4170 "use strict";
4171 return "---";
4172 });
4173 showdown2.subParser("makeMarkdown.image", function(node) {
4174 "use strict";
4175 var txt = "";
4176 if (node.hasAttribute("src")) {
4177 txt += "![" + node.getAttribute("alt") + "](";
4178 txt += "<" + node.getAttribute("src") + ">";
4179 if (node.hasAttribute("width") && node.hasAttribute("height")) {
4180 txt += " =" + node.getAttribute("width") + "x" + node.getAttribute("height");
4181 }
4182 if (node.hasAttribute("title")) {
4183 txt += ' "' + node.getAttribute("title") + '"';
4184 }
4185 txt += ")";
4186 }
4187 return txt;
4188 });
4189 showdown2.subParser("makeMarkdown.links", function(node, globals) {
4190 "use strict";
4191 var txt = "";
4192 if (node.hasChildNodes() && node.hasAttribute("href")) {
4193 var children = node.childNodes, childrenLength = children.length;
4194 txt = "[";
4195 for (var i2 = 0; i2 < childrenLength; ++i2) {
4196 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4197 }
4198 txt += "](";
4199 txt += "<" + node.getAttribute("href") + ">";
4200 if (node.hasAttribute("title")) {
4201 txt += ' "' + node.getAttribute("title") + '"';
4202 }
4203 txt += ")";
4204 }
4205 return txt;
4206 });
4207 showdown2.subParser("makeMarkdown.list", function(node, globals, type) {
4208 "use strict";
4209 var txt = "";
4210 if (!node.hasChildNodes()) {
4211 return "";
4212 }
4213 var listItems = node.childNodes, listItemsLenght = listItems.length, listNum = node.getAttribute("start") || 1;
4214 for (var i2 = 0; i2 < listItemsLenght; ++i2) {
4215 if (typeof listItems[i2].tagName === "undefined" || listItems[i2].tagName.toLowerCase() !== "li") {
4216 continue;
4217 }
4218 var bullet = "";
4219 if (type === "ol") {
4220 bullet = listNum.toString() + ". ";
4221 } else {
4222 bullet = "- ";
4223 }
4224 txt += bullet + showdown2.subParser("makeMarkdown.listItem")(listItems[i2], globals);
4225 ++listNum;
4226 }
4227 txt += "\n<!-- -->\n";
4228 return txt.trim();
4229 });
4230 showdown2.subParser("makeMarkdown.listItem", function(node, globals) {
4231 "use strict";
4232 var listItemTxt = "";
4233 var children = node.childNodes, childrenLenght = children.length;
4234 for (var i2 = 0; i2 < childrenLenght; ++i2) {
4235 listItemTxt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4236 }
4237 if (!/\n$/.test(listItemTxt)) {
4238 listItemTxt += "\n";
4239 } else {
4240 listItemTxt = listItemTxt.split("\n").join("\n ").replace(/^ {4}$/gm, "").replace(/\n\n+/g, "\n\n");
4241 }
4242 return listItemTxt;
4243 });
4244 showdown2.subParser("makeMarkdown.node", function(node, globals, spansOnly) {
4245 "use strict";
4246 spansOnly = spansOnly || false;
4247 var txt = "";
4248 if (node.nodeType === 3) {
4249 return showdown2.subParser("makeMarkdown.txt")(node, globals);
4250 }
4251 if (node.nodeType === 8) {
4252 return "<!--" + node.data + "-->\n\n";
4253 }
4254 if (node.nodeType !== 1) {
4255 return "";
4256 }
4257 var tagName = node.tagName.toLowerCase();
4258 switch (tagName) {
4259 //
4260 // BLOCKS
4261 //
4262 case "h1":
4263 if (!spansOnly) {
4264 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 1) + "\n\n";
4265 }
4266 break;
4267 case "h2":
4268 if (!spansOnly) {
4269 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 2) + "\n\n";
4270 }
4271 break;
4272 case "h3":
4273 if (!spansOnly) {
4274 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 3) + "\n\n";
4275 }
4276 break;
4277 case "h4":
4278 if (!spansOnly) {
4279 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 4) + "\n\n";
4280 }
4281 break;
4282 case "h5":
4283 if (!spansOnly) {
4284 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 5) + "\n\n";
4285 }
4286 break;
4287 case "h6":
4288 if (!spansOnly) {
4289 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 6) + "\n\n";
4290 }
4291 break;
4292 case "p":
4293 if (!spansOnly) {
4294 txt = showdown2.subParser("makeMarkdown.paragraph")(node, globals) + "\n\n";
4295 }
4296 break;
4297 case "blockquote":
4298 if (!spansOnly) {
4299 txt = showdown2.subParser("makeMarkdown.blockquote")(node, globals) + "\n\n";
4300 }
4301 break;
4302 case "hr":
4303 if (!spansOnly) {
4304 txt = showdown2.subParser("makeMarkdown.hr")(node, globals) + "\n\n";
4305 }
4306 break;
4307 case "ol":
4308 if (!spansOnly) {
4309 txt = showdown2.subParser("makeMarkdown.list")(node, globals, "ol") + "\n\n";
4310 }
4311 break;
4312 case "ul":
4313 if (!spansOnly) {
4314 txt = showdown2.subParser("makeMarkdown.list")(node, globals, "ul") + "\n\n";
4315 }
4316 break;
4317 case "precode":
4318 if (!spansOnly) {
4319 txt = showdown2.subParser("makeMarkdown.codeBlock")(node, globals) + "\n\n";
4320 }
4321 break;
4322 case "pre":
4323 if (!spansOnly) {
4324 txt = showdown2.subParser("makeMarkdown.pre")(node, globals) + "\n\n";
4325 }
4326 break;
4327 case "table":
4328 if (!spansOnly) {
4329 txt = showdown2.subParser("makeMarkdown.table")(node, globals) + "\n\n";
4330 }
4331 break;
4332 //
4333 // SPANS
4334 //
4335 case "code":
4336 txt = showdown2.subParser("makeMarkdown.codeSpan")(node, globals);
4337 break;
4338 case "em":
4339 case "i":
4340 txt = showdown2.subParser("makeMarkdown.emphasis")(node, globals);
4341 break;
4342 case "strong":
4343 case "b":
4344 txt = showdown2.subParser("makeMarkdown.strong")(node, globals);
4345 break;
4346 case "del":
4347 txt = showdown2.subParser("makeMarkdown.strikethrough")(node, globals);
4348 break;
4349 case "a":
4350 txt = showdown2.subParser("makeMarkdown.links")(node, globals);
4351 break;
4352 case "img":
4353 txt = showdown2.subParser("makeMarkdown.image")(node, globals);
4354 break;
4355 default:
4356 txt = node.outerHTML + "\n\n";
4357 }
4358 return txt;
4359 });
4360 showdown2.subParser("makeMarkdown.paragraph", function(node, globals) {
4361 "use strict";
4362 var txt = "";
4363 if (node.hasChildNodes()) {
4364 var children = node.childNodes, childrenLength = children.length;
4365 for (var i2 = 0; i2 < childrenLength; ++i2) {
4366 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4367 }
4368 }
4369 txt = txt.trim();
4370 return txt;
4371 });
4372 showdown2.subParser("makeMarkdown.pre", function(node, globals) {
4373 "use strict";
4374 var num = node.getAttribute("prenum");
4375 return "<pre>" + globals.preList[num] + "</pre>";
4376 });
4377 showdown2.subParser("makeMarkdown.strikethrough", function(node, globals) {
4378 "use strict";
4379 var txt = "";
4380 if (node.hasChildNodes()) {
4381 txt += "~~";
4382 var children = node.childNodes, childrenLength = children.length;
4383 for (var i2 = 0; i2 < childrenLength; ++i2) {
4384 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4385 }
4386 txt += "~~";
4387 }
4388 return txt;
4389 });
4390 showdown2.subParser("makeMarkdown.strong", function(node, globals) {
4391 "use strict";
4392 var txt = "";
4393 if (node.hasChildNodes()) {
4394 txt += "**";
4395 var children = node.childNodes, childrenLength = children.length;
4396 for (var i2 = 0; i2 < childrenLength; ++i2) {
4397 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4398 }
4399 txt += "**";
4400 }
4401 return txt;
4402 });
4403 showdown2.subParser("makeMarkdown.table", function(node, globals) {
4404 "use strict";
4405 var txt = "", tableArray = [[], []], headings = node.querySelectorAll("thead>tr>th"), rows = node.querySelectorAll("tbody>tr"), i2, ii;
4406 for (i2 = 0; i2 < headings.length; ++i2) {
4407 var headContent = showdown2.subParser("makeMarkdown.tableCell")(headings[i2], globals), allign = "---";
4408 if (headings[i2].hasAttribute("style")) {
4409 var style = headings[i2].getAttribute("style").toLowerCase().replace(/\s/g, "");
4410 switch (style) {
4411 case "text-align:left;":
4412 allign = ":---";
4413 break;
4414 case "text-align:right;":
4415 allign = "---:";
4416 break;
4417 case "text-align:center;":
4418 allign = ":---:";
4419 break;
4420 }
4421 }
4422 tableArray[0][i2] = headContent.trim();
4423 tableArray[1][i2] = allign;
4424 }
4425 for (i2 = 0; i2 < rows.length; ++i2) {
4426 var r2 = tableArray.push([]) - 1, cols = rows[i2].getElementsByTagName("td");
4427 for (ii = 0; ii < headings.length; ++ii) {
4428 var cellContent = " ";
4429 if (typeof cols[ii] !== "undefined") {
4430 cellContent = showdown2.subParser("makeMarkdown.tableCell")(cols[ii], globals);
4431 }
4432 tableArray[r2].push(cellContent);
4433 }
4434 }
4435 var cellSpacesCount = 3;
4436 for (i2 = 0; i2 < tableArray.length; ++i2) {
4437 for (ii = 0; ii < tableArray[i2].length; ++ii) {
4438 var strLen = tableArray[i2][ii].length;
4439 if (strLen > cellSpacesCount) {
4440 cellSpacesCount = strLen;
4441 }
4442 }
4443 }
4444 for (i2 = 0; i2 < tableArray.length; ++i2) {
4445 for (ii = 0; ii < tableArray[i2].length; ++ii) {
4446 if (i2 === 1) {
4447 if (tableArray[i2][ii].slice(-1) === ":") {
4448 tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii].slice(-1), cellSpacesCount - 1, "-") + ":";
4449 } else {
4450 tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii], cellSpacesCount, "-");
4451 }
4452 } else {
4453 tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii], cellSpacesCount);
4454 }
4455 }
4456 txt += "| " + tableArray[i2].join(" | ") + " |\n";
4457 }
4458 return txt.trim();
4459 });
4460 showdown2.subParser("makeMarkdown.tableCell", function(node, globals) {
4461 "use strict";
4462 var txt = "";
4463 if (!node.hasChildNodes()) {
4464 return "";
4465 }
4466 var children = node.childNodes, childrenLength = children.length;
4467 for (var i2 = 0; i2 < childrenLength; ++i2) {
4468 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals, true);
4469 }
4470 return txt.trim();
4471 });
4472 showdown2.subParser("makeMarkdown.txt", function(node) {
4473 "use strict";
4474 var txt = node.nodeValue;
4475 txt = txt.replace(/ +/g, " ");
4476 txt = txt.replace(/¨NBSP;/g, " ");
4477 txt = showdown2.helper.unescapeHTMLEntities(txt);
4478 txt = txt.replace(/([*_~|`])/g, "\\$1");
4479 txt = txt.replace(/^(\s*)>/g, "\\$1>");
4480 txt = txt.replace(/^#/gm, "\\#");
4481 txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3");
4482 txt = txt.replace(/^( {0,3}\d+)\./gm, "$1\\.");
4483 txt = txt.replace(/^( {0,3})([+-])/gm, "$1\\$2");
4484 txt = txt.replace(/]([\s]*)\(/g, "\\]$1\\(");
4485 txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:");
4486 return txt;
4487 });
4488 var root = this;
4489 if (typeof define === "function" && define.amd) {
4490 define(function() {
4491 "use strict";
4492 return showdown2;
4493 });
4494 } else if (typeof module !== "undefined" && module.exports) {
4495 module.exports = showdown2;
4496 } else {
4497 root.showdown = showdown2;
4498 }
4499 }).call(exports);
4500 }
4501 });
4502
4503 // packages/blocks/build-module/index.mjs
4504 var index_exports = {};
4505 __export(index_exports, {
4506 __EXPERIMENTAL_ELEMENTS: () => __EXPERIMENTAL_ELEMENTS,
4507 __EXPERIMENTAL_PATHS_WITH_OVERRIDE: () => __EXPERIMENTAL_PATHS_WITH_OVERRIDE,
4508 __EXPERIMENTAL_STYLE_PROPERTY: () => __EXPERIMENTAL_STYLE_PROPERTY,
4509 __experimentalCloneSanitizedBlock: () => __experimentalCloneSanitizedBlock,
4510 __experimentalGetAccessibleBlockLabel: () => getAccessibleBlockLabel,
4511 __experimentalGetBlockAttributesNamesByRole: () => __experimentalGetBlockAttributesNamesByRole,
4512 __experimentalGetBlockLabel: () => getBlockLabel,
4513 __experimentalSanitizeBlockAttributes: () => __experimentalSanitizeBlockAttributes,
4514 __unstableGetBlockProps: () => getBlockProps,
4515 __unstableGetInnerBlocksProps: () => getInnerBlocksProps,
4516 __unstableSerializeAndClean: () => __unstableSerializeAndClean,
4517 children: () => children_default,
4518 cloneBlock: () => cloneBlock,
4519 createBlock: () => createBlock,
4520 createBlocksFromInnerBlocksTemplate: () => createBlocksFromInnerBlocksTemplate,
4521 doBlocksMatchTemplate: () => doBlocksMatchTemplate,
4522 findTransform: () => findTransform,
4523 getBlockAttributes: () => getBlockAttributes,
4524 getBlockAttributesNamesByRole: () => getBlockAttributesNamesByRole,
4525 getBlockBindingsSource: () => getBlockBindingsSource,
4526 getBlockBindingsSources: () => getBlockBindingsSources,
4527 getBlockContent: () => getBlockInnerHTML,
4528 getBlockDefaultClassName: () => getBlockDefaultClassName,
4529 getBlockFromExample: () => getBlockFromExample,
4530 getBlockMenuDefaultClassName: () => getBlockMenuDefaultClassName,
4531 getBlockSupport: () => getBlockSupport,
4532 getBlockTransforms: () => getBlockTransforms,
4533 getBlockType: () => getBlockType,
4534 getBlockTypes: () => getBlockTypes,
4535 getBlockVariations: () => getBlockVariations,
4536 getCategories: () => getCategories2,
4537 getChildBlockNames: () => getChildBlockNames,
4538 getDefaultBlockName: () => getDefaultBlockName,
4539 getFreeformContentHandlerName: () => getFreeformContentHandlerName,
4540 getGroupingBlockName: () => getGroupingBlockName,
4541 getPhrasingContentSchema: () => deprecatedGetPhrasingContentSchema,
4542 getPossibleBlockTransformations: () => getPossibleBlockTransformations,
4543 getSaveContent: () => getSaveContent,
4544 getSaveElement: () => getSaveElement,
4545 getUnregisteredTypeHandlerName: () => getUnregisteredTypeHandlerName,
4546 hasBlockSupport: () => hasBlockSupport,
4547 hasChildBlocks: () => hasChildBlocks,
4548 hasChildBlocksWithInserterSupport: () => hasChildBlocksWithInserterSupport,
4549 isReusableBlock: () => isReusableBlock,
4550 isTemplatePart: () => isTemplatePart,
4551 isUnmodifiedBlock: () => isUnmodifiedBlock,
4552 isUnmodifiedDefaultBlock: () => isUnmodifiedDefaultBlock,
4553 isValidBlockContent: () => isValidBlockContent,
4554 isValidIcon: () => isValidIcon,
4555 node: () => node_default,
4556 normalizeIconObject: () => normalizeIconObject,
4557 parse: () => parse2,
4558 parseWithAttributeSchema: () => parseWithAttributeSchema,
4559 pasteHandler: () => pasteHandler,
4560 privateApis: () => privateApis,
4561 rawHandler: () => rawHandler,
4562 registerBlockBindingsSource: () => registerBlockBindingsSource,
4563 registerBlockCollection: () => registerBlockCollection,
4564 registerBlockStyle: () => registerBlockStyle,
4565 registerBlockType: () => registerBlockType,
4566 registerBlockVariation: () => registerBlockVariation,
4567 serialize: () => serialize,
4568 serializeRawBlock: () => serializeRawBlock,
4569 setCategories: () => setCategories2,
4570 setDefaultBlockName: () => setDefaultBlockName,
4571 setFreeformContentHandlerName: () => setFreeformContentHandlerName,
4572 setGroupingBlockName: () => setGroupingBlockName,
4573 setUnregisteredTypeHandlerName: () => setUnregisteredTypeHandlerName,
4574 store: () => store,
4575 switchToBlockType: () => switchToBlockType,
4576 synchronizeBlocksWithTemplate: () => synchronizeBlocksWithTemplate,
4577 unregisterBlockBindingsSource: () => unregisterBlockBindingsSource,
4578 unregisterBlockStyle: () => unregisterBlockStyle,
4579 unregisterBlockType: () => unregisterBlockType,
4580 unregisterBlockVariation: () => unregisterBlockVariation,
4581 unstable__bootstrapServerSideBlockDefinitions: () => unstable__bootstrapServerSideBlockDefinitions,
4582 updateCategory: () => updateCategory2,
4583 validateBlock: () => validateBlock,
4584 withBlockContentContext: () => withBlockContentContext
4585 });
4586
4587 // packages/blocks/build-module/store/index.mjs
4588 var import_data5 = __toESM(require_data(), 1);
4589
4590 // node_modules/tslib/tslib.es6.mjs
4591 var __assign = function() {
4592 __assign = Object.assign || function __assign2(t3) {
4593 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
4594 s2 = arguments[i2];
4595 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2];
4596 }
4597 return t3;
4598 };
4599 return __assign.apply(this, arguments);
4600 };
4601
4602 // node_modules/lower-case/dist.es2015/index.js
4603 function lowerCase(str) {
4604 return str.toLowerCase();
4605 }
4606
4607 // node_modules/no-case/dist.es2015/index.js
4608 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
4609 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
4610 function noCase(input, options) {
4611 if (options === void 0) {
4612 options = {};
4613 }
4614 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
4615 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
4616 var start = 0;
4617 var end = result.length;
4618 while (result.charAt(start) === "\0")
4619 start++;
4620 while (result.charAt(end - 1) === "\0")
4621 end--;
4622 return result.slice(start, end).split("\0").map(transform).join(delimiter);
4623 }
4624 function replace(input, re, value) {
4625 if (re instanceof RegExp)
4626 return input.replace(re, value);
4627 return re.reduce(function(input2, re2) {
4628 return input2.replace(re2, value);
4629 }, input);
4630 }
4631
4632 // node_modules/pascal-case/dist.es2015/index.js
4633 function pascalCaseTransform(input, index) {
4634 var firstChar = input.charAt(0);
4635 var lowerChars = input.substr(1).toLowerCase();
4636 if (index > 0 && firstChar >= "0" && firstChar <= "9") {
4637 return "_" + firstChar + lowerChars;
4638 }
4639 return "" + firstChar.toUpperCase() + lowerChars;
4640 }
4641 function pascalCase(input, options) {
4642 if (options === void 0) {
4643 options = {};
4644 }
4645 return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
4646 }
4647
4648 // node_modules/camel-case/dist.es2015/index.js
4649 function camelCaseTransform(input, index) {
4650 if (index === 0)
4651 return input.toLowerCase();
4652 return pascalCaseTransform(input, index);
4653 }
4654 function camelCase(input, options) {
4655 if (options === void 0) {
4656 options = {};
4657 }
4658 return pascalCase(input, __assign({ transform: camelCaseTransform }, options));
4659 }
4660
4661 // packages/blocks/build-module/store/reducer.mjs
4662 var import_data2 = __toESM(require_data(), 1);
4663 var import_i18n3 = __toESM(require_i18n(), 1);
4664
4665 // node_modules/colord/index.mjs
4666 var r = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) };
4667 var t = function(r2) {
4668 return "string" == typeof r2 ? r2.length > 0 : "number" == typeof r2;
4669 };
4670 var n = function(r2, t3, n2) {
4671 return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r2) / n2 + 0;
4672 };
4673 var e = function(r2, t3, n2) {
4674 return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r2 > n2 ? n2 : r2 > t3 ? r2 : t3;
4675 };
4676 var u = function(r2) {
4677 return (r2 = isFinite(r2) ? r2 % 360 : 0) > 0 ? r2 : r2 + 360;
4678 };
4679 var a = function(r2) {
4680 return { r: e(r2.r, 0, 255), g: e(r2.g, 0, 255), b: e(r2.b, 0, 255), a: e(r2.a) };
4681 };
4682 var o = function(r2) {
4683 return { r: n(r2.r), g: n(r2.g), b: n(r2.b), a: n(r2.a, 3) };
4684 };
4685 var i = /^#([0-9a-f]{3,8})$/i;
4686 var s = function(r2) {
4687 var t3 = r2.toString(16);
4688 return t3.length < 2 ? "0" + t3 : t3;
4689 };
4690 var h = function(r2) {
4691 var t3 = r2.r, n2 = r2.g, e2 = r2.b, u2 = r2.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0;
4692 return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 };
4693 };
4694 var b = function(r2) {
4695 var t3 = r2.h, n2 = r2.s, e2 = r2.v, u2 = r2.a;
4696 t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100;
4697 var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6;
4698 return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 };
4699 };
4700 var g = function(r2) {
4701 return { h: u(r2.h), s: e(r2.s, 0, 100), l: e(r2.l, 0, 100), a: e(r2.a) };
4702 };
4703 var d = function(r2) {
4704 return { h: n(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) };
4705 };
4706 var f = function(r2) {
4707 return b((n2 = (t3 = r2).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a }));
4708 var t3, n2, e2;
4709 };
4710 var c = function(r2) {
4711 return { h: (t3 = h(r2)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a };
4712 var t3, n2, e2, u2;
4713 };
4714 var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
4715 var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
4716 var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
4717 var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
4718 var y = { string: [[function(r2) {
4719 var t3 = i.exec(r2);
4720 return t3 ? (r2 = t3[1]).length <= 4 ? { r: parseInt(r2[0] + r2[0], 16), g: parseInt(r2[1] + r2[1], 16), b: parseInt(r2[2] + r2[2], 16), a: 4 === r2.length ? n(parseInt(r2[3] + r2[3], 16) / 255, 2) : 1 } : 6 === r2.length || 8 === r2.length ? { r: parseInt(r2.substr(0, 2), 16), g: parseInt(r2.substr(2, 2), 16), b: parseInt(r2.substr(4, 2), 16), a: 8 === r2.length ? n(parseInt(r2.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
4721 }, "hex"], [function(r2) {
4722 var t3 = v.exec(r2) || m.exec(r2);
4723 return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null;
4724 }, "rgb"], [function(t3) {
4725 var n2 = l.exec(t3) || p.exec(t3);
4726 if (!n2) return null;
4727 var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) });
4728 return f(a2);
4729 }, "hsl"]], object: [[function(r2) {
4730 var n2 = r2.r, e2 = r2.g, u2 = r2.b, o3 = r2.a, i2 = void 0 === o3 ? 1 : o3;
4731 return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null;
4732 }, "rgb"], [function(r2) {
4733 var n2 = r2.h, e2 = r2.s, u2 = r2.l, a2 = r2.a, o3 = void 0 === a2 ? 1 : a2;
4734 if (!t(n2) || !t(e2) || !t(u2)) return null;
4735 var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) });
4736 return f(i2);
4737 }, "hsl"], [function(r2) {
4738 var n2 = r2.h, a2 = r2.s, o3 = r2.v, i2 = r2.a, s2 = void 0 === i2 ? 1 : i2;
4739 if (!t(n2) || !t(a2) || !t(o3)) return null;
4740 var h2 = (function(r3) {
4741 return { h: u(r3.h), s: e(r3.s, 0, 100), v: e(r3.v, 0, 100), a: e(r3.a) };
4742 })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) });
4743 return b(h2);
4744 }, "hsv"]] };
4745 var N = function(r2, t3) {
4746 for (var n2 = 0; n2 < t3.length; n2++) {
4747 var e2 = t3[n2][0](r2);
4748 if (e2) return [e2, t3[n2][1]];
4749 }
4750 return [null, void 0];
4751 };
4752 var x = function(r2) {
4753 return "string" == typeof r2 ? N(r2.trim(), y.string) : "object" == typeof r2 && null !== r2 ? N(r2, y.object) : [null, void 0];
4754 };
4755 var M = function(r2, t3) {
4756 var n2 = c(r2);
4757 return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a };
4758 };
4759 var H = function(r2) {
4760 return (299 * r2.r + 587 * r2.g + 114 * r2.b) / 1e3 / 255;
4761 };
4762 var $ = function(r2, t3) {
4763 var n2 = c(r2);
4764 return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a };
4765 };
4766 var j = (function() {
4767 function r2(r3) {
4768 this.parsed = x(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
4769 }
4770 return r2.prototype.isValid = function() {
4771 return null !== this.parsed;
4772 }, r2.prototype.brightness = function() {
4773 return n(H(this.rgba), 2);
4774 }, r2.prototype.isDark = function() {
4775 return H(this.rgba) < 0.5;
4776 }, r2.prototype.isLight = function() {
4777 return H(this.rgba) >= 0.5;
4778 }, r2.prototype.toHex = function() {
4779 return r3 = o(this.rgba), t3 = r3.r, e2 = r3.g, u2 = r3.b, i2 = (a2 = r3.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2;
4780 var r3, t3, e2, u2, a2, i2;
4781 }, r2.prototype.toRgb = function() {
4782 return o(this.rgba);
4783 }, r2.prototype.toRgbString = function() {
4784 return r3 = o(this.rgba), t3 = r3.r, n2 = r3.g, e2 = r3.b, (u2 = r3.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")";
4785 var r3, t3, n2, e2, u2;
4786 }, r2.prototype.toHsl = function() {
4787 return d(c(this.rgba));
4788 }, r2.prototype.toHslString = function() {
4789 return r3 = d(c(this.rgba)), t3 = r3.h, n2 = r3.s, e2 = r3.l, (u2 = r3.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)";
4790 var r3, t3, n2, e2, u2;
4791 }, r2.prototype.toHsv = function() {
4792 return r3 = h(this.rgba), { h: n(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) };
4793 var r3;
4794 }, r2.prototype.invert = function() {
4795 return w({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a });
4796 var r3;
4797 }, r2.prototype.saturate = function(r3) {
4798 return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, r3));
4799 }, r2.prototype.desaturate = function(r3) {
4800 return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, -r3));
4801 }, r2.prototype.grayscale = function() {
4802 return w(M(this.rgba, -1));
4803 }, r2.prototype.lighten = function(r3) {
4804 return void 0 === r3 && (r3 = 0.1), w($(this.rgba, r3));
4805 }, r2.prototype.darken = function(r3) {
4806 return void 0 === r3 && (r3 = 0.1), w($(this.rgba, -r3));
4807 }, r2.prototype.rotate = function(r3) {
4808 return void 0 === r3 && (r3 = 15), this.hue(this.hue() + r3);
4809 }, r2.prototype.alpha = function(r3) {
4810 return "number" == typeof r3 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r3 }) : n(this.rgba.a, 3);
4811 var t3;
4812 }, r2.prototype.hue = function(r3) {
4813 var t3 = c(this.rgba);
4814 return "number" == typeof r3 ? w({ h: r3, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h);
4815 }, r2.prototype.isEqual = function(r3) {
4816 return this.toHex() === w(r3).toHex();
4817 }, r2;
4818 })();
4819 var w = function(r2) {
4820 return r2 instanceof j ? r2 : new j(r2);
4821 };
4822 var S = [];
4823 var k = function(r2) {
4824 r2.forEach(function(r3) {
4825 S.indexOf(r3) < 0 && (r3(j, y), S.push(r3));
4826 });
4827 };
4828
4829 // node_modules/colord/plugins/names.mjs
4830 function names_default(e2, f2) {
4831 var a2 = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {};
4832 for (var d2 in a2) r2[a2[d2]] = d2;
4833 var l2 = {};
4834 e2.prototype.toName = function(f3) {
4835 if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent";
4836 var d3, i2, n2 = r2[this.toHex()];
4837 if (n2) return n2;
4838 if (null == f3 ? void 0 : f3.closest) {
4839 var o3 = this.toRgb(), t3 = 1 / 0, b2 = "black";
4840 if (!l2.length) for (var c2 in a2) l2[c2] = new e2(a2[c2]).toRgb();
4841 for (var g2 in a2) {
4842 var u2 = (d3 = o3, i2 = l2[g2], Math.pow(d3.r - i2.r, 2) + Math.pow(d3.g - i2.g, 2) + Math.pow(d3.b - i2.b, 2));
4843 u2 < t3 && (t3 = u2, b2 = g2);
4844 }
4845 return b2;
4846 }
4847 };
4848 f2.string.push([function(f3) {
4849 var r3 = f3.toLowerCase(), d3 = "transparent" === r3 ? "#0000" : a2[r3];
4850 return d3 ? new e2(d3).toRgb() : null;
4851 }, "name"]);
4852 }
4853
4854 // node_modules/colord/plugins/a11y.mjs
4855 var o2 = function(o3) {
4856 var t3 = o3 / 255;
4857 return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4);
4858 };
4859 var t2 = function(t3) {
4860 return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b);
4861 };
4862 function a11y_default(o3) {
4863 o3.prototype.luminance = function() {
4864 return o4 = t2(this.rgba), void 0 === (r2 = 2) && (r2 = 0), void 0 === n2 && (n2 = Math.pow(10, r2)), Math.round(n2 * o4) / n2 + 0;
4865 var o4, r2, n2;
4866 }, o3.prototype.contrast = function(r2) {
4867 void 0 === r2 && (r2 = "#FFF");
4868 var n2, a2, i2, e2, v2, u2, d2, c2 = r2 instanceof o3 ? r2 : new o3(r2);
4869 return e2 = this.rgba, v2 = c2.toRgb(), u2 = t2(e2), d2 = t2(v2), n2 = u2 > d2 ? (u2 + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0;
4870 }, o3.prototype.isReadable = function(o4, t3) {
4871 return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r2 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r2.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5);
4872 var r2, n2, a2, i2, e2;
4873 };
4874 }
4875
4876 // packages/blocks/build-module/api/utils.mjs
4877 var import_element = __toESM(require_element(), 1);
4878 var import_i18n2 = __toESM(require_i18n(), 1);
4879 var import_dom = __toESM(require_dom(), 1);
4880 var import_rich_text = __toESM(require_rich_text(), 1);
4881 var import_deprecated = __toESM(require_deprecated(), 1);
4882
4883 // packages/blocks/build-module/api/constants.mjs
4884 var BLOCK_ICON_DEFAULT = "block-default";
4885 var DEPRECATED_ENTRY_KEYS = [
4886 "attributes",
4887 "supports",
4888 "save",
4889 "migrate",
4890 "isEligible",
4891 "apiVersion"
4892 ];
4893 var __EXPERIMENTAL_STYLE_PROPERTY = {
4894 // Kept for back-compatibility purposes.
4895 "--wp--style--color--link": {
4896 value: ["color", "link"],
4897 support: ["color", "link"]
4898 },
4899 aspectRatio: {
4900 value: ["dimensions", "aspectRatio"],
4901 support: ["dimensions", "aspectRatio"],
4902 useEngine: true
4903 },
4904 background: {
4905 value: ["color", "gradient"],
4906 support: ["color", "gradients"],
4907 useEngine: true
4908 },
4909 backgroundColor: {
4910 value: ["color", "background"],
4911 support: ["color", "background"],
4912 requiresOptOut: true,
4913 useEngine: true
4914 },
4915 backgroundImage: {
4916 value: ["background", "backgroundImage"],
4917 support: ["background", "backgroundImage"],
4918 useEngine: true
4919 },
4920 backgroundRepeat: {
4921 value: ["background", "backgroundRepeat"],
4922 support: ["background", "backgroundRepeat"],
4923 useEngine: true
4924 },
4925 backgroundSize: {
4926 value: ["background", "backgroundSize"],
4927 support: ["background", "backgroundSize"],
4928 useEngine: true
4929 },
4930 backgroundPosition: {
4931 value: ["background", "backgroundPosition"],
4932 support: ["background", "backgroundPosition"],
4933 useEngine: true
4934 },
4935 backgroundGradient: {
4936 value: ["background", "gradient"],
4937 support: ["background", "gradient"],
4938 useEngine: true
4939 },
4940 borderColor: {
4941 value: ["border", "color"],
4942 support: ["__experimentalBorder", "color"],
4943 useEngine: true
4944 },
4945 borderRadius: {
4946 value: ["border", "radius"],
4947 support: ["__experimentalBorder", "radius"],
4948 properties: {
4949 borderTopLeftRadius: "topLeft",
4950 borderTopRightRadius: "topRight",
4951 borderBottomLeftRadius: "bottomLeft",
4952 borderBottomRightRadius: "bottomRight"
4953 },
4954 useEngine: true
4955 },
4956 borderStyle: {
4957 value: ["border", "style"],
4958 support: ["__experimentalBorder", "style"],
4959 useEngine: true
4960 },
4961 borderWidth: {
4962 value: ["border", "width"],
4963 support: ["__experimentalBorder", "width"],
4964 useEngine: true
4965 },
4966 borderTopColor: {
4967 value: ["border", "top", "color"],
4968 support: ["__experimentalBorder", "color"],
4969 useEngine: true
4970 },
4971 borderTopStyle: {
4972 value: ["border", "top", "style"],
4973 support: ["__experimentalBorder", "style"],
4974 useEngine: true
4975 },
4976 borderTopWidth: {
4977 value: ["border", "top", "width"],
4978 support: ["__experimentalBorder", "width"],
4979 useEngine: true
4980 },
4981 borderRightColor: {
4982 value: ["border", "right", "color"],
4983 support: ["__experimentalBorder", "color"],
4984 useEngine: true
4985 },
4986 borderRightStyle: {
4987 value: ["border", "right", "style"],
4988 support: ["__experimentalBorder", "style"],
4989 useEngine: true
4990 },
4991 borderRightWidth: {
4992 value: ["border", "right", "width"],
4993 support: ["__experimentalBorder", "width"],
4994 useEngine: true
4995 },
4996 borderBottomColor: {
4997 value: ["border", "bottom", "color"],
4998 support: ["__experimentalBorder", "color"],
4999 useEngine: true
5000 },
5001 borderBottomStyle: {
5002 value: ["border", "bottom", "style"],
5003 support: ["__experimentalBorder", "style"],
5004 useEngine: true
5005 },
5006 borderBottomWidth: {
5007 value: ["border", "bottom", "width"],
5008 support: ["__experimentalBorder", "width"],
5009 useEngine: true
5010 },
5011 borderLeftColor: {
5012 value: ["border", "left", "color"],
5013 support: ["__experimentalBorder", "color"],
5014 useEngine: true
5015 },
5016 borderLeftStyle: {
5017 value: ["border", "left", "style"],
5018 support: ["__experimentalBorder", "style"],
5019 useEngine: true
5020 },
5021 borderLeftWidth: {
5022 value: ["border", "left", "width"],
5023 support: ["__experimentalBorder", "width"],
5024 useEngine: true
5025 },
5026 color: {
5027 value: ["color", "text"],
5028 support: ["color", "text"],
5029 requiresOptOut: true,
5030 useEngine: true
5031 },
5032 columnCount: {
5033 value: ["typography", "textColumns"],
5034 support: ["typography", "textColumns"],
5035 useEngine: true
5036 },
5037 filter: {
5038 value: ["filter", "duotone"],
5039 support: ["filter", "duotone"]
5040 },
5041 linkColor: {
5042 value: ["elements", "link", "color", "text"],
5043 support: ["color", "link"]
5044 },
5045 captionColor: {
5046 value: ["elements", "caption", "color", "text"],
5047 support: ["color", "caption"]
5048 },
5049 buttonColor: {
5050 value: ["elements", "button", "color", "text"],
5051 support: ["color", "button"]
5052 },
5053 buttonBackgroundColor: {
5054 value: ["elements", "button", "color", "background"],
5055 support: ["color", "button"]
5056 },
5057 headingColor: {
5058 value: ["elements", "heading", "color", "text"],
5059 support: ["color", "heading"]
5060 },
5061 headingBackgroundColor: {
5062 value: ["elements", "heading", "color", "background"],
5063 support: ["color", "heading"]
5064 },
5065 fontFamily: {
5066 value: ["typography", "fontFamily"],
5067 support: ["typography", "__experimentalFontFamily"],
5068 useEngine: true
5069 },
5070 fontSize: {
5071 value: ["typography", "fontSize"],
5072 support: ["typography", "fontSize"],
5073 useEngine: true
5074 },
5075 fontStyle: {
5076 value: ["typography", "fontStyle"],
5077 support: ["typography", "__experimentalFontStyle"],
5078 useEngine: true
5079 },
5080 fontWeight: {
5081 value: ["typography", "fontWeight"],
5082 support: ["typography", "__experimentalFontWeight"],
5083 useEngine: true
5084 },
5085 lineHeight: {
5086 value: ["typography", "lineHeight"],
5087 support: ["typography", "lineHeight"],
5088 useEngine: true
5089 },
5090 margin: {
5091 value: ["spacing", "margin"],
5092 support: ["spacing", "margin"],
5093 properties: {
5094 marginTop: "top",
5095 marginRight: "right",
5096 marginBottom: "bottom",
5097 marginLeft: "left"
5098 },
5099 useEngine: true
5100 },
5101 minHeight: {
5102 value: ["dimensions", "minHeight"],
5103 support: ["dimensions", "minHeight"],
5104 useEngine: true
5105 },
5106 minWidth: {
5107 value: ["dimensions", "minWidth"],
5108 support: ["dimensions", "minWidth"],
5109 useEngine: true
5110 },
5111 height: {
5112 value: ["dimensions", "height"],
5113 support: ["dimensions", "height"],
5114 useEngine: true
5115 },
5116 width: {
5117 value: ["dimensions", "width"],
5118 support: ["dimensions", "width"],
5119 useEngine: true
5120 },
5121 padding: {
5122 value: ["spacing", "padding"],
5123 support: ["spacing", "padding"],
5124 properties: {
5125 paddingTop: "top",
5126 paddingRight: "right",
5127 paddingBottom: "bottom",
5128 paddingLeft: "left"
5129 },
5130 useEngine: true
5131 },
5132 textAlign: {
5133 value: ["typography", "textAlign"],
5134 support: ["typography", "textAlign"],
5135 useEngine: false
5136 },
5137 textDecoration: {
5138 value: ["typography", "textDecoration"],
5139 support: ["typography", "__experimentalTextDecoration"],
5140 useEngine: true
5141 },
5142 textTransform: {
5143 value: ["typography", "textTransform"],
5144 support: ["typography", "__experimentalTextTransform"],
5145 useEngine: true
5146 },
5147 letterSpacing: {
5148 value: ["typography", "letterSpacing"],
5149 support: ["typography", "__experimentalLetterSpacing"],
5150 useEngine: true
5151 },
5152 textIndent: {
5153 value: ["typography", "textIndent"],
5154 support: ["typography", "textIndent"],
5155 useEngine: true
5156 },
5157 writingMode: {
5158 value: ["typography", "writingMode"],
5159 support: ["typography", "__experimentalWritingMode"],
5160 useEngine: true
5161 },
5162 "--wp--style--root--padding": {
5163 value: ["spacing", "padding"],
5164 support: ["spacing", "padding"],
5165 properties: {
5166 "--wp--style--root--padding-top": "top",
5167 "--wp--style--root--padding-right": "right",
5168 "--wp--style--root--padding-bottom": "bottom",
5169 "--wp--style--root--padding-left": "left"
5170 },
5171 rootOnly: true
5172 }
5173 };
5174 var __EXPERIMENTAL_ELEMENTS = {
5175 link: "a:where(:not(.wp-element-button))",
5176 heading: "h1, h2, h3, h4, h5, h6",
5177 h1: "h1",
5178 h2: "h2",
5179 h3: "h3",
5180 h4: "h4",
5181 h5: "h5",
5182 h6: "h6",
5183 button: ".wp-element-button, .wp-block-button__link",
5184 caption: ".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",
5185 cite: "cite",
5186 select: "select",
5187 textInput: "textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])"
5188 };
5189 var __EXPERIMENTAL_PATHS_WITH_OVERRIDE = {
5190 "color.duotone": true,
5191 "color.gradients": true,
5192 "color.palette": true,
5193 "dimensions.aspectRatios": true,
5194 "typography.fontSizes": true,
5195 "spacing.spacingSizes": true
5196 };
5197
5198 // packages/blocks/build-module/api/registration.mjs
5199 var import_data = __toESM(require_data(), 1);
5200 var import_i18n = __toESM(require_i18n(), 1);
5201 var import_warning = __toESM(require_warning(), 1);
5202
5203 // packages/blocks/build-module/api/i18n-block.json
5204 var i18n_block_default = {
5205 title: "block title",
5206 description: "block description",
5207 keywords: ["block keyword"],
5208 styles: [
5209 {
5210 label: "block style label"
5211 }
5212 ],
5213 variations: [
5214 {
5215 title: "block variation title",
5216 description: "block variation description",
5217 keywords: ["block variation keyword"]
5218 }
5219 ]
5220 };
5221
5222 // packages/blocks/build-module/lock-unlock.mjs
5223 var import_private_apis = __toESM(require_private_apis(), 1);
5224 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
5225 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
5226 "@wordpress/blocks"
5227 );
5228
5229 // packages/blocks/build-module/api/registration.mjs
5230 function isObject(object) {
5231 return object !== null && typeof object === "object";
5232 }
5233 function unstable__bootstrapServerSideBlockDefinitions(definitions) {
5234 const { addBootstrappedBlockType: addBootstrappedBlockType2 } = unlock((0, import_data.dispatch)(store));
5235 for (const [name, blockType] of Object.entries(definitions)) {
5236 addBootstrappedBlockType2(name, blockType);
5237 }
5238 }
5239 function getBlockSettingsFromMetadata({
5240 textdomain,
5241 ...metadata
5242 }) {
5243 const allowedFields = [
5244 "apiVersion",
5245 "title",
5246 "category",
5247 "parent",
5248 "ancestor",
5249 "icon",
5250 "description",
5251 "keywords",
5252 "attributes",
5253 "providesContext",
5254 "usesContext",
5255 "selectors",
5256 "supports",
5257 "styles",
5258 "example",
5259 "variations",
5260 "blockHooks",
5261 "allowedBlocks"
5262 ];
5263 const settings = Object.fromEntries(
5264 Object.entries(metadata).filter(
5265 ([key]) => allowedFields.includes(key)
5266 )
5267 );
5268 if (textdomain) {
5269 Object.keys(i18n_block_default).forEach((key) => {
5270 if (!settings[key]) {
5271 return;
5272 }
5273 settings[key] = translateBlockSettingUsingI18nSchema(
5274 i18n_block_default[key],
5275 settings[key],
5276 textdomain
5277 );
5278 });
5279 }
5280 return settings;
5281 }
5282 function registerBlockType(blockNameOrMetadata, settings) {
5283 const name = isObject(blockNameOrMetadata) ? blockNameOrMetadata.name : blockNameOrMetadata;
5284 if (typeof name !== "string") {
5285 (0, import_warning.default)("Block names must be strings.");
5286 return;
5287 }
5288 if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) {
5289 (0, import_warning.default)(
5290 "Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block"
5291 );
5292 return;
5293 }
5294 if ((0, import_data.select)(store).getBlockType(name)) {
5295 (0, import_warning.default)('Block "' + name + '" is already registered.');
5296 return;
5297 }
5298 const { addBootstrappedBlockType: addBootstrappedBlockType2, addUnprocessedBlockType: addUnprocessedBlockType2 } = unlock(
5299 (0, import_data.dispatch)(store)
5300 );
5301 if (isObject(blockNameOrMetadata)) {
5302 const metadata = getBlockSettingsFromMetadata(blockNameOrMetadata);
5303 addBootstrappedBlockType2(name, metadata);
5304 }
5305 addUnprocessedBlockType2(name, settings);
5306 return (0, import_data.select)(store).getBlockType(name);
5307 }
5308 function translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdomain) {
5309 if (typeof i18nSchema === "string" && typeof settingValue === "string") {
5310 return (0, import_i18n._x)(settingValue, i18nSchema, textdomain);
5311 }
5312 if (Array.isArray(i18nSchema) && i18nSchema.length && Array.isArray(settingValue)) {
5313 return settingValue.map(
5314 (value) => translateBlockSettingUsingI18nSchema(
5315 i18nSchema[0],
5316 value,
5317 textdomain
5318 )
5319 );
5320 }
5321 if (isObject(i18nSchema) && Object.entries(i18nSchema).length && isObject(settingValue)) {
5322 return Object.keys(settingValue).reduce(
5323 (accumulator, key) => {
5324 if (!i18nSchema[key]) {
5325 accumulator[key] = settingValue[key];
5326 return accumulator;
5327 }
5328 accumulator[key] = translateBlockSettingUsingI18nSchema(
5329 i18nSchema[key],
5330 settingValue[key],
5331 textdomain
5332 );
5333 return accumulator;
5334 },
5335 {}
5336 );
5337 }
5338 return settingValue;
5339 }
5340 function registerBlockCollection(namespace, { title, icon }) {
5341 (0, import_data.dispatch)(store).addBlockCollection(namespace, title, icon);
5342 }
5343 function unregisterBlockType(name) {
5344 const oldBlock = (0, import_data.select)(store).getBlockType(name);
5345 if (!oldBlock) {
5346 (0, import_warning.default)('Block "' + name + '" is not registered.');
5347 return;
5348 }
5349 (0, import_data.dispatch)(store).removeBlockTypes(name);
5350 return oldBlock;
5351 }
5352 function setFreeformContentHandlerName(blockName) {
5353 (0, import_data.dispatch)(store).setFreeformFallbackBlockName(blockName);
5354 }
5355 function getFreeformContentHandlerName() {
5356 return (0, import_data.select)(store).getFreeformFallbackBlockName();
5357 }
5358 function getGroupingBlockName() {
5359 return (0, import_data.select)(store).getGroupingBlockName();
5360 }
5361 function setUnregisteredTypeHandlerName(blockName) {
5362 (0, import_data.dispatch)(store).setUnregisteredFallbackBlockName(blockName);
5363 }
5364 function getUnregisteredTypeHandlerName() {
5365 return (0, import_data.select)(store).getUnregisteredFallbackBlockName();
5366 }
5367 function setDefaultBlockName(name) {
5368 (0, import_data.dispatch)(store).setDefaultBlockName(name);
5369 }
5370 function setGroupingBlockName(name) {
5371 (0, import_data.dispatch)(store).setGroupingBlockName(name);
5372 }
5373 function getDefaultBlockName() {
5374 return (0, import_data.select)(store).getDefaultBlockName();
5375 }
5376 function getBlockType(name) {
5377 return (0, import_data.select)(store)?.getBlockType(name);
5378 }
5379 function getBlockTypes() {
5380 return (0, import_data.select)(store).getBlockTypes();
5381 }
5382 function getBlockSupport(nameOrType, feature, defaultSupports) {
5383 return (0, import_data.select)(store).getBlockSupport(
5384 nameOrType,
5385 feature,
5386 defaultSupports
5387 );
5388 }
5389 function hasBlockSupport(nameOrType, feature, defaultSupports) {
5390 return (0, import_data.select)(store).hasBlockSupport(
5391 nameOrType,
5392 feature,
5393 defaultSupports
5394 );
5395 }
5396 function isReusableBlock(blockOrType) {
5397 return blockOrType?.name === "core/block";
5398 }
5399 function isTemplatePart(blockOrType) {
5400 return blockOrType?.name === "core/template-part";
5401 }
5402 var getChildBlockNames = (blockName) => {
5403 return (0, import_data.select)(store).getChildBlockNames(blockName);
5404 };
5405 var hasChildBlocks = (blockName) => {
5406 return (0, import_data.select)(store).hasChildBlocks(blockName);
5407 };
5408 var hasChildBlocksWithInserterSupport = (blockName) => {
5409 return (0, import_data.select)(store).hasChildBlocksWithInserterSupport(blockName);
5410 };
5411 var registerBlockStyle = (blockNames, styleVariation) => {
5412 (0, import_data.dispatch)(store).addBlockStyles(blockNames, styleVariation);
5413 };
5414 var unregisterBlockStyle = (blockName, styleVariationName) => {
5415 (0, import_data.dispatch)(store).removeBlockStyles(blockName, styleVariationName);
5416 };
5417 var getBlockVariations = (blockName, scope) => {
5418 return (0, import_data.select)(store).getBlockVariations(blockName, scope);
5419 };
5420 var registerBlockVariation = (blockName, variation) => {
5421 if (Array.isArray(variation)) {
5422 for (const v2 of variation) {
5423 if (typeof v2.name !== "string") {
5424 (0, import_warning.default)("Variation names must be unique strings.");
5425 }
5426 }
5427 } else if (typeof variation.name !== "string") {
5428 (0, import_warning.default)("Variation names must be unique strings.");
5429 }
5430 (0, import_data.dispatch)(store).addBlockVariations(blockName, variation);
5431 };
5432 var unregisterBlockVariation = (blockName, variationName) => {
5433 (0, import_data.dispatch)(store).removeBlockVariations(blockName, variationName);
5434 };
5435 var registerBlockBindingsSource = (source) => {
5436 const {
5437 name,
5438 label,
5439 usesContext,
5440 getValues,
5441 setValues,
5442 canUserEditValue,
5443 getFieldsList
5444 } = source;
5445 const existingSource = unlock(
5446 (0, import_data.select)(store)
5447 ).getBlockBindingsSource(name);
5448 const serverProps = ["label", "usesContext"];
5449 for (const prop2 in existingSource) {
5450 if (!serverProps.includes(prop2) && existingSource[prop2]) {
5451 (0, import_warning.default)(
5452 'Block bindings source "' + name + '" is already registered.'
5453 );
5454 return;
5455 }
5456 }
5457 if (!name) {
5458 (0, import_warning.default)("Block bindings source must contain a name.");
5459 return;
5460 }
5461 if (typeof name !== "string") {
5462 (0, import_warning.default)("Block bindings source name must be a string.");
5463 return;
5464 }
5465 if (/[A-Z]+/.test(name)) {
5466 (0, import_warning.default)(
5467 "Block bindings source name must not contain uppercase characters."
5468 );
5469 return;
5470 }
5471 if (!/^[a-z0-9/-]+$/.test(name)) {
5472 (0, import_warning.default)(
5473 "Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source."
5474 );
5475 return;
5476 }
5477 if (!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(name)) {
5478 (0, import_warning.default)(
5479 "Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source."
5480 );
5481 return;
5482 }
5483 if (!label && !existingSource?.label) {
5484 (0, import_warning.default)("Block bindings source must contain a label.");
5485 return;
5486 }
5487 if (label && typeof label !== "string") {
5488 (0, import_warning.default)("Block bindings source label must be a string.");
5489 return;
5490 }
5491 if (label && existingSource?.label && label !== existingSource?.label) {
5492 (0, import_warning.default)('Block bindings "' + name + '" source label was overridden.');
5493 }
5494 if (usesContext && !Array.isArray(usesContext)) {
5495 (0, import_warning.default)("Block bindings source usesContext must be an array.");
5496 return;
5497 }
5498 if (getValues && typeof getValues !== "function") {
5499 (0, import_warning.default)("Block bindings source getValues must be a function.");
5500 return;
5501 }
5502 if (setValues && typeof setValues !== "function") {
5503 (0, import_warning.default)("Block bindings source setValues must be a function.");
5504 return;
5505 }
5506 if (canUserEditValue && typeof canUserEditValue !== "function") {
5507 (0, import_warning.default)("Block bindings source canUserEditValue must be a function.");
5508 return;
5509 }
5510 if (getFieldsList && typeof getFieldsList !== "function") {
5511 (0, import_warning.default)("Block bindings source getFieldsList must be a function.");
5512 return;
5513 }
5514 return unlock((0, import_data.dispatch)(store)).addBlockBindingsSource(source);
5515 };
5516 function unregisterBlockBindingsSource(name) {
5517 const oldSource = getBlockBindingsSource(name);
5518 if (!oldSource) {
5519 (0, import_warning.default)('Block bindings source "' + name + '" is not registered.');
5520 return;
5521 }
5522 unlock((0, import_data.dispatch)(store)).removeBlockBindingsSource(name);
5523 }
5524 function getBlockBindingsSource(name) {
5525 return unlock((0, import_data.select)(store)).getBlockBindingsSource(name);
5526 }
5527 function getBlockBindingsSources() {
5528 return unlock((0, import_data.select)(store)).getAllBlockBindingsSources();
5529 }
5530
5531 // packages/blocks/build-module/api/utils.mjs
5532 k([names_default, a11y_default]);
5533 var ICON_COLORS = ["#191e23", "#f8f9f9"];
5534 function isUnmodifiedBlock(block, role) {
5535 const blockAttributes = getBlockType(block.name)?.attributes ?? {};
5536 const attributesByRole = role ? Object.entries(blockAttributes).filter(([key, definition]) => {
5537 if (role === "content" && key === "metadata") {
5538 return Object.keys(
5539 block.attributes[key]?.bindings ?? {}
5540 ).length > 0;
5541 }
5542 return definition.role === role || definition.__experimentalRole === role;
5543 }) : [];
5544 const attributesToCheck = !!attributesByRole.length ? attributesByRole : Object.entries(blockAttributes);
5545 return attributesToCheck.every(([key, definition]) => {
5546 const value = block.attributes[key];
5547 if (definition.hasOwnProperty("default")) {
5548 return value === definition.default;
5549 }
5550 if (definition.type === "rich-text") {
5551 return !value?.length;
5552 }
5553 return value === void 0;
5554 });
5555 }
5556 function isUnmodifiedDefaultBlock(block, role) {
5557 return block.name === getDefaultBlockName() && isUnmodifiedBlock(block, role);
5558 }
5559 function isValidIcon(icon) {
5560 return !!icon && (typeof icon === "string" || (0, import_element.isValidElement)(icon) || typeof icon === "function" || icon instanceof import_element.Component);
5561 }
5562 function normalizeIconObject(icon) {
5563 const resolvedIcon = icon || BLOCK_ICON_DEFAULT;
5564 if (isValidIcon(resolvedIcon)) {
5565 return { src: resolvedIcon };
5566 }
5567 const iconDescriptor = resolvedIcon;
5568 if ("background" in iconDescriptor) {
5569 const colordBgColor = w(iconDescriptor.background);
5570 const getColorContrast = (iconColor) => colordBgColor.contrast(iconColor);
5571 const maxContrast = Math.max(...ICON_COLORS.map(getColorContrast));
5572 return {
5573 ...iconDescriptor,
5574 foreground: iconDescriptor.foreground ? iconDescriptor.foreground : ICON_COLORS.find(
5575 (iconColor) => getColorContrast(iconColor) === maxContrast
5576 ),
5577 shadowColor: colordBgColor.alpha(0.3).toRgbString()
5578 };
5579 }
5580 return iconDescriptor;
5581 }
5582 function normalizeBlockType(blockTypeOrName) {
5583 if (typeof blockTypeOrName === "string") {
5584 return getBlockType(blockTypeOrName);
5585 }
5586 return blockTypeOrName;
5587 }
5588 function getBlockLabel(blockType, attributes, context = "visual") {
5589 const { __experimentalLabel: getLabel, title } = blockType;
5590 const label = getLabel && getLabel(attributes, { context });
5591 if (!label) {
5592 return title;
5593 }
5594 if (label.toPlainText) {
5595 return label.toPlainText();
5596 }
5597 return (0, import_dom.__unstableStripHTML)(label);
5598 }
5599 function getAccessibleBlockLabel(blockType, attributes, position, direction = "vertical") {
5600 const title = blockType?.title ?? "";
5601 const label = blockType ? getBlockLabel(blockType, attributes, "accessibility") : "";
5602 const hasPosition = position !== void 0;
5603 const hasLabel = label && label !== title;
5604 if (hasPosition && direction === "vertical") {
5605 if (hasLabel) {
5606 return (0, import_i18n2.sprintf)(
5607 /* translators: accessibility text. 1: The block title. 2: The block row number. 3: The block label.. */
5608 (0, import_i18n2.__)("%1$s Block. Row %2$d. %3$s"),
5609 title,
5610 position,
5611 label
5612 );
5613 }
5614 return (0, import_i18n2.sprintf)(
5615 /* translators: accessibility text. 1: The block title. 2: The block row number. */
5616 (0, import_i18n2.__)("%1$s Block. Row %2$d"),
5617 title,
5618 position
5619 );
5620 } else if (hasPosition && direction === "horizontal") {
5621 if (hasLabel) {
5622 return (0, import_i18n2.sprintf)(
5623 /* translators: accessibility text. 1: The block title. 2: The block column number. 3: The block label.. */
5624 (0, import_i18n2.__)("%1$s Block. Column %2$d. %3$s"),
5625 title,
5626 position,
5627 label
5628 );
5629 }
5630 return (0, import_i18n2.sprintf)(
5631 /* translators: accessibility text. 1: The block title. 2: The block column number. */
5632 (0, import_i18n2.__)("%1$s Block. Column %2$d"),
5633 title,
5634 position
5635 );
5636 }
5637 if (hasLabel) {
5638 return (0, import_i18n2.sprintf)(
5639 /* translators: accessibility text. 1: The block title. 2: The block label. */
5640 (0, import_i18n2.__)("%1$s Block. %2$s"),
5641 title,
5642 label
5643 );
5644 }
5645 return (0, import_i18n2.sprintf)(
5646 /* translators: accessibility text. %s: The block title. */
5647 (0, import_i18n2.__)("%s Block"),
5648 title
5649 );
5650 }
5651 function getDefault(attributeSchema) {
5652 if (attributeSchema.default !== void 0) {
5653 return attributeSchema.default;
5654 }
5655 if (attributeSchema.type === "rich-text") {
5656 return new import_rich_text.RichTextData();
5657 }
5658 return void 0;
5659 }
5660 function isBlockRegistered(name) {
5661 return getBlockType(name) !== void 0;
5662 }
5663 function __experimentalSanitizeBlockAttributes(name, attributes) {
5664 const blockType = getBlockType(name);
5665 if (void 0 === blockType) {
5666 throw new Error(`Block type '${name}' is not registered.`);
5667 }
5668 return Object.entries(blockType.attributes).reduce(
5669 (accumulator, [key, schema]) => {
5670 const value = attributes[key];
5671 if (void 0 !== value) {
5672 if (schema.type === "rich-text") {
5673 if (value instanceof import_rich_text.RichTextData) {
5674 accumulator[key] = value;
5675 } else if (typeof value === "string") {
5676 accumulator[key] = import_rich_text.RichTextData.fromHTMLString(value);
5677 }
5678 } else if (schema.type === "string" && value instanceof import_rich_text.RichTextData) {
5679 accumulator[key] = value.toHTMLString();
5680 } else {
5681 accumulator[key] = value;
5682 }
5683 } else {
5684 const _default = getDefault(schema);
5685 if (void 0 !== _default) {
5686 accumulator[key] = _default;
5687 }
5688 }
5689 if (["node", "children"].indexOf(schema.source ?? "") !== -1) {
5690 if (typeof accumulator[key] === "string") {
5691 accumulator[key] = [accumulator[key]];
5692 } else if (!Array.isArray(accumulator[key])) {
5693 accumulator[key] = [];
5694 }
5695 }
5696 return accumulator;
5697 },
5698 {}
5699 );
5700 }
5701 function getBlockAttributesNamesByRole(name, role) {
5702 const attributes = getBlockType(name)?.attributes;
5703 if (!attributes) {
5704 return [];
5705 }
5706 const attributesNames = Object.keys(attributes);
5707 if (!role) {
5708 return attributesNames;
5709 }
5710 return attributesNames.filter((attributeName) => {
5711 const attribute = attributes[attributeName];
5712 if (attribute?.role === role) {
5713 return true;
5714 }
5715 if (attribute?.__experimentalRole === role) {
5716 (0, import_deprecated.default)("__experimentalRole attribute", {
5717 since: "6.7",
5718 version: "6.8",
5719 alternative: "role attribute",
5720 hint: `Check the block.json of the ${name} block.`
5721 });
5722 return true;
5723 }
5724 return false;
5725 });
5726 }
5727 var __experimentalGetBlockAttributesNamesByRole = (...args) => {
5728 (0, import_deprecated.default)("__experimentalGetBlockAttributesNamesByRole", {
5729 since: "6.7",
5730 version: "6.8",
5731 alternative: "getBlockAttributesNamesByRole"
5732 });
5733 return getBlockAttributesNamesByRole(...args);
5734 };
5735 function isContentBlock(name) {
5736 const blockType = getBlockType(name);
5737 const attributes = blockType?.attributes;
5738 const supportsContentRole = blockType?.supports?.contentRole;
5739 if (supportsContentRole) {
5740 return true;
5741 }
5742 if (!attributes) {
5743 return false;
5744 }
5745 return !!Object.keys(attributes)?.some((attributeKey) => {
5746 const attribute = attributes[attributeKey];
5747 return attribute?.role === "content" || attribute?.__experimentalRole === "content";
5748 });
5749 }
5750 function omit(object, keys) {
5751 const keysArray = Array.isArray(keys) ? keys : [keys];
5752 return Object.fromEntries(
5753 Object.entries(object).filter(
5754 ([key]) => !keysArray.includes(key)
5755 )
5756 );
5757 }
5758
5759 // packages/blocks/build-module/store/reducer.mjs
5760 var DEFAULT_CATEGORIES = [
5761 { slug: "text", title: (0, import_i18n3.__)("Text") },
5762 { slug: "media", title: (0, import_i18n3.__)("Media") },
5763 { slug: "design", title: (0, import_i18n3.__)("Design") },
5764 { slug: "widgets", title: (0, import_i18n3.__)("Widgets") },
5765 { slug: "theme", title: (0, import_i18n3.__)("Theme") },
5766 { slug: "embed", title: (0, import_i18n3.__)("Embeds") },
5767 { slug: "reusable", title: (0, import_i18n3.__)("Reusable blocks") }
5768 ];
5769 function keyBlockTypesByName(types) {
5770 return types.reduce(
5771 (newBlockTypes, block) => ({
5772 ...newBlockTypes,
5773 [block.name]: block
5774 }),
5775 {}
5776 );
5777 }
5778 function getUniqueItemsByName(items) {
5779 return items.reduce((acc, currentItem) => {
5780 if (!acc.some((item) => item.name === currentItem.name)) {
5781 acc.push(currentItem);
5782 }
5783 return acc;
5784 }, []);
5785 }
5786 function bootstrappedBlockTypes(state = {}, action) {
5787 switch (action.type) {
5788 case "ADD_BOOTSTRAPPED_BLOCK_TYPE":
5789 const { name, blockType } = action;
5790 const serverDefinition = state[name];
5791 if (serverDefinition) {
5792 return state;
5793 }
5794 const newDefinition = Object.fromEntries(
5795 Object.entries(blockType).filter(
5796 ([, value]) => value !== null && value !== void 0
5797 ).map(([key, value]) => [camelCase(key), value])
5798 );
5799 newDefinition.name = name;
5800 return {
5801 ...state,
5802 [name]: newDefinition
5803 };
5804 case "REMOVE_BLOCK_TYPES":
5805 return omit(state, action.names);
5806 }
5807 return state;
5808 }
5809 function unprocessedBlockTypes(state = {}, action) {
5810 switch (action.type) {
5811 case "ADD_UNPROCESSED_BLOCK_TYPE":
5812 return {
5813 ...state,
5814 [action.name]: action.blockType
5815 };
5816 case "REMOVE_BLOCK_TYPES":
5817 return omit(state, action.names);
5818 }
5819 return state;
5820 }
5821 function blockTypes(state = {}, action) {
5822 switch (action.type) {
5823 case "ADD_BLOCK_TYPES":
5824 return {
5825 ...state,
5826 ...keyBlockTypesByName(action.blockTypes)
5827 };
5828 case "REMOVE_BLOCK_TYPES":
5829 return omit(state, action.names);
5830 }
5831 return state;
5832 }
5833 function blockStyles(state = {}, action) {
5834 switch (action.type) {
5835 case "ADD_BLOCK_TYPES":
5836 return {
5837 ...state,
5838 ...Object.fromEntries(
5839 Object.entries(
5840 keyBlockTypesByName(action.blockTypes)
5841 ).map(([name, blockType]) => [
5842 name,
5843 getUniqueItemsByName([
5844 ...(blockType.styles ?? []).map((style) => ({
5845 ...style,
5846 source: "block"
5847 })),
5848 ...(state[blockType.name] ?? []).filter(
5849 ({ source }) => "block" !== source
5850 )
5851 ])
5852 ])
5853 )
5854 };
5855 case "ADD_BLOCK_STYLES":
5856 const updatedStyles = {};
5857 action.blockNames.forEach((blockName) => {
5858 updatedStyles[blockName] = getUniqueItemsByName([
5859 ...state[blockName] ?? [],
5860 ...action.styles
5861 ]);
5862 });
5863 return { ...state, ...updatedStyles };
5864 case "REMOVE_BLOCK_STYLES":
5865 return {
5866 ...state,
5867 [action.blockName]: (state[action.blockName] ?? []).filter(
5868 (style) => action.styleNames.indexOf(style.name) === -1
5869 )
5870 };
5871 }
5872 return state;
5873 }
5874 function blockVariations(state = {}, action) {
5875 switch (action.type) {
5876 case "ADD_BLOCK_TYPES":
5877 return {
5878 ...state,
5879 ...Object.fromEntries(
5880 Object.entries(
5881 keyBlockTypesByName(action.blockTypes)
5882 ).map(([name, blockType]) => {
5883 return [
5884 name,
5885 getUniqueItemsByName([
5886 ...(blockType.variations ?? []).map(
5887 (variation) => ({
5888 ...variation,
5889 source: "block"
5890 })
5891 ),
5892 ...(state[blockType.name] ?? []).filter(
5893 ({ source }) => "block" !== source
5894 )
5895 ])
5896 ];
5897 })
5898 )
5899 };
5900 case "ADD_BLOCK_VARIATIONS":
5901 return {
5902 ...state,
5903 [action.blockName]: getUniqueItemsByName([
5904 ...state[action.blockName] ?? [],
5905 ...action.variations
5906 ])
5907 };
5908 case "REMOVE_BLOCK_VARIATIONS":
5909 return {
5910 ...state,
5911 [action.blockName]: (state[action.blockName] ?? []).filter(
5912 (variation) => action.variationNames.indexOf(variation.name) === -1
5913 )
5914 };
5915 }
5916 return state;
5917 }
5918 function createBlockNameSetterReducer(setActionType) {
5919 return (state = null, action) => {
5920 switch (action.type) {
5921 case "REMOVE_BLOCK_TYPES":
5922 if (action.names.indexOf(state) !== -1) {
5923 return null;
5924 }
5925 return state;
5926 case setActionType:
5927 return action.name || null;
5928 }
5929 return state;
5930 };
5931 }
5932 var defaultBlockName = createBlockNameSetterReducer(
5933 "SET_DEFAULT_BLOCK_NAME"
5934 );
5935 var freeformFallbackBlockName = createBlockNameSetterReducer(
5936 "SET_FREEFORM_FALLBACK_BLOCK_NAME"
5937 );
5938 var unregisteredFallbackBlockName = createBlockNameSetterReducer(
5939 "SET_UNREGISTERED_FALLBACK_BLOCK_NAME"
5940 );
5941 var groupingBlockName = createBlockNameSetterReducer(
5942 "SET_GROUPING_BLOCK_NAME"
5943 );
5944 function categories(state = DEFAULT_CATEGORIES, action) {
5945 switch (action.type) {
5946 case "SET_CATEGORIES":
5947 const uniqueCategories = /* @__PURE__ */ new Map();
5948 (action.categories || []).forEach((category) => {
5949 uniqueCategories.set(category.slug, category);
5950 });
5951 return [...uniqueCategories.values()];
5952 case "UPDATE_CATEGORY": {
5953 if (!action.category || !Object.keys(action.category).length) {
5954 return state;
5955 }
5956 const categoryToChange = state.find(
5957 ({ slug }) => slug === action.slug
5958 );
5959 if (categoryToChange) {
5960 return state.map((category) => {
5961 if (category.slug === action.slug) {
5962 return {
5963 ...category,
5964 ...action.category
5965 };
5966 }
5967 return category;
5968 });
5969 }
5970 }
5971 }
5972 return state;
5973 }
5974 function collections(state = {}, action) {
5975 switch (action.type) {
5976 case "ADD_BLOCK_COLLECTION":
5977 return {
5978 ...state,
5979 [action.namespace]: {
5980 title: action.title,
5981 icon: action.icon
5982 }
5983 };
5984 case "REMOVE_BLOCK_COLLECTION":
5985 return omit(state, action.namespace);
5986 }
5987 return state;
5988 }
5989 function getMergedUsesContext(existingUsesContext = [], newUsesContext = []) {
5990 const mergedArrays = Array.from(
5991 new Set(existingUsesContext.concat(newUsesContext))
5992 );
5993 return mergedArrays.length > 0 ? mergedArrays : void 0;
5994 }
5995 function blockBindingsSources(state = {}, action) {
5996 switch (action.type) {
5997 case "ADD_BLOCK_BINDINGS_SOURCE":
5998 return {
5999 ...state,
6000 [action.name]: {
6001 label: action.label || state[action.name]?.label,
6002 usesContext: getMergedUsesContext(
6003 state[action.name]?.usesContext,
6004 action.usesContext
6005 ),
6006 getValues: action.getValues,
6007 setValues: action.setValues,
6008 // Only set `canUserEditValue` if `setValues` is also defined.
6009 canUserEditValue: action.setValues && action.canUserEditValue,
6010 getFieldsList: action.getFieldsList
6011 }
6012 };
6013 case "REMOVE_BLOCK_BINDINGS_SOURCE":
6014 return omit(state, action.name);
6015 }
6016 return state;
6017 }
6018 var reducer_default = (0, import_data2.combineReducers)({
6019 bootstrappedBlockTypes,
6020 unprocessedBlockTypes,
6021 blockTypes,
6022 blockStyles,
6023 blockVariations,
6024 defaultBlockName,
6025 freeformFallbackBlockName,
6026 unregisteredFallbackBlockName,
6027 groupingBlockName,
6028 categories,
6029 collections,
6030 blockBindingsSources
6031 });
6032
6033 // packages/blocks/build-module/store/selectors.mjs
6034 var selectors_exports = {};
6035 __export(selectors_exports, {
6036 __experimentalHasContentRoleAttribute: () => __experimentalHasContentRoleAttribute,
6037 getActiveBlockVariation: () => getActiveBlockVariation,
6038 getBlockStyles: () => getBlockStyles,
6039 getBlockSupport: () => getBlockSupport2,
6040 getBlockType: () => getBlockType2,
6041 getBlockTypes: () => getBlockTypes2,
6042 getBlockVariations: () => getBlockVariations2,
6043 getCategories: () => getCategories,
6044 getChildBlockNames: () => getChildBlockNames2,
6045 getCollections: () => getCollections,
6046 getDefaultBlockName: () => getDefaultBlockName2,
6047 getDefaultBlockVariation: () => getDefaultBlockVariation,
6048 getFreeformFallbackBlockName: () => getFreeformFallbackBlockName,
6049 getGroupingBlockName: () => getGroupingBlockName2,
6050 getUnregisteredFallbackBlockName: () => getUnregisteredFallbackBlockName,
6051 hasBlockSupport: () => hasBlockSupport2,
6052 hasChildBlocks: () => hasChildBlocks2,
6053 hasChildBlocksWithInserterSupport: () => hasChildBlocksWithInserterSupport2,
6054 isMatchingSearchTerm: () => isMatchingSearchTerm
6055 });
6056 var import_remove_accents = __toESM(require_remove_accents(), 1);
6057 var import_data4 = __toESM(require_data(), 1);
6058 var import_rich_text2 = __toESM(require_rich_text(), 1);
6059 var import_deprecated3 = __toESM(require_deprecated(), 1);
6060
6061 // packages/blocks/build-module/store/utils.mjs
6062 var getValueFromObjectPath = (object, path, defaultValue) => {
6063 const normalizedPath = Array.isArray(path) ? path : path.split(".");
6064 let value = object;
6065 normalizedPath.forEach((fieldName) => {
6066 value = value?.[fieldName];
6067 });
6068 return value ?? defaultValue;
6069 };
6070 function isObject2(candidate) {
6071 return typeof candidate === "object" && candidate !== null && candidate.constructor === Object;
6072 }
6073 function matchesAttributes(blockAttributes, variationAttributes) {
6074 if (isObject2(blockAttributes) && isObject2(variationAttributes)) {
6075 return Object.entries(variationAttributes).every(
6076 ([key, value]) => matchesAttributes(blockAttributes?.[key], value)
6077 );
6078 }
6079 return blockAttributes === variationAttributes;
6080 }
6081
6082 // packages/blocks/build-module/store/private-selectors.mjs
6083 var private_selectors_exports = {};
6084 __export(private_selectors_exports, {
6085 getAllBlockBindingsSources: () => getAllBlockBindingsSources,
6086 getBlockBindingsSource: () => getBlockBindingsSource2,
6087 getBlockBindingsSourceFieldsList: () => getBlockBindingsSourceFieldsList,
6088 getBootstrappedBlockType: () => getBootstrappedBlockType,
6089 getSupportedStyles: () => getSupportedStyles,
6090 getUnprocessedBlockTypes: () => getUnprocessedBlockTypes,
6091 hasContentRoleAttribute: () => hasContentRoleAttribute
6092 });
6093 var import_data3 = __toESM(require_data(), 1);
6094 var import_deprecated2 = __toESM(require_deprecated(), 1);
6095 var ROOT_BLOCK_SUPPORTS = [
6096 "background",
6097 "backgroundColor",
6098 "color",
6099 "linkColor",
6100 "captionColor",
6101 "buttonColor",
6102 "headingColor",
6103 "fontFamily",
6104 "fontSize",
6105 "fontStyle",
6106 "fontWeight",
6107 "lineHeight",
6108 "padding",
6109 "contentSize",
6110 "wideSize",
6111 "blockGap",
6112 "textAlign",
6113 "textDecoration",
6114 "textIndent",
6115 "textTransform",
6116 "letterSpacing"
6117 ];
6118 function filterElementBlockSupports(blockSupports, name, element) {
6119 return blockSupports.filter((support) => {
6120 if (support === "fontSize" && element === "heading") {
6121 return false;
6122 }
6123 if (support === "textDecoration" && !name && element !== "link") {
6124 return false;
6125 }
6126 if (support === "textTransform" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes(
6127 element
6128 ) || element === "button" || element === "caption" || element === "text")) {
6129 return false;
6130 }
6131 if (support === "letterSpacing" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes(
6132 element
6133 ) || element === "button" || element === "caption" || element === "text")) {
6134 return false;
6135 }
6136 if (support === "textIndent" && !name) {
6137 return false;
6138 }
6139 if (support === "textColumns" && !name) {
6140 return false;
6141 }
6142 return true;
6143 });
6144 }
6145 var getSupportedStyles = (0, import_data3.createSelector)(
6146 (state, name, element) => {
6147 if (!name) {
6148 return filterElementBlockSupports(
6149 ROOT_BLOCK_SUPPORTS,
6150 name,
6151 element
6152 );
6153 }
6154 const blockType = getBlockType2(state, name);
6155 if (!blockType) {
6156 return [];
6157 }
6158 const supportKeys = [];
6159 const supports = blockType?.supports;
6160 if (supports?.spacing?.blockGap) {
6161 supportKeys.push("blockGap");
6162 }
6163 if (supports?.shadow) {
6164 supportKeys.push("shadow");
6165 }
6166 const stylePropertyMap = __EXPERIMENTAL_STYLE_PROPERTY;
6167 Object.keys(stylePropertyMap).forEach((styleName) => {
6168 if (!stylePropertyMap[styleName].support) {
6169 return;
6170 }
6171 if (stylePropertyMap[styleName].requiresOptOut) {
6172 if (supports && stylePropertyMap[styleName].support[0] in supports && getValueFromObjectPath(
6173 supports,
6174 stylePropertyMap[styleName].support
6175 ) !== false) {
6176 supportKeys.push(styleName);
6177 return;
6178 }
6179 }
6180 if (supports && getValueFromObjectPath(
6181 supports,
6182 stylePropertyMap[styleName].support,
6183 false
6184 )) {
6185 supportKeys.push(styleName);
6186 }
6187 });
6188 return filterElementBlockSupports(supportKeys, name, element);
6189 },
6190 (state, name) => [
6191 state.blockTypes[name]
6192 ]
6193 );
6194 function getBootstrappedBlockType(state, name) {
6195 return state.bootstrappedBlockTypes[name];
6196 }
6197 function getUnprocessedBlockTypes(state) {
6198 return state.unprocessedBlockTypes;
6199 }
6200 function getAllBlockBindingsSources(state) {
6201 return state.blockBindingsSources;
6202 }
6203 function getBlockBindingsSource2(state, sourceName) {
6204 return state.blockBindingsSources[sourceName];
6205 }
6206 var getBlockBindingsSourceFieldsList = (0, import_data3.createRegistrySelector)(
6207 (select3) => (0, import_data3.createSelector)(
6208 (state, source, blockContext) => {
6209 if (!source.getFieldsList) {
6210 return [];
6211 }
6212 const context = {};
6213 if (source?.usesContext?.length) {
6214 for (const key of source.usesContext) {
6215 context[key] = blockContext[key];
6216 }
6217 }
6218 return source.getFieldsList({ select: select3, context });
6219 },
6220 (state, source, blockContext) => [source.getFieldsList, source.usesContext, blockContext]
6221 )
6222 );
6223 var hasContentRoleAttribute = (state, blockTypeName) => {
6224 const blockType = getBlockType2(state, blockTypeName);
6225 if (!blockType) {
6226 return false;
6227 }
6228 return Object.values(blockType.attributes).some(
6229 ({ role, __experimentalRole }) => {
6230 if (role === "content") {
6231 return true;
6232 }
6233 if (__experimentalRole === "content") {
6234 (0, import_deprecated2.default)("__experimentalRole attribute", {
6235 since: "6.7",
6236 version: "6.8",
6237 alternative: "role attribute",
6238 hint: `Check the block.json of the ${blockTypeName} block.`
6239 });
6240 return true;
6241 }
6242 return false;
6243 }
6244 );
6245 };
6246
6247 // packages/blocks/build-module/store/selectors.mjs
6248 var getNormalizedBlockType = (state, nameOrType) => "string" === typeof nameOrType ? getBlockType2(state, nameOrType) : nameOrType;
6249 var getBlockTypes2 = (0, import_data4.createSelector)(
6250 (state) => Object.values(state.blockTypes),
6251 (state) => [state.blockTypes]
6252 );
6253 function getBlockType2(state, name) {
6254 return state.blockTypes[name];
6255 }
6256 function getBlockStyles(state, name) {
6257 return state.blockStyles[name];
6258 }
6259 var getBlockVariations2 = (0, import_data4.createSelector)(
6260 (state, blockName, scope) => {
6261 const variations = state.blockVariations[blockName];
6262 if (!variations || !scope) {
6263 return variations;
6264 }
6265 return variations.filter((variation) => {
6266 return (variation.scope || ["block", "inserter"]).includes(
6267 scope
6268 );
6269 });
6270 },
6271 (state, blockName) => [
6272 state.blockVariations[blockName]
6273 ]
6274 );
6275 function getActiveBlockVariation(state, blockName, attributes, scope) {
6276 const variations = getBlockVariations2(state, blockName, scope);
6277 if (!variations) {
6278 return variations;
6279 }
6280 const blockType = getBlockType2(state, blockName);
6281 const attributeKeys = Object.keys(blockType?.attributes || {});
6282 let match;
6283 let maxMatchedAttributes = 0;
6284 for (const variation of variations) {
6285 if (Array.isArray(variation.isActive)) {
6286 const definedAttributes = variation.isActive.filter(
6287 (attribute) => {
6288 const topLevelAttribute = attribute.split(".")[0];
6289 return attributeKeys.includes(topLevelAttribute);
6290 }
6291 );
6292 const definedAttributesLength = definedAttributes.length;
6293 if (definedAttributesLength === 0) {
6294 continue;
6295 }
6296 const isMatch = definedAttributes.every((attribute) => {
6297 const variationAttributeValue = getValueFromObjectPath(
6298 variation.attributes,
6299 attribute
6300 );
6301 if (variationAttributeValue === void 0) {
6302 return false;
6303 }
6304 let blockAttributeValue = getValueFromObjectPath(
6305 attributes,
6306 attribute
6307 );
6308 if (blockAttributeValue instanceof import_rich_text2.RichTextData) {
6309 blockAttributeValue = blockAttributeValue.toHTMLString();
6310 }
6311 return matchesAttributes(
6312 blockAttributeValue,
6313 variationAttributeValue
6314 );
6315 });
6316 if (isMatch && definedAttributesLength > maxMatchedAttributes) {
6317 match = variation;
6318 maxMatchedAttributes = definedAttributesLength;
6319 }
6320 } else if (variation.isActive?.(
6321 attributes,
6322 variation.attributes
6323 )) {
6324 return match || variation;
6325 }
6326 }
6327 if (!match && ["block", "transform"].includes(scope)) {
6328 match = variations.find(
6329 (variation) => variation?.isDefault && !Object.hasOwn(variation, "isActive")
6330 );
6331 }
6332 return match;
6333 }
6334 function getDefaultBlockVariation(state, blockName, scope) {
6335 const variations = getBlockVariations2(state, blockName, scope);
6336 const defaultVariation = [...variations || []].reverse().find(({ isDefault }) => !!isDefault);
6337 return defaultVariation || variations?.[0];
6338 }
6339 function getCategories(state) {
6340 return state.categories;
6341 }
6342 function getCollections(state) {
6343 return state.collections;
6344 }
6345 function getDefaultBlockName2(state) {
6346 return state.defaultBlockName;
6347 }
6348 function getFreeformFallbackBlockName(state) {
6349 return state.freeformFallbackBlockName;
6350 }
6351 function getUnregisteredFallbackBlockName(state) {
6352 return state.unregisteredFallbackBlockName;
6353 }
6354 function getGroupingBlockName2(state) {
6355 return state.groupingBlockName;
6356 }
6357 var getChildBlockNames2 = (0, import_data4.createSelector)(
6358 (state, blockName) => {
6359 return getBlockTypes2(state).filter((blockType) => {
6360 return blockType.parent?.includes(blockName);
6361 }).map(({ name }) => name);
6362 },
6363 (state) => [state.blockTypes]
6364 );
6365 var getBlockSupport2 = (state, nameOrType, feature, defaultSupports) => {
6366 const blockType = getNormalizedBlockType(state, nameOrType);
6367 if (!blockType?.supports) {
6368 return defaultSupports;
6369 }
6370 return getValueFromObjectPath(
6371 blockType.supports,
6372 feature,
6373 defaultSupports
6374 );
6375 };
6376 function hasBlockSupport2(state, nameOrType, feature, defaultSupports) {
6377 return !!getBlockSupport2(state, nameOrType, feature, defaultSupports);
6378 }
6379 function getNormalizedSearchTerm(term) {
6380 return (0, import_remove_accents.default)(term ?? "").toLowerCase().trim();
6381 }
6382 function isMatchingSearchTerm(state, nameOrType, searchTerm = "") {
6383 const blockType = getNormalizedBlockType(state, nameOrType);
6384 const normalizedSearchTerm = getNormalizedSearchTerm(searchTerm);
6385 const isSearchMatch = (candidate) => getNormalizedSearchTerm(candidate).includes(normalizedSearchTerm);
6386 return isSearchMatch(blockType?.title) || blockType?.keywords?.some(isSearchMatch) || isSearchMatch(blockType?.category) || typeof blockType?.description === "string" && isSearchMatch(blockType.description);
6387 }
6388 var hasChildBlocks2 = (state, blockName) => {
6389 return getChildBlockNames2(state, blockName).length > 0;
6390 };
6391 var hasChildBlocksWithInserterSupport2 = (state, blockName) => {
6392 return getChildBlockNames2(state, blockName).some((childBlockName) => {
6393 return hasBlockSupport2(state, childBlockName, "inserter", true);
6394 });
6395 };
6396 var __experimentalHasContentRoleAttribute = (...args) => {
6397 (0, import_deprecated3.default)("__experimentalHasContentRoleAttribute", {
6398 since: "6.7",
6399 version: "6.8",
6400 hint: "This is a private selector."
6401 });
6402 return hasContentRoleAttribute(...args);
6403 };
6404
6405 // packages/blocks/build-module/store/actions.mjs
6406 var actions_exports = {};
6407 __export(actions_exports, {
6408 __experimentalReapplyBlockFilters: () => __experimentalReapplyBlockFilters,
6409 addBlockCollection: () => addBlockCollection,
6410 addBlockStyles: () => addBlockStyles,
6411 addBlockTypes: () => addBlockTypes,
6412 addBlockVariations: () => addBlockVariations,
6413 reapplyBlockTypeFilters: () => reapplyBlockTypeFilters,
6414 removeBlockCollection: () => removeBlockCollection,
6415 removeBlockStyles: () => removeBlockStyles,
6416 removeBlockTypes: () => removeBlockTypes,
6417 removeBlockVariations: () => removeBlockVariations,
6418 setCategories: () => setCategories,
6419 setDefaultBlockName: () => setDefaultBlockName2,
6420 setFreeformFallbackBlockName: () => setFreeformFallbackBlockName,
6421 setGroupingBlockName: () => setGroupingBlockName2,
6422 setUnregisteredFallbackBlockName: () => setUnregisteredFallbackBlockName,
6423 updateCategory: () => updateCategory
6424 });
6425 var import_deprecated5 = __toESM(require_deprecated(), 1);
6426
6427 // node_modules/is-plain-object/dist/is-plain-object.mjs
6428 function isObject3(o3) {
6429 return Object.prototype.toString.call(o3) === "[object Object]";
6430 }
6431 function isPlainObject(o3) {
6432 var ctor, prot;
6433 if (isObject3(o3) === false) return false;
6434 ctor = o3.constructor;
6435 if (ctor === void 0) return true;
6436 prot = ctor.prototype;
6437 if (isObject3(prot) === false) return false;
6438 if (prot.hasOwnProperty("isPrototypeOf") === false) {
6439 return false;
6440 }
6441 return true;
6442 }
6443
6444 // packages/blocks/build-module/store/process-block-type.mjs
6445 var import_react_is = __toESM(require_react_is(), 1);
6446 var import_deprecated4 = __toESM(require_deprecated(), 1);
6447 var import_hooks = __toESM(require_hooks(), 1);
6448 var import_warning2 = __toESM(require_warning(), 1);
6449 var LEGACY_CATEGORY_MAPPING = {
6450 common: "text",
6451 formatting: "text",
6452 layout: "design"
6453 };
6454 function mergeBlockVariations(bootstrappedVariations = [], clientVariations = []) {
6455 const result = [...bootstrappedVariations];
6456 clientVariations.forEach((clientVariation) => {
6457 const index = result.findIndex(
6458 (bootstrappedVariation) => bootstrappedVariation.name === clientVariation.name
6459 );
6460 if (index !== -1) {
6461 result[index] = { ...result[index], ...clientVariation };
6462 } else {
6463 result.push(clientVariation);
6464 }
6465 });
6466 return result;
6467 }
6468 var processBlockType = (name, blockSettings) => ({
6469 select: select3
6470 }) => {
6471 const bootstrappedBlockType = select3.getBootstrappedBlockType(name);
6472 const blockType = {
6473 apiVersion: 1,
6474 name,
6475 icon: BLOCK_ICON_DEFAULT,
6476 keywords: [],
6477 attributes: {},
6478 providesContext: {},
6479 usesContext: [],
6480 selectors: {},
6481 supports: {},
6482 styles: [],
6483 blockHooks: {},
6484 save: () => null,
6485 ...bootstrappedBlockType,
6486 ...blockSettings,
6487 // blockType.variations can be defined as a filePath.
6488 variations: mergeBlockVariations(
6489 Array.isArray(bootstrappedBlockType?.variations) ? bootstrappedBlockType.variations : [],
6490 Array.isArray(blockSettings?.variations) ? blockSettings.variations : []
6491 )
6492 };
6493 if (!blockType.attributes || typeof blockType.attributes !== "object") {
6494 (0, import_warning2.default)(
6495 'The block "' + name + '" is registering attributes as `null` or `undefined`. Use an empty object (`attributes: {}`) or exclude the `attributes` key.'
6496 );
6497 blockType.attributes = {};
6498 }
6499 const settings = (0, import_hooks.applyFilters)(
6500 "blocks.registerBlockType",
6501 blockType,
6502 name,
6503 null
6504 );
6505 if (settings.apiVersion <= 2) {
6506 (0, import_deprecated4.default)("Block with API version 2 or lower", {
6507 since: "6.9",
6508 hint: `The block "${name}" is registered with API version ${settings.apiVersion}. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the \`apiVersion\` field to 3 and test the block inside the iframe editor.`,
6509 link: "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/"
6510 });
6511 }
6512 if (settings.description && typeof settings.description !== "string") {
6513 (0, import_deprecated4.default)("Declaring non-string block descriptions", {
6514 since: "6.2"
6515 });
6516 }
6517 if (settings.deprecated) {
6518 settings.deprecated = settings.deprecated.map(
6519 (deprecation) => Object.fromEntries(
6520 Object.entries(
6521 // Only keep valid deprecation keys.
6522 (0, import_hooks.applyFilters)(
6523 "blocks.registerBlockType",
6524 // Merge deprecation keys with pre-filter settings
6525 // so that filters that depend on specific keys being
6526 // present don't fail.
6527 {
6528 // Omit deprecation keys here so that deprecations
6529 // can opt out of specific keys like "supports".
6530 ...omit(blockType, DEPRECATED_ENTRY_KEYS),
6531 ...deprecation
6532 },
6533 blockType.name,
6534 deprecation
6535 )
6536 ).filter(
6537 ([key]) => DEPRECATED_ENTRY_KEYS.includes(key)
6538 )
6539 )
6540 );
6541 }
6542 if (!isPlainObject(settings)) {
6543 (0, import_warning2.default)("Block settings must be a valid object.");
6544 return;
6545 }
6546 if (typeof settings.save !== "function") {
6547 (0, import_warning2.default)('The "save" property must be a valid function.');
6548 return;
6549 }
6550 if ("edit" in settings && !(0, import_react_is.isValidElementType)(settings.edit)) {
6551 (0, import_warning2.default)('The "edit" property must be a valid component.');
6552 return;
6553 }
6554 if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) {
6555 settings.category = LEGACY_CATEGORY_MAPPING[settings.category];
6556 }
6557 if ("category" in settings && !select3.getCategories().some(
6558 ({ slug }) => slug === settings.category
6559 )) {
6560 (0, import_warning2.default)(
6561 'The block "' + name + '" is registered with an invalid category "' + settings.category + '".'
6562 );
6563 delete settings.category;
6564 }
6565 if (!("title" in settings) || settings.title === "") {
6566 (0, import_warning2.default)('The block "' + name + '" must have a title.');
6567 return;
6568 }
6569 if (typeof settings.title !== "string") {
6570 (0, import_warning2.default)("Block titles must be strings.");
6571 return;
6572 }
6573 settings.icon = normalizeIconObject(settings.icon);
6574 if (!isValidIcon(settings.icon.src)) {
6575 (0, import_warning2.default)(
6576 "The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional"
6577 );
6578 return;
6579 }
6580 if (typeof settings?.parent === "string" || settings?.parent instanceof String) {
6581 settings.parent = [settings.parent];
6582 (0, import_warning2.default)(
6583 "Parent must be undefined or an array of strings (block types), but it is a string."
6584 );
6585 }
6586 if (!Array.isArray(settings?.parent) && settings?.parent !== void 0) {
6587 (0, import_warning2.default)(
6588 "Parent must be undefined or an array of block types, but it is " + settings.parent
6589 );
6590 return;
6591 }
6592 if (1 === settings?.parent?.length && name === settings.parent[0]) {
6593 (0, import_warning2.default)(
6594 'Block "' + name + '" cannot be a parent of itself. Please remove the block name from the parent list.'
6595 );
6596 return;
6597 }
6598 return settings;
6599 };
6600
6601 // packages/blocks/build-module/store/actions.mjs
6602 function addBlockTypes(blockTypes2) {
6603 return {
6604 type: "ADD_BLOCK_TYPES",
6605 blockTypes: Array.isArray(blockTypes2) ? blockTypes2 : [blockTypes2]
6606 };
6607 }
6608 function reapplyBlockTypeFilters() {
6609 return ({ dispatch: dispatch3, select: select3 }) => {
6610 const processedBlockTypes = [];
6611 for (const [name, settings] of Object.entries(
6612 select3.getUnprocessedBlockTypes()
6613 )) {
6614 const result = dispatch3(processBlockType(name, settings));
6615 if (result) {
6616 processedBlockTypes.push(result);
6617 }
6618 }
6619 if (!processedBlockTypes.length) {
6620 return;
6621 }
6622 dispatch3.addBlockTypes(processedBlockTypes);
6623 };
6624 }
6625 function __experimentalReapplyBlockFilters() {
6626 (0, import_deprecated5.default)(
6627 'wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',
6628 {
6629 since: "6.4",
6630 alternative: "reapplyBlockFilters"
6631 }
6632 );
6633 return reapplyBlockTypeFilters();
6634 }
6635 function removeBlockTypes(names) {
6636 return {
6637 type: "REMOVE_BLOCK_TYPES",
6638 names: Array.isArray(names) ? names : [names]
6639 };
6640 }
6641 function addBlockStyles(blockNames, styles) {
6642 return {
6643 type: "ADD_BLOCK_STYLES",
6644 styles: Array.isArray(styles) ? styles : [styles],
6645 blockNames: Array.isArray(blockNames) ? blockNames : [blockNames]
6646 };
6647 }
6648 function removeBlockStyles(blockName, styleNames) {
6649 return {
6650 type: "REMOVE_BLOCK_STYLES",
6651 styleNames: Array.isArray(styleNames) ? styleNames : [styleNames],
6652 blockName
6653 };
6654 }
6655 function addBlockVariations(blockName, variations) {
6656 return {
6657 type: "ADD_BLOCK_VARIATIONS",
6658 variations: Array.isArray(variations) ? variations : [variations],
6659 blockName
6660 };
6661 }
6662 function removeBlockVariations(blockName, variationNames) {
6663 return {
6664 type: "REMOVE_BLOCK_VARIATIONS",
6665 variationNames: Array.isArray(variationNames) ? variationNames : [variationNames],
6666 blockName
6667 };
6668 }
6669 function setDefaultBlockName2(name) {
6670 return {
6671 type: "SET_DEFAULT_BLOCK_NAME",
6672 name
6673 };
6674 }
6675 function setFreeformFallbackBlockName(name) {
6676 return {
6677 type: "SET_FREEFORM_FALLBACK_BLOCK_NAME",
6678 name
6679 };
6680 }
6681 function setUnregisteredFallbackBlockName(name) {
6682 return {
6683 type: "SET_UNREGISTERED_FALLBACK_BLOCK_NAME",
6684 name
6685 };
6686 }
6687 function setGroupingBlockName2(name) {
6688 return {
6689 type: "SET_GROUPING_BLOCK_NAME",
6690 name
6691 };
6692 }
6693 function setCategories(categories2) {
6694 return {
6695 type: "SET_CATEGORIES",
6696 categories: categories2
6697 };
6698 }
6699 function updateCategory(slug, category) {
6700 return {
6701 type: "UPDATE_CATEGORY",
6702 slug,
6703 category
6704 };
6705 }
6706 function addBlockCollection(namespace, title, icon) {
6707 return {
6708 type: "ADD_BLOCK_COLLECTION",
6709 namespace,
6710 title,
6711 icon
6712 };
6713 }
6714 function removeBlockCollection(namespace) {
6715 return {
6716 type: "REMOVE_BLOCK_COLLECTION",
6717 namespace
6718 };
6719 }
6720
6721 // packages/blocks/build-module/store/private-actions.mjs
6722 var private_actions_exports = {};
6723 __export(private_actions_exports, {
6724 addBlockBindingsSource: () => addBlockBindingsSource,
6725 addBootstrappedBlockType: () => addBootstrappedBlockType,
6726 addUnprocessedBlockType: () => addUnprocessedBlockType,
6727 removeBlockBindingsSource: () => removeBlockBindingsSource
6728 });
6729 function addBootstrappedBlockType(name, blockType) {
6730 return {
6731 type: "ADD_BOOTSTRAPPED_BLOCK_TYPE",
6732 name,
6733 blockType
6734 };
6735 }
6736 function addUnprocessedBlockType(name, blockType) {
6737 return ({ dispatch: dispatch3 }) => {
6738 dispatch3({ type: "ADD_UNPROCESSED_BLOCK_TYPE", name, blockType });
6739 const processedBlockType = dispatch3(
6740 processBlockType(name, blockType)
6741 );
6742 if (!processedBlockType) {
6743 return;
6744 }
6745 dispatch3.addBlockTypes(processedBlockType);
6746 };
6747 }
6748 function addBlockBindingsSource(source) {
6749 return {
6750 type: "ADD_BLOCK_BINDINGS_SOURCE",
6751 name: source.name,
6752 label: source.label,
6753 usesContext: source.usesContext,
6754 getValues: source.getValues,
6755 setValues: source.setValues,
6756 canUserEditValue: source.canUserEditValue,
6757 getFieldsList: source.getFieldsList
6758 };
6759 }
6760 function removeBlockBindingsSource(name) {
6761 return {
6762 type: "REMOVE_BLOCK_BINDINGS_SOURCE",
6763 name
6764 };
6765 }
6766
6767 // packages/blocks/build-module/store/constants.mjs
6768 var STORE_NAME = "core/blocks";
6769
6770 // packages/blocks/build-module/store/index.mjs
6771 var store = (0, import_data5.createReduxStore)(STORE_NAME, {
6772 reducer: reducer_default,
6773 selectors: selectors_exports,
6774 actions: actions_exports
6775 });
6776 (0, import_data5.register)(store);
6777 unlock(store).registerPrivateSelectors(private_selectors_exports);
6778 unlock(store).registerPrivateActions(private_actions_exports);
6779
6780 // node_modules/uuid/dist/stringify.js
6781 var byteToHex = [];
6782 for (let i2 = 0; i2 < 256; ++i2) {
6783 byteToHex.push((i2 + 256).toString(16).slice(1));
6784 }
6785 function unsafeStringify(arr, offset = 0) {
6786 return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
6787 }
6788
6789 // node_modules/uuid/dist/rng.js
6790 var rnds8 = new Uint8Array(16);
6791 function rng() {
6792 return crypto.getRandomValues(rnds8);
6793 }
6794
6795 // node_modules/uuid/dist/v4.js
6796 function v4(options, buf, offset) {
6797 if (!buf && !options && crypto.randomUUID) {
6798 return crypto.randomUUID();
6799 }
6800 return _v4(options, buf, offset);
6801 }
6802 function _v4(options, buf, offset) {
6803 options = options || {};
6804 const rnds = options.random ?? options.rng?.() ?? rng();
6805 if (rnds.length < 16) {
6806 throw new Error("Random bytes length must be >= 16");
6807 }
6808 rnds[6] = rnds[6] & 15 | 64;
6809 rnds[8] = rnds[8] & 63 | 128;
6810 if (buf) {
6811 offset = offset || 0;
6812 if (offset < 0 || offset + 16 > buf.length) {
6813 throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
6814 }
6815 for (let i2 = 0; i2 < 16; ++i2) {
6816 buf[offset + i2] = rnds[i2];
6817 }
6818 return buf;
6819 }
6820 return unsafeStringify(rnds);
6821 }
6822 var v4_default = v4;
6823
6824 // packages/blocks/build-module/api/factory.mjs
6825 var import_hooks2 = __toESM(require_hooks(), 1);
6826 function createBlock(name, attributes = {}, innerBlocks = []) {
6827 if (!isBlockRegistered(name)) {
6828 return createBlock("core/missing", {
6829 originalName: name,
6830 originalContent: "",
6831 originalUndelimitedContent: ""
6832 });
6833 }
6834 const sanitizedAttributes = __experimentalSanitizeBlockAttributes(
6835 name,
6836 attributes
6837 );
6838 const clientId = v4_default();
6839 return {
6840 clientId,
6841 name,
6842 isValid: true,
6843 attributes: sanitizedAttributes,
6844 innerBlocks
6845 };
6846 }
6847 function createBlocksFromInnerBlocksTemplate(innerBlocksOrTemplate = []) {
6848 return innerBlocksOrTemplate.map((innerBlock) => {
6849 const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [
6850 innerBlock.name,
6851 innerBlock.attributes,
6852 innerBlock.innerBlocks
6853 ];
6854 const [name, attributes, innerBlocks = []] = innerBlockTemplate;
6855 return createBlock(
6856 name,
6857 attributes,
6858 createBlocksFromInnerBlocksTemplate(
6859 innerBlocks
6860 )
6861 );
6862 });
6863 }
6864 function __experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks) {
6865 const { name } = block;
6866 if (!isBlockRegistered(name)) {
6867 return createBlock("core/missing", {
6868 originalName: name,
6869 originalContent: "",
6870 originalUndelimitedContent: ""
6871 });
6872 }
6873 const clientId = v4_default();
6874 const sanitizedAttributes = __experimentalSanitizeBlockAttributes(name, {
6875 ...block.attributes,
6876 ...mergeAttributes
6877 });
6878 return {
6879 ...block,
6880 clientId,
6881 attributes: sanitizedAttributes,
6882 innerBlocks: newInnerBlocks || block.innerBlocks.map(
6883 (innerBlock) => __experimentalCloneSanitizedBlock(innerBlock)
6884 )
6885 };
6886 }
6887 function cloneBlock(block, mergeAttributes = {}, newInnerBlocks) {
6888 const clientId = v4_default();
6889 return {
6890 ...block,
6891 clientId,
6892 attributes: {
6893 ...block.attributes,
6894 ...mergeAttributes
6895 },
6896 innerBlocks: newInnerBlocks || block.innerBlocks.map((innerBlock) => cloneBlock(innerBlock))
6897 };
6898 }
6899 var isPossibleTransformForSource = (transform, direction, blocks) => {
6900 if (!blocks.length) {
6901 return false;
6902 }
6903 const isMultiBlock = blocks.length > 1;
6904 const firstBlockName = blocks[0].name;
6905 const isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock;
6906 if (!isValidForMultiBlocks) {
6907 return false;
6908 }
6909 if (!isWildcardBlockTransform(transform) && !blocks.every((block) => block.name === firstBlockName)) {
6910 return false;
6911 }
6912 const isBlockType = transform.type === "block";
6913 if (!isBlockType) {
6914 return false;
6915 }
6916 const sourceBlock = blocks[0];
6917 const hasMatchingName = direction !== "from" || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
6918 if (!hasMatchingName) {
6919 return false;
6920 }
6921 if (!isMultiBlock && direction === "from" && isContainerGroupBlock(sourceBlock.name) && isContainerGroupBlock(transform.blockName)) {
6922 return false;
6923 }
6924 if (!maybeCheckTransformIsMatch(transform, blocks)) {
6925 return false;
6926 }
6927 return true;
6928 };
6929 var getBlockTypesForPossibleFromTransforms = (blocks) => {
6930 if (!blocks.length) {
6931 return [];
6932 }
6933 const allBlockTypes = getBlockTypes();
6934 const blockTypesWithPossibleFromTransforms = allBlockTypes.filter(
6935 (blockType) => {
6936 const fromTransforms = getBlockTransforms("from", blockType.name);
6937 return !!findTransform(fromTransforms, (transform) => {
6938 return isPossibleTransformForSource(
6939 transform,
6940 "from",
6941 blocks
6942 );
6943 });
6944 }
6945 );
6946 return blockTypesWithPossibleFromTransforms;
6947 };
6948 var getBlockTypesForPossibleToTransforms = (blocks) => {
6949 if (!blocks.length) {
6950 return [];
6951 }
6952 const sourceBlock = blocks[0];
6953 const blockType = getBlockType(sourceBlock.name);
6954 const transformsTo = blockType ? getBlockTransforms("to", blockType.name) : [];
6955 const possibleTransforms = transformsTo.filter((transform) => {
6956 return transform && isPossibleTransformForSource(transform, "to", blocks);
6957 });
6958 const blockNames = possibleTransforms.map((transformation) => transformation.blocks).flat();
6959 return blockNames.filter((name) => !!name).map(getBlockType).filter((bt) => !!bt);
6960 };
6961 var isWildcardBlockTransform = (t3) => !!t3 && t3.type === "block" && Array.isArray(t3.blocks) && t3.blocks.includes("*");
6962 var isContainerGroupBlock = (name) => name === getGroupingBlockName();
6963 function getPossibleBlockTransformations(blocks) {
6964 if (!blocks.length) {
6965 return [];
6966 }
6967 const blockTypesForFromTransforms = getBlockTypesForPossibleFromTransforms(blocks);
6968 const blockTypesForToTransforms = getBlockTypesForPossibleToTransforms(blocks);
6969 return [
6970 .../* @__PURE__ */ new Set([
6971 ...blockTypesForFromTransforms,
6972 ...blockTypesForToTransforms
6973 ])
6974 ];
6975 }
6976 function findTransform(transforms, predicate) {
6977 const hooks = (0, import_hooks2.createHooks)();
6978 for (let i2 = 0; i2 < transforms.length; i2++) {
6979 const candidate = transforms[i2];
6980 if (predicate(candidate)) {
6981 hooks.addFilter(
6982 "transform",
6983 "transform/" + i2.toString(),
6984 (result) => result ? result : candidate,
6985 candidate.priority
6986 );
6987 }
6988 }
6989 return hooks.applyFilters("transform", null);
6990 }
6991 function getBlockTransforms(direction, blockTypeOrName) {
6992 if (blockTypeOrName === void 0) {
6993 return getBlockTypes().map(({ name }) => getBlockTransforms(direction, name)).flat();
6994 }
6995 const blockType = normalizeBlockType(blockTypeOrName);
6996 const { name: blockName, transforms } = blockType || {};
6997 const directionTransforms = transforms?.[direction];
6998 if (!transforms || !Array.isArray(directionTransforms)) {
6999 return [];
7000 }
7001 const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms);
7002 const filteredTransforms = usingMobileTransformations ? directionTransforms.filter((t3) => {
7003 if (t3.type === "raw") {
7004 return true;
7005 }
7006 if (t3.type === "prefix") {
7007 return true;
7008 }
7009 if (!t3.blocks || !t3.blocks.length) {
7010 return false;
7011 }
7012 if (isWildcardBlockTransform(t3)) {
7013 return true;
7014 }
7015 return t3.blocks.every(
7016 (transformBlockName) => transforms.supportedMobileTransforms.includes(
7017 transformBlockName
7018 )
7019 );
7020 }) : directionTransforms;
7021 return filteredTransforms.map((transform) => ({
7022 ...transform,
7023 blockName,
7024 usingMobileTransformations
7025 }));
7026 }
7027 function maybeCheckTransformIsMatch(transform, blocks) {
7028 if (typeof transform.isMatch !== "function") {
7029 return true;
7030 }
7031 const sourceBlock = blocks[0];
7032 const attributes = transform.isMultiBlock ? blocks.map((block2) => block2.attributes) : sourceBlock.attributes;
7033 const block = transform.isMultiBlock ? blocks : sourceBlock;
7034 return transform.isMatch(attributes, block);
7035 }
7036 function switchToBlockType(blocks, name) {
7037 const blocksArray = Array.isArray(blocks) ? blocks : [blocks];
7038 const isMultiBlock = blocksArray.length > 1;
7039 const firstBlock = blocksArray[0];
7040 const sourceName = firstBlock.name;
7041 const transformationsFrom = getBlockTransforms("from", name);
7042 const transformationsTo = getBlockTransforms("to", sourceName);
7043 const transformation = findTransform(
7044 transformationsTo,
7045 (t3) => t3.type === "block" && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(name) !== -1) && (!isMultiBlock || !!t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray)
7046 ) || findTransform(
7047 transformationsFrom,
7048 (t3) => t3.type === "block" && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || !!t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray)
7049 );
7050 if (!transformation) {
7051 return null;
7052 }
7053 let transformationResults;
7054 if (transformation.isMultiBlock) {
7055 if ("__experimentalConvert" in transformation) {
7056 transformationResults = transformation.__experimentalConvert(blocksArray);
7057 } else {
7058 transformationResults = transformation.transform(
7059 blocksArray.map((currentBlock) => currentBlock.attributes),
7060 blocksArray.map((currentBlock) => currentBlock.innerBlocks)
7061 );
7062 }
7063 } else if ("__experimentalConvert" in transformation) {
7064 transformationResults = transformation.__experimentalConvert(firstBlock);
7065 } else {
7066 transformationResults = transformation.transform(
7067 firstBlock.attributes,
7068 firstBlock.innerBlocks
7069 );
7070 }
7071 if (transformationResults === null || typeof transformationResults !== "object") {
7072 return null;
7073 }
7074 transformationResults = Array.isArray(transformationResults) ? transformationResults : [transformationResults];
7075 if (transformationResults.some(
7076 (result) => !getBlockType(result.name)
7077 )) {
7078 return null;
7079 }
7080 const hasSwitchedBlock = transformationResults.some(
7081 (result) => result.name === name
7082 );
7083 if (!hasSwitchedBlock) {
7084 return null;
7085 }
7086 const ret = transformationResults.map((result, index, results) => {
7087 return (0, import_hooks2.applyFilters)(
7088 "blocks.switchToBlockType.transformedBlock",
7089 result,
7090 blocks,
7091 index,
7092 results
7093 );
7094 });
7095 return ret;
7096 }
7097 var getBlockFromExample = (name, example) => createBlock(
7098 name,
7099 example.attributes,
7100 (example.innerBlocks ?? []).map(
7101 (innerBlock) => getBlockFromExample(innerBlock.name, innerBlock)
7102 )
7103 );
7104
7105 // packages/blocks/build-module/api/parser/index.mjs
7106 var import_block_serialization_default_parser = __toESM(require_block_serialization_default_parser(), 1);
7107 var import_autop2 = __toESM(require_autop(), 1);
7108
7109 // packages/blocks/build-module/api/serializer.mjs
7110 var import_element2 = __toESM(require_element(), 1);
7111 var import_hooks3 = __toESM(require_hooks(), 1);
7112 var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1);
7113 var import_autop = __toESM(require_autop(), 1);
7114 var import_deprecated6 = __toESM(require_deprecated(), 1);
7115
7116 // packages/blocks/build-module/api/parser/serialize-raw-block.mjs
7117 function serializeRawBlock(rawBlock, options = {}) {
7118 const { isCommentDelimited = true } = options;
7119 const {
7120 blockName,
7121 attrs = {},
7122 innerBlocks = [],
7123 innerContent = []
7124 } = rawBlock;
7125 let childIndex = 0;
7126 const content = innerContent.map(
7127 (item) => (
7128 // `null` denotes a nested block, otherwise we have an HTML fragment.
7129 item !== null ? item : serializeRawBlock(innerBlocks[childIndex++], options)
7130 )
7131 ).join("\n").replace(/\n+/g, "\n").trim();
7132 return isCommentDelimited ? getCommentDelimitedContent(blockName ?? void 0, attrs, content) : content;
7133 }
7134
7135 // packages/blocks/build-module/api/serializer.mjs
7136 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
7137 function getBlockDefaultClassName(blockName) {
7138 const className = "wp-block-" + blockName.replace(/\//, "-").replace(/^core-/, "");
7139 return (0, import_hooks3.applyFilters)(
7140 "blocks.getBlockDefaultClassName",
7141 className,
7142 blockName
7143 );
7144 }
7145 function getBlockMenuDefaultClassName(blockName) {
7146 const className = "editor-block-list-item-" + blockName.replace(/\//, "-").replace(/^core-/, "");
7147 return (0, import_hooks3.applyFilters)(
7148 "blocks.getBlockMenuDefaultClassName",
7149 className,
7150 blockName
7151 );
7152 }
7153 var blockPropsProvider = {};
7154 var innerBlocksPropsProvider = {};
7155 function getBlockProps(props = {}) {
7156 const { blockType, attributes } = blockPropsProvider;
7157 return getBlockProps.skipFilters ? props : (0, import_hooks3.applyFilters)(
7158 "blocks.getSaveContent.extraProps",
7159 { ...props },
7160 blockType,
7161 attributes
7162 );
7163 }
7164 function getInnerBlocksProps(props = {}) {
7165 const { innerBlocks } = innerBlocksPropsProvider;
7166 if (!Array.isArray(innerBlocks)) {
7167 return { ...props, children: innerBlocks };
7168 }
7169 const html2 = serialize(innerBlocks, { isInnerBlocks: true });
7170 const children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_element2.RawHTML, { children: html2 });
7171 return { ...props, children };
7172 }
7173 function getSaveElement(blockTypeOrName, attributes, innerBlocks = []) {
7174 const blockType = normalizeBlockType(blockTypeOrName);
7175 if (!blockType?.save) {
7176 return null;
7177 }
7178 let save = blockType.save;
7179 if (save.prototype instanceof import_element2.Component) {
7180 const SaveClass = save;
7181 const instance = new SaveClass({ attributes });
7182 save = instance.render.bind(instance);
7183 }
7184 blockPropsProvider.blockType = blockType;
7185 blockPropsProvider.attributes = attributes;
7186 innerBlocksPropsProvider.innerBlocks = innerBlocks;
7187 let element = save({
7188 attributes,
7189 innerBlocks
7190 });
7191 if (element !== null && typeof element === "object" && (0, import_hooks3.hasFilter)("blocks.getSaveContent.extraProps") && !((blockType.apiVersion ?? 0) > 1)) {
7192 const props = (0, import_hooks3.applyFilters)(
7193 "blocks.getSaveContent.extraProps",
7194 { ...element.props },
7195 blockType,
7196 attributes
7197 );
7198 if (!(0, import_is_shallow_equal.isShallowEqual)(props, element.props)) {
7199 element = (0, import_element2.cloneElement)(
7200 element,
7201 props
7202 );
7203 }
7204 }
7205 return (0, import_hooks3.applyFilters)(
7206 "blocks.getSaveElement",
7207 element,
7208 blockType,
7209 attributes
7210 );
7211 }
7212 function getSaveContent(blockTypeOrName, attributes, innerBlocks) {
7213 const blockType = normalizeBlockType(
7214 blockTypeOrName
7215 );
7216 if (!blockType) {
7217 return "";
7218 }
7219 return (0, import_element2.renderToString)(
7220 getSaveElement(blockType, attributes, innerBlocks)
7221 );
7222 }
7223 function getCommentAttributes(blockType, attributes) {
7224 return Object.entries(blockType.attributes ?? {}).reduce(
7225 (accumulator, [key, attributeSchema]) => {
7226 const value = attributes[key];
7227 if (void 0 === value) {
7228 return accumulator;
7229 }
7230 if (attributeSchema.source !== void 0) {
7231 return accumulator;
7232 }
7233 if (attributeSchema.role === "local") {
7234 return accumulator;
7235 }
7236 if (attributeSchema.__experimentalRole === "local") {
7237 (0, import_deprecated6.default)("__experimentalRole attribute", {
7238 since: "6.7",
7239 version: "6.8",
7240 alternative: "role attribute",
7241 hint: `Check the block.json of the ${blockType?.name} block.`
7242 });
7243 return accumulator;
7244 }
7245 if ("default" in attributeSchema && JSON.stringify(attributeSchema.default) === JSON.stringify(value)) {
7246 return accumulator;
7247 }
7248 accumulator[key] = value;
7249 return accumulator;
7250 },
7251 {}
7252 );
7253 }
7254 function serializeAttributes(attributes) {
7255 return JSON.stringify(attributes).replaceAll("\\\\", "\\u005c").replaceAll("--", "\\u002d\\u002d").replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026").replaceAll('\\"', "\\u0022");
7256 }
7257 function getBlockInnerHTML(block) {
7258 let saveContent = block.originalContent ?? "";
7259 if (block.isValid || block.innerBlocks.length) {
7260 try {
7261 saveContent = getSaveContent(
7262 block.name,
7263 block.attributes,
7264 block.innerBlocks
7265 );
7266 } catch {
7267 }
7268 }
7269 return saveContent;
7270 }
7271 function getCommentDelimitedContent(rawBlockName, attributes, content) {
7272 const serializedAttributes = attributes && Object.entries(attributes).length ? serializeAttributes(attributes) + " " : "";
7273 const blockName = rawBlockName?.startsWith("core/") ? rawBlockName.slice(5) : rawBlockName;
7274 if (!content) {
7275 return `<!-- wp:${blockName} ${serializedAttributes}/-->`;
7276 }
7277 return `<!-- wp:${blockName} ${serializedAttributes}-->
7278 ` + content + `
7279 <!-- /wp:${blockName} -->`;
7280 }
7281 function serializeBlock(block, { isInnerBlocks = false } = {}) {
7282 if (!block.isValid && block.__unstableBlockSource) {
7283 return serializeRawBlock(block.__unstableBlockSource);
7284 }
7285 const blockName = block.name;
7286 const saveContent = getBlockInnerHTML(block);
7287 if (blockName === getUnregisteredTypeHandlerName() || !isInnerBlocks && blockName === getFreeformContentHandlerName()) {
7288 return saveContent;
7289 }
7290 const blockType = getBlockType(blockName);
7291 if (!blockType) {
7292 return saveContent;
7293 }
7294 const saveAttributes = getCommentAttributes(blockType, block.attributes);
7295 return getCommentDelimitedContent(blockName, saveAttributes, saveContent);
7296 }
7297 var __unstableSerializeAndClean = /* @__PURE__ */ (() => {
7298 const cache = /* @__PURE__ */ new WeakMap();
7299 return (blocks) => {
7300 const cached = cache.get(blocks);
7301 if (cached !== void 0) {
7302 return cached;
7303 }
7304 let effectiveBlocks = blocks;
7305 if (effectiveBlocks.length === 1 && isUnmodifiedDefaultBlock(effectiveBlocks[0])) {
7306 effectiveBlocks = [];
7307 }
7308 let content = serialize(effectiveBlocks);
7309 if (effectiveBlocks.length === 1 && effectiveBlocks[0].name === getFreeformContentHandlerName() && effectiveBlocks[0].name === "core/freeform") {
7310 content = (0, import_autop.removep)(content);
7311 }
7312 cache.set(blocks, content);
7313 return content;
7314 };
7315 })();
7316 function serialize(blocks, options) {
7317 const blocksArray = Array.isArray(blocks) ? blocks : [blocks];
7318 return blocksArray.map((block) => serializeBlock(block, options)).join("\n\n");
7319 }
7320
7321 // node_modules/simple-html-tokenizer/dist/es6/index.js
7322 var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/;
7323 var CHARCODE = /^#([0-9]+)$/;
7324 var NAMED = /^([A-Za-z0-9]+)$/;
7325 var EntityParser = (
7326 /** @class */
7327 (function() {
7328 function EntityParser2(named) {
7329 this.named = named;
7330 }
7331 EntityParser2.prototype.parse = function(entity) {
7332 if (!entity) {
7333 return;
7334 }
7335 var matches = entity.match(HEXCHARCODE);
7336 if (matches) {
7337 return String.fromCharCode(parseInt(matches[1], 16));
7338 }
7339 matches = entity.match(CHARCODE);
7340 if (matches) {
7341 return String.fromCharCode(parseInt(matches[1], 10));
7342 }
7343 matches = entity.match(NAMED);
7344 if (matches) {
7345 return this.named[matches[1]];
7346 }
7347 };
7348 return EntityParser2;
7349 })()
7350 );
7351 var WSP = /[\t\n\f ]/;
7352 var ALPHA = /[A-Za-z]/;
7353 var CRLF = /\r\n?/g;
7354 function isSpace(char) {
7355 return WSP.test(char);
7356 }
7357 function isAlpha(char) {
7358 return ALPHA.test(char);
7359 }
7360 function preprocessInput(input) {
7361 return input.replace(CRLF, "\n");
7362 }
7363 var EventedTokenizer = (
7364 /** @class */
7365 (function() {
7366 function EventedTokenizer2(delegate, entityParser) {
7367 this.delegate = delegate;
7368 this.entityParser = entityParser;
7369 this.state = "beforeData";
7370 this.line = -1;
7371 this.column = -1;
7372 this.input = "";
7373 this.index = -1;
7374 this.tagNameBuffer = "";
7375 this.states = {
7376 beforeData: function() {
7377 var char = this.peek();
7378 if (char === "<") {
7379 this.transitionTo(
7380 "tagOpen"
7381 /* tagOpen */
7382 );
7383 this.markTagStart();
7384 this.consume();
7385 } else {
7386 if (char === "\n") {
7387 var tag = this.tagNameBuffer.toLowerCase();
7388 if (tag === "pre" || tag === "textarea") {
7389 this.consume();
7390 }
7391 }
7392 this.transitionTo(
7393 "data"
7394 /* data */
7395 );
7396 this.delegate.beginData();
7397 }
7398 },
7399 data: function() {
7400 var char = this.peek();
7401 if (char === "<") {
7402 this.delegate.finishData();
7403 this.transitionTo(
7404 "tagOpen"
7405 /* tagOpen */
7406 );
7407 this.markTagStart();
7408 this.consume();
7409 } else if (char === "&") {
7410 this.consume();
7411 this.delegate.appendToData(this.consumeCharRef() || "&");
7412 } else {
7413 this.consume();
7414 this.delegate.appendToData(char);
7415 }
7416 },
7417 tagOpen: function() {
7418 var char = this.consume();
7419 if (char === "!") {
7420 this.transitionTo(
7421 "markupDeclarationOpen"
7422 /* markupDeclarationOpen */
7423 );
7424 } else if (char === "/") {
7425 this.transitionTo(
7426 "endTagOpen"
7427 /* endTagOpen */
7428 );
7429 } else if (char === "@" || char === ":" || isAlpha(char)) {
7430 this.transitionTo(
7431 "tagName"
7432 /* tagName */
7433 );
7434 this.tagNameBuffer = "";
7435 this.delegate.beginStartTag();
7436 this.appendToTagName(char);
7437 }
7438 },
7439 markupDeclarationOpen: function() {
7440 var char = this.consume();
7441 if (char === "-" && this.input.charAt(this.index) === "-") {
7442 this.consume();
7443 this.transitionTo(
7444 "commentStart"
7445 /* commentStart */
7446 );
7447 this.delegate.beginComment();
7448 }
7449 },
7450 commentStart: function() {
7451 var char = this.consume();
7452 if (char === "-") {
7453 this.transitionTo(
7454 "commentStartDash"
7455 /* commentStartDash */
7456 );
7457 } else if (char === ">") {
7458 this.delegate.finishComment();
7459 this.transitionTo(
7460 "beforeData"
7461 /* beforeData */
7462 );
7463 } else {
7464 this.delegate.appendToCommentData(char);
7465 this.transitionTo(
7466 "comment"
7467 /* comment */
7468 );
7469 }
7470 },
7471 commentStartDash: function() {
7472 var char = this.consume();
7473 if (char === "-") {
7474 this.transitionTo(
7475 "commentEnd"
7476 /* commentEnd */
7477 );
7478 } else if (char === ">") {
7479 this.delegate.finishComment();
7480 this.transitionTo(
7481 "beforeData"
7482 /* beforeData */
7483 );
7484 } else {
7485 this.delegate.appendToCommentData("-");
7486 this.transitionTo(
7487 "comment"
7488 /* comment */
7489 );
7490 }
7491 },
7492 comment: function() {
7493 var char = this.consume();
7494 if (char === "-") {
7495 this.transitionTo(
7496 "commentEndDash"
7497 /* commentEndDash */
7498 );
7499 } else {
7500 this.delegate.appendToCommentData(char);
7501 }
7502 },
7503 commentEndDash: function() {
7504 var char = this.consume();
7505 if (char === "-") {
7506 this.transitionTo(
7507 "commentEnd"
7508 /* commentEnd */
7509 );
7510 } else {
7511 this.delegate.appendToCommentData("-" + char);
7512 this.transitionTo(
7513 "comment"
7514 /* comment */
7515 );
7516 }
7517 },
7518 commentEnd: function() {
7519 var char = this.consume();
7520 if (char === ">") {
7521 this.delegate.finishComment();
7522 this.transitionTo(
7523 "beforeData"
7524 /* beforeData */
7525 );
7526 } else {
7527 this.delegate.appendToCommentData("--" + char);
7528 this.transitionTo(
7529 "comment"
7530 /* comment */
7531 );
7532 }
7533 },
7534 tagName: function() {
7535 var char = this.consume();
7536 if (isSpace(char)) {
7537 this.transitionTo(
7538 "beforeAttributeName"
7539 /* beforeAttributeName */
7540 );
7541 } else if (char === "/") {
7542 this.transitionTo(
7543 "selfClosingStartTag"
7544 /* selfClosingStartTag */
7545 );
7546 } else if (char === ">") {
7547 this.delegate.finishTag();
7548 this.transitionTo(
7549 "beforeData"
7550 /* beforeData */
7551 );
7552 } else {
7553 this.appendToTagName(char);
7554 }
7555 },
7556 beforeAttributeName: function() {
7557 var char = this.peek();
7558 if (isSpace(char)) {
7559 this.consume();
7560 return;
7561 } else if (char === "/") {
7562 this.transitionTo(
7563 "selfClosingStartTag"
7564 /* selfClosingStartTag */
7565 );
7566 this.consume();
7567 } else if (char === ">") {
7568 this.consume();
7569 this.delegate.finishTag();
7570 this.transitionTo(
7571 "beforeData"
7572 /* beforeData */
7573 );
7574 } else if (char === "=") {
7575 this.delegate.reportSyntaxError("attribute name cannot start with equals sign");
7576 this.transitionTo(
7577 "attributeName"
7578 /* attributeName */
7579 );
7580 this.delegate.beginAttribute();
7581 this.consume();
7582 this.delegate.appendToAttributeName(char);
7583 } else {
7584 this.transitionTo(
7585 "attributeName"
7586 /* attributeName */
7587 );
7588 this.delegate.beginAttribute();
7589 }
7590 },
7591 attributeName: function() {
7592 var char = this.peek();
7593 if (isSpace(char)) {
7594 this.transitionTo(
7595 "afterAttributeName"
7596 /* afterAttributeName */
7597 );
7598 this.consume();
7599 } else if (char === "/") {
7600 this.delegate.beginAttributeValue(false);
7601 this.delegate.finishAttributeValue();
7602 this.consume();
7603 this.transitionTo(
7604 "selfClosingStartTag"
7605 /* selfClosingStartTag */
7606 );
7607 } else if (char === "=") {
7608 this.transitionTo(
7609 "beforeAttributeValue"
7610 /* beforeAttributeValue */
7611 );
7612 this.consume();
7613 } else if (char === ">") {
7614 this.delegate.beginAttributeValue(false);
7615 this.delegate.finishAttributeValue();
7616 this.consume();
7617 this.delegate.finishTag();
7618 this.transitionTo(
7619 "beforeData"
7620 /* beforeData */
7621 );
7622 } else if (char === '"' || char === "'" || char === "<") {
7623 this.delegate.reportSyntaxError(char + " is not a valid character within attribute names");
7624 this.consume();
7625 this.delegate.appendToAttributeName(char);
7626 } else {
7627 this.consume();
7628 this.delegate.appendToAttributeName(char);
7629 }
7630 },
7631 afterAttributeName: function() {
7632 var char = this.peek();
7633 if (isSpace(char)) {
7634 this.consume();
7635 return;
7636 } else if (char === "/") {
7637 this.delegate.beginAttributeValue(false);
7638 this.delegate.finishAttributeValue();
7639 this.consume();
7640 this.transitionTo(
7641 "selfClosingStartTag"
7642 /* selfClosingStartTag */
7643 );
7644 } else if (char === "=") {
7645 this.consume();
7646 this.transitionTo(
7647 "beforeAttributeValue"
7648 /* beforeAttributeValue */
7649 );
7650 } else if (char === ">") {
7651 this.delegate.beginAttributeValue(false);
7652 this.delegate.finishAttributeValue();
7653 this.consume();
7654 this.delegate.finishTag();
7655 this.transitionTo(
7656 "beforeData"
7657 /* beforeData */
7658 );
7659 } else {
7660 this.delegate.beginAttributeValue(false);
7661 this.delegate.finishAttributeValue();
7662 this.transitionTo(
7663 "attributeName"
7664 /* attributeName */
7665 );
7666 this.delegate.beginAttribute();
7667 this.consume();
7668 this.delegate.appendToAttributeName(char);
7669 }
7670 },
7671 beforeAttributeValue: function() {
7672 var char = this.peek();
7673 if (isSpace(char)) {
7674 this.consume();
7675 } else if (char === '"') {
7676 this.transitionTo(
7677 "attributeValueDoubleQuoted"
7678 /* attributeValueDoubleQuoted */
7679 );
7680 this.delegate.beginAttributeValue(true);
7681 this.consume();
7682 } else if (char === "'") {
7683 this.transitionTo(
7684 "attributeValueSingleQuoted"
7685 /* attributeValueSingleQuoted */
7686 );
7687 this.delegate.beginAttributeValue(true);
7688 this.consume();
7689 } else if (char === ">") {
7690 this.delegate.beginAttributeValue(false);
7691 this.delegate.finishAttributeValue();
7692 this.consume();
7693 this.delegate.finishTag();
7694 this.transitionTo(
7695 "beforeData"
7696 /* beforeData */
7697 );
7698 } else {
7699 this.transitionTo(
7700 "attributeValueUnquoted"
7701 /* attributeValueUnquoted */
7702 );
7703 this.delegate.beginAttributeValue(false);
7704 this.consume();
7705 this.delegate.appendToAttributeValue(char);
7706 }
7707 },
7708 attributeValueDoubleQuoted: function() {
7709 var char = this.consume();
7710 if (char === '"') {
7711 this.delegate.finishAttributeValue();
7712 this.transitionTo(
7713 "afterAttributeValueQuoted"
7714 /* afterAttributeValueQuoted */
7715 );
7716 } else if (char === "&") {
7717 this.delegate.appendToAttributeValue(this.consumeCharRef() || "&");
7718 } else {
7719 this.delegate.appendToAttributeValue(char);
7720 }
7721 },
7722 attributeValueSingleQuoted: function() {
7723 var char = this.consume();
7724 if (char === "'") {
7725 this.delegate.finishAttributeValue();
7726 this.transitionTo(
7727 "afterAttributeValueQuoted"
7728 /* afterAttributeValueQuoted */
7729 );
7730 } else if (char === "&") {
7731 this.delegate.appendToAttributeValue(this.consumeCharRef() || "&");
7732 } else {
7733 this.delegate.appendToAttributeValue(char);
7734 }
7735 },
7736 attributeValueUnquoted: function() {
7737 var char = this.peek();
7738 if (isSpace(char)) {
7739 this.delegate.finishAttributeValue();
7740 this.consume();
7741 this.transitionTo(
7742 "beforeAttributeName"
7743 /* beforeAttributeName */
7744 );
7745 } else if (char === "/") {
7746 this.delegate.finishAttributeValue();
7747 this.consume();
7748 this.transitionTo(
7749 "selfClosingStartTag"
7750 /* selfClosingStartTag */
7751 );
7752 } else if (char === "&") {
7753 this.consume();
7754 this.delegate.appendToAttributeValue(this.consumeCharRef() || "&");
7755 } else if (char === ">") {
7756 this.delegate.finishAttributeValue();
7757 this.consume();
7758 this.delegate.finishTag();
7759 this.transitionTo(
7760 "beforeData"
7761 /* beforeData */
7762 );
7763 } else {
7764 this.consume();
7765 this.delegate.appendToAttributeValue(char);
7766 }
7767 },
7768 afterAttributeValueQuoted: function() {
7769 var char = this.peek();
7770 if (isSpace(char)) {
7771 this.consume();
7772 this.transitionTo(
7773 "beforeAttributeName"
7774 /* beforeAttributeName */
7775 );
7776 } else if (char === "/") {
7777 this.consume();
7778 this.transitionTo(
7779 "selfClosingStartTag"
7780 /* selfClosingStartTag */
7781 );
7782 } else if (char === ">") {
7783 this.consume();
7784 this.delegate.finishTag();
7785 this.transitionTo(
7786 "beforeData"
7787 /* beforeData */
7788 );
7789 } else {
7790 this.transitionTo(
7791 "beforeAttributeName"
7792 /* beforeAttributeName */
7793 );
7794 }
7795 },
7796 selfClosingStartTag: function() {
7797 var char = this.peek();
7798 if (char === ">") {
7799 this.consume();
7800 this.delegate.markTagAsSelfClosing();
7801 this.delegate.finishTag();
7802 this.transitionTo(
7803 "beforeData"
7804 /* beforeData */
7805 );
7806 } else {
7807 this.transitionTo(
7808 "beforeAttributeName"
7809 /* beforeAttributeName */
7810 );
7811 }
7812 },
7813 endTagOpen: function() {
7814 var char = this.consume();
7815 if (char === "@" || char === ":" || isAlpha(char)) {
7816 this.transitionTo(
7817 "tagName"
7818 /* tagName */
7819 );
7820 this.tagNameBuffer = "";
7821 this.delegate.beginEndTag();
7822 this.appendToTagName(char);
7823 }
7824 }
7825 };
7826 this.reset();
7827 }
7828 EventedTokenizer2.prototype.reset = function() {
7829 this.transitionTo(
7830 "beforeData"
7831 /* beforeData */
7832 );
7833 this.input = "";
7834 this.index = 0;
7835 this.line = 1;
7836 this.column = 0;
7837 this.delegate.reset();
7838 };
7839 EventedTokenizer2.prototype.transitionTo = function(state) {
7840 this.state = state;
7841 };
7842 EventedTokenizer2.prototype.tokenize = function(input) {
7843 this.reset();
7844 this.tokenizePart(input);
7845 this.tokenizeEOF();
7846 };
7847 EventedTokenizer2.prototype.tokenizePart = function(input) {
7848 this.input += preprocessInput(input);
7849 while (this.index < this.input.length) {
7850 var handler = this.states[this.state];
7851 if (handler !== void 0) {
7852 handler.call(this);
7853 } else {
7854 throw new Error("unhandled state " + this.state);
7855 }
7856 }
7857 };
7858 EventedTokenizer2.prototype.tokenizeEOF = function() {
7859 this.flushData();
7860 };
7861 EventedTokenizer2.prototype.flushData = function() {
7862 if (this.state === "data") {
7863 this.delegate.finishData();
7864 this.transitionTo(
7865 "beforeData"
7866 /* beforeData */
7867 );
7868 }
7869 };
7870 EventedTokenizer2.prototype.peek = function() {
7871 return this.input.charAt(this.index);
7872 };
7873 EventedTokenizer2.prototype.consume = function() {
7874 var char = this.peek();
7875 this.index++;
7876 if (char === "\n") {
7877 this.line++;
7878 this.column = 0;
7879 } else {
7880 this.column++;
7881 }
7882 return char;
7883 };
7884 EventedTokenizer2.prototype.consumeCharRef = function() {
7885 var endIndex = this.input.indexOf(";", this.index);
7886 if (endIndex === -1) {
7887 return;
7888 }
7889 var entity = this.input.slice(this.index, endIndex);
7890 var chars = this.entityParser.parse(entity);
7891 if (chars) {
7892 var count = entity.length;
7893 while (count) {
7894 this.consume();
7895 count--;
7896 }
7897 this.consume();
7898 return chars;
7899 }
7900 };
7901 EventedTokenizer2.prototype.markTagStart = function() {
7902 this.delegate.tagOpen();
7903 };
7904 EventedTokenizer2.prototype.appendToTagName = function(char) {
7905 this.tagNameBuffer += char;
7906 this.delegate.appendToTagName(char);
7907 };
7908 return EventedTokenizer2;
7909 })()
7910 );
7911 var Tokenizer = (
7912 /** @class */
7913 (function() {
7914 function Tokenizer2(entityParser, options) {
7915 if (options === void 0) {
7916 options = {};
7917 }
7918 this.options = options;
7919 this.token = null;
7920 this.startLine = 1;
7921 this.startColumn = 0;
7922 this.tokens = [];
7923 this.tokenizer = new EventedTokenizer(this, entityParser);
7924 this._currentAttribute = void 0;
7925 }
7926 Tokenizer2.prototype.tokenize = function(input) {
7927 this.tokens = [];
7928 this.tokenizer.tokenize(input);
7929 return this.tokens;
7930 };
7931 Tokenizer2.prototype.tokenizePart = function(input) {
7932 this.tokens = [];
7933 this.tokenizer.tokenizePart(input);
7934 return this.tokens;
7935 };
7936 Tokenizer2.prototype.tokenizeEOF = function() {
7937 this.tokens = [];
7938 this.tokenizer.tokenizeEOF();
7939 return this.tokens[0];
7940 };
7941 Tokenizer2.prototype.reset = function() {
7942 this.token = null;
7943 this.startLine = 1;
7944 this.startColumn = 0;
7945 };
7946 Tokenizer2.prototype.current = function() {
7947 var token = this.token;
7948 if (token === null) {
7949 throw new Error("token was unexpectedly null");
7950 }
7951 if (arguments.length === 0) {
7952 return token;
7953 }
7954 for (var i2 = 0; i2 < arguments.length; i2++) {
7955 if (token.type === arguments[i2]) {
7956 return token;
7957 }
7958 }
7959 throw new Error("token type was unexpectedly " + token.type);
7960 };
7961 Tokenizer2.prototype.push = function(token) {
7962 this.token = token;
7963 this.tokens.push(token);
7964 };
7965 Tokenizer2.prototype.currentAttribute = function() {
7966 return this._currentAttribute;
7967 };
7968 Tokenizer2.prototype.addLocInfo = function() {
7969 if (this.options.loc) {
7970 this.current().loc = {
7971 start: {
7972 line: this.startLine,
7973 column: this.startColumn
7974 },
7975 end: {
7976 line: this.tokenizer.line,
7977 column: this.tokenizer.column
7978 }
7979 };
7980 }
7981 this.startLine = this.tokenizer.line;
7982 this.startColumn = this.tokenizer.column;
7983 };
7984 Tokenizer2.prototype.beginData = function() {
7985 this.push({
7986 type: "Chars",
7987 chars: ""
7988 });
7989 };
7990 Tokenizer2.prototype.appendToData = function(char) {
7991 this.current(
7992 "Chars"
7993 /* Chars */
7994 ).chars += char;
7995 };
7996 Tokenizer2.prototype.finishData = function() {
7997 this.addLocInfo();
7998 };
7999 Tokenizer2.prototype.beginComment = function() {
8000 this.push({
8001 type: "Comment",
8002 chars: ""
8003 });
8004 };
8005 Tokenizer2.prototype.appendToCommentData = function(char) {
8006 this.current(
8007 "Comment"
8008 /* Comment */
8009 ).chars += char;
8010 };
8011 Tokenizer2.prototype.finishComment = function() {
8012 this.addLocInfo();
8013 };
8014 Tokenizer2.prototype.tagOpen = function() {
8015 };
8016 Tokenizer2.prototype.beginStartTag = function() {
8017 this.push({
8018 type: "StartTag",
8019 tagName: "",
8020 attributes: [],
8021 selfClosing: false
8022 });
8023 };
8024 Tokenizer2.prototype.beginEndTag = function() {
8025 this.push({
8026 type: "EndTag",
8027 tagName: ""
8028 });
8029 };
8030 Tokenizer2.prototype.finishTag = function() {
8031 this.addLocInfo();
8032 };
8033 Tokenizer2.prototype.markTagAsSelfClosing = function() {
8034 this.current(
8035 "StartTag"
8036 /* StartTag */
8037 ).selfClosing = true;
8038 };
8039 Tokenizer2.prototype.appendToTagName = function(char) {
8040 this.current(
8041 "StartTag",
8042 "EndTag"
8043 /* EndTag */
8044 ).tagName += char;
8045 };
8046 Tokenizer2.prototype.beginAttribute = function() {
8047 this._currentAttribute = ["", "", false];
8048 };
8049 Tokenizer2.prototype.appendToAttributeName = function(char) {
8050 this.currentAttribute()[0] += char;
8051 };
8052 Tokenizer2.prototype.beginAttributeValue = function(isQuoted) {
8053 this.currentAttribute()[2] = isQuoted;
8054 };
8055 Tokenizer2.prototype.appendToAttributeValue = function(char) {
8056 this.currentAttribute()[1] += char;
8057 };
8058 Tokenizer2.prototype.finishAttributeValue = function() {
8059 this.current(
8060 "StartTag"
8061 /* StartTag */
8062 ).attributes.push(this._currentAttribute);
8063 };
8064 Tokenizer2.prototype.reportSyntaxError = function(message) {
8065 this.current().syntaxError = message;
8066 };
8067 return Tokenizer2;
8068 })()
8069 );
8070
8071 // packages/blocks/build-module/api/validation/index.mjs
8072 var import_es6 = __toESM(require_es6(), 1);
8073 var import_deprecated7 = __toESM(require_deprecated(), 1);
8074 var import_html_entities = __toESM(require_html_entities(), 1);
8075
8076 // packages/blocks/build-module/api/validation/logger.mjs
8077 function createLogger() {
8078 function createLogHandler(logger) {
8079 return (message, ...args) => logger("Block validation: " + message, ...args);
8080 }
8081 return {
8082 // eslint-disable-next-line no-console
8083 error: createLogHandler(console.error),
8084 // eslint-disable-next-line no-console
8085 warning: createLogHandler(console.warn),
8086 getItems() {
8087 return [];
8088 }
8089 };
8090 }
8091 function createQueuedLogger() {
8092 const queue = [];
8093 const logger = createLogger();
8094 return {
8095 error(...args) {
8096 queue.push({ log: logger.error, args });
8097 },
8098 warning(...args) {
8099 queue.push({ log: logger.warning, args });
8100 },
8101 getItems() {
8102 return queue;
8103 }
8104 };
8105 }
8106
8107 // packages/blocks/build-module/api/validation/index.mjs
8108 var identity = (x2) => x2;
8109 var REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g;
8110 var REGEXP_ONLY_WHITESPACE = /^[\t\n\r\v\f ]*$/;
8111 var REGEXP_STYLE_URL_TYPE = /^url\s*\(['"\s]*(.*?)['"\s]*\)$/;
8112 var BOOLEAN_ATTRIBUTES = [
8113 "allowfullscreen",
8114 "allowpaymentrequest",
8115 "allowusermedia",
8116 "async",
8117 "autofocus",
8118 "autoplay",
8119 "checked",
8120 "controls",
8121 "default",
8122 "defer",
8123 "disabled",
8124 "download",
8125 "formnovalidate",
8126 "hidden",
8127 "ismap",
8128 "itemscope",
8129 "loop",
8130 "multiple",
8131 "muted",
8132 "nomodule",
8133 "novalidate",
8134 "open",
8135 "playsinline",
8136 "readonly",
8137 "required",
8138 "reversed",
8139 "selected",
8140 "typemustmatch"
8141 ];
8142 var ENUMERATED_ATTRIBUTES = [
8143 "autocapitalize",
8144 "autocomplete",
8145 "charset",
8146 "contenteditable",
8147 "crossorigin",
8148 "decoding",
8149 "dir",
8150 "draggable",
8151 "enctype",
8152 "formenctype",
8153 "formmethod",
8154 "http-equiv",
8155 "inputmode",
8156 "kind",
8157 "method",
8158 "preload",
8159 "scope",
8160 "shape",
8161 "spellcheck",
8162 "translate",
8163 "type",
8164 "wrap"
8165 ];
8166 var MEANINGFUL_ATTRIBUTES = [
8167 ...BOOLEAN_ATTRIBUTES,
8168 ...ENUMERATED_ATTRIBUTES
8169 ];
8170 var TEXT_NORMALIZATIONS = [
8171 identity,
8172 getTextWithCollapsedWhitespace
8173 ];
8174 var REGEXP_NAMED_CHARACTER_REFERENCE = /^[\da-z]+$/i;
8175 var REGEXP_DECIMAL_CHARACTER_REFERENCE = /^#\d+$/;
8176 var REGEXP_HEXADECIMAL_CHARACTER_REFERENCE = /^#x[\da-f]+$/i;
8177 function isValidCharacterReference(text2) {
8178 return REGEXP_NAMED_CHARACTER_REFERENCE.test(text2) || REGEXP_DECIMAL_CHARACTER_REFERENCE.test(text2) || REGEXP_HEXADECIMAL_CHARACTER_REFERENCE.test(text2);
8179 }
8180 var DecodeEntityParser = class {
8181 /**
8182 * Returns a substitute string for an entity string sequence between `&`
8183 * and `;`, or undefined if no substitution should occur.
8184 *
8185 * @param entity Entity fragment discovered in HTML.
8186 *
8187 * @return Entity substitute value.
8188 */
8189 parse(entity) {
8190 if (isValidCharacterReference(entity)) {
8191 return (0, import_html_entities.decodeEntities)("&" + entity + ";");
8192 }
8193 return void 0;
8194 }
8195 };
8196 function getTextPiecesSplitOnWhitespace(text2) {
8197 return text2.trim().split(REGEXP_WHITESPACE);
8198 }
8199 function getTextWithCollapsedWhitespace(text2) {
8200 return getTextPiecesSplitOnWhitespace(text2).join(" ");
8201 }
8202 function getMeaningfulAttributePairs(token) {
8203 return (token.attributes ?? []).filter((pair) => {
8204 const [key, value] = pair;
8205 return value || key.indexOf("data-") === 0 || MEANINGFUL_ATTRIBUTES.includes(key);
8206 });
8207 }
8208 function isEquivalentTextTokens(actual, expected, logger = createLogger()) {
8209 let actualChars = actual.chars;
8210 let expectedChars = expected.chars;
8211 for (let i2 = 0; i2 < TEXT_NORMALIZATIONS.length; i2++) {
8212 const normalize = TEXT_NORMALIZATIONS[i2];
8213 actualChars = normalize(actualChars);
8214 expectedChars = normalize(expectedChars);
8215 if (actualChars === expectedChars) {
8216 return true;
8217 }
8218 }
8219 logger.warning(
8220 "Expected text `%s`, saw `%s`.",
8221 expected.chars,
8222 actual.chars
8223 );
8224 return false;
8225 }
8226 function getNormalizedLength(value) {
8227 if (0 === parseFloat(value)) {
8228 return "0";
8229 }
8230 if (value.indexOf(".") === 0) {
8231 return "0" + value;
8232 }
8233 return value;
8234 }
8235 function getNormalizedStyleValue(value) {
8236 const textPieces = getTextPiecesSplitOnWhitespace(value);
8237 const normalizedPieces = textPieces.map(getNormalizedLength);
8238 const result = normalizedPieces.join(" ");
8239 return result.replace(REGEXP_STYLE_URL_TYPE, "url($1)");
8240 }
8241 function getStyleProperties(text2) {
8242 const pairs = text2.replace(/;?\s*$/, "").split(";").map((style) => {
8243 const [key, ...valueParts] = style.split(":");
8244 const value = valueParts.join(":");
8245 return [key.trim(), getNormalizedStyleValue(value.trim())];
8246 });
8247 return Object.fromEntries(pairs);
8248 }
8249 var isEqualAttributesOfName = {
8250 class: (actual, expected) => {
8251 const [actualPieces, expectedPieces] = [actual, expected].map(
8252 getTextPiecesSplitOnWhitespace
8253 );
8254 const actualDiff = actualPieces.filter(
8255 (c2) => !expectedPieces.includes(c2)
8256 );
8257 const expectedDiff = expectedPieces.filter(
8258 (c2) => !actualPieces.includes(c2)
8259 );
8260 return actualDiff.length === 0 && expectedDiff.length === 0;
8261 },
8262 style: (actual, expected) => {
8263 return (0, import_es6.default)(
8264 ...[actual, expected].map(getStyleProperties)
8265 );
8266 },
8267 // For each boolean attribute, mere presence of attribute in both is enough
8268 // to assume equivalence.
8269 ...Object.fromEntries(
8270 BOOLEAN_ATTRIBUTES.map((attribute) => [attribute, () => true])
8271 )
8272 };
8273 function isEqualTagAttributePairs(actual, expected, logger = createLogger()) {
8274 if (actual.length !== expected.length) {
8275 logger.warning(
8276 "Expected attributes %o, instead saw %o.",
8277 expected,
8278 actual
8279 );
8280 return false;
8281 }
8282 const expectedAttributes = {};
8283 for (let i2 = 0; i2 < expected.length; i2++) {
8284 expectedAttributes[expected[i2][0].toLowerCase()] = expected[i2][1];
8285 }
8286 for (let i2 = 0; i2 < actual.length; i2++) {
8287 const [name, actualValue] = actual[i2];
8288 const nameLower = name.toLowerCase();
8289 if (!expectedAttributes.hasOwnProperty(nameLower)) {
8290 logger.warning("Encountered unexpected attribute `%s`.", name);
8291 return false;
8292 }
8293 const expectedValue = expectedAttributes[nameLower];
8294 const isEqualAttributes = isEqualAttributesOfName[nameLower];
8295 if (isEqualAttributes) {
8296 if (!isEqualAttributes(actualValue, expectedValue)) {
8297 logger.warning(
8298 "Expected attribute `%s` of value `%s`, saw `%s`.",
8299 name,
8300 expectedValue,
8301 actualValue
8302 );
8303 return false;
8304 }
8305 } else if (actualValue !== expectedValue) {
8306 logger.warning(
8307 "Expected attribute `%s` of value `%s`, saw `%s`.",
8308 name,
8309 expectedValue,
8310 actualValue
8311 );
8312 return false;
8313 }
8314 }
8315 return true;
8316 }
8317 var isEqualTokensOfType = {
8318 StartTag: (actual, expected, logger = createLogger()) => {
8319 if (actual.tagName !== expected.tagName && // Optimization: Use short-circuit evaluation to defer case-
8320 // insensitive check on the assumption that the majority case will
8321 // have exactly equal tag names.
8322 actual.tagName.toLowerCase() !== expected.tagName.toLowerCase()) {
8323 logger.warning(
8324 "Expected tag name `%s`, instead saw `%s`.",
8325 expected.tagName,
8326 actual.tagName
8327 );
8328 return false;
8329 }
8330 return isEqualTagAttributePairs(
8331 ...[actual, expected].map(getMeaningfulAttributePairs),
8332 logger
8333 );
8334 },
8335 Chars: isEquivalentTextTokens,
8336 Comment: isEquivalentTextTokens
8337 };
8338 function getNextNonWhitespaceToken(tokens) {
8339 let token;
8340 while (token = tokens.shift()) {
8341 if (token.type !== "Chars") {
8342 return token;
8343 }
8344 if (!REGEXP_ONLY_WHITESPACE.test(token.chars)) {
8345 return token;
8346 }
8347 }
8348 return void 0;
8349 }
8350 function getHTMLTokens(html2, logger = createLogger()) {
8351 try {
8352 return new Tokenizer(new DecodeEntityParser()).tokenize(
8353 html2
8354 );
8355 } catch {
8356 logger.warning("Malformed HTML detected: %s", html2);
8357 }
8358 return null;
8359 }
8360 function isClosedByToken(currentToken, nextToken) {
8361 if (!currentToken.selfClosing) {
8362 return false;
8363 }
8364 if (nextToken && nextToken.tagName === currentToken.tagName && nextToken.type === "EndTag") {
8365 return true;
8366 }
8367 return false;
8368 }
8369 function isEquivalentHTML(actual, expected, logger = createLogger()) {
8370 if (actual === expected) {
8371 return true;
8372 }
8373 const [actualTokens, expectedTokens] = [actual, expected].map(
8374 (html2) => getHTMLTokens(html2, logger)
8375 );
8376 if (!actualTokens || !expectedTokens) {
8377 return false;
8378 }
8379 let actualToken, expectedToken;
8380 while (actualToken = getNextNonWhitespaceToken(actualTokens)) {
8381 expectedToken = getNextNonWhitespaceToken(expectedTokens);
8382 if (!expectedToken) {
8383 logger.warning(
8384 "Expected end of content, instead saw %o.",
8385 actualToken
8386 );
8387 return false;
8388 }
8389 if (actualToken.type !== expectedToken.type) {
8390 logger.warning(
8391 "Expected token of type `%s` (%o), instead saw `%s` (%o).",
8392 expectedToken.type,
8393 expectedToken,
8394 actualToken.type,
8395 actualToken
8396 );
8397 return false;
8398 }
8399 const isEqualTokens = isEqualTokensOfType[actualToken.type];
8400 if (isEqualTokens && !isEqualTokens(actualToken, expectedToken, logger)) {
8401 return false;
8402 }
8403 if (isClosedByToken(actualToken, expectedTokens[0])) {
8404 getNextNonWhitespaceToken(expectedTokens);
8405 } else if (isClosedByToken(expectedToken, actualTokens[0])) {
8406 getNextNonWhitespaceToken(actualTokens);
8407 }
8408 }
8409 if (expectedToken = getNextNonWhitespaceToken(expectedTokens)) {
8410 logger.warning(
8411 "Expected %o, instead saw end of content.",
8412 expectedToken
8413 );
8414 return false;
8415 }
8416 return true;
8417 }
8418 function validateBlock(block, blockTypeOrName = block.name) {
8419 const isFallbackBlock = block.name === getFreeformContentHandlerName() || block.name === getUnregisteredTypeHandlerName();
8420 if (isFallbackBlock) {
8421 return [true, []];
8422 }
8423 const logger = createQueuedLogger();
8424 const blockType = normalizeBlockType(blockTypeOrName);
8425 let generatedBlockContent;
8426 try {
8427 generatedBlockContent = getSaveContent(blockType, block.attributes);
8428 } catch (error) {
8429 logger.error(
8430 "Block validation failed because an error occurred while generating block content:\n\n%s",
8431 error.toString()
8432 );
8433 return [false, logger.getItems()];
8434 }
8435 const isValid = isEquivalentHTML(
8436 block.originalContent,
8437 generatedBlockContent,
8438 logger
8439 );
8440 if (!isValid) {
8441 logger.error(
8442 "Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",
8443 blockType.name,
8444 blockType,
8445 generatedBlockContent,
8446 block.originalContent
8447 );
8448 }
8449 return [isValid, logger.getItems()];
8450 }
8451 function isValidBlockContent(blockTypeOrName, attributes, originalBlockContent) {
8452 (0, import_deprecated7.default)("isValidBlockContent introduces opportunity for data loss", {
8453 since: "12.6",
8454 plugin: "Gutenberg",
8455 alternative: "validateBlock"
8456 });
8457 const blockType = normalizeBlockType(blockTypeOrName);
8458 const block = {
8459 clientId: "",
8460 name: blockType.name,
8461 isValid: true,
8462 attributes,
8463 innerBlocks: [],
8464 originalContent: originalBlockContent
8465 };
8466 const [isValid] = validateBlock(block, blockType);
8467 return isValid;
8468 }
8469
8470 // packages/blocks/build-module/api/parser/convert-legacy-block.mjs
8471 function convertLegacyBlockNameAndAttributes(name, attributes) {
8472 const newAttributes = { ...attributes };
8473 if ("core/cover-image" === name) {
8474 name = "core/cover";
8475 }
8476 if ("core/text" === name || "core/cover-text" === name) {
8477 name = "core/paragraph";
8478 }
8479 if (name && name.indexOf("core/social-link-") === 0) {
8480 newAttributes.service = name.substring(17);
8481 name = "core/social-link";
8482 }
8483 if (name && name.indexOf("core-embed/") === 0) {
8484 const providerSlug = name.substring(11);
8485 const deprecated12 = {
8486 speaker: "speaker-deck",
8487 polldaddy: "crowdsignal"
8488 };
8489 newAttributes.providerNameSlug = providerSlug in deprecated12 ? deprecated12[providerSlug] : providerSlug;
8490 if (!["amazon-kindle", "wordpress"].includes(providerSlug)) {
8491 newAttributes.responsive = true;
8492 }
8493 name = "core/embed";
8494 }
8495 if (name === "core/post-comment-author") {
8496 name = "core/comment-author-name";
8497 }
8498 if (name === "core/post-comment-content") {
8499 name = "core/comment-content";
8500 }
8501 if (name === "core/post-comment-date") {
8502 name = "core/comment-date";
8503 }
8504 if (name === "core/comments-query-loop") {
8505 name = "core/comments";
8506 const className = newAttributes.className ?? "";
8507 if (!className.includes("wp-block-comments-query-loop")) {
8508 newAttributes.className = [
8509 "wp-block-comments-query-loop",
8510 className
8511 ].join(" ");
8512 }
8513 }
8514 if (name === "core/post-comments") {
8515 name = "core/comments";
8516 newAttributes.legacy = true;
8517 }
8518 const layout = attributes.layout;
8519 if (layout?.type === "grid" && typeof layout?.columnCount === "string") {
8520 newAttributes.layout = {
8521 ...newAttributes.layout,
8522 columnCount: parseInt(layout.columnCount, 10)
8523 };
8524 }
8525 const style = attributes.style;
8526 const styleLayout = style?.layout;
8527 if (typeof styleLayout?.columnSpan === "string") {
8528 const columnSpanNumber = parseInt(styleLayout.columnSpan, 10);
8529 newAttributes.style = {
8530 ...newAttributes.style,
8531 layout: {
8532 ...newAttributes.style?.layout,
8533 columnSpan: isNaN(columnSpanNumber) ? void 0 : columnSpanNumber
8534 }
8535 };
8536 }
8537 if (typeof styleLayout?.rowSpan === "string") {
8538 const rowSpanNumber = parseInt(styleLayout.rowSpan, 10);
8539 newAttributes.style = {
8540 ...newAttributes.style,
8541 layout: {
8542 ...newAttributes.style?.layout,
8543 rowSpan: isNaN(rowSpanNumber) ? void 0 : rowSpanNumber
8544 }
8545 };
8546 }
8547 return [name, newAttributes];
8548 }
8549
8550 // node_modules/hpq/es/get-path.js
8551 function getPath(object, path) {
8552 var segments = path.split(".");
8553 var segment;
8554 while (segment = segments.shift()) {
8555 if (!(segment in object)) {
8556 return;
8557 }
8558 object = object[segment];
8559 }
8560 return object;
8561 }
8562
8563 // node_modules/hpq/es/index.js
8564 var getDocument = /* @__PURE__ */ (function() {
8565 var doc;
8566 return function() {
8567 if (!doc) {
8568 doc = document.implementation.createHTMLDocument("");
8569 }
8570 return doc;
8571 };
8572 })();
8573 function parse(source, matchers) {
8574 if (!matchers) {
8575 return;
8576 }
8577 if ("string" === typeof source) {
8578 var doc = getDocument();
8579 doc.body.innerHTML = source;
8580 source = doc.body;
8581 }
8582 if ("function" === typeof matchers) {
8583 return matchers(source);
8584 }
8585 if (Object !== matchers.constructor) {
8586 return;
8587 }
8588 return Object.keys(matchers).reduce(function(memo, key) {
8589 memo[key] = parse(source, matchers[key]);
8590 return memo;
8591 }, {});
8592 }
8593 function prop(selector, name) {
8594 if (1 === arguments.length) {
8595 name = selector;
8596 selector = void 0;
8597 }
8598 return function(node) {
8599 var match = node;
8600 if (selector) {
8601 match = node.querySelector(selector);
8602 }
8603 if (match) {
8604 return getPath(match, name);
8605 }
8606 };
8607 }
8608 function attr(selector, name) {
8609 if (1 === arguments.length) {
8610 name = selector;
8611 selector = void 0;
8612 }
8613 return function(node) {
8614 var attributes = prop(selector, "attributes")(node);
8615 if (attributes && attributes.hasOwnProperty(name)) {
8616 return attributes[name].value;
8617 }
8618 };
8619 }
8620 function text(selector) {
8621 return prop(selector, "textContent");
8622 }
8623 function query(selector, matchers) {
8624 return function(node) {
8625 var matches = node.querySelectorAll(selector);
8626 return [].map.call(matches, function(match) {
8627 return parse(match, matchers);
8628 });
8629 };
8630 }
8631
8632 // node_modules/memize/dist/index.js
8633 function memize(fn, options) {
8634 var size = 0;
8635 var head;
8636 var tail;
8637 options = options || {};
8638 function memoized() {
8639 var node = head, len = arguments.length, args, i2;
8640 searchCache: while (node) {
8641 if (node.args.length !== arguments.length) {
8642 node = node.next;
8643 continue;
8644 }
8645 for (i2 = 0; i2 < len; i2++) {
8646 if (node.args[i2] !== arguments[i2]) {
8647 node = node.next;
8648 continue searchCache;
8649 }
8650 }
8651 if (node !== head) {
8652 if (node === tail) {
8653 tail = node.prev;
8654 }
8655 node.prev.next = node.next;
8656 if (node.next) {
8657 node.next.prev = node.prev;
8658 }
8659 node.next = head;
8660 node.prev = null;
8661 head.prev = node;
8662 head = node;
8663 }
8664 return node.val;
8665 }
8666 args = new Array(len);
8667 for (i2 = 0; i2 < len; i2++) {
8668 args[i2] = arguments[i2];
8669 }
8670 node = {
8671 args,
8672 // Generate the result from original function
8673 val: fn.apply(null, args)
8674 };
8675 if (head) {
8676 head.prev = node;
8677 node.next = head;
8678 } else {
8679 tail = node;
8680 }
8681 if (size === /** @type {MemizeOptions} */
8682 options.maxSize) {
8683 tail = /** @type {MemizeCacheNode} */
8684 tail.prev;
8685 tail.next = null;
8686 } else {
8687 size++;
8688 }
8689 head = node;
8690 return node.val;
8691 }
8692 memoized.clear = function() {
8693 head = null;
8694 tail = null;
8695 size = 0;
8696 };
8697 return memoized;
8698 }
8699
8700 // packages/blocks/build-module/api/parser/get-block-attributes.mjs
8701 var import_hooks4 = __toESM(require_hooks(), 1);
8702 var import_rich_text4 = __toESM(require_rich_text(), 1);
8703
8704 // packages/blocks/build-module/api/matchers.mjs
8705 var import_rich_text3 = __toESM(require_rich_text(), 1);
8706
8707 // packages/blocks/build-module/api/node.mjs
8708 var import_deprecated9 = __toESM(require_deprecated(), 1);
8709
8710 // packages/blocks/build-module/api/children.mjs
8711 var import_element3 = __toESM(require_element(), 1);
8712 var import_deprecated8 = __toESM(require_deprecated(), 1);
8713 function getSerializeCapableElement(children) {
8714 return children;
8715 }
8716 function getChildrenArray(children) {
8717 (0, import_deprecated8.default)("wp.blocks.children.getChildrenArray", {
8718 since: "6.1",
8719 version: "6.3",
8720 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8721 });
8722 return children;
8723 }
8724 function concat(...blockNodes) {
8725 (0, import_deprecated8.default)("wp.blocks.children.concat", {
8726 since: "6.1",
8727 version: "6.3",
8728 alternative: "wp.richText.concat",
8729 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8730 });
8731 const result = [];
8732 for (let i2 = 0; i2 < blockNodes.length; i2++) {
8733 const blockNode = Array.isArray(blockNodes[i2]) ? blockNodes[i2] : [blockNodes[i2]];
8734 for (let j2 = 0; j2 < blockNode.length; j2++) {
8735 const child = blockNode[j2];
8736 const canConcatToPreviousString = typeof child === "string" && typeof result[result.length - 1] === "string";
8737 if (canConcatToPreviousString) {
8738 result[result.length - 1] += child;
8739 } else {
8740 result.push(child);
8741 }
8742 }
8743 }
8744 return result;
8745 }
8746 function fromDOM22(domNodes) {
8747 (0, import_deprecated8.default)("wp.blocks.children.fromDOM", {
8748 since: "6.1",
8749 version: "6.3",
8750 alternative: "wp.richText.create",
8751 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8752 });
8753 const result = [];
8754 for (let i2 = 0; i2 < domNodes.length; i2++) {
8755 try {
8756 result.push(fromDOM2(domNodes[i2]));
8757 } catch {
8758 }
8759 }
8760 return result;
8761 }
8762 function toHTML(children) {
8763 (0, import_deprecated8.default)("wp.blocks.children.toHTML", {
8764 since: "6.1",
8765 version: "6.3",
8766 alternative: "wp.richText.toHTMLString",
8767 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8768 });
8769 const element = getSerializeCapableElement(children);
8770 return (0, import_element3.renderToString)(element);
8771 }
8772 function matcher(selector) {
8773 (0, import_deprecated8.default)("wp.blocks.children.matcher", {
8774 since: "6.1",
8775 version: "6.3",
8776 alternative: "html source",
8777 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8778 });
8779 return (domNode) => {
8780 let match = domNode;
8781 if (selector) {
8782 match = domNode.querySelector(selector);
8783 }
8784 if (match) {
8785 return fromDOM22(match.childNodes);
8786 }
8787 return [];
8788 };
8789 }
8790 var children_default = {
8791 concat,
8792 getChildrenArray,
8793 fromDOM: fromDOM22,
8794 toHTML,
8795 matcher
8796 };
8797
8798 // packages/blocks/build-module/api/node.mjs
8799 function isNodeOfType(node, type) {
8800 (0, import_deprecated9.default)("wp.blocks.node.isNodeOfType", {
8801 since: "6.1",
8802 version: "6.3",
8803 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8804 });
8805 return typeof node !== "string" && node?.type === type;
8806 }
8807 function getNamedNodeMapAsObject(nodeMap) {
8808 const result = {};
8809 for (let i2 = 0; i2 < nodeMap.length; i2++) {
8810 const { name, value } = nodeMap[i2];
8811 result[name] = value;
8812 }
8813 return result;
8814 }
8815 function fromDOM2(domNode) {
8816 (0, import_deprecated9.default)("wp.blocks.node.fromDOM", {
8817 since: "6.1",
8818 version: "6.3",
8819 alternative: "wp.richText.create",
8820 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8821 });
8822 if (domNode.nodeType === domNode.TEXT_NODE) {
8823 return domNode.nodeValue;
8824 }
8825 if (domNode.nodeType !== domNode.ELEMENT_NODE) {
8826 throw new TypeError(
8827 "A block node can only be created from a node of type text or element."
8828 );
8829 }
8830 return {
8831 type: domNode.nodeName.toLowerCase(),
8832 props: {
8833 ...getNamedNodeMapAsObject(domNode.attributes),
8834 children: fromDOM22(domNode.childNodes)
8835 }
8836 };
8837 }
8838 function toHTML2(node) {
8839 (0, import_deprecated9.default)("wp.blocks.node.toHTML", {
8840 since: "6.1",
8841 version: "6.3",
8842 alternative: "wp.richText.toHTMLString",
8843 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8844 });
8845 return toHTML([node]);
8846 }
8847 function matcher2(selector) {
8848 (0, import_deprecated9.default)("wp.blocks.node.matcher", {
8849 since: "6.1",
8850 version: "6.3",
8851 alternative: "html source",
8852 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8853 });
8854 return (domNode) => {
8855 let match = domNode;
8856 if (selector) {
8857 match = domNode.querySelector(selector);
8858 }
8859 try {
8860 return fromDOM2(match);
8861 } catch {
8862 return null;
8863 }
8864 };
8865 }
8866 var node_default = {
8867 isNodeOfType,
8868 fromDOM: fromDOM2,
8869 toHTML: toHTML2,
8870 matcher: matcher2
8871 };
8872
8873 // packages/blocks/build-module/api/matchers.mjs
8874 function html(selector, multilineTag) {
8875 return (domNode) => {
8876 let match = domNode;
8877 if (selector) {
8878 match = domNode.querySelector(selector);
8879 }
8880 if (!match) {
8881 return "";
8882 }
8883 if (multilineTag) {
8884 let value = "";
8885 const length = match.children.length;
8886 for (let index = 0; index < length; index++) {
8887 const child = match.children[index];
8888 if (child.nodeName.toLowerCase() !== multilineTag) {
8889 continue;
8890 }
8891 value += child.outerHTML;
8892 }
8893 return value;
8894 }
8895 return match.innerHTML;
8896 };
8897 }
8898 var richText = (selector, preserveWhiteSpace) => (el) => {
8899 const target = selector ? el.querySelector(selector) : el;
8900 return target ? import_rich_text3.RichTextData.fromHTMLElement(target, {
8901 preserveWhiteSpace
8902 }) : import_rich_text3.RichTextData.empty();
8903 };
8904
8905 // packages/blocks/build-module/api/parser/get-block-attributes.mjs
8906 var toBooleanAttributeMatcher = (matcher3) => (value) => matcher3(value) !== void 0;
8907 function isOfType(value, type) {
8908 switch (type) {
8909 case "rich-text":
8910 return value instanceof import_rich_text4.RichTextData;
8911 case "string":
8912 return typeof value === "string";
8913 case "boolean":
8914 return typeof value === "boolean";
8915 case "object":
8916 return !!value && value.constructor === Object;
8917 case "null":
8918 return value === null;
8919 case "array":
8920 return Array.isArray(value);
8921 case "integer":
8922 case "number":
8923 return typeof value === "number";
8924 }
8925 return true;
8926 }
8927 function isOfTypes(value, types) {
8928 return types.some((type) => isOfType(value, type));
8929 }
8930 function getBlockAttribute(attributeKey, attributeSchema, innerDOM, commentAttributes, innerHTML) {
8931 let value;
8932 switch (attributeSchema.source) {
8933 // An undefined source means that it's an attribute serialized to the
8934 // block's "comment".
8935 case void 0:
8936 value = commentAttributes ? commentAttributes[attributeKey] : void 0;
8937 break;
8938 // raw source means that it's the original raw block content.
8939 case "raw":
8940 value = innerHTML;
8941 break;
8942 case "attribute":
8943 case "property":
8944 case "html":
8945 case "text":
8946 case "rich-text":
8947 case "children":
8948 case "node":
8949 case "query":
8950 case "tag":
8951 value = parseWithAttributeSchema(innerDOM, attributeSchema);
8952 break;
8953 }
8954 if (!isValidByType(value, attributeSchema.type) || !isValidByEnum(value, attributeSchema.enum)) {
8955 value = void 0;
8956 }
8957 if (value === void 0) {
8958 value = getDefault(attributeSchema);
8959 }
8960 return value;
8961 }
8962 function isValidByType(value, type) {
8963 return type === void 0 || isOfTypes(value, Array.isArray(type) ? type : [type]);
8964 }
8965 function isValidByEnum(value, enumSet) {
8966 return !Array.isArray(enumSet) || enumSet.includes(value);
8967 }
8968 var matcherFromSource = memize(
8969 (sourceConfig) => {
8970 switch (sourceConfig.source) {
8971 case "attribute": {
8972 let matcher3 = attr(
8973 sourceConfig.selector,
8974 sourceConfig.attribute
8975 );
8976 if (sourceConfig.type === "boolean") {
8977 matcher3 = toBooleanAttributeMatcher(matcher3);
8978 }
8979 return matcher3;
8980 }
8981 case "html":
8982 return html(sourceConfig.selector, sourceConfig.multiline);
8983 case "text":
8984 return text(sourceConfig.selector);
8985 case "rich-text":
8986 return richText(
8987 sourceConfig.selector,
8988 sourceConfig.__unstablePreserveWhiteSpace
8989 );
8990 case "children":
8991 return matcher(sourceConfig.selector);
8992 case "node":
8993 return matcher2(sourceConfig.selector);
8994 case "query":
8995 const subMatchers = Object.fromEntries(
8996 Object.entries(sourceConfig.query).map(
8997 ([key, subSourceConfig]) => [
8998 key,
8999 matcherFromSource(subSourceConfig)
9000 ]
9001 )
9002 );
9003 return query(sourceConfig.selector, subMatchers);
9004 case "tag": {
9005 const matcher3 = prop(sourceConfig.selector, "nodeName");
9006 return (domNode) => matcher3(domNode)?.toLowerCase();
9007 }
9008 default:
9009 console.error(
9010 `Unknown source type "${sourceConfig.source}"`
9011 );
9012 return void 0;
9013 }
9014 }
9015 );
9016 function parseHtml(innerHTML) {
9017 return parse(innerHTML, (h2) => h2);
9018 }
9019 function parseWithAttributeSchema(innerHTML, attributeSchema) {
9020 return matcherFromSource(attributeSchema)(
9021 parseHtml(innerHTML)
9022 );
9023 }
9024 function getBlockAttributes(blockTypeOrName, innerHTML, attributes = {}) {
9025 const doc = parseHtml(innerHTML);
9026 const blockType = normalizeBlockType(blockTypeOrName);
9027 const blockAttributes = Object.fromEntries(
9028 Object.entries(blockType?.attributes ?? {}).map(
9029 ([key, schema]) => [
9030 key,
9031 getBlockAttribute(key, schema, doc, attributes, innerHTML)
9032 ]
9033 )
9034 );
9035 return (0, import_hooks4.applyFilters)(
9036 "blocks.getBlockAttributes",
9037 blockAttributes,
9038 blockType,
9039 innerHTML,
9040 attributes
9041 );
9042 }
9043
9044 // packages/blocks/build-module/api/parser/fix-custom-classname.mjs
9045 var CLASS_ATTR_SCHEMA = {
9046 type: "string",
9047 source: "attribute",
9048 selector: "[data-custom-class-name] > *",
9049 attribute: "class"
9050 };
9051 function getHTMLRootElementClasses(innerHTML) {
9052 const parsed = parseWithAttributeSchema(
9053 `<div data-custom-class-name>${innerHTML}</div>`,
9054 CLASS_ATTR_SCHEMA
9055 );
9056 return parsed ? parsed.trim().split(/\s+/) : [];
9057 }
9058 function fixCustomClassname(blockAttributes, blockType, innerHTML) {
9059 if (!hasBlockSupport(blockType, "customClassName", true)) {
9060 return blockAttributes;
9061 }
9062 const modifiedBlockAttributes = { ...blockAttributes };
9063 const { className: omittedClassName, ...attributesSansClassName } = modifiedBlockAttributes;
9064 const serialized = getSaveContent(blockType, attributesSansClassName);
9065 const defaultClasses = getHTMLRootElementClasses(serialized);
9066 const actualClasses = getHTMLRootElementClasses(innerHTML);
9067 const customClasses = actualClasses.filter(
9068 (className) => !defaultClasses.includes(className)
9069 );
9070 if (customClasses.length) {
9071 modifiedBlockAttributes.className = customClasses.join(" ");
9072 } else if (serialized) {
9073 delete modifiedBlockAttributes.className;
9074 }
9075 return modifiedBlockAttributes;
9076 }
9077
9078 // packages/blocks/build-module/api/parser/fix-global-attribute.mjs
9079 function getHTMLRootElement(innerHTML, dataAttribute, attributeSchema) {
9080 const parsed = parseWithAttributeSchema(
9081 `<div ${dataAttribute}>${innerHTML}</div>`,
9082 attributeSchema
9083 );
9084 return parsed;
9085 }
9086 function fixGlobalAttribute(blockAttributes, blockType, innerHTML, supportKey, dataAttribute, attributeSchema) {
9087 if (!hasBlockSupport(blockType, supportKey, false)) {
9088 return blockAttributes;
9089 }
9090 const modifiedBlockAttributes = { ...blockAttributes };
9091 const attributeValue = getHTMLRootElement(
9092 innerHTML,
9093 dataAttribute,
9094 attributeSchema
9095 );
9096 if (attributeValue) {
9097 modifiedBlockAttributes[supportKey] = attributeValue;
9098 }
9099 return modifiedBlockAttributes;
9100 }
9101
9102 // packages/blocks/build-module/api/parser/apply-built-in-validation-fixes.mjs
9103 var ARIA_LABEL_ATTR_SCHEMA = {
9104 type: "string",
9105 source: "attribute",
9106 selector: "[data-aria-label] > *",
9107 attribute: "aria-label"
9108 };
9109 var ANCHOR_ATTR_SCHEMA = {
9110 type: "string",
9111 source: "attribute",
9112 selector: "[data-anchor] > *",
9113 attribute: "id"
9114 };
9115 function applyBuiltInValidationFixes(block, blockType) {
9116 const { attributes, originalContent } = block;
9117 let updatedBlockAttributes = attributes;
9118 updatedBlockAttributes = fixCustomClassname(
9119 attributes,
9120 blockType,
9121 originalContent ?? ""
9122 );
9123 updatedBlockAttributes = fixGlobalAttribute(
9124 updatedBlockAttributes,
9125 blockType,
9126 originalContent ?? "",
9127 "ariaLabel",
9128 "data-aria-label",
9129 ARIA_LABEL_ATTR_SCHEMA
9130 );
9131 updatedBlockAttributes = fixGlobalAttribute(
9132 updatedBlockAttributes,
9133 blockType,
9134 originalContent ?? "",
9135 "anchor",
9136 "data-anchor",
9137 ANCHOR_ATTR_SCHEMA
9138 );
9139 return {
9140 ...block,
9141 attributes: updatedBlockAttributes
9142 };
9143 }
9144
9145 // packages/blocks/build-module/api/parser/apply-block-deprecated-versions.mjs
9146 function stubFalse() {
9147 return false;
9148 }
9149 function applyBlockDeprecatedVersions(block, rawBlock, blockType) {
9150 const parsedAttributes = rawBlock.attrs ?? {};
9151 const { deprecated: deprecatedDefinitions } = blockType;
9152 if (!deprecatedDefinitions || !deprecatedDefinitions.length) {
9153 return block;
9154 }
9155 for (let i2 = 0; i2 < deprecatedDefinitions.length; i2++) {
9156 const { isEligible = stubFalse } = deprecatedDefinitions[i2];
9157 if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks, {
9158 blockNode: rawBlock,
9159 block
9160 })) {
9161 continue;
9162 }
9163 const deprecatedBlockType = Object.assign(
9164 omit(
9165 blockType,
9166 DEPRECATED_ENTRY_KEYS
9167 ),
9168 deprecatedDefinitions[i2]
9169 );
9170 let migratedBlock = {
9171 ...block,
9172 attributes: getBlockAttributes(
9173 deprecatedBlockType,
9174 block.originalContent ?? "",
9175 parsedAttributes
9176 )
9177 };
9178 let [isValid] = validateBlock(migratedBlock, deprecatedBlockType);
9179 if (!isValid) {
9180 migratedBlock = applyBuiltInValidationFixes(
9181 migratedBlock,
9182 deprecatedBlockType
9183 );
9184 [isValid] = validateBlock(migratedBlock, deprecatedBlockType);
9185 }
9186 if (!isValid) {
9187 continue;
9188 }
9189 let migratedInnerBlocks = migratedBlock.innerBlocks;
9190 let migratedAttributes = migratedBlock.attributes;
9191 const { migrate } = deprecatedBlockType;
9192 if (migrate) {
9193 let migrated = migrate(migratedAttributes, block.innerBlocks);
9194 if (!Array.isArray(migrated)) {
9195 migrated = [migrated];
9196 }
9197 [
9198 migratedAttributes = parsedAttributes,
9199 migratedInnerBlocks = block.innerBlocks
9200 ] = migrated;
9201 }
9202 block = {
9203 ...block,
9204 attributes: migratedAttributes,
9205 innerBlocks: migratedInnerBlocks,
9206 isValid: true,
9207 validationIssues: []
9208 };
9209 }
9210 return block;
9211 }
9212
9213 // packages/blocks/build-module/api/parser/index.mjs
9214 function convertLegacyBlocks(rawBlock) {
9215 const [correctName, correctedAttributes] = convertLegacyBlockNameAndAttributes(
9216 rawBlock.blockName,
9217 rawBlock.attrs ?? {}
9218 );
9219 return {
9220 ...rawBlock,
9221 blockName: correctName,
9222 attrs: correctedAttributes
9223 };
9224 }
9225 function normalizeRawBlock(rawBlock, options) {
9226 const fallbackBlockName = getFreeformContentHandlerName();
9227 const rawBlockName = rawBlock.blockName || getFreeformContentHandlerName();
9228 const rawAttributes = rawBlock.attrs || {};
9229 const rawInnerBlocks = rawBlock.innerBlocks || [];
9230 let rawInnerHTML = rawBlock.innerHTML.trim();
9231 if (rawBlockName === fallbackBlockName && rawBlockName === "core/freeform" && !options?.__unstableSkipAutop) {
9232 rawInnerHTML = (0, import_autop2.autop)(rawInnerHTML).trim();
9233 }
9234 return {
9235 ...rawBlock,
9236 blockName: rawBlockName,
9237 attrs: rawAttributes,
9238 innerHTML: rawInnerHTML,
9239 innerBlocks: rawInnerBlocks
9240 };
9241 }
9242 function createMissingBlockType(rawBlock) {
9243 const unregisteredFallbackBlock = getUnregisteredTypeHandlerName() || getFreeformContentHandlerName();
9244 const originalUndelimitedContent = serializeRawBlock(rawBlock, {
9245 isCommentDelimited: false
9246 });
9247 const originalContent = serializeRawBlock(rawBlock, {
9248 isCommentDelimited: true
9249 });
9250 return {
9251 blockName: unregisteredFallbackBlock,
9252 attrs: {
9253 originalName: rawBlock.blockName,
9254 originalContent,
9255 originalUndelimitedContent
9256 },
9257 innerHTML: rawBlock.blockName ? originalContent : rawBlock.innerHTML,
9258 innerBlocks: rawBlock.innerBlocks,
9259 innerContent: rawBlock.innerContent
9260 };
9261 }
9262 function applyBlockValidation(unvalidatedBlock, blockType) {
9263 const [isValid] = validateBlock(unvalidatedBlock, blockType);
9264 if (isValid) {
9265 return { ...unvalidatedBlock, isValid, validationIssues: [] };
9266 }
9267 const fixedBlock = applyBuiltInValidationFixes(
9268 unvalidatedBlock,
9269 blockType
9270 );
9271 const [isFixedValid, validationIssues] = validateBlock(
9272 fixedBlock,
9273 blockType
9274 );
9275 return { ...fixedBlock, isValid: isFixedValid, validationIssues };
9276 }
9277 function parseRawBlock(rawBlock, options) {
9278 let normalizedBlock = normalizeRawBlock(rawBlock, options);
9279 normalizedBlock = convertLegacyBlocks(normalizedBlock);
9280 let blockType = getBlockType(normalizedBlock.blockName);
9281 if (!blockType) {
9282 normalizedBlock = createMissingBlockType(normalizedBlock);
9283 blockType = getBlockType(normalizedBlock.blockName);
9284 }
9285 const isFallbackBlock = normalizedBlock.blockName === getFreeformContentHandlerName() || normalizedBlock.blockName === getUnregisteredTypeHandlerName();
9286 if (!blockType || !normalizedBlock.innerHTML && isFallbackBlock) {
9287 return;
9288 }
9289 const parsedInnerBlocks = normalizedBlock.innerBlocks.map((innerBlock) => parseRawBlock(innerBlock, options)).filter((innerBlock) => !!innerBlock);
9290 const parsedBlock = createBlock(
9291 normalizedBlock.blockName,
9292 getBlockAttributes(
9293 blockType,
9294 normalizedBlock.innerHTML,
9295 normalizedBlock.attrs
9296 ),
9297 parsedInnerBlocks
9298 );
9299 parsedBlock.originalContent = normalizedBlock.innerHTML;
9300 const validatedBlock = applyBlockValidation(parsedBlock, blockType);
9301 const { validationIssues } = validatedBlock;
9302 const updatedBlock = applyBlockDeprecatedVersions(
9303 validatedBlock,
9304 normalizedBlock,
9305 blockType
9306 );
9307 if (!updatedBlock.isValid) {
9308 updatedBlock.__unstableBlockSource = rawBlock;
9309 }
9310 if (!validatedBlock.isValid && updatedBlock.isValid && !options?.__unstableSkipMigrationLogs) {
9311 console.groupCollapsed("Updated Block: %s", blockType.name);
9312 console.info(
9313 "Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",
9314 blockType.name,
9315 blockType,
9316 getSaveContent(blockType, updatedBlock.attributes),
9317 updatedBlock.originalContent
9318 );
9319 console.groupEnd();
9320 } else if (!validatedBlock.isValid && !updatedBlock.isValid) {
9321 validationIssues.forEach(({ log: log2, args }) => log2(...args));
9322 }
9323 return updatedBlock;
9324 }
9325 function parse2(content, options) {
9326 return (0, import_block_serialization_default_parser.parse)(content).reduce(
9327 (accumulator, rawBlock) => {
9328 const block = parseRawBlock(
9329 rawBlock,
9330 options
9331 );
9332 if (block) {
9333 accumulator.push(block);
9334 }
9335 return accumulator;
9336 },
9337 []
9338 );
9339 }
9340
9341 // packages/blocks/build-module/api/raw-handling/index.mjs
9342 var import_deprecated10 = __toESM(require_deprecated(), 1);
9343 var import_dom12 = __toESM(require_dom(), 1);
9344
9345 // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs
9346 var import_element4 = __toESM(require_element(), 1);
9347
9348 // packages/blocks/build-module/api/raw-handling/get-raw-transforms.mjs
9349 function getRawTransforms() {
9350 return getBlockTransforms("from").filter(({ type }) => type === "raw").map((transform) => {
9351 return transform.isMatch ? transform : {
9352 ...transform,
9353 isMatch: (node) => transform.selector && node.matches(transform.selector)
9354 };
9355 });
9356 }
9357
9358 // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs
9359 function htmlToBlocks(html2, handler) {
9360 const doc = document.implementation.createHTMLDocument("");
9361 doc.body.innerHTML = html2;
9362 return Array.from(doc.body.children).flatMap((node) => {
9363 const transforms = getRawTransforms();
9364 const rawTransform = findTransform(
9365 transforms,
9366 ((t3) => {
9367 const transform2 = t3;
9368 return transform2.isMatch(node);
9369 })
9370 );
9371 if (!rawTransform) {
9372 if (import_element4.Platform.isNative) {
9373 return parse2(
9374 `<!-- wp:html -->${node.outerHTML}<!-- /wp:html -->`
9375 );
9376 }
9377 return createBlock(
9378 // Should not be hardcoded.
9379 "core/html",
9380 getBlockAttributes("core/html", node.outerHTML)
9381 );
9382 }
9383 const { transform, blockName } = rawTransform;
9384 if (transform) {
9385 const block = transform(node, handler);
9386 if (node.hasAttribute("class")) {
9387 block.attributes.className = node.getAttribute("class");
9388 }
9389 return block;
9390 }
9391 return createBlock(
9392 blockName,
9393 getBlockAttributes(blockName, node.outerHTML)
9394 );
9395 });
9396 }
9397
9398 // packages/blocks/build-module/api/raw-handling/normalise-blocks.mjs
9399 var import_dom2 = __toESM(require_dom(), 1);
9400 function normaliseBlocks(HTML, options = {}) {
9401 const decuDoc = document.implementation.createHTMLDocument("");
9402 const accuDoc = document.implementation.createHTMLDocument("");
9403 const decu = decuDoc.body;
9404 const accu = accuDoc.body;
9405 decu.innerHTML = HTML;
9406 while (decu.firstChild) {
9407 const node = decu.firstChild;
9408 if (node.nodeType === node.TEXT_NODE) {
9409 if ((0, import_dom2.isEmpty)(node)) {
9410 decu.removeChild(node);
9411 } else {
9412 if (!accu.lastChild || accu.lastChild.nodeName !== "P") {
9413 accu.appendChild(accuDoc.createElement("P"));
9414 }
9415 accu.lastChild.appendChild(node);
9416 }
9417 } else if (node.nodeType === node.ELEMENT_NODE) {
9418 if (node.nodeName === "BR") {
9419 if (node.nextSibling && node.nextSibling.nodeName === "BR") {
9420 accu.appendChild(accuDoc.createElement("P"));
9421 decu.removeChild(node.nextSibling);
9422 }
9423 if (accu.lastChild && accu.lastChild.nodeName === "P" && accu.lastChild.hasChildNodes()) {
9424 accu.lastChild.appendChild(node);
9425 } else {
9426 decu.removeChild(node);
9427 }
9428 } else if (node.nodeName === "P") {
9429 if ((0, import_dom2.isEmpty)(node) && !options.raw) {
9430 decu.removeChild(node);
9431 } else {
9432 accu.appendChild(node);
9433 }
9434 } else if ((0, import_dom2.isPhrasingContent)(node)) {
9435 if (!accu.lastChild || accu.lastChild.nodeName !== "P") {
9436 accu.appendChild(accuDoc.createElement("P"));
9437 }
9438 accu.lastChild.appendChild(node);
9439 } else {
9440 accu.appendChild(node);
9441 }
9442 } else {
9443 decu.removeChild(node);
9444 }
9445 }
9446 return accu.innerHTML;
9447 }
9448
9449 // packages/blocks/build-module/api/raw-handling/special-comment-converter.mjs
9450 var import_dom3 = __toESM(require_dom(), 1);
9451 function specialCommentConverter(node, doc) {
9452 if (node.nodeType !== node.COMMENT_NODE) {
9453 return;
9454 }
9455 if (node.nodeValue !== "nextpage" && node.nodeValue.indexOf("more") !== 0) {
9456 return;
9457 }
9458 const block = createBlock2(node, doc);
9459 if (!node.parentNode || node.parentNode.nodeName !== "P") {
9460 (0, import_dom3.replace)(node, block);
9461 } else {
9462 const childNodes = Array.from(node.parentNode.childNodes);
9463 const nodeIndex = childNodes.indexOf(node);
9464 const wrapperNode = node.parentNode.parentNode || doc.body;
9465 const paragraphBuilder = (acc, child) => {
9466 if (!acc) {
9467 acc = doc.createElement("p");
9468 }
9469 acc.appendChild(child);
9470 return acc;
9471 };
9472 [
9473 childNodes.slice(0, nodeIndex).reduce(paragraphBuilder, null),
9474 block,
9475 childNodes.slice(nodeIndex + 1).reduce(paragraphBuilder, null)
9476 ].forEach(
9477 (element) => element && wrapperNode.insertBefore(element, node.parentNode)
9478 );
9479 (0, import_dom3.remove)(node.parentNode);
9480 }
9481 }
9482 function createBlock2(commentNode, doc) {
9483 if (commentNode.nodeValue === "nextpage") {
9484 return createNextpage(doc);
9485 }
9486 const customText = commentNode.nodeValue.slice(4).trim();
9487 let sibling = commentNode;
9488 let noTeaser = false;
9489 while (sibling = sibling.nextSibling) {
9490 if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === "noteaser") {
9491 noTeaser = true;
9492 (0, import_dom3.remove)(sibling);
9493 break;
9494 }
9495 }
9496 return createMore(customText, noTeaser, doc);
9497 }
9498 function createMore(customText, noTeaser, doc) {
9499 const node = doc.createElement("wp-block");
9500 node.dataset.block = "core/more";
9501 if (customText) {
9502 node.dataset.customText = customText;
9503 }
9504 if (noTeaser) {
9505 node.dataset.noTeaser = "";
9506 }
9507 return node;
9508 }
9509 function createNextpage(doc) {
9510 const node = doc.createElement("wp-block");
9511 node.dataset.block = "core/nextpage";
9512 return node;
9513 }
9514
9515 // packages/blocks/build-module/api/raw-handling/list-reducer.mjs
9516 var import_dom4 = __toESM(require_dom(), 1);
9517 function isList(node) {
9518 return node.nodeName === "OL" || node.nodeName === "UL";
9519 }
9520 function shallowTextContent(element) {
9521 return Array.from(element.childNodes).map(({ nodeValue = "" }) => nodeValue).join("");
9522 }
9523 function listReducer(node) {
9524 if (!isList(node)) {
9525 return;
9526 }
9527 const list = node;
9528 const prevElement = list.previousElementSibling;
9529 if (prevElement && prevElement.nodeName === node.nodeName && list.children.length === 1) {
9530 while (list.firstChild) {
9531 prevElement.appendChild(list.firstChild);
9532 }
9533 list.parentNode.removeChild(list);
9534 }
9535 const parentElement = node.parentNode;
9536 if (parentElement && parentElement.nodeName === "LI" && parentElement.children.length === 1 && !/\S/.test(shallowTextContent(parentElement))) {
9537 const parentListItem = parentElement;
9538 const prevListItem = parentListItem.previousElementSibling;
9539 const parentList = parentListItem.parentNode;
9540 if (prevListItem) {
9541 prevListItem.appendChild(list);
9542 parentList.removeChild(parentListItem);
9543 }
9544 }
9545 if (parentElement && isList(parentElement)) {
9546 const prevListItem = list.previousElementSibling;
9547 if (prevListItem) {
9548 prevListItem.appendChild(node);
9549 } else {
9550 (0, import_dom4.unwrap)(node);
9551 }
9552 }
9553 }
9554
9555 // packages/blocks/build-module/api/raw-handling/blockquote-normaliser.mjs
9556 function blockquoteNormaliser(options = {}) {
9557 return (bq) => {
9558 if (bq.nodeName !== "BLOCKQUOTE") {
9559 return;
9560 }
9561 const node = bq;
9562 node.innerHTML = normaliseBlocks(node.innerHTML, options);
9563 };
9564 }
9565
9566 // packages/blocks/build-module/api/raw-handling/figure-content-reducer.mjs
9567 var import_dom5 = __toESM(require_dom(), 1);
9568 function isFigureContent(node, schema) {
9569 const tag = node.nodeName.toLowerCase();
9570 if (tag === "figcaption" || (0, import_dom5.isTextContent)(node)) {
9571 return false;
9572 }
9573 return tag in (schema?.figure?.children ?? {});
9574 }
9575 function canHaveAnchor(node, schema) {
9576 const tag = node.nodeName.toLowerCase();
9577 return tag in (schema?.figure?.children?.a?.children ?? {});
9578 }
9579 function wrapFigureContent(element, beforeElement = element) {
9580 const figure = element.ownerDocument.createElement("figure");
9581 beforeElement.parentNode.insertBefore(figure, beforeElement);
9582 figure.appendChild(element);
9583 }
9584 function figureContentReducer(node, doc, schema) {
9585 if (!schema || !isFigureContent(node, schema)) {
9586 return;
9587 }
9588 let nodeToInsert = node;
9589 const parentNode = node.parentNode;
9590 if (canHaveAnchor(node, schema) && parentNode.nodeName === "A" && parentNode.childNodes.length === 1) {
9591 nodeToInsert = node.parentNode;
9592 }
9593 const wrapper = nodeToInsert.closest("p,div");
9594 if (wrapper) {
9595 const element = node;
9596 if (!element.classList) {
9597 wrapFigureContent(nodeToInsert, wrapper);
9598 } else if (element.classList.contains("alignright") || element.classList.contains("alignleft") || element.classList.contains("aligncenter") || !wrapper.textContent.trim()) {
9599 wrapFigureContent(nodeToInsert, wrapper);
9600 }
9601 } else {
9602 wrapFigureContent(nodeToInsert);
9603 }
9604 }
9605
9606 // packages/blocks/build-module/api/raw-handling/shortcode-converter.mjs
9607 var import_shortcode = __toESM(require_shortcode(), 1);
9608 var castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
9609 var beforeLineRegexp = /(\n|<p>|<br\s*\/?>)\s*$/;
9610 var afterLineRegexp = /^\s*(\n|<\/p>|<br\s*\/?>)/;
9611 function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) {
9612 const transformsFrom = getBlockTransforms(
9613 "from"
9614 );
9615 const transformation = findTransform(
9616 transformsFrom,
9617 ((transform) => {
9618 const t3 = transform;
9619 return excludedBlockNames.indexOf(t3.blockName) === -1 && t3.type === "shortcode" && castArray(t3.tag).some(
9620 (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
9621 );
9622 })
9623 );
9624 if (!transformation) {
9625 return [HTML];
9626 }
9627 const transformTags = castArray(transformation.tag);
9628 const transformTag = transformTags.find(
9629 (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
9630 );
9631 let match;
9632 const previousIndex = lastIndex;
9633 if (match = (0, import_shortcode.next)(transformTag, HTML, lastIndex)) {
9634 lastIndex = match.index + match.content.length;
9635 const beforeHTML = HTML.substr(0, match.index);
9636 const afterHTML = HTML.substr(lastIndex);
9637 if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) {
9638 return segmentHTMLToShortcodeBlock(HTML, lastIndex);
9639 }
9640 if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
9641 return segmentHTMLToShortcodeBlock(HTML, previousIndex, [
9642 ...excludedBlockNames,
9643 transformation.blockName
9644 ]);
9645 }
9646 let blocks = [];
9647 if (typeof transformation.transform === "function") {
9648 blocks = [].concat(
9649 transformation.transform(match.shortcode.attrs, match)
9650 );
9651 blocks = blocks.map((block) => {
9652 block.originalContent = match.shortcode.content;
9653 return applyBuiltInValidationFixes(
9654 block,
9655 getBlockType(block.name)
9656 );
9657 });
9658 } else {
9659 const attributes = Object.fromEntries(
9660 Object.entries(transformation.attributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [
9661 key,
9662 schema.shortcode(match.shortcode.attrs, match)
9663 ])
9664 );
9665 const blockType = getBlockType(transformation.blockName);
9666 if (!blockType) {
9667 return [HTML];
9668 }
9669 const transformationBlockType = {
9670 ...blockType,
9671 attributes: transformation.attributes
9672 };
9673 let block = createBlock(
9674 transformation.blockName,
9675 getBlockAttributes(
9676 transformationBlockType,
9677 match.shortcode.content,
9678 attributes
9679 )
9680 );
9681 block.originalContent = match.shortcode.content;
9682 block = applyBuiltInValidationFixes(
9683 block,
9684 transformationBlockType
9685 );
9686 blocks = [block];
9687 }
9688 return [
9689 ...segmentHTMLToShortcodeBlock(
9690 beforeHTML.replace(beforeLineRegexp, "")
9691 ),
9692 ...blocks,
9693 ...segmentHTMLToShortcodeBlock(
9694 afterHTML.replace(afterLineRegexp, "")
9695 )
9696 ];
9697 }
9698 return [HTML];
9699 }
9700 var shortcode_converter_default = segmentHTMLToShortcodeBlock;
9701
9702 // packages/blocks/build-module/api/raw-handling/utils.mjs
9703 var import_dom6 = __toESM(require_dom(), 1);
9704 function getBlockContentSchemaFromTransforms(transforms, context) {
9705 const phrasingContentSchema = (0, import_dom6.getPhrasingContentSchema)(context);
9706 const schemaArgs = { phrasingContentSchema, isPaste: context === "paste" };
9707 const schemas = transforms.map(({ isMatch, blockName, schema }) => {
9708 const hasAnchorSupport = hasBlockSupport(blockName, "anchor");
9709 schema = typeof schema === "function" ? schema(schemaArgs) : schema;
9710 if (!hasAnchorSupport && !isMatch) {
9711 return schema;
9712 }
9713 if (!schema) {
9714 return {};
9715 }
9716 return Object.fromEntries(
9717 Object.entries(schema).map(([key, value]) => {
9718 let attributes = value.attributes || [];
9719 if (hasAnchorSupport) {
9720 attributes = [...attributes, "id"];
9721 }
9722 return [
9723 key,
9724 {
9725 ...value,
9726 attributes,
9727 isMatch: isMatch ? isMatch : void 0
9728 }
9729 ];
9730 })
9731 );
9732 });
9733 function mergeTagNameSchemaProperties(objValue, srcValue, key) {
9734 switch (key) {
9735 case "children": {
9736 if (objValue === "*" || srcValue === "*") {
9737 return "*";
9738 }
9739 return mergeSchemas(
9740 { ...objValue || {} },
9741 srcValue || {}
9742 );
9743 }
9744 case "attributes":
9745 case "require": {
9746 return Array.from(
9747 /* @__PURE__ */ new Set([...objValue || [], ...srcValue || []])
9748 );
9749 }
9750 case "isMatch": {
9751 if (!objValue || !srcValue) {
9752 return void 0;
9753 }
9754 return (...args) => {
9755 return objValue(...args) || srcValue(...args);
9756 };
9757 }
9758 case "classes": {
9759 if ((objValue || []).includes("*") || (srcValue || []).includes("*")) {
9760 return ["*"];
9761 }
9762 return [...objValue || [], ...srcValue || []];
9763 }
9764 }
9765 }
9766 function mergeTagNameSchemas(a2, b2) {
9767 if (a2 === b2) {
9768 return a2;
9769 }
9770 for (const key in b2) {
9771 if (a2[key]) {
9772 a2[key] = mergeTagNameSchemaProperties(
9773 a2[key],
9774 b2[key],
9775 key
9776 );
9777 } else if (Array.isArray(b2[key])) {
9778 a2[key] = b2[key].slice();
9779 } else {
9780 a2[key] = { ...b2[key] };
9781 }
9782 }
9783 return a2;
9784 }
9785 function mergeSchemas(a2, b2) {
9786 if (a2 === b2) {
9787 return a2;
9788 }
9789 for (const key in b2) {
9790 if (a2[key]) {
9791 a2[key] = mergeTagNameSchemas(a2[key], b2[key]);
9792 } else if (Array.isArray(b2[key])) {
9793 a2[key] = b2[key].slice();
9794 } else {
9795 a2[key] = { ...b2[key] };
9796 }
9797 }
9798 return a2;
9799 }
9800 return schemas.reduce(mergeSchemas, {});
9801 }
9802 function getBlockContentSchema(context) {
9803 return getBlockContentSchemaFromTransforms(getRawTransforms(), context);
9804 }
9805 function isPlain(HTML) {
9806 if (!/<(?!br[ />])/i.test(HTML)) {
9807 return true;
9808 }
9809 const doc = document.implementation.createHTMLDocument("");
9810 doc.body.innerHTML = HTML;
9811 if (doc.body.children.length !== 1) {
9812 return false;
9813 }
9814 const wrapper = doc.body.children.item(0);
9815 const descendants = wrapper.getElementsByTagName("*");
9816 for (let i2 = 0; i2 < descendants.length; i2++) {
9817 if (descendants.item(i2).tagName !== "BR") {
9818 return false;
9819 }
9820 }
9821 if (wrapper.tagName !== "SPAN") {
9822 return false;
9823 }
9824 return true;
9825 }
9826 function deepFilterNodeList(nodeList, filters, doc, schema) {
9827 Array.from(nodeList).forEach((node) => {
9828 deepFilterNodeList(node.childNodes, filters, doc, schema);
9829 filters.forEach((item) => {
9830 if (!doc.contains(node)) {
9831 return;
9832 }
9833 item(node, doc, schema);
9834 });
9835 });
9836 }
9837 function deepFilterHTML(HTML, filters = [], schema) {
9838 const doc = document.implementation.createHTMLDocument("");
9839 doc.body.innerHTML = HTML;
9840 deepFilterNodeList(doc.body.childNodes, filters, doc, schema);
9841 return doc.body.innerHTML;
9842 }
9843 function getSibling(node, which) {
9844 const sibling = node[`${which}Sibling`];
9845 if (sibling && (0, import_dom6.isPhrasingContent)(sibling)) {
9846 return sibling;
9847 }
9848 const { parentNode } = node;
9849 if (!parentNode || !(0, import_dom6.isPhrasingContent)(parentNode)) {
9850 return;
9851 }
9852 return getSibling(parentNode, which);
9853 }
9854
9855 // packages/blocks/build-module/api/raw-handling/paste-handler.mjs
9856 var import_dom11 = __toESM(require_dom(), 1);
9857
9858 // packages/blocks/build-module/api/raw-handling/comment-remover.mjs
9859 var import_dom7 = __toESM(require_dom(), 1);
9860 function commentRemover(node) {
9861 if (node.nodeType === node.COMMENT_NODE) {
9862 (0, import_dom7.remove)(node);
9863 }
9864 }
9865
9866 // packages/blocks/build-module/api/raw-handling/is-inline-content.mjs
9867 var import_dom8 = __toESM(require_dom(), 1);
9868 function isInline(node, contextTag) {
9869 if ((0, import_dom8.isTextContent)(node)) {
9870 return true;
9871 }
9872 if (!contextTag) {
9873 return false;
9874 }
9875 const tag = node.nodeName.toLowerCase();
9876 const inlineAllowedTagGroups = [
9877 ["ul", "li", "ol"],
9878 ["h1", "h2", "h3", "h4", "h5", "h6"]
9879 ];
9880 return inlineAllowedTagGroups.some(
9881 (tagGroup) => [tag, contextTag].filter((t3) => !tagGroup.includes(t3)).length === 0
9882 );
9883 }
9884 function deepCheck(nodes, contextTag) {
9885 return nodes.every(
9886 (node) => isInline(node, contextTag) && deepCheck(Array.from(node.children), contextTag)
9887 );
9888 }
9889 function isDoubleBR(node) {
9890 return node.nodeName === "BR" && !!node.previousSibling && node.previousSibling.nodeName === "BR";
9891 }
9892 function isInlineContent(HTML, contextTag) {
9893 const doc = document.implementation.createHTMLDocument("");
9894 doc.body.innerHTML = HTML;
9895 const nodes = Array.from(doc.body.children);
9896 return !nodes.some(isDoubleBR) && deepCheck(nodes, contextTag);
9897 }
9898
9899 // packages/blocks/build-module/api/raw-handling/phrasing-content-reducer.mjs
9900 var import_dom9 = __toESM(require_dom(), 1);
9901 function phrasingContentReducer(node, doc) {
9902 if (node.nodeName === "SPAN" && node.style) {
9903 const {
9904 fontWeight,
9905 fontStyle,
9906 textDecorationLine,
9907 textDecoration,
9908 verticalAlign
9909 } = node.style;
9910 const element = node;
9911 if (fontWeight === "bold" || fontWeight === "700") {
9912 (0, import_dom9.wrap)(doc.createElement("strong"), element);
9913 }
9914 if (fontStyle === "italic") {
9915 (0, import_dom9.wrap)(doc.createElement("em"), element);
9916 }
9917 if (textDecorationLine === "line-through" || textDecoration.includes("line-through")) {
9918 (0, import_dom9.wrap)(doc.createElement("s"), element);
9919 }
9920 if (verticalAlign === "super") {
9921 (0, import_dom9.wrap)(doc.createElement("sup"), element);
9922 } else if (verticalAlign === "sub") {
9923 (0, import_dom9.wrap)(doc.createElement("sub"), element);
9924 }
9925 } else if (node.nodeName === "B") {
9926 (0, import_dom9.replaceTag)(node, "strong");
9927 } else if (node.nodeName === "I") {
9928 (0, import_dom9.replaceTag)(node, "em");
9929 } else if (node.nodeName === "A") {
9930 const anchor = node;
9931 if (anchor.target && anchor.target.toLowerCase() === "_blank") {
9932 anchor.rel = "noopener";
9933 } else {
9934 anchor.removeAttribute("target");
9935 anchor.removeAttribute("rel");
9936 }
9937 if (anchor.name && !anchor.id) {
9938 anchor.id = anchor.name;
9939 }
9940 if (anchor.id && !anchor.ownerDocument.querySelector(`[href="#${anchor.id}"]`)) {
9941 anchor.removeAttribute("id");
9942 }
9943 }
9944 }
9945
9946 // packages/blocks/build-module/api/raw-handling/head-remover.mjs
9947 function headRemover(node) {
9948 if (node.nodeName !== "SCRIPT" && node.nodeName !== "NOSCRIPT" && node.nodeName !== "TEMPLATE" && node.nodeName !== "STYLE") {
9949 return;
9950 }
9951 node.parentNode.removeChild(node);
9952 }
9953
9954 // packages/blocks/build-module/api/raw-handling/ms-list-ignore.mjs
9955 function msListIgnore(node) {
9956 if (node.nodeType !== node.ELEMENT_NODE) {
9957 return;
9958 }
9959 const el = node;
9960 const style = el.getAttribute("style");
9961 if (!style || !style.includes("mso-list")) {
9962 return;
9963 }
9964 const rules = style.split(";").reduce(
9965 (acc, rule) => {
9966 const [key, value] = rule.split(":");
9967 if (key && value) {
9968 acc[key.trim().toLowerCase()] = value.trim().toLowerCase();
9969 }
9970 return acc;
9971 },
9972 {}
9973 );
9974 if (rules["mso-list"] === "ignore") {
9975 el.remove();
9976 }
9977 }
9978
9979 // packages/blocks/build-module/api/raw-handling/ms-list-converter.mjs
9980 function isList2(node) {
9981 return node.nodeName === "OL" || node.nodeName === "UL";
9982 }
9983 function msListConverter(node, doc) {
9984 if (node.nodeName !== "P") {
9985 return;
9986 }
9987 const element = node;
9988 const style = element.getAttribute("style");
9989 if (!style || !style.includes("mso-list")) {
9990 return;
9991 }
9992 const prevNode = element.previousElementSibling;
9993 if (!prevNode || !isList2(prevNode)) {
9994 const type = element.textContent.trim().slice(0, 1);
9995 const isNumeric = /[1iIaA]/.test(type);
9996 const newListNode = doc.createElement(isNumeric ? "ol" : "ul");
9997 if (isNumeric) {
9998 newListNode.setAttribute("type", type);
9999 }
10000 element.parentNode.insertBefore(newListNode, element);
10001 }
10002 const listNode = element.previousElementSibling;
10003 const listType = listNode.nodeName;
10004 const listItem = doc.createElement("li");
10005 let receivingNode = listNode;
10006 listItem.innerHTML = deepFilterHTML(element.innerHTML, [msListIgnore]);
10007 const matches = /mso-list\s*:[^;]+level([0-9]+)/i.exec(style);
10008 let level = matches ? parseInt(matches[1], 10) - 1 || 0 : 0;
10009 while (level--) {
10010 receivingNode = receivingNode.lastChild || receivingNode;
10011 if (isList2(receivingNode)) {
10012 receivingNode = receivingNode.lastChild || receivingNode;
10013 }
10014 }
10015 if (!isList2(receivingNode)) {
10016 receivingNode = receivingNode.appendChild(
10017 doc.createElement(listType)
10018 );
10019 }
10020 receivingNode.appendChild(listItem);
10021 element.parentNode.removeChild(element);
10022 }
10023
10024 // packages/blocks/build-module/api/raw-handling/image-corrector.mjs
10025 var import_blob = __toESM(require_blob(), 1);
10026 function imageCorrector(img) {
10027 if (img.nodeName !== "IMG") {
10028 return;
10029 }
10030 const node = img;
10031 if (node.src.indexOf("file:") === 0) {
10032 node.src = "";
10033 }
10034 if (node.src.indexOf("data:") === 0) {
10035 const [properties, data] = node.src.split(",");
10036 const [type] = properties.slice(5).split(";");
10037 if (!data || !type) {
10038 node.src = "";
10039 return;
10040 }
10041 let decoded;
10042 try {
10043 decoded = atob(data);
10044 } catch {
10045 node.src = "";
10046 return;
10047 }
10048 const uint8Array = new Uint8Array(decoded.length);
10049 for (let i2 = 0; i2 < uint8Array.length; i2++) {
10050 uint8Array[i2] = decoded.charCodeAt(i2);
10051 }
10052 const name = type.replace("/", ".");
10053 const file = new window.File([uint8Array], name, { type });
10054 node.src = (0, import_blob.createBlobURL)(file);
10055 }
10056 if (node.height === 1 || node.width === 1) {
10057 node.parentNode.removeChild(node);
10058 }
10059 }
10060
10061 // packages/blocks/build-module/api/raw-handling/div-normaliser.mjs
10062 function divNormaliser(div) {
10063 if (div.nodeName !== "DIV") {
10064 return;
10065 }
10066 const node = div;
10067 node.innerHTML = normaliseBlocks(node.innerHTML);
10068 }
10069
10070 // packages/blocks/build-module/api/raw-handling/markdown-converter.mjs
10071 var import_showdown = __toESM(require_showdown(), 1);
10072 var converter = new import_showdown.default.Converter({
10073 noHeaderId: true,
10074 tables: true,
10075 literalMidWordUnderscores: true,
10076 omitExtraWLInCodeBlocks: true,
10077 simpleLineBreaks: true,
10078 strikethrough: true
10079 });
10080 function slackMarkdownVariantCorrector(text2) {
10081 return text2.replace(
10082 /((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,
10083 (match, p1, p2, p3) => `${p1}
10084 ${p2}
10085 ${p3}`
10086 );
10087 }
10088 function bulletsToAsterisks(text2) {
10089 return text2.replace(/(^|\n)•( +)/g, "$1*$2");
10090 }
10091 function escapeSingleLineOrderedListMarker(text2) {
10092 if (text2.includes("\n")) {
10093 return text2;
10094 }
10095 return text2.replace(/^(\d+)\.(\s)/, "$1\\.$2");
10096 }
10097 var correctors = [
10098 escapeSingleLineOrderedListMarker,
10099 bulletsToAsterisks,
10100 slackMarkdownVariantCorrector
10101 ];
10102 function markdownConverter(text2) {
10103 return converter.makeHtml(
10104 correctors.reduce(
10105 (current, corrector) => corrector(current),
10106 text2
10107 )
10108 );
10109 }
10110
10111 // packages/blocks/build-module/api/raw-handling/iframe-remover.mjs
10112 function iframeRemover(iframe) {
10113 if (iframe.nodeName === "IFRAME") {
10114 const node = iframe;
10115 const text2 = node.ownerDocument.createTextNode(node.src);
10116 node.parentNode.replaceChild(text2, node);
10117 }
10118 }
10119
10120 // packages/blocks/build-module/api/raw-handling/google-docs-uid-remover.mjs
10121 var import_dom10 = __toESM(require_dom(), 1);
10122 function googleDocsUIdRemover(node) {
10123 const el = node;
10124 if (!el.id || el.id.indexOf("docs-internal-guid-") !== 0) {
10125 return;
10126 }
10127 if (el.tagName === "B") {
10128 (0, import_dom10.unwrap)(node);
10129 } else {
10130 el.removeAttribute("id");
10131 }
10132 }
10133
10134 // packages/blocks/build-module/api/raw-handling/html-formatting-remover.mjs
10135 function isFormattingSpace(character) {
10136 return character === " " || character === "\r" || character === "\n" || character === " ";
10137 }
10138 function htmlFormattingRemover(node) {
10139 if (node.nodeType !== node.TEXT_NODE) {
10140 return;
10141 }
10142 let parent = node;
10143 while (parent = parent.parentNode) {
10144 if (parent.nodeType === parent.ELEMENT_NODE && parent.nodeName === "PRE") {
10145 return;
10146 }
10147 }
10148 const textNode = node;
10149 let newData = textNode.data.replace(/[ \r\n\t]+/g, " ");
10150 if (newData[0] === " ") {
10151 const previousSibling = getSibling(node, "previous");
10152 if (!previousSibling || previousSibling.nodeName === "BR" || previousSibling.textContent.slice(-1) === " ") {
10153 newData = newData.slice(1);
10154 }
10155 }
10156 if (newData[newData.length - 1] === " ") {
10157 const nextSibling = getSibling(node, "next");
10158 if (!nextSibling || nextSibling.nodeName === "BR" || nextSibling.nodeType === nextSibling.TEXT_NODE && isFormattingSpace(nextSibling.textContent[0])) {
10159 newData = newData.slice(0, -1);
10160 }
10161 }
10162 if (!newData) {
10163 node.parentNode.removeChild(node);
10164 } else {
10165 textNode.data = newData;
10166 }
10167 }
10168
10169 // packages/blocks/build-module/api/raw-handling/br-remover.mjs
10170 function brRemover(node) {
10171 if (node.nodeName !== "BR") {
10172 return;
10173 }
10174 if (getSibling(node, "next")) {
10175 return;
10176 }
10177 node.parentNode.removeChild(node);
10178 }
10179
10180 // packages/blocks/build-module/api/raw-handling/empty-paragraph-remover.mjs
10181 function emptyParagraphRemover(node) {
10182 if (node.nodeName !== "P") {
10183 return;
10184 }
10185 if (node.hasChildNodes()) {
10186 return;
10187 }
10188 node.parentNode.removeChild(node);
10189 }
10190
10191 // packages/blocks/build-module/api/raw-handling/slack-paragraph-corrector.mjs
10192 function slackParagraphCorrector(node) {
10193 if (node.nodeName !== "SPAN") {
10194 return;
10195 }
10196 if (node.getAttribute("data-stringify-type") !== "paragraph-break") {
10197 return;
10198 }
10199 const parentNode = node.parentNode;
10200 parentNode.insertBefore(node.ownerDocument.createElement("br"), node);
10201 parentNode.insertBefore(node.ownerDocument.createElement("br"), node);
10202 parentNode.removeChild(node);
10203 }
10204
10205 // packages/blocks/build-module/api/raw-handling/latex-to-math.mjs
10206 function isLatexMathMode(text2) {
10207 const lettersRegex = /[\p{L}\s]+/gu;
10208 let match;
10209 while (match = lettersRegex.exec(text2)) {
10210 if (text2[match.index - 1] === "{") {
10211 continue;
10212 }
10213 let sequence = match[0];
10214 if (text2[match.index - 1] === "\\") {
10215 sequence = sequence.replace(/^[a-zA-Z]+/, "");
10216 }
10217 if (sequence.length < 6) {
10218 continue;
10219 }
10220 return false;
10221 }
10222 if (/\\[a-zA-Z]+\s*\{/g.test(text2)) {
10223 return true;
10224 }
10225 const softClues = [
10226 (t3) => t3.includes("^") && !t3.startsWith("^"),
10227 (t3) => ["=", "+", "-", "/", "*"].some(
10228 (operator) => t3.includes(operator)
10229 ),
10230 (t3) => /\\[a-zA-Z]+/g.test(t3)
10231 ];
10232 if (softClues.filter((clue) => clue(text2)).length >= 2) {
10233 return true;
10234 }
10235 return false;
10236 }
10237
10238 // packages/blocks/build-module/api/raw-handling/heading-transformer.mjs
10239 function headingTransformer(node) {
10240 if (node.nodeType !== node.ELEMENT_NODE) {
10241 return;
10242 }
10243 const element = node;
10244 if (element.tagName === "P" && element.getAttribute("role") === "heading" && element.hasAttribute("aria-level")) {
10245 const level = parseInt(element.getAttribute("aria-level"), 10);
10246 if (level >= 1 && level <= 6) {
10247 const headingTag = `H${level}`;
10248 const newHeading = element.ownerDocument.createElement(headingTag);
10249 Array.from(element.attributes).forEach((attr2) => {
10250 if (attr2.name !== "role" && attr2.name !== "aria-level") {
10251 newHeading.setAttribute(attr2.name, attr2.value);
10252 }
10253 });
10254 while (element.firstChild) {
10255 newHeading.appendChild(element.firstChild);
10256 }
10257 element.parentNode.replaceChild(newHeading, element);
10258 }
10259 }
10260 }
10261
10262 // packages/blocks/build-module/api/raw-handling/paste-handler.mjs
10263 var log = (...args) => window?.console?.log?.(...args);
10264 function filterInlineHTML(HTML) {
10265 HTML = deepFilterHTML(HTML, [
10266 headRemover,
10267 googleDocsUIdRemover,
10268 msListIgnore,
10269 phrasingContentReducer,
10270 commentRemover
10271 ]);
10272 HTML = (0, import_dom11.removeInvalidHTML)(
10273 HTML,
10274 (0, import_dom11.getPhrasingContentSchema)("paste"),
10275 true
10276 );
10277 HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]);
10278 log("Processed inline HTML:\n\n", HTML);
10279 return HTML;
10280 }
10281 function pasteHandler({
10282 HTML = "",
10283 plainText = "",
10284 mode = "AUTO",
10285 tagName
10286 }) {
10287 log("Received HTML (pasteHandler):\n\n", HTML);
10288 log("Received plain text (pasteHandler):\n\n", plainText);
10289 HTML = HTML.replace(/<meta[^>]+>/g, "");
10290 HTML = HTML.replace(
10291 /^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,
10292 ""
10293 );
10294 HTML = HTML.replace(
10295 /(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,
10296 ""
10297 );
10298 if (mode !== "INLINE") {
10299 const content = HTML ? HTML : plainText;
10300 if (content.indexOf("<!-- wp:") !== -1) {
10301 const parseResult = parse2(content);
10302 const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform";
10303 if (!isSingleFreeFormBlock) {
10304 return parseResult;
10305 }
10306 }
10307 }
10308 HTML = HTML.normalize();
10309 HTML = deepFilterHTML(HTML, [slackParagraphCorrector]);
10310 const isPlainText = plainText && (!HTML || isPlain(HTML));
10311 if (isPlainText && isLatexMathMode(plainText)) {
10312 return [createBlock("core/math", { latex: plainText })];
10313 }
10314 if (isPlainText) {
10315 HTML = plainText;
10316 if (!/^\s+$/.test(plainText)) {
10317 HTML = markdownConverter(HTML);
10318 }
10319 }
10320 const pieces = shortcode_converter_default(HTML);
10321 const hasShortcodes = pieces.length > 1;
10322 if (isPlainText && !hasShortcodes) {
10323 if (mode === "AUTO" && plainText.indexOf("\n") === -1 && plainText.indexOf("<p>") !== 0 && HTML.indexOf("<p>") === 0) {
10324 mode = "INLINE";
10325 }
10326 }
10327 if (mode === "INLINE") {
10328 return filterInlineHTML(HTML);
10329 }
10330 if (mode === "AUTO" && !hasShortcodes && isInlineContent(HTML, tagName)) {
10331 return filterInlineHTML(HTML);
10332 }
10333 const phrasingContentSchema = (0, import_dom11.getPhrasingContentSchema)("paste");
10334 const blockContentSchema = getBlockContentSchema("paste");
10335 const blocks = pieces.map((piece) => {
10336 if (typeof piece !== "string") {
10337 return piece;
10338 }
10339 const filters = [
10340 googleDocsUIdRemover,
10341 msListConverter,
10342 headRemover,
10343 listReducer,
10344 imageCorrector,
10345 phrasingContentReducer,
10346 specialCommentConverter,
10347 commentRemover,
10348 iframeRemover,
10349 figureContentReducer,
10350 blockquoteNormaliser(),
10351 divNormaliser,
10352 headingTransformer
10353 ];
10354 const schema = {
10355 ...blockContentSchema,
10356 // Keep top-level phrasing content, normalised by `normaliseBlocks`.
10357 ...phrasingContentSchema
10358 };
10359 piece = deepFilterHTML(piece, filters, blockContentSchema);
10360 piece = (0, import_dom11.removeInvalidHTML)(piece, schema, false);
10361 piece = normaliseBlocks(piece);
10362 piece = deepFilterHTML(
10363 piece,
10364 [htmlFormattingRemover, brRemover, emptyParagraphRemover],
10365 blockContentSchema
10366 );
10367 log("Processed HTML piece:\n\n", piece);
10368 return htmlToBlocks(piece, pasteHandler);
10369 }).flat().filter(Boolean);
10370 if (mode === "AUTO" && blocks.length === 1 && hasBlockSupport(blocks[0].name, "__unstablePasteTextInline", false)) {
10371 const trimRegex = /^[\n]+|[\n]+$/g;
10372 const trimmedPlainText = plainText.replace(trimRegex, "");
10373 if (trimmedPlainText !== "" && trimmedPlainText.indexOf("\n") === -1) {
10374 return (0, import_dom11.removeInvalidHTML)(
10375 getBlockInnerHTML(blocks[0]),
10376 phrasingContentSchema,
10377 false
10378 ).replace(trimRegex, "");
10379 }
10380 }
10381 return blocks;
10382 }
10383
10384 // packages/blocks/build-module/api/raw-handling/index.mjs
10385 function deprecatedGetPhrasingContentSchema(context) {
10386 (0, import_deprecated10.default)("wp.blocks.getPhrasingContentSchema", {
10387 since: "5.6",
10388 alternative: "wp.dom.getPhrasingContentSchema"
10389 });
10390 return (0, import_dom12.getPhrasingContentSchema)(context);
10391 }
10392 function rawHandler({ HTML = "" }) {
10393 if (HTML.indexOf("<!-- wp:") !== -1) {
10394 const parseResult = parse2(HTML);
10395 const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform";
10396 if (!isSingleFreeFormBlock) {
10397 return parseResult;
10398 }
10399 }
10400 const pieces = shortcode_converter_default(HTML);
10401 const blockContentSchema = getBlockContentSchema();
10402 return pieces.map((piece) => {
10403 if (typeof piece !== "string") {
10404 return piece;
10405 }
10406 const filters = [
10407 // Needed to adjust invalid lists.
10408 listReducer,
10409 // Needed to create more and nextpage blocks.
10410 specialCommentConverter,
10411 // Needed to create media blocks.
10412 figureContentReducer,
10413 // Needed to create the quote block, which cannot handle text
10414 // without wrapper paragraphs.
10415 blockquoteNormaliser({ raw: true })
10416 ];
10417 piece = deepFilterHTML(piece, filters, blockContentSchema);
10418 piece = normaliseBlocks(piece, { raw: true });
10419 return htmlToBlocks(piece, rawHandler);
10420 }).flat().filter(Boolean);
10421 }
10422
10423 // packages/blocks/build-module/api/categories.mjs
10424 var import_data6 = __toESM(require_data(), 1);
10425 function getCategories2() {
10426 return (0, import_data6.select)(store).getCategories();
10427 }
10428 function setCategories2(categories2) {
10429 (0, import_data6.dispatch)(store).setCategories(categories2);
10430 }
10431 function updateCategory2(slug, category) {
10432 (0, import_data6.dispatch)(store).updateCategory(slug, category);
10433 }
10434
10435 // packages/blocks/build-module/api/templates.mjs
10436 var import_element5 = __toESM(require_element(), 1);
10437 function doBlocksMatchTemplate(blocks = [], template = []) {
10438 return blocks.length === template.length && template.every(([name, , innerBlocksTemplate], index) => {
10439 const block = blocks[index];
10440 return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate);
10441 });
10442 }
10443 var isHTMLAttribute = (attributeDefinition) => attributeDefinition?.source === "html";
10444 var isQueryAttribute = (attributeDefinition) => attributeDefinition?.source === "query";
10445 function normalizeAttributes(schema, values) {
10446 if (!values) {
10447 return {};
10448 }
10449 return Object.fromEntries(
10450 Object.entries(values).map(([key, value]) => [
10451 key,
10452 normalizeAttribute(schema[key], value)
10453 ])
10454 );
10455 }
10456 function normalizeAttribute(definition, value) {
10457 if (isHTMLAttribute(definition) && Array.isArray(value)) {
10458 return (0, import_element5.renderToString)(value);
10459 }
10460 if (isQueryAttribute(definition) && value) {
10461 return value.map(
10462 (subValues) => {
10463 return normalizeAttributes(definition.query, subValues);
10464 }
10465 );
10466 }
10467 return value;
10468 }
10469 function synchronizeBlocksWithTemplate(blocks = [], template) {
10470 if (!template) {
10471 return blocks;
10472 }
10473 return template.map(
10474 ([name, attributes, innerBlocksTemplate], index) => {
10475 const block = blocks[index];
10476 if (block && block.name === name) {
10477 const innerBlocks = synchronizeBlocksWithTemplate(
10478 block.innerBlocks,
10479 innerBlocksTemplate
10480 );
10481 return { ...block, innerBlocks };
10482 }
10483 const blockType = getBlockType(name);
10484 const normalizedAttributes = normalizeAttributes(
10485 blockType?.attributes ?? {},
10486 attributes
10487 );
10488 const [blockName, blockAttributes] = convertLegacyBlockNameAndAttributes(
10489 name,
10490 normalizedAttributes
10491 );
10492 return createBlock(
10493 blockName,
10494 blockAttributes,
10495 synchronizeBlocksWithTemplate([], innerBlocksTemplate)
10496 );
10497 }
10498 );
10499 }
10500
10501 // packages/blocks/build-module/api/index.mjs
10502 var fieldsKey = /* @__PURE__ */ Symbol("fields");
10503 var formKey = /* @__PURE__ */ Symbol("form");
10504 var privateApis = {};
10505 lock(privateApis, {
10506 isContentBlock,
10507 fieldsKey,
10508 formKey,
10509 parseRawBlock
10510 });
10511
10512 // packages/blocks/build-module/deprecated.mjs
10513 var import_deprecated11 = __toESM(require_deprecated(), 1);
10514 function withBlockContentContext(OriginalComponent) {
10515 (0, import_deprecated11.default)("wp.blocks.withBlockContentContext", {
10516 since: "6.1"
10517 });
10518 return OriginalComponent;
10519 }
10520 return __toCommonJS(index_exports);
10521 })();
10522 /*! Bundled license information:
10523
10524 react-is/cjs/react-is.development.js:
10525 (**
10526 * @license React
10527 * react-is.development.js
10528 *
10529 * Copyright (c) Facebook, Inc. and its affiliates.
10530 *
10531 * This source code is licensed under the MIT license found in the
10532 * LICENSE file in the root directory of this source tree.
10533 *)
10534
10535 showdown/dist/showdown.js:
10536 (*! showdown v 1.9.1 - 02-11-2019 *)
10537
10538 is-plain-object/dist/is-plain-object.mjs:
10539 (*!
10540 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
10541 *
10542 * Copyright (c) 2014-2017, Jon Schlinkert.
10543 * Released under the MIT License.
10544 *)
10545 */
10546 //# sourceMappingURL=index.js.map
10547