vendor.js
185 KB
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
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
/***/ "./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mpvue-page-factory/index.js":
/*!****************************************************************************************!*\
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mpvue-page-factory/index.js ***!
\****************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mpvue/index.js");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
function callHook$1(vm, hook, params) {
var handlers = vm.$options[hook];
if (hook === 'onError' && handlers) {
handlers = [handlers];
}
if(typeof handlers === 'function'){
handlers = [handlers]
}
var ret;
if (handlers) {
for (var i = 0, j = handlers.length; i < j; i++) {
// try {
ret = handlers[i].call(vm, params);
// } catch (e) {//fixed by xxxxxx
// handleError(e, vm, (hook + " hook"));
// }
}
}
if (vm._hasHookEvent) {
vm.$emit('hook:' + hook);
}
// for child
if (vm.$children.length) {
vm.$children.forEach(function (v) {
return callHook$1(v, hook, params);
});
}
return ret
}
function getRootVueVm(page) {
return page.$vm.$root;
}
/* harmony default export */ __webpack_exports__["default"] = (function (App) {
return {
// 页面的初始数据
data: {
$root: {}
},
// mp lifecycle for vue
// 生命周期函数--监听页面加载
onLoad:function onLoad(query) {
//页面加载的时候
var app = new vue__WEBPACK_IMPORTED_MODULE_0___default.a(App);
// 挂载Vue对象到page上
this.$vm = app;
var rootVueVM = app.$root;
rootVueVM.__wxWebviewId__ = this.__wxWebviewId__//fixed by xxxxxx(createIntersectionObserver)
//初始化mp对象
if (!rootVueVM.$mp) {
rootVueVM.$mp = {};
}
var mp = rootVueVM.$mp;
mp.mpType = 'page';
mp.page = this;
mp.query = query;
mp.status = 'load';
//mount 要在 mp.status = 'load';赋值之后,不然mount方法会重复添加微信Page
//具体原因参考mpvue核心库源码,_initMP方法
app.$mount();
},
handleProxy: function handleProxy(e) {
var rootVueVM = getRootVueVm(this);
return rootVueVM.$handleProxyWithVue(e)
},
// 生命周期函数--监听页面显示
onShow:function onShow() {
var rootVueVM = getRootVueVm(this);
var mp = rootVueVM.$mp;
mp.status = 'show';
callHook$1(rootVueVM, 'onShow');
// // 只有页面需要 setData
rootVueVM.$nextTick(function () {
rootVueVM._initDataToMP();
});
},
// 生命周期函数--监听页面初次渲染完成
onReady:function onReady() {
var rootVueVM = getRootVueVm(this);
var mp = rootVueVM.$mp;
mp.status = 'ready';
callHook$1(rootVueVM, 'onReady');
},
// 生命周期函数--监听页面隐藏
onHide: function onHide() {
var rootVueVM = getRootVueVm(this);
var mp = rootVueVM.$mp;
mp.status = 'hide';
callHook$1(rootVueVM, 'onHide');
},
// 生命周期函数--监听页面卸载
onUnload: function onUnload() {
var rootVueVM = getRootVueVm(this);
callHook$1(rootVueVM, 'onUnload');
rootVueVM.$destroy();
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function onPullDownRefresh() {
var rootVueVM = getRootVueVm(this);
callHook$1(rootVueVM, 'onPullDownRefresh');
},
// 页面上拉触底事件的处理函数
onReachBottom: function onReachBottom() {
var rootVueVM = getRootVueVm(this);
callHook$1(rootVueVM, 'onReachBottom');
},
// Do something when page scroll
onPageScroll: function onPageScroll(options) {
var rootVueVM = getRootVueVm(this);
callHook$1(rootVueVM, 'onPageScroll', options);
},
// 当前是 tab 页时,点击 tab 时触发
onTabItemTap: function onTabItemTap(options) {
var rootVueVM = getRootVueVm(this);
callHook$1(rootVueVM, 'onTabItemTap', options);
},
// // 用户点击右上角分享
onShareAppMessage: App.onShareAppMessage ?
function (options) {
var rootVueVM = getRootVueVm(this);
return callHook$1(rootVueVM, 'onShareAppMessage', options);
} : null,
//fixed by xxxxxx
onNavigationBarButtonTap: function onNavigationBarButtonTap(options) {
var rootVueVM = getRootVueVm(this);
callHook$1(rootVueVM, "onNavigationBarButtonTap", options)
},
onNavigationBarSearchInputChanged: function onNavigationBarSearchInputChanged(options) {
var rootVueVM = getRootVueVm(this);
callHook$1(rootVueVM, "onNavigationBarSearchInputChanged", options)
},
onNavigationBarSearchInputConfirmed: function onNavigationBarSearchInputConfirmed(options) {
var rootVueVM = getRootVueVm(this);
callHook$1(rootVueVM, "onNavigationBarSearchInputConfirmed", options)
},
onNavigationBarSearchInputClicked: function onNavigationBarSearchInputClicked(options) {
var rootVueVM = getRootVueVm(this);
callHook$1(rootVueVM, "onNavigationBarSearchInputClicked", options)
},
onBackPress: function onBackPress(options) {
var rootVueVM = getRootVueVm(this);
return callHook$1(rootVueVM, "onBackPress",options)
},
$getAppWebview:function (e) {
return plus.webview.getWebviewById('' + this.__wxWebviewId__)
}
};
});
/***/ }),
/***/ "./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mpvue/index.js":
/*!***************************************************************************!*\
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mpvue/index.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {// fix env
try {
if (!global) global = {}
global.process = global.process || {}
global.process.env = global.process.env || {}
global.App = global.App || App
global.Page = global.Page || Page
global.Component = global.Component || Component
global.getApp = global.getApp || getApp
} catch (e) {}
;(function(global, factory) {
true
? (module.exports = factory())
: undefined
})(this, function() {
"use strict"
//fixed by xxxxxx
function calcDiff(holder, key, newObj, oldObj) {
if (newObj === oldObj || newObj === undefined) {
return
}
if (newObj == null || oldObj == null || typeof newObj !== typeof oldObj) {
holder[key] = newObj
} else if (Array.isArray(newObj) && Array.isArray(oldObj)) {
if (newObj.length === oldObj.length) {
for (var i = 0, len = newObj.length; i < len; ++i) {
calcDiff(holder, key + "[" + i + "]", newObj[i], oldObj[i])
}
} else {
holder[key] = newObj
}
} else if (typeof newObj === "object" && typeof oldObj === "object") {
var newKeys = Object.keys(newObj)
var oldKeys = Object.keys(oldObj)
if (newKeys.length !== oldKeys.length) {
holder[key] = newObj
} else {
var allKeysSet = Object.create(null)
for (var i = 0, len = newKeys.length; i < len; ++i) {
allKeysSet[newKeys[i]] = true
allKeysSet[oldKeys[i]] = true
}
if (Object.keys(allKeysSet).length !== newKeys.length) {
holder[key] = newObj
} else {
for (var i = 0, len = newKeys.length; i < len; ++i) {
var k = newKeys[i]
calcDiff(holder, key + "." + k, newObj[k], oldObj[k])
}
}
}
} else if (newObj !== oldObj) {
holder[key] = newObj
}
}
function diff(newObj, oldObj) {
var keys = Object.keys(newObj)
var diffResult = {}
for (var i = 0, len = keys.length; i < len; ++i) {
var k = keys[i]
var oldKeyPath = k.split(".")
var oldValue = oldObj[oldKeyPath[0]]
for (var j = 1, jlen = oldKeyPath.length; j < jlen && oldValue !== undefined; ++j) {
oldValue = oldValue[oldKeyPath[j]]
}
calcDiff(diffResult, k, newObj[k], oldValue)
}
return diffResult
}
/* */
// these helpers produces better vm code in JS engines due to their
// explicitness and function inlining
function isUndef(v) {
return v === undefined || v === null
}
function isDef(v) {
return v !== undefined && v !== null
}
function isTrue(v) {
return v === true
}
function isFalse(v) {
return v === false
}
/**
* Check if value is primitive
*/
function isPrimitive(value) {
return typeof value === "string" || typeof value === "number"
}
/**
* Quick object check - this is primarily used to tell
* Objects from primitive values when we know the value
* is a JSON-compliant type.
*/
function isObject(obj) {
return obj !== null && typeof obj === "object"
}
var _toString = Object.prototype.toString
/**
* Strict object type check. Only returns true
* for plain JavaScript objects.
*/
function isPlainObject(obj) {
return _toString.call(obj) === "[object Object]"
}
function isRegExp(v) {
return _toString.call(v) === "[object RegExp]"
}
/**
* Check if val is a valid array index.
*/
function isValidArrayIndex(val) {
var n = parseFloat(val)
return n >= 0 && Math.floor(n) === n && isFinite(val)
}
/**
* Convert a value to a string that is actually rendered.
*/
function toString(val) {
return val == null
? ""
: typeof val === "object"
? JSON.stringify(val, null, 2)
: String(val)
}
/**
* Convert a input value to a number for persistence.
* If the conversion fails, return original string.
*/
function toNumber(val) {
var n = parseFloat(val)
return isNaN(n) ? val : n
}
/**
* Make a map and return a function for checking if a key
* is in that map.
*/
function makeMap(str, expectsLowerCase) {
var map = Object.create(null)
var list = str.split(",")
for (var i = 0; i < list.length; i++) {
map[list[i]] = true
}
return expectsLowerCase
? function(val) {
return map[val.toLowerCase()]
}
: function(val) {
return map[val]
}
}
/**
* Check if a tag is a built-in tag.
*/
var isBuiltInTag = makeMap("slot,component", true)
/**
* Check if a attribute is a reserved attribute.
*/
var isReservedAttribute = makeMap("key,ref,slot,is")
/**
* Remove an item from an array
*/
function remove(arr, item) {
if (arr.length) {
var index = arr.indexOf(item)
if (index > -1) {
return arr.splice(index, 1)
}
}
}
/**
* Check whether the object has the property.
*/
var hasOwnProperty = Object.prototype.hasOwnProperty
function hasOwn(obj, key) {
return hasOwnProperty.call(obj, key)
}
/**
* Create a cached version of a pure function.
*/
function cached(fn) {
var cache = Object.create(null)
return function cachedFn(str) {
var hit = cache[str]
return hit || (cache[str] = fn(str))
}
}
/**
* Camelize a hyphen-delimited string.
*/
var camelizeRE = /-(\w)/g
var camelize = cached(function(str) {
return str.replace(camelizeRE, function(_, c) {
return c ? c.toUpperCase() : ""
})
})
/**
* Capitalize a string.
*/
var capitalize = cached(function(str) {
return str.charAt(0).toUpperCase() + str.slice(1)
})
/**
* Hyphenate a camelCase string.
*/
var hyphenateRE = /([^-])([A-Z])/g
var hyphenate = cached(function(str) {
return str
.replace(hyphenateRE, "$1-$2")
.replace(hyphenateRE, "$1-$2")
.toLowerCase()
})
/**
* Simple bind, faster than native
*/
function bind(fn, ctx) {
function boundFn(a) {
var l = arguments.length
return l ? (l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a)) : fn.call(ctx)
}
// record original fn length
boundFn._length = fn.length
return boundFn
}
/**
* Convert an Array-like object to a real Array.
*/
function toArray(list, start) {
start = start || 0
var i = list.length - start
var ret = new Array(i)
while (i--) {
ret[i] = list[i + start]
}
return ret
}
/**
* Mix properties into target object.
*/
function extend(to, _from) {
for (var key in _from) {
to[key] = _from[key]
}
return to
}
/**
* Merge an Array of Objects into a single Object.
*/
function toObject(arr) {
var res = {}
for (var i = 0; i < arr.length; i++) {
if (arr[i]) {
extend(res, arr[i])
}
}
return res
}
/**
* Perform no operation.
* Stubbing args to make Flow happy without leaving useless transpiled code
* with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
*/
function noop(a, b, c) {}
/**
* Always return false.
*/
var no = function(a, b, c) {
return false
}
/**
* Return same value
*/
var identity = function(_) {
return _
}
/**
* Generate a static keys string from compiler modules.
*/
/**
* Check if two values are loosely equal - that is,
* if they are plain objects, do they have the same shape?
*/
function looseEqual(a, b) {
var isObjectA = isObject(a)
var isObjectB = isObject(b)
if (isObjectA && isObjectB) {
try {
return JSON.stringify(a) === JSON.stringify(b)
} catch (e) {
// possible circular reference
return a === b
}
} else if (!isObjectA && !isObjectB) {
return String(a) === String(b)
} else {
return false
}
}
function looseIndexOf(arr, val) {
for (var i = 0; i < arr.length; i++) {
if (looseEqual(arr[i], val)) {
return i
}
}
return -1
}
/**
* Ensure a function is called only once.
*/
function once(fn) {
var called = false
return function() {
if (!called) {
called = true
fn.apply(this, arguments)
}
}
}
var SSR_ATTR = "data-server-rendered"
var ASSET_TYPES = ["component", "directive", "filter"]
var LIFECYCLE_HOOKS = [
"beforeCreate",
"created",
"beforeMount",
"mounted",
"beforeUpdate",
"updated",
"beforeDestroy",
"destroyed",
"activated",
"deactivated",
"onLaunch",
"onLoad",
"onShow",
"onReady",
"onHide",
"onUnload",
"onPullDownRefresh",
"onReachBottom",
"onShareAppMessage",
"onPageScroll",
"onTabItemTap",
"attached",
"ready",
"moved",
"detached",
"onUniNViewMessage", //fixed by xxxxxx
"onNavigationBarButtonTap", //fixed by xxxxxx
"onBackPress",//fixed by xxxxxx
]
/* */
var config = {
/**
* Option merge strategies (used in core/util/options)
*/
optionMergeStrategies: Object.create(null),
/**
* Whether to suppress warnings.
*/
silent: false,
/**
* Show production mode tip message on boot?
*/
productionTip: "production" !== "production",
/**
* Whether to enable devtools
*/
devtools: "production" !== "production",
/**
* Whether to record perf
*/
performance: false,
/**
* Error handler for watcher errors
*/
errorHandler: null,
/**
* Warn handler for watcher warns
*/
warnHandler: null,
/**
* Ignore certain custom elements
*/
ignoredElements: [],
/**
* Custom user key aliases for v-on
*/
keyCodes: Object.create(null),
/**
* Check if a tag is reserved so that it cannot be registered as a
* component. This is platform-dependent and may be overwritten.
*/
isReservedTag: no,
/**
* Check if an attribute is reserved so that it cannot be used as a component
* prop. This is platform-dependent and may be overwritten.
*/
isReservedAttr: no,
/**
* Check if a tag is an unknown element.
* Platform-dependent.
*/
isUnknownElement: no,
/**
* Get the namespace of an element
*/
getTagNamespace: noop,
/**
* Parse the real tag name for the specific platform.
*/
parsePlatformTagName: identity,
/**
* Check if an attribute must be bound using property, e.g. value
* Platform-dependent.
*/
mustUseProp: no,
/**
* Exposed for legacy reasons
*/
_lifecycleHooks: LIFECYCLE_HOOKS
}
/* */
var emptyObject = Object.freeze({})
/**
* Check if a string starts with $ or _
*/
function isReserved(str) {
var c = (str + "").charCodeAt(0)
return c === 0x24 || c === 0x5f
}
/**
* Define a property.
*/
function def(obj, key, val, enumerable) {
Object.defineProperty(obj, key, {
value: val,
enumerable: !!enumerable,
writable: true,
configurable: true
})
}
/**
* Parse simple path.
*/
var bailRE = /[^\w.$]/
function parsePath(path) {
if (bailRE.test(path)) {
return
}
var segments = path.split(".")
return function(obj) {
for (var i = 0; i < segments.length; i++) {
if (!obj) {
return
}
obj = obj[segments[i]]
}
return obj
}
}
/* */
var warn = noop
var formatComponentName = null // work around flow check
/* */
function handleError(err, vm, info) {
if (config.errorHandler) {
config.errorHandler.call(null, err, vm, info)
} else {
if (inBrowser && typeof console !== "undefined") {
console.error(err)
} else {
throw err
}
}
}
/* */
// can we use __proto__?
var hasProto = "__proto__" in {}
// Browser environment sniffing
var inBrowser = typeof window !== "undefined"
var UA = ["mpvue-runtime"].join()
var isIE = UA && /msie|trident/.test(UA)
var isIE9 = UA && UA.indexOf("msie 9.0") > 0
var isEdge = UA && UA.indexOf("edge/") > 0
var isAndroid = UA && UA.indexOf("android") > 0
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA)
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge
// Firefix has a "watch" function on Object.prototype...
var nativeWatch = {}.watch
var supportsPassive = false
if (inBrowser) {
try {
var opts = {}
Object.defineProperty(opts, "passive", {
get: function get() {
/* istanbul ignore next */
supportsPassive = true
}
}) // https://github.com/facebook/flow/issues/285
window.addEventListener("test-passive", null, opts)
} catch (e) {}
}
// this needs to be lazy-evaled because vue may be required before
// vue-server-renderer can set VUE_ENV
var _isServer
var isServerRendering = function() {
if (_isServer === undefined) {
/* istanbul ignore if */
if (!inBrowser && typeof global !== "undefined") {
// detect presence of vue-server-renderer and avoid
// Webpack shimming the process
_isServer = global["process"].env.VUE_ENV === "server"
} else {
_isServer = false
}
}
return _isServer
}
// detect devtools
var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__
/* istanbul ignore next */
function isNative(Ctor) {
return typeof Ctor === "function" && /native code/.test(Ctor.toString())
}
var hasSymbol =
typeof Symbol !== "undefined" &&
isNative(Symbol) &&
typeof Reflect !== "undefined" &&
isNative(Reflect.ownKeys)
/**
* Defer a task to execute it asynchronously.
*/
var nextTick = (function() {
var callbacks = []
var pending = false
var timerFunc
function nextTickHandler() {
pending = false
var copies = callbacks.slice(0)
callbacks.length = 0
for (var i = 0; i < copies.length; i++) {
copies[i]()
}
}
// the nextTick behavior leverages the microtask queue, which can be accessed
// via either native Promise.then or MutationObserver.
// MutationObserver has wider support, however it is seriously bugged in
// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
// completely stops working after triggering a few times... so, if native
// Promise is available, we will use it:
/* istanbul ignore if */
if (typeof Promise !== "undefined" && isNative(Promise)) {
var p = Promise.resolve()
var logError = function(err) {
console.error(err)
}
timerFunc = function() {
p.then(nextTickHandler).catch(logError)
// in problematic UIWebViews, Promise.then doesn't completely break, but
// it can get stuck in a weird state where callbacks are pushed into the
// microtask queue but the queue isn't being flushed, until the browser
// needs to do some other work, e.g. handle a timer. Therefore we can
// "force" the microtask queue to be flushed by adding an empty timer.
if (isIOS) {
setTimeout(noop)
}
}
// } else if (typeof MutationObserver !== 'undefined' && (
// isNative(MutationObserver) ||
// // PhantomJS and iOS 7.x
// MutationObserver.toString() === '[object MutationObserverConstructor]'
// )) {
// // use MutationObserver where native Promise is not available,
// // e.g. PhantomJS IE11, iOS7, Android 4.4
// var counter = 1
// var observer = new MutationObserver(nextTickHandler)
// var textNode = document.createTextNode(String(counter))
// observer.observe(textNode, {
// characterData: true
// })
// timerFunc = () => {
// counter = (counter + 1) % 2
// textNode.data = String(counter)
// }
} else {
// fallback to setTimeout
/* istanbul ignore next */
timerFunc = function() {
setTimeout(nextTickHandler, 0)
}
}
return function queueNextTick(cb, ctx) {
var _resolve
callbacks.push(function() {
if (cb) {
try {
cb.call(ctx)
} catch (e) {
handleError(e, ctx, "nextTick")
}
} else if (_resolve) {
_resolve(ctx)
}
})
if (!pending) {
pending = true
timerFunc()
}
if (!cb && typeof Promise !== "undefined") {
return new Promise(function(resolve, reject) {
_resolve = resolve
})
}
}
})()
var _Set
/* istanbul ignore if */
if (typeof Set !== "undefined" && isNative(Set)) {
// use native Set when available.
_Set = Set
} else {
// a non-standard Set polyfill that only works with primitive keys.
_Set = (function() {
function Set() {
this.set = Object.create(null)
}
Set.prototype.has = function has(key) {
return this.set[key] === true
}
Set.prototype.add = function add(key) {
this.set[key] = true
}
Set.prototype.clear = function clear() {
this.set = Object.create(null)
}
return Set
})()
}
/* */
var uid$1 = 0
/**
* A dep is an observable that can have multiple
* directives subscribing to it.
*/
var Dep = function Dep() {
this.id = uid$1++
this.subs = []
}
Dep.prototype.addSub = function addSub(sub) {
this.subs.push(sub)
}
Dep.prototype.removeSub = function removeSub(sub) {
remove(this.subs, sub)
}
Dep.prototype.depend = function depend() {
if (Dep.target) {
Dep.target.addDep(this)
}
}
Dep.prototype.notify = function notify() {
// stabilize the subscriber list first
var subs = this.subs.slice()
for (var i = 0, l = subs.length; i < l; i++) {
subs[i].update()
}
}
// the current target watcher being evaluated.
// this is globally unique because there could be only one
// watcher being evaluated at any time.
Dep.target = null
var targetStack = []
function pushTarget(_target) {
if (Dep.target) {
targetStack.push(Dep.target)
}
Dep.target = _target
}
function popTarget() {
Dep.target = targetStack.pop()
}
/*
* not type checking this file because flow doesn't play well with
* dynamically accessing methods on Array prototype
*/
var arrayProto = Array.prototype
var arrayMethods = Object.create(arrayProto)
;["push", "pop", "shift", "unshift", "splice", "sort", "reverse"].forEach(function(method) {
// cache original method
var original = arrayProto[method]
def(arrayMethods, method, function mutator() {
var args = [],
len = arguments.length
while (len--) args[len] = arguments[len]
var result = original.apply(this, args)
var ob = this.__ob__
var inserted
switch (method) {
case "push":
case "unshift":
inserted = args
break
case "splice":
inserted = args.slice(2)
break
}
if (inserted) {
ob.observeArray(inserted)
}
// notify change
ob.dep.notify()
return result
})
})
/* */
var arrayKeys = Object.getOwnPropertyNames(arrayMethods)
/**
* By default, when a reactive property is set, the new value is
* also converted to become reactive. However when passing down props,
* we don't want to force conversion because the value may be a nested value
* under a frozen data structure. Converting it would defeat the optimization.
*/
var observerState = {
shouldConvert: true
}
/**
* Observer class that are attached to each observed
* object. Once attached, the observer converts target
* object's property keys into getter/setters that
* collect dependencies and dispatches updates.
*/
var Observer = function Observer(value) {
this.value = value
this.dep = new Dep()
this.vmCount = 0
def(value, "__ob__", this)
if (Array.isArray(value)) {
var augment = hasProto ? protoAugment : copyAugment
augment(value, arrayMethods, arrayKeys)
this.observeArray(value)
} else {
this.walk(value)
}
}
/**
* Walk through each property and convert them into
* getter/setters. This method should only be called when
* value type is Object.
*/
Observer.prototype.walk = function walk(obj) {
var keys = Object.keys(obj)
for (var i = 0; i < keys.length; i++) {
defineReactive$$1(obj, keys[i], obj[keys[i]])
}
}
/**
* Observe a list of Array items.
*/
Observer.prototype.observeArray = function observeArray(items) {
for (var i = 0, l = items.length; i < l; i++) {
observe(items[i])
}
}
// helpers
/**
* Augment an target Object or Array by intercepting
* the prototype chain using __proto__
*/
function protoAugment(target, src, keys) {
/* eslint-disable no-proto */
target.__proto__ = src
/* eslint-enable no-proto */
}
/**
* Augment an target Object or Array by defining
* hidden properties.
*/
/* istanbul ignore next */
function copyAugment(target, src, keys) {
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i]
def(target, key, src[key])
}
}
/**
* Attempt to create an observer instance for a value,
* returns the new observer if successfully observed,
* or the existing observer if the value already has one.
*/
function observe(value, asRootData) {
if (!isObject(value)) {
return
}
var ob
if (hasOwn(value, "__ob__") && value.__ob__ instanceof Observer) {
ob = value.__ob__
} else if (
observerState.shouldConvert &&
!isServerRendering() &&
(Array.isArray(value) || isPlainObject(value)) &&
Object.isExtensible(value) &&
!value._isVue
) {
ob = new Observer(value)
}
if (asRootData && ob) {
ob.vmCount++
}
return ob
}
/**
* Define a reactive property on an Object.
*/
function defineReactive$$1(obj, key, val, customSetter, shallow) {
var dep = new Dep()
var property = Object.getOwnPropertyDescriptor(obj, key)
if (property && property.configurable === false) {
return
}
// cater for pre-defined getter/setters
var getter = property && property.get
var setter = property && property.set
var childOb = !shallow && observe(val)
Object.defineProperty(obj, key, {
enumerable: true,
configurable: true,
get: function reactiveGetter() {
var value = getter ? getter.call(obj) : val
if (Dep.target) {
dep.depend()
if (childOb) {
childOb.dep.depend()
}
if (Array.isArray(value)) {
dependArray(value)
}
}
return value
},
set: function reactiveSetter(newVal) {
var value = getter ? getter.call(obj) : val
/* eslint-disable no-self-compare */
if (newVal === value || (newVal !== newVal && value !== value)) {
return
}
/* eslint-enable no-self-compare */
if (false) {}
if (setter) {
setter.call(obj, newVal)
} else {
val = newVal
}
childOb = !shallow && observe(newVal)
dep.notify()
}
})
}
/**
* Set a property on an object. Adds the new property and
* triggers change notification if the property doesn't
* already exist.
*/
function set(target, key, val) {
if (Array.isArray(target) && isValidArrayIndex(key)) {
target.length = Math.max(target.length, key)
target.splice(key, 1, val)
return val
}
if (hasOwn(target, key)) {
target[key] = val
return val
}
var ob = target.__ob__
if (target._isVue || (ob && ob.vmCount)) {
false &&
false
return val
}
if (!ob) {
target[key] = val
return val
}
defineReactive$$1(ob.value, key, val)
ob.dep.notify()
return val
}
/**
* Delete a property and trigger change if necessary.
*/
function del(target, key) {
if (Array.isArray(target) && isValidArrayIndex(key)) {
target.splice(key, 1)
return
}
var ob = target.__ob__
if (target._isVue || (ob && ob.vmCount)) {
false &&
false
return
}
if (!hasOwn(target, key)) {
return
}
delete target[key]
if (!ob) {
return
}
ob.dep.notify()
}
/**
* Collect dependencies on array elements when the array is touched, since
* we cannot intercept array element access like property getters.
*/
function dependArray(value) {
for (var e = void 0, i = 0, l = value.length; i < l; i++) {
e = value[i]
e && e.__ob__ && e.__ob__.dep.depend()
if (Array.isArray(e)) {
dependArray(e)
}
}
}
/* */
/**
* Option overwriting strategies are functions that handle
* how to merge a parent option value and a child option
* value into the final value.
*/
var strats = config.optionMergeStrategies
/**
* Options with restrictions
*/
/**
* Helper that recursively merges two data objects together.
*/
function mergeData(to, from) {
if (!from) {
return to
}
var key, toVal, fromVal
var keys = Object.keys(from)
for (var i = 0; i < keys.length; i++) {
key = keys[i]
toVal = to[key]
fromVal = from[key]
if (!hasOwn(to, key)) {
set(to, key, fromVal)
} else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
mergeData(toVal, fromVal)
}
}
return to
}
/**
* Data
*/
function mergeDataOrFn(parentVal, childVal, vm) {
if (!vm) {
// in a Vue.extend merge, both should be functions
if (!childVal) {
return parentVal
}
if (!parentVal) {
return childVal
}
// when parentVal & childVal are both present,
// we need to return a function that returns the
// merged result of both functions... no need to
// check if parentVal is a function here because
// it has to be a function to pass previous merges.
return function mergedDataFn() {
return mergeData(
typeof childVal === "function" ? childVal.call(this) : childVal,
parentVal.call(this)
)
}
} else if (parentVal || childVal) {
return function mergedInstanceDataFn() {
// instance merge
var instanceData = typeof childVal === "function" ? childVal.call(vm) : childVal
var defaultData = typeof parentVal === "function" ? parentVal.call(vm) : undefined
if (instanceData) {
return mergeData(instanceData, defaultData)
} else {
return defaultData
}
}
}
}
strats.data = function(parentVal, childVal, vm) {
if (!vm) {
if (childVal && typeof childVal !== "function") {
false &&
false
return parentVal
}
return mergeDataOrFn.call(this, parentVal, childVal)
}
return mergeDataOrFn(parentVal, childVal, vm)
}
/**
* Hooks and props are merged as arrays.
*/
function mergeHook(parentVal, childVal) {
return childVal
? parentVal
? parentVal.concat(childVal)
: Array.isArray(childVal)
? childVal
: [childVal]
: parentVal
}
LIFECYCLE_HOOKS.forEach(function(hook) {
strats[hook] = mergeHook
})
/**
* Assets
*
* When a vm is present (instance creation), we need to do
* a three-way merge between constructor options, instance
* options and parent options.
*/
function mergeAssets(parentVal, childVal) {
var res = Object.create(parentVal || null)
return childVal ? extend(res, childVal) : res
}
ASSET_TYPES.forEach(function(type) {
strats[type + "s"] = mergeAssets
})
/**
* Watchers.
*
* Watchers hashes should not overwrite one
* another, so we merge them as arrays.
*/
strats.watch = function(parentVal, childVal) {
// work around Firefox's Object.prototype.watch...
if (parentVal === nativeWatch) {
parentVal = undefined
}
if (childVal === nativeWatch) {
childVal = undefined
}
/* istanbul ignore if */
if (!childVal) {
return Object.create(parentVal || null)
}
if (!parentVal) {
return childVal
}
var ret = {}
extend(ret, parentVal)
for (var key in childVal) {
var parent = ret[key]
var child = childVal[key]
if (parent && !Array.isArray(parent)) {
parent = [parent]
}
ret[key] = parent ? parent.concat(child) : Array.isArray(child) ? child : [child]
}
return ret
}
/**
* Other object hashes.
*/
strats.props = strats.methods = strats.inject = strats.computed = function(
parentVal,
childVal
) {
if (!childVal) {
return Object.create(parentVal || null)
}
if (!parentVal) {
return childVal
}
var ret = Object.create(null)
extend(ret, parentVal)
extend(ret, childVal)
return ret
}
strats.provide = mergeDataOrFn
/**
* Default strategy.
*/
var defaultStrat = function(parentVal, childVal) {
return childVal === undefined ? parentVal : childVal
}
/**
* Ensure all props option syntax are normalized into the
* Object-based format.
*/
function normalizeProps(options) {
var props = options.props
if (!props) {
return
}
var res = {}
var i, val, name
if (Array.isArray(props)) {
i = props.length
while (i--) {
val = props[i]
if (typeof val === "string") {
name = camelize(val)
res[name] = {
type: null
}
} else {
}
}
} else if (isPlainObject(props)) {
for (var key in props) {
val = props[key]
name = camelize(key)
res[name] = isPlainObject(val)
? val
: {
type: val
}
}
}
options.props = res
}
/**
* Normalize all injections into Object-based format
*/
function normalizeInject(options) {
var inject = options.inject
if (Array.isArray(inject)) {
var normalized = (options.inject = {})
for (var i = 0; i < inject.length; i++) {
normalized[inject[i]] = inject[i]
}
}
}
/**
* Normalize raw function directives into object format.
*/
function normalizeDirectives(options) {
var dirs = options.directives
if (dirs) {
for (var key in dirs) {
var def = dirs[key]
if (typeof def === "function") {
dirs[key] = {
bind: def,
update: def
}
}
}
}
}
/**
* Merge two option objects into a new one.
* Core utility used in both instantiation and inheritance.
*/
function mergeOptions(parent, child, vm) {
if (typeof child === "function") {
child = child.options
}
normalizeProps(child)
normalizeInject(child)
normalizeDirectives(child)
var extendsFrom = child.extends
if (extendsFrom) {
parent = mergeOptions(parent, extendsFrom, vm)
}
if (child.mixins) {
for (var i = 0, l = child.mixins.length; i < l; i++) {
parent = mergeOptions(parent, child.mixins[i], vm)
}
}
var options = {}
var key
for (key in parent) {
mergeField(key)
}
for (key in child) {
if (!hasOwn(parent, key)) {
mergeField(key)
}
}
function mergeField(key) {
var strat = strats[key] || defaultStrat
options[key] = strat(parent[key], child[key], vm, key)
}
return options
}
/**
* Resolve an asset.
* This function is used because child instances need access
* to assets defined in its ancestor chain.
*/
function resolveAsset(options, type, id, warnMissing) {
/* istanbul ignore if */
if (typeof id !== "string") {
return
}
var assets = options[type]
// check local registration variations first
if (hasOwn(assets, id)) {
return assets[id]
}
var camelizedId = camelize(id)
if (hasOwn(assets, camelizedId)) {
return assets[camelizedId]
}
var PascalCaseId = capitalize(camelizedId)
if (hasOwn(assets, PascalCaseId)) {
return assets[PascalCaseId]
}
// fallback to prototype chain
var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]
if (false) {}
return res
}
/* */
function validateProp(key, propOptions, propsData, vm) {
var prop = propOptions[key]
var absent = !hasOwn(propsData, key)
var value = propsData[key]
// handle boolean props
if (isType(Boolean, prop.type)) {
if (absent && !hasOwn(prop, "default")) {
value = false
} else if (!isType(String, prop.type) && (value === "" || value === hyphenate(key))) {
value = true
}
}
// check default value
if (value === undefined) {
value = getPropDefaultValue(vm, prop, key)
// since the default value is a fresh copy,
// make sure to observe it.
var prevShouldConvert = observerState.shouldConvert
observerState.shouldConvert = true
observe(value)
observerState.shouldConvert = prevShouldConvert
}
return value
}
/**
* Get the default value of a prop.
*/
function getPropDefaultValue(vm, prop, key) {
// no default, return undefined
if (!hasOwn(prop, "default")) {
return undefined
}
var def = prop.default
// warn against non-factory defaults for Object & Array
if (false) {}
// the raw prop value was also undefined from previous render,
// return previous default value to avoid unnecessary watcher trigger
if (
vm &&
vm.$options.propsData &&
vm.$options.propsData[key] === undefined &&
vm._props[key] !== undefined
) {
return vm._props[key]
}
// call factory function for non-Function types
// a value is Function if its prototype is function even across different execution context
return typeof def === "function" && getType(prop.type) !== "Function" ? def.call(vm) : def
}
/**
* Use function string name to check built-in types,
* because a simple equality check will fail when running
* across different vms / iframes.
*/
function getType(fn) {
var match = fn && fn.toString().match(/^\s*function (\w+)/)
return match ? match[1] : ""
}
function isType(type, fn) {
if (!Array.isArray(fn)) {
return getType(fn) === getType(type)
}
for (var i = 0, len = fn.length; i < len; i++) {
if (getType(fn[i]) === getType(type)) {
return true
}
}
/* istanbul ignore next */
return false
}
/* */
/* not type checking this file because flow doesn't play well with Proxy */
var mark
var measure
/* */
var VNode = function VNode(
tag,
data,
children,
text,
elm,
context,
componentOptions,
asyncFactory
) {
this.tag = tag
this.data = data
this.children = children
this.text = text
this.elm = elm
this.ns = undefined
this.context = context
this.functionalContext = undefined
this.key = data && data.key
this.componentOptions = componentOptions
this.componentInstance = undefined
this.parent = undefined
this.raw = false
this.isStatic = false
this.isRootInsert = true
this.isComment = false
this.isCloned = false
this.isOnce = false
this.asyncFactory = asyncFactory
this.asyncMeta = undefined
this.isAsyncPlaceholder = false
}
var prototypeAccessors = {
child: {}
}
// DEPRECATED: alias for componentInstance for backwards compat.
/* istanbul ignore next */
prototypeAccessors.child.get = function() {
return this.componentInstance
}
Object.defineProperties(VNode.prototype, prototypeAccessors)
var createEmptyVNode = function(text) {
if (text === void 0) text = ""
var node = new VNode()
node.text = text
node.isComment = true
return node
}
function createTextVNode(val) {
return new VNode(undefined, undefined, undefined, String(val))
}
// optimized shallow clone
// used for static nodes and slot nodes because they may be reused across
// multiple renders, cloning them avoids errors when DOM manipulations rely
// on their elm reference.
function cloneVNode(vnode) {
var cloned = new VNode(
vnode.tag,
vnode.data,
vnode.children,
vnode.text,
vnode.elm,
vnode.context,
vnode.componentOptions,
vnode.asyncFactory
)
cloned.ns = vnode.ns
cloned.isStatic = vnode.isStatic
cloned.key = vnode.key
cloned.isComment = vnode.isComment
cloned.isCloned = true
return cloned
}
function cloneVNodes(vnodes) {
var len = vnodes.length
var res = new Array(len)
for (var i = 0; i < len; i++) {
res[i] = cloneVNode(vnodes[i])
}
return res
}
/* */
var normalizeEvent = cached(function(name) {
var passive = name.charAt(0) === "&"
name = passive ? name.slice(1) : name
var once$$1 = name.charAt(0) === "~" // Prefixed last, checked first
name = once$$1 ? name.slice(1) : name
var capture = name.charAt(0) === "!"
name = capture ? name.slice(1) : name
return {
name: name,
once: once$$1,
capture: capture,
passive: passive
}
})
function createFnInvoker(fns) {
function invoker() {
var arguments$1 = arguments
var fns = invoker.fns
if (Array.isArray(fns)) {
var cloned = fns.slice()
for (var i = 0; i < cloned.length; i++) {
cloned[i].apply(null, arguments$1)
}
} else {
// return handler return value for single handlers
return fns.apply(null, arguments)
}
}
invoker.fns = fns
return invoker
}
function updateListeners(on, oldOn, add, remove$$1, vm) {
var name, cur, old, event
for (name in on) {
cur = on[name]
old = oldOn[name]
event = normalizeEvent(name)
if (isUndef(cur)) {
false &&
false
} else if (isUndef(old)) {
if (isUndef(cur.fns)) {
cur = on[name] = createFnInvoker(cur)
}
add(event.name, cur, event.once, event.capture, event.passive)
} else if (cur !== old) {
old.fns = cur
on[name] = old
}
}
for (name in oldOn) {
if (isUndef(on[name])) {
event = normalizeEvent(name)
remove$$1(event.name, oldOn[name], event.capture)
}
}
}
/* */
/* */
function extractPropsFromVNodeData(data, Ctor, tag) {
// we are only extracting raw values here.
// validation and default values are handled in the child
// component itself.
var propOptions = Ctor.options.props
if (isUndef(propOptions)) {
return
}
var res = {}
var attrs = data.attrs
var props = data.props
if (isDef(attrs) || isDef(props)) {
for (var key in propOptions) {
var altKey = hyphenate(key)
checkProp(res, props, key, altKey, true) ||
checkProp(res, attrs, key, altKey, false)
}
}
return res
}
function checkProp(res, hash, key, altKey, preserve) {
if (isDef(hash)) {
if (hasOwn(hash, key)) {
res[key] = hash[key]
if (!preserve) {
delete hash[key]
}
return true
} else if (hasOwn(hash, altKey)) {
res[key] = hash[altKey]
if (!preserve) {
delete hash[altKey]
}
return true
}
}
return false
}
/* */
// The template compiler attempts to minimize the need for normalization by
// statically analyzing the template at compile time.
//
// For plain HTML markup, normalization can be completely skipped because the
// generated render function is guaranteed to return Array<VNode>. There are
// two cases where extra normalization is needed:
// 1. When the children contains components - because a functional component
// may return an Array instead of a single root. In this case, just a simple
// normalization is needed - if any child is an Array, we flatten the whole
// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
// because functional components already normalize their own children.
function simpleNormalizeChildren(children) {
for (var i = 0; i < children.length; i++) {
if (Array.isArray(children[i])) {
return Array.prototype.concat.apply([], children)
}
}
return children
}
// 2. When the children contains constructs that always generated nested Arrays,
// e.g. <template>, <slot>, v-for, or when the children is provided by user
// with hand-written render functions / JSX. In such cases a full normalization
// is needed to cater to all possible types of children values.
function normalizeChildren(children) {
return isPrimitive(children)
? [createTextVNode(children)]
: Array.isArray(children)
? normalizeArrayChildren(children)
: undefined
}
function isTextNode(node) {
return isDef(node) && isDef(node.text) && isFalse(node.isComment)
}
function normalizeArrayChildren(children, nestedIndex) {
var res = []
var i, c, last
for (i = 0; i < children.length; i++) {
c = children[i]
if (isUndef(c) || typeof c === "boolean") {
continue
}
last = res[res.length - 1]
// nested
if (Array.isArray(c)) {
res.push.apply(res, normalizeArrayChildren(c, (nestedIndex || "") + "_" + i))
} else if (isPrimitive(c)) {
if (isTextNode(last)) {
// merge adjacent text nodes
// this is necessary for SSR hydration because text nodes are
// essentially merged when rendered to HTML strings
last.text += String(c)
} else if (c !== "") {
// convert primitive to vnode
res.push(createTextVNode(c))
}
} else {
if (isTextNode(c) && isTextNode(last)) {
// merge adjacent text nodes
res[res.length - 1] = createTextVNode(last.text + c.text)
} else {
// default key for nested array children (likely generated by v-for)
if (
isTrue(children._isVList) &&
isDef(c.tag) &&
isUndef(c.key) &&
isDef(nestedIndex)
) {
c.key = "__vlist" + nestedIndex + "_" + i + "__"
}
res.push(c)
}
}
}
return res
}
/* */
function ensureCtor(comp, base) {
if (comp.__esModule && comp.default) {
comp = comp.default
}
return isObject(comp) ? base.extend(comp) : comp
}
function createAsyncPlaceholder(factory, data, context, children, tag) {
var node = createEmptyVNode()
node.asyncFactory = factory
node.asyncMeta = {
data: data,
context: context,
children: children,
tag: tag
}
return node
}
function resolveAsyncComponent(factory, baseCtor, context) {
if (isTrue(factory.error) && isDef(factory.errorComp)) {
return factory.errorComp
}
if (isDef(factory.resolved)) {
return factory.resolved
}
if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
return factory.loadingComp
}
if (isDef(factory.contexts)) {
// already pending
factory.contexts.push(context)
} else {
var contexts = (factory.contexts = [context])
var sync = true
var forceRender = function() {
for (var i = 0, l = contexts.length; i < l; i++) {
contexts[i].$forceUpdate()
}
}
var resolve = once(function(res) {
// cache resolved
factory.resolved = ensureCtor(res, baseCtor)
// invoke callbacks only if this is not a synchronous resolve
// (async resolves are shimmed as synchronous during SSR)
if (!sync) {
forceRender()
}
})
var reject = once(function(reason) {
false &&
false
if (isDef(factory.errorComp)) {
factory.error = true
forceRender()
}
})
var res = factory(resolve, reject)
if (isObject(res)) {
if (typeof res.then === "function") {
// () => Promise
if (isUndef(factory.resolved)) {
res.then(resolve, reject)
}
} else if (isDef(res.component) && typeof res.component.then === "function") {
res.component.then(resolve, reject)
if (isDef(res.error)) {
factory.errorComp = ensureCtor(res.error, baseCtor)
}
if (isDef(res.loading)) {
factory.loadingComp = ensureCtor(res.loading, baseCtor)
if (res.delay === 0) {
factory.loading = true
} else {
setTimeout(function() {
if (isUndef(factory.resolved) && isUndef(factory.error)) {
factory.loading = true
forceRender()
}
}, res.delay || 200)
}
}
if (isDef(res.timeout)) {
setTimeout(function() {
if (isUndef(factory.resolved)) {
reject(null)
}
}, res.timeout)
}
}
}
sync = false
// return in case resolved synchronously
return factory.loading ? factory.loadingComp : factory.resolved
}
}
/* */
function getFirstComponentChild(children) {
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
var c = children[i]
if (isDef(c) && isDef(c.componentOptions)) {
return c
}
}
}
}
/* */
/* */
function initEvents(vm) {
vm._events = Object.create(null)
vm._hasHookEvent = false
// init parent attached events
var listeners = vm.$options._parentListeners
if (listeners) {
updateComponentListeners(vm, listeners)
}
}
var target
function add(event, fn, once$$1) {
if (once$$1) {
target.$once(event, fn)
} else {
target.$on(event, fn)
}
}
function remove$1(event, fn) {
target.$off(event, fn)
}
function updateComponentListeners(vm, listeners, oldListeners) {
target = vm
updateListeners(listeners, oldListeners || {}, add, remove$1, vm)
}
function eventsMixin(Vue) {
var hookRE = /^hook:/
Vue.prototype.$on = function(event, fn) {
var this$1 = this
var vm = this
if (Array.isArray(event)) {
for (var i = 0, l = event.length; i < l; i++) {
this$1.$on(event[i], fn)
}
} else {
;(vm._events[event] || (vm._events[event] = [])).push(fn)
// optimize hook:event cost by using a boolean flag marked at registration
// instead of a hash lookup
if (hookRE.test(event)) {
vm._hasHookEvent = true
}
}
return vm
}
Vue.prototype.$once = function(event, fn) {
var vm = this
function on() {
vm.$off(event, on)
fn.apply(vm, arguments)
}
on.fn = fn
vm.$on(event, on)
return vm
}
Vue.prototype.$off = function(event, fn) {
var this$1 = this
var vm = this
// all
if (!arguments.length) {
vm._events = Object.create(null)
return vm
}
// array of events
if (Array.isArray(event)) {
for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
this$1.$off(event[i$1], fn)
}
return vm
}
// specific event
var cbs = vm._events[event]
if (!cbs) {
return vm
}
if (arguments.length === 1) {
vm._events[event] = null
return vm
}
// specific handler
var cb
var i = cbs.length
while (i--) {
cb = cbs[i]
if (cb === fn || cb.fn === fn) {
cbs.splice(i, 1)
break
}
}
return vm
}
Vue.prototype.$emit = function(event) {
var vm = this
var cbs = vm._events[event]
if (cbs) {
cbs = cbs.length > 1 ? toArray(cbs) : cbs
var args = toArray(arguments, 1)
for (var i = 0, l = cbs.length; i < l; i++) {
try {
cbs[i].apply(vm, args)
} catch (e) {
handleError(e, vm, 'event handler for "' + event + '"')
}
}
}
return vm
}
}
/* */
/**
* Runtime helper for resolving raw children VNodes into a slot object.
*/
function resolveSlots(children, context) {
var slots = {}
if (!children) {
return slots
}
var defaultSlot = []
for (var i = 0, l = children.length; i < l; i++) {
var child = children[i]
// named slots should only be respected if the vnode was rendered in the
// same context.
if (
(child.context === context || child.functionalContext === context) &&
child.data &&
child.data.slot != null
) {
var name = child.data.slot
var slot = slots[name] || (slots[name] = [])
if (child.tag === "template") {
slot.push.apply(slot, child.children)
} else {
slot.push(child)
}
} else {
defaultSlot.push(child)
}
}
// ignore whitespace
if (!defaultSlot.every(isWhitespace)) {
slots.default = defaultSlot
}
return slots
}
function isWhitespace(node) {
return node.isComment || node.text === " "
}
function resolveScopedSlots(
fns, // see flow/vnode
res
) {
res = res || {}
for (var i = 0; i < fns.length; i++) {
if (Array.isArray(fns[i])) {
resolveScopedSlots(fns[i], res)
} else {
res[fns[i].key] = fns[i].fn
}
}
return res
}
/* */
var activeInstance = null
function initLifecycle(vm) {
var options = vm.$options
// locate first non-abstract parent
var parent = options.parent
if (parent && !options.abstract) {
while (parent.$options.abstract && parent.$parent) {
parent = parent.$parent
}
parent.$children.push(vm)
}
vm.$parent = parent
vm.$root = parent ? parent.$root : vm
vm.$children = []
vm.$refs = {}
vm._watcher = null
vm._inactive = null
vm._directInactive = false
vm._isMounted = false
vm._isDestroyed = false
vm._isBeingDestroyed = false
}
function lifecycleMixin(Vue) {
Vue.prototype._update = function(vnode, hydrating) {
var vm = this
if (vm._isMounted) {
callHook(vm, "beforeUpdate")
}
var prevEl = vm.$el
var prevVnode = vm._vnode
var prevActiveInstance = activeInstance
activeInstance = vm
vm._vnode = vnode
// Vue.prototype.__patch__ is injected in entry points
// based on the rendering backend used.
if (!prevVnode) {
// initial render
vm.$el = vm.__patch__(
vm.$el,
vnode,
hydrating,
false /* removeOnly */,
vm.$options._parentElm,
vm.$options._refElm
)
// no need for the ref nodes after initial patch
// this prevents keeping a detached DOM tree in memory (#5851)
vm.$options._parentElm = vm.$options._refElm = null
} else {
// updates
vm.$el = vm.__patch__(prevVnode, vnode)
}
activeInstance = prevActiveInstance
// update __vue__ reference
if (prevEl) {
prevEl.__vue__ = null
}
if (vm.$el) {
vm.$el.__vue__ = vm
}
// if parent is an HOC, update its $el as well
if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
vm.$parent.$el = vm.$el
}
// updated hook is called by the scheduler to ensure that children are
// updated in a parent's updated hook.
}
Vue.prototype.$forceUpdate = function() {
var vm = this
if (vm._watcher) {
vm._watcher.update()
}
}
Vue.prototype.$destroy = function() {
var vm = this
if (vm._isBeingDestroyed) {
return
}
callHook(vm, "beforeDestroy")
vm._isBeingDestroyed = true
// remove self from parent
var parent = vm.$parent
if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
remove(parent.$children, vm)
}
// teardown watchers
if (vm._watcher) {
vm._watcher.teardown()
}
var i = vm._watchers.length
while (i--) {
vm._watchers[i].teardown()
}
// remove reference from data ob
// frozen object may not have observer.
if (vm._data.__ob__) {
vm._data.__ob__.vmCount--
}
// call the last hook...
vm._isDestroyed = true
// invoke destroy hooks on current rendered tree
vm.__patch__(vm._vnode, null)
// fire destroyed hook
callHook(vm, "destroyed")
// turn off all instance listeners.
vm.$off()
// remove __vue__ reference
if (vm.$el) {
vm.$el.__vue__ = null
}
}
}
function mountComponent(vm, el, hydrating) {
vm.$el = el
if (!vm.$options.render) {
vm.$options.render = createEmptyVNode
}
callHook(vm, "beforeMount")
var updateComponent
/* istanbul ignore if */
if (false) {} else {
updateComponent = function() {
vm._update(vm._render(), hydrating)
}
}
vm._watcher = new Watcher(vm, updateComponent, noop)
hydrating = false
// manually mounted instance, call mounted on self
// mounted is called for render-created child components in its inserted hook
if (vm.$vnode == null) {
vm._isMounted = true
callHook(vm, "mounted")
}
return vm
}
function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
var hasChildren = !!(
renderChildren || // has new static slots
vm.$options._renderChildren || // has old static slots
parentVnode.data.scopedSlots || // has new scoped slots
vm.$scopedSlots !== emptyObject
) // has old scoped slots
vm.$options._parentVnode = parentVnode
vm.$vnode = parentVnode // update vm's placeholder node without re-render
if (vm._vnode) {
// update child tree's parent
vm._vnode.parent = parentVnode
}
vm.$options._renderChildren = renderChildren
// update $attrs and $listensers hash
// these are also reactive so they may trigger child update if the child
// used them during render
vm.$attrs = parentVnode.data && parentVnode.data.attrs
vm.$listeners = listeners
// update props
if (propsData && vm.$options.props) {
observerState.shouldConvert = false
var props = vm._props
var propKeys = vm.$options._propKeys || []
for (var i = 0; i < propKeys.length; i++) {
var key = propKeys[i]
props[key] = validateProp(key, vm.$options.props, propsData, vm)
}
observerState.shouldConvert = true
// keep a copy of raw propsData
vm.$options.propsData = propsData
}
// update listeners
if (listeners) {
var oldListeners = vm.$options._parentListeners
vm.$options._parentListeners = listeners
updateComponentListeners(vm, listeners, oldListeners)
}
// resolve slots + force update if has children
if (hasChildren) {
vm.$slots = resolveSlots(renderChildren, parentVnode.context)
vm.$forceUpdate()
}
}
function isInInactiveTree(vm) {
while (vm && (vm = vm.$parent)) {
if (vm._inactive) {
return true
}
}
return false
}
function activateChildComponent(vm, direct) {
if (direct) {
vm._directInactive = false
if (isInInactiveTree(vm)) {
return
}
} else if (vm._directInactive) {
return
}
if (vm._inactive || vm._inactive === null) {
vm._inactive = false
for (var i = 0; i < vm.$children.length; i++) {
activateChildComponent(vm.$children[i])
}
callHook(vm, "activated")
}
}
function deactivateChildComponent(vm, direct) {
if (direct) {
vm._directInactive = true
if (isInInactiveTree(vm)) {
return
}
}
if (!vm._inactive) {
vm._inactive = true
for (var i = 0; i < vm.$children.length; i++) {
deactivateChildComponent(vm.$children[i])
}
callHook(vm, "deactivated")
}
}
function callHook(vm, hook) {
var handlers = vm.$options[hook]
if (handlers) {
for (var i = 0, j = handlers.length; i < j; i++) {
try {
handlers[i].call(vm)
} catch (e) {
handleError(e, vm, hook + " hook")
}
}
}
if (vm._hasHookEvent) {
vm.$emit("hook:" + hook)
}
}
/* */
var MAX_UPDATE_COUNT = 100
var queue = []
var activatedChildren = []
var has = {}
var circular = {}
var waiting = false
var flushing = false
var index = 0
/**
* Reset the scheduler's state.
*/
function resetSchedulerState() {
index = queue.length = activatedChildren.length = 0
has = {}
waiting = flushing = false
}
/**
* Flush both queues and run the watchers.
*/
function flushSchedulerQueue() {
flushing = true
var watcher, id
// Sort queue before flush.
// This ensures that:
// 1. Components are updated from parent to child. (because parent is always
// created before the child)
// 2. A component's user watchers are run before its render watcher (because
// user watchers are created before the render watcher)
// 3. If a component is destroyed during a parent component's watcher run,
// its watchers can be skipped.
queue.sort(function(a, b) {
return a.id - b.id
})
// do not cache length because more watchers might be pushed
// as we run existing watchers
for (index = 0; index < queue.length; index++) {
watcher = queue[index]
id = watcher.id
has[id] = null
watcher.run()
// in dev build, check and stop circular updates.
if (false) {}
}
// keep copies of post queues before resetting state
var activatedQueue = activatedChildren.slice()
var updatedQueue = queue.slice()
resetSchedulerState()
// call component updated and activated hooks
callActivatedHooks(activatedQueue)
callUpdatedHooks(updatedQueue)
// devtool hook
/* istanbul ignore if */
if (devtools && config.devtools) {
devtools.emit("flush")
}
}
function callUpdatedHooks(queue) {
var i = queue.length
while (i--) {
var watcher = queue[i]
var vm = watcher.vm
if (vm._watcher === watcher && vm._isMounted) {
callHook(vm, "updated")
}
}
}
/**
* Queue a kept-alive component that was activated during patch.
* The queue will be processed after the entire tree has been patched.
*/
function queueActivatedComponent(vm) {
// setting _inactive to false here so that a render function can
// rely on checking whether it's in an inactive tree (e.g. router-view)
vm._inactive = false
activatedChildren.push(vm)
}
function callActivatedHooks(queue) {
for (var i = 0; i < queue.length; i++) {
queue[i]._inactive = true
activateChildComponent(queue[i], true /* true */)
}
}
/**
* Push a watcher into the watcher queue.
* Jobs with duplicate IDs will be skipped unless it's
* pushed when the queue is being flushed.
*/
function queueWatcher(watcher) {
var id = watcher.id
if (has[id] == null) {
has[id] = true
if (!flushing) {
queue.push(watcher)
} else {
// if already flushing, splice the watcher based on its id
// if already past its id, it will be run next immediately.
var i = queue.length - 1
while (i > index && queue[i].id > watcher.id) {
i--
}
queue.splice(i + 1, 0, watcher)
}
// queue the flush
if (!waiting) {
waiting = true
nextTick(flushSchedulerQueue)
}
}
}
/* */
var uid$2 = 0
/**
* A watcher parses an expression, collects dependencies,
* and fires callback when the expression value changes.
* This is used for both the $watch() api and directives.
*/
var Watcher = function Watcher(vm, expOrFn, cb, options) {
this.vm = vm
vm._watchers.push(this)
// options
if (options) {
this.deep = !!options.deep
this.user = !!options.user
this.lazy = !!options.lazy
this.sync = !!options.sync
} else {
this.deep = this.user = this.lazy = this.sync = false
}
this.cb = cb
this.id = ++uid$2 // uid for batching
this.active = true
this.dirty = this.lazy // for lazy watchers
this.deps = []
this.newDeps = []
this.depIds = new _Set()
this.newDepIds = new _Set()
this.expression = ""
// parse expression for getter
if (typeof expOrFn === "function") {
this.getter = expOrFn
} else {
this.getter = parsePath(expOrFn)
if (!this.getter) {
this.getter = function() {}
false &&
false
}
}
this.value = this.lazy ? undefined : this.get()
}
/**
* Evaluate the getter, and re-collect dependencies.
*/
Watcher.prototype.get = function get() {
pushTarget(this)
var value
var vm = this.vm
try {
value = this.getter.call(vm, vm)
} catch (e) {
if (this.user) {
handleError(e, vm, 'getter for watcher "' + this.expression + '"')
} else {
throw e
}
} finally {
// "touch" every property so they are all tracked as
// dependencies for deep watching
if (this.deep) {
traverse(value)
}
popTarget()
this.cleanupDeps()
}
return value
}
/**
* Add a dependency to this directive.
*/
Watcher.prototype.addDep = function addDep(dep) {
var id = dep.id
if (!this.newDepIds.has(id)) {
this.newDepIds.add(id)
this.newDeps.push(dep)
if (!this.depIds.has(id)) {
dep.addSub(this)
}
}
}
/**
* Clean up for dependency collection.
*/
Watcher.prototype.cleanupDeps = function cleanupDeps() {
var this$1 = this
var i = this.deps.length
while (i--) {
var dep = this$1.deps[i]
if (!this$1.newDepIds.has(dep.id)) {
dep.removeSub(this$1)
}
}
var tmp = this.depIds
this.depIds = this.newDepIds
this.newDepIds = tmp
this.newDepIds.clear()
tmp = this.deps
this.deps = this.newDeps
this.newDeps = tmp
this.newDeps.length = 0
}
/**
* Subscriber interface.
* Will be called when a dependency changes.
*/
Watcher.prototype.update = function update() {
/* istanbul ignore else */
if (this.lazy) {
this.dirty = true
} else if (this.sync) {
this.run()
} else {
queueWatcher(this)
}
}
/**
* Scheduler job interface.
* Will be called by the scheduler.
*/
Watcher.prototype.run = function run() {
if (this.active) {
var value = this.get()
if (
value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
isObject(value) ||
this.deep
) {
// set new value
var oldValue = this.value
this.value = value
if (this.user) {
try {
this.cb.call(this.vm, value, oldValue)
} catch (e) {
handleError(e, this.vm, 'callback for watcher "' + this.expression + '"')
}
} else {
this.cb.call(this.vm, value, oldValue)
}
}
}
}
/**
* Evaluate the value of the watcher.
* This only gets called for lazy watchers.
*/
Watcher.prototype.evaluate = function evaluate() {
this.value = this.get()
this.dirty = false
}
/**
* Depend on all deps collected by this watcher.
*/
Watcher.prototype.depend = function depend() {
var this$1 = this
var i = this.deps.length
while (i--) {
this$1.deps[i].depend()
}
}
/**
* Remove self from all dependencies' subscriber list.
*/
Watcher.prototype.teardown = function teardown() {
var this$1 = this
if (this.active) {
// remove self from vm's watcher list
// this is a somewhat expensive operation so we skip it
// if the vm is being destroyed.
if (!this.vm._isBeingDestroyed) {
remove(this.vm._watchers, this)
}
var i = this.deps.length
while (i--) {
this$1.deps[i].removeSub(this$1)
}
this.active = false
}
}
/**
* Recursively traverse an object to evoke all converted
* getters, so that every nested property inside the object
* is collected as a "deep" dependency.
*/
var seenObjects = new _Set()
function traverse(val) {
seenObjects.clear()
_traverse(val, seenObjects)
}
function _traverse(val, seen) {
var i, keys
var isA = Array.isArray(val)
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
return
}
if (val.__ob__) {
var depId = val.__ob__.dep.id
if (seen.has(depId)) {
return
}
seen.add(depId)
}
if (isA) {
i = val.length
while (i--) {
_traverse(val[i], seen)
}
} else {
keys = Object.keys(val)
i = keys.length
while (i--) {
_traverse(val[keys[i]], seen)
}
}
}
/* */
var sharedPropertyDefinition = {
enumerable: true,
configurable: true,
get: noop,
set: noop
}
function proxy(target, sourceKey, key) {
sharedPropertyDefinition.get = function proxyGetter() {
return this[sourceKey][key]
}
sharedPropertyDefinition.set = function proxySetter(val) {
this[sourceKey][key] = val
}
Object.defineProperty(target, key, sharedPropertyDefinition)
}
function initState(vm) {
vm._watchers = []
var opts = vm.$options
if (opts.props) {
initProps(vm, opts.props)
}
if (opts.methods) {
initMethods(vm, opts.methods)
}
if (opts.data) {
initData(vm)
} else {
observe((vm._data = {}), true /* asRootData */)
}
if (opts.computed) {
initComputed(vm, opts.computed)
}
if (opts.watch && opts.watch !== nativeWatch) {
initWatch(vm, opts.watch)
}
}
function checkOptionType(vm, name) {
var option = vm.$options[name]
if (!isPlainObject(option)) {
warn('component option "' + name + '" should be an object.', vm)
}
}
function initProps(vm, propsOptions) {
var propsData = vm.$options.propsData || {}
var props = (vm._props = {})
// cache prop keys so that future props updates can iterate using Array
// instead of dynamic object key enumeration.
var keys = (vm.$options._propKeys = [])
var isRoot = !vm.$parent
// root instance props should be converted
observerState.shouldConvert = isRoot
var loop = function(key) {
keys.push(key)
var value = validateProp(key, propsOptions, propsData, vm)
/* istanbul ignore else */
{
defineReactive$$1(props, key, value)
}
// static props are already proxied on the component's prototype
// during Vue.extend(). We only need to proxy props defined at
// instantiation here.
if (!(key in vm)) {
proxy(vm, "_props", key)
}
}
for (var key in propsOptions) loop(key)
observerState.shouldConvert = true
}
function initData(vm) {
var data = vm.$options.data
data = vm._data = typeof data === "function" ? getData(data, vm) : data || {}
if (!isPlainObject(data)) {
data = {}
false &&
false
}
// proxy data on instance
var keys = Object.keys(data)
var props = vm.$options.props
var methods = vm.$options.methods
var i = keys.length
while (i--) {
var key = keys[i]
if (props && hasOwn(props, key)) {
false &&
false
} else if (!isReserved(key)) {
proxy(vm, "_data", key)
}
}
// observe data
observe(data, true /* asRootData */)
}
function getData(data, vm) {
try {
return data.call(vm)
} catch (e) {
handleError(e, vm, "data()")
return {}
}
}
var computedWatcherOptions = {
lazy: true
}
function initComputed(vm, computed) {
false && false
var watchers = (vm._computedWatchers = Object.create(null))
for (var key in computed) {
var userDef = computed[key]
var getter = typeof userDef === "function" ? userDef : userDef.get
watchers[key] = new Watcher(vm, getter, noop, computedWatcherOptions)
// component-defined computed properties are already defined on the
// component prototype. We only need to define computed properties defined
// at instantiation here.
if (!(key in vm)) {
defineComputed(vm, key, userDef)
} else {
}
}
}
function defineComputed(target, key, userDef) {
if (typeof userDef === "function") {
sharedPropertyDefinition.get = createComputedGetter(key)
sharedPropertyDefinition.set = noop
} else {
sharedPropertyDefinition.get = userDef.get
? userDef.cache !== false
? createComputedGetter(key)
: userDef.get
: noop
sharedPropertyDefinition.set = userDef.set ? userDef.set : noop
}
Object.defineProperty(target, key, sharedPropertyDefinition)
}
function createComputedGetter(key) {
return function computedGetter() {
var watcher = this._computedWatchers && this._computedWatchers[key]
if (watcher) {
if (watcher.dirty) {
watcher.evaluate()
}
if (Dep.target) {
watcher.depend()
}
return watcher.value
}
}
}
function initMethods(vm, methods) {
false && false
var props = vm.$options.props
for (var key in methods) {
vm[key] = methods[key] == null ? noop : bind(methods[key], vm)
}
}
function initWatch(vm, watch) {
false && false
for (var key in watch) {
var handler = watch[key]
if (Array.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
createWatcher(vm, key, handler[i])
}
} else {
createWatcher(vm, key, handler)
}
}
}
function createWatcher(vm, keyOrFn, handler, options) {
if (isPlainObject(handler)) {
options = handler
handler = handler.handler
}
if (typeof handler === "string") {
handler = vm[handler]
}
return vm.$watch(keyOrFn, handler, options)
}
function stateMixin(Vue) {
// flow somehow has problems with directly declared definition object
// when using Object.defineProperty, so we have to procedurally build up
// the object here.
var dataDef = {}
dataDef.get = function() {
return this._data
}
var propsDef = {}
propsDef.get = function() {
return this._props
}
Object.defineProperty(Vue.prototype, "$data", dataDef)
Object.defineProperty(Vue.prototype, "$props", propsDef)
Vue.prototype.$set = set
Vue.prototype.$delete = del
Vue.prototype.$watch = function(expOrFn, cb, options) {
var vm = this
if (isPlainObject(cb)) {
return createWatcher(vm, expOrFn, cb, options)
}
options = options || {}
options.user = true
var watcher = new Watcher(vm, expOrFn, cb, options)
if (options.immediate) {
cb.call(vm, watcher.value)
}
return function unwatchFn() {
watcher.teardown()
}
}
}
/* */
function initProvide(vm) {
var provide = vm.$options.provide
if (provide) {
vm._provided = typeof provide === "function" ? provide.call(vm) : provide
}
}
function initInjections(vm) {
var result = resolveInject(vm.$options.inject, vm)
if (result) {
observerState.shouldConvert = false
Object.keys(result).forEach(function(key) {
/* istanbul ignore else */
{
defineReactive$$1(vm, key, result[key])
}
})
observerState.shouldConvert = true
}
}
function resolveInject(inject, vm) {
if (inject) {
// inject is :any because flow is not smart enough to figure out cached
var result = Object.create(null)
var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject)
for (var i = 0; i < keys.length; i++) {
var key = keys[i]
var provideKey = inject[key]
var source = vm
while (source) {
if (source._provided && provideKey in source._provided) {
result[key] = source._provided[provideKey]
break
}
source = source.$parent
}
if (false) {}
}
return result
}
}
/* */
function createFunctionalComponent(Ctor, propsData, data, context, children) {
var props = {}
var propOptions = Ctor.options.props
if (isDef(propOptions)) {
for (var key in propOptions) {
props[key] = validateProp(key, propOptions, propsData || {})
}
} else {
if (isDef(data.attrs)) {
mergeProps(props, data.attrs)
}
if (isDef(data.props)) {
mergeProps(props, data.props)
}
}
// ensure the createElement function in functional components
// gets a unique context - this is necessary for correct named slot check
var _context = Object.create(context)
var h = function(a, b, c, d) {
return createElement(_context, a, b, c, d, true)
}
var vnode = Ctor.options.render.call(null, h, {
data: data,
props: props,
children: children,
parent: context,
listeners: data.on || {},
injections: resolveInject(Ctor.options.inject, context),
slots: function() {
return resolveSlots(children, context)
}
})
if (vnode instanceof VNode) {
vnode.functionalContext = context
vnode.functionalOptions = Ctor.options
if (data.slot) {
;(vnode.data || (vnode.data = {})).slot = data.slot
}
}
return vnode
}
function mergeProps(to, from) {
for (var key in from) {
to[camelize(key)] = from[key]
}
}
/* */
// hooks to be invoked on component VNodes during patch
var componentVNodeHooks = {
init: function init(vnode, hydrating, parentElm, refElm) {
if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
var child = (vnode.componentInstance = createComponentInstanceForVnode(
vnode,
activeInstance,
parentElm,
refElm
))
child.$mount(hydrating ? vnode.elm : undefined, hydrating)
} else if (vnode.data.keepAlive) {
// kept-alive components, treat as a patch
var mountedNode = vnode // work around flow
componentVNodeHooks.prepatch(mountedNode, mountedNode)
}
},
prepatch: function prepatch(oldVnode, vnode) {
var options = vnode.componentOptions
var child = (vnode.componentInstance = oldVnode.componentInstance)
updateChildComponent(
child,
options.propsData, // updated props
options.listeners, // updated listeners
vnode, // new parent vnode
options.children // new children
)
},
insert: function insert(vnode) {
var context = vnode.context
var componentInstance = vnode.componentInstance
if (!componentInstance._isMounted) {
componentInstance._isMounted = true
callHook(componentInstance, "mounted")
}
if (vnode.data.keepAlive) {
if (context._isMounted) {
// vue-router#1212
// During updates, a kept-alive component's child components may
// change, so directly walking the tree here may call activated hooks
// on incorrect children. Instead we push them into a queue which will
// be processed after the whole patch process ended.
queueActivatedComponent(componentInstance)
} else {
activateChildComponent(componentInstance, true /* direct */)
}
}
},
destroy: function destroy(vnode) {
var componentInstance = vnode.componentInstance
if (!componentInstance._isDestroyed) {
if (!vnode.data.keepAlive) {
componentInstance.$destroy()
} else {
deactivateChildComponent(componentInstance, true /* direct */)
}
}
}
}
var hooksToMerge = Object.keys(componentVNodeHooks)
function createComponent(Ctor, data, context, children, tag) {
if (isUndef(Ctor)) {
return
}
var baseCtor = context.$options._base
// plain options object: turn it into a constructor
if (isObject(Ctor)) {
Ctor = baseCtor.extend(Ctor)
}
// if at this stage it's not a constructor or an async component factory,
// reject.
if (typeof Ctor !== "function") {
return
}
// async component
var asyncFactory
if (isUndef(Ctor.cid)) {
asyncFactory = Ctor
Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context)
if (Ctor === undefined) {
// return a placeholder node for async component, which is rendered
// as a comment node but preserves all the raw information for the node.
// the information will be used for async server-rendering and hydration.
return createAsyncPlaceholder(asyncFactory, data, context, children, tag)
}
}
data = data || {}
// resolve constructor options in case global mixins are applied after
// component constructor creation
resolveConstructorOptions(Ctor)
// transform component v-model data into props & events
if (isDef(data.model)) {
transformModel(Ctor.options, data)
}
// extract props
var propsData = extractPropsFromVNodeData(data, Ctor, tag)
// functional component
if (isTrue(Ctor.options.functional)) {
return createFunctionalComponent(Ctor, propsData, data, context, children)
}
// keep listeners
var listeners = data.on
if (isTrue(Ctor.options.abstract)) {
// abstract components do not keep anything
// other than props & listeners & slot
// work around flow
var slot = data.slot
data = {}
if (slot) {
data.slot = slot
}
}
// merge component management hooks onto the placeholder node
mergeHooks(data)
// return a placeholder vnode
var name = Ctor.options.name || tag
var vnode = new VNode(
"vue-component-" + Ctor.cid + (name ? "-" + name : ""),
data,
undefined,
undefined,
undefined,
context,
{
Ctor: Ctor,
propsData: propsData,
listeners: listeners,
tag: tag,
children: children
},
asyncFactory
)
return vnode
}
function createComponentInstanceForVnode(
vnode, // we know it's MountedComponentVNode but flow doesn't
parent, // activeInstance in lifecycle state
parentElm,
refElm
) {
var vnodeComponentOptions = vnode.componentOptions
var options = {
_isComponent: true,
parent: parent,
propsData: vnodeComponentOptions.propsData,
_componentTag: vnodeComponentOptions.tag,
_parentVnode: vnode,
_parentListeners: vnodeComponentOptions.listeners,
_renderChildren: vnodeComponentOptions.children,
_parentElm: parentElm || null,
_refElm: refElm || null
}
// check inline-template render functions
var inlineTemplate = vnode.data.inlineTemplate
if (isDef(inlineTemplate)) {
options.render = inlineTemplate.render
options.staticRenderFns = inlineTemplate.staticRenderFns
}
return new vnodeComponentOptions.Ctor(options)
}
function mergeHooks(data) {
if (!data.hook) {
data.hook = {}
}
for (var i = 0; i < hooksToMerge.length; i++) {
var key = hooksToMerge[i]
var fromParent = data.hook[key]
var ours = componentVNodeHooks[key]
data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours
}
}
function mergeHook$1(one, two) {
return function(a, b, c, d) {
one(a, b, c, d)
two(a, b, c, d)
}
}
// transform component v-model info (value and callback) into
// prop and event handler respectively.
function transformModel(options, data) {
var prop = (options.model && options.model.prop) || "value"
var event = (options.model && options.model.event) || "input"
;(data.props || (data.props = {}))[prop] = data.model.value
var on = data.on || (data.on = {})
if (isDef(on[event])) {
on[event] = [data.model.callback].concat(on[event])
} else {
on[event] = data.model.callback
}
}
/* */
var SIMPLE_NORMALIZE = 1
var ALWAYS_NORMALIZE = 2
// wrapper function for providing a more flexible interface
// without getting yelled at by flow
function createElement(context, tag, data, children, normalizationType, alwaysNormalize) {
if (Array.isArray(data) || isPrimitive(data)) {
normalizationType = children
children = data
data = undefined
}
if (isTrue(alwaysNormalize)) {
normalizationType = ALWAYS_NORMALIZE
}
return _createElement(context, tag, data, children, normalizationType)
}
function _createElement(context, tag, data, children, normalizationType) {
if (isDef(data) && isDef(data.__ob__)) {
false &&
false
return createEmptyVNode()
}
// object syntax in v-bind
if (isDef(data) && isDef(data.is)) {
tag = data.is
}
if (!tag) {
// in case of component :is set to falsy value
return createEmptyVNode()
}
// warn against non-primitive key
if (
false
) {}
// support single function children as default scoped slot
if (Array.isArray(children) && typeof children[0] === "function") {
data = data || {}
data.scopedSlots = {
default: children[0]
}
children.length = 0
}
if (normalizationType === ALWAYS_NORMALIZE) {
children = normalizeChildren(children)
} else if (normalizationType === SIMPLE_NORMALIZE) {
children = simpleNormalizeChildren(children)
}
var vnode, ns
if (typeof tag === "string") {
var Ctor
ns = config.getTagNamespace(tag)
if (config.isReservedTag(tag)) {
// platform built-in elements
vnode = new VNode(
config.parsePlatformTagName(tag),
data,
children,
undefined,
undefined,
context
)
} else if (isDef((Ctor = resolveAsset(context.$options, "components", tag)))) {
// component
vnode = createComponent(Ctor, data, context, children, tag)
} else {
// unknown or unlisted namespaced elements
// check at runtime because it may get assigned a namespace when its
// parent normalizes children
vnode = new VNode(tag, data, children, undefined, undefined, context)
}
} else {
// direct component options / constructor
vnode = createComponent(tag, data, context, children)
}
if (isDef(vnode)) {
if (ns) {
applyNS(vnode, ns)
}
return vnode
} else {
return createEmptyVNode()
}
}
function applyNS(vnode, ns) {
vnode.ns = ns
if (vnode.tag === "foreignObject") {
// use default namespace inside foreignObject
return
}
if (isDef(vnode.children)) {
for (var i = 0, l = vnode.children.length; i < l; i++) {
var child = vnode.children[i]
if (isDef(child.tag) && isUndef(child.ns)) {
applyNS(child, ns)
}
}
}
}
/* */
/**
* Runtime helper for rendering v-for lists.
*/
function renderList(val, render) {
var ret, i, l, keys, key
if (Array.isArray(val) || typeof val === "string") {
ret = new Array(val.length)
for (i = 0, l = val.length; i < l; i++) {
ret[i] = render(val[i], i)
}
} else if (typeof val === "number") {
ret = new Array(val)
for (i = 0; i < val; i++) {
ret[i] = render(i + 1, i)
}
} else if (isObject(val)) {
keys = Object.keys(val)
ret = new Array(keys.length)
for (i = 0, l = keys.length; i < l; i++) {
key = keys[i]
ret[i] = render(val[key], key, i)
}
}
if (isDef(ret)) {
ret._isVList = true
}
return ret
}
/* */
/**
* Runtime helper for rendering <slot>
*/
function renderSlot(name, fallback, props, bindObject) {
var scopedSlotFn = this.$scopedSlots[name]
if (scopedSlotFn) {
// scoped slot
props = props || {}
if (bindObject) {
props = extend(extend({}, bindObject), props)
}
return scopedSlotFn(props) || fallback
} else {
var slotNodes = this.$slots[name]
// warn duplicate slot usage
if (slotNodes && "production" !== "production") {
slotNodes._rendered &&
warn(
'Duplicate presence of slot "' +
name +
'" found in the same render tree ' +
"- this will likely cause render errors.",
this
)
slotNodes._rendered = true
}
return slotNodes || fallback
}
}
/* */
/**
* Runtime helper for resolving filters
*/
function resolveFilter(id) {
return resolveAsset(this.$options, "filters", id, true) || identity
}
/* */
/**
* Runtime helper for checking keyCodes from config.
*/
function checkKeyCodes(eventKeyCode, key, builtInAlias) {
var keyCodes = config.keyCodes[key] || builtInAlias
if (Array.isArray(keyCodes)) {
return keyCodes.indexOf(eventKeyCode) === -1
} else {
return keyCodes !== eventKeyCode
}
}
/* */
/**
* Runtime helper for merging v-bind="object" into a VNode's data.
*/
function bindObjectProps(data, tag, value, asProp, isSync) {
if (value) {
if (!isObject(value)) {
false &&
false
} else {
if (Array.isArray(value)) {
value = toObject(value)
}
var hash
var loop = function(key) {
if (key === "class" || key === "style" || isReservedAttribute(key)) {
hash = data
} else {
var type = data.attrs && data.attrs.type
hash =
asProp || config.mustUseProp(tag, type, key)
? data.domProps || (data.domProps = {})
: data.attrs || (data.attrs = {})
}
if (!(key in hash)) {
hash[key] = value[key]
if (isSync) {
var on = data.on || (data.on = {})
on["update:" + key] = function($event) {
value[key] = $event
}
}
}
}
for (var key in value) loop(key)
}
}
return data
}
/* */
/**
* Runtime helper for rendering static trees.
*/
function renderStatic(index, isInFor) {
var tree = this._staticTrees[index]
// if has already-rendered static tree and not inside v-for,
// we can reuse the same tree by doing a shallow clone.
if (tree && !isInFor) {
return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree)
}
// otherwise, render a fresh tree.
tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(
this._renderProxy
)
markStatic(tree, "__static__" + index, false)
return tree
}
/**
* Runtime helper for v-once.
* Effectively it means marking the node as static with a unique key.
*/
function markOnce(tree, index, key) {
markStatic(tree, "__once__" + index + (key ? "_" + key : ""), true)
return tree
}
function markStatic(tree, key, isOnce) {
if (Array.isArray(tree)) {
for (var i = 0; i < tree.length; i++) {
if (tree[i] && typeof tree[i] !== "string") {
markStaticNode(tree[i], key + "_" + i, isOnce)
}
}
} else {
markStaticNode(tree, key, isOnce)
}
}
function markStaticNode(node, key, isOnce) {
node.isStatic = true
node.key = key
node.isOnce = isOnce
}
/* */
function bindObjectListeners(data, value) {
if (value) {
if (!isPlainObject(value)) {
false &&
false
} else {
var on = (data.on = data.on ? extend({}, data.on) : {})
for (var key in value) {
var existing = on[key]
var ours = value[key]
on[key] = existing ? [].concat(ours, existing) : ours
}
}
}
return data
}
/* */
function initRender(vm) {
vm._vnode = null // the root of the child tree
vm._staticTrees = null
var parentVnode = (vm.$vnode = vm.$options._parentVnode) // the placeholder node in parent tree
var renderContext = parentVnode && parentVnode.context
vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext)
vm.$scopedSlots = emptyObject
// bind the createElement fn to this instance
// so that we get proper render context inside it.
// args order: tag, data, children, normalizationType, alwaysNormalize
// internal version is used by render functions compiled from templates
vm._c = function(a, b, c, d) {
return createElement(vm, a, b, c, d, false)
}
// normalization is always applied for the public version, used in
// user-written render functions.
vm.$createElement = function(a, b, c, d) {
return createElement(vm, a, b, c, d, true)
}
// $attrs & $listeners are exposed for easier HOC creation.
// they need to be reactive so that HOCs using them are always updated
var parentData = parentVnode && parentVnode.data
/* istanbul ignore else */
{
defineReactive$$1(vm, "$attrs", parentData && parentData.attrs, null, true)
defineReactive$$1(vm, "$listeners", parentData && parentData.on, null, true)
}
}
function renderMixin(Vue) {
Vue.prototype.$nextTick = function(fn) {
return nextTick(fn, this)
}
Vue.prototype._render = function() {
var vm = this
var ref = vm.$options
var render = ref.render
var staticRenderFns = ref.staticRenderFns
var _parentVnode = ref._parentVnode
if (vm._isMounted) {
// clone slot nodes on re-renders
for (var key in vm.$slots) {
vm.$slots[key] = cloneVNodes(vm.$slots[key])
}
}
vm.$scopedSlots = (_parentVnode && _parentVnode.data.scopedSlots) || emptyObject
if (staticRenderFns && !vm._staticTrees) {
vm._staticTrees = []
}
// set parent vnode. this allows render functions to have access
// to the data on the placeholder node.
vm.$vnode = _parentVnode
// render self
var vnode
try {
vnode = render.call(vm._renderProxy, vm.$createElement)
} catch (e) {
handleError(e, vm, "render function")
// return error render result,
// or previous vnode to prevent render error causing blank component
/* istanbul ignore else */
{
vnode = vm._vnode
}
}
// return empty vnode in case the render function errored out
if (!(vnode instanceof VNode)) {
if (false) {}
vnode = createEmptyVNode()
}
// set parent
vnode.parent = _parentVnode
return vnode
}
// internal render helpers.
// these are exposed on the instance prototype to reduce generated render
// code size.
Vue.prototype._o = markOnce
Vue.prototype._n = toNumber
Vue.prototype._s = toString
Vue.prototype._l = renderList
Vue.prototype._t = renderSlot
Vue.prototype._q = looseEqual
Vue.prototype._i = looseIndexOf
Vue.prototype._m = renderStatic
Vue.prototype._f = resolveFilter
Vue.prototype._k = checkKeyCodes
Vue.prototype._b = bindObjectProps
Vue.prototype._v = createTextVNode
Vue.prototype._e = createEmptyVNode
Vue.prototype._u = resolveScopedSlots
Vue.prototype._g = bindObjectListeners
}
/* */
var uid = 0
function initMixin(Vue) {
Vue.prototype._init = function(options) {
var vm = this
// a uid
vm._uid = uid++
var startTag, endTag
/* istanbul ignore if */
if (false) {}
// a flag to avoid this being observed
vm._isVue = true
// merge options
if (options && options._isComponent) {
// optimize internal component instantiation
// since dynamic options merging is pretty slow, and none of the
// internal component options needs special treatment.
initInternalComponent(vm, options)
} else {
vm.$options = mergeOptions(
resolveConstructorOptions(vm.constructor),
options || {},
vm
)
}
/* istanbul ignore else */
{
vm._renderProxy = vm
}
// expose real self
vm._self = vm
initLifecycle(vm)
initEvents(vm)
initRender(vm)
callHook(vm, "beforeCreate")
initInjections(vm) // resolve injections before data/props
initState(vm)
initProvide(vm) // resolve provide after data/props
callHook(vm, "created")
/* istanbul ignore if */
if (false) {}
if (vm.$options.el) {
vm.$mount(vm.$options.el)
}
}
}
function initInternalComponent(vm, options) {
var opts = (vm.$options = Object.create(vm.constructor.options))
// doing this because it's faster than dynamic enumeration.
opts.parent = options.parent
opts.propsData = options.propsData
opts._parentVnode = options._parentVnode
opts._parentListeners = options._parentListeners
opts._renderChildren = options._renderChildren
opts._componentTag = options._componentTag
opts._parentElm = options._parentElm
opts._refElm = options._refElm
if (options.render) {
opts.render = options.render
opts.staticRenderFns = options.staticRenderFns
}
}
function resolveConstructorOptions(Ctor) {
var options = Ctor.options
if (Ctor.super) {
var superOptions = resolveConstructorOptions(Ctor.super)
var cachedSuperOptions = Ctor.superOptions
if (superOptions !== cachedSuperOptions) {
// super option changed,
// need to resolve new options.
Ctor.superOptions = superOptions
// check if there are any late-modified/attached options (#4976)
var modifiedOptions = resolveModifiedOptions(Ctor)
// update base extend options
if (modifiedOptions) {
extend(Ctor.extendOptions, modifiedOptions)
}
options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions)
if (options.name) {
options.components[options.name] = Ctor
}
}
}
return options
}
function resolveModifiedOptions(Ctor) {
var modified
var latest = Ctor.options
var extended = Ctor.extendOptions
var sealed = Ctor.sealedOptions
for (var key in latest) {
if (latest[key] !== sealed[key]) {
if (!modified) {
modified = {}
}
modified[key] = dedupe(latest[key], extended[key], sealed[key])
}
}
return modified
}
function dedupe(latest, extended, sealed) {
// compare latest and sealed to ensure lifecycle hooks won't be duplicated
// between merges
if (Array.isArray(latest)) {
var res = []
sealed = Array.isArray(sealed) ? sealed : [sealed]
extended = Array.isArray(extended) ? extended : [extended]
for (var i = 0; i < latest.length; i++) {
// push original options and not sealed options to exclude duplicated options
if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
res.push(latest[i])
}
}
return res
} else {
return latest
}
}
function Vue$3(options) {
if (false) {}
this._init(options)
}
initMixin(Vue$3)
stateMixin(Vue$3)
eventsMixin(Vue$3)
lifecycleMixin(Vue$3)
renderMixin(Vue$3)
/* */
function initUse(Vue) {
Vue.use = function(plugin) {
var installedPlugins = this._installedPlugins || (this._installedPlugins = [])
if (installedPlugins.indexOf(plugin) > -1) {
return this
}
// additional parameters
var args = toArray(arguments, 1)
args.unshift(this)
if (typeof plugin.install === "function") {
plugin.install.apply(plugin, args)
} else if (typeof plugin === "function") {
plugin.apply(null, args)
}
installedPlugins.push(plugin)
return this
}
}
/* */
function initMixin$1(Vue) {
Vue.mixin = function(mixin) {
this.options = mergeOptions(this.options, mixin)
return this
}
}
/* */
function initExtend(Vue) {
/**
* Each instance constructor, including Vue, has a unique
* cid. This enables us to create wrapped "child
* constructors" for prototypal inheritance and cache them.
*/
Vue.cid = 0
var cid = 1
/**
* Class inheritance
*/
Vue.extend = function(extendOptions) {
extendOptions = extendOptions || {}
var Super = this
var SuperId = Super.cid
var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {})
if (cachedCtors[SuperId]) {
return cachedCtors[SuperId]
}
var name = extendOptions.name || Super.options.name
var Sub = function VueComponent(options) {
this._init(options)
}
Sub.prototype = Object.create(Super.prototype)
Sub.prototype.constructor = Sub
Sub.cid = cid++
Sub.options = mergeOptions(Super.options, extendOptions)
Sub["super"] = Super
// For props and computed properties, we define the proxy getters on
// the Vue instances at extension time, on the extended prototype. This
// avoids Object.defineProperty calls for each instance created.
if (Sub.options.props) {
initProps$1(Sub)
}
if (Sub.options.computed) {
initComputed$1(Sub)
}
// allow further extension/mixin/plugin usage
Sub.extend = Super.extend
Sub.mixin = Super.mixin
Sub.use = Super.use
// create asset registers, so extended classes
// can have their private assets too.
ASSET_TYPES.forEach(function(type) {
Sub[type] = Super[type]
})
// enable recursive self-lookup
if (name) {
Sub.options.components[name] = Sub
}
// keep a reference to the super options at extension time.
// later at instantiation we can check if Super's options have
// been updated.
Sub.superOptions = Super.options
Sub.extendOptions = extendOptions
Sub.sealedOptions = extend({}, Sub.options)
// cache constructor
cachedCtors[SuperId] = Sub
return Sub
}
}
function initProps$1(Comp) {
var props = Comp.options.props
for (var key in props) {
proxy(Comp.prototype, "_props", key)
}
}
function initComputed$1(Comp) {
var computed = Comp.options.computed
for (var key in computed) {
defineComputed(Comp.prototype, key, computed[key])
}
}
/* */
function initAssetRegisters(Vue) {
/**
* Create asset registration methods.
*/
ASSET_TYPES.forEach(function(type) {
Vue[type] = function(id, definition) {
if (!definition) {
return this.options[type + "s"][id]
} else {
/* istanbul ignore if */
if (type === "component" && isPlainObject(definition)) {
definition.name = definition.name || id
definition = this.options._base.extend(definition)
}
if (type === "directive" && typeof definition === "function") {
definition = {
bind: definition,
update: definition
}
}
this.options[type + "s"][id] = definition
return definition
}
}
})
}
/* */
var patternTypes = [String, RegExp, Array]
function getComponentName(opts) {
return opts && (opts.Ctor.options.name || opts.tag)
}
function matches(pattern, name) {
if (Array.isArray(pattern)) {
return pattern.indexOf(name) > -1
} else if (typeof pattern === "string") {
return pattern.split(",").indexOf(name) > -1
} else if (isRegExp(pattern)) {
return pattern.test(name)
}
/* istanbul ignore next */
return false
}
function pruneCache(cache, current, filter) {
for (var key in cache) {
var cachedNode = cache[key]
if (cachedNode) {
var name = getComponentName(cachedNode.componentOptions)
if (name && !filter(name)) {
if (cachedNode !== current) {
pruneCacheEntry(cachedNode)
}
cache[key] = null
}
}
}
}
function pruneCacheEntry(vnode) {
if (vnode) {
vnode.componentInstance.$destroy()
}
}
var KeepAlive = {
name: "keep-alive",
abstract: true,
props: {
include: patternTypes,
exclude: patternTypes
},
created: function created() {
this.cache = Object.create(null)
},
destroyed: function destroyed() {
var this$1 = this
for (var key in this$1.cache) {
pruneCacheEntry(this$1.cache[key])
}
},
watch: {
include: function include(val) {
pruneCache(this.cache, this._vnode, function(name) {
return matches(val, name)
})
},
exclude: function exclude(val) {
pruneCache(this.cache, this._vnode, function(name) {
return !matches(val, name)
})
}
},
render: function render() {
var vnode = getFirstComponentChild(this.$slots.default)
var componentOptions = vnode && vnode.componentOptions
if (componentOptions) {
// check pattern
var name = getComponentName(componentOptions)
if (
name &&
((this.include && !matches(this.include, name)) ||
(this.exclude && matches(this.exclude, name)))
) {
return vnode
}
var key =
vnode.key == null
? // same constructor may get registered as different local components
// so cid alone is not enough (#3269)
componentOptions.Ctor.cid +
(componentOptions.tag ? "::" + componentOptions.tag : "")
: vnode.key
if (this.cache[key]) {
vnode.componentInstance = this.cache[key].componentInstance
} else {
this.cache[key] = vnode
}
vnode.data.keepAlive = true
}
return vnode
}
}
var builtInComponents = {
KeepAlive: KeepAlive
}
/* */
function initGlobalAPI(Vue) {
// config
var configDef = {}
configDef.get = function() {
return config
}
Object.defineProperty(Vue, "config", configDef)
// exposed util methods.
// NOTE: these are not considered part of the public API - avoid relying on
// them unless you are aware of the risk.
Vue.util = {
warn: warn,
extend: extend,
mergeOptions: mergeOptions,
defineReactive: defineReactive$$1
}
Vue.set = set
Vue.delete = del
Vue.nextTick = nextTick
Vue.options = Object.create(null)
ASSET_TYPES.forEach(function(type) {
Vue.options[type + "s"] = Object.create(null)
})
// this is used to identify the "base" constructor to extend all plain-object
// components with in Weex's multi-instance scenarios.
Vue.options._base = Vue
extend(Vue.options.components, builtInComponents)
initUse(Vue)
initMixin$1(Vue)
initExtend(Vue)
initAssetRegisters(Vue)
}
initGlobalAPI(Vue$3)
Object.defineProperty(Vue$3.prototype, "$isServer", {
get: isServerRendering
})
Object.defineProperty(Vue$3.prototype, "$ssrContext", {
get: function get() {
/* istanbul ignore next */
return this.$vnode && this.$vnode.ssrContext
}
})
Vue$3.version = "2.4.1"
Vue$3.mpvueVersion = "1.0.12"
/* globals renderer */
var isReservedTag = makeMap(
"template,script,style,element,content,slot,link,meta,svg,view," +
"a,div,img,image,text,span,richtext,input,switch,textarea,spinner,select," +
"slider,slider-neighbor,indicator,trisition,trisition-group,canvas," +
"list,cell,header,loading,loading-indicator,refresh,scrollable,scroller," +
"video,web,embed,tabbar,tabheader,datepicker,timepicker,marquee,countdown",
true
)
// these are reserved for web because they are directly compiled away
// during template compilation
var isReservedAttr = makeMap("style,class")
// Elements that you can, intentionally, leave open (and which close themselves)
// more flexable than web
var canBeLeftOpenTag = makeMap(
"web,spinner,switch,video,textarea,canvas," + "indicator,marquee,countdown",
true
)
var isUnaryTag = makeMap("embed,img,image,input,link,meta", true)
function mustUseProp() {
/* console.log('mustUseProp') */
}
function getTagNamespace() {
/* console.log('getTagNamespace') */
}
function isUnknownElement() {
/* console.log('isUnknownElement') */
}
function getComKey(vm) {
return vm && vm.$attrs ? vm.$attrs["mpcomid"] : "0"
}
// 用于小程序的 event type 到 web 的 event
var eventTypeMap = {
tap: ["tap", "click"],
touchstart: ["touchstart"],
touchmove: ["touchmove"],
touchcancel: ["touchcancel"],
touchend: ["touchend"],
longtap: ["longtap"],
input: ["input"],
blur: ["change", "blur"],
submit: ["submit"],
focus: ["focus"],
scrolltoupper: ["scrolltoupper"],
scrolltolower: ["scrolltolower"],
scroll: ["scroll"]
}
/* */
// import { namespaceMap } from 'mp/util/index'
var obj = {}
function createElement$1(tagName, vnode) {
return obj
}
function createElementNS(namespace, tagName) {
return obj
}
function createTextNode(text) {
return obj
}
function createComment(text) {
return obj
}
function insertBefore(parentNode, newNode, referenceNode) {}
function removeChild(node, child) {}
function appendChild(node, child) {}
function parentNode(node) {
return obj
}
function nextSibling(node) {
return obj
}
function tagName(node) {
return "div"
}
function setTextContent(node, text) {
return obj
}
function setAttribute(node, key, val) {
return obj
}
var nodeOps = Object.freeze({
createElement: createElement$1,
createElementNS: createElementNS,
createTextNode: createTextNode,
createComment: createComment,
insertBefore: insertBefore,
removeChild: removeChild,
appendChild: appendChild,
parentNode: parentNode,
nextSibling: nextSibling,
tagName: tagName,
setTextContent: setTextContent,
setAttribute: setAttribute
})
/* */
var ref = {
create: function create(_, vnode) {
registerRef(vnode)
},
update: function update(oldVnode, vnode) {
if (oldVnode.data.ref !== vnode.data.ref) {
registerRef(oldVnode, true)
registerRef(vnode)
}
},
destroy: function destroy(vnode) {
registerRef(vnode, true)
}
}
function registerRef(vnode, isRemoval) {
var key = vnode.data.ref
if (!key) {
return
}
var vm = vnode.context
var ref = vnode.componentInstance || vnode.elm
var refs = vm.$refs
if (isRemoval) {
if (Array.isArray(refs[key])) {
remove(refs[key], ref)
} else if (refs[key] === ref) {
refs[key] = undefined
}
} else {
if (vnode.data.refInFor) {
if (!Array.isArray(refs[key])) {
refs[key] = [ref]
} else if (refs[key].indexOf(ref) < 0) {
// $flow-disable-line
refs[key].push(ref)
}
} else {
refs[key] = ref
}
}
}
/**
* Virtual DOM patching algorithm based on Snabbdom by
* Simon Friis Vindum (@paldepind)
* Licensed under the MIT License
* https://github.com/paldepind/snabbdom/blob/master/LICENSE
*
* modified by Evan You (@yyx990803)
*
/*
* Not type-checking this because this file is perf-critical and the cost
* of making flow understand it is not worth it.
*/
var emptyNode = new VNode("", {}, [])
var hooks = ["create", "activate", "update", "remove", "destroy"]
function sameVnode(a, b) {
return (
a.key === b.key &&
((a.tag === b.tag &&
a.isComment === b.isComment &&
isDef(a.data) === isDef(b.data) &&
sameInputType(a, b)) ||
(isTrue(a.isAsyncPlaceholder) &&
a.asyncFactory === b.asyncFactory &&
isUndef(b.asyncFactory.error)))
)
}
// Some browsers do not support dynamically changing type for <input>
// so they need to be treated as different nodes
function sameInputType(a, b) {
if (a.tag !== "input") {
return true
}
var i
var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type
var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type
return typeA === typeB
}
function createKeyToOldIdx(children, beginIdx, endIdx) {
var i, key
var map = {}
for (i = beginIdx; i <= endIdx; ++i) {
key = children[i].key
if (isDef(key)) {
map[key] = i
}
}
return map
}
function createPatchFunction(backend) {
var i, j
var cbs = {}
var modules = backend.modules
var nodeOps = backend.nodeOps
for (i = 0; i < hooks.length; ++i) {
cbs[hooks[i]] = []
for (j = 0; j < modules.length; ++j) {
if (isDef(modules[j][hooks[i]])) {
cbs[hooks[i]].push(modules[j][hooks[i]])
}
}
}
function emptyNodeAt(elm) {
return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
}
function createRmCb(childElm, listeners) {
function remove$$1() {
if (--remove$$1.listeners === 0) {
removeNode(childElm)
}
}
remove$$1.listeners = listeners
return remove$$1
}
function removeNode(el) {
var parent = nodeOps.parentNode(el)
// element may have already been removed due to v-html / v-text
if (isDef(parent)) {
nodeOps.removeChild(parent, el)
}
}
var inPre = 0
function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested) {
vnode.isRootInsert = !nested // for transition enter check
if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
return
}
var data = vnode.data
var children = vnode.children
var tag = vnode.tag
if (isDef(tag)) {
vnode.elm = vnode.ns
? nodeOps.createElementNS(vnode.ns, tag)
: nodeOps.createElement(tag, vnode)
setScope(vnode)
/* istanbul ignore if */
{
createChildren(vnode, children, insertedVnodeQueue)
if (isDef(data)) {
invokeCreateHooks(vnode, insertedVnodeQueue)
}
insert(parentElm, vnode.elm, refElm)
}
if (false) {}
} else if (isTrue(vnode.isComment)) {
vnode.elm = nodeOps.createComment(vnode.text)
insert(parentElm, vnode.elm, refElm)
} else {
vnode.elm = nodeOps.createTextNode(vnode.text)
insert(parentElm, vnode.elm, refElm)
}
}
function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
var i = vnode.data
if (isDef(i)) {
var isReactivated = isDef(vnode.componentInstance) && i.keepAlive
if (isDef((i = i.hook)) && isDef((i = i.init))) {
i(vnode, false /* hydrating */, parentElm, refElm)
}
// after calling the init hook, if the vnode is a child component
// it should've created a child instance and mounted it. the child
// component also has set the placeholder vnode's elm.
// in that case we can just return the element and be done.
if (isDef(vnode.componentInstance)) {
initComponent(vnode, insertedVnodeQueue)
if (isTrue(isReactivated)) {
reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm)
}
return true
}
}
}
function initComponent(vnode, insertedVnodeQueue) {
if (isDef(vnode.data.pendingInsert)) {
insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert)
vnode.data.pendingInsert = null
}
vnode.elm = vnode.componentInstance.$el
if (isPatchable(vnode)) {
invokeCreateHooks(vnode, insertedVnodeQueue)
setScope(vnode)
} else {
// empty component root.
// skip all element-related modules except for ref (#3455)
registerRef(vnode)
// make sure to invoke the insert hook
insertedVnodeQueue.push(vnode)
}
}
function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
var i
// hack for #4339: a reactivated component with inner transition
// does not trigger because the inner node's created hooks are not called
// again. It's not ideal to involve module-specific logic in here but
// there doesn't seem to be a better way to do it.
var innerNode = vnode
while (innerNode.componentInstance) {
innerNode = innerNode.componentInstance._vnode
if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {
for (i = 0; i < cbs.activate.length; ++i) {
cbs.activate[i](emptyNode, innerNode)
}
insertedVnodeQueue.push(innerNode)
break
}
}
// unlike a newly created component,
// a reactivated keep-alive component doesn't insert itself
insert(parentElm, vnode.elm, refElm)
}
function insert(parent, elm, ref$$1) {
if (isDef(parent)) {
if (isDef(ref$$1)) {
if (ref$$1.parentNode === parent) {
nodeOps.insertBefore(parent, elm, ref$$1)
}
} else {
nodeOps.appendChild(parent, elm)
}
}
}
function createChildren(vnode, children, insertedVnodeQueue) {
if (Array.isArray(children)) {
for (var i = 0; i < children.length; ++i) {
createElm(children[i], insertedVnodeQueue, vnode.elm, null, true)
}
} else if (isPrimitive(vnode.text)) {
nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text))
}
}
function isPatchable(vnode) {
while (vnode.componentInstance) {
vnode = vnode.componentInstance._vnode
}
return isDef(vnode.tag)
}
function invokeCreateHooks(vnode, insertedVnodeQueue) {
for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
cbs.create[i$1](emptyNode, vnode)
}
i = vnode.data.hook // Reuse variable
if (isDef(i)) {
if (isDef(i.create)) {
i.create(emptyNode, vnode)
}
if (isDef(i.insert)) {
insertedVnodeQueue.push(vnode)
}
}
}
// set scope id attribute for scoped CSS.
// this is implemented as a special case to avoid the overhead
// of going through the normal attribute patching process.
function setScope(vnode) {
var i
var ancestor = vnode
while (ancestor) {
if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {
nodeOps.setAttribute(vnode.elm, i, "")
}
ancestor = ancestor.parent
}
// for slot content they should also get the scopeId from the host instance.
if (
isDef((i = activeInstance)) &&
i !== vnode.context &&
isDef((i = i.$options._scopeId))
) {
nodeOps.setAttribute(vnode.elm, i, "")
}
}
function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
for (; startIdx <= endIdx; ++startIdx) {
createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm)
}
}
function invokeDestroyHook(vnode) {
var i, j
var data = vnode.data
if (isDef(data)) {
if (isDef((i = data.hook)) && isDef((i = i.destroy))) {
i(vnode)
}
for (i = 0; i < cbs.destroy.length; ++i) {
cbs.destroy[i](vnode)
}
}
if (isDef((i = vnode.children))) {
for (j = 0; j < vnode.children.length; ++j) {
invokeDestroyHook(vnode.children[j])
}
}
}
function removeVnodes(parentElm, vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx]
if (isDef(ch)) {
if (isDef(ch.tag)) {
removeAndInvokeRemoveHook(ch)
invokeDestroyHook(ch)
} else {
// Text node
removeNode(ch.elm)
}
}
}
}
function removeAndInvokeRemoveHook(vnode, rm) {
if (isDef(rm) || isDef(vnode.data)) {
var i
var listeners = cbs.remove.length + 1
if (isDef(rm)) {
// we have a recursively passed down rm callback
// increase the listeners count
rm.listeners += listeners
} else {
// directly removing
rm = createRmCb(vnode.elm, listeners)
}
// recursively invoke hooks on child component root node
if (
isDef((i = vnode.componentInstance)) &&
isDef((i = i._vnode)) &&
isDef(i.data)
) {
removeAndInvokeRemoveHook(i, rm)
}
for (i = 0; i < cbs.remove.length; ++i) {
cbs.remove[i](vnode, rm)
}
if (isDef((i = vnode.data.hook)) && isDef((i = i.remove))) {
i(vnode, rm)
} else {
rm()
}
} else {
removeNode(vnode.elm)
}
}
function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
var oldStartIdx = 0
var newStartIdx = 0
var oldEndIdx = oldCh.length - 1
var oldStartVnode = oldCh[0]
var oldEndVnode = oldCh[oldEndIdx]
var newEndIdx = newCh.length - 1
var newStartVnode = newCh[0]
var newEndVnode = newCh[newEndIdx]
var oldKeyToIdx, idxInOld, elmToMove, refElm
// removeOnly is a special flag used only by <transition-group>
// to ensure removed elements stay in correct relative positions
// during leaving transitions
var canMove = !removeOnly
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
if (isUndef(oldStartVnode)) {
oldStartVnode = oldCh[++oldStartIdx] // Vnode has been moved left
} else if (isUndef(oldEndVnode)) {
oldEndVnode = oldCh[--oldEndIdx]
} else if (sameVnode(oldStartVnode, newStartVnode)) {
patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue)
oldStartVnode = oldCh[++oldStartIdx]
newStartVnode = newCh[++newStartIdx]
} else if (sameVnode(oldEndVnode, newEndVnode)) {
patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue)
oldEndVnode = oldCh[--oldEndIdx]
newEndVnode = newCh[--newEndIdx]
} else if (sameVnode(oldStartVnode, newEndVnode)) {
// Vnode moved right
patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue)
canMove &&
nodeOps.insertBefore(
parentElm,
oldStartVnode.elm,
nodeOps.nextSibling(oldEndVnode.elm)
)
oldStartVnode = oldCh[++oldStartIdx]
newEndVnode = newCh[--newEndIdx]
} else if (sameVnode(oldEndVnode, newStartVnode)) {
// Vnode moved left
patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue)
canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm)
oldEndVnode = oldCh[--oldEndIdx]
newStartVnode = newCh[++newStartIdx]
} else {
if (isUndef(oldKeyToIdx)) {
oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx)
}
idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null
if (isUndef(idxInOld)) {
// New element
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm)
newStartVnode = newCh[++newStartIdx]
} else {
elmToMove = oldCh[idxInOld]
/* istanbul ignore if */
if (false) {}
if (sameVnode(elmToMove, newStartVnode)) {
patchVnode(elmToMove, newStartVnode, insertedVnodeQueue)
oldCh[idxInOld] = undefined
canMove &&
nodeOps.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm)
newStartVnode = newCh[++newStartIdx]
} else {
// same key but different element. treat as new element
createElm(
newStartVnode,
insertedVnodeQueue,
parentElm,
oldStartVnode.elm
)
newStartVnode = newCh[++newStartIdx]
}
}
}
}
if (oldStartIdx > oldEndIdx) {
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue)
} else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx)
}
}
function patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly) {
if (oldVnode === vnode) {
return
}
var elm = (vnode.elm = oldVnode.elm)
if (isTrue(oldVnode.isAsyncPlaceholder)) {
if (isDef(vnode.asyncFactory.resolved)) {
hydrate(oldVnode.elm, vnode, insertedVnodeQueue)
} else {
vnode.isAsyncPlaceholder = true
}
return
}
// reuse element for static trees.
// note we only do this if the vnode is cloned -
// if the new node is not cloned it means the render functions have been
// reset by the hot-reload-api and we need to do a proper re-render.
if (
isTrue(vnode.isStatic) &&
isTrue(oldVnode.isStatic) &&
vnode.key === oldVnode.key &&
(isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
) {
vnode.componentInstance = oldVnode.componentInstance
return
}
var i
var data = vnode.data
if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {
i(oldVnode, vnode)
}
var oldCh = oldVnode.children
var ch = vnode.children
if (isDef(data) && isPatchable(vnode)) {
for (i = 0; i < cbs.update.length; ++i) {
cbs.update[i](oldVnode, vnode)
}
if (isDef((i = data.hook)) && isDef((i = i.update))) {
i(oldVnode, vnode)
}
}
if (isUndef(vnode.text)) {
if (isDef(oldCh) && isDef(ch)) {
if (oldCh !== ch) {
updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly)
}
} else if (isDef(ch)) {
if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, "")
}
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue)
} else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1)
} else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, "")
}
} else if (oldVnode.text !== vnode.text) {
nodeOps.setTextContent(elm, vnode.text)
}
if (isDef(data)) {
if (isDef((i = data.hook)) && isDef((i = i.postpatch))) {
i(oldVnode, vnode)
}
}
}
function invokeInsertHook(vnode, queue, initial) {
// delay insert hooks for component root nodes, invoke them after the
// element is really inserted
if (isTrue(initial) && isDef(vnode.parent)) {
vnode.parent.data.pendingInsert = queue
} else {
for (var i = 0; i < queue.length; ++i) {
queue[i].data.hook.insert(queue[i])
}
}
}
var bailed = false
// list of modules that can skip create hook during hydration because they
// are already rendered on the client or has no need for initialization
var isRenderedModule = makeMap("attrs,style,class,staticClass,staticStyle,key")
// Note: this is a browser-only function so we can assume elms are DOM nodes.
function hydrate(elm, vnode, insertedVnodeQueue) {
if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
vnode.elm = elm
vnode.isAsyncPlaceholder = true
return true
}
vnode.elm = elm
var tag = vnode.tag
var data = vnode.data
var children = vnode.children
if (isDef(data)) {
if (isDef((i = data.hook)) && isDef((i = i.init))) {
i(vnode, true /* hydrating */)
}
if (isDef((i = vnode.componentInstance))) {
// child component. it should have hydrated its own tree.
initComponent(vnode, insertedVnodeQueue)
return true
}
}
if (isDef(tag)) {
if (isDef(children)) {
// empty element, allow client to pick up and populate children
if (!elm.hasChildNodes()) {
createChildren(vnode, children, insertedVnodeQueue)
} else {
var childrenMatch = true
var childNode = elm.firstChild
for (var i$1 = 0; i$1 < children.length; i$1++) {
if (
!childNode ||
!hydrate(childNode, children[i$1], insertedVnodeQueue)
) {
childrenMatch = false
break
}
childNode = childNode.nextSibling
}
// if childNode is not null, it means the actual childNodes list is
// longer than the virtual children list.
if (!childrenMatch || childNode) {
if (
false
) {}
return false
}
}
}
if (isDef(data)) {
for (var key in data) {
if (!isRenderedModule(key)) {
invokeCreateHooks(vnode, insertedVnodeQueue)
break
}
}
}
} else if (elm.data !== vnode.text) {
elm.data = vnode.text
}
return true
}
return function patch(oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
if (isUndef(vnode)) {
if (isDef(oldVnode)) {
invokeDestroyHook(oldVnode)
}
return
}
var isInitialPatch = false
var insertedVnodeQueue = []
if (isUndef(oldVnode)) {
// empty mount (likely as component), create new root element
isInitialPatch = true
createElm(vnode, insertedVnodeQueue, parentElm, refElm)
} else {
var isRealElement = isDef(oldVnode.nodeType)
if (!isRealElement && sameVnode(oldVnode, vnode)) {
// patch existing root node
patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly)
} else {
if (isRealElement) {
// mounting to a real element
// check if this is server-rendered content and if we can perform
// a successful hydration.
if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
oldVnode.removeAttribute(SSR_ATTR)
hydrating = true
}
if (isTrue(hydrating)) {
if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
invokeInsertHook(vnode, insertedVnodeQueue, true)
return oldVnode
} else {
}
}
// either not server-rendered, or hydration failed.
// create an empty node and replace it
oldVnode = emptyNodeAt(oldVnode)
}
// replacing existing element
var oldElm = oldVnode.elm
var parentElm$1 = nodeOps.parentNode(oldElm)
createElm(
vnode,
insertedVnodeQueue,
// extremely rare edge case: do not insert if old element is in a
// leaving transition. Only happens when combining transition +
// keep-alive + HOCs. (#4590)
oldElm._leaveCb ? null : parentElm$1,
nodeOps.nextSibling(oldElm)
)
if (isDef(vnode.parent)) {
// component root element replaced.
// update parent placeholder node element, recursively
var ancestor = vnode.parent
while (ancestor) {
ancestor.elm = vnode.elm
ancestor = ancestor.parent
}
if (isPatchable(vnode)) {
for (var i = 0; i < cbs.create.length; ++i) {
cbs.create[i](emptyNode, vnode.parent)
}
}
}
if (isDef(parentElm$1)) {
removeVnodes(parentElm$1, [oldVnode], 0, 0)
} else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode)
}
}
}
invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch)
return vnode.elm
}
}
/* */
// import baseModules from 'core/vdom/modules/index'
// const platformModules = []
// import platformModules from 'web/runtime/modules/index'
// the directive module should be applied last, after all
// built-in modules have been applied.
// const modules = platformModules.concat(baseModules)
var modules = [ref]
var corePatch = createPatchFunction({
nodeOps: nodeOps,
modules: modules
})
function patch() {
corePatch.apply(this, arguments)
this.$updateDataToMP()
}
function callHook$1(vm, hook, params) {
var handlers = vm.$options[hook]
if (hook === "onError" && handlers) {
handlers = [handlers]
}
var ret
if (handlers) {
for (var i = 0, j = handlers.length; i < j; i++) {
try {
ret = handlers[i].call(vm, params)
} catch (e) {
handleError(e, vm, hook + " hook")
}
}
}
if (vm._hasHookEvent) {
vm.$emit("hook:" + hook)
}
// for child
if (vm.$children.length) {
vm.$children.forEach(function(v) {
return callHook$1(v, hook, params)
})
}
return ret
}
// mpType 小程序实例的类型,可能的值是 'app', 'page'
// rootVueVM 是 vue 的根组件实例,子组件中访问 this.$root 可得
function getGlobalData(app, rootVueVM) {
var mp = rootVueVM.$mp
if (app && app.globalData) {
mp.appOptions = app.globalData.appOptions
}
}
// 格式化 properties 属性,并给每个属性加上 observer 方法
// properties 的 一些类型 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/component.html
// properties: {
// paramA: Number,
// myProperty: { // 属性名
// type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
// value: '', // 属性初始值(可选),如果未指定则会根据类型选择一个
// observer: function(newVal, oldVal, changedPath) {
// // 属性被改变时执行的函数(可选),也可以写成在methods段中定义的方法名字符串, 如:'_propertyChange'
// // 通常 newVal 就是新设置的数据, oldVal 是旧数据
// }
// },
// }
// props 的一些类型 https://cn.vuejs.org/v2/guide/components-props.html#ad
// props: {
// // 基础的类型检查 (`null` 匹配任何类型)
// propA: Number,
// // 多个可能的类型
// propB: [String, Number],
// // 必填的字符串
// propC: {
// type: String,
// required: true
// },
// // 带有默认值的数字
// propD: {
// type: Number,
// default: 100
// },
// // 带有默认值的对象
// propE: {
// type: Object,
// // 对象或数组且一定会从一个工厂函数返回默认值
// default: function () {
// return { message: 'hello' }
// }
// },
// // 自定义验证函数
// propF: {
// validator: function (value) {
// // 这个值必须匹配下列字符串中的一个
// return ['success', 'warning', 'danger'].indexOf(value) !== -1
// }
// }
// }
// core/util/options
function normalizeProps$1(props, res, vm) {
if (!props) {
return
}
var i, val, name
if (Array.isArray(props)) {
i = props.length
while (i--) {
val = props[i]
if (typeof val === "string") {
name = camelize(val)
res[name] = {
type: null
}
} else {
}
}
} else if (isPlainObject(props)) {
for (var key in props) {
val = props[key]
name = camelize(key)
res[name] = isPlainObject(val)
? val
: {
type: val
}
}
}
// fix vueProps to properties
for (var key$1 in res) {
if (res.hasOwnProperty(key$1)) {
var item = res[key$1]
if (item.default) {
item.value = item.default
}
var oldObserver = item.observer
item.observer = function(newVal, oldVal) {
vm[name] = newVal
// 先修改值再触发原始的 observer,跟 watch 行为保持一致
if (typeof oldObserver === "function") {
oldObserver.call(vm, newVal, oldVal)
}
}
}
}
return res
}
function normalizeProperties(vm) {
var properties = vm.$options.properties
var vueProps = vm.$options.props
var res = {}
normalizeProps$1(properties, res, vm)
normalizeProps$1(vueProps, res, vm)
return res
}
/**
* 把 properties 中的属性 proxy 到 vm 上
*/
function initMpProps(vm) {
var mpProps = (vm._mpProps = {})
var keys = Object.keys(vm.$options.properties || {})
keys.forEach(function(key) {
if (!(key in vm)) {
proxy(vm, "_mpProps", key)
mpProps[key] = undefined // for observe
}
})
observe(mpProps, true)
}
function initMP(mpType, next) {
var rootVueVM = this.$root
if (!rootVueVM.$mp) {
rootVueVM.$mp = {}
}
var mp = rootVueVM.$mp
// Please do not register multiple Pages
// if (mp.registered) {
if (mp.status) {
// 处理子组件的小程序生命周期
if (mpType === "app") {
callHook$1(this, "onLaunch", mp.appOptions)
} else {
callHook$1(this, "onLoad", mp.query)
// callHook$1(this, "onReady") // 避免 onReady触发两次
}
return next()
}
// mp.registered = true
mp.mpType = mpType
mp.status = "register"
if (mpType === "app") {
global.App({
// 页面的初始数据
globalData: {
appOptions: {}
},
handleProxy: function handleProxy(e) {
return rootVueVM.$handleProxyWithVue(e)
},
// Do something initial when launch.
onLaunch: function onLaunch(options) {
if (options === void 0) options = {}
mp.app = this
mp.status = "launch"
this.globalData.appOptions = mp.appOptions = options
callHook$1(rootVueVM, "onLaunch", options)
next()
},
// Do something when app show.
onShow: function onShow(options) {
if (options === void 0) options = {}
mp.status = "show"
this.globalData.appOptions = mp.appOptions = options
callHook$1(rootVueVM, "onShow", options)
},
// Do something when app hide.
onHide: function onHide() {
mp.status = "hide"
callHook$1(rootVueVM, "onHide")
},
onError: function onError(err) {
callHook$1(rootVueVM, "onError", err)
},
//fixed by xxxxxx
onUniNViewMessage: function onUniNViewMessage(e) {
callHook$1(rootVueVM, "onUniNViewMessage", e)
}
})
} else if (mpType === "component") {
initMpProps(rootVueVM)
global.Component({
// 小程序原生的组件属性
properties: normalizeProperties(rootVueVM),
// 页面的初始数据
data: {
$root: {}
},
methods: {
handleProxy: function handleProxy(e) {
return rootVueVM.$handleProxyWithVue(e)
}
},
// mp lifecycle for vue
// 组件生命周期函数,在组件实例进入页面节点树时执行,注意此时不能调用 setData
created: function created() {
mp.status = "created"
mp.page = this
},
// 组件生命周期函数,在组件实例进入页面节点树时执行
attached: function attached() {
mp.status = "attached"
callHook$1(rootVueVM, "attached")
},
// 组件生命周期函数,在组件布局完成后执行,此时可以获取节点信息(使用 SelectorQuery )
ready: function ready() {
mp.status = "ready"
callHook$1(rootVueVM, "ready")
next()
// 只有页面需要 setData
rootVueVM.$nextTick(function() {
rootVueVM._initDataToMP()
})
},
// 组件生命周期函数,在组件实例被移动到节点树另一个位置时执行
moved: function moved() {
callHook$1(rootVueVM, "moved")
},
// 组件生命周期函数,在组件实例被从页面节点树移除时执行
detached: function detached() {
mp.status = "detached"
callHook$1(rootVueVM, "detached")
}
})
} else {
var app = global.getApp()
global.Page({
// 页面的初始数据
data: {
$root: {}
},
handleProxy: function handleProxy(e) {
return rootVueVM.$handleProxyWithVue(e)
},
// mp lifecycle for vue
// 生命周期函数--监听页面加载
onLoad: function onLoad(query) {
rootVueVM.__wxWebviewId__ = this.__wxWebviewId__//fixed by xxxxxx(createIntersectionObserver)
mp.page = this
mp.query = query
mp.status = "load"
getGlobalData(app, rootVueVM)
//仅load时重置数据
if (rootVueVM.$options && typeof rootVueVM.$options.data === "function") {
Object.assign(rootVueVM.$data, rootVueVM.$options.data())
}
callHook$1(rootVueVM, "onLoad", query)
},
// 生命周期函数--监听页面显示
onShow: function onShow() {
rootVueVM.__wxWebviewId__ = this.__wxWebviewId__//fixed by xxxxxx(createIntersectionObserver)
mp.page = this
mp.status = "show"
callHook$1(rootVueVM, "onShow")
// // 只有页面需要 setData
rootVueVM.$nextTick(function () {
rootVueVM._initDataToMP();
});
},
// 生命周期函数--监听页面初次渲染完成
onReady: function onReady() {
mp.status = "ready"
callHook$1(rootVueVM, "onReady")
next()
},
// 生命周期函数--监听页面隐藏
onHide: function onHide() {
mp.status = "hide"
callHook$1(rootVueVM, "onHide")
},
// 生命周期函数--监听页面卸载
onUnload: function onUnload() {
mp.status = "unload"
callHook$1(rootVueVM, "onUnload")
mp.page = null
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function onPullDownRefresh() {
callHook$1(rootVueVM, "onPullDownRefresh")
},
// 页面上拉触底事件的处理函数
onReachBottom: function onReachBottom() {
callHook$1(rootVueVM, "onReachBottom")
},
// 用户点击右上角分享
onShareAppMessage: rootVueVM.$options.onShareAppMessage
? function(options) {
return callHook$1(rootVueVM, "onShareAppMessage", options)
}
: null,
// Do something when page scroll
onPageScroll: function onPageScroll(options) {
callHook$1(rootVueVM, "onPageScroll", options)
},
// 当前是 tab 页时,点击 tab 时触发
onTabItemTap: function onTabItemTap(options) {
callHook$1(rootVueVM, "onTabItemTap", options)
}
})
}
}
// 节流方法,性能优化
// 全局的命名约定,为了节省编译的包大小一律采取形象的缩写,说明如下。
// $c === $child
// $k === $comKey
// 新型的被拍平的数据结构
// {
// $root: {
// '1-1'{
// // ... data
// },
// '1.2-1': {
// // ... data1
// },
// '1.2-2': {
// // ... data2
// }
// }
// }
function getVmData(vm) {
// 确保当前 vm 所有数据被同步
var dataKeys = [].concat(
Object.keys(vm._data || {}),
Object.keys(vm._props || {}),
Object.keys(vm._mpProps || {}),
Object.keys(vm._computedWatchers || {})
)
return dataKeys.reduce(function(res, key) {
res[key] = vm[key]
return res
}, {})
}
function getParentComKey(vm, res) {
if (res === void 0) res = []
var ref = vm || {}
var $parent = ref.$parent
if (!$parent) {
return res
}
res.unshift(getComKey($parent))
if ($parent.$parent) {
return getParentComKey($parent, res)
}
return res
}
function formatVmData(vm) {
var $p = getParentComKey(vm).join(",")
var $k = $p + ($p ? "," : "") + getComKey(vm)
// getVmData 这儿获取当前组件内的所有数据,包含 props、computed 的数据
// 改动 vue.runtime 所获的的核心能力
var data = Object.assign(getVmData(vm), {
$k: $k,
$kk: $k + ",",
$p: $p
})
var key = "$root." + $k
var res = {}
res[key] = data
return res
}
function collectVmData(vm, res) {
if (res === void 0) res = {}
var vms = vm.$children
if (vms && vms.length) {
vms.forEach(function(v) {
return collectVmData(v, res)
})
}
return Object.assign(res, formatVmData(vm))
}
/**
* 频率控制 返回函数连续调用时,func 执行频率限定为 次 / wait
* 自动合并 data
*
* @param {function} func 传入函数
* @param {number} wait 表示时间窗口的间隔
* @param {object} options 如果想忽略开始边界上的调用,传入{leading: false}。
* 如果想忽略结尾边界上的调用,传入{trailing: false}
* @return {function} 返回客户调用函数
*/
function throttle(func, wait, options) {
var context, args, result
var timeout = null
// 上次执行时间点
var previous = 0
if (!options) {
options = {}
}
// 延迟执行函数
function later() {
// 若设定了开始边界不执行选项,上次执行时间始终为0
previous = options.leading === false ? 0 : Date.now()
timeout = null
result = func.apply(context, args)
if (!timeout) {
context = args = null
}
}
return function(handle, data) {
var now = Date.now()
// 首次执行时,如果设定了开始边界不执行选项,将上次执行时间设定为当前时间。
if (!previous && options.leading === false) {
previous = now
}
// 延迟执行时间间隔
var remaining = wait - (now - previous)
context = this
args = args ? [handle, Object.assign(args[1], data)] : [handle, data]
// 延迟时间间隔remaining小于等于0,表示上次执行至此所间隔时间已经超过一个时间窗口
// remaining大于时间窗口wait,表示客户端系统时间被调整过
if (remaining <= 0 || remaining > wait) {
clearTimeout(timeout)
timeout = null
previous = now
result = func.apply(context, args)
if (!timeout) {
context = args = null
}
// 如果延迟执行不存在,且没有设定结尾边界不执行选项
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining)
}
return result
}
}
// 优化频繁的 setData: https://mp.weixin.qq.com/debug/wxadoc/dev/framework/performance/tips.html
var throttleSetData = throttle(function(handle, data) {
handle(data)
}, 50)
function getPage(vm) {
var rootVueVM = vm.$root
var ref = rootVueVM.$mp || {}
var mpType = ref.mpType
if (mpType === void 0) mpType = ""
var page = ref.page
// 优化后台态页面进行 setData: https://mp.weixin.qq.com/debug/wxadoc/dev/framework/performance/tips.html
if (mpType === "app" || !page || typeof page.setData !== "function") {
return
}
return page
}
// 优化每次 setData 都传递大量新数据
function updateDataToMP() {
var page = getPage(this)
if (!page) {
return
}
var data = JSON.parse(JSON.stringify(formatVmData(this)))
//fixed by xxxxxx
throttleSetData(page.setData.bind(page), diff(data, page.data))
}
function initDataToMP() {
var page = getPage(this)
if (!page) {
return
}
var data = collectVmData(this.$root)
//fixed by xxxxxx
page.setData(JSON.parse(JSON.stringify(data)))
}
function getVM(vm, comkeys) {
if (comkeys === void 0) comkeys = []
var keys = comkeys.slice(1)
if (!keys.length) {
return vm
}
return keys.reduce(function(res, key) {
var len = res.$children.length
for (var i = 0; i < len; i++) {
var v = res.$children[i]
var k = getComKey(v)
if (k === key) {
res = v
return res
}
}
return res
}, vm)
}
function getHandle(vnode, eventid, eventTypes) {
if (eventTypes === void 0) eventTypes = []
var res = []
if (!vnode || !vnode.tag) {
return res
}
var ref = vnode || {}
var data = ref.data
if (data === void 0) data = {}
var children = ref.children
if (children === void 0) children = []
var componentInstance = ref.componentInstance
if (componentInstance) {
// 增加 slot 情况的处理
// Object.values 会多增加几行编译后的代码
Object.keys(componentInstance.$slots).forEach(function(slotKey) {
var slot = componentInstance.$slots[slotKey]
var slots = Array.isArray(slot) ? slot : [slot]
slots.forEach(function(node) {
res = res.concat(getHandle(node, eventid, eventTypes))
})
})
} else {
// 避免遍历超出当前组件的 vm
children.forEach(function(node) {
res = res.concat(getHandle(node, eventid, eventTypes))
})
}
var attrs = data.attrs
var on = data.on
if (attrs && on && attrs["eventid"] === eventid) {
eventTypes.forEach(function(et) {
var h = on[et]
if (typeof h === "function") {
res.push(h)
} else if (Array.isArray(h)) {
res = res.concat(h)
}
})
return res
}
return res
}
function getWebEventByMP(e) {
var type = e.type
var timeStamp = e.timeStamp
var touches = e.touches
var detail = e.detail
if (detail === void 0) detail = {}
var target = e.target
if (target === void 0) target = {}
var currentTarget = e.currentTarget
if (currentTarget === void 0) currentTarget = {}
var x = detail.x
var y = detail.y
var event = {
mp: e,
type: type,
timeStamp: timeStamp,
x: x,
y: y,
target: Object.assign({}, target, detail),
detail: detail, //fixed by xxxxxx
currentTarget: currentTarget,
stopPropagation: noop,
preventDefault: noop
}
if (touches && touches.length) {
Object.assign(event, touches[0])
event.touches = touches
}
return event
}
function handleProxyWithVue(e) {
var rootVueVM = this.$root
var type = e.type
var target = e.target
if (target === void 0) target = {}
var currentTarget = e.currentTarget
var ref = currentTarget || target
var dataset = ref.dataset
if (dataset === void 0) dataset = {}
var comkey = dataset.comkey
if (comkey === void 0) comkey = ""
var eventid = dataset.eventid
var vm = getVM(rootVueVM, comkey.split(","))
if (!vm) {
return
}
var webEventTypes = eventTypeMap[type] || [type]
var handles = getHandle(vm._vnode, eventid, webEventTypes)
// TODO, enevt 还需要处理更多
// https://developer.mozilla.org/zh-CN/docs/Web/API/Event
if (handles.length) {
var event = getWebEventByMP(e)
if (handles.length === 1) {
var result = handles[0](event)
return result
}
handles.forEach(function(h) {
return h(event)
})
}
}
// for platforms
// import config from 'core/config'
// install platform specific utils
Vue$3.config.mustUseProp = mustUseProp
Vue$3.config.isReservedTag = isReservedTag
Vue$3.config.isReservedAttr = isReservedAttr
Vue$3.config.getTagNamespace = getTagNamespace
Vue$3.config.isUnknownElement = isUnknownElement
// install platform patch function
Vue$3.prototype.__patch__ = patch
// public mount method
Vue$3.prototype.$mount = function(el, hydrating) {
var this$1 = this
// el = el && inBrowser ? query(el) : undefined
// return mountComponent(this, el, hydrating)
// 初始化小程序生命周期相关
var options = this.$options
if (options && (options.render || options.mpType)) {
var mpType = options.mpType
if (mpType === void 0) mpType = "page"
return this._initMP(mpType, function() {
return mountComponent(this$1, undefined, undefined)
})
} else {
return mountComponent(this, undefined, undefined)
}
}
// for mp
Vue$3.prototype._initMP = initMP
Vue$3.prototype.$updateDataToMP = updateDataToMP
Vue$3.prototype._initDataToMP = initDataToMP
Vue$3.prototype.$handleProxyWithVue = handleProxyWithVue
/* */
return Vue$3
})
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js":
/*!********************************************************************!*\
!*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***!
\********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.
function normalizeComponent (
scriptExports,
render,
staticRenderFns,
functionalTemplate,
injectStyles,
scopeId,
moduleIdentifier, /* server only */
shadowMode /* vue-cli only */
) {
// Vue.extend constructor export interop
var options = typeof scriptExports === 'function'
? scriptExports.options
: scriptExports
// render functions
if (render) {
options.render = render
options.staticRenderFns = staticRenderFns
options._compiled = true
}
// functional template
if (functionalTemplate) {
options.functional = true
}
// scopedId
if (scopeId) {
options._scopeId = 'data-v-' + scopeId
}
var hook
if (moduleIdentifier) { // server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__
}
// inject component styles
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
}
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook
} else if (injectStyles) {
hook = shadowMode
? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
: injectStyles
}
if (hook) {
if (options.functional) {
// for template-only hot-reload because in that case the render fn doesn't
// go through the normalizer
options._injectStyles = hook
// register for functioal component in vue file
var originalRender = options.render
options.render = function renderWithStyleInjection (h, context) {
hook.call(context)
return originalRender(h, context)
}
} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate
options.beforeCreate = existing
? [].concat(existing, hook)
: [hook]
}
}
return {
exports: scriptExports,
options: options
}
}
/***/ }),
/***/ "./node_modules/webpack/buildin/global.js":
/*!***********************************!*\
!*** (webpack)/buildin/global.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/***/ "E:\\appImg\\app\\pages.json":
/*!********************************!*\
!*** E:/appImg/app/pages.json ***!
\********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/***/ })
}]);
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map