@grepp/detect-gpu 5.0.81 → 5.0.83

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.
@@ -2855,6 +2855,19 @@
2855
2855
  ]
2856
2856
  ]
2857
2857
  ],
2858
+ [
2859
+ "amd radeon 740m",
2860
+ "740",
2861
+ "740m amd radeon",
2862
+ 0,
2863
+ [
2864
+ [
2865
+ 3840,
2866
+ 2160,
2867
+ 34
2868
+ ]
2869
+ ]
2870
+ ],
2858
2871
  [
2859
2872
  "amd radeon 7500m/7600m",
2860
2873
  "7500",
@@ -2945,6 +2958,11 @@
2945
2958
  1920,
2946
2959
  1200,
2947
2960
  253
2961
+ ],
2962
+ [
2963
+ 2880,
2964
+ 1920,
2965
+ 111
2948
2966
  ]
2949
2967
  ]
2950
2968
  ],
@@ -7225,9 +7243,9 @@
7225
7243
  60
7226
7244
  ],
7227
7245
  [
7228
- 3360,
7229
- 2100,
7230
- 55
7246
+ 2560,
7247
+ 1440,
7248
+ 51
7231
7249
  ],
7232
7250
  [
7233
7251
  5120,
@@ -7446,7 +7464,7 @@
7446
7464
  [
7447
7465
  3584,
7448
7466
  2240,
7449
- 51
7467
+ 60
7450
7468
  ]
7451
7469
  ]
7452
7470
  ],
@@ -7718,6 +7736,11 @@
7718
7736
  5120,
7719
7737
  2880,
7720
7738
  55
7739
+ ],
7740
+ [
7741
+ 5760,
7742
+ 3240,
7743
+ 52
7721
7744
  ]
7722
7745
  ]
7723
7746
  ],
@@ -10764,6 +10787,19 @@
10764
10787
  ]
10765
10788
  ]
10766
10789
  ],
10790
+ [
10791
+ "amd radeon rx",
10792
+ "rx",
10793
+ "amd radeon rx",
10794
+ 0,
10795
+ [
10796
+ [
10797
+ 1920,
10798
+ 1080,
10799
+ 116
10800
+ ]
10801
+ ]
10802
+ ],
10767
10803
  [
10768
10804
  "amd radeon rx 460",
10769
10805
  "460",
@@ -11525,7 +11561,7 @@
11525
11561
  [
11526
11562
  1920,
11527
11563
  1080,
11528
- 170
11564
+ 165
11529
11565
  ]
11530
11566
  ]
11531
11567
  ],
@@ -11605,7 +11641,7 @@
11605
11641
  [
11606
11642
  1920,
11607
11643
  1080,
11608
- 60
11644
+ 144
11609
11645
  ],
11610
11646
  [
11611
11647
  5120,
@@ -11742,6 +11778,11 @@
11742
11778
  "6800 amd radeon rx",
11743
11779
  0,
11744
11780
  [
11781
+ [
11782
+ 1920,
11783
+ 1080,
11784
+ 180
11785
+ ],
11745
11786
  [
11746
11787
  2560,
11747
11788
  1440,
@@ -11961,6 +12002,11 @@
11961
12002
  "7600m amd radeon rx xt",
11962
12003
  0,
11963
12004
  [
12005
+ [
12006
+ 1920,
12007
+ 1080,
12008
+ 731
12009
+ ],
11964
12010
  [
11965
12011
  2560,
11966
12012
  1600,
@@ -11970,11 +12016,6 @@
11970
12016
  3440,
11971
12017
  1440,
11972
12018
  60
11973
- ],
11974
- [
11975
- 3840,
11976
- 2160,
11977
- 71
11978
12019
  ]
11979
12020
  ]
11980
12021
  ],
@@ -5496,7 +5496,7 @@
5496
5496
  [
5497
5497
  1920,
5498
5498
  1080,
5499
- 632
5499
+ 804
5500
5500
  ],
5501
5501
  [
5502
5502
  2560,
@@ -5631,11 +5631,6 @@
5631
5631
  [
5632
5632
  1920,
5633
5633
  1080,
5634
- 144
5635
- ],
5636
- [
5637
- 2880,
5638
- 1620,
5639
5634
  120
5640
5635
  ]
5641
5636
  ]
@@ -5947,7 +5942,7 @@
5947
5942
  [
5948
5943
  1920,
5949
5944
  1080,
5950
- 144
5945
+ 970
5951
5946
  ]
5952
5947
  ]
5953
5948
  ],
@@ -5987,11 +5982,6 @@
5987
5982
  1920,
5988
5983
  1080,
5989
5984
  164
5990
- ],
5991
- [
5992
- 2560,
5993
- 1440,
5994
- 568
5995
5985
  ]
5996
5986
  ]
5997
5987
  ],
@@ -6117,11 +6107,6 @@
6117
6107
  "5060 geforce nvidia rtx",
6118
6108
  0,
6119
6109
  [
6120
- [
6121
- 1360,
6122
- 768,
6123
- 60
6124
- ],
6125
6110
  [
6126
6111
  2560,
6127
6112
  1440,
@@ -6187,7 +6172,7 @@
6187
6172
  [
6188
6173
  2560,
6189
6174
  1600,
6190
- 239
6175
+ 165
6191
6176
  ]
6192
6177
  ]
6193
6178
  ],
@@ -6276,6 +6261,19 @@
6276
6261
  ]
6277
6262
  ]
6278
6263
  ],
6264
+ [
6265
+ "nvidia geforce rtx 5090 laptop gpu",
6266
+ "5090",
6267
+ "5090 geforce gpu laptop nvidia rtx",
6268
+ 0,
6269
+ [
6270
+ [
6271
+ 2560,
6272
+ 1600,
6273
+ 144
6274
+ ]
6275
+ ]
6276
+ ],
6279
6277
  [
6280
6278
  "nvidia geforce rtx t10-16",
6281
6279
  "10",
@@ -136,9 +136,9 @@
136
136
  0,
137
137
  [
138
138
  [
139
- 1920,
140
- 1080,
141
- 148
139
+ 3840,
140
+ 2160,
141
+ 90
142
142
  ]
143
143
  ]
144
144
  ],
@@ -443,7 +443,7 @@
443
443
  [
444
444
  3840,
445
445
  2160,
446
- 231
446
+ 256
447
447
  ]
448
448
  ]
449
449
  ],
@@ -1186,7 +1186,7 @@
1186
1186
  [
1187
1187
  1920,
1188
1188
  1080,
1189
- 14
1189
+ 17
1190
1190
  ]
1191
1191
  ]
1192
1192
  ],
@@ -1402,7 +1402,7 @@
1402
1402
  [
1403
1403
  1366,
1404
1404
  768,
1405
- 33
1405
+ 25
1406
1406
  ],
1407
1407
  [
1408
1408
  1440,
@@ -2720,6 +2720,11 @@
2720
2720
  1920,
2721
2721
  1080,
2722
2722
  149
2723
+ ],
2724
+ [
2725
+ 1920,
2726
+ 1200,
2727
+ 59
2723
2728
  ]
2724
2729
  ]
2725
2730
  ],
@@ -3248,7 +3253,7 @@
3248
3253
  [
3249
3254
  1366,
3250
3255
  768,
3251
- 27
3256
+ 23
3252
3257
  ],
3253
3258
  [
3254
3259
  1920,
@@ -3436,6 +3441,11 @@
3436
3441
  1440,
3437
3442
  26
3438
3443
  ],
3444
+ [
3445
+ 2688,
3446
+ 1680,
3447
+ 34
3448
+ ],
3439
3449
  [
3440
3450
  3440,
3441
3451
  1440,
@@ -3444,7 +3454,7 @@
3444
3454
  [
3445
3455
  3584,
3446
3456
  2240,
3447
- 15
3457
+ 137
3448
3458
  ],
3449
3459
  [
3450
3460
  3840,
@@ -3560,7 +3570,7 @@
3560
3570
  [
3561
3571
  3840,
3562
3572
  2160,
3563
- 18
3573
+ 21
3564
3574
  ]
3565
3575
  ]
3566
3576
  ],
@@ -5735,7 +5735,7 @@
5735
5735
  [
5736
5736
  1920,
5737
5737
  1080,
5738
- 632
5738
+ 804
5739
5739
  ],
5740
5740
  [
5741
5741
  2560,
@@ -5870,11 +5870,6 @@
5870
5870
  [
5871
5871
  1920,
5872
5872
  1080,
5873
- 144
5874
- ],
5875
- [
5876
- 2880,
5877
- 1620,
5878
5873
  120
5879
5874
  ]
5880
5875
  ]
@@ -6186,7 +6181,7 @@
6186
6181
  [
6187
6182
  1920,
6188
6183
  1080,
6189
- 144
6184
+ 970
6190
6185
  ]
6191
6186
  ]
6192
6187
  ],
@@ -6226,11 +6221,6 @@
6226
6221
  1920,
6227
6222
  1080,
6228
6223
  164
6229
- ],
6230
- [
6231
- 2560,
6232
- 1440,
6233
- 568
6234
6224
  ]
6235
6225
  ]
6236
6226
  ],
@@ -6356,11 +6346,6 @@
6356
6346
  "5060 geforce nvidia rtx",
6357
6347
  0,
6358
6348
  [
6359
- [
6360
- 1360,
6361
- 768,
6362
- 60
6363
- ],
6364
6349
  [
6365
6350
  2560,
6366
6351
  1440,
@@ -6426,7 +6411,7 @@
6426
6411
  [
6427
6412
  2560,
6428
6413
  1600,
6429
- 239
6414
+ 165
6430
6415
  ]
6431
6416
  ]
6432
6417
  ],
@@ -6515,6 +6500,19 @@
6515
6500
  ]
6516
6501
  ]
6517
6502
  ],
6503
+ [
6504
+ "nvidia geforce rtx 5090 laptop gpu",
6505
+ "5090",
6506
+ "5090 geforce gpu laptop nvidia rtx",
6507
+ 0,
6508
+ [
6509
+ [
6510
+ 2560,
6511
+ 1600,
6512
+ 144
6513
+ ]
6514
+ ]
6515
+ ],
6518
6516
  [
6519
6517
  "nvidia geforce rtx t10-16",
6520
6518
  "10",
@@ -9117,7 +9115,12 @@
9117
9115
  [
9118
9116
  1920,
9119
9117
  1080,
9120
- 66
9118
+ 58
9119
+ ],
9120
+ [
9121
+ 2560,
9122
+ 1440,
9123
+ 43
9121
9124
  ]
9122
9125
  ]
9123
9126
  ],
@@ -893,6 +893,19 @@
893
893
  ]
894
894
  ]
895
895
  ],
896
+ [
897
+ "amd radeon 740m",
898
+ "740",
899
+ "740m amd radeon",
900
+ 0,
901
+ [
902
+ [
903
+ 3840,
904
+ 2160,
905
+ 34
906
+ ]
907
+ ]
908
+ ],
896
909
  [
897
910
  "amd radeon 7500m/7600m",
898
911
  "7500",
@@ -983,6 +996,11 @@
983
996
  1920,
984
997
  1200,
985
998
  253
999
+ ],
1000
+ [
1001
+ 2880,
1002
+ 1920,
1003
+ 111
986
1004
  ]
987
1005
  ]
988
1006
  ],
@@ -5263,9 +5281,9 @@
5263
5281
  60
5264
5282
  ],
5265
5283
  [
5266
- 3360,
5267
- 2100,
5268
- 55
5284
+ 2560,
5285
+ 1440,
5286
+ 51
5269
5287
  ],
5270
5288
  [
5271
5289
  5120,
@@ -5484,7 +5502,7 @@
5484
5502
  [
5485
5503
  3584,
5486
5504
  2240,
5487
- 51
5505
+ 60
5488
5506
  ]
5489
5507
  ]
5490
5508
  ],
@@ -5756,6 +5774,11 @@
5756
5774
  5120,
5757
5775
  2880,
5758
5776
  55
5777
+ ],
5778
+ [
5779
+ 5760,
5780
+ 3240,
5781
+ 52
5759
5782
  ]
5760
5783
  ]
5761
5784
  ],
@@ -8802,6 +8825,19 @@
8802
8825
  ]
8803
8826
  ]
8804
8827
  ],
8828
+ [
8829
+ "amd radeon rx",
8830
+ "rx",
8831
+ "amd radeon rx",
8832
+ 0,
8833
+ [
8834
+ [
8835
+ 1920,
8836
+ 1080,
8837
+ 116
8838
+ ]
8839
+ ]
8840
+ ],
8805
8841
  [
8806
8842
  "amd radeon rx 460",
8807
8843
  "460",
@@ -9563,7 +9599,7 @@
9563
9599
  [
9564
9600
  1920,
9565
9601
  1080,
9566
- 170
9602
+ 165
9567
9603
  ]
9568
9604
  ]
9569
9605
  ],
@@ -9643,7 +9679,7 @@
9643
9679
  [
9644
9680
  1920,
9645
9681
  1080,
9646
- 60
9682
+ 144
9647
9683
  ],
9648
9684
  [
9649
9685
  5120,
@@ -9780,6 +9816,11 @@
9780
9816
  "6800 amd radeon rx",
9781
9817
  0,
9782
9818
  [
9819
+ [
9820
+ 1920,
9821
+ 1080,
9822
+ 180
9823
+ ],
9783
9824
  [
9784
9825
  2560,
9785
9826
  1440,
@@ -9999,6 +10040,11 @@
9999
10040
  "7600m amd radeon rx xt",
10000
10041
  0,
10001
10042
  [
10043
+ [
10044
+ 1920,
10045
+ 1080,
10046
+ 731
10047
+ ],
10002
10048
  [
10003
10049
  2560,
10004
10050
  1600,
@@ -10008,11 +10054,6 @@
10008
10054
  3440,
10009
10055
  1440,
10010
10056
  60
10011
- ],
10012
- [
10013
- 3840,
10014
- 2160,
10015
- 71
10016
10057
  ]
10017
10058
  ]
10018
10059
  ],
@@ -2437,7 +2437,7 @@
2437
2437
  [
2438
2438
  3088,
2439
2439
  1440,
2440
- 94,
2440
+ 110,
2441
2441
  "samsung galaxy s23 ultra"
2442
2442
  ]
2443
2443
  ]
@@ -2492,6 +2492,12 @@
2492
2492
  "830 adreno qualcomm",
2493
2493
  0,
2494
2494
  [
2495
+ [
2496
+ 2122,
2497
+ 1080,
2498
+ 120,
2499
+ "samsung galaxy s25+"
2500
+ ],
2495
2501
  [
2496
2502
  2256,
2497
2503
  1032,
@@ -2505,15 +2511,9 @@
2505
2511
  "samsung galaxy s25 ultra"
2506
2512
  ],
2507
2513
  [
2508
- 2340,
2509
- 1080,
2510
- 120,
2511
- "samsung galaxy s25+"
2512
- ],
2513
- [
2514
- 3054,
2515
- 1380,
2516
- 99,
2514
+ 3200,
2515
+ 1440,
2516
+ 60,
2517
2517
  "xiaomi 15 pro"
2518
2518
  ]
2519
2519
  ]
@@ -101,7 +101,7 @@
101
101
  [
102
102
  2388,
103
103
  1668,
104
- 40,
104
+ 113,
105
105
  "apple ipad pro (11-inch) (2rd generation)"
106
106
  ],
107
107
  [
@@ -136,7 +136,7 @@
136
136
  2360,
137
137
  1640,
138
138
  60,
139
- "apple ipad (10th generation)"
139
+ "apple ipad air (4th generation)"
140
140
  ],
141
141
  [
142
142
  2388,
@@ -190,7 +190,7 @@
190
190
  2266,
191
191
  1488,
192
192
  60,
193
- "apple ipad mini 7th gen cellular (a17)"
193
+ "apple ipad mini (a17)"
194
194
  ]
195
195
  ]
196
196
  ],
@@ -314,12 +314,6 @@
314
314
  120,
315
315
  "apple ipad pro 11 inch (4th gen)"
316
316
  ],
317
- [
318
- 2730,
319
- 2048,
320
- 120,
321
- "apple ipad pro 12.9-inch (6th generation)"
322
- ],
323
317
  [
324
318
  2732,
325
319
  2048,
@@ -363,8 +357,8 @@
363
357
  [
364
358
  2420,
365
359
  1668,
366
- 120,
367
- "apple ipad pro 11-inch (m4)"
360
+ 61,
361
+ "apple ipad pro 11 inch 5th gen"
368
362
  ],
369
363
  [
370
364
  2752,
@@ -67,11 +67,17 @@
67
67
  [
68
68
  2436,
69
69
  1125,
70
+ 49,
71
+ "apple iphone xs"
72
+ ],
73
+ [
74
+ 2208,
75
+ 1242,
70
76
  60,
71
77
  "apple iphone xs max"
72
78
  ],
73
79
  [
74
- 2208,
80
+ 2688,
75
81
  1242,
76
82
  60,
77
83
  "apple iphone xs max"
@@ -151,7 +157,7 @@
151
157
  [
152
158
  1334,
153
159
  750,
154
- 118,
160
+ 60,
155
161
  "apple iphone se (2022)"
156
162
  ],
157
163
  [
@@ -209,7 +215,7 @@
209
215
  [
210
216
  2778,
211
217
  1284,
212
- 60,
218
+ 122,
213
219
  "apple iphone 15 pro max"
214
220
  ]
215
221
  ]
@@ -223,7 +229,7 @@
223
229
  [
224
230
  2532,
225
231
  1170,
226
- 60,
232
+ 41,
227
233
  "apple iphone 16 (iphone17,5)"
228
234
  ],
229
235
  [
@@ -254,6 +260,46 @@
254
260
  ]
255
261
  ]
256
262
  ],
263
+ [
264
+ "apple a19 gpu",
265
+ "19",
266
+ "a19 apple gpu",
267
+ 0,
268
+ [
269
+ [
270
+ 2532,
271
+ 1170,
272
+ 60,
273
+ "apple iphone 17"
274
+ ]
275
+ ]
276
+ ],
277
+ [
278
+ "apple a19 pro gpu",
279
+ "19",
280
+ "a19 apple gpu pro",
281
+ 0,
282
+ [
283
+ [
284
+ 2532,
285
+ 1170,
286
+ 60,
287
+ "apple iphone 17 pro"
288
+ ],
289
+ [
290
+ 2688,
291
+ 1242,
292
+ 60,
293
+ "apple iphone air"
294
+ ],
295
+ [
296
+ 2778,
297
+ 1284,
298
+ 60,
299
+ "apple iphone 17 pro max"
300
+ ]
301
+ ]
302
+ ],
257
303
  [
258
304
  "apple a7 gpu",
259
305
  "7",
@@ -150,6 +150,12 @@
150
150
  36,
151
151
  "samsung galaxy a15"
152
152
  ],
153
+ [
154
+ 2174,
155
+ 1080,
156
+ 39,
157
+ "poco m4 pro 5g (21091116ag)"
158
+ ],
153
159
  [
154
160
  2177,
155
161
  1080,
@@ -161,12 +167,6 @@
161
167
  1080,
162
168
  35,
163
169
  "samsung galaxy a22 5g"
164
- ],
165
- [
166
- 2304,
167
- 1080,
168
- 34,
169
- "poco m4 pro 5g (21091116ag)"
170
170
  ]
171
171
  ]
172
172
  ],
@@ -1,2 +1,2 @@
1
- function e(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{d(n.next(e))}catch(e){a(e)}}function c(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,c)}d((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const t=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function r(e){return e=e.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const n=34962,o="undefined"==typeof window,a=(()=>{if(o)return;const{userAgent:e,platform:t,maxTouchPoints:r}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),a="iPad"===t||"MacIntel"===t&&r>0&&!window.MSStream;return{isIpad:a,isMobile:/android/i.test(e)||n||a,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e)}})();function i(e,t,r){if(!r)return[t];const o=function(e){const t="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",r="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",o=e.createShader(35633),a=e.createShader(35632),i=e.createProgram();if(!(a&&o&&i))return;e.shaderSource(o,t),e.shaderSource(a,r),e.compileShader(o),e.compileShader(a),e.attachShader(i,o),e.attachShader(i,a),e.linkProgram(i),e.detachShader(i,o),e.detachShader(i,a),e.deleteShader(o),e.deleteShader(a),e.useProgram(i);const c=e.createBuffer();e.bindBuffer(n,c),e.bufferData(n,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const d=e.getAttribLocation(i,"aPosition");e.vertexAttribPointer(d,3,5126,!1,0,0),e.enableVertexAttribArray(d),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const l=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,l),e.deleteProgram(i),e.deleteBuffer(c),l.join("")}(e),i="801621810",c="8016218135",d="80162181161",l=(null==a?void 0:a.isIpad)?[["a7",d,12],["a8",c,15],["a8x",c,15],["a9",c,15],["a9x",c,15],["a10",c,15],["a10x",c,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["a15",i,15],["m1",i,15],["m2",i,15]]:[["a7",d,12],["a8",c,12],["a9",c,15],["a10",c,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15],["a15",i,15],["a16",i,15],["a17",i,15]];let s;"80162181255"===o?s=l.filter(([,,e])=>e>=14):(s=l.filter(([,e])=>e===o),s.length||(s=l));return s.map(([e])=>`apple ${e} gpu`)}class c extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const d=[],l=[];function s(e,t){if(e===t)return 0;const r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let a,i=0;for(;i<n&&e.charCodeAt(i)===t.charCodeAt(i);)i++;if(n-=i,o-=i,0===n)return o;let c,s,f=0,u=0,g=0;for(;u<n;)l[u]=e.charCodeAt(i+u),d[u]=++u;for(;g<o;)for(a=t.charCodeAt(i+g),c=g++,f=g,u=0;u<n;u++)s=a===l[u]?c:c+1,c=d[u],f=d[u]=c>f?s>f?f+1:s:s>c?c+1:s;return f}function f(e){return null!=e}const u=(...n)=>e(void 0,[...n],void 0,function*({mobileTiers:n=[0,15,30,60],desktopTiers:d=[0,15,30,60],override:l={},glContext:u,failIfMajorPerformanceCaveat:g=!1,benchmarksURL:h="https://unpkg.com/@grepp/detect-gpu@5.0.81/dist/benchmarks"}={}){const p={};if(o)return{tier:0,type:"SSR"};const{isIpad:m=!!(null==a?void 0:a.isIpad),isMobile:v=!!(null==a?void 0:a.isMobile),screenSize:w=window.screen,loadBenchmarks:x=t=>e(void 0,void 0,void 0,function*(){const e=yield fetch(`${h}/${t}`).then(e=>e.json());if(parseInt(e.shift().split(".")[0],10)<4)throw new c("Detect GPU benchmark data is out of date. Please update to version 4x");return e})}=l;let{renderer:A}=l;const P=(e,t,r,n,o)=>({device:o,fps:n,gpu:r,isMobile:v,tier:e,type:t});let S,b="";if(A)A=r(A),S=[A];else{const e=u||function(e,t=!1){const r={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:t,powerPreference:"high-performance",stencil:!1};e&&delete r.powerPreference;const n=window.document.createElement("canvas"),o=n.getContext("webgl",r)||n.getContext("experimental-webgl",r);return null!=o?o:void 0}(null==a?void 0:a.isSafari12,g);if(!e)return P(0,"WEBGL_UNSUPPORTED");const t=(null==a?void 0:a.isFirefox)?null:e.getExtension("WEBGL_debug_renderer_info");if(A=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),!A)return P(1,"FALLBACK");b=A,A=r(A),S=function(e,t,r){return"apple gpu"===t?i(e,t,r):[t]}(e,A,v)}const E=(yield Promise.all(S.map(function(t){return e(this,void 0,void 0,function*(){var e;const r=(e=>{const t=v?["adreno","apple","mali-t","mali","nvidia","powervr","samsung"]:["intel","apple","amd","radeon","nvidia","geforce","adreno"];for(const r of t)if(e.includes(r))return r})(t);if(!r)return;const n=`${v?"m":"d"}-${r}${m?"-ipad":""}.json`,o=p[n]=null!==(e=p[n])&&void 0!==e?e:x(n);let a;try{a=yield o}catch(e){if(e instanceof c)throw e;return}const i=function(e){var t;const r=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(t=null==r?void 0:r.join("").replace(/\W|amd/g,""))&&void 0!==t?t:""}(t);let d=a.filter(([,e])=>e===i);d.length||(d=a.filter(([e])=>e.includes(t)));const l=d.length;if(0===l)return;const f=t.split(/[.,()\[\]/\s]/g).sort().filter((e,t,r)=>0===t||e!==r[t-1]).join(" ");let u,[g,,,,h]=l>1?d.map(e=>[e,s(f,e[2])]).sort(([,e],[,t])=>e-t)[0][0]:d[0],A=Number.MAX_VALUE;const{devicePixelRatio:P}=window,S=w.width*P*w.height*P;for(const e of h){const[t,r]=e,n=t*r,o=Math.abs(S-n);o<A&&(A=o,u=e)}if(!u)return;const[,,b,E]=u;return[A,b,g,E]})}))).filter(f).sort(([e=Number.MAX_VALUE,t],[r=Number.MAX_VALUE,n])=>e===r?t-n:e-r);if(!E.length){const e=t.find(e=>A.includes(e));return e?P(0,"BLOCKLISTED",e):P(1,"FALLBACK",`${A} (${b})`)}const[,y,C,L]=E[0];if(-1===y)return P(0,"BLOCKLISTED",C,y,L);const M=v?n:d;let $=0;for(let e=0;e<M.length;e++)y>=M[e]&&($=e);return P($,"BENCHMARK",C,y,L)});export{u as getGPUTier};
1
+ function e(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{d(n.next(e))}catch(e){a(e)}}function c(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,c)}d((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const t=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function r(e){return e=e.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const n=34962,o="undefined"==typeof window,a=(()=>{if(o)return;const{userAgent:e,platform:t,maxTouchPoints:r}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),a="iPad"===t||"MacIntel"===t&&r>0&&!window.MSStream;return{isIpad:a,isMobile:/android/i.test(e)||n||a,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e)}})();function i(e,t,r){if(!r)return[t];const o=function(e){const t="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",r="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",o=e.createShader(35633),a=e.createShader(35632),i=e.createProgram();if(!(a&&o&&i))return;e.shaderSource(o,t),e.shaderSource(a,r),e.compileShader(o),e.compileShader(a),e.attachShader(i,o),e.attachShader(i,a),e.linkProgram(i),e.detachShader(i,o),e.detachShader(i,a),e.deleteShader(o),e.deleteShader(a),e.useProgram(i);const c=e.createBuffer();e.bindBuffer(n,c),e.bufferData(n,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const d=e.getAttribLocation(i,"aPosition");e.vertexAttribPointer(d,3,5126,!1,0,0),e.enableVertexAttribArray(d),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const l=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,l),e.deleteProgram(i),e.deleteBuffer(c),l.join("")}(e),i="801621810",c="8016218135",d="80162181161",l=(null==a?void 0:a.isIpad)?[["a7",d,12],["a8",c,15],["a8x",c,15],["a9",c,15],["a9x",c,15],["a10",c,15],["a10x",c,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["a15",i,15],["m1",i,15],["m2",i,15]]:[["a7",d,12],["a8",c,12],["a9",c,15],["a10",c,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15],["a15",i,15],["a16",i,15],["a17",i,15]];let s;"80162181255"===o?s=l.filter(([,,e])=>e>=14):(s=l.filter(([,e])=>e===o),s.length||(s=l));return s.map(([e])=>`apple ${e} gpu`)}class c extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const d=[],l=[];function s(e,t){if(e===t)return 0;const r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let a,i=0;for(;i<n&&e.charCodeAt(i)===t.charCodeAt(i);)i++;if(n-=i,o-=i,0===n)return o;let c,s,f=0,u=0,g=0;for(;u<n;)l[u]=e.charCodeAt(i+u),d[u]=++u;for(;g<o;)for(a=t.charCodeAt(i+g),c=g++,f=g,u=0;u<n;u++)s=a===l[u]?c:c+1,c=d[u],f=d[u]=c>f?s>f?f+1:s:s>c?c+1:s;return f}function f(e){return null!=e}const u=(...n)=>e(void 0,[...n],void 0,function*({mobileTiers:n=[0,15,30,60],desktopTiers:d=[0,15,30,60],override:l={},glContext:u,failIfMajorPerformanceCaveat:g=!1,benchmarksURL:h="https://unpkg.com/@grepp/detect-gpu@5.0.83/dist/benchmarks"}={}){const p={};if(o)return{tier:0,type:"SSR"};const{isIpad:m=!!(null==a?void 0:a.isIpad),isMobile:v=!!(null==a?void 0:a.isMobile),screenSize:w=window.screen,loadBenchmarks:x=t=>e(void 0,void 0,void 0,function*(){const e=yield fetch(`${h}/${t}`).then(e=>e.json());if(parseInt(e.shift().split(".")[0],10)<4)throw new c("Detect GPU benchmark data is out of date. Please update to version 4x");return e})}=l;let{renderer:A}=l;const P=(e,t,r,n,o)=>({device:o,fps:n,gpu:r,isMobile:v,tier:e,type:t});let S,b="";if(A)A=r(A),S=[A];else{const e=u||function(e,t=!1){const r={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:t,powerPreference:"high-performance",stencil:!1};e&&delete r.powerPreference;const n=window.document.createElement("canvas"),o=n.getContext("webgl",r)||n.getContext("experimental-webgl",r);return null!=o?o:void 0}(null==a?void 0:a.isSafari12,g);if(!e)return P(0,"WEBGL_UNSUPPORTED");const t=(null==a?void 0:a.isFirefox)?null:e.getExtension("WEBGL_debug_renderer_info");if(A=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),!A)return P(1,"FALLBACK");b=A,A=r(A),S=function(e,t,r){return"apple gpu"===t?i(e,t,r):[t]}(e,A,v)}const E=(yield Promise.all(S.map(function(t){return e(this,void 0,void 0,function*(){var e;const r=(e=>{const t=v?["adreno","apple","mali-t","mali","nvidia","powervr","samsung"]:["intel","apple","amd","radeon","nvidia","geforce","adreno"];for(const r of t)if(e.includes(r))return r})(t);if(!r)return;const n=`${v?"m":"d"}-${r}${m?"-ipad":""}.json`,o=p[n]=null!==(e=p[n])&&void 0!==e?e:x(n);let a;try{a=yield o}catch(e){if(e instanceof c)throw e;return}const i=function(e){var t;const r=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(t=null==r?void 0:r.join("").replace(/\W|amd/g,""))&&void 0!==t?t:""}(t);let d=a.filter(([,e])=>e===i);d.length||(d=a.filter(([e])=>e.includes(t)));const l=d.length;if(0===l)return;const f=t.split(/[.,()\[\]/\s]/g).sort().filter((e,t,r)=>0===t||e!==r[t-1]).join(" ");let u,[g,,,,h]=l>1?d.map(e=>[e,s(f,e[2])]).sort(([,e],[,t])=>e-t)[0][0]:d[0],A=Number.MAX_VALUE;const{devicePixelRatio:P}=window,S=w.width*P*w.height*P;for(const e of h){const[t,r]=e,n=t*r,o=Math.abs(S-n);o<A&&(A=o,u=e)}if(!u)return;const[,,b,E]=u;return[A,b,g,E]})}))).filter(f).sort(([e=Number.MAX_VALUE,t],[r=Number.MAX_VALUE,n])=>e===r?t-n:e-r);if(!E.length){const e=t.find(e=>A.includes(e));return e?P(0,"BLOCKLISTED",e):P(1,"FALLBACK",`${A} (${b})`)}const[,y,C,L]=E[0];if(-1===y)return P(0,"BLOCKLISTED",C,y,L);const M=v?n:d;let $=0;for(let e=0;e<M.length;e++)y>=M[e]&&($=e);return P($,"BENCHMARK",C,y,L)});export{u as getGPUTier};
2
2
  //# sourceMappingURL=detect-gpu.esm.js.map
@@ -1,2 +1,2 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).DetectGPU={})}(this,function(e){"use strict";var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},r(e,t)};function t(e,r,t,n){return new(t||(t=Promise))(function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function c(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(i,c)}u((n=n.apply(e,r||[])).next())})}function n(e,r){var t,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=c(0),i.throw=c(1),i.return=c(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(t=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=r.call(e,a)}catch(e){c=[6,e],n=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}"function"==typeof SuppressedError&&SuppressedError;var o=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function a(e){return e=e.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const i=34962;var c="undefined"==typeof window,u=function(){if(!c){var e=window.navigator,r=e.userAgent,t=e.platform,n=e.maxTouchPoints,o=/(iphone|ipod|ipad)/i.test(r),a="iPad"===t||"MacIntel"===t&&n>0&&!window.MSStream;return{isIpad:a,isMobile:/android/i.test(r)||o||a,isSafari12:/Version\/12.+Safari/.test(r),isFirefox:/Firefox/.test(r)}}}();function l(e,r,t){if(!t)return[r];var n,o=function(e){var r="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",t="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",n=e.createShader(35633),o=e.createShader(35632),a=e.createProgram();if(!(o&&n&&a))return;e.shaderSource(n,r),e.shaderSource(o,t),e.compileShader(n),e.compileShader(o),e.attachShader(a,n),e.attachShader(a,o),e.linkProgram(a),e.detachShader(a,n),e.detachShader(a,o),e.deleteShader(n),e.deleteShader(o),e.useProgram(a);var c=e.createBuffer();e.bindBuffer(i,c),e.bufferData(i,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);var u=e.getAttribLocation(a,"aPosition");e.vertexAttribPointer(u,3,5126,!1,0,0),e.enableVertexAttribArray(u),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);var l=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,l),e.deleteProgram(a),e.deleteBuffer(c),l.join("")}(e),a="801621810",c="8016218135",l="80162181161",f=(null==u?void 0:u.isIpad)?[["a7",l,12],["a8",c,15],["a8x",c,15],["a9",c,15],["a9x",c,15],["a10",c,15],["a10x",c,15],["a12",a,15],["a12x",a,15],["a12z",a,15],["a14",a,15],["a15",a,15],["m1",a,15],["m2",a,15]]:[["a7",l,12],["a8",c,12],["a9",c,15],["a10",c,15],["a11",a,15],["a12",a,15],["a13",a,15],["a14",a,15],["a15",a,15],["a16",a,15],["a17",a,15]];return"80162181255"===o?n=f.filter(function(e){return e[2]>=14}):(n=f.filter(function(e){return e[1]===o})).length||(n=f),n.map(function(e){var r=e[0];return"apple ".concat(r," gpu")})}var f=function(e){function t(r){var t=this.constructor,n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);var d=[],s=[];function h(e,r){if(e===r)return 0;var t=e;e.length>r.length&&(e=r,r=t);for(var n=e.length,o=r.length;n>0&&e.charCodeAt(~-n)===r.charCodeAt(~-o);)n--,o--;for(var a,i=0;i<n&&e.charCodeAt(i)===r.charCodeAt(i);)i++;if(o-=i,0===(n-=i))return o;for(var c,u,l=0,f=0,h=0;f<n;)s[f]=e.charCodeAt(i+f),d[f]=++f;for(;h<o;)for(a=r.charCodeAt(i+h),c=h++,l=h,f=0;f<n;f++)u=a===s[f]?c:c+1,c=d[f],l=d[f]=c>l?u>l?l+1:u:u>c?c+1:u;return l}function p(e){return null!=e}e.getGPUTier=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,function(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}([],e,!0),void 0,function(e){function r(e){return t(this,void 0,void 0,function(){var r,t,o,a,c,u,l,d,p,v,m,y,x,P,S,E,C,_,L,j,M,k,B,I,O,R,T;return n(this,function(n){switch(n.label){case 0:if(!(r=A(e)))return[2];t="".concat(g?"m":"d","-").concat(r).concat(s?"-ipad":"",".json"),o=i[t]=null!==(T=i[t])&&void 0!==T?T:w(t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,o];case 2:return a=n.sent(),[3,4];case 3:if((c=n.sent())instanceof f)throw c;return[2];case 4:if(u=function(e){var r,t=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(r=null==t?void 0:t.join("").replace(/\W|amd/g,""))&&void 0!==r?r:""}(e),l=a.filter(function(e){return e[1]===u}),l.length||(l=a.filter(function(r){return r[0].includes(e)})),0===(d=l.length))return[2];for(p=e.split(/[.,()\[\]/\s]/g).sort().filter(function(e,r,t){return 0===r||e!==t[r-1]}).join(" "),v=d>1?l.map(function(e){return[e,h(p,e[2])]}).sort(function(e,r){return e[1]-r[1]})[0][0]:l[0],m=v[0],y=v[4],x=Number.MAX_VALUE,S=window.devicePixelRatio,E=b.width*S*b.height*S,C=0,_=y;C<_.length;C++)L=_[C],j=L[0],M=L[1],k=j*M,(B=Math.abs(E-k))<x&&(x=B,P=L);return P?(O=(I=P)[2],R=I[3],[2,[x,O,m,R]]):[2]}})})}var i,d,s,v,g,m,b,y,w,x,A,P,S,E,C,_,L,j,M,k,B,I,O,R,T,U=void 0===e?{}:e,D=U.mobileTiers,N=void 0===D?[0,15,30,60]:D,F=U.desktopTiers,G=void 0===F?[0,15,30,60]:F,K=U.override,W=void 0===K?{}:K,$=U.glContext,V=U.failIfMajorPerformanceCaveat,q=void 0!==V&&V,z=U.benchmarksURL,X=void 0===z?"https://unpkg.com/@grepp/detect-gpu@".concat("5.0.81","/dist/benchmarks"):z;return n(this,function(e){switch(e.label){case 0:if(i={},c)return[2,{tier:0,type:"SSR"}];if(d=W.isIpad,s=void 0===d?!!(null==u?void 0:u.isIpad):d,v=W.isMobile,g=void 0===v?!!(null==u?void 0:u.isMobile):v,m=W.screenSize,b=void 0===m?window.screen:m,y=W.loadBenchmarks,w=void 0===y?function(e){return t(void 0,void 0,void 0,function(){var r;return n(this,function(t){switch(t.label){case 0:return[4,fetch("".concat(X,"/").concat(e)).then(function(e){return e.json()})];case 1:if(r=t.sent(),parseInt(r.shift().split(".")[0],10)<4)throw new f("Detect GPU benchmark data is out of date. Please update to version 4x");return[2,r]}})})}:y,x=W.renderer,A=function(e){for(var r=0,t=g?["adreno","apple","mali-t","mali","nvidia","powervr","samsung"]:["intel","apple","amd","radeon","nvidia","geforce","adreno"];r<t.length;r++){var n=t[r];if(e.includes(n))return n}},P=function(e,r,t,n,o){return{device:o,fps:n,gpu:t,isMobile:g,tier:e,type:r}},E="",x)x=a(x),S=[x];else{if(C=$||function(e,r){void 0===r&&(r=!1);var t={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:r,powerPreference:"high-performance",stencil:!1};e&&delete t.powerPreference;var n=window.document.createElement("canvas"),o=n.getContext("webgl",t)||n.getContext("experimental-webgl",t);return null!=o?o:void 0}(null==u?void 0:u.isSafari12,q),!C)return[2,P(0,"WEBGL_UNSUPPORTED")];if(_=(null==u?void 0:u.isFirefox)?null:C.getExtension("WEBGL_debug_renderer_info"),!(x=_?C.getParameter(_.UNMASKED_RENDERER_WEBGL):C.getParameter(C.RENDERER)))return[2,P(1,"FALLBACK")];E=x,x=a(x),S=function(e,r,t){return"apple gpu"===r?l(e,r,t):[r]}(C,x,g)}return[4,Promise.all(S.map(r))];case 1:if(L=e.sent().filter(p).sort(function(e,r){var t=e[0],n=void 0===t?Number.MAX_VALUE:t,o=e[1],a=r[0],i=void 0===a?Number.MAX_VALUE:a,c=r[1];return n===i?o-c:n-i}),!L.length)return[2,(j=o.find(function(e){return x.includes(e)}))?P(0,"BLOCKLISTED",j):P(1,"FALLBACK","".concat(x," (").concat(E,")"))];if(M=L[0],k=M[1],B=M[2],I=M[3],-1===k)return[2,P(0,"BLOCKLISTED",B,k,I)];for(O=g?N:G,R=0,T=0;T<O.length;T++)k>=O[T]&&(R=T);return[2,P(R,"BENCHMARK",B,k,I)]}})})}});
1
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).DetectGPU={})}(this,function(e){"use strict";var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},r(e,t)};function t(e,r,t,n){return new(t||(t=Promise))(function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function c(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(i,c)}u((n=n.apply(e,r||[])).next())})}function n(e,r){var t,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=c(0),i.throw=c(1),i.return=c(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(t=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=r.call(e,a)}catch(e){c=[6,e],n=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}"function"==typeof SuppressedError&&SuppressedError;var o=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function a(e){return e=e.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const i=34962;var c="undefined"==typeof window,u=function(){if(!c){var e=window.navigator,r=e.userAgent,t=e.platform,n=e.maxTouchPoints,o=/(iphone|ipod|ipad)/i.test(r),a="iPad"===t||"MacIntel"===t&&n>0&&!window.MSStream;return{isIpad:a,isMobile:/android/i.test(r)||o||a,isSafari12:/Version\/12.+Safari/.test(r),isFirefox:/Firefox/.test(r)}}}();function l(e,r,t){if(!t)return[r];var n,o=function(e){var r="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",t="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",n=e.createShader(35633),o=e.createShader(35632),a=e.createProgram();if(!(o&&n&&a))return;e.shaderSource(n,r),e.shaderSource(o,t),e.compileShader(n),e.compileShader(o),e.attachShader(a,n),e.attachShader(a,o),e.linkProgram(a),e.detachShader(a,n),e.detachShader(a,o),e.deleteShader(n),e.deleteShader(o),e.useProgram(a);var c=e.createBuffer();e.bindBuffer(i,c),e.bufferData(i,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);var u=e.getAttribLocation(a,"aPosition");e.vertexAttribPointer(u,3,5126,!1,0,0),e.enableVertexAttribArray(u),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);var l=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,l),e.deleteProgram(a),e.deleteBuffer(c),l.join("")}(e),a="801621810",c="8016218135",l="80162181161",f=(null==u?void 0:u.isIpad)?[["a7",l,12],["a8",c,15],["a8x",c,15],["a9",c,15],["a9x",c,15],["a10",c,15],["a10x",c,15],["a12",a,15],["a12x",a,15],["a12z",a,15],["a14",a,15],["a15",a,15],["m1",a,15],["m2",a,15]]:[["a7",l,12],["a8",c,12],["a9",c,15],["a10",c,15],["a11",a,15],["a12",a,15],["a13",a,15],["a14",a,15],["a15",a,15],["a16",a,15],["a17",a,15]];return"80162181255"===o?n=f.filter(function(e){return e[2]>=14}):(n=f.filter(function(e){return e[1]===o})).length||(n=f),n.map(function(e){var r=e[0];return"apple ".concat(r," gpu")})}var f=function(e){function t(r){var t=this.constructor,n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);var d=[],s=[];function h(e,r){if(e===r)return 0;var t=e;e.length>r.length&&(e=r,r=t);for(var n=e.length,o=r.length;n>0&&e.charCodeAt(~-n)===r.charCodeAt(~-o);)n--,o--;for(var a,i=0;i<n&&e.charCodeAt(i)===r.charCodeAt(i);)i++;if(o-=i,0===(n-=i))return o;for(var c,u,l=0,f=0,h=0;f<n;)s[f]=e.charCodeAt(i+f),d[f]=++f;for(;h<o;)for(a=r.charCodeAt(i+h),c=h++,l=h,f=0;f<n;f++)u=a===s[f]?c:c+1,c=d[f],l=d[f]=c>l?u>l?l+1:u:u>c?c+1:u;return l}function p(e){return null!=e}e.getGPUTier=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,function(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}([],e,!0),void 0,function(e){function r(e){return t(this,void 0,void 0,function(){var r,t,o,a,c,u,l,d,p,v,m,y,x,P,S,E,C,_,L,j,M,k,B,I,O,R,T;return n(this,function(n){switch(n.label){case 0:if(!(r=A(e)))return[2];t="".concat(g?"m":"d","-").concat(r).concat(s?"-ipad":"",".json"),o=i[t]=null!==(T=i[t])&&void 0!==T?T:w(t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,o];case 2:return a=n.sent(),[3,4];case 3:if((c=n.sent())instanceof f)throw c;return[2];case 4:if(u=function(e){var r,t=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(r=null==t?void 0:t.join("").replace(/\W|amd/g,""))&&void 0!==r?r:""}(e),l=a.filter(function(e){return e[1]===u}),l.length||(l=a.filter(function(r){return r[0].includes(e)})),0===(d=l.length))return[2];for(p=e.split(/[.,()\[\]/\s]/g).sort().filter(function(e,r,t){return 0===r||e!==t[r-1]}).join(" "),v=d>1?l.map(function(e){return[e,h(p,e[2])]}).sort(function(e,r){return e[1]-r[1]})[0][0]:l[0],m=v[0],y=v[4],x=Number.MAX_VALUE,S=window.devicePixelRatio,E=b.width*S*b.height*S,C=0,_=y;C<_.length;C++)L=_[C],j=L[0],M=L[1],k=j*M,(B=Math.abs(E-k))<x&&(x=B,P=L);return P?(O=(I=P)[2],R=I[3],[2,[x,O,m,R]]):[2]}})})}var i,d,s,v,g,m,b,y,w,x,A,P,S,E,C,_,L,j,M,k,B,I,O,R,T,U=void 0===e?{}:e,D=U.mobileTiers,N=void 0===D?[0,15,30,60]:D,F=U.desktopTiers,G=void 0===F?[0,15,30,60]:F,K=U.override,W=void 0===K?{}:K,$=U.glContext,V=U.failIfMajorPerformanceCaveat,q=void 0!==V&&V,z=U.benchmarksURL,X=void 0===z?"https://unpkg.com/@grepp/detect-gpu@".concat("5.0.83","/dist/benchmarks"):z;return n(this,function(e){switch(e.label){case 0:if(i={},c)return[2,{tier:0,type:"SSR"}];if(d=W.isIpad,s=void 0===d?!!(null==u?void 0:u.isIpad):d,v=W.isMobile,g=void 0===v?!!(null==u?void 0:u.isMobile):v,m=W.screenSize,b=void 0===m?window.screen:m,y=W.loadBenchmarks,w=void 0===y?function(e){return t(void 0,void 0,void 0,function(){var r;return n(this,function(t){switch(t.label){case 0:return[4,fetch("".concat(X,"/").concat(e)).then(function(e){return e.json()})];case 1:if(r=t.sent(),parseInt(r.shift().split(".")[0],10)<4)throw new f("Detect GPU benchmark data is out of date. Please update to version 4x");return[2,r]}})})}:y,x=W.renderer,A=function(e){for(var r=0,t=g?["adreno","apple","mali-t","mali","nvidia","powervr","samsung"]:["intel","apple","amd","radeon","nvidia","geforce","adreno"];r<t.length;r++){var n=t[r];if(e.includes(n))return n}},P=function(e,r,t,n,o){return{device:o,fps:n,gpu:t,isMobile:g,tier:e,type:r}},E="",x)x=a(x),S=[x];else{if(C=$||function(e,r){void 0===r&&(r=!1);var t={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:r,powerPreference:"high-performance",stencil:!1};e&&delete t.powerPreference;var n=window.document.createElement("canvas"),o=n.getContext("webgl",t)||n.getContext("experimental-webgl",t);return null!=o?o:void 0}(null==u?void 0:u.isSafari12,q),!C)return[2,P(0,"WEBGL_UNSUPPORTED")];if(_=(null==u?void 0:u.isFirefox)?null:C.getExtension("WEBGL_debug_renderer_info"),!(x=_?C.getParameter(_.UNMASKED_RENDERER_WEBGL):C.getParameter(C.RENDERER)))return[2,P(1,"FALLBACK")];E=x,x=a(x),S=function(e,r,t){return"apple gpu"===r?l(e,r,t):[r]}(C,x,g)}return[4,Promise.all(S.map(r))];case 1:if(L=e.sent().filter(p).sort(function(e,r){var t=e[0],n=void 0===t?Number.MAX_VALUE:t,o=e[1],a=r[0],i=void 0===a?Number.MAX_VALUE:a,c=r[1];return n===i?o-c:n-i}),!L.length)return[2,(j=o.find(function(e){return x.includes(e)}))?P(0,"BLOCKLISTED",j):P(1,"FALLBACK","".concat(x," (").concat(E,")"))];if(M=L[0],k=M[1],B=M[2],I=M[3],-1===k)return[2,P(0,"BLOCKLISTED",B,k,I)];for(O=g?N:G,R=0,T=0;T<O.length;T++)k>=O[T]&&(R=T);return[2,P(R,"BENCHMARK",B,k,I)]}})})}});
2
2
  //# sourceMappingURL=detect-gpu.umd.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grepp/detect-gpu",
3
- "version": "5.0.81",
3
+ "version": "5.0.83",
4
4
  "description": "Classify GPU's based on their benchmark score in order to provide an adaptive experience.",
5
5
  "author": "Tim van Scherpenzeel",
6
6
  "license": "MIT",