@mapbox/mapbox-gl-style-spec 14.7.0-beta.1 → 14.7.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/dist/index.es.js CHANGED
@@ -6467,7 +6467,8 @@ var paint_symbol = {
6467
6467
  interpolated: true,
6468
6468
  parameters: [
6469
6469
  "zoom",
6470
- "measure-light"
6470
+ "measure-light",
6471
+ "feature-state"
6471
6472
  ]
6472
6473
  },
6473
6474
  "property-type": "data-driven"
@@ -6498,7 +6499,8 @@ var paint_symbol = {
6498
6499
  interpolated: true,
6499
6500
  parameters: [
6500
6501
  "zoom",
6501
- "measure-light"
6502
+ "measure-light",
6503
+ "feature-state"
6502
6504
  ]
6503
6505
  },
6504
6506
  "property-type": "data-driven"
@@ -7612,6 +7614,32 @@ var paint_hillshade = {
7612
7614
  }
7613
7615
  };
7614
7616
  var paint_background = {
7617
+ "background-pitch-alignment": {
7618
+ type: "enum",
7619
+ values: {
7620
+ map: {
7621
+ doc: "The background is aligned to the plane of the map."
7622
+ },
7623
+ viewport: {
7624
+ doc: "The background is aligned to the plane of the viewport, covering the whole screen."
7625
+ }
7626
+ },
7627
+ "default": "map",
7628
+ doc: "Orientation of background layer.",
7629
+ "sdk-support": {
7630
+ "basic functionality": {
7631
+ js: "3.8.0",
7632
+ android: "11.8.0",
7633
+ ios: "11.8.0"
7634
+ }
7635
+ },
7636
+ expression: {
7637
+ interpolated: false,
7638
+ parameters: [
7639
+ ]
7640
+ },
7641
+ "property-type": "data-constant"
7642
+ },
7615
7643
  "background-color": {
7616
7644
  type: "color",
7617
7645
  "default": "#000000",
@@ -8350,9 +8378,7 @@ var paint_model = {
8350
8378
  doc: "An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled.",
8351
8379
  "sdk-support": {
8352
8380
  "basic functionality": {
8353
- js: "3.5.0",
8354
- android: "11.5.0",
8355
- ios: "11.5.0"
8381
+ js: "3.5.0"
8356
8382
  }
8357
8383
  }
8358
8384
  }
@@ -9228,16 +9254,22 @@ var v8 = {
9228
9254
  js: "3.0.0",
9229
9255
  android: "11.0.0",
9230
9256
  ios: "11.0.0"
9257
+ },
9258
+ "data-driven styling": {
9259
+ js: "3.8.0",
9260
+ android: "11.8.0",
9261
+ ios: "11.8.0"
9231
9262
  }
9232
9263
  },
9233
9264
  expression: {
9234
9265
  interpolated: true,
9235
9266
  parameters: [
9236
9267
  "zoom",
9237
- "measure-light"
9268
+ "measure-light",
9269
+ "feature-state"
9238
9270
  ]
9239
9271
  },
9240
- "property-type": "data-constant"
9272
+ "property-type": "data-driven"
9241
9273
  },
9242
9274
  "fill-extrusion-line-width": {
9243
9275
  type: "number",
@@ -9892,1050 +9924,1058 @@ function getDefaultExportFromCjs (x) {
9892
9924
 
9893
9925
  var csscolorparser = {};
9894
9926
 
9895
- var parseCSSColor_1;
9896
- // (c) Dean McNamee <dean@gmail.com>, 2012.
9897
- //
9898
- // https://github.com/deanm/css-color-parser-js
9899
- //
9900
- // Permission is hereby granted, free of charge, to any person obtaining a copy
9901
- // of this software and associated documentation files (the "Software"), to
9902
- // deal in the Software without restriction, including without limitation the
9903
- // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9904
- // sell copies of the Software, and to permit persons to whom the Software is
9905
- // furnished to do so, subject to the following conditions:
9906
- //
9907
- // The above copyright notice and this permission notice shall be included in
9908
- // all copies or substantial portions of the Software.
9909
- //
9910
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9911
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9912
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
9913
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9914
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9915
- // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
9916
- // IN THE SOFTWARE.
9917
- // http://www.w3.org/TR/css3-color/
9918
- var kCSSColorTable = {
9919
- 'transparent': [
9920
- 0,
9921
- 0,
9922
- 0,
9923
- 0
9924
- ],
9925
- 'aliceblue': [
9926
- 240,
9927
- 248,
9928
- 255,
9929
- 1
9930
- ],
9931
- 'antiquewhite': [
9932
- 250,
9933
- 235,
9934
- 215,
9935
- 1
9936
- ],
9937
- 'aqua': [
9938
- 0,
9939
- 255,
9940
- 255,
9941
- 1
9942
- ],
9943
- 'aquamarine': [
9944
- 127,
9945
- 255,
9946
- 212,
9947
- 1
9948
- ],
9949
- 'azure': [
9950
- 240,
9951
- 255,
9952
- 255,
9953
- 1
9954
- ],
9955
- 'beige': [
9956
- 245,
9957
- 245,
9958
- 220,
9959
- 1
9960
- ],
9961
- 'bisque': [
9962
- 255,
9963
- 228,
9964
- 196,
9965
- 1
9966
- ],
9967
- 'black': [
9968
- 0,
9969
- 0,
9970
- 0,
9971
- 1
9972
- ],
9973
- 'blanchedalmond': [
9974
- 255,
9975
- 235,
9976
- 205,
9977
- 1
9978
- ],
9979
- 'blue': [
9980
- 0,
9981
- 0,
9982
- 255,
9983
- 1
9984
- ],
9985
- 'blueviolet': [
9986
- 138,
9987
- 43,
9988
- 226,
9989
- 1
9990
- ],
9991
- 'brown': [
9992
- 165,
9993
- 42,
9994
- 42,
9995
- 1
9996
- ],
9997
- 'burlywood': [
9998
- 222,
9999
- 184,
10000
- 135,
10001
- 1
10002
- ],
10003
- 'cadetblue': [
10004
- 95,
10005
- 158,
10006
- 160,
10007
- 1
10008
- ],
10009
- 'chartreuse': [
10010
- 127,
10011
- 255,
10012
- 0,
10013
- 1
10014
- ],
10015
- 'chocolate': [
10016
- 210,
10017
- 105,
10018
- 30,
10019
- 1
10020
- ],
10021
- 'coral': [
10022
- 255,
10023
- 127,
10024
- 80,
10025
- 1
10026
- ],
10027
- 'cornflowerblue': [
10028
- 100,
10029
- 149,
10030
- 237,
10031
- 1
10032
- ],
10033
- 'cornsilk': [
10034
- 255,
10035
- 248,
10036
- 220,
10037
- 1
10038
- ],
10039
- 'crimson': [
10040
- 220,
10041
- 20,
10042
- 60,
10043
- 1
10044
- ],
10045
- 'cyan': [
10046
- 0,
10047
- 255,
10048
- 255,
10049
- 1
10050
- ],
10051
- 'darkblue': [
10052
- 0,
10053
- 0,
10054
- 139,
10055
- 1
10056
- ],
10057
- 'darkcyan': [
10058
- 0,
10059
- 139,
10060
- 139,
10061
- 1
10062
- ],
10063
- 'darkgoldenrod': [
10064
- 184,
10065
- 134,
10066
- 11,
10067
- 1
10068
- ],
10069
- 'darkgray': [
10070
- 169,
10071
- 169,
10072
- 169,
10073
- 1
10074
- ],
10075
- 'darkgreen': [
10076
- 0,
10077
- 100,
10078
- 0,
10079
- 1
10080
- ],
10081
- 'darkgrey': [
10082
- 169,
10083
- 169,
10084
- 169,
10085
- 1
10086
- ],
10087
- 'darkkhaki': [
10088
- 189,
10089
- 183,
10090
- 107,
10091
- 1
10092
- ],
10093
- 'darkmagenta': [
10094
- 139,
10095
- 0,
10096
- 139,
10097
- 1
10098
- ],
10099
- 'darkolivegreen': [
10100
- 85,
10101
- 107,
10102
- 47,
10103
- 1
10104
- ],
10105
- 'darkorange': [
10106
- 255,
10107
- 140,
10108
- 0,
10109
- 1
10110
- ],
10111
- 'darkorchid': [
10112
- 153,
10113
- 50,
10114
- 204,
10115
- 1
10116
- ],
10117
- 'darkred': [
10118
- 139,
10119
- 0,
10120
- 0,
10121
- 1
10122
- ],
10123
- 'darksalmon': [
10124
- 233,
10125
- 150,
10126
- 122,
10127
- 1
10128
- ],
10129
- 'darkseagreen': [
10130
- 143,
10131
- 188,
10132
- 143,
10133
- 1
10134
- ],
10135
- 'darkslateblue': [
10136
- 72,
10137
- 61,
10138
- 139,
10139
- 1
10140
- ],
10141
- 'darkslategray': [
10142
- 47,
10143
- 79,
10144
- 79,
10145
- 1
10146
- ],
10147
- 'darkslategrey': [
10148
- 47,
10149
- 79,
10150
- 79,
10151
- 1
10152
- ],
10153
- 'darkturquoise': [
10154
- 0,
10155
- 206,
10156
- 209,
10157
- 1
10158
- ],
10159
- 'darkviolet': [
10160
- 148,
10161
- 0,
10162
- 211,
10163
- 1
10164
- ],
10165
- 'deeppink': [
10166
- 255,
10167
- 20,
10168
- 147,
10169
- 1
10170
- ],
10171
- 'deepskyblue': [
10172
- 0,
10173
- 191,
10174
- 255,
10175
- 1
10176
- ],
10177
- 'dimgray': [
10178
- 105,
10179
- 105,
10180
- 105,
10181
- 1
10182
- ],
10183
- 'dimgrey': [
10184
- 105,
10185
- 105,
10186
- 105,
10187
- 1
10188
- ],
10189
- 'dodgerblue': [
10190
- 30,
10191
- 144,
10192
- 255,
10193
- 1
10194
- ],
10195
- 'firebrick': [
10196
- 178,
10197
- 34,
10198
- 34,
10199
- 1
10200
- ],
10201
- 'floralwhite': [
10202
- 255,
10203
- 250,
10204
- 240,
10205
- 1
10206
- ],
10207
- 'forestgreen': [
10208
- 34,
10209
- 139,
10210
- 34,
10211
- 1
10212
- ],
10213
- 'fuchsia': [
10214
- 255,
10215
- 0,
10216
- 255,
10217
- 1
10218
- ],
10219
- 'gainsboro': [
10220
- 220,
10221
- 220,
10222
- 220,
10223
- 1
10224
- ],
10225
- 'ghostwhite': [
10226
- 248,
10227
- 248,
10228
- 255,
10229
- 1
10230
- ],
10231
- 'gold': [
10232
- 255,
10233
- 215,
10234
- 0,
10235
- 1
10236
- ],
10237
- 'goldenrod': [
10238
- 218,
10239
- 165,
10240
- 32,
10241
- 1
10242
- ],
10243
- 'gray': [
10244
- 128,
10245
- 128,
10246
- 128,
10247
- 1
10248
- ],
10249
- 'green': [
10250
- 0,
10251
- 128,
10252
- 0,
10253
- 1
10254
- ],
10255
- 'greenyellow': [
10256
- 173,
10257
- 255,
10258
- 47,
10259
- 1
10260
- ],
10261
- 'grey': [
10262
- 128,
10263
- 128,
10264
- 128,
10265
- 1
10266
- ],
10267
- 'honeydew': [
10268
- 240,
10269
- 255,
10270
- 240,
10271
- 1
10272
- ],
10273
- 'hotpink': [
10274
- 255,
10275
- 105,
10276
- 180,
10277
- 1
10278
- ],
10279
- 'indianred': [
10280
- 205,
10281
- 92,
10282
- 92,
10283
- 1
10284
- ],
10285
- 'indigo': [
10286
- 75,
10287
- 0,
10288
- 130,
10289
- 1
10290
- ],
10291
- 'ivory': [
10292
- 255,
10293
- 255,
10294
- 240,
10295
- 1
10296
- ],
10297
- 'khaki': [
10298
- 240,
10299
- 230,
10300
- 140,
10301
- 1
10302
- ],
10303
- 'lavender': [
10304
- 230,
10305
- 230,
10306
- 250,
10307
- 1
10308
- ],
10309
- 'lavenderblush': [
10310
- 255,
10311
- 240,
10312
- 245,
10313
- 1
10314
- ],
10315
- 'lawngreen': [
10316
- 124,
10317
- 252,
10318
- 0,
10319
- 1
10320
- ],
10321
- 'lemonchiffon': [
10322
- 255,
10323
- 250,
10324
- 205,
10325
- 1
10326
- ],
10327
- 'lightblue': [
10328
- 173,
10329
- 216,
10330
- 230,
10331
- 1
10332
- ],
10333
- 'lightcoral': [
10334
- 240,
10335
- 128,
10336
- 128,
10337
- 1
10338
- ],
10339
- 'lightcyan': [
10340
- 224,
10341
- 255,
10342
- 255,
10343
- 1
10344
- ],
10345
- 'lightgoldenrodyellow': [
10346
- 250,
10347
- 250,
10348
- 210,
10349
- 1
10350
- ],
10351
- 'lightgray': [
10352
- 211,
10353
- 211,
10354
- 211,
10355
- 1
10356
- ],
10357
- 'lightgreen': [
10358
- 144,
10359
- 238,
10360
- 144,
10361
- 1
10362
- ],
10363
- 'lightgrey': [
10364
- 211,
10365
- 211,
10366
- 211,
10367
- 1
10368
- ],
10369
- 'lightpink': [
10370
- 255,
10371
- 182,
10372
- 193,
10373
- 1
10374
- ],
10375
- 'lightsalmon': [
10376
- 255,
10377
- 160,
10378
- 122,
10379
- 1
10380
- ],
10381
- 'lightseagreen': [
10382
- 32,
10383
- 178,
10384
- 170,
10385
- 1
10386
- ],
10387
- 'lightskyblue': [
10388
- 135,
10389
- 206,
10390
- 250,
10391
- 1
10392
- ],
10393
- 'lightslategray': [
10394
- 119,
10395
- 136,
10396
- 153,
10397
- 1
10398
- ],
10399
- 'lightslategrey': [
10400
- 119,
10401
- 136,
10402
- 153,
10403
- 1
10404
- ],
10405
- 'lightsteelblue': [
10406
- 176,
10407
- 196,
10408
- 222,
10409
- 1
10410
- ],
10411
- 'lightyellow': [
10412
- 255,
10413
- 255,
10414
- 224,
10415
- 1
10416
- ],
10417
- 'lime': [
10418
- 0,
10419
- 255,
10420
- 0,
10421
- 1
10422
- ],
10423
- 'limegreen': [
10424
- 50,
10425
- 205,
10426
- 50,
10427
- 1
10428
- ],
10429
- 'linen': [
10430
- 250,
10431
- 240,
10432
- 230,
10433
- 1
10434
- ],
10435
- 'magenta': [
10436
- 255,
10437
- 0,
10438
- 255,
10439
- 1
10440
- ],
10441
- 'maroon': [
10442
- 128,
10443
- 0,
10444
- 0,
10445
- 1
10446
- ],
10447
- 'mediumaquamarine': [
10448
- 102,
10449
- 205,
10450
- 170,
10451
- 1
10452
- ],
10453
- 'mediumblue': [
10454
- 0,
10455
- 0,
10456
- 205,
10457
- 1
10458
- ],
10459
- 'mediumorchid': [
10460
- 186,
10461
- 85,
10462
- 211,
10463
- 1
10464
- ],
10465
- 'mediumpurple': [
10466
- 147,
10467
- 112,
10468
- 219,
10469
- 1
10470
- ],
10471
- 'mediumseagreen': [
10472
- 60,
10473
- 179,
10474
- 113,
10475
- 1
10476
- ],
10477
- 'mediumslateblue': [
10478
- 123,
10479
- 104,
10480
- 238,
10481
- 1
10482
- ],
10483
- 'mediumspringgreen': [
10484
- 0,
10485
- 250,
10486
- 154,
10487
- 1
10488
- ],
10489
- 'mediumturquoise': [
10490
- 72,
10491
- 209,
10492
- 204,
10493
- 1
10494
- ],
10495
- 'mediumvioletred': [
10496
- 199,
10497
- 21,
10498
- 133,
10499
- 1
10500
- ],
10501
- 'midnightblue': [
10502
- 25,
10503
- 25,
10504
- 112,
10505
- 1
10506
- ],
10507
- 'mintcream': [
10508
- 245,
10509
- 255,
10510
- 250,
10511
- 1
10512
- ],
10513
- 'mistyrose': [
10514
- 255,
10515
- 228,
10516
- 225,
10517
- 1
10518
- ],
10519
- 'moccasin': [
10520
- 255,
10521
- 228,
10522
- 181,
10523
- 1
10524
- ],
10525
- 'navajowhite': [
10526
- 255,
10527
- 222,
10528
- 173,
10529
- 1
10530
- ],
10531
- 'navy': [
10532
- 0,
10533
- 0,
10534
- 128,
10535
- 1
10536
- ],
10537
- 'oldlace': [
10538
- 253,
10539
- 245,
10540
- 230,
10541
- 1
10542
- ],
10543
- 'olive': [
10544
- 128,
10545
- 128,
10546
- 0,
10547
- 1
10548
- ],
10549
- 'olivedrab': [
10550
- 107,
10551
- 142,
10552
- 35,
10553
- 1
10554
- ],
10555
- 'orange': [
10556
- 255,
10557
- 165,
10558
- 0,
10559
- 1
10560
- ],
10561
- 'orangered': [
10562
- 255,
10563
- 69,
10564
- 0,
10565
- 1
10566
- ],
10567
- 'orchid': [
10568
- 218,
10569
- 112,
10570
- 214,
10571
- 1
10572
- ],
10573
- 'palegoldenrod': [
10574
- 238,
10575
- 232,
10576
- 170,
10577
- 1
10578
- ],
10579
- 'palegreen': [
10580
- 152,
10581
- 251,
10582
- 152,
10583
- 1
10584
- ],
10585
- 'paleturquoise': [
10586
- 175,
10587
- 238,
10588
- 238,
10589
- 1
10590
- ],
10591
- 'palevioletred': [
10592
- 219,
10593
- 112,
10594
- 147,
10595
- 1
10596
- ],
10597
- 'papayawhip': [
10598
- 255,
10599
- 239,
10600
- 213,
10601
- 1
10602
- ],
10603
- 'peachpuff': [
10604
- 255,
10605
- 218,
10606
- 185,
10607
- 1
10608
- ],
10609
- 'peru': [
10610
- 205,
10611
- 133,
10612
- 63,
10613
- 1
10614
- ],
10615
- 'pink': [
10616
- 255,
10617
- 192,
10618
- 203,
10619
- 1
10620
- ],
10621
- 'plum': [
10622
- 221,
10623
- 160,
10624
- 221,
10625
- 1
10626
- ],
10627
- 'powderblue': [
10628
- 176,
10629
- 224,
10630
- 230,
10631
- 1
10632
- ],
10633
- 'purple': [
10634
- 128,
10635
- 0,
10636
- 128,
10637
- 1
10638
- ],
10639
- 'rebeccapurple': [
10640
- 102,
10641
- 51,
10642
- 153,
10643
- 1
10644
- ],
10645
- 'red': [
10646
- 255,
10647
- 0,
10648
- 0,
10649
- 1
10650
- ],
10651
- 'rosybrown': [
10652
- 188,
10653
- 143,
10654
- 143,
10655
- 1
10656
- ],
10657
- 'royalblue': [
10658
- 65,
10659
- 105,
10660
- 225,
10661
- 1
10662
- ],
10663
- 'saddlebrown': [
10664
- 139,
10665
- 69,
10666
- 19,
10667
- 1
10668
- ],
10669
- 'salmon': [
10670
- 250,
10671
- 128,
10672
- 114,
10673
- 1
10674
- ],
10675
- 'sandybrown': [
10676
- 244,
10677
- 164,
10678
- 96,
10679
- 1
10680
- ],
10681
- 'seagreen': [
10682
- 46,
10683
- 139,
10684
- 87,
10685
- 1
10686
- ],
10687
- 'seashell': [
10688
- 255,
10689
- 245,
10690
- 238,
10691
- 1
10692
- ],
10693
- 'sienna': [
10694
- 160,
10695
- 82,
10696
- 45,
10697
- 1
10698
- ],
10699
- 'silver': [
10700
- 192,
10701
- 192,
10702
- 192,
10703
- 1
10704
- ],
10705
- 'skyblue': [
10706
- 135,
10707
- 206,
10708
- 235,
10709
- 1
10710
- ],
10711
- 'slateblue': [
10712
- 106,
10713
- 90,
10714
- 205,
10715
- 1
10716
- ],
10717
- 'slategray': [
10718
- 112,
10719
- 128,
10720
- 144,
10721
- 1
10722
- ],
10723
- 'slategrey': [
10724
- 112,
10725
- 128,
10726
- 144,
10727
- 1
10728
- ],
10729
- 'snow': [
10730
- 255,
10731
- 250,
10732
- 250,
10733
- 1
10734
- ],
10735
- 'springgreen': [
10736
- 0,
10737
- 255,
10738
- 127,
10739
- 1
10740
- ],
10741
- 'steelblue': [
10742
- 70,
10743
- 130,
10744
- 180,
10745
- 1
10746
- ],
10747
- 'tan': [
10748
- 210,
10749
- 180,
10750
- 140,
10751
- 1
10752
- ],
10753
- 'teal': [
10754
- 0,
10755
- 128,
10756
- 128,
10757
- 1
10758
- ],
10759
- 'thistle': [
10760
- 216,
10761
- 191,
10762
- 216,
10763
- 1
10764
- ],
10765
- 'tomato': [
10766
- 255,
10767
- 99,
10768
- 71,
10769
- 1
10770
- ],
10771
- 'turquoise': [
10772
- 64,
10773
- 224,
10774
- 208,
10775
- 1
10776
- ],
10777
- 'violet': [
10778
- 238,
10779
- 130,
10780
- 238,
10781
- 1
10782
- ],
10783
- 'wheat': [
10784
- 245,
10785
- 222,
10786
- 179,
10787
- 1
10788
- ],
10789
- 'white': [
10790
- 255,
10791
- 255,
10792
- 255,
10793
- 1
10794
- ],
10795
- 'whitesmoke': [
10796
- 245,
10797
- 245,
10798
- 245,
10799
- 1
10800
- ],
10801
- 'yellow': [
10802
- 255,
10803
- 255,
10804
- 0,
10805
- 1
10806
- ],
10807
- 'yellowgreen': [
10808
- 154,
10809
- 205,
10810
- 50,
10811
- 1
10812
- ]
10813
- };
10814
- function clamp_css_byte(i) {
10815
- // Clamp to integer 0 .. 255.
10816
- i = Math.round(i);
10817
- // Seems to be what Chrome does (vs truncation).
10818
- return i < 0 ? 0 : i > 255 ? 255 : i;
10819
- }
10820
- function clamp_css_float(f) {
10821
- // Clamp to float 0.0 .. 1.0.
10822
- return f < 0 ? 0 : f > 1 ? 1 : f;
10823
- }
10824
- function parse_css_int(str) {
10825
- // int or percentage.
10826
- if (str[str.length - 1] === '%')
10827
- return clamp_css_byte(parseFloat(str) / 100 * 255);
10828
- return clamp_css_byte(parseInt(str));
10829
- }
10830
- function parse_css_float(str) {
10831
- // float or percentage.
10832
- if (str[str.length - 1] === '%')
10833
- return clamp_css_float(parseFloat(str) / 100);
10834
- return clamp_css_float(parseFloat(str));
10835
- }
10836
- function css_hue_to_rgb(m1, m2, h) {
10837
- if (h < 0)
10838
- h += 1;
10839
- else if (h > 1)
10840
- h -= 1;
10841
- if (h * 6 < 1)
10842
- return m1 + (m2 - m1) * h * 6;
10843
- if (h * 2 < 1)
10844
- return m2;
10845
- if (h * 3 < 2)
10846
- return m1 + (m2 - m1) * (2 / 3 - h) * 6;
10847
- return m1;
10848
- }
10849
- function parseCSSColor(css_str) {
10850
- // Remove all whitespace, not compliant, but should just be more accepting.
10851
- var str = css_str.replace(/ /g, '').toLowerCase();
10852
- // Color keywords (and transparent) lookup.
10853
- if (str in kCSSColorTable)
10854
- return kCSSColorTable[str].slice();
10855
- // dup.
10856
- // #abc and #abc123 syntax.
10857
- if (str[0] === '#') {
10858
- if (str.length === 4) {
10859
- var iv = parseInt(str.substr(1), 16);
10860
- // TODO(deanm): Stricter parsing.
10861
- if (!(iv >= 0 && iv <= 4095))
10862
- return null;
10863
- // Covers NaN.
10864
- return [
10865
- (iv & 3840) >> 4 | (iv & 3840) >> 8,
10866
- iv & 240 | (iv & 240) >> 4,
10867
- iv & 15 | (iv & 15) << 4,
10868
- 1
10869
- ];
10870
- } else if (str.length === 7) {
10871
- var iv = parseInt(str.substr(1), 16);
10872
- // TODO(deanm): Stricter parsing.
10873
- if (!(iv >= 0 && iv <= 16777215))
10874
- return null;
10875
- // Covers NaN.
10876
- return [
10877
- (iv & 16711680) >> 16,
10878
- (iv & 65280) >> 8,
10879
- iv & 255,
10880
- 1
10881
- ];
10882
- }
10883
- return null;
10884
- }
10885
- var op = str.indexOf('('), ep = str.indexOf(')');
10886
- if (op !== -1 && ep + 1 === str.length) {
10887
- var fname = str.substr(0, op);
10888
- var params = str.substr(op + 1, ep - (op + 1)).split(',');
10889
- var alpha = 1;
10890
- // To allow case fallthrough.
10891
- switch (fname) {
10892
- case 'rgba':
10893
- if (params.length !== 4)
10894
- return null;
10895
- alpha = parse_css_float(params.pop());
10896
- // Fall through.
10897
- case 'rgb':
10898
- if (params.length !== 3)
10899
- return null;
10900
- return [
10901
- parse_css_int(params[0]),
10902
- parse_css_int(params[1]),
10903
- parse_css_int(params[2]),
10904
- alpha
10905
- ];
10906
- case 'hsla':
10907
- if (params.length !== 4)
10908
- return null;
10909
- alpha = parse_css_float(params.pop());
10910
- // Fall through.
10911
- case 'hsl':
10912
- if (params.length !== 3)
10913
- return null;
10914
- var h = (parseFloat(params[0]) % 360 + 360) % 360 / 360;
10915
- // 0 .. 1
10916
- // NOTE(deanm): According to the CSS spec s/l should only be
10917
- // percentages, but we don't bother and let float or percentage.
10918
- var s = parse_css_float(params[1]);
10919
- var l = parse_css_float(params[2]);
10920
- var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
10921
- var m1 = l * 2 - m2;
10922
- return [
10923
- clamp_css_byte(css_hue_to_rgb(m1, m2, h + 1 / 3) * 255),
10924
- clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255),
10925
- clamp_css_byte(css_hue_to_rgb(m1, m2, h - 1 / 3) * 255),
10926
- alpha
10927
- ];
10928
- default:
10929
- return null;
10930
- }
10931
- }
10932
- return null;
10933
- }
10934
- try {
10935
- parseCSSColor_1 = csscolorparser.parseCSSColor = parseCSSColor;
10936
- } catch (e) {
9927
+ var hasRequiredCsscolorparser;
9928
+
9929
+ function requireCsscolorparser () {
9930
+ if (hasRequiredCsscolorparser) return csscolorparser;
9931
+ hasRequiredCsscolorparser = 1;
9932
+ // (c) Dean McNamee <dean@gmail.com>, 2012.
9933
+ //
9934
+ // https://github.com/deanm/css-color-parser-js
9935
+ //
9936
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
9937
+ // of this software and associated documentation files (the "Software"), to
9938
+ // deal in the Software without restriction, including without limitation the
9939
+ // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9940
+ // sell copies of the Software, and to permit persons to whom the Software is
9941
+ // furnished to do so, subject to the following conditions:
9942
+ //
9943
+ // The above copyright notice and this permission notice shall be included in
9944
+ // all copies or substantial portions of the Software.
9945
+ //
9946
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9947
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9948
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
9949
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9950
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9951
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
9952
+ // IN THE SOFTWARE.
9953
+ // http://www.w3.org/TR/css3-color/
9954
+ var kCSSColorTable = {
9955
+ 'transparent': [
9956
+ 0,
9957
+ 0,
9958
+ 0,
9959
+ 0
9960
+ ],
9961
+ 'aliceblue': [
9962
+ 240,
9963
+ 248,
9964
+ 255,
9965
+ 1
9966
+ ],
9967
+ 'antiquewhite': [
9968
+ 250,
9969
+ 235,
9970
+ 215,
9971
+ 1
9972
+ ],
9973
+ 'aqua': [
9974
+ 0,
9975
+ 255,
9976
+ 255,
9977
+ 1
9978
+ ],
9979
+ 'aquamarine': [
9980
+ 127,
9981
+ 255,
9982
+ 212,
9983
+ 1
9984
+ ],
9985
+ 'azure': [
9986
+ 240,
9987
+ 255,
9988
+ 255,
9989
+ 1
9990
+ ],
9991
+ 'beige': [
9992
+ 245,
9993
+ 245,
9994
+ 220,
9995
+ 1
9996
+ ],
9997
+ 'bisque': [
9998
+ 255,
9999
+ 228,
10000
+ 196,
10001
+ 1
10002
+ ],
10003
+ 'black': [
10004
+ 0,
10005
+ 0,
10006
+ 0,
10007
+ 1
10008
+ ],
10009
+ 'blanchedalmond': [
10010
+ 255,
10011
+ 235,
10012
+ 205,
10013
+ 1
10014
+ ],
10015
+ 'blue': [
10016
+ 0,
10017
+ 0,
10018
+ 255,
10019
+ 1
10020
+ ],
10021
+ 'blueviolet': [
10022
+ 138,
10023
+ 43,
10024
+ 226,
10025
+ 1
10026
+ ],
10027
+ 'brown': [
10028
+ 165,
10029
+ 42,
10030
+ 42,
10031
+ 1
10032
+ ],
10033
+ 'burlywood': [
10034
+ 222,
10035
+ 184,
10036
+ 135,
10037
+ 1
10038
+ ],
10039
+ 'cadetblue': [
10040
+ 95,
10041
+ 158,
10042
+ 160,
10043
+ 1
10044
+ ],
10045
+ 'chartreuse': [
10046
+ 127,
10047
+ 255,
10048
+ 0,
10049
+ 1
10050
+ ],
10051
+ 'chocolate': [
10052
+ 210,
10053
+ 105,
10054
+ 30,
10055
+ 1
10056
+ ],
10057
+ 'coral': [
10058
+ 255,
10059
+ 127,
10060
+ 80,
10061
+ 1
10062
+ ],
10063
+ 'cornflowerblue': [
10064
+ 100,
10065
+ 149,
10066
+ 237,
10067
+ 1
10068
+ ],
10069
+ 'cornsilk': [
10070
+ 255,
10071
+ 248,
10072
+ 220,
10073
+ 1
10074
+ ],
10075
+ 'crimson': [
10076
+ 220,
10077
+ 20,
10078
+ 60,
10079
+ 1
10080
+ ],
10081
+ 'cyan': [
10082
+ 0,
10083
+ 255,
10084
+ 255,
10085
+ 1
10086
+ ],
10087
+ 'darkblue': [
10088
+ 0,
10089
+ 0,
10090
+ 139,
10091
+ 1
10092
+ ],
10093
+ 'darkcyan': [
10094
+ 0,
10095
+ 139,
10096
+ 139,
10097
+ 1
10098
+ ],
10099
+ 'darkgoldenrod': [
10100
+ 184,
10101
+ 134,
10102
+ 11,
10103
+ 1
10104
+ ],
10105
+ 'darkgray': [
10106
+ 169,
10107
+ 169,
10108
+ 169,
10109
+ 1
10110
+ ],
10111
+ 'darkgreen': [
10112
+ 0,
10113
+ 100,
10114
+ 0,
10115
+ 1
10116
+ ],
10117
+ 'darkgrey': [
10118
+ 169,
10119
+ 169,
10120
+ 169,
10121
+ 1
10122
+ ],
10123
+ 'darkkhaki': [
10124
+ 189,
10125
+ 183,
10126
+ 107,
10127
+ 1
10128
+ ],
10129
+ 'darkmagenta': [
10130
+ 139,
10131
+ 0,
10132
+ 139,
10133
+ 1
10134
+ ],
10135
+ 'darkolivegreen': [
10136
+ 85,
10137
+ 107,
10138
+ 47,
10139
+ 1
10140
+ ],
10141
+ 'darkorange': [
10142
+ 255,
10143
+ 140,
10144
+ 0,
10145
+ 1
10146
+ ],
10147
+ 'darkorchid': [
10148
+ 153,
10149
+ 50,
10150
+ 204,
10151
+ 1
10152
+ ],
10153
+ 'darkred': [
10154
+ 139,
10155
+ 0,
10156
+ 0,
10157
+ 1
10158
+ ],
10159
+ 'darksalmon': [
10160
+ 233,
10161
+ 150,
10162
+ 122,
10163
+ 1
10164
+ ],
10165
+ 'darkseagreen': [
10166
+ 143,
10167
+ 188,
10168
+ 143,
10169
+ 1
10170
+ ],
10171
+ 'darkslateblue': [
10172
+ 72,
10173
+ 61,
10174
+ 139,
10175
+ 1
10176
+ ],
10177
+ 'darkslategray': [
10178
+ 47,
10179
+ 79,
10180
+ 79,
10181
+ 1
10182
+ ],
10183
+ 'darkslategrey': [
10184
+ 47,
10185
+ 79,
10186
+ 79,
10187
+ 1
10188
+ ],
10189
+ 'darkturquoise': [
10190
+ 0,
10191
+ 206,
10192
+ 209,
10193
+ 1
10194
+ ],
10195
+ 'darkviolet': [
10196
+ 148,
10197
+ 0,
10198
+ 211,
10199
+ 1
10200
+ ],
10201
+ 'deeppink': [
10202
+ 255,
10203
+ 20,
10204
+ 147,
10205
+ 1
10206
+ ],
10207
+ 'deepskyblue': [
10208
+ 0,
10209
+ 191,
10210
+ 255,
10211
+ 1
10212
+ ],
10213
+ 'dimgray': [
10214
+ 105,
10215
+ 105,
10216
+ 105,
10217
+ 1
10218
+ ],
10219
+ 'dimgrey': [
10220
+ 105,
10221
+ 105,
10222
+ 105,
10223
+ 1
10224
+ ],
10225
+ 'dodgerblue': [
10226
+ 30,
10227
+ 144,
10228
+ 255,
10229
+ 1
10230
+ ],
10231
+ 'firebrick': [
10232
+ 178,
10233
+ 34,
10234
+ 34,
10235
+ 1
10236
+ ],
10237
+ 'floralwhite': [
10238
+ 255,
10239
+ 250,
10240
+ 240,
10241
+ 1
10242
+ ],
10243
+ 'forestgreen': [
10244
+ 34,
10245
+ 139,
10246
+ 34,
10247
+ 1
10248
+ ],
10249
+ 'fuchsia': [
10250
+ 255,
10251
+ 0,
10252
+ 255,
10253
+ 1
10254
+ ],
10255
+ 'gainsboro': [
10256
+ 220,
10257
+ 220,
10258
+ 220,
10259
+ 1
10260
+ ],
10261
+ 'ghostwhite': [
10262
+ 248,
10263
+ 248,
10264
+ 255,
10265
+ 1
10266
+ ],
10267
+ 'gold': [
10268
+ 255,
10269
+ 215,
10270
+ 0,
10271
+ 1
10272
+ ],
10273
+ 'goldenrod': [
10274
+ 218,
10275
+ 165,
10276
+ 32,
10277
+ 1
10278
+ ],
10279
+ 'gray': [
10280
+ 128,
10281
+ 128,
10282
+ 128,
10283
+ 1
10284
+ ],
10285
+ 'green': [
10286
+ 0,
10287
+ 128,
10288
+ 0,
10289
+ 1
10290
+ ],
10291
+ 'greenyellow': [
10292
+ 173,
10293
+ 255,
10294
+ 47,
10295
+ 1
10296
+ ],
10297
+ 'grey': [
10298
+ 128,
10299
+ 128,
10300
+ 128,
10301
+ 1
10302
+ ],
10303
+ 'honeydew': [
10304
+ 240,
10305
+ 255,
10306
+ 240,
10307
+ 1
10308
+ ],
10309
+ 'hotpink': [
10310
+ 255,
10311
+ 105,
10312
+ 180,
10313
+ 1
10314
+ ],
10315
+ 'indianred': [
10316
+ 205,
10317
+ 92,
10318
+ 92,
10319
+ 1
10320
+ ],
10321
+ 'indigo': [
10322
+ 75,
10323
+ 0,
10324
+ 130,
10325
+ 1
10326
+ ],
10327
+ 'ivory': [
10328
+ 255,
10329
+ 255,
10330
+ 240,
10331
+ 1
10332
+ ],
10333
+ 'khaki': [
10334
+ 240,
10335
+ 230,
10336
+ 140,
10337
+ 1
10338
+ ],
10339
+ 'lavender': [
10340
+ 230,
10341
+ 230,
10342
+ 250,
10343
+ 1
10344
+ ],
10345
+ 'lavenderblush': [
10346
+ 255,
10347
+ 240,
10348
+ 245,
10349
+ 1
10350
+ ],
10351
+ 'lawngreen': [
10352
+ 124,
10353
+ 252,
10354
+ 0,
10355
+ 1
10356
+ ],
10357
+ 'lemonchiffon': [
10358
+ 255,
10359
+ 250,
10360
+ 205,
10361
+ 1
10362
+ ],
10363
+ 'lightblue': [
10364
+ 173,
10365
+ 216,
10366
+ 230,
10367
+ 1
10368
+ ],
10369
+ 'lightcoral': [
10370
+ 240,
10371
+ 128,
10372
+ 128,
10373
+ 1
10374
+ ],
10375
+ 'lightcyan': [
10376
+ 224,
10377
+ 255,
10378
+ 255,
10379
+ 1
10380
+ ],
10381
+ 'lightgoldenrodyellow': [
10382
+ 250,
10383
+ 250,
10384
+ 210,
10385
+ 1
10386
+ ],
10387
+ 'lightgray': [
10388
+ 211,
10389
+ 211,
10390
+ 211,
10391
+ 1
10392
+ ],
10393
+ 'lightgreen': [
10394
+ 144,
10395
+ 238,
10396
+ 144,
10397
+ 1
10398
+ ],
10399
+ 'lightgrey': [
10400
+ 211,
10401
+ 211,
10402
+ 211,
10403
+ 1
10404
+ ],
10405
+ 'lightpink': [
10406
+ 255,
10407
+ 182,
10408
+ 193,
10409
+ 1
10410
+ ],
10411
+ 'lightsalmon': [
10412
+ 255,
10413
+ 160,
10414
+ 122,
10415
+ 1
10416
+ ],
10417
+ 'lightseagreen': [
10418
+ 32,
10419
+ 178,
10420
+ 170,
10421
+ 1
10422
+ ],
10423
+ 'lightskyblue': [
10424
+ 135,
10425
+ 206,
10426
+ 250,
10427
+ 1
10428
+ ],
10429
+ 'lightslategray': [
10430
+ 119,
10431
+ 136,
10432
+ 153,
10433
+ 1
10434
+ ],
10435
+ 'lightslategrey': [
10436
+ 119,
10437
+ 136,
10438
+ 153,
10439
+ 1
10440
+ ],
10441
+ 'lightsteelblue': [
10442
+ 176,
10443
+ 196,
10444
+ 222,
10445
+ 1
10446
+ ],
10447
+ 'lightyellow': [
10448
+ 255,
10449
+ 255,
10450
+ 224,
10451
+ 1
10452
+ ],
10453
+ 'lime': [
10454
+ 0,
10455
+ 255,
10456
+ 0,
10457
+ 1
10458
+ ],
10459
+ 'limegreen': [
10460
+ 50,
10461
+ 205,
10462
+ 50,
10463
+ 1
10464
+ ],
10465
+ 'linen': [
10466
+ 250,
10467
+ 240,
10468
+ 230,
10469
+ 1
10470
+ ],
10471
+ 'magenta': [
10472
+ 255,
10473
+ 0,
10474
+ 255,
10475
+ 1
10476
+ ],
10477
+ 'maroon': [
10478
+ 128,
10479
+ 0,
10480
+ 0,
10481
+ 1
10482
+ ],
10483
+ 'mediumaquamarine': [
10484
+ 102,
10485
+ 205,
10486
+ 170,
10487
+ 1
10488
+ ],
10489
+ 'mediumblue': [
10490
+ 0,
10491
+ 0,
10492
+ 205,
10493
+ 1
10494
+ ],
10495
+ 'mediumorchid': [
10496
+ 186,
10497
+ 85,
10498
+ 211,
10499
+ 1
10500
+ ],
10501
+ 'mediumpurple': [
10502
+ 147,
10503
+ 112,
10504
+ 219,
10505
+ 1
10506
+ ],
10507
+ 'mediumseagreen': [
10508
+ 60,
10509
+ 179,
10510
+ 113,
10511
+ 1
10512
+ ],
10513
+ 'mediumslateblue': [
10514
+ 123,
10515
+ 104,
10516
+ 238,
10517
+ 1
10518
+ ],
10519
+ 'mediumspringgreen': [
10520
+ 0,
10521
+ 250,
10522
+ 154,
10523
+ 1
10524
+ ],
10525
+ 'mediumturquoise': [
10526
+ 72,
10527
+ 209,
10528
+ 204,
10529
+ 1
10530
+ ],
10531
+ 'mediumvioletred': [
10532
+ 199,
10533
+ 21,
10534
+ 133,
10535
+ 1
10536
+ ],
10537
+ 'midnightblue': [
10538
+ 25,
10539
+ 25,
10540
+ 112,
10541
+ 1
10542
+ ],
10543
+ 'mintcream': [
10544
+ 245,
10545
+ 255,
10546
+ 250,
10547
+ 1
10548
+ ],
10549
+ 'mistyrose': [
10550
+ 255,
10551
+ 228,
10552
+ 225,
10553
+ 1
10554
+ ],
10555
+ 'moccasin': [
10556
+ 255,
10557
+ 228,
10558
+ 181,
10559
+ 1
10560
+ ],
10561
+ 'navajowhite': [
10562
+ 255,
10563
+ 222,
10564
+ 173,
10565
+ 1
10566
+ ],
10567
+ 'navy': [
10568
+ 0,
10569
+ 0,
10570
+ 128,
10571
+ 1
10572
+ ],
10573
+ 'oldlace': [
10574
+ 253,
10575
+ 245,
10576
+ 230,
10577
+ 1
10578
+ ],
10579
+ 'olive': [
10580
+ 128,
10581
+ 128,
10582
+ 0,
10583
+ 1
10584
+ ],
10585
+ 'olivedrab': [
10586
+ 107,
10587
+ 142,
10588
+ 35,
10589
+ 1
10590
+ ],
10591
+ 'orange': [
10592
+ 255,
10593
+ 165,
10594
+ 0,
10595
+ 1
10596
+ ],
10597
+ 'orangered': [
10598
+ 255,
10599
+ 69,
10600
+ 0,
10601
+ 1
10602
+ ],
10603
+ 'orchid': [
10604
+ 218,
10605
+ 112,
10606
+ 214,
10607
+ 1
10608
+ ],
10609
+ 'palegoldenrod': [
10610
+ 238,
10611
+ 232,
10612
+ 170,
10613
+ 1
10614
+ ],
10615
+ 'palegreen': [
10616
+ 152,
10617
+ 251,
10618
+ 152,
10619
+ 1
10620
+ ],
10621
+ 'paleturquoise': [
10622
+ 175,
10623
+ 238,
10624
+ 238,
10625
+ 1
10626
+ ],
10627
+ 'palevioletred': [
10628
+ 219,
10629
+ 112,
10630
+ 147,
10631
+ 1
10632
+ ],
10633
+ 'papayawhip': [
10634
+ 255,
10635
+ 239,
10636
+ 213,
10637
+ 1
10638
+ ],
10639
+ 'peachpuff': [
10640
+ 255,
10641
+ 218,
10642
+ 185,
10643
+ 1
10644
+ ],
10645
+ 'peru': [
10646
+ 205,
10647
+ 133,
10648
+ 63,
10649
+ 1
10650
+ ],
10651
+ 'pink': [
10652
+ 255,
10653
+ 192,
10654
+ 203,
10655
+ 1
10656
+ ],
10657
+ 'plum': [
10658
+ 221,
10659
+ 160,
10660
+ 221,
10661
+ 1
10662
+ ],
10663
+ 'powderblue': [
10664
+ 176,
10665
+ 224,
10666
+ 230,
10667
+ 1
10668
+ ],
10669
+ 'purple': [
10670
+ 128,
10671
+ 0,
10672
+ 128,
10673
+ 1
10674
+ ],
10675
+ 'rebeccapurple': [
10676
+ 102,
10677
+ 51,
10678
+ 153,
10679
+ 1
10680
+ ],
10681
+ 'red': [
10682
+ 255,
10683
+ 0,
10684
+ 0,
10685
+ 1
10686
+ ],
10687
+ 'rosybrown': [
10688
+ 188,
10689
+ 143,
10690
+ 143,
10691
+ 1
10692
+ ],
10693
+ 'royalblue': [
10694
+ 65,
10695
+ 105,
10696
+ 225,
10697
+ 1
10698
+ ],
10699
+ 'saddlebrown': [
10700
+ 139,
10701
+ 69,
10702
+ 19,
10703
+ 1
10704
+ ],
10705
+ 'salmon': [
10706
+ 250,
10707
+ 128,
10708
+ 114,
10709
+ 1
10710
+ ],
10711
+ 'sandybrown': [
10712
+ 244,
10713
+ 164,
10714
+ 96,
10715
+ 1
10716
+ ],
10717
+ 'seagreen': [
10718
+ 46,
10719
+ 139,
10720
+ 87,
10721
+ 1
10722
+ ],
10723
+ 'seashell': [
10724
+ 255,
10725
+ 245,
10726
+ 238,
10727
+ 1
10728
+ ],
10729
+ 'sienna': [
10730
+ 160,
10731
+ 82,
10732
+ 45,
10733
+ 1
10734
+ ],
10735
+ 'silver': [
10736
+ 192,
10737
+ 192,
10738
+ 192,
10739
+ 1
10740
+ ],
10741
+ 'skyblue': [
10742
+ 135,
10743
+ 206,
10744
+ 235,
10745
+ 1
10746
+ ],
10747
+ 'slateblue': [
10748
+ 106,
10749
+ 90,
10750
+ 205,
10751
+ 1
10752
+ ],
10753
+ 'slategray': [
10754
+ 112,
10755
+ 128,
10756
+ 144,
10757
+ 1
10758
+ ],
10759
+ 'slategrey': [
10760
+ 112,
10761
+ 128,
10762
+ 144,
10763
+ 1
10764
+ ],
10765
+ 'snow': [
10766
+ 255,
10767
+ 250,
10768
+ 250,
10769
+ 1
10770
+ ],
10771
+ 'springgreen': [
10772
+ 0,
10773
+ 255,
10774
+ 127,
10775
+ 1
10776
+ ],
10777
+ 'steelblue': [
10778
+ 70,
10779
+ 130,
10780
+ 180,
10781
+ 1
10782
+ ],
10783
+ 'tan': [
10784
+ 210,
10785
+ 180,
10786
+ 140,
10787
+ 1
10788
+ ],
10789
+ 'teal': [
10790
+ 0,
10791
+ 128,
10792
+ 128,
10793
+ 1
10794
+ ],
10795
+ 'thistle': [
10796
+ 216,
10797
+ 191,
10798
+ 216,
10799
+ 1
10800
+ ],
10801
+ 'tomato': [
10802
+ 255,
10803
+ 99,
10804
+ 71,
10805
+ 1
10806
+ ],
10807
+ 'turquoise': [
10808
+ 64,
10809
+ 224,
10810
+ 208,
10811
+ 1
10812
+ ],
10813
+ 'violet': [
10814
+ 238,
10815
+ 130,
10816
+ 238,
10817
+ 1
10818
+ ],
10819
+ 'wheat': [
10820
+ 245,
10821
+ 222,
10822
+ 179,
10823
+ 1
10824
+ ],
10825
+ 'white': [
10826
+ 255,
10827
+ 255,
10828
+ 255,
10829
+ 1
10830
+ ],
10831
+ 'whitesmoke': [
10832
+ 245,
10833
+ 245,
10834
+ 245,
10835
+ 1
10836
+ ],
10837
+ 'yellow': [
10838
+ 255,
10839
+ 255,
10840
+ 0,
10841
+ 1
10842
+ ],
10843
+ 'yellowgreen': [
10844
+ 154,
10845
+ 205,
10846
+ 50,
10847
+ 1
10848
+ ]
10849
+ };
10850
+ function clamp_css_byte(i) {
10851
+ // Clamp to integer 0 .. 255.
10852
+ i = Math.round(i);
10853
+ // Seems to be what Chrome does (vs truncation).
10854
+ return i < 0 ? 0 : i > 255 ? 255 : i;
10855
+ }
10856
+ function clamp_css_float(f) {
10857
+ // Clamp to float 0.0 .. 1.0.
10858
+ return f < 0 ? 0 : f > 1 ? 1 : f;
10859
+ }
10860
+ function parse_css_int(str) {
10861
+ // int or percentage.
10862
+ if (str[str.length - 1] === '%')
10863
+ return clamp_css_byte(parseFloat(str) / 100 * 255);
10864
+ return clamp_css_byte(parseInt(str));
10865
+ }
10866
+ function parse_css_float(str) {
10867
+ // float or percentage.
10868
+ if (str[str.length - 1] === '%')
10869
+ return clamp_css_float(parseFloat(str) / 100);
10870
+ return clamp_css_float(parseFloat(str));
10871
+ }
10872
+ function css_hue_to_rgb(m1, m2, h) {
10873
+ if (h < 0)
10874
+ h += 1;
10875
+ else if (h > 1)
10876
+ h -= 1;
10877
+ if (h * 6 < 1)
10878
+ return m1 + (m2 - m1) * h * 6;
10879
+ if (h * 2 < 1)
10880
+ return m2;
10881
+ if (h * 3 < 2)
10882
+ return m1 + (m2 - m1) * (2 / 3 - h) * 6;
10883
+ return m1;
10884
+ }
10885
+ function parseCSSColor(css_str) {
10886
+ // Remove all whitespace, not compliant, but should just be more accepting.
10887
+ var str = css_str.replace(/ /g, '').toLowerCase();
10888
+ // Color keywords (and transparent) lookup.
10889
+ if (str in kCSSColorTable)
10890
+ return kCSSColorTable[str].slice();
10891
+ // dup.
10892
+ // #abc and #abc123 syntax.
10893
+ if (str[0] === '#') {
10894
+ if (str.length === 4) {
10895
+ var iv = parseInt(str.substr(1), 16);
10896
+ // TODO(deanm): Stricter parsing.
10897
+ if (!(iv >= 0 && iv <= 4095))
10898
+ return null;
10899
+ // Covers NaN.
10900
+ return [
10901
+ (iv & 3840) >> 4 | (iv & 3840) >> 8,
10902
+ iv & 240 | (iv & 240) >> 4,
10903
+ iv & 15 | (iv & 15) << 4,
10904
+ 1
10905
+ ];
10906
+ } else if (str.length === 7) {
10907
+ var iv = parseInt(str.substr(1), 16);
10908
+ // TODO(deanm): Stricter parsing.
10909
+ if (!(iv >= 0 && iv <= 16777215))
10910
+ return null;
10911
+ // Covers NaN.
10912
+ return [
10913
+ (iv & 16711680) >> 16,
10914
+ (iv & 65280) >> 8,
10915
+ iv & 255,
10916
+ 1
10917
+ ];
10918
+ }
10919
+ return null;
10920
+ }
10921
+ var op = str.indexOf('('), ep = str.indexOf(')');
10922
+ if (op !== -1 && ep + 1 === str.length) {
10923
+ var fname = str.substr(0, op);
10924
+ var params = str.substr(op + 1, ep - (op + 1)).split(',');
10925
+ var alpha = 1;
10926
+ // To allow case fallthrough.
10927
+ switch (fname) {
10928
+ case 'rgba':
10929
+ if (params.length !== 4)
10930
+ return null;
10931
+ alpha = parse_css_float(params.pop());
10932
+ // Fall through.
10933
+ case 'rgb':
10934
+ if (params.length !== 3)
10935
+ return null;
10936
+ return [
10937
+ parse_css_int(params[0]),
10938
+ parse_css_int(params[1]),
10939
+ parse_css_int(params[2]),
10940
+ alpha
10941
+ ];
10942
+ case 'hsla':
10943
+ if (params.length !== 4)
10944
+ return null;
10945
+ alpha = parse_css_float(params.pop());
10946
+ // Fall through.
10947
+ case 'hsl':
10948
+ if (params.length !== 3)
10949
+ return null;
10950
+ var h = (parseFloat(params[0]) % 360 + 360) % 360 / 360;
10951
+ // 0 .. 1
10952
+ // NOTE(deanm): According to the CSS spec s/l should only be
10953
+ // percentages, but we don't bother and let float or percentage.
10954
+ var s = parse_css_float(params[1]);
10955
+ var l = parse_css_float(params[2]);
10956
+ var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
10957
+ var m1 = l * 2 - m2;
10958
+ return [
10959
+ clamp_css_byte(css_hue_to_rgb(m1, m2, h + 1 / 3) * 255),
10960
+ clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255),
10961
+ clamp_css_byte(css_hue_to_rgb(m1, m2, h - 1 / 3) * 255),
10962
+ alpha
10963
+ ];
10964
+ default:
10965
+ return null;
10966
+ }
10967
+ }
10968
+ return null;
10969
+ }
10970
+ try {
10971
+ csscolorparser.parseCSSColor = parseCSSColor;
10972
+ } catch (e) {
10973
+ }
10974
+ return csscolorparser;
10937
10975
  }
10938
10976
 
10977
+ var csscolorparserExports = requireCsscolorparser();
10978
+
10939
10979
  function number(a, b, t) {
10940
10980
  return a * (1 - t) + b * t;
10941
10981
  }
@@ -10976,7 +11016,7 @@ class Color {
10976
11016
  if (typeof input !== 'string') {
10977
11017
  return void 0;
10978
11018
  }
10979
- const rgba = parseCSSColor_1(input);
11019
+ const rgba = csscolorparserExports.parseCSSColor(input);
10980
11020
  if (!rgba) {
10981
11021
  return void 0;
10982
11022
  }
@@ -14083,72 +14123,81 @@ class Step {
14083
14123
  }
14084
14124
  }
14085
14125
 
14086
- var unitbezier = UnitBezier;
14087
- function UnitBezier(p1x, p1y, p2x, p2y) {
14088
- // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).
14089
- this.cx = 3 * p1x;
14090
- this.bx = 3 * (p2x - p1x) - this.cx;
14091
- this.ax = 1 - this.cx - this.bx;
14092
- this.cy = 3 * p1y;
14093
- this.by = 3 * (p2y - p1y) - this.cy;
14094
- this.ay = 1 - this.cy - this.by;
14095
- this.p1x = p1x;
14096
- this.p1y = p1y;
14097
- this.p2x = p2x;
14098
- this.p2y = p2y;
14099
- }
14100
- UnitBezier.prototype = {
14101
- sampleCurveX: function (t) {
14102
- // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.
14103
- return ((this.ax * t + this.bx) * t + this.cx) * t;
14104
- },
14105
- sampleCurveY: function (t) {
14106
- return ((this.ay * t + this.by) * t + this.cy) * t;
14107
- },
14108
- sampleCurveDerivativeX: function (t) {
14109
- return (3 * this.ax * t + 2 * this.bx) * t + this.cx;
14110
- },
14111
- solveCurveX: function (x, epsilon) {
14112
- if (epsilon === undefined)
14113
- epsilon = 0.000001;
14114
- if (x < 0)
14115
- return 0;
14116
- if (x > 1)
14117
- return 1;
14118
- var t = x;
14119
- // First try a few iterations of Newton's method - normally very fast.
14120
- for (var i = 0; i < 8; i++) {
14121
- var x2 = this.sampleCurveX(t) - x;
14122
- if (Math.abs(x2) < epsilon)
14123
- return t;
14124
- var d2 = this.sampleCurveDerivativeX(t);
14125
- if (Math.abs(d2) < 0.000001)
14126
- break;
14127
- t = t - x2 / d2;
14128
- }
14129
- // Fall back to the bisection method for reliability.
14130
- var t0 = 0;
14131
- var t1 = 1;
14132
- t = x;
14133
- for (i = 0; i < 20; i++) {
14134
- x2 = this.sampleCurveX(t);
14135
- if (Math.abs(x2 - x) < epsilon)
14136
- break;
14137
- if (x > x2) {
14138
- t0 = t;
14139
- } else {
14140
- t1 = t;
14141
- }
14142
- t = (t1 - t0) * 0.5 + t0;
14143
- }
14144
- return t;
14145
- },
14146
- solve: function (x, epsilon) {
14147
- return this.sampleCurveY(this.solveCurveX(x, epsilon));
14148
- }
14149
- };
14126
+ var unitbezier;
14127
+ var hasRequiredUnitbezier;
14128
+
14129
+ function requireUnitbezier () {
14130
+ if (hasRequiredUnitbezier) return unitbezier;
14131
+ hasRequiredUnitbezier = 1;
14132
+ unitbezier = UnitBezier;
14133
+ function UnitBezier(p1x, p1y, p2x, p2y) {
14134
+ // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).
14135
+ this.cx = 3 * p1x;
14136
+ this.bx = 3 * (p2x - p1x) - this.cx;
14137
+ this.ax = 1 - this.cx - this.bx;
14138
+ this.cy = 3 * p1y;
14139
+ this.by = 3 * (p2y - p1y) - this.cy;
14140
+ this.ay = 1 - this.cy - this.by;
14141
+ this.p1x = p1x;
14142
+ this.p1y = p1y;
14143
+ this.p2x = p2x;
14144
+ this.p2y = p2y;
14145
+ }
14146
+ UnitBezier.prototype = {
14147
+ sampleCurveX: function (t) {
14148
+ // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.
14149
+ return ((this.ax * t + this.bx) * t + this.cx) * t;
14150
+ },
14151
+ sampleCurveY: function (t) {
14152
+ return ((this.ay * t + this.by) * t + this.cy) * t;
14153
+ },
14154
+ sampleCurveDerivativeX: function (t) {
14155
+ return (3 * this.ax * t + 2 * this.bx) * t + this.cx;
14156
+ },
14157
+ solveCurveX: function (x, epsilon) {
14158
+ if (epsilon === undefined)
14159
+ epsilon = 0.000001;
14160
+ if (x < 0)
14161
+ return 0;
14162
+ if (x > 1)
14163
+ return 1;
14164
+ var t = x;
14165
+ // First try a few iterations of Newton's method - normally very fast.
14166
+ for (var i = 0; i < 8; i++) {
14167
+ var x2 = this.sampleCurveX(t) - x;
14168
+ if (Math.abs(x2) < epsilon)
14169
+ return t;
14170
+ var d2 = this.sampleCurveDerivativeX(t);
14171
+ if (Math.abs(d2) < 0.000001)
14172
+ break;
14173
+ t = t - x2 / d2;
14174
+ }
14175
+ // Fall back to the bisection method for reliability.
14176
+ var t0 = 0;
14177
+ var t1 = 1;
14178
+ t = x;
14179
+ for (i = 0; i < 20; i++) {
14180
+ x2 = this.sampleCurveX(t);
14181
+ if (Math.abs(x2 - x) < epsilon)
14182
+ break;
14183
+ if (x > x2) {
14184
+ t0 = t;
14185
+ } else {
14186
+ t1 = t;
14187
+ }
14188
+ t = (t1 - t0) * 0.5 + t0;
14189
+ }
14190
+ return t;
14191
+ },
14192
+ solve: function (x, epsilon) {
14193
+ return this.sampleCurveY(this.solveCurveX(x, epsilon));
14194
+ }
14195
+ };
14196
+ return unitbezier;
14197
+ }
14150
14198
 
14151
- var UnitBezier$1 = /*@__PURE__*/getDefaultExportFromCjs(unitbezier);
14199
+ var unitbezierExports = requireUnitbezier();
14200
+ var UnitBezier = /*@__PURE__*/getDefaultExportFromCjs(unitbezierExports);
14152
14201
 
14153
14202
  const Xn = 0.95047, Yn = 1, Zn = 1.08883, t0 = 4 / 29, t1 = 6 / 29, t2 = 3 * t1 * t1, t3 = t1 * t1 * t1, deg2rad = Math.PI / 180, rad2deg = 180 / Math.PI;
14154
14203
  function xyz2lab(t) {
@@ -14258,7 +14307,7 @@ class Interpolate {
14258
14307
  t = exponentialInterpolation(input, 1, lower, upper);
14259
14308
  } else if (interpolation.name === 'cubic-bezier') {
14260
14309
  const c = interpolation.controlPoints;
14261
- const ub = new UnitBezier$1(c[0], c[1], c[2], c[3]);
14310
+ const ub = new UnitBezier(c[0], c[1], c[2], c[3]);
14262
14311
  t = ub.solve(exponentialInterpolation(input, 1, lower, upper));
14263
14312
  }
14264
14313
  return t;
@@ -18288,7 +18337,7 @@ function validateColor(options) {
18288
18337
  if (type !== 'string') {
18289
18338
  return [new ValidationError(key, value, `color expected, ${ type } found`)];
18290
18339
  }
18291
- if (parseCSSColor_1(value) === null) {
18340
+ if (csscolorparserExports.parseCSSColor(value) === null) {
18292
18341
  return [new ValidationError(key, value, `color expected, "${ value }" found`)];
18293
18342
  }
18294
18343
  return [];
@@ -19120,1059 +19169,1067 @@ var jsonlint$1 = {};
19120
19169
 
19121
19170
  /* parser generated by jison 0.4.15 */
19122
19171
 
19123
- (function (exports) {
19124
- /*
19125
- Returns a Parser object of the following structure:
19172
+ var hasRequiredJsonlint;
19126
19173
 
19127
- Parser: {
19128
- yy: {}
19129
- }
19174
+ function requireJsonlint () {
19175
+ if (hasRequiredJsonlint) return jsonlint$1;
19176
+ hasRequiredJsonlint = 1;
19177
+ (function (exports) {
19178
+ /*
19179
+ Returns a Parser object of the following structure:
19130
19180
 
19131
- Parser.prototype: {
19132
- yy: {},
19133
- trace: function(),
19134
- symbols_: {associative list: name ==> number},
19135
- terminals_: {associative list: number ==> name},
19136
- productions_: [...],
19137
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
19138
- table: [...],
19139
- defaultActions: {...},
19140
- parseError: function(str, hash),
19141
- parse: function(input),
19181
+ Parser: {
19182
+ yy: {}
19183
+ }
19142
19184
 
19143
- lexer: {
19144
- EOF: 1,
19145
- parseError: function(str, hash),
19146
- setInput: function(input),
19147
- input: function(),
19148
- unput: function(str),
19149
- more: function(),
19150
- less: function(n),
19151
- pastInput: function(),
19152
- upcomingInput: function(),
19153
- showPosition: function(),
19154
- test_match: function(regex_match_array, rule_index),
19155
- next: function(),
19156
- lex: function(),
19157
- begin: function(condition),
19158
- popState: function(),
19159
- _currentRules: function(),
19160
- topState: function(),
19161
- pushState: function(condition),
19185
+ Parser.prototype: {
19186
+ yy: {},
19187
+ trace: function(),
19188
+ symbols_: {associative list: name ==> number},
19189
+ terminals_: {associative list: number ==> name},
19190
+ productions_: [...],
19191
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
19192
+ table: [...],
19193
+ defaultActions: {...},
19194
+ parseError: function(str, hash),
19195
+ parse: function(input),
19162
19196
 
19163
- options: {
19164
- ranges: boolean (optional: true ==> token location info will include a .range[] member)
19165
- flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
19166
- backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
19167
- },
19197
+ lexer: {
19198
+ EOF: 1,
19199
+ parseError: function(str, hash),
19200
+ setInput: function(input),
19201
+ input: function(),
19202
+ unput: function(str),
19203
+ more: function(),
19204
+ less: function(n),
19205
+ pastInput: function(),
19206
+ upcomingInput: function(),
19207
+ showPosition: function(),
19208
+ test_match: function(regex_match_array, rule_index),
19209
+ next: function(),
19210
+ lex: function(),
19211
+ begin: function(condition),
19212
+ popState: function(),
19213
+ _currentRules: function(),
19214
+ topState: function(),
19215
+ pushState: function(condition),
19168
19216
 
19169
- performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
19170
- rules: [...],
19171
- conditions: {associative list: name ==> set},
19172
- }
19173
- }
19217
+ options: {
19218
+ ranges: boolean (optional: true ==> token location info will include a .range[] member)
19219
+ flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
19220
+ backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
19221
+ },
19174
19222
 
19223
+ performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
19224
+ rules: [...],
19225
+ conditions: {associative list: name ==> set},
19226
+ }
19227
+ }
19175
19228
 
19176
- token location info (@$, _$, etc.): {
19177
- first_line: n,
19178
- last_line: n,
19179
- first_column: n,
19180
- last_column: n,
19181
- range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
19182
- }
19183
19229
 
19230
+ token location info (@$, _$, etc.): {
19231
+ first_line: n,
19232
+ last_line: n,
19233
+ first_column: n,
19234
+ last_column: n,
19235
+ range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
19236
+ }
19184
19237
 
19185
- the parseError function receives a 'hash' object with these members for lexer and parser errors: {
19186
- text: (matched text)
19187
- token: (the produced terminal token, if any)
19188
- line: (yylineno)
19189
- }
19190
- while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
19191
- loc: (yylloc)
19192
- expected: (string describing the set of expected tokens)
19193
- recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
19194
- }
19195
- */
19196
- var parser = (function () {
19197
- var o = function (k, v, o, l) {
19198
- for (o = o || {}, l = k.length; l--; o[k[l]] = v);
19199
- return o;
19200
- }, $V0 = [
19201
- 1,
19202
- 12
19203
- ], $V1 = [
19204
- 1,
19205
- 13
19206
- ], $V2 = [
19207
- 1,
19208
- 9
19209
- ], $V3 = [
19210
- 1,
19211
- 10
19212
- ], $V4 = [
19213
- 1,
19214
- 11
19215
- ], $V5 = [
19216
- 1,
19217
- 14
19218
- ], $V6 = [
19219
- 1,
19220
- 15
19221
- ], $V7 = [
19222
- 14,
19223
- 18,
19224
- 22,
19225
- 24
19226
- ], $V8 = [
19227
- 18,
19228
- 22
19229
- ], $V9 = [
19230
- 22,
19231
- 24
19232
- ];
19233
- var parser = {
19234
- trace: function trace() {
19235
- },
19236
- yy: {},
19237
- symbols_: {
19238
- 'error': 2,
19239
- 'JSONString': 3,
19240
- 'STRING': 4,
19241
- 'JSONNumber': 5,
19242
- 'NUMBER': 6,
19243
- 'JSONNullLiteral': 7,
19244
- 'NULL': 8,
19245
- 'JSONBooleanLiteral': 9,
19246
- 'TRUE': 10,
19247
- 'FALSE': 11,
19248
- 'JSONText': 12,
19249
- 'JSONValue': 13,
19250
- 'EOF': 14,
19251
- 'JSONObject': 15,
19252
- 'JSONArray': 16,
19253
- '{': 17,
19254
- '}': 18,
19255
- 'JSONMemberList': 19,
19256
- 'JSONMember': 20,
19257
- ':': 21,
19258
- ',': 22,
19259
- '[': 23,
19260
- ']': 24,
19261
- 'JSONElementList': 25,
19262
- '$accept': 0,
19263
- '$end': 1
19264
- },
19265
- terminals_: {
19266
- 2: 'error',
19267
- 4: 'STRING',
19268
- 6: 'NUMBER',
19269
- 8: 'NULL',
19270
- 10: 'TRUE',
19271
- 11: 'FALSE',
19272
- 14: 'EOF',
19273
- 17: '{',
19274
- 18: '}',
19275
- 21: ':',
19276
- 22: ',',
19277
- 23: '[',
19278
- 24: ']'
19279
- },
19280
- productions_: [
19281
- 0,
19282
- [
19283
- 3,
19284
- 1
19285
- ],
19286
- [
19287
- 5,
19288
- 1
19289
- ],
19290
- [
19291
- 7,
19292
- 1
19293
- ],
19294
- [
19295
- 9,
19296
- 1
19297
- ],
19298
- [
19299
- 9,
19300
- 1
19301
- ],
19302
- [
19303
- 12,
19304
- 2
19305
- ],
19306
- [
19307
- 13,
19308
- 1
19309
- ],
19310
- [
19311
- 13,
19312
- 1
19313
- ],
19314
- [
19315
- 13,
19316
- 1
19317
- ],
19318
- [
19319
- 13,
19320
- 1
19321
- ],
19322
- [
19323
- 13,
19324
- 1
19325
- ],
19326
- [
19327
- 13,
19328
- 1
19329
- ],
19330
- [
19331
- 15,
19332
- 2
19333
- ],
19334
- [
19335
- 15,
19336
- 3
19337
- ],
19338
- [
19339
- 20,
19340
- 3
19341
- ],
19342
- [
19343
- 19,
19344
- 1
19345
- ],
19346
- [
19347
- 19,
19348
- 3
19349
- ],
19350
- [
19351
- 16,
19352
- 2
19353
- ],
19354
- [
19355
- 16,
19356
- 3
19357
- ],
19358
- [
19359
- 25,
19360
- 1
19361
- ],
19362
- [
19363
- 25,
19364
- 3
19365
- ]
19366
- ],
19367
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
19368
- /* this == yyval */
19369
- var $0 = $$.length - 1;
19370
- switch (yystate) {
19371
- case 1:
19372
- // replace escaped characters with actual character
19373
- this.$ = new String(yytext.replace(/\\(\\|")/g, '$' + '1').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\v/g, '\x0B').replace(/\\f/g, '\f').replace(/\\b/g, '\b'));
19374
- this.$.__line__ = this._$.first_line;
19375
- break;
19376
- case 2:
19377
- this.$ = new Number(yytext);
19378
- this.$.__line__ = this._$.first_line;
19379
- break;
19380
- case 3:
19381
- this.$ = null;
19382
- break;
19383
- case 4:
19384
- this.$ = new Boolean(true);
19385
- this.$.__line__ = this._$.first_line;
19386
- break;
19387
- case 5:
19388
- this.$ = new Boolean(false);
19389
- this.$.__line__ = this._$.first_line;
19390
- break;
19391
- case 6:
19392
- return this.$ = $$[$0 - 1];
19393
- case 13:
19394
- this.$ = {};
19395
- Object.defineProperty(this.$, '__line__', {
19396
- value: this._$.first_line,
19397
- enumerable: false
19398
- });
19399
- break;
19400
- case 14:
19401
- case 19:
19402
- this.$ = $$[$0 - 1];
19403
- Object.defineProperty(this.$, '__line__', {
19404
- value: this._$.first_line,
19405
- enumerable: false
19406
- });
19407
- break;
19408
- case 15:
19409
- this.$ = [
19410
- $$[$0 - 2],
19411
- $$[$0]
19412
- ];
19413
- break;
19414
- case 16:
19415
- this.$ = {};
19416
- this.$[$$[$0][0]] = $$[$0][1];
19417
- break;
19418
- case 17:
19419
- this.$ = $$[$0 - 2];
19420
- $$[$0 - 2][$$[$0][0]] = $$[$0][1];
19421
- break;
19422
- case 18:
19423
- this.$ = [];
19424
- Object.defineProperty(this.$, '__line__', {
19425
- value: this._$.first_line,
19426
- enumerable: false
19427
- });
19428
- break;
19429
- case 20:
19430
- this.$ = [$$[$0]];
19431
- break;
19432
- case 21:
19433
- this.$ = $$[$0 - 2];
19434
- $$[$0 - 2].push($$[$0]);
19435
- break;
19436
- }
19437
- },
19438
- table: [
19439
- {
19440
- 3: 5,
19441
- 4: $V0,
19442
- 5: 6,
19443
- 6: $V1,
19444
- 7: 3,
19445
- 8: $V2,
19446
- 9: 4,
19447
- 10: $V3,
19448
- 11: $V4,
19449
- 12: 1,
19450
- 13: 2,
19451
- 15: 7,
19452
- 16: 8,
19453
- 17: $V5,
19454
- 23: $V6
19455
- },
19456
- { 1: [3] },
19457
- {
19458
- 14: [
19459
- 1,
19460
- 16
19461
- ]
19462
- },
19463
- o($V7, [
19464
- 2,
19465
- 7
19466
- ]),
19467
- o($V7, [
19468
- 2,
19469
- 8
19470
- ]),
19471
- o($V7, [
19472
- 2,
19473
- 9
19474
- ]),
19475
- o($V7, [
19476
- 2,
19477
- 10
19478
- ]),
19479
- o($V7, [
19480
- 2,
19481
- 11
19482
- ]),
19483
- o($V7, [
19484
- 2,
19485
- 12
19486
- ]),
19487
- o($V7, [
19488
- 2,
19489
- 3
19490
- ]),
19491
- o($V7, [
19492
- 2,
19493
- 4
19494
- ]),
19495
- o($V7, [
19496
- 2,
19497
- 5
19498
- ]),
19499
- o([
19500
- 14,
19501
- 18,
19502
- 21,
19503
- 22,
19504
- 24
19505
- ], [
19506
- 2,
19507
- 1
19508
- ]),
19509
- o($V7, [
19510
- 2,
19511
- 2
19512
- ]),
19513
- {
19514
- 3: 20,
19515
- 4: $V0,
19516
- 18: [
19517
- 1,
19518
- 17
19519
- ],
19520
- 19: 18,
19521
- 20: 19
19522
- },
19523
- {
19524
- 3: 5,
19525
- 4: $V0,
19526
- 5: 6,
19527
- 6: $V1,
19528
- 7: 3,
19529
- 8: $V2,
19530
- 9: 4,
19531
- 10: $V3,
19532
- 11: $V4,
19533
- 13: 23,
19534
- 15: 7,
19535
- 16: 8,
19536
- 17: $V5,
19537
- 23: $V6,
19538
- 24: [
19539
- 1,
19540
- 21
19541
- ],
19542
- 25: 22
19543
- },
19544
- {
19545
- 1: [
19546
- 2,
19547
- 6
19548
- ]
19549
- },
19550
- o($V7, [
19551
- 2,
19552
- 13
19553
- ]),
19554
- {
19555
- 18: [
19556
- 1,
19557
- 24
19558
- ],
19559
- 22: [
19560
- 1,
19561
- 25
19562
- ]
19563
- },
19564
- o($V8, [
19565
- 2,
19566
- 16
19567
- ]),
19568
- {
19569
- 21: [
19570
- 1,
19571
- 26
19572
- ]
19573
- },
19574
- o($V7, [
19575
- 2,
19576
- 18
19577
- ]),
19578
- {
19579
- 22: [
19580
- 1,
19581
- 28
19582
- ],
19583
- 24: [
19584
- 1,
19585
- 27
19586
- ]
19587
- },
19588
- o($V9, [
19589
- 2,
19590
- 20
19591
- ]),
19592
- o($V7, [
19593
- 2,
19594
- 14
19595
- ]),
19596
- {
19597
- 3: 20,
19598
- 4: $V0,
19599
- 20: 29
19600
- },
19601
- {
19602
- 3: 5,
19603
- 4: $V0,
19604
- 5: 6,
19605
- 6: $V1,
19606
- 7: 3,
19607
- 8: $V2,
19608
- 9: 4,
19609
- 10: $V3,
19610
- 11: $V4,
19611
- 13: 30,
19612
- 15: 7,
19613
- 16: 8,
19614
- 17: $V5,
19615
- 23: $V6
19616
- },
19617
- o($V7, [
19618
- 2,
19619
- 19
19620
- ]),
19621
- {
19622
- 3: 5,
19623
- 4: $V0,
19624
- 5: 6,
19625
- 6: $V1,
19626
- 7: 3,
19627
- 8: $V2,
19628
- 9: 4,
19629
- 10: $V3,
19630
- 11: $V4,
19631
- 13: 31,
19632
- 15: 7,
19633
- 16: 8,
19634
- 17: $V5,
19635
- 23: $V6
19636
- },
19637
- o($V8, [
19638
- 2,
19639
- 17
19640
- ]),
19641
- o($V8, [
19642
- 2,
19643
- 15
19644
- ]),
19645
- o($V9, [
19646
- 2,
19647
- 21
19648
- ])
19649
- ],
19650
- defaultActions: {
19651
- 16: [
19652
- 2,
19653
- 6
19654
- ]
19655
- },
19656
- parseError: function parseError(str, hash) {
19657
- if (hash.recoverable) {
19658
- this.trace(str);
19659
- } else {
19660
- throw new Error(str);
19661
- }
19662
- },
19663
- parse: function parse(input) {
19664
- var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
19665
- var args = lstack.slice.call(arguments, 1);
19666
- var lexer = Object.create(this.lexer);
19667
- var sharedState = { yy: {} };
19668
- for (var k in this.yy) {
19669
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
19670
- sharedState.yy[k] = this.yy[k];
19671
- }
19672
- }
19673
- lexer.setInput(input, sharedState.yy);
19674
- sharedState.yy.lexer = lexer;
19675
- sharedState.yy.parser = this;
19676
- if (typeof lexer.yylloc == 'undefined') {
19677
- lexer.yylloc = {};
19678
- }
19679
- var yyloc = lexer.yylloc;
19680
- lstack.push(yyloc);
19681
- var ranges = lexer.options && lexer.options.ranges;
19682
- if (typeof sharedState.yy.parseError === 'function') {
19683
- this.parseError = sharedState.yy.parseError;
19684
- } else {
19685
- this.parseError = Object.getPrototypeOf(this).parseError;
19686
- }
19687
- function lex() {
19688
- var token;
19689
- token = lexer.lex() || EOF;
19690
- if (typeof token !== 'number') {
19691
- token = self.symbols_[token] || token;
19692
- }
19693
- return token;
19694
- }
19695
- var symbol, state, action, r, yyval = {}, p, len, newState, expected;
19696
- while (true) {
19697
- state = stack[stack.length - 1];
19698
- if (this.defaultActions[state]) {
19699
- action = this.defaultActions[state];
19700
- } else {
19701
- if (symbol === null || typeof symbol == 'undefined') {
19702
- symbol = lex();
19703
- }
19704
- action = table[state] && table[state][symbol];
19705
- }
19706
- if (typeof action === 'undefined' || !action.length || !action[0]) {
19707
- var errStr = '';
19708
- expected = [];
19709
- for (p in table[state]) {
19710
- if (this.terminals_[p] && p > TERROR) {
19711
- expected.push('\'' + this.terminals_[p] + '\'');
19712
- }
19713
- }
19714
- if (lexer.showPosition) {
19715
- errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
19716
- } else {
19717
- errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
19718
- }
19719
- this.parseError(errStr, {
19720
- text: lexer.match,
19721
- token: this.terminals_[symbol] || symbol,
19722
- line: lexer.yylineno,
19723
- loc: yyloc,
19724
- expected: expected
19725
- });
19726
- }
19727
- if (action[0] instanceof Array && action.length > 1) {
19728
- throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
19729
- }
19730
- switch (action[0]) {
19731
- case 1:
19732
- stack.push(symbol);
19733
- vstack.push(lexer.yytext);
19734
- lstack.push(lexer.yylloc);
19735
- stack.push(action[1]);
19736
- symbol = null;
19737
- {
19738
- yyleng = lexer.yyleng;
19739
- yytext = lexer.yytext;
19740
- yylineno = lexer.yylineno;
19741
- yyloc = lexer.yylloc;
19742
- }
19743
- break;
19744
- case 2:
19745
- len = this.productions_[action[1]][1];
19746
- yyval.$ = vstack[vstack.length - len];
19747
- yyval._$ = {
19748
- first_line: lstack[lstack.length - (len || 1)].first_line,
19749
- last_line: lstack[lstack.length - 1].last_line,
19750
- first_column: lstack[lstack.length - (len || 1)].first_column,
19751
- last_column: lstack[lstack.length - 1].last_column
19752
- };
19753
- if (ranges) {
19754
- yyval._$.range = [
19755
- lstack[lstack.length - (len || 1)].range[0],
19756
- lstack[lstack.length - 1].range[1]
19757
- ];
19758
- }
19759
- r = this.performAction.apply(yyval, [
19760
- yytext,
19761
- yyleng,
19762
- yylineno,
19763
- sharedState.yy,
19764
- action[1],
19765
- vstack,
19766
- lstack
19767
- ].concat(args));
19768
- if (typeof r !== 'undefined') {
19769
- return r;
19770
- }
19771
- if (len) {
19772
- stack = stack.slice(0, -1 * len * 2);
19773
- vstack = vstack.slice(0, -1 * len);
19774
- lstack = lstack.slice(0, -1 * len);
19775
- }
19776
- stack.push(this.productions_[action[1]][0]);
19777
- vstack.push(yyval.$);
19778
- lstack.push(yyval._$);
19779
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
19780
- stack.push(newState);
19781
- break;
19782
- case 3:
19783
- return true;
19784
- }
19785
- }
19786
- return true;
19787
- }
19788
- };
19789
- /* generated by jison-lex 0.3.4 */
19790
- var lexer = (function () {
19791
- var lexer = {
19792
- EOF: 1,
19793
- parseError: function parseError(str, hash) {
19794
- if (this.yy.parser) {
19795
- this.yy.parser.parseError(str, hash);
19796
- } else {
19797
- throw new Error(str);
19798
- }
19799
- },
19800
- // resets the lexer, sets new input
19801
- setInput: function (input, yy) {
19802
- this.yy = yy || this.yy || {};
19803
- this._input = input;
19804
- this._more = this._backtrack = this.done = false;
19805
- this.yylineno = this.yyleng = 0;
19806
- this.yytext = this.matched = this.match = '';
19807
- this.conditionStack = ['INITIAL'];
19808
- this.yylloc = {
19809
- first_line: 1,
19810
- first_column: 0,
19811
- last_line: 1,
19812
- last_column: 0
19813
- };
19814
- if (this.options.ranges) {
19815
- this.yylloc.range = [
19816
- 0,
19817
- 0
19818
- ];
19819
- }
19820
- this.offset = 0;
19821
- return this;
19822
- },
19823
- // consumes and returns one char from the input
19824
- input: function () {
19825
- var ch = this._input[0];
19826
- this.yytext += ch;
19827
- this.yyleng++;
19828
- this.offset++;
19829
- this.match += ch;
19830
- this.matched += ch;
19831
- var lines = ch.match(/(?:\r\n?|\n).*/g);
19832
- if (lines) {
19833
- this.yylineno++;
19834
- this.yylloc.last_line++;
19835
- } else {
19836
- this.yylloc.last_column++;
19837
- }
19838
- if (this.options.ranges) {
19839
- this.yylloc.range[1]++;
19840
- }
19841
- this._input = this._input.slice(1);
19842
- return ch;
19843
- },
19844
- // unshifts one char (or a string) into the input
19845
- unput: function (ch) {
19846
- var len = ch.length;
19847
- var lines = ch.split(/(?:\r\n?|\n)/g);
19848
- this._input = ch + this._input;
19849
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
19850
- //this.yyleng -= len;
19851
- this.offset -= len;
19852
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
19853
- this.match = this.match.substr(0, this.match.length - 1);
19854
- this.matched = this.matched.substr(0, this.matched.length - 1);
19855
- if (lines.length - 1) {
19856
- this.yylineno -= lines.length - 1;
19857
- }
19858
- var r = this.yylloc.range;
19859
- this.yylloc = {
19860
- first_line: this.yylloc.first_line,
19861
- last_line: this.yylineno + 1,
19862
- first_column: this.yylloc.first_column,
19863
- last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
19864
- };
19865
- if (this.options.ranges) {
19866
- this.yylloc.range = [
19867
- r[0],
19868
- r[0] + this.yyleng - len
19869
- ];
19870
- }
19871
- this.yyleng = this.yytext.length;
19872
- return this;
19873
- },
19874
- // When called from action, caches matched text and appends it on next action
19875
- more: function () {
19876
- this._more = true;
19877
- return this;
19878
- },
19879
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
19880
- reject: function () {
19881
- if (this.options.backtrack_lexer) {
19882
- this._backtrack = true;
19883
- } else {
19884
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
19885
- text: '',
19886
- token: null,
19887
- line: this.yylineno
19888
- });
19889
- }
19890
- return this;
19891
- },
19892
- // retain first n characters of the match
19893
- less: function (n) {
19894
- this.unput(this.match.slice(n));
19895
- },
19896
- // displays already matched input, i.e. for error messages
19897
- pastInput: function () {
19898
- var past = this.matched.substr(0, this.matched.length - this.match.length);
19899
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '');
19900
- },
19901
- // displays upcoming input, i.e. for error messages
19902
- upcomingInput: function () {
19903
- var next = this.match;
19904
- if (next.length < 20) {
19905
- next += this._input.substr(0, 20 - next.length);
19906
- }
19907
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '');
19908
- },
19909
- // displays the character position where the lexing error occurred, i.e. for error messages
19910
- showPosition: function () {
19911
- var pre = this.pastInput();
19912
- var c = new Array(pre.length + 1).join('-');
19913
- return pre + this.upcomingInput() + '\n' + c + '^';
19914
- },
19915
- // test the lexed token: return FALSE when not a match, otherwise return token
19916
- test_match: function (match, indexed_rule) {
19917
- var token, lines, backup;
19918
- if (this.options.backtrack_lexer) {
19919
- // save context
19920
- backup = {
19921
- yylineno: this.yylineno,
19922
- yylloc: {
19923
- first_line: this.yylloc.first_line,
19924
- last_line: this.last_line,
19925
- first_column: this.yylloc.first_column,
19926
- last_column: this.yylloc.last_column
19927
- },
19928
- yytext: this.yytext,
19929
- match: this.match,
19930
- matches: this.matches,
19931
- matched: this.matched,
19932
- yyleng: this.yyleng,
19933
- offset: this.offset,
19934
- _more: this._more,
19935
- _input: this._input,
19936
- yy: this.yy,
19937
- conditionStack: this.conditionStack.slice(0),
19938
- done: this.done
19939
- };
19940
- if (this.options.ranges) {
19941
- backup.yylloc.range = this.yylloc.range.slice(0);
19942
- }
19943
- }
19944
- lines = match[0].match(/(?:\r\n?|\n).*/g);
19945
- if (lines) {
19946
- this.yylineno += lines.length;
19947
- }
19948
- this.yylloc = {
19949
- first_line: this.yylloc.last_line,
19950
- last_line: this.yylineno + 1,
19951
- first_column: this.yylloc.last_column,
19952
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
19953
- };
19954
- this.yytext += match[0];
19955
- this.match += match[0];
19956
- this.matches = match;
19957
- this.yyleng = this.yytext.length;
19958
- if (this.options.ranges) {
19959
- this.yylloc.range = [
19960
- this.offset,
19961
- this.offset += this.yyleng
19962
- ];
19963
- }
19964
- this._more = false;
19965
- this._backtrack = false;
19966
- this._input = this._input.slice(match[0].length);
19967
- this.matched += match[0];
19968
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
19969
- if (this.done && this._input) {
19970
- this.done = false;
19971
- }
19972
- if (token) {
19973
- return token;
19974
- } else if (this._backtrack) {
19975
- // recover context
19976
- for (var k in backup) {
19977
- this[k] = backup[k];
19978
- }
19979
- return false; // rule action called reject() implying the next rule should be tested instead.
19980
- }
19981
- return false;
19982
- },
19983
- // return next match in input
19984
- next: function () {
19985
- if (this.done) {
19986
- return this.EOF;
19987
- }
19988
- if (!this._input) {
19989
- this.done = true;
19990
- }
19991
- var token, match, tempMatch, index;
19992
- if (!this._more) {
19993
- this.yytext = '';
19994
- this.match = '';
19995
- }
19996
- var rules = this._currentRules();
19997
- for (var i = 0; i < rules.length; i++) {
19998
- tempMatch = this._input.match(this.rules[rules[i]]);
19999
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
20000
- match = tempMatch;
20001
- index = i;
20002
- if (this.options.backtrack_lexer) {
20003
- token = this.test_match(tempMatch, rules[i]);
20004
- if (token !== false) {
20005
- return token;
20006
- } else if (this._backtrack) {
20007
- match = false;
20008
- continue; // rule action called reject() implying a rule MISmatch.
20009
- } else {
20010
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
20011
- return false;
20012
- }
20013
- } else if (!this.options.flex) {
20014
- break;
20015
- }
20016
- }
20017
- }
20018
- if (match) {
20019
- token = this.test_match(match, rules[index]);
20020
- if (token !== false) {
20021
- return token;
20022
- }
20023
- // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
20024
- return false;
20025
- }
20026
- if (this._input === '') {
20027
- return this.EOF;
20028
- } else {
20029
- return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
20030
- text: '',
20031
- token: null,
20032
- line: this.yylineno
20033
- });
20034
- }
20035
- },
20036
- // return next match that has a token
20037
- lex: function lex() {
20038
- var r = this.next();
20039
- if (r) {
20040
- return r;
20041
- } else {
20042
- return this.lex();
20043
- }
20044
- },
20045
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
20046
- begin: function begin(condition) {
20047
- this.conditionStack.push(condition);
20048
- },
20049
- // pop the previously active lexer condition state off the condition stack
20050
- popState: function popState() {
20051
- var n = this.conditionStack.length - 1;
20052
- if (n > 0) {
20053
- return this.conditionStack.pop();
20054
- } else {
20055
- return this.conditionStack[0];
20056
- }
20057
- },
20058
- // produce the lexer rule set which is active for the currently active lexer condition state
20059
- _currentRules: function _currentRules() {
20060
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
20061
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
20062
- } else {
20063
- return this.conditions['INITIAL'].rules;
20064
- }
20065
- },
20066
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
20067
- topState: function topState(n) {
20068
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
20069
- if (n >= 0) {
20070
- return this.conditionStack[n];
20071
- } else {
20072
- return 'INITIAL';
20073
- }
20074
- },
20075
- // alias for begin(condition)
20076
- pushState: function pushState(condition) {
20077
- this.begin(condition);
20078
- },
20079
- // return the number of states currently on the stack
20080
- stateStackSize: function stateStackSize() {
20081
- return this.conditionStack.length;
20082
- },
20083
- options: {},
20084
- performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
20085
- switch ($avoiding_name_collisions) {
20086
- case 0:
20087
- /* skip whitespace */
20088
- break;
20089
- case 1:
20090
- return 6;
20091
- case 2:
20092
- yy_.yytext = yy_.yytext.substr(1, yy_.yyleng - 2);
20093
- return 4;
20094
- case 3:
20095
- return 17;
20096
- case 4:
20097
- return 18;
20098
- case 5:
20099
- return 23;
20100
- case 6:
20101
- return 24;
20102
- case 7:
20103
- return 22;
20104
- case 8:
20105
- return 21;
20106
- case 9:
20107
- return 10;
20108
- case 10:
20109
- return 11;
20110
- case 11:
20111
- return 8;
20112
- case 12:
20113
- return 14;
20114
- case 13:
20115
- return 'INVALID';
20116
- }
20117
- },
20118
- rules: [
20119
- /^(?:\s+)/,
20120
- /^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,
20121
- /^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,
20122
- /^(?:\{)/,
20123
- /^(?:\})/,
20124
- /^(?:\[)/,
20125
- /^(?:\])/,
20126
- /^(?:,)/,
20127
- /^(?::)/,
20128
- /^(?:true\b)/,
20129
- /^(?:false\b)/,
20130
- /^(?:null\b)/,
20131
- /^(?:$)/,
20132
- /^(?:.)/
20133
- ],
20134
- conditions: {
20135
- 'INITIAL': {
20136
- 'rules': [
20137
- 0,
20138
- 1,
20139
- 2,
20140
- 3,
20141
- 4,
20142
- 5,
20143
- 6,
20144
- 7,
20145
- 8,
20146
- 9,
20147
- 10,
20148
- 11,
20149
- 12,
20150
- 13
20151
- ],
20152
- 'inclusive': true
20153
- }
20154
- }
20155
- };
20156
- return lexer;
20157
- }());
20158
- parser.lexer = lexer;
20159
- function Parser() {
20160
- this.yy = {};
20161
- }
20162
- Parser.prototype = parser;
20163
- parser.Parser = Parser;
20164
- return new Parser();
20165
- }());
20166
- if (typeof commonjsRequire !== 'undefined' && 'object' !== 'undefined') {
20167
- exports.parser = parser;
20168
- exports.Parser = parser.Parser;
20169
- exports.parse = function () {
20170
- return parser.parse.apply(parser, arguments);
20171
- };
20172
- }
20173
- } (jsonlint$1));
20174
19238
 
20175
- var jsonlint = /*@__PURE__*/getDefaultExportFromCjs(jsonlint$1);
19239
+ the parseError function receives a 'hash' object with these members for lexer and parser errors: {
19240
+ text: (matched text)
19241
+ token: (the produced terminal token, if any)
19242
+ line: (yylineno)
19243
+ }
19244
+ while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
19245
+ loc: (yylloc)
19246
+ expected: (string describing the set of expected tokens)
19247
+ recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
19248
+ }
19249
+ */
19250
+ var parser = (function () {
19251
+ var o = function (k, v, o, l) {
19252
+ for (o = o || {}, l = k.length; l--; o[k[l]] = v);
19253
+ return o;
19254
+ }, $V0 = [
19255
+ 1,
19256
+ 12
19257
+ ], $V1 = [
19258
+ 1,
19259
+ 13
19260
+ ], $V2 = [
19261
+ 1,
19262
+ 9
19263
+ ], $V3 = [
19264
+ 1,
19265
+ 10
19266
+ ], $V4 = [
19267
+ 1,
19268
+ 11
19269
+ ], $V5 = [
19270
+ 1,
19271
+ 14
19272
+ ], $V6 = [
19273
+ 1,
19274
+ 15
19275
+ ], $V7 = [
19276
+ 14,
19277
+ 18,
19278
+ 22,
19279
+ 24
19280
+ ], $V8 = [
19281
+ 18,
19282
+ 22
19283
+ ], $V9 = [
19284
+ 22,
19285
+ 24
19286
+ ];
19287
+ var parser = {
19288
+ trace: function trace() {
19289
+ },
19290
+ yy: {},
19291
+ symbols_: {
19292
+ 'error': 2,
19293
+ 'JSONString': 3,
19294
+ 'STRING': 4,
19295
+ 'JSONNumber': 5,
19296
+ 'NUMBER': 6,
19297
+ 'JSONNullLiteral': 7,
19298
+ 'NULL': 8,
19299
+ 'JSONBooleanLiteral': 9,
19300
+ 'TRUE': 10,
19301
+ 'FALSE': 11,
19302
+ 'JSONText': 12,
19303
+ 'JSONValue': 13,
19304
+ 'EOF': 14,
19305
+ 'JSONObject': 15,
19306
+ 'JSONArray': 16,
19307
+ '{': 17,
19308
+ '}': 18,
19309
+ 'JSONMemberList': 19,
19310
+ 'JSONMember': 20,
19311
+ ':': 21,
19312
+ ',': 22,
19313
+ '[': 23,
19314
+ ']': 24,
19315
+ 'JSONElementList': 25,
19316
+ '$accept': 0,
19317
+ '$end': 1
19318
+ },
19319
+ terminals_: {
19320
+ 2: 'error',
19321
+ 4: 'STRING',
19322
+ 6: 'NUMBER',
19323
+ 8: 'NULL',
19324
+ 10: 'TRUE',
19325
+ 11: 'FALSE',
19326
+ 14: 'EOF',
19327
+ 17: '{',
19328
+ 18: '}',
19329
+ 21: ':',
19330
+ 22: ',',
19331
+ 23: '[',
19332
+ 24: ']'
19333
+ },
19334
+ productions_: [
19335
+ 0,
19336
+ [
19337
+ 3,
19338
+ 1
19339
+ ],
19340
+ [
19341
+ 5,
19342
+ 1
19343
+ ],
19344
+ [
19345
+ 7,
19346
+ 1
19347
+ ],
19348
+ [
19349
+ 9,
19350
+ 1
19351
+ ],
19352
+ [
19353
+ 9,
19354
+ 1
19355
+ ],
19356
+ [
19357
+ 12,
19358
+ 2
19359
+ ],
19360
+ [
19361
+ 13,
19362
+ 1
19363
+ ],
19364
+ [
19365
+ 13,
19366
+ 1
19367
+ ],
19368
+ [
19369
+ 13,
19370
+ 1
19371
+ ],
19372
+ [
19373
+ 13,
19374
+ 1
19375
+ ],
19376
+ [
19377
+ 13,
19378
+ 1
19379
+ ],
19380
+ [
19381
+ 13,
19382
+ 1
19383
+ ],
19384
+ [
19385
+ 15,
19386
+ 2
19387
+ ],
19388
+ [
19389
+ 15,
19390
+ 3
19391
+ ],
19392
+ [
19393
+ 20,
19394
+ 3
19395
+ ],
19396
+ [
19397
+ 19,
19398
+ 1
19399
+ ],
19400
+ [
19401
+ 19,
19402
+ 3
19403
+ ],
19404
+ [
19405
+ 16,
19406
+ 2
19407
+ ],
19408
+ [
19409
+ 16,
19410
+ 3
19411
+ ],
19412
+ [
19413
+ 25,
19414
+ 1
19415
+ ],
19416
+ [
19417
+ 25,
19418
+ 3
19419
+ ]
19420
+ ],
19421
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
19422
+ /* this == yyval */
19423
+ var $0 = $$.length - 1;
19424
+ switch (yystate) {
19425
+ case 1:
19426
+ // replace escaped characters with actual character
19427
+ this.$ = new String(yytext.replace(/\\(\\|")/g, '$' + '1').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\v/g, '\x0B').replace(/\\f/g, '\f').replace(/\\b/g, '\b'));
19428
+ this.$.__line__ = this._$.first_line;
19429
+ break;
19430
+ case 2:
19431
+ this.$ = new Number(yytext);
19432
+ this.$.__line__ = this._$.first_line;
19433
+ break;
19434
+ case 3:
19435
+ this.$ = null;
19436
+ break;
19437
+ case 4:
19438
+ this.$ = new Boolean(true);
19439
+ this.$.__line__ = this._$.first_line;
19440
+ break;
19441
+ case 5:
19442
+ this.$ = new Boolean(false);
19443
+ this.$.__line__ = this._$.first_line;
19444
+ break;
19445
+ case 6:
19446
+ return this.$ = $$[$0 - 1];
19447
+ case 13:
19448
+ this.$ = {};
19449
+ Object.defineProperty(this.$, '__line__', {
19450
+ value: this._$.first_line,
19451
+ enumerable: false
19452
+ });
19453
+ break;
19454
+ case 14:
19455
+ case 19:
19456
+ this.$ = $$[$0 - 1];
19457
+ Object.defineProperty(this.$, '__line__', {
19458
+ value: this._$.first_line,
19459
+ enumerable: false
19460
+ });
19461
+ break;
19462
+ case 15:
19463
+ this.$ = [
19464
+ $$[$0 - 2],
19465
+ $$[$0]
19466
+ ];
19467
+ break;
19468
+ case 16:
19469
+ this.$ = {};
19470
+ this.$[$$[$0][0]] = $$[$0][1];
19471
+ break;
19472
+ case 17:
19473
+ this.$ = $$[$0 - 2];
19474
+ $$[$0 - 2][$$[$0][0]] = $$[$0][1];
19475
+ break;
19476
+ case 18:
19477
+ this.$ = [];
19478
+ Object.defineProperty(this.$, '__line__', {
19479
+ value: this._$.first_line,
19480
+ enumerable: false
19481
+ });
19482
+ break;
19483
+ case 20:
19484
+ this.$ = [$$[$0]];
19485
+ break;
19486
+ case 21:
19487
+ this.$ = $$[$0 - 2];
19488
+ $$[$0 - 2].push($$[$0]);
19489
+ break;
19490
+ }
19491
+ },
19492
+ table: [
19493
+ {
19494
+ 3: 5,
19495
+ 4: $V0,
19496
+ 5: 6,
19497
+ 6: $V1,
19498
+ 7: 3,
19499
+ 8: $V2,
19500
+ 9: 4,
19501
+ 10: $V3,
19502
+ 11: $V4,
19503
+ 12: 1,
19504
+ 13: 2,
19505
+ 15: 7,
19506
+ 16: 8,
19507
+ 17: $V5,
19508
+ 23: $V6
19509
+ },
19510
+ { 1: [3] },
19511
+ {
19512
+ 14: [
19513
+ 1,
19514
+ 16
19515
+ ]
19516
+ },
19517
+ o($V7, [
19518
+ 2,
19519
+ 7
19520
+ ]),
19521
+ o($V7, [
19522
+ 2,
19523
+ 8
19524
+ ]),
19525
+ o($V7, [
19526
+ 2,
19527
+ 9
19528
+ ]),
19529
+ o($V7, [
19530
+ 2,
19531
+ 10
19532
+ ]),
19533
+ o($V7, [
19534
+ 2,
19535
+ 11
19536
+ ]),
19537
+ o($V7, [
19538
+ 2,
19539
+ 12
19540
+ ]),
19541
+ o($V7, [
19542
+ 2,
19543
+ 3
19544
+ ]),
19545
+ o($V7, [
19546
+ 2,
19547
+ 4
19548
+ ]),
19549
+ o($V7, [
19550
+ 2,
19551
+ 5
19552
+ ]),
19553
+ o([
19554
+ 14,
19555
+ 18,
19556
+ 21,
19557
+ 22,
19558
+ 24
19559
+ ], [
19560
+ 2,
19561
+ 1
19562
+ ]),
19563
+ o($V7, [
19564
+ 2,
19565
+ 2
19566
+ ]),
19567
+ {
19568
+ 3: 20,
19569
+ 4: $V0,
19570
+ 18: [
19571
+ 1,
19572
+ 17
19573
+ ],
19574
+ 19: 18,
19575
+ 20: 19
19576
+ },
19577
+ {
19578
+ 3: 5,
19579
+ 4: $V0,
19580
+ 5: 6,
19581
+ 6: $V1,
19582
+ 7: 3,
19583
+ 8: $V2,
19584
+ 9: 4,
19585
+ 10: $V3,
19586
+ 11: $V4,
19587
+ 13: 23,
19588
+ 15: 7,
19589
+ 16: 8,
19590
+ 17: $V5,
19591
+ 23: $V6,
19592
+ 24: [
19593
+ 1,
19594
+ 21
19595
+ ],
19596
+ 25: 22
19597
+ },
19598
+ {
19599
+ 1: [
19600
+ 2,
19601
+ 6
19602
+ ]
19603
+ },
19604
+ o($V7, [
19605
+ 2,
19606
+ 13
19607
+ ]),
19608
+ {
19609
+ 18: [
19610
+ 1,
19611
+ 24
19612
+ ],
19613
+ 22: [
19614
+ 1,
19615
+ 25
19616
+ ]
19617
+ },
19618
+ o($V8, [
19619
+ 2,
19620
+ 16
19621
+ ]),
19622
+ {
19623
+ 21: [
19624
+ 1,
19625
+ 26
19626
+ ]
19627
+ },
19628
+ o($V7, [
19629
+ 2,
19630
+ 18
19631
+ ]),
19632
+ {
19633
+ 22: [
19634
+ 1,
19635
+ 28
19636
+ ],
19637
+ 24: [
19638
+ 1,
19639
+ 27
19640
+ ]
19641
+ },
19642
+ o($V9, [
19643
+ 2,
19644
+ 20
19645
+ ]),
19646
+ o($V7, [
19647
+ 2,
19648
+ 14
19649
+ ]),
19650
+ {
19651
+ 3: 20,
19652
+ 4: $V0,
19653
+ 20: 29
19654
+ },
19655
+ {
19656
+ 3: 5,
19657
+ 4: $V0,
19658
+ 5: 6,
19659
+ 6: $V1,
19660
+ 7: 3,
19661
+ 8: $V2,
19662
+ 9: 4,
19663
+ 10: $V3,
19664
+ 11: $V4,
19665
+ 13: 30,
19666
+ 15: 7,
19667
+ 16: 8,
19668
+ 17: $V5,
19669
+ 23: $V6
19670
+ },
19671
+ o($V7, [
19672
+ 2,
19673
+ 19
19674
+ ]),
19675
+ {
19676
+ 3: 5,
19677
+ 4: $V0,
19678
+ 5: 6,
19679
+ 6: $V1,
19680
+ 7: 3,
19681
+ 8: $V2,
19682
+ 9: 4,
19683
+ 10: $V3,
19684
+ 11: $V4,
19685
+ 13: 31,
19686
+ 15: 7,
19687
+ 16: 8,
19688
+ 17: $V5,
19689
+ 23: $V6
19690
+ },
19691
+ o($V8, [
19692
+ 2,
19693
+ 17
19694
+ ]),
19695
+ o($V8, [
19696
+ 2,
19697
+ 15
19698
+ ]),
19699
+ o($V9, [
19700
+ 2,
19701
+ 21
19702
+ ])
19703
+ ],
19704
+ defaultActions: {
19705
+ 16: [
19706
+ 2,
19707
+ 6
19708
+ ]
19709
+ },
19710
+ parseError: function parseError(str, hash) {
19711
+ if (hash.recoverable) {
19712
+ this.trace(str);
19713
+ } else {
19714
+ throw new Error(str);
19715
+ }
19716
+ },
19717
+ parse: function parse(input) {
19718
+ var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
19719
+ var args = lstack.slice.call(arguments, 1);
19720
+ var lexer = Object.create(this.lexer);
19721
+ var sharedState = { yy: {} };
19722
+ for (var k in this.yy) {
19723
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
19724
+ sharedState.yy[k] = this.yy[k];
19725
+ }
19726
+ }
19727
+ lexer.setInput(input, sharedState.yy);
19728
+ sharedState.yy.lexer = lexer;
19729
+ sharedState.yy.parser = this;
19730
+ if (typeof lexer.yylloc == 'undefined') {
19731
+ lexer.yylloc = {};
19732
+ }
19733
+ var yyloc = lexer.yylloc;
19734
+ lstack.push(yyloc);
19735
+ var ranges = lexer.options && lexer.options.ranges;
19736
+ if (typeof sharedState.yy.parseError === 'function') {
19737
+ this.parseError = sharedState.yy.parseError;
19738
+ } else {
19739
+ this.parseError = Object.getPrototypeOf(this).parseError;
19740
+ }
19741
+ function lex() {
19742
+ var token;
19743
+ token = lexer.lex() || EOF;
19744
+ if (typeof token !== 'number') {
19745
+ token = self.symbols_[token] || token;
19746
+ }
19747
+ return token;
19748
+ }
19749
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
19750
+ while (true) {
19751
+ state = stack[stack.length - 1];
19752
+ if (this.defaultActions[state]) {
19753
+ action = this.defaultActions[state];
19754
+ } else {
19755
+ if (symbol === null || typeof symbol == 'undefined') {
19756
+ symbol = lex();
19757
+ }
19758
+ action = table[state] && table[state][symbol];
19759
+ }
19760
+ if (typeof action === 'undefined' || !action.length || !action[0]) {
19761
+ var errStr = '';
19762
+ expected = [];
19763
+ for (p in table[state]) {
19764
+ if (this.terminals_[p] && p > TERROR) {
19765
+ expected.push('\'' + this.terminals_[p] + '\'');
19766
+ }
19767
+ }
19768
+ if (lexer.showPosition) {
19769
+ errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
19770
+ } else {
19771
+ errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
19772
+ }
19773
+ this.parseError(errStr, {
19774
+ text: lexer.match,
19775
+ token: this.terminals_[symbol] || symbol,
19776
+ line: lexer.yylineno,
19777
+ loc: yyloc,
19778
+ expected: expected
19779
+ });
19780
+ }
19781
+ if (action[0] instanceof Array && action.length > 1) {
19782
+ throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
19783
+ }
19784
+ switch (action[0]) {
19785
+ case 1:
19786
+ stack.push(symbol);
19787
+ vstack.push(lexer.yytext);
19788
+ lstack.push(lexer.yylloc);
19789
+ stack.push(action[1]);
19790
+ symbol = null;
19791
+ {
19792
+ yyleng = lexer.yyleng;
19793
+ yytext = lexer.yytext;
19794
+ yylineno = lexer.yylineno;
19795
+ yyloc = lexer.yylloc;
19796
+ }
19797
+ break;
19798
+ case 2:
19799
+ len = this.productions_[action[1]][1];
19800
+ yyval.$ = vstack[vstack.length - len];
19801
+ yyval._$ = {
19802
+ first_line: lstack[lstack.length - (len || 1)].first_line,
19803
+ last_line: lstack[lstack.length - 1].last_line,
19804
+ first_column: lstack[lstack.length - (len || 1)].first_column,
19805
+ last_column: lstack[lstack.length - 1].last_column
19806
+ };
19807
+ if (ranges) {
19808
+ yyval._$.range = [
19809
+ lstack[lstack.length - (len || 1)].range[0],
19810
+ lstack[lstack.length - 1].range[1]
19811
+ ];
19812
+ }
19813
+ r = this.performAction.apply(yyval, [
19814
+ yytext,
19815
+ yyleng,
19816
+ yylineno,
19817
+ sharedState.yy,
19818
+ action[1],
19819
+ vstack,
19820
+ lstack
19821
+ ].concat(args));
19822
+ if (typeof r !== 'undefined') {
19823
+ return r;
19824
+ }
19825
+ if (len) {
19826
+ stack = stack.slice(0, -1 * len * 2);
19827
+ vstack = vstack.slice(0, -1 * len);
19828
+ lstack = lstack.slice(0, -1 * len);
19829
+ }
19830
+ stack.push(this.productions_[action[1]][0]);
19831
+ vstack.push(yyval.$);
19832
+ lstack.push(yyval._$);
19833
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
19834
+ stack.push(newState);
19835
+ break;
19836
+ case 3:
19837
+ return true;
19838
+ }
19839
+ }
19840
+ return true;
19841
+ }
19842
+ };
19843
+ /* generated by jison-lex 0.3.4 */
19844
+ var lexer = (function () {
19845
+ var lexer = {
19846
+ EOF: 1,
19847
+ parseError: function parseError(str, hash) {
19848
+ if (this.yy.parser) {
19849
+ this.yy.parser.parseError(str, hash);
19850
+ } else {
19851
+ throw new Error(str);
19852
+ }
19853
+ },
19854
+ // resets the lexer, sets new input
19855
+ setInput: function (input, yy) {
19856
+ this.yy = yy || this.yy || {};
19857
+ this._input = input;
19858
+ this._more = this._backtrack = this.done = false;
19859
+ this.yylineno = this.yyleng = 0;
19860
+ this.yytext = this.matched = this.match = '';
19861
+ this.conditionStack = ['INITIAL'];
19862
+ this.yylloc = {
19863
+ first_line: 1,
19864
+ first_column: 0,
19865
+ last_line: 1,
19866
+ last_column: 0
19867
+ };
19868
+ if (this.options.ranges) {
19869
+ this.yylloc.range = [
19870
+ 0,
19871
+ 0
19872
+ ];
19873
+ }
19874
+ this.offset = 0;
19875
+ return this;
19876
+ },
19877
+ // consumes and returns one char from the input
19878
+ input: function () {
19879
+ var ch = this._input[0];
19880
+ this.yytext += ch;
19881
+ this.yyleng++;
19882
+ this.offset++;
19883
+ this.match += ch;
19884
+ this.matched += ch;
19885
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
19886
+ if (lines) {
19887
+ this.yylineno++;
19888
+ this.yylloc.last_line++;
19889
+ } else {
19890
+ this.yylloc.last_column++;
19891
+ }
19892
+ if (this.options.ranges) {
19893
+ this.yylloc.range[1]++;
19894
+ }
19895
+ this._input = this._input.slice(1);
19896
+ return ch;
19897
+ },
19898
+ // unshifts one char (or a string) into the input
19899
+ unput: function (ch) {
19900
+ var len = ch.length;
19901
+ var lines = ch.split(/(?:\r\n?|\n)/g);
19902
+ this._input = ch + this._input;
19903
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
19904
+ //this.yyleng -= len;
19905
+ this.offset -= len;
19906
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
19907
+ this.match = this.match.substr(0, this.match.length - 1);
19908
+ this.matched = this.matched.substr(0, this.matched.length - 1);
19909
+ if (lines.length - 1) {
19910
+ this.yylineno -= lines.length - 1;
19911
+ }
19912
+ var r = this.yylloc.range;
19913
+ this.yylloc = {
19914
+ first_line: this.yylloc.first_line,
19915
+ last_line: this.yylineno + 1,
19916
+ first_column: this.yylloc.first_column,
19917
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
19918
+ };
19919
+ if (this.options.ranges) {
19920
+ this.yylloc.range = [
19921
+ r[0],
19922
+ r[0] + this.yyleng - len
19923
+ ];
19924
+ }
19925
+ this.yyleng = this.yytext.length;
19926
+ return this;
19927
+ },
19928
+ // When called from action, caches matched text and appends it on next action
19929
+ more: function () {
19930
+ this._more = true;
19931
+ return this;
19932
+ },
19933
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
19934
+ reject: function () {
19935
+ if (this.options.backtrack_lexer) {
19936
+ this._backtrack = true;
19937
+ } else {
19938
+ return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
19939
+ text: '',
19940
+ token: null,
19941
+ line: this.yylineno
19942
+ });
19943
+ }
19944
+ return this;
19945
+ },
19946
+ // retain first n characters of the match
19947
+ less: function (n) {
19948
+ this.unput(this.match.slice(n));
19949
+ },
19950
+ // displays already matched input, i.e. for error messages
19951
+ pastInput: function () {
19952
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
19953
+ return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '');
19954
+ },
19955
+ // displays upcoming input, i.e. for error messages
19956
+ upcomingInput: function () {
19957
+ var next = this.match;
19958
+ if (next.length < 20) {
19959
+ next += this._input.substr(0, 20 - next.length);
19960
+ }
19961
+ return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '');
19962
+ },
19963
+ // displays the character position where the lexing error occurred, i.e. for error messages
19964
+ showPosition: function () {
19965
+ var pre = this.pastInput();
19966
+ var c = new Array(pre.length + 1).join('-');
19967
+ return pre + this.upcomingInput() + '\n' + c + '^';
19968
+ },
19969
+ // test the lexed token: return FALSE when not a match, otherwise return token
19970
+ test_match: function (match, indexed_rule) {
19971
+ var token, lines, backup;
19972
+ if (this.options.backtrack_lexer) {
19973
+ // save context
19974
+ backup = {
19975
+ yylineno: this.yylineno,
19976
+ yylloc: {
19977
+ first_line: this.yylloc.first_line,
19978
+ last_line: this.last_line,
19979
+ first_column: this.yylloc.first_column,
19980
+ last_column: this.yylloc.last_column
19981
+ },
19982
+ yytext: this.yytext,
19983
+ match: this.match,
19984
+ matches: this.matches,
19985
+ matched: this.matched,
19986
+ yyleng: this.yyleng,
19987
+ offset: this.offset,
19988
+ _more: this._more,
19989
+ _input: this._input,
19990
+ yy: this.yy,
19991
+ conditionStack: this.conditionStack.slice(0),
19992
+ done: this.done
19993
+ };
19994
+ if (this.options.ranges) {
19995
+ backup.yylloc.range = this.yylloc.range.slice(0);
19996
+ }
19997
+ }
19998
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
19999
+ if (lines) {
20000
+ this.yylineno += lines.length;
20001
+ }
20002
+ this.yylloc = {
20003
+ first_line: this.yylloc.last_line,
20004
+ last_line: this.yylineno + 1,
20005
+ first_column: this.yylloc.last_column,
20006
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
20007
+ };
20008
+ this.yytext += match[0];
20009
+ this.match += match[0];
20010
+ this.matches = match;
20011
+ this.yyleng = this.yytext.length;
20012
+ if (this.options.ranges) {
20013
+ this.yylloc.range = [
20014
+ this.offset,
20015
+ this.offset += this.yyleng
20016
+ ];
20017
+ }
20018
+ this._more = false;
20019
+ this._backtrack = false;
20020
+ this._input = this._input.slice(match[0].length);
20021
+ this.matched += match[0];
20022
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
20023
+ if (this.done && this._input) {
20024
+ this.done = false;
20025
+ }
20026
+ if (token) {
20027
+ return token;
20028
+ } else if (this._backtrack) {
20029
+ // recover context
20030
+ for (var k in backup) {
20031
+ this[k] = backup[k];
20032
+ }
20033
+ return false; // rule action called reject() implying the next rule should be tested instead.
20034
+ }
20035
+ return false;
20036
+ },
20037
+ // return next match in input
20038
+ next: function () {
20039
+ if (this.done) {
20040
+ return this.EOF;
20041
+ }
20042
+ if (!this._input) {
20043
+ this.done = true;
20044
+ }
20045
+ var token, match, tempMatch, index;
20046
+ if (!this._more) {
20047
+ this.yytext = '';
20048
+ this.match = '';
20049
+ }
20050
+ var rules = this._currentRules();
20051
+ for (var i = 0; i < rules.length; i++) {
20052
+ tempMatch = this._input.match(this.rules[rules[i]]);
20053
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
20054
+ match = tempMatch;
20055
+ index = i;
20056
+ if (this.options.backtrack_lexer) {
20057
+ token = this.test_match(tempMatch, rules[i]);
20058
+ if (token !== false) {
20059
+ return token;
20060
+ } else if (this._backtrack) {
20061
+ match = false;
20062
+ continue; // rule action called reject() implying a rule MISmatch.
20063
+ } else {
20064
+ // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
20065
+ return false;
20066
+ }
20067
+ } else if (!this.options.flex) {
20068
+ break;
20069
+ }
20070
+ }
20071
+ }
20072
+ if (match) {
20073
+ token = this.test_match(match, rules[index]);
20074
+ if (token !== false) {
20075
+ return token;
20076
+ }
20077
+ // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
20078
+ return false;
20079
+ }
20080
+ if (this._input === '') {
20081
+ return this.EOF;
20082
+ } else {
20083
+ return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
20084
+ text: '',
20085
+ token: null,
20086
+ line: this.yylineno
20087
+ });
20088
+ }
20089
+ },
20090
+ // return next match that has a token
20091
+ lex: function lex() {
20092
+ var r = this.next();
20093
+ if (r) {
20094
+ return r;
20095
+ } else {
20096
+ return this.lex();
20097
+ }
20098
+ },
20099
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
20100
+ begin: function begin(condition) {
20101
+ this.conditionStack.push(condition);
20102
+ },
20103
+ // pop the previously active lexer condition state off the condition stack
20104
+ popState: function popState() {
20105
+ var n = this.conditionStack.length - 1;
20106
+ if (n > 0) {
20107
+ return this.conditionStack.pop();
20108
+ } else {
20109
+ return this.conditionStack[0];
20110
+ }
20111
+ },
20112
+ // produce the lexer rule set which is active for the currently active lexer condition state
20113
+ _currentRules: function _currentRules() {
20114
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
20115
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
20116
+ } else {
20117
+ return this.conditions['INITIAL'].rules;
20118
+ }
20119
+ },
20120
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
20121
+ topState: function topState(n) {
20122
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
20123
+ if (n >= 0) {
20124
+ return this.conditionStack[n];
20125
+ } else {
20126
+ return 'INITIAL';
20127
+ }
20128
+ },
20129
+ // alias for begin(condition)
20130
+ pushState: function pushState(condition) {
20131
+ this.begin(condition);
20132
+ },
20133
+ // return the number of states currently on the stack
20134
+ stateStackSize: function stateStackSize() {
20135
+ return this.conditionStack.length;
20136
+ },
20137
+ options: {},
20138
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
20139
+ switch ($avoiding_name_collisions) {
20140
+ case 0:
20141
+ /* skip whitespace */
20142
+ break;
20143
+ case 1:
20144
+ return 6;
20145
+ case 2:
20146
+ yy_.yytext = yy_.yytext.substr(1, yy_.yyleng - 2);
20147
+ return 4;
20148
+ case 3:
20149
+ return 17;
20150
+ case 4:
20151
+ return 18;
20152
+ case 5:
20153
+ return 23;
20154
+ case 6:
20155
+ return 24;
20156
+ case 7:
20157
+ return 22;
20158
+ case 8:
20159
+ return 21;
20160
+ case 9:
20161
+ return 10;
20162
+ case 10:
20163
+ return 11;
20164
+ case 11:
20165
+ return 8;
20166
+ case 12:
20167
+ return 14;
20168
+ case 13:
20169
+ return 'INVALID';
20170
+ }
20171
+ },
20172
+ rules: [
20173
+ /^(?:\s+)/,
20174
+ /^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,
20175
+ /^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,
20176
+ /^(?:\{)/,
20177
+ /^(?:\})/,
20178
+ /^(?:\[)/,
20179
+ /^(?:\])/,
20180
+ /^(?:,)/,
20181
+ /^(?::)/,
20182
+ /^(?:true\b)/,
20183
+ /^(?:false\b)/,
20184
+ /^(?:null\b)/,
20185
+ /^(?:$)/,
20186
+ /^(?:.)/
20187
+ ],
20188
+ conditions: {
20189
+ 'INITIAL': {
20190
+ 'rules': [
20191
+ 0,
20192
+ 1,
20193
+ 2,
20194
+ 3,
20195
+ 4,
20196
+ 5,
20197
+ 6,
20198
+ 7,
20199
+ 8,
20200
+ 9,
20201
+ 10,
20202
+ 11,
20203
+ 12,
20204
+ 13
20205
+ ],
20206
+ 'inclusive': true
20207
+ }
20208
+ }
20209
+ };
20210
+ return lexer;
20211
+ }());
20212
+ parser.lexer = lexer;
20213
+ function Parser() {
20214
+ this.yy = {};
20215
+ }
20216
+ Parser.prototype = parser;
20217
+ parser.Parser = Parser;
20218
+ return new Parser();
20219
+ }());
20220
+ if (typeof commonjsRequire !== 'undefined' && 'object' !== 'undefined') {
20221
+ exports.parser = parser;
20222
+ exports.Parser = parser.Parser;
20223
+ exports.parse = function () {
20224
+ return parser.parse.apply(parser, arguments);
20225
+ };
20226
+ }
20227
+ } (jsonlint$1));
20228
+ return jsonlint$1;
20229
+ }
20230
+
20231
+ var jsonlintExports = requireJsonlint();
20232
+ var jsonlint = /*@__PURE__*/getDefaultExportFromCjs(jsonlintExports);
20176
20233
 
20177
20234
  function readStyle(style) {
20178
20235
  if (style instanceof String || typeof style === 'string' || ArrayBuffer.isView(style)) {