@wix/editor-react-components 1.2647.0 → 1.2648.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/site/components/AnimatedIcon/component.js +1 -1
  2. package/dist/site/components/AudioPlayer/component.js +1 -1
  3. package/dist/site/components/Breadcrumbs/component.js +1 -1
  4. package/dist/site/components/Checkbox/component.js +1 -1
  5. package/dist/site/components/CheckboxGroup/component.js +1 -1
  6. package/dist/site/components/CollapsibleText/component.js +1 -1
  7. package/dist/site/components/DatePicker/component.js +1 -1
  8. package/dist/site/components/Dropdown/component.js +1 -1
  9. package/dist/site/components/GoogleMap/component.js +2 -2
  10. package/dist/site/components/HTMLComponent/component.js +1 -1
  11. package/dist/site/components/Image3/component.js +1 -1
  12. package/dist/site/components/Line/component.js +1 -1
  13. package/dist/site/components/Lottie/component.js +1 -1
  14. package/dist/site/components/Menu/component.js +1 -1
  15. package/dist/site/components/Menu/sdk.js +1 -1
  16. package/dist/site/components/RadioButtons/component.js +1 -1
  17. package/dist/site/components/Slideshow/component.js +1 -1
  18. package/dist/site/components/SlotsPlaceholder/component.js +1 -1
  19. package/dist/site/components/Tabs/component.js +1 -1
  20. package/dist/site/components/TextBox/component.js +1 -1
  21. package/dist/site/components/TextInput/component.js +1 -1
  22. package/dist/site/components/TextMarquee/component.js +1 -1
  23. package/dist/site/components/TimePicker/component.js +1 -1
  24. package/dist/site/components/TransparentVideo/component.js +1 -1
  25. package/dist/site/components/VideoUpload/component.js +2 -2
  26. package/dist/site/components/WRichText/WRichText.types.d.ts +0 -2
  27. package/dist/site/components/WRichText/component.js +4 -44
  28. package/dist/site/components/WRichText/constants.d.ts +0 -1
  29. package/dist/site/components/WRichText/css.css +0 -17
  30. package/dist/site/components/WRichText/manifest.js +0 -18
  31. package/dist/site/components/WRichText/sdk.js +1 -1
  32. package/dist/site/components/chunks/Button.js +1 -1
  33. package/dist/site/components/chunks/constants.js +1 -2
  34. package/dist/site/components/chunks/index.js +3 -2133
  35. package/dist/site/components/chunks/index2.js +2 -2
  36. package/dist/site/components/chunks/index3.js +3 -3
  37. package/dist/site/components/chunks/index4.js +2133 -3
  38. package/dist/site/components/chunks/parseHtml.js +1 -1
  39. package/dist/site/components/chunks/parseSvg.js +1 -1
  40. package/dist/site/components/chunks/useConsentPolicyProps.js +1 -1
  41. package/package.json +2 -2
  42. package/dist/site/components/WRichText/components/demoteInlineAnchors.d.ts +0 -2
@@ -1,2135 +1,5 @@
1
- import { g as getDefaultExportFromCjs } from "./_commonjsHelpers.js";
2
- import React__default from "react";
3
- import { r as requireCjs } from "./index11.js";
4
- var lib$3 = {};
5
- var htmlToDom = {};
6
- var domparser = {};
7
- var utilities$1 = {};
8
- var lib$2 = {};
9
- var lib$1 = {};
10
- var hasRequiredLib$3;
11
- function requireLib$3() {
12
- if (hasRequiredLib$3) return lib$1;
13
- hasRequiredLib$3 = 1;
14
- (function(exports$1) {
15
- Object.defineProperty(exports$1, "__esModule", { value: true });
16
- exports$1.Doctype = exports$1.CDATA = exports$1.Tag = exports$1.Style = exports$1.Script = exports$1.Comment = exports$1.Directive = exports$1.Text = exports$1.Root = exports$1.isTag = exports$1.ElementType = void 0;
17
- var ElementType;
18
- (function(ElementType2) {
19
- ElementType2["Root"] = "root";
20
- ElementType2["Text"] = "text";
21
- ElementType2["Directive"] = "directive";
22
- ElementType2["Comment"] = "comment";
23
- ElementType2["Script"] = "script";
24
- ElementType2["Style"] = "style";
25
- ElementType2["Tag"] = "tag";
26
- ElementType2["CDATA"] = "cdata";
27
- ElementType2["Doctype"] = "doctype";
28
- })(ElementType = exports$1.ElementType || (exports$1.ElementType = {}));
29
- function isTag(elem) {
30
- return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
31
- }
32
- exports$1.isTag = isTag;
33
- exports$1.Root = ElementType.Root;
34
- exports$1.Text = ElementType.Text;
35
- exports$1.Directive = ElementType.Directive;
36
- exports$1.Comment = ElementType.Comment;
37
- exports$1.Script = ElementType.Script;
38
- exports$1.Style = ElementType.Style;
39
- exports$1.Tag = ElementType.Tag;
40
- exports$1.CDATA = ElementType.CDATA;
41
- exports$1.Doctype = ElementType.Doctype;
42
- })(lib$1);
43
- return lib$1;
44
- }
45
- var node = {};
46
- var hasRequiredNode;
47
- function requireNode() {
48
- if (hasRequiredNode) return node;
49
- hasRequiredNode = 1;
50
- var __extends = node && node.__extends || /* @__PURE__ */ (function() {
51
- var extendStatics = function(d, b) {
52
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
53
- d2.__proto__ = b2;
54
- } || function(d2, b2) {
55
- for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
56
- };
57
- return extendStatics(d, b);
58
- };
59
- return function(d, b) {
60
- if (typeof b !== "function" && b !== null)
61
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
62
- extendStatics(d, b);
63
- function __() {
64
- this.constructor = d;
65
- }
66
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
67
- };
68
- })();
69
- var __assign = node && node.__assign || function() {
70
- __assign = Object.assign || function(t) {
71
- for (var s, i = 1, n = arguments.length; i < n; i++) {
72
- s = arguments[i];
73
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
74
- t[p] = s[p];
75
- }
76
- return t;
77
- };
78
- return __assign.apply(this, arguments);
79
- };
80
- Object.defineProperty(node, "__esModule", { value: true });
81
- node.cloneNode = node.hasChildren = node.isDocument = node.isDirective = node.isComment = node.isText = node.isCDATA = node.isTag = node.Element = node.Document = node.CDATA = node.NodeWithChildren = node.ProcessingInstruction = node.Comment = node.Text = node.DataNode = node.Node = void 0;
82
- var domelementtype_1 = /* @__PURE__ */ requireLib$3();
83
- var Node = (
84
- /** @class */
85
- (function() {
86
- function Node2() {
87
- this.parent = null;
88
- this.prev = null;
89
- this.next = null;
90
- this.startIndex = null;
91
- this.endIndex = null;
92
- }
93
- Object.defineProperty(Node2.prototype, "parentNode", {
94
- // Read-write aliases for properties
95
- /**
96
- * Same as {@link parent}.
97
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
98
- */
99
- get: function() {
100
- return this.parent;
101
- },
102
- set: function(parent) {
103
- this.parent = parent;
104
- },
105
- enumerable: false,
106
- configurable: true
107
- });
108
- Object.defineProperty(Node2.prototype, "previousSibling", {
109
- /**
110
- * Same as {@link prev}.
111
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
112
- */
113
- get: function() {
114
- return this.prev;
115
- },
116
- set: function(prev) {
117
- this.prev = prev;
118
- },
119
- enumerable: false,
120
- configurable: true
121
- });
122
- Object.defineProperty(Node2.prototype, "nextSibling", {
123
- /**
124
- * Same as {@link next}.
125
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
126
- */
127
- get: function() {
128
- return this.next;
129
- },
130
- set: function(next) {
131
- this.next = next;
132
- },
133
- enumerable: false,
134
- configurable: true
135
- });
136
- Node2.prototype.cloneNode = function(recursive) {
137
- if (recursive === void 0) {
138
- recursive = false;
139
- }
140
- return cloneNode(this, recursive);
141
- };
142
- return Node2;
143
- })()
144
- );
145
- node.Node = Node;
146
- var DataNode = (
147
- /** @class */
148
- (function(_super) {
149
- __extends(DataNode2, _super);
150
- function DataNode2(data) {
151
- var _this = _super.call(this) || this;
152
- _this.data = data;
153
- return _this;
154
- }
155
- Object.defineProperty(DataNode2.prototype, "nodeValue", {
156
- /**
157
- * Same as {@link data}.
158
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
159
- */
160
- get: function() {
161
- return this.data;
162
- },
163
- set: function(data) {
164
- this.data = data;
165
- },
166
- enumerable: false,
167
- configurable: true
168
- });
169
- return DataNode2;
170
- })(Node)
171
- );
172
- node.DataNode = DataNode;
173
- var Text = (
174
- /** @class */
175
- (function(_super) {
176
- __extends(Text2, _super);
177
- function Text2() {
178
- var _this = _super !== null && _super.apply(this, arguments) || this;
179
- _this.type = domelementtype_1.ElementType.Text;
180
- return _this;
181
- }
182
- Object.defineProperty(Text2.prototype, "nodeType", {
183
- get: function() {
184
- return 3;
185
- },
186
- enumerable: false,
187
- configurable: true
188
- });
189
- return Text2;
190
- })(DataNode)
191
- );
192
- node.Text = Text;
193
- var Comment = (
194
- /** @class */
195
- (function(_super) {
196
- __extends(Comment2, _super);
197
- function Comment2() {
198
- var _this = _super !== null && _super.apply(this, arguments) || this;
199
- _this.type = domelementtype_1.ElementType.Comment;
200
- return _this;
201
- }
202
- Object.defineProperty(Comment2.prototype, "nodeType", {
203
- get: function() {
204
- return 8;
205
- },
206
- enumerable: false,
207
- configurable: true
208
- });
209
- return Comment2;
210
- })(DataNode)
211
- );
212
- node.Comment = Comment;
213
- var ProcessingInstruction = (
214
- /** @class */
215
- (function(_super) {
216
- __extends(ProcessingInstruction2, _super);
217
- function ProcessingInstruction2(name, data) {
218
- var _this = _super.call(this, data) || this;
219
- _this.name = name;
220
- _this.type = domelementtype_1.ElementType.Directive;
221
- return _this;
222
- }
223
- Object.defineProperty(ProcessingInstruction2.prototype, "nodeType", {
224
- get: function() {
225
- return 1;
226
- },
227
- enumerable: false,
228
- configurable: true
229
- });
230
- return ProcessingInstruction2;
231
- })(DataNode)
232
- );
233
- node.ProcessingInstruction = ProcessingInstruction;
234
- var NodeWithChildren = (
235
- /** @class */
236
- (function(_super) {
237
- __extends(NodeWithChildren2, _super);
238
- function NodeWithChildren2(children) {
239
- var _this = _super.call(this) || this;
240
- _this.children = children;
241
- return _this;
242
- }
243
- Object.defineProperty(NodeWithChildren2.prototype, "firstChild", {
244
- // Aliases
245
- /** First child of the node. */
246
- get: function() {
247
- var _a;
248
- return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
249
- },
250
- enumerable: false,
251
- configurable: true
252
- });
253
- Object.defineProperty(NodeWithChildren2.prototype, "lastChild", {
254
- /** Last child of the node. */
255
- get: function() {
256
- return this.children.length > 0 ? this.children[this.children.length - 1] : null;
257
- },
258
- enumerable: false,
259
- configurable: true
260
- });
261
- Object.defineProperty(NodeWithChildren2.prototype, "childNodes", {
262
- /**
263
- * Same as {@link children}.
264
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
265
- */
266
- get: function() {
267
- return this.children;
268
- },
269
- set: function(children) {
270
- this.children = children;
271
- },
272
- enumerable: false,
273
- configurable: true
274
- });
275
- return NodeWithChildren2;
276
- })(Node)
277
- );
278
- node.NodeWithChildren = NodeWithChildren;
279
- var CDATA = (
280
- /** @class */
281
- (function(_super) {
282
- __extends(CDATA2, _super);
283
- function CDATA2() {
284
- var _this = _super !== null && _super.apply(this, arguments) || this;
285
- _this.type = domelementtype_1.ElementType.CDATA;
286
- return _this;
287
- }
288
- Object.defineProperty(CDATA2.prototype, "nodeType", {
289
- get: function() {
290
- return 4;
291
- },
292
- enumerable: false,
293
- configurable: true
294
- });
295
- return CDATA2;
296
- })(NodeWithChildren)
297
- );
298
- node.CDATA = CDATA;
299
- var Document = (
300
- /** @class */
301
- (function(_super) {
302
- __extends(Document2, _super);
303
- function Document2() {
304
- var _this = _super !== null && _super.apply(this, arguments) || this;
305
- _this.type = domelementtype_1.ElementType.Root;
306
- return _this;
307
- }
308
- Object.defineProperty(Document2.prototype, "nodeType", {
309
- get: function() {
310
- return 9;
311
- },
312
- enumerable: false,
313
- configurable: true
314
- });
315
- return Document2;
316
- })(NodeWithChildren)
317
- );
318
- node.Document = Document;
319
- var Element = (
320
- /** @class */
321
- (function(_super) {
322
- __extends(Element2, _super);
323
- function Element2(name, attribs, children, type) {
324
- if (children === void 0) {
325
- children = [];
326
- }
327
- if (type === void 0) {
328
- type = name === "script" ? domelementtype_1.ElementType.Script : name === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag;
329
- }
330
- var _this = _super.call(this, children) || this;
331
- _this.name = name;
332
- _this.attribs = attribs;
333
- _this.type = type;
334
- return _this;
335
- }
336
- Object.defineProperty(Element2.prototype, "nodeType", {
337
- get: function() {
338
- return 1;
339
- },
340
- enumerable: false,
341
- configurable: true
342
- });
343
- Object.defineProperty(Element2.prototype, "tagName", {
344
- // DOM Level 1 aliases
345
- /**
346
- * Same as {@link name}.
347
- * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
348
- */
349
- get: function() {
350
- return this.name;
351
- },
352
- set: function(name) {
353
- this.name = name;
354
- },
355
- enumerable: false,
356
- configurable: true
357
- });
358
- Object.defineProperty(Element2.prototype, "attributes", {
359
- get: function() {
360
- var _this = this;
361
- return Object.keys(this.attribs).map(function(name) {
362
- var _a, _b;
363
- return {
364
- name,
365
- value: _this.attribs[name],
366
- namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
367
- prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name]
368
- };
369
- });
370
- },
371
- enumerable: false,
372
- configurable: true
373
- });
374
- return Element2;
375
- })(NodeWithChildren)
376
- );
377
- node.Element = Element;
378
- function isTag(node2) {
379
- return (0, domelementtype_1.isTag)(node2);
380
- }
381
- node.isTag = isTag;
382
- function isCDATA(node2) {
383
- return node2.type === domelementtype_1.ElementType.CDATA;
384
- }
385
- node.isCDATA = isCDATA;
386
- function isText(node2) {
387
- return node2.type === domelementtype_1.ElementType.Text;
388
- }
389
- node.isText = isText;
390
- function isComment(node2) {
391
- return node2.type === domelementtype_1.ElementType.Comment;
392
- }
393
- node.isComment = isComment;
394
- function isDirective(node2) {
395
- return node2.type === domelementtype_1.ElementType.Directive;
396
- }
397
- node.isDirective = isDirective;
398
- function isDocument(node2) {
399
- return node2.type === domelementtype_1.ElementType.Root;
400
- }
401
- node.isDocument = isDocument;
402
- function hasChildren(node2) {
403
- return Object.prototype.hasOwnProperty.call(node2, "children");
404
- }
405
- node.hasChildren = hasChildren;
406
- function cloneNode(node2, recursive) {
407
- if (recursive === void 0) {
408
- recursive = false;
409
- }
410
- var result;
411
- if (isText(node2)) {
412
- result = new Text(node2.data);
413
- } else if (isComment(node2)) {
414
- result = new Comment(node2.data);
415
- } else if (isTag(node2)) {
416
- var children = recursive ? cloneChildren(node2.children) : [];
417
- var clone_1 = new Element(node2.name, __assign({}, node2.attribs), children);
418
- children.forEach(function(child) {
419
- return child.parent = clone_1;
420
- });
421
- if (node2.namespace != null) {
422
- clone_1.namespace = node2.namespace;
423
- }
424
- if (node2["x-attribsNamespace"]) {
425
- clone_1["x-attribsNamespace"] = __assign({}, node2["x-attribsNamespace"]);
426
- }
427
- if (node2["x-attribsPrefix"]) {
428
- clone_1["x-attribsPrefix"] = __assign({}, node2["x-attribsPrefix"]);
429
- }
430
- result = clone_1;
431
- } else if (isCDATA(node2)) {
432
- var children = recursive ? cloneChildren(node2.children) : [];
433
- var clone_2 = new CDATA(children);
434
- children.forEach(function(child) {
435
- return child.parent = clone_2;
436
- });
437
- result = clone_2;
438
- } else if (isDocument(node2)) {
439
- var children = recursive ? cloneChildren(node2.children) : [];
440
- var clone_3 = new Document(children);
441
- children.forEach(function(child) {
442
- return child.parent = clone_3;
443
- });
444
- if (node2["x-mode"]) {
445
- clone_3["x-mode"] = node2["x-mode"];
446
- }
447
- result = clone_3;
448
- } else if (isDirective(node2)) {
449
- var instruction = new ProcessingInstruction(node2.name, node2.data);
450
- if (node2["x-name"] != null) {
451
- instruction["x-name"] = node2["x-name"];
452
- instruction["x-publicId"] = node2["x-publicId"];
453
- instruction["x-systemId"] = node2["x-systemId"];
454
- }
455
- result = instruction;
456
- } else {
457
- throw new Error("Not implemented yet: ".concat(node2.type));
458
- }
459
- result.startIndex = node2.startIndex;
460
- result.endIndex = node2.endIndex;
461
- if (node2.sourceCodeLocation != null) {
462
- result.sourceCodeLocation = node2.sourceCodeLocation;
463
- }
464
- return result;
465
- }
466
- node.cloneNode = cloneNode;
467
- function cloneChildren(childs) {
468
- var children = childs.map(function(child) {
469
- return cloneNode(child, true);
470
- });
471
- for (var i = 1; i < children.length; i++) {
472
- children[i].prev = children[i - 1];
473
- children[i - 1].next = children[i];
474
- }
475
- return children;
476
- }
477
- return node;
478
- }
479
- var hasRequiredLib$2;
480
- function requireLib$2() {
481
- if (hasRequiredLib$2) return lib$2;
482
- hasRequiredLib$2 = 1;
483
- (function(exports$1) {
484
- var __createBinding = lib$2 && lib$2.__createBinding || (Object.create ? (function(o, m, k, k2) {
485
- if (k2 === void 0) k2 = k;
486
- var desc = Object.getOwnPropertyDescriptor(m, k);
487
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
488
- desc = { enumerable: true, get: function() {
489
- return m[k];
490
- } };
491
- }
492
- Object.defineProperty(o, k2, desc);
493
- }) : (function(o, m, k, k2) {
494
- if (k2 === void 0) k2 = k;
495
- o[k2] = m[k];
496
- }));
497
- var __exportStar = lib$2 && lib$2.__exportStar || function(m, exports$12) {
498
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$12, p)) __createBinding(exports$12, m, p);
499
- };
500
- Object.defineProperty(exports$1, "__esModule", { value: true });
501
- exports$1.DomHandler = void 0;
502
- var domelementtype_1 = /* @__PURE__ */ requireLib$3();
503
- var node_js_1 = /* @__PURE__ */ requireNode();
504
- __exportStar(/* @__PURE__ */ requireNode(), exports$1);
505
- var defaultOpts = {
506
- withStartIndices: false,
507
- withEndIndices: false,
508
- xmlMode: false
509
- };
510
- var DomHandler = (
511
- /** @class */
512
- (function() {
513
- function DomHandler2(callback, options, elementCB) {
514
- this.dom = [];
515
- this.root = new node_js_1.Document(this.dom);
516
- this.done = false;
517
- this.tagStack = [this.root];
518
- this.lastNode = null;
519
- this.parser = null;
520
- if (typeof options === "function") {
521
- elementCB = options;
522
- options = defaultOpts;
523
- }
524
- if (typeof callback === "object") {
525
- options = callback;
526
- callback = void 0;
527
- }
528
- this.callback = callback !== null && callback !== void 0 ? callback : null;
529
- this.options = options !== null && options !== void 0 ? options : defaultOpts;
530
- this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
531
- }
532
- DomHandler2.prototype.onparserinit = function(parser) {
533
- this.parser = parser;
534
- };
535
- DomHandler2.prototype.onreset = function() {
536
- this.dom = [];
537
- this.root = new node_js_1.Document(this.dom);
538
- this.done = false;
539
- this.tagStack = [this.root];
540
- this.lastNode = null;
541
- this.parser = null;
542
- };
543
- DomHandler2.prototype.onend = function() {
544
- if (this.done)
545
- return;
546
- this.done = true;
547
- this.parser = null;
548
- this.handleCallback(null);
549
- };
550
- DomHandler2.prototype.onerror = function(error) {
551
- this.handleCallback(error);
552
- };
553
- DomHandler2.prototype.onclosetag = function() {
554
- this.lastNode = null;
555
- var elem = this.tagStack.pop();
556
- if (this.options.withEndIndices) {
557
- elem.endIndex = this.parser.endIndex;
558
- }
559
- if (this.elementCB)
560
- this.elementCB(elem);
561
- };
562
- DomHandler2.prototype.onopentag = function(name, attribs) {
563
- var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : void 0;
564
- var element = new node_js_1.Element(name, attribs, void 0, type);
565
- this.addNode(element);
566
- this.tagStack.push(element);
567
- };
568
- DomHandler2.prototype.ontext = function(data) {
569
- var lastNode = this.lastNode;
570
- if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
571
- lastNode.data += data;
572
- if (this.options.withEndIndices) {
573
- lastNode.endIndex = this.parser.endIndex;
574
- }
575
- } else {
576
- var node2 = new node_js_1.Text(data);
577
- this.addNode(node2);
578
- this.lastNode = node2;
579
- }
580
- };
581
- DomHandler2.prototype.oncomment = function(data) {
582
- if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
583
- this.lastNode.data += data;
584
- return;
585
- }
586
- var node2 = new node_js_1.Comment(data);
587
- this.addNode(node2);
588
- this.lastNode = node2;
589
- };
590
- DomHandler2.prototype.oncommentend = function() {
591
- this.lastNode = null;
592
- };
593
- DomHandler2.prototype.oncdatastart = function() {
594
- var text = new node_js_1.Text("");
595
- var node2 = new node_js_1.CDATA([text]);
596
- this.addNode(node2);
597
- text.parent = node2;
598
- this.lastNode = text;
599
- };
600
- DomHandler2.prototype.oncdataend = function() {
601
- this.lastNode = null;
602
- };
603
- DomHandler2.prototype.onprocessinginstruction = function(name, data) {
604
- var node2 = new node_js_1.ProcessingInstruction(name, data);
605
- this.addNode(node2);
606
- };
607
- DomHandler2.prototype.handleCallback = function(error) {
608
- if (typeof this.callback === "function") {
609
- this.callback(error, this.dom);
610
- } else if (error) {
611
- throw error;
612
- }
613
- };
614
- DomHandler2.prototype.addNode = function(node2) {
615
- var parent = this.tagStack[this.tagStack.length - 1];
616
- var previousSibling = parent.children[parent.children.length - 1];
617
- if (this.options.withStartIndices) {
618
- node2.startIndex = this.parser.startIndex;
619
- }
620
- if (this.options.withEndIndices) {
621
- node2.endIndex = this.parser.endIndex;
622
- }
623
- parent.children.push(node2);
624
- if (previousSibling) {
625
- node2.prev = previousSibling;
626
- previousSibling.next = node2;
627
- }
628
- node2.parent = parent;
629
- this.lastNode = null;
630
- };
631
- return DomHandler2;
632
- })()
633
- );
634
- exports$1.DomHandler = DomHandler;
635
- exports$1.default = DomHandler;
636
- })(lib$2);
637
- return lib$2;
638
- }
639
- var constants = {};
640
- var hasRequiredConstants;
641
- function requireConstants() {
642
- if (hasRequiredConstants) return constants;
643
- hasRequiredConstants = 1;
644
- (function(exports$1) {
645
- Object.defineProperty(exports$1, "__esModule", { value: true });
646
- exports$1.CARRIAGE_RETURN_PLACEHOLDER_REGEX = exports$1.CARRIAGE_RETURN_PLACEHOLDER = exports$1.CARRIAGE_RETURN_REGEX = exports$1.CARRIAGE_RETURN = exports$1.CASE_SENSITIVE_TAG_NAMES_MAP = exports$1.CASE_SENSITIVE_TAG_NAMES = void 0;
647
- exports$1.CASE_SENSITIVE_TAG_NAMES = [
648
- "animateMotion",
649
- "animateTransform",
650
- "clipPath",
651
- "feBlend",
652
- "feColorMatrix",
653
- "feComponentTransfer",
654
- "feComposite",
655
- "feConvolveMatrix",
656
- "feDiffuseLighting",
657
- "feDisplacementMap",
658
- "feDropShadow",
659
- "feFlood",
660
- "feFuncA",
661
- "feFuncB",
662
- "feFuncG",
663
- "feFuncR",
664
- "feGaussianBlur",
665
- "feImage",
666
- "feMerge",
667
- "feMergeNode",
668
- "feMorphology",
669
- "feOffset",
670
- "fePointLight",
671
- "feSpecularLighting",
672
- "feSpotLight",
673
- "feTile",
674
- "feTurbulence",
675
- "foreignObject",
676
- "linearGradient",
677
- "radialGradient",
678
- "textPath"
679
- ];
680
- exports$1.CASE_SENSITIVE_TAG_NAMES_MAP = exports$1.CASE_SENSITIVE_TAG_NAMES.reduce(function(accumulator, tagName) {
681
- accumulator[tagName.toLowerCase()] = tagName;
682
- return accumulator;
683
- }, {});
684
- exports$1.CARRIAGE_RETURN = "\r";
685
- exports$1.CARRIAGE_RETURN_REGEX = new RegExp(exports$1.CARRIAGE_RETURN, "g");
686
- exports$1.CARRIAGE_RETURN_PLACEHOLDER = "__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(), "__");
687
- exports$1.CARRIAGE_RETURN_PLACEHOLDER_REGEX = new RegExp(exports$1.CARRIAGE_RETURN_PLACEHOLDER, "g");
688
- })(constants);
689
- return constants;
690
- }
691
- var hasRequiredUtilities$1;
692
- function requireUtilities$1() {
693
- if (hasRequiredUtilities$1) return utilities$1;
694
- hasRequiredUtilities$1 = 1;
695
- Object.defineProperty(utilities$1, "__esModule", { value: true });
696
- utilities$1.formatAttributes = formatAttributes;
697
- utilities$1.escapeSpecialCharacters = escapeSpecialCharacters;
698
- utilities$1.revertEscapedCharacters = revertEscapedCharacters;
699
- utilities$1.formatDOM = formatDOM;
700
- var domhandler_1 = /* @__PURE__ */ requireLib$2();
701
- var constants_1 = requireConstants();
702
- function getCaseSensitiveTagName(tagName) {
703
- return constants_1.CASE_SENSITIVE_TAG_NAMES_MAP[tagName];
704
- }
705
- function formatAttributes(attributes) {
706
- var map = {};
707
- var index = 0;
708
- var attributesLength = attributes.length;
709
- for (; index < attributesLength; index++) {
710
- var attribute = attributes[index];
711
- map[attribute.name] = attribute.value;
712
- }
713
- return map;
714
- }
715
- function formatTagName(tagName) {
716
- tagName = tagName.toLowerCase();
717
- var caseSensitiveTagName = getCaseSensitiveTagName(tagName);
718
- if (caseSensitiveTagName) {
719
- return caseSensitiveTagName;
720
- }
721
- return tagName;
722
- }
723
- function escapeSpecialCharacters(html) {
724
- return html.replace(constants_1.CARRIAGE_RETURN_REGEX, constants_1.CARRIAGE_RETURN_PLACEHOLDER);
725
- }
726
- function revertEscapedCharacters(text) {
727
- return text.replace(constants_1.CARRIAGE_RETURN_PLACEHOLDER_REGEX, constants_1.CARRIAGE_RETURN);
728
- }
729
- function formatDOM(nodes, parent, directive) {
730
- if (parent === void 0) {
731
- parent = null;
732
- }
733
- var domNodes = [];
734
- var current;
735
- var index = 0;
736
- var nodesLength = nodes.length;
737
- for (; index < nodesLength; index++) {
738
- var node2 = nodes[index];
739
- switch (node2.nodeType) {
740
- case 1: {
741
- var tagName = formatTagName(node2.nodeName);
742
- current = new domhandler_1.Element(tagName, formatAttributes(node2.attributes));
743
- current.children = formatDOM(
744
- // template children are on content
745
- tagName === "template" ? node2.content.childNodes : node2.childNodes,
746
- current
747
- );
748
- break;
749
- }
750
- case 3:
751
- current = new domhandler_1.Text(revertEscapedCharacters(node2.nodeValue));
752
- break;
753
- case 8:
754
- current = new domhandler_1.Comment(node2.nodeValue);
755
- break;
756
- default:
757
- continue;
758
- }
759
- var prev = domNodes[index - 1] || null;
760
- if (prev) {
761
- prev.next = current;
762
- }
763
- current.parent = parent;
764
- current.prev = prev;
765
- current.next = null;
766
- domNodes.push(current);
767
- }
768
- if (directive) {
769
- current = new domhandler_1.ProcessingInstruction(directive.substring(0, directive.indexOf(" ")).toLowerCase(), directive);
770
- current.next = domNodes[0] || null;
771
- current.parent = parent;
772
- domNodes.unshift(current);
773
- if (domNodes[1]) {
774
- domNodes[1].prev = domNodes[0];
775
- }
776
- }
777
- return domNodes;
778
- }
779
- return utilities$1;
780
- }
781
- var hasRequiredDomparser;
782
- function requireDomparser() {
783
- if (hasRequiredDomparser) return domparser;
784
- hasRequiredDomparser = 1;
785
- Object.defineProperty(domparser, "__esModule", { value: true });
786
- domparser.default = domparser$1;
787
- var utilities_1 = requireUtilities$1();
788
- var HTML = "html";
789
- var HEAD = "head";
790
- var BODY = "body";
791
- var FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/;
792
- var HEAD_TAG_REGEX = /<head[^]*>/i;
793
- var BODY_TAG_REGEX = /<body[^]*>/i;
794
- var parseFromDocument = function(html, tagName) {
795
- throw new Error("This browser does not support `document.implementation.createHTMLDocument`");
796
- };
797
- var parseFromString = function(html, tagName) {
798
- throw new Error("This browser does not support `DOMParser.prototype.parseFromString`");
799
- };
800
- var DOMParser = typeof window === "object" && window.DOMParser;
801
- if (typeof DOMParser === "function") {
802
- var domParser_1 = new DOMParser();
803
- var mimeType_1 = "text/html";
804
- parseFromString = function(html, tagName) {
805
- if (tagName) {
806
- html = "<".concat(tagName, ">").concat(html, "</").concat(tagName, ">");
807
- }
808
- return domParser_1.parseFromString(html, mimeType_1);
809
- };
810
- parseFromDocument = parseFromString;
811
- }
812
- if (typeof document === "object" && document.implementation) {
813
- var htmlDocument_1 = document.implementation.createHTMLDocument();
814
- parseFromDocument = function(html, tagName) {
815
- if (tagName) {
816
- var element = htmlDocument_1.documentElement.querySelector(tagName);
817
- if (element) {
818
- element.innerHTML = html;
819
- }
820
- return htmlDocument_1;
821
- }
822
- htmlDocument_1.documentElement.innerHTML = html;
823
- return htmlDocument_1;
824
- };
825
- }
826
- var template = typeof document === "object" && document.createElement("template");
827
- var parseFromTemplate;
828
- if (template && template.content) {
829
- parseFromTemplate = function(html) {
830
- template.innerHTML = html;
831
- return template.content.childNodes;
832
- };
833
- }
834
- function domparser$1(html) {
835
- var _a, _b;
836
- html = (0, utilities_1.escapeSpecialCharacters)(html);
837
- var match = html.match(FIRST_TAG_REGEX);
838
- var firstTagName = match && match[1] ? match[1].toLowerCase() : "";
839
- switch (firstTagName) {
840
- case HTML: {
841
- var doc = parseFromString(html);
842
- if (!HEAD_TAG_REGEX.test(html)) {
843
- var element = doc.querySelector(HEAD);
844
- (_a = element === null || element === void 0 ? void 0 : element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(element);
845
- }
846
- if (!BODY_TAG_REGEX.test(html)) {
847
- var element = doc.querySelector(BODY);
848
- (_b = element === null || element === void 0 ? void 0 : element.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(element);
849
- }
850
- return doc.querySelectorAll(HTML);
851
- }
852
- case HEAD:
853
- case BODY: {
854
- var elements = parseFromDocument(html).querySelectorAll(firstTagName);
855
- if (BODY_TAG_REGEX.test(html) && HEAD_TAG_REGEX.test(html)) {
856
- return elements[0].parentNode.childNodes;
857
- }
858
- return elements;
859
- }
860
- // low-level tag or text
861
- default: {
862
- if (parseFromTemplate) {
863
- return parseFromTemplate(html);
864
- }
865
- var element = parseFromDocument(html, BODY).querySelector(BODY);
866
- return element.childNodes;
867
- }
868
- }
869
- }
870
- return domparser;
871
- }
872
- var hasRequiredHtmlToDom;
873
- function requireHtmlToDom() {
874
- if (hasRequiredHtmlToDom) return htmlToDom;
875
- hasRequiredHtmlToDom = 1;
876
- var __importDefault = htmlToDom && htmlToDom.__importDefault || function(mod) {
877
- return mod && mod.__esModule ? mod : { "default": mod };
878
- };
879
- Object.defineProperty(htmlToDom, "__esModule", { value: true });
880
- htmlToDom.default = HTMLDOMParser;
881
- var domparser_1 = __importDefault(requireDomparser());
882
- var utilities_1 = requireUtilities$1();
883
- var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/;
884
- function HTMLDOMParser(html) {
885
- if (typeof html !== "string") {
886
- throw new TypeError("First argument must be a string");
887
- }
888
- if (!html) {
889
- return [];
890
- }
891
- var match = html.match(DIRECTIVE_REGEX);
892
- var directive = match ? match[1] : void 0;
893
- return (0, utilities_1.formatDOM)((0, domparser_1.default)(html), null, directive);
894
- }
895
- return htmlToDom;
896
- }
897
- var attributesToProps = {};
898
- var lib = {};
899
- var possibleStandardNamesOptimized = {};
900
- var hasRequiredPossibleStandardNamesOptimized;
901
- function requirePossibleStandardNamesOptimized() {
902
- if (hasRequiredPossibleStandardNamesOptimized) return possibleStandardNamesOptimized;
903
- hasRequiredPossibleStandardNamesOptimized = 1;
904
- var SAME = 0;
905
- possibleStandardNamesOptimized.SAME = SAME;
906
- var CAMELCASE = 1;
907
- possibleStandardNamesOptimized.CAMELCASE = CAMELCASE;
908
- possibleStandardNamesOptimized.possibleStandardNames = {
909
- accept: 0,
910
- acceptCharset: 1,
911
- "accept-charset": "acceptCharset",
912
- accessKey: 1,
913
- action: 0,
914
- allowFullScreen: 1,
915
- alt: 0,
916
- as: 0,
917
- async: 0,
918
- autoCapitalize: 1,
919
- autoComplete: 1,
920
- autoCorrect: 1,
921
- autoFocus: 1,
922
- autoPlay: 1,
923
- autoSave: 1,
924
- capture: 0,
925
- cellPadding: 1,
926
- cellSpacing: 1,
927
- challenge: 0,
928
- charSet: 1,
929
- checked: 0,
930
- children: 0,
931
- cite: 0,
932
- class: "className",
933
- classID: 1,
934
- className: 1,
935
- cols: 0,
936
- colSpan: 1,
937
- content: 0,
938
- contentEditable: 1,
939
- contextMenu: 1,
940
- controls: 0,
941
- controlsList: 1,
942
- coords: 0,
943
- crossOrigin: 1,
944
- dangerouslySetInnerHTML: 1,
945
- data: 0,
946
- dateTime: 1,
947
- default: 0,
948
- defaultChecked: 1,
949
- defaultValue: 1,
950
- defer: 0,
951
- dir: 0,
952
- disabled: 0,
953
- disablePictureInPicture: 1,
954
- disableRemotePlayback: 1,
955
- download: 0,
956
- draggable: 0,
957
- encType: 1,
958
- enterKeyHint: 1,
959
- for: "htmlFor",
960
- form: 0,
961
- formMethod: 1,
962
- formAction: 1,
963
- formEncType: 1,
964
- formNoValidate: 1,
965
- formTarget: 1,
966
- frameBorder: 1,
967
- headers: 0,
968
- height: 0,
969
- hidden: 0,
970
- high: 0,
971
- href: 0,
972
- hrefLang: 1,
973
- htmlFor: 1,
974
- httpEquiv: 1,
975
- "http-equiv": "httpEquiv",
976
- icon: 0,
977
- id: 0,
978
- innerHTML: 1,
979
- inputMode: 1,
980
- integrity: 0,
981
- is: 0,
982
- itemID: 1,
983
- itemProp: 1,
984
- itemRef: 1,
985
- itemScope: 1,
986
- itemType: 1,
987
- keyParams: 1,
988
- keyType: 1,
989
- kind: 0,
990
- label: 0,
991
- lang: 0,
992
- list: 0,
993
- loop: 0,
994
- low: 0,
995
- manifest: 0,
996
- marginWidth: 1,
997
- marginHeight: 1,
998
- max: 0,
999
- maxLength: 1,
1000
- media: 0,
1001
- mediaGroup: 1,
1002
- method: 0,
1003
- min: 0,
1004
- minLength: 1,
1005
- multiple: 0,
1006
- muted: 0,
1007
- name: 0,
1008
- noModule: 1,
1009
- nonce: 0,
1010
- noValidate: 1,
1011
- open: 0,
1012
- optimum: 0,
1013
- pattern: 0,
1014
- placeholder: 0,
1015
- playsInline: 1,
1016
- poster: 0,
1017
- preload: 0,
1018
- profile: 0,
1019
- radioGroup: 1,
1020
- readOnly: 1,
1021
- referrerPolicy: 1,
1022
- rel: 0,
1023
- required: 0,
1024
- reversed: 0,
1025
- role: 0,
1026
- rows: 0,
1027
- rowSpan: 1,
1028
- sandbox: 0,
1029
- scope: 0,
1030
- scoped: 0,
1031
- scrolling: 0,
1032
- seamless: 0,
1033
- selected: 0,
1034
- shape: 0,
1035
- size: 0,
1036
- sizes: 0,
1037
- span: 0,
1038
- spellCheck: 1,
1039
- src: 0,
1040
- srcDoc: 1,
1041
- srcLang: 1,
1042
- srcSet: 1,
1043
- start: 0,
1044
- step: 0,
1045
- style: 0,
1046
- summary: 0,
1047
- tabIndex: 1,
1048
- target: 0,
1049
- title: 0,
1050
- type: 0,
1051
- useMap: 1,
1052
- value: 0,
1053
- width: 0,
1054
- wmode: 0,
1055
- wrap: 0,
1056
- about: 0,
1057
- accentHeight: 1,
1058
- "accent-height": "accentHeight",
1059
- accumulate: 0,
1060
- additive: 0,
1061
- alignmentBaseline: 1,
1062
- "alignment-baseline": "alignmentBaseline",
1063
- allowReorder: 1,
1064
- alphabetic: 0,
1065
- amplitude: 0,
1066
- arabicForm: 1,
1067
- "arabic-form": "arabicForm",
1068
- ascent: 0,
1069
- attributeName: 1,
1070
- attributeType: 1,
1071
- autoReverse: 1,
1072
- azimuth: 0,
1073
- baseFrequency: 1,
1074
- baselineShift: 1,
1075
- "baseline-shift": "baselineShift",
1076
- baseProfile: 1,
1077
- bbox: 0,
1078
- begin: 0,
1079
- bias: 0,
1080
- by: 0,
1081
- calcMode: 1,
1082
- capHeight: 1,
1083
- "cap-height": "capHeight",
1084
- clip: 0,
1085
- clipPath: 1,
1086
- "clip-path": "clipPath",
1087
- clipPathUnits: 1,
1088
- clipRule: 1,
1089
- "clip-rule": "clipRule",
1090
- color: 0,
1091
- colorInterpolation: 1,
1092
- "color-interpolation": "colorInterpolation",
1093
- colorInterpolationFilters: 1,
1094
- "color-interpolation-filters": "colorInterpolationFilters",
1095
- colorProfile: 1,
1096
- "color-profile": "colorProfile",
1097
- colorRendering: 1,
1098
- "color-rendering": "colorRendering",
1099
- contentScriptType: 1,
1100
- contentStyleType: 1,
1101
- cursor: 0,
1102
- cx: 0,
1103
- cy: 0,
1104
- d: 0,
1105
- datatype: 0,
1106
- decelerate: 0,
1107
- descent: 0,
1108
- diffuseConstant: 1,
1109
- direction: 0,
1110
- display: 0,
1111
- divisor: 0,
1112
- dominantBaseline: 1,
1113
- "dominant-baseline": "dominantBaseline",
1114
- dur: 0,
1115
- dx: 0,
1116
- dy: 0,
1117
- edgeMode: 1,
1118
- elevation: 0,
1119
- enableBackground: 1,
1120
- "enable-background": "enableBackground",
1121
- end: 0,
1122
- exponent: 0,
1123
- externalResourcesRequired: 1,
1124
- fill: 0,
1125
- fillOpacity: 1,
1126
- "fill-opacity": "fillOpacity",
1127
- fillRule: 1,
1128
- "fill-rule": "fillRule",
1129
- filter: 0,
1130
- filterRes: 1,
1131
- filterUnits: 1,
1132
- floodOpacity: 1,
1133
- "flood-opacity": "floodOpacity",
1134
- floodColor: 1,
1135
- "flood-color": "floodColor",
1136
- focusable: 0,
1137
- fontFamily: 1,
1138
- "font-family": "fontFamily",
1139
- fontSize: 1,
1140
- "font-size": "fontSize",
1141
- fontSizeAdjust: 1,
1142
- "font-size-adjust": "fontSizeAdjust",
1143
- fontStretch: 1,
1144
- "font-stretch": "fontStretch",
1145
- fontStyle: 1,
1146
- "font-style": "fontStyle",
1147
- fontVariant: 1,
1148
- "font-variant": "fontVariant",
1149
- fontWeight: 1,
1150
- "font-weight": "fontWeight",
1151
- format: 0,
1152
- from: 0,
1153
- fx: 0,
1154
- fy: 0,
1155
- g1: 0,
1156
- g2: 0,
1157
- glyphName: 1,
1158
- "glyph-name": "glyphName",
1159
- glyphOrientationHorizontal: 1,
1160
- "glyph-orientation-horizontal": "glyphOrientationHorizontal",
1161
- glyphOrientationVertical: 1,
1162
- "glyph-orientation-vertical": "glyphOrientationVertical",
1163
- glyphRef: 1,
1164
- gradientTransform: 1,
1165
- gradientUnits: 1,
1166
- hanging: 0,
1167
- horizAdvX: 1,
1168
- "horiz-adv-x": "horizAdvX",
1169
- horizOriginX: 1,
1170
- "horiz-origin-x": "horizOriginX",
1171
- ideographic: 0,
1172
- imageRendering: 1,
1173
- "image-rendering": "imageRendering",
1174
- in2: 0,
1175
- in: 0,
1176
- inlist: 0,
1177
- intercept: 0,
1178
- k1: 0,
1179
- k2: 0,
1180
- k3: 0,
1181
- k4: 0,
1182
- k: 0,
1183
- kernelMatrix: 1,
1184
- kernelUnitLength: 1,
1185
- kerning: 0,
1186
- keyPoints: 1,
1187
- keySplines: 1,
1188
- keyTimes: 1,
1189
- lengthAdjust: 1,
1190
- letterSpacing: 1,
1191
- "letter-spacing": "letterSpacing",
1192
- lightingColor: 1,
1193
- "lighting-color": "lightingColor",
1194
- limitingConeAngle: 1,
1195
- local: 0,
1196
- markerEnd: 1,
1197
- "marker-end": "markerEnd",
1198
- markerHeight: 1,
1199
- markerMid: 1,
1200
- "marker-mid": "markerMid",
1201
- markerStart: 1,
1202
- "marker-start": "markerStart",
1203
- markerUnits: 1,
1204
- markerWidth: 1,
1205
- mask: 0,
1206
- maskContentUnits: 1,
1207
- maskUnits: 1,
1208
- mathematical: 0,
1209
- mode: 0,
1210
- numOctaves: 1,
1211
- offset: 0,
1212
- opacity: 0,
1213
- operator: 0,
1214
- order: 0,
1215
- orient: 0,
1216
- orientation: 0,
1217
- origin: 0,
1218
- overflow: 0,
1219
- overlinePosition: 1,
1220
- "overline-position": "overlinePosition",
1221
- overlineThickness: 1,
1222
- "overline-thickness": "overlineThickness",
1223
- paintOrder: 1,
1224
- "paint-order": "paintOrder",
1225
- panose1: 0,
1226
- "panose-1": "panose1",
1227
- pathLength: 1,
1228
- patternContentUnits: 1,
1229
- patternTransform: 1,
1230
- patternUnits: 1,
1231
- pointerEvents: 1,
1232
- "pointer-events": "pointerEvents",
1233
- points: 0,
1234
- pointsAtX: 1,
1235
- pointsAtY: 1,
1236
- pointsAtZ: 1,
1237
- prefix: 0,
1238
- preserveAlpha: 1,
1239
- preserveAspectRatio: 1,
1240
- primitiveUnits: 1,
1241
- property: 0,
1242
- r: 0,
1243
- radius: 0,
1244
- refX: 1,
1245
- refY: 1,
1246
- renderingIntent: 1,
1247
- "rendering-intent": "renderingIntent",
1248
- repeatCount: 1,
1249
- repeatDur: 1,
1250
- requiredExtensions: 1,
1251
- requiredFeatures: 1,
1252
- resource: 0,
1253
- restart: 0,
1254
- result: 0,
1255
- results: 0,
1256
- rotate: 0,
1257
- rx: 0,
1258
- ry: 0,
1259
- scale: 0,
1260
- security: 0,
1261
- seed: 0,
1262
- shapeRendering: 1,
1263
- "shape-rendering": "shapeRendering",
1264
- slope: 0,
1265
- spacing: 0,
1266
- specularConstant: 1,
1267
- specularExponent: 1,
1268
- speed: 0,
1269
- spreadMethod: 1,
1270
- startOffset: 1,
1271
- stdDeviation: 1,
1272
- stemh: 0,
1273
- stemv: 0,
1274
- stitchTiles: 1,
1275
- stopColor: 1,
1276
- "stop-color": "stopColor",
1277
- stopOpacity: 1,
1278
- "stop-opacity": "stopOpacity",
1279
- strikethroughPosition: 1,
1280
- "strikethrough-position": "strikethroughPosition",
1281
- strikethroughThickness: 1,
1282
- "strikethrough-thickness": "strikethroughThickness",
1283
- string: 0,
1284
- stroke: 0,
1285
- strokeDasharray: 1,
1286
- "stroke-dasharray": "strokeDasharray",
1287
- strokeDashoffset: 1,
1288
- "stroke-dashoffset": "strokeDashoffset",
1289
- strokeLinecap: 1,
1290
- "stroke-linecap": "strokeLinecap",
1291
- strokeLinejoin: 1,
1292
- "stroke-linejoin": "strokeLinejoin",
1293
- strokeMiterlimit: 1,
1294
- "stroke-miterlimit": "strokeMiterlimit",
1295
- strokeWidth: 1,
1296
- "stroke-width": "strokeWidth",
1297
- strokeOpacity: 1,
1298
- "stroke-opacity": "strokeOpacity",
1299
- suppressContentEditableWarning: 1,
1300
- suppressHydrationWarning: 1,
1301
- surfaceScale: 1,
1302
- systemLanguage: 1,
1303
- tableValues: 1,
1304
- targetX: 1,
1305
- targetY: 1,
1306
- textAnchor: 1,
1307
- "text-anchor": "textAnchor",
1308
- textDecoration: 1,
1309
- "text-decoration": "textDecoration",
1310
- textLength: 1,
1311
- textRendering: 1,
1312
- "text-rendering": "textRendering",
1313
- to: 0,
1314
- transform: 0,
1315
- typeof: 0,
1316
- u1: 0,
1317
- u2: 0,
1318
- underlinePosition: 1,
1319
- "underline-position": "underlinePosition",
1320
- underlineThickness: 1,
1321
- "underline-thickness": "underlineThickness",
1322
- unicode: 0,
1323
- unicodeBidi: 1,
1324
- "unicode-bidi": "unicodeBidi",
1325
- unicodeRange: 1,
1326
- "unicode-range": "unicodeRange",
1327
- unitsPerEm: 1,
1328
- "units-per-em": "unitsPerEm",
1329
- unselectable: 0,
1330
- vAlphabetic: 1,
1331
- "v-alphabetic": "vAlphabetic",
1332
- values: 0,
1333
- vectorEffect: 1,
1334
- "vector-effect": "vectorEffect",
1335
- version: 0,
1336
- vertAdvY: 1,
1337
- "vert-adv-y": "vertAdvY",
1338
- vertOriginX: 1,
1339
- "vert-origin-x": "vertOriginX",
1340
- vertOriginY: 1,
1341
- "vert-origin-y": "vertOriginY",
1342
- vHanging: 1,
1343
- "v-hanging": "vHanging",
1344
- vIdeographic: 1,
1345
- "v-ideographic": "vIdeographic",
1346
- viewBox: 1,
1347
- viewTarget: 1,
1348
- visibility: 0,
1349
- vMathematical: 1,
1350
- "v-mathematical": "vMathematical",
1351
- vocab: 0,
1352
- widths: 0,
1353
- wordSpacing: 1,
1354
- "word-spacing": "wordSpacing",
1355
- writingMode: 1,
1356
- "writing-mode": "writingMode",
1357
- x1: 0,
1358
- x2: 0,
1359
- x: 0,
1360
- xChannelSelector: 1,
1361
- xHeight: 1,
1362
- "x-height": "xHeight",
1363
- xlinkActuate: 1,
1364
- "xlink:actuate": "xlinkActuate",
1365
- xlinkArcrole: 1,
1366
- "xlink:arcrole": "xlinkArcrole",
1367
- xlinkHref: 1,
1368
- "xlink:href": "xlinkHref",
1369
- xlinkRole: 1,
1370
- "xlink:role": "xlinkRole",
1371
- xlinkShow: 1,
1372
- "xlink:show": "xlinkShow",
1373
- xlinkTitle: 1,
1374
- "xlink:title": "xlinkTitle",
1375
- xlinkType: 1,
1376
- "xlink:type": "xlinkType",
1377
- xmlBase: 1,
1378
- "xml:base": "xmlBase",
1379
- xmlLang: 1,
1380
- "xml:lang": "xmlLang",
1381
- xmlns: 0,
1382
- "xml:space": "xmlSpace",
1383
- xmlnsXlink: 1,
1384
- "xmlns:xlink": "xmlnsXlink",
1385
- xmlSpace: 1,
1386
- y1: 0,
1387
- y2: 0,
1388
- y: 0,
1389
- yChannelSelector: 1,
1390
- z: 0,
1391
- zoomAndPan: 1
1392
- };
1393
- return possibleStandardNamesOptimized;
1394
- }
1395
- var hasRequiredLib$1;
1396
- function requireLib$1() {
1397
- if (hasRequiredLib$1) return lib;
1398
- hasRequiredLib$1 = 1;
1399
- const RESERVED = 0;
1400
- const STRING = 1;
1401
- const BOOLEANISH_STRING = 2;
1402
- const BOOLEAN = 3;
1403
- const OVERLOADED_BOOLEAN = 4;
1404
- const NUMERIC = 5;
1405
- const POSITIVE_NUMERIC = 6;
1406
- function getPropertyInfo(name) {
1407
- return properties.hasOwnProperty(name) ? properties[name] : null;
1408
- }
1409
- function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
1410
- this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
1411
- this.attributeName = attributeName;
1412
- this.attributeNamespace = attributeNamespace;
1413
- this.mustUseProperty = mustUseProperty;
1414
- this.propertyName = name;
1415
- this.type = type;
1416
- this.sanitizeURL = sanitizeURL;
1417
- this.removeEmptyString = removeEmptyString;
1418
- }
1419
- const properties = {};
1420
- const reservedProps = [
1421
- "children",
1422
- "dangerouslySetInnerHTML",
1423
- // TODO: This prevents the assignment of defaultValue to regular
1424
- // elements (not just inputs). Now that ReactDOMInput assigns to the
1425
- // defaultValue property -- do we need this?
1426
- "defaultValue",
1427
- "defaultChecked",
1428
- "innerHTML",
1429
- "suppressContentEditableWarning",
1430
- "suppressHydrationWarning",
1431
- "style"
1432
- ];
1433
- reservedProps.forEach((name) => {
1434
- properties[name] = new PropertyInfoRecord(
1435
- name,
1436
- RESERVED,
1437
- false,
1438
- // mustUseProperty
1439
- name,
1440
- // attributeName
1441
- null,
1442
- // attributeNamespace
1443
- false,
1444
- // sanitizeURL
1445
- false
1446
- // removeEmptyString
1447
- );
1448
- });
1449
- [
1450
- ["acceptCharset", "accept-charset"],
1451
- ["className", "class"],
1452
- ["htmlFor", "for"],
1453
- ["httpEquiv", "http-equiv"]
1454
- ].forEach(([name, attributeName]) => {
1455
- properties[name] = new PropertyInfoRecord(
1456
- name,
1457
- STRING,
1458
- false,
1459
- // mustUseProperty
1460
- attributeName,
1461
- // attributeName
1462
- null,
1463
- // attributeNamespace
1464
- false,
1465
- // sanitizeURL
1466
- false
1467
- // removeEmptyString
1468
- );
1469
- });
1470
- ["contentEditable", "draggable", "spellCheck", "value"].forEach((name) => {
1471
- properties[name] = new PropertyInfoRecord(
1472
- name,
1473
- BOOLEANISH_STRING,
1474
- false,
1475
- // mustUseProperty
1476
- name.toLowerCase(),
1477
- // attributeName
1478
- null,
1479
- // attributeNamespace
1480
- false,
1481
- // sanitizeURL
1482
- false
1483
- // removeEmptyString
1484
- );
1485
- });
1486
- [
1487
- "autoReverse",
1488
- "externalResourcesRequired",
1489
- "focusable",
1490
- "preserveAlpha"
1491
- ].forEach((name) => {
1492
- properties[name] = new PropertyInfoRecord(
1493
- name,
1494
- BOOLEANISH_STRING,
1495
- false,
1496
- // mustUseProperty
1497
- name,
1498
- // attributeName
1499
- null,
1500
- // attributeNamespace
1501
- false,
1502
- // sanitizeURL
1503
- false
1504
- // removeEmptyString
1505
- );
1506
- });
1507
- [
1508
- "allowFullScreen",
1509
- "async",
1510
- // Note: there is a special case that prevents it from being written to the DOM
1511
- // on the client side because the browsers are inconsistent. Instead we call focus().
1512
- "autoFocus",
1513
- "autoPlay",
1514
- "controls",
1515
- "default",
1516
- "defer",
1517
- "disabled",
1518
- "disablePictureInPicture",
1519
- "disableRemotePlayback",
1520
- "formNoValidate",
1521
- "hidden",
1522
- "loop",
1523
- "noModule",
1524
- "noValidate",
1525
- "open",
1526
- "playsInline",
1527
- "readOnly",
1528
- "required",
1529
- "reversed",
1530
- "scoped",
1531
- "seamless",
1532
- // Microdata
1533
- "itemScope"
1534
- ].forEach((name) => {
1535
- properties[name] = new PropertyInfoRecord(
1536
- name,
1537
- BOOLEAN,
1538
- false,
1539
- // mustUseProperty
1540
- name.toLowerCase(),
1541
- // attributeName
1542
- null,
1543
- // attributeNamespace
1544
- false,
1545
- // sanitizeURL
1546
- false
1547
- // removeEmptyString
1548
- );
1549
- });
1550
- [
1551
- "checked",
1552
- // Note: `option.selected` is not updated if `select.multiple` is
1553
- // disabled with `removeAttribute`. We have special logic for handling this.
1554
- "multiple",
1555
- "muted",
1556
- "selected"
1557
- // NOTE: if you add a camelCased prop to this list,
1558
- // you'll need to set attributeName to name.toLowerCase()
1559
- // instead in the assignment below.
1560
- ].forEach((name) => {
1561
- properties[name] = new PropertyInfoRecord(
1562
- name,
1563
- BOOLEAN,
1564
- true,
1565
- // mustUseProperty
1566
- name,
1567
- // attributeName
1568
- null,
1569
- // attributeNamespace
1570
- false,
1571
- // sanitizeURL
1572
- false
1573
- // removeEmptyString
1574
- );
1575
- });
1576
- [
1577
- "capture",
1578
- "download"
1579
- // NOTE: if you add a camelCased prop to this list,
1580
- // you'll need to set attributeName to name.toLowerCase()
1581
- // instead in the assignment below.
1582
- ].forEach((name) => {
1583
- properties[name] = new PropertyInfoRecord(
1584
- name,
1585
- OVERLOADED_BOOLEAN,
1586
- false,
1587
- // mustUseProperty
1588
- name,
1589
- // attributeName
1590
- null,
1591
- // attributeNamespace
1592
- false,
1593
- // sanitizeURL
1594
- false
1595
- // removeEmptyString
1596
- );
1597
- });
1598
- [
1599
- "cols",
1600
- "rows",
1601
- "size",
1602
- "span"
1603
- // NOTE: if you add a camelCased prop to this list,
1604
- // you'll need to set attributeName to name.toLowerCase()
1605
- // instead in the assignment below.
1606
- ].forEach((name) => {
1607
- properties[name] = new PropertyInfoRecord(
1608
- name,
1609
- POSITIVE_NUMERIC,
1610
- false,
1611
- // mustUseProperty
1612
- name,
1613
- // attributeName
1614
- null,
1615
- // attributeNamespace
1616
- false,
1617
- // sanitizeURL
1618
- false
1619
- // removeEmptyString
1620
- );
1621
- });
1622
- ["rowSpan", "start"].forEach((name) => {
1623
- properties[name] = new PropertyInfoRecord(
1624
- name,
1625
- NUMERIC,
1626
- false,
1627
- // mustUseProperty
1628
- name.toLowerCase(),
1629
- // attributeName
1630
- null,
1631
- // attributeNamespace
1632
- false,
1633
- // sanitizeURL
1634
- false
1635
- // removeEmptyString
1636
- );
1637
- });
1638
- const CAMELIZE = /[\-\:]([a-z])/g;
1639
- const capitalize = (token) => token[1].toUpperCase();
1640
- [
1641
- "accent-height",
1642
- "alignment-baseline",
1643
- "arabic-form",
1644
- "baseline-shift",
1645
- "cap-height",
1646
- "clip-path",
1647
- "clip-rule",
1648
- "color-interpolation",
1649
- "color-interpolation-filters",
1650
- "color-profile",
1651
- "color-rendering",
1652
- "dominant-baseline",
1653
- "enable-background",
1654
- "fill-opacity",
1655
- "fill-rule",
1656
- "flood-color",
1657
- "flood-opacity",
1658
- "font-family",
1659
- "font-size",
1660
- "font-size-adjust",
1661
- "font-stretch",
1662
- "font-style",
1663
- "font-variant",
1664
- "font-weight",
1665
- "glyph-name",
1666
- "glyph-orientation-horizontal",
1667
- "glyph-orientation-vertical",
1668
- "horiz-adv-x",
1669
- "horiz-origin-x",
1670
- "image-rendering",
1671
- "letter-spacing",
1672
- "lighting-color",
1673
- "marker-end",
1674
- "marker-mid",
1675
- "marker-start",
1676
- "overline-position",
1677
- "overline-thickness",
1678
- "paint-order",
1679
- "panose-1",
1680
- "pointer-events",
1681
- "rendering-intent",
1682
- "shape-rendering",
1683
- "stop-color",
1684
- "stop-opacity",
1685
- "strikethrough-position",
1686
- "strikethrough-thickness",
1687
- "stroke-dasharray",
1688
- "stroke-dashoffset",
1689
- "stroke-linecap",
1690
- "stroke-linejoin",
1691
- "stroke-miterlimit",
1692
- "stroke-opacity",
1693
- "stroke-width",
1694
- "text-anchor",
1695
- "text-decoration",
1696
- "text-rendering",
1697
- "underline-position",
1698
- "underline-thickness",
1699
- "unicode-bidi",
1700
- "unicode-range",
1701
- "units-per-em",
1702
- "v-alphabetic",
1703
- "v-hanging",
1704
- "v-ideographic",
1705
- "v-mathematical",
1706
- "vector-effect",
1707
- "vert-adv-y",
1708
- "vert-origin-x",
1709
- "vert-origin-y",
1710
- "word-spacing",
1711
- "writing-mode",
1712
- "xmlns:xlink",
1713
- "x-height"
1714
- // NOTE: if you add a camelCased prop to this list,
1715
- // you'll need to set attributeName to name.toLowerCase()
1716
- // instead in the assignment below.
1717
- ].forEach((attributeName) => {
1718
- const name = attributeName.replace(CAMELIZE, capitalize);
1719
- properties[name] = new PropertyInfoRecord(
1720
- name,
1721
- STRING,
1722
- false,
1723
- // mustUseProperty
1724
- attributeName,
1725
- null,
1726
- // attributeNamespace
1727
- false,
1728
- // sanitizeURL
1729
- false
1730
- // removeEmptyString
1731
- );
1732
- });
1733
- [
1734
- "xlink:actuate",
1735
- "xlink:arcrole",
1736
- "xlink:role",
1737
- "xlink:show",
1738
- "xlink:title",
1739
- "xlink:type"
1740
- // NOTE: if you add a camelCased prop to this list,
1741
- // you'll need to set attributeName to name.toLowerCase()
1742
- // instead in the assignment below.
1743
- ].forEach((attributeName) => {
1744
- const name = attributeName.replace(CAMELIZE, capitalize);
1745
- properties[name] = new PropertyInfoRecord(
1746
- name,
1747
- STRING,
1748
- false,
1749
- // mustUseProperty
1750
- attributeName,
1751
- "http://www.w3.org/1999/xlink",
1752
- false,
1753
- // sanitizeURL
1754
- false
1755
- // removeEmptyString
1756
- );
1757
- });
1758
- [
1759
- "xml:base",
1760
- "xml:lang",
1761
- "xml:space"
1762
- // NOTE: if you add a camelCased prop to this list,
1763
- // you'll need to set attributeName to name.toLowerCase()
1764
- // instead in the assignment below.
1765
- ].forEach((attributeName) => {
1766
- const name = attributeName.replace(CAMELIZE, capitalize);
1767
- properties[name] = new PropertyInfoRecord(
1768
- name,
1769
- STRING,
1770
- false,
1771
- // mustUseProperty
1772
- attributeName,
1773
- "http://www.w3.org/XML/1998/namespace",
1774
- false,
1775
- // sanitizeURL
1776
- false
1777
- // removeEmptyString
1778
- );
1779
- });
1780
- ["tabIndex", "crossOrigin"].forEach((attributeName) => {
1781
- properties[attributeName] = new PropertyInfoRecord(
1782
- attributeName,
1783
- STRING,
1784
- false,
1785
- // mustUseProperty
1786
- attributeName.toLowerCase(),
1787
- // attributeName
1788
- null,
1789
- // attributeNamespace
1790
- false,
1791
- // sanitizeURL
1792
- false
1793
- // removeEmptyString
1794
- );
1795
- });
1796
- const xlinkHref = "xlinkHref";
1797
- properties[xlinkHref] = new PropertyInfoRecord(
1798
- "xlinkHref",
1799
- STRING,
1800
- false,
1801
- // mustUseProperty
1802
- "xlink:href",
1803
- "http://www.w3.org/1999/xlink",
1804
- true,
1805
- // sanitizeURL
1806
- false
1807
- // removeEmptyString
1808
- );
1809
- ["src", "href", "action", "formAction"].forEach((attributeName) => {
1810
- properties[attributeName] = new PropertyInfoRecord(
1811
- attributeName,
1812
- STRING,
1813
- false,
1814
- // mustUseProperty
1815
- attributeName.toLowerCase(),
1816
- // attributeName
1817
- null,
1818
- // attributeNamespace
1819
- true,
1820
- // sanitizeURL
1821
- true
1822
- // removeEmptyString
1823
- );
1824
- });
1825
- const {
1826
- CAMELCASE,
1827
- SAME,
1828
- possibleStandardNames: possibleStandardNamesOptimized2
1829
- } = requirePossibleStandardNamesOptimized();
1830
- const ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
1831
- const ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
1832
- const isCustomAttribute = RegExp.prototype.test.bind(
1833
- // eslint-disable-next-line no-misleading-character-class
1834
- new RegExp("^(data|aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$")
1835
- );
1836
- const possibleStandardNames = Object.keys(
1837
- possibleStandardNamesOptimized2
1838
- ).reduce((accumulator, standardName) => {
1839
- const propName = possibleStandardNamesOptimized2[standardName];
1840
- if (propName === SAME) {
1841
- accumulator[standardName] = standardName;
1842
- } else if (propName === CAMELCASE) {
1843
- accumulator[standardName.toLowerCase()] = standardName;
1844
- } else {
1845
- accumulator[standardName] = propName;
1846
- }
1847
- return accumulator;
1848
- }, {});
1849
- lib.BOOLEAN = BOOLEAN;
1850
- lib.BOOLEANISH_STRING = BOOLEANISH_STRING;
1851
- lib.NUMERIC = NUMERIC;
1852
- lib.OVERLOADED_BOOLEAN = OVERLOADED_BOOLEAN;
1853
- lib.POSITIVE_NUMERIC = POSITIVE_NUMERIC;
1854
- lib.RESERVED = RESERVED;
1855
- lib.STRING = STRING;
1856
- lib.getPropertyInfo = getPropertyInfo;
1857
- lib.isCustomAttribute = isCustomAttribute;
1858
- lib.possibleStandardNames = possibleStandardNames;
1859
- return lib;
1860
- }
1861
- var utilities = {};
1862
- var hasRequiredUtilities;
1863
- function requireUtilities() {
1864
- if (hasRequiredUtilities) return utilities;
1865
- hasRequiredUtilities = 1;
1866
- (function(exports$1) {
1867
- var __importDefault = utilities && utilities.__importDefault || function(mod) {
1868
- return mod && mod.__esModule ? mod : { "default": mod };
1869
- };
1870
- Object.defineProperty(exports$1, "__esModule", { value: true });
1871
- exports$1.returnFirstArg = exports$1.canTextBeChildOfNode = exports$1.ELEMENTS_WITH_NO_TEXT_CHILDREN = exports$1.PRESERVE_CUSTOM_ATTRIBUTES = void 0;
1872
- exports$1.isCustomComponent = isCustomComponent;
1873
- exports$1.setStyleProp = setStyleProp;
1874
- var react_1 = React__default;
1875
- var style_to_js_1 = __importDefault(requireCjs());
1876
- var RESERVED_SVG_MATHML_ELEMENTS = /* @__PURE__ */ new Set([
1877
- "annotation-xml",
1878
- "color-profile",
1879
- "font-face",
1880
- "font-face-src",
1881
- "font-face-uri",
1882
- "font-face-format",
1883
- "font-face-name",
1884
- "missing-glyph"
1885
- ]);
1886
- function isCustomComponent(tagName, props) {
1887
- if (!tagName.includes("-")) {
1888
- return Boolean(props && typeof props.is === "string");
1889
- }
1890
- if (RESERVED_SVG_MATHML_ELEMENTS.has(tagName)) {
1891
- return false;
1892
- }
1893
- return true;
1894
- }
1895
- var styleOptions = {
1896
- reactCompat: true
1897
- };
1898
- function setStyleProp(style, props) {
1899
- if (typeof style !== "string") {
1900
- return;
1901
- }
1902
- if (!style.trim()) {
1903
- props.style = {};
1904
- return;
1905
- }
1906
- try {
1907
- props.style = (0, style_to_js_1.default)(style, styleOptions);
1908
- } catch (error) {
1909
- props.style = {};
1910
- }
1911
- }
1912
- exports$1.PRESERVE_CUSTOM_ATTRIBUTES = Number(react_1.version.split(".")[0]) >= 16;
1913
- exports$1.ELEMENTS_WITH_NO_TEXT_CHILDREN = /* @__PURE__ */ new Set([
1914
- "tr",
1915
- "tbody",
1916
- "thead",
1917
- "tfoot",
1918
- "colgroup",
1919
- "table",
1920
- "head",
1921
- "html",
1922
- "frameset"
1923
- ]);
1924
- var canTextBeChildOfNode = function(node2) {
1925
- return !exports$1.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(node2.name);
1926
- };
1927
- exports$1.canTextBeChildOfNode = canTextBeChildOfNode;
1928
- var returnFirstArg = function(arg) {
1929
- return arg;
1930
- };
1931
- exports$1.returnFirstArg = returnFirstArg;
1932
- })(utilities);
1933
- return utilities;
1934
- }
1935
- var hasRequiredAttributesToProps;
1936
- function requireAttributesToProps() {
1937
- if (hasRequiredAttributesToProps) return attributesToProps;
1938
- hasRequiredAttributesToProps = 1;
1939
- Object.defineProperty(attributesToProps, "__esModule", { value: true });
1940
- attributesToProps.default = attributesToProps$1;
1941
- var react_property_1 = requireLib$1();
1942
- var utilities_1 = requireUtilities();
1943
- var UNCONTROLLED_COMPONENT_ATTRIBUTES = ["checked", "value"];
1944
- var UNCONTROLLED_COMPONENT_NAMES = ["input", "select", "textarea"];
1945
- var valueOnlyInputs = {
1946
- reset: true,
1947
- submit: true
1948
- };
1949
- function attributesToProps$1(attributes, nodeName) {
1950
- if (attributes === void 0) {
1951
- attributes = {};
1952
- }
1953
- var props = {};
1954
- var isInputValueOnly = Boolean(attributes.type && valueOnlyInputs[attributes.type]);
1955
- for (var attributeName in attributes) {
1956
- var attributeValue = attributes[attributeName];
1957
- if ((0, react_property_1.isCustomAttribute)(attributeName)) {
1958
- props[attributeName] = attributeValue;
1959
- continue;
1960
- }
1961
- var attributeNameLowerCased = attributeName.toLowerCase();
1962
- var propName = getPropName(attributeNameLowerCased);
1963
- if (propName) {
1964
- var propertyInfo = (0, react_property_1.getPropertyInfo)(propName);
1965
- if (UNCONTROLLED_COMPONENT_ATTRIBUTES.includes(propName) && UNCONTROLLED_COMPONENT_NAMES.includes(nodeName) && !isInputValueOnly) {
1966
- propName = getPropName("default" + attributeNameLowerCased);
1967
- }
1968
- props[propName] = attributeValue;
1969
- switch (propertyInfo && propertyInfo.type) {
1970
- case react_property_1.BOOLEAN:
1971
- props[propName] = true;
1972
- break;
1973
- case react_property_1.OVERLOADED_BOOLEAN:
1974
- if (attributeValue === "") {
1975
- props[propName] = true;
1976
- }
1977
- break;
1978
- }
1979
- continue;
1980
- }
1981
- if (utilities_1.PRESERVE_CUSTOM_ATTRIBUTES) {
1982
- props[attributeName] = attributeValue;
1983
- }
1984
- }
1985
- (0, utilities_1.setStyleProp)(attributes.style, props);
1986
- return props;
1987
- }
1988
- function getPropName(attributeName) {
1989
- return react_property_1.possibleStandardNames[attributeName];
1990
- }
1991
- return attributesToProps;
1992
- }
1993
- var domToReact = {};
1994
- var hasRequiredDomToReact;
1995
- function requireDomToReact() {
1996
- if (hasRequiredDomToReact) return domToReact;
1997
- hasRequiredDomToReact = 1;
1998
- var __importDefault = domToReact && domToReact.__importDefault || function(mod) {
1999
- return mod && mod.__esModule ? mod : { "default": mod };
2000
- };
2001
- Object.defineProperty(domToReact, "__esModule", { value: true });
2002
- domToReact.default = domToReact$1;
2003
- var react_1 = React__default;
2004
- var attributes_to_props_1 = __importDefault(requireAttributesToProps());
2005
- var utilities_1 = requireUtilities();
2006
- var React = {
2007
- cloneElement: react_1.cloneElement,
2008
- createElement: react_1.createElement,
2009
- isValidElement: react_1.isValidElement
2010
- };
2011
- function domToReact$1(nodes, options) {
2012
- if (options === void 0) {
2013
- options = {};
2014
- }
2015
- var reactElements = [];
2016
- var hasReplace = typeof options.replace === "function";
2017
- var transform = options.transform || utilities_1.returnFirstArg;
2018
- var _a = options.library || React, cloneElement = _a.cloneElement, createElement = _a.createElement, isValidElement = _a.isValidElement;
2019
- var nodesLength = nodes.length;
2020
- for (var index = 0; index < nodesLength; index++) {
2021
- var node2 = nodes[index];
2022
- if (hasReplace) {
2023
- var replaceElement = options.replace(node2, index);
2024
- if (isValidElement(replaceElement)) {
2025
- if (nodesLength > 1) {
2026
- replaceElement = cloneElement(replaceElement, {
2027
- key: replaceElement.key || index
2028
- });
2029
- }
2030
- reactElements.push(transform(replaceElement, node2, index));
2031
- continue;
2032
- }
2033
- }
2034
- if (node2.type === "text") {
2035
- var isWhitespace = !node2.data.trim().length;
2036
- if (isWhitespace && node2.parent && !(0, utilities_1.canTextBeChildOfNode)(node2.parent)) {
2037
- continue;
2038
- }
2039
- if (options.trim && isWhitespace) {
2040
- continue;
2041
- }
2042
- reactElements.push(transform(node2.data, node2, index));
2043
- continue;
2044
- }
2045
- var element = node2;
2046
- var props = {};
2047
- if (skipAttributesToProps(element)) {
2048
- (0, utilities_1.setStyleProp)(element.attribs.style, element.attribs);
2049
- props = element.attribs;
2050
- } else if (element.attribs) {
2051
- props = (0, attributes_to_props_1.default)(element.attribs, element.name);
2052
- }
2053
- var children = void 0;
2054
- switch (node2.type) {
2055
- case "script":
2056
- case "style":
2057
- if (node2.children[0]) {
2058
- props.dangerouslySetInnerHTML = {
2059
- __html: node2.children[0].data
2060
- };
2061
- }
2062
- break;
2063
- case "tag":
2064
- if (node2.name === "textarea" && node2.children[0]) {
2065
- props.defaultValue = node2.children[0].data;
2066
- } else if (node2.children && node2.children.length) {
2067
- children = domToReact$1(node2.children, options);
2068
- }
2069
- break;
2070
- // skip all other cases (e.g., comment)
2071
- default:
2072
- continue;
2073
- }
2074
- if (nodesLength > 1) {
2075
- props.key = index;
2076
- }
2077
- reactElements.push(transform(createElement(node2.name, props, children), node2, index));
2078
- }
2079
- return reactElements.length === 1 ? reactElements[0] : reactElements;
2080
- }
2081
- function skipAttributesToProps(node2) {
2082
- return utilities_1.PRESERVE_CUSTOM_ATTRIBUTES && node2.type === "tag" && (0, utilities_1.isCustomComponent)(node2.name, node2.attribs);
2083
- }
2084
- return domToReact;
2085
- }
2086
- var hasRequiredLib;
2087
- function requireLib() {
2088
- if (hasRequiredLib) return lib$3;
2089
- hasRequiredLib = 1;
2090
- (function(exports$1) {
2091
- var __importDefault = lib$3 && lib$3.__importDefault || function(mod) {
2092
- return mod && mod.__esModule ? mod : { "default": mod };
2093
- };
2094
- Object.defineProperty(exports$1, "__esModule", { value: true });
2095
- exports$1.htmlToDOM = exports$1.domToReact = exports$1.attributesToProps = exports$1.Text = exports$1.ProcessingInstruction = exports$1.Element = exports$1.Comment = void 0;
2096
- exports$1.default = HTMLReactParser2;
2097
- var html_dom_parser_1 = __importDefault(requireHtmlToDom());
2098
- exports$1.htmlToDOM = html_dom_parser_1.default;
2099
- var attributes_to_props_1 = __importDefault(requireAttributesToProps());
2100
- exports$1.attributesToProps = attributes_to_props_1.default;
2101
- var dom_to_react_1 = __importDefault(requireDomToReact());
2102
- exports$1.domToReact = dom_to_react_1.default;
2103
- var domhandler_1 = /* @__PURE__ */ requireLib$2();
2104
- Object.defineProperty(exports$1, "Comment", { enumerable: true, get: function() {
2105
- return domhandler_1.Comment;
2106
- } });
2107
- Object.defineProperty(exports$1, "Element", { enumerable: true, get: function() {
2108
- return domhandler_1.Element;
2109
- } });
2110
- Object.defineProperty(exports$1, "ProcessingInstruction", { enumerable: true, get: function() {
2111
- return domhandler_1.ProcessingInstruction;
2112
- } });
2113
- Object.defineProperty(exports$1, "Text", { enumerable: true, get: function() {
2114
- return domhandler_1.Text;
2115
- } });
2116
- var domParserOptions = { lowerCaseAttributeNames: false };
2117
- function HTMLReactParser2(html, options) {
2118
- if (typeof html !== "string") {
2119
- throw new TypeError("First argument must be a string");
2120
- }
2121
- if (!html) {
2122
- return [];
2123
- }
2124
- return (0, dom_to_react_1.default)((0, html_dom_parser_1.default)(html, (options === null || options === void 0 ? void 0 : options.htmlparser2) || domParserOptions), options);
2125
- }
2126
- })(lib$3);
2127
- return lib$3;
2128
- }
2129
- var libExports = requireLib();
2130
- const HTMLReactParser = /* @__PURE__ */ getDefaultExportFromCjs(libExports);
2131
- const parse = HTMLReactParser.default || HTMLReactParser;
1
+ import { d as defineStaticService } from "./staticService.js";
2
+ const LinkUtilsDefinition = defineStaticService("@wix/viewer-service-link-utils");
2132
3
  export {
2133
- libExports as l,
2134
- parse as p
4
+ LinkUtilsDefinition as L
2135
5
  };