html-react-parser 1.2.6 → 1.3.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.
- package/CHANGELOG.md +26 -2
- package/README.md +28 -5
- package/dist/html-react-parser.js +2375 -2020
- package/dist/html-react-parser.js.map +1 -1
- package/dist/html-react-parser.min.js +1 -1
- package/dist/html-react-parser.min.js.map +1 -1
- package/lib/attributes-to-props.js +22 -30
- package/lib/utilities.js +5 -1
- package/package.json +31 -31
|
@@ -1,2024 +1,2379 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}(this, (function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['react'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.HTMLReactParser = factory(global.React));
|
|
5
|
+
}(this, (function (require$$0) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
10
|
+
|
|
11
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
12
|
+
|
|
13
|
+
var htmlReactParser$1 = {exports: {}};
|
|
14
|
+
|
|
15
|
+
var lib$1 = {};
|
|
16
|
+
|
|
17
|
+
var possibleStandardNamesOptimized$1 = {};
|
|
18
|
+
|
|
19
|
+
// An attribute in which the DOM/SVG standard name is the same as the React prop name (e.g., 'accept').
|
|
20
|
+
var SAME$1 = 0;
|
|
21
|
+
possibleStandardNamesOptimized$1.SAME = SAME$1;
|
|
22
|
+
|
|
23
|
+
// An attribute in which the React prop name is the camelcased version of the DOM/SVG standard name (e.g., 'acceptCharset').
|
|
24
|
+
var CAMELCASE$1 = 1;
|
|
25
|
+
possibleStandardNamesOptimized$1.CAMELCASE = CAMELCASE$1;
|
|
26
|
+
|
|
27
|
+
possibleStandardNamesOptimized$1.possibleStandardNames = {
|
|
28
|
+
accept: 0,
|
|
29
|
+
acceptCharset: 1,
|
|
30
|
+
'accept-charset': 'acceptCharset',
|
|
31
|
+
accessKey: 1,
|
|
32
|
+
action: 0,
|
|
33
|
+
allowFullScreen: 1,
|
|
34
|
+
alt: 0,
|
|
35
|
+
as: 0,
|
|
36
|
+
async: 0,
|
|
37
|
+
autoCapitalize: 1,
|
|
38
|
+
autoComplete: 1,
|
|
39
|
+
autoCorrect: 1,
|
|
40
|
+
autoFocus: 1,
|
|
41
|
+
autoPlay: 1,
|
|
42
|
+
autoSave: 1,
|
|
43
|
+
capture: 0,
|
|
44
|
+
cellPadding: 1,
|
|
45
|
+
cellSpacing: 1,
|
|
46
|
+
challenge: 0,
|
|
47
|
+
charSet: 1,
|
|
48
|
+
checked: 0,
|
|
49
|
+
children: 0,
|
|
50
|
+
cite: 0,
|
|
51
|
+
class: 'className',
|
|
52
|
+
classID: 1,
|
|
53
|
+
className: 1,
|
|
54
|
+
cols: 0,
|
|
55
|
+
colSpan: 1,
|
|
56
|
+
content: 0,
|
|
57
|
+
contentEditable: 1,
|
|
58
|
+
contextMenu: 1,
|
|
59
|
+
controls: 0,
|
|
60
|
+
controlsList: 1,
|
|
61
|
+
coords: 0,
|
|
62
|
+
crossOrigin: 1,
|
|
63
|
+
dangerouslySetInnerHTML: 1,
|
|
64
|
+
data: 0,
|
|
65
|
+
dateTime: 1,
|
|
66
|
+
default: 0,
|
|
67
|
+
defaultChecked: 1,
|
|
68
|
+
defaultValue: 1,
|
|
69
|
+
defer: 0,
|
|
70
|
+
dir: 0,
|
|
71
|
+
disabled: 0,
|
|
72
|
+
disablePictureInPicture: 1,
|
|
73
|
+
disableRemotePlayback: 1,
|
|
74
|
+
download: 0,
|
|
75
|
+
draggable: 0,
|
|
76
|
+
encType: 1,
|
|
77
|
+
enterKeyHint: 1,
|
|
78
|
+
for: 'htmlFor',
|
|
79
|
+
form: 0,
|
|
80
|
+
formMethod: 1,
|
|
81
|
+
formAction: 1,
|
|
82
|
+
formEncType: 1,
|
|
83
|
+
formNoValidate: 1,
|
|
84
|
+
formTarget: 1,
|
|
85
|
+
frameBorder: 1,
|
|
86
|
+
headers: 0,
|
|
87
|
+
height: 0,
|
|
88
|
+
hidden: 0,
|
|
89
|
+
high: 0,
|
|
90
|
+
href: 0,
|
|
91
|
+
hrefLang: 1,
|
|
92
|
+
htmlFor: 1,
|
|
93
|
+
httpEquiv: 1,
|
|
94
|
+
'http-equiv': 'httpEquiv',
|
|
95
|
+
icon: 0,
|
|
96
|
+
id: 0,
|
|
97
|
+
innerHTML: 1,
|
|
98
|
+
inputMode: 1,
|
|
99
|
+
integrity: 0,
|
|
100
|
+
is: 0,
|
|
101
|
+
itemID: 1,
|
|
102
|
+
itemProp: 1,
|
|
103
|
+
itemRef: 1,
|
|
104
|
+
itemScope: 1,
|
|
105
|
+
itemType: 1,
|
|
106
|
+
keyParams: 1,
|
|
107
|
+
keyType: 1,
|
|
108
|
+
kind: 0,
|
|
109
|
+
label: 0,
|
|
110
|
+
lang: 0,
|
|
111
|
+
list: 0,
|
|
112
|
+
loop: 0,
|
|
113
|
+
low: 0,
|
|
114
|
+
manifest: 0,
|
|
115
|
+
marginWidth: 1,
|
|
116
|
+
marginHeight: 1,
|
|
117
|
+
max: 0,
|
|
118
|
+
maxLength: 1,
|
|
119
|
+
media: 0,
|
|
120
|
+
mediaGroup: 1,
|
|
121
|
+
method: 0,
|
|
122
|
+
min: 0,
|
|
123
|
+
minLength: 1,
|
|
124
|
+
multiple: 0,
|
|
125
|
+
muted: 0,
|
|
126
|
+
name: 0,
|
|
127
|
+
noModule: 1,
|
|
128
|
+
nonce: 0,
|
|
129
|
+
noValidate: 1,
|
|
130
|
+
open: 0,
|
|
131
|
+
optimum: 0,
|
|
132
|
+
pattern: 0,
|
|
133
|
+
placeholder: 0,
|
|
134
|
+
playsInline: 1,
|
|
135
|
+
poster: 0,
|
|
136
|
+
preload: 0,
|
|
137
|
+
profile: 0,
|
|
138
|
+
radioGroup: 1,
|
|
139
|
+
readOnly: 1,
|
|
140
|
+
referrerPolicy: 1,
|
|
141
|
+
rel: 0,
|
|
142
|
+
required: 0,
|
|
143
|
+
reversed: 0,
|
|
144
|
+
role: 0,
|
|
145
|
+
rows: 0,
|
|
146
|
+
rowSpan: 1,
|
|
147
|
+
sandbox: 0,
|
|
148
|
+
scope: 0,
|
|
149
|
+
scoped: 0,
|
|
150
|
+
scrolling: 0,
|
|
151
|
+
seamless: 0,
|
|
152
|
+
selected: 0,
|
|
153
|
+
shape: 0,
|
|
154
|
+
size: 0,
|
|
155
|
+
sizes: 0,
|
|
156
|
+
span: 0,
|
|
157
|
+
spellCheck: 1,
|
|
158
|
+
src: 0,
|
|
159
|
+
srcDoc: 1,
|
|
160
|
+
srcLang: 1,
|
|
161
|
+
srcSet: 1,
|
|
162
|
+
start: 0,
|
|
163
|
+
step: 0,
|
|
164
|
+
style: 0,
|
|
165
|
+
summary: 0,
|
|
166
|
+
tabIndex: 1,
|
|
167
|
+
target: 0,
|
|
168
|
+
title: 0,
|
|
169
|
+
type: 0,
|
|
170
|
+
useMap: 1,
|
|
171
|
+
value: 0,
|
|
172
|
+
width: 0,
|
|
173
|
+
wmode: 0,
|
|
174
|
+
wrap: 0,
|
|
175
|
+
about: 0,
|
|
176
|
+
accentHeight: 1,
|
|
177
|
+
'accent-height': 'accentHeight',
|
|
178
|
+
accumulate: 0,
|
|
179
|
+
additive: 0,
|
|
180
|
+
alignmentBaseline: 1,
|
|
181
|
+
'alignment-baseline': 'alignmentBaseline',
|
|
182
|
+
allowReorder: 1,
|
|
183
|
+
alphabetic: 0,
|
|
184
|
+
amplitude: 0,
|
|
185
|
+
arabicForm: 1,
|
|
186
|
+
'arabic-form': 'arabicForm',
|
|
187
|
+
ascent: 0,
|
|
188
|
+
attributeName: 1,
|
|
189
|
+
attributeType: 1,
|
|
190
|
+
autoReverse: 1,
|
|
191
|
+
azimuth: 0,
|
|
192
|
+
baseFrequency: 1,
|
|
193
|
+
baselineShift: 1,
|
|
194
|
+
'baseline-shift': 'baselineShift',
|
|
195
|
+
baseProfile: 1,
|
|
196
|
+
bbox: 0,
|
|
197
|
+
begin: 0,
|
|
198
|
+
bias: 0,
|
|
199
|
+
by: 0,
|
|
200
|
+
calcMode: 1,
|
|
201
|
+
capHeight: 1,
|
|
202
|
+
'cap-height': 'capHeight',
|
|
203
|
+
clip: 0,
|
|
204
|
+
clipPath: 1,
|
|
205
|
+
'clip-path': 'clipPath',
|
|
206
|
+
clipPathUnits: 1,
|
|
207
|
+
clipRule: 1,
|
|
208
|
+
'clip-rule': 'clipRule',
|
|
209
|
+
color: 0,
|
|
210
|
+
colorInterpolation: 1,
|
|
211
|
+
'color-interpolation': 'colorInterpolation',
|
|
212
|
+
colorInterpolationFilters: 1,
|
|
213
|
+
'color-interpolation-filters': 'colorInterpolationFilters',
|
|
214
|
+
colorProfile: 1,
|
|
215
|
+
'color-profile': 'colorProfile',
|
|
216
|
+
colorRendering: 1,
|
|
217
|
+
'color-rendering': 'colorRendering',
|
|
218
|
+
contentScriptType: 1,
|
|
219
|
+
contentStyleType: 1,
|
|
220
|
+
cursor: 0,
|
|
221
|
+
cx: 0,
|
|
222
|
+
cy: 0,
|
|
223
|
+
d: 0,
|
|
224
|
+
datatype: 0,
|
|
225
|
+
decelerate: 0,
|
|
226
|
+
descent: 0,
|
|
227
|
+
diffuseConstant: 1,
|
|
228
|
+
direction: 0,
|
|
229
|
+
display: 0,
|
|
230
|
+
divisor: 0,
|
|
231
|
+
dominantBaseline: 1,
|
|
232
|
+
'dominant-baseline': 'dominantBaseline',
|
|
233
|
+
dur: 0,
|
|
234
|
+
dx: 0,
|
|
235
|
+
dy: 0,
|
|
236
|
+
edgeMode: 1,
|
|
237
|
+
elevation: 0,
|
|
238
|
+
enableBackground: 1,
|
|
239
|
+
'enable-background': 'enableBackground',
|
|
240
|
+
end: 0,
|
|
241
|
+
exponent: 0,
|
|
242
|
+
externalResourcesRequired: 1,
|
|
243
|
+
fill: 0,
|
|
244
|
+
fillOpacity: 1,
|
|
245
|
+
'fill-opacity': 'fillOpacity',
|
|
246
|
+
fillRule: 1,
|
|
247
|
+
'fill-rule': 'fillRule',
|
|
248
|
+
filter: 0,
|
|
249
|
+
filterRes: 1,
|
|
250
|
+
filterUnits: 1,
|
|
251
|
+
floodOpacity: 1,
|
|
252
|
+
'flood-opacity': 'floodOpacity',
|
|
253
|
+
floodColor: 1,
|
|
254
|
+
'flood-color': 'floodColor',
|
|
255
|
+
focusable: 0,
|
|
256
|
+
fontFamily: 1,
|
|
257
|
+
'font-family': 'fontFamily',
|
|
258
|
+
fontSize: 1,
|
|
259
|
+
'font-size': 'fontSize',
|
|
260
|
+
fontSizeAdjust: 1,
|
|
261
|
+
'font-size-adjust': 'fontSizeAdjust',
|
|
262
|
+
fontStretch: 1,
|
|
263
|
+
'font-stretch': 'fontStretch',
|
|
264
|
+
fontStyle: 1,
|
|
265
|
+
'font-style': 'fontStyle',
|
|
266
|
+
fontVariant: 1,
|
|
267
|
+
'font-variant': 'fontVariant',
|
|
268
|
+
fontWeight: 1,
|
|
269
|
+
'font-weight': 'fontWeight',
|
|
270
|
+
format: 0,
|
|
271
|
+
from: 0,
|
|
272
|
+
fx: 0,
|
|
273
|
+
fy: 0,
|
|
274
|
+
g1: 0,
|
|
275
|
+
g2: 0,
|
|
276
|
+
glyphName: 1,
|
|
277
|
+
'glyph-name': 'glyphName',
|
|
278
|
+
glyphOrientationHorizontal: 1,
|
|
279
|
+
'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
|
|
280
|
+
glyphOrientationVertical: 1,
|
|
281
|
+
'glyph-orientation-vertical': 'glyphOrientationVertical',
|
|
282
|
+
glyphRef: 1,
|
|
283
|
+
gradientTransform: 1,
|
|
284
|
+
gradientUnits: 1,
|
|
285
|
+
hanging: 0,
|
|
286
|
+
horizAdvX: 1,
|
|
287
|
+
'horiz-adv-x': 'horizAdvX',
|
|
288
|
+
horizOriginX: 1,
|
|
289
|
+
'horiz-origin-x': 'horizOriginX',
|
|
290
|
+
ideographic: 0,
|
|
291
|
+
imageRendering: 1,
|
|
292
|
+
'image-rendering': 'imageRendering',
|
|
293
|
+
in2: 0,
|
|
294
|
+
in: 0,
|
|
295
|
+
inlist: 0,
|
|
296
|
+
intercept: 0,
|
|
297
|
+
k1: 0,
|
|
298
|
+
k2: 0,
|
|
299
|
+
k3: 0,
|
|
300
|
+
k4: 0,
|
|
301
|
+
k: 0,
|
|
302
|
+
kernelMatrix: 1,
|
|
303
|
+
kernelUnitLength: 1,
|
|
304
|
+
kerning: 0,
|
|
305
|
+
keyPoints: 1,
|
|
306
|
+
keySplines: 1,
|
|
307
|
+
keyTimes: 1,
|
|
308
|
+
lengthAdjust: 1,
|
|
309
|
+
letterSpacing: 1,
|
|
310
|
+
'letter-spacing': 'letterSpacing',
|
|
311
|
+
lightingColor: 1,
|
|
312
|
+
'lighting-color': 'lightingColor',
|
|
313
|
+
limitingConeAngle: 1,
|
|
314
|
+
local: 0,
|
|
315
|
+
markerEnd: 1,
|
|
316
|
+
'marker-end': 'markerEnd',
|
|
317
|
+
markerHeight: 1,
|
|
318
|
+
markerMid: 1,
|
|
319
|
+
'marker-mid': 'markerMid',
|
|
320
|
+
markerStart: 1,
|
|
321
|
+
'marker-start': 'markerStart',
|
|
322
|
+
markerUnits: 1,
|
|
323
|
+
markerWidth: 1,
|
|
324
|
+
mask: 0,
|
|
325
|
+
maskContentUnits: 1,
|
|
326
|
+
maskUnits: 1,
|
|
327
|
+
mathematical: 0,
|
|
328
|
+
mode: 0,
|
|
329
|
+
numOctaves: 1,
|
|
330
|
+
offset: 0,
|
|
331
|
+
opacity: 0,
|
|
332
|
+
operator: 0,
|
|
333
|
+
order: 0,
|
|
334
|
+
orient: 0,
|
|
335
|
+
orientation: 0,
|
|
336
|
+
origin: 0,
|
|
337
|
+
overflow: 0,
|
|
338
|
+
overlinePosition: 1,
|
|
339
|
+
'overline-position': 'overlinePosition',
|
|
340
|
+
overlineThickness: 1,
|
|
341
|
+
'overline-thickness': 'overlineThickness',
|
|
342
|
+
paintOrder: 1,
|
|
343
|
+
'paint-order': 'paintOrder',
|
|
344
|
+
panose1: 0,
|
|
345
|
+
'panose-1': 'panose1',
|
|
346
|
+
pathLength: 1,
|
|
347
|
+
patternContentUnits: 1,
|
|
348
|
+
patternTransform: 1,
|
|
349
|
+
patternUnits: 1,
|
|
350
|
+
pointerEvents: 1,
|
|
351
|
+
'pointer-events': 'pointerEvents',
|
|
352
|
+
points: 0,
|
|
353
|
+
pointsAtX: 1,
|
|
354
|
+
pointsAtY: 1,
|
|
355
|
+
pointsAtZ: 1,
|
|
356
|
+
prefix: 0,
|
|
357
|
+
preserveAlpha: 1,
|
|
358
|
+
preserveAspectRatio: 1,
|
|
359
|
+
primitiveUnits: 1,
|
|
360
|
+
property: 0,
|
|
361
|
+
r: 0,
|
|
362
|
+
radius: 0,
|
|
363
|
+
refX: 1,
|
|
364
|
+
refY: 1,
|
|
365
|
+
renderingIntent: 1,
|
|
366
|
+
'rendering-intent': 'renderingIntent',
|
|
367
|
+
repeatCount: 1,
|
|
368
|
+
repeatDur: 1,
|
|
369
|
+
requiredExtensions: 1,
|
|
370
|
+
requiredFeatures: 1,
|
|
371
|
+
resource: 0,
|
|
372
|
+
restart: 0,
|
|
373
|
+
result: 0,
|
|
374
|
+
results: 0,
|
|
375
|
+
rotate: 0,
|
|
376
|
+
rx: 0,
|
|
377
|
+
ry: 0,
|
|
378
|
+
scale: 0,
|
|
379
|
+
security: 0,
|
|
380
|
+
seed: 0,
|
|
381
|
+
shapeRendering: 1,
|
|
382
|
+
'shape-rendering': 'shapeRendering',
|
|
383
|
+
slope: 0,
|
|
384
|
+
spacing: 0,
|
|
385
|
+
specularConstant: 1,
|
|
386
|
+
specularExponent: 1,
|
|
387
|
+
speed: 0,
|
|
388
|
+
spreadMethod: 1,
|
|
389
|
+
startOffset: 1,
|
|
390
|
+
stdDeviation: 1,
|
|
391
|
+
stemh: 0,
|
|
392
|
+
stemv: 0,
|
|
393
|
+
stitchTiles: 1,
|
|
394
|
+
stopColor: 1,
|
|
395
|
+
'stop-color': 'stopColor',
|
|
396
|
+
stopOpacity: 1,
|
|
397
|
+
'stop-opacity': 'stopOpacity',
|
|
398
|
+
strikethroughPosition: 1,
|
|
399
|
+
'strikethrough-position': 'strikethroughPosition',
|
|
400
|
+
strikethroughThickness: 1,
|
|
401
|
+
'strikethrough-thickness': 'strikethroughThickness',
|
|
402
|
+
string: 0,
|
|
403
|
+
stroke: 0,
|
|
404
|
+
strokeDasharray: 1,
|
|
405
|
+
'stroke-dasharray': 'strokeDasharray',
|
|
406
|
+
strokeDashoffset: 1,
|
|
407
|
+
'stroke-dashoffset': 'strokeDashoffset',
|
|
408
|
+
strokeLinecap: 1,
|
|
409
|
+
'stroke-linecap': 'strokeLinecap',
|
|
410
|
+
strokeLinejoin: 1,
|
|
411
|
+
'stroke-linejoin': 'strokeLinejoin',
|
|
412
|
+
strokeMiterlimit: 1,
|
|
413
|
+
'stroke-miterlimit': 'strokeMiterlimit',
|
|
414
|
+
strokeWidth: 1,
|
|
415
|
+
'stroke-width': 'strokeWidth',
|
|
416
|
+
strokeOpacity: 1,
|
|
417
|
+
'stroke-opacity': 'strokeOpacity',
|
|
418
|
+
suppressContentEditableWarning: 1,
|
|
419
|
+
suppressHydrationWarning: 1,
|
|
420
|
+
surfaceScale: 1,
|
|
421
|
+
systemLanguage: 1,
|
|
422
|
+
tableValues: 1,
|
|
423
|
+
targetX: 1,
|
|
424
|
+
targetY: 1,
|
|
425
|
+
textAnchor: 1,
|
|
426
|
+
'text-anchor': 'textAnchor',
|
|
427
|
+
textDecoration: 1,
|
|
428
|
+
'text-decoration': 'textDecoration',
|
|
429
|
+
textLength: 1,
|
|
430
|
+
textRendering: 1,
|
|
431
|
+
'text-rendering': 'textRendering',
|
|
432
|
+
to: 0,
|
|
433
|
+
transform: 0,
|
|
434
|
+
typeof: 0,
|
|
435
|
+
u1: 0,
|
|
436
|
+
u2: 0,
|
|
437
|
+
underlinePosition: 1,
|
|
438
|
+
'underline-position': 'underlinePosition',
|
|
439
|
+
underlineThickness: 1,
|
|
440
|
+
'underline-thickness': 'underlineThickness',
|
|
441
|
+
unicode: 0,
|
|
442
|
+
unicodeBidi: 1,
|
|
443
|
+
'unicode-bidi': 'unicodeBidi',
|
|
444
|
+
unicodeRange: 1,
|
|
445
|
+
'unicode-range': 'unicodeRange',
|
|
446
|
+
unitsPerEm: 1,
|
|
447
|
+
'units-per-em': 'unitsPerEm',
|
|
448
|
+
unselectable: 0,
|
|
449
|
+
vAlphabetic: 1,
|
|
450
|
+
'v-alphabetic': 'vAlphabetic',
|
|
451
|
+
values: 0,
|
|
452
|
+
vectorEffect: 1,
|
|
453
|
+
'vector-effect': 'vectorEffect',
|
|
454
|
+
version: 0,
|
|
455
|
+
vertAdvY: 1,
|
|
456
|
+
'vert-adv-y': 'vertAdvY',
|
|
457
|
+
vertOriginX: 1,
|
|
458
|
+
'vert-origin-x': 'vertOriginX',
|
|
459
|
+
vertOriginY: 1,
|
|
460
|
+
'vert-origin-y': 'vertOriginY',
|
|
461
|
+
vHanging: 1,
|
|
462
|
+
'v-hanging': 'vHanging',
|
|
463
|
+
vIdeographic: 1,
|
|
464
|
+
'v-ideographic': 'vIdeographic',
|
|
465
|
+
viewBox: 1,
|
|
466
|
+
viewTarget: 1,
|
|
467
|
+
visibility: 0,
|
|
468
|
+
vMathematical: 1,
|
|
469
|
+
'v-mathematical': 'vMathematical',
|
|
470
|
+
vocab: 0,
|
|
471
|
+
widths: 0,
|
|
472
|
+
wordSpacing: 1,
|
|
473
|
+
'word-spacing': 'wordSpacing',
|
|
474
|
+
writingMode: 1,
|
|
475
|
+
'writing-mode': 'writingMode',
|
|
476
|
+
x1: 0,
|
|
477
|
+
x2: 0,
|
|
478
|
+
x: 0,
|
|
479
|
+
xChannelSelector: 1,
|
|
480
|
+
xHeight: 1,
|
|
481
|
+
'x-height': 'xHeight',
|
|
482
|
+
xlinkActuate: 1,
|
|
483
|
+
'xlink:actuate': 'xlinkActuate',
|
|
484
|
+
xlinkArcrole: 1,
|
|
485
|
+
'xlink:arcrole': 'xlinkArcrole',
|
|
486
|
+
xlinkHref: 1,
|
|
487
|
+
'xlink:href': 'xlinkHref',
|
|
488
|
+
xlinkRole: 1,
|
|
489
|
+
'xlink:role': 'xlinkRole',
|
|
490
|
+
xlinkShow: 1,
|
|
491
|
+
'xlink:show': 'xlinkShow',
|
|
492
|
+
xlinkTitle: 1,
|
|
493
|
+
'xlink:title': 'xlinkTitle',
|
|
494
|
+
xlinkType: 1,
|
|
495
|
+
'xlink:type': 'xlinkType',
|
|
496
|
+
xmlBase: 1,
|
|
497
|
+
'xml:base': 'xmlBase',
|
|
498
|
+
xmlLang: 1,
|
|
499
|
+
'xml:lang': 'xmlLang',
|
|
500
|
+
xmlns: 0,
|
|
501
|
+
'xml:space': 'xmlSpace',
|
|
502
|
+
xmlnsXlink: 1,
|
|
503
|
+
'xmlns:xlink': 'xmlnsXlink',
|
|
504
|
+
xmlSpace: 1,
|
|
505
|
+
y1: 0,
|
|
506
|
+
y2: 0,
|
|
507
|
+
y: 0,
|
|
508
|
+
yChannelSelector: 1,
|
|
509
|
+
z: 0,
|
|
510
|
+
zoomAndPan: 1
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
Object.defineProperty(lib$1, '__esModule', { value: true });
|
|
514
|
+
|
|
515
|
+
function _slicedToArray(arr, i) {
|
|
516
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
function _arrayWithHoles(arr) {
|
|
520
|
+
if (Array.isArray(arr)) return arr;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
function _iterableToArrayLimit(arr, i) {
|
|
524
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
525
|
+
|
|
526
|
+
if (_i == null) return;
|
|
527
|
+
var _arr = [];
|
|
528
|
+
var _n = true;
|
|
529
|
+
var _d = false;
|
|
530
|
+
|
|
531
|
+
var _s, _e;
|
|
532
|
+
|
|
533
|
+
try {
|
|
534
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
535
|
+
_arr.push(_s.value);
|
|
536
|
+
|
|
537
|
+
if (i && _arr.length === i) break;
|
|
538
|
+
}
|
|
539
|
+
} catch (err) {
|
|
540
|
+
_d = true;
|
|
541
|
+
_e = err;
|
|
542
|
+
} finally {
|
|
543
|
+
try {
|
|
544
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
545
|
+
} finally {
|
|
546
|
+
if (_d) throw _e;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
return _arr;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
554
|
+
if (!o) return;
|
|
555
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
556
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
557
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
558
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
559
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
function _arrayLikeToArray(arr, len) {
|
|
563
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
564
|
+
|
|
565
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
566
|
+
|
|
567
|
+
return arr2;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
function _nonIterableRest() {
|
|
571
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// A reserved attribute.
|
|
575
|
+
// It is handled by React separately and shouldn't be written to the DOM.
|
|
576
|
+
var RESERVED = 0; // A simple string attribute.
|
|
577
|
+
// Attributes that aren't in the filter are presumed to have this type.
|
|
578
|
+
|
|
579
|
+
var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
|
|
580
|
+
// "enumerated" attributes with "true" and "false" as possible values.
|
|
581
|
+
// When true, it should be set to a "true" string.
|
|
582
|
+
// When false, it should be set to a "false" string.
|
|
583
|
+
|
|
584
|
+
var BOOLEANISH_STRING = 2; // A real boolean attribute.
|
|
585
|
+
// When true, it should be present (set either to an empty string or its name).
|
|
586
|
+
// When false, it should be omitted.
|
|
587
|
+
|
|
588
|
+
var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
|
|
589
|
+
// When true, it should be present (set either to an empty string or its name).
|
|
590
|
+
// When false, it should be omitted.
|
|
591
|
+
// For any other value, should be present with that value.
|
|
592
|
+
|
|
593
|
+
var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
|
|
594
|
+
// When falsy, it should be removed.
|
|
595
|
+
|
|
596
|
+
var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
|
|
597
|
+
// When falsy, it should be removed.
|
|
598
|
+
|
|
599
|
+
var POSITIVE_NUMERIC = 6;
|
|
600
|
+
function getPropertyInfo(name) {
|
|
601
|
+
return properties.hasOwnProperty(name) ? properties[name] : null;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
|
|
605
|
+
this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
|
606
|
+
this.attributeName = attributeName;
|
|
607
|
+
this.attributeNamespace = attributeNamespace;
|
|
608
|
+
this.mustUseProperty = mustUseProperty;
|
|
609
|
+
this.propertyName = name;
|
|
610
|
+
this.type = type;
|
|
611
|
+
this.sanitizeURL = sanitizeURL;
|
|
612
|
+
this.removeEmptyString = removeEmptyString;
|
|
613
|
+
} // When adding attributes to this list, be sure to also add them to
|
|
614
|
+
// the `possibleStandardNames` module to ensure casing and incorrect
|
|
615
|
+
// name warnings.
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
|
|
619
|
+
|
|
620
|
+
var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
|
|
621
|
+
// elements (not just inputs). Now that ReactDOMInput assigns to the
|
|
622
|
+
// defaultValue property -- do we need this?
|
|
623
|
+
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
|
|
624
|
+
reservedProps.forEach(function (name) {
|
|
625
|
+
properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
|
|
626
|
+
name, // attributeName
|
|
627
|
+
null, // attributeNamespace
|
|
628
|
+
false, // sanitizeURL
|
|
629
|
+
false);
|
|
630
|
+
}); // A few React string attributes have a different name.
|
|
631
|
+
// This is a mapping from React prop names to the attribute names.
|
|
632
|
+
|
|
633
|
+
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
|
|
634
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
635
|
+
name = _ref2[0],
|
|
636
|
+
attributeName = _ref2[1];
|
|
637
|
+
|
|
638
|
+
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
639
|
+
attributeName, // attributeName
|
|
640
|
+
null, // attributeNamespace
|
|
641
|
+
false, // sanitizeURL
|
|
642
|
+
false);
|
|
643
|
+
}); // These are "enumerated" HTML attributes that accept "true" and "false".
|
|
644
|
+
// In React, we let users pass `true` and `false` even though technically
|
|
645
|
+
// these aren't boolean attributes (they are coerced to strings).
|
|
646
|
+
|
|
647
|
+
['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
|
|
648
|
+
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
|
649
|
+
name.toLowerCase(), // attributeName
|
|
650
|
+
null, // attributeNamespace
|
|
651
|
+
false, // sanitizeURL
|
|
652
|
+
false);
|
|
653
|
+
}); // These are "enumerated" SVG attributes that accept "true" and "false".
|
|
654
|
+
// In React, we let users pass `true` and `false` even though technically
|
|
655
|
+
// these aren't boolean attributes (they are coerced to strings).
|
|
656
|
+
// Since these are SVG attributes, their attribute names are case-sensitive.
|
|
657
|
+
|
|
658
|
+
['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
|
|
659
|
+
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
|
660
|
+
name, // attributeName
|
|
661
|
+
null, // attributeNamespace
|
|
662
|
+
false, // sanitizeURL
|
|
663
|
+
false);
|
|
664
|
+
}); // These are HTML boolean attributes.
|
|
665
|
+
|
|
666
|
+
['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
|
|
667
|
+
// on the client side because the browsers are inconsistent. Instead we call focus().
|
|
668
|
+
'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
|
|
669
|
+
'itemScope'].forEach(function (name) {
|
|
670
|
+
properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
|
|
671
|
+
name.toLowerCase(), // attributeName
|
|
672
|
+
null, // attributeNamespace
|
|
673
|
+
false, // sanitizeURL
|
|
674
|
+
false);
|
|
675
|
+
}); // These are the few React props that we set as DOM properties
|
|
676
|
+
// rather than attributes. These are all booleans.
|
|
677
|
+
|
|
678
|
+
['checked', // Note: `option.selected` is not updated if `select.multiple` is
|
|
679
|
+
// disabled with `removeAttribute`. We have special logic for handling this.
|
|
680
|
+
'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
|
|
681
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
682
|
+
// instead in the assignment below.
|
|
683
|
+
].forEach(function (name) {
|
|
684
|
+
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
|
|
685
|
+
name, // attributeName
|
|
686
|
+
null, // attributeNamespace
|
|
687
|
+
false, // sanitizeURL
|
|
688
|
+
false);
|
|
689
|
+
}); // These are HTML attributes that are "overloaded booleans": they behave like
|
|
690
|
+
// booleans, but can also accept a string value.
|
|
691
|
+
|
|
692
|
+
['capture', 'download' // NOTE: if you add a camelCased prop to this list,
|
|
693
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
694
|
+
// instead in the assignment below.
|
|
695
|
+
].forEach(function (name) {
|
|
696
|
+
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
|
|
697
|
+
name, // attributeName
|
|
698
|
+
null, // attributeNamespace
|
|
699
|
+
false, // sanitizeURL
|
|
700
|
+
false);
|
|
701
|
+
}); // These are HTML attributes that must be positive numbers.
|
|
702
|
+
|
|
703
|
+
['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
|
|
704
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
705
|
+
// instead in the assignment below.
|
|
706
|
+
].forEach(function (name) {
|
|
707
|
+
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
|
|
708
|
+
name, // attributeName
|
|
709
|
+
null, // attributeNamespace
|
|
710
|
+
false, // sanitizeURL
|
|
711
|
+
false);
|
|
712
|
+
}); // These are HTML attributes that must be numbers.
|
|
713
|
+
|
|
714
|
+
['rowSpan', 'start'].forEach(function (name) {
|
|
715
|
+
properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
|
|
716
|
+
name.toLowerCase(), // attributeName
|
|
717
|
+
null, // attributeNamespace
|
|
718
|
+
false, // sanitizeURL
|
|
719
|
+
false);
|
|
720
|
+
});
|
|
721
|
+
var CAMELIZE = /[\-\:]([a-z])/g;
|
|
722
|
+
|
|
723
|
+
var capitalize$1 = function capitalize(token) {
|
|
724
|
+
return token[1].toUpperCase();
|
|
725
|
+
}; // This is a list of all SVG attributes that need special casing, namespacing,
|
|
726
|
+
// or boolean value assignment. Regular attributes that just accept strings
|
|
727
|
+
// and have the same names are omitted, just like in the HTML attribute filter.
|
|
728
|
+
// Some of these attributes can be hard to find. This list was created by
|
|
729
|
+
// scraping the MDN documentation.
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,
|
|
733
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
734
|
+
// instead in the assignment below.
|
|
735
|
+
].forEach(function (attributeName) {
|
|
736
|
+
var name = attributeName.replace(CAMELIZE, capitalize$1);
|
|
737
|
+
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
738
|
+
attributeName, null, // attributeNamespace
|
|
739
|
+
false, // sanitizeURL
|
|
740
|
+
false);
|
|
741
|
+
}); // String SVG attributes with the xlink namespace.
|
|
742
|
+
|
|
743
|
+
['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
|
|
744
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
745
|
+
// instead in the assignment below.
|
|
746
|
+
].forEach(function (attributeName) {
|
|
747
|
+
var name = attributeName.replace(CAMELIZE, capitalize$1);
|
|
748
|
+
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
749
|
+
attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL
|
|
750
|
+
false);
|
|
751
|
+
}); // String SVG attributes with the xml namespace.
|
|
752
|
+
|
|
753
|
+
['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
|
|
754
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
755
|
+
// instead in the assignment below.
|
|
756
|
+
].forEach(function (attributeName) {
|
|
757
|
+
var name = attributeName.replace(CAMELIZE, capitalize$1);
|
|
758
|
+
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
759
|
+
attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL
|
|
760
|
+
false);
|
|
761
|
+
}); // These attribute exists both in HTML and SVG.
|
|
762
|
+
// The attribute name is case-sensitive in SVG so we can't just use
|
|
763
|
+
// the React name like we do for attributes that exist only in HTML.
|
|
764
|
+
|
|
765
|
+
['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
|
|
766
|
+
properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
|
|
767
|
+
attributeName.toLowerCase(), // attributeName
|
|
768
|
+
null, // attributeNamespace
|
|
769
|
+
false, // sanitizeURL
|
|
770
|
+
false);
|
|
771
|
+
}); // These attributes accept URLs. These must not allow javascript: URLS.
|
|
772
|
+
// These will also need to accept Trusted Types object in the future.
|
|
773
|
+
|
|
774
|
+
var xlinkHref = 'xlinkHref';
|
|
775
|
+
properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
|
|
776
|
+
'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL
|
|
777
|
+
false);
|
|
778
|
+
['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
|
|
779
|
+
properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
|
|
780
|
+
attributeName.toLowerCase(), // attributeName
|
|
781
|
+
null, // attributeNamespace
|
|
782
|
+
true, // sanitizeURL
|
|
783
|
+
true);
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
var _require = possibleStandardNamesOptimized$1,
|
|
787
|
+
CAMELCASE = _require.CAMELCASE,
|
|
788
|
+
SAME = _require.SAME,
|
|
789
|
+
possibleStandardNamesOptimized = _require.possibleStandardNames;
|
|
790
|
+
|
|
791
|
+
var 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";
|
|
792
|
+
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
793
|
+
/**
|
|
794
|
+
* Checks whether a property name is a custom attribute.
|
|
795
|
+
*
|
|
796
|
+
* @see {@link https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L23-L25}
|
|
797
|
+
*
|
|
798
|
+
* @param {string}
|
|
799
|
+
* @return {boolean}
|
|
800
|
+
*/
|
|
801
|
+
|
|
802
|
+
var isCustomAttribute = RegExp.prototype.test.bind( // eslint-disable-next-line no-misleading-character-class
|
|
803
|
+
new RegExp('^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'));
|
|
804
|
+
var possibleStandardNames = Object.keys(possibleStandardNamesOptimized).reduce(function (accumulator, standardName) {
|
|
805
|
+
var propName = possibleStandardNamesOptimized[standardName];
|
|
806
|
+
|
|
807
|
+
if (propName === SAME) {
|
|
808
|
+
accumulator[standardName] = standardName;
|
|
809
|
+
} else if (propName === CAMELCASE) {
|
|
810
|
+
accumulator[standardName.toLowerCase()] = standardName;
|
|
811
|
+
} else {
|
|
812
|
+
accumulator[standardName] = propName;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
return accumulator;
|
|
816
|
+
}, {});
|
|
817
|
+
|
|
818
|
+
lib$1.BOOLEAN = BOOLEAN;
|
|
819
|
+
lib$1.BOOLEANISH_STRING = BOOLEANISH_STRING;
|
|
820
|
+
lib$1.NUMERIC = NUMERIC;
|
|
821
|
+
lib$1.OVERLOADED_BOOLEAN = OVERLOADED_BOOLEAN;
|
|
822
|
+
lib$1.POSITIVE_NUMERIC = POSITIVE_NUMERIC;
|
|
823
|
+
lib$1.RESERVED = RESERVED;
|
|
824
|
+
lib$1.STRING = STRING;
|
|
825
|
+
lib$1.getPropertyInfo = getPropertyInfo;
|
|
826
|
+
lib$1.isCustomAttribute = isCustomAttribute;
|
|
827
|
+
lib$1.possibleStandardNames = possibleStandardNames;
|
|
828
|
+
|
|
829
|
+
var cjs = {};
|
|
830
|
+
|
|
831
|
+
// http://www.w3.org/TR/CSS21/grammar.html
|
|
832
|
+
// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
|
|
833
|
+
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
834
|
+
|
|
835
|
+
var NEWLINE_REGEX = /\n/g;
|
|
836
|
+
var WHITESPACE_REGEX = /^\s*/;
|
|
837
|
+
|
|
838
|
+
// declaration
|
|
839
|
+
var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
|
|
840
|
+
var COLON_REGEX = /^:\s*/;
|
|
841
|
+
var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
|
|
842
|
+
var SEMICOLON_REGEX = /^[;\s]*/;
|
|
843
|
+
|
|
844
|
+
// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
|
|
845
|
+
var TRIM_REGEX = /^\s+|\s+$/g;
|
|
846
|
+
|
|
847
|
+
// strings
|
|
848
|
+
var NEWLINE = '\n';
|
|
849
|
+
var FORWARD_SLASH = '/';
|
|
850
|
+
var ASTERISK = '*';
|
|
851
|
+
var EMPTY_STRING = '';
|
|
852
|
+
|
|
853
|
+
// types
|
|
854
|
+
var TYPE_COMMENT = 'comment';
|
|
855
|
+
var TYPE_DECLARATION = 'declaration';
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* @param {String} style
|
|
859
|
+
* @param {Object} [options]
|
|
860
|
+
* @return {Object[]}
|
|
861
|
+
* @throws {TypeError}
|
|
862
|
+
* @throws {Error}
|
|
863
|
+
*/
|
|
864
|
+
var inlineStyleParser = function(style, options) {
|
|
865
|
+
if (typeof style !== 'string') {
|
|
866
|
+
throw new TypeError('First argument must be a string');
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
if (!style) return [];
|
|
870
|
+
|
|
871
|
+
options = options || {};
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Positional.
|
|
875
|
+
*/
|
|
876
|
+
var lineno = 1;
|
|
877
|
+
var column = 1;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Update lineno and column based on `str`.
|
|
881
|
+
*
|
|
882
|
+
* @param {String} str
|
|
883
|
+
*/
|
|
884
|
+
function updatePosition(str) {
|
|
885
|
+
var lines = str.match(NEWLINE_REGEX);
|
|
886
|
+
if (lines) lineno += lines.length;
|
|
887
|
+
var i = str.lastIndexOf(NEWLINE);
|
|
888
|
+
column = ~i ? str.length - i : column + str.length;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* Mark position and patch `node.position`.
|
|
893
|
+
*
|
|
894
|
+
* @return {Function}
|
|
895
|
+
*/
|
|
896
|
+
function position() {
|
|
897
|
+
var start = { line: lineno, column: column };
|
|
898
|
+
return function(node) {
|
|
899
|
+
node.position = new Position(start);
|
|
900
|
+
whitespace();
|
|
901
|
+
return node;
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Store position information for a node.
|
|
907
|
+
*
|
|
908
|
+
* @constructor
|
|
909
|
+
* @property {Object} start
|
|
910
|
+
* @property {Object} end
|
|
911
|
+
* @property {undefined|String} source
|
|
912
|
+
*/
|
|
913
|
+
function Position(start) {
|
|
914
|
+
this.start = start;
|
|
915
|
+
this.end = { line: lineno, column: column };
|
|
916
|
+
this.source = options.source;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Non-enumerable source string.
|
|
921
|
+
*/
|
|
922
|
+
Position.prototype.content = style;
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Error `msg`.
|
|
926
|
+
*
|
|
927
|
+
* @param {String} msg
|
|
928
|
+
* @throws {Error}
|
|
929
|
+
*/
|
|
930
|
+
function error(msg) {
|
|
931
|
+
var err = new Error(
|
|
932
|
+
options.source + ':' + lineno + ':' + column + ': ' + msg
|
|
933
|
+
);
|
|
934
|
+
err.reason = msg;
|
|
935
|
+
err.filename = options.source;
|
|
936
|
+
err.line = lineno;
|
|
937
|
+
err.column = column;
|
|
938
|
+
err.source = style;
|
|
939
|
+
|
|
940
|
+
if (options.silent) ; else {
|
|
941
|
+
throw err;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Match `re` and return captures.
|
|
947
|
+
*
|
|
948
|
+
* @param {RegExp} re
|
|
949
|
+
* @return {undefined|Array}
|
|
950
|
+
*/
|
|
951
|
+
function match(re) {
|
|
952
|
+
var m = re.exec(style);
|
|
953
|
+
if (!m) return;
|
|
954
|
+
var str = m[0];
|
|
955
|
+
updatePosition(str);
|
|
956
|
+
style = style.slice(str.length);
|
|
957
|
+
return m;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Parse whitespace.
|
|
962
|
+
*/
|
|
963
|
+
function whitespace() {
|
|
964
|
+
match(WHITESPACE_REGEX);
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* Parse comments.
|
|
969
|
+
*
|
|
970
|
+
* @param {Object[]} [rules]
|
|
971
|
+
* @return {Object[]}
|
|
972
|
+
*/
|
|
973
|
+
function comments(rules) {
|
|
974
|
+
var c;
|
|
975
|
+
rules = rules || [];
|
|
976
|
+
while ((c = comment())) {
|
|
977
|
+
if (c !== false) {
|
|
978
|
+
rules.push(c);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
return rules;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* Parse comment.
|
|
986
|
+
*
|
|
987
|
+
* @return {Object}
|
|
988
|
+
* @throws {Error}
|
|
989
|
+
*/
|
|
990
|
+
function comment() {
|
|
991
|
+
var pos = position();
|
|
992
|
+
if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
|
|
993
|
+
|
|
994
|
+
var i = 2;
|
|
995
|
+
while (
|
|
996
|
+
EMPTY_STRING != style.charAt(i) &&
|
|
997
|
+
(ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))
|
|
998
|
+
) {
|
|
999
|
+
++i;
|
|
1000
|
+
}
|
|
1001
|
+
i += 2;
|
|
1002
|
+
|
|
1003
|
+
if (EMPTY_STRING === style.charAt(i - 1)) {
|
|
1004
|
+
return error('End of comment missing');
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
var str = style.slice(2, i - 2);
|
|
1008
|
+
column += 2;
|
|
1009
|
+
updatePosition(str);
|
|
1010
|
+
style = style.slice(i);
|
|
1011
|
+
column += 2;
|
|
1012
|
+
|
|
1013
|
+
return pos({
|
|
1014
|
+
type: TYPE_COMMENT,
|
|
1015
|
+
comment: str
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Parse declaration.
|
|
1021
|
+
*
|
|
1022
|
+
* @return {Object}
|
|
1023
|
+
* @throws {Error}
|
|
1024
|
+
*/
|
|
1025
|
+
function declaration() {
|
|
1026
|
+
var pos = position();
|
|
1027
|
+
|
|
1028
|
+
// prop
|
|
1029
|
+
var prop = match(PROPERTY_REGEX);
|
|
1030
|
+
if (!prop) return;
|
|
1031
|
+
comment();
|
|
1032
|
+
|
|
1033
|
+
// :
|
|
1034
|
+
if (!match(COLON_REGEX)) return error("property missing ':'");
|
|
1035
|
+
|
|
1036
|
+
// val
|
|
1037
|
+
var val = match(VALUE_REGEX);
|
|
1038
|
+
|
|
1039
|
+
var ret = pos({
|
|
1040
|
+
type: TYPE_DECLARATION,
|
|
1041
|
+
property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
|
|
1042
|
+
value: val
|
|
1043
|
+
? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))
|
|
1044
|
+
: EMPTY_STRING
|
|
1045
|
+
});
|
|
1046
|
+
|
|
1047
|
+
// ;
|
|
1048
|
+
match(SEMICOLON_REGEX);
|
|
1049
|
+
|
|
1050
|
+
return ret;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Parse declarations.
|
|
1055
|
+
*
|
|
1056
|
+
* @return {Object[]}
|
|
1057
|
+
*/
|
|
1058
|
+
function declarations() {
|
|
1059
|
+
var decls = [];
|
|
1060
|
+
|
|
1061
|
+
comments(decls);
|
|
1062
|
+
|
|
1063
|
+
// declarations
|
|
1064
|
+
var decl;
|
|
1065
|
+
while ((decl = declaration())) {
|
|
1066
|
+
if (decl !== false) {
|
|
1067
|
+
decls.push(decl);
|
|
1068
|
+
comments(decls);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
return decls;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
whitespace();
|
|
1076
|
+
return declarations();
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Trim `str`.
|
|
1081
|
+
*
|
|
1082
|
+
* @param {String} str
|
|
1083
|
+
* @return {String}
|
|
1084
|
+
*/
|
|
1085
|
+
function trim(str) {
|
|
1086
|
+
return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
var parse = inlineStyleParser;
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* Parses inline style to object.
|
|
1093
|
+
*
|
|
1094
|
+
* @example
|
|
1095
|
+
* // returns { 'line-height': '42' }
|
|
1096
|
+
* StyleToObject('line-height: 42;');
|
|
1097
|
+
*
|
|
1098
|
+
* @param {String} style - The inline style.
|
|
1099
|
+
* @param {Function} [iterator] - The iterator function.
|
|
1100
|
+
* @return {null|Object}
|
|
1101
|
+
*/
|
|
1102
|
+
function StyleToObject(style, iterator) {
|
|
1103
|
+
var output = null;
|
|
1104
|
+
if (!style || typeof style !== 'string') {
|
|
1105
|
+
return output;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
var declaration;
|
|
1109
|
+
var declarations = parse(style);
|
|
1110
|
+
var hasIterator = typeof iterator === 'function';
|
|
1111
|
+
var property;
|
|
1112
|
+
var value;
|
|
1113
|
+
|
|
1114
|
+
for (var i = 0, len = declarations.length; i < len; i++) {
|
|
1115
|
+
declaration = declarations[i];
|
|
1116
|
+
property = declaration.property;
|
|
1117
|
+
value = declaration.value;
|
|
1118
|
+
|
|
1119
|
+
if (hasIterator) {
|
|
1120
|
+
iterator(property, value, declaration);
|
|
1121
|
+
} else if (value) {
|
|
1122
|
+
output || (output = {});
|
|
1123
|
+
output[property] = value;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
return output;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
var styleToObject = StyleToObject;
|
|
1131
|
+
|
|
1132
|
+
var utilities$4 = {};
|
|
1133
|
+
|
|
1134
|
+
utilities$4.__esModule = true;
|
|
1135
|
+
utilities$4.camelCase = void 0;
|
|
1136
|
+
var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9-]+$/;
|
|
1137
|
+
var HYPHEN_REGEX = /-([a-z])/g;
|
|
1138
|
+
var NO_HYPHEN_REGEX = /^[^-]+$/;
|
|
1139
|
+
var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
|
|
1140
|
+
var skipCamelCase = function (property) {
|
|
1141
|
+
return !property ||
|
|
1142
|
+
NO_HYPHEN_REGEX.test(property) ||
|
|
1143
|
+
CUSTOM_PROPERTY_REGEX.test(property);
|
|
1144
|
+
};
|
|
1145
|
+
var capitalize = function (match, character) {
|
|
1146
|
+
return character.toUpperCase();
|
|
1147
|
+
};
|
|
1148
|
+
var trimHyphen = function (match, prefix) { return prefix + "-"; };
|
|
1149
|
+
var camelCase = function (property, options) {
|
|
1150
|
+
if (options === void 0) { options = {}; }
|
|
1151
|
+
if (skipCamelCase(property)) {
|
|
1152
|
+
return property;
|
|
1153
|
+
}
|
|
1154
|
+
property = property.toLowerCase();
|
|
1155
|
+
if (!options.reactCompat) {
|
|
1156
|
+
property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
|
|
1157
|
+
}
|
|
1158
|
+
return property.replace(HYPHEN_REGEX, capitalize);
|
|
1159
|
+
};
|
|
1160
|
+
utilities$4.camelCase = camelCase;
|
|
1161
|
+
|
|
1162
|
+
(function (exports) {
|
|
1163
|
+
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
1164
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1165
|
+
};
|
|
1166
|
+
exports.__esModule = true;
|
|
1167
|
+
var style_to_object_1 = __importDefault(styleToObject);
|
|
1168
|
+
var utilities_1 = utilities$4;
|
|
1169
|
+
function StyleToJS(style, options) {
|
|
1170
|
+
var output = {};
|
|
1171
|
+
if (!style || typeof style !== 'string') {
|
|
1172
|
+
return output;
|
|
1173
|
+
}
|
|
1174
|
+
style_to_object_1["default"](style, function (property, value) {
|
|
1175
|
+
if (property && value) {
|
|
1176
|
+
output[utilities_1.camelCase(property, options)] = value;
|
|
1177
|
+
}
|
|
1178
|
+
});
|
|
1179
|
+
return output;
|
|
1180
|
+
}
|
|
1181
|
+
exports["default"] = StyleToJS;
|
|
1182
|
+
}(cjs));
|
|
1183
|
+
|
|
1184
|
+
var React$1 = require$$0__default['default'];
|
|
1185
|
+
var styleToJS = cjs.default;
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* Swap key with value in an object.
|
|
1189
|
+
*
|
|
1190
|
+
* @param {Object} obj - The object.
|
|
1191
|
+
* @param {Function} [override] - The override method.
|
|
1192
|
+
* @return {Object} - The inverted object.
|
|
1193
|
+
*/
|
|
1194
|
+
function invertObject(obj, override) {
|
|
1195
|
+
if (!obj || typeof obj !== 'object') {
|
|
1196
|
+
throw new TypeError('First argument must be an object');
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
var key;
|
|
1200
|
+
var value;
|
|
1201
|
+
var isOverridePresent = typeof override === 'function';
|
|
1202
|
+
var overrides = {};
|
|
1203
|
+
var result = {};
|
|
1204
|
+
|
|
1205
|
+
for (key in obj) {
|
|
1206
|
+
value = obj[key];
|
|
1207
|
+
|
|
1208
|
+
if (isOverridePresent) {
|
|
1209
|
+
overrides = override(key, value);
|
|
1210
|
+
if (overrides && overrides.length === 2) {
|
|
1211
|
+
result[overrides[0]] = overrides[1];
|
|
1212
|
+
continue;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
if (typeof value === 'string') {
|
|
1217
|
+
result[value] = key;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
return result;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Check if a given tag is a custom component.
|
|
1226
|
+
*
|
|
1227
|
+
* @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}
|
|
1228
|
+
*
|
|
1229
|
+
* @param {string} tagName - The name of the html tag.
|
|
1230
|
+
* @param {Object} props - The props being passed to the element.
|
|
1231
|
+
* @return {boolean}
|
|
1232
|
+
*/
|
|
1233
|
+
function isCustomComponent(tagName, props) {
|
|
1234
|
+
if (tagName.indexOf('-') === -1) {
|
|
1235
|
+
return props && typeof props.is === 'string';
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
switch (tagName) {
|
|
1239
|
+
// These are reserved SVG and MathML elements.
|
|
1240
|
+
// We don't mind this whitelist too much because we expect it to never grow.
|
|
1241
|
+
// The alternative is to track the namespace in a few places which is convoluted.
|
|
1242
|
+
// https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
|
|
1243
|
+
case 'annotation-xml':
|
|
1244
|
+
case 'color-profile':
|
|
1245
|
+
case 'font-face':
|
|
1246
|
+
case 'font-face-src':
|
|
1247
|
+
case 'font-face-uri':
|
|
1248
|
+
case 'font-face-format':
|
|
1249
|
+
case 'font-face-name':
|
|
1250
|
+
case 'missing-glyph':
|
|
1251
|
+
return false;
|
|
1252
|
+
default:
|
|
1253
|
+
return true;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
var styleToJSOptions = { reactCompat: true };
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* Sets style prop.
|
|
1261
|
+
*
|
|
1262
|
+
* @param {null|undefined|string} style
|
|
1263
|
+
* @param {object} props
|
|
1264
|
+
*/
|
|
1265
|
+
function setStyleProp$1(style, props) {
|
|
1266
|
+
if (style === null || style === undefined) {
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1269
|
+
try {
|
|
1270
|
+
props.style = styleToJS(style, styleToJSOptions);
|
|
1271
|
+
} catch (err) {
|
|
1272
|
+
props.style = {};
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* @constant {boolean}
|
|
1278
|
+
* @see {@link https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html}
|
|
1279
|
+
*/
|
|
1280
|
+
var PRESERVE_CUSTOM_ATTRIBUTES = React$1.version.split('.')[0] >= 16;
|
|
1281
|
+
|
|
1282
|
+
var utilities$3 = {
|
|
1283
|
+
PRESERVE_CUSTOM_ATTRIBUTES: PRESERVE_CUSTOM_ATTRIBUTES,
|
|
1284
|
+
invertObject: invertObject,
|
|
1285
|
+
isCustomComponent: isCustomComponent,
|
|
1286
|
+
setStyleProp: setStyleProp$1
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
var reactProperty = lib$1;
|
|
1290
|
+
var utilities$2 = utilities$3;
|
|
1291
|
+
|
|
1292
|
+
/**
|
|
1293
|
+
* Converts HTML/SVG DOM attributes to React props.
|
|
1294
|
+
*
|
|
1295
|
+
* @param {object} [attributes={}] - HTML/SVG DOM attributes.
|
|
1296
|
+
* @return {object} - React props.
|
|
1297
|
+
*/
|
|
1298
|
+
var attributesToProps$2 = function attributesToProps(attributes) {
|
|
1299
|
+
attributes = attributes || {};
|
|
1300
|
+
|
|
1301
|
+
var attributeName;
|
|
1302
|
+
var attributeNameLowerCased;
|
|
1303
|
+
var attributeValue;
|
|
1304
|
+
var propName;
|
|
1305
|
+
var propertyInfo;
|
|
1306
|
+
var props = {};
|
|
1307
|
+
|
|
1308
|
+
for (attributeName in attributes) {
|
|
1309
|
+
attributeValue = attributes[attributeName];
|
|
1310
|
+
|
|
1311
|
+
// ARIA (aria-*) or custom data (data-*) attribute
|
|
1312
|
+
if (reactProperty.isCustomAttribute(attributeName)) {
|
|
1313
|
+
props[attributeName] = attributeValue;
|
|
1314
|
+
continue;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
// convert HTML/SVG attribute to React prop
|
|
1318
|
+
attributeNameLowerCased = attributeName.toLowerCase();
|
|
1319
|
+
propName = reactProperty.possibleStandardNames[attributeNameLowerCased];
|
|
1320
|
+
|
|
1321
|
+
if (propName) {
|
|
1322
|
+
props[propName] = attributeValue;
|
|
1323
|
+
propertyInfo = reactProperty.getPropertyInfo(propName);
|
|
1324
|
+
switch (propertyInfo && propertyInfo.type) {
|
|
1325
|
+
case reactProperty.BOOLEAN:
|
|
1326
|
+
props[propName] = true;
|
|
1327
|
+
break;
|
|
1328
|
+
case reactProperty.OVERLOADED_BOOLEAN:
|
|
1329
|
+
if (attributeValue === '') {
|
|
1330
|
+
props[propName] = true;
|
|
1331
|
+
}
|
|
1332
|
+
break;
|
|
1333
|
+
}
|
|
1334
|
+
continue;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
// preserve custom attribute if React >=16
|
|
1338
|
+
if (utilities$2.PRESERVE_CUSTOM_ATTRIBUTES) {
|
|
1339
|
+
props[attributeName] = attributeValue;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
// transform inline style to object
|
|
1344
|
+
utilities$2.setStyleProp(attributes.style, props);
|
|
1345
|
+
|
|
1346
|
+
return props;
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1349
|
+
var React = require$$0__default['default'];
|
|
1350
|
+
var attributesToProps$1 = attributesToProps$2;
|
|
1351
|
+
var utilities$1 = utilities$3;
|
|
1352
|
+
|
|
1353
|
+
var setStyleProp = utilities$1.setStyleProp;
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* Converts DOM nodes to JSX element(s).
|
|
1357
|
+
*
|
|
1358
|
+
* @param {DomElement[]} nodes - DOM nodes.
|
|
1359
|
+
* @param {object} [options={}] - Options.
|
|
1360
|
+
* @param {Function} [options.replace] - Replacer.
|
|
1361
|
+
* @param {object} [options.library] - Library (React/Preact/etc.).
|
|
1362
|
+
* @return {string|JSX.Element|JSX.Element[]}
|
|
1363
|
+
*/
|
|
1364
|
+
function domToReact$1(nodes, options) {
|
|
1365
|
+
options = options || {};
|
|
1366
|
+
|
|
1367
|
+
var library = options.library || React;
|
|
1368
|
+
var cloneElement = library.cloneElement;
|
|
1369
|
+
var createElement = library.createElement;
|
|
1370
|
+
var isValidElement = library.isValidElement;
|
|
1371
|
+
|
|
1372
|
+
var result = [];
|
|
1373
|
+
var node;
|
|
1374
|
+
var hasReplace = typeof options.replace === 'function';
|
|
1375
|
+
var replaceElement;
|
|
1376
|
+
var props;
|
|
1377
|
+
var children;
|
|
1378
|
+
var data;
|
|
1379
|
+
var trim = options.trim;
|
|
1380
|
+
|
|
1381
|
+
for (var i = 0, len = nodes.length; i < len; i++) {
|
|
1382
|
+
node = nodes[i];
|
|
1383
|
+
|
|
1384
|
+
// replace with custom React element (if present)
|
|
1385
|
+
if (hasReplace) {
|
|
1386
|
+
replaceElement = options.replace(node);
|
|
1387
|
+
|
|
1388
|
+
if (isValidElement(replaceElement)) {
|
|
1389
|
+
// set "key" prop for sibling elements
|
|
1390
|
+
// https://fb.me/react-warning-keys
|
|
1391
|
+
if (len > 1) {
|
|
1392
|
+
replaceElement = cloneElement(replaceElement, {
|
|
1393
|
+
key: replaceElement.key || i
|
|
1394
|
+
});
|
|
1395
|
+
}
|
|
1396
|
+
result.push(replaceElement);
|
|
1397
|
+
continue;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
if (node.type === 'text') {
|
|
1402
|
+
// if trim option is enabled, skip whitespace text nodes
|
|
1403
|
+
if (trim) {
|
|
1404
|
+
data = node.data.trim();
|
|
1405
|
+
if (data) {
|
|
1406
|
+
result.push(node.data);
|
|
1407
|
+
}
|
|
1408
|
+
} else {
|
|
1409
|
+
result.push(node.data);
|
|
1410
|
+
}
|
|
1411
|
+
continue;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
props = node.attribs;
|
|
1415
|
+
if (skipAttributesToProps(node)) {
|
|
1416
|
+
setStyleProp(props.style, props);
|
|
1417
|
+
} else if (props) {
|
|
1418
|
+
props = attributesToProps$1(props);
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
children = null;
|
|
1422
|
+
|
|
1423
|
+
switch (node.type) {
|
|
1424
|
+
case 'script':
|
|
1425
|
+
case 'style':
|
|
1426
|
+
// prevent text in <script> or <style> from being escaped
|
|
1427
|
+
// https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml
|
|
1428
|
+
if (node.children[0]) {
|
|
1429
|
+
props.dangerouslySetInnerHTML = {
|
|
1430
|
+
__html: node.children[0].data
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
break;
|
|
1434
|
+
|
|
1435
|
+
case 'tag':
|
|
1436
|
+
// setting textarea value in children is an antipattern in React
|
|
1437
|
+
// https://reactjs.org/docs/forms.html#the-textarea-tag
|
|
1438
|
+
if (node.name === 'textarea' && node.children[0]) {
|
|
1439
|
+
props.defaultValue = node.children[0].data;
|
|
1440
|
+
} else if (node.children && node.children.length) {
|
|
1441
|
+
// continue recursion of creating React elements (if applicable)
|
|
1442
|
+
children = domToReact$1(node.children, options);
|
|
1443
|
+
}
|
|
1444
|
+
break;
|
|
1445
|
+
|
|
1446
|
+
// skip all other cases (e.g., comment)
|
|
1447
|
+
default:
|
|
1448
|
+
continue;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
// set "key" prop for sibling elements
|
|
1452
|
+
// https://fb.me/react-warning-keys
|
|
1453
|
+
if (len > 1) {
|
|
1454
|
+
props.key = i;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
result.push(createElement(node.name, props, children));
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
return result.length === 1 ? result[0] : result;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
/**
|
|
1464
|
+
* Determines whether DOM element attributes should be transformed to props.
|
|
1465
|
+
* Web Components should not have their attributes transformed except for `style`.
|
|
1466
|
+
*
|
|
1467
|
+
* @param {DomElement} node
|
|
1468
|
+
* @return {boolean}
|
|
1469
|
+
*/
|
|
1470
|
+
function skipAttributesToProps(node) {
|
|
1471
|
+
return (
|
|
1472
|
+
utilities$1.PRESERVE_CUSTOM_ATTRIBUTES &&
|
|
1473
|
+
node.type === 'tag' &&
|
|
1474
|
+
utilities$1.isCustomComponent(node.name, node.attribs)
|
|
1475
|
+
);
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
var domToReact_1 = domToReact$1;
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* SVG elements are case-sensitive.
|
|
1482
|
+
*
|
|
1483
|
+
* @see {@link https://developer.mozilla.org/docs/Web/SVG/Element#SVG_elements_A_to_Z}
|
|
1484
|
+
*/
|
|
1485
|
+
|
|
1486
|
+
var CASE_SENSITIVE_TAG_NAMES$1 = [
|
|
1487
|
+
'animateMotion',
|
|
1488
|
+
'animateTransform',
|
|
1489
|
+
'clipPath',
|
|
1490
|
+
'feBlend',
|
|
1491
|
+
'feColorMatrix',
|
|
1492
|
+
'feComponentTransfer',
|
|
1493
|
+
'feComposite',
|
|
1494
|
+
'feConvolveMatrix',
|
|
1495
|
+
'feDiffuseLighting',
|
|
1496
|
+
'feDisplacementMap',
|
|
1497
|
+
'feDropShadow',
|
|
1498
|
+
'feFlood',
|
|
1499
|
+
'feFuncA',
|
|
1500
|
+
'feFuncB',
|
|
1501
|
+
'feFuncG',
|
|
1502
|
+
'feFuncR',
|
|
1503
|
+
'feGaussainBlur',
|
|
1504
|
+
'feImage',
|
|
1505
|
+
'feMerge',
|
|
1506
|
+
'feMergeNode',
|
|
1507
|
+
'feMorphology',
|
|
1508
|
+
'feOffset',
|
|
1509
|
+
'fePointLight',
|
|
1510
|
+
'feSpecularLighting',
|
|
1511
|
+
'feSpotLight',
|
|
1512
|
+
'feTile',
|
|
1513
|
+
'feTurbulence',
|
|
1514
|
+
'foreignObject',
|
|
1515
|
+
'linearGradient',
|
|
1516
|
+
'radialGradient',
|
|
1517
|
+
'textPath'
|
|
1518
|
+
];
|
|
1519
|
+
|
|
1520
|
+
var constants$1 = {
|
|
1521
|
+
CASE_SENSITIVE_TAG_NAMES: CASE_SENSITIVE_TAG_NAMES$1
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1524
|
+
var node = {};
|
|
1525
|
+
|
|
1526
|
+
var lib = {};
|
|
1527
|
+
|
|
1528
|
+
(function (exports) {
|
|
1529
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1530
|
+
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
|
|
1531
|
+
/** Types of elements found in htmlparser2's DOM */
|
|
1532
|
+
var ElementType;
|
|
1533
|
+
(function (ElementType) {
|
|
1534
|
+
/** Type for the root element of a document */
|
|
1535
|
+
ElementType["Root"] = "root";
|
|
1536
|
+
/** Type for Text */
|
|
1537
|
+
ElementType["Text"] = "text";
|
|
1538
|
+
/** Type for <? ... ?> */
|
|
1539
|
+
ElementType["Directive"] = "directive";
|
|
1540
|
+
/** Type for <!-- ... --> */
|
|
1541
|
+
ElementType["Comment"] = "comment";
|
|
1542
|
+
/** Type for <script> tags */
|
|
1543
|
+
ElementType["Script"] = "script";
|
|
1544
|
+
/** Type for <style> tags */
|
|
1545
|
+
ElementType["Style"] = "style";
|
|
1546
|
+
/** Type for Any tag */
|
|
1547
|
+
ElementType["Tag"] = "tag";
|
|
1548
|
+
/** Type for <![CDATA[ ... ]]> */
|
|
1549
|
+
ElementType["CDATA"] = "cdata";
|
|
1550
|
+
/** Type for <!doctype ...> */
|
|
1551
|
+
ElementType["Doctype"] = "doctype";
|
|
1552
|
+
})(ElementType = exports.ElementType || (exports.ElementType = {}));
|
|
1553
|
+
/**
|
|
1554
|
+
* Tests whether an element is a tag or not.
|
|
1555
|
+
*
|
|
1556
|
+
* @param elem Element to test
|
|
1557
|
+
*/
|
|
1558
|
+
function isTag(elem) {
|
|
1559
|
+
return (elem.type === ElementType.Tag ||
|
|
1560
|
+
elem.type === ElementType.Script ||
|
|
1561
|
+
elem.type === ElementType.Style);
|
|
1562
|
+
}
|
|
1563
|
+
exports.isTag = isTag;
|
|
1564
|
+
// Exports for backwards compatibility
|
|
1565
|
+
/** Type for the root element of a document */
|
|
1566
|
+
exports.Root = ElementType.Root;
|
|
1567
|
+
/** Type for Text */
|
|
1568
|
+
exports.Text = ElementType.Text;
|
|
1569
|
+
/** Type for <? ... ?> */
|
|
1570
|
+
exports.Directive = ElementType.Directive;
|
|
1571
|
+
/** Type for <!-- ... --> */
|
|
1572
|
+
exports.Comment = ElementType.Comment;
|
|
1573
|
+
/** Type for <script> tags */
|
|
1574
|
+
exports.Script = ElementType.Script;
|
|
1575
|
+
/** Type for <style> tags */
|
|
1576
|
+
exports.Style = ElementType.Style;
|
|
1577
|
+
/** Type for Any tag */
|
|
1578
|
+
exports.Tag = ElementType.Tag;
|
|
1579
|
+
/** Type for <![CDATA[ ... ]]> */
|
|
1580
|
+
exports.CDATA = ElementType.CDATA;
|
|
1581
|
+
/** Type for <!doctype ...> */
|
|
1582
|
+
exports.Doctype = ElementType.Doctype;
|
|
1583
|
+
}(lib));
|
|
1584
|
+
|
|
1585
|
+
var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
|
|
1586
|
+
var extendStatics = function (d, b) {
|
|
1587
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1588
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1589
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1590
|
+
return extendStatics(d, b);
|
|
1591
|
+
};
|
|
1592
|
+
return function (d, b) {
|
|
1593
|
+
if (typeof b !== "function" && b !== null)
|
|
1594
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1595
|
+
extendStatics(d, b);
|
|
1596
|
+
function __() { this.constructor = d; }
|
|
1597
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1598
|
+
};
|
|
1599
|
+
})();
|
|
1600
|
+
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
1601
|
+
__assign = Object.assign || function(t) {
|
|
1602
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1603
|
+
s = arguments[i];
|
|
1604
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1605
|
+
t[p] = s[p];
|
|
1606
|
+
}
|
|
1607
|
+
return t;
|
|
1608
|
+
};
|
|
1609
|
+
return __assign.apply(this, arguments);
|
|
1610
|
+
};
|
|
1611
|
+
Object.defineProperty(node, "__esModule", { value: true });
|
|
1612
|
+
node.cloneNode = node.hasChildren = node.isDocument = node.isDirective = node.isComment = node.isText = node.isCDATA = node.isTag = node.Element = node.Document = node.NodeWithChildren = node.ProcessingInstruction = node.Comment = node.Text = node.DataNode = node.Node = void 0;
|
|
1613
|
+
var domelementtype_1 = lib;
|
|
1614
|
+
var nodeTypes = new Map([
|
|
1615
|
+
[domelementtype_1.ElementType.Tag, 1],
|
|
1616
|
+
[domelementtype_1.ElementType.Script, 1],
|
|
1617
|
+
[domelementtype_1.ElementType.Style, 1],
|
|
1618
|
+
[domelementtype_1.ElementType.Directive, 1],
|
|
1619
|
+
[domelementtype_1.ElementType.Text, 3],
|
|
1620
|
+
[domelementtype_1.ElementType.CDATA, 4],
|
|
1621
|
+
[domelementtype_1.ElementType.Comment, 8],
|
|
1622
|
+
[domelementtype_1.ElementType.Root, 9],
|
|
1623
|
+
]);
|
|
1624
|
+
/**
|
|
1625
|
+
* This object will be used as the prototype for Nodes when creating a
|
|
1626
|
+
* DOM-Level-1-compliant structure.
|
|
1627
|
+
*/
|
|
1628
|
+
var Node = /** @class */ (function () {
|
|
1629
|
+
/**
|
|
1630
|
+
*
|
|
1631
|
+
* @param type The type of the node.
|
|
1632
|
+
*/
|
|
1633
|
+
function Node(type) {
|
|
1634
|
+
this.type = type;
|
|
1635
|
+
/** Parent of the node */
|
|
1636
|
+
this.parent = null;
|
|
1637
|
+
/** Previous sibling */
|
|
1638
|
+
this.prev = null;
|
|
1639
|
+
/** Next sibling */
|
|
1640
|
+
this.next = null;
|
|
1641
|
+
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
|
1642
|
+
this.startIndex = null;
|
|
1643
|
+
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
|
1644
|
+
this.endIndex = null;
|
|
1645
|
+
}
|
|
1646
|
+
Object.defineProperty(Node.prototype, "nodeType", {
|
|
1647
|
+
// Read-only aliases
|
|
1648
|
+
get: function () {
|
|
1649
|
+
var _a;
|
|
1650
|
+
return (_a = nodeTypes.get(this.type)) !== null && _a !== void 0 ? _a : 1;
|
|
1651
|
+
},
|
|
1652
|
+
enumerable: false,
|
|
1653
|
+
configurable: true
|
|
1654
|
+
});
|
|
1655
|
+
Object.defineProperty(Node.prototype, "parentNode", {
|
|
1656
|
+
// Read-write aliases for properties
|
|
1657
|
+
get: function () {
|
|
1658
|
+
return this.parent;
|
|
1659
|
+
},
|
|
1660
|
+
set: function (parent) {
|
|
1661
|
+
this.parent = parent;
|
|
1662
|
+
},
|
|
1663
|
+
enumerable: false,
|
|
1664
|
+
configurable: true
|
|
1665
|
+
});
|
|
1666
|
+
Object.defineProperty(Node.prototype, "previousSibling", {
|
|
1667
|
+
get: function () {
|
|
1668
|
+
return this.prev;
|
|
1669
|
+
},
|
|
1670
|
+
set: function (prev) {
|
|
1671
|
+
this.prev = prev;
|
|
1672
|
+
},
|
|
1673
|
+
enumerable: false,
|
|
1674
|
+
configurable: true
|
|
1675
|
+
});
|
|
1676
|
+
Object.defineProperty(Node.prototype, "nextSibling", {
|
|
1677
|
+
get: function () {
|
|
1678
|
+
return this.next;
|
|
1679
|
+
},
|
|
1680
|
+
set: function (next) {
|
|
1681
|
+
this.next = next;
|
|
1682
|
+
},
|
|
1683
|
+
enumerable: false,
|
|
1684
|
+
configurable: true
|
|
1685
|
+
});
|
|
1686
|
+
/**
|
|
1687
|
+
* Clone this node, and optionally its children.
|
|
1688
|
+
*
|
|
1689
|
+
* @param recursive Clone child nodes as well.
|
|
1690
|
+
* @returns A clone of the node.
|
|
1691
|
+
*/
|
|
1692
|
+
Node.prototype.cloneNode = function (recursive) {
|
|
1693
|
+
if (recursive === void 0) { recursive = false; }
|
|
1694
|
+
return cloneNode(this, recursive);
|
|
1695
|
+
};
|
|
1696
|
+
return Node;
|
|
1697
|
+
}());
|
|
1698
|
+
node.Node = Node;
|
|
1699
|
+
/**
|
|
1700
|
+
* A node that contains some data.
|
|
1701
|
+
*/
|
|
1702
|
+
var DataNode = /** @class */ (function (_super) {
|
|
1703
|
+
__extends(DataNode, _super);
|
|
1704
|
+
/**
|
|
1705
|
+
* @param type The type of the node
|
|
1706
|
+
* @param data The content of the data node
|
|
1707
|
+
*/
|
|
1708
|
+
function DataNode(type, data) {
|
|
1709
|
+
var _this = _super.call(this, type) || this;
|
|
1710
|
+
_this.data = data;
|
|
1711
|
+
return _this;
|
|
1712
|
+
}
|
|
1713
|
+
Object.defineProperty(DataNode.prototype, "nodeValue", {
|
|
1714
|
+
get: function () {
|
|
1715
|
+
return this.data;
|
|
1716
|
+
},
|
|
1717
|
+
set: function (data) {
|
|
1718
|
+
this.data = data;
|
|
1719
|
+
},
|
|
1720
|
+
enumerable: false,
|
|
1721
|
+
configurable: true
|
|
1722
|
+
});
|
|
1723
|
+
return DataNode;
|
|
1724
|
+
}(Node));
|
|
1725
|
+
node.DataNode = DataNode;
|
|
1726
|
+
/**
|
|
1727
|
+
* Text within the document.
|
|
1728
|
+
*/
|
|
1729
|
+
var Text$1 = /** @class */ (function (_super) {
|
|
1730
|
+
__extends(Text, _super);
|
|
1731
|
+
function Text(data) {
|
|
1732
|
+
return _super.call(this, domelementtype_1.ElementType.Text, data) || this;
|
|
1733
|
+
}
|
|
1734
|
+
return Text;
|
|
1735
|
+
}(DataNode));
|
|
1736
|
+
node.Text = Text$1;
|
|
1737
|
+
/**
|
|
1738
|
+
* Comments within the document.
|
|
1739
|
+
*/
|
|
1740
|
+
var Comment$1 = /** @class */ (function (_super) {
|
|
1741
|
+
__extends(Comment, _super);
|
|
1742
|
+
function Comment(data) {
|
|
1743
|
+
return _super.call(this, domelementtype_1.ElementType.Comment, data) || this;
|
|
1744
|
+
}
|
|
1745
|
+
return Comment;
|
|
1746
|
+
}(DataNode));
|
|
1747
|
+
node.Comment = Comment$1;
|
|
1748
|
+
/**
|
|
1749
|
+
* Processing instructions, including doc types.
|
|
1750
|
+
*/
|
|
1751
|
+
var ProcessingInstruction$1 = /** @class */ (function (_super) {
|
|
1752
|
+
__extends(ProcessingInstruction, _super);
|
|
1753
|
+
function ProcessingInstruction(name, data) {
|
|
1754
|
+
var _this = _super.call(this, domelementtype_1.ElementType.Directive, data) || this;
|
|
1755
|
+
_this.name = name;
|
|
1756
|
+
return _this;
|
|
1757
|
+
}
|
|
1758
|
+
return ProcessingInstruction;
|
|
1759
|
+
}(DataNode));
|
|
1760
|
+
node.ProcessingInstruction = ProcessingInstruction$1;
|
|
1761
|
+
/**
|
|
1762
|
+
* A `Node` that can have children.
|
|
1763
|
+
*/
|
|
1764
|
+
var NodeWithChildren = /** @class */ (function (_super) {
|
|
1765
|
+
__extends(NodeWithChildren, _super);
|
|
1766
|
+
/**
|
|
1767
|
+
* @param type Type of the node.
|
|
1768
|
+
* @param children Children of the node. Only certain node types can have children.
|
|
1769
|
+
*/
|
|
1770
|
+
function NodeWithChildren(type, children) {
|
|
1771
|
+
var _this = _super.call(this, type) || this;
|
|
1772
|
+
_this.children = children;
|
|
1773
|
+
return _this;
|
|
1774
|
+
}
|
|
1775
|
+
Object.defineProperty(NodeWithChildren.prototype, "firstChild", {
|
|
1776
|
+
// Aliases
|
|
1777
|
+
get: function () {
|
|
1778
|
+
var _a;
|
|
1779
|
+
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
|
1780
|
+
},
|
|
1781
|
+
enumerable: false,
|
|
1782
|
+
configurable: true
|
|
1783
|
+
});
|
|
1784
|
+
Object.defineProperty(NodeWithChildren.prototype, "lastChild", {
|
|
1785
|
+
get: function () {
|
|
1786
|
+
return this.children.length > 0
|
|
1787
|
+
? this.children[this.children.length - 1]
|
|
1788
|
+
: null;
|
|
1789
|
+
},
|
|
1790
|
+
enumerable: false,
|
|
1791
|
+
configurable: true
|
|
1792
|
+
});
|
|
1793
|
+
Object.defineProperty(NodeWithChildren.prototype, "childNodes", {
|
|
1794
|
+
get: function () {
|
|
1795
|
+
return this.children;
|
|
1796
|
+
},
|
|
1797
|
+
set: function (children) {
|
|
1798
|
+
this.children = children;
|
|
1799
|
+
},
|
|
1800
|
+
enumerable: false,
|
|
1801
|
+
configurable: true
|
|
1802
|
+
});
|
|
1803
|
+
return NodeWithChildren;
|
|
1804
|
+
}(Node));
|
|
1805
|
+
node.NodeWithChildren = NodeWithChildren;
|
|
1806
|
+
/**
|
|
1807
|
+
* The root node of the document.
|
|
1808
|
+
*/
|
|
1809
|
+
var Document = /** @class */ (function (_super) {
|
|
1810
|
+
__extends(Document, _super);
|
|
1811
|
+
function Document(children) {
|
|
1812
|
+
return _super.call(this, domelementtype_1.ElementType.Root, children) || this;
|
|
1813
|
+
}
|
|
1814
|
+
return Document;
|
|
1815
|
+
}(NodeWithChildren));
|
|
1816
|
+
node.Document = Document;
|
|
1817
|
+
/**
|
|
1818
|
+
* An element within the DOM.
|
|
1819
|
+
*/
|
|
1820
|
+
var Element$1 = /** @class */ (function (_super) {
|
|
1821
|
+
__extends(Element, _super);
|
|
1822
|
+
/**
|
|
1823
|
+
* @param name Name of the tag, eg. `div`, `span`.
|
|
1824
|
+
* @param attribs Object mapping attribute names to attribute values.
|
|
1825
|
+
* @param children Children of the node.
|
|
1826
|
+
*/
|
|
1827
|
+
function Element(name, attribs, children, type) {
|
|
1828
|
+
if (children === void 0) { children = []; }
|
|
1829
|
+
if (type === void 0) { type = name === "script"
|
|
1830
|
+
? domelementtype_1.ElementType.Script
|
|
1831
|
+
: name === "style"
|
|
1832
|
+
? domelementtype_1.ElementType.Style
|
|
1833
|
+
: domelementtype_1.ElementType.Tag; }
|
|
1834
|
+
var _this = _super.call(this, type, children) || this;
|
|
1835
|
+
_this.name = name;
|
|
1836
|
+
_this.attribs = attribs;
|
|
1837
|
+
return _this;
|
|
1838
|
+
}
|
|
1839
|
+
Object.defineProperty(Element.prototype, "tagName", {
|
|
1840
|
+
// DOM Level 1 aliases
|
|
1841
|
+
get: function () {
|
|
1842
|
+
return this.name;
|
|
1843
|
+
},
|
|
1844
|
+
set: function (name) {
|
|
1845
|
+
this.name = name;
|
|
1846
|
+
},
|
|
1847
|
+
enumerable: false,
|
|
1848
|
+
configurable: true
|
|
1849
|
+
});
|
|
1850
|
+
Object.defineProperty(Element.prototype, "attributes", {
|
|
1851
|
+
get: function () {
|
|
1852
|
+
var _this = this;
|
|
1853
|
+
return Object.keys(this.attribs).map(function (name) {
|
|
1854
|
+
var _a, _b;
|
|
1855
|
+
return ({
|
|
1856
|
+
name: name,
|
|
1857
|
+
value: _this.attribs[name],
|
|
1858
|
+
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
|
|
1859
|
+
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name],
|
|
1860
|
+
});
|
|
1861
|
+
});
|
|
1862
|
+
},
|
|
1863
|
+
enumerable: false,
|
|
1864
|
+
configurable: true
|
|
1865
|
+
});
|
|
1866
|
+
return Element;
|
|
1867
|
+
}(NodeWithChildren));
|
|
1868
|
+
node.Element = Element$1;
|
|
1869
|
+
/**
|
|
1870
|
+
* @param node Node to check.
|
|
1871
|
+
* @returns `true` if the node is a `Element`, `false` otherwise.
|
|
1872
|
+
*/
|
|
1873
|
+
function isTag(node) {
|
|
1874
|
+
return (0, domelementtype_1.isTag)(node);
|
|
1875
|
+
}
|
|
1876
|
+
node.isTag = isTag;
|
|
1877
|
+
/**
|
|
1878
|
+
* @param node Node to check.
|
|
1879
|
+
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
|
1880
|
+
*/
|
|
1881
|
+
function isCDATA(node) {
|
|
1882
|
+
return node.type === domelementtype_1.ElementType.CDATA;
|
|
1883
|
+
}
|
|
1884
|
+
node.isCDATA = isCDATA;
|
|
1885
|
+
/**
|
|
1886
|
+
* @param node Node to check.
|
|
1887
|
+
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
|
1888
|
+
*/
|
|
1889
|
+
function isText(node) {
|
|
1890
|
+
return node.type === domelementtype_1.ElementType.Text;
|
|
1891
|
+
}
|
|
1892
|
+
node.isText = isText;
|
|
1893
|
+
/**
|
|
1894
|
+
* @param node Node to check.
|
|
1895
|
+
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
|
1896
|
+
*/
|
|
1897
|
+
function isComment(node) {
|
|
1898
|
+
return node.type === domelementtype_1.ElementType.Comment;
|
|
1899
|
+
}
|
|
1900
|
+
node.isComment = isComment;
|
|
1901
|
+
/**
|
|
1902
|
+
* @param node Node to check.
|
|
1903
|
+
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
1904
|
+
*/
|
|
1905
|
+
function isDirective(node) {
|
|
1906
|
+
return node.type === domelementtype_1.ElementType.Directive;
|
|
1907
|
+
}
|
|
1908
|
+
node.isDirective = isDirective;
|
|
1909
|
+
/**
|
|
1910
|
+
* @param node Node to check.
|
|
1911
|
+
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
1912
|
+
*/
|
|
1913
|
+
function isDocument(node) {
|
|
1914
|
+
return node.type === domelementtype_1.ElementType.Root;
|
|
1915
|
+
}
|
|
1916
|
+
node.isDocument = isDocument;
|
|
1917
|
+
/**
|
|
1918
|
+
* @param node Node to check.
|
|
1919
|
+
* @returns `true` if the node is a `NodeWithChildren` (has children), `false` otherwise.
|
|
1920
|
+
*/
|
|
1921
|
+
function hasChildren(node) {
|
|
1922
|
+
return Object.prototype.hasOwnProperty.call(node, "children");
|
|
1923
|
+
}
|
|
1924
|
+
node.hasChildren = hasChildren;
|
|
1925
|
+
/**
|
|
1926
|
+
* Clone a node, and optionally its children.
|
|
1927
|
+
*
|
|
1928
|
+
* @param recursive Clone child nodes as well.
|
|
1929
|
+
* @returns A clone of the node.
|
|
1930
|
+
*/
|
|
1931
|
+
function cloneNode(node, recursive) {
|
|
1932
|
+
if (recursive === void 0) { recursive = false; }
|
|
1933
|
+
var result;
|
|
1934
|
+
if (isText(node)) {
|
|
1935
|
+
result = new Text$1(node.data);
|
|
1936
|
+
}
|
|
1937
|
+
else if (isComment(node)) {
|
|
1938
|
+
result = new Comment$1(node.data);
|
|
1939
|
+
}
|
|
1940
|
+
else if (isTag(node)) {
|
|
1941
|
+
var children = recursive ? cloneChildren(node.children) : [];
|
|
1942
|
+
var clone_1 = new Element$1(node.name, __assign({}, node.attribs), children);
|
|
1943
|
+
children.forEach(function (child) { return (child.parent = clone_1); });
|
|
1944
|
+
if (node["x-attribsNamespace"]) {
|
|
1945
|
+
clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]);
|
|
1946
|
+
}
|
|
1947
|
+
if (node["x-attribsPrefix"]) {
|
|
1948
|
+
clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]);
|
|
1949
|
+
}
|
|
1950
|
+
result = clone_1;
|
|
1951
|
+
}
|
|
1952
|
+
else if (isCDATA(node)) {
|
|
1953
|
+
var children = recursive ? cloneChildren(node.children) : [];
|
|
1954
|
+
var clone_2 = new NodeWithChildren(domelementtype_1.ElementType.CDATA, children);
|
|
1955
|
+
children.forEach(function (child) { return (child.parent = clone_2); });
|
|
1956
|
+
result = clone_2;
|
|
1957
|
+
}
|
|
1958
|
+
else if (isDocument(node)) {
|
|
1959
|
+
var children = recursive ? cloneChildren(node.children) : [];
|
|
1960
|
+
var clone_3 = new Document(children);
|
|
1961
|
+
children.forEach(function (child) { return (child.parent = clone_3); });
|
|
1962
|
+
if (node["x-mode"]) {
|
|
1963
|
+
clone_3["x-mode"] = node["x-mode"];
|
|
1964
|
+
}
|
|
1965
|
+
result = clone_3;
|
|
1966
|
+
}
|
|
1967
|
+
else if (isDirective(node)) {
|
|
1968
|
+
var instruction = new ProcessingInstruction$1(node.name, node.data);
|
|
1969
|
+
if (node["x-name"] != null) {
|
|
1970
|
+
instruction["x-name"] = node["x-name"];
|
|
1971
|
+
instruction["x-publicId"] = node["x-publicId"];
|
|
1972
|
+
instruction["x-systemId"] = node["x-systemId"];
|
|
1973
|
+
}
|
|
1974
|
+
result = instruction;
|
|
1975
|
+
}
|
|
1976
|
+
else {
|
|
1977
|
+
throw new Error("Not implemented yet: " + node.type);
|
|
1978
|
+
}
|
|
1979
|
+
result.startIndex = node.startIndex;
|
|
1980
|
+
result.endIndex = node.endIndex;
|
|
1981
|
+
return result;
|
|
1982
|
+
}
|
|
1983
|
+
node.cloneNode = cloneNode;
|
|
1984
|
+
function cloneChildren(childs) {
|
|
1985
|
+
var children = childs.map(function (child) { return cloneNode(child, true); });
|
|
1986
|
+
for (var i = 1; i < children.length; i++) {
|
|
1987
|
+
children[i].prev = children[i - 1];
|
|
1988
|
+
children[i - 1].next = children[i];
|
|
1989
|
+
}
|
|
1990
|
+
return children;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
var constants = constants$1;
|
|
1994
|
+
var domhandler = node;
|
|
1995
|
+
|
|
1996
|
+
var CASE_SENSITIVE_TAG_NAMES = constants.CASE_SENSITIVE_TAG_NAMES;
|
|
1997
|
+
|
|
1998
|
+
var Comment = domhandler.Comment;
|
|
1999
|
+
var Element = domhandler.Element;
|
|
2000
|
+
var ProcessingInstruction = domhandler.ProcessingInstruction;
|
|
2001
|
+
var Text = domhandler.Text;
|
|
2002
|
+
|
|
2003
|
+
var caseSensitiveTagNamesMap = {};
|
|
2004
|
+
var tagName;
|
|
2005
|
+
|
|
2006
|
+
for (var i = 0, len = CASE_SENSITIVE_TAG_NAMES.length; i < len; i++) {
|
|
2007
|
+
tagName = CASE_SENSITIVE_TAG_NAMES[i];
|
|
2008
|
+
caseSensitiveTagNamesMap[tagName.toLowerCase()] = tagName;
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
/**
|
|
2012
|
+
* Gets case-sensitive tag name.
|
|
2013
|
+
*
|
|
2014
|
+
* @param {string} tagName - Tag name in lowercase.
|
|
2015
|
+
* @return {string|undefined} - Case-sensitive tag name.
|
|
2016
|
+
*/
|
|
2017
|
+
function getCaseSensitiveTagName(tagName) {
|
|
2018
|
+
return caseSensitiveTagNamesMap[tagName];
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
* Formats DOM attributes to a hash map.
|
|
2023
|
+
*
|
|
2024
|
+
* @param {NamedNodeMap} attributes - List of attributes.
|
|
2025
|
+
* @return {object} - Map of attribute name to value.
|
|
2026
|
+
*/
|
|
2027
|
+
function formatAttributes(attributes) {
|
|
2028
|
+
var result = {};
|
|
2029
|
+
var attribute;
|
|
2030
|
+
// `NamedNodeMap` is array-like
|
|
2031
|
+
for (var i = 0, len = attributes.length; i < len; i++) {
|
|
2032
|
+
attribute = attributes[i];
|
|
2033
|
+
result[attribute.name] = attribute.value;
|
|
2034
|
+
}
|
|
2035
|
+
return result;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
/**
|
|
2039
|
+
* Corrects the tag name if it is case-sensitive (SVG).
|
|
2040
|
+
* Otherwise, returns the lowercase tag name (HTML).
|
|
2041
|
+
*
|
|
2042
|
+
* @param {string} tagName - Lowercase tag name.
|
|
2043
|
+
* @return {string} - Formatted tag name.
|
|
2044
|
+
*/
|
|
2045
|
+
function formatTagName(tagName) {
|
|
2046
|
+
tagName = tagName.toLowerCase();
|
|
2047
|
+
var caseSensitiveTagName = getCaseSensitiveTagName(tagName);
|
|
2048
|
+
if (caseSensitiveTagName) {
|
|
2049
|
+
return caseSensitiveTagName;
|
|
2050
|
+
}
|
|
2051
|
+
return tagName;
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
/**
|
|
2055
|
+
* Transforms DOM nodes to `domhandler` nodes.
|
|
2056
|
+
*
|
|
2057
|
+
* @param {NodeList} nodes - DOM nodes.
|
|
2058
|
+
* @param {Element|null} [parent=null] - Parent node.
|
|
2059
|
+
* @param {string} [directive] - Directive.
|
|
2060
|
+
* @return {Array<Comment|Element|ProcessingInstruction|Text>}
|
|
2061
|
+
*/
|
|
2062
|
+
function formatDOM$1(nodes, parent, directive) {
|
|
2063
|
+
parent = parent || null;
|
|
2064
|
+
var result = [];
|
|
2065
|
+
|
|
2066
|
+
for (var index = 0, len = nodes.length; index < len; index++) {
|
|
2067
|
+
var node = nodes[index];
|
|
2068
|
+
var current;
|
|
2069
|
+
|
|
2070
|
+
// set the node data given the type
|
|
2071
|
+
switch (node.nodeType) {
|
|
2072
|
+
case 1:
|
|
2073
|
+
// script, style, or tag
|
|
2074
|
+
current = new Element(
|
|
2075
|
+
formatTagName(node.nodeName),
|
|
2076
|
+
formatAttributes(node.attributes)
|
|
2077
|
+
);
|
|
2078
|
+
current.children = formatDOM$1(node.childNodes, current);
|
|
2079
|
+
break;
|
|
2080
|
+
|
|
2081
|
+
case 3:
|
|
2082
|
+
current = new Text(node.nodeValue);
|
|
2083
|
+
break;
|
|
2084
|
+
|
|
2085
|
+
case 8:
|
|
2086
|
+
current = new Comment(node.nodeValue);
|
|
2087
|
+
break;
|
|
2088
|
+
|
|
2089
|
+
default:
|
|
2090
|
+
continue;
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
// set previous node next
|
|
2094
|
+
var prev = result[index - 1] || null;
|
|
2095
|
+
if (prev) {
|
|
2096
|
+
prev.next = current;
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2099
|
+
// set properties for current node
|
|
2100
|
+
current.parent = parent;
|
|
2101
|
+
current.prev = prev;
|
|
2102
|
+
current.next = null;
|
|
2103
|
+
|
|
2104
|
+
result.push(current);
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
if (directive) {
|
|
2108
|
+
current = new ProcessingInstruction(
|
|
2109
|
+
directive.substring(0, directive.indexOf(' ')).toLowerCase(),
|
|
2110
|
+
directive
|
|
2111
|
+
);
|
|
2112
|
+
current.next = result[0] || null;
|
|
2113
|
+
current.parent = parent;
|
|
2114
|
+
result.unshift(current);
|
|
2115
|
+
|
|
2116
|
+
if (result[1]) {
|
|
2117
|
+
result[1].prev = result[0];
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
return result;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
/**
|
|
2125
|
+
* Detects if browser is Internet Explorer.
|
|
2126
|
+
*
|
|
2127
|
+
* @return {boolean} - Whether IE is detected.
|
|
2128
|
+
*/
|
|
2129
|
+
function isIE$1() {
|
|
2130
|
+
return /(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent);
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
var utilities = {
|
|
2134
|
+
formatAttributes: formatAttributes,
|
|
2135
|
+
formatDOM: formatDOM$1,
|
|
2136
|
+
isIE: isIE$1
|
|
2137
|
+
};
|
|
2138
|
+
|
|
2139
|
+
// constants
|
|
2140
|
+
var HTML = 'html';
|
|
2141
|
+
var HEAD = 'head';
|
|
2142
|
+
var BODY = 'body';
|
|
2143
|
+
var FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/; // e.g., <h1>
|
|
2144
|
+
var HEAD_TAG_REGEX = /<head.*>/i;
|
|
2145
|
+
var BODY_TAG_REGEX = /<body.*>/i;
|
|
2146
|
+
|
|
2147
|
+
// falls back to `parseFromString` if `createHTMLDocument` cannot be used
|
|
2148
|
+
var parseFromDocument = function () {
|
|
2149
|
+
throw new Error(
|
|
2150
|
+
'This browser does not support `document.implementation.createHTMLDocument`'
|
|
2151
|
+
);
|
|
2152
|
+
};
|
|
2153
|
+
|
|
2154
|
+
var parseFromString = function () {
|
|
2155
|
+
throw new Error(
|
|
2156
|
+
'This browser does not support `DOMParser.prototype.parseFromString`'
|
|
2157
|
+
);
|
|
2158
|
+
};
|
|
2159
|
+
|
|
2160
|
+
/**
|
|
2161
|
+
* DOMParser (performance: slow).
|
|
2162
|
+
*
|
|
2163
|
+
* @see https://developer.mozilla.org/docs/Web/API/DOMParser#Parsing_an_SVG_or_HTML_document
|
|
2164
|
+
*/
|
|
2165
|
+
if (typeof window.DOMParser === 'function') {
|
|
2166
|
+
var domParser = new window.DOMParser();
|
|
2167
|
+
var mimeType = 'text/html';
|
|
2168
|
+
|
|
2169
|
+
/**
|
|
2170
|
+
* Creates an HTML document using `DOMParser.parseFromString`.
|
|
2171
|
+
*
|
|
2172
|
+
* @param {string} html - The HTML string.
|
|
2173
|
+
* @param {string} [tagName] - The element to render the HTML (with 'body' as fallback).
|
|
2174
|
+
* @return {HTMLDocument}
|
|
2175
|
+
*/
|
|
2176
|
+
parseFromString = function (html, tagName) {
|
|
2177
|
+
if (tagName) {
|
|
2178
|
+
html = '<' + tagName + '>' + html + '</' + tagName + '>';
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
return domParser.parseFromString(html, mimeType);
|
|
2182
|
+
};
|
|
2183
|
+
|
|
2184
|
+
parseFromDocument = parseFromString;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
/**
|
|
2188
|
+
* DOMImplementation (performance: fair).
|
|
2189
|
+
*
|
|
2190
|
+
* @see https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument
|
|
2191
|
+
*/
|
|
2192
|
+
if (document.implementation) {
|
|
2193
|
+
var isIE = utilities.isIE;
|
|
2194
|
+
|
|
2195
|
+
// title parameter is required in IE
|
|
2196
|
+
// https://msdn.microsoft.com/en-us/library/ff975457(v=vs.85).aspx
|
|
2197
|
+
var doc = document.implementation.createHTMLDocument(
|
|
2198
|
+
isIE() ? 'html-dom-parser' : undefined
|
|
2199
|
+
);
|
|
2200
|
+
|
|
2201
|
+
/**
|
|
2202
|
+
* Use HTML document created by `document.implementation.createHTMLDocument`.
|
|
2203
|
+
*
|
|
2204
|
+
* @param {string} html - The HTML string.
|
|
2205
|
+
* @param {string} [tagName] - The element to render the HTML (with 'body' as fallback).
|
|
2206
|
+
* @return {HTMLDocument}
|
|
2207
|
+
*/
|
|
2208
|
+
parseFromDocument = function (html, tagName) {
|
|
2209
|
+
if (tagName) {
|
|
2210
|
+
doc.documentElement.getElementsByTagName(tagName)[0].innerHTML = html;
|
|
2211
|
+
return doc;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
doc.documentElement.innerHTML = html;
|
|
2215
|
+
return doc;
|
|
2216
|
+
};
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
/**
|
|
2220
|
+
* Template (performance: fast).
|
|
2221
|
+
*
|
|
2222
|
+
* @see https://developer.mozilla.org/docs/Web/HTML/Element/template
|
|
2223
|
+
*/
|
|
2224
|
+
var template = document.createElement('template');
|
|
2225
|
+
var parseFromTemplate;
|
|
2226
|
+
|
|
2227
|
+
if (template.content) {
|
|
2228
|
+
/**
|
|
2229
|
+
* Uses a template element (content fragment) to parse HTML.
|
|
2230
|
+
*
|
|
2231
|
+
* @param {string} html - The HTML string.
|
|
2232
|
+
* @return {NodeList}
|
|
2233
|
+
*/
|
|
2234
|
+
parseFromTemplate = function (html) {
|
|
2235
|
+
template.innerHTML = html;
|
|
2236
|
+
return template.content.childNodes;
|
|
2237
|
+
};
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
/**
|
|
2241
|
+
* Parses HTML string to DOM nodes.
|
|
2242
|
+
*
|
|
2243
|
+
* @param {string} html - HTML markup.
|
|
2244
|
+
* @return {NodeList}
|
|
2245
|
+
*/
|
|
2246
|
+
function domparser$1(html) {
|
|
2247
|
+
var firstTagName;
|
|
2248
|
+
var match = html.match(FIRST_TAG_REGEX);
|
|
2249
|
+
|
|
2250
|
+
if (match && match[1]) {
|
|
2251
|
+
firstTagName = match[1].toLowerCase();
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
var doc;
|
|
2255
|
+
var element;
|
|
2256
|
+
var elements;
|
|
2257
|
+
|
|
2258
|
+
switch (firstTagName) {
|
|
2259
|
+
case HTML:
|
|
2260
|
+
doc = parseFromString(html);
|
|
2261
|
+
|
|
2262
|
+
// the created document may come with filler head/body elements,
|
|
2263
|
+
// so make sure to remove them if they don't actually exist
|
|
2264
|
+
if (!HEAD_TAG_REGEX.test(html)) {
|
|
2265
|
+
element = doc.getElementsByTagName(HEAD)[0];
|
|
2266
|
+
if (element) {
|
|
2267
|
+
element.parentNode.removeChild(element);
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
if (!BODY_TAG_REGEX.test(html)) {
|
|
2272
|
+
element = doc.getElementsByTagName(BODY)[0];
|
|
2273
|
+
if (element) {
|
|
2274
|
+
element.parentNode.removeChild(element);
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
return doc.getElementsByTagName(HTML);
|
|
2279
|
+
|
|
2280
|
+
case HEAD:
|
|
2281
|
+
case BODY:
|
|
2282
|
+
elements = parseFromDocument(html).getElementsByTagName(firstTagName);
|
|
2283
|
+
|
|
2284
|
+
// if there's a sibling element, then return both elements
|
|
2285
|
+
if (BODY_TAG_REGEX.test(html) && HEAD_TAG_REGEX.test(html)) {
|
|
2286
|
+
return elements[0].parentNode.childNodes;
|
|
2287
|
+
}
|
|
2288
|
+
return elements;
|
|
2289
|
+
|
|
2290
|
+
// low-level tag or text
|
|
2291
|
+
default:
|
|
2292
|
+
if (parseFromTemplate) {
|
|
2293
|
+
return parseFromTemplate(html);
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
return parseFromDocument(html, BODY).getElementsByTagName(BODY)[0]
|
|
2297
|
+
.childNodes;
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
var domparser_1 = domparser$1;
|
|
2302
|
+
|
|
2303
|
+
var domparser = domparser_1;
|
|
2304
|
+
var formatDOM = utilities.formatDOM;
|
|
2305
|
+
|
|
2306
|
+
var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/; // e.g., <!doctype html>
|
|
2307
|
+
|
|
2308
|
+
/**
|
|
2309
|
+
* Parses HTML string to DOM nodes in browser.
|
|
2310
|
+
*
|
|
2311
|
+
* @param {string} html - HTML markup.
|
|
2312
|
+
* @return {DomElement[]} - DOM elements.
|
|
2313
|
+
*/
|
|
2314
|
+
function HTMLDOMParser(html) {
|
|
2315
|
+
if (typeof html !== 'string') {
|
|
2316
|
+
throw new TypeError('First argument must be a string');
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2319
|
+
if (html === '') {
|
|
2320
|
+
return [];
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
// match directive
|
|
2324
|
+
var match = html.match(DIRECTIVE_REGEX);
|
|
2325
|
+
var directive;
|
|
2326
|
+
|
|
2327
|
+
if (match && match[1]) {
|
|
2328
|
+
directive = match[1];
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
return formatDOM(domparser(html), null, directive);
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
var htmlToDom = HTMLDOMParser;
|
|
2335
|
+
|
|
2336
|
+
var domToReact = domToReact_1;
|
|
2337
|
+
var attributesToProps = attributesToProps$2;
|
|
2338
|
+
var htmlToDOM = htmlToDom;
|
|
2339
|
+
|
|
2340
|
+
var domParserOptions = { lowerCaseAttributeNames: false };
|
|
2341
|
+
|
|
2342
|
+
/**
|
|
2343
|
+
* Converts HTML string to React elements.
|
|
2344
|
+
*
|
|
2345
|
+
* @param {String} html - HTML string.
|
|
2346
|
+
* @param {Object} [options] - Parser options.
|
|
2347
|
+
* @param {Object} [options.htmlparser2] - htmlparser2 options.
|
|
2348
|
+
* @param {Object} [options.library] - Library for React, Preact, etc.
|
|
2349
|
+
* @param {Function} [options.replace] - Replace method.
|
|
2350
|
+
* @return {JSX.Element|JSX.Element[]|String} - React element(s), empty array, or string.
|
|
2351
|
+
*/
|
|
2352
|
+
function HTMLReactParser(html, options) {
|
|
2353
|
+
if (typeof html !== 'string') {
|
|
2354
|
+
throw new TypeError('First argument must be a string');
|
|
2355
|
+
}
|
|
2356
|
+
if (html === '') {
|
|
2357
|
+
return [];
|
|
2358
|
+
}
|
|
2359
|
+
options = options || {};
|
|
2360
|
+
return domToReact(
|
|
2361
|
+
htmlToDOM(html, options.htmlparser2 || domParserOptions),
|
|
2362
|
+
options
|
|
2363
|
+
);
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
HTMLReactParser.domToReact = domToReact;
|
|
2367
|
+
HTMLReactParser.htmlToDOM = htmlToDOM;
|
|
2368
|
+
HTMLReactParser.attributesToProps = attributesToProps;
|
|
2369
|
+
|
|
2370
|
+
// support CommonJS and ES Modules
|
|
2371
|
+
htmlReactParser$1.exports = HTMLReactParser;
|
|
2372
|
+
htmlReactParser$1.exports.default = HTMLReactParser;
|
|
2373
|
+
|
|
2374
|
+
var htmlReactParser = htmlReactParser$1.exports;
|
|
2375
|
+
|
|
2376
|
+
return htmlReactParser;
|
|
2022
2377
|
|
|
2023
2378
|
})));
|
|
2024
2379
|
//# sourceMappingURL=html-react-parser.js.map
|