Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

jquery-3.5.1.js 281 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
  1. /*!
  2. * jQuery JavaScript Library v3.5.1
  3. * https://jquery.com/
  4. *
  5. * Includes Sizzle.js
  6. * https://sizzlejs.com/
  7. *
  8. * Copyright JS Foundation and other contributors
  9. * Released under the MIT license
  10. * https://jquery.org/license
  11. *
  12. * Date: 2020-05-04T22:49Z
  13. */
  14. ( function( global, factory ) {
  15. "use strict";
  16. if ( typeof module === "object" && typeof module.exports === "object" ) {
  17. // For CommonJS and CommonJS-like environments where a proper `window`
  18. // is present, execute the factory and get jQuery.
  19. // For environments that do not have a `window` with a `document`
  20. // (such as Node.js), expose a factory as module.exports.
  21. // This accentuates the need for the creation of a real `window`.
  22. // e.g. var jQuery = require("jquery")(window);
  23. // See ticket #14549 for more info.
  24. module.exports = global.document ?
  25. factory( global, true ) :
  26. function( w ) {
  27. if ( !w.document ) {
  28. throw new Error( "jQuery requires a window with a document" );
  29. }
  30. return factory( w );
  31. };
  32. } else {
  33. factory( global );
  34. }
  35. // Pass this if window is not defined yet
  36. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  37. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  38. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  39. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  40. // enough that all such attempts are guarded in a try block.
  41. "use strict";
  42. var arr = [];
  43. var getProto = Object.getPrototypeOf;
  44. var slice = arr.slice;
  45. var flat = arr.flat ? function( array ) {
  46. return arr.flat.call( array );
  47. } : function( array ) {
  48. return arr.concat.apply( [], array );
  49. };
  50. var push = arr.push;
  51. var indexOf = arr.indexOf;
  52. var class2type = {};
  53. var toString = class2type.toString;
  54. var hasOwn = class2type.hasOwnProperty;
  55. var fnToString = hasOwn.toString;
  56. var ObjectFunctionString = fnToString.call( Object );
  57. var support = {};
  58. var isFunction = function isFunction( obj ) {
  59. // Support: Chrome <=57, Firefox <=52
  60. // In some browsers, typeof returns "function" for HTML <object> elements
  61. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  62. // We don't want to classify *any* DOM node as a function.
  63. return typeof obj === "function" && typeof obj.nodeType !== "number";
  64. };
  65. var isWindow = function isWindow( obj ) {
  66. return obj != null && obj === obj.window;
  67. };
  68. var document = window.document;
  69. var preservedScriptAttributes = {
  70. type: true,
  71. src: true,
  72. nonce: true,
  73. noModule: true
  74. };
  75. function DOMEval( code, node, doc ) {
  76. doc = doc || document;
  77. var i, val,
  78. script = doc.createElement( "script" );
  79. script.text = code;
  80. if ( node ) {
  81. for ( i in preservedScriptAttributes ) {
  82. // Support: Firefox 64+, Edge 18+
  83. // Some browsers don't support the "nonce" property on scripts.
  84. // On the other hand, just using `getAttribute` is not enough as
  85. // the `nonce` attribute is reset to an empty string whenever it
  86. // becomes browsing-context connected.
  87. // See https://github.com/whatwg/html/issues/2369
  88. // See https://html.spec.whatwg.org/#nonce-attributes
  89. // The `node.getAttribute` check was added for the sake of
  90. // `jQuery.globalEval` so that it can fake a nonce-containing node
  91. // via an object.
  92. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  93. if ( val ) {
  94. script.setAttribute( i, val );
  95. }
  96. }
  97. }
  98. doc.head.appendChild( script ).parentNode.removeChild( script );
  99. }
  100. function toType( obj ) {
  101. if ( obj == null ) {
  102. return obj + "";
  103. }
  104. // Support: Android <=2.3 only (functionish RegExp)
  105. return typeof obj === "object" || typeof obj === "function" ?
  106. class2type[ toString.call( obj ) ] || "object" :
  107. typeof obj;
  108. }
  109. /* global Symbol */
  110. // Defining this global in .eslintrc.json would create a danger of using the global
  111. // unguarded in another place, it seems safer to define global only for this module
  112. var
  113. version = "3.5.1",
  114. // Define a local copy of jQuery
  115. jQuery = function( selector, context ) {
  116. // The jQuery object is actually just the init constructor 'enhanced'
  117. // Need init if jQuery is called (just allow error to be thrown if not included)
  118. return new jQuery.fn.init( selector, context );
  119. };
  120. jQuery.fn = jQuery.prototype = {
  121. // The current version of jQuery being used
  122. jquery: version,
  123. constructor: jQuery,
  124. // The default length of a jQuery object is 0
  125. length: 0,
  126. toArray: function() {
  127. return slice.call( this );
  128. },
  129. // Get the Nth element in the matched element set OR
  130. // Get the whole matched element set as a clean array
  131. get: function( num ) {
  132. // Return all the elements in a clean array
  133. if ( num == null ) {
  134. return slice.call( this );
  135. }
  136. // Return just the one element from the set
  137. return num < 0 ? this[ num + this.length ] : this[ num ];
  138. },
  139. // Take an array of elements and push it onto the stack
  140. // (returning the new matched element set)
  141. pushStack: function( elems ) {
  142. // Build a new jQuery matched element set
  143. var ret = jQuery.merge( this.constructor(), elems );
  144. // Add the old object onto the stack (as a reference)
  145. ret.prevObject = this;
  146. // Return the newly-formed element set
  147. return ret;
  148. },
  149. // Execute a callback for every element in the matched set.
  150. each: function( callback ) {
  151. return jQuery.each( this, callback );
  152. },
  153. map: function( callback ) {
  154. return this.pushStack( jQuery.map( this, function( elem, i ) {
  155. return callback.call( elem, i, elem );
  156. } ) );
  157. },
  158. slice: function() {
  159. return this.pushStack( slice.apply( this, arguments ) );
  160. },
  161. first: function() {
  162. return this.eq( 0 );
  163. },
  164. last: function() {
  165. return this.eq( -1 );
  166. },
  167. even: function() {
  168. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  169. return ( i + 1 ) % 2;
  170. } ) );
  171. },
  172. odd: function() {
  173. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  174. return i % 2;
  175. } ) );
  176. },
  177. eq: function( i ) {
  178. var len = this.length,
  179. j = +i + ( i < 0 ? len : 0 );
  180. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  181. },
  182. end: function() {
  183. return this.prevObject || this.constructor();
  184. },
  185. // For internal use only.
  186. // Behaves like an Array's method, not like a jQuery method.
  187. push: push,
  188. sort: arr.sort,
  189. splice: arr.splice
  190. };
  191. jQuery.extend = jQuery.fn.extend = function() {
  192. var options, name, src, copy, copyIsArray, clone,
  193. target = arguments[ 0 ] || {},
  194. i = 1,
  195. length = arguments.length,
  196. deep = false;
  197. // Handle a deep copy situation
  198. if ( typeof target === "boolean" ) {
  199. deep = target;
  200. // Skip the boolean and the target
  201. target = arguments[ i ] || {};
  202. i++;
  203. }
  204. // Handle case when target is a string or something (possible in deep copy)
  205. if ( typeof target !== "object" && !isFunction( target ) ) {
  206. target = {};
  207. }
  208. // Extend jQuery itself if only one argument is passed
  209. if ( i === length ) {
  210. target = this;
  211. i--;
  212. }
  213. for ( ; i < length; i++ ) {
  214. // Only deal with non-null/undefined values
  215. if ( ( options = arguments[ i ] ) != null ) {
  216. // Extend the base object
  217. for ( name in options ) {
  218. copy = options[ name ];
  219. // Prevent Object.prototype pollution
  220. // Prevent never-ending loop
  221. if ( name === "__proto__" || target === copy ) {
  222. continue;
  223. }
  224. // Recurse if we're merging plain objects or arrays
  225. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  226. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  227. src = target[ name ];
  228. // Ensure proper type for the source value
  229. if ( copyIsArray && !Array.isArray( src ) ) {
  230. clone = [];
  231. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  232. clone = {};
  233. } else {
  234. clone = src;
  235. }
  236. copyIsArray = false;
  237. // Never move original objects, clone them
  238. target[ name ] = jQuery.extend( deep, clone, copy );
  239. // Don't bring in undefined values
  240. } else if ( copy !== undefined ) {
  241. target[ name ] = copy;
  242. }
  243. }
  244. }
  245. }
  246. // Return the modified object
  247. return target;
  248. };
  249. jQuery.extend( {
  250. // Unique for each copy of jQuery on the page
  251. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  252. // Assume jQuery is ready without the ready module
  253. isReady: true,
  254. error: function( msg ) {
  255. throw new Error( msg );
  256. },
  257. noop: function() {},
  258. isPlainObject: function( obj ) {
  259. var proto, Ctor;
  260. // Detect obvious negatives
  261. // Use toString instead of jQuery.type to catch host objects
  262. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  263. return false;
  264. }
  265. proto = getProto( obj );
  266. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  267. if ( !proto ) {
  268. return true;
  269. }
  270. // Objects with prototype are plain iff they were constructed by a global Object function
  271. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  272. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  273. },
  274. isEmptyObject: function( obj ) {
  275. var name;
  276. for ( name in obj ) {
  277. return false;
  278. }
  279. return true;
  280. },
  281. // Evaluates a script in a provided context; falls back to the global one
  282. // if not specified.
  283. globalEval: function( code, options, doc ) {
  284. DOMEval( code, { nonce: options && options.nonce }, doc );
  285. },
  286. each: function( obj, callback ) {
  287. var length, i = 0;
  288. if ( isArrayLike( obj ) ) {
  289. length = obj.length;
  290. for ( ; i < length; i++ ) {
  291. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  292. break;
  293. }
  294. }
  295. } else {
  296. for ( i in obj ) {
  297. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  298. break;
  299. }
  300. }
  301. }
  302. return obj;
  303. },
  304. // results is for internal usage only
  305. makeArray: function( arr, results ) {
  306. var ret = results || [];
  307. if ( arr != null ) {
  308. if ( isArrayLike( Object( arr ) ) ) {
  309. jQuery.merge( ret,
  310. typeof arr === "string" ?
  311. [ arr ] : arr
  312. );
  313. } else {
  314. push.call( ret, arr );
  315. }
  316. }
  317. return ret;
  318. },
  319. inArray: function( elem, arr, i ) {
  320. return arr == null ? -1 : indexOf.call( arr, elem, i );
  321. },
  322. // Support: Android <=4.0 only, PhantomJS 1 only
  323. // push.apply(_, arraylike) throws on ancient WebKit
  324. merge: function( first, second ) {
  325. var len = +second.length,
  326. j = 0,
  327. i = first.length;
  328. for ( ; j < len; j++ ) {
  329. first[ i++ ] = second[ j ];
  330. }
  331. first.length = i;
  332. return first;
  333. },
  334. grep: function( elems, callback, invert ) {
  335. var callbackInverse,
  336. matches = [],
  337. i = 0,
  338. length = elems.length,
  339. callbackExpect = !invert;
  340. // Go through the array, only saving the items
  341. // that pass the validator function
  342. for ( ; i < length; i++ ) {
  343. callbackInverse = !callback( elems[ i ], i );
  344. if ( callbackInverse !== callbackExpect ) {
  345. matches.push( elems[ i ] );
  346. }
  347. }
  348. return matches;
  349. },
  350. // arg is for internal usage only
  351. map: function( elems, callback, arg ) {
  352. var length, value,
  353. i = 0,
  354. ret = [];
  355. // Go through the array, translating each of the items to their new values
  356. if ( isArrayLike( elems ) ) {
  357. length = elems.length;
  358. for ( ; i < length; i++ ) {
  359. value = callback( elems[ i ], i, arg );
  360. if ( value != null ) {
  361. ret.push( value );
  362. }
  363. }
  364. // Go through every key on the object,
  365. } else {
  366. for ( i in elems ) {
  367. value = callback( elems[ i ], i, arg );
  368. if ( value != null ) {
  369. ret.push( value );
  370. }
  371. }
  372. }
  373. // Flatten any nested arrays
  374. return flat( ret );
  375. },
  376. // A global GUID counter for objects
  377. guid: 1,
  378. // jQuery.support is not used in Core but other projects attach their
  379. // properties to it so it needs to exist.
  380. support: support
  381. } );
  382. if ( typeof Symbol === "function" ) {
  383. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  384. }
  385. // Populate the class2type map
  386. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  387. function( _i, name ) {
  388. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  389. } );
  390. function isArrayLike( obj ) {
  391. // Support: real iOS 8.2 only (not reproducible in simulator)
  392. // `in` check used to prevent JIT error (gh-2145)
  393. // hasOwn isn't used here due to false negatives
  394. // regarding Nodelist length in IE
  395. var length = !!obj && "length" in obj && obj.length,
  396. type = toType( obj );
  397. if ( isFunction( obj ) || isWindow( obj ) ) {
  398. return false;
  399. }
  400. return type === "array" || length === 0 ||
  401. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  402. }
  403. var Sizzle =
  404. /*!
  405. * Sizzle CSS Selector Engine v2.3.5
  406. * https://sizzlejs.com/
  407. *
  408. * Copyright JS Foundation and other contributors
  409. * Released under the MIT license
  410. * https://js.foundation/
  411. *
  412. * Date: 2020-03-14
  413. */
  414. ( function( window ) {
  415. var i,
  416. support,
  417. Expr,
  418. getText,
  419. isXML,
  420. tokenize,
  421. compile,
  422. select,
  423. outermostContext,
  424. sortInput,
  425. hasDuplicate,
  426. // Local document vars
  427. setDocument,
  428. document,
  429. docElem,
  430. documentIsHTML,
  431. rbuggyQSA,
  432. rbuggyMatches,
  433. matches,
  434. contains,
  435. // Instance-specific data
  436. expando = "sizzle" + 1 * new Date(),
  437. preferredDoc = window.document,
  438. dirruns = 0,
  439. done = 0,
  440. classCache = createCache(),
  441. tokenCache = createCache(),
  442. compilerCache = createCache(),
  443. nonnativeSelectorCache = createCache(),
  444. sortOrder = function( a, b ) {
  445. if ( a === b ) {
  446. hasDuplicate = true;
  447. }
  448. return 0;
  449. },
  450. // Instance methods
  451. hasOwn = ( {} ).hasOwnProperty,
  452. arr = [],
  453. pop = arr.pop,
  454. pushNative = arr.push,
  455. push = arr.push,
  456. slice = arr.slice,
  457. // Use a stripped-down indexOf as it's faster than native
  458. // https://jsperf.com/thor-indexof-vs-for/5
  459. indexOf = function( list, elem ) {
  460. var i = 0,
  461. len = list.length;
  462. for ( ; i < len; i++ ) {
  463. if ( list[ i ] === elem ) {
  464. return i;
  465. }
  466. }
  467. return -1;
  468. },
  469. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
  470. "ismap|loop|multiple|open|readonly|required|scoped",
  471. // Regular expressions
  472. // http://www.w3.org/TR/css3-selectors/#whitespace
  473. whitespace = "[\\x20\\t\\r\\n\\f]",
  474. // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  475. identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  476. "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  477. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  478. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  479. // Operator (capture 2)
  480. "*([*^$|!~]?=)" + whitespace +
  481. // "Attribute values must be CSS identifiers [capture 5]
  482. // or strings [capture 3 or capture 4]"
  483. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  484. whitespace + "*\\]",
  485. pseudos = ":(" + identifier + ")(?:\\((" +
  486. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  487. // 1. quoted (capture 3; capture 4 or capture 5)
  488. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  489. // 2. simple (capture 6)
  490. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  491. // 3. anything else (capture 2)
  492. ".*" +
  493. ")\\)|)",
  494. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  495. rwhitespace = new RegExp( whitespace + "+", "g" ),
  496. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
  497. whitespace + "+$", "g" ),
  498. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  499. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
  500. "*" ),
  501. rdescend = new RegExp( whitespace + "|>" ),
  502. rpseudo = new RegExp( pseudos ),
  503. ridentifier = new RegExp( "^" + identifier + "$" ),
  504. matchExpr = {
  505. "ID": new RegExp( "^#(" + identifier + ")" ),
  506. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  507. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  508. "ATTR": new RegExp( "^" + attributes ),
  509. "PSEUDO": new RegExp( "^" + pseudos ),
  510. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  511. whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  512. whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  513. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  514. // For use in libraries implementing .is()
  515. // We use this for POS matching in `select`
  516. "needsContext": new RegExp( "^" + whitespace +
  517. "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  518. "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  519. },
  520. rhtml = /HTML$/i,
  521. rinputs = /^(?:input|select|textarea|button)$/i,
  522. rheader = /^h\d$/i,
  523. rnative = /^[^{]+\{\s*\[native \w/,
  524. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  525. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  526. rsibling = /[+~]/,
  527. // CSS escapes
  528. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  529. runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
  530. funescape = function( escape, nonHex ) {
  531. var high = "0x" + escape.slice( 1 ) - 0x10000;
  532. return nonHex ?
  533. // Strip the backslash prefix from a non-hex escape sequence
  534. nonHex :
  535. // Replace a hexadecimal escape sequence with the encoded Unicode code point
  536. // Support: IE <=11+
  537. // For values outside the Basic Multilingual Plane (BMP), manually construct a
  538. // surrogate pair
  539. high < 0 ?
  540. String.fromCharCode( high + 0x10000 ) :
  541. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  542. },
  543. // CSS string/identifier serialization
  544. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  545. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  546. fcssescape = function( ch, asCodePoint ) {
  547. if ( asCodePoint ) {
  548. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  549. if ( ch === "\0" ) {
  550. return "\uFFFD";
  551. }
  552. // Control characters and (dependent upon position) numbers get escaped as code points
  553. return ch.slice( 0, -1 ) + "\\" +
  554. ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  555. }
  556. // Other potentially-special ASCII characters get backslash-escaped
  557. return "\\" + ch;
  558. },
  559. // Used for iframes
  560. // See setDocument()
  561. // Removing the function wrapper causes a "Permission Denied"
  562. // error in IE
  563. unloadHandler = function() {
  564. setDocument();
  565. },
  566. inDisabledFieldset = addCombinator(
  567. function( elem ) {
  568. return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  569. },
  570. { dir: "parentNode", next: "legend" }
  571. );
  572. // Optimize for push.apply( _, NodeList )
  573. try {
  574. push.apply(
  575. ( arr = slice.call( preferredDoc.childNodes ) ),
  576. preferredDoc.childNodes
  577. );
  578. // Support: Android<4.0
  579. // Detect silently failing push.apply
  580. // eslint-disable-next-line no-unused-expressions
  581. arr[ preferredDoc.childNodes.length ].nodeType;
  582. } catch ( e ) {
  583. push = { apply: arr.length ?
  584. // Leverage slice if possible
  585. function( target, els ) {
  586. pushNative.apply( target, slice.call( els ) );
  587. } :
  588. // Support: IE<9
  589. // Otherwise append directly
  590. function( target, els ) {
  591. var j = target.length,
  592. i = 0;
  593. // Can't trust NodeList.length
  594. while ( ( target[ j++ ] = els[ i++ ] ) ) {}
  595. target.length = j - 1;
  596. }
  597. };
  598. }
  599. function Sizzle( selector, context, results, seed ) {
  600. var m, i, elem, nid, match, groups, newSelector,
  601. newContext = context && context.ownerDocument,
  602. // nodeType defaults to 9, since context defaults to document
  603. nodeType = context ? context.nodeType : 9;
  604. results = results || [];
  605. // Return early from calls with invalid selector or context
  606. if ( typeof selector !== "string" || !selector ||
  607. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  608. return results;
  609. }
  610. // Try to shortcut find operations (as opposed to filters) in HTML documents
  611. if ( !seed ) {
  612. setDocument( context );
  613. context = context || document;
  614. if ( documentIsHTML ) {
  615. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  616. // (excepting DocumentFragment context, where the methods don't exist)
  617. if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  618. // ID selector
  619. if ( ( m = match[ 1 ] ) ) {
  620. // Document context
  621. if ( nodeType === 9 ) {
  622. if ( ( elem = context.getElementById( m ) ) ) {
  623. // Support: IE, Opera, Webkit
  624. // TODO: identify versions
  625. // getElementById can match elements by name instead of ID
  626. if ( elem.id === m ) {
  627. results.push( elem );
  628. return results;
  629. }
  630. } else {
  631. return results;
  632. }
  633. // Element context
  634. } else {
  635. // Support: IE, Opera, Webkit
  636. // TODO: identify versions
  637. // getElementById can match elements by name instead of ID
  638. if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  639. contains( context, elem ) &&
  640. elem.id === m ) {
  641. results.push( elem );
  642. return results;
  643. }
  644. }
  645. // Type selector
  646. } else if ( match[ 2 ] ) {
  647. push.apply( results, context.getElementsByTagName( selector ) );
  648. return results;
  649. // Class selector
  650. } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
  651. context.getElementsByClassName ) {
  652. push.apply( results, context.getElementsByClassName( m ) );
  653. return results;
  654. }
  655. }
  656. // Take advantage of querySelectorAll
  657. if ( support.qsa &&
  658. !nonnativeSelectorCache[ selector + " " ] &&
  659. ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
  660. // Support: IE 8 only
  661. // Exclude object elements
  662. ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
  663. newSelector = selector;
  664. newContext = context;
  665. // qSA considers elements outside a scoping root when evaluating child or
  666. // descendant combinators, which is not what we want.
  667. // In such cases, we work around the behavior by prefixing every selector in the
  668. // list with an ID selector referencing the scope context.
  669. // The technique has to be used as well when a leading combinator is used
  670. // as such selectors are not recognized by querySelectorAll.
  671. // Thanks to Andrew Dupont for this technique.
  672. if ( nodeType === 1 &&
  673. ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
  674. // Expand context for sibling selectors
  675. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  676. context;
  677. // We can use :scope instead of the ID hack if the browser
  678. // supports it & if we're not changing the context.
  679. if ( newContext !== context || !support.scope ) {
  680. // Capture the context ID, setting it first if necessary
  681. if ( ( nid = context.getAttribute( "id" ) ) ) {
  682. nid = nid.replace( rcssescape, fcssescape );
  683. } else {
  684. context.setAttribute( "id", ( nid = expando ) );
  685. }
  686. }
  687. // Prefix every selector in the list
  688. groups = tokenize( selector );
  689. i = groups.length;
  690. while ( i-- ) {
  691. groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  692. toSelector( groups[ i ] );
  693. }
  694. newSelector = groups.join( "," );
  695. }
  696. try {
  697. push.apply( results,
  698. newContext.querySelectorAll( newSelector )
  699. );
  700. return results;
  701. } catch ( qsaError ) {
  702. nonnativeSelectorCache( selector, true );
  703. } finally {
  704. if ( nid === expando ) {
  705. context.removeAttribute( "id" );
  706. }
  707. }
  708. }
  709. }
  710. }
  711. // All others
  712. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  713. }
  714. /**
  715. * Create key-value caches of limited size
  716. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  717. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  718. * deleting the oldest entry
  719. */
  720. function createCache() {
  721. var keys = [];
  722. function cache( key, value ) {
  723. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  724. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  725. // Only keep the most recent entries
  726. delete cache[ keys.shift() ];
  727. }
  728. return ( cache[ key + " " ] = value );
  729. }
  730. return cache;
  731. }
  732. /**
  733. * Mark a function for special use by Sizzle
  734. * @param {Function} fn The function to mark
  735. */
  736. function markFunction( fn ) {
  737. fn[ expando ] = true;
  738. return fn;
  739. }
  740. /**
  741. * Support testing using an element
  742. * @param {Function} fn Passed the created element and returns a boolean result
  743. */
  744. function assert( fn ) {
  745. var el = document.createElement( "fieldset" );
  746. try {
  747. return !!fn( el );
  748. } catch ( e ) {
  749. return false;
  750. } finally {
  751. // Remove from its parent by default
  752. if ( el.parentNode ) {
  753. el.parentNode.removeChild( el );
  754. }
  755. // release memory in IE
  756. el = null;
  757. }
  758. }
  759. /**
  760. * Adds the same handler for all of the specified attrs
  761. * @param {String} attrs Pipe-separated list of attributes
  762. * @param {Function} handler The method that will be applied
  763. */
  764. function addHandle( attrs, handler ) {
  765. var arr = attrs.split( "|" ),
  766. i = arr.length;
  767. while ( i-- ) {
  768. Expr.attrHandle[ arr[ i ] ] = handler;
  769. }
  770. }
  771. /**
  772. * Checks document order of two siblings
  773. * @param {Element} a
  774. * @param {Element} b
  775. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  776. */
  777. function siblingCheck( a, b ) {
  778. var cur = b && a,
  779. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  780. a.sourceIndex - b.sourceIndex;
  781. // Use IE sourceIndex if available on both nodes
  782. if ( diff ) {
  783. return diff;
  784. }
  785. // Check if b follows a
  786. if ( cur ) {
  787. while ( ( cur = cur.nextSibling ) ) {
  788. if ( cur === b ) {
  789. return -1;
  790. }
  791. }
  792. }
  793. return a ? 1 : -1;
  794. }
  795. /**
  796. * Returns a function to use in pseudos for input types
  797. * @param {String} type
  798. */
  799. function createInputPseudo( type ) {
  800. return function( elem ) {
  801. var name = elem.nodeName.toLowerCase();
  802. return name === "input" && elem.type === type;
  803. };
  804. }
  805. /**
  806. * Returns a function to use in pseudos for buttons
  807. * @param {String} type
  808. */
  809. function createButtonPseudo( type ) {
  810. return function( elem ) {
  811. var name = elem.nodeName.toLowerCase();
  812. return ( name === "input" || name === "button" ) && elem.type === type;
  813. };
  814. }
  815. /**
  816. * Returns a function to use in pseudos for :enabled/:disabled
  817. * @param {Boolean} disabled true for :disabled; false for :enabled
  818. */
  819. function createDisabledPseudo( disabled ) {
  820. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  821. return function( elem ) {
  822. // Only certain elements can match :enabled or :disabled
  823. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  824. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  825. if ( "form" in elem ) {
  826. // Check for inherited disabledness on relevant non-disabled elements:
  827. // * listed form-associated elements in a disabled fieldset
  828. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  829. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  830. // * option elements in a disabled optgroup
  831. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  832. // All such elements have a "form" property.
  833. if ( elem.parentNode && elem.disabled === false ) {
  834. // Option elements defer to a parent optgroup if present
  835. if ( "label" in elem ) {
  836. if ( "label" in elem.parentNode ) {
  837. return elem.parentNode.disabled === disabled;
  838. } else {
  839. return elem.disabled === disabled;
  840. }
  841. }
  842. // Support: IE 6 - 11
  843. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  844. return elem.isDisabled === disabled ||
  845. // Where there is no isDisabled, check manually
  846. /* jshint -W018 */
  847. elem.isDisabled !== !disabled &&
  848. inDisabledFieldset( elem ) === disabled;
  849. }
  850. return elem.disabled === disabled;
  851. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  852. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  853. // even exist on them, let alone have a boolean value.
  854. } else if ( "label" in elem ) {
  855. return elem.disabled === disabled;
  856. }
  857. // Remaining elements are neither :enabled nor :disabled
  858. return false;
  859. };
  860. }
  861. /**
  862. * Returns a function to use in pseudos for positionals
  863. * @param {Function} fn
  864. */
  865. function createPositionalPseudo( fn ) {
  866. return markFunction( function( argument ) {
  867. argument = +argument;
  868. return markFunction( function( seed, matches ) {
  869. var j,
  870. matchIndexes = fn( [], seed.length, argument ),
  871. i = matchIndexes.length;
  872. // Match elements found at the specified indexes
  873. while ( i-- ) {
  874. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  875. seed[ j ] = !( matches[ j ] = seed[ j ] );
  876. }
  877. }
  878. } );
  879. } );
  880. }
  881. /**
  882. * Checks a node for validity as a Sizzle context
  883. * @param {Element|Object=} context
  884. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  885. */
  886. function testContext( context ) {
  887. return context && typeof context.getElementsByTagName !== "undefined" && context;
  888. }
  889. // Expose support vars for convenience
  890. support = Sizzle.support = {};
  891. /**
  892. * Detects XML nodes
  893. * @param {Element|Object} elem An element or a document
  894. * @returns {Boolean} True iff elem is a non-HTML XML node
  895. */
  896. isXML = Sizzle.isXML = function( elem ) {
  897. var namespace = elem.namespaceURI,
  898. docElem = ( elem.ownerDocument || elem ).documentElement;
  899. // Support: IE <=8
  900. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  901. // https://bugs.jquery.com/ticket/4833
  902. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  903. };
  904. /**
  905. * Sets document-related variables once based on the current document
  906. * @param {Element|Object} [doc] An element or document object to use to set the document
  907. * @returns {Object} Returns the current document
  908. */
  909. setDocument = Sizzle.setDocument = function( node ) {
  910. var hasCompare, subWindow,
  911. doc = node ? node.ownerDocument || node : preferredDoc;
  912. // Return early if doc is invalid or already selected
  913. // Support: IE 11+, Edge 17 - 18+
  914. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  915. // two documents; shallow comparisons work.
  916. // eslint-disable-next-line eqeqeq
  917. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  918. return document;
  919. }
  920. // Update global variables
  921. document = doc;
  922. docElem = document.documentElement;
  923. documentIsHTML = !isXML( document );
  924. // Support: IE 9 - 11+, Edge 12 - 18+
  925. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  926. // Support: IE 11+, Edge 17 - 18+
  927. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  928. // two documents; shallow comparisons work.
  929. // eslint-disable-next-line eqeqeq
  930. if ( preferredDoc != document &&
  931. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  932. // Support: IE 11, Edge
  933. if ( subWindow.addEventListener ) {
  934. subWindow.addEventListener( "unload", unloadHandler, false );
  935. // Support: IE 9 - 10 only
  936. } else if ( subWindow.attachEvent ) {
  937. subWindow.attachEvent( "onunload", unloadHandler );
  938. }
  939. }
  940. // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
  941. // Safari 4 - 5 only, Opera <=11.6 - 12.x only
  942. // IE/Edge & older browsers don't support the :scope pseudo-class.
  943. // Support: Safari 6.0 only
  944. // Safari 6.0 supports :scope but it's an alias of :root there.
  945. support.scope = assert( function( el ) {
  946. docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
  947. return typeof el.querySelectorAll !== "undefined" &&
  948. !el.querySelectorAll( ":scope fieldset div" ).length;
  949. } );
  950. /* Attributes
  951. ---------------------------------------------------------------------- */
  952. // Support: IE<8
  953. // Verify that getAttribute really returns attributes and not properties
  954. // (excepting IE8 booleans)
  955. support.attributes = assert( function( el ) {
  956. el.className = "i";
  957. return !el.getAttribute( "className" );
  958. } );
  959. /* getElement(s)By*
  960. ---------------------------------------------------------------------- */
  961. // Check if getElementsByTagName("*") returns only elements
  962. support.getElementsByTagName = assert( function( el ) {
  963. el.appendChild( document.createComment( "" ) );
  964. return !el.getElementsByTagName( "*" ).length;
  965. } );
  966. // Support: IE<9
  967. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  968. // Support: IE<10
  969. // Check if getElementById returns elements by name
  970. // The broken getElementById methods don't pick up programmatically-set names,
  971. // so use a roundabout getElementsByName test
  972. support.getById = assert( function( el ) {
  973. docElem.appendChild( el ).id = expando;
  974. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  975. } );
  976. // ID filter and find
  977. if ( support.getById ) {
  978. Expr.filter[ "ID" ] = function( id ) {
  979. var attrId = id.replace( runescape, funescape );
  980. return function( elem ) {
  981. return elem.getAttribute( "id" ) === attrId;
  982. };
  983. };
  984. Expr.find[ "ID" ] = function( id, context ) {
  985. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  986. var elem = context.getElementById( id );
  987. return elem ? [ elem ] : [];
  988. }
  989. };
  990. } else {
  991. Expr.filter[ "ID" ] = function( id ) {
  992. var attrId = id.replace( runescape, funescape );
  993. return function( elem ) {
  994. var node = typeof elem.getAttributeNode !== "undefined" &&
  995. elem.getAttributeNode( "id" );
  996. return node && node.value === attrId;
  997. };
  998. };
  999. // Support: IE 6 - 7 only
  1000. // getElementById is not reliable as a find shortcut
  1001. Expr.find[ "ID" ] = function( id, context ) {
  1002. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1003. var node, i, elems,
  1004. elem = context.getElementById( id );
  1005. if ( elem ) {
  1006. // Verify the id attribute
  1007. node = elem.getAttributeNode( "id" );
  1008. if ( node && node.value === id ) {
  1009. return [ elem ];
  1010. }
  1011. // Fall back on getElementsByName
  1012. elems = context.getElementsByName( id );
  1013. i = 0;
  1014. while ( ( elem = elems[ i++ ] ) ) {
  1015. node = elem.getAttributeNode( "id" );
  1016. if ( node && node.value === id ) {
  1017. return [ elem ];
  1018. }
  1019. }
  1020. }
  1021. return [];
  1022. }
  1023. };
  1024. }
  1025. // Tag
  1026. Expr.find[ "TAG" ] = support.getElementsByTagName ?
  1027. function( tag, context ) {
  1028. if ( typeof context.getElementsByTagName !== "undefined" ) {
  1029. return context.getElementsByTagName( tag );
  1030. // DocumentFragment nodes don't have gEBTN
  1031. } else if ( support.qsa ) {
  1032. return context.querySelectorAll( tag );
  1033. }
  1034. } :
  1035. function( tag, context ) {
  1036. var elem,
  1037. tmp = [],
  1038. i = 0,
  1039. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  1040. results = context.getElementsByTagName( tag );
  1041. // Filter out possible comments
  1042. if ( tag === "*" ) {
  1043. while ( ( elem = results[ i++ ] ) ) {
  1044. if ( elem.nodeType === 1 ) {
  1045. tmp.push( elem );
  1046. }
  1047. }
  1048. return tmp;
  1049. }
  1050. return results;
  1051. };
  1052. // Class
  1053. Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
  1054. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  1055. return context.getElementsByClassName( className );
  1056. }
  1057. };
  1058. /* QSA/matchesSelector
  1059. ---------------------------------------------------------------------- */
  1060. // QSA and matchesSelector support
  1061. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  1062. rbuggyMatches = [];
  1063. // qSa(:focus) reports false when true (Chrome 21)
  1064. // We allow this because of a bug in IE8/9 that throws an error
  1065. // whenever `document.activeElement` is accessed on an iframe
  1066. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  1067. // See https://bugs.jquery.com/ticket/13378
  1068. rbuggyQSA = [];
  1069. if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
  1070. // Build QSA regex
  1071. // Regex strategy adopted from Diego Perini
  1072. assert( function( el ) {
  1073. var input;
  1074. // Select is set to empty string on purpose
  1075. // This is to test IE's treatment of not explicitly
  1076. // setting a boolean content attribute,
  1077. // since its presence should be enough
  1078. // https://bugs.jquery.com/ticket/12359
  1079. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  1080. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  1081. "<option selected=''></option></select>";
  1082. // Support: IE8, Opera 11-12.16
  1083. // Nothing should be selected when empty strings follow ^= or $= or *=
  1084. // The test attribute must be unknown in Opera but "safe" for WinRT
  1085. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  1086. if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
  1087. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  1088. }
  1089. // Support: IE8
  1090. // Boolean attributes and "value" are not treated correctly
  1091. if ( !el.querySelectorAll( "[selected]" ).length ) {
  1092. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1093. }
  1094. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  1095. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1096. rbuggyQSA.push( "~=" );
  1097. }
  1098. // Support: IE 11+, Edge 15 - 18+
  1099. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  1100. // Adding a temporary attribute to the document before the selection works
  1101. // around the issue.
  1102. // Interestingly, IE 10 & older don't seem to have the issue.
  1103. input = document.createElement( "input" );
  1104. input.setAttribute( "name", "" );
  1105. el.appendChild( input );
  1106. if ( !el.querySelectorAll( "[name='']" ).length ) {
  1107. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  1108. whitespace + "*(?:''|\"\")" );
  1109. }
  1110. // Webkit/Opera - :checked should return selected option elements
  1111. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1112. // IE8 throws error here and will not see later tests
  1113. if ( !el.querySelectorAll( ":checked" ).length ) {
  1114. rbuggyQSA.push( ":checked" );
  1115. }
  1116. // Support: Safari 8+, iOS 8+
  1117. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1118. // In-page `selector#id sibling-combinator selector` fails
  1119. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1120. rbuggyQSA.push( ".#.+[+~]" );
  1121. }
  1122. // Support: Firefox <=3.6 - 5 only
  1123. // Old Firefox doesn't throw on a badly-escaped identifier.
  1124. el.querySelectorAll( "\\\f" );
  1125. rbuggyQSA.push( "[\\r\\n\\f]" );
  1126. } );
  1127. assert( function( el ) {
  1128. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  1129. "<select disabled='disabled'><option/></select>";
  1130. // Support: Windows 8 Native Apps
  1131. // The type and name attributes are restricted during .innerHTML assignment
  1132. var input = document.createElement( "input" );
  1133. input.setAttribute( "type", "hidden" );
  1134. el.appendChild( input ).setAttribute( "name", "D" );
  1135. // Support: IE8
  1136. // Enforce case-sensitivity of name attribute
  1137. if ( el.querySelectorAll( "[name=d]" ).length ) {
  1138. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1139. }
  1140. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1141. // IE8 throws error here and will not see later tests
  1142. if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
  1143. rbuggyQSA.push( ":enabled", ":disabled" );
  1144. }
  1145. // Support: IE9-11+
  1146. // IE's :disabled selector does not pick up the children of disabled fieldsets
  1147. docElem.appendChild( el ).disabled = true;
  1148. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  1149. rbuggyQSA.push( ":enabled", ":disabled" );
  1150. }
  1151. // Support: Opera 10 - 11 only
  1152. // Opera 10-11 does not throw on post-comma invalid pseudos
  1153. el.querySelectorAll( "*,:x" );
  1154. rbuggyQSA.push( ",.*:" );
  1155. } );
  1156. }
  1157. if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
  1158. docElem.webkitMatchesSelector ||
  1159. docElem.mozMatchesSelector ||
  1160. docElem.oMatchesSelector ||
  1161. docElem.msMatchesSelector ) ) ) ) {
  1162. assert( function( el ) {
  1163. // Check to see if it's possible to do matchesSelector
  1164. // on a disconnected node (IE 9)
  1165. support.disconnectedMatch = matches.call( el, "*" );
  1166. // This should fail with an exception
  1167. // Gecko does not error, returns false instead
  1168. matches.call( el, "[s!='']:x" );
  1169. rbuggyMatches.push( "!=", pseudos );
  1170. } );
  1171. }
  1172. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  1173. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
  1174. /* Contains
  1175. ---------------------------------------------------------------------- */
  1176. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1177. // Element contains another
  1178. // Purposefully self-exclusive
  1179. // As in, an element does not contain itself
  1180. contains = hasCompare || rnative.test( docElem.contains ) ?
  1181. function( a, b ) {
  1182. var adown = a.nodeType === 9 ? a.documentElement : a,
  1183. bup = b && b.parentNode;
  1184. return a === bup || !!( bup && bup.nodeType === 1 && (
  1185. adown.contains ?
  1186. adown.contains( bup ) :
  1187. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1188. ) );
  1189. } :
  1190. function( a, b ) {
  1191. if ( b ) {
  1192. while ( ( b = b.parentNode ) ) {
  1193. if ( b === a ) {
  1194. return true;
  1195. }
  1196. }
  1197. }
  1198. return false;
  1199. };
  1200. /* Sorting
  1201. ---------------------------------------------------------------------- */
  1202. // Document order sorting
  1203. sortOrder = hasCompare ?
  1204. function( a, b ) {
  1205. // Flag for duplicate removal
  1206. if ( a === b ) {
  1207. hasDuplicate = true;
  1208. return 0;
  1209. }
  1210. // Sort on method existence if only one input has compareDocumentPosition
  1211. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1212. if ( compare ) {
  1213. return compare;
  1214. }
  1215. // Calculate position if both inputs belong to the same document
  1216. // Support: IE 11+, Edge 17 - 18+
  1217. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1218. // two documents; shallow comparisons work.
  1219. // eslint-disable-next-line eqeqeq
  1220. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  1221. a.compareDocumentPosition( b ) :
  1222. // Otherwise we know they are disconnected
  1223. 1;
  1224. // Disconnected nodes
  1225. if ( compare & 1 ||
  1226. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  1227. // Choose the first element that is related to our preferred document
  1228. // Support: IE 11+, Edge 17 - 18+
  1229. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1230. // two documents; shallow comparisons work.
  1231. // eslint-disable-next-line eqeqeq
  1232. if ( a == document || a.ownerDocument == preferredDoc &&
  1233. contains( preferredDoc, a ) ) {
  1234. return -1;
  1235. }
  1236. // Support: IE 11+, Edge 17 - 18+
  1237. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1238. // two documents; shallow comparisons work.
  1239. // eslint-disable-next-line eqeqeq
  1240. if ( b == document || b.ownerDocument == preferredDoc &&
  1241. contains( preferredDoc, b ) ) {
  1242. return 1;
  1243. }
  1244. // Maintain original order
  1245. return sortInput ?
  1246. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1247. 0;
  1248. }
  1249. return compare & 4 ? -1 : 1;
  1250. } :
  1251. function( a, b ) {
  1252. // Exit early if the nodes are identical
  1253. if ( a === b ) {
  1254. hasDuplicate = true;
  1255. return 0;
  1256. }
  1257. var cur,
  1258. i = 0,
  1259. aup = a.parentNode,
  1260. bup = b.parentNode,
  1261. ap = [ a ],
  1262. bp = [ b ];
  1263. // Parentless nodes are either documents or disconnected
  1264. if ( !aup || !bup ) {
  1265. // Support: IE 11+, Edge 17 - 18+
  1266. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1267. // two documents; shallow comparisons work.
  1268. /* eslint-disable eqeqeq */
  1269. return a == document ? -1 :
  1270. b == document ? 1 :
  1271. /* eslint-enable eqeqeq */
  1272. aup ? -1 :
  1273. bup ? 1 :
  1274. sortInput ?
  1275. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1276. 0;
  1277. // If the nodes are siblings, we can do a quick check
  1278. } else if ( aup === bup ) {
  1279. return siblingCheck( a, b );
  1280. }
  1281. // Otherwise we need full lists of their ancestors for comparison
  1282. cur = a;
  1283. while ( ( cur = cur.parentNode ) ) {
  1284. ap.unshift( cur );
  1285. }
  1286. cur = b;
  1287. while ( ( cur = cur.parentNode ) ) {
  1288. bp.unshift( cur );
  1289. }
  1290. // Walk down the tree looking for a discrepancy
  1291. while ( ap[ i ] === bp[ i ] ) {
  1292. i++;
  1293. }
  1294. return i ?
  1295. // Do a sibling check if the nodes have a common ancestor
  1296. siblingCheck( ap[ i ], bp[ i ] ) :
  1297. // Otherwise nodes in our document sort first
  1298. // Support: IE 11+, Edge 17 - 18+
  1299. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1300. // two documents; shallow comparisons work.
  1301. /* eslint-disable eqeqeq */
  1302. ap[ i ] == preferredDoc ? -1 :
  1303. bp[ i ] == preferredDoc ? 1 :
  1304. /* eslint-enable eqeqeq */
  1305. 0;
  1306. };
  1307. return document;
  1308. };
  1309. Sizzle.matches = function( expr, elements ) {
  1310. return Sizzle( expr, null, null, elements );
  1311. };
  1312. Sizzle.matchesSelector = function( elem, expr ) {
  1313. setDocument( elem );
  1314. if ( support.matchesSelector && documentIsHTML &&
  1315. !nonnativeSelectorCache[ expr + " " ] &&
  1316. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1317. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1318. try {
  1319. var ret = matches.call( elem, expr );
  1320. // IE 9's matchesSelector returns false on disconnected nodes
  1321. if ( ret || support.disconnectedMatch ||
  1322. // As well, disconnected nodes are said to be in a document
  1323. // fragment in IE 9
  1324. elem.document && elem.document.nodeType !== 11 ) {
  1325. return ret;
  1326. }
  1327. } catch ( e ) {
  1328. nonnativeSelectorCache( expr, true );
  1329. }
  1330. }
  1331. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1332. };
  1333. Sizzle.contains = function( context, elem ) {
  1334. // Set document vars if needed
  1335. // Support: IE 11+, Edge 17 - 18+
  1336. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1337. // two documents; shallow comparisons work.
  1338. // eslint-disable-next-line eqeqeq
  1339. if ( ( context.ownerDocument || context ) != document ) {
  1340. setDocument( context );
  1341. }
  1342. return contains( context, elem );
  1343. };
  1344. Sizzle.attr = function( elem, name ) {
  1345. // Set document vars if needed
  1346. // Support: IE 11+, Edge 17 - 18+
  1347. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1348. // two documents; shallow comparisons work.
  1349. // eslint-disable-next-line eqeqeq
  1350. if ( ( elem.ownerDocument || elem ) != document ) {
  1351. setDocument( elem );
  1352. }
  1353. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1354. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1355. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1356. fn( elem, name, !documentIsHTML ) :
  1357. undefined;
  1358. return val !== undefined ?
  1359. val :
  1360. support.attributes || !documentIsHTML ?
  1361. elem.getAttribute( name ) :
  1362. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  1363. val.value :
  1364. null;
  1365. };
  1366. Sizzle.escape = function( sel ) {
  1367. return ( sel + "" ).replace( rcssescape, fcssescape );
  1368. };
  1369. Sizzle.error = function( msg ) {
  1370. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1371. };
  1372. /**
  1373. * Document sorting and removing duplicates
  1374. * @param {ArrayLike} results
  1375. */
  1376. Sizzle.uniqueSort = function( results ) {
  1377. var elem,
  1378. duplicates = [],
  1379. j = 0,
  1380. i = 0;
  1381. // Unless we *know* we can detect duplicates, assume their presence
  1382. hasDuplicate = !support.detectDuplicates;
  1383. sortInput = !support.sortStable && results.slice( 0 );
  1384. results.sort( sortOrder );
  1385. if ( hasDuplicate ) {
  1386. while ( ( elem = results[ i++ ] ) ) {
  1387. if ( elem === results[ i ] ) {
  1388. j = duplicates.push( i );
  1389. }
  1390. }
  1391. while ( j-- ) {
  1392. results.splice( duplicates[ j ], 1 );
  1393. }
  1394. }
  1395. // Clear input after sorting to release objects
  1396. // See https://github.com/jquery/sizzle/pull/225
  1397. sortInput = null;
  1398. return results;
  1399. };
  1400. /**
  1401. * Utility function for retrieving the text value of an array of DOM nodes
  1402. * @param {Array|Element} elem
  1403. */
  1404. getText = Sizzle.getText = function( elem ) {
  1405. var node,
  1406. ret = "",
  1407. i = 0,
  1408. nodeType = elem.nodeType;
  1409. if ( !nodeType ) {
  1410. // If no nodeType, this is expected to be an array
  1411. while ( ( node = elem[ i++ ] ) ) {
  1412. // Do not traverse comment nodes
  1413. ret += getText( node );
  1414. }
  1415. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1416. // Use textContent for elements
  1417. // innerText usage removed for consistency of new lines (jQuery #11153)
  1418. if ( typeof elem.textContent === "string" ) {
  1419. return elem.textContent;
  1420. } else {
  1421. // Traverse its children
  1422. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1423. ret += getText( elem );
  1424. }
  1425. }
  1426. } else if ( nodeType === 3 || nodeType === 4 ) {
  1427. return elem.nodeValue;
  1428. }
  1429. // Do not include comment or processing instruction nodes
  1430. return ret;
  1431. };
  1432. Expr = Sizzle.selectors = {
  1433. // Can be adjusted by the user
  1434. cacheLength: 50,
  1435. createPseudo: markFunction,
  1436. match: matchExpr,
  1437. attrHandle: {},
  1438. find: {},
  1439. relative: {
  1440. ">": { dir: "parentNode", first: true },
  1441. " ": { dir: "parentNode" },
  1442. "+": { dir: "previousSibling", first: true },
  1443. "~": { dir: "previousSibling" }
  1444. },
  1445. preFilter: {
  1446. "ATTR": function( match ) {
  1447. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  1448. // Move the given value to match[3] whether quoted or unquoted
  1449. match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
  1450. match[ 5 ] || "" ).replace( runescape, funescape );
  1451. if ( match[ 2 ] === "~=" ) {
  1452. match[ 3 ] = " " + match[ 3 ] + " ";
  1453. }
  1454. return match.slice( 0, 4 );
  1455. },
  1456. "CHILD": function( match ) {
  1457. /* matches from matchExpr["CHILD"]
  1458. 1 type (only|nth|...)
  1459. 2 what (child|of-type)
  1460. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1461. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1462. 5 sign of xn-component
  1463. 6 x of xn-component
  1464. 7 sign of y-component
  1465. 8 y of y-component
  1466. */
  1467. match[ 1 ] = match[ 1 ].toLowerCase();
  1468. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  1469. // nth-* requires argument
  1470. if ( !match[ 3 ] ) {
  1471. Sizzle.error( match[ 0 ] );
  1472. }
  1473. // numeric x and y parameters for Expr.filter.CHILD
  1474. // remember that false/true cast respectively to 0/1
  1475. match[ 4 ] = +( match[ 4 ] ?
  1476. match[ 5 ] + ( match[ 6 ] || 1 ) :
  1477. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
  1478. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  1479. // other types prohibit arguments
  1480. } else if ( match[ 3 ] ) {
  1481. Sizzle.error( match[ 0 ] );
  1482. }
  1483. return match;
  1484. },
  1485. "PSEUDO": function( match ) {
  1486. var excess,
  1487. unquoted = !match[ 6 ] && match[ 2 ];
  1488. if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
  1489. return null;
  1490. }
  1491. // Accept quoted arguments as-is
  1492. if ( match[ 3 ] ) {
  1493. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  1494. // Strip excess characters from unquoted arguments
  1495. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1496. // Get excess from tokenize (recursively)
  1497. ( excess = tokenize( unquoted, true ) ) &&
  1498. // advance to the next closing parenthesis
  1499. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  1500. // excess is a negative index
  1501. match[ 0 ] = match[ 0 ].slice( 0, excess );
  1502. match[ 2 ] = unquoted.slice( 0, excess );
  1503. }
  1504. // Return only captures needed by the pseudo filter method (type and argument)
  1505. return match.slice( 0, 3 );
  1506. }
  1507. },
  1508. filter: {
  1509. "TAG": function( nodeNameSelector ) {
  1510. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1511. return nodeNameSelector === "*" ?
  1512. function() {
  1513. return true;
  1514. } :
  1515. function( elem ) {
  1516. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1517. };
  1518. },
  1519. "CLASS": function( className ) {
  1520. var pattern = classCache[ className + " " ];
  1521. return pattern ||
  1522. ( pattern = new RegExp( "(^|" + whitespace +
  1523. ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
  1524. className, function( elem ) {
  1525. return pattern.test(
  1526. typeof elem.className === "string" && elem.className ||
  1527. typeof elem.getAttribute !== "undefined" &&
  1528. elem.getAttribute( "class" ) ||
  1529. ""
  1530. );
  1531. } );
  1532. },
  1533. "ATTR": function( name, operator, check ) {
  1534. return function( elem ) {
  1535. var result = Sizzle.attr( elem, name );
  1536. if ( result == null ) {
  1537. return operator === "!=";
  1538. }
  1539. if ( !operator ) {
  1540. return true;
  1541. }
  1542. result += "";
  1543. /* eslint-disable max-len */
  1544. return operator === "=" ? result === check :
  1545. operator === "!=" ? result !== check :
  1546. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1547. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1548. operator === "$=" ? check && result.slice( -check.length ) === check :
  1549. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1550. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1551. false;
  1552. /* eslint-enable max-len */
  1553. };
  1554. },
  1555. "CHILD": function( type, what, _argument, first, last ) {
  1556. var simple = type.slice( 0, 3 ) !== "nth",
  1557. forward = type.slice( -4 ) !== "last",
  1558. ofType = what === "of-type";
  1559. return first === 1 && last === 0 ?
  1560. // Shortcut for :nth-*(n)
  1561. function( elem ) {
  1562. return !!elem.parentNode;
  1563. } :
  1564. function( elem, _context, xml ) {
  1565. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  1566. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1567. parent = elem.parentNode,
  1568. name = ofType && elem.nodeName.toLowerCase(),
  1569. useCache = !xml && !ofType,
  1570. diff = false;
  1571. if ( parent ) {
  1572. // :(first|last|only)-(child|of-type)
  1573. if ( simple ) {
  1574. while ( dir ) {
  1575. node = elem;
  1576. while ( ( node = node[ dir ] ) ) {
  1577. if ( ofType ?
  1578. node.nodeName.toLowerCase() === name :
  1579. node.nodeType === 1 ) {
  1580. return false;
  1581. }
  1582. }
  1583. // Reverse direction for :only-* (if we haven't yet done so)
  1584. start = dir = type === "only" && !start && "nextSibling";
  1585. }
  1586. return true;
  1587. }
  1588. start = [ forward ? parent.firstChild : parent.lastChild ];
  1589. // non-xml :nth-child(...) stores cache data on `parent`
  1590. if ( forward && useCache ) {
  1591. // Seek `elem` from a previously-cached index
  1592. // ...in a gzip-friendly way
  1593. node = parent;
  1594. outerCache = node[ expando ] || ( node[ expando ] = {} );
  1595. // Support: IE <9 only
  1596. // Defend against cloned attroperties (jQuery gh-1709)
  1597. uniqueCache = outerCache[ node.uniqueID ] ||
  1598. ( outerCache[ node.uniqueID ] = {} );
  1599. cache = uniqueCache[ type ] || [];
  1600. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1601. diff = nodeIndex && cache[ 2 ];
  1602. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1603. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1604. // Fallback to seeking `elem` from the start
  1605. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1606. // When found, cache indexes on `parent` and break
  1607. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1608. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  1609. break;
  1610. }
  1611. }
  1612. } else {
  1613. // Use previously-cached element index if available
  1614. if ( useCache ) {
  1615. // ...in a gzip-friendly way
  1616. node = elem;
  1617. outerCache = node[ expando ] || ( node[ expando ] = {} );
  1618. // Support: IE <9 only
  1619. // Defend against cloned attroperties (jQuery gh-1709)
  1620. uniqueCache = outerCache[ node.uniqueID ] ||
  1621. ( outerCache[ node.uniqueID ] = {} );
  1622. cache = uniqueCache[ type ] || [];
  1623. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1624. diff = nodeIndex;
  1625. }
  1626. // xml :nth-child(...)
  1627. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1628. if ( diff === false ) {
  1629. // Use the same loop as above to seek `elem` from the start
  1630. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1631. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1632. if ( ( ofType ?
  1633. node.nodeName.toLowerCase() === name :
  1634. node.nodeType === 1 ) &&
  1635. ++diff ) {
  1636. // Cache the index of each encountered element
  1637. if ( useCache ) {
  1638. outerCache = node[ expando ] ||
  1639. ( node[ expando ] = {} );
  1640. // Support: IE <9 only
  1641. // Defend against cloned attroperties (jQuery gh-1709)
  1642. uniqueCache = outerCache[ node.uniqueID ] ||
  1643. ( outerCache[ node.uniqueID ] = {} );
  1644. uniqueCache[ type ] = [ dirruns, diff ];
  1645. }
  1646. if ( node === elem ) {
  1647. break;
  1648. }
  1649. }
  1650. }
  1651. }
  1652. }
  1653. // Incorporate the offset, then check against cycle size
  1654. diff -= last;
  1655. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1656. }
  1657. };
  1658. },
  1659. "PSEUDO": function( pseudo, argument ) {
  1660. // pseudo-class names are case-insensitive
  1661. // http://www.w3.org/TR/selectors/#pseudo-classes
  1662. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1663. // Remember that setFilters inherits from pseudos
  1664. var args,
  1665. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1666. Sizzle.error( "unsupported pseudo: " + pseudo );
  1667. // The user may use createPseudo to indicate that
  1668. // arguments are needed to create the filter function
  1669. // just as Sizzle does
  1670. if ( fn[ expando ] ) {
  1671. return fn( argument );
  1672. }
  1673. // But maintain support for old signatures
  1674. if ( fn.length > 1 ) {
  1675. args = [ pseudo, pseudo, "", argument ];
  1676. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1677. markFunction( function( seed, matches ) {
  1678. var idx,
  1679. matched = fn( seed, argument ),
  1680. i = matched.length;
  1681. while ( i-- ) {
  1682. idx = indexOf( seed, matched[ i ] );
  1683. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  1684. }
  1685. } ) :
  1686. function( elem ) {
  1687. return fn( elem, 0, args );
  1688. };
  1689. }
  1690. return fn;
  1691. }
  1692. },
  1693. pseudos: {
  1694. // Potentially complex pseudos
  1695. "not": markFunction( function( selector ) {
  1696. // Trim the selector passed to compile
  1697. // to avoid treating leading and trailing
  1698. // spaces as combinators
  1699. var input = [],
  1700. results = [],
  1701. matcher = compile( selector.replace( rtrim, "$1" ) );
  1702. return matcher[ expando ] ?
  1703. markFunction( function( seed, matches, _context, xml ) {
  1704. var elem,
  1705. unmatched = matcher( seed, null, xml, [] ),
  1706. i = seed.length;
  1707. // Match elements unmatched by `matcher`
  1708. while ( i-- ) {
  1709. if ( ( elem = unmatched[ i ] ) ) {
  1710. seed[ i ] = !( matches[ i ] = elem );
  1711. }
  1712. }
  1713. } ) :
  1714. function( elem, _context, xml ) {
  1715. input[ 0 ] = elem;
  1716. matcher( input, null, xml, results );
  1717. // Don't keep the element (issue #299)
  1718. input[ 0 ] = null;
  1719. return !results.pop();
  1720. };
  1721. } ),
  1722. "has": markFunction( function( selector ) {
  1723. return function( elem ) {
  1724. return Sizzle( selector, elem ).length > 0;
  1725. };
  1726. } ),
  1727. "contains": markFunction( function( text ) {
  1728. text = text.replace( runescape, funescape );
  1729. return function( elem ) {
  1730. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  1731. };
  1732. } ),
  1733. // "Whether an element is represented by a :lang() selector
  1734. // is based solely on the element's language value
  1735. // being equal to the identifier C,
  1736. // or beginning with the identifier C immediately followed by "-".
  1737. // The matching of C against the element's language value is performed case-insensitively.
  1738. // The identifier C does not have to be a valid language name."
  1739. // http://www.w3.org/TR/selectors/#lang-pseudo
  1740. "lang": markFunction( function( lang ) {
  1741. // lang value must be a valid identifier
  1742. if ( !ridentifier.test( lang || "" ) ) {
  1743. Sizzle.error( "unsupported lang: " + lang );
  1744. }
  1745. lang = lang.replace( runescape, funescape ).toLowerCase();
  1746. return function( elem ) {
  1747. var elemLang;
  1748. do {
  1749. if ( ( elemLang = documentIsHTML ?
  1750. elem.lang :
  1751. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  1752. elemLang = elemLang.toLowerCase();
  1753. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1754. }
  1755. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  1756. return false;
  1757. };
  1758. } ),
  1759. // Miscellaneous
  1760. "target": function( elem ) {
  1761. var hash = window.location && window.location.hash;
  1762. return hash && hash.slice( 1 ) === elem.id;
  1763. },
  1764. "root": function( elem ) {
  1765. return elem === docElem;
  1766. },
  1767. "focus": function( elem ) {
  1768. return elem === document.activeElement &&
  1769. ( !document.hasFocus || document.hasFocus() ) &&
  1770. !!( elem.type || elem.href || ~elem.tabIndex );
  1771. },
  1772. // Boolean properties
  1773. "enabled": createDisabledPseudo( false ),
  1774. "disabled": createDisabledPseudo( true ),
  1775. "checked": function( elem ) {
  1776. // In CSS3, :checked should return both checked and selected elements
  1777. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1778. var nodeName = elem.nodeName.toLowerCase();
  1779. return ( nodeName === "input" && !!elem.checked ) ||
  1780. ( nodeName === "option" && !!elem.selected );
  1781. },
  1782. "selected": function( elem ) {
  1783. // Accessing this property makes selected-by-default
  1784. // options in Safari work properly
  1785. if ( elem.parentNode ) {
  1786. // eslint-disable-next-line no-unused-expressions
  1787. elem.parentNode.selectedIndex;
  1788. }
  1789. return elem.selected === true;
  1790. },
  1791. // Contents
  1792. "empty": function( elem ) {
  1793. // http://www.w3.org/TR/selectors/#empty-pseudo
  1794. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1795. // but not by others (comment: 8; processing instruction: 7; etc.)
  1796. // nodeType < 6 works because attributes (2) do not appear as children
  1797. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1798. if ( elem.nodeType < 6 ) {
  1799. return false;
  1800. }
  1801. }
  1802. return true;
  1803. },
  1804. "parent": function( elem ) {
  1805. return !Expr.pseudos[ "empty" ]( elem );
  1806. },
  1807. // Element/input types
  1808. "header": function( elem ) {
  1809. return rheader.test( elem.nodeName );
  1810. },
  1811. "input": function( elem ) {
  1812. return rinputs.test( elem.nodeName );
  1813. },
  1814. "button": function( elem ) {
  1815. var name = elem.nodeName.toLowerCase();
  1816. return name === "input" && elem.type === "button" || name === "button";
  1817. },
  1818. "text": function( elem ) {
  1819. var attr;
  1820. return elem.nodeName.toLowerCase() === "input" &&
  1821. elem.type === "text" &&
  1822. // Support: IE<8
  1823. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  1824. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  1825. attr.toLowerCase() === "text" );
  1826. },
  1827. // Position-in-collection
  1828. "first": createPositionalPseudo( function() {
  1829. return [ 0 ];
  1830. } ),
  1831. "last": createPositionalPseudo( function( _matchIndexes, length ) {
  1832. return [ length - 1 ];
  1833. } ),
  1834. "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
  1835. return [ argument < 0 ? argument + length : argument ];
  1836. } ),
  1837. "even": createPositionalPseudo( function( matchIndexes, length ) {
  1838. var i = 0;
  1839. for ( ; i < length; i += 2 ) {
  1840. matchIndexes.push( i );
  1841. }
  1842. return matchIndexes;
  1843. } ),
  1844. "odd": createPositionalPseudo( function( matchIndexes, length ) {
  1845. var i = 1;
  1846. for ( ; i < length; i += 2 ) {
  1847. matchIndexes.push( i );
  1848. }
  1849. return matchIndexes;
  1850. } ),
  1851. "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  1852. var i = argument < 0 ?
  1853. argument + length :
  1854. argument > length ?
  1855. length :
  1856. argument;
  1857. for ( ; --i >= 0; ) {
  1858. matchIndexes.push( i );
  1859. }
  1860. return matchIndexes;
  1861. } ),
  1862. "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  1863. var i = argument < 0 ? argument + length : argument;
  1864. for ( ; ++i < length; ) {
  1865. matchIndexes.push( i );
  1866. }
  1867. return matchIndexes;
  1868. } )
  1869. }
  1870. };
  1871. Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
  1872. // Add button/input type pseudos
  1873. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1874. Expr.pseudos[ i ] = createInputPseudo( i );
  1875. }
  1876. for ( i in { submit: true, reset: true } ) {
  1877. Expr.pseudos[ i ] = createButtonPseudo( i );
  1878. }
  1879. // Easy API for creating new setFilters
  1880. function setFilters() {}
  1881. setFilters.prototype = Expr.filters = Expr.pseudos;
  1882. Expr.setFilters = new setFilters();
  1883. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  1884. var matched, match, tokens, type,
  1885. soFar, groups, preFilters,
  1886. cached = tokenCache[ selector + " " ];
  1887. if ( cached ) {
  1888. return parseOnly ? 0 : cached.slice( 0 );
  1889. }
  1890. soFar = selector;
  1891. groups = [];
  1892. preFilters = Expr.preFilter;
  1893. while ( soFar ) {
  1894. // Comma and first run
  1895. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  1896. if ( match ) {
  1897. // Don't consume trailing commas as valid
  1898. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  1899. }
  1900. groups.push( ( tokens = [] ) );
  1901. }
  1902. matched = false;
  1903. // Combinators
  1904. if ( ( match = rcombinators.exec( soFar ) ) ) {
  1905. matched = match.shift();
  1906. tokens.push( {
  1907. value: matched,
  1908. // Cast descendant combinators to space
  1909. type: match[ 0 ].replace( rtrim, " " )
  1910. } );
  1911. soFar = soFar.slice( matched.length );
  1912. }
  1913. // Filters
  1914. for ( type in Expr.filter ) {
  1915. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  1916. ( match = preFilters[ type ]( match ) ) ) ) {
  1917. matched = match.shift();
  1918. tokens.push( {
  1919. value: matched,
  1920. type: type,
  1921. matches: match
  1922. } );
  1923. soFar = soFar.slice( matched.length );
  1924. }
  1925. }
  1926. if ( !matched ) {
  1927. break;
  1928. }
  1929. }
  1930. // Return the length of the invalid excess
  1931. // if we're just parsing
  1932. // Otherwise, throw an error or return tokens
  1933. return parseOnly ?
  1934. soFar.length :
  1935. soFar ?
  1936. Sizzle.error( selector ) :
  1937. // Cache the tokens
  1938. tokenCache( selector, groups ).slice( 0 );
  1939. };
  1940. function toSelector( tokens ) {
  1941. var i = 0,
  1942. len = tokens.length,
  1943. selector = "";
  1944. for ( ; i < len; i++ ) {
  1945. selector += tokens[ i ].value;
  1946. }
  1947. return selector;
  1948. }
  1949. function addCombinator( matcher, combinator, base ) {
  1950. var dir = combinator.dir,
  1951. skip = combinator.next,
  1952. key = skip || dir,
  1953. checkNonElements = base && key === "parentNode",
  1954. doneName = done++;
  1955. return combinator.first ?
  1956. // Check against closest ancestor/preceding element
  1957. function( elem, context, xml ) {
  1958. while ( ( elem = elem[ dir ] ) ) {
  1959. if ( elem.nodeType === 1 || checkNonElements ) {
  1960. return matcher( elem, context, xml );
  1961. }
  1962. }
  1963. return false;
  1964. } :
  1965. // Check against all ancestor/preceding elements
  1966. function( elem, context, xml ) {
  1967. var oldCache, uniqueCache, outerCache,
  1968. newCache = [ dirruns, doneName ];
  1969. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  1970. if ( xml ) {
  1971. while ( ( elem = elem[ dir ] ) ) {
  1972. if ( elem.nodeType === 1 || checkNonElements ) {
  1973. if ( matcher( elem, context, xml ) ) {
  1974. return true;
  1975. }
  1976. }
  1977. }
  1978. } else {
  1979. while ( ( elem = elem[ dir ] ) ) {
  1980. if ( elem.nodeType === 1 || checkNonElements ) {
  1981. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  1982. // Support: IE <9 only
  1983. // Defend against cloned attroperties (jQuery gh-1709)
  1984. uniqueCache = outerCache[ elem.uniqueID ] ||
  1985. ( outerCache[ elem.uniqueID ] = {} );
  1986. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  1987. elem = elem[ dir ] || elem;
  1988. } else if ( ( oldCache = uniqueCache[ key ] ) &&
  1989. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1990. // Assign to newCache so results back-propagate to previous elements
  1991. return ( newCache[ 2 ] = oldCache[ 2 ] );
  1992. } else {
  1993. // Reuse newcache so results back-propagate to previous elements
  1994. uniqueCache[ key ] = newCache;
  1995. // A match means we're done; a fail means we have to keep checking
  1996. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  1997. return true;
  1998. }
  1999. }
  2000. }
  2001. }
  2002. }
  2003. return false;
  2004. };
  2005. }
  2006. function elementMatcher( matchers ) {
  2007. return matchers.length > 1 ?
  2008. function( elem, context, xml ) {
  2009. var i = matchers.length;
  2010. while ( i-- ) {
  2011. if ( !matchers[ i ]( elem, context, xml ) ) {
  2012. return false;
  2013. }
  2014. }
  2015. return true;
  2016. } :
  2017. matchers[ 0 ];
  2018. }
  2019. function multipleContexts( selector, contexts, results ) {
  2020. var i = 0,
  2021. len = contexts.length;
  2022. for ( ; i < len; i++ ) {
  2023. Sizzle( selector, contexts[ i ], results );
  2024. }
  2025. return results;
  2026. }
  2027. function condense( unmatched, map, filter, context, xml ) {
  2028. var elem,
  2029. newUnmatched = [],
  2030. i = 0,
  2031. len = unmatched.length,
  2032. mapped = map != null;
  2033. for ( ; i < len; i++ ) {
  2034. if ( ( elem = unmatched[ i ] ) ) {
  2035. if ( !filter || filter( elem, context, xml ) ) {
  2036. newUnmatched.push( elem );
  2037. if ( mapped ) {
  2038. map.push( i );
  2039. }
  2040. }
  2041. }
  2042. }
  2043. return newUnmatched;
  2044. }
  2045. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  2046. if ( postFilter && !postFilter[ expando ] ) {
  2047. postFilter = setMatcher( postFilter );
  2048. }
  2049. if ( postFinder && !postFinder[ expando ] ) {
  2050. postFinder = setMatcher( postFinder, postSelector );
  2051. }
  2052. return markFunction( function( seed, results, context, xml ) {
  2053. var temp, i, elem,
  2054. preMap = [],
  2055. postMap = [],
  2056. preexisting = results.length,
  2057. // Get initial elements from seed or context
  2058. elems = seed || multipleContexts(
  2059. selector || "*",
  2060. context.nodeType ? [ context ] : context,
  2061. []
  2062. ),
  2063. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  2064. matcherIn = preFilter && ( seed || !selector ) ?
  2065. condense( elems, preMap, preFilter, context, xml ) :
  2066. elems,
  2067. matcherOut = matcher ?
  2068. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  2069. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  2070. // ...intermediate processing is necessary
  2071. [] :
  2072. // ...otherwise use results directly
  2073. results :
  2074. matcherIn;
  2075. // Find primary matches
  2076. if ( matcher ) {
  2077. matcher( matcherIn, matcherOut, context, xml );
  2078. }
  2079. // Apply postFilter
  2080. if ( postFilter ) {
  2081. temp = condense( matcherOut, postMap );
  2082. postFilter( temp, [], context, xml );
  2083. // Un-match failing elements by moving them back to matcherIn
  2084. i = temp.length;
  2085. while ( i-- ) {
  2086. if ( ( elem = temp[ i ] ) ) {
  2087. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  2088. }
  2089. }
  2090. }
  2091. if ( seed ) {
  2092. if ( postFinder || preFilter ) {
  2093. if ( postFinder ) {
  2094. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  2095. temp = [];
  2096. i = matcherOut.length;
  2097. while ( i-- ) {
  2098. if ( ( elem = matcherOut[ i ] ) ) {
  2099. // Restore matcherIn since elem is not yet a final match
  2100. temp.push( ( matcherIn[ i ] = elem ) );
  2101. }
  2102. }
  2103. postFinder( null, ( matcherOut = [] ), temp, xml );
  2104. }
  2105. // Move matched elements from seed to results to keep them synchronized
  2106. i = matcherOut.length;
  2107. while ( i-- ) {
  2108. if ( ( elem = matcherOut[ i ] ) &&
  2109. ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
  2110. seed[ temp ] = !( results[ temp ] = elem );
  2111. }
  2112. }
  2113. }
  2114. // Add elements to results, through postFinder if defined
  2115. } else {
  2116. matcherOut = condense(
  2117. matcherOut === results ?
  2118. matcherOut.splice( preexisting, matcherOut.length ) :
  2119. matcherOut
  2120. );
  2121. if ( postFinder ) {
  2122. postFinder( null, results, matcherOut, xml );
  2123. } else {
  2124. push.apply( results, matcherOut );
  2125. }
  2126. }
  2127. } );
  2128. }
  2129. function matcherFromTokens( tokens ) {
  2130. var checkContext, matcher, j,
  2131. len = tokens.length,
  2132. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  2133. implicitRelative = leadingRelative || Expr.relative[ " " ],
  2134. i = leadingRelative ? 1 : 0,
  2135. // The foundational matcher ensures that elements are reachable from top-level context(s)
  2136. matchContext = addCombinator( function( elem ) {
  2137. return elem === checkContext;
  2138. }, implicitRelative, true ),
  2139. matchAnyContext = addCombinator( function( elem ) {
  2140. return indexOf( checkContext, elem ) > -1;
  2141. }, implicitRelative, true ),
  2142. matchers = [ function( elem, context, xml ) {
  2143. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  2144. ( checkContext = context ).nodeType ?
  2145. matchContext( elem, context, xml ) :
  2146. matchAnyContext( elem, context, xml ) );
  2147. // Avoid hanging onto element (issue #299)
  2148. checkContext = null;
  2149. return ret;
  2150. } ];
  2151. for ( ; i < len; i++ ) {
  2152. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  2153. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  2154. } else {
  2155. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  2156. // Return special upon seeing a positional matcher
  2157. if ( matcher[ expando ] ) {
  2158. // Find the next relative operator (if any) for proper handling
  2159. j = ++i;
  2160. for ( ; j < len; j++ ) {
  2161. if ( Expr.relative[ tokens[ j ].type ] ) {
  2162. break;
  2163. }
  2164. }
  2165. return setMatcher(
  2166. i > 1 && elementMatcher( matchers ),
  2167. i > 1 && toSelector(
  2168. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  2169. tokens
  2170. .slice( 0, i - 1 )
  2171. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  2172. ).replace( rtrim, "$1" ),
  2173. matcher,
  2174. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2175. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  2176. j < len && toSelector( tokens )
  2177. );
  2178. }
  2179. matchers.push( matcher );
  2180. }
  2181. }
  2182. return elementMatcher( matchers );
  2183. }
  2184. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2185. var bySet = setMatchers.length > 0,
  2186. byElement = elementMatchers.length > 0,
  2187. superMatcher = function( seed, context, xml, results, outermost ) {
  2188. var elem, j, matcher,
  2189. matchedCount = 0,
  2190. i = "0",
  2191. unmatched = seed && [],
  2192. setMatched = [],
  2193. contextBackup = outermostContext,
  2194. // We must always have either seed elements or outermost context
  2195. elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
  2196. // Use integer dirruns iff this is the outermost matcher
  2197. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  2198. len = elems.length;
  2199. if ( outermost ) {
  2200. // Support: IE 11+, Edge 17 - 18+
  2201. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2202. // two documents; shallow comparisons work.
  2203. // eslint-disable-next-line eqeqeq
  2204. outermostContext = context == document || context || outermost;
  2205. }
  2206. // Add elements passing elementMatchers directly to results
  2207. // Support: IE<9, Safari
  2208. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2209. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  2210. if ( byElement && elem ) {
  2211. j = 0;
  2212. // Support: IE 11+, Edge 17 - 18+
  2213. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2214. // two documents; shallow comparisons work.
  2215. // eslint-disable-next-line eqeqeq
  2216. if ( !context && elem.ownerDocument != document ) {
  2217. setDocument( elem );
  2218. xml = !documentIsHTML;
  2219. }
  2220. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  2221. if ( matcher( elem, context || document, xml ) ) {
  2222. results.push( elem );
  2223. break;
  2224. }
  2225. }
  2226. if ( outermost ) {
  2227. dirruns = dirrunsUnique;
  2228. }
  2229. }
  2230. // Track unmatched elements for set filters
  2231. if ( bySet ) {
  2232. // They will have gone through all possible matchers
  2233. if ( ( elem = !matcher && elem ) ) {
  2234. matchedCount--;
  2235. }
  2236. // Lengthen the array for every element, matched or not
  2237. if ( seed ) {
  2238. unmatched.push( elem );
  2239. }
  2240. }
  2241. }
  2242. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2243. // makes the latter nonnegative.
  2244. matchedCount += i;
  2245. // Apply set filters to unmatched elements
  2246. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2247. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2248. // no element matchers and no seed.
  2249. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2250. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2251. // numerically zero.
  2252. if ( bySet && i !== matchedCount ) {
  2253. j = 0;
  2254. while ( ( matcher = setMatchers[ j++ ] ) ) {
  2255. matcher( unmatched, setMatched, context, xml );
  2256. }
  2257. if ( seed ) {
  2258. // Reintegrate element matches to eliminate the need for sorting
  2259. if ( matchedCount > 0 ) {
  2260. while ( i-- ) {
  2261. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  2262. setMatched[ i ] = pop.call( results );
  2263. }
  2264. }
  2265. }
  2266. // Discard index placeholder values to get only actual matches
  2267. setMatched = condense( setMatched );
  2268. }
  2269. // Add matches to results
  2270. push.apply( results, setMatched );
  2271. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2272. if ( outermost && !seed && setMatched.length > 0 &&
  2273. ( matchedCount + setMatchers.length ) > 1 ) {
  2274. Sizzle.uniqueSort( results );
  2275. }
  2276. }
  2277. // Override manipulation of globals by nested matchers
  2278. if ( outermost ) {
  2279. dirruns = dirrunsUnique;
  2280. outermostContext = contextBackup;
  2281. }
  2282. return unmatched;
  2283. };
  2284. return bySet ?
  2285. markFunction( superMatcher ) :
  2286. superMatcher;
  2287. }
  2288. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2289. var i,
  2290. setMatchers = [],
  2291. elementMatchers = [],
  2292. cached = compilerCache[ selector + " " ];
  2293. if ( !cached ) {
  2294. // Generate a function of recursive functions that can be used to check each element
  2295. if ( !match ) {
  2296. match = tokenize( selector );
  2297. }
  2298. i = match.length;
  2299. while ( i-- ) {
  2300. cached = matcherFromTokens( match[ i ] );
  2301. if ( cached[ expando ] ) {
  2302. setMatchers.push( cached );
  2303. } else {
  2304. elementMatchers.push( cached );
  2305. }
  2306. }
  2307. // Cache the compiled function
  2308. cached = compilerCache(
  2309. selector,
  2310. matcherFromGroupMatchers( elementMatchers, setMatchers )
  2311. );
  2312. // Save selector and tokenization
  2313. cached.selector = selector;
  2314. }
  2315. return cached;
  2316. };
  2317. /**
  2318. * A low-level selection function that works with Sizzle's compiled
  2319. * selector functions
  2320. * @param {String|Function} selector A selector or a pre-compiled
  2321. * selector function built with Sizzle.compile
  2322. * @param {Element} context
  2323. * @param {Array} [results]
  2324. * @param {Array} [seed] A set of elements to match against
  2325. */
  2326. select = Sizzle.select = function( selector, context, results, seed ) {
  2327. var i, tokens, token, type, find,
  2328. compiled = typeof selector === "function" && selector,
  2329. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  2330. results = results || [];
  2331. // Try to minimize operations if there is only one selector in the list and no seed
  2332. // (the latter of which guarantees us context)
  2333. if ( match.length === 1 ) {
  2334. // Reduce context if the leading compound selector is an ID
  2335. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  2336. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  2337. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  2338. context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
  2339. .replace( runescape, funescape ), context ) || [] )[ 0 ];
  2340. if ( !context ) {
  2341. return results;
  2342. // Precompiled matchers will still verify ancestry, so step up a level
  2343. } else if ( compiled ) {
  2344. context = context.parentNode;
  2345. }
  2346. selector = selector.slice( tokens.shift().value.length );
  2347. }
  2348. // Fetch a seed set for right-to-left matching
  2349. i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
  2350. while ( i-- ) {
  2351. token = tokens[ i ];
  2352. // Abort if we hit a combinator
  2353. if ( Expr.relative[ ( type = token.type ) ] ) {
  2354. break;
  2355. }
  2356. if ( ( find = Expr.find[ type ] ) ) {
  2357. // Search, expanding context for leading sibling combinators
  2358. if ( ( seed = find(
  2359. token.matches[ 0 ].replace( runescape, funescape ),
  2360. rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
  2361. context
  2362. ) ) ) {
  2363. // If seed is empty or no tokens remain, we can return early
  2364. tokens.splice( i, 1 );
  2365. selector = seed.length && toSelector( tokens );
  2366. if ( !selector ) {
  2367. push.apply( results, seed );
  2368. return results;
  2369. }
  2370. break;
  2371. }
  2372. }
  2373. }
  2374. }
  2375. // Compile and execute a filtering function if one is not provided
  2376. // Provide `match` to avoid retokenization if we modified the selector above
  2377. ( compiled || compile( selector, match ) )(
  2378. seed,
  2379. context,
  2380. !documentIsHTML,
  2381. results,
  2382. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2383. );
  2384. return results;
  2385. };
  2386. // One-time assignments
  2387. // Sort stability
  2388. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  2389. // Support: Chrome 14-35+
  2390. // Always assume duplicates if they aren't passed to the comparison function
  2391. support.detectDuplicates = !!hasDuplicate;
  2392. // Initialize against the default document
  2393. setDocument();
  2394. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2395. // Detached nodes confoundingly follow *each other*
  2396. support.sortDetached = assert( function( el ) {
  2397. // Should return 1, but returns 4 (following)
  2398. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  2399. } );
  2400. // Support: IE<8
  2401. // Prevent attribute/property "interpolation"
  2402. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2403. if ( !assert( function( el ) {
  2404. el.innerHTML = "<a href='#'></a>";
  2405. return el.firstChild.getAttribute( "href" ) === "#";
  2406. } ) ) {
  2407. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2408. if ( !isXML ) {
  2409. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2410. }
  2411. } );
  2412. }
  2413. // Support: IE<9
  2414. // Use defaultValue in place of getAttribute("value")
  2415. if ( !support.attributes || !assert( function( el ) {
  2416. el.innerHTML = "<input/>";
  2417. el.firstChild.setAttribute( "value", "" );
  2418. return el.firstChild.getAttribute( "value" ) === "";
  2419. } ) ) {
  2420. addHandle( "value", function( elem, _name, isXML ) {
  2421. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2422. return elem.defaultValue;
  2423. }
  2424. } );
  2425. }
  2426. // Support: IE<9
  2427. // Use getAttributeNode to fetch booleans when getAttribute lies
  2428. if ( !assert( function( el ) {
  2429. return el.getAttribute( "disabled" ) == null;
  2430. } ) ) {
  2431. addHandle( booleans, function( elem, name, isXML ) {
  2432. var val;
  2433. if ( !isXML ) {
  2434. return elem[ name ] === true ? name.toLowerCase() :
  2435. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  2436. val.value :
  2437. null;
  2438. }
  2439. } );
  2440. }
  2441. return Sizzle;
  2442. } )( window );
  2443. jQuery.find = Sizzle;
  2444. jQuery.expr = Sizzle.selectors;
  2445. // Deprecated
  2446. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  2447. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  2448. jQuery.text = Sizzle.getText;
  2449. jQuery.isXMLDoc = Sizzle.isXML;
  2450. jQuery.contains = Sizzle.contains;
  2451. jQuery.escapeSelector = Sizzle.escape;
  2452. var dir = function( elem, dir, until ) {
  2453. var matched = [],
  2454. truncate = until !== undefined;
  2455. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  2456. if ( elem.nodeType === 1 ) {
  2457. if ( truncate && jQuery( elem ).is( until ) ) {
  2458. break;
  2459. }
  2460. matched.push( elem );
  2461. }
  2462. }
  2463. return matched;
  2464. };
  2465. var siblings = function( n, elem ) {
  2466. var matched = [];
  2467. for ( ; n; n = n.nextSibling ) {
  2468. if ( n.nodeType === 1 && n !== elem ) {
  2469. matched.push( n );
  2470. }
  2471. }
  2472. return matched;
  2473. };
  2474. var rneedsContext = jQuery.expr.match.needsContext;
  2475. function nodeName( elem, name ) {
  2476. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  2477. };
  2478. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  2479. // Implement the identical functionality for filter and not
  2480. function winnow( elements, qualifier, not ) {
  2481. if ( isFunction( qualifier ) ) {
  2482. return jQuery.grep( elements, function( elem, i ) {
  2483. return !!qualifier.call( elem, i, elem ) !== not;
  2484. } );
  2485. }
  2486. // Single element
  2487. if ( qualifier.nodeType ) {
  2488. return jQuery.grep( elements, function( elem ) {
  2489. return ( elem === qualifier ) !== not;
  2490. } );
  2491. }
  2492. // Arraylike of elements (jQuery, arguments, Array)
  2493. if ( typeof qualifier !== "string" ) {
  2494. return jQuery.grep( elements, function( elem ) {
  2495. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  2496. } );
  2497. }
  2498. // Filtered directly for both simple and complex selectors
  2499. return jQuery.filter( qualifier, elements, not );
  2500. }
  2501. jQuery.filter = function( expr, elems, not ) {
  2502. var elem = elems[ 0 ];
  2503. if ( not ) {
  2504. expr = ":not(" + expr + ")";
  2505. }
  2506. if ( elems.length === 1 && elem.nodeType === 1 ) {
  2507. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  2508. }
  2509. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2510. return elem.nodeType === 1;
  2511. } ) );
  2512. };
  2513. jQuery.fn.extend( {
  2514. find: function( selector ) {
  2515. var i, ret,
  2516. len = this.length,
  2517. self = this;
  2518. if ( typeof selector !== "string" ) {
  2519. return this.pushStack( jQuery( selector ).filter( function() {
  2520. for ( i = 0; i < len; i++ ) {
  2521. if ( jQuery.contains( self[ i ], this ) ) {
  2522. return true;
  2523. }
  2524. }
  2525. } ) );
  2526. }
  2527. ret = this.pushStack( [] );
  2528. for ( i = 0; i < len; i++ ) {
  2529. jQuery.find( selector, self[ i ], ret );
  2530. }
  2531. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  2532. },
  2533. filter: function( selector ) {
  2534. return this.pushStack( winnow( this, selector || [], false ) );
  2535. },
  2536. not: function( selector ) {
  2537. return this.pushStack( winnow( this, selector || [], true ) );
  2538. },
  2539. is: function( selector ) {
  2540. return !!winnow(
  2541. this,
  2542. // If this is a positional/relative selector, check membership in the returned set
  2543. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2544. typeof selector === "string" && rneedsContext.test( selector ) ?
  2545. jQuery( selector ) :
  2546. selector || [],
  2547. false
  2548. ).length;
  2549. }
  2550. } );
  2551. // Initialize a jQuery object
  2552. // A central reference to the root jQuery(document)
  2553. var rootjQuery,
  2554. // A simple way to check for HTML strings
  2555. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  2556. // Strict HTML recognition (#11290: must start with <)
  2557. // Shortcut simple #id case for speed
  2558. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  2559. init = jQuery.fn.init = function( selector, context, root ) {
  2560. var match, elem;
  2561. // HANDLE: $(""), $(null), $(undefined), $(false)
  2562. if ( !selector ) {
  2563. return this;
  2564. }
  2565. // Method init() accepts an alternate rootjQuery
  2566. // so migrate can support jQuery.sub (gh-2101)
  2567. root = root || rootjQuery;
  2568. // Handle HTML strings
  2569. if ( typeof selector === "string" ) {
  2570. if ( selector[ 0 ] === "<" &&
  2571. selector[ selector.length - 1 ] === ">" &&
  2572. selector.length >= 3 ) {
  2573. // Assume that strings that start and end with <> are HTML and skip the regex check
  2574. match = [ null, selector, null ];
  2575. } else {
  2576. match = rquickExpr.exec( selector );
  2577. }
  2578. // Match html or make sure no context is specified for #id
  2579. if ( match && ( match[ 1 ] || !context ) ) {
  2580. // HANDLE: $(html) -> $(array)
  2581. if ( match[ 1 ] ) {
  2582. context = context instanceof jQuery ? context[ 0 ] : context;
  2583. // Option to run scripts is true for back-compat
  2584. // Intentionally let the error be thrown if parseHTML is not present
  2585. jQuery.merge( this, jQuery.parseHTML(
  2586. match[ 1 ],
  2587. context && context.nodeType ? context.ownerDocument || context : document,
  2588. true
  2589. ) );
  2590. // HANDLE: $(html, props)
  2591. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  2592. for ( match in context ) {
  2593. // Properties of context are called as methods if possible
  2594. if ( isFunction( this[ match ] ) ) {
  2595. this[ match ]( context[ match ] );
  2596. // ...and otherwise set as attributes
  2597. } else {
  2598. this.attr( match, context[ match ] );
  2599. }
  2600. }
  2601. }
  2602. return this;
  2603. // HANDLE: $(#id)
  2604. } else {
  2605. elem = document.getElementById( match[ 2 ] );
  2606. if ( elem ) {
  2607. // Inject the element directly into the jQuery object
  2608. this[ 0 ] = elem;
  2609. this.length = 1;
  2610. }
  2611. return this;
  2612. }
  2613. // HANDLE: $(expr, $(...))
  2614. } else if ( !context || context.jquery ) {
  2615. return ( context || root ).find( selector );
  2616. // HANDLE: $(expr, context)
  2617. // (which is just equivalent to: $(context).find(expr)
  2618. } else {
  2619. return this.constructor( context ).find( selector );
  2620. }
  2621. // HANDLE: $(DOMElement)
  2622. } else if ( selector.nodeType ) {
  2623. this[ 0 ] = selector;
  2624. this.length = 1;
  2625. return this;
  2626. // HANDLE: $(function)
  2627. // Shortcut for document ready
  2628. } else if ( isFunction( selector ) ) {
  2629. return root.ready !== undefined ?
  2630. root.ready( selector ) :
  2631. // Execute immediately if ready is not present
  2632. selector( jQuery );
  2633. }
  2634. return jQuery.makeArray( selector, this );
  2635. };
  2636. // Give the init function the jQuery prototype for later instantiation
  2637. init.prototype = jQuery.fn;
  2638. // Initialize central reference
  2639. rootjQuery = jQuery( document );
  2640. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2641. // Methods guaranteed to produce a unique set when starting from a unique set
  2642. guaranteedUnique = {
  2643. children: true,
  2644. contents: true,
  2645. next: true,
  2646. prev: true
  2647. };
  2648. jQuery.fn.extend( {
  2649. has: function( target ) {
  2650. var targets = jQuery( target, this ),
  2651. l = targets.length;
  2652. return this.filter( function() {
  2653. var i = 0;
  2654. for ( ; i < l; i++ ) {
  2655. if ( jQuery.contains( this, targets[ i ] ) ) {
  2656. return true;
  2657. }
  2658. }
  2659. } );
  2660. },
  2661. closest: function( selectors, context ) {
  2662. var cur,
  2663. i = 0,
  2664. l = this.length,
  2665. matched = [],
  2666. targets = typeof selectors !== "string" && jQuery( selectors );
  2667. // Positional selectors never match, since there's no _selection_ context
  2668. if ( !rneedsContext.test( selectors ) ) {
  2669. for ( ; i < l; i++ ) {
  2670. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  2671. // Always skip document fragments
  2672. if ( cur.nodeType < 11 && ( targets ?
  2673. targets.index( cur ) > -1 :
  2674. // Don't pass non-elements to Sizzle
  2675. cur.nodeType === 1 &&
  2676. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  2677. matched.push( cur );
  2678. break;
  2679. }
  2680. }
  2681. }
  2682. }
  2683. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  2684. },
  2685. // Determine the position of an element within the set
  2686. index: function( elem ) {
  2687. // No argument, return index in parent
  2688. if ( !elem ) {
  2689. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2690. }
  2691. // Index in selector
  2692. if ( typeof elem === "string" ) {
  2693. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2694. }
  2695. // Locate the position of the desired element
  2696. return indexOf.call( this,
  2697. // If it receives a jQuery object, the first element is used
  2698. elem.jquery ? elem[ 0 ] : elem
  2699. );
  2700. },
  2701. add: function( selector, context ) {
  2702. return this.pushStack(
  2703. jQuery.uniqueSort(
  2704. jQuery.merge( this.get(), jQuery( selector, context ) )
  2705. )
  2706. );
  2707. },
  2708. addBack: function( selector ) {
  2709. return this.add( selector == null ?
  2710. this.prevObject : this.prevObject.filter( selector )
  2711. );
  2712. }
  2713. } );
  2714. function sibling( cur, dir ) {
  2715. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  2716. return cur;
  2717. }
  2718. jQuery.each( {
  2719. parent: function( elem ) {
  2720. var parent = elem.parentNode;
  2721. return parent && parent.nodeType !== 11 ? parent : null;
  2722. },
  2723. parents: function( elem ) {
  2724. return dir( elem, "parentNode" );
  2725. },
  2726. parentsUntil: function( elem, _i, until ) {
  2727. return dir( elem, "parentNode", until );
  2728. },
  2729. next: function( elem ) {
  2730. return sibling( elem, "nextSibling" );
  2731. },
  2732. prev: function( elem ) {
  2733. return sibling( elem, "previousSibling" );
  2734. },
  2735. nextAll: function( elem ) {
  2736. return dir( elem, "nextSibling" );
  2737. },
  2738. prevAll: function( elem ) {
  2739. return dir( elem, "previousSibling" );
  2740. },
  2741. nextUntil: function( elem, _i, until ) {
  2742. return dir( elem, "nextSibling", until );
  2743. },
  2744. prevUntil: function( elem, _i, until ) {
  2745. return dir( elem, "previousSibling", until );
  2746. },
  2747. siblings: function( elem ) {
  2748. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  2749. },
  2750. children: function( elem ) {
  2751. return siblings( elem.firstChild );
  2752. },
  2753. contents: function( elem ) {
  2754. if ( elem.contentDocument != null &&
  2755. // Support: IE 11+
  2756. // <object> elements with no `data` attribute has an object
  2757. // `contentDocument` with a `null` prototype.
  2758. getProto( elem.contentDocument ) ) {
  2759. return elem.contentDocument;
  2760. }
  2761. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  2762. // Treat the template element as a regular one in browsers that
  2763. // don't support it.
  2764. if ( nodeName( elem, "template" ) ) {
  2765. elem = elem.content || elem;
  2766. }
  2767. return jQuery.merge( [], elem.childNodes );
  2768. }
  2769. }, function( name, fn ) {
  2770. jQuery.fn[ name ] = function( until, selector ) {
  2771. var matched = jQuery.map( this, fn, until );
  2772. if ( name.slice( -5 ) !== "Until" ) {
  2773. selector = until;
  2774. }
  2775. if ( selector && typeof selector === "string" ) {
  2776. matched = jQuery.filter( selector, matched );
  2777. }
  2778. if ( this.length > 1 ) {
  2779. // Remove duplicates
  2780. if ( !guaranteedUnique[ name ] ) {
  2781. jQuery.uniqueSort( matched );
  2782. }
  2783. // Reverse order for parents* and prev-derivatives
  2784. if ( rparentsprev.test( name ) ) {
  2785. matched.reverse();
  2786. }
  2787. }
  2788. return this.pushStack( matched );
  2789. };
  2790. } );
  2791. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  2792. // Convert String-formatted options into Object-formatted ones
  2793. function createOptions( options ) {
  2794. var object = {};
  2795. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  2796. object[ flag ] = true;
  2797. } );
  2798. return object;
  2799. }
  2800. /*
  2801. * Create a callback list using the following parameters:
  2802. *
  2803. * options: an optional list of space-separated options that will change how
  2804. * the callback list behaves or a more traditional option object
  2805. *
  2806. * By default a callback list will act like an event callback list and can be
  2807. * "fired" multiple times.
  2808. *
  2809. * Possible options:
  2810. *
  2811. * once: will ensure the callback list can only be fired once (like a Deferred)
  2812. *
  2813. * memory: will keep track of previous values and will call any callback added
  2814. * after the list has been fired right away with the latest "memorized"
  2815. * values (like a Deferred)
  2816. *
  2817. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2818. *
  2819. * stopOnFalse: interrupt callings when a callback returns false
  2820. *
  2821. */
  2822. jQuery.Callbacks = function( options ) {
  2823. // Convert options from String-formatted to Object-formatted if needed
  2824. // (we check in cache first)
  2825. options = typeof options === "string" ?
  2826. createOptions( options ) :
  2827. jQuery.extend( {}, options );
  2828. var // Flag to know if list is currently firing
  2829. firing,
  2830. // Last fire value for non-forgettable lists
  2831. memory,
  2832. // Flag to know if list was already fired
  2833. fired,
  2834. // Flag to prevent firing
  2835. locked,
  2836. // Actual callback list
  2837. list = [],
  2838. // Queue of execution data for repeatable lists
  2839. queue = [],
  2840. // Index of currently firing callback (modified by add/remove as needed)
  2841. firingIndex = -1,
  2842. // Fire callbacks
  2843. fire = function() {
  2844. // Enforce single-firing
  2845. locked = locked || options.once;
  2846. // Execute callbacks for all pending executions,
  2847. // respecting firingIndex overrides and runtime changes
  2848. fired = firing = true;
  2849. for ( ; queue.length; firingIndex = -1 ) {
  2850. memory = queue.shift();
  2851. while ( ++firingIndex < list.length ) {
  2852. // Run callback and check for early termination
  2853. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  2854. options.stopOnFalse ) {
  2855. // Jump to end and forget the data so .add doesn't re-fire
  2856. firingIndex = list.length;
  2857. memory = false;
  2858. }
  2859. }
  2860. }
  2861. // Forget the data if we're done with it
  2862. if ( !options.memory ) {
  2863. memory = false;
  2864. }
  2865. firing = false;
  2866. // Clean up if we're done firing for good
  2867. if ( locked ) {
  2868. // Keep an empty list if we have data for future add calls
  2869. if ( memory ) {
  2870. list = [];
  2871. // Otherwise, this object is spent
  2872. } else {
  2873. list = "";
  2874. }
  2875. }
  2876. },
  2877. // Actual Callbacks object
  2878. self = {
  2879. // Add a callback or a collection of callbacks to the list
  2880. add: function() {
  2881. if ( list ) {
  2882. // If we have memory from a past run, we should fire after adding
  2883. if ( memory && !firing ) {
  2884. firingIndex = list.length - 1;
  2885. queue.push( memory );
  2886. }
  2887. ( function add( args ) {
  2888. jQuery.each( args, function( _, arg ) {
  2889. if ( isFunction( arg ) ) {
  2890. if ( !options.unique || !self.has( arg ) ) {
  2891. list.push( arg );
  2892. }
  2893. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  2894. // Inspect recursively
  2895. add( arg );
  2896. }
  2897. } );
  2898. } )( arguments );
  2899. if ( memory && !firing ) {
  2900. fire();
  2901. }
  2902. }
  2903. return this;
  2904. },
  2905. // Remove a callback from the list
  2906. remove: function() {
  2907. jQuery.each( arguments, function( _, arg ) {
  2908. var index;
  2909. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2910. list.splice( index, 1 );
  2911. // Handle firing indexes
  2912. if ( index <= firingIndex ) {
  2913. firingIndex--;
  2914. }
  2915. }
  2916. } );
  2917. return this;
  2918. },
  2919. // Check if a given callback is in the list.
  2920. // If no argument is given, return whether or not list has callbacks attached.
  2921. has: function( fn ) {
  2922. return fn ?
  2923. jQuery.inArray( fn, list ) > -1 :
  2924. list.length > 0;
  2925. },
  2926. // Remove all callbacks from the list
  2927. empty: function() {
  2928. if ( list ) {
  2929. list = [];
  2930. }
  2931. return this;
  2932. },
  2933. // Disable .fire and .add
  2934. // Abort any current/pending executions
  2935. // Clear all callbacks and values
  2936. disable: function() {
  2937. locked = queue = [];
  2938. list = memory = "";
  2939. return this;
  2940. },
  2941. disabled: function() {
  2942. return !list;
  2943. },
  2944. // Disable .fire
  2945. // Also disable .add unless we have memory (since it would have no effect)
  2946. // Abort any pending executions
  2947. lock: function() {
  2948. locked = queue = [];
  2949. if ( !memory && !firing ) {
  2950. list = memory = "";
  2951. }
  2952. return this;
  2953. },
  2954. locked: function() {
  2955. return !!locked;
  2956. },
  2957. // Call all callbacks with the given context and arguments
  2958. fireWith: function( context, args ) {
  2959. if ( !locked ) {
  2960. args = args || [];
  2961. args = [ context, args.slice ? args.slice() : args ];
  2962. queue.push( args );
  2963. if ( !firing ) {
  2964. fire();
  2965. }
  2966. }
  2967. return this;
  2968. },
  2969. // Call all the callbacks with the given arguments
  2970. fire: function() {
  2971. self.fireWith( this, arguments );
  2972. return this;
  2973. },
  2974. // To know if the callbacks have already been called at least once
  2975. fired: function() {
  2976. return !!fired;
  2977. }
  2978. };
  2979. return self;
  2980. };
  2981. function Identity( v ) {
  2982. return v;
  2983. }
  2984. function Thrower( ex ) {
  2985. throw ex;
  2986. }
  2987. function adoptValue( value, resolve, reject, noValue ) {
  2988. var method;
  2989. try {
  2990. // Check for promise aspect first to privilege synchronous behavior
  2991. if ( value && isFunction( ( method = value.promise ) ) ) {
  2992. method.call( value ).done( resolve ).fail( reject );
  2993. // Other thenables
  2994. } else if ( value && isFunction( ( method = value.then ) ) ) {
  2995. method.call( value, resolve, reject );
  2996. // Other non-thenables
  2997. } else {
  2998. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  2999. // * false: [ value ].slice( 0 ) => resolve( value )
  3000. // * true: [ value ].slice( 1 ) => resolve()
  3001. resolve.apply( undefined, [ value ].slice( noValue ) );
  3002. }
  3003. // For Promises/A+, convert exceptions into rejections
  3004. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  3005. // Deferred#then to conditionally suppress rejection.
  3006. } catch ( value ) {
  3007. // Support: Android 4.0 only
  3008. // Strict mode functions invoked without .call/.apply get global-object context
  3009. reject.apply( undefined, [ value ] );
  3010. }
  3011. }
  3012. jQuery.extend( {
  3013. Deferred: function( func ) {
  3014. var tuples = [
  3015. // action, add listener, callbacks,
  3016. // ... .then handlers, argument index, [final state]
  3017. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  3018. jQuery.Callbacks( "memory" ), 2 ],
  3019. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  3020. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  3021. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  3022. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  3023. ],
  3024. state = "pending",
  3025. promise = {
  3026. state: function() {
  3027. return state;
  3028. },
  3029. always: function() {
  3030. deferred.done( arguments ).fail( arguments );
  3031. return this;
  3032. },
  3033. "catch": function( fn ) {
  3034. return promise.then( null, fn );
  3035. },
  3036. // Keep pipe for back-compat
  3037. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  3038. var fns = arguments;
  3039. return jQuery.Deferred( function( newDefer ) {
  3040. jQuery.each( tuples, function( _i, tuple ) {
  3041. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  3042. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  3043. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  3044. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  3045. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  3046. deferred[ tuple[ 1 ] ]( function() {
  3047. var returned = fn && fn.apply( this, arguments );
  3048. if ( returned && isFunction( returned.promise ) ) {
  3049. returned.promise()
  3050. .progress( newDefer.notify )
  3051. .done( newDefer.resolve )
  3052. .fail( newDefer.reject );
  3053. } else {
  3054. newDefer[ tuple[ 0 ] + "With" ](
  3055. this,
  3056. fn ? [ returned ] : arguments
  3057. );
  3058. }
  3059. } );
  3060. } );
  3061. fns = null;
  3062. } ).promise();
  3063. },
  3064. then: function( onFulfilled, onRejected, onProgress ) {
  3065. var maxDepth = 0;
  3066. function resolve( depth, deferred, handler, special ) {
  3067. return function() {
  3068. var that = this,
  3069. args = arguments,
  3070. mightThrow = function() {
  3071. var returned, then;
  3072. // Support: Promises/A+ section 2.3.3.3.3
  3073. // https://promisesaplus.com/#point-59
  3074. // Ignore double-resolution attempts
  3075. if ( depth < maxDepth ) {
  3076. return;
  3077. }
  3078. returned = handler.apply( that, args );
  3079. // Support: Promises/A+ section 2.3.1
  3080. // https://promisesaplus.com/#point-48
  3081. if ( returned === deferred.promise() ) {
  3082. throw new TypeError( "Thenable self-resolution" );
  3083. }
  3084. // Support: Promises/A+ sections 2.3.3.1, 3.5
  3085. // https://promisesaplus.com/#point-54
  3086. // https://promisesaplus.com/#point-75
  3087. // Retrieve `then` only once
  3088. then = returned &&
  3089. // Support: Promises/A+ section 2.3.4
  3090. // https://promisesaplus.com/#point-64
  3091. // Only check objects and functions for thenability
  3092. ( typeof returned === "object" ||
  3093. typeof returned === "function" ) &&
  3094. returned.then;
  3095. // Handle a returned thenable
  3096. if ( isFunction( then ) ) {
  3097. // Special processors (notify) just wait for resolution
  3098. if ( special ) {
  3099. then.call(
  3100. returned,
  3101. resolve( maxDepth, deferred, Identity, special ),
  3102. resolve( maxDepth, deferred, Thrower, special )
  3103. );
  3104. // Normal processors (resolve) also hook into progress
  3105. } else {
  3106. // ...and disregard older resolution values
  3107. maxDepth++;
  3108. then.call(
  3109. returned,
  3110. resolve( maxDepth, deferred, Identity, special ),
  3111. resolve( maxDepth, deferred, Thrower, special ),
  3112. resolve( maxDepth, deferred, Identity,
  3113. deferred.notifyWith )
  3114. );
  3115. }
  3116. // Handle all other returned values
  3117. } else {
  3118. // Only substitute handlers pass on context
  3119. // and multiple values (non-spec behavior)
  3120. if ( handler !== Identity ) {
  3121. that = undefined;
  3122. args = [ returned ];
  3123. }
  3124. // Process the value(s)
  3125. // Default process is resolve
  3126. ( special || deferred.resolveWith )( that, args );
  3127. }
  3128. },
  3129. // Only normal processors (resolve) catch and reject exceptions
  3130. process = special ?
  3131. mightThrow :
  3132. function() {
  3133. try {
  3134. mightThrow();
  3135. } catch ( e ) {
  3136. if ( jQuery.Deferred.exceptionHook ) {
  3137. jQuery.Deferred.exceptionHook( e,
  3138. process.stackTrace );
  3139. }
  3140. // Support: Promises/A+ section 2.3.3.3.4.1
  3141. // https://promisesaplus.com/#point-61
  3142. // Ignore post-resolution exceptions
  3143. if ( depth + 1 >= maxDepth ) {
  3144. // Only substitute handlers pass on context
  3145. // and multiple values (non-spec behavior)
  3146. if ( handler !== Thrower ) {
  3147. that = undefined;
  3148. args = [ e ];
  3149. }
  3150. deferred.rejectWith( that, args );
  3151. }
  3152. }
  3153. };
  3154. // Support: Promises/A+ section 2.3.3.3.1
  3155. // https://promisesaplus.com/#point-57
  3156. // Re-resolve promises immediately to dodge false rejection from
  3157. // subsequent errors
  3158. if ( depth ) {
  3159. process();
  3160. } else {
  3161. // Call an optional hook to record the stack, in case of exception
  3162. // since it's otherwise lost when execution goes async
  3163. if ( jQuery.Deferred.getStackHook ) {
  3164. process.stackTrace = jQuery.Deferred.getStackHook();
  3165. }
  3166. window.setTimeout( process );
  3167. }
  3168. };
  3169. }
  3170. return jQuery.Deferred( function( newDefer ) {
  3171. // progress_handlers.add( ... )
  3172. tuples[ 0 ][ 3 ].add(
  3173. resolve(
  3174. 0,
  3175. newDefer,
  3176. isFunction( onProgress ) ?
  3177. onProgress :
  3178. Identity,
  3179. newDefer.notifyWith
  3180. )
  3181. );
  3182. // fulfilled_handlers.add( ... )
  3183. tuples[ 1 ][ 3 ].add(
  3184. resolve(
  3185. 0,
  3186. newDefer,
  3187. isFunction( onFulfilled ) ?
  3188. onFulfilled :
  3189. Identity
  3190. )
  3191. );
  3192. // rejected_handlers.add( ... )
  3193. tuples[ 2 ][ 3 ].add(
  3194. resolve(
  3195. 0,
  3196. newDefer,
  3197. isFunction( onRejected ) ?
  3198. onRejected :
  3199. Thrower
  3200. )
  3201. );
  3202. } ).promise();
  3203. },
  3204. // Get a promise for this deferred
  3205. // If obj is provided, the promise aspect is added to the object
  3206. promise: function( obj ) {
  3207. return obj != null ? jQuery.extend( obj, promise ) : promise;
  3208. }
  3209. },
  3210. deferred = {};
  3211. // Add list-specific methods
  3212. jQuery.each( tuples, function( i, tuple ) {
  3213. var list = tuple[ 2 ],
  3214. stateString = tuple[ 5 ];
  3215. // promise.progress = list.add
  3216. // promise.done = list.add
  3217. // promise.fail = list.add
  3218. promise[ tuple[ 1 ] ] = list.add;
  3219. // Handle state
  3220. if ( stateString ) {
  3221. list.add(
  3222. function() {
  3223. // state = "resolved" (i.e., fulfilled)
  3224. // state = "rejected"
  3225. state = stateString;
  3226. },
  3227. // rejected_callbacks.disable
  3228. // fulfilled_callbacks.disable
  3229. tuples[ 3 - i ][ 2 ].disable,
  3230. // rejected_handlers.disable
  3231. // fulfilled_handlers.disable
  3232. tuples[ 3 - i ][ 3 ].disable,
  3233. // progress_callbacks.lock
  3234. tuples[ 0 ][ 2 ].lock,
  3235. // progress_handlers.lock
  3236. tuples[ 0 ][ 3 ].lock
  3237. );
  3238. }
  3239. // progress_handlers.fire
  3240. // fulfilled_handlers.fire
  3241. // rejected_handlers.fire
  3242. list.add( tuple[ 3 ].fire );
  3243. // deferred.notify = function() { deferred.notifyWith(...) }
  3244. // deferred.resolve = function() { deferred.resolveWith(...) }
  3245. // deferred.reject = function() { deferred.rejectWith(...) }
  3246. deferred[ tuple[ 0 ] ] = function() {
  3247. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  3248. return this;
  3249. };
  3250. // deferred.notifyWith = list.fireWith
  3251. // deferred.resolveWith = list.fireWith
  3252. // deferred.rejectWith = list.fireWith
  3253. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  3254. } );
  3255. // Make the deferred a promise
  3256. promise.promise( deferred );
  3257. // Call given func if any
  3258. if ( func ) {
  3259. func.call( deferred, deferred );
  3260. }
  3261. // All done!
  3262. return deferred;
  3263. },
  3264. // Deferred helper
  3265. when: function( singleValue ) {
  3266. var
  3267. // count of uncompleted subordinates
  3268. remaining = arguments.length,
  3269. // count of unprocessed arguments
  3270. i = remaining,
  3271. // subordinate fulfillment data
  3272. resolveContexts = Array( i ),
  3273. resolveValues = slice.call( arguments ),
  3274. // the master Deferred
  3275. master = jQuery.Deferred(),
  3276. // subordinate callback factory
  3277. updateFunc = function( i ) {
  3278. return function( value ) {
  3279. resolveContexts[ i ] = this;
  3280. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  3281. if ( !( --remaining ) ) {
  3282. master.resolveWith( resolveContexts, resolveValues );
  3283. }
  3284. };
  3285. };
  3286. // Single- and empty arguments are adopted like Promise.resolve
  3287. if ( remaining <= 1 ) {
  3288. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
  3289. !remaining );
  3290. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  3291. if ( master.state() === "pending" ||
  3292. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  3293. return master.then();
  3294. }
  3295. }
  3296. // Multiple arguments are aggregated like Promise.all array elements
  3297. while ( i-- ) {
  3298. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  3299. }
  3300. return master.promise();
  3301. }
  3302. } );
  3303. // These usually indicate a programmer mistake during development,
  3304. // warn about them ASAP rather than swallowing them by default.
  3305. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  3306. jQuery.Deferred.exceptionHook = function( error, stack ) {
  3307. // Support: IE 8 - 9 only
  3308. // Console exists when dev tools are open, which can happen at any time
  3309. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  3310. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  3311. }
  3312. };
  3313. jQuery.readyException = function( error ) {
  3314. window.setTimeout( function() {
  3315. throw error;
  3316. } );
  3317. };
  3318. // The deferred used on DOM ready
  3319. var readyList = jQuery.Deferred();
  3320. jQuery.fn.ready = function( fn ) {
  3321. readyList
  3322. .then( fn )
  3323. // Wrap jQuery.readyException in a function so that the lookup
  3324. // happens at the time of error handling instead of callback
  3325. // registration.
  3326. .catch( function( error ) {
  3327. jQuery.readyException( error );
  3328. } );
  3329. return this;
  3330. };
  3331. jQuery.extend( {
  3332. // Is the DOM ready to be used? Set to true once it occurs.
  3333. isReady: false,
  3334. // A counter to track how many items to wait for before
  3335. // the ready event fires. See #6781
  3336. readyWait: 1,
  3337. // Handle when the DOM is ready
  3338. ready: function( wait ) {
  3339. // Abort if there are pending holds or we're already ready
  3340. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  3341. return;
  3342. }
  3343. // Remember that the DOM is ready
  3344. jQuery.isReady = true;
  3345. // If a normal DOM Ready event fired, decrement, and wait if need be
  3346. if ( wait !== true && --jQuery.readyWait > 0 ) {
  3347. return;
  3348. }
  3349. // If there are functions bound, to execute
  3350. readyList.resolveWith( document, [ jQuery ] );
  3351. }
  3352. } );
  3353. jQuery.ready.then = readyList.then;
  3354. // The ready event handler and self cleanup method
  3355. function completed() {
  3356. document.removeEventListener( "DOMContentLoaded", completed );
  3357. window.removeEventListener( "load", completed );
  3358. jQuery.ready();
  3359. }
  3360. // Catch cases where $(document).ready() is called
  3361. // after the browser event has already occurred.
  3362. // Support: IE <=9 - 10 only
  3363. // Older IE sometimes signals "interactive" too soon
  3364. if ( document.readyState === "complete" ||
  3365. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  3366. // Handle it asynchronously to allow scripts the opportunity to delay ready
  3367. window.setTimeout( jQuery.ready );
  3368. } else {
  3369. // Use the handy event callback
  3370. document.addEventListener( "DOMContentLoaded", completed );
  3371. // A fallback to window.onload, that will always work
  3372. window.addEventListener( "load", completed );
  3373. }
  3374. // Multifunctional method to get and set values of a collection
  3375. // The value/s can optionally be executed if it's a function
  3376. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  3377. var i = 0,
  3378. len = elems.length,
  3379. bulk = key == null;
  3380. // Sets many values
  3381. if ( toType( key ) === "object" ) {
  3382. chainable = true;
  3383. for ( i in key ) {
  3384. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  3385. }
  3386. // Sets one value
  3387. } else if ( value !== undefined ) {
  3388. chainable = true;
  3389. if ( !isFunction( value ) ) {
  3390. raw = true;
  3391. }
  3392. if ( bulk ) {
  3393. // Bulk operations run against the entire set
  3394. if ( raw ) {
  3395. fn.call( elems, value );
  3396. fn = null;
  3397. // ...except when executing function values
  3398. } else {
  3399. bulk = fn;
  3400. fn = function( elem, _key, value ) {
  3401. return bulk.call( jQuery( elem ), value );
  3402. };
  3403. }
  3404. }
  3405. if ( fn ) {
  3406. for ( ; i < len; i++ ) {
  3407. fn(
  3408. elems[ i ], key, raw ?
  3409. value :
  3410. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  3411. );
  3412. }
  3413. }
  3414. }
  3415. if ( chainable ) {
  3416. return elems;
  3417. }
  3418. // Gets
  3419. if ( bulk ) {
  3420. return fn.call( elems );
  3421. }
  3422. return len ? fn( elems[ 0 ], key ) : emptyGet;
  3423. };
  3424. // Matches dashed string for camelizing
  3425. var rmsPrefix = /^-ms-/,
  3426. rdashAlpha = /-([a-z])/g;
  3427. // Used by camelCase as callback to replace()
  3428. function fcamelCase( _all, letter ) {
  3429. return letter.toUpperCase();
  3430. }
  3431. // Convert dashed to camelCase; used by the css and data modules
  3432. // Support: IE <=9 - 11, Edge 12 - 15
  3433. // Microsoft forgot to hump their vendor prefix (#9572)
  3434. function camelCase( string ) {
  3435. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  3436. }
  3437. var acceptData = function( owner ) {
  3438. // Accepts only:
  3439. // - Node
  3440. // - Node.ELEMENT_NODE
  3441. // - Node.DOCUMENT_NODE
  3442. // - Object
  3443. // - Any
  3444. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  3445. };
  3446. function Data() {
  3447. this.expando = jQuery.expando + Data.uid++;
  3448. }
  3449. Data.uid = 1;
  3450. Data.prototype = {
  3451. cache: function( owner ) {
  3452. // Check if the owner object already has a cache
  3453. var value = owner[ this.expando ];
  3454. // If not, create one
  3455. if ( !value ) {
  3456. value = {};
  3457. // We can accept data for non-element nodes in modern browsers,
  3458. // but we should not, see #8335.
  3459. // Always return an empty object.
  3460. if ( acceptData( owner ) ) {
  3461. // If it is a node unlikely to be stringify-ed or looped over
  3462. // use plain assignment
  3463. if ( owner.nodeType ) {
  3464. owner[ this.expando ] = value;
  3465. // Otherwise secure it in a non-enumerable property
  3466. // configurable must be true to allow the property to be
  3467. // deleted when data is removed
  3468. } else {
  3469. Object.defineProperty( owner, this.expando, {
  3470. value: value,
  3471. configurable: true
  3472. } );
  3473. }
  3474. }
  3475. }
  3476. return value;
  3477. },
  3478. set: function( owner, data, value ) {
  3479. var prop,
  3480. cache = this.cache( owner );
  3481. // Handle: [ owner, key, value ] args
  3482. // Always use camelCase key (gh-2257)
  3483. if ( typeof data === "string" ) {
  3484. cache[ camelCase( data ) ] = value;
  3485. // Handle: [ owner, { properties } ] args
  3486. } else {
  3487. // Copy the properties one-by-one to the cache object
  3488. for ( prop in data ) {
  3489. cache[ camelCase( prop ) ] = data[ prop ];
  3490. }
  3491. }
  3492. return cache;
  3493. },
  3494. get: function( owner, key ) {
  3495. return key === undefined ?
  3496. this.cache( owner ) :
  3497. // Always use camelCase key (gh-2257)
  3498. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  3499. },
  3500. access: function( owner, key, value ) {
  3501. // In cases where either:
  3502. //
  3503. // 1. No key was specified
  3504. // 2. A string key was specified, but no value provided
  3505. //
  3506. // Take the "read" path and allow the get method to determine
  3507. // which value to return, respectively either:
  3508. //
  3509. // 1. The entire cache object
  3510. // 2. The data stored at the key
  3511. //
  3512. if ( key === undefined ||
  3513. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  3514. return this.get( owner, key );
  3515. }
  3516. // When the key is not a string, or both a key and value
  3517. // are specified, set or extend (existing objects) with either:
  3518. //
  3519. // 1. An object of properties
  3520. // 2. A key and value
  3521. //
  3522. this.set( owner, key, value );
  3523. // Since the "set" path can have two possible entry points
  3524. // return the expected data based on which path was taken[*]
  3525. return value !== undefined ? value : key;
  3526. },
  3527. remove: function( owner, key ) {
  3528. var i,
  3529. cache = owner[ this.expando ];
  3530. if ( cache === undefined ) {
  3531. return;
  3532. }
  3533. if ( key !== undefined ) {
  3534. // Support array or space separated string of keys
  3535. if ( Array.isArray( key ) ) {
  3536. // If key is an array of keys...
  3537. // We always set camelCase keys, so remove that.
  3538. key = key.map( camelCase );
  3539. } else {
  3540. key = camelCase( key );
  3541. // If a key with the spaces exists, use it.
  3542. // Otherwise, create an array by matching non-whitespace
  3543. key = key in cache ?
  3544. [ key ] :
  3545. ( key.match( rnothtmlwhite ) || [] );
  3546. }
  3547. i = key.length;
  3548. while ( i-- ) {
  3549. delete cache[ key[ i ] ];
  3550. }
  3551. }
  3552. // Remove the expando if there's no more data
  3553. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  3554. // Support: Chrome <=35 - 45
  3555. // Webkit & Blink performance suffers when deleting properties
  3556. // from DOM nodes, so set to undefined instead
  3557. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  3558. if ( owner.nodeType ) {
  3559. owner[ this.expando ] = undefined;
  3560. } else {
  3561. delete owner[ this.expando ];
  3562. }
  3563. }
  3564. },
  3565. hasData: function( owner ) {
  3566. var cache = owner[ this.expando ];
  3567. return cache !== undefined && !jQuery.isEmptyObject( cache );
  3568. }
  3569. };
  3570. var dataPriv = new Data();
  3571. var dataUser = new Data();
  3572. // Implementation Summary
  3573. //
  3574. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3575. // 2. Improve the module's maintainability by reducing the storage
  3576. // paths to a single mechanism.
  3577. // 3. Use the same single mechanism to support "private" and "user" data.
  3578. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3579. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3580. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3581. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3582. rmultiDash = /[A-Z]/g;
  3583. function getData( data ) {
  3584. if ( data === "true" ) {
  3585. return true;
  3586. }
  3587. if ( data === "false" ) {
  3588. return false;
  3589. }
  3590. if ( data === "null" ) {
  3591. return null;
  3592. }
  3593. // Only convert to a number if it doesn't change the string
  3594. if ( data === +data + "" ) {
  3595. return +data;
  3596. }
  3597. if ( rbrace.test( data ) ) {
  3598. return JSON.parse( data );
  3599. }
  3600. return data;
  3601. }
  3602. function dataAttr( elem, key, data ) {
  3603. var name;
  3604. // If nothing was found internally, try to fetch any
  3605. // data from the HTML5 data-* attribute
  3606. if ( data === undefined && elem.nodeType === 1 ) {
  3607. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  3608. data = elem.getAttribute( name );
  3609. if ( typeof data === "string" ) {
  3610. try {
  3611. data = getData( data );
  3612. } catch ( e ) {}
  3613. // Make sure we set the data so it isn't changed later
  3614. dataUser.set( elem, key, data );
  3615. } else {
  3616. data = undefined;
  3617. }
  3618. }
  3619. return data;
  3620. }
  3621. jQuery.extend( {
  3622. hasData: function( elem ) {
  3623. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  3624. },
  3625. data: function( elem, name, data ) {
  3626. return dataUser.access( elem, name, data );
  3627. },
  3628. removeData: function( elem, name ) {
  3629. dataUser.remove( elem, name );
  3630. },
  3631. // TODO: Now that all calls to _data and _removeData have been replaced
  3632. // with direct calls to dataPriv methods, these can be deprecated.
  3633. _data: function( elem, name, data ) {
  3634. return dataPriv.access( elem, name, data );
  3635. },
  3636. _removeData: function( elem, name ) {
  3637. dataPriv.remove( elem, name );
  3638. }
  3639. } );
  3640. jQuery.fn.extend( {
  3641. data: function( key, value ) {
  3642. var i, name, data,
  3643. elem = this[ 0 ],
  3644. attrs = elem && elem.attributes;
  3645. // Gets all values
  3646. if ( key === undefined ) {
  3647. if ( this.length ) {
  3648. data = dataUser.get( elem );
  3649. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  3650. i = attrs.length;
  3651. while ( i-- ) {
  3652. // Support: IE 11 only
  3653. // The attrs elements can be null (#14894)
  3654. if ( attrs[ i ] ) {
  3655. name = attrs[ i ].name;
  3656. if ( name.indexOf( "data-" ) === 0 ) {
  3657. name = camelCase( name.slice( 5 ) );
  3658. dataAttr( elem, name, data[ name ] );
  3659. }
  3660. }
  3661. }
  3662. dataPriv.set( elem, "hasDataAttrs", true );
  3663. }
  3664. }
  3665. return data;
  3666. }
  3667. // Sets multiple values
  3668. if ( typeof key === "object" ) {
  3669. return this.each( function() {
  3670. dataUser.set( this, key );
  3671. } );
  3672. }
  3673. return access( this, function( value ) {
  3674. var data;
  3675. // The calling jQuery object (element matches) is not empty
  3676. // (and therefore has an element appears at this[ 0 ]) and the
  3677. // `value` parameter was not undefined. An empty jQuery object
  3678. // will result in `undefined` for elem = this[ 0 ] which will
  3679. // throw an exception if an attempt to read a data cache is made.
  3680. if ( elem && value === undefined ) {
  3681. // Attempt to get data from the cache
  3682. // The key will always be camelCased in Data
  3683. data = dataUser.get( elem, key );
  3684. if ( data !== undefined ) {
  3685. return data;
  3686. }
  3687. // Attempt to "discover" the data in
  3688. // HTML5 custom data-* attrs
  3689. data = dataAttr( elem, key );
  3690. if ( data !== undefined ) {
  3691. return data;
  3692. }
  3693. // We tried really hard, but the data doesn't exist.
  3694. return;
  3695. }
  3696. // Set the data...
  3697. this.each( function() {
  3698. // We always store the camelCased key
  3699. dataUser.set( this, key, value );
  3700. } );
  3701. }, null, value, arguments.length > 1, null, true );
  3702. },
  3703. removeData: function( key ) {
  3704. return this.each( function() {
  3705. dataUser.remove( this, key );
  3706. } );
  3707. }
  3708. } );
  3709. jQuery.extend( {
  3710. queue: function( elem, type, data ) {
  3711. var queue;
  3712. if ( elem ) {
  3713. type = ( type || "fx" ) + "queue";
  3714. queue = dataPriv.get( elem, type );
  3715. // Speed up dequeue by getting out quickly if this is just a lookup
  3716. if ( data ) {
  3717. if ( !queue || Array.isArray( data ) ) {
  3718. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  3719. } else {
  3720. queue.push( data );
  3721. }
  3722. }
  3723. return queue || [];
  3724. }
  3725. },
  3726. dequeue: function( elem, type ) {
  3727. type = type || "fx";
  3728. var queue = jQuery.queue( elem, type ),
  3729. startLength = queue.length,
  3730. fn = queue.shift(),
  3731. hooks = jQuery._queueHooks( elem, type ),
  3732. next = function() {
  3733. jQuery.dequeue( elem, type );
  3734. };
  3735. // If the fx queue is dequeued, always remove the progress sentinel
  3736. if ( fn === "inprogress" ) {
  3737. fn = queue.shift();
  3738. startLength--;
  3739. }
  3740. if ( fn ) {
  3741. // Add a progress sentinel to prevent the fx queue from being
  3742. // automatically dequeued
  3743. if ( type === "fx" ) {
  3744. queue.unshift( "inprogress" );
  3745. }
  3746. // Clear up the last queue stop function
  3747. delete hooks.stop;
  3748. fn.call( elem, next, hooks );
  3749. }
  3750. if ( !startLength && hooks ) {
  3751. hooks.empty.fire();
  3752. }
  3753. },
  3754. // Not public - generate a queueHooks object, or return the current one
  3755. _queueHooks: function( elem, type ) {
  3756. var key = type + "queueHooks";
  3757. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  3758. empty: jQuery.Callbacks( "once memory" ).add( function() {
  3759. dataPriv.remove( elem, [ type + "queue", key ] );
  3760. } )
  3761. } );
  3762. }
  3763. } );
  3764. jQuery.fn.extend( {
  3765. queue: function( type, data ) {
  3766. var setter = 2;
  3767. if ( typeof type !== "string" ) {
  3768. data = type;
  3769. type = "fx";
  3770. setter--;
  3771. }
  3772. if ( arguments.length < setter ) {
  3773. return jQuery.queue( this[ 0 ], type );
  3774. }
  3775. return data === undefined ?
  3776. this :
  3777. this.each( function() {
  3778. var queue = jQuery.queue( this, type, data );
  3779. // Ensure a hooks for this queue
  3780. jQuery._queueHooks( this, type );
  3781. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  3782. jQuery.dequeue( this, type );
  3783. }
  3784. } );
  3785. },
  3786. dequeue: function( type ) {
  3787. return this.each( function() {
  3788. jQuery.dequeue( this, type );
  3789. } );
  3790. },
  3791. clearQueue: function( type ) {
  3792. return this.queue( type || "fx", [] );
  3793. },
  3794. // Get a promise resolved when queues of a certain type
  3795. // are emptied (fx is the type by default)
  3796. promise: function( type, obj ) {
  3797. var tmp,
  3798. count = 1,
  3799. defer = jQuery.Deferred(),
  3800. elements = this,
  3801. i = this.length,
  3802. resolve = function() {
  3803. if ( !( --count ) ) {
  3804. defer.resolveWith( elements, [ elements ] );
  3805. }
  3806. };
  3807. if ( typeof type !== "string" ) {
  3808. obj = type;
  3809. type = undefined;
  3810. }
  3811. type = type || "fx";
  3812. while ( i-- ) {
  3813. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  3814. if ( tmp && tmp.empty ) {
  3815. count++;
  3816. tmp.empty.add( resolve );
  3817. }
  3818. }
  3819. resolve();
  3820. return defer.promise( obj );
  3821. }
  3822. } );
  3823. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  3824. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  3825. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3826. var documentElement = document.documentElement;
  3827. var isAttached = function( elem ) {
  3828. return jQuery.contains( elem.ownerDocument, elem );
  3829. },
  3830. composed = { composed: true };
  3831. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  3832. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  3833. // Support: iOS 10.0-10.2 only
  3834. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  3835. // leading to errors. We need to check for `getRootNode`.
  3836. if ( documentElement.getRootNode ) {
  3837. isAttached = function( elem ) {
  3838. return jQuery.contains( elem.ownerDocument, elem ) ||
  3839. elem.getRootNode( composed ) === elem.ownerDocument;
  3840. };
  3841. }
  3842. var isHiddenWithinTree = function( elem, el ) {
  3843. // isHiddenWithinTree might be called from jQuery#filter function;
  3844. // in that case, element will be second argument
  3845. elem = el || elem;
  3846. // Inline style trumps all
  3847. return elem.style.display === "none" ||
  3848. elem.style.display === "" &&
  3849. // Otherwise, check computed style
  3850. // Support: Firefox <=43 - 45
  3851. // Disconnected elements can have computed display: none, so first confirm that elem is
  3852. // in the document.
  3853. isAttached( elem ) &&
  3854. jQuery.css( elem, "display" ) === "none";
  3855. };
  3856. function adjustCSS( elem, prop, valueParts, tween ) {
  3857. var adjusted, scale,
  3858. maxIterations = 20,
  3859. currentValue = tween ?
  3860. function() {
  3861. return tween.cur();
  3862. } :
  3863. function() {
  3864. return jQuery.css( elem, prop, "" );
  3865. },
  3866. initial = currentValue(),
  3867. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  3868. // Starting value computation is required for potential unit mismatches
  3869. initialInUnit = elem.nodeType &&
  3870. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  3871. rcssNum.exec( jQuery.css( elem, prop ) );
  3872. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  3873. // Support: Firefox <=54
  3874. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  3875. initial = initial / 2;
  3876. // Trust units reported by jQuery.css
  3877. unit = unit || initialInUnit[ 3 ];
  3878. // Iteratively approximate from a nonzero starting point
  3879. initialInUnit = +initial || 1;
  3880. while ( maxIterations-- ) {
  3881. // Evaluate and update our best guess (doubling guesses that zero out).
  3882. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  3883. jQuery.style( elem, prop, initialInUnit + unit );
  3884. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  3885. maxIterations = 0;
  3886. }
  3887. initialInUnit = initialInUnit / scale;
  3888. }
  3889. initialInUnit = initialInUnit * 2;
  3890. jQuery.style( elem, prop, initialInUnit + unit );
  3891. // Make sure we update the tween properties later on
  3892. valueParts = valueParts || [];
  3893. }
  3894. if ( valueParts ) {
  3895. initialInUnit = +initialInUnit || +initial || 0;
  3896. // Apply relative offset (+=/-=) if specified
  3897. adjusted = valueParts[ 1 ] ?
  3898. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  3899. +valueParts[ 2 ];
  3900. if ( tween ) {
  3901. tween.unit = unit;
  3902. tween.start = initialInUnit;
  3903. tween.end = adjusted;
  3904. }
  3905. }
  3906. return adjusted;
  3907. }
  3908. var defaultDisplayMap = {};
  3909. function getDefaultDisplay( elem ) {
  3910. var temp,
  3911. doc = elem.ownerDocument,
  3912. nodeName = elem.nodeName,
  3913. display = defaultDisplayMap[ nodeName ];
  3914. if ( display ) {
  3915. return display;
  3916. }
  3917. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  3918. display = jQuery.css( temp, "display" );
  3919. temp.parentNode.removeChild( temp );
  3920. if ( display === "none" ) {
  3921. display = "block";
  3922. }
  3923. defaultDisplayMap[ nodeName ] = display;
  3924. return display;
  3925. }
  3926. function showHide( elements, show ) {
  3927. var display, elem,
  3928. values = [],
  3929. index = 0,
  3930. length = elements.length;
  3931. // Determine new display value for elements that need to change
  3932. for ( ; index < length; index++ ) {
  3933. elem = elements[ index ];
  3934. if ( !elem.style ) {
  3935. continue;
  3936. }
  3937. display = elem.style.display;
  3938. if ( show ) {
  3939. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  3940. // check is required in this first loop unless we have a nonempty display value (either
  3941. // inline or about-to-be-restored)
  3942. if ( display === "none" ) {
  3943. values[ index ] = dataPriv.get( elem, "display" ) || null;
  3944. if ( !values[ index ] ) {
  3945. elem.style.display = "";
  3946. }
  3947. }
  3948. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  3949. values[ index ] = getDefaultDisplay( elem );
  3950. }
  3951. } else {
  3952. if ( display !== "none" ) {
  3953. values[ index ] = "none";
  3954. // Remember what we're overwriting
  3955. dataPriv.set( elem, "display", display );
  3956. }
  3957. }
  3958. }
  3959. // Set the display of the elements in a second loop to avoid constant reflow
  3960. for ( index = 0; index < length; index++ ) {
  3961. if ( values[ index ] != null ) {
  3962. elements[ index ].style.display = values[ index ];
  3963. }
  3964. }
  3965. return elements;
  3966. }
  3967. jQuery.fn.extend( {
  3968. show: function() {
  3969. return showHide( this, true );
  3970. },
  3971. hide: function() {
  3972. return showHide( this );
  3973. },
  3974. toggle: function( state ) {
  3975. if ( typeof state === "boolean" ) {
  3976. return state ? this.show() : this.hide();
  3977. }
  3978. return this.each( function() {
  3979. if ( isHiddenWithinTree( this ) ) {
  3980. jQuery( this ).show();
  3981. } else {
  3982. jQuery( this ).hide();
  3983. }
  3984. } );
  3985. }
  3986. } );
  3987. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  3988. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  3989. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  3990. ( function() {
  3991. var fragment = document.createDocumentFragment(),
  3992. div = fragment.appendChild( document.createElement( "div" ) ),
  3993. input = document.createElement( "input" );
  3994. // Support: Android 4.0 - 4.3 only
  3995. // Check state lost if the name is set (#11217)
  3996. // Support: Windows Web Apps (WWA)
  3997. // `name` and `type` must use .setAttribute for WWA (#14901)
  3998. input.setAttribute( "type", "radio" );
  3999. input.setAttribute( "checked", "checked" );
  4000. input.setAttribute( "name", "t" );
  4001. div.appendChild( input );
  4002. // Support: Android <=4.1 only
  4003. // Older WebKit doesn't clone checked state correctly in fragments
  4004. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  4005. // Support: IE <=11 only
  4006. // Make sure textarea (and checkbox) defaultValue is properly cloned
  4007. div.innerHTML = "<textarea>x</textarea>";
  4008. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  4009. // Support: IE <=9 only
  4010. // IE <=9 replaces <option> tags with their contents when inserted outside of
  4011. // the select element.
  4012. div.innerHTML = "<option></option>";
  4013. support.option = !!div.lastChild;
  4014. } )();
  4015. // We have to close these tags to support XHTML (#13200)
  4016. var wrapMap = {
  4017. // XHTML parsers do not magically insert elements in the
  4018. // same way that tag soup parsers do. So we cannot shorten
  4019. // this by omitting <tbody> or other required elements.
  4020. thead: [ 1, "<table>", "</table>" ],
  4021. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  4022. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4023. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4024. _default: [ 0, "", "" ]
  4025. };
  4026. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4027. wrapMap.th = wrapMap.td;
  4028. // Support: IE <=9 only
  4029. if ( !support.option ) {
  4030. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  4031. }
  4032. function getAll( context, tag ) {
  4033. // Support: IE <=9 - 11 only
  4034. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  4035. var ret;
  4036. if ( typeof context.getElementsByTagName !== "undefined" ) {
  4037. ret = context.getElementsByTagName( tag || "*" );
  4038. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  4039. ret = context.querySelectorAll( tag || "*" );
  4040. } else {
  4041. ret = [];
  4042. }
  4043. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  4044. return jQuery.merge( [ context ], ret );
  4045. }
  4046. return ret;
  4047. }
  4048. // Mark scripts as having already been evaluated
  4049. function setGlobalEval( elems, refElements ) {
  4050. var i = 0,
  4051. l = elems.length;
  4052. for ( ; i < l; i++ ) {
  4053. dataPriv.set(
  4054. elems[ i ],
  4055. "globalEval",
  4056. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  4057. );
  4058. }
  4059. }
  4060. var rhtml = /<|&#?\w+;/;
  4061. function buildFragment( elems, context, scripts, selection, ignored ) {
  4062. var elem, tmp, tag, wrap, attached, j,
  4063. fragment = context.createDocumentFragment(),
  4064. nodes = [],
  4065. i = 0,
  4066. l = elems.length;
  4067. for ( ; i < l; i++ ) {
  4068. elem = elems[ i ];
  4069. if ( elem || elem === 0 ) {
  4070. // Add nodes directly
  4071. if ( toType( elem ) === "object" ) {
  4072. // Support: Android <=4.0 only, PhantomJS 1 only
  4073. // push.apply(_, arraylike) throws on ancient WebKit
  4074. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4075. // Convert non-html into a text node
  4076. } else if ( !rhtml.test( elem ) ) {
  4077. nodes.push( context.createTextNode( elem ) );
  4078. // Convert html into DOM nodes
  4079. } else {
  4080. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  4081. // Deserialize a standard representation
  4082. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  4083. wrap = wrapMap[ tag ] || wrapMap._default;
  4084. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  4085. // Descend through wrappers to the right content
  4086. j = wrap[ 0 ];
  4087. while ( j-- ) {
  4088. tmp = tmp.lastChild;
  4089. }
  4090. // Support: Android <=4.0 only, PhantomJS 1 only
  4091. // push.apply(_, arraylike) throws on ancient WebKit
  4092. jQuery.merge( nodes, tmp.childNodes );
  4093. // Remember the top-level container
  4094. tmp = fragment.firstChild;
  4095. // Ensure the created nodes are orphaned (#12392)
  4096. tmp.textContent = "";
  4097. }
  4098. }
  4099. }
  4100. // Remove wrapper from fragment
  4101. fragment.textContent = "";
  4102. i = 0;
  4103. while ( ( elem = nodes[ i++ ] ) ) {
  4104. // Skip elements already in the context collection (trac-4087)
  4105. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  4106. if ( ignored ) {
  4107. ignored.push( elem );
  4108. }
  4109. continue;
  4110. }
  4111. attached = isAttached( elem );
  4112. // Append to fragment
  4113. tmp = getAll( fragment.appendChild( elem ), "script" );
  4114. // Preserve script evaluation history
  4115. if ( attached ) {
  4116. setGlobalEval( tmp );
  4117. }
  4118. // Capture executables
  4119. if ( scripts ) {
  4120. j = 0;
  4121. while ( ( elem = tmp[ j++ ] ) ) {
  4122. if ( rscriptType.test( elem.type || "" ) ) {
  4123. scripts.push( elem );
  4124. }
  4125. }
  4126. }
  4127. }
  4128. return fragment;
  4129. }
  4130. var
  4131. rkeyEvent = /^key/,
  4132. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  4133. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  4134. function returnTrue() {
  4135. return true;
  4136. }
  4137. function returnFalse() {
  4138. return false;
  4139. }
  4140. // Support: IE <=9 - 11+
  4141. // focus() and blur() are asynchronous, except when they are no-op.
  4142. // So expect focus to be synchronous when the element is already active,
  4143. // and blur to be synchronous when the element is not already active.
  4144. // (focus and blur are always synchronous in other supported browsers,
  4145. // this just defines when we can count on it).
  4146. function expectSync( elem, type ) {
  4147. return ( elem === safeActiveElement() ) === ( type === "focus" );
  4148. }
  4149. // Support: IE <=9 only
  4150. // Accessing document.activeElement can throw unexpectedly
  4151. // https://bugs.jquery.com/ticket/13393
  4152. function safeActiveElement() {
  4153. try {
  4154. return document.activeElement;
  4155. } catch ( err ) { }
  4156. }
  4157. function on( elem, types, selector, data, fn, one ) {
  4158. var origFn, type;
  4159. // Types can be a map of types/handlers
  4160. if ( typeof types === "object" ) {
  4161. // ( types-Object, selector, data )
  4162. if ( typeof selector !== "string" ) {
  4163. // ( types-Object, data )
  4164. data = data || selector;
  4165. selector = undefined;
  4166. }
  4167. for ( type in types ) {
  4168. on( elem, type, selector, data, types[ type ], one );
  4169. }
  4170. return elem;
  4171. }
  4172. if ( data == null && fn == null ) {
  4173. // ( types, fn )
  4174. fn = selector;
  4175. data = selector = undefined;
  4176. } else if ( fn == null ) {
  4177. if ( typeof selector === "string" ) {
  4178. // ( types, selector, fn )
  4179. fn = data;
  4180. data = undefined;
  4181. } else {
  4182. // ( types, data, fn )
  4183. fn = data;
  4184. data = selector;
  4185. selector = undefined;
  4186. }
  4187. }
  4188. if ( fn === false ) {
  4189. fn = returnFalse;
  4190. } else if ( !fn ) {
  4191. return elem;
  4192. }
  4193. if ( one === 1 ) {
  4194. origFn = fn;
  4195. fn = function( event ) {
  4196. // Can use an empty set, since event contains the info
  4197. jQuery().off( event );
  4198. return origFn.apply( this, arguments );
  4199. };
  4200. // Use same guid so caller can remove using origFn
  4201. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4202. }
  4203. return elem.each( function() {
  4204. jQuery.event.add( this, types, fn, data, selector );
  4205. } );
  4206. }
  4207. /*
  4208. * Helper functions for managing events -- not part of the public interface.
  4209. * Props to Dean Edwards' addEvent library for many of the ideas.
  4210. */
  4211. jQuery.event = {
  4212. global: {},
  4213. add: function( elem, types, handler, data, selector ) {
  4214. var handleObjIn, eventHandle, tmp,
  4215. events, t, handleObj,
  4216. special, handlers, type, namespaces, origType,
  4217. elemData = dataPriv.get( elem );
  4218. // Only attach events to objects that accept data
  4219. if ( !acceptData( elem ) ) {
  4220. return;
  4221. }
  4222. // Caller can pass in an object of custom data in lieu of the handler
  4223. if ( handler.handler ) {
  4224. handleObjIn = handler;
  4225. handler = handleObjIn.handler;
  4226. selector = handleObjIn.selector;
  4227. }
  4228. // Ensure that invalid selectors throw exceptions at attach time
  4229. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  4230. if ( selector ) {
  4231. jQuery.find.matchesSelector( documentElement, selector );
  4232. }
  4233. // Make sure that the handler has a unique ID, used to find/remove it later
  4234. if ( !handler.guid ) {
  4235. handler.guid = jQuery.guid++;
  4236. }
  4237. // Init the element's event structure and main handler, if this is the first
  4238. if ( !( events = elemData.events ) ) {
  4239. events = elemData.events = Object.create( null );
  4240. }
  4241. if ( !( eventHandle = elemData.handle ) ) {
  4242. eventHandle = elemData.handle = function( e ) {
  4243. // Discard the second event of a jQuery.event.trigger() and
  4244. // when an event is called after a page has unloaded
  4245. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  4246. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  4247. };
  4248. }
  4249. // Handle multiple events separated by a space
  4250. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4251. t = types.length;
  4252. while ( t-- ) {
  4253. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4254. type = origType = tmp[ 1 ];
  4255. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4256. // There *must* be a type, no attaching namespace-only handlers
  4257. if ( !type ) {
  4258. continue;
  4259. }
  4260. // If event changes its type, use the special event handlers for the changed type
  4261. special = jQuery.event.special[ type ] || {};
  4262. // If selector defined, determine special event api type, otherwise given type
  4263. type = ( selector ? special.delegateType : special.bindType ) || type;
  4264. // Update special based on newly reset type
  4265. special = jQuery.event.special[ type ] || {};
  4266. // handleObj is passed to all event handlers
  4267. handleObj = jQuery.extend( {
  4268. type: type,
  4269. origType: origType,
  4270. data: data,
  4271. handler: handler,
  4272. guid: handler.guid,
  4273. selector: selector,
  4274. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  4275. namespace: namespaces.join( "." )
  4276. }, handleObjIn );
  4277. // Init the event handler queue if we're the first
  4278. if ( !( handlers = events[ type ] ) ) {
  4279. handlers = events[ type ] = [];
  4280. handlers.delegateCount = 0;
  4281. // Only use addEventListener if the special events handler returns false
  4282. if ( !special.setup ||
  4283. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  4284. if ( elem.addEventListener ) {
  4285. elem.addEventListener( type, eventHandle );
  4286. }
  4287. }
  4288. }
  4289. if ( special.add ) {
  4290. special.add.call( elem, handleObj );
  4291. if ( !handleObj.handler.guid ) {
  4292. handleObj.handler.guid = handler.guid;
  4293. }
  4294. }
  4295. // Add to the element's handler list, delegates in front
  4296. if ( selector ) {
  4297. handlers.splice( handlers.delegateCount++, 0, handleObj );
  4298. } else {
  4299. handlers.push( handleObj );
  4300. }
  4301. // Keep track of which events have ever been used, for event optimization
  4302. jQuery.event.global[ type ] = true;
  4303. }
  4304. },
  4305. // Detach an event or set of events from an element
  4306. remove: function( elem, types, handler, selector, mappedTypes ) {
  4307. var j, origCount, tmp,
  4308. events, t, handleObj,
  4309. special, handlers, type, namespaces, origType,
  4310. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  4311. if ( !elemData || !( events = elemData.events ) ) {
  4312. return;
  4313. }
  4314. // Once for each type.namespace in types; type may be omitted
  4315. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4316. t = types.length;
  4317. while ( t-- ) {
  4318. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4319. type = origType = tmp[ 1 ];
  4320. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4321. // Unbind all events (on this namespace, if provided) for the element
  4322. if ( !type ) {
  4323. for ( type in events ) {
  4324. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  4325. }
  4326. continue;
  4327. }
  4328. special = jQuery.event.special[ type ] || {};
  4329. type = ( selector ? special.delegateType : special.bindType ) || type;
  4330. handlers = events[ type ] || [];
  4331. tmp = tmp[ 2 ] &&
  4332. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  4333. // Remove matching events
  4334. origCount = j = handlers.length;
  4335. while ( j-- ) {
  4336. handleObj = handlers[ j ];
  4337. if ( ( mappedTypes || origType === handleObj.origType ) &&
  4338. ( !handler || handler.guid === handleObj.guid ) &&
  4339. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  4340. ( !selector || selector === handleObj.selector ||
  4341. selector === "**" && handleObj.selector ) ) {
  4342. handlers.splice( j, 1 );
  4343. if ( handleObj.selector ) {
  4344. handlers.delegateCount--;
  4345. }
  4346. if ( special.remove ) {
  4347. special.remove.call( elem, handleObj );
  4348. }
  4349. }
  4350. }
  4351. // Remove generic event handler if we removed something and no more handlers exist
  4352. // (avoids potential for endless recursion during removal of special event handlers)
  4353. if ( origCount && !handlers.length ) {
  4354. if ( !special.teardown ||
  4355. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  4356. jQuery.removeEvent( elem, type, elemData.handle );
  4357. }
  4358. delete events[ type ];
  4359. }
  4360. }
  4361. // Remove data and the expando if it's no longer used
  4362. if ( jQuery.isEmptyObject( events ) ) {
  4363. dataPriv.remove( elem, "handle events" );
  4364. }
  4365. },
  4366. dispatch: function( nativeEvent ) {
  4367. var i, j, ret, matched, handleObj, handlerQueue,
  4368. args = new Array( arguments.length ),
  4369. // Make a writable jQuery.Event from the native event object
  4370. event = jQuery.event.fix( nativeEvent ),
  4371. handlers = (
  4372. dataPriv.get( this, "events" ) || Object.create( null )
  4373. )[ event.type ] || [],
  4374. special = jQuery.event.special[ event.type ] || {};
  4375. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  4376. args[ 0 ] = event;
  4377. for ( i = 1; i < arguments.length; i++ ) {
  4378. args[ i ] = arguments[ i ];
  4379. }
  4380. event.delegateTarget = this;
  4381. // Call the preDispatch hook for the mapped type, and let it bail if desired
  4382. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  4383. return;
  4384. }
  4385. // Determine handlers
  4386. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  4387. // Run delegates first; they may want to stop propagation beneath us
  4388. i = 0;
  4389. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  4390. event.currentTarget = matched.elem;
  4391. j = 0;
  4392. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  4393. !event.isImmediatePropagationStopped() ) {
  4394. // If the event is namespaced, then each handler is only invoked if it is
  4395. // specially universal or its namespaces are a superset of the event's.
  4396. if ( !event.rnamespace || handleObj.namespace === false ||
  4397. event.rnamespace.test( handleObj.namespace ) ) {
  4398. event.handleObj = handleObj;
  4399. event.data = handleObj.data;
  4400. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  4401. handleObj.handler ).apply( matched.elem, args );
  4402. if ( ret !== undefined ) {
  4403. if ( ( event.result = ret ) === false ) {
  4404. event.preventDefault();
  4405. event.stopPropagation();
  4406. }
  4407. }
  4408. }
  4409. }
  4410. }
  4411. // Call the postDispatch hook for the mapped type
  4412. if ( special.postDispatch ) {
  4413. special.postDispatch.call( this, event );
  4414. }
  4415. return event.result;
  4416. },
  4417. handlers: function( event, handlers ) {
  4418. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  4419. handlerQueue = [],
  4420. delegateCount = handlers.delegateCount,
  4421. cur = event.target;
  4422. // Find delegate handlers
  4423. if ( delegateCount &&
  4424. // Support: IE <=9
  4425. // Black-hole SVG <use> instance trees (trac-13180)
  4426. cur.nodeType &&
  4427. // Support: Firefox <=42
  4428. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  4429. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  4430. // Support: IE 11 only
  4431. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  4432. !( event.type === "click" && event.button >= 1 ) ) {
  4433. for ( ; cur !== this; cur = cur.parentNode || this ) {
  4434. // Don't check non-elements (#13208)
  4435. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  4436. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  4437. matchedHandlers = [];
  4438. matchedSelectors = {};
  4439. for ( i = 0; i < delegateCount; i++ ) {
  4440. handleObj = handlers[ i ];
  4441. // Don't conflict with Object.prototype properties (#13203)
  4442. sel = handleObj.selector + " ";
  4443. if ( matchedSelectors[ sel ] === undefined ) {
  4444. matchedSelectors[ sel ] = handleObj.needsContext ?
  4445. jQuery( sel, this ).index( cur ) > -1 :
  4446. jQuery.find( sel, this, null, [ cur ] ).length;
  4447. }
  4448. if ( matchedSelectors[ sel ] ) {
  4449. matchedHandlers.push( handleObj );
  4450. }
  4451. }
  4452. if ( matchedHandlers.length ) {
  4453. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  4454. }
  4455. }
  4456. }
  4457. }
  4458. // Add the remaining (directly-bound) handlers
  4459. cur = this;
  4460. if ( delegateCount < handlers.length ) {
  4461. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  4462. }
  4463. return handlerQueue;
  4464. },
  4465. addProp: function( name, hook ) {
  4466. Object.defineProperty( jQuery.Event.prototype, name, {
  4467. enumerable: true,
  4468. configurable: true,
  4469. get: isFunction( hook ) ?
  4470. function() {
  4471. if ( this.originalEvent ) {
  4472. return hook( this.originalEvent );
  4473. }
  4474. } :
  4475. function() {
  4476. if ( this.originalEvent ) {
  4477. return this.originalEvent[ name ];
  4478. }
  4479. },
  4480. set: function( value ) {
  4481. Object.defineProperty( this, name, {
  4482. enumerable: true,
  4483. configurable: true,
  4484. writable: true,
  4485. value: value
  4486. } );
  4487. }
  4488. } );
  4489. },
  4490. fix: function( originalEvent ) {
  4491. return originalEvent[ jQuery.expando ] ?
  4492. originalEvent :
  4493. new jQuery.Event( originalEvent );
  4494. },
  4495. special: {
  4496. load: {
  4497. // Prevent triggered image.load events from bubbling to window.load
  4498. noBubble: true
  4499. },
  4500. click: {
  4501. // Utilize native event to ensure correct state for checkable inputs
  4502. setup: function( data ) {
  4503. // For mutual compressibility with _default, replace `this` access with a local var.
  4504. // `|| data` is dead code meant only to preserve the variable through minification.
  4505. var el = this || data;
  4506. // Claim the first handler
  4507. if ( rcheckableType.test( el.type ) &&
  4508. el.click && nodeName( el, "input" ) ) {
  4509. // dataPriv.set( el, "click", ... )
  4510. leverageNative( el, "click", returnTrue );
  4511. }
  4512. // Return false to allow normal processing in the caller
  4513. return false;
  4514. },
  4515. trigger: function( data ) {
  4516. // For mutual compressibility with _default, replace `this` access with a local var.
  4517. // `|| data` is dead code meant only to preserve the variable through minification.
  4518. var el = this || data;
  4519. // Force setup before triggering a click
  4520. if ( rcheckableType.test( el.type ) &&
  4521. el.click && nodeName( el, "input" ) ) {
  4522. leverageNative( el, "click" );
  4523. }
  4524. // Return non-false to allow normal event-path propagation
  4525. return true;
  4526. },
  4527. // For cross-browser consistency, suppress native .click() on links
  4528. // Also prevent it if we're currently inside a leveraged native-event stack
  4529. _default: function( event ) {
  4530. var target = event.target;
  4531. return rcheckableType.test( target.type ) &&
  4532. target.click && nodeName( target, "input" ) &&
  4533. dataPriv.get( target, "click" ) ||
  4534. nodeName( target, "a" );
  4535. }
  4536. },
  4537. beforeunload: {
  4538. postDispatch: function( event ) {
  4539. // Support: Firefox 20+
  4540. // Firefox doesn't alert if the returnValue field is not set.
  4541. if ( event.result !== undefined && event.originalEvent ) {
  4542. event.originalEvent.returnValue = event.result;
  4543. }
  4544. }
  4545. }
  4546. }
  4547. };
  4548. // Ensure the presence of an event listener that handles manually-triggered
  4549. // synthetic events by interrupting progress until reinvoked in response to
  4550. // *native* events that it fires directly, ensuring that state changes have
  4551. // already occurred before other listeners are invoked.
  4552. function leverageNative( el, type, expectSync ) {
  4553. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  4554. if ( !expectSync ) {
  4555. if ( dataPriv.get( el, type ) === undefined ) {
  4556. jQuery.event.add( el, type, returnTrue );
  4557. }
  4558. return;
  4559. }
  4560. // Register the controller as a special universal handler for all event namespaces
  4561. dataPriv.set( el, type, false );
  4562. jQuery.event.add( el, type, {
  4563. namespace: false,
  4564. handler: function( event ) {
  4565. var notAsync, result,
  4566. saved = dataPriv.get( this, type );
  4567. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  4568. // Interrupt processing of the outer synthetic .trigger()ed event
  4569. // Saved data should be false in such cases, but might be a leftover capture object
  4570. // from an async native handler (gh-4350)
  4571. if ( !saved.length ) {
  4572. // Store arguments for use when handling the inner native event
  4573. // There will always be at least one argument (an event object), so this array
  4574. // will not be confused with a leftover capture object.
  4575. saved = slice.call( arguments );
  4576. dataPriv.set( this, type, saved );
  4577. // Trigger the native event and capture its result
  4578. // Support: IE <=9 - 11+
  4579. // focus() and blur() are asynchronous
  4580. notAsync = expectSync( this, type );
  4581. this[ type ]();
  4582. result = dataPriv.get( this, type );
  4583. if ( saved !== result || notAsync ) {
  4584. dataPriv.set( this, type, false );
  4585. } else {
  4586. result = {};
  4587. }
  4588. if ( saved !== result ) {
  4589. // Cancel the outer synthetic event
  4590. event.stopImmediatePropagation();
  4591. event.preventDefault();
  4592. return result.value;
  4593. }
  4594. // If this is an inner synthetic event for an event with a bubbling surrogate
  4595. // (focus or blur), assume that the surrogate already propagated from triggering the
  4596. // native event and prevent that from happening again here.
  4597. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  4598. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  4599. // less bad than duplication.
  4600. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  4601. event.stopPropagation();
  4602. }
  4603. // If this is a native event triggered above, everything is now in order
  4604. // Fire an inner synthetic event with the original arguments
  4605. } else if ( saved.length ) {
  4606. // ...and capture the result
  4607. dataPriv.set( this, type, {
  4608. value: jQuery.event.trigger(
  4609. // Support: IE <=9 - 11+
  4610. // Extend with the prototype to reset the above stopImmediatePropagation()
  4611. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  4612. saved.slice( 1 ),
  4613. this
  4614. )
  4615. } );
  4616. // Abort handling of the native event
  4617. event.stopImmediatePropagation();
  4618. }
  4619. }
  4620. } );
  4621. }
  4622. jQuery.removeEvent = function( elem, type, handle ) {
  4623. // This "if" is needed for plain objects
  4624. if ( elem.removeEventListener ) {
  4625. elem.removeEventListener( type, handle );
  4626. }
  4627. };
  4628. jQuery.Event = function( src, props ) {
  4629. // Allow instantiation without the 'new' keyword
  4630. if ( !( this instanceof jQuery.Event ) ) {
  4631. return new jQuery.Event( src, props );
  4632. }
  4633. // Event object
  4634. if ( src && src.type ) {
  4635. this.originalEvent = src;
  4636. this.type = src.type;
  4637. // Events bubbling up the document may have been marked as prevented
  4638. // by a handler lower down the tree; reflect the correct value.
  4639. this.isDefaultPrevented = src.defaultPrevented ||
  4640. src.defaultPrevented === undefined &&
  4641. // Support: Android <=2.3 only
  4642. src.returnValue === false ?
  4643. returnTrue :
  4644. returnFalse;
  4645. // Create target properties
  4646. // Support: Safari <=6 - 7 only
  4647. // Target should not be a text node (#504, #13143)
  4648. this.target = ( src.target && src.target.nodeType === 3 ) ?
  4649. src.target.parentNode :
  4650. src.target;
  4651. this.currentTarget = src.currentTarget;
  4652. this.relatedTarget = src.relatedTarget;
  4653. // Event type
  4654. } else {
  4655. this.type = src;
  4656. }
  4657. // Put explicitly provided properties onto the event object
  4658. if ( props ) {
  4659. jQuery.extend( this, props );
  4660. }
  4661. // Create a timestamp if incoming event doesn't have one
  4662. this.timeStamp = src && src.timeStamp || Date.now();
  4663. // Mark it as fixed
  4664. this[ jQuery.expando ] = true;
  4665. };
  4666. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4667. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4668. jQuery.Event.prototype = {
  4669. constructor: jQuery.Event,
  4670. isDefaultPrevented: returnFalse,
  4671. isPropagationStopped: returnFalse,
  4672. isImmediatePropagationStopped: returnFalse,
  4673. isSimulated: false,
  4674. preventDefault: function() {
  4675. var e = this.originalEvent;
  4676. this.isDefaultPrevented = returnTrue;
  4677. if ( e && !this.isSimulated ) {
  4678. e.preventDefault();
  4679. }
  4680. },
  4681. stopPropagation: function() {
  4682. var e = this.originalEvent;
  4683. this.isPropagationStopped = returnTrue;
  4684. if ( e && !this.isSimulated ) {
  4685. e.stopPropagation();
  4686. }
  4687. },
  4688. stopImmediatePropagation: function() {
  4689. var e = this.originalEvent;
  4690. this.isImmediatePropagationStopped = returnTrue;
  4691. if ( e && !this.isSimulated ) {
  4692. e.stopImmediatePropagation();
  4693. }
  4694. this.stopPropagation();
  4695. }
  4696. };
  4697. // Includes all common event props including KeyEvent and MouseEvent specific props
  4698. jQuery.each( {
  4699. altKey: true,
  4700. bubbles: true,
  4701. cancelable: true,
  4702. changedTouches: true,
  4703. ctrlKey: true,
  4704. detail: true,
  4705. eventPhase: true,
  4706. metaKey: true,
  4707. pageX: true,
  4708. pageY: true,
  4709. shiftKey: true,
  4710. view: true,
  4711. "char": true,
  4712. code: true,
  4713. charCode: true,
  4714. key: true,
  4715. keyCode: true,
  4716. button: true,
  4717. buttons: true,
  4718. clientX: true,
  4719. clientY: true,
  4720. offsetX: true,
  4721. offsetY: true,
  4722. pointerId: true,
  4723. pointerType: true,
  4724. screenX: true,
  4725. screenY: true,
  4726. targetTouches: true,
  4727. toElement: true,
  4728. touches: true,
  4729. which: function( event ) {
  4730. var button = event.button;
  4731. // Add which for key events
  4732. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  4733. return event.charCode != null ? event.charCode : event.keyCode;
  4734. }
  4735. // Add which for click: 1 === left; 2 === middle; 3 === right
  4736. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  4737. if ( button & 1 ) {
  4738. return 1;
  4739. }
  4740. if ( button & 2 ) {
  4741. return 3;
  4742. }
  4743. if ( button & 4 ) {
  4744. return 2;
  4745. }
  4746. return 0;
  4747. }
  4748. return event.which;
  4749. }
  4750. }, jQuery.event.addProp );
  4751. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  4752. jQuery.event.special[ type ] = {
  4753. // Utilize native event if possible so blur/focus sequence is correct
  4754. setup: function() {
  4755. // Claim the first handler
  4756. // dataPriv.set( this, "focus", ... )
  4757. // dataPriv.set( this, "blur", ... )
  4758. leverageNative( this, type, expectSync );
  4759. // Return false to allow normal processing in the caller
  4760. return false;
  4761. },
  4762. trigger: function() {
  4763. // Force setup before trigger
  4764. leverageNative( this, type );
  4765. // Return non-false to allow normal event-path propagation
  4766. return true;
  4767. },
  4768. delegateType: delegateType
  4769. };
  4770. } );
  4771. // Create mouseenter/leave events using mouseover/out and event-time checks
  4772. // so that event delegation works in jQuery.
  4773. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  4774. //
  4775. // Support: Safari 7 only
  4776. // Safari sends mouseenter too often; see:
  4777. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  4778. // for the description of the bug (it existed in older Chrome versions as well).
  4779. jQuery.each( {
  4780. mouseenter: "mouseover",
  4781. mouseleave: "mouseout",
  4782. pointerenter: "pointerover",
  4783. pointerleave: "pointerout"
  4784. }, function( orig, fix ) {
  4785. jQuery.event.special[ orig ] = {
  4786. delegateType: fix,
  4787. bindType: fix,
  4788. handle: function( event ) {
  4789. var ret,
  4790. target = this,
  4791. related = event.relatedTarget,
  4792. handleObj = event.handleObj;
  4793. // For mouseenter/leave call the handler if related is outside the target.
  4794. // NB: No relatedTarget if the mouse left/entered the browser window
  4795. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  4796. event.type = handleObj.origType;
  4797. ret = handleObj.handler.apply( this, arguments );
  4798. event.type = fix;
  4799. }
  4800. return ret;
  4801. }
  4802. };
  4803. } );
  4804. jQuery.fn.extend( {
  4805. on: function( types, selector, data, fn ) {
  4806. return on( this, types, selector, data, fn );
  4807. },
  4808. one: function( types, selector, data, fn ) {
  4809. return on( this, types, selector, data, fn, 1 );
  4810. },
  4811. off: function( types, selector, fn ) {
  4812. var handleObj, type;
  4813. if ( types && types.preventDefault && types.handleObj ) {
  4814. // ( event ) dispatched jQuery.Event
  4815. handleObj = types.handleObj;
  4816. jQuery( types.delegateTarget ).off(
  4817. handleObj.namespace ?
  4818. handleObj.origType + "." + handleObj.namespace :
  4819. handleObj.origType,
  4820. handleObj.selector,
  4821. handleObj.handler
  4822. );
  4823. return this;
  4824. }
  4825. if ( typeof types === "object" ) {
  4826. // ( types-object [, selector] )
  4827. for ( type in types ) {
  4828. this.off( type, selector, types[ type ] );
  4829. }
  4830. return this;
  4831. }
  4832. if ( selector === false || typeof selector === "function" ) {
  4833. // ( types [, fn] )
  4834. fn = selector;
  4835. selector = undefined;
  4836. }
  4837. if ( fn === false ) {
  4838. fn = returnFalse;
  4839. }
  4840. return this.each( function() {
  4841. jQuery.event.remove( this, types, fn, selector );
  4842. } );
  4843. }
  4844. } );
  4845. var
  4846. // Support: IE <=10 - 11, Edge 12 - 13 only
  4847. // In IE/Edge using regex groups here causes severe slowdowns.
  4848. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  4849. rnoInnerhtml = /<script|<style|<link/i,
  4850. // checked="checked" or checked
  4851. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4852. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  4853. // Prefer a tbody over its parent table for containing new rows
  4854. function manipulationTarget( elem, content ) {
  4855. if ( nodeName( elem, "table" ) &&
  4856. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  4857. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  4858. }
  4859. return elem;
  4860. }
  4861. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4862. function disableScript( elem ) {
  4863. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  4864. return elem;
  4865. }
  4866. function restoreScript( elem ) {
  4867. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  4868. elem.type = elem.type.slice( 5 );
  4869. } else {
  4870. elem.removeAttribute( "type" );
  4871. }
  4872. return elem;
  4873. }
  4874. function cloneCopyEvent( src, dest ) {
  4875. var i, l, type, pdataOld, udataOld, udataCur, events;
  4876. if ( dest.nodeType !== 1 ) {
  4877. return;
  4878. }
  4879. // 1. Copy private data: events, handlers, etc.
  4880. if ( dataPriv.hasData( src ) ) {
  4881. pdataOld = dataPriv.get( src );
  4882. events = pdataOld.events;
  4883. if ( events ) {
  4884. dataPriv.remove( dest, "handle events" );
  4885. for ( type in events ) {
  4886. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4887. jQuery.event.add( dest, type, events[ type ][ i ] );
  4888. }
  4889. }
  4890. }
  4891. }
  4892. // 2. Copy user data
  4893. if ( dataUser.hasData( src ) ) {
  4894. udataOld = dataUser.access( src );
  4895. udataCur = jQuery.extend( {}, udataOld );
  4896. dataUser.set( dest, udataCur );
  4897. }
  4898. }
  4899. // Fix IE bugs, see support tests
  4900. function fixInput( src, dest ) {
  4901. var nodeName = dest.nodeName.toLowerCase();
  4902. // Fails to persist the checked state of a cloned checkbox or radio button.
  4903. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4904. dest.checked = src.checked;
  4905. // Fails to return the selected option to the default selected state when cloning options
  4906. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4907. dest.defaultValue = src.defaultValue;
  4908. }
  4909. }
  4910. function domManip( collection, args, callback, ignored ) {
  4911. // Flatten any nested arrays
  4912. args = flat( args );
  4913. var fragment, first, scripts, hasScripts, node, doc,
  4914. i = 0,
  4915. l = collection.length,
  4916. iNoClone = l - 1,
  4917. value = args[ 0 ],
  4918. valueIsFunction = isFunction( value );
  4919. // We can't cloneNode fragments that contain checked, in WebKit
  4920. if ( valueIsFunction ||
  4921. ( l > 1 && typeof value === "string" &&
  4922. !support.checkClone && rchecked.test( value ) ) ) {
  4923. return collection.each( function( index ) {
  4924. var self = collection.eq( index );
  4925. if ( valueIsFunction ) {
  4926. args[ 0 ] = value.call( this, index, self.html() );
  4927. }
  4928. domManip( self, args, callback, ignored );
  4929. } );
  4930. }
  4931. if ( l ) {
  4932. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  4933. first = fragment.firstChild;
  4934. if ( fragment.childNodes.length === 1 ) {
  4935. fragment = first;
  4936. }
  4937. // Require either new content or an interest in ignored elements to invoke the callback
  4938. if ( first || ignored ) {
  4939. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4940. hasScripts = scripts.length;
  4941. // Use the original fragment for the last item
  4942. // instead of the first because it can end up
  4943. // being emptied incorrectly in certain situations (#8070).
  4944. for ( ; i < l; i++ ) {
  4945. node = fragment;
  4946. if ( i !== iNoClone ) {
  4947. node = jQuery.clone( node, true, true );
  4948. // Keep references to cloned scripts for later restoration
  4949. if ( hasScripts ) {
  4950. // Support: Android <=4.0 only, PhantomJS 1 only
  4951. // push.apply(_, arraylike) throws on ancient WebKit
  4952. jQuery.merge( scripts, getAll( node, "script" ) );
  4953. }
  4954. }
  4955. callback.call( collection[ i ], node, i );
  4956. }
  4957. if ( hasScripts ) {
  4958. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4959. // Reenable scripts
  4960. jQuery.map( scripts, restoreScript );
  4961. // Evaluate executable scripts on first document insertion
  4962. for ( i = 0; i < hasScripts; i++ ) {
  4963. node = scripts[ i ];
  4964. if ( rscriptType.test( node.type || "" ) &&
  4965. !dataPriv.access( node, "globalEval" ) &&
  4966. jQuery.contains( doc, node ) ) {
  4967. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  4968. // Optional AJAX dependency, but won't run scripts if not present
  4969. if ( jQuery._evalUrl && !node.noModule ) {
  4970. jQuery._evalUrl( node.src, {
  4971. nonce: node.nonce || node.getAttribute( "nonce" )
  4972. }, doc );
  4973. }
  4974. } else {
  4975. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  4976. }
  4977. }
  4978. }
  4979. }
  4980. }
  4981. }
  4982. return collection;
  4983. }
  4984. function remove( elem, selector, keepData ) {
  4985. var node,
  4986. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  4987. i = 0;
  4988. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  4989. if ( !keepData && node.nodeType === 1 ) {
  4990. jQuery.cleanData( getAll( node ) );
  4991. }
  4992. if ( node.parentNode ) {
  4993. if ( keepData && isAttached( node ) ) {
  4994. setGlobalEval( getAll( node, "script" ) );
  4995. }
  4996. node.parentNode.removeChild( node );
  4997. }
  4998. }
  4999. return elem;
  5000. }
  5001. jQuery.extend( {
  5002. htmlPrefilter: function( html ) {
  5003. return html;
  5004. },
  5005. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  5006. var i, l, srcElements, destElements,
  5007. clone = elem.cloneNode( true ),
  5008. inPage = isAttached( elem );
  5009. // Fix IE cloning issues
  5010. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  5011. !jQuery.isXMLDoc( elem ) ) {
  5012. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  5013. destElements = getAll( clone );
  5014. srcElements = getAll( elem );
  5015. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  5016. fixInput( srcElements[ i ], destElements[ i ] );
  5017. }
  5018. }
  5019. // Copy the events from the original to the clone
  5020. if ( dataAndEvents ) {
  5021. if ( deepDataAndEvents ) {
  5022. srcElements = srcElements || getAll( elem );
  5023. destElements = destElements || getAll( clone );
  5024. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  5025. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  5026. }
  5027. } else {
  5028. cloneCopyEvent( elem, clone );
  5029. }
  5030. }
  5031. // Preserve script evaluation history
  5032. destElements = getAll( clone, "script" );
  5033. if ( destElements.length > 0 ) {
  5034. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  5035. }
  5036. // Return the cloned set
  5037. return clone;
  5038. },
  5039. cleanData: function( elems ) {
  5040. var data, elem, type,
  5041. special = jQuery.event.special,
  5042. i = 0;
  5043. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  5044. if ( acceptData( elem ) ) {
  5045. if ( ( data = elem[ dataPriv.expando ] ) ) {
  5046. if ( data.events ) {
  5047. for ( type in data.events ) {
  5048. if ( special[ type ] ) {
  5049. jQuery.event.remove( elem, type );
  5050. // This is a shortcut to avoid jQuery.event.remove's overhead
  5051. } else {
  5052. jQuery.removeEvent( elem, type, data.handle );
  5053. }
  5054. }
  5055. }
  5056. // Support: Chrome <=35 - 45+
  5057. // Assign undefined instead of using delete, see Data#remove
  5058. elem[ dataPriv.expando ] = undefined;
  5059. }
  5060. if ( elem[ dataUser.expando ] ) {
  5061. // Support: Chrome <=35 - 45+
  5062. // Assign undefined instead of using delete, see Data#remove
  5063. elem[ dataUser.expando ] = undefined;
  5064. }
  5065. }
  5066. }
  5067. }
  5068. } );
  5069. jQuery.fn.extend( {
  5070. detach: function( selector ) {
  5071. return remove( this, selector, true );
  5072. },
  5073. remove: function( selector ) {
  5074. return remove( this, selector );
  5075. },
  5076. text: function( value ) {
  5077. return access( this, function( value ) {
  5078. return value === undefined ?
  5079. jQuery.text( this ) :
  5080. this.empty().each( function() {
  5081. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5082. this.textContent = value;
  5083. }
  5084. } );
  5085. }, null, value, arguments.length );
  5086. },
  5087. append: function() {
  5088. return domManip( this, arguments, function( elem ) {
  5089. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5090. var target = manipulationTarget( this, elem );
  5091. target.appendChild( elem );
  5092. }
  5093. } );
  5094. },
  5095. prepend: function() {
  5096. return domManip( this, arguments, function( elem ) {
  5097. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5098. var target = manipulationTarget( this, elem );
  5099. target.insertBefore( elem, target.firstChild );
  5100. }
  5101. } );
  5102. },
  5103. before: function() {
  5104. return domManip( this, arguments, function( elem ) {
  5105. if ( this.parentNode ) {
  5106. this.parentNode.insertBefore( elem, this );
  5107. }
  5108. } );
  5109. },
  5110. after: function() {
  5111. return domManip( this, arguments, function( elem ) {
  5112. if ( this.parentNode ) {
  5113. this.parentNode.insertBefore( elem, this.nextSibling );
  5114. }
  5115. } );
  5116. },
  5117. empty: function() {
  5118. var elem,
  5119. i = 0;
  5120. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  5121. if ( elem.nodeType === 1 ) {
  5122. // Prevent memory leaks
  5123. jQuery.cleanData( getAll( elem, false ) );
  5124. // Remove any remaining nodes
  5125. elem.textContent = "";
  5126. }
  5127. }
  5128. return this;
  5129. },
  5130. clone: function( dataAndEvents, deepDataAndEvents ) {
  5131. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  5132. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  5133. return this.map( function() {
  5134. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  5135. } );
  5136. },
  5137. html: function( value ) {
  5138. return access( this, function( value ) {
  5139. var elem = this[ 0 ] || {},
  5140. i = 0,
  5141. l = this.length;
  5142. if ( value === undefined && elem.nodeType === 1 ) {
  5143. return elem.innerHTML;
  5144. }
  5145. // See if we can take a shortcut and just use innerHTML
  5146. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  5147. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  5148. value = jQuery.htmlPrefilter( value );
  5149. try {
  5150. for ( ; i < l; i++ ) {
  5151. elem = this[ i ] || {};
  5152. // Remove element nodes and prevent memory leaks
  5153. if ( elem.nodeType === 1 ) {
  5154. jQuery.cleanData( getAll( elem, false ) );
  5155. elem.innerHTML = value;
  5156. }
  5157. }
  5158. elem = 0;
  5159. // If using innerHTML throws an exception, use the fallback method
  5160. } catch ( e ) {}
  5161. }
  5162. if ( elem ) {
  5163. this.empty().append( value );
  5164. }
  5165. }, null, value, arguments.length );
  5166. },
  5167. replaceWith: function() {
  5168. var ignored = [];
  5169. // Make the changes, replacing each non-ignored context element with the new content
  5170. return domManip( this, arguments, function( elem ) {
  5171. var parent = this.parentNode;
  5172. if ( jQuery.inArray( this, ignored ) < 0 ) {
  5173. jQuery.cleanData( getAll( this ) );
  5174. if ( parent ) {
  5175. parent.replaceChild( elem, this );
  5176. }
  5177. }
  5178. // Force callback invocation
  5179. }, ignored );
  5180. }
  5181. } );
  5182. jQuery.each( {
  5183. appendTo: "append",
  5184. prependTo: "prepend",
  5185. insertBefore: "before",
  5186. insertAfter: "after",
  5187. replaceAll: "replaceWith"
  5188. }, function( name, original ) {
  5189. jQuery.fn[ name ] = function( selector ) {
  5190. var elems,
  5191. ret = [],
  5192. insert = jQuery( selector ),
  5193. last = insert.length - 1,
  5194. i = 0;
  5195. for ( ; i <= last; i++ ) {
  5196. elems = i === last ? this : this.clone( true );
  5197. jQuery( insert[ i ] )[ original ]( elems );
  5198. // Support: Android <=4.0 only, PhantomJS 1 only
  5199. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  5200. push.apply( ret, elems.get() );
  5201. }
  5202. return this.pushStack( ret );
  5203. };
  5204. } );
  5205. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  5206. var getStyles = function( elem ) {
  5207. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  5208. // IE throws on elements created in popups
  5209. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  5210. var view = elem.ownerDocument.defaultView;
  5211. if ( !view || !view.opener ) {
  5212. view = window;
  5213. }
  5214. return view.getComputedStyle( elem );
  5215. };
  5216. var swap = function( elem, options, callback ) {
  5217. var ret, name,
  5218. old = {};
  5219. // Remember the old values, and insert the new ones
  5220. for ( name in options ) {
  5221. old[ name ] = elem.style[ name ];
  5222. elem.style[ name ] = options[ name ];
  5223. }
  5224. ret = callback.call( elem );
  5225. // Revert the old values
  5226. for ( name in options ) {
  5227. elem.style[ name ] = old[ name ];
  5228. }
  5229. return ret;
  5230. };
  5231. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  5232. ( function() {
  5233. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  5234. // so they're executed at the same time to save the second computation.
  5235. function computeStyleTests() {
  5236. // This is a singleton, we need to execute it only once
  5237. if ( !div ) {
  5238. return;
  5239. }
  5240. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  5241. "margin-top:1px;padding:0;border:0";
  5242. div.style.cssText =
  5243. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  5244. "margin:auto;border:1px;padding:1px;" +
  5245. "width:60%;top:1%";
  5246. documentElement.appendChild( container ).appendChild( div );
  5247. var divStyle = window.getComputedStyle( div );
  5248. pixelPositionVal = divStyle.top !== "1%";
  5249. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  5250. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  5251. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  5252. // Some styles come back with percentage values, even though they shouldn't
  5253. div.style.right = "60%";
  5254. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  5255. // Support: IE 9 - 11 only
  5256. // Detect misreporting of content dimensions for box-sizing:border-box elements
  5257. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  5258. // Support: IE 9 only
  5259. // Detect overflow:scroll screwiness (gh-3699)
  5260. // Support: Chrome <=64
  5261. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  5262. div.style.position = "absolute";
  5263. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  5264. documentElement.removeChild( container );
  5265. // Nullify the div so it wouldn't be stored in the memory and
  5266. // it will also be a sign that checks already performed
  5267. div = null;
  5268. }
  5269. function roundPixelMeasures( measure ) {
  5270. return Math.round( parseFloat( measure ) );
  5271. }
  5272. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  5273. reliableTrDimensionsVal, reliableMarginLeftVal,
  5274. container = document.createElement( "div" ),
  5275. div = document.createElement( "div" );
  5276. // Finish early in limited (non-browser) environments
  5277. if ( !div.style ) {
  5278. return;
  5279. }
  5280. // Support: IE <=9 - 11 only
  5281. // Style of cloned element affects source element cloned (#8908)
  5282. div.style.backgroundClip = "content-box";
  5283. div.cloneNode( true ).style.backgroundClip = "";
  5284. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  5285. jQuery.extend( support, {
  5286. boxSizingReliable: function() {
  5287. computeStyleTests();
  5288. return boxSizingReliableVal;
  5289. },
  5290. pixelBoxStyles: function() {
  5291. computeStyleTests();
  5292. return pixelBoxStylesVal;
  5293. },
  5294. pixelPosition: function() {
  5295. computeStyleTests();
  5296. return pixelPositionVal;
  5297. },
  5298. reliableMarginLeft: function() {
  5299. computeStyleTests();
  5300. return reliableMarginLeftVal;
  5301. },
  5302. scrollboxSize: function() {
  5303. computeStyleTests();
  5304. return scrollboxSizeVal;
  5305. },
  5306. // Support: IE 9 - 11+, Edge 15 - 18+
  5307. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5308. // set in CSS while `offset*` properties report correct values.
  5309. // Behavior in IE 9 is more subtle than in newer versions & it passes
  5310. // some versions of this test; make sure not to make it pass there!
  5311. reliableTrDimensions: function() {
  5312. var table, tr, trChild, trStyle;
  5313. if ( reliableTrDimensionsVal == null ) {
  5314. table = document.createElement( "table" );
  5315. tr = document.createElement( "tr" );
  5316. trChild = document.createElement( "div" );
  5317. table.style.cssText = "position:absolute;left:-11111px";
  5318. tr.style.height = "1px";
  5319. trChild.style.height = "9px";
  5320. documentElement
  5321. .appendChild( table )
  5322. .appendChild( tr )
  5323. .appendChild( trChild );
  5324. trStyle = window.getComputedStyle( tr );
  5325. reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
  5326. documentElement.removeChild( table );
  5327. }
  5328. return reliableTrDimensionsVal;
  5329. }
  5330. } );
  5331. } )();
  5332. function curCSS( elem, name, computed ) {
  5333. var width, minWidth, maxWidth, ret,
  5334. // Support: Firefox 51+
  5335. // Retrieving style before computed somehow
  5336. // fixes an issue with getting wrong values
  5337. // on detached elements
  5338. style = elem.style;
  5339. computed = computed || getStyles( elem );
  5340. // getPropertyValue is needed for:
  5341. // .css('filter') (IE 9 only, #12537)
  5342. // .css('--customProperty) (#3144)
  5343. if ( computed ) {
  5344. ret = computed.getPropertyValue( name ) || computed[ name ];
  5345. if ( ret === "" && !isAttached( elem ) ) {
  5346. ret = jQuery.style( elem, name );
  5347. }
  5348. // A tribute to the "awesome hack by Dean Edwards"
  5349. // Android Browser returns percentage for some values,
  5350. // but width seems to be reliably pixels.
  5351. // This is against the CSSOM draft spec:
  5352. // https://drafts.csswg.org/cssom/#resolved-values
  5353. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  5354. // Remember the original values
  5355. width = style.width;
  5356. minWidth = style.minWidth;
  5357. maxWidth = style.maxWidth;
  5358. // Put in the new values to get a computed value out
  5359. style.minWidth = style.maxWidth = style.width = ret;
  5360. ret = computed.width;
  5361. // Revert the changed values
  5362. style.width = width;
  5363. style.minWidth = minWidth;
  5364. style.maxWidth = maxWidth;
  5365. }
  5366. }
  5367. return ret !== undefined ?
  5368. // Support: IE <=9 - 11 only
  5369. // IE returns zIndex value as an integer.
  5370. ret + "" :
  5371. ret;
  5372. }
  5373. function addGetHookIf( conditionFn, hookFn ) {
  5374. // Define the hook, we'll check on the first run if it's really needed.
  5375. return {
  5376. get: function() {
  5377. if ( conditionFn() ) {
  5378. // Hook not needed (or it's not possible to use it due
  5379. // to missing dependency), remove it.
  5380. delete this.get;
  5381. return;
  5382. }
  5383. // Hook needed; redefine it so that the support test is not executed again.
  5384. return ( this.get = hookFn ).apply( this, arguments );
  5385. }
  5386. };
  5387. }
  5388. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  5389. emptyStyle = document.createElement( "div" ).style,
  5390. vendorProps = {};
  5391. // Return a vendor-prefixed property or undefined
  5392. function vendorPropName( name ) {
  5393. // Check for vendor prefixed names
  5394. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  5395. i = cssPrefixes.length;
  5396. while ( i-- ) {
  5397. name = cssPrefixes[ i ] + capName;
  5398. if ( name in emptyStyle ) {
  5399. return name;
  5400. }
  5401. }
  5402. }
  5403. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  5404. function finalPropName( name ) {
  5405. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  5406. if ( final ) {
  5407. return final;
  5408. }
  5409. if ( name in emptyStyle ) {
  5410. return name;
  5411. }
  5412. return vendorProps[ name ] = vendorPropName( name ) || name;
  5413. }
  5414. var
  5415. // Swappable if display is none or starts with table
  5416. // except "table", "table-cell", or "table-caption"
  5417. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  5418. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  5419. rcustomProp = /^--/,
  5420. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  5421. cssNormalTransform = {
  5422. letterSpacing: "0",
  5423. fontWeight: "400"
  5424. };
  5425. function setPositiveNumber( _elem, value, subtract ) {
  5426. // Any relative (+/-) values have already been
  5427. // normalized at this point
  5428. var matches = rcssNum.exec( value );
  5429. return matches ?
  5430. // Guard against undefined "subtract", e.g., when used as in cssHooks
  5431. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  5432. value;
  5433. }
  5434. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  5435. var i = dimension === "width" ? 1 : 0,
  5436. extra = 0,
  5437. delta = 0;
  5438. // Adjustment may not be necessary
  5439. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  5440. return 0;
  5441. }
  5442. for ( ; i < 4; i += 2 ) {
  5443. // Both box models exclude margin
  5444. if ( box === "margin" ) {
  5445. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  5446. }
  5447. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  5448. if ( !isBorderBox ) {
  5449. // Add padding
  5450. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5451. // For "border" or "margin", add border
  5452. if ( box !== "padding" ) {
  5453. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5454. // But still keep track of it otherwise
  5455. } else {
  5456. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5457. }
  5458. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  5459. // "padding" or "margin"
  5460. } else {
  5461. // For "content", subtract padding
  5462. if ( box === "content" ) {
  5463. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5464. }
  5465. // For "content" or "padding", subtract border
  5466. if ( box !== "margin" ) {
  5467. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5468. }
  5469. }
  5470. }
  5471. // Account for positive content-box scroll gutter when requested by providing computedVal
  5472. if ( !isBorderBox && computedVal >= 0 ) {
  5473. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  5474. // Assuming integer scroll gutter, subtract the rest and round down
  5475. delta += Math.max( 0, Math.ceil(
  5476. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5477. computedVal -
  5478. delta -
  5479. extra -
  5480. 0.5
  5481. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  5482. // Use an explicit zero to avoid NaN (gh-3964)
  5483. ) ) || 0;
  5484. }
  5485. return delta;
  5486. }
  5487. function getWidthOrHeight( elem, dimension, extra ) {
  5488. // Start with computed style
  5489. var styles = getStyles( elem ),
  5490. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  5491. // Fake content-box until we know it's needed to know the true value.
  5492. boxSizingNeeded = !support.boxSizingReliable() || extra,
  5493. isBorderBox = boxSizingNeeded &&
  5494. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5495. valueIsBorderBox = isBorderBox,
  5496. val = curCSS( elem, dimension, styles ),
  5497. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  5498. // Support: Firefox <=54
  5499. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  5500. if ( rnumnonpx.test( val ) ) {
  5501. if ( !extra ) {
  5502. return val;
  5503. }
  5504. val = "auto";
  5505. }
  5506. // Support: IE 9 - 11 only
  5507. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  5508. // In those cases, the computed value can be trusted to be border-box.
  5509. if ( ( !support.boxSizingReliable() && isBorderBox ||
  5510. // Support: IE 10 - 11+, Edge 15 - 18+
  5511. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5512. // set in CSS while `offset*` properties report correct values.
  5513. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  5514. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  5515. // Fall back to offsetWidth/offsetHeight when value is "auto"
  5516. // This happens for inline elements with no explicit setting (gh-3571)
  5517. val === "auto" ||
  5518. // Support: Android <=4.1 - 4.3 only
  5519. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  5520. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  5521. // Make sure the element is visible & connected
  5522. elem.getClientRects().length ) {
  5523. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  5524. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  5525. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  5526. // retrieved value as a content box dimension.
  5527. valueIsBorderBox = offsetProp in elem;
  5528. if ( valueIsBorderBox ) {
  5529. val = elem[ offsetProp ];
  5530. }
  5531. }
  5532. // Normalize "" and auto
  5533. val = parseFloat( val ) || 0;
  5534. // Adjust for the element's box model
  5535. return ( val +
  5536. boxModelAdjustment(
  5537. elem,
  5538. dimension,
  5539. extra || ( isBorderBox ? "border" : "content" ),
  5540. valueIsBorderBox,
  5541. styles,
  5542. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  5543. val
  5544. )
  5545. ) + "px";
  5546. }
  5547. jQuery.extend( {
  5548. // Add in style property hooks for overriding the default
  5549. // behavior of getting and setting a style property
  5550. cssHooks: {
  5551. opacity: {
  5552. get: function( elem, computed ) {
  5553. if ( computed ) {
  5554. // We should always get a number back from opacity
  5555. var ret = curCSS( elem, "opacity" );
  5556. return ret === "" ? "1" : ret;
  5557. }
  5558. }
  5559. }
  5560. },
  5561. // Don't automatically add "px" to these possibly-unitless properties
  5562. cssNumber: {
  5563. "animationIterationCount": true,
  5564. "columnCount": true,
  5565. "fillOpacity": true,
  5566. "flexGrow": true,
  5567. "flexShrink": true,
  5568. "fontWeight": true,
  5569. "gridArea": true,
  5570. "gridColumn": true,
  5571. "gridColumnEnd": true,
  5572. "gridColumnStart": true,
  5573. "gridRow": true,
  5574. "gridRowEnd": true,
  5575. "gridRowStart": true,
  5576. "lineHeight": true,
  5577. "opacity": true,
  5578. "order": true,
  5579. "orphans": true,
  5580. "widows": true,
  5581. "zIndex": true,
  5582. "zoom": true
  5583. },
  5584. // Add in properties whose names you wish to fix before
  5585. // setting or getting the value
  5586. cssProps: {},
  5587. // Get and set the style property on a DOM Node
  5588. style: function( elem, name, value, extra ) {
  5589. // Don't set styles on text and comment nodes
  5590. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5591. return;
  5592. }
  5593. // Make sure that we're working with the right name
  5594. var ret, type, hooks,
  5595. origName = camelCase( name ),
  5596. isCustomProp = rcustomProp.test( name ),
  5597. style = elem.style;
  5598. // Make sure that we're working with the right name. We don't
  5599. // want to query the value if it is a CSS custom property
  5600. // since they are user-defined.
  5601. if ( !isCustomProp ) {
  5602. name = finalPropName( origName );
  5603. }
  5604. // Gets hook for the prefixed version, then unprefixed version
  5605. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5606. // Check if we're setting a value
  5607. if ( value !== undefined ) {
  5608. type = typeof value;
  5609. // Convert "+=" or "-=" to relative numbers (#7345)
  5610. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  5611. value = adjustCSS( elem, name, ret );
  5612. // Fixes bug #9237
  5613. type = "number";
  5614. }
  5615. // Make sure that null and NaN values aren't set (#7116)
  5616. if ( value == null || value !== value ) {
  5617. return;
  5618. }
  5619. // If a number was passed in, add the unit (except for certain CSS properties)
  5620. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  5621. // "px" to a few hardcoded values.
  5622. if ( type === "number" && !isCustomProp ) {
  5623. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  5624. }
  5625. // background-* props affect original clone's values
  5626. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  5627. style[ name ] = "inherit";
  5628. }
  5629. // If a hook was provided, use that value, otherwise just set the specified value
  5630. if ( !hooks || !( "set" in hooks ) ||
  5631. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  5632. if ( isCustomProp ) {
  5633. style.setProperty( name, value );
  5634. } else {
  5635. style[ name ] = value;
  5636. }
  5637. }
  5638. } else {
  5639. // If a hook was provided get the non-computed value from there
  5640. if ( hooks && "get" in hooks &&
  5641. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  5642. return ret;
  5643. }
  5644. // Otherwise just get the value from the style object
  5645. return style[ name ];
  5646. }
  5647. },
  5648. css: function( elem, name, extra, styles ) {
  5649. var val, num, hooks,
  5650. origName = camelCase( name ),
  5651. isCustomProp = rcustomProp.test( name );
  5652. // Make sure that we're working with the right name. We don't
  5653. // want to modify the value if it is a CSS custom property
  5654. // since they are user-defined.
  5655. if ( !isCustomProp ) {
  5656. name = finalPropName( origName );
  5657. }
  5658. // Try prefixed name followed by the unprefixed name
  5659. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5660. // If a hook was provided get the computed value from there
  5661. if ( hooks && "get" in hooks ) {
  5662. val = hooks.get( elem, true, extra );
  5663. }
  5664. // Otherwise, if a way to get the computed value exists, use that
  5665. if ( val === undefined ) {
  5666. val = curCSS( elem, name, styles );
  5667. }
  5668. // Convert "normal" to computed value
  5669. if ( val === "normal" && name in cssNormalTransform ) {
  5670. val = cssNormalTransform[ name ];
  5671. }
  5672. // Make numeric if forced or a qualifier was provided and val looks numeric
  5673. if ( extra === "" || extra ) {
  5674. num = parseFloat( val );
  5675. return extra === true || isFinite( num ) ? num || 0 : val;
  5676. }
  5677. return val;
  5678. }
  5679. } );
  5680. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  5681. jQuery.cssHooks[ dimension ] = {
  5682. get: function( elem, computed, extra ) {
  5683. if ( computed ) {
  5684. // Certain elements can have dimension info if we invisibly show them
  5685. // but it must have a current display style that would benefit
  5686. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  5687. // Support: Safari 8+
  5688. // Table columns in Safari have non-zero offsetWidth & zero
  5689. // getBoundingClientRect().width unless display is changed.
  5690. // Support: IE <=11 only
  5691. // Running getBoundingClientRect on a disconnected node
  5692. // in IE throws an error.
  5693. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  5694. swap( elem, cssShow, function() {
  5695. return getWidthOrHeight( elem, dimension, extra );
  5696. } ) :
  5697. getWidthOrHeight( elem, dimension, extra );
  5698. }
  5699. },
  5700. set: function( elem, value, extra ) {
  5701. var matches,
  5702. styles = getStyles( elem ),
  5703. // Only read styles.position if the test has a chance to fail
  5704. // to avoid forcing a reflow.
  5705. scrollboxSizeBuggy = !support.scrollboxSize() &&
  5706. styles.position === "absolute",
  5707. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  5708. boxSizingNeeded = scrollboxSizeBuggy || extra,
  5709. isBorderBox = boxSizingNeeded &&
  5710. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5711. subtract = extra ?
  5712. boxModelAdjustment(
  5713. elem,
  5714. dimension,
  5715. extra,
  5716. isBorderBox,
  5717. styles
  5718. ) :
  5719. 0;
  5720. // Account for unreliable border-box dimensions by comparing offset* to computed and
  5721. // faking a content-box to get border and padding (gh-3699)
  5722. if ( isBorderBox && scrollboxSizeBuggy ) {
  5723. subtract -= Math.ceil(
  5724. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5725. parseFloat( styles[ dimension ] ) -
  5726. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  5727. 0.5
  5728. );
  5729. }
  5730. // Convert to pixels if value adjustment is needed
  5731. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  5732. ( matches[ 3 ] || "px" ) !== "px" ) {
  5733. elem.style[ dimension ] = value;
  5734. value = jQuery.css( elem, dimension );
  5735. }
  5736. return setPositiveNumber( elem, value, subtract );
  5737. }
  5738. };
  5739. } );
  5740. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  5741. function( elem, computed ) {
  5742. if ( computed ) {
  5743. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  5744. elem.getBoundingClientRect().left -
  5745. swap( elem, { marginLeft: 0 }, function() {
  5746. return elem.getBoundingClientRect().left;
  5747. } )
  5748. ) + "px";
  5749. }
  5750. }
  5751. );
  5752. // These hooks are used by animate to expand properties
  5753. jQuery.each( {
  5754. margin: "",
  5755. padding: "",
  5756. border: "Width"
  5757. }, function( prefix, suffix ) {
  5758. jQuery.cssHooks[ prefix + suffix ] = {
  5759. expand: function( value ) {
  5760. var i = 0,
  5761. expanded = {},
  5762. // Assumes a single number if not a string
  5763. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  5764. for ( ; i < 4; i++ ) {
  5765. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5766. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5767. }
  5768. return expanded;
  5769. }
  5770. };
  5771. if ( prefix !== "margin" ) {
  5772. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5773. }
  5774. } );
  5775. jQuery.fn.extend( {
  5776. css: function( name, value ) {
  5777. return access( this, function( elem, name, value ) {
  5778. var styles, len,
  5779. map = {},
  5780. i = 0;
  5781. if ( Array.isArray( name ) ) {
  5782. styles = getStyles( elem );
  5783. len = name.length;
  5784. for ( ; i < len; i++ ) {
  5785. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5786. }
  5787. return map;
  5788. }
  5789. return value !== undefined ?
  5790. jQuery.style( elem, name, value ) :
  5791. jQuery.css( elem, name );
  5792. }, name, value, arguments.length > 1 );
  5793. }
  5794. } );
  5795. function Tween( elem, options, prop, end, easing ) {
  5796. return new Tween.prototype.init( elem, options, prop, end, easing );
  5797. }
  5798. jQuery.Tween = Tween;
  5799. Tween.prototype = {
  5800. constructor: Tween,
  5801. init: function( elem, options, prop, end, easing, unit ) {
  5802. this.elem = elem;
  5803. this.prop = prop;
  5804. this.easing = easing || jQuery.easing._default;
  5805. this.options = options;
  5806. this.start = this.now = this.cur();
  5807. this.end = end;
  5808. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5809. },
  5810. cur: function() {
  5811. var hooks = Tween.propHooks[ this.prop ];
  5812. return hooks && hooks.get ?
  5813. hooks.get( this ) :
  5814. Tween.propHooks._default.get( this );
  5815. },
  5816. run: function( percent ) {
  5817. var eased,
  5818. hooks = Tween.propHooks[ this.prop ];
  5819. if ( this.options.duration ) {
  5820. this.pos = eased = jQuery.easing[ this.easing ](
  5821. percent, this.options.duration * percent, 0, 1, this.options.duration
  5822. );
  5823. } else {
  5824. this.pos = eased = percent;
  5825. }
  5826. this.now = ( this.end - this.start ) * eased + this.start;
  5827. if ( this.options.step ) {
  5828. this.options.step.call( this.elem, this.now, this );
  5829. }
  5830. if ( hooks && hooks.set ) {
  5831. hooks.set( this );
  5832. } else {
  5833. Tween.propHooks._default.set( this );
  5834. }
  5835. return this;
  5836. }
  5837. };
  5838. Tween.prototype.init.prototype = Tween.prototype;
  5839. Tween.propHooks = {
  5840. _default: {
  5841. get: function( tween ) {
  5842. var result;
  5843. // Use a property on the element directly when it is not a DOM element,
  5844. // or when there is no matching style property that exists.
  5845. if ( tween.elem.nodeType !== 1 ||
  5846. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  5847. return tween.elem[ tween.prop ];
  5848. }
  5849. // Passing an empty string as a 3rd parameter to .css will automatically
  5850. // attempt a parseFloat and fallback to a string if the parse fails.
  5851. // Simple values such as "10px" are parsed to Float;
  5852. // complex values such as "rotate(1rad)" are returned as-is.
  5853. result = jQuery.css( tween.elem, tween.prop, "" );
  5854. // Empty strings, null, undefined and "auto" are converted to 0.
  5855. return !result || result === "auto" ? 0 : result;
  5856. },
  5857. set: function( tween ) {
  5858. // Use step hook for back compat.
  5859. // Use cssHook if its there.
  5860. // Use .style if available and use plain properties where available.
  5861. if ( jQuery.fx.step[ tween.prop ] ) {
  5862. jQuery.fx.step[ tween.prop ]( tween );
  5863. } else if ( tween.elem.nodeType === 1 && (
  5864. jQuery.cssHooks[ tween.prop ] ||
  5865. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  5866. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5867. } else {
  5868. tween.elem[ tween.prop ] = tween.now;
  5869. }
  5870. }
  5871. }
  5872. };
  5873. // Support: IE <=9 only
  5874. // Panic based approach to setting things on disconnected nodes
  5875. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5876. set: function( tween ) {
  5877. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5878. tween.elem[ tween.prop ] = tween.now;
  5879. }
  5880. }
  5881. };
  5882. jQuery.easing = {
  5883. linear: function( p ) {
  5884. return p;
  5885. },
  5886. swing: function( p ) {
  5887. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5888. },
  5889. _default: "swing"
  5890. };
  5891. jQuery.fx = Tween.prototype.init;
  5892. // Back compat <1.8 extension point
  5893. jQuery.fx.step = {};
  5894. var
  5895. fxNow, inProgress,
  5896. rfxtypes = /^(?:toggle|show|hide)$/,
  5897. rrun = /queueHooks$/;
  5898. function schedule() {
  5899. if ( inProgress ) {
  5900. if ( document.hidden === false && window.requestAnimationFrame ) {
  5901. window.requestAnimationFrame( schedule );
  5902. } else {
  5903. window.setTimeout( schedule, jQuery.fx.interval );
  5904. }
  5905. jQuery.fx.tick();
  5906. }
  5907. }
  5908. // Animations created synchronously will run synchronously
  5909. function createFxNow() {
  5910. window.setTimeout( function() {
  5911. fxNow = undefined;
  5912. } );
  5913. return ( fxNow = Date.now() );
  5914. }
  5915. // Generate parameters to create a standard animation
  5916. function genFx( type, includeWidth ) {
  5917. var which,
  5918. i = 0,
  5919. attrs = { height: type };
  5920. // If we include width, step value is 1 to do all cssExpand values,
  5921. // otherwise step value is 2 to skip over Left and Right
  5922. includeWidth = includeWidth ? 1 : 0;
  5923. for ( ; i < 4; i += 2 - includeWidth ) {
  5924. which = cssExpand[ i ];
  5925. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5926. }
  5927. if ( includeWidth ) {
  5928. attrs.opacity = attrs.width = type;
  5929. }
  5930. return attrs;
  5931. }
  5932. function createTween( value, prop, animation ) {
  5933. var tween,
  5934. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  5935. index = 0,
  5936. length = collection.length;
  5937. for ( ; index < length; index++ ) {
  5938. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  5939. // We're done with this property
  5940. return tween;
  5941. }
  5942. }
  5943. }
  5944. function defaultPrefilter( elem, props, opts ) {
  5945. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  5946. isBox = "width" in props || "height" in props,
  5947. anim = this,
  5948. orig = {},
  5949. style = elem.style,
  5950. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  5951. dataShow = dataPriv.get( elem, "fxshow" );
  5952. // Queue-skipping animations hijack the fx hooks
  5953. if ( !opts.queue ) {
  5954. hooks = jQuery._queueHooks( elem, "fx" );
  5955. if ( hooks.unqueued == null ) {
  5956. hooks.unqueued = 0;
  5957. oldfire = hooks.empty.fire;
  5958. hooks.empty.fire = function() {
  5959. if ( !hooks.unqueued ) {
  5960. oldfire();
  5961. }
  5962. };
  5963. }
  5964. hooks.unqueued++;
  5965. anim.always( function() {
  5966. // Ensure the complete handler is called before this completes
  5967. anim.always( function() {
  5968. hooks.unqueued--;
  5969. if ( !jQuery.queue( elem, "fx" ).length ) {
  5970. hooks.empty.fire();
  5971. }
  5972. } );
  5973. } );
  5974. }
  5975. // Detect show/hide animations
  5976. for ( prop in props ) {
  5977. value = props[ prop ];
  5978. if ( rfxtypes.test( value ) ) {
  5979. delete props[ prop ];
  5980. toggle = toggle || value === "toggle";
  5981. if ( value === ( hidden ? "hide" : "show" ) ) {
  5982. // Pretend to be hidden if this is a "show" and
  5983. // there is still data from a stopped show/hide
  5984. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  5985. hidden = true;
  5986. // Ignore all other no-op show/hide data
  5987. } else {
  5988. continue;
  5989. }
  5990. }
  5991. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  5992. }
  5993. }
  5994. // Bail out if this is a no-op like .hide().hide()
  5995. propTween = !jQuery.isEmptyObject( props );
  5996. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  5997. return;
  5998. }
  5999. // Restrict "overflow" and "display" styles during box animations
  6000. if ( isBox && elem.nodeType === 1 ) {
  6001. // Support: IE <=9 - 11, Edge 12 - 15
  6002. // Record all 3 overflow attributes because IE does not infer the shorthand
  6003. // from identically-valued overflowX and overflowY and Edge just mirrors
  6004. // the overflowX value there.
  6005. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  6006. // Identify a display type, preferring old show/hide data over the CSS cascade
  6007. restoreDisplay = dataShow && dataShow.display;
  6008. if ( restoreDisplay == null ) {
  6009. restoreDisplay = dataPriv.get( elem, "display" );
  6010. }
  6011. display = jQuery.css( elem, "display" );
  6012. if ( display === "none" ) {
  6013. if ( restoreDisplay ) {
  6014. display = restoreDisplay;
  6015. } else {
  6016. // Get nonempty value(s) by temporarily forcing visibility
  6017. showHide( [ elem ], true );
  6018. restoreDisplay = elem.style.display || restoreDisplay;
  6019. display = jQuery.css( elem, "display" );
  6020. showHide( [ elem ] );
  6021. }
  6022. }
  6023. // Animate inline elements as inline-block
  6024. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  6025. if ( jQuery.css( elem, "float" ) === "none" ) {
  6026. // Restore the original display value at the end of pure show/hide animations
  6027. if ( !propTween ) {
  6028. anim.done( function() {
  6029. style.display = restoreDisplay;
  6030. } );
  6031. if ( restoreDisplay == null ) {
  6032. display = style.display;
  6033. restoreDisplay = display === "none" ? "" : display;
  6034. }
  6035. }
  6036. style.display = "inline-block";
  6037. }
  6038. }
  6039. }
  6040. if ( opts.overflow ) {
  6041. style.overflow = "hidden";
  6042. anim.always( function() {
  6043. style.overflow = opts.overflow[ 0 ];
  6044. style.overflowX = opts.overflow[ 1 ];
  6045. style.overflowY = opts.overflow[ 2 ];
  6046. } );
  6047. }
  6048. // Implement show/hide animations
  6049. propTween = false;
  6050. for ( prop in orig ) {
  6051. // General show/hide setup for this element animation
  6052. if ( !propTween ) {
  6053. if ( dataShow ) {
  6054. if ( "hidden" in dataShow ) {
  6055. hidden = dataShow.hidden;
  6056. }
  6057. } else {
  6058. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  6059. }
  6060. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  6061. if ( toggle ) {
  6062. dataShow.hidden = !hidden;
  6063. }
  6064. // Show elements before animating them
  6065. if ( hidden ) {
  6066. showHide( [ elem ], true );
  6067. }
  6068. /* eslint-disable no-loop-func */
  6069. anim.done( function() {
  6070. /* eslint-enable no-loop-func */
  6071. // The final step of a "hide" animation is actually hiding the element
  6072. if ( !hidden ) {
  6073. showHide( [ elem ] );
  6074. }
  6075. dataPriv.remove( elem, "fxshow" );
  6076. for ( prop in orig ) {
  6077. jQuery.style( elem, prop, orig[ prop ] );
  6078. }
  6079. } );
  6080. }
  6081. // Per-property setup
  6082. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  6083. if ( !( prop in dataShow ) ) {
  6084. dataShow[ prop ] = propTween.start;
  6085. if ( hidden ) {
  6086. propTween.end = propTween.start;
  6087. propTween.start = 0;
  6088. }
  6089. }
  6090. }
  6091. }
  6092. function propFilter( props, specialEasing ) {
  6093. var index, name, easing, value, hooks;
  6094. // camelCase, specialEasing and expand cssHook pass
  6095. for ( index in props ) {
  6096. name = camelCase( index );
  6097. easing = specialEasing[ name ];
  6098. value = props[ index ];
  6099. if ( Array.isArray( value ) ) {
  6100. easing = value[ 1 ];
  6101. value = props[ index ] = value[ 0 ];
  6102. }
  6103. if ( index !== name ) {
  6104. props[ name ] = value;
  6105. delete props[ index ];
  6106. }
  6107. hooks = jQuery.cssHooks[ name ];
  6108. if ( hooks && "expand" in hooks ) {
  6109. value = hooks.expand( value );
  6110. delete props[ name ];
  6111. // Not quite $.extend, this won't overwrite existing keys.
  6112. // Reusing 'index' because we have the correct "name"
  6113. for ( index in value ) {
  6114. if ( !( index in props ) ) {
  6115. props[ index ] = value[ index ];
  6116. specialEasing[ index ] = easing;
  6117. }
  6118. }
  6119. } else {
  6120. specialEasing[ name ] = easing;
  6121. }
  6122. }
  6123. }
  6124. function Animation( elem, properties, options ) {
  6125. var result,
  6126. stopped,
  6127. index = 0,
  6128. length = Animation.prefilters.length,
  6129. deferred = jQuery.Deferred().always( function() {
  6130. // Don't match elem in the :animated selector
  6131. delete tick.elem;
  6132. } ),
  6133. tick = function() {
  6134. if ( stopped ) {
  6135. return false;
  6136. }
  6137. var currentTime = fxNow || createFxNow(),
  6138. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  6139. // Support: Android 2.3 only
  6140. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  6141. temp = remaining / animation.duration || 0,
  6142. percent = 1 - temp,
  6143. index = 0,
  6144. length = animation.tweens.length;
  6145. for ( ; index < length; index++ ) {
  6146. animation.tweens[ index ].run( percent );
  6147. }
  6148. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  6149. // If there's more to do, yield
  6150. if ( percent < 1 && length ) {
  6151. return remaining;
  6152. }
  6153. // If this was an empty animation, synthesize a final progress notification
  6154. if ( !length ) {
  6155. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6156. }
  6157. // Resolve the animation and report its conclusion
  6158. deferred.resolveWith( elem, [ animation ] );
  6159. return false;
  6160. },
  6161. animation = deferred.promise( {
  6162. elem: elem,
  6163. props: jQuery.extend( {}, properties ),
  6164. opts: jQuery.extend( true, {
  6165. specialEasing: {},
  6166. easing: jQuery.easing._default
  6167. }, options ),
  6168. originalProperties: properties,
  6169. originalOptions: options,
  6170. startTime: fxNow || createFxNow(),
  6171. duration: options.duration,
  6172. tweens: [],
  6173. createTween: function( prop, end ) {
  6174. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  6175. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  6176. animation.tweens.push( tween );
  6177. return tween;
  6178. },
  6179. stop: function( gotoEnd ) {
  6180. var index = 0,
  6181. // If we are going to the end, we want to run all the tweens
  6182. // otherwise we skip this part
  6183. length = gotoEnd ? animation.tweens.length : 0;
  6184. if ( stopped ) {
  6185. return this;
  6186. }
  6187. stopped = true;
  6188. for ( ; index < length; index++ ) {
  6189. animation.tweens[ index ].run( 1 );
  6190. }
  6191. // Resolve when we played the last frame; otherwise, reject
  6192. if ( gotoEnd ) {
  6193. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6194. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  6195. } else {
  6196. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  6197. }
  6198. return this;
  6199. }
  6200. } ),
  6201. props = animation.props;
  6202. propFilter( props, animation.opts.specialEasing );
  6203. for ( ; index < length; index++ ) {
  6204. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  6205. if ( result ) {
  6206. if ( isFunction( result.stop ) ) {
  6207. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  6208. result.stop.bind( result );
  6209. }
  6210. return result;
  6211. }
  6212. }
  6213. jQuery.map( props, createTween, animation );
  6214. if ( isFunction( animation.opts.start ) ) {
  6215. animation.opts.start.call( elem, animation );
  6216. }
  6217. // Attach callbacks from options
  6218. animation
  6219. .progress( animation.opts.progress )
  6220. .done( animation.opts.done, animation.opts.complete )
  6221. .fail( animation.opts.fail )
  6222. .always( animation.opts.always );
  6223. jQuery.fx.timer(
  6224. jQuery.extend( tick, {
  6225. elem: elem,
  6226. anim: animation,
  6227. queue: animation.opts.queue
  6228. } )
  6229. );
  6230. return animation;
  6231. }
  6232. jQuery.Animation = jQuery.extend( Animation, {
  6233. tweeners: {
  6234. "*": [ function( prop, value ) {
  6235. var tween = this.createTween( prop, value );
  6236. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  6237. return tween;
  6238. } ]
  6239. },
  6240. tweener: function( props, callback ) {
  6241. if ( isFunction( props ) ) {
  6242. callback = props;
  6243. props = [ "*" ];
  6244. } else {
  6245. props = props.match( rnothtmlwhite );
  6246. }
  6247. var prop,
  6248. index = 0,
  6249. length = props.length;
  6250. for ( ; index < length; index++ ) {
  6251. prop = props[ index ];
  6252. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  6253. Animation.tweeners[ prop ].unshift( callback );
  6254. }
  6255. },
  6256. prefilters: [ defaultPrefilter ],
  6257. prefilter: function( callback, prepend ) {
  6258. if ( prepend ) {
  6259. Animation.prefilters.unshift( callback );
  6260. } else {
  6261. Animation.prefilters.push( callback );
  6262. }
  6263. }
  6264. } );
  6265. jQuery.speed = function( speed, easing, fn ) {
  6266. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  6267. complete: fn || !fn && easing ||
  6268. isFunction( speed ) && speed,
  6269. duration: speed,
  6270. easing: fn && easing || easing && !isFunction( easing ) && easing
  6271. };
  6272. // Go to the end state if fx are off
  6273. if ( jQuery.fx.off ) {
  6274. opt.duration = 0;
  6275. } else {
  6276. if ( typeof opt.duration !== "number" ) {
  6277. if ( opt.duration in jQuery.fx.speeds ) {
  6278. opt.duration = jQuery.fx.speeds[ opt.duration ];
  6279. } else {
  6280. opt.duration = jQuery.fx.speeds._default;
  6281. }
  6282. }
  6283. }
  6284. // Normalize opt.queue - true/undefined/null -> "fx"
  6285. if ( opt.queue == null || opt.queue === true ) {
  6286. opt.queue = "fx";
  6287. }
  6288. // Queueing
  6289. opt.old = opt.complete;
  6290. opt.complete = function() {
  6291. if ( isFunction( opt.old ) ) {
  6292. opt.old.call( this );
  6293. }
  6294. if ( opt.queue ) {
  6295. jQuery.dequeue( this, opt.queue );
  6296. }
  6297. };
  6298. return opt;
  6299. };
  6300. jQuery.fn.extend( {
  6301. fadeTo: function( speed, to, easing, callback ) {
  6302. // Show any hidden elements after setting opacity to 0
  6303. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  6304. // Animate to the value specified
  6305. .end().animate( { opacity: to }, speed, easing, callback );
  6306. },
  6307. animate: function( prop, speed, easing, callback ) {
  6308. var empty = jQuery.isEmptyObject( prop ),
  6309. optall = jQuery.speed( speed, easing, callback ),
  6310. doAnimation = function() {
  6311. // Operate on a copy of prop so per-property easing won't be lost
  6312. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  6313. // Empty animations, or finishing resolves immediately
  6314. if ( empty || dataPriv.get( this, "finish" ) ) {
  6315. anim.stop( true );
  6316. }
  6317. };
  6318. doAnimation.finish = doAnimation;
  6319. return empty || optall.queue === false ?
  6320. this.each( doAnimation ) :
  6321. this.queue( optall.queue, doAnimation );
  6322. },
  6323. stop: function( type, clearQueue, gotoEnd ) {
  6324. var stopQueue = function( hooks ) {
  6325. var stop = hooks.stop;
  6326. delete hooks.stop;
  6327. stop( gotoEnd );
  6328. };
  6329. if ( typeof type !== "string" ) {
  6330. gotoEnd = clearQueue;
  6331. clearQueue = type;
  6332. type = undefined;
  6333. }
  6334. if ( clearQueue ) {
  6335. this.queue( type || "fx", [] );
  6336. }
  6337. return this.each( function() {
  6338. var dequeue = true,
  6339. index = type != null && type + "queueHooks",
  6340. timers = jQuery.timers,
  6341. data = dataPriv.get( this );
  6342. if ( index ) {
  6343. if ( data[ index ] && data[ index ].stop ) {
  6344. stopQueue( data[ index ] );
  6345. }
  6346. } else {
  6347. for ( index in data ) {
  6348. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  6349. stopQueue( data[ index ] );
  6350. }
  6351. }
  6352. }
  6353. for ( index = timers.length; index--; ) {
  6354. if ( timers[ index ].elem === this &&
  6355. ( type == null || timers[ index ].queue === type ) ) {
  6356. timers[ index ].anim.stop( gotoEnd );
  6357. dequeue = false;
  6358. timers.splice( index, 1 );
  6359. }
  6360. }
  6361. // Start the next in the queue if the last step wasn't forced.
  6362. // Timers currently will call their complete callbacks, which
  6363. // will dequeue but only if they were gotoEnd.
  6364. if ( dequeue || !gotoEnd ) {
  6365. jQuery.dequeue( this, type );
  6366. }
  6367. } );
  6368. },
  6369. finish: function( type ) {
  6370. if ( type !== false ) {
  6371. type = type || "fx";
  6372. }
  6373. return this.each( function() {
  6374. var index,
  6375. data = dataPriv.get( this ),
  6376. queue = data[ type + "queue" ],
  6377. hooks = data[ type + "queueHooks" ],
  6378. timers = jQuery.timers,
  6379. length = queue ? queue.length : 0;
  6380. // Enable finishing flag on private data
  6381. data.finish = true;
  6382. // Empty the queue first
  6383. jQuery.queue( this, type, [] );
  6384. if ( hooks && hooks.stop ) {
  6385. hooks.stop.call( this, true );
  6386. }
  6387. // Look for any active animations, and finish them
  6388. for ( index = timers.length; index--; ) {
  6389. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  6390. timers[ index ].anim.stop( true );
  6391. timers.splice( index, 1 );
  6392. }
  6393. }
  6394. // Look for any animations in the old queue and finish them
  6395. for ( index = 0; index < length; index++ ) {
  6396. if ( queue[ index ] && queue[ index ].finish ) {
  6397. queue[ index ].finish.call( this );
  6398. }
  6399. }
  6400. // Turn off finishing flag
  6401. delete data.finish;
  6402. } );
  6403. }
  6404. } );
  6405. jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
  6406. var cssFn = jQuery.fn[ name ];
  6407. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6408. return speed == null || typeof speed === "boolean" ?
  6409. cssFn.apply( this, arguments ) :
  6410. this.animate( genFx( name, true ), speed, easing, callback );
  6411. };
  6412. } );
  6413. // Generate shortcuts for custom animations
  6414. jQuery.each( {
  6415. slideDown: genFx( "show" ),
  6416. slideUp: genFx( "hide" ),
  6417. slideToggle: genFx( "toggle" ),
  6418. fadeIn: { opacity: "show" },
  6419. fadeOut: { opacity: "hide" },
  6420. fadeToggle: { opacity: "toggle" }
  6421. }, function( name, props ) {
  6422. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6423. return this.animate( props, speed, easing, callback );
  6424. };
  6425. } );
  6426. jQuery.timers = [];
  6427. jQuery.fx.tick = function() {
  6428. var timer,
  6429. i = 0,
  6430. timers = jQuery.timers;
  6431. fxNow = Date.now();
  6432. for ( ; i < timers.length; i++ ) {
  6433. timer = timers[ i ];
  6434. // Run the timer and safely remove it when done (allowing for external removal)
  6435. if ( !timer() && timers[ i ] === timer ) {
  6436. timers.splice( i--, 1 );
  6437. }
  6438. }
  6439. if ( !timers.length ) {
  6440. jQuery.fx.stop();
  6441. }
  6442. fxNow = undefined;
  6443. };
  6444. jQuery.fx.timer = function( timer ) {
  6445. jQuery.timers.push( timer );
  6446. jQuery.fx.start();
  6447. };
  6448. jQuery.fx.interval = 13;
  6449. jQuery.fx.start = function() {
  6450. if ( inProgress ) {
  6451. return;
  6452. }
  6453. inProgress = true;
  6454. schedule();
  6455. };
  6456. jQuery.fx.stop = function() {
  6457. inProgress = null;
  6458. };
  6459. jQuery.fx.speeds = {
  6460. slow: 600,
  6461. fast: 200,
  6462. // Default speed
  6463. _default: 400
  6464. };
  6465. // Based off of the plugin by Clint Helfers, with permission.
  6466. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  6467. jQuery.fn.delay = function( time, type ) {
  6468. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  6469. type = type || "fx";
  6470. return this.queue( type, function( next, hooks ) {
  6471. var timeout = window.setTimeout( next, time );
  6472. hooks.stop = function() {
  6473. window.clearTimeout( timeout );
  6474. };
  6475. } );
  6476. };
  6477. ( function() {
  6478. var input = document.createElement( "input" ),
  6479. select = document.createElement( "select" ),
  6480. opt = select.appendChild( document.createElement( "option" ) );
  6481. input.type = "checkbox";
  6482. // Support: Android <=4.3 only
  6483. // Default value for a checkbox should be "on"
  6484. support.checkOn = input.value !== "";
  6485. // Support: IE <=11 only
  6486. // Must access selectedIndex to make default options select
  6487. support.optSelected = opt.selected;
  6488. // Support: IE <=11 only
  6489. // An input loses its value after becoming a radio
  6490. input = document.createElement( "input" );
  6491. input.value = "t";
  6492. input.type = "radio";
  6493. support.radioValue = input.value === "t";
  6494. } )();
  6495. var boolHook,
  6496. attrHandle = jQuery.expr.attrHandle;
  6497. jQuery.fn.extend( {
  6498. attr: function( name, value ) {
  6499. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  6500. },
  6501. removeAttr: function( name ) {
  6502. return this.each( function() {
  6503. jQuery.removeAttr( this, name );
  6504. } );
  6505. }
  6506. } );
  6507. jQuery.extend( {
  6508. attr: function( elem, name, value ) {
  6509. var ret, hooks,
  6510. nType = elem.nodeType;
  6511. // Don't get/set attributes on text, comment and attribute nodes
  6512. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6513. return;
  6514. }
  6515. // Fallback to prop when attributes are not supported
  6516. if ( typeof elem.getAttribute === "undefined" ) {
  6517. return jQuery.prop( elem, name, value );
  6518. }
  6519. // Attribute hooks are determined by the lowercase version
  6520. // Grab necessary hook if one is defined
  6521. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6522. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  6523. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  6524. }
  6525. if ( value !== undefined ) {
  6526. if ( value === null ) {
  6527. jQuery.removeAttr( elem, name );
  6528. return;
  6529. }
  6530. if ( hooks && "set" in hooks &&
  6531. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6532. return ret;
  6533. }
  6534. elem.setAttribute( name, value + "" );
  6535. return value;
  6536. }
  6537. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6538. return ret;
  6539. }
  6540. ret = jQuery.find.attr( elem, name );
  6541. // Non-existent attributes return null, we normalize to undefined
  6542. return ret == null ? undefined : ret;
  6543. },
  6544. attrHooks: {
  6545. type: {
  6546. set: function( elem, value ) {
  6547. if ( !support.radioValue && value === "radio" &&
  6548. nodeName( elem, "input" ) ) {
  6549. var val = elem.value;
  6550. elem.setAttribute( "type", value );
  6551. if ( val ) {
  6552. elem.value = val;
  6553. }
  6554. return value;
  6555. }
  6556. }
  6557. }
  6558. },
  6559. removeAttr: function( elem, value ) {
  6560. var name,
  6561. i = 0,
  6562. // Attribute names can contain non-HTML whitespace characters
  6563. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  6564. attrNames = value && value.match( rnothtmlwhite );
  6565. if ( attrNames && elem.nodeType === 1 ) {
  6566. while ( ( name = attrNames[ i++ ] ) ) {
  6567. elem.removeAttribute( name );
  6568. }
  6569. }
  6570. }
  6571. } );
  6572. // Hooks for boolean attributes
  6573. boolHook = {
  6574. set: function( elem, value, name ) {
  6575. if ( value === false ) {
  6576. // Remove boolean attributes when set to false
  6577. jQuery.removeAttr( elem, name );
  6578. } else {
  6579. elem.setAttribute( name, name );
  6580. }
  6581. return name;
  6582. }
  6583. };
  6584. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  6585. var getter = attrHandle[ name ] || jQuery.find.attr;
  6586. attrHandle[ name ] = function( elem, name, isXML ) {
  6587. var ret, handle,
  6588. lowercaseName = name.toLowerCase();
  6589. if ( !isXML ) {
  6590. // Avoid an infinite loop by temporarily removing this function from the getter
  6591. handle = attrHandle[ lowercaseName ];
  6592. attrHandle[ lowercaseName ] = ret;
  6593. ret = getter( elem, name, isXML ) != null ?
  6594. lowercaseName :
  6595. null;
  6596. attrHandle[ lowercaseName ] = handle;
  6597. }
  6598. return ret;
  6599. };
  6600. } );
  6601. var rfocusable = /^(?:input|select|textarea|button)$/i,
  6602. rclickable = /^(?:a|area)$/i;
  6603. jQuery.fn.extend( {
  6604. prop: function( name, value ) {
  6605. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  6606. },
  6607. removeProp: function( name ) {
  6608. return this.each( function() {
  6609. delete this[ jQuery.propFix[ name ] || name ];
  6610. } );
  6611. }
  6612. } );
  6613. jQuery.extend( {
  6614. prop: function( elem, name, value ) {
  6615. var ret, hooks,
  6616. nType = elem.nodeType;
  6617. // Don't get/set properties on text, comment and attribute nodes
  6618. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6619. return;
  6620. }
  6621. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6622. // Fix name and attach hooks
  6623. name = jQuery.propFix[ name ] || name;
  6624. hooks = jQuery.propHooks[ name ];
  6625. }
  6626. if ( value !== undefined ) {
  6627. if ( hooks && "set" in hooks &&
  6628. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6629. return ret;
  6630. }
  6631. return ( elem[ name ] = value );
  6632. }
  6633. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6634. return ret;
  6635. }
  6636. return elem[ name ];
  6637. },
  6638. propHooks: {
  6639. tabIndex: {
  6640. get: function( elem ) {
  6641. // Support: IE <=9 - 11 only
  6642. // elem.tabIndex doesn't always return the
  6643. // correct value when it hasn't been explicitly set
  6644. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  6645. // Use proper attribute retrieval(#12072)
  6646. var tabindex = jQuery.find.attr( elem, "tabindex" );
  6647. if ( tabindex ) {
  6648. return parseInt( tabindex, 10 );
  6649. }
  6650. if (
  6651. rfocusable.test( elem.nodeName ) ||
  6652. rclickable.test( elem.nodeName ) &&
  6653. elem.href
  6654. ) {
  6655. return 0;
  6656. }
  6657. return -1;
  6658. }
  6659. }
  6660. },
  6661. propFix: {
  6662. "for": "htmlFor",
  6663. "class": "className"
  6664. }
  6665. } );
  6666. // Support: IE <=11 only
  6667. // Accessing the selectedIndex property
  6668. // forces the browser to respect setting selected
  6669. // on the option
  6670. // The getter ensures a default option is selected
  6671. // when in an optgroup
  6672. // eslint rule "no-unused-expressions" is disabled for this code
  6673. // since it considers such accessions noop
  6674. if ( !support.optSelected ) {
  6675. jQuery.propHooks.selected = {
  6676. get: function( elem ) {
  6677. /* eslint no-unused-expressions: "off" */
  6678. var parent = elem.parentNode;
  6679. if ( parent && parent.parentNode ) {
  6680. parent.parentNode.selectedIndex;
  6681. }
  6682. return null;
  6683. },
  6684. set: function( elem ) {
  6685. /* eslint no-unused-expressions: "off" */
  6686. var parent = elem.parentNode;
  6687. if ( parent ) {
  6688. parent.selectedIndex;
  6689. if ( parent.parentNode ) {
  6690. parent.parentNode.selectedIndex;
  6691. }
  6692. }
  6693. }
  6694. };
  6695. }
  6696. jQuery.each( [
  6697. "tabIndex",
  6698. "readOnly",
  6699. "maxLength",
  6700. "cellSpacing",
  6701. "cellPadding",
  6702. "rowSpan",
  6703. "colSpan",
  6704. "useMap",
  6705. "frameBorder",
  6706. "contentEditable"
  6707. ], function() {
  6708. jQuery.propFix[ this.toLowerCase() ] = this;
  6709. } );
  6710. // Strip and collapse whitespace according to HTML spec
  6711. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  6712. function stripAndCollapse( value ) {
  6713. var tokens = value.match( rnothtmlwhite ) || [];
  6714. return tokens.join( " " );
  6715. }
  6716. function getClass( elem ) {
  6717. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  6718. }
  6719. function classesToArray( value ) {
  6720. if ( Array.isArray( value ) ) {
  6721. return value;
  6722. }
  6723. if ( typeof value === "string" ) {
  6724. return value.match( rnothtmlwhite ) || [];
  6725. }
  6726. return [];
  6727. }
  6728. jQuery.fn.extend( {
  6729. addClass: function( value ) {
  6730. var classes, elem, cur, curValue, clazz, j, finalValue,
  6731. i = 0;
  6732. if ( isFunction( value ) ) {
  6733. return this.each( function( j ) {
  6734. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  6735. } );
  6736. }
  6737. classes = classesToArray( value );
  6738. if ( classes.length ) {
  6739. while ( ( elem = this[ i++ ] ) ) {
  6740. curValue = getClass( elem );
  6741. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6742. if ( cur ) {
  6743. j = 0;
  6744. while ( ( clazz = classes[ j++ ] ) ) {
  6745. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  6746. cur += clazz + " ";
  6747. }
  6748. }
  6749. // Only assign if different to avoid unneeded rendering.
  6750. finalValue = stripAndCollapse( cur );
  6751. if ( curValue !== finalValue ) {
  6752. elem.setAttribute( "class", finalValue );
  6753. }
  6754. }
  6755. }
  6756. }
  6757. return this;
  6758. },
  6759. removeClass: function( value ) {
  6760. var classes, elem, cur, curValue, clazz, j, finalValue,
  6761. i = 0;
  6762. if ( isFunction( value ) ) {
  6763. return this.each( function( j ) {
  6764. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  6765. } );
  6766. }
  6767. if ( !arguments.length ) {
  6768. return this.attr( "class", "" );
  6769. }
  6770. classes = classesToArray( value );
  6771. if ( classes.length ) {
  6772. while ( ( elem = this[ i++ ] ) ) {
  6773. curValue = getClass( elem );
  6774. // This expression is here for better compressibility (see addClass)
  6775. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6776. if ( cur ) {
  6777. j = 0;
  6778. while ( ( clazz = classes[ j++ ] ) ) {
  6779. // Remove *all* instances
  6780. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  6781. cur = cur.replace( " " + clazz + " ", " " );
  6782. }
  6783. }
  6784. // Only assign if different to avoid unneeded rendering.
  6785. finalValue = stripAndCollapse( cur );
  6786. if ( curValue !== finalValue ) {
  6787. elem.setAttribute( "class", finalValue );
  6788. }
  6789. }
  6790. }
  6791. }
  6792. return this;
  6793. },
  6794. toggleClass: function( value, stateVal ) {
  6795. var type = typeof value,
  6796. isValidValue = type === "string" || Array.isArray( value );
  6797. if ( typeof stateVal === "boolean" && isValidValue ) {
  6798. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6799. }
  6800. if ( isFunction( value ) ) {
  6801. return this.each( function( i ) {
  6802. jQuery( this ).toggleClass(
  6803. value.call( this, i, getClass( this ), stateVal ),
  6804. stateVal
  6805. );
  6806. } );
  6807. }
  6808. return this.each( function() {
  6809. var className, i, self, classNames;
  6810. if ( isValidValue ) {
  6811. // Toggle individual class names
  6812. i = 0;
  6813. self = jQuery( this );
  6814. classNames = classesToArray( value );
  6815. while ( ( className = classNames[ i++ ] ) ) {
  6816. // Check each className given, space separated list
  6817. if ( self.hasClass( className ) ) {
  6818. self.removeClass( className );
  6819. } else {
  6820. self.addClass( className );
  6821. }
  6822. }
  6823. // Toggle whole class name
  6824. } else if ( value === undefined || type === "boolean" ) {
  6825. className = getClass( this );
  6826. if ( className ) {
  6827. // Store className if set
  6828. dataPriv.set( this, "__className__", className );
  6829. }
  6830. // If the element has a class name or if we're passed `false`,
  6831. // then remove the whole classname (if there was one, the above saved it).
  6832. // Otherwise bring back whatever was previously saved (if anything),
  6833. // falling back to the empty string if nothing was stored.
  6834. if ( this.setAttribute ) {
  6835. this.setAttribute( "class",
  6836. className || value === false ?
  6837. "" :
  6838. dataPriv.get( this, "__className__" ) || ""
  6839. );
  6840. }
  6841. }
  6842. } );
  6843. },
  6844. hasClass: function( selector ) {
  6845. var className, elem,
  6846. i = 0;
  6847. className = " " + selector + " ";
  6848. while ( ( elem = this[ i++ ] ) ) {
  6849. if ( elem.nodeType === 1 &&
  6850. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  6851. return true;
  6852. }
  6853. }
  6854. return false;
  6855. }
  6856. } );
  6857. var rreturn = /\r/g;
  6858. jQuery.fn.extend( {
  6859. val: function( value ) {
  6860. var hooks, ret, valueIsFunction,
  6861. elem = this[ 0 ];
  6862. if ( !arguments.length ) {
  6863. if ( elem ) {
  6864. hooks = jQuery.valHooks[ elem.type ] ||
  6865. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6866. if ( hooks &&
  6867. "get" in hooks &&
  6868. ( ret = hooks.get( elem, "value" ) ) !== undefined
  6869. ) {
  6870. return ret;
  6871. }
  6872. ret = elem.value;
  6873. // Handle most common string cases
  6874. if ( typeof ret === "string" ) {
  6875. return ret.replace( rreturn, "" );
  6876. }
  6877. // Handle cases where value is null/undef or number
  6878. return ret == null ? "" : ret;
  6879. }
  6880. return;
  6881. }
  6882. valueIsFunction = isFunction( value );
  6883. return this.each( function( i ) {
  6884. var val;
  6885. if ( this.nodeType !== 1 ) {
  6886. return;
  6887. }
  6888. if ( valueIsFunction ) {
  6889. val = value.call( this, i, jQuery( this ).val() );
  6890. } else {
  6891. val = value;
  6892. }
  6893. // Treat null/undefined as ""; convert numbers to string
  6894. if ( val == null ) {
  6895. val = "";
  6896. } else if ( typeof val === "number" ) {
  6897. val += "";
  6898. } else if ( Array.isArray( val ) ) {
  6899. val = jQuery.map( val, function( value ) {
  6900. return value == null ? "" : value + "";
  6901. } );
  6902. }
  6903. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6904. // If set returns undefined, fall back to normal setting
  6905. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  6906. this.value = val;
  6907. }
  6908. } );
  6909. }
  6910. } );
  6911. jQuery.extend( {
  6912. valHooks: {
  6913. option: {
  6914. get: function( elem ) {
  6915. var val = jQuery.find.attr( elem, "value" );
  6916. return val != null ?
  6917. val :
  6918. // Support: IE <=10 - 11 only
  6919. // option.text throws exceptions (#14686, #14858)
  6920. // Strip and collapse whitespace
  6921. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  6922. stripAndCollapse( jQuery.text( elem ) );
  6923. }
  6924. },
  6925. select: {
  6926. get: function( elem ) {
  6927. var value, option, i,
  6928. options = elem.options,
  6929. index = elem.selectedIndex,
  6930. one = elem.type === "select-one",
  6931. values = one ? null : [],
  6932. max = one ? index + 1 : options.length;
  6933. if ( index < 0 ) {
  6934. i = max;
  6935. } else {
  6936. i = one ? index : 0;
  6937. }
  6938. // Loop through all the selected options
  6939. for ( ; i < max; i++ ) {
  6940. option = options[ i ];
  6941. // Support: IE <=9 only
  6942. // IE8-9 doesn't update selected after form reset (#2551)
  6943. if ( ( option.selected || i === index ) &&
  6944. // Don't return options that are disabled or in a disabled optgroup
  6945. !option.disabled &&
  6946. ( !option.parentNode.disabled ||
  6947. !nodeName( option.parentNode, "optgroup" ) ) ) {
  6948. // Get the specific value for the option
  6949. value = jQuery( option ).val();
  6950. // We don't need an array for one selects
  6951. if ( one ) {
  6952. return value;
  6953. }
  6954. // Multi-Selects return an array
  6955. values.push( value );
  6956. }
  6957. }
  6958. return values;
  6959. },
  6960. set: function( elem, value ) {
  6961. var optionSet, option,
  6962. options = elem.options,
  6963. values = jQuery.makeArray( value ),
  6964. i = options.length;
  6965. while ( i-- ) {
  6966. option = options[ i ];
  6967. /* eslint-disable no-cond-assign */
  6968. if ( option.selected =
  6969. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  6970. ) {
  6971. optionSet = true;
  6972. }
  6973. /* eslint-enable no-cond-assign */
  6974. }
  6975. // Force browsers to behave consistently when non-matching value is set
  6976. if ( !optionSet ) {
  6977. elem.selectedIndex = -1;
  6978. }
  6979. return values;
  6980. }
  6981. }
  6982. }
  6983. } );
  6984. // Radios and checkboxes getter/setter
  6985. jQuery.each( [ "radio", "checkbox" ], function() {
  6986. jQuery.valHooks[ this ] = {
  6987. set: function( elem, value ) {
  6988. if ( Array.isArray( value ) ) {
  6989. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  6990. }
  6991. }
  6992. };
  6993. if ( !support.checkOn ) {
  6994. jQuery.valHooks[ this ].get = function( elem ) {
  6995. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  6996. };
  6997. }
  6998. } );
  6999. // Return jQuery for attributes-only inclusion
  7000. support.focusin = "onfocusin" in window;
  7001. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  7002. stopPropagationCallback = function( e ) {
  7003. e.stopPropagation();
  7004. };
  7005. jQuery.extend( jQuery.event, {
  7006. trigger: function( event, data, elem, onlyHandlers ) {
  7007. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  7008. eventPath = [ elem || document ],
  7009. type = hasOwn.call( event, "type" ) ? event.type : event,
  7010. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  7011. cur = lastElement = tmp = elem = elem || document;
  7012. // Don't do events on text and comment nodes
  7013. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  7014. return;
  7015. }
  7016. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  7017. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  7018. return;
  7019. }
  7020. if ( type.indexOf( "." ) > -1 ) {
  7021. // Namespaced trigger; create a regexp to match event type in handle()
  7022. namespaces = type.split( "." );
  7023. type = namespaces.shift();
  7024. namespaces.sort();
  7025. }
  7026. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  7027. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  7028. event = event[ jQuery.expando ] ?
  7029. event :
  7030. new jQuery.Event( type, typeof event === "object" && event );
  7031. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  7032. event.isTrigger = onlyHandlers ? 2 : 3;
  7033. event.namespace = namespaces.join( "." );
  7034. event.rnamespace = event.namespace ?
  7035. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  7036. null;
  7037. // Clean up the event in case it is being reused
  7038. event.result = undefined;
  7039. if ( !event.target ) {
  7040. event.target = elem;
  7041. }
  7042. // Clone any incoming data and prepend the event, creating the handler arg list
  7043. data = data == null ?
  7044. [ event ] :
  7045. jQuery.makeArray( data, [ event ] );
  7046. // Allow special events to draw outside the lines
  7047. special = jQuery.event.special[ type ] || {};
  7048. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  7049. return;
  7050. }
  7051. // Determine event propagation path in advance, per W3C events spec (#9951)
  7052. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  7053. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  7054. bubbleType = special.delegateType || type;
  7055. if ( !rfocusMorph.test( bubbleType + type ) ) {
  7056. cur = cur.parentNode;
  7057. }
  7058. for ( ; cur; cur = cur.parentNode ) {
  7059. eventPath.push( cur );
  7060. tmp = cur;
  7061. }
  7062. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  7063. if ( tmp === ( elem.ownerDocument || document ) ) {
  7064. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  7065. }
  7066. }
  7067. // Fire handlers on the event path
  7068. i = 0;
  7069. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  7070. lastElement = cur;
  7071. event.type = i > 1 ?
  7072. bubbleType :
  7073. special.bindType || type;
  7074. // jQuery handler
  7075. handle = (
  7076. dataPriv.get( cur, "events" ) || Object.create( null )
  7077. )[ event.type ] &&
  7078. dataPriv.get( cur, "handle" );
  7079. if ( handle ) {
  7080. handle.apply( cur, data );
  7081. }
  7082. // Native handler
  7083. handle = ontype && cur[ ontype ];
  7084. if ( handle && handle.apply && acceptData( cur ) ) {
  7085. event.result = handle.apply( cur, data );
  7086. if ( event.result === false ) {
  7087. event.preventDefault();
  7088. }
  7089. }
  7090. }
  7091. event.type = type;
  7092. // If nobody prevented the default action, do it now
  7093. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  7094. if ( ( !special._default ||
  7095. special._default.apply( eventPath.pop(), data ) === false ) &&
  7096. acceptData( elem ) ) {
  7097. // Call a native DOM method on the target with the same name as the event.
  7098. // Don't do default actions on window, that's where global variables be (#6170)
  7099. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  7100. // Don't re-trigger an onFOO event when we call its FOO() method
  7101. tmp = elem[ ontype ];
  7102. if ( tmp ) {
  7103. elem[ ontype ] = null;
  7104. }
  7105. // Prevent re-triggering of the same event, since we already bubbled it above
  7106. jQuery.event.triggered = type;
  7107. if ( event.isPropagationStopped() ) {
  7108. lastElement.addEventListener( type, stopPropagationCallback );
  7109. }
  7110. elem[ type ]();
  7111. if ( event.isPropagationStopped() ) {
  7112. lastElement.removeEventListener( type, stopPropagationCallback );
  7113. }
  7114. jQuery.event.triggered = undefined;
  7115. if ( tmp ) {
  7116. elem[ ontype ] = tmp;
  7117. }
  7118. }
  7119. }
  7120. }
  7121. return event.result;
  7122. },
  7123. // Piggyback on a donor event to simulate a different one
  7124. // Used only for `focus(in | out)` events
  7125. simulate: function( type, elem, event ) {
  7126. var e = jQuery.extend(
  7127. new jQuery.Event(),
  7128. event,
  7129. {
  7130. type: type,
  7131. isSimulated: true
  7132. }
  7133. );
  7134. jQuery.event.trigger( e, null, elem );
  7135. }
  7136. } );
  7137. jQuery.fn.extend( {
  7138. trigger: function( type, data ) {
  7139. return this.each( function() {
  7140. jQuery.event.trigger( type, data, this );
  7141. } );
  7142. },
  7143. triggerHandler: function( type, data ) {
  7144. var elem = this[ 0 ];
  7145. if ( elem ) {
  7146. return jQuery.event.trigger( type, data, elem, true );
  7147. }
  7148. }
  7149. } );
  7150. // Support: Firefox <=44
  7151. // Firefox doesn't have focus(in | out) events
  7152. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  7153. //
  7154. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  7155. // focus(in | out) events fire after focus & blur events,
  7156. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  7157. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  7158. if ( !support.focusin ) {
  7159. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  7160. // Attach a single capturing handler on the document while someone wants focusin/focusout
  7161. var handler = function( event ) {
  7162. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  7163. };
  7164. jQuery.event.special[ fix ] = {
  7165. setup: function() {
  7166. // Handle: regular nodes (via `this.ownerDocument`), window
  7167. // (via `this.document`) & document (via `this`).
  7168. var doc = this.ownerDocument || this.document || this,
  7169. attaches = dataPriv.access( doc, fix );
  7170. if ( !attaches ) {
  7171. doc.addEventListener( orig, handler, true );
  7172. }
  7173. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  7174. },
  7175. teardown: function() {
  7176. var doc = this.ownerDocument || this.document || this,
  7177. attaches = dataPriv.access( doc, fix ) - 1;
  7178. if ( !attaches ) {
  7179. doc.removeEventListener( orig, handler, true );
  7180. dataPriv.remove( doc, fix );
  7181. } else {
  7182. dataPriv.access( doc, fix, attaches );
  7183. }
  7184. }
  7185. };
  7186. } );
  7187. }
  7188. var location = window.location;
  7189. var nonce = { guid: Date.now() };
  7190. var rquery = ( /\?/ );
  7191. // Cross-browser xml parsing
  7192. jQuery.parseXML = function( data ) {
  7193. var xml;
  7194. if ( !data || typeof data !== "string" ) {
  7195. return null;
  7196. }
  7197. // Support: IE 9 - 11 only
  7198. // IE throws on parseFromString with invalid input.
  7199. try {
  7200. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  7201. } catch ( e ) {
  7202. xml = undefined;
  7203. }
  7204. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  7205. jQuery.error( "Invalid XML: " + data );
  7206. }
  7207. return xml;
  7208. };
  7209. var
  7210. rbracket = /\[\]$/,
  7211. rCRLF = /\r?\n/g,
  7212. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7213. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7214. function buildParams( prefix, obj, traditional, add ) {
  7215. var name;
  7216. if ( Array.isArray( obj ) ) {
  7217. // Serialize array item.
  7218. jQuery.each( obj, function( i, v ) {
  7219. if ( traditional || rbracket.test( prefix ) ) {
  7220. // Treat each array item as a scalar.
  7221. add( prefix, v );
  7222. } else {
  7223. // Item is non-scalar (array or object), encode its numeric index.
  7224. buildParams(
  7225. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  7226. v,
  7227. traditional,
  7228. add
  7229. );
  7230. }
  7231. } );
  7232. } else if ( !traditional && toType( obj ) === "object" ) {
  7233. // Serialize object item.
  7234. for ( name in obj ) {
  7235. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7236. }
  7237. } else {
  7238. // Serialize scalar item.
  7239. add( prefix, obj );
  7240. }
  7241. }
  7242. // Serialize an array of form elements or a set of
  7243. // key/values into a query string
  7244. jQuery.param = function( a, traditional ) {
  7245. var prefix,
  7246. s = [],
  7247. add = function( key, valueOrFunction ) {
  7248. // If value is a function, invoke it and use its return value
  7249. var value = isFunction( valueOrFunction ) ?
  7250. valueOrFunction() :
  7251. valueOrFunction;
  7252. s[ s.length ] = encodeURIComponent( key ) + "=" +
  7253. encodeURIComponent( value == null ? "" : value );
  7254. };
  7255. if ( a == null ) {
  7256. return "";
  7257. }
  7258. // If an array was passed in, assume that it is an array of form elements.
  7259. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7260. // Serialize the form elements
  7261. jQuery.each( a, function() {
  7262. add( this.name, this.value );
  7263. } );
  7264. } else {
  7265. // If traditional, encode the "old" way (the way 1.3.2 or older
  7266. // did it), otherwise encode params recursively.
  7267. for ( prefix in a ) {
  7268. buildParams( prefix, a[ prefix ], traditional, add );
  7269. }
  7270. }
  7271. // Return the resulting serialization
  7272. return s.join( "&" );
  7273. };
  7274. jQuery.fn.extend( {
  7275. serialize: function() {
  7276. return jQuery.param( this.serializeArray() );
  7277. },
  7278. serializeArray: function() {
  7279. return this.map( function() {
  7280. // Can add propHook for "elements" to filter or add form elements
  7281. var elements = jQuery.prop( this, "elements" );
  7282. return elements ? jQuery.makeArray( elements ) : this;
  7283. } )
  7284. .filter( function() {
  7285. var type = this.type;
  7286. // Use .is( ":disabled" ) so that fieldset[disabled] works
  7287. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7288. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7289. ( this.checked || !rcheckableType.test( type ) );
  7290. } )
  7291. .map( function( _i, elem ) {
  7292. var val = jQuery( this ).val();
  7293. if ( val == null ) {
  7294. return null;
  7295. }
  7296. if ( Array.isArray( val ) ) {
  7297. return jQuery.map( val, function( val ) {
  7298. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7299. } );
  7300. }
  7301. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7302. } ).get();
  7303. }
  7304. } );
  7305. var
  7306. r20 = /%20/g,
  7307. rhash = /#.*$/,
  7308. rantiCache = /([?&])_=[^&]*/,
  7309. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  7310. // #7653, #8125, #8152: local protocol detection
  7311. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  7312. rnoContent = /^(?:GET|HEAD)$/,
  7313. rprotocol = /^\/\//,
  7314. /* Prefilters
  7315. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  7316. * 2) These are called:
  7317. * - BEFORE asking for a transport
  7318. * - AFTER param serialization (s.data is a string if s.processData is true)
  7319. * 3) key is the dataType
  7320. * 4) the catchall symbol "*" can be used
  7321. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  7322. */
  7323. prefilters = {},
  7324. /* Transports bindings
  7325. * 1) key is the dataType
  7326. * 2) the catchall symbol "*" can be used
  7327. * 3) selection will start with transport dataType and THEN go to "*" if needed
  7328. */
  7329. transports = {},
  7330. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  7331. allTypes = "*/".concat( "*" ),
  7332. // Anchor tag for parsing the document origin
  7333. originAnchor = document.createElement( "a" );
  7334. originAnchor.href = location.href;
  7335. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  7336. function addToPrefiltersOrTransports( structure ) {
  7337. // dataTypeExpression is optional and defaults to "*"
  7338. return function( dataTypeExpression, func ) {
  7339. if ( typeof dataTypeExpression !== "string" ) {
  7340. func = dataTypeExpression;
  7341. dataTypeExpression = "*";
  7342. }
  7343. var dataType,
  7344. i = 0,
  7345. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  7346. if ( isFunction( func ) ) {
  7347. // For each dataType in the dataTypeExpression
  7348. while ( ( dataType = dataTypes[ i++ ] ) ) {
  7349. // Prepend if requested
  7350. if ( dataType[ 0 ] === "+" ) {
  7351. dataType = dataType.slice( 1 ) || "*";
  7352. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  7353. // Otherwise append
  7354. } else {
  7355. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  7356. }
  7357. }
  7358. }
  7359. };
  7360. }
  7361. // Base inspection function for prefilters and transports
  7362. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  7363. var inspected = {},
  7364. seekingTransport = ( structure === transports );
  7365. function inspect( dataType ) {
  7366. var selected;
  7367. inspected[ dataType ] = true;
  7368. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  7369. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  7370. if ( typeof dataTypeOrTransport === "string" &&
  7371. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  7372. options.dataTypes.unshift( dataTypeOrTransport );
  7373. inspect( dataTypeOrTransport );
  7374. return false;
  7375. } else if ( seekingTransport ) {
  7376. return !( selected = dataTypeOrTransport );
  7377. }
  7378. } );
  7379. return selected;
  7380. }
  7381. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  7382. }
  7383. // A special extend for ajax options
  7384. // that takes "flat" options (not to be deep extended)
  7385. // Fixes #9887
  7386. function ajaxExtend( target, src ) {
  7387. var key, deep,
  7388. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  7389. for ( key in src ) {
  7390. if ( src[ key ] !== undefined ) {
  7391. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  7392. }
  7393. }
  7394. if ( deep ) {
  7395. jQuery.extend( true, target, deep );
  7396. }
  7397. return target;
  7398. }
  7399. /* Handles responses to an ajax request:
  7400. * - finds the right dataType (mediates between content-type and expected dataType)
  7401. * - returns the corresponding response
  7402. */
  7403. function ajaxHandleResponses( s, jqXHR, responses ) {
  7404. var ct, type, finalDataType, firstDataType,
  7405. contents = s.contents,
  7406. dataTypes = s.dataTypes;
  7407. // Remove auto dataType and get content-type in the process
  7408. while ( dataTypes[ 0 ] === "*" ) {
  7409. dataTypes.shift();
  7410. if ( ct === undefined ) {
  7411. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  7412. }
  7413. }
  7414. // Check if we're dealing with a known content-type
  7415. if ( ct ) {
  7416. for ( type in contents ) {
  7417. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  7418. dataTypes.unshift( type );
  7419. break;
  7420. }
  7421. }
  7422. }
  7423. // Check to see if we have a response for the expected dataType
  7424. if ( dataTypes[ 0 ] in responses ) {
  7425. finalDataType = dataTypes[ 0 ];
  7426. } else {
  7427. // Try convertible dataTypes
  7428. for ( type in responses ) {
  7429. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  7430. finalDataType = type;
  7431. break;
  7432. }
  7433. if ( !firstDataType ) {
  7434. firstDataType = type;
  7435. }
  7436. }
  7437. // Or just use first one
  7438. finalDataType = finalDataType || firstDataType;
  7439. }
  7440. // If we found a dataType
  7441. // We add the dataType to the list if needed
  7442. // and return the corresponding response
  7443. if ( finalDataType ) {
  7444. if ( finalDataType !== dataTypes[ 0 ] ) {
  7445. dataTypes.unshift( finalDataType );
  7446. }
  7447. return responses[ finalDataType ];
  7448. }
  7449. }
  7450. /* Chain conversions given the request and the original response
  7451. * Also sets the responseXXX fields on the jqXHR instance
  7452. */
  7453. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  7454. var conv2, current, conv, tmp, prev,
  7455. converters = {},
  7456. // Work with a copy of dataTypes in case we need to modify it for conversion
  7457. dataTypes = s.dataTypes.slice();
  7458. // Create converters map with lowercased keys
  7459. if ( dataTypes[ 1 ] ) {
  7460. for ( conv in s.converters ) {
  7461. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  7462. }
  7463. }
  7464. current = dataTypes.shift();
  7465. // Convert to each sequential dataType
  7466. while ( current ) {
  7467. if ( s.responseFields[ current ] ) {
  7468. jqXHR[ s.responseFields[ current ] ] = response;
  7469. }
  7470. // Apply the dataFilter if provided
  7471. if ( !prev && isSuccess && s.dataFilter ) {
  7472. response = s.dataFilter( response, s.dataType );
  7473. }
  7474. prev = current;
  7475. current = dataTypes.shift();
  7476. if ( current ) {
  7477. // There's only work to do if current dataType is non-auto
  7478. if ( current === "*" ) {
  7479. current = prev;
  7480. // Convert response if prev dataType is non-auto and differs from current
  7481. } else if ( prev !== "*" && prev !== current ) {
  7482. // Seek a direct converter
  7483. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  7484. // If none found, seek a pair
  7485. if ( !conv ) {
  7486. for ( conv2 in converters ) {
  7487. // If conv2 outputs current
  7488. tmp = conv2.split( " " );
  7489. if ( tmp[ 1 ] === current ) {
  7490. // If prev can be converted to accepted input
  7491. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  7492. converters[ "* " + tmp[ 0 ] ];
  7493. if ( conv ) {
  7494. // Condense equivalence converters
  7495. if ( conv === true ) {
  7496. conv = converters[ conv2 ];
  7497. // Otherwise, insert the intermediate dataType
  7498. } else if ( converters[ conv2 ] !== true ) {
  7499. current = tmp[ 0 ];
  7500. dataTypes.unshift( tmp[ 1 ] );
  7501. }
  7502. break;
  7503. }
  7504. }
  7505. }
  7506. }
  7507. // Apply converter (if not an equivalence)
  7508. if ( conv !== true ) {
  7509. // Unless errors are allowed to bubble, catch and return them
  7510. if ( conv && s.throws ) {
  7511. response = conv( response );
  7512. } else {
  7513. try {
  7514. response = conv( response );
  7515. } catch ( e ) {
  7516. return {
  7517. state: "parsererror",
  7518. error: conv ? e : "No conversion from " + prev + " to " + current
  7519. };
  7520. }
  7521. }
  7522. }
  7523. }
  7524. }
  7525. }
  7526. return { state: "success", data: response };
  7527. }
  7528. jQuery.extend( {
  7529. // Counter for holding the number of active queries
  7530. active: 0,
  7531. // Last-Modified header cache for next request
  7532. lastModified: {},
  7533. etag: {},
  7534. ajaxSettings: {
  7535. url: location.href,
  7536. type: "GET",
  7537. isLocal: rlocalProtocol.test( location.protocol ),
  7538. global: true,
  7539. processData: true,
  7540. async: true,
  7541. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  7542. /*
  7543. timeout: 0,
  7544. data: null,
  7545. dataType: null,
  7546. username: null,
  7547. password: null,
  7548. cache: null,
  7549. throws: false,
  7550. traditional: false,
  7551. headers: {},
  7552. */
  7553. accepts: {
  7554. "*": allTypes,
  7555. text: "text/plain",
  7556. html: "text/html",
  7557. xml: "application/xml, text/xml",
  7558. json: "application/json, text/javascript"
  7559. },
  7560. contents: {
  7561. xml: /\bxml\b/,
  7562. html: /\bhtml/,
  7563. json: /\bjson\b/
  7564. },
  7565. responseFields: {
  7566. xml: "responseXML",
  7567. text: "responseText",
  7568. json: "responseJSON"
  7569. },
  7570. // Data converters
  7571. // Keys separate source (or catchall "*") and destination types with a single space
  7572. converters: {
  7573. // Convert anything to text
  7574. "* text": String,
  7575. // Text to html (true = no transformation)
  7576. "text html": true,
  7577. // Evaluate text as a json expression
  7578. "text json": JSON.parse,
  7579. // Parse text as xml
  7580. "text xml": jQuery.parseXML
  7581. },
  7582. // For options that shouldn't be deep extended:
  7583. // you can add your own custom options here if
  7584. // and when you create one that shouldn't be
  7585. // deep extended (see ajaxExtend)
  7586. flatOptions: {
  7587. url: true,
  7588. context: true
  7589. }
  7590. },
  7591. // Creates a full fledged settings object into target
  7592. // with both ajaxSettings and settings fields.
  7593. // If target is omitted, writes into ajaxSettings.
  7594. ajaxSetup: function( target, settings ) {
  7595. return settings ?
  7596. // Building a settings object
  7597. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  7598. // Extending ajaxSettings
  7599. ajaxExtend( jQuery.ajaxSettings, target );
  7600. },
  7601. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  7602. ajaxTransport: addToPrefiltersOrTransports( transports ),
  7603. // Main method
  7604. ajax: function( url, options ) {
  7605. // If url is an object, simulate pre-1.5 signature
  7606. if ( typeof url === "object" ) {
  7607. options = url;
  7608. url = undefined;
  7609. }
  7610. // Force options to be an object
  7611. options = options || {};
  7612. var transport,
  7613. // URL without anti-cache param
  7614. cacheURL,
  7615. // Response headers
  7616. responseHeadersString,
  7617. responseHeaders,
  7618. // timeout handle
  7619. timeoutTimer,
  7620. // Url cleanup var
  7621. urlAnchor,
  7622. // Request state (becomes false upon send and true upon completion)
  7623. completed,
  7624. // To know if global events are to be dispatched
  7625. fireGlobals,
  7626. // Loop variable
  7627. i,
  7628. // uncached part of the url
  7629. uncached,
  7630. // Create the final options object
  7631. s = jQuery.ajaxSetup( {}, options ),
  7632. // Callbacks context
  7633. callbackContext = s.context || s,
  7634. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  7635. globalEventContext = s.context &&
  7636. ( callbackContext.nodeType || callbackContext.jquery ) ?
  7637. jQuery( callbackContext ) :
  7638. jQuery.event,
  7639. // Deferreds
  7640. deferred = jQuery.Deferred(),
  7641. completeDeferred = jQuery.Callbacks( "once memory" ),
  7642. // Status-dependent callbacks
  7643. statusCode = s.statusCode || {},
  7644. // Headers (they are sent all at once)
  7645. requestHeaders = {},
  7646. requestHeadersNames = {},
  7647. // Default abort message
  7648. strAbort = "canceled",
  7649. // Fake xhr
  7650. jqXHR = {
  7651. readyState: 0,
  7652. // Builds headers hashtable if needed
  7653. getResponseHeader: function( key ) {
  7654. var match;
  7655. if ( completed ) {
  7656. if ( !responseHeaders ) {
  7657. responseHeaders = {};
  7658. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  7659. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  7660. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  7661. .concat( match[ 2 ] );
  7662. }
  7663. }
  7664. match = responseHeaders[ key.toLowerCase() + " " ];
  7665. }
  7666. return match == null ? null : match.join( ", " );
  7667. },
  7668. // Raw string
  7669. getAllResponseHeaders: function() {
  7670. return completed ? responseHeadersString : null;
  7671. },
  7672. // Caches the header
  7673. setRequestHeader: function( name, value ) {
  7674. if ( completed == null ) {
  7675. name = requestHeadersNames[ name.toLowerCase() ] =
  7676. requestHeadersNames[ name.toLowerCase() ] || name;
  7677. requestHeaders[ name ] = value;
  7678. }
  7679. return this;
  7680. },
  7681. // Overrides response content-type header
  7682. overrideMimeType: function( type ) {
  7683. if ( completed == null ) {
  7684. s.mimeType = type;
  7685. }
  7686. return this;
  7687. },
  7688. // Status-dependent callbacks
  7689. statusCode: function( map ) {
  7690. var code;
  7691. if ( map ) {
  7692. if ( completed ) {
  7693. // Execute the appropriate callbacks
  7694. jqXHR.always( map[ jqXHR.status ] );
  7695. } else {
  7696. // Lazy-add the new callbacks in a way that preserves old ones
  7697. for ( code in map ) {
  7698. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  7699. }
  7700. }
  7701. }
  7702. return this;
  7703. },
  7704. // Cancel the request
  7705. abort: function( statusText ) {
  7706. var finalText = statusText || strAbort;
  7707. if ( transport ) {
  7708. transport.abort( finalText );
  7709. }
  7710. done( 0, finalText );
  7711. return this;
  7712. }
  7713. };
  7714. // Attach deferreds
  7715. deferred.promise( jqXHR );
  7716. // Add protocol if not provided (prefilters might expect it)
  7717. // Handle falsy url in the settings object (#10093: consistency with old signature)
  7718. // We also use the url parameter if available
  7719. s.url = ( ( url || s.url || location.href ) + "" )
  7720. .replace( rprotocol, location.protocol + "//" );
  7721. // Alias method option to type as per ticket #12004
  7722. s.type = options.method || options.type || s.method || s.type;
  7723. // Extract dataTypes list
  7724. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  7725. // A cross-domain request is in order when the origin doesn't match the current origin.
  7726. if ( s.crossDomain == null ) {
  7727. urlAnchor = document.createElement( "a" );
  7728. // Support: IE <=8 - 11, Edge 12 - 15
  7729. // IE throws exception on accessing the href property if url is malformed,
  7730. // e.g. http://example.com:80x/
  7731. try {
  7732. urlAnchor.href = s.url;
  7733. // Support: IE <=8 - 11 only
  7734. // Anchor's host property isn't correctly set when s.url is relative
  7735. urlAnchor.href = urlAnchor.href;
  7736. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  7737. urlAnchor.protocol + "//" + urlAnchor.host;
  7738. } catch ( e ) {
  7739. // If there is an error parsing the URL, assume it is crossDomain,
  7740. // it can be rejected by the transport if it is invalid
  7741. s.crossDomain = true;
  7742. }
  7743. }
  7744. // Convert data if not already a string
  7745. if ( s.data && s.processData && typeof s.data !== "string" ) {
  7746. s.data = jQuery.param( s.data, s.traditional );
  7747. }
  7748. // Apply prefilters
  7749. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  7750. // If request was aborted inside a prefilter, stop there
  7751. if ( completed ) {
  7752. return jqXHR;
  7753. }
  7754. // We can fire global events as of now if asked to
  7755. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  7756. fireGlobals = jQuery.event && s.global;
  7757. // Watch for a new set of requests
  7758. if ( fireGlobals && jQuery.active++ === 0 ) {
  7759. jQuery.event.trigger( "ajaxStart" );
  7760. }
  7761. // Uppercase the type
  7762. s.type = s.type.toUpperCase();
  7763. // Determine if request has content
  7764. s.hasContent = !rnoContent.test( s.type );
  7765. // Save the URL in case we're toying with the If-Modified-Since
  7766. // and/or If-None-Match header later on
  7767. // Remove hash to simplify url manipulation
  7768. cacheURL = s.url.replace( rhash, "" );
  7769. // More options handling for requests with no content
  7770. if ( !s.hasContent ) {
  7771. // Remember the hash so we can put it back
  7772. uncached = s.url.slice( cacheURL.length );
  7773. // If data is available and should be processed, append data to url
  7774. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  7775. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  7776. // #9682: remove data so that it's not used in an eventual retry
  7777. delete s.data;
  7778. }
  7779. // Add or update anti-cache param if needed
  7780. if ( s.cache === false ) {
  7781. cacheURL = cacheURL.replace( rantiCache, "$1" );
  7782. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
  7783. uncached;
  7784. }
  7785. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  7786. s.url = cacheURL + uncached;
  7787. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  7788. } else if ( s.data && s.processData &&
  7789. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  7790. s.data = s.data.replace( r20, "+" );
  7791. }
  7792. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7793. if ( s.ifModified ) {
  7794. if ( jQuery.lastModified[ cacheURL ] ) {
  7795. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  7796. }
  7797. if ( jQuery.etag[ cacheURL ] ) {
  7798. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  7799. }
  7800. }
  7801. // Set the correct header, if data is being sent
  7802. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  7803. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  7804. }
  7805. // Set the Accepts header for the server, depending on the dataType
  7806. jqXHR.setRequestHeader(
  7807. "Accept",
  7808. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  7809. s.accepts[ s.dataTypes[ 0 ] ] +
  7810. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  7811. s.accepts[ "*" ]
  7812. );
  7813. // Check for headers option
  7814. for ( i in s.headers ) {
  7815. jqXHR.setRequestHeader( i, s.headers[ i ] );
  7816. }
  7817. // Allow custom headers/mimetypes and early abort
  7818. if ( s.beforeSend &&
  7819. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  7820. // Abort if not done already and return
  7821. return jqXHR.abort();
  7822. }
  7823. // Aborting is no longer a cancellation
  7824. strAbort = "abort";
  7825. // Install callbacks on deferreds
  7826. completeDeferred.add( s.complete );
  7827. jqXHR.done( s.success );
  7828. jqXHR.fail( s.error );
  7829. // Get transport
  7830. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  7831. // If no transport, we auto-abort
  7832. if ( !transport ) {
  7833. done( -1, "No Transport" );
  7834. } else {
  7835. jqXHR.readyState = 1;
  7836. // Send global event
  7837. if ( fireGlobals ) {
  7838. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  7839. }
  7840. // If request was aborted inside ajaxSend, stop there
  7841. if ( completed ) {
  7842. return jqXHR;
  7843. }
  7844. // Timeout
  7845. if ( s.async && s.timeout > 0 ) {
  7846. timeoutTimer = window.setTimeout( function() {
  7847. jqXHR.abort( "timeout" );
  7848. }, s.timeout );
  7849. }
  7850. try {
  7851. completed = false;
  7852. transport.send( requestHeaders, done );
  7853. } catch ( e ) {
  7854. // Rethrow post-completion exceptions
  7855. if ( completed ) {
  7856. throw e;
  7857. }
  7858. // Propagate others as results
  7859. done( -1, e );
  7860. }
  7861. }
  7862. // Callback for when everything is done
  7863. function done( status, nativeStatusText, responses, headers ) {
  7864. var isSuccess, success, error, response, modified,
  7865. statusText = nativeStatusText;
  7866. // Ignore repeat invocations
  7867. if ( completed ) {
  7868. return;
  7869. }
  7870. completed = true;
  7871. // Clear timeout if it exists
  7872. if ( timeoutTimer ) {
  7873. window.clearTimeout( timeoutTimer );
  7874. }
  7875. // Dereference transport for early garbage collection
  7876. // (no matter how long the jqXHR object will be used)
  7877. transport = undefined;
  7878. // Cache response headers
  7879. responseHeadersString = headers || "";
  7880. // Set readyState
  7881. jqXHR.readyState = status > 0 ? 4 : 0;
  7882. // Determine if successful
  7883. isSuccess = status >= 200 && status < 300 || status === 304;
  7884. // Get response data
  7885. if ( responses ) {
  7886. response = ajaxHandleResponses( s, jqXHR, responses );
  7887. }
  7888. // Use a noop converter for missing script
  7889. if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
  7890. s.converters[ "text script" ] = function() {};
  7891. }
  7892. // Convert no matter what (that way responseXXX fields are always set)
  7893. response = ajaxConvert( s, response, jqXHR, isSuccess );
  7894. // If successful, handle type chaining
  7895. if ( isSuccess ) {
  7896. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7897. if ( s.ifModified ) {
  7898. modified = jqXHR.getResponseHeader( "Last-Modified" );
  7899. if ( modified ) {
  7900. jQuery.lastModified[ cacheURL ] = modified;
  7901. }
  7902. modified = jqXHR.getResponseHeader( "etag" );
  7903. if ( modified ) {
  7904. jQuery.etag[ cacheURL ] = modified;
  7905. }
  7906. }
  7907. // if no content
  7908. if ( status === 204 || s.type === "HEAD" ) {
  7909. statusText = "nocontent";
  7910. // if not modified
  7911. } else if ( status === 304 ) {
  7912. statusText = "notmodified";
  7913. // If we have data, let's convert it
  7914. } else {
  7915. statusText = response.state;
  7916. success = response.data;
  7917. error = response.error;
  7918. isSuccess = !error;
  7919. }
  7920. } else {
  7921. // Extract error from statusText and normalize for non-aborts
  7922. error = statusText;
  7923. if ( status || !statusText ) {
  7924. statusText = "error";
  7925. if ( status < 0 ) {
  7926. status = 0;
  7927. }
  7928. }
  7929. }
  7930. // Set data for the fake xhr object
  7931. jqXHR.status = status;
  7932. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7933. // Success/Error
  7934. if ( isSuccess ) {
  7935. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7936. } else {
  7937. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7938. }
  7939. // Status-dependent callbacks
  7940. jqXHR.statusCode( statusCode );
  7941. statusCode = undefined;
  7942. if ( fireGlobals ) {
  7943. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7944. [ jqXHR, s, isSuccess ? success : error ] );
  7945. }
  7946. // Complete
  7947. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7948. if ( fireGlobals ) {
  7949. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7950. // Handle the global AJAX counter
  7951. if ( !( --jQuery.active ) ) {
  7952. jQuery.event.trigger( "ajaxStop" );
  7953. }
  7954. }
  7955. }
  7956. return jqXHR;
  7957. },
  7958. getJSON: function( url, data, callback ) {
  7959. return jQuery.get( url, data, callback, "json" );
  7960. },
  7961. getScript: function( url, callback ) {
  7962. return jQuery.get( url, undefined, callback, "script" );
  7963. }
  7964. } );
  7965. jQuery.each( [ "get", "post" ], function( _i, method ) {
  7966. jQuery[ method ] = function( url, data, callback, type ) {
  7967. // Shift arguments if data argument was omitted
  7968. if ( isFunction( data ) ) {
  7969. type = type || callback;
  7970. callback = data;
  7971. data = undefined;
  7972. }
  7973. // The url can be an options object (which then must have .url)
  7974. return jQuery.ajax( jQuery.extend( {
  7975. url: url,
  7976. type: method,
  7977. dataType: type,
  7978. data: data,
  7979. success: callback
  7980. }, jQuery.isPlainObject( url ) && url ) );
  7981. };
  7982. } );
  7983. jQuery.ajaxPrefilter( function( s ) {
  7984. var i;
  7985. for ( i in s.headers ) {
  7986. if ( i.toLowerCase() === "content-type" ) {
  7987. s.contentType = s.headers[ i ] || "";
  7988. }
  7989. }
  7990. } );
  7991. jQuery._evalUrl = function( url, options, doc ) {
  7992. return jQuery.ajax( {
  7993. url: url,
  7994. // Make this explicit, since user can override this through ajaxSetup (#11264)
  7995. type: "GET",
  7996. dataType: "script",
  7997. cache: true,
  7998. async: false,
  7999. global: false,
  8000. // Only evaluate the response if it is successful (gh-4126)
  8001. // dataFilter is not invoked for failure responses, so using it instead
  8002. // of the default converter is kludgy but it works.
  8003. converters: {
  8004. "text script": function() {}
  8005. },
  8006. dataFilter: function( response ) {
  8007. jQuery.globalEval( response, options, doc );
  8008. }
  8009. } );
  8010. };
  8011. jQuery.fn.extend( {
  8012. wrapAll: function( html ) {
  8013. var wrap;
  8014. if ( this[ 0 ] ) {
  8015. if ( isFunction( html ) ) {
  8016. html = html.call( this[ 0 ] );
  8017. }
  8018. // The elements to wrap the target around
  8019. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  8020. if ( this[ 0 ].parentNode ) {
  8021. wrap.insertBefore( this[ 0 ] );
  8022. }
  8023. wrap.map( function() {
  8024. var elem = this;
  8025. while ( elem.firstElementChild ) {
  8026. elem = elem.firstElementChild;
  8027. }
  8028. return elem;
  8029. } ).append( this );
  8030. }
  8031. return this;
  8032. },
  8033. wrapInner: function( html ) {
  8034. if ( isFunction( html ) ) {
  8035. return this.each( function( i ) {
  8036. jQuery( this ).wrapInner( html.call( this, i ) );
  8037. } );
  8038. }
  8039. return this.each( function() {
  8040. var self = jQuery( this ),
  8041. contents = self.contents();
  8042. if ( contents.length ) {
  8043. contents.wrapAll( html );
  8044. } else {
  8045. self.append( html );
  8046. }
  8047. } );
  8048. },
  8049. wrap: function( html ) {
  8050. var htmlIsFunction = isFunction( html );
  8051. return this.each( function( i ) {
  8052. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  8053. } );
  8054. },
  8055. unwrap: function( selector ) {
  8056. this.parent( selector ).not( "body" ).each( function() {
  8057. jQuery( this ).replaceWith( this.childNodes );
  8058. } );
  8059. return this;
  8060. }
  8061. } );
  8062. jQuery.expr.pseudos.hidden = function( elem ) {
  8063. return !jQuery.expr.pseudos.visible( elem );
  8064. };
  8065. jQuery.expr.pseudos.visible = function( elem ) {
  8066. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  8067. };
  8068. jQuery.ajaxSettings.xhr = function() {
  8069. try {
  8070. return new window.XMLHttpRequest();
  8071. } catch ( e ) {}
  8072. };
  8073. var xhrSuccessStatus = {
  8074. // File protocol always yields status code 0, assume 200
  8075. 0: 200,
  8076. // Support: IE <=9 only
  8077. // #1450: sometimes IE returns 1223 when it should be 204
  8078. 1223: 204
  8079. },
  8080. xhrSupported = jQuery.ajaxSettings.xhr();
  8081. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  8082. support.ajax = xhrSupported = !!xhrSupported;
  8083. jQuery.ajaxTransport( function( options ) {
  8084. var callback, errorCallback;
  8085. // Cross domain only allowed if supported through XMLHttpRequest
  8086. if ( support.cors || xhrSupported && !options.crossDomain ) {
  8087. return {
  8088. send: function( headers, complete ) {
  8089. var i,
  8090. xhr = options.xhr();
  8091. xhr.open(
  8092. options.type,
  8093. options.url,
  8094. options.async,
  8095. options.username,
  8096. options.password
  8097. );
  8098. // Apply custom fields if provided
  8099. if ( options.xhrFields ) {
  8100. for ( i in options.xhrFields ) {
  8101. xhr[ i ] = options.xhrFields[ i ];
  8102. }
  8103. }
  8104. // Override mime type if needed
  8105. if ( options.mimeType && xhr.overrideMimeType ) {
  8106. xhr.overrideMimeType( options.mimeType );
  8107. }
  8108. // X-Requested-With header
  8109. // For cross-domain requests, seeing as conditions for a preflight are
  8110. // akin to a jigsaw puzzle, we simply never set it to be sure.
  8111. // (it can always be set on a per-request basis or even using ajaxSetup)
  8112. // For same-domain requests, won't change header if already provided.
  8113. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  8114. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  8115. }
  8116. // Set headers
  8117. for ( i in headers ) {
  8118. xhr.setRequestHeader( i, headers[ i ] );
  8119. }
  8120. // Callback
  8121. callback = function( type ) {
  8122. return function() {
  8123. if ( callback ) {
  8124. callback = errorCallback = xhr.onload =
  8125. xhr.onerror = xhr.onabort = xhr.ontimeout =
  8126. xhr.onreadystatechange = null;
  8127. if ( type === "abort" ) {
  8128. xhr.abort();
  8129. } else if ( type === "error" ) {
  8130. // Support: IE <=9 only
  8131. // On a manual native abort, IE9 throws
  8132. // errors on any property access that is not readyState
  8133. if ( typeof xhr.status !== "number" ) {
  8134. complete( 0, "error" );
  8135. } else {
  8136. complete(
  8137. // File: protocol always yields status 0; see #8605, #14207
  8138. xhr.status,
  8139. xhr.statusText
  8140. );
  8141. }
  8142. } else {
  8143. complete(
  8144. xhrSuccessStatus[ xhr.status ] || xhr.status,
  8145. xhr.statusText,
  8146. // Support: IE <=9 only
  8147. // IE9 has no XHR2 but throws on binary (trac-11426)
  8148. // For XHR2 non-text, let the caller handle it (gh-2498)
  8149. ( xhr.responseType || "text" ) !== "text" ||
  8150. typeof xhr.responseText !== "string" ?
  8151. { binary: xhr.response } :
  8152. { text: xhr.responseText },
  8153. xhr.getAllResponseHeaders()
  8154. );
  8155. }
  8156. }
  8157. };
  8158. };
  8159. // Listen to events
  8160. xhr.onload = callback();
  8161. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  8162. // Support: IE 9 only
  8163. // Use onreadystatechange to replace onabort
  8164. // to handle uncaught aborts
  8165. if ( xhr.onabort !== undefined ) {
  8166. xhr.onabort = errorCallback;
  8167. } else {
  8168. xhr.onreadystatechange = function() {
  8169. // Check readyState before timeout as it changes
  8170. if ( xhr.readyState === 4 ) {
  8171. // Allow onerror to be called first,
  8172. // but that will not handle a native abort
  8173. // Also, save errorCallback to a variable
  8174. // as xhr.onerror cannot be accessed
  8175. window.setTimeout( function() {
  8176. if ( callback ) {
  8177. errorCallback();
  8178. }
  8179. } );
  8180. }
  8181. };
  8182. }
  8183. // Create the abort callback
  8184. callback = callback( "abort" );
  8185. try {
  8186. // Do send the request (this may raise an exception)
  8187. xhr.send( options.hasContent && options.data || null );
  8188. } catch ( e ) {
  8189. // #14683: Only rethrow if this hasn't been notified as an error yet
  8190. if ( callback ) {
  8191. throw e;
  8192. }
  8193. }
  8194. },
  8195. abort: function() {
  8196. if ( callback ) {
  8197. callback();
  8198. }
  8199. }
  8200. };
  8201. }
  8202. } );
  8203. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  8204. jQuery.ajaxPrefilter( function( s ) {
  8205. if ( s.crossDomain ) {
  8206. s.contents.script = false;
  8207. }
  8208. } );
  8209. // Install script dataType
  8210. jQuery.ajaxSetup( {
  8211. accepts: {
  8212. script: "text/javascript, application/javascript, " +
  8213. "application/ecmascript, application/x-ecmascript"
  8214. },
  8215. contents: {
  8216. script: /\b(?:java|ecma)script\b/
  8217. },
  8218. converters: {
  8219. "text script": function( text ) {
  8220. jQuery.globalEval( text );
  8221. return text;
  8222. }
  8223. }
  8224. } );
  8225. // Handle cache's special case and crossDomain
  8226. jQuery.ajaxPrefilter( "script", function( s ) {
  8227. if ( s.cache === undefined ) {
  8228. s.cache = false;
  8229. }
  8230. if ( s.crossDomain ) {
  8231. s.type = "GET";
  8232. }
  8233. } );
  8234. // Bind script tag hack transport
  8235. jQuery.ajaxTransport( "script", function( s ) {
  8236. // This transport only deals with cross domain or forced-by-attrs requests
  8237. if ( s.crossDomain || s.scriptAttrs ) {
  8238. var script, callback;
  8239. return {
  8240. send: function( _, complete ) {
  8241. script = jQuery( "<script>" )
  8242. .attr( s.scriptAttrs || {} )
  8243. .prop( { charset: s.scriptCharset, src: s.url } )
  8244. .on( "load error", callback = function( evt ) {
  8245. script.remove();
  8246. callback = null;
  8247. if ( evt ) {
  8248. complete( evt.type === "error" ? 404 : 200, evt.type );
  8249. }
  8250. } );
  8251. // Use native DOM manipulation to avoid our domManip AJAX trickery
  8252. document.head.appendChild( script[ 0 ] );
  8253. },
  8254. abort: function() {
  8255. if ( callback ) {
  8256. callback();
  8257. }
  8258. }
  8259. };
  8260. }
  8261. } );
  8262. var oldCallbacks = [],
  8263. rjsonp = /(=)\?(?=&|$)|\?\?/;
  8264. // Default jsonp settings
  8265. jQuery.ajaxSetup( {
  8266. jsonp: "callback",
  8267. jsonpCallback: function() {
  8268. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
  8269. this[ callback ] = true;
  8270. return callback;
  8271. }
  8272. } );
  8273. // Detect, normalize options and install callbacks for jsonp requests
  8274. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  8275. var callbackName, overwritten, responseContainer,
  8276. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  8277. "url" :
  8278. typeof s.data === "string" &&
  8279. ( s.contentType || "" )
  8280. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  8281. rjsonp.test( s.data ) && "data"
  8282. );
  8283. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  8284. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  8285. // Get callback name, remembering preexisting value associated with it
  8286. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  8287. s.jsonpCallback() :
  8288. s.jsonpCallback;
  8289. // Insert callback into url or form data
  8290. if ( jsonProp ) {
  8291. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  8292. } else if ( s.jsonp !== false ) {
  8293. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  8294. }
  8295. // Use data converter to retrieve json after script execution
  8296. s.converters[ "script json" ] = function() {
  8297. if ( !responseContainer ) {
  8298. jQuery.error( callbackName + " was not called" );
  8299. }
  8300. return responseContainer[ 0 ];
  8301. };
  8302. // Force json dataType
  8303. s.dataTypes[ 0 ] = "json";
  8304. // Install callback
  8305. overwritten = window[ callbackName ];
  8306. window[ callbackName ] = function() {
  8307. responseContainer = arguments;
  8308. };
  8309. // Clean-up function (fires after converters)
  8310. jqXHR.always( function() {
  8311. // If previous value didn't exist - remove it
  8312. if ( overwritten === undefined ) {
  8313. jQuery( window ).removeProp( callbackName );
  8314. // Otherwise restore preexisting value
  8315. } else {
  8316. window[ callbackName ] = overwritten;
  8317. }
  8318. // Save back as free
  8319. if ( s[ callbackName ] ) {
  8320. // Make sure that re-using the options doesn't screw things around
  8321. s.jsonpCallback = originalSettings.jsonpCallback;
  8322. // Save the callback name for future use
  8323. oldCallbacks.push( callbackName );
  8324. }
  8325. // Call if it was a function and we have a response
  8326. if ( responseContainer && isFunction( overwritten ) ) {
  8327. overwritten( responseContainer[ 0 ] );
  8328. }
  8329. responseContainer = overwritten = undefined;
  8330. } );
  8331. // Delegate to script
  8332. return "script";
  8333. }
  8334. } );
  8335. // Support: Safari 8 only
  8336. // In Safari 8 documents created via document.implementation.createHTMLDocument
  8337. // collapse sibling forms: the second one becomes a child of the first one.
  8338. // Because of that, this security measure has to be disabled in Safari 8.
  8339. // https://bugs.webkit.org/show_bug.cgi?id=137337
  8340. support.createHTMLDocument = ( function() {
  8341. var body = document.implementation.createHTMLDocument( "" ).body;
  8342. body.innerHTML = "<form></form><form></form>";
  8343. return body.childNodes.length === 2;
  8344. } )();
  8345. // Argument "data" should be string of html
  8346. // context (optional): If specified, the fragment will be created in this context,
  8347. // defaults to document
  8348. // keepScripts (optional): If true, will include scripts passed in the html string
  8349. jQuery.parseHTML = function( data, context, keepScripts ) {
  8350. if ( typeof data !== "string" ) {
  8351. return [];
  8352. }
  8353. if ( typeof context === "boolean" ) {
  8354. keepScripts = context;
  8355. context = false;
  8356. }
  8357. var base, parsed, scripts;
  8358. if ( !context ) {
  8359. // Stop scripts or inline event handlers from being executed immediately
  8360. // by using document.implementation
  8361. if ( support.createHTMLDocument ) {
  8362. context = document.implementation.createHTMLDocument( "" );
  8363. // Set the base href for the created document
  8364. // so any parsed elements with URLs
  8365. // are based on the document's URL (gh-2965)
  8366. base = context.createElement( "base" );
  8367. base.href = document.location.href;
  8368. context.head.appendChild( base );
  8369. } else {
  8370. context = document;
  8371. }
  8372. }
  8373. parsed = rsingleTag.exec( data );
  8374. scripts = !keepScripts && [];
  8375. // Single tag
  8376. if ( parsed ) {
  8377. return [ context.createElement( parsed[ 1 ] ) ];
  8378. }
  8379. parsed = buildFragment( [ data ], context, scripts );
  8380. if ( scripts && scripts.length ) {
  8381. jQuery( scripts ).remove();
  8382. }
  8383. return jQuery.merge( [], parsed.childNodes );
  8384. };
  8385. /**
  8386. * Load a url into a page
  8387. */
  8388. jQuery.fn.load = function( url, params, callback ) {
  8389. var selector, type, response,
  8390. self = this,
  8391. off = url.indexOf( " " );
  8392. if ( off > -1 ) {
  8393. selector = stripAndCollapse( url.slice( off ) );
  8394. url = url.slice( 0, off );
  8395. }
  8396. // If it's a function
  8397. if ( isFunction( params ) ) {
  8398. // We assume that it's the callback
  8399. callback = params;
  8400. params = undefined;
  8401. // Otherwise, build a param string
  8402. } else if ( params && typeof params === "object" ) {
  8403. type = "POST";
  8404. }
  8405. // If we have elements to modify, make the request
  8406. if ( self.length > 0 ) {
  8407. jQuery.ajax( {
  8408. url: url,
  8409. // If "type" variable is undefined, then "GET" method will be used.
  8410. // Make value of this field explicit since
  8411. // user can override it through ajaxSetup method
  8412. type: type || "GET",
  8413. dataType: "html",
  8414. data: params
  8415. } ).done( function( responseText ) {
  8416. // Save response for use in complete callback
  8417. response = arguments;
  8418. self.html( selector ?
  8419. // If a selector was specified, locate the right elements in a dummy div
  8420. // Exclude scripts to avoid IE 'Permission Denied' errors
  8421. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  8422. // Otherwise use the full result
  8423. responseText );
  8424. // If the request succeeds, this function gets "data", "status", "jqXHR"
  8425. // but they are ignored because response was set above.
  8426. // If it fails, this function gets "jqXHR", "status", "error"
  8427. } ).always( callback && function( jqXHR, status ) {
  8428. self.each( function() {
  8429. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  8430. } );
  8431. } );
  8432. }
  8433. return this;
  8434. };
  8435. jQuery.expr.pseudos.animated = function( elem ) {
  8436. return jQuery.grep( jQuery.timers, function( fn ) {
  8437. return elem === fn.elem;
  8438. } ).length;
  8439. };
  8440. jQuery.offset = {
  8441. setOffset: function( elem, options, i ) {
  8442. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  8443. position = jQuery.css( elem, "position" ),
  8444. curElem = jQuery( elem ),
  8445. props = {};
  8446. // Set position first, in-case top/left are set even on static elem
  8447. if ( position === "static" ) {
  8448. elem.style.position = "relative";
  8449. }
  8450. curOffset = curElem.offset();
  8451. curCSSTop = jQuery.css( elem, "top" );
  8452. curCSSLeft = jQuery.css( elem, "left" );
  8453. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  8454. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  8455. // Need to be able to calculate position if either
  8456. // top or left is auto and position is either absolute or fixed
  8457. if ( calculatePosition ) {
  8458. curPosition = curElem.position();
  8459. curTop = curPosition.top;
  8460. curLeft = curPosition.left;
  8461. } else {
  8462. curTop = parseFloat( curCSSTop ) || 0;
  8463. curLeft = parseFloat( curCSSLeft ) || 0;
  8464. }
  8465. if ( isFunction( options ) ) {
  8466. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  8467. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  8468. }
  8469. if ( options.top != null ) {
  8470. props.top = ( options.top - curOffset.top ) + curTop;
  8471. }
  8472. if ( options.left != null ) {
  8473. props.left = ( options.left - curOffset.left ) + curLeft;
  8474. }
  8475. if ( "using" in options ) {
  8476. options.using.call( elem, props );
  8477. } else {
  8478. if ( typeof props.top === "number" ) {
  8479. props.top += "px";
  8480. }
  8481. if ( typeof props.left === "number" ) {
  8482. props.left += "px";
  8483. }
  8484. curElem.css( props );
  8485. }
  8486. }
  8487. };
  8488. jQuery.fn.extend( {
  8489. // offset() relates an element's border box to the document origin
  8490. offset: function( options ) {
  8491. // Preserve chaining for setter
  8492. if ( arguments.length ) {
  8493. return options === undefined ?
  8494. this :
  8495. this.each( function( i ) {
  8496. jQuery.offset.setOffset( this, options, i );
  8497. } );
  8498. }
  8499. var rect, win,
  8500. elem = this[ 0 ];
  8501. if ( !elem ) {
  8502. return;
  8503. }
  8504. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  8505. // Support: IE <=11 only
  8506. // Running getBoundingClientRect on a
  8507. // disconnected node in IE throws an error
  8508. if ( !elem.getClientRects().length ) {
  8509. return { top: 0, left: 0 };
  8510. }
  8511. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  8512. rect = elem.getBoundingClientRect();
  8513. win = elem.ownerDocument.defaultView;
  8514. return {
  8515. top: rect.top + win.pageYOffset,
  8516. left: rect.left + win.pageXOffset
  8517. };
  8518. },
  8519. // position() relates an element's margin box to its offset parent's padding box
  8520. // This corresponds to the behavior of CSS absolute positioning
  8521. position: function() {
  8522. if ( !this[ 0 ] ) {
  8523. return;
  8524. }
  8525. var offsetParent, offset, doc,
  8526. elem = this[ 0 ],
  8527. parentOffset = { top: 0, left: 0 };
  8528. // position:fixed elements are offset from the viewport, which itself always has zero offset
  8529. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  8530. // Assume position:fixed implies availability of getBoundingClientRect
  8531. offset = elem.getBoundingClientRect();
  8532. } else {
  8533. offset = this.offset();
  8534. // Account for the *real* offset parent, which can be the document or its root element
  8535. // when a statically positioned element is identified
  8536. doc = elem.ownerDocument;
  8537. offsetParent = elem.offsetParent || doc.documentElement;
  8538. while ( offsetParent &&
  8539. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  8540. jQuery.css( offsetParent, "position" ) === "static" ) {
  8541. offsetParent = offsetParent.parentNode;
  8542. }
  8543. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  8544. // Incorporate borders into its offset, since they are outside its content origin
  8545. parentOffset = jQuery( offsetParent ).offset();
  8546. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  8547. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  8548. }
  8549. }
  8550. // Subtract parent offsets and element margins
  8551. return {
  8552. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  8553. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  8554. };
  8555. },
  8556. // This method will return documentElement in the following cases:
  8557. // 1) For the element inside the iframe without offsetParent, this method will return
  8558. // documentElement of the parent window
  8559. // 2) For the hidden or detached element
  8560. // 3) For body or html element, i.e. in case of the html node - it will return itself
  8561. //
  8562. // but those exceptions were never presented as a real life use-cases
  8563. // and might be considered as more preferable results.
  8564. //
  8565. // This logic, however, is not guaranteed and can change at any point in the future
  8566. offsetParent: function() {
  8567. return this.map( function() {
  8568. var offsetParent = this.offsetParent;
  8569. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  8570. offsetParent = offsetParent.offsetParent;
  8571. }
  8572. return offsetParent || documentElement;
  8573. } );
  8574. }
  8575. } );
  8576. // Create scrollLeft and scrollTop methods
  8577. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  8578. var top = "pageYOffset" === prop;
  8579. jQuery.fn[ method ] = function( val ) {
  8580. return access( this, function( elem, method, val ) {
  8581. // Coalesce documents and windows
  8582. var win;
  8583. if ( isWindow( elem ) ) {
  8584. win = elem;
  8585. } else if ( elem.nodeType === 9 ) {
  8586. win = elem.defaultView;
  8587. }
  8588. if ( val === undefined ) {
  8589. return win ? win[ prop ] : elem[ method ];
  8590. }
  8591. if ( win ) {
  8592. win.scrollTo(
  8593. !top ? val : win.pageXOffset,
  8594. top ? val : win.pageYOffset
  8595. );
  8596. } else {
  8597. elem[ method ] = val;
  8598. }
  8599. }, method, val, arguments.length );
  8600. };
  8601. } );
  8602. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  8603. // Add the top/left cssHooks using jQuery.fn.position
  8604. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  8605. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  8606. // getComputedStyle returns percent when specified for top/left/bottom/right;
  8607. // rather than make the css module depend on the offset module, just check for it here
  8608. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  8609. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  8610. function( elem, computed ) {
  8611. if ( computed ) {
  8612. computed = curCSS( elem, prop );
  8613. // If curCSS returns percentage, fallback to offset
  8614. return rnumnonpx.test( computed ) ?
  8615. jQuery( elem ).position()[ prop ] + "px" :
  8616. computed;
  8617. }
  8618. }
  8619. );
  8620. } );
  8621. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  8622. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  8623. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  8624. function( defaultExtra, funcName ) {
  8625. // Margin is only for outerHeight, outerWidth
  8626. jQuery.fn[ funcName ] = function( margin, value ) {
  8627. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  8628. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  8629. return access( this, function( elem, type, value ) {
  8630. var doc;
  8631. if ( isWindow( elem ) ) {
  8632. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  8633. return funcName.indexOf( "outer" ) === 0 ?
  8634. elem[ "inner" + name ] :
  8635. elem.document.documentElement[ "client" + name ];
  8636. }
  8637. // Get document width or height
  8638. if ( elem.nodeType === 9 ) {
  8639. doc = elem.documentElement;
  8640. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  8641. // whichever is greatest
  8642. return Math.max(
  8643. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  8644. elem.body[ "offset" + name ], doc[ "offset" + name ],
  8645. doc[ "client" + name ]
  8646. );
  8647. }
  8648. return value === undefined ?
  8649. // Get width or height on the element, requesting but not forcing parseFloat
  8650. jQuery.css( elem, type, extra ) :
  8651. // Set width or height on the element
  8652. jQuery.style( elem, type, value, extra );
  8653. }, type, chainable ? margin : undefined, chainable );
  8654. };
  8655. } );
  8656. } );
  8657. jQuery.each( [
  8658. "ajaxStart",
  8659. "ajaxStop",
  8660. "ajaxComplete",
  8661. "ajaxError",
  8662. "ajaxSuccess",
  8663. "ajaxSend"
  8664. ], function( _i, type ) {
  8665. jQuery.fn[ type ] = function( fn ) {
  8666. return this.on( type, fn );
  8667. };
  8668. } );
  8669. jQuery.fn.extend( {
  8670. bind: function( types, data, fn ) {
  8671. return this.on( types, null, data, fn );
  8672. },
  8673. unbind: function( types, fn ) {
  8674. return this.off( types, null, fn );
  8675. },
  8676. delegate: function( selector, types, data, fn ) {
  8677. return this.on( types, selector, data, fn );
  8678. },
  8679. undelegate: function( selector, types, fn ) {
  8680. // ( namespace ) or ( selector, types [, fn] )
  8681. return arguments.length === 1 ?
  8682. this.off( selector, "**" ) :
  8683. this.off( types, selector || "**", fn );
  8684. },
  8685. hover: function( fnOver, fnOut ) {
  8686. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  8687. }
  8688. } );
  8689. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  8690. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  8691. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  8692. function( _i, name ) {
  8693. // Handle event binding
  8694. jQuery.fn[ name ] = function( data, fn ) {
  8695. return arguments.length > 0 ?
  8696. this.on( name, null, data, fn ) :
  8697. this.trigger( name );
  8698. };
  8699. } );
  8700. // Support: Android <=4.0 only
  8701. // Make sure we trim BOM and NBSP
  8702. var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  8703. // Bind a function to a context, optionally partially applying any
  8704. // arguments.
  8705. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  8706. // However, it is not slated for removal any time soon
  8707. jQuery.proxy = function( fn, context ) {
  8708. var tmp, args, proxy;
  8709. if ( typeof context === "string" ) {
  8710. tmp = fn[ context ];
  8711. context = fn;
  8712. fn = tmp;
  8713. }
  8714. // Quick check to determine if target is callable, in the spec
  8715. // this throws a TypeError, but we will just return undefined.
  8716. if ( !isFunction( fn ) ) {
  8717. return undefined;
  8718. }
  8719. // Simulated bind
  8720. args = slice.call( arguments, 2 );
  8721. proxy = function() {
  8722. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  8723. };
  8724. // Set the guid of unique handler to the same of original handler, so it can be removed
  8725. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  8726. return proxy;
  8727. };
  8728. jQuery.holdReady = function( hold ) {
  8729. if ( hold ) {
  8730. jQuery.readyWait++;
  8731. } else {
  8732. jQuery.ready( true );
  8733. }
  8734. };
  8735. jQuery.isArray = Array.isArray;
  8736. jQuery.parseJSON = JSON.parse;
  8737. jQuery.nodeName = nodeName;
  8738. jQuery.isFunction = isFunction;
  8739. jQuery.isWindow = isWindow;
  8740. jQuery.camelCase = camelCase;
  8741. jQuery.type = toType;
  8742. jQuery.now = Date.now;
  8743. jQuery.isNumeric = function( obj ) {
  8744. // As of jQuery 3.0, isNumeric is limited to
  8745. // strings and numbers (primitives or objects)
  8746. // that can be coerced to finite numbers (gh-2662)
  8747. var type = jQuery.type( obj );
  8748. return ( type === "number" || type === "string" ) &&
  8749. // parseFloat NaNs numeric-cast false positives ("")
  8750. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  8751. // subtraction forces infinities to NaN
  8752. !isNaN( obj - parseFloat( obj ) );
  8753. };
  8754. jQuery.trim = function( text ) {
  8755. return text == null ?
  8756. "" :
  8757. ( text + "" ).replace( rtrim, "" );
  8758. };
  8759. // Register as a named AMD module, since jQuery can be concatenated with other
  8760. // files that may use define, but not via a proper concatenation script that
  8761. // understands anonymous AMD modules. A named AMD is safest and most robust
  8762. // way to register. Lowercase jquery is used because AMD module names are
  8763. // derived from file names, and jQuery is normally delivered in a lowercase
  8764. // file name. Do this after creating the global so that if an AMD module wants
  8765. // to call noConflict to hide this version of jQuery, it will work.
  8766. // Note that for maximum portability, libraries that are not jQuery should
  8767. // declare themselves as anonymous modules, and avoid setting a global if an
  8768. // AMD loader is present. jQuery is a special case. For more information, see
  8769. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  8770. if ( typeof define === "function" && define.amd ) {
  8771. define( "jquery", [], function() {
  8772. return jQuery;
  8773. } );
  8774. }
  8775. var
  8776. // Map over jQuery in case of overwrite
  8777. _jQuery = window.jQuery,
  8778. // Map over the $ in case of overwrite
  8779. _$ = window.$;
  8780. jQuery.noConflict = function( deep ) {
  8781. if ( window.$ === jQuery ) {
  8782. window.$ = _$;
  8783. }
  8784. if ( deep && window.jQuery === jQuery ) {
  8785. window.jQuery = _jQuery;
  8786. }
  8787. return jQuery;
  8788. };
  8789. // Expose jQuery and $ identifiers, even in AMD
  8790. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  8791. // and CommonJS for browser emulators (#13566)
  8792. if ( typeof noGlobal === "undefined" ) {
  8793. window.jQuery = window.$ = jQuery;
  8794. }
  8795. return jQuery;
  8796. } );
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...